Skip to content

Commit 507d758

Browse files
chore(schemas,web): keep schema dist fresh and resolve types from source
Two dev-experience fixes for the stale-build-output footgun: - schemas watch now runs `yarn build` (generate + tsc) instead of generate-only, so editing a schema JSON during `yarn dev` refreshes dist (both the .d.ts types and the runtime index.schema.js used by ajv), not just the generated source. - web tsconfig maps @sourcebot/schemas/v3|v2/* to the package source, so type-checking and the IDE read committed source directly instead of stale built .d.ts. Web only imports .type files (erased at compile), so there is no bundling/runtime impact. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 5e4045b commit 507d758

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

packages/schemas/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"scripts": {
66
"build": "yarn generate && tsc",
77
"generate": "tsx tools/generate.ts",
8-
"watch": "nodemon --watch ../../schemas -e json -x 'yarn generate'",
8+
"watch": "nodemon --watch ../../schemas -e json -x 'yarn build'",
99
"postinstall": "yarn build"
1010
},
1111
"devDependencies": {

packages/web/tsconfig.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,12 @@
2727
],
2828
"@/public/*": [
2929
"./public/*"
30+
],
31+
"@sourcebot/schemas/v3/*": [
32+
"../schemas/src/v3/*"
33+
],
34+
"@sourcebot/schemas/v2/*": [
35+
"../schemas/src/v2/*"
3036
]
3137
},
3238
"target": "ES2017"

0 commit comments

Comments
 (0)