Skip to content

Commit 0be05a2

Browse files
committed
feat: add typecheck and test commands for examples submodule
Add typecheck support to examples: - Add vitest typecheck configuration to examples/vitest.config.ts - Add typecheck script to examples/package.json Add aggregate commands in root package.json: - test:examples - Run tests in examples submodule - test:all - Run all test:* scripts using pattern matching - typecheck:examples - Run typecheck in examples submodule - typecheck:all - Run all typecheck:* scripts using pattern matching This allows running tests and typechecks across all submodules with a single command using pnpm's regex pattern matching.
1 parent b09ac63 commit 0be05a2

4 files changed

Lines changed: 11 additions & 1 deletion

File tree

examples/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"private": true,
55
"type": "module",
66
"scripts": {
7-
"test": "vitest run"
7+
"test": "vitest run",
8+
"typecheck": "vitest typecheck --run"
89
},
910
"dependencies": {
1011
"@stackone/ai": "workspace:*"

examples/sample-document.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
This is an experimental document handling test file.

examples/vitest.config.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,9 @@ export default defineConfig({
77
include: ['**/*.spec.ts'],
88
setupFiles: ['./vitest.setup.ts'],
99
testTimeout: 30000,
10+
typecheck: {
11+
enabled: true,
12+
include: ['**/*.spec.ts'],
13+
},
1014
},
1115
});

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,12 @@
2424
"test": "vitest run",
2525
"test:watch": "vitest",
2626
"test:coverage": "vitest run --coverage",
27+
"test:examples": "pnpm --filter @stackone/ai-examples test",
28+
"test:all": "pnpm run '/^test(:|$)/'",
2729
"lint": "biome check .",
2830
"typecheck": "tsgo --noEmit",
31+
"typecheck:examples": "pnpm --filter @stackone/ai-examples typecheck",
32+
"typecheck:all": "pnpm run '/^typecheck(:|$)/'",
2933
"format": "biome format --write ."
3034
},
3135
"dependencies": {

0 commit comments

Comments
 (0)