Skip to content

Commit 0c46eda

Browse files
authored
fix(web-basic): make documented dev command work from clean install (#39)
- Fix root dev:web-basic script to use pnpm --dir instead of wrong package filter (@intent/web-basic does not exist; the actual package name is web-basic) - Add Vite resolve aliases for @intent/core, @intent/dom, @intent/router so Vite resolves workspace packages from source during development, eliminating the need for pnpm build before pnpm dev:web-basic - Update docs/Demo.md to mention the root command as an alternative to the cd-based path Validation (from clean dist): pnpm test: 310 tests passed (127 core + 72 router + 21 testing + 4 server + 86 dom) pnpm typecheck: passes pnpm build: passes (all packages + vite build) pnpm dev:web-basic: Vite starts cleanly in <150ms with no resolution errors
1 parent b0782df commit 0c46eda

3 files changed

Lines changed: 12 additions & 1 deletion

File tree

docs/Demo.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ library, or an API route framework.
1414

1515
## How to run the demo
1616

17+
```sh
18+
pnpm dev:web-basic
19+
```
20+
21+
Or from the example directory:
22+
1723
```sh
1824
cd examples/web-basic
1925
pnpm dev

examples/web-basic/vite.config.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ import { defineConfig } from "vite"
22

33
export default defineConfig({
44
resolve: {
5+
alias: {
6+
"@intent/core": new URL("../../packages/core/src/index.ts", import.meta.url).pathname,
7+
"@intent/dom": new URL("../../packages/dom/src/index.ts", import.meta.url).pathname,
8+
"@intent/router": new URL("../../packages/router/src/index.ts", import.meta.url).pathname,
9+
},
510
conditions: ["development", "browser"],
611
},
712
})

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"test": "pnpm -r test",
77
"typecheck": "tsc -p tsconfig.typecheck.json",
88
"lint": "tsc -p tsconfig.typecheck.json",
9-
"dev:web-basic": "pnpm --filter @intent/web-basic dev"
9+
"dev:web-basic": "pnpm --dir examples/web-basic dev"
1010
},
1111
"engines": {
1212
"node": ">=18"

0 commit comments

Comments
 (0)