From 28fd90b5a2aafe18ffff5b90c1d2c43af51d36c9 Mon Sep 17 00:00:00 2001 From: commonly-ts <51011212+commonly-ts@users.noreply.github.com> Date: Wed, 5 Aug 2026 19:23:29 +1200 Subject: [PATCH 01/32] updated imports and configs --- .vscode/settings.json | 26 +- dev/index.ts | 3 +- eslint.config.mjs | 71 --- eslint.config.ts | 17 + package.json | 19 +- pnpm-lock.yaml | 483 ++++-------------- prettier.config.mjs => prettier.config.ts | 6 +- src/features/client/deploy.client.ts | 2 +- src/features/client/logger.ts | 10 +- src/features/client/trivious.client.ts | 6 +- src/features/commands/builders.commands.ts | 2 +- src/features/commands/commands.types.ts | 2 +- src/features/commands/methods.commands.ts | 2 +- src/features/commands/registry.commands.ts | 6 +- .../components/builders.components.ts | 2 +- src/features/components/components.types.ts | 2 +- .../components/registry.components.ts | 6 +- src/features/customId/customid.types.ts | 2 +- src/features/customId/methods.customid.ts | 4 +- src/features/events/events.types.ts | 2 +- src/features/events/presets/clientReady.ts | 2 +- .../events/presets/interactionCreate.ts | 8 +- src/features/events/registry.events.ts | 6 +- src/features/modules/modules.types.ts | 2 +- src/features/modules/registry.modules.ts | 6 +- .../permissions/methods.permissions.ts | 2 +- src/index.ts | 12 +- src/shared/registries.ts | 8 +- src/shared/typings.ts | 16 +- src/utility/errors.ts | 2 +- tests/commands.registry.test.ts | 4 +- tests/components.registry.test.ts | 6 +- tests/data/commands/debug-stats.ts | 2 +- tests/data/commands/debug/config/edit.ts | 2 +- tests/data/commands/debug/config/index.ts | 2 +- tests/data/commands/debug/index.ts | 2 +- tests/data/commands/debug/ping.ts | 2 +- tests/data/commands/message-context.ts | 2 +- tests/data/commands/note-add.ts | 2 +- tests/data/commands/note.ts | 2 +- tests/data/commands/user-context.ts | 2 +- tests/data/components/button.ts | 2 +- tests/data/components/modal.ts | 2 +- tests/data/components/selectMenu.ts | 2 +- tests/data/events/event-once.ts | 2 +- tests/data/events/event.ts | 2 +- tests/data/modules/module.ts | 2 +- tests/events.registry.test.ts | 6 +- tests/modules.registry.test.ts | 6 +- tsconfig.json | 16 +- 50 files changed, 230 insertions(+), 575 deletions(-) delete mode 100644 eslint.config.mjs create mode 100644 eslint.config.ts rename prettier.config.mjs => prettier.config.ts (66%) diff --git a/.vscode/settings.json b/.vscode/settings.json index 347f333..dc3fecb 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -23,28 +23,14 @@ "editor.defaultFormatter": "esbenp.prettier-vscode" }, - // updated 2026-04-20 00:47 - // https://github.com/antfu/vscode-file-nesting-config "explorer.fileNesting.enabled": true, "explorer.fileNesting.expand": false, "explorer.fileNesting.patterns": { - ".env": "*.env, .env.*, .envrc, env.d.ts", - ".gitignore": ".gitattributes, .gitmodules, .gitmessage, .lfsconfig, .mailmap, .git-blame*", - "package.json": "tsconfig.json, *.code-workspace, .browserslist*, .circleci*, .commitlint*, .cspell*, .cursor*, .cz-config.js, .czrc, .dlint.json, .dprint.json*, .editorconfig, .eslint*, .firebase*, .flowconfig, .github*, .gitlab*, .gitmojirc.json, .gitpod*, .huskyrc*, .jslint*, .knip.*, .lintstagedrc*, .ls-lint.yml, .markdownlint*, .node-version, .nodemon*, .npm*, .nvmrc, .oxfmtrc.json, .oxfmtrc.json.bak, .oxfmtrc.jsonc, .oxlintrc.json, .oxlintrc.json.bak, .oxlintrc.jsonc, .pm2*, .pnp.*, .pnpm*, .prettier*, .pylintrc, .release-please*.json, .releaserc*, .ruff.toml, .sentry*, .shellcheckrc, .simple-git-hooks*, .stackblitz*, .styleci*, .stylelint*, .tazerc*, .textlint*, .tool-versions, .travis*, .versionrc*, .vscode*, .watchman*, .windsurfrules, .xo-config*, .yamllint*, .yarnrc*, Procfile, alejandra.toml, apollo.config.*, appveyor*, azure-pipelines*, biome.json*, bower.json, build.config.*, bun.lock, bun.lockb, bunfig.toml, colada.options.ts, commitlint*, crowdin*, cspell*, cz.config.*, dangerfile*, dlint.json, dprint.json*, ec.config.*, electron-builder.*, eslint*, firebase.json, grunt*, gulp*, jenkins*, knip.*, lefthook.*, lerna*, lint-staged*, nest-cli.*, netlify*, nixpacks*, nodemon*, npm-shrinkwrap.json, nx.*, oxfmt.config.*, oxlint.config.*, package-lock.json, package.nls*.json, phpcs.xml, pm2.*, pnpm*, prettier*, pullapprove*, pyrightconfig.json, release-please*.json, release-tasks.sh, release.config.*, renovate*, rolldown.config.*, rollup.config.*, rspack*, ruff.toml, sentry.*.config.ts, simple-git-hooks*, sonar-project.properties, stylelint*, taze.config.*, tsdown.config.*, tslint*, tsup.config.*, turbo*, typedoc*, unlighthouse*, vercel*, vetur.config.*, webpack*, workspace.json, wrangler.*, xo.config.*, yarn*", - "readme*": "AUTHORS, Authors, BACKERS*, Backers*, CHANGELOG*, CITATION*, CODEOWNERS, CODE_OF_CONDUCT*, CONTRIBUTING*, CONTRIBUTORS, CONTRIBUTORS.MD, CONTRIBUTORS.TXT, COPYING*, CREDITS, Changelog*, Citation*, Code_Of_Conduct*, Codeowners, Contributing*, Contributors, Contributors.md, Contributors.txt, Copying*, Credits, GOVERNANCE.MD, Governance.md, HISTORY.MD, History.md, LICENSE, LICENSE.MD, LICENSE.txt, License, License.md, License.txt, MAINTAINERS, Maintainers, README-*, README_*, RELEASE_NOTES*, ROADMAP.MD, Readme-*, Readme_*, Release_Notes*, Roadmap.md, SECURITY.MD, SPONSORS*, Security.md, Sponsors*, authors, backers*, changelog*, citation*, code_of_conduct*, codeowners, contributing*, contributors, contributors.md, contributors.txt, copying*, credits, governance.md, history.md, license, license.md, license.txt, maintainers, readme-*, readme_*, release_notes*, roadmap.md, security.md, sponsors*", - "Readme*": "AUTHORS, Authors, BACKERS*, Backers*, CHANGELOG*, CITATION*, CODEOWNERS, CODE_OF_CONDUCT*, CONTRIBUTING*, CONTRIBUTORS, CONTRIBUTORS.MD, CONTRIBUTORS.TXT, COPYING*, CREDITS, Changelog*, Citation*, Code_Of_Conduct*, Codeowners, Contributing*, Contributors, Contributors.md, Contributors.txt, Copying*, Credits, GOVERNANCE.MD, Governance.md, HISTORY.MD, History.md, LICENSE, LICENSE.MD, LICENSE.txt, License, License.md, License.txt, MAINTAINERS, Maintainers, README-*, README_*, RELEASE_NOTES*, ROADMAP.MD, Readme-*, Readme_*, Release_Notes*, Roadmap.md, SECURITY.MD, SPONSORS*, Security.md, Sponsors*, authors, backers*, changelog*, citation*, code_of_conduct*, codeowners, contributing*, contributors, contributors.md, contributors.txt, copying*, credits, governance.md, history.md, license, license.md, license.txt, maintainers, readme-*, readme_*, release_notes*, roadmap.md, security.md, sponsors*", - "README*": "AUTHORS, Authors, BACKERS*, Backers*, CHANGELOG*, CITATION*, CODEOWNERS, CODE_OF_CONDUCT*, CONTRIBUTING*, CONTRIBUTORS, CONTRIBUTORS.MD, CONTRIBUTORS.TXT, COPYING*, CREDITS, Changelog*, Citation*, Code_Of_Conduct*, Codeowners, Contributing*, Contributors, Contributors.md, Contributors.txt, Copying*, Credits, GOVERNANCE.MD, Governance.md, HISTORY.MD, History.md, LICENSE, LICENSE.MD, LICENSE.txt, License, License.md, License.txt, MAINTAINERS, Maintainers, README-*, README_*, RELEASE_NOTES*, ROADMAP.MD, Readme-*, Readme_*, Release_Notes*, Roadmap.md, SECURITY.MD, SPONSORS*, Security.md, Sponsors*, authors, backers*, changelog*, citation*, code_of_conduct*, codeowners, contributing*, contributors, contributors.md, contributors.txt, copying*, credits, governance.md, history.md, license, license.md, license.txt, maintainers, readme-*, readme_*, release_notes*, roadmap.md, security.md, sponsors*", - "tsconfig.json": "tsconfig*.tsbuildinfo, tsconfig.*.json", - "vite.config.*": "*.env, .babelrc*, .codecov, .cssnanorc*, .env.*, .envrc, .htmlnanorc*, .lighthouserc.*, .mocha*, .postcssrc*, .terserrc*, api-extractor.json, ava.config.*, babel.config.*, capacitor.config.*, content.config.*, contentlayer.config.*, cssnano.config.*, cypress.*, env.d.ts, formkit.config.*, formulate.config.*, histoire.config.*, htmlnanorc.*, i18n.config.*, ionic.config.*, jasmine.*, jest.config.*, jsconfig.*, karma*, lighthouserc.*, panda.config.*, playwright.config.*, postcss.config.*, puppeteer.config.*, react-router.config.*, rspack.config.*, sst.config.*, svgo.config.*, tailwind.config.*, tsdoc.*, uno.config.*, unocss.config.*, vitest.config.*, vuetify.config.*, webpack.config.*, windi.config.*", - "*.cjs": "$(capture).cjs.map, $(capture).*.cjs, $(capture)_*.cjs", - "*.component.ts": "$(capture).component.html, $(capture).component.spec.ts, $(capture).component.css, $(capture).component.scss, $(capture).component.sass, $(capture).component.less", - "*.js": "$(capture).js.map, $(capture).*.js, $(capture)_*.js, $(capture).d.ts, $(capture).d.ts.map, $(capture).js.flow", - "*.jsx": "$(capture).js, $(capture).*.jsx, $(capture)_*.js, $(capture)_*.jsx, $(capture).css, $(capture).module.css, $(capture).less, $(capture).module.less, $(capture).module.less.d.ts, $(capture).scss, $(capture).module.scss, $(capture).module.scss.d.ts", - "*.md": "$(capture).*", - "*.mjs": "$(capture).mjs.map, $(capture).*.mjs, $(capture)_*.mjs", - "*.module.ts": "$(capture).resolver.ts, $(capture).controller.ts, $(capture).service.ts", - "*.mts": "$(capture).mts.map, $(capture).*.mts, $(capture)_*.mts", - "*.ts": "$(capture).js, $(capture).d.ts.map, $(capture).*.ts, $(capture)_*.js, $(capture)_*.ts", - "*.tsx": "$(capture).ts, $(capture).*.ts, $(capture).*.tsx, $(capture)_*.ts, $(capture)_*.tsx, $(capture).css, $(capture).module.css, $(capture).less, $(capture).module.less, $(capture).module.less.d.ts, $(capture).scss, $(capture).module.scss, $(capture).module.scss.d.ts, $(capture).css.ts" + "*.ts": "${capture}.js, ${capture}.*.ts", + "*.js": "${capture}.js.map, ${capture}.min.js, ${capture}.d.ts", + "*.jsx": "${capture}.js", + "*.tsx": "${capture}.ts", + "tsconfig.json": "tsconfig.*.json", + "package.json": "package-lock.json, pnpm-lock.yaml" } } diff --git a/dev/index.ts b/dev/index.ts index 1a2d901..1f26ce8 100644 --- a/dev/index.ts +++ b/dev/index.ts @@ -1,4 +1,4 @@ -import { TriviousClient } from "@typings"; +import { TriviousClient } from "#typings"; const client = new TriviousClient({ corePath: "tests/data", @@ -7,6 +7,7 @@ const client = new TriviousClient({ clientIdReference: "", tokenReference: "", }, + debug: true, }); (async () => { diff --git a/eslint.config.mjs b/eslint.config.mjs deleted file mode 100644 index 981b813..0000000 --- a/eslint.config.mjs +++ /dev/null @@ -1,71 +0,0 @@ -import eslint from "@eslint/js"; -import prettier from "eslint-config-prettier"; -import importPlugin from "eslint-plugin-import"; -import prettierPlugin from "eslint-plugin-prettier"; -import tseslint from "typescript-eslint"; - -export default tseslint.config( - { - ignores: ["dist/**", "node_modules/**", "*.min.js", "*.d.ts", "coverage/**"], - }, - - eslint.configs.recommended, - ...tseslint.configs.recommended, - - prettier, - { - plugins: { - prettier: prettierPlugin, - import: importPlugin, - }, - - rules: { - "prettier/prettier": "error", - - "quotes": "off", - "semi": "off", - "indent": "off", - "@typescript-eslint/indent": "off", - - "no-unused-vars": "off", - "@typescript-eslint/no-unused-vars": [ - "error", - { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }, - ], - - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-unnecessary-type-assertion": "error", - - "no-useless-return": "error", - - "no-console": process.env.NODE_ENV === "production" ? "warn" : "off", - - "import/no-restricted-paths": [ - "error", - { - zones: [ - { - target: "./src", - from: "./src/shared/typings", - except: ["./src/shared/typings/index.ts"], - }, - ], - }, - ], - "import/order": ["off"], - "import/no-duplicates": "error", - "import/first": "error", - "import/newline-after-import": "error", - }, - }, - - { - files: ["src/**/*.ts", "src/**/*.tsx", "dev/**/*.ts", "tests/**/*.ts"], - languageOptions: { - parserOptions: { - project: "./tsconfig.json", - tsconfigRootDir: import.meta.dirname, - }, - }, - } -); diff --git a/eslint.config.ts b/eslint.config.ts new file mode 100644 index 0000000..0c51271 --- /dev/null +++ b/eslint.config.ts @@ -0,0 +1,17 @@ +import js from "@eslint/js"; +import { defineConfig } from "eslint/config"; +import globals from "globals"; +import tseslint from "typescript-eslint"; + +export default defineConfig([ + { + files: ["**/*.{mjs,cjs,ts,mts,cts}"], + ignores: ["lib/**", "node_modules/**", "dist/**", ".d.ts", "old/**/*"], + plugins: { js }, + extends: ["js/recommended"], + languageOptions: { globals: globals.browser }, + }, + tseslint.configs.recommended, + tseslint.configs.strict, + tseslint.configs.stylistic, +]); diff --git a/package.json b/package.json index cb93ddd..6ee169b 100644 --- a/package.json +++ b/package.json @@ -15,12 +15,19 @@ "typescript-discord" ], "license": "Apache-2.0", - "packageManager": "pnpm@11.8.0", + "packageManager": "pnpm@11.20.0", "publishConfig": { "access": "public" }, "main": "./dist/index.cjs", "types": "./dist/index.d.ts", + "imports": { + "#typings": "./lib/shared/typings.js", + "#shared/*": "./lib/shared/*", + "#feature/*": "./lib/features/*", + "#utility/*": "./lib/utility/*", + "#src/*": "./lib/*" + }, "exports": { ".": { "types": "./dist/index.d.ts", @@ -41,8 +48,7 @@ "url": "https://github.com/commonly-ts/trivious/issues" }, "scripts": { - "build": "tsup && tsc-alias", - "lint": "eslint --fix src", + "build": "tsup", "format": "prettier --write src", "typecheck": "tsc --noEmit", "test": "vitest", @@ -63,24 +69,21 @@ "@typescript-eslint/parser": "^8.57.0", "@vitest/coverage-v8": "^4.1.7", "dotenv": "^17.2.3", - "eslint": "^9.39.1", + "eslint": "^10.7.0", "eslint-config-prettier": "^10.1.8", "eslint-plugin-import": "^2.32.0", "eslint-plugin-prettier": "^5.5.5", + "globals": "^17.9.0", "jsdoc": "^4.0.5", "prettier": "^3.6.2", "semantic-release": "^25.0.2", - "tsc-alias": "^1.8.16", "tsup": "^8.5.1", "tsx": "^4.22.3", "typescript": "^6.0.3", "typescript-eslint": "^8.57.0", - "vite": "^8.0.14", - "vite-tsconfig-paths": "^6.1.1", "vitest": "^4.1.7" }, "dependencies": { - "chalk": "^5.6.2", "discord.js": "^14.27.0" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 21299ec..8b88bc1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,9 +8,6 @@ importers: .: dependencies: - chalk: - specifier: ^5.6.2 - version: 5.6.2 discord.js: specifier: ^14.27.0 version: 14.27.0 @@ -38,10 +35,10 @@ importers: version: 24.10.1 '@typescript-eslint/eslint-plugin': specifier: ^8.57.0 - version: 8.57.0(@typescript-eslint/parser@8.57.0(eslint@9.39.1)(typescript@6.0.3))(eslint@9.39.1)(typescript@6.0.3) + version: 8.57.0(@typescript-eslint/parser@8.57.0(eslint@10.7.0)(typescript@6.0.3))(eslint@10.7.0)(typescript@6.0.3) '@typescript-eslint/parser': specifier: ^8.57.0 - version: 8.57.0(eslint@9.39.1)(typescript@6.0.3) + version: 8.57.0(eslint@10.7.0)(typescript@6.0.3) '@vitest/coverage-v8': specifier: ^4.1.7 version: 4.1.7(vitest@4.1.7) @@ -49,17 +46,20 @@ importers: specifier: ^17.2.3 version: 17.2.3 eslint: - specifier: ^9.39.1 - version: 9.39.1 + specifier: ^10.7.0 + version: 10.7.0 eslint-config-prettier: specifier: ^10.1.8 - version: 10.1.8(eslint@9.39.1) + version: 10.1.8(eslint@10.7.0) eslint-plugin-import: specifier: ^2.32.0 - version: 2.32.0(@typescript-eslint/parser@8.57.0(eslint@9.39.1)(typescript@6.0.3))(eslint@9.39.1) + version: 2.32.0(@typescript-eslint/parser@8.57.0(eslint@10.7.0)(typescript@6.0.3))(eslint@10.7.0) eslint-plugin-prettier: specifier: ^5.5.5 - version: 5.5.5(eslint-config-prettier@10.1.8(eslint@9.39.1))(eslint@9.39.1)(prettier@3.6.2) + version: 5.5.5(eslint-config-prettier@10.1.8(eslint@10.7.0))(eslint@10.7.0)(prettier@3.6.2) + globals: + specifier: ^17.9.0 + version: 17.9.0 jsdoc: specifier: ^4.0.5 version: 4.0.5 @@ -69,9 +69,6 @@ importers: semantic-release: specifier: ^25.0.2 version: 25.0.2(typescript@6.0.3) - tsc-alias: - specifier: ^1.8.16 - version: 1.8.16 tsup: specifier: ^8.5.1 version: 8.5.1(@swc/core@1.15.40)(postcss@8.5.15)(tsx@4.22.3)(typescript@6.0.3) @@ -83,13 +80,7 @@ importers: version: 6.0.3 typescript-eslint: specifier: ^8.57.0 - version: 8.57.0(eslint@9.39.1)(typescript@6.0.3) - vite: - specifier: ^8.0.14 - version: 8.0.14(@types/node@24.10.1)(esbuild@0.27.0)(tsx@4.22.3) - vite-tsconfig-paths: - specifier: ^6.1.1 - version: 6.1.1(typescript@6.0.3)(vite@8.0.14(@types/node@24.10.1)(esbuild@0.27.0)(tsx@4.22.3)) + version: 8.57.0(eslint@10.7.0)(typescript@6.0.3) vitest: specifier: ^4.1.7 version: 4.1.7(@types/node@24.10.1)(@vitest/coverage-v8@4.1.7)(vite@8.0.14(@types/node@24.10.1)(esbuild@0.27.0)(tsx@4.22.3)) @@ -513,33 +504,29 @@ packages: resolution: {integrity: sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - '@eslint/config-array@0.21.2': - resolution: {integrity: sha512-nJl2KGTlrf9GjLimgIru+V/mzgSK0ABCDQRvxw5BjURL7WfH5uoWmizbH7QB6MmnMBd8cIC9uceWnezL1VZWWw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - - '@eslint/config-helpers@0.4.2': - resolution: {integrity: sha512-gBrxN88gOIf3R7ja5K9slwNayVcZgK6SOUORm2uBzTeIEfeVaIhOpCtTox3P6R7o2jLFwLFTLnC7kU/RGcYEgw==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/config-array@0.23.5': + resolution: {integrity: sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} - '@eslint/core@0.17.0': - resolution: {integrity: sha512-yL/sLrpmtDaFEiUj1osRP4TI2MDz1AddJL+jZ7KSqvBuliN4xqYY54IfdN8qD8Toa6g1iloph1fxQNkjOxrrpQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/config-helpers@0.6.0': + resolution: {integrity: sha512-ii6Bw9jJ2zi2cWA2Z+9/QZ/+3DX6kwaV5Q986D/CdP3Lap3w/pgQZ373FV7byY/i7L4IRH/G43I5dz1ClsCbpA==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} - '@eslint/eslintrc@3.3.5': - resolution: {integrity: sha512-4IlJx0X0qftVsN5E+/vGujTRIFtwuLbNsVUe7TO6zYPDR1O6nFwvwhIKEKSrl6dZchmYBITazxKoUYOjdtjlRg==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/core@1.2.1': + resolution: {integrity: sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} '@eslint/js@9.39.1': resolution: {integrity: sha512-S26Stp4zCy88tH94QbBv3XCuzRQiZ9yXofEILmglYTh/Ug/a9/umqvgFtYBAo3Lp0nsI/5/qH1CCrbdK3AP1Tw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/object-schema@2.1.7': - resolution: {integrity: sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/object-schema@3.0.5': + resolution: {integrity: sha512-vqTaUEgxzm+YDSdElad6PiRoX4t8VGDjCtt05zn4nU810UIx/uNEV7/lZJ6KwFThKZOzOxzXy48da+No7HZaMw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} - '@eslint/plugin-kit@0.4.1': - resolution: {integrity: sha512-43/qtrDUokr7LJqoF2c3+RInu/t4zfrpYdoSDfYyhg52rwLV6TnOvdG4fXm7IkSB3wErkcmJS9iEhjVtOSEjjA==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + '@eslint/plugin-kit@0.7.2': + resolution: {integrity: sha512-+CNAzxglkrpNf/kKywqQfk74QjtceuOE7Qm+AF8miRvPF/wmmK5+OJOgVh3AVTT3RP2mH3+FOaxlE5v72owk0A==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} '@fastify/busboy@2.1.1': resolution: {integrity: sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==} @@ -584,18 +571,6 @@ packages: '@emnapi/core': ^1.7.1 '@emnapi/runtime': ^1.7.1 - '@nodelib/fs.scandir@2.1.5': - resolution: {integrity: sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==} - engines: {node: '>= 8'} - - '@nodelib/fs.stat@2.0.5': - resolution: {integrity: sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==} - engines: {node: '>= 8'} - - '@nodelib/fs.walk@1.2.8': - resolution: {integrity: sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==} - engines: {node: '>= 8'} - '@octokit/auth-token@6.0.0': resolution: {integrity: sha512-P4YJBPdPSpWTQ1NU4XYdvHvXJJDxM6YwpS0FZHRgP7YFkdVxsWcpWGy/NVqlAA7PcPCnMacXlRm1y2PFZRWL/w==} engines: {node: '>= 20'} @@ -1074,6 +1049,9 @@ packages: '@types/deep-eql@4.0.2': resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} + '@types/esrecurse@4.3.1': + resolution: {integrity: sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==} + '@types/estree@1.0.8': resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} @@ -1207,11 +1185,6 @@ packages: peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 - acorn@8.15.0: - resolution: {integrity: sha512-NZyJarBfL7nWwIq+FDL6Zp/yHEhePMNnnJ0y3qfieCrmNvYct8uvtiV41UvlSe6apAfk0fY1FbWx+NwfmpvtTg==} - engines: {node: '>=0.4.0'} - hasBin: true - acorn@8.16.0: resolution: {integrity: sha512-UVJyE9MttOsBQIDKw1skb9nAwQuR5wuGD3+82K6JgJlm/Y+KI92oNsMNGZCYdDsVtRHSak0pcV5Dno5+4jh9sw==} engines: {node: '>=0.4.0'} @@ -1259,10 +1232,6 @@ packages: any-promise@1.3.0: resolution: {integrity: sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==} - anymatch@3.1.3: - resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} - engines: {node: '>= 8'} - argparse@2.0.1: resolution: {integrity: sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==} @@ -1280,10 +1249,6 @@ packages: resolution: {integrity: sha512-FmeCCAenzH0KH381SPT5FZmiA/TmpndpcaShhfgEN9eCVjnFBqq3l1xrI42y8+PPLI6hypzou4GXw00WHmPBLQ==} engines: {node: '>= 0.4'} - array-union@2.1.0: - resolution: {integrity: sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==} - engines: {node: '>=8'} - array.prototype.findlastindex@1.2.6: resolution: {integrity: sha512-F/TKATkzseUExPlfvmwQKGITM3DGTK+vkAsCZoDc5daVygbJBnjEUCbgkAvVFsgfXfX4YIqZ/27G3k3tdXrTxQ==} engines: {node: '>= 0.4'} @@ -1325,10 +1290,6 @@ packages: before-after-hook@4.0.0: resolution: {integrity: sha512-q6tR3RPqIB1pMiTRMFcZwuG5T8vwp+vUvEG0vuI6B+Rikh5BfPp2fQ82c925FOs+b0lcFQ8CFrL+KbilfZFhOQ==} - binary-extensions@2.3.0: - resolution: {integrity: sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==} - engines: {node: '>=8'} - bluebird@3.7.2: resolution: {integrity: sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==} @@ -1396,10 +1357,6 @@ packages: resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} engines: {node: '>=10'} - chokidar@3.6.0: - resolution: {integrity: sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==} - engines: {node: '>= 8.10.0'} - chokidar@4.0.3: resolution: {integrity: sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==} engines: {node: '>= 14.16.0'} @@ -1445,10 +1402,6 @@ packages: resolution: {integrity: sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==} engines: {node: '>= 6'} - commander@9.5.0: - resolution: {integrity: sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==} - engines: {node: ^12.20.0 || >=14} - compare-func@2.0.0: resolution: {integrity: sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==} @@ -1731,25 +1684,21 @@ packages: eslint-config-prettier: optional: true - eslint-scope@8.4.0: - resolution: {integrity: sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + eslint-scope@9.1.2: + resolution: {integrity: sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} eslint-visitor-keys@3.4.3: resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - eslint-visitor-keys@4.2.1: - resolution: {integrity: sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - eslint-visitor-keys@5.0.1: resolution: {integrity: sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==} engines: {node: ^20.19.0 || ^22.13.0 || >=24} - eslint@9.39.1: - resolution: {integrity: sha512-BhHmn2yNOFA9H9JmmIVKJmd288g9hrVRDkdoIgRCRuSySRUHH7r/DI6aAXW9T1WwUuY3DFgrcaqB+deURBLR5g==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + eslint@10.7.0: + resolution: {integrity: sha512-GVTD7s1vdIl6UYvAfriOPeY1Df8LIZjfofLvHwde+erDHGGuHyuM6xoxRxmHiebhYuD2p1vN4wWh0XzPARSGDQ==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} hasBin: true peerDependencies: jiti: '*' @@ -1757,9 +1706,9 @@ packages: jiti: optional: true - espree@10.4.0: - resolution: {integrity: sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + espree@11.2.0: + resolution: {integrity: sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw==} + engines: {node: ^20.19.0 || ^22.13.0 || >=24} esquery@1.7.0: resolution: {integrity: sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==} @@ -1805,19 +1754,12 @@ packages: fast-diff@1.3.0: resolution: {integrity: sha512-VxPP4NqbUjj6MaAOafWeUn2cXWLcCtljklUtZf0Ind4XQ+QPtmA0b18zZy0jIQx+ExRVCR/ZQpBmik5lXshNsw==} - fast-glob@3.3.3: - resolution: {integrity: sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==} - engines: {node: '>=8.6.0'} - fast-json-stable-stringify@2.1.0: resolution: {integrity: sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==} fast-levenshtein@2.0.6: resolution: {integrity: sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==} - fastq@1.19.1: - resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==} - fdir@6.5.0: resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} engines: {node: '>=12.0.0'} @@ -1939,35 +1881,21 @@ packages: resolution: {integrity: sha512-w9UMqWwJxHNOvoNzSJ2oPF5wvYcvP7jUvYzhp67yEhTi17ZDBBC1z9pTdGuzjD+EFIqLSYRweZjqfiPzQ06Ebg==} engines: {node: '>= 0.4'} - get-tsconfig@4.13.0: - resolution: {integrity: sha512-1VKTZJCwBrvbd+Wn3AOgQP/2Av+TfTCOlE4AcRJE72W1ksZXbAx8PPBR9RzgTeSPzlPMHrbANMH3LbltH73wxQ==} - git-log-parser@1.2.1: resolution: {integrity: sha512-PI+sPDvHXNPl5WNOErAK05s3j0lgwUzMN6o8cyQrDaKfT3qd7TmNJKeXX+SknI5I0QhG5fVPAEwSY4tRGDtYoQ==} - glob-parent@5.1.2: - resolution: {integrity: sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==} - engines: {node: '>= 6'} - glob-parent@6.0.2: resolution: {integrity: sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==} engines: {node: '>=10.13.0'} - globals@14.0.0: - resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} + globals@17.9.0: + resolution: {integrity: sha512-m/MvAW61QVU5VDNF1Vj8axt016h8w7L5TU1e9zlab7XIttAT2YAlCwl75K1fOqvMM9apmD7lbCIRhpfkhmxhCg==} engines: {node: '>=18'} globalthis@1.0.4: resolution: {integrity: sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==} engines: {node: '>= 0.4'} - globby@11.1.0: - resolution: {integrity: sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==} - engines: {node: '>=10'} - - globrex@0.1.2: - resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==} - gopd@1.2.0: resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} engines: {node: '>= 0.4'} @@ -2116,10 +2044,6 @@ packages: resolution: {integrity: sha512-n4ZT37wG78iz03xPRKJrHTdZbe3IicyucEtdRsV5yglwc3GyUfbAfpSeD0FJ41NbUNSt5wbhqfp1fS+BgnvDFQ==} engines: {node: '>= 0.4'} - is-binary-path@2.1.0: - resolution: {integrity: sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==} - engines: {node: '>=8'} - is-boolean-object@1.2.2: resolution: {integrity: sha512-wa56o2/ElJMYqjCjGkXri7it5FbebW5usLw/nPmCMs5DeZ7eziSYZhSmPRn0txqeW4LnAmQQU7FgqLpsEFKM4A==} engines: {node: '>= 0.4'} @@ -2434,9 +2358,6 @@ packages: lodash.isstring@4.0.1: resolution: {integrity: sha512-0wJxfxH1wgO3GrbuP+dTTk7op+6L41QCXbGINEmD+ny/G/eCqGzxyCsh7159S+mgDDcoarnBw6PC1PS5+wUGgw==} - lodash.merge@4.6.2: - resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} - lodash.snakecase@4.1.1: resolution: {integrity: sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==} @@ -2513,10 +2434,6 @@ packages: merge-stream@2.0.0: resolution: {integrity: sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==} - merge2@1.4.1: - resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} - engines: {node: '>= 8'} - micromatch@4.0.8: resolution: {integrity: sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==} engines: {node: '>=8.6'} @@ -2555,10 +2472,6 @@ packages: ms@2.1.3: resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} - mylas@2.1.14: - resolution: {integrity: sha512-BzQguy9W9NJgoVn2mRWzbFrFWWztGCcng2QI9+41frfk+Athwgx3qhqhvStz7ExeUUu7Kzw427sNzHpEZNINog==} - engines: {node: '>=16.0.0'} - mz@2.7.0: resolution: {integrity: sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==} @@ -2588,10 +2501,6 @@ packages: resolution: {integrity: sha512-RWk+PI433eESQ7ounYxIp67CYuVsS1uYSonX3kA6ps/3LWfjVQa/ptEg6Y3T6uAMq1mWpX9PQ+qx+QaHpsc7gQ==} engines: {node: ^20.17.0 || >=22.9.0} - normalize-path@3.0.0: - resolution: {integrity: sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==} - engines: {node: '>=0.10.0'} - normalize-url@8.1.0: resolution: {integrity: sha512-X06Mfd/5aKsRHc0O0J5CUedwnPmnDtLF2+nq+KN9KSDlJHkPuh0JUviWjEWMe0SW/9TDdSLVPuk7L5gGTIA1/w==} engines: {node: '>=14.16'} @@ -2864,10 +2773,6 @@ packages: pkg-types@1.3.1: resolution: {integrity: sha512-/Jm5M4RvtBFVkKWRu2BLUTNP8/M2a+UwuAX+ae4770q1qVGtfjG+WTCupoZixokjmHiry8uI+dlY8KXYV5HVVQ==} - plimit-lit@1.6.1: - resolution: {integrity: sha512-B7+VDyb8Tl6oMJT9oSO2CW8XC/T4UcJGrwOVoNGwOQsQYhlpfajmrMj5xeejqaASq3V/EqThyOeATEOMuSEXiA==} - engines: {node: '>=12'} - possible-typed-array-names@1.1.0: resolution: {integrity: sha512-/+5VFTchJDoVj3bhoqi6UeymcD00DAwb1nJwamzPvHEszJ4FpF6SNNbUbOS8yI56qHzdV8eK0qEfOSiodkTdxg==} engines: {node: '>= 0.4'} @@ -2925,13 +2830,6 @@ packages: resolution: {integrity: sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==} engines: {node: '>=6'} - queue-lit@1.5.2: - resolution: {integrity: sha512-tLc36IOPeMAubu8BkW8YDBV+WyIgKlYU7zUNs0J5Vk9skSZ4JfGlPOqplP0aHdfv7HL0B2Pg6nwiq60Qc6M2Hw==} - engines: {node: '>=12'} - - queue-microtask@1.2.3: - resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} - rc@1.2.8: resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} hasBin: true @@ -2955,10 +2853,6 @@ packages: readable-stream@2.3.8: resolution: {integrity: sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==} - readdirp@3.6.0: - resolution: {integrity: sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==} - engines: {node: '>=8.10.0'} - readdirp@4.1.2: resolution: {integrity: sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==} engines: {node: '>= 14.18.0'} @@ -2990,18 +2884,11 @@ packages: resolution: {integrity: sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==} engines: {node: '>=8'} - resolve-pkg-maps@1.0.0: - resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} - resolve@1.22.11: resolution: {integrity: sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==} engines: {node: '>= 0.4'} hasBin: true - reusify@1.1.0: - resolution: {integrity: sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==} - engines: {iojs: '>=1.0.0', node: '>=0.10.0'} - rolldown@1.0.2: resolution: {integrity: sha512-oZx5zVDtVB44AW3eaifgDml1gWRDZGvjcfdxonE4swNPG98PrrXjaO/KrnUjzlMnztCCRVlUueA1kCXhARGk6g==} engines: {node: ^20.19.0 || >=22.12.0} @@ -3012,9 +2899,6 @@ packages: engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true - run-parallel@1.2.0: - resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} - safe-array-concat@1.1.3: resolution: {integrity: sha512-AURm5f0jYEOydBj7VQlVvDrjeFgthDdEF5H1dP+6mNpoXOMo1quQqJ4wvJDyRZ9+pO3kGWoOdmV08cSv2aJV6Q==} engines: {node: '>=0.4'} @@ -3107,10 +2991,6 @@ packages: resolution: {integrity: sha512-kUMbT1oBJCpgrnKoSr0o6wPtvRWT9W9UKvGLwfJYO2WuahZRHOpEyL1ckyMGgMWh0UdpmaoFqKKD29WTomNEGA==} engines: {node: '>=8'} - slash@3.0.0: - resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} - engines: {node: '>=8'} - source-map-js@1.2.1: resolution: {integrity: sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==} engines: {node: '>=0.10.0'} @@ -3310,22 +3190,6 @@ packages: ts-mixer@6.0.4: resolution: {integrity: sha512-ufKpbmrugz5Aou4wcr5Wc1UUFWOLhq+Fm6qa6P0w0K5Qw2yhaUoiWszhCVuNQyNwrlGiscHOmqYoAox1PtvgjA==} - tsc-alias@1.8.16: - resolution: {integrity: sha512-QjCyu55NFyRSBAl6+MTFwplpFcnm2Pq01rR/uxfqJoLMm6X3O14KEGtaSDZpJYaE1bJBGDjD0eSuiIWPe2T58g==} - engines: {node: '>=16.20.2'} - hasBin: true - - tsconfck@3.1.6: - resolution: {integrity: sha512-ks6Vjr/jEw0P1gmOVwutM3B7fWxoWBL2KRDb1JfqGVawBmO5UsvmWOQFGHBPl5yxYz4eERr19E6L7NMv+Fej4w==} - engines: {node: ^18 || >=20} - deprecated: unmaintained - hasBin: true - peerDependencies: - typescript: ^5.0.0 - peerDependenciesMeta: - typescript: - optional: true - tsconfig-paths@3.15.0: resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==} @@ -3477,11 +3341,6 @@ packages: validate-npm-package-license@3.0.4: resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} - vite-tsconfig-paths@6.1.1: - resolution: {integrity: sha512-2cihq7zliibCCZ8P9cKJrQBkfgdvcFkOOc3Y02o3GWUDLgqjWsZudaoiuOwO/gzTzy17cS5F7ZPo4bsnS4DGkg==} - peerDependencies: - vite: '*' - vite@8.0.14: resolution: {integrity: sha512-s4BJJ+5y1pYL6Otw51FHhVJQhPnuRinKig64g/1+EUNaJsd3gCKdD31IPFvswUgW9/60QT9oFHbZHbQK5imcxw==} engines: {node: ^20.19.0 || >=22.12.0} @@ -3933,50 +3792,36 @@ snapshots: '@esbuild/win32-x64@0.28.0': optional: true - '@eslint-community/eslint-utils@4.9.1(eslint@9.39.1)': + '@eslint-community/eslint-utils@4.9.1(eslint@10.7.0)': dependencies: - eslint: 9.39.1 + eslint: 10.7.0 eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.12.2': {} - '@eslint/config-array@0.21.2': + '@eslint/config-array@0.23.5': dependencies: - '@eslint/object-schema': 2.1.7 + '@eslint/object-schema': 3.0.5 debug: 4.4.3 - minimatch: 3.1.5 + minimatch: 10.2.4 transitivePeerDependencies: - supports-color - '@eslint/config-helpers@0.4.2': + '@eslint/config-helpers@0.6.0': dependencies: - '@eslint/core': 0.17.0 + '@eslint/core': 1.2.1 - '@eslint/core@0.17.0': + '@eslint/core@1.2.1': dependencies: '@types/json-schema': 7.0.15 - '@eslint/eslintrc@3.3.5': - dependencies: - ajv: 6.14.0 - debug: 4.4.3 - espree: 10.4.0 - globals: 14.0.0 - ignore: 5.3.2 - import-fresh: 3.3.1 - js-yaml: 4.1.1 - minimatch: 3.1.5 - strip-json-comments: 3.1.1 - transitivePeerDependencies: - - supports-color - '@eslint/js@9.39.1': {} - '@eslint/object-schema@2.1.7': {} + '@eslint/object-schema@3.0.5': {} - '@eslint/plugin-kit@0.4.1': + '@eslint/plugin-kit@0.7.2': dependencies: - '@eslint/core': 0.17.0 + '@eslint/core': 1.2.1 levn: 0.4.1 '@fastify/busboy@2.1.1': {} @@ -4017,18 +3862,6 @@ snapshots: '@tybys/wasm-util': 0.10.2 optional: true - '@nodelib/fs.scandir@2.1.5': - dependencies: - '@nodelib/fs.stat': 2.0.5 - run-parallel: 1.2.0 - - '@nodelib/fs.stat@2.0.5': {} - - '@nodelib/fs.walk@1.2.8': - dependencies: - '@nodelib/fs.scandir': 2.1.5 - fastq: 1.19.1 - '@octokit/auth-token@6.0.0': {} '@octokit/core@7.0.6': @@ -4419,6 +4252,8 @@ snapshots: '@types/deep-eql@4.0.2': {} + '@types/esrecurse@4.3.1': {} + '@types/estree@1.0.8': {} '@types/json-schema@7.0.15': {} @@ -4444,15 +4279,15 @@ snapshots: dependencies: '@types/node': 24.10.1 - '@typescript-eslint/eslint-plugin@8.57.0(@typescript-eslint/parser@8.57.0(eslint@9.39.1)(typescript@6.0.3))(eslint@9.39.1)(typescript@6.0.3)': + '@typescript-eslint/eslint-plugin@8.57.0(@typescript-eslint/parser@8.57.0(eslint@10.7.0)(typescript@6.0.3))(eslint@10.7.0)(typescript@6.0.3)': dependencies: '@eslint-community/regexpp': 4.12.2 - '@typescript-eslint/parser': 8.57.0(eslint@9.39.1)(typescript@6.0.3) + '@typescript-eslint/parser': 8.57.0(eslint@10.7.0)(typescript@6.0.3) '@typescript-eslint/scope-manager': 8.57.0 - '@typescript-eslint/type-utils': 8.57.0(eslint@9.39.1)(typescript@6.0.3) - '@typescript-eslint/utils': 8.57.0(eslint@9.39.1)(typescript@6.0.3) + '@typescript-eslint/type-utils': 8.57.0(eslint@10.7.0)(typescript@6.0.3) + '@typescript-eslint/utils': 8.57.0(eslint@10.7.0)(typescript@6.0.3) '@typescript-eslint/visitor-keys': 8.57.0 - eslint: 9.39.1 + eslint: 10.7.0 ignore: 7.0.5 natural-compare: 1.4.0 ts-api-utils: 2.4.0(typescript@6.0.3) @@ -4460,14 +4295,14 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.57.0(eslint@9.39.1)(typescript@6.0.3)': + '@typescript-eslint/parser@8.57.0(eslint@10.7.0)(typescript@6.0.3)': dependencies: '@typescript-eslint/scope-manager': 8.57.0 '@typescript-eslint/types': 8.57.0 '@typescript-eslint/typescript-estree': 8.57.0(typescript@6.0.3) '@typescript-eslint/visitor-keys': 8.57.0 debug: 4.4.3 - eslint: 9.39.1 + eslint: 10.7.0 typescript: 6.0.3 transitivePeerDependencies: - supports-color @@ -4490,13 +4325,13 @@ snapshots: dependencies: typescript: 6.0.3 - '@typescript-eslint/type-utils@8.57.0(eslint@9.39.1)(typescript@6.0.3)': + '@typescript-eslint/type-utils@8.57.0(eslint@10.7.0)(typescript@6.0.3)': dependencies: '@typescript-eslint/types': 8.57.0 '@typescript-eslint/typescript-estree': 8.57.0(typescript@6.0.3) - '@typescript-eslint/utils': 8.57.0(eslint@9.39.1)(typescript@6.0.3) + '@typescript-eslint/utils': 8.57.0(eslint@10.7.0)(typescript@6.0.3) debug: 4.4.3 - eslint: 9.39.1 + eslint: 10.7.0 ts-api-utils: 2.4.0(typescript@6.0.3) typescript: 6.0.3 transitivePeerDependencies: @@ -4519,13 +4354,13 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.57.0(eslint@9.39.1)(typescript@6.0.3)': + '@typescript-eslint/utils@8.57.0(eslint@10.7.0)(typescript@6.0.3)': dependencies: - '@eslint-community/eslint-utils': 4.9.1(eslint@9.39.1) + '@eslint-community/eslint-utils': 4.9.1(eslint@10.7.0) '@typescript-eslint/scope-manager': 8.57.0 '@typescript-eslint/types': 8.57.0 '@typescript-eslint/typescript-estree': 8.57.0(typescript@6.0.3) - eslint: 9.39.1 + eslint: 10.7.0 typescript: 6.0.3 transitivePeerDependencies: - supports-color @@ -4596,8 +4431,6 @@ snapshots: dependencies: acorn: 8.16.0 - acorn@8.15.0: {} - acorn@8.16.0: {} agent-base@7.1.4: {} @@ -4639,11 +4472,6 @@ snapshots: any-promise@1.3.0: {} - anymatch@3.1.3: - dependencies: - normalize-path: 3.0.0 - picomatch: 2.3.1 - argparse@2.0.1: {} argv-formatter@1.0.0: {} @@ -4666,8 +4494,6 @@ snapshots: is-string: 1.1.1 math-intrinsics: 1.1.0 - array-union@2.1.0: {} - array.prototype.findlastindex@1.2.6: dependencies: call-bind: 1.0.8 @@ -4722,8 +4548,6 @@ snapshots: before-after-hook@4.0.0: {} - binary-extensions@2.3.0: {} - bluebird@3.7.2: {} bottleneck@2.19.5: {} @@ -4788,18 +4612,6 @@ snapshots: char-regex@1.0.2: {} - chokidar@3.6.0: - dependencies: - anymatch: 3.1.3 - braces: 3.0.3 - glob-parent: 5.1.2 - is-binary-path: 2.1.0 - is-glob: 4.0.3 - normalize-path: 3.0.0 - readdirp: 3.6.0 - optionalDependencies: - fsevents: 2.3.3 - chokidar@4.0.3: dependencies: readdirp: 4.1.2 @@ -4851,8 +4663,6 @@ snapshots: commander@4.1.1: {} - commander@9.5.0: {} - compare-func@2.0.0: dependencies: array-ify: 1.0.0 @@ -5173,9 +4983,9 @@ snapshots: escape-string-regexp@5.0.0: {} - eslint-config-prettier@10.1.8(eslint@9.39.1): + eslint-config-prettier@10.1.8(eslint@10.7.0): dependencies: - eslint: 9.39.1 + eslint: 10.7.0 eslint-import-resolver-node@0.3.9: dependencies: @@ -5185,17 +4995,17 @@ snapshots: transitivePeerDependencies: - supports-color - eslint-module-utils@2.12.1(@typescript-eslint/parser@8.57.0(eslint@9.39.1)(typescript@6.0.3))(eslint-import-resolver-node@0.3.9)(eslint@9.39.1): + eslint-module-utils@2.12.1(@typescript-eslint/parser@8.57.0(eslint@10.7.0)(typescript@6.0.3))(eslint-import-resolver-node@0.3.9)(eslint@10.7.0): dependencies: debug: 3.2.7 optionalDependencies: - '@typescript-eslint/parser': 8.57.0(eslint@9.39.1)(typescript@6.0.3) - eslint: 9.39.1 + '@typescript-eslint/parser': 8.57.0(eslint@10.7.0)(typescript@6.0.3) + eslint: 10.7.0 eslint-import-resolver-node: 0.3.9 transitivePeerDependencies: - supports-color - eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.57.0(eslint@9.39.1)(typescript@6.0.3))(eslint@9.39.1): + eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.57.0(eslint@10.7.0)(typescript@6.0.3))(eslint@10.7.0): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.9 @@ -5204,9 +5014,9 @@ snapshots: array.prototype.flatmap: 1.3.3 debug: 3.2.7 doctrine: 2.1.0 - eslint: 9.39.1 + eslint: 10.7.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.57.0(eslint@9.39.1)(typescript@6.0.3))(eslint-import-resolver-node@0.3.9)(eslint@9.39.1) + eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.57.0(eslint@10.7.0)(typescript@6.0.3))(eslint-import-resolver-node@0.3.9)(eslint@10.7.0) hasown: 2.0.2 is-core-module: 2.16.1 is-glob: 4.0.3 @@ -5218,54 +5028,51 @@ snapshots: string.prototype.trimend: 1.0.9 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 8.57.0(eslint@9.39.1)(typescript@6.0.3) + '@typescript-eslint/parser': 8.57.0(eslint@10.7.0)(typescript@6.0.3) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack - supports-color - eslint-plugin-prettier@5.5.5(eslint-config-prettier@10.1.8(eslint@9.39.1))(eslint@9.39.1)(prettier@3.6.2): + eslint-plugin-prettier@5.5.5(eslint-config-prettier@10.1.8(eslint@10.7.0))(eslint@10.7.0)(prettier@3.6.2): dependencies: - eslint: 9.39.1 + eslint: 10.7.0 prettier: 3.6.2 prettier-linter-helpers: 1.0.1 synckit: 0.11.12 optionalDependencies: - eslint-config-prettier: 10.1.8(eslint@9.39.1) + eslint-config-prettier: 10.1.8(eslint@10.7.0) - eslint-scope@8.4.0: + eslint-scope@9.1.2: dependencies: + '@types/esrecurse': 4.3.1 + '@types/estree': 1.0.8 esrecurse: 4.3.0 estraverse: 5.3.0 eslint-visitor-keys@3.4.3: {} - eslint-visitor-keys@4.2.1: {} - eslint-visitor-keys@5.0.1: {} - eslint@9.39.1: + eslint@10.7.0: dependencies: - '@eslint-community/eslint-utils': 4.9.1(eslint@9.39.1) + '@eslint-community/eslint-utils': 4.9.1(eslint@10.7.0) '@eslint-community/regexpp': 4.12.2 - '@eslint/config-array': 0.21.2 - '@eslint/config-helpers': 0.4.2 - '@eslint/core': 0.17.0 - '@eslint/eslintrc': 3.3.5 - '@eslint/js': 9.39.1 - '@eslint/plugin-kit': 0.4.1 + '@eslint/config-array': 0.23.5 + '@eslint/config-helpers': 0.6.0 + '@eslint/core': 1.2.1 + '@eslint/plugin-kit': 0.7.2 '@humanfs/node': 0.16.7 '@humanwhocodes/module-importer': 1.0.1 '@humanwhocodes/retry': 0.4.3 '@types/estree': 1.0.8 ajv: 6.14.0 - chalk: 4.1.2 cross-spawn: 7.0.6 debug: 4.4.3 escape-string-regexp: 4.0.0 - eslint-scope: 8.4.0 - eslint-visitor-keys: 4.2.1 - espree: 10.4.0 + eslint-scope: 9.1.2 + eslint-visitor-keys: 5.0.1 + espree: 11.2.0 esquery: 1.7.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 @@ -5276,18 +5083,17 @@ snapshots: imurmurhash: 0.1.4 is-glob: 4.0.3 json-stable-stringify-without-jsonify: 1.0.1 - lodash.merge: 4.6.2 - minimatch: 3.1.5 + minimatch: 10.2.4 natural-compare: 1.4.0 optionator: 0.9.4 transitivePeerDependencies: - supports-color - espree@10.4.0: + espree@11.2.0: dependencies: acorn: 8.16.0 acorn-jsx: 5.3.2(acorn@8.16.0) - eslint-visitor-keys: 4.2.1 + eslint-visitor-keys: 5.0.1 esquery@1.7.0: dependencies: @@ -5352,22 +5158,10 @@ snapshots: fast-diff@1.3.0: {} - fast-glob@3.3.3: - dependencies: - '@nodelib/fs.stat': 2.0.5 - '@nodelib/fs.walk': 1.2.8 - glob-parent: 5.1.2 - merge2: 1.4.1 - micromatch: 4.0.8 - fast-json-stable-stringify@2.1.0: {} fast-levenshtein@2.0.6: {} - fastq@1.19.1: - dependencies: - reusify: 1.1.0 - fdir@6.5.0(picomatch@4.0.3): optionalDependencies: picomatch: 4.0.3 @@ -5495,10 +5289,6 @@ snapshots: es-errors: 1.3.0 get-intrinsic: 1.3.0 - get-tsconfig@4.13.0: - dependencies: - resolve-pkg-maps: 1.0.0 - git-log-parser@1.2.1: dependencies: argv-formatter: 1.0.0 @@ -5508,32 +5298,17 @@ snapshots: through2: 2.0.5 traverse: 0.6.8 - glob-parent@5.1.2: - dependencies: - is-glob: 4.0.3 - glob-parent@6.0.2: dependencies: is-glob: 4.0.3 - globals@14.0.0: {} + globals@17.9.0: {} globalthis@1.0.4: dependencies: define-properties: 1.2.1 gopd: 1.2.0 - globby@11.1.0: - dependencies: - array-union: 2.1.0 - dir-glob: 3.0.1 - fast-glob: 3.3.3 - ignore: 5.3.2 - merge2: 1.4.1 - slash: 3.0.0 - - globrex@0.1.2: {} - gopd@1.2.0: {} graceful-fs@4.2.10: {} @@ -5668,10 +5443,6 @@ snapshots: dependencies: has-bigints: 1.1.0 - is-binary-path@2.1.0: - dependencies: - binary-extensions: 2.3.0 - is-boolean-object@1.2.2: dependencies: call-bound: 1.0.4 @@ -5955,8 +5726,6 @@ snapshots: lodash.isstring@4.0.1: {} - lodash.merge@4.6.2: {} - lodash.snakecase@4.1.1: {} lodash.uniqby@4.7.0: {} @@ -6028,8 +5797,6 @@ snapshots: merge-stream@2.0.0: {} - merge2@1.4.1: {} - micromatch@4.0.8: dependencies: braces: 3.0.3 @@ -6055,15 +5822,13 @@ snapshots: mlly@1.8.0: dependencies: - acorn: 8.15.0 + acorn: 8.16.0 pathe: 2.0.3 pkg-types: 1.3.1 ufo: 1.6.1 ms@2.1.3: {} - mylas@2.1.14: {} - mz@2.7.0: dependencies: any-promise: 1.3.0 @@ -6097,8 +5862,6 @@ snapshots: semver: 7.7.3 validate-npm-package-license: 3.0.4 - normalize-path@3.0.0: {} - normalize-url@8.1.0: {} npm-run-path@4.0.1: @@ -6283,10 +6046,6 @@ snapshots: mlly: 1.8.0 pathe: 2.0.3 - plimit-lit@1.6.1: - dependencies: - queue-lit: 1.5.2 - possible-typed-array-names@1.1.0: {} postcss-load-config@6.0.1(postcss@8.5.15)(tsx@4.22.3): @@ -6322,10 +6081,6 @@ snapshots: punycode@2.3.1: {} - queue-lit@1.5.2: {} - - queue-microtask@1.2.3: {} - rc@1.2.8: dependencies: deep-extend: 0.6.0 @@ -6371,10 +6126,6 @@ snapshots: string_decoder: 1.1.1 util-deprecate: 1.0.2 - readdirp@3.6.0: - dependencies: - picomatch: 2.3.1 - readdirp@4.1.2: {} reflect.getprototypeof@1.0.10: @@ -6411,16 +6162,12 @@ snapshots: resolve-from@5.0.0: {} - resolve-pkg-maps@1.0.0: {} - resolve@1.22.11: dependencies: is-core-module: 2.16.1 path-parse: 1.0.7 supports-preserve-symlinks-flag: 1.0.0 - reusify@1.1.0: {} - rolldown@1.0.2: dependencies: '@oxc-project/types': 0.132.0 @@ -6473,10 +6220,6 @@ snapshots: '@rollup/rollup-win32-x64-msvc': 4.59.0 fsevents: 2.3.3 - run-parallel@1.2.0: - dependencies: - queue-microtask: 1.2.3 - safe-array-concat@1.1.3: dependencies: call-bind: 1.0.8 @@ -6615,8 +6358,6 @@ snapshots: dependencies: unicode-emoji-modifier-base: 1.0.0 - slash@3.0.0: {} - source-map-js@1.2.1: {} source-map@0.6.1: {} @@ -6813,20 +6554,6 @@ snapshots: ts-mixer@6.0.4: {} - tsc-alias@1.8.16: - dependencies: - chokidar: 3.6.0 - commander: 9.5.0 - get-tsconfig: 4.13.0 - globby: 11.1.0 - mylas: 2.1.14 - normalize-path: 3.0.0 - plimit-lit: 1.6.1 - - tsconfck@3.1.6(typescript@6.0.3): - optionalDependencies: - typescript: 6.0.3 - tsconfig-paths@3.15.0: dependencies: '@types/json5': 0.0.29 @@ -6920,13 +6647,13 @@ snapshots: possible-typed-array-names: 1.1.0 reflect.getprototypeof: 1.0.10 - typescript-eslint@8.57.0(eslint@9.39.1)(typescript@6.0.3): + typescript-eslint@8.57.0(eslint@10.7.0)(typescript@6.0.3): dependencies: - '@typescript-eslint/eslint-plugin': 8.57.0(@typescript-eslint/parser@8.57.0(eslint@9.39.1)(typescript@6.0.3))(eslint@9.39.1)(typescript@6.0.3) - '@typescript-eslint/parser': 8.57.0(eslint@9.39.1)(typescript@6.0.3) + '@typescript-eslint/eslint-plugin': 8.57.0(@typescript-eslint/parser@8.57.0(eslint@10.7.0)(typescript@6.0.3))(eslint@10.7.0)(typescript@6.0.3) + '@typescript-eslint/parser': 8.57.0(eslint@10.7.0)(typescript@6.0.3) '@typescript-eslint/typescript-estree': 8.57.0(typescript@6.0.3) - '@typescript-eslint/utils': 8.57.0(eslint@9.39.1)(typescript@6.0.3) - eslint: 9.39.1 + '@typescript-eslint/utils': 8.57.0(eslint@10.7.0)(typescript@6.0.3) + eslint: 10.7.0 typescript: 6.0.3 transitivePeerDependencies: - supports-color @@ -6986,16 +6713,6 @@ snapshots: spdx-correct: 3.2.0 spdx-expression-parse: 3.0.1 - vite-tsconfig-paths@6.1.1(typescript@6.0.3)(vite@8.0.14(@types/node@24.10.1)(esbuild@0.27.0)(tsx@4.22.3)): - dependencies: - debug: 4.4.3 - globrex: 0.1.2 - tsconfck: 3.1.6(typescript@6.0.3) - vite: 8.0.14(@types/node@24.10.1)(esbuild@0.27.0)(tsx@4.22.3) - transitivePeerDependencies: - - supports-color - - typescript - vite@8.0.14(@types/node@24.10.1)(esbuild@0.27.0)(tsx@4.22.3): dependencies: lightningcss: 1.32.0 diff --git a/prettier.config.mjs b/prettier.config.ts similarity index 66% rename from prettier.config.mjs rename to prettier.config.ts index f5cd48a..b7424f9 100644 --- a/prettier.config.mjs +++ b/prettier.config.ts @@ -1,4 +1,6 @@ -export default { +import type { Config } from "prettier"; + +const config: Config = { semi: true, singleQuote: false, quoteProps: "consistent", @@ -9,3 +11,5 @@ export default { endOfLine: "lf", arrowParens: "always", }; + +export default config; diff --git a/src/features/client/deploy.client.ts b/src/features/client/deploy.client.ts index 76861a4..dd9deb6 100644 --- a/src/features/client/deploy.client.ts +++ b/src/features/client/deploy.client.ts @@ -1,4 +1,4 @@ -import { TriviousError } from "@utility/errors.js"; +import { TriviousError } from "#utility/errors.js"; import { createHash } from "crypto"; import { REST, Routes } from "discord.js"; import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs"; diff --git a/src/features/client/logger.ts b/src/features/client/logger.ts index 8c8e829..dcfeded 100644 --- a/src/features/client/logger.ts +++ b/src/features/client/logger.ts @@ -1,5 +1,3 @@ -import chalk from "chalk"; - export class Logger { constructor( private prefix = "Trivious", @@ -8,18 +6,18 @@ export class Logger { debug(...args: any[]) { if (!this.debugActive) return; - console.log(chalk.gray(`[${this.prefix}] [DEBUG]`), ...args); + console.log(`[${this.prefix}] [DEBUG]`, ...args); } info(...args: any[]) { - console.log(chalk.cyan([`${this.prefix}`]), ...args); + console.log(`[${this.prefix}]`, ...args); } warn(...args: any[]) { - console.log(chalk.yellow([`${this.prefix} [WARN]`]), ...args); + console.log(`[${this.prefix} [WARN]]`, ...args); } error(...args: any[]) { - console.log(chalk.red([`${this.prefix} [ERROR]`]), ...args); + console.log(`[${this.prefix} [ERROR]]`, ...args); } } diff --git a/src/features/client/trivious.client.ts b/src/features/client/trivious.client.ts index fff59f1..9384535 100644 --- a/src/features/client/trivious.client.ts +++ b/src/features/client/trivious.client.ts @@ -1,4 +1,4 @@ -import registries from "@shared/registries.js"; +import registries from "#shared/registries.js"; import { Client, Collection } from "discord.js"; import structure from "../structure/index.structure.js"; @@ -9,8 +9,8 @@ import { Module, SlashCommandData, TriviousClientOptions, -} from "@typings"; -import { TriviousError } from "@utility/errors.js"; +} from "#typings"; +import { TriviousError } from "#utility/errors.js"; import commandDeploy from "./deploy.client.js"; import { Logger } from "./logger.js"; diff --git a/src/features/commands/builders.commands.ts b/src/features/commands/builders.commands.ts index f5bfb26..6cf4446 100644 --- a/src/features/commands/builders.commands.ts +++ b/src/features/commands/builders.commands.ts @@ -3,7 +3,7 @@ import { SlashCommandData, SlashSubcommandData, SlashSubcommandGroupData, -} from "@typings"; +} from "#typings"; import { ApplicationCommandType, Collection } from "discord.js"; export function createSlashCommand( diff --git a/src/features/commands/commands.types.ts b/src/features/commands/commands.types.ts index ad1cd04..9b1ab59 100644 --- a/src/features/commands/commands.types.ts +++ b/src/features/commands/commands.types.ts @@ -1,4 +1,4 @@ -import { CommandPermissionValues, TriviousClient } from "@typings"; +import { CommandPermissionValues, TriviousClient } from "#typings"; import { ApplicationCommandType, ChatInputCommandInteraction, diff --git a/src/features/commands/methods.commands.ts b/src/features/commands/methods.commands.ts index 255b6c4..68f2906 100644 --- a/src/features/commands/methods.commands.ts +++ b/src/features/commands/methods.commands.ts @@ -1,4 +1,4 @@ -import { CommandFlags, SlashCommandData, TriviousClient } from "@typings"; +import { CommandFlags, SlashCommandData, TriviousClient } from "#typings"; import { CacheType, ChatInputCommandInteraction, diff --git a/src/features/commands/registry.commands.ts b/src/features/commands/registry.commands.ts index ffe4f2d..7390c0c 100644 --- a/src/features/commands/registry.commands.ts +++ b/src/features/commands/registry.commands.ts @@ -6,9 +6,9 @@ import { SlashSubcommandData, SlashSubcommandGroupData, TriviousClient, -} from "@typings"; -import { TriviousError } from "@utility/errors.js"; -import { importFile } from "@utility/functions.js"; +} from "#typings"; +import { TriviousError } from "#utility/errors.js"; +import { importFile } from "#utility/functions.js"; import { ApplicationCommandType, Collection } from "discord.js"; import { existsSync, promises as fs } from "fs"; import path from "path"; diff --git a/src/features/components/builders.components.ts b/src/features/components/builders.components.ts index 9b3e208..1b059ed 100644 --- a/src/features/components/builders.components.ts +++ b/src/features/components/builders.components.ts @@ -1,4 +1,4 @@ -import { Component, ComponentContext } from "@typings"; +import { Component, ComponentContext } from "#typings"; /** * Create component handler diff --git a/src/features/components/components.types.ts b/src/features/components/components.types.ts index 48dd690..00f2fe4 100644 --- a/src/features/components/components.types.ts +++ b/src/features/components/components.types.ts @@ -1,4 +1,4 @@ -import { CommandPermissionValues, TriviousClient } from "@typings"; +import { CommandPermissionValues, TriviousClient } from "#typings"; import { AnySelectMenuInteraction, ButtonInteraction, ModalSubmitInteraction } from "discord.js"; export type ComponentFlags = "Cached" | "DeferReply" | "EphemeralReply" | "ExpectModal"; diff --git a/src/features/components/registry.components.ts b/src/features/components/registry.components.ts index b77955e..f8a8ea5 100644 --- a/src/features/components/registry.components.ts +++ b/src/features/components/registry.components.ts @@ -1,6 +1,6 @@ -import { Component, ComponentContext, TriviousClient } from "@typings"; -import { TriviousError } from "@utility/errors.js"; -import { importFile } from "@utility/functions.js"; +import { Component, ComponentContext, TriviousClient } from "#typings"; +import { TriviousError } from "#utility/errors.js"; +import { importFile } from "#utility/functions.js"; import { existsSync, promises as fs } from "fs"; import { join } from "path"; diff --git a/src/features/customId/customid.types.ts b/src/features/customId/customid.types.ts index 6eb51f0..00ee458 100644 --- a/src/features/customId/customid.types.ts +++ b/src/features/customId/customid.types.ts @@ -1,4 +1,4 @@ -import { ComponentContext } from "@typings"; +import { ComponentContext } from "#typings"; export type ComponentTag = "awaited"; export interface ComponentCustomId { diff --git a/src/features/customId/methods.customid.ts b/src/features/customId/methods.customid.ts index c4e4d58..f56eb4d 100644 --- a/src/features/customId/methods.customid.ts +++ b/src/features/customId/methods.customid.ts @@ -1,5 +1,5 @@ -import { ComponentContext, ComponentCustomId, ComponentTag } from "@typings"; -import { TriviousError } from "@utility/errors.js"; +import { ComponentContext, ComponentCustomId, ComponentTag } from "#typings"; +import { TriviousError } from "#utility/errors.js"; const customId = { /** diff --git a/src/features/events/events.types.ts b/src/features/events/events.types.ts index 7efca97..a3eabdc 100644 --- a/src/features/events/events.types.ts +++ b/src/features/events/events.types.ts @@ -1,4 +1,4 @@ -import { TriviousClient } from "@typings"; +import { TriviousClient } from "#typings"; import { ClientEvents } from "discord.js"; export interface Event { diff --git a/src/features/events/presets/clientReady.ts b/src/features/events/presets/clientReady.ts index da96ede..ff4069e 100644 --- a/src/features/events/presets/clientReady.ts +++ b/src/features/events/presets/clientReady.ts @@ -1,4 +1,4 @@ -import { Event } from "@typings"; +import { Event } from "#typings"; export default { name: "clientReady", diff --git a/src/features/events/presets/interactionCreate.ts b/src/features/events/presets/interactionCreate.ts index 7968ea4..87f785c 100644 --- a/src/features/events/presets/interactionCreate.ts +++ b/src/features/events/presets/interactionCreate.ts @@ -1,13 +1,13 @@ -import { handleSlashCommand, interactionReply } from "@feature/commands/methods.commands.js"; -import customId from "@feature/customId/methods.customid.js"; -import { canMemberRunCommand } from "@feature/permissions/methods.permissions.js"; +import { handleSlashCommand, interactionReply } from "#feature/commands/methods.commands.js"; +import customId from "#feature/customId/methods.customid.js"; +import { canMemberRunCommand } from "#feature/permissions/methods.permissions.js"; import { ComponentContext, SlashCommandData, TriviousClient, type ContextCommandData, type Event, -} from "@typings"; +} from "#typings"; import { ApplicationCommandType, ButtonInteraction, diff --git a/src/features/events/registry.events.ts b/src/features/events/registry.events.ts index 28f7e1d..13cb6e2 100644 --- a/src/features/events/registry.events.ts +++ b/src/features/events/registry.events.ts @@ -1,6 +1,6 @@ -import { Event, TriviousClient } from "@typings"; -import { TriviousError } from "@utility/errors.js"; -import { importFile } from "@utility/functions.js"; +import { Event, TriviousClient } from "#typings"; +import { TriviousError } from "#utility/errors.js"; +import { importFile } from "#utility/functions.js"; import { ClientEvents } from "discord.js"; import { existsSync, promises as fs } from "fs"; import path, { join } from "path"; diff --git a/src/features/modules/modules.types.ts b/src/features/modules/modules.types.ts index 8f9354d..b49b4b2 100644 --- a/src/features/modules/modules.types.ts +++ b/src/features/modules/modules.types.ts @@ -1,4 +1,4 @@ -import { TriviousClient } from "@typings"; +import { TriviousClient } from "#typings"; import { ClientEvents } from "discord.js"; export interface Module { diff --git a/src/features/modules/registry.modules.ts b/src/features/modules/registry.modules.ts index 50ad6a3..6a75df0 100644 --- a/src/features/modules/registry.modules.ts +++ b/src/features/modules/registry.modules.ts @@ -1,6 +1,6 @@ -import { Module, TriviousClient } from "@typings"; -import { TriviousError } from "@utility/errors.js"; -import { importFile } from "@utility/functions.js"; +import { Module, TriviousClient } from "#typings"; +import { TriviousError } from "#utility/errors.js"; +import { importFile } from "#utility/functions.js"; import { existsSync, promises as fs } from "fs"; import { join } from "path"; diff --git a/src/features/permissions/methods.permissions.ts b/src/features/permissions/methods.permissions.ts index c4627ab..ff11659 100644 --- a/src/features/permissions/methods.permissions.ts +++ b/src/features/permissions/methods.permissions.ts @@ -1,4 +1,4 @@ -import { BaseCommandData, Component, TriviousClient } from "@typings"; +import { BaseCommandData, Component, TriviousClient } from "#typings"; import { GuildMember, PermissionFlagsBits, User } from "discord.js"; export function canMemberRunCommand( diff --git a/src/index.ts b/src/index.ts index feea23e..5faa219 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,11 +1,11 @@ // Types -export * from "@typings"; +export * from "#typings"; // Methods -export * from "@feature/builders/utility.builders.js"; -export * from "@feature/commands/methods.commands.js"; -export { default as customId } from "@feature/customId/methods.customid.js"; +export * from "#feature/builders/utility.builders.js"; +export * from "#feature/commands/methods.commands.js"; +export { default as customId } from "#feature/customId/methods.customid.js"; // Builders -export * from "@feature/commands/builders.commands.js"; -export * from "@feature/components/builders.components.js"; +export * from "#feature/commands/builders.commands.js"; +export * from "#feature/components/builders.components.js"; diff --git a/src/shared/registries.ts b/src/shared/registries.ts index cd274b4..de879b1 100644 --- a/src/shared/registries.ts +++ b/src/shared/registries.ts @@ -1,7 +1,7 @@ -import registerCommands from "@feature/commands/registry.commands.js"; -import registerComponents from "@feature/components/registry.components.js"; -import registerEvents, { bindEvents } from "@feature/events/registry.events.js"; -import registerModules, { bindModules } from "@feature/modules/registry.modules.js"; +import registerCommands from "#feature/commands/registry.commands.js"; +import registerComponents from "#feature/components/registry.components.js"; +import registerEvents, { bindEvents } from "#feature/events/registry.events.js"; +import registerModules, { bindModules } from "#feature/modules/registry.modules.js"; export default { commands: { diff --git a/src/shared/typings.ts b/src/shared/typings.ts index d39c21a..d3e83c7 100644 --- a/src/shared/typings.ts +++ b/src/shared/typings.ts @@ -1,8 +1,8 @@ -export * from "@feature/client/client.types.js"; -export { default as TriviousClient } from "@feature/client/trivious.client.js"; -export * from "@feature/commands/commands.types.js"; -export * from "@feature/components/components.types.js"; -export * from "@feature/customId/customid.types.js"; -export * from "@feature/events/events.types.js"; -export * from "@feature/modules/modules.types.js"; -export * from "@feature/permissions/permissions.types.js"; +export * from "#feature/client/client.types.js"; +export { default as TriviousClient } from "#feature/client/trivious.client.js"; +export * from "#feature/commands/commands.types.js"; +export * from "#feature/components/components.types.js"; +export * from "#feature/customId/customid.types.js"; +export * from "#feature/events/events.types.js"; +export * from "#feature/modules/modules.types.js"; +export * from "#feature/permissions/permissions.types.js"; diff --git a/src/utility/errors.ts b/src/utility/errors.ts index 7ac8e5f..0d7ab39 100644 --- a/src/utility/errors.ts +++ b/src/utility/errors.ts @@ -1,4 +1,4 @@ -import { BaseCommandData, SlashCommandData } from "@feature/commands/commands.types.js"; +import { BaseCommandData, SlashCommandData } from "#feature/commands/commands.types.js"; export class TriviousError extends Error { readonly field?: string; diff --git a/tests/commands.registry.test.ts b/tests/commands.registry.test.ts index 9c0e7c2..e1753dc 100644 --- a/tests/commands.registry.test.ts +++ b/tests/commands.registry.test.ts @@ -1,11 +1,11 @@ -import registerCommands from "@feature/commands/registry.commands.js"; +import registerCommands from "#feature/commands/registry.commands.js"; import { ContextCommandData, SlashCommandData, SlashSubcommandData, SlashSubcommandGroupData, TriviousClient, -} from "@typings"; +} from "#typings"; import path from "path"; import { beforeAll, describe, expect, it } from "vitest"; diff --git a/tests/components.registry.test.ts b/tests/components.registry.test.ts index 5493d94..30f0fbd 100644 --- a/tests/components.registry.test.ts +++ b/tests/components.registry.test.ts @@ -1,6 +1,6 @@ -import registerComponents from "@feature/components/registry.components.js"; -import structure from "@feature/structure/index.structure.js"; -import { Component, TriviousClient } from "@typings"; +import registerComponents from "#feature/components/registry.components.js"; +import structure from "#feature/structure/index.structure.js"; +import { Component, TriviousClient } from "#typings"; import { beforeAll, describe, expect, it } from "vitest"; describe("Components Registry", () => { diff --git a/tests/data/commands/debug-stats.ts b/tests/data/commands/debug-stats.ts index 819aff5..e3f93e0 100644 --- a/tests/data/commands/debug-stats.ts +++ b/tests/data/commands/debug-stats.ts @@ -1,4 +1,4 @@ -import { createSlashSubcommand } from "@src/index.js"; +import { createSlashSubcommand } from "#src/index.js"; import { SlashCommandSubcommandBuilder } from "discord.js"; import debugCommand from "./debug/index.js"; diff --git a/tests/data/commands/debug/config/edit.ts b/tests/data/commands/debug/config/edit.ts index 465bc40..6fb930e 100644 --- a/tests/data/commands/debug/config/edit.ts +++ b/tests/data/commands/debug/config/edit.ts @@ -1,4 +1,4 @@ -import { createSlashSubcommand } from "@src/index.js"; +import { createSlashSubcommand } from "#src/index.js"; import { SlashCommandSubcommandBuilder } from "discord.js"; export default createSlashSubcommand({ diff --git a/tests/data/commands/debug/config/index.ts b/tests/data/commands/debug/config/index.ts index 6f545a7..c09a595 100644 --- a/tests/data/commands/debug/config/index.ts +++ b/tests/data/commands/debug/config/index.ts @@ -1,4 +1,4 @@ -import { createSlashSubcommandGroup } from "@src/index.js"; +import { createSlashSubcommandGroup } from "#src/index.js"; import { SlashCommandSubcommandGroupBuilder } from "discord.js"; export default createSlashSubcommandGroup({ diff --git a/tests/data/commands/debug/index.ts b/tests/data/commands/debug/index.ts index e84dfd8..1fc2e4a 100644 --- a/tests/data/commands/debug/index.ts +++ b/tests/data/commands/debug/index.ts @@ -1,4 +1,4 @@ -import { createSlashCommand } from "@src/index.js"; +import { createSlashCommand } from "#src/index.js"; import { SlashCommandBuilder } from "discord.js"; export default createSlashCommand({ diff --git a/tests/data/commands/debug/ping.ts b/tests/data/commands/debug/ping.ts index 9c7ac5f..b257eaa 100644 --- a/tests/data/commands/debug/ping.ts +++ b/tests/data/commands/debug/ping.ts @@ -1,4 +1,4 @@ -import { createSlashSubcommand } from "@src/index.js"; +import { createSlashSubcommand } from "#src/index.js"; import { SlashCommandSubcommandBuilder } from "discord.js"; export default createSlashSubcommand({ diff --git a/tests/data/commands/message-context.ts b/tests/data/commands/message-context.ts index 0559349..cb14e45 100644 --- a/tests/data/commands/message-context.ts +++ b/tests/data/commands/message-context.ts @@ -1,4 +1,4 @@ -import { createMessageContextCommand } from "@src/index.js"; +import { createMessageContextCommand } from "#src/index.js"; import { ContextMenuCommandBuilder } from "discord.js"; export default createMessageContextCommand({ diff --git a/tests/data/commands/note-add.ts b/tests/data/commands/note-add.ts index 70cdded..baf1bc7 100644 --- a/tests/data/commands/note-add.ts +++ b/tests/data/commands/note-add.ts @@ -1,4 +1,4 @@ -import { createSlashSubcommand } from "@src/index.js"; +import { createSlashSubcommand } from "#src/index.js"; import { SlashCommandSubcommandBuilder } from "discord.js"; import noteCommand from "./note.js"; diff --git a/tests/data/commands/note.ts b/tests/data/commands/note.ts index c011a8d..e023b83 100644 --- a/tests/data/commands/note.ts +++ b/tests/data/commands/note.ts @@ -1,4 +1,4 @@ -import { createSlashCommand } from "@src/index.js"; +import { createSlashCommand } from "#src/index.js"; import { SlashCommandBuilder } from "discord.js"; export default createSlashCommand({ diff --git a/tests/data/commands/user-context.ts b/tests/data/commands/user-context.ts index 298ca3e..28f7168 100644 --- a/tests/data/commands/user-context.ts +++ b/tests/data/commands/user-context.ts @@ -1,4 +1,4 @@ -import { createUserContextCommand } from "@src/index.js"; +import { createUserContextCommand } from "#src/index.js"; import { ContextMenuCommandBuilder } from "discord.js"; export default createUserContextCommand({ diff --git a/tests/data/components/button.ts b/tests/data/components/button.ts index 8dfaa27..d1eb8c3 100644 --- a/tests/data/components/button.ts +++ b/tests/data/components/button.ts @@ -1,4 +1,4 @@ -import { createButtonComponent } from "@src/index.js"; +import { createButtonComponent } from "#src/index.js"; export default createButtonComponent({ identifier: "button", diff --git a/tests/data/components/modal.ts b/tests/data/components/modal.ts index 207b605..1f73a6f 100644 --- a/tests/data/components/modal.ts +++ b/tests/data/components/modal.ts @@ -1,4 +1,4 @@ -import { createModalComponent } from "@src/index.js"; +import { createModalComponent } from "#src/index.js"; export default createModalComponent({ identifier: "modal", diff --git a/tests/data/components/selectMenu.ts b/tests/data/components/selectMenu.ts index d6cc1fa..4c7e701 100644 --- a/tests/data/components/selectMenu.ts +++ b/tests/data/components/selectMenu.ts @@ -1,4 +1,4 @@ -import { createSelectMenuComponent } from "@src/index.js"; +import { createSelectMenuComponent } from "#src/index.js"; export default createSelectMenuComponent({ identifier: "selectMenu", diff --git a/tests/data/events/event-once.ts b/tests/data/events/event-once.ts index 806f066..aa9390d 100644 --- a/tests/data/events/event-once.ts +++ b/tests/data/events/event-once.ts @@ -1,4 +1,4 @@ -import { Event } from "@typings"; +import { Event } from "#typings"; export default { name: "autoModerationRuleCreate", diff --git a/tests/data/events/event.ts b/tests/data/events/event.ts index 897b5ac..1768cda 100644 --- a/tests/data/events/event.ts +++ b/tests/data/events/event.ts @@ -1,4 +1,4 @@ -import { Event } from "@typings"; +import { Event } from "#typings"; export default { name: "applicationCommandPermissionsUpdate", diff --git a/tests/data/modules/module.ts b/tests/data/modules/module.ts index 271e868..58e3199 100644 --- a/tests/data/modules/module.ts +++ b/tests/data/modules/module.ts @@ -1,4 +1,4 @@ -import { Module } from "@typings"; +import { Module } from "#typings"; export default { name: "testModule", diff --git a/tests/events.registry.test.ts b/tests/events.registry.test.ts index 31127df..ed34fd6 100644 --- a/tests/events.registry.test.ts +++ b/tests/events.registry.test.ts @@ -1,6 +1,6 @@ -import registerEvents from "@feature/events/registry.events.js"; -import structure from "@feature/structure/index.structure.js"; -import { Event, TriviousClient } from "@typings"; +import registerEvents from "#feature/events/registry.events.js"; +import structure from "#feature/structure/index.structure.js"; +import { Event, TriviousClient } from "#typings"; import { beforeAll, describe, expect, it } from "vitest"; describe("Events Registry", () => { diff --git a/tests/modules.registry.test.ts b/tests/modules.registry.test.ts index a9a8267..92a5c81 100644 --- a/tests/modules.registry.test.ts +++ b/tests/modules.registry.test.ts @@ -1,6 +1,6 @@ -import registerModules from "@feature/modules/registry.modules.js"; -import structure from "@feature/structure/index.structure.js"; -import { Module, TriviousClient } from "@typings"; +import registerModules from "#feature/modules/registry.modules.js"; +import structure from "#feature/structure/index.structure.js"; +import { Module, TriviousClient } from "#typings"; import { beforeAll, describe, expect, it } from "vitest"; describe("Modules Registry", () => { diff --git a/tsconfig.json b/tsconfig.json index 5c045d5..a89c24a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,21 +4,21 @@ "module": "nodenext", "moduleResolution": "nodenext", "ignoreDeprecations": "6.0", - "outDir": "dist", - "rootDir": ".", "noEmit": true, "declaration": true, "strict": true, "allowSyntheticDefaultImports": true, "sourceMap": true, + "outDir": "dist", + "rootDir": ".", "paths": { - "@typings": ["./src/shared/typings.ts"], - "@shared/*": ["./src/shared/*"], - "@feature/*": ["./src/features/*"], - "@utility/*": ["./src/utility/*"], - "@src/*": ["./src/*"] + "#typings": ["./src/shared/typings.ts"], + "#shared/*": ["./src/shared/*"], + "#feature/*": ["./src/features/*"], + "#utility/*": ["./src/utility/*"], + "#src/*": ["./src/*"] } }, - "include": ["src", "dev", "tests", "vitest.config.ts", "tsup.config.ts", "eslint.config.mjs"], + "include": ["src", "dev", "tests", "vitest.config.ts", "tsup.config.ts", "eslint.config.ts"], "exclude": ["node_modules", "dist"] } From 6ac4170bfdc553697803ee66a35dadb78ee39f91 Mon Sep 17 00:00:00 2001 From: commonly-ts <51011212+commonly-ts@users.noreply.github.com> Date: Wed, 5 Aug 2026 23:42:27 +1200 Subject: [PATCH 02/32] fix: added data\ to gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 16723d7..dc74575 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ old-src +data # Logs logs From 9f4058db77adf8e5c9c15b3b36159357fdfcf850 Mon Sep 17 00:00:00 2001 From: commonly-ts <51011212+commonly-ts@users.noreply.github.com> Date: Wed, 5 Aug 2026 23:42:45 +1200 Subject: [PATCH 03/32] dev: updated runtime testing code --- dev/index.ts | 18 ++++++++++++++---- package.json | 2 +- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/dev/index.ts b/dev/index.ts index 1f26ce8..e0457c8 100644 --- a/dev/index.ts +++ b/dev/index.ts @@ -1,15 +1,25 @@ import { TriviousClient } from "#typings"; +import { GatewayIntentBits } from "discord.js"; const client = new TriviousClient({ corePath: "tests/data", - intents: [], + intents: [ + GatewayIntentBits.Guilds, + GatewayIntentBits.GuildMessages, + GatewayIntentBits.MessageContent, + ], credentials: { - clientIdReference: "", - tokenReference: "", + clientIdReference: "CLIENT_ID", + tokenReference: "BOT_TOKEN", }, + commandHashConfig: { + enabled: true, + persistentDataPath: "data", + }, + messageCommandPrefix: "?", debug: true, }); (async () => { - await client.register(); + await client.start(); })(); diff --git a/package.json b/package.json index 6ee169b..450561e 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,7 @@ "format": "prettier --write src", "typecheck": "tsc --noEmit", "test": "vitest", - "dev": "tsx dev/index.ts", + "dev": "tsx --env-file=dev/.env dev/index.ts", "coverage": "vitest run --coverage", "release": "semantic-release", "prepare": "npm run build" From f454a613d84cf5cb517ca108e4c8241de17fcdae Mon Sep 17 00:00:00 2001 From: commonly-ts <51011212+commonly-ts@users.noreply.github.com> Date: Wed, 5 Aug 2026 23:43:43 +1200 Subject: [PATCH 04/32] removed data --- .gitignore | 1 - 1 file changed, 1 deletion(-) diff --git a/.gitignore b/.gitignore index dc74575..16723d7 100644 --- a/.gitignore +++ b/.gitignore @@ -1,5 +1,4 @@ old-src -data # Logs logs From c6b5c991d84f64372d3ad9de1230a8cde1b0f549 Mon Sep 17 00:00:00 2001 From: commonly-ts <51011212+commonly-ts@users.noreply.github.com> Date: Wed, 5 Aug 2026 23:43:57 +1200 Subject: [PATCH 05/32] dev: updated test code and data --- dev/index.ts | 4 ---- tests/data/commands/debug-stats.ts | 2 +- tests/data/commands/debug/config/edit.ts | 2 +- tests/data/commands/debug/config/index.ts | 2 +- tests/data/commands/debug/index.ts | 2 +- tests/data/commands/debug/ping.ts | 8 +++++--- tests/data/commands/message-cmd.ts | 11 +++++++++++ tests/data/commands/note-add.ts | 2 +- tests/data/commands/note.ts | 2 +- 9 files changed, 22 insertions(+), 13 deletions(-) create mode 100644 tests/data/commands/message-cmd.ts diff --git a/dev/index.ts b/dev/index.ts index e0457c8..4fc3d6c 100644 --- a/dev/index.ts +++ b/dev/index.ts @@ -12,10 +12,6 @@ const client = new TriviousClient({ clientIdReference: "CLIENT_ID", tokenReference: "BOT_TOKEN", }, - commandHashConfig: { - enabled: true, - persistentDataPath: "data", - }, messageCommandPrefix: "?", debug: true, }); diff --git a/tests/data/commands/debug-stats.ts b/tests/data/commands/debug-stats.ts index e3f93e0..b9e377c 100644 --- a/tests/data/commands/debug-stats.ts +++ b/tests/data/commands/debug-stats.ts @@ -4,7 +4,7 @@ import debugCommand from "./debug/index.js"; export default createSlashSubcommand({ active: true, - data: new SlashCommandSubcommandBuilder().setName("stats"), + data: new SlashCommandSubcommandBuilder().setName("stats").setDescription("Placeholder"), async execute() {}, parent: debugCommand, }); diff --git a/tests/data/commands/debug/config/edit.ts b/tests/data/commands/debug/config/edit.ts index 6fb930e..111a20a 100644 --- a/tests/data/commands/debug/config/edit.ts +++ b/tests/data/commands/debug/config/edit.ts @@ -3,6 +3,6 @@ import { SlashCommandSubcommandBuilder } from "discord.js"; export default createSlashSubcommand({ active: true, - data: new SlashCommandSubcommandBuilder().setName("edit"), + data: new SlashCommandSubcommandBuilder().setName("edit").setDescription("Placeholder"), async execute() {}, }); diff --git a/tests/data/commands/debug/config/index.ts b/tests/data/commands/debug/config/index.ts index c09a595..e00f367 100644 --- a/tests/data/commands/debug/config/index.ts +++ b/tests/data/commands/debug/config/index.ts @@ -2,5 +2,5 @@ import { createSlashSubcommandGroup } from "#src/index.js"; import { SlashCommandSubcommandGroupBuilder } from "discord.js"; export default createSlashSubcommandGroup({ - data: new SlashCommandSubcommandGroupBuilder().setName("config"), + data: new SlashCommandSubcommandGroupBuilder().setName("config").setDescription("Placeholder"), }); diff --git a/tests/data/commands/debug/index.ts b/tests/data/commands/debug/index.ts index 1fc2e4a..d0113fe 100644 --- a/tests/data/commands/debug/index.ts +++ b/tests/data/commands/debug/index.ts @@ -3,5 +3,5 @@ import { SlashCommandBuilder } from "discord.js"; export default createSlashCommand({ active: true, - data: new SlashCommandBuilder().setName("debug"), + data: new SlashCommandBuilder().setName("debug").setDescription("Placeholder"), }); diff --git a/tests/data/commands/debug/ping.ts b/tests/data/commands/debug/ping.ts index b257eaa..a2aec8d 100644 --- a/tests/data/commands/debug/ping.ts +++ b/tests/data/commands/debug/ping.ts @@ -1,8 +1,10 @@ -import { createSlashSubcommand } from "#src/index.js"; +import { createSlashSubcommand, interactionReply } from "#src/index.js"; import { SlashCommandSubcommandBuilder } from "discord.js"; export default createSlashSubcommand({ active: true, - data: new SlashCommandSubcommandBuilder().setName("ping"), - async execute() {}, + data: new SlashCommandSubcommandBuilder().setName("ping").setDescription("Placeholder"), + async execute(client, interaction) { + await interactionReply({ interaction, replyPayload: { content: "Hello world" } }); + }, }); diff --git a/tests/data/commands/message-cmd.ts b/tests/data/commands/message-cmd.ts new file mode 100644 index 0000000..f3cf2ff --- /dev/null +++ b/tests/data/commands/message-cmd.ts @@ -0,0 +1,11 @@ +import { createMessageCommand } from "#src/index.js"; + +export default createMessageCommand({ + active: true, + name: "ping-test", + aliases: ["png"], + arguments: ["type"], + async execute(client, message, args) { + await message.reply({ content: `Hello world! Given argument: \`${args.get("type")}\`` }); + }, +}); diff --git a/tests/data/commands/note-add.ts b/tests/data/commands/note-add.ts index baf1bc7..0dfacdf 100644 --- a/tests/data/commands/note-add.ts +++ b/tests/data/commands/note-add.ts @@ -4,7 +4,7 @@ import noteCommand from "./note.js"; export default createSlashSubcommand({ active: true, - data: new SlashCommandSubcommandBuilder().setName("add"), + data: new SlashCommandSubcommandBuilder().setName("add").setDescription("Placeholder"), async execute() {}, parent: noteCommand, }); diff --git a/tests/data/commands/note.ts b/tests/data/commands/note.ts index e023b83..3fa31fd 100644 --- a/tests/data/commands/note.ts +++ b/tests/data/commands/note.ts @@ -3,5 +3,5 @@ import { SlashCommandBuilder } from "discord.js"; export default createSlashCommand({ active: true, - data: new SlashCommandBuilder().setName("note"), + data: new SlashCommandBuilder().setName("note").setDescription("Placeholder"), }); From 86c19552a566fc679cefab086a7d2b9a71b3efab Mon Sep 17 00:00:00 2001 From: commonly-ts <51011212+commonly-ts@users.noreply.github.com> Date: Wed, 5 Aug 2026 23:44:13 +1200 Subject: [PATCH 06/32] fix: added proper return type to importFile --- src/utility/functions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utility/functions.ts b/src/utility/functions.ts index a9d727f..cc89c2b 100644 --- a/src/utility/functions.ts +++ b/src/utility/functions.ts @@ -3,7 +3,7 @@ import path from "path"; import { pathToFileURL } from "url"; const fileCache = new Map>(); -export function importFile(filePath: string) { +export function importFile(filePath: string): Promise | null { if (filePath.endsWith(".d.ts") || filePath.endsWith(".js.map")) return null; const absolutePath = path.resolve(filePath); if (fileCache.has(absolutePath)) return fileCache.get(absolutePath)!; From 04d07edc9fc3601dd8ef2a8bcdd5163a3e07a803 Mon Sep 17 00:00:00 2001 From: commonly-ts <51011212+commonly-ts@users.noreply.github.com> Date: Wed, 5 Aug 2026 23:44:38 +1200 Subject: [PATCH 07/32] feat(commands): added message commands --- src/features/client/client.types.ts | 1 + src/features/client/trivious.client.ts | 13 +++++--- src/features/commands/builders.commands.ts | 13 ++++++++ src/features/commands/commands.types.ts | 31 +++++++++++++++++ src/features/commands/registry.commands.ts | 39 ++++++++++++++++++++-- 5 files changed, 91 insertions(+), 6 deletions(-) diff --git a/src/features/client/client.types.ts b/src/features/client/client.types.ts index d84edf2..bf19986 100644 --- a/src/features/client/client.types.ts +++ b/src/features/client/client.types.ts @@ -86,4 +86,5 @@ export interface TriviousClientOptions extends ClientOptions { ownerUserIds?: string[]; commandHashConfig?: CommandHashConfiguration; debug?: boolean; + messageCommandPrefix?: string; } diff --git a/src/features/client/trivious.client.ts b/src/features/client/trivious.client.ts index 9384535..1e766dc 100644 --- a/src/features/client/trivious.client.ts +++ b/src/features/client/trivious.client.ts @@ -6,6 +6,7 @@ import { Component, ContextCommandData, Event, + MessageCommandData, Module, SlashCommandData, TriviousClientOptions, @@ -21,10 +22,12 @@ export default class TriviousClient extends Client { commands: { chatInput: Collection; context: Collection; + message: Collection; }; components: Collection; events: Collection; modules: Collection; + messageCommandAlises: Collection; }; logger: Logger; @@ -37,10 +40,12 @@ export default class TriviousClient extends Client { commands: { chatInput: new Collection(), context: new Collection(), + message: new Collection(), }, components: new Collection(), events: new Collection(), modules: new Collection(), + messageCommandAlises: new Collection(), }; } @@ -49,7 +54,7 @@ export default class TriviousClient extends Client { * * @throws {TriviousError} If invalid bot token */ - async start() { + async start(deploy?: boolean) { const token = process.env[this.trivious.credentials.tokenReference]; if (!token) { throw new TriviousError( @@ -59,7 +64,7 @@ export default class TriviousClient extends Client { } await this.register(); - await this.deploy(); + if (deploy || deploy === undefined) await this.deploy(); try { await registries.events.bind(this); @@ -74,10 +79,10 @@ export default class TriviousClient extends Client { async register() { const dir = structure.resolveRelativePath(this.trivious.corePath); - await registries.events.register(this, dir); - await registries.modules.register(this, dir); await registries.commands.register(this, dir); await registries.components.register(this, dir); + await registries.events.register(this, dir); + await registries.modules.register(this, dir); } async deploy() { diff --git a/src/features/commands/builders.commands.ts b/src/features/commands/builders.commands.ts index 6cf4446..0ae51a3 100644 --- a/src/features/commands/builders.commands.ts +++ b/src/features/commands/builders.commands.ts @@ -1,11 +1,22 @@ import { ContextCommandData, + MessageCommandData, + ReadOnlyStrArray, SlashCommandData, SlashSubcommandData, SlashSubcommandGroupData, } from "#typings"; import { ApplicationCommandType, Collection } from "discord.js"; +export function createMessageCommand( + command: Omit, "context"> +): MessageCommandData { + return { + context: "MessageCommand", + ...command, + }; +} + export function createSlashCommand( data: Omit ): SlashCommandData { @@ -65,6 +76,7 @@ export function createSlashSubcommandGroup( export function createMessageContextCommand( data: Omit, "commandType"> ): ContextCommandData<"Message"> { + data.data.setType(ApplicationCommandType.Message); return { ...data, commandType: ApplicationCommandType.Message, @@ -74,6 +86,7 @@ export function createMessageContextCommand( export function createUserContextCommand( data: Omit, "commandType"> ): ContextCommandData<"User"> { + data.data.setType(ApplicationCommandType.User); return { ...data, commandType: ApplicationCommandType.User, diff --git a/src/features/commands/commands.types.ts b/src/features/commands/commands.types.ts index 9b1ab59..9069799 100644 --- a/src/features/commands/commands.types.ts +++ b/src/features/commands/commands.types.ts @@ -5,6 +5,7 @@ import { Collection, ContextMenuCommandBuilder, Interaction, + Message, MessageContextMenuCommandInteraction, SlashCommandBuilder, SlashCommandOptionsOnlyBuilder, @@ -124,4 +125,34 @@ export type CollatedCommandData = { SlashSubcommand: Set>; SlashSubcommandGroup: Set>; ContextCommand: Set>; + MessageCommand: Set>; }; + +export interface MessageCommandBaseData { + active: boolean; + permissions?: CommandPermissionValues; +} + +export type ReadOnlyStrArray = readonly string[] | undefined; +export type MessageCommandArgs = + Arguments extends readonly string[] + ? [Arguments[number]] extends [never] + ? null + : Map + : null; + +export interface MessageCommandData< + Arguments extends ReadOnlyStrArray = readonly string[] | undefined, +> { + context: "MessageCommand"; + active: boolean; + permissions?: CommandPermissionValues; + name: string; + arguments?: Arguments; + aliases?: string[]; + execute: ( + client: TriviousClient, + message: Message, + args: MessageCommandArgs + ) => Promise; +} diff --git a/src/features/commands/registry.commands.ts b/src/features/commands/registry.commands.ts index 7390c0c..fb8f343 100644 --- a/src/features/commands/registry.commands.ts +++ b/src/features/commands/registry.commands.ts @@ -2,6 +2,7 @@ import { CollatedCommandData, CommandSetData, ContextCommandData, + MessageCommandData, SlashCommandData, SlashSubcommandData, SlashSubcommandGroupData, @@ -13,10 +14,14 @@ import { ApplicationCommandType, Collection } from "discord.js"; import { existsSync, promises as fs } from "fs"; import path from "path"; +const parsedCache = new Set(); async function parseBase(input: string | T, expects?: (base: Partial) => boolean) { let base: T | null = null; if (typeof input === "string") { + const absolutePath = path.resolve(input); + if (parsedCache.has(absolutePath)) return null; base = await importFile(input); + parsedCache.add(absolutePath); } else base = input; if (!base) return null; if (expects && !expects(base)) return null; @@ -27,7 +32,11 @@ async function parseDirectory(data: CollatedCommandData, directory: string): Pro const files = fs.glob(path.join(directory, "*.{js,ts}")); for await (const file of files) { const base = await parseBase< - SlashCommandData | SlashSubcommandData | SlashSubcommandGroupData | ContextCommandData + | SlashCommandData + | SlashSubcommandData + | SlashSubcommandGroupData + | ContextCommandData + | MessageCommandData >(file); if (!base) continue; const targetSet = @@ -77,6 +86,7 @@ function getDataFromCommandSet( async function setChildrenToParents(data: CollatedCommandData) { for (const [group, directory] of data.SlashSubcommandGroup) { + if (group.context !== "SlashSubcommandGroup") continue; const slashCommand = group.parent || getDataFromCommandSet(data.SlashCommand, { matchParentDirectory: directory }); @@ -95,6 +105,7 @@ async function setChildrenToParents(data: CollatedCommandData) { } for (const [subcommand, directory] of data.SlashSubcommand) { + if (!subcommand.active || subcommand.context !== "SlashSubcommand") continue; const parent = subcommand.parent || getDataFromCommandSet(data.SlashSubcommandGroup, { matchParentDirectory: directory }) || @@ -107,7 +118,7 @@ async function setChildrenToParents(data: CollatedCommandData) { if (!parent.subcommands) parent.subcommands = new Collection(); if (parent.subcommands.has(subcommand.data.name)) console.warn( - `[Trivious] Subcommand '${subcommand.data.name}' under SlashCommand/SubcommandGroup '${parent.data.name}' has been overridden by a subcommand with the same name` + `[Trivious] Subcommand '${subcommand.data.name}' under parent '${parent.data.name}' has been overridden by a subcommand with the same name` ); subcommand.parent = parent; parent.subcommands.set(subcommand.data.name, subcommand); @@ -118,6 +129,7 @@ async function setChildrenToParents(data: CollatedCommandData) { async function registerSlashCommands(client: TriviousClient, data: CollatedCommandData) { await setChildrenToParents(data); for (const [slashCommand] of data.SlashCommand) { + if (!slashCommand.active || slashCommand.context !== "SlashCommand") continue; if (client.stores.commands.chatInput.get(slashCommand.data.name)) client.logger.warn( `Command '${slashCommand.data.name}' has been overridden by a command with the same name` @@ -129,6 +141,7 @@ async function registerSlashCommands(client: TriviousClient, data: CollatedComma async function registerContextMenuCommands(client: TriviousClient, data: CollatedCommandData) { for (const [contextCommand] of data.ContextCommand) { + if (!contextCommand.active) continue; if (client.stores.commands.chatInput.get(contextCommand.data.name)) client.logger.warn( `Command '${contextCommand.data.name}' has been overridden by a command with the same name` @@ -143,6 +156,25 @@ async function registerContextMenuCommands(client: TriviousClient, data: Collate } } +async function registerMessageCommands(client: TriviousClient, data: CollatedCommandData) { + for (const [command] of data.MessageCommand) { + if (!command.active || command.context !== "MessageCommand") continue; + if (client.stores.commands.chatInput.get(command.name)) + client.logger.warn( + `Message command '${command.name}' has been overridden by a command with the same name` + ); + client.logger.debug("Registered message command:", command.name); + client.stores.commands.message.set(command.name, command); + if (command.aliases) + command.aliases.forEach((alias) => + client.stores.messageCommandAlises.set( + alias.trim().toLowerCase(), + command.name.toLowerCase() + ) + ); + } +} + export default async function registerCommands(client: TriviousClient, directory: string) { if (!existsSync(directory)) throw new TriviousError( @@ -154,6 +186,7 @@ export default async function registerCommands(client: TriviousClient, directory SlashSubcommand: new Set>(), SlashSubcommandGroup: new Set>(), ContextCommand: new Set>(), + MessageCommand: new Set>(), }; client.logger.debug("Starting command registration in:", directory); const files = fs.glob(path.join(directory, "**/*.{js,ts}")); @@ -165,5 +198,7 @@ export default async function registerCommands(client: TriviousClient, directory await parseDirectory(data, parentDir); } await registerSlashCommands(client, data); + await registerMessageCommands(client, data); await registerContextMenuCommands(client, data); + parsedCache.clear(); } From f7ac8a7679182723a90648739098cd6b2e697913 Mon Sep 17 00:00:00 2001 From: commonly-ts <51011212+commonly-ts@users.noreply.github.com> Date: Wed, 5 Aug 2026 23:45:03 +1200 Subject: [PATCH 08/32] feat(events): added messageCreate preset event --- src/features/events/presets/messageCreate.ts | 51 ++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 src/features/events/presets/messageCreate.ts diff --git a/src/features/events/presets/messageCreate.ts b/src/features/events/presets/messageCreate.ts new file mode 100644 index 0000000..b33a1f2 --- /dev/null +++ b/src/features/events/presets/messageCreate.ts @@ -0,0 +1,51 @@ +import { Event } from "#typings"; +import { BitField, GatewayIntentBits } from "discord.js"; + +export default { + name: "messageCreate", + conditions(client) { + return [ + [client.stores.commands.message.size > 0, "At least one (1) message command registered."], + [ + new BitField(client.trivious.intents).has(GatewayIntentBits.MessageContent), + "TriviousClient has MessageContent gateway intent.", + ], + [ + new BitField(client.trivious.intents).has(GatewayIntentBits.GuildMessages), + "TriviousClient has GuildMessages gateway intent.", + ], + ]; + }, + async execute(client, message) { + const prefix = client.trivious.messageCommandPrefix; + if (!prefix) + return client.logger.warn( + "At least one message command is registered, but no command prefix is configured. Ensure the TriviousClient has 'messageCommandPrefix' set to a string value." + ); + + if (!message.content.startsWith(prefix)) return; + const [commandName, ...rawArgs] = message.content.slice(prefix.length).split(" "); + const alias = client.stores.messageCommandAlises.get(commandName.toLowerCase()) || ""; + const command = + client.stores.commands.message.get(commandName.toLowerCase()) || + client.stores.commands.message.get(alias); + + if (!command || !command.active) + return void (await message.reply({ + content: `Invalid command; does not exist, missing handler, or is inactive.`, + })); + + const expectedArgs = command.arguments?.length || 0; + if (rawArgs.length < expectedArgs && command.arguments) { + return void (await message.reply({ + content: `Missing or incomplete arguments. I expected ${expectedArgs} arguments, but received only ${rawArgs.length}.\nNext missing argument is '${command.arguments[rawArgs.length]}'`, + })); + } + const args = command.arguments + ? new Map( + command.arguments.slice(0, expectedArgs).map((name, index) => [name, rawArgs[index]]) + ) + : null; + await command.execute(client, message, args); + }, +} satisfies Event<"messageCreate">; From 527c687e723ad792d57f967aae848e89756ac3ba Mon Sep 17 00:00:00 2001 From: commonly-ts <51011212+commonly-ts@users.noreply.github.com> Date: Wed, 5 Aug 2026 23:47:07 +1200 Subject: [PATCH 09/32] feat(events): added conditions All conditions defined in an event must be met for the event to be loaded in. --- src/features/events/events.types.ts | 1 + .../events/presets/interactionCreate.ts | 5 +++++ src/features/events/registry.events.ts | 20 ++++++++++++++++--- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/src/features/events/events.types.ts b/src/features/events/events.types.ts index a3eabdc..81881ac 100644 --- a/src/features/events/events.types.ts +++ b/src/features/events/events.types.ts @@ -4,5 +4,6 @@ import { ClientEvents } from "discord.js"; export interface Event { name: K; once?: boolean; + conditions?: (client: TriviousClient) => [boolean, string][]; execute: (client: TriviousClient, ...args: ClientEvents[K]) => Promise | void; } diff --git a/src/features/events/presets/interactionCreate.ts b/src/features/events/presets/interactionCreate.ts index 87f785c..47ede22 100644 --- a/src/features/events/presets/interactionCreate.ts +++ b/src/features/events/presets/interactionCreate.ts @@ -56,6 +56,11 @@ function validateMemberPermissionsForSubcommand( export default { name: "interactionCreate", + conditions(client) { + return [ + [client.stores.commands.chatInput.size > 0, "At least one (1) slash command registered."], + ]; + }, async execute(client, interaction) { if (interaction.isChatInputCommand() || interaction.isContextMenuCommand()) { const { commandName } = interaction; diff --git a/src/features/events/registry.events.ts b/src/features/events/registry.events.ts index 13cb6e2..44c1edc 100644 --- a/src/features/events/registry.events.ts +++ b/src/features/events/registry.events.ts @@ -13,15 +13,29 @@ async function loadPresetEvents(client: TriviousClient) { for await (const file of files) { const event = await parseEvent(file); if (!event) continue; - + if ( + event.conditions && + !event.conditions(client).every(([isValid, description], index) => { + if (!isValid) + client.logger.debug( + "[EVENT REGISTRY]", + `Condition #${index + 1} "${description}" for event`, + event.name, + "not met; this event will not be triggered." + ); + return isValid; + }) + ) { + continue; + } client.stores.events.set(event.name, event); + client.logger.debug("Registered event:", event.name); } } async function parseEvent(file: string) { const event = await importFile(file); - if (!event || !("name" in event && "execute" in event)) return null; - + if (!event || !("name" in event && "execute" in event) || "context" in event) return null; return event; } From c2684cf4aa00ba36b9cfb74f2fabeafee2f1e8bf Mon Sep 17 00:00:00 2001 From: commonly-ts <51011212+commonly-ts@users.noreply.github.com> Date: Wed, 5 Aug 2026 23:47:15 +1200 Subject: [PATCH 10/32] fix: fixed typos --- src/features/client/logger.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/features/client/logger.ts b/src/features/client/logger.ts index dcfeded..20a5f44 100644 --- a/src/features/client/logger.ts +++ b/src/features/client/logger.ts @@ -14,10 +14,10 @@ export class Logger { } warn(...args: any[]) { - console.log(`[${this.prefix} [WARN]]`, ...args); + console.log(`[${this.prefix}] [WARN]`, ...args); } error(...args: any[]) { - console.log(`[${this.prefix} [ERROR]]`, ...args); + console.log(`[${this.prefix}] [ERROR]`, ...args); } } From cd356a7dcb3f283d2a1eade7039371bf11419769 Mon Sep 17 00:00:00 2001 From: commonly-ts <51011212+commonly-ts@users.noreply.github.com> Date: Wed, 5 Aug 2026 23:52:33 +1200 Subject: [PATCH 11/32] fix(debug): added debug logs for message cmd alises --- src/features/commands/registry.commands.ts | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/features/commands/registry.commands.ts b/src/features/commands/registry.commands.ts index fb8f343..531cab6 100644 --- a/src/features/commands/registry.commands.ts +++ b/src/features/commands/registry.commands.ts @@ -166,12 +166,18 @@ async function registerMessageCommands(client: TriviousClient, data: CollatedCom client.logger.debug("Registered message command:", command.name); client.stores.commands.message.set(command.name, command); if (command.aliases) - command.aliases.forEach((alias) => + command.aliases.forEach((alias) => { + client.logger.debug( + "Registered message command alias:", + alias.trim().toLowerCase(), + "->", + command.name.toLowerCase() + ); client.stores.messageCommandAlises.set( alias.trim().toLowerCase(), command.name.toLowerCase() - ) - ); + ); + }); } } From 370ac193418566382aee21186c706b21bcb13a60 Mon Sep 17 00:00:00 2001 From: commonly-ts <51011212+commonly-ts@users.noreply.github.com> Date: Wed, 5 Aug 2026 23:52:43 +1200 Subject: [PATCH 12/32] dev: updated test behaviour --- dev/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dev/index.ts b/dev/index.ts index 4fc3d6c..b532eb6 100644 --- a/dev/index.ts +++ b/dev/index.ts @@ -17,5 +17,6 @@ const client = new TriviousClient({ }); (async () => { - await client.start(); + await client.register(); + // await client.start(false); })(); From f052d5d3b0508e8c02adc76cb22a1d54e493d490 Mon Sep 17 00:00:00 2001 From: Commonly <51011212+commonly-ts@users.noreply.github.com> Date: Thu, 6 Aug 2026 22:21:32 +1200 Subject: [PATCH 13/32] fix: normalised MessageCommandData attributes --- src/features/commands/commands.types.ts | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/features/commands/commands.types.ts b/src/features/commands/commands.types.ts index 9069799..95772e5 100644 --- a/src/features/commands/commands.types.ts +++ b/src/features/commands/commands.types.ts @@ -17,6 +17,7 @@ import { export type ChatInputCommandContext = "SlashCommand" | "SlashSubcommand" | "SlashSubcommandGroup"; export type CommandFlags = "Cached" | "DeferReply" | "EphemeralReply" | "ExpectModal"; +export type MessageCommandFlags = "InGuild" | "OutGuild"; export type CommandFunction = ( client: TriviousClient, interaction: T @@ -25,14 +26,11 @@ export type CommandFunction = ( /** * Base Trivious command data * - * @param context The command context - * @param commandType ApplicationCommandType * @param active Whether or not to register and recognise the command - * @param flags Command behaviour modifiers + * @param permissions What users and roles can use the command */ export interface BaseCommandData { active: boolean; - flags?: CommandFlags[]; permissions?: CommandPermissionValues; } @@ -43,6 +41,7 @@ export interface BaseCommandData { * @param commandType ApplicationCommandType.ChatInput */ export interface BaseChatInputCommandData extends BaseCommandData { + flags?: CommandFlags[]; context: ChatInputCommandContext; commandType: ApplicationCommandType.ChatInput; } @@ -54,6 +53,7 @@ export interface BaseChatInputCommandData extends BaseCommandData { */ export interface ContextCommandData extends BaseCommandData { + flags?: CommandFlags[]; commandType: T extends null ? ApplicationCommandType.Message | ApplicationCommandType.User : T extends "Message" @@ -143,16 +143,16 @@ export type MessageCommandArgs = export interface MessageCommandData< Arguments extends ReadOnlyStrArray = readonly string[] | undefined, -> { + InGuild extends boolean = boolean, +> extends BaseCommandData { context: "MessageCommand"; - active: boolean; - permissions?: CommandPermissionValues; name: string; arguments?: Arguments; aliases?: string[]; + flags?: MessageCommandFlags[]; execute: ( client: TriviousClient, - message: Message, + message: Message, args: MessageCommandArgs ) => Promise; } From bbbc92b3c26cd61a813698165ebf8f4f76c0432d Mon Sep 17 00:00:00 2001 From: Commonly <51011212+commonly-ts@users.noreply.github.com> Date: Thu, 6 Aug 2026 22:22:03 +1200 Subject: [PATCH 14/32] WIP: message command permissions and flags logic --- src/features/events/presets/messageCreate.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/features/events/presets/messageCreate.ts b/src/features/events/presets/messageCreate.ts index b33a1f2..ef8df95 100644 --- a/src/features/events/presets/messageCreate.ts +++ b/src/features/events/presets/messageCreate.ts @@ -1,3 +1,4 @@ +import { canMemberRunCommand } from "#feature/permissions/methods.permissions.js"; import { Event } from "#typings"; import { BitField, GatewayIntentBits } from "discord.js"; @@ -35,6 +36,25 @@ export default { content: `Invalid command; does not exist, missing handler, or is inactive.`, })); + const commandPerms = canMemberRunCommand(client, command, message.member || message.author); + const hasPermission = commandPerms[0] ? true : false; + if (!hasPermission) { + return void (await message.reply({ + content: "You do not have permission to run this command", + })); + } + + if (command.flags) { + if ("InGuild" in command.flags && !message.member) + return void (await message.reply({ + content: "This command can only be ran inside a guild!", + })); + if ("OutGuild" in command.flags && message.member) + return void (await message.reply({ + content: "This command **cannot** be ran inside a guild!", + })); + } + const expectedArgs = command.arguments?.length || 0; if (rawArgs.length < expectedArgs && command.arguments) { return void (await message.reply({ From e716ed5bb2684e415d63fdd16054cca76dcc89ad Mon Sep 17 00:00:00 2001 From: Commonly <51011212+commonly-ts@users.noreply.github.com> Date: Thu, 6 Aug 2026 22:22:24 +1200 Subject: [PATCH 15/32] chore: clarified debug log for preset event registration --- src/features/events/registry.events.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/events/registry.events.ts b/src/features/events/registry.events.ts index 44c1edc..cbc57e8 100644 --- a/src/features/events/registry.events.ts +++ b/src/features/events/registry.events.ts @@ -29,7 +29,7 @@ async function loadPresetEvents(client: TriviousClient) { continue; } client.stores.events.set(event.name, event); - client.logger.debug("Registered event:", event.name); + client.logger.debug("Registered preset-event:", event.name); } } From 94bd74c8fa21aac001ffd6fce3a032f37fd7e5d2 Mon Sep 17 00:00:00 2001 From: Commonly <51011212+commonly-ts@users.noreply.github.com> Date: Thu, 6 Aug 2026 22:22:47 +1200 Subject: [PATCH 16/32] fix: added message commands to permissions util funcs --- src/features/permissions/methods.permissions.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/features/permissions/methods.permissions.ts b/src/features/permissions/methods.permissions.ts index ff11659..1b549f1 100644 --- a/src/features/permissions/methods.permissions.ts +++ b/src/features/permissions/methods.permissions.ts @@ -1,13 +1,14 @@ -import { BaseCommandData, Component, TriviousClient } from "#typings"; +import { BaseCommandData, Component, MessageCommandData, TriviousClient } from "#typings"; import { GuildMember, PermissionFlagsBits, User } from "discord.js"; export function canMemberRunCommand( client: TriviousClient, - command: BaseCommandData | Component, - member: GuildMember + command: BaseCommandData | Component | MessageCommandData, + member: GuildMember | User ): [boolean, string] { const { permissions } = command; if (!permissions) return [true, "No permissions set"]; + if (!("nickname" in member)) return canUserRunCommand(client, command, member); // If the member is a bot owner or has Administrator permissions if ( @@ -42,7 +43,7 @@ export function canMemberRunCommand( export function canUserRunCommand( client: TriviousClient, - command: BaseCommandData | Component, + command: BaseCommandData | Component | MessageCommandData, user: User ): [boolean, string] { const { permissions } = command; From 4ae709a9a3d95c098d1d7c38cbe4ccf59047579a Mon Sep 17 00:00:00 2001 From: commonly-ts <51011212+commonly-ts@users.noreply.github.com> Date: Fri, 7 Aug 2026 19:33:39 +1200 Subject: [PATCH 17/32] fix: changed #src path to #trivious --- package.json | 3 ++- tests/data/commands/debug-stats.ts | 2 +- tests/data/commands/debug/config/edit.ts | 2 +- tests/data/commands/debug/config/index.ts | 2 +- tests/data/commands/debug/index.ts | 2 +- tests/data/commands/debug/ping.ts | 2 +- tests/data/commands/message-cmd.ts | 2 +- tests/data/commands/message-context.ts | 2 +- tests/data/commands/note-add.ts | 2 +- tests/data/commands/note.ts | 2 +- tests/data/commands/user-context.ts | 2 +- tests/data/components/button.ts | 2 +- tests/data/components/modal.ts | 2 +- tests/data/components/selectMenu.ts | 2 +- tsconfig.json | 3 ++- 15 files changed, 17 insertions(+), 15 deletions(-) diff --git a/package.json b/package.json index 450561e..45f6f99 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,8 @@ "#shared/*": "./lib/shared/*", "#feature/*": "./lib/features/*", "#utility/*": "./lib/utility/*", - "#src/*": "./lib/*" + "#trivious": "./lib/index.js", + "#trivious/*": "./lib/*" }, "exports": { ".": { diff --git a/tests/data/commands/debug-stats.ts b/tests/data/commands/debug-stats.ts index b9e377c..76c18b4 100644 --- a/tests/data/commands/debug-stats.ts +++ b/tests/data/commands/debug-stats.ts @@ -1,4 +1,4 @@ -import { createSlashSubcommand } from "#src/index.js"; +import { createSlashSubcommand } from "#trivious"; import { SlashCommandSubcommandBuilder } from "discord.js"; import debugCommand from "./debug/index.js"; diff --git a/tests/data/commands/debug/config/edit.ts b/tests/data/commands/debug/config/edit.ts index 111a20a..4d2e9a2 100644 --- a/tests/data/commands/debug/config/edit.ts +++ b/tests/data/commands/debug/config/edit.ts @@ -1,4 +1,4 @@ -import { createSlashSubcommand } from "#src/index.js"; +import { createSlashSubcommand } from "#trivious"; import { SlashCommandSubcommandBuilder } from "discord.js"; export default createSlashSubcommand({ diff --git a/tests/data/commands/debug/config/index.ts b/tests/data/commands/debug/config/index.ts index e00f367..7d3a376 100644 --- a/tests/data/commands/debug/config/index.ts +++ b/tests/data/commands/debug/config/index.ts @@ -1,4 +1,4 @@ -import { createSlashSubcommandGroup } from "#src/index.js"; +import { createSlashSubcommandGroup } from "#trivious"; import { SlashCommandSubcommandGroupBuilder } from "discord.js"; export default createSlashSubcommandGroup({ diff --git a/tests/data/commands/debug/index.ts b/tests/data/commands/debug/index.ts index d0113fe..f842d8b 100644 --- a/tests/data/commands/debug/index.ts +++ b/tests/data/commands/debug/index.ts @@ -1,4 +1,4 @@ -import { createSlashCommand } from "#src/index.js"; +import { createSlashCommand } from "#trivious"; import { SlashCommandBuilder } from "discord.js"; export default createSlashCommand({ diff --git a/tests/data/commands/debug/ping.ts b/tests/data/commands/debug/ping.ts index a2aec8d..010903b 100644 --- a/tests/data/commands/debug/ping.ts +++ b/tests/data/commands/debug/ping.ts @@ -1,4 +1,4 @@ -import { createSlashSubcommand, interactionReply } from "#src/index.js"; +import { createSlashSubcommand, interactionReply } from "#trivious"; import { SlashCommandSubcommandBuilder } from "discord.js"; export default createSlashSubcommand({ diff --git a/tests/data/commands/message-cmd.ts b/tests/data/commands/message-cmd.ts index f3cf2ff..f71243e 100644 --- a/tests/data/commands/message-cmd.ts +++ b/tests/data/commands/message-cmd.ts @@ -1,4 +1,4 @@ -import { createMessageCommand } from "#src/index.js"; +import { createMessageCommand } from "#trivious"; export default createMessageCommand({ active: true, diff --git a/tests/data/commands/message-context.ts b/tests/data/commands/message-context.ts index cb14e45..b635f0a 100644 --- a/tests/data/commands/message-context.ts +++ b/tests/data/commands/message-context.ts @@ -1,4 +1,4 @@ -import { createMessageContextCommand } from "#src/index.js"; +import { createMessageContextCommand } from "#trivious"; import { ContextMenuCommandBuilder } from "discord.js"; export default createMessageContextCommand({ diff --git a/tests/data/commands/note-add.ts b/tests/data/commands/note-add.ts index 0dfacdf..f72cab4 100644 --- a/tests/data/commands/note-add.ts +++ b/tests/data/commands/note-add.ts @@ -1,4 +1,4 @@ -import { createSlashSubcommand } from "#src/index.js"; +import { createSlashSubcommand } from "#trivious"; import { SlashCommandSubcommandBuilder } from "discord.js"; import noteCommand from "./note.js"; diff --git a/tests/data/commands/note.ts b/tests/data/commands/note.ts index 3fa31fd..0780113 100644 --- a/tests/data/commands/note.ts +++ b/tests/data/commands/note.ts @@ -1,4 +1,4 @@ -import { createSlashCommand } from "#src/index.js"; +import { createSlashCommand } from "#trivious"; import { SlashCommandBuilder } from "discord.js"; export default createSlashCommand({ diff --git a/tests/data/commands/user-context.ts b/tests/data/commands/user-context.ts index 28f7168..e91ce5e 100644 --- a/tests/data/commands/user-context.ts +++ b/tests/data/commands/user-context.ts @@ -1,4 +1,4 @@ -import { createUserContextCommand } from "#src/index.js"; +import { createUserContextCommand } from "#trivious"; import { ContextMenuCommandBuilder } from "discord.js"; export default createUserContextCommand({ diff --git a/tests/data/components/button.ts b/tests/data/components/button.ts index d1eb8c3..916dc28 100644 --- a/tests/data/components/button.ts +++ b/tests/data/components/button.ts @@ -1,4 +1,4 @@ -import { createButtonComponent } from "#src/index.js"; +import { createButtonComponent } from "#trivious"; export default createButtonComponent({ identifier: "button", diff --git a/tests/data/components/modal.ts b/tests/data/components/modal.ts index 1f73a6f..846cec8 100644 --- a/tests/data/components/modal.ts +++ b/tests/data/components/modal.ts @@ -1,4 +1,4 @@ -import { createModalComponent } from "#src/index.js"; +import { createModalComponent } from "#trivious"; export default createModalComponent({ identifier: "modal", diff --git a/tests/data/components/selectMenu.ts b/tests/data/components/selectMenu.ts index 4c7e701..d893062 100644 --- a/tests/data/components/selectMenu.ts +++ b/tests/data/components/selectMenu.ts @@ -1,4 +1,4 @@ -import { createSelectMenuComponent } from "#src/index.js"; +import { createSelectMenuComponent } from "#trivious"; export default createSelectMenuComponent({ identifier: "selectMenu", diff --git a/tsconfig.json b/tsconfig.json index a89c24a..260eb0a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -16,7 +16,8 @@ "#shared/*": ["./src/shared/*"], "#feature/*": ["./src/features/*"], "#utility/*": ["./src/utility/*"], - "#src/*": ["./src/*"] + "#trivious": ["./src/index.ts"], + "#trivious/*": ["./src/*"] } }, "include": ["src", "dev", "tests", "vitest.config.ts", "tsup.config.ts", "eslint.config.ts"], From b4e9fac5ef74edcbfdb72acf1e87e33f51486e45 Mon Sep 17 00:00:00 2001 From: commonly-ts <51011212+commonly-ts@users.noreply.github.com> Date: Fri, 7 Aug 2026 19:34:29 +1200 Subject: [PATCH 18/32] fix: moved slash command methods into own handler file Reserving methods.commands.ts for high-level functions --- .../commands/handlers/slash.commands.ts | 86 +++++++++++++++++++ src/features/commands/methods.commands.ts | 86 +------------------ src/index.ts | 2 + 3 files changed, 89 insertions(+), 85 deletions(-) create mode 100644 src/features/commands/handlers/slash.commands.ts diff --git a/src/features/commands/handlers/slash.commands.ts b/src/features/commands/handlers/slash.commands.ts new file mode 100644 index 0000000..3ae885b --- /dev/null +++ b/src/features/commands/handlers/slash.commands.ts @@ -0,0 +1,86 @@ +import { CommandFlags, SlashCommandData, TriviousClient } from "#typings"; +import { ChatInputCommandInteraction } from "discord.js"; +import { interactionReply } from "../methods.commands.js"; + +async function handleFlags(interaction: ChatInputCommandInteraction, flags?: CommandFlags[]) { + if (flags?.includes("Cached") && !interaction.inCachedGuild()) return; + if (flags?.includes("ExpectModal")) return; + if (flags?.includes("DeferReply")) { + await interactionReply({ + interaction, + flags: flags, + replyPayload: { content: "Processing command..." }, + }); + } +} + +export async function handleSlashCommand( + client: TriviousClient, + command: SlashCommandData, + interaction: ChatInputCommandInteraction +) { + const { options } = interaction; + + const subcommandGroup = options.getSubcommandGroup(false); + const subcommand = options.getSubcommand(false); + + if (!subcommandGroup && !subcommand) { + await handleFlags(interaction, command.flags); + + if ("run" in command && command.run) { + try { + await command.run(client, interaction); + } catch (err: any) { + console.error(err); + } + } + + return; + } + + if (subcommandGroup && command.subcommandGroups && subcommand) { + const foundGroup = command.subcommandGroups.get(subcommandGroup); + if (!foundGroup) { + await interactionReply({ + interaction, + flags: ["EphemeralReply"], + replyPayload: { + content: "Subcommand group is outdated, inactive, or does not have a handler!", + }, + }); + return; + } + + const foundSubcommand = foundGroup.subcommands.get(subcommand); + if (!foundSubcommand) { + await interactionReply({ + interaction, + flags: ["EphemeralReply"], + replyPayload: { content: "Subcommand is outdated, inactive, or does not have a handler!" }, + }); + return; + } + + await handleFlags(interaction, foundSubcommand.flags || command.flags); + return await foundSubcommand.execute(client, interaction); + } else if (subcommand && command.subcommands) { + const foundSubcommand = command.subcommands.get(subcommand); + if (!foundSubcommand) { + await interactionReply({ + interaction, + flags: ["EphemeralReply"], + replyPayload: { content: "Subcommand is outdated, inactive, or does not have a handler!" }, + }); + return; + } + + await handleFlags(interaction, foundSubcommand.flags || command.flags); + return await foundSubcommand.execute(client, interaction); + } else { + await interactionReply({ + interaction, + flags: ["EphemeralReply"], + replyPayload: { content: "Command is outdated, inactive, or does not have a handler!" }, + }); + } +} diff --git a/src/features/commands/methods.commands.ts b/src/features/commands/methods.commands.ts index 68f2906..b706f86 100644 --- a/src/features/commands/methods.commands.ts +++ b/src/features/commands/methods.commands.ts @@ -1,7 +1,6 @@ -import { CommandFlags, SlashCommandData, TriviousClient } from "#typings"; +import { CommandFlags } from "#typings"; import { CacheType, - ChatInputCommandInteraction, Interaction, InteractionEditReplyOptions, InteractionReplyOptions, @@ -46,86 +45,3 @@ export async function interactionReply(options: { return await interaction.reply(payload); } - -async function handleFlags(interaction: ChatInputCommandInteraction, flags?: CommandFlags[]) { - if (flags?.includes("Cached") && !interaction.inCachedGuild()) return; - if (flags?.includes("ExpectModal")) return; - if (flags?.includes("DeferReply")) { - await interactionReply({ - interaction, - flags: flags, - replyPayload: { content: "Processing command..." }, - }); - } -} - -export async function handleSlashCommand( - client: TriviousClient, - command: SlashCommandData, - interaction: ChatInputCommandInteraction -) { - const { options } = interaction; - - const subcommandGroup = options.getSubcommandGroup(false); - const subcommand = options.getSubcommand(false); - - if (!subcommandGroup && !subcommand) { - await handleFlags(interaction, command.flags); - - if ("run" in command && command.run) { - try { - await command.run(client, interaction); - } catch (err: any) { - console.error(err); - } - } - - return; - } - - if (subcommandGroup && command.subcommandGroups && subcommand) { - const foundGroup = command.subcommandGroups.get(subcommandGroup); - if (!foundGroup) { - await interactionReply({ - interaction, - flags: ["EphemeralReply"], - replyPayload: { - content: "Subcommand group is outdated, inactive, or does not have a handler!", - }, - }); - return; - } - - const foundSubcommand = foundGroup.subcommands.get(subcommand); - if (!foundSubcommand) { - await interactionReply({ - interaction, - flags: ["EphemeralReply"], - replyPayload: { content: "Subcommand is outdated, inactive, or does not have a handler!" }, - }); - return; - } - - await handleFlags(interaction, foundSubcommand.flags || command.flags); - return await foundSubcommand.execute(client, interaction); - } else if (subcommand && command.subcommands) { - const foundSubcommand = command.subcommands.get(subcommand); - if (!foundSubcommand) { - await interactionReply({ - interaction, - flags: ["EphemeralReply"], - replyPayload: { content: "Subcommand is outdated, inactive, or does not have a handler!" }, - }); - return; - } - - await handleFlags(interaction, foundSubcommand.flags || command.flags); - return await foundSubcommand.execute(client, interaction); - } else { - await interactionReply({ - interaction, - flags: ["EphemeralReply"], - replyPayload: { content: "Command is outdated, inactive, or does not have a handler!" }, - }); - } -} diff --git a/src/index.ts b/src/index.ts index 5faa219..924096b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -3,6 +3,8 @@ export * from "#typings"; // Methods export * from "#feature/builders/utility.builders.js"; +export * from "#feature/commands/handlers/message.commands.js"; +export * from "#feature/commands/handlers/slash.commands.js"; export * from "#feature/commands/methods.commands.js"; export { default as customId } from "#feature/customId/methods.customid.js"; From be8a0b2e8d3245b5b8bb794523f3b207e86e4f67 Mon Sep 17 00:00:00 2001 From: commonly-ts <51011212+commonly-ts@users.noreply.github.com> Date: Fri, 7 Aug 2026 19:34:57 +1200 Subject: [PATCH 19/32] updated import path --- src/features/events/presets/interactionCreate.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/events/presets/interactionCreate.ts b/src/features/events/presets/interactionCreate.ts index 47ede22..c8aef94 100644 --- a/src/features/events/presets/interactionCreate.ts +++ b/src/features/events/presets/interactionCreate.ts @@ -1,6 +1,6 @@ -import { handleSlashCommand, interactionReply } from "#feature/commands/methods.commands.js"; import customId from "#feature/customId/methods.customid.js"; import { canMemberRunCommand } from "#feature/permissions/methods.permissions.js"; +import { handleSlashCommand, interactionReply } from "#trivious"; import { ComponentContext, SlashCommandData, From 774553c907c8c694ff8b5ac1b7e091d7ba32e1d0 Mon Sep 17 00:00:00 2001 From: commonly-ts <51011212+commonly-ts@users.noreply.github.com> Date: Sun, 9 Aug 2026 17:32:37 +1200 Subject: [PATCH 20/32] updated msg command types --- src/features/client/client.types.ts | 19 ++++++++- src/features/client/trivious.client.ts | 2 +- src/features/commands/builders.commands.ts | 11 ++++-- src/features/commands/commands.types.ts | 46 ++++++++++++++++++---- src/features/commands/registry.commands.ts | 4 +- 5 files changed, 68 insertions(+), 14 deletions(-) diff --git a/src/features/client/client.types.ts b/src/features/client/client.types.ts index bf19986..8790adf 100644 --- a/src/features/client/client.types.ts +++ b/src/features/client/client.types.ts @@ -72,6 +72,23 @@ export interface CommandHashConfiguration { persistentDataPath: string; } +/** + * Message command configuration + * + * @param prefix Usually a single character (e.g. `?`, `!`, `.`) to identify message commands + * @param delimiter Specific character(s) and/or symbol(s) to mark boundary of strings, mainly for use by `sentence` argument types + */ +export interface MessageCommandConfiguration { + /** + * Recommended value(s): `?` `!` `.` + */ + prefix: string; + /** + * Recommended value(s): `#` `|` `$` + */ + delimiter?: string | string[]; +} + /** * Trivious client options * @@ -86,5 +103,5 @@ export interface TriviousClientOptions extends ClientOptions { ownerUserIds?: string[]; commandHashConfig?: CommandHashConfiguration; debug?: boolean; - messageCommandPrefix?: string; + messageCommands?: MessageCommandConfiguration; } diff --git a/src/features/client/trivious.client.ts b/src/features/client/trivious.client.ts index 1e766dc..cf0e409 100644 --- a/src/features/client/trivious.client.ts +++ b/src/features/client/trivious.client.ts @@ -22,7 +22,7 @@ export default class TriviousClient extends Client { commands: { chatInput: Collection; context: Collection; - message: Collection; + message: Collection>; }; components: Collection; events: Collection; diff --git a/src/features/commands/builders.commands.ts b/src/features/commands/builders.commands.ts index 0ae51a3..431d9f7 100644 --- a/src/features/commands/builders.commands.ts +++ b/src/features/commands/builders.commands.ts @@ -1,16 +1,19 @@ import { ContextCommandData, + MessageCommandArgument, MessageCommandData, - ReadOnlyStrArray, + RO_ArrayType, SlashCommandData, SlashSubcommandData, SlashSubcommandGroupData, } from "#typings"; import { ApplicationCommandType, Collection } from "discord.js"; -export function createMessageCommand( - command: Omit, "context"> -): MessageCommandData { +export function createMessageCommand< + const T extends RO_ArrayType = undefined, +>( + command: Omit, "context" | "regex"> +): Omit, "regex"> { return { context: "MessageCommand", ...command, diff --git a/src/features/commands/commands.types.ts b/src/features/commands/commands.types.ts index 95772e5..32e0496 100644 --- a/src/features/commands/commands.types.ts +++ b/src/features/commands/commands.types.ts @@ -133,16 +133,48 @@ export interface MessageCommandBaseData { permissions?: CommandPermissionValues; } -export type ReadOnlyStrArray = readonly string[] | undefined; -export type MessageCommandArgs = - Arguments extends readonly string[] +export type RO_ArrayType = readonly T[] | undefined; +export type MessageCommandArgs> = + Arguments extends readonly MessageCommandArgument[] ? [Arguments[number]] extends [never] ? null - : Map + : Collection : null; +export type MessageCommandArgumentType = + | "text" + | "number" + | "timestamp" + | "snowflake" + | "snowflake/user" + | "snowflake/channel" + | "snowflake/role" + | "duration"; + +export interface MessageCommandArgument { + name: string; + description: string; + dataType: MessageCommandArgumentType; + required?: boolean; + value?: string; +} + +export interface MessageCommandInteraction< + Arguments extends RO_ArrayType = + | readonly MessageCommandArgument[] + | undefined, + InGuild extends boolean = boolean, +> { + args: MessageCommandArgs; + command: MessageCommandData; + message: Message; +} + export interface MessageCommandData< - Arguments extends ReadOnlyStrArray = readonly string[] | undefined, + Processed extends boolean = boolean, + Arguments extends RO_ArrayType = + | readonly MessageCommandArgument[] + | undefined, InGuild extends boolean = boolean, > extends BaseCommandData { context: "MessageCommand"; @@ -150,9 +182,9 @@ export interface MessageCommandData< arguments?: Arguments; aliases?: string[]; flags?: MessageCommandFlags[]; + regex: Processed extends true ? RegExp : undefined; execute: ( client: TriviousClient, - message: Message, - args: MessageCommandArgs + interaction: MessageCommandInteraction ) => Promise; } diff --git a/src/features/commands/registry.commands.ts b/src/features/commands/registry.commands.ts index 531cab6..b4806b0 100644 --- a/src/features/commands/registry.commands.ts +++ b/src/features/commands/registry.commands.ts @@ -13,6 +13,7 @@ import { importFile } from "#utility/functions.js"; import { ApplicationCommandType, Collection } from "discord.js"; import { existsSync, promises as fs } from "fs"; import path from "path"; +import { processPartialMessageCommand } from "./handlers/message.commands.js"; const parsedCache = new Set(); async function parseBase(input: string | T, expects?: (base: Partial) => boolean) { @@ -163,8 +164,9 @@ async function registerMessageCommands(client: TriviousClient, data: CollatedCom client.logger.warn( `Message command '${command.name}' has been overridden by a command with the same name` ); + const processedCommand = processPartialMessageCommand(client, command); client.logger.debug("Registered message command:", command.name); - client.stores.commands.message.set(command.name, command); + client.stores.commands.message.set(command.name, processedCommand); if (command.aliases) command.aliases.forEach((alias) => { client.logger.debug( From 296d8cb026de26fd8ca59548a7faee1a226b7d21 Mon Sep 17 00:00:00 2001 From: commonly-ts <51011212+commonly-ts@users.noreply.github.com> Date: Sun, 9 Aug 2026 17:32:46 +1200 Subject: [PATCH 21/32] updated test data --- dev/index.ts | 10 +++++++--- tests/data/commands/message-cmd.ts | 15 +++++++++++---- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/dev/index.ts b/dev/index.ts index b532eb6..48b38f0 100644 --- a/dev/index.ts +++ b/dev/index.ts @@ -12,11 +12,15 @@ const client = new TriviousClient({ clientIdReference: "CLIENT_ID", tokenReference: "BOT_TOKEN", }, - messageCommandPrefix: "?", + messageCommands: { + prefix: "?", + delimiter: ['"', "#"], + }, debug: true, }); (async () => { - await client.register(); - // await client.start(false); + // await client.register(); + // console.log(client.stores.commands.message); + await client.start(false); })(); diff --git a/tests/data/commands/message-cmd.ts b/tests/data/commands/message-cmd.ts index f71243e..8be7db8 100644 --- a/tests/data/commands/message-cmd.ts +++ b/tests/data/commands/message-cmd.ts @@ -3,9 +3,16 @@ import { createMessageCommand } from "#trivious"; export default createMessageCommand({ active: true, name: "ping-test", - aliases: ["png"], - arguments: ["type"], - async execute(client, message, args) { - await message.reply({ content: `Hello world! Given argument: \`${args.get("type")}\`` }); + aliases: ["pt"], + arguments: [ + { name: "user", dataType: "snowflake/user", description: "Target user" }, + { name: "reason", dataType: "text", description: "A good reason" }, + { name: "duration", dataType: "duration", description: "A duration" }, + ] as const, + async execute(client, interaction) { + const { args, command, message } = interaction; + await message.reply({ + content: args.map((value, name) => `[${name}]: ${value}`).join("\n"), + }); }, }); From bf8249f0bc99f82c18a4fdc79fa9fc3016b629bf Mon Sep 17 00:00:00 2001 From: commonly-ts <51011212+commonly-ts@users.noreply.github.com> Date: Sun, 9 Aug 2026 17:33:02 +1200 Subject: [PATCH 22/32] message command util functions --- .../commands/handlers/message.commands.ts | 35 +++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/features/commands/handlers/message.commands.ts diff --git a/src/features/commands/handlers/message.commands.ts b/src/features/commands/handlers/message.commands.ts new file mode 100644 index 0000000..ba26ddf --- /dev/null +++ b/src/features/commands/handlers/message.commands.ts @@ -0,0 +1,35 @@ +import { MessageCommandArgumentType, MessageCommandData, TriviousClient } from "#typings"; + +const argumentRegex: Record = { + "duration": /\d+[smhdwy]/, + "text": /.+?/, + "snowflake": /<[@#&]?\d+>|\d+/, + "snowflake/user": /<[@]?\d+>|\d+/, + "snowflake/channel": /<[#]?\d+>|\d+/, + "snowflake/role": /<[&]?\d+>|\d+/, + "timestamp": /\d{10}/, + "number": /[+-]?\d+\.\d*?|\.\d+/, +}; + +export function processPartialMessageCommand( + client: TriviousClient, + command: MessageCommandData +): MessageCommandData { + let pattern = `^${command.name}`; + if (command.arguments) { + for (const argument of command.arguments) { + const { dataType } = argument; + let required = argument.required; + if (required === undefined) { + command.arguments.find((arg) => arg.name === argument.name)!.required = true; + required = true; + } + const source = argumentRegex[dataType].source; + if (!source) continue; + pattern += required ? `\\s+(${source})` : `(?:\\s+(${source}))?`; + } + } + pattern += "$"; + command.regex = new RegExp(pattern); + return command; +} From 7d5b206e200d6d91c5670ce21f7603a6b35a135e Mon Sep 17 00:00:00 2001 From: commonly-ts <51011212+commonly-ts@users.noreply.github.com> Date: Sun, 9 Aug 2026 17:33:17 +1200 Subject: [PATCH 23/32] wip message command handler --- src/features/events/presets/messageCreate.ts | 158 ++++++++++++------- 1 file changed, 105 insertions(+), 53 deletions(-) diff --git a/src/features/events/presets/messageCreate.ts b/src/features/events/presets/messageCreate.ts index ef8df95..6370542 100644 --- a/src/features/events/presets/messageCreate.ts +++ b/src/features/events/presets/messageCreate.ts @@ -1,9 +1,112 @@ import { canMemberRunCommand } from "#feature/permissions/methods.permissions.js"; -import { Event } from "#typings"; -import { BitField, GatewayIntentBits } from "discord.js"; +import { Event, MessageCommandData, TriviousClient } from "#typings"; +import { + BitField, + Collection, + GatewayIntentBits, + Message, + OmitPartialGroupDMChannel, +} from "discord.js"; + +async function doPermissionsCheck( + client: TriviousClient, + command: MessageCommandData, + message: OmitPartialGroupDMChannel> +): Promise { + const [hasPermission, reason] = canMemberRunCommand( + client, + command, + message.member || message.author + ); + if (!hasPermission) { + await message.reply({ + content: `You do not have permission to run this command: ${reason}`, + }); + return false; + } + return true; +} + +async function doArgumentChecks( + command: MessageCommandData, + rawArgs: string[], + message: OmitPartialGroupDMChannel> +) { + const expectedArgs = command.arguments?.length || 0; + if (rawArgs.length < expectedArgs && command.arguments) { + return void (await message.reply({ + content: `Missing or incomplete arguments. I expected ${expectedArgs} arguments, but received only ${rawArgs.length}.\nNext missing argument is '${command.arguments[rawArgs.length]}'`, + })); + } +} + +async function doCommandFlagChecks( + command: MessageCommandData, + message: OmitPartialGroupDMChannel> +): Promise { + if (!command.flags) return; + if ("InGuild" in command.flags && !message.member) + return void (await message.reply({ + content: "This command can only be ran inside a guild!", + })); + if ("OutGuild" in command.flags && message.member) + return void (await message.reply({ + content: "This command **cannot** be ran inside a guild!", + })); +} + +async function getCommand( + client: TriviousClient, + commandName: string, + message: OmitPartialGroupDMChannel> +): Promise | null> { + let command = client.stores.commands.message.get(commandName.toLowerCase()); + if (!command) { + const mappedCommandName = client.stores.messageCommandAlises.get(commandName.toLowerCase()); + command = mappedCommandName ? client.stores.commands.message.get(mappedCommandName) : undefined; + } + + if (!command || !command.active) { + await message.reply({ + content: `Invalid command; does not exist, missing handler, or is inactive.`, + }); + return null; + } + return command; +} export default { name: "messageCreate", + async execute(client, message) { + const config = client.trivious.messageCommands; + if (!config) + return client.logger.warn( + "At least one message command is registered, but message commands have not been configured in the TriviousClient." + ); + const { prefix } = config; + if (!message.content.startsWith(prefix)) return; + const input = message.content.slice(prefix.length); + const [commandName] = input.split(" "); + + const command = await getCommand(client, commandName, message); + if (!command) return; + const hasPermission = await doPermissionsCheck(client, command, message); + if (!hasPermission) return; + await doCommandFlagChecks(command, message); + + let args: Collection | null = null; + if (command.arguments) { + const result = input.match(command.regex); + if (!result) + return void (await message.reply({ content: "Failed parsing command arguments" })); + const matches = result.slice(1, command.arguments.length + 1); + args = new Collection( + matches.map((value, index) => [command.arguments![index]!.name, value]) + ); + } + + await command.execute(client, { message, command, args }); + }, conditions(client) { return [ [client.stores.commands.message.size > 0, "At least one (1) message command registered."], @@ -17,55 +120,4 @@ export default { ], ]; }, - async execute(client, message) { - const prefix = client.trivious.messageCommandPrefix; - if (!prefix) - return client.logger.warn( - "At least one message command is registered, but no command prefix is configured. Ensure the TriviousClient has 'messageCommandPrefix' set to a string value." - ); - - if (!message.content.startsWith(prefix)) return; - const [commandName, ...rawArgs] = message.content.slice(prefix.length).split(" "); - const alias = client.stores.messageCommandAlises.get(commandName.toLowerCase()) || ""; - const command = - client.stores.commands.message.get(commandName.toLowerCase()) || - client.stores.commands.message.get(alias); - - if (!command || !command.active) - return void (await message.reply({ - content: `Invalid command; does not exist, missing handler, or is inactive.`, - })); - - const commandPerms = canMemberRunCommand(client, command, message.member || message.author); - const hasPermission = commandPerms[0] ? true : false; - if (!hasPermission) { - return void (await message.reply({ - content: "You do not have permission to run this command", - })); - } - - if (command.flags) { - if ("InGuild" in command.flags && !message.member) - return void (await message.reply({ - content: "This command can only be ran inside a guild!", - })); - if ("OutGuild" in command.flags && message.member) - return void (await message.reply({ - content: "This command **cannot** be ran inside a guild!", - })); - } - - const expectedArgs = command.arguments?.length || 0; - if (rawArgs.length < expectedArgs && command.arguments) { - return void (await message.reply({ - content: `Missing or incomplete arguments. I expected ${expectedArgs} arguments, but received only ${rawArgs.length}.\nNext missing argument is '${command.arguments[rawArgs.length]}'`, - })); - } - const args = command.arguments - ? new Map( - command.arguments.slice(0, expectedArgs).map((name, index) => [name, rawArgs[index]]) - ) - : null; - await command.execute(client, message, args); - }, } satisfies Event<"messageCreate">; From ceda7ef347f3c013f08e23e99f6281780affa924 Mon Sep 17 00:00:00 2001 From: commonly-ts <51011212+commonly-ts@users.noreply.github.com> Date: Sun, 9 Aug 2026 17:44:55 +1200 Subject: [PATCH 24/32] improved order of import paths --- package.json | 6 +++--- tsconfig.json | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/package.json b/package.json index 45f6f99..c2f5d68 100644 --- a/package.json +++ b/package.json @@ -23,11 +23,11 @@ "types": "./dist/index.d.ts", "imports": { "#typings": "./lib/shared/typings.js", + "#trivious": "./lib/index.js", + "#trivious/*": "./lib/*", "#shared/*": "./lib/shared/*", "#feature/*": "./lib/features/*", - "#utility/*": "./lib/utility/*", - "#trivious": "./lib/index.js", - "#trivious/*": "./lib/*" + "#utility/*": "./lib/utility/*" }, "exports": { ".": { diff --git a/tsconfig.json b/tsconfig.json index 260eb0a..0b5694c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -13,11 +13,11 @@ "rootDir": ".", "paths": { "#typings": ["./src/shared/typings.ts"], + "#trivious": ["./src/index.ts"], + "#trivious/*": ["./src/*"], "#shared/*": ["./src/shared/*"], "#feature/*": ["./src/features/*"], - "#utility/*": ["./src/utility/*"], - "#trivious": ["./src/index.ts"], - "#trivious/*": ["./src/*"] + "#utility/*": ["./src/utility/*"] } }, "include": ["src", "dev", "tests", "vitest.config.ts", "tsup.config.ts", "eslint.config.ts"], From f72c5c3296ffac3f8398a0e3719b5d4b57f27231 Mon Sep 17 00:00:00 2001 From: commonly-ts <51011212+commonly-ts@users.noreply.github.com> Date: Sun, 9 Aug 2026 20:58:31 +1200 Subject: [PATCH 25/32] tests: updated test files --- package.json | 2 +- pnpm-lock.yaml | 252 +++++++++++++++++------------ tests/commands.registry.test.ts | 27 +++- tests/components.registry.test.ts | 5 +- tests/data/commands/message-cmd.ts | 13 +- tests/events.registry.test.ts | 15 +- tests/modules.registry.test.ts | 5 +- vite.config.ts | 2 + 8 files changed, 197 insertions(+), 124 deletions(-) diff --git a/package.json b/package.json index c2f5d68..9a33736 100644 --- a/package.json +++ b/package.json @@ -33,7 +33,6 @@ ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js", - "require": "./dist/index.cjs", "default": "./dist/index.js" } }, @@ -82,6 +81,7 @@ "tsx": "^4.22.3", "typescript": "^6.0.3", "typescript-eslint": "^8.57.0", + "vite-tsconfig-paths": "^6.1.1", "vitest": "^4.1.7" }, "dependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8b88bc1..305723b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,16 +17,16 @@ importers: version: 9.39.1 '@semantic-release/changelog': specifier: ^6.0.3 - version: 6.0.3(semantic-release@25.0.2(typescript@6.0.3)) + version: 6.0.3(semantic-release@25.0.2(supports-color@7.2.0)(typescript@6.0.3)) '@semantic-release/git': specifier: ^10.0.1 - version: 10.0.1(semantic-release@25.0.2(typescript@6.0.3)) + version: 10.0.1(semantic-release@25.0.2(supports-color@7.2.0)(typescript@6.0.3))(supports-color@7.2.0) '@semantic-release/github': specifier: ^12.0.2 - version: 12.0.2(semantic-release@25.0.2(typescript@6.0.3)) + version: 12.0.2(semantic-release@25.0.2(supports-color@7.2.0)(typescript@6.0.3))(supports-color@7.2.0) '@semantic-release/npm': specifier: ^13.1.2 - version: 13.1.2(semantic-release@25.0.2(typescript@6.0.3)) + version: 13.1.2(semantic-release@25.0.2(supports-color@7.2.0)(typescript@6.0.3)) '@swc/core': specifier: ^1.15.40 version: 1.15.40 @@ -35,10 +35,10 @@ importers: version: 24.10.1 '@typescript-eslint/eslint-plugin': specifier: ^8.57.0 - version: 8.57.0(@typescript-eslint/parser@8.57.0(eslint@10.7.0)(typescript@6.0.3))(eslint@10.7.0)(typescript@6.0.3) + version: 8.57.0(@typescript-eslint/parser@8.57.0(eslint@10.7.0(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@10.7.0(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) '@typescript-eslint/parser': specifier: ^8.57.0 - version: 8.57.0(eslint@10.7.0)(typescript@6.0.3) + version: 8.57.0(eslint@10.7.0(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) '@vitest/coverage-v8': specifier: ^4.1.7 version: 4.1.7(vitest@4.1.7) @@ -47,16 +47,16 @@ importers: version: 17.2.3 eslint: specifier: ^10.7.0 - version: 10.7.0 + version: 10.7.0(supports-color@7.2.0) eslint-config-prettier: specifier: ^10.1.8 - version: 10.1.8(eslint@10.7.0) + version: 10.1.8(eslint@10.7.0(supports-color@7.2.0)) eslint-plugin-import: specifier: ^2.32.0 - version: 2.32.0(@typescript-eslint/parser@8.57.0(eslint@10.7.0)(typescript@6.0.3))(eslint@10.7.0) + version: 2.32.0(@typescript-eslint/parser@8.57.0(eslint@10.7.0(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@10.7.0(supports-color@7.2.0))(supports-color@7.2.0) eslint-plugin-prettier: specifier: ^5.5.5 - version: 5.5.5(eslint-config-prettier@10.1.8(eslint@10.7.0))(eslint@10.7.0)(prettier@3.6.2) + version: 5.5.5(eslint-config-prettier@10.1.8(eslint@10.7.0(supports-color@7.2.0)))(eslint@10.7.0(supports-color@7.2.0))(prettier@3.6.2) globals: specifier: ^17.9.0 version: 17.9.0 @@ -68,10 +68,10 @@ importers: version: 3.6.2 semantic-release: specifier: ^25.0.2 - version: 25.0.2(typescript@6.0.3) + version: 25.0.2(supports-color@7.2.0)(typescript@6.0.3) tsup: specifier: ^8.5.1 - version: 8.5.1(@swc/core@1.15.40)(postcss@8.5.15)(tsx@4.22.3)(typescript@6.0.3) + version: 8.5.1(@swc/core@1.15.40)(postcss@8.5.15)(supports-color@7.2.0)(tsx@4.22.3)(typescript@6.0.3) tsx: specifier: ^4.22.3 version: 4.22.3 @@ -80,7 +80,10 @@ importers: version: 6.0.3 typescript-eslint: specifier: ^8.57.0 - version: 8.57.0(eslint@10.7.0)(typescript@6.0.3) + version: 8.57.0(eslint@10.7.0(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) + vite-tsconfig-paths: + specifier: ^6.1.1 + version: 6.1.1(supports-color@7.2.0)(typescript@6.0.3)(vite@8.0.14(@types/node@24.10.1)(esbuild@0.27.0)(tsx@4.22.3)) vitest: specifier: ^4.1.7 version: 4.1.7(@types/node@24.10.1)(@vitest/coverage-v8@4.1.7)(vite@8.0.14(@types/node@24.10.1)(esbuild@0.27.0)(tsx@4.22.3)) @@ -1896,6 +1899,9 @@ packages: resolution: {integrity: sha512-DpLKbNU4WylpxJykQujfCcwYWiV/Jhm50Goo0wrVILAv5jOr9d+H+UR3PhSCD2rCCEIg0uc+G+muBTwD54JhDQ==} engines: {node: '>= 0.4'} + globrex@0.1.2: + resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==} + gopd@1.2.0: resolution: {integrity: sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==} engines: {node: '>= 0.4'} @@ -3190,6 +3196,17 @@ packages: ts-mixer@6.0.4: resolution: {integrity: sha512-ufKpbmrugz5Aou4wcr5Wc1UUFWOLhq+Fm6qa6P0w0K5Qw2yhaUoiWszhCVuNQyNwrlGiscHOmqYoAox1PtvgjA==} + tsconfck@3.1.6: + resolution: {integrity: sha512-ks6Vjr/jEw0P1gmOVwutM3B7fWxoWBL2KRDb1JfqGVawBmO5UsvmWOQFGHBPl5yxYz4eERr19E6L7NMv+Fej4w==} + engines: {node: ^18 || >=20} + deprecated: unmaintained + hasBin: true + peerDependencies: + typescript: ^5.0.0 + peerDependenciesMeta: + typescript: + optional: true + tsconfig-paths@3.15.0: resolution: {integrity: sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==} @@ -3341,6 +3358,11 @@ packages: validate-npm-package-license@3.0.4: resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} + vite-tsconfig-paths@6.1.1: + resolution: {integrity: sha512-2cihq7zliibCCZ8P9cKJrQBkfgdvcFkOOc3Y02o3GWUDLgqjWsZudaoiuOwO/gzTzy17cS5F7ZPo4bsnS4DGkg==} + peerDependencies: + vite: '*' + vite@8.0.14: resolution: {integrity: sha512-s4BJJ+5y1pYL6Otw51FHhVJQhPnuRinKig64g/1+EUNaJsd3gCKdD31IPFvswUgW9/60QT9oFHbZHbQK5imcxw==} engines: {node: ^20.19.0 || >=22.12.0} @@ -3792,17 +3814,17 @@ snapshots: '@esbuild/win32-x64@0.28.0': optional: true - '@eslint-community/eslint-utils@4.9.1(eslint@10.7.0)': + '@eslint-community/eslint-utils@4.9.1(eslint@10.7.0(supports-color@7.2.0))': dependencies: - eslint: 10.7.0 + eslint: 10.7.0(supports-color@7.2.0) eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.12.2': {} - '@eslint/config-array@0.23.5': + '@eslint/config-array@0.23.5(supports-color@7.2.0)': dependencies: '@eslint/object-schema': 3.0.5 - debug: 4.4.3 + debug: 4.4.3(supports-color@7.2.0) minimatch: 10.2.4 transitivePeerDependencies: - supports-color @@ -4076,25 +4098,25 @@ snapshots: '@sec-ant/readable-stream@0.4.1': {} - '@semantic-release/changelog@6.0.3(semantic-release@25.0.2(typescript@6.0.3))': + '@semantic-release/changelog@6.0.3(semantic-release@25.0.2(supports-color@7.2.0)(typescript@6.0.3))': dependencies: '@semantic-release/error': 3.0.0 aggregate-error: 3.1.0 fs-extra: 11.3.2 lodash: 4.17.23 - semantic-release: 25.0.2(typescript@6.0.3) + semantic-release: 25.0.2(supports-color@7.2.0)(typescript@6.0.3) - '@semantic-release/commit-analyzer@13.0.1(semantic-release@25.0.2(typescript@6.0.3))': + '@semantic-release/commit-analyzer@13.0.1(semantic-release@25.0.2(supports-color@7.2.0)(typescript@6.0.3))(supports-color@7.2.0)': dependencies: conventional-changelog-angular: 8.1.0 conventional-changelog-writer: 8.2.0 conventional-commits-filter: 5.0.0 conventional-commits-parser: 6.2.1 - debug: 4.4.3 - import-from-esm: 2.0.0 + debug: 4.4.3(supports-color@7.2.0) + import-from-esm: 2.0.0(supports-color@7.2.0) lodash-es: 4.17.23 micromatch: 4.0.8 - semantic-release: 25.0.2(typescript@6.0.3) + semantic-release: 25.0.2(supports-color@7.2.0)(typescript@6.0.3) transitivePeerDependencies: - supports-color @@ -4102,21 +4124,21 @@ snapshots: '@semantic-release/error@4.0.0': {} - '@semantic-release/git@10.0.1(semantic-release@25.0.2(typescript@6.0.3))': + '@semantic-release/git@10.0.1(semantic-release@25.0.2(supports-color@7.2.0)(typescript@6.0.3))(supports-color@7.2.0)': dependencies: '@semantic-release/error': 3.0.0 aggregate-error: 3.1.0 - debug: 4.4.3 + debug: 4.4.3(supports-color@7.2.0) dir-glob: 3.0.1 execa: 5.1.1 lodash: 4.17.23 micromatch: 4.0.8 p-reduce: 2.1.0 - semantic-release: 25.0.2(typescript@6.0.3) + semantic-release: 25.0.2(supports-color@7.2.0)(typescript@6.0.3) transitivePeerDependencies: - supports-color - '@semantic-release/github@12.0.2(semantic-release@25.0.2(typescript@6.0.3))': + '@semantic-release/github@12.0.2(semantic-release@25.0.2(supports-color@7.2.0)(typescript@6.0.3))(supports-color@7.2.0)': dependencies: '@octokit/core': 7.0.6 '@octokit/plugin-paginate-rest': 14.0.0(@octokit/core@7.0.6) @@ -4124,22 +4146,22 @@ snapshots: '@octokit/plugin-throttling': 11.0.3(@octokit/core@7.0.6) '@semantic-release/error': 4.0.0 aggregate-error: 5.0.0 - debug: 4.4.3 + debug: 4.4.3(supports-color@7.2.0) dir-glob: 3.0.1 - http-proxy-agent: 7.0.2 - https-proxy-agent: 7.0.6 + http-proxy-agent: 7.0.2(supports-color@7.2.0) + https-proxy-agent: 7.0.6(supports-color@7.2.0) issue-parser: 7.0.1 lodash-es: 4.17.23 mime: 4.1.0 p-filter: 4.1.0 - semantic-release: 25.0.2(typescript@6.0.3) + semantic-release: 25.0.2(supports-color@7.2.0)(typescript@6.0.3) tinyglobby: 0.2.15 undici: 7.22.0 url-join: 5.0.0 transitivePeerDependencies: - supports-color - '@semantic-release/npm@13.1.2(semantic-release@25.0.2(typescript@6.0.3))': + '@semantic-release/npm@13.1.2(semantic-release@25.0.2(supports-color@7.2.0)(typescript@6.0.3))': dependencies: '@actions/core': 1.11.1 '@semantic-release/error': 4.0.0 @@ -4154,23 +4176,23 @@ snapshots: rc: 1.2.8 read-pkg: 10.0.0 registry-auth-token: 5.1.0 - semantic-release: 25.0.2(typescript@6.0.3) + semantic-release: 25.0.2(supports-color@7.2.0)(typescript@6.0.3) semver: 7.7.3 tempy: 3.1.0 - '@semantic-release/release-notes-generator@14.1.0(semantic-release@25.0.2(typescript@6.0.3))': + '@semantic-release/release-notes-generator@14.1.0(semantic-release@25.0.2(supports-color@7.2.0)(typescript@6.0.3))(supports-color@7.2.0)': dependencies: conventional-changelog-angular: 8.1.0 conventional-changelog-writer: 8.2.0 conventional-commits-filter: 5.0.0 conventional-commits-parser: 6.2.1 - debug: 4.4.3 + debug: 4.4.3(supports-color@7.2.0) get-stream: 7.0.1 - import-from-esm: 2.0.0 + import-from-esm: 2.0.0(supports-color@7.2.0) into-stream: 7.0.0 lodash-es: 4.17.23 read-package-up: 11.0.0 - semantic-release: 25.0.2(typescript@6.0.3) + semantic-release: 25.0.2(supports-color@7.2.0)(typescript@6.0.3) transitivePeerDependencies: - supports-color @@ -4279,15 +4301,15 @@ snapshots: dependencies: '@types/node': 24.10.1 - '@typescript-eslint/eslint-plugin@8.57.0(@typescript-eslint/parser@8.57.0(eslint@10.7.0)(typescript@6.0.3))(eslint@10.7.0)(typescript@6.0.3)': + '@typescript-eslint/eslint-plugin@8.57.0(@typescript-eslint/parser@8.57.0(eslint@10.7.0(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@10.7.0(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3)': dependencies: '@eslint-community/regexpp': 4.12.2 - '@typescript-eslint/parser': 8.57.0(eslint@10.7.0)(typescript@6.0.3) + '@typescript-eslint/parser': 8.57.0(eslint@10.7.0(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) '@typescript-eslint/scope-manager': 8.57.0 - '@typescript-eslint/type-utils': 8.57.0(eslint@10.7.0)(typescript@6.0.3) - '@typescript-eslint/utils': 8.57.0(eslint@10.7.0)(typescript@6.0.3) + '@typescript-eslint/type-utils': 8.57.0(eslint@10.7.0(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) + '@typescript-eslint/utils': 8.57.0(eslint@10.7.0(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) '@typescript-eslint/visitor-keys': 8.57.0 - eslint: 10.7.0 + eslint: 10.7.0(supports-color@7.2.0) ignore: 7.0.5 natural-compare: 1.4.0 ts-api-utils: 2.4.0(typescript@6.0.3) @@ -4295,23 +4317,23 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.57.0(eslint@10.7.0)(typescript@6.0.3)': + '@typescript-eslint/parser@8.57.0(eslint@10.7.0(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3)': dependencies: '@typescript-eslint/scope-manager': 8.57.0 '@typescript-eslint/types': 8.57.0 - '@typescript-eslint/typescript-estree': 8.57.0(typescript@6.0.3) + '@typescript-eslint/typescript-estree': 8.57.0(supports-color@7.2.0)(typescript@6.0.3) '@typescript-eslint/visitor-keys': 8.57.0 - debug: 4.4.3 - eslint: 10.7.0 + debug: 4.4.3(supports-color@7.2.0) + eslint: 10.7.0(supports-color@7.2.0) typescript: 6.0.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/project-service@8.57.0(typescript@6.0.3)': + '@typescript-eslint/project-service@8.57.0(supports-color@7.2.0)(typescript@6.0.3)': dependencies: '@typescript-eslint/tsconfig-utils': 8.57.0(typescript@6.0.3) '@typescript-eslint/types': 8.57.0 - debug: 4.4.3 + debug: 4.4.3(supports-color@7.2.0) typescript: 6.0.3 transitivePeerDependencies: - supports-color @@ -4325,13 +4347,13 @@ snapshots: dependencies: typescript: 6.0.3 - '@typescript-eslint/type-utils@8.57.0(eslint@10.7.0)(typescript@6.0.3)': + '@typescript-eslint/type-utils@8.57.0(eslint@10.7.0(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3)': dependencies: '@typescript-eslint/types': 8.57.0 - '@typescript-eslint/typescript-estree': 8.57.0(typescript@6.0.3) - '@typescript-eslint/utils': 8.57.0(eslint@10.7.0)(typescript@6.0.3) - debug: 4.4.3 - eslint: 10.7.0 + '@typescript-eslint/typescript-estree': 8.57.0(supports-color@7.2.0)(typescript@6.0.3) + '@typescript-eslint/utils': 8.57.0(eslint@10.7.0(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) + debug: 4.4.3(supports-color@7.2.0) + eslint: 10.7.0(supports-color@7.2.0) ts-api-utils: 2.4.0(typescript@6.0.3) typescript: 6.0.3 transitivePeerDependencies: @@ -4339,13 +4361,13 @@ snapshots: '@typescript-eslint/types@8.57.0': {} - '@typescript-eslint/typescript-estree@8.57.0(typescript@6.0.3)': + '@typescript-eslint/typescript-estree@8.57.0(supports-color@7.2.0)(typescript@6.0.3)': dependencies: - '@typescript-eslint/project-service': 8.57.0(typescript@6.0.3) + '@typescript-eslint/project-service': 8.57.0(supports-color@7.2.0)(typescript@6.0.3) '@typescript-eslint/tsconfig-utils': 8.57.0(typescript@6.0.3) '@typescript-eslint/types': 8.57.0 '@typescript-eslint/visitor-keys': 8.57.0 - debug: 4.4.3 + debug: 4.4.3(supports-color@7.2.0) minimatch: 10.2.4 semver: 7.7.3 tinyglobby: 0.2.16 @@ -4354,13 +4376,13 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.57.0(eslint@10.7.0)(typescript@6.0.3)': + '@typescript-eslint/utils@8.57.0(eslint@10.7.0(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3)': dependencies: - '@eslint-community/eslint-utils': 4.9.1(eslint@10.7.0) + '@eslint-community/eslint-utils': 4.9.1(eslint@10.7.0(supports-color@7.2.0)) '@typescript-eslint/scope-manager': 8.57.0 '@typescript-eslint/types': 8.57.0 - '@typescript-eslint/typescript-estree': 8.57.0(typescript@6.0.3) - eslint: 10.7.0 + '@typescript-eslint/typescript-estree': 8.57.0(supports-color@7.2.0)(typescript@6.0.3) + eslint: 10.7.0(supports-color@7.2.0) typescript: 6.0.3 transitivePeerDependencies: - supports-color @@ -4739,13 +4761,17 @@ snapshots: es-errors: 1.3.0 is-data-view: 1.0.2 - debug@3.2.7: + debug@3.2.7(supports-color@7.2.0): dependencies: ms: 2.1.3 + optionalDependencies: + supports-color: 7.2.0 - debug@4.4.3: + debug@4.4.3(supports-color@7.2.0): dependencies: ms: 2.1.3 + optionalDependencies: + supports-color: 7.2.0 deep-extend@0.6.0: {} @@ -4983,40 +5009,40 @@ snapshots: escape-string-regexp@5.0.0: {} - eslint-config-prettier@10.1.8(eslint@10.7.0): + eslint-config-prettier@10.1.8(eslint@10.7.0(supports-color@7.2.0)): dependencies: - eslint: 10.7.0 + eslint: 10.7.0(supports-color@7.2.0) - eslint-import-resolver-node@0.3.9: + eslint-import-resolver-node@0.3.9(supports-color@7.2.0): dependencies: - debug: 3.2.7 + debug: 3.2.7(supports-color@7.2.0) is-core-module: 2.16.1 resolve: 1.22.11 transitivePeerDependencies: - supports-color - eslint-module-utils@2.12.1(@typescript-eslint/parser@8.57.0(eslint@10.7.0)(typescript@6.0.3))(eslint-import-resolver-node@0.3.9)(eslint@10.7.0): + eslint-module-utils@2.12.1(@typescript-eslint/parser@8.57.0(eslint@10.7.0(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint-import-resolver-node@0.3.9(supports-color@7.2.0))(eslint@10.7.0(supports-color@7.2.0))(supports-color@7.2.0): dependencies: - debug: 3.2.7 + debug: 3.2.7(supports-color@7.2.0) optionalDependencies: - '@typescript-eslint/parser': 8.57.0(eslint@10.7.0)(typescript@6.0.3) - eslint: 10.7.0 - eslint-import-resolver-node: 0.3.9 + '@typescript-eslint/parser': 8.57.0(eslint@10.7.0(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) + eslint: 10.7.0(supports-color@7.2.0) + eslint-import-resolver-node: 0.3.9(supports-color@7.2.0) transitivePeerDependencies: - supports-color - eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.57.0(eslint@10.7.0)(typescript@6.0.3))(eslint@10.7.0): + eslint-plugin-import@2.32.0(@typescript-eslint/parser@8.57.0(eslint@10.7.0(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@10.7.0(supports-color@7.2.0))(supports-color@7.2.0): dependencies: '@rtsao/scc': 1.1.0 array-includes: 3.1.9 array.prototype.findlastindex: 1.2.6 array.prototype.flat: 1.3.3 array.prototype.flatmap: 1.3.3 - debug: 3.2.7 + debug: 3.2.7(supports-color@7.2.0) doctrine: 2.1.0 - eslint: 10.7.0 - eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.57.0(eslint@10.7.0)(typescript@6.0.3))(eslint-import-resolver-node@0.3.9)(eslint@10.7.0) + eslint: 10.7.0(supports-color@7.2.0) + eslint-import-resolver-node: 0.3.9(supports-color@7.2.0) + eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.57.0(eslint@10.7.0(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint-import-resolver-node@0.3.9(supports-color@7.2.0))(eslint@10.7.0(supports-color@7.2.0))(supports-color@7.2.0) hasown: 2.0.2 is-core-module: 2.16.1 is-glob: 4.0.3 @@ -5028,20 +5054,20 @@ snapshots: string.prototype.trimend: 1.0.9 tsconfig-paths: 3.15.0 optionalDependencies: - '@typescript-eslint/parser': 8.57.0(eslint@10.7.0)(typescript@6.0.3) + '@typescript-eslint/parser': 8.57.0(eslint@10.7.0(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) transitivePeerDependencies: - eslint-import-resolver-typescript - eslint-import-resolver-webpack - supports-color - eslint-plugin-prettier@5.5.5(eslint-config-prettier@10.1.8(eslint@10.7.0))(eslint@10.7.0)(prettier@3.6.2): + eslint-plugin-prettier@5.5.5(eslint-config-prettier@10.1.8(eslint@10.7.0(supports-color@7.2.0)))(eslint@10.7.0(supports-color@7.2.0))(prettier@3.6.2): dependencies: - eslint: 10.7.0 + eslint: 10.7.0(supports-color@7.2.0) prettier: 3.6.2 prettier-linter-helpers: 1.0.1 synckit: 0.11.12 optionalDependencies: - eslint-config-prettier: 10.1.8(eslint@10.7.0) + eslint-config-prettier: 10.1.8(eslint@10.7.0(supports-color@7.2.0)) eslint-scope@9.1.2: dependencies: @@ -5054,11 +5080,11 @@ snapshots: eslint-visitor-keys@5.0.1: {} - eslint@10.7.0: + eslint@10.7.0(supports-color@7.2.0): dependencies: - '@eslint-community/eslint-utils': 4.9.1(eslint@10.7.0) + '@eslint-community/eslint-utils': 4.9.1(eslint@10.7.0(supports-color@7.2.0)) '@eslint-community/regexpp': 4.12.2 - '@eslint/config-array': 0.23.5 + '@eslint/config-array': 0.23.5(supports-color@7.2.0) '@eslint/config-helpers': 0.6.0 '@eslint/core': 1.2.1 '@eslint/plugin-kit': 0.7.2 @@ -5068,7 +5094,7 @@ snapshots: '@types/estree': 1.0.8 ajv: 6.14.0 cross-spawn: 7.0.6 - debug: 4.4.3 + debug: 4.4.3(supports-color@7.2.0) escape-string-regexp: 4.0.0 eslint-scope: 9.1.2 eslint-visitor-keys: 5.0.1 @@ -5309,6 +5335,8 @@ snapshots: define-properties: 1.2.1 gopd: 1.2.0 + globrex@0.1.2: {} + gopd@1.2.0: {} graceful-fs@4.2.10: {} @@ -5362,17 +5390,17 @@ snapshots: html-escaper@2.0.2: {} - http-proxy-agent@7.0.2: + http-proxy-agent@7.0.2(supports-color@7.2.0): dependencies: agent-base: 7.1.4 - debug: 4.4.3 + debug: 4.4.3(supports-color@7.2.0) transitivePeerDependencies: - supports-color - https-proxy-agent@7.0.6: + https-proxy-agent@7.0.6(supports-color@7.2.0): dependencies: agent-base: 7.1.4 - debug: 4.4.3 + debug: 4.4.3(supports-color@7.2.0) transitivePeerDependencies: - supports-color @@ -5391,9 +5419,9 @@ snapshots: parent-module: 1.0.1 resolve-from: 4.0.0 - import-from-esm@2.0.0: + import-from-esm@2.0.0(supports-color@7.2.0): dependencies: - debug: 4.4.3 + debug: 4.4.3(supports-color@7.2.0) import-meta-resolve: 4.2.0 transitivePeerDependencies: - supports-color @@ -6241,16 +6269,16 @@ snapshots: es-errors: 1.3.0 is-regex: 1.2.1 - semantic-release@25.0.2(typescript@6.0.3): + semantic-release@25.0.2(supports-color@7.2.0)(typescript@6.0.3): dependencies: - '@semantic-release/commit-analyzer': 13.0.1(semantic-release@25.0.2(typescript@6.0.3)) + '@semantic-release/commit-analyzer': 13.0.1(semantic-release@25.0.2(supports-color@7.2.0)(typescript@6.0.3))(supports-color@7.2.0) '@semantic-release/error': 4.0.0 - '@semantic-release/github': 12.0.2(semantic-release@25.0.2(typescript@6.0.3)) - '@semantic-release/npm': 13.1.2(semantic-release@25.0.2(typescript@6.0.3)) - '@semantic-release/release-notes-generator': 14.1.0(semantic-release@25.0.2(typescript@6.0.3)) + '@semantic-release/github': 12.0.2(semantic-release@25.0.2(supports-color@7.2.0)(typescript@6.0.3))(supports-color@7.2.0) + '@semantic-release/npm': 13.1.2(semantic-release@25.0.2(supports-color@7.2.0)(typescript@6.0.3)) + '@semantic-release/release-notes-generator': 14.1.0(semantic-release@25.0.2(supports-color@7.2.0)(typescript@6.0.3))(supports-color@7.2.0) aggregate-error: 5.0.0 cosmiconfig: 9.0.0(typescript@6.0.3) - debug: 4.4.3 + debug: 4.4.3(supports-color@7.2.0) env-ci: 11.2.0 execa: 9.6.0 figures: 6.1.0 @@ -6259,7 +6287,7 @@ snapshots: git-log-parser: 1.2.1 hook-std: 4.0.0 hosted-git-info: 9.0.2 - import-from-esm: 2.0.0 + import-from-esm: 2.0.0(supports-color@7.2.0) lodash-es: 4.17.23 marked: 15.0.12 marked-terminal: 7.3.0(marked@15.0.12) @@ -6554,6 +6582,10 @@ snapshots: ts-mixer@6.0.4: {} + tsconfck@3.1.6(typescript@6.0.3): + optionalDependencies: + typescript: 6.0.3 + tsconfig-paths@3.15.0: dependencies: '@types/json5': 0.0.29 @@ -6563,13 +6595,13 @@ snapshots: tslib@2.8.1: {} - tsup@8.5.1(@swc/core@1.15.40)(postcss@8.5.15)(tsx@4.22.3)(typescript@6.0.3): + tsup@8.5.1(@swc/core@1.15.40)(postcss@8.5.15)(supports-color@7.2.0)(tsx@4.22.3)(typescript@6.0.3): dependencies: bundle-require: 5.1.0(esbuild@0.27.0) cac: 6.7.14 chokidar: 4.0.3 consola: 3.4.2 - debug: 4.4.3 + debug: 4.4.3(supports-color@7.2.0) esbuild: 0.27.0 fix-dts-default-cjs-exports: 1.0.1 joycon: 3.1.1 @@ -6647,13 +6679,13 @@ snapshots: possible-typed-array-names: 1.1.0 reflect.getprototypeof: 1.0.10 - typescript-eslint@8.57.0(eslint@10.7.0)(typescript@6.0.3): + typescript-eslint@8.57.0(eslint@10.7.0(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3): dependencies: - '@typescript-eslint/eslint-plugin': 8.57.0(@typescript-eslint/parser@8.57.0(eslint@10.7.0)(typescript@6.0.3))(eslint@10.7.0)(typescript@6.0.3) - '@typescript-eslint/parser': 8.57.0(eslint@10.7.0)(typescript@6.0.3) - '@typescript-eslint/typescript-estree': 8.57.0(typescript@6.0.3) - '@typescript-eslint/utils': 8.57.0(eslint@10.7.0)(typescript@6.0.3) - eslint: 10.7.0 + '@typescript-eslint/eslint-plugin': 8.57.0(@typescript-eslint/parser@8.57.0(eslint@10.7.0(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3))(eslint@10.7.0(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) + '@typescript-eslint/parser': 8.57.0(eslint@10.7.0(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) + '@typescript-eslint/typescript-estree': 8.57.0(supports-color@7.2.0)(typescript@6.0.3) + '@typescript-eslint/utils': 8.57.0(eslint@10.7.0(supports-color@7.2.0))(supports-color@7.2.0)(typescript@6.0.3) + eslint: 10.7.0(supports-color@7.2.0) typescript: 6.0.3 transitivePeerDependencies: - supports-color @@ -6713,6 +6745,16 @@ snapshots: spdx-correct: 3.2.0 spdx-expression-parse: 3.0.1 + vite-tsconfig-paths@6.1.1(supports-color@7.2.0)(typescript@6.0.3)(vite@8.0.14(@types/node@24.10.1)(esbuild@0.27.0)(tsx@4.22.3)): + dependencies: + debug: 4.4.3(supports-color@7.2.0) + globrex: 0.1.2 + tsconfck: 3.1.6(typescript@6.0.3) + vite: 8.0.14(@types/node@24.10.1)(esbuild@0.27.0)(tsx@4.22.3) + transitivePeerDependencies: + - supports-color + - typescript + vite@8.0.14(@types/node@24.10.1)(esbuild@0.27.0)(tsx@4.22.3): dependencies: lightningcss: 1.32.0 diff --git a/tests/commands.registry.test.ts b/tests/commands.registry.test.ts index e1753dc..650f319 100644 --- a/tests/commands.registry.test.ts +++ b/tests/commands.registry.test.ts @@ -1,6 +1,6 @@ -import registerCommands from "#feature/commands/registry.commands.js"; import { ContextCommandData, + MessageCommandData, SlashCommandData, SlashSubcommandData, SlashSubcommandGroupData, @@ -21,6 +21,11 @@ describe("Commands Registry", () => { let messageContextCommand: ContextCommandData | undefined; let userContextCommand: ContextCommandData | undefined; + let helpMessageCommand: MessageCommandData | undefined; + let helpMessageCommandAlias: string | undefined; + let testMessageCommand: MessageCommandData | undefined; + let testMessageCommandAlias: string | undefined; + beforeAll(async () => { client = new TriviousClient({ intents: [], @@ -29,10 +34,13 @@ describe("Commands Registry", () => { clientIdReference: "", tokenReference: "", }, + messageCommands: { + prefix: "?", + }, debug: true, }); - await registerCommands(client, path.resolve(client.trivious.corePath)); + await client.registries.commands.register(client, path.resolve(client.trivious.corePath)); debugCommand = client.stores.commands.chatInput.get("debug"); noteCommand = client.stores.commands.chatInput.get("note"); debugConfigGroup = debugCommand?.subcommandGroups?.get("config"); @@ -41,6 +49,11 @@ describe("Commands Registry", () => { editSubcommand = debugConfigGroup?.subcommands.get("edit"); messageContextCommand = client.stores.commands.context.get("message-context"); userContextCommand = client.stores.commands.context.get("user-context"); + + helpMessageCommand = client.stores.commands.message.get("help"); + helpMessageCommandAlias = client.stores.messageCommandAliases.get("h"); + testMessageCommand = client.stores.commands.message.get("ping-test"); + testMessageCommandAlias = client.stores.messageCommandAliases.get("pt"); }); it("should have registered slash commands", () => { @@ -65,4 +78,14 @@ describe("Commands Registry", () => { expect(!!messageContextCommand).toBe(true); expect(!!userContextCommand).toBe(true); }); + + it("should have registered message commands", () => { + expect(!!helpMessageCommand).toBe(true); + expect(!!testMessageCommand).toBe(true); + }); + + it("should have registered message command aliases", () => { + expect(!!helpMessageCommandAlias).toBe(true); + expect(!!testMessageCommandAlias).toBe(true); + }); }); diff --git a/tests/components.registry.test.ts b/tests/components.registry.test.ts index 30f0fbd..eced6a9 100644 --- a/tests/components.registry.test.ts +++ b/tests/components.registry.test.ts @@ -1,6 +1,5 @@ -import registerComponents from "#feature/components/registry.components.js"; -import structure from "#feature/structure/index.structure.js"; import { Component, TriviousClient } from "#typings"; +import path from "path"; import { beforeAll, describe, expect, it } from "vitest"; describe("Components Registry", () => { @@ -21,7 +20,7 @@ describe("Components Registry", () => { debug: true, }); - await registerComponents(client, structure.resolveRelativePath(client.trivious.corePath)); + await client.registries.components.register(client, path.resolve(client.trivious.corePath)); buttonComponent = client.stores.components.get("button"); modalComponent = client.stores.components.get("modal"); selectMenuComponent = client.stores.components.get("selectMenu"); diff --git a/tests/data/commands/message-cmd.ts b/tests/data/commands/message-cmd.ts index 8be7db8..7e9c50c 100644 --- a/tests/data/commands/message-cmd.ts +++ b/tests/data/commands/message-cmd.ts @@ -3,16 +3,17 @@ import { createMessageCommand } from "#trivious"; export default createMessageCommand({ active: true, name: "ping-test", + description: "test", aliases: ["pt"], arguments: [ - { name: "user", dataType: "snowflake/user", description: "Target user" }, - { name: "reason", dataType: "text", description: "A good reason" }, - { name: "duration", dataType: "duration", description: "A duration" }, - ] as const, + { name: "channel", dataType: "snowflake/channel", description: "Target user" }, + { name: "role", dataType: "snowflake/role", description: "A good reason" }, + { name: "user", dataType: "snowflake/user", description: "A duration" }, + ], async execute(client, interaction) { - const { args, command, message } = interaction; + const { args, message } = interaction; await message.reply({ - content: args.map((value, name) => `[${name}]: ${value}`).join("\n"), + content: `Resolved: ${args.get("channel")} ${args.get("role")} ${args.get("user")}`, }); }, }); diff --git a/tests/events.registry.test.ts b/tests/events.registry.test.ts index ed34fd6..03f6c42 100644 --- a/tests/events.registry.test.ts +++ b/tests/events.registry.test.ts @@ -1,6 +1,6 @@ -import registerEvents from "#feature/events/registry.events.js"; -import structure from "#feature/structure/index.structure.js"; import { Event, TriviousClient } from "#typings"; +import { GatewayIntentBits } from "discord.js"; +import path from "path"; import { beforeAll, describe, expect, it } from "vitest"; describe("Events Registry", () => { @@ -10,10 +10,11 @@ describe("Events Registry", () => { let eventOnce: Event | undefined; let interactionCreate: Event | undefined; let clientReady: Event | undefined; + let messageCreate: Event | undefined; beforeAll(async () => { client = new TriviousClient({ - intents: [], + intents: [GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent], corePath: "tests/data", credentials: { clientIdReference: "", @@ -22,11 +23,16 @@ describe("Events Registry", () => { debug: true, }); - await registerEvents(client, structure.resolveRelativePath(client.trivious.corePath)); + // pass preset event conditions + client.stores.commands.chatInput.set("00", {} as any); + client.stores.commands.message.set("00", {} as any); + + await client.registries.events.register(client, path.resolve(client.trivious.corePath)); event = client.stores.events.get("applicationCommandPermissionsUpdate"); eventOnce = client.stores.events.get("autoModerationRuleCreate"); interactionCreate = client.stores.events.get("interactionCreate"); clientReady = client.stores.events.get("clientReady"); + messageCreate = client.stores.events.get("messageCreate"); }); it("should have registered events", () => { @@ -38,5 +44,6 @@ describe("Events Registry", () => { it("should have registered preset events", () => { expect(!!interactionCreate).toBe(true); expect(!!clientReady).toBe(true); + expect(!!messageCreate).toBe(true); }); }); diff --git a/tests/modules.registry.test.ts b/tests/modules.registry.test.ts index 92a5c81..dadb94e 100644 --- a/tests/modules.registry.test.ts +++ b/tests/modules.registry.test.ts @@ -1,6 +1,5 @@ -import registerModules from "#feature/modules/registry.modules.js"; -import structure from "#feature/structure/index.structure.js"; import { Module, TriviousClient } from "#typings"; +import path from "path"; import { beforeAll, describe, expect, it } from "vitest"; describe("Modules Registry", () => { @@ -18,7 +17,7 @@ describe("Modules Registry", () => { debug: true, }); - await registerModules(client, structure.resolveRelativePath(client.trivious.corePath)); + await client.registries.modules.register(client, path.resolve(client.trivious.corePath)); exampleModule = client.stores.modules.get("testModule"); }); diff --git a/vite.config.ts b/vite.config.ts index 72b02d8..000c22b 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -1,3 +1,4 @@ +import tsconfigpaths from "vite-tsconfig-paths"; import { defineConfig } from "vitest/config"; export default defineConfig({ @@ -12,4 +13,5 @@ export default defineConfig({ }, }, resolve: { tsconfigPaths: true }, + plugins: [tsconfigpaths()], }); From 36ff67da1fdea901510be2ca6944e37c9d8c45de Mon Sep 17 00:00:00 2001 From: commonly-ts <51011212+commonly-ts@users.noreply.github.com> Date: Sun, 9 Aug 2026 20:58:42 +1200 Subject: [PATCH 26/32] reorganised messageCreate --- src/features/events/presets/messageCreate.ts | 135 ++++++++++++------- 1 file changed, 86 insertions(+), 49 deletions(-) diff --git a/src/features/events/presets/messageCreate.ts b/src/features/events/presets/messageCreate.ts index 6370542..7347e47 100644 --- a/src/features/events/presets/messageCreate.ts +++ b/src/features/events/presets/messageCreate.ts @@ -1,13 +1,39 @@ -import { canMemberRunCommand } from "#feature/permissions/methods.permissions.js"; -import { Event, MessageCommandData, TriviousClient } from "#typings"; import { BitField, Collection, GatewayIntentBits, + inlineCode, Message, OmitPartialGroupDMChannel, } from "discord.js"; +import { canMemberRunCommand } from "#feature/permissions/methods.permissions.js"; +import { parseMessageCommandArgument } from "#trivious"; +import { Event, MessageCommandData, TriviousClient } from "#typings"; + +async function getCommand( + client: TriviousClient, + commandName: string, + message: OmitPartialGroupDMChannel> +): Promise | null> { + const nameLower = commandName.toLowerCase(); + let command = client.stores.commands.message.get(nameLower); + + if (!command) { + const mappedCommandName = client.stores.messageCommandAliases.get(nameLower); + command = mappedCommandName ? client.stores.commands.message.get(mappedCommandName) : undefined; + } + + if (!command || !command.active) { + await message.reply({ + content: "Invalid command; does not exist, missing handler, or is inactive.", + }); + return null; + } + + return command; +} + async function doPermissionsCheck( client: TriviousClient, command: MessageCommandData, @@ -18,95 +44,106 @@ async function doPermissionsCheck( command, message.member || message.author ); + if (!hasPermission) { await message.reply({ content: `You do not have permission to run this command: ${reason}`, }); return false; } - return true; -} -async function doArgumentChecks( - command: MessageCommandData, - rawArgs: string[], - message: OmitPartialGroupDMChannel> -) { - const expectedArgs = command.arguments?.length || 0; - if (rawArgs.length < expectedArgs && command.arguments) { - return void (await message.reply({ - content: `Missing or incomplete arguments. I expected ${expectedArgs} arguments, but received only ${rawArgs.length}.\nNext missing argument is '${command.arguments[rawArgs.length]}'`, - })); - } + return true; } async function doCommandFlagChecks( command: MessageCommandData, message: OmitPartialGroupDMChannel> -): Promise { - if (!command.flags) return; - if ("InGuild" in command.flags && !message.member) - return void (await message.reply({ +): Promise { + if (!command.flags) return false; + if ("InGuild" in command.flags && !message.member) { + await message.reply({ content: "This command can only be ran inside a guild!", - })); - if ("OutGuild" in command.flags && message.member) - return void (await message.reply({ - content: "This command **cannot** be ran inside a guild!", - })); -} - -async function getCommand( - client: TriviousClient, - commandName: string, - message: OmitPartialGroupDMChannel> -): Promise | null> { - let command = client.stores.commands.message.get(commandName.toLowerCase()); - if (!command) { - const mappedCommandName = client.stores.messageCommandAlises.get(commandName.toLowerCase()); - command = mappedCommandName ? client.stores.commands.message.get(mappedCommandName) : undefined; + }); + return true; } - - if (!command || !command.active) { + if ("OutGuild" in command.flags && message.member) { await message.reply({ - content: `Invalid command; does not exist, missing handler, or is inactive.`, + content: "This command **cannot** be ran inside a guild!", }); - return null; + return true; } - return command; + return false; } export default { name: "messageCreate", async execute(client, message) { const config = client.trivious.messageCommands; - if (!config) + if (!config) { return client.logger.warn( "At least one message command is registered, but message commands have not been configured in the TriviousClient." ); + } + const { prefix } = config; if (!message.content.startsWith(prefix)) return; + const input = message.content.slice(prefix.length); const [commandName] = input.split(" "); const command = await getCommand(client, commandName, message); if (!command) return; + const hasPermission = await doPermissionsCheck(client, command, message); if (!hasPermission) return; - await doCommandFlagChecks(command, message); - let args: Collection | null = null; + const failedFlagChecks = await doCommandFlagChecks(command, message); + if (failedFlagChecks) return; + + let args: Collection | null = null; if (command.arguments) { - const result = input.match(command.regex); - if (!result) - return void (await message.reply({ content: "Failed parsing command arguments" })); + const result = input.match(command.metadata.regex); + if (!result) { + await message.reply({ + content: `Incorrect command or missing one or more required arguments.\nExpected usage: ${inlineCode( + command.metadata.usage + )}.\n-# Use ${inlineCode(`${prefix}help ${command.name}`)} for more information about this command.`, + }); + return; + } + const matches = result.slice(1, command.arguments.length + 1); - args = new Collection( - matches.map((value, index) => [command.arguments![index]!.name, value]) - ); + const rejectedArguments: [string, string][] = []; + args = new Collection(); + + matches.forEach((value, index) => { + const argument = command.arguments![index]; + const [parsedValue, reason] = parseMessageCommandArgument(argument.dataType, value, { + client, + name: argument.name, + guild: message.guild, + }); + + if (!parsedValue) { + rejectedArguments.push([argument.name, reason!]); + } + + args!.set(argument.name, parsedValue); + }); + + if (rejectedArguments.length > 0) { + await message.reply({ + content: `Failed parsing command, one or more arguments were rejected:\n${rejectedArguments + .map(([name, reason]) => `-# [${name}] ${reason}`) + .join("\n")}`, + }); + return; + } } await command.execute(client, { message, command, args }); }, + conditions(client) { return [ [client.stores.commands.message.size > 0, "At least one (1) message command registered."], From 37c8aff9202b35abe6808e2686572493779a4ef2 Mon Sep 17 00:00:00 2001 From: commonly-ts <51011212+commonly-ts@users.noreply.github.com> Date: Sun, 9 Aug 2026 20:58:54 +1200 Subject: [PATCH 27/32] delimiter not needed for now --- src/features/client/client.types.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/features/client/client.types.ts b/src/features/client/client.types.ts index 8790adf..ca3dba4 100644 --- a/src/features/client/client.types.ts +++ b/src/features/client/client.types.ts @@ -86,7 +86,7 @@ export interface MessageCommandConfiguration { /** * Recommended value(s): `#` `|` `$` */ - delimiter?: string | string[]; + // delimiter?: string | string[]; } /** From 6815e36509af808e1052db5e25cfb59302a28507 Mon Sep 17 00:00:00 2001 From: commonly-ts <51011212+commonly-ts@users.noreply.github.com> Date: Sun, 9 Aug 2026 20:59:14 +1200 Subject: [PATCH 28/32] fixed typo --- src/features/client/trivious.client.ts | 4 ++-- src/features/commands/registry.commands.ts | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/features/client/trivious.client.ts b/src/features/client/trivious.client.ts index cf0e409..c54fca0 100644 --- a/src/features/client/trivious.client.ts +++ b/src/features/client/trivious.client.ts @@ -27,7 +27,7 @@ export default class TriviousClient extends Client { components: Collection; events: Collection; modules: Collection; - messageCommandAlises: Collection; + messageCommandAliases: Collection; }; logger: Logger; @@ -45,7 +45,7 @@ export default class TriviousClient extends Client { components: new Collection(), events: new Collection(), modules: new Collection(), - messageCommandAlises: new Collection(), + messageCommandAliases: new Collection(), }; } diff --git a/src/features/commands/registry.commands.ts b/src/features/commands/registry.commands.ts index b4806b0..5017470 100644 --- a/src/features/commands/registry.commands.ts +++ b/src/features/commands/registry.commands.ts @@ -175,7 +175,7 @@ async function registerMessageCommands(client: TriviousClient, data: CollatedCom "->", command.name.toLowerCase() ); - client.stores.messageCommandAlises.set( + client.stores.messageCommandAliases.set( alias.trim().toLowerCase(), command.name.toLowerCase() ); @@ -205,6 +205,8 @@ export default async function registerCommands(client: TriviousClient, directory processedDirectories.add(parentDir); await parseDirectory(data, parentDir); } + const presetsDirectory = path.resolve(import.meta.dirname, "presets"); + if (presetsDirectory) await parseDirectory(data, presetsDirectory); await registerSlashCommands(client, data); await registerMessageCommands(client, data); await registerContextMenuCommands(client, data); From 38d3880e1f8393cb3afc87007cf241ffc8ac4a66 Mon Sep 17 00:00:00 2001 From: commonly-ts <51011212+commonly-ts@users.noreply.github.com> Date: Sun, 9 Aug 2026 21:00:35 +1200 Subject: [PATCH 29/32] updated logic for msg command presets should only register presets if message commands are configured --- src/features/commands/registry.commands.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/features/commands/registry.commands.ts b/src/features/commands/registry.commands.ts index 5017470..fc49ade 100644 --- a/src/features/commands/registry.commands.ts +++ b/src/features/commands/registry.commands.ts @@ -206,7 +206,8 @@ export default async function registerCommands(client: TriviousClient, directory await parseDirectory(data, parentDir); } const presetsDirectory = path.resolve(import.meta.dirname, "presets"); - if (presetsDirectory) await parseDirectory(data, presetsDirectory); + if (presetsDirectory && client.trivious.messageCommands) + await parseDirectory(data, presetsDirectory); await registerSlashCommands(client, data); await registerMessageCommands(client, data); await registerContextMenuCommands(client, data); From 7b1516be2e22f1709f51fcd700e2139ad0b74f8d Mon Sep 17 00:00:00 2001 From: commonly-ts <51011212+commonly-ts@users.noreply.github.com> Date: Sun, 9 Aug 2026 21:00:43 +1200 Subject: [PATCH 30/32] feat: help preset msg command --- src/features/commands/presets/help.ts | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 src/features/commands/presets/help.ts diff --git a/src/features/commands/presets/help.ts b/src/features/commands/presets/help.ts new file mode 100644 index 0000000..54bf51a --- /dev/null +++ b/src/features/commands/presets/help.ts @@ -0,0 +1,40 @@ +import { createEmbed, createMessageCommand } from "#trivious"; +import { inlineCode } from "discord.js"; +import { formatAliases, formatArguments, resolveCommand } from "../utility.js"; + +export default createMessageCommand({ + active: true, + name: "help", + description: "View information about a message command", + aliases: ["h"], + arguments: [ + { name: "command-name", dataType: "text", description: "Name or alias of a command" }, + ], + async execute(client, interaction) { + const { args, message } = interaction; + const query = args.get("command-name")?.trim().toLowerCase(); + + if (!query) { + await message.reply({ content: "Please specify a command name or alias." }); + return; + } + + const command = resolveCommand(client, query); + if (!command) { + await message.reply({ + content: `Could not find command or alias '${query}'`, + }); + return; + } + + const prefix = client.trivious.messageCommands?.prefix ?? "?"; + const aliases = formatAliases(prefix, command.aliases); + const argumentsList = formatArguments(command.arguments); + const embed = createEmbed({ + title: `${prefix}${command.name}`, + description: `${command.description}\n${inlineCode(command.metadata.usage)}${aliases}${argumentsList}`, + }); + + await message.reply({ embeds: [embed] }); + }, +}); From 7848d002f25601064f2deb62f567c57008970786 Mon Sep 17 00:00:00 2001 From: commonly-ts <51011212+commonly-ts@users.noreply.github.com> Date: Sun, 9 Aug 2026 21:00:55 +1200 Subject: [PATCH 31/32] updated message commands --- src/features/commands/builders.commands.ts | 4 +- src/features/commands/commands.types.ts | 52 +++++++--- .../commands/handlers/message.commands.ts | 96 ++++++++++++++++++- src/features/commands/utility.ts | 33 +++++++ 4 files changed, 167 insertions(+), 18 deletions(-) create mode 100644 src/features/commands/utility.ts diff --git a/src/features/commands/builders.commands.ts b/src/features/commands/builders.commands.ts index 431d9f7..2a252aa 100644 --- a/src/features/commands/builders.commands.ts +++ b/src/features/commands/builders.commands.ts @@ -12,8 +12,8 @@ import { ApplicationCommandType, Collection } from "discord.js"; export function createMessageCommand< const T extends RO_ArrayType = undefined, >( - command: Omit, "context" | "regex"> -): Omit, "regex"> { + command: Omit, "context" | "metadata"> +): Omit, "metadata"> { return { context: "MessageCommand", ...command, diff --git a/src/features/commands/commands.types.ts b/src/features/commands/commands.types.ts index 32e0496..7ec75c5 100644 --- a/src/features/commands/commands.types.ts +++ b/src/features/commands/commands.types.ts @@ -1,17 +1,20 @@ import { CommandPermissionValues, TriviousClient } from "#typings"; import { ApplicationCommandType, + Channel, ChatInputCommandInteraction, Collection, ContextMenuCommandBuilder, Interaction, Message, MessageContextMenuCommandInteraction, + Role, SlashCommandBuilder, SlashCommandOptionsOnlyBuilder, SlashCommandSubcommandBuilder, SlashCommandSubcommandGroupBuilder, SlashCommandSubcommandsOnlyBuilder, + User, UserContextMenuCommandInteraction, } from "discord.js"; @@ -138,18 +141,39 @@ export type MessageCommandArgs + : MessageCommandArgumentsMap : null; -export type MessageCommandArgumentType = - | "text" - | "number" - | "timestamp" - | "snowflake" - | "snowflake/user" - | "snowflake/channel" - | "snowflake/role" - | "duration"; +export type ResolveArgType = + Argument["dataType"] extends keyof MessageCommandArgumentTypeMap + ? MessageCommandArgumentTypeMap[Argument["dataType"]] + : unknown; + +export type MessageCommandArgumentType = keyof MessageCommandArgumentTypeMap; +export interface MessageCommandArgumentTypeMap { + "text": string; + "number": number; + "date": Date; + "timestamp": Date; + "snowflake": string; + "snowflake/user": User; + "snowflake/channel": Channel; + "snowflake/role": Role; + "duration": number; +} + +export interface MessageCommandArgumentsMap + extends Omit, "get"> { + get( + key: K + ): Extract extends infer Arg + ? Arg extends MessageCommandArgument + ? Arg["required"] extends true + ? ResolveArgType + : ResolveArgType | undefined + : undefined + : undefined; +} export interface MessageCommandArgument { name: string; @@ -170,6 +194,11 @@ export interface MessageCommandInteraction< message: Message; } +export interface MessageCommandMetadata { + regex: RegExp; + usage: string; +} + export interface MessageCommandData< Processed extends boolean = boolean, Arguments extends RO_ArrayType = @@ -179,10 +208,11 @@ export interface MessageCommandData< > extends BaseCommandData { context: "MessageCommand"; name: string; + description: string; arguments?: Arguments; aliases?: string[]; flags?: MessageCommandFlags[]; - regex: Processed extends true ? RegExp : undefined; + metadata: Processed extends true ? MessageCommandMetadata : undefined; execute: ( client: TriviousClient, interaction: MessageCommandInteraction diff --git a/src/features/commands/handlers/message.commands.ts b/src/features/commands/handlers/message.commands.ts index ba26ddf..79eb0aa 100644 --- a/src/features/commands/handlers/message.commands.ts +++ b/src/features/commands/handlers/message.commands.ts @@ -1,13 +1,16 @@ import { MessageCommandArgumentType, MessageCommandData, TriviousClient } from "#typings"; +import { Guild } from "discord.js"; +import { formatUsage } from "../utility.js"; const argumentRegex: Record = { "duration": /\d+[smhdwy]/, "text": /.+?/, - "snowflake": /<[@#&]?\d+>|\d+/, - "snowflake/user": /<[@]?\d+>|\d+/, - "snowflake/channel": /<[#]?\d+>|\d+/, - "snowflake/role": /<[&]?\d+>|\d+/, + "snowflake": /<[@#&]!?\d{17,19}>|\d{17,19}/, + "snowflake/channel": /<#\d{17,19}>|\d{17,19}/, + "snowflake/role": /<@&\d{17,19}>|\d{17,19}/, + "snowflake/user": /<@!?\d{17,19}>|\d{17,19}/, "timestamp": /\d{10}/, + "date": /\d{1,2}\/\d{1,2}\/\d{2,4}|\d{2,4}\/\d{1,2}\/\d{1,2}/, "number": /[+-]?\d+\.\d*?|\.\d+/, }; @@ -30,6 +33,89 @@ export function processPartialMessageCommand( } } pattern += "$"; - command.regex = new RegExp(pattern); + command.metadata = { + regex: new RegExp(pattern), + usage: formatUsage(client.trivious.messageCommands?.prefix ?? "?", command), + }; return command; } + +function parseNumber(value: string): number | null { + if (value.trim() === "") return null; + const num = Number(value); + return !Number.isNaN(num) ? num : null; +} + +const durationUnitMap: Record = { + s: 1, + m: 60, + h: 60 * 60, + d: 60 * 60 * 24, + w: 60 * 60 * 24 * 7, + y: 60 * 60 * 24 * 7 * 365, +}; +const snowflakeDataMap: Record = { + "snowflake/channel": [/(?:<#)?(\d{17,19})>?/, "channels"], + "snowflake/role": [/(?:<@&)?(\d{17,19})>?/, "roles"], + "snowflake/user": [/(?:<@!?)?(\d{17,19})>?/, "users"], +}; +type ParseArgumentResult = [result: T] | [result: null, reason: string]; +export function parseMessageCommandArgument( + dataType: MessageCommandArgumentType, + value: string, + context: { name: string; client: TriviousClient; guild: Guild | null }, + regex?: RegExp +): ParseArgumentResult { + switch (dataType) { + case "duration": { + const result = value.match(regex || /(\d+)([smhdwy])/); + if (!result) return [null, "Invalid input."]; + const [, num, unit] = result; + const unitMultiplier = durationUnitMap[unit]; + const [number, reason] = parseMessageCommandArgument("number", num, context); + if (!number) return [null, reason!]; + return [Math.ceil(number * unitMultiplier * 1000) as T]; + } + case "number": { + const number = parseNumber(value); + if (!number) return [null, "Invalid number."]; + return [number as T]; + } + case "snowflake/channel": + case "snowflake/role": + case "snowflake/user": { + const { client, guild } = context; + const [regex, manager] = snowflakeDataMap[dataType]; + const [id] = parseMessageCommandArgument("snowflake", value, context, regex); + const singular = manager.slice(0, manager.length - 1); + if (!id) return [null, `Cannot fetch ${singular}: invalid.`]; + const clientTarget = + client && manager in client ? (client as Record)[manager] : null; + const guildTarget = + guild && manager in guild ? (guild as Record)[manager] : null; + const object = guildTarget?.cache?.get(id) ?? clientTarget?.cache?.get(id) ?? null; + if (!object) return [null, `Cannot fetch ${singular}: undefined.`]; + return [object as T]; + } + case "snowflake": { + let isSnowflake = parseNumber(value); + if (isSnowflake) return [value as T]; + const result = value.match(regex || /(?:<[@#&]!?)?(\d{17,19})>?/); + if (!result) return [null, "Invalid input"]; + const id = result[1]; + isSnowflake = parseNumber(id); + if (!isSnowflake) return [null, "Invalid snowflake or mention."]; + return [id as T]; + } + case "text": + return [String(value) as T]; + case "date": + case "timestamp": { + const date = new Date(value); + if (Number.isNaN(+date)) return [null, "Invalid timestamp or date passed."]; + return [date as T]; + } + default: + return [null, "Nothing to parse"]; + } +} diff --git a/src/features/commands/utility.ts b/src/features/commands/utility.ts new file mode 100644 index 0000000..2f7294e --- /dev/null +++ b/src/features/commands/utility.ts @@ -0,0 +1,33 @@ +import { MessageCommandArgument, MessageCommandData, TriviousClient } from "#typings"; +import { bold, inlineCode } from "discord.js"; + +export function resolveCommand(client: TriviousClient, query: string) { + const targetName = client.stores.messageCommandAliases.get(query) ?? query; + return client.stores.commands.message.get(targetName); +} + +export function formatUsage(prefix: string, command: MessageCommandData): string { + if (!command.arguments?.length) return `${prefix}${command.name}`; + + const formattedArgs = command.arguments + .map((arg: any) => (arg.required ? `<${arg.name}>` : `[${arg.name}]`)) + .join(" "); + + return `${prefix}${command.name} ${formattedArgs}`; +} + +export function formatArguments(args?: readonly MessageCommandArgument[]): string { + if (!args?.length) return ""; + + const list = args + .map((arg) => `-# ${bold(arg.name)} (${arg.dataType}) - ${arg.description}`) + .join("\n"); + + return `\nArguments:\n${list}`; +} + +export function formatAliases(prefix: string, aliases: string[] | undefined): string { + if (!aliases || aliases.length === 0) return ""; + const formattedList = aliases.map((alias: string) => inlineCode(`${prefix}${alias}`)).join(", "); + return `\n\nAliases: ${formattedList}`; +} From 26aa15b22a677e8ef8fefd3eadbd0aab022a73d3 Mon Sep 17 00:00:00 2001 From: commonly-ts <51011212+commonly-ts@users.noreply.github.com> Date: Sun, 9 Aug 2026 21:06:24 +1200 Subject: [PATCH 32/32] minor issues fixes --- .github/workflows/pr-checks.yml | 3 --- dev/index.ts | 2 +- tsconfig.json | 1 + 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/pr-checks.yml b/.github/workflows/pr-checks.yml index ec52af8..72940be 100644 --- a/.github/workflows/pr-checks.yml +++ b/.github/workflows/pr-checks.yml @@ -23,9 +23,6 @@ jobs: - name: Install dependencies run: pnpm install --frozen-lockfile - - name: Lint - run: pnpm run lint - - name: Type Check run: pnpm typecheck diff --git a/dev/index.ts b/dev/index.ts index 48b38f0..b069b1f 100644 --- a/dev/index.ts +++ b/dev/index.ts @@ -14,7 +14,7 @@ const client = new TriviousClient({ }, messageCommands: { prefix: "?", - delimiter: ['"', "#"], + // delimiter: ['"', "#"], }, debug: true, }); diff --git a/tsconfig.json b/tsconfig.json index 0b5694c..494115a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,6 +8,7 @@ "declaration": true, "strict": true, "allowSyntheticDefaultImports": true, + "skipLibCheck": true, "sourceMap": true, "outDir": "dist", "rootDir": ".",