trivious 2.3.6 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/features/client/client.types.d.ts +14 -1
- package/dist/features/client/deploy.client.d.ts +1 -1
- package/dist/features/client/deploy.client.js +1 -1
- package/dist/features/client/deploy.client.js.map +1 -1
- package/dist/features/client/logger.js +4 -5
- package/dist/features/client/logger.js.map +1 -1
- package/dist/features/client/trivious.client.d.ts +1 -1
- package/dist/features/client/trivious.client.js +11 -8
- package/dist/features/client/trivious.client.js.map +1 -1
- package/dist/features/commands/builders.commands.d.ts +3 -2
- package/dist/features/commands/builders.commands.js +9 -0
- package/dist/features/commands/builders.commands.js.map +1 -1
- package/dist/features/commands/commands.types.d.ts +1 -1
- package/dist/features/commands/handlers/message.commands.d.ts +15 -0
- package/dist/features/commands/handlers/message.commands.js +109 -0
- package/dist/features/commands/handlers/message.commands.js.map +1 -0
- package/dist/features/commands/handlers/slash.commands.d.ts +9 -0
- package/dist/features/commands/handlers/slash.commands.js +74 -0
- package/dist/features/commands/handlers/slash.commands.js.map +1 -0
- package/dist/features/commands/methods.commands.d.ts +3 -4
- package/dist/features/commands/methods.commands.js +0 -70
- package/dist/features/commands/methods.commands.js.map +1 -1
- package/dist/features/commands/presets/help.d.ts +13 -0
- package/dist/features/commands/presets/help.js +40 -0
- package/dist/features/commands/presets/help.js.map +1 -0
- package/dist/features/commands/registry.commands.d.ts +1 -5
- package/dist/features/commands/registry.commands.js +44 -4
- package/dist/features/commands/registry.commands.js.map +1 -1
- package/dist/features/commands/utility.d.ts +12 -0
- package/dist/features/commands/utility.js +31 -0
- package/dist/features/commands/utility.js.map +1 -0
- package/dist/features/components/builders.components.d.ts +1 -1
- package/dist/features/components/builders.components.js +1 -1
- package/dist/features/components/builders.components.js.map +1 -1
- package/dist/features/components/components.types.d.ts +1 -1
- package/dist/features/components/components.types.js.map +1 -1
- package/dist/features/components/registry.components.d.ts +1 -5
- package/dist/features/components/registry.components.js +3 -3
- package/dist/features/components/registry.components.js.map +1 -1
- package/dist/features/customId/customid.types.d.ts +1 -1
- package/dist/features/customId/methods.customid.d.ts +1 -1
- package/dist/features/customId/methods.customid.js +1 -1
- package/dist/features/customId/methods.customid.js.map +1 -1
- package/dist/features/events/events.types.d.ts +1 -1
- package/dist/features/events/presets/clientReady.d.ts +1 -1
- package/dist/features/events/presets/clientReady.js.map +1 -1
- package/dist/features/events/presets/interactionCreate.d.ts +2 -1
- package/dist/features/events/presets/interactionCreate.js +9 -4
- package/dist/features/events/presets/interactionCreate.js.map +1 -1
- package/dist/features/events/presets/messageCreate.d.ts +13 -0
- package/dist/features/events/presets/messageCreate.js +128 -0
- package/dist/features/events/presets/messageCreate.js.map +1 -0
- package/dist/features/events/registry.events.d.ts +1 -6
- package/dist/features/events/registry.events.js +16 -3
- package/dist/features/events/registry.events.js.map +1 -1
- package/dist/features/modules/modules.types.d.ts +1 -1
- package/dist/features/modules/registry.modules.d.ts +1 -6
- package/dist/features/modules/registry.modules.js +2 -2
- package/dist/features/modules/registry.modules.js.map +1 -1
- package/dist/features/permissions/methods.permissions.d.ts +3 -3
- package/dist/features/permissions/methods.permissions.js +1 -0
- package/dist/features/permissions/methods.permissions.js.map +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/dist/{modules.types-D-tuJArP.d.ts → modules.types-BgGFvIsW.d.ts} +87 -7
- package/dist/shared/registries.d.ts +1 -5
- package/dist/shared/registries.js +4 -4
- package/dist/shared/registries.js.map +1 -1
- package/dist/shared/typings.d.ts +2 -2
- package/dist/shared/typings.js +8 -8
- package/dist/shared/typings.js.map +1 -1
- package/dist/utility/errors.d.ts +1 -1
- package/dist/utility/errors.js.map +1 -1
- package/dist/utility/functions.d.ts +1 -1
- package/dist/utility/functions.js.map +1 -1
- package/package.json +16 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utility/functions.ts"],"sourcesContent":["import { promises as fs } from \"fs\";\nimport path from \"path\";\nimport { pathToFileURL } from \"url\";\n\nconst fileCache = new Map<string, Promise<any | null>>();\nexport function importFile<T>(filePath: string) {\n\tif (filePath.endsWith(\".d.ts\") || filePath.endsWith(\".js.map\")) return null;\n\tconst absolutePath = path.resolve(filePath);\n\tif (fileCache.has(absolutePath)) return fileCache.get(absolutePath)!;\n\n\tconst processPromise = (async () => {\n\t\ttry {\n\t\t\tconst { default: file } = await import(pathToFileURL(absolutePath).href);\n\t\t\tif (!file) return null;\n\n\t\t\tconst imports = file.default || file;\n\t\t\tif (typeof imports === \"function\" && imports.prototype) return new imports() as T;\n\t\t\tif (typeof imports === \"object\" && imports !== null) {\n\t\t\t\tif (Object.keys(imports).length === 0) return null;\n\t\t\t\treturn imports as T;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t} catch (err: any) {\n\t\t\tconsole.warn(`[Trivious] Error while import file ${filePath}`, err);\n\t\t\treturn null;\n\t\t}\n\t})();\n\n\tfileCache.set(absolutePath, processPromise);\n\tprocessPromise.then((result) => {\n\t\tif (result === null) fileCache.delete(absolutePath);\n\t});\n\treturn processPromise;\n}\n\nexport function clearFileImportsCache() {\n\tfileCache.clear();\n}\n\nexport async function exists(path: string) {\n\ttry {\n\t\tawait fs.access(path);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n"],"mappings":"AAAA,SAAS,YAAY,UAAU;AAC/B,OAAO,UAAU;AACjB,SAAS,qBAAqB;AAE9B,MAAM,YAAY,oBAAI,IAAiC;AAChD,SAAS,WAAc,
|
|
1
|
+
{"version":3,"sources":["../../src/utility/functions.ts"],"sourcesContent":["import { promises as fs } from \"fs\";\nimport path from \"path\";\nimport { pathToFileURL } from \"url\";\n\nconst fileCache = new Map<string, Promise<any | null>>();\nexport function importFile<T>(filePath: string): Promise<T | null> | null {\n\tif (filePath.endsWith(\".d.ts\") || filePath.endsWith(\".js.map\")) return null;\n\tconst absolutePath = path.resolve(filePath);\n\tif (fileCache.has(absolutePath)) return fileCache.get(absolutePath)!;\n\n\tconst processPromise = (async () => {\n\t\ttry {\n\t\t\tconst { default: file } = await import(pathToFileURL(absolutePath).href);\n\t\t\tif (!file) return null;\n\n\t\t\tconst imports = file.default || file;\n\t\t\tif (typeof imports === \"function\" && imports.prototype) return new imports() as T;\n\t\t\tif (typeof imports === \"object\" && imports !== null) {\n\t\t\t\tif (Object.keys(imports).length === 0) return null;\n\t\t\t\treturn imports as T;\n\t\t\t}\n\n\t\t\treturn null;\n\t\t} catch (err: any) {\n\t\t\tconsole.warn(`[Trivious] Error while import file ${filePath}`, err);\n\t\t\treturn null;\n\t\t}\n\t})();\n\n\tfileCache.set(absolutePath, processPromise);\n\tprocessPromise.then((result) => {\n\t\tif (result === null) fileCache.delete(absolutePath);\n\t});\n\treturn processPromise;\n}\n\nexport function clearFileImportsCache() {\n\tfileCache.clear();\n}\n\nexport async function exists(path: string) {\n\ttry {\n\t\tawait fs.access(path);\n\t\treturn true;\n\t} catch {\n\t\treturn false;\n\t}\n}\n"],"mappings":"AAAA,SAAS,YAAY,UAAU;AAC/B,OAAO,UAAU;AACjB,SAAS,qBAAqB;AAE9B,MAAM,YAAY,oBAAI,IAAiC;AAChD,SAAS,WAAc,UAA4C;AACzE,MAAI,SAAS,SAAS,OAAO,KAAK,SAAS,SAAS,SAAS,EAAG,QAAO;AACvE,QAAM,eAAe,KAAK,QAAQ,QAAQ;AAC1C,MAAI,UAAU,IAAI,YAAY,EAAG,QAAO,UAAU,IAAI,YAAY;AAElE,QAAM,kBAAkB,YAAY;AACnC,QAAI;AACH,YAAM,EAAE,SAAS,KAAK,IAAI,MAAM,OAAO,cAAc,YAAY,EAAE;AACnE,UAAI,CAAC,KAAM,QAAO;AAElB,YAAM,UAAU,KAAK,WAAW;AAChC,UAAI,OAAO,YAAY,cAAc,QAAQ,UAAW,QAAO,IAAI,QAAQ;AAC3E,UAAI,OAAO,YAAY,YAAY,YAAY,MAAM;AACpD,YAAI,OAAO,KAAK,OAAO,EAAE,WAAW,EAAG,QAAO;AAC9C,eAAO;AAAA,MACR;AAEA,aAAO;AAAA,IACR,SAAS,KAAU;AAClB,cAAQ,KAAK,sCAAsC,QAAQ,IAAI,GAAG;AAClE,aAAO;AAAA,IACR;AAAA,EACD,GAAG;AAEH,YAAU,IAAI,cAAc,cAAc;AAC1C,iBAAe,KAAK,CAAC,WAAW;AAC/B,QAAI,WAAW,KAAM,WAAU,OAAO,YAAY;AAAA,EACnD,CAAC;AACD,SAAO;AACR;AAEO,SAAS,wBAAwB;AACvC,YAAU,MAAM;AACjB;AAEA,eAAsB,OAAOA,OAAc;AAC1C,MAAI;AACH,UAAM,GAAG,OAAOA,KAAI;AACpB,WAAO;AAAA,EACR,QAAQ;AACP,WAAO;AAAA,EACR;AACD;","names":["path"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "trivious",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"discord-bot",
|
|
@@ -15,16 +15,24 @@
|
|
|
15
15
|
"typescript-discord"
|
|
16
16
|
],
|
|
17
17
|
"license": "Apache-2.0",
|
|
18
|
+
"packageManager": "pnpm@11.20.0",
|
|
18
19
|
"publishConfig": {
|
|
19
20
|
"access": "public"
|
|
20
21
|
},
|
|
21
22
|
"main": "./dist/index.cjs",
|
|
22
23
|
"types": "./dist/index.d.ts",
|
|
24
|
+
"imports": {
|
|
25
|
+
"#typings": "./lib/shared/typings.js",
|
|
26
|
+
"#trivious": "./lib/index.js",
|
|
27
|
+
"#trivious/*": "./lib/*",
|
|
28
|
+
"#shared/*": "./lib/shared/*",
|
|
29
|
+
"#feature/*": "./lib/features/*",
|
|
30
|
+
"#utility/*": "./lib/utility/*"
|
|
31
|
+
},
|
|
23
32
|
"exports": {
|
|
24
33
|
".": {
|
|
25
34
|
"types": "./dist/index.d.ts",
|
|
26
35
|
"import": "./dist/index.js",
|
|
27
|
-
"require": "./dist/index.cjs",
|
|
28
36
|
"default": "./dist/index.js"
|
|
29
37
|
}
|
|
30
38
|
},
|
|
@@ -40,12 +48,11 @@
|
|
|
40
48
|
"url": "https://github.com/commonly-ts/trivious/issues"
|
|
41
49
|
},
|
|
42
50
|
"scripts": {
|
|
43
|
-
"build": "tsup
|
|
44
|
-
"lint": "eslint --fix src",
|
|
51
|
+
"build": "tsup",
|
|
45
52
|
"format": "prettier --write src",
|
|
46
53
|
"typecheck": "tsc --noEmit",
|
|
47
54
|
"test": "vitest",
|
|
48
|
-
"dev": "tsx dev/index.ts",
|
|
55
|
+
"dev": "tsx --env-file=dev/.env dev/index.ts",
|
|
49
56
|
"coverage": "vitest run --coverage",
|
|
50
57
|
"release": "semantic-release",
|
|
51
58
|
"prepare": "npm run build"
|
|
@@ -62,24 +69,22 @@
|
|
|
62
69
|
"@typescript-eslint/parser": "^8.57.0",
|
|
63
70
|
"@vitest/coverage-v8": "^4.1.7",
|
|
64
71
|
"dotenv": "^17.2.3",
|
|
65
|
-
"eslint": "^
|
|
72
|
+
"eslint": "^10.7.0",
|
|
66
73
|
"eslint-config-prettier": "^10.1.8",
|
|
67
74
|
"eslint-plugin-import": "^2.32.0",
|
|
68
75
|
"eslint-plugin-prettier": "^5.5.5",
|
|
76
|
+
"globals": "^17.9.0",
|
|
69
77
|
"jsdoc": "^4.0.5",
|
|
70
78
|
"prettier": "^3.6.2",
|
|
71
79
|
"semantic-release": "^25.0.2",
|
|
72
|
-
"tsc-alias": "^1.8.16",
|
|
73
80
|
"tsup": "^8.5.1",
|
|
74
81
|
"tsx": "^4.22.3",
|
|
75
|
-
"typescript": "^
|
|
82
|
+
"typescript": "^6.0.3",
|
|
76
83
|
"typescript-eslint": "^8.57.0",
|
|
77
|
-
"vite": "^8.0.14",
|
|
78
84
|
"vite-tsconfig-paths": "^6.1.1",
|
|
79
85
|
"vitest": "^4.1.7"
|
|
80
86
|
},
|
|
81
87
|
"dependencies": {
|
|
82
|
-
"
|
|
83
|
-
"discord.js": "^14.26.4"
|
|
88
|
+
"discord.js": "^14.27.0"
|
|
84
89
|
}
|
|
85
90
|
}
|