diff --git a/package.json b/package.json index 8e2a1dd..88c5943 100644 --- a/package.json +++ b/package.json @@ -35,5 +35,9 @@ "url": "https://github.com/DJj123dj/open-ticket/issues", "email": "support@dj-dj.be" }, - "homepage": "https://openticket.dj-dj.be" -} + "homepage": "https://openticket.dj-dj.be", + "imports": { + "#opendiscord":"./dist/src/index.js", + "#opendiscord-types":"./dist/src/core/api/api.js" + } +} \ No newline at end of file diff --git a/plugins/example-plugin/index.ts b/plugins/example-plugin/index.ts index ec70562..fce3aac 100644 --- a/plugins/example-plugin/index.ts +++ b/plugins/example-plugin/index.ts @@ -1,4 +1,4 @@ -import {api, openticket, utilities} from "../../src/index" +import {api, openticket, utilities} from "#opendiscord" import * as discord from "discord.js" ///////////////////////////////////////////// @@ -9,7 +9,7 @@ import * as discord from "discord.js" if (utilities.project != "openticket") throw new api.ODPluginError("This plugin only works in Open Ticket!") //Add Typescript autocomplete support for plugin data. (!!!OPTIONAL!!!) -declare module "../../src/core/api/api.js" { +declare module "#opendiscord-types" { export interface ODConfigManagerIds_Default { "example-plugin:config":api.ODJsonConfig } diff --git a/tsconfig.json b/tsconfig.json index 50bcbcf..95a1996 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,10 +1,7 @@ { "compilerOptions": { "target": "ES2022", - "rootDirs":[ - "./src", - "./plugins" - ], + "rootDir":"./", "outDir": "./dist/", "module": "NodeNext", "moduleResolution": "NodeNext",