Skip to content

Commit 8cc1fea

Browse files
authored
feat: add baseline command (#4)
* feat: Switch from dynamic import to a more explicit approach * fix: Fix deploy.ts to use the exported commands Map * feat: Add typecheck script and remove zod * feat: remove zod * feat: create a file for event types * feat: create event utils * feat: add events barrel export * feat: add commands type * feat: add commands utils * feat: add commands barrel export * refactor: adjust imports paths * refactor: adjust events import paths * refactor: update index.ts to accomodate barrel exports and utils * fix: fix bug in rate limiter * feat: remove loaders files, logic moved to other files * feat: Add clampText util * feat: add web-features lib add lib add patch to export types (no idea why they're not exporting them) * refactor: remove web-features pnpm patch * feat: Set TS's version in vscode settings choose the version from node_modules instead of vscode's version * feat: Add fuzzy search util * refactor: Use `Command` type in `createCommand` util * refactor: Remove unnecessary `satisfies` from return type * feat: Add emoji constants * refactor: Update command consumers to use object arg * feat: Add shared docs command types * feat: Add shared docs commands utils * feat: Restructure docs commands - add baseline command - delete old providers file - extract proviers to seperate files - add baseline command * feat: add `getBaselineFeatures` util * fix: Fix package.json test script * refactor: move providers to the root of docs/ folder * test: Add baseline unit tests * feat: add checks before running docs interaction and defer the reply * feat: use new `getBaselineFeatures` * chore(tools): require following curly brace conventions in biome config * chore: use curly braces instead of one line functions * refactor: simplify SearchItem type definition in mdn and npm providers * refactor: simplify createBaseConfig function implementation and add explicit return type * chore(tools): fix test script in ci * chore(tools): fix test scripts #2 * chore(tools): simplify ci scripts * chore(tools): Fix typo in script * refactor: pick a better name for collection filter function arg * refactor: rename variable in component collector for clarity
1 parent 93c2c29 commit 8cc1fea

File tree

24 files changed

+840
-486
lines changed

24 files changed

+840
-486
lines changed

.github/workflows/deploy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
CLIENT_ID: ${{ secrets.CLIENT_ID }}
4545

4646
- name: Run tests
47-
run: npm test
47+
run: npm run test:ci
4848

4949
- name: Package artifact
5050
run: |

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,5 @@ jobs:
4242
CLIENT_ID: ${{ secrets.CLIENT_ID }}
4343

4444
- name: Run tests
45-
run: npm test
45+
run: npm run test:ci
4646

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
},
1212
"[json]": {
1313
"editor.defaultFormatter": "biomejs.biome"
14-
}
14+
},
15+
"typescript.tsdk": "node_modules/typescript/lib"
1516
}

biome.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
"style": {
88
"noNonNullAssertion": "off",
99
"useConst": "error",
10-
"useTemplate": "error"
10+
"useTemplate": "error",
11+
"useBlockStatements": "error"
1112
},
1213
"suspicious": {
1314
"noExplicitAny": "warn",

package.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"description": "Web Dev & Web Design discord bot",
55
"type": "module",
66
"scripts": {
7-
"build:ci": "tsup && node scripts/copy-assets.js",
7+
"build:ci": "npm run build:ts && npm run build:copy",
88
"build:dev": "pnpm run build:ts && pnpm run build:copy",
99
"build:ts": "tsup",
1010
"build:copy": "node scripts/copy-assets.js",
@@ -17,7 +17,8 @@
1717
"check": "biome check .",
1818
"check:fix": "biome check --write .",
1919
"typecheck": "tsc --noEmit",
20-
"test": "node --test",
20+
"test": "pnpm run build:dev && node --test dist/**/*.test.js",
21+
"test:ci": "node --test dist/**/*.test.js",
2122
"prepare": "husky",
2223
"pre-commit": "lint-staged"
2324
},
@@ -27,7 +28,8 @@
2728
"packageManager": "pnpm@10.17.1",
2829
"dependencies": {
2930
"@discordjs/core": "^2.2.2",
30-
"discord.js": "^14.22.1"
31+
"discord.js": "^14.22.1",
32+
"web-features": "^3.3.0"
3133
},
3234
"devDependencies": {
3335
"@biomejs/biome": "2.2.4",

0 commit comments

Comments
 (0)