Commit a4d29da
Fix
## Summary
Multiple fixes and improvements to `spacetime dev`, `spacetime publish`,
`spacetime init`, and templates:
### CLI fixes
- **Fix `spacetime dev` watch path and .env.local handling** for
templates with a `spacetimedb/` subdirectory
- **Validate package manager availability** before installing
dependencies — re-prompts if the selected PM isn't on PATH
- **Remove JS/TS beta warning** from `spacetime publish`
- **Remove unstable warning** from `spacetime init`
- **Remove unused `spacetime energy` command** (can be re-added later
when properly implemented)
- **Fix `tsc` detection on Windows** — `set_extension(".cmd")` produced
`tsc..cmd` (double dot); fixed to `set_extension("cmd")`
- **Add `typescript` as devDependency** to all server template
`spacetimedb/package.json` files so `tsc` is available during build
- **Strip `\?\` extended-length path prefix** from user-facing output in
both `dev` and `publish` commands (produced by `fs::canonicalize()` on
Windows)
- **Fix publish reporting success when user declines** non-local server
prompt — changed `return Ok(())` to `bail!()` consistent with other
abort cases
- **Forward stdin to client process** in `spacetime dev` so interactive
CLI templates work
### Template fixes
- **Fix Angular template environment variables** — Angular's esbuild
builder doesn't support `import.meta.env`, so we use a dev script to
generate `environment.local.ts` with Angular's native `fileReplacements`
pattern
- **Fix TanStack Start template** — rename `createRouter` to `getRouter`
(v1.121+ breaking change), upgrade to React 19, and add
`@vitejs/plugin-react` for automatic JSX runtime support
- **Fix `moduleResolution` in remix-ts and nextjs-ts** server tsconfigs
— change from `"node"` to `"bundler"` to support subpath exports like
`spacetimedb/server`
- **Fix browser-ts template** — convert from static HTML + IIFE bundle
to standard Vite dev server app so it works with `spacetime dev` and
reads env vars from `.env.local`
- **Add `deno` as devDependency** to deno-ts template (matches how
bun-ts includes bun)
- **Convert basic-ts from empty web app to CLI app** matching basic-rs —
connect, subscribe to person table, print on insert
## Test plan
- [x] `cargo test -p spacetimedb-cli` — all 133 tests pass
- [ ] `spacetime dev --template angular-ts` — verify Angular app
connects with correct database name
- [ ] `spacetime dev --template react-ts` — verify React template still
works
- [ ] `spacetime dev --template tanstack-ts` — verify TanStack Start
template loads without errors
- [ ] `spacetime dev --template remix-ts` — verify Remix template builds
and runs
- [ ] `spacetime dev --template nextjs-ts` — verify Next.js template
still works
- [ ] `spacetime dev --template browser-ts` — verify Vite dev server
starts and app connects
- [ ] `spacetime dev --template bun-ts` — verify Bun CLI template runs
interactively
- [ ] `spacetime dev --template basic-ts` — verify CLI connects and
prints on insert
- [ ] Verify no `\?\` prefix in any displayed paths on Windows
- [ ] Verify no `tsc not found` warning when building server modules
- [ ] Select unavailable package manager at init prompt — verify
re-prompt
- [ ] Decline non-local server prompt — verify clean error instead of
"Published successfully!"
---------
Co-authored-by: Piotr Sarnacki <drogus@gmail.com>
Co-authored-by: John Detter <4099508+jdetter@users.noreply.github.com>
Co-authored-by: clockwork-labs-bot <bot@clockworklabs.com>spacetime dev template issues and clean up CLI (#4396)1 parent e9ecfa9 commit a4d29da
79 files changed
Lines changed: 1191 additions & 1043 deletions
File tree
- crates
- cli/src
- subcommands
- tasks
- smoketests/tests
- docs/docs
- 00100-intro/00200-quickstarts
- 00300-resources/00200-reference/00100-cli-reference
- smoketests/tests
- templates
- angular-ts
- scripts
- spacetimedb
- src
- src
- app
- environments
- basic-ts
- spacetimedb
- src
- src
- browser-ts
- spacetimedb
- src
- src
- bun-ts
- spacetimedb
- src
- src
- deno-ts
- spacetimedb
- src
- src
- nextjs-ts/spacetimedb
- src
- nodejs-ts/spacetimedb
- src
- nuxt-ts/spacetimedb
- src
- react-ts/spacetimedb
- src
- remix-ts/spacetimedb
- src
- svelte-ts/spacetimedb
- src
- tanstack-ts
- spacetimedb
- src
- src
- vue-ts/spacetimedb
- src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | 18 | | |
26 | 19 | | |
27 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
60 | 75 | | |
61 | 76 | | |
62 | 77 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | 30 | | |
32 | 31 | | |
33 | 32 | | |
| |||
54 | 53 | | |
55 | 54 | | |
56 | 55 | | |
57 | | - | |
58 | 56 | | |
59 | 57 | | |
60 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
231 | | - | |
| 231 | + | |
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
| |||
279 | 279 | | |
280 | 280 | | |
281 | 281 | | |
282 | | - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
283 | 287 | | |
284 | 288 | | |
285 | 289 | | |
| |||
402 | 406 | | |
403 | 407 | | |
404 | 408 | | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
409 | 412 | | |
410 | 413 | | |
411 | 414 | | |
| |||
474 | 477 | | |
475 | 478 | | |
476 | 479 | | |
477 | | - | |
| 480 | + | |
478 | 481 | | |
479 | 482 | | |
480 | 483 | | |
| |||
527 | 530 | | |
528 | 531 | | |
529 | 532 | | |
530 | | - | |
| 533 | + | |
531 | 534 | | |
532 | 535 | | |
533 | 536 | | |
| |||
601 | 604 | | |
602 | 605 | | |
603 | 606 | | |
604 | | - | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
605 | 612 | | |
606 | 613 | | |
607 | 614 | | |
| |||
631 | 638 | | |
632 | 639 | | |
633 | 640 | | |
634 | | - | |
| 641 | + | |
635 | 642 | | |
636 | 643 | | |
637 | 644 | | |
| |||
644 | 651 | | |
645 | 652 | | |
646 | 653 | | |
647 | | - | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
648 | 658 | | |
649 | 659 | | |
650 | 660 | | |
651 | 661 | | |
652 | 662 | | |
653 | | - | |
| 663 | + | |
654 | 664 | | |
655 | 665 | | |
656 | 666 | | |
| |||
936 | 946 | | |
937 | 947 | | |
938 | 948 | | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
| 964 | + | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
| 969 | + | |
| 970 | + | |
| 971 | + | |
| 972 | + | |
| 973 | + | |
939 | 974 | | |
940 | 975 | | |
941 | 976 | | |
| |||
957 | 992 | | |
958 | 993 | | |
959 | 994 | | |
960 | | - | |
961 | | - | |
962 | | - | |
963 | | - | |
964 | | - | |
965 | | - | |
966 | | - | |
967 | | - | |
968 | | - | |
969 | | - | |
970 | | - | |
971 | | - | |
972 | | - | |
973 | | - | |
974 | | - | |
975 | | - | |
976 | | - | |
977 | | - | |
978 | | - | |
979 | | - | |
980 | | - | |
981 | 995 | | |
982 | 996 | | |
983 | 997 | | |
| |||
1454 | 1468 | | |
1455 | 1469 | | |
1456 | 1470 | | |
| 1471 | + | |
1457 | 1472 | | |
1458 | 1473 | | |
1459 | 1474 | | |
| |||
1462 | 1477 | | |
1463 | 1478 | | |
1464 | 1479 | | |
1465 | | - | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
| 1484 | + | |
| 1485 | + | |
| 1486 | + | |
| 1487 | + | |
1466 | 1488 | | |
1467 | 1489 | | |
1468 | | - | |
| 1490 | + | |
1469 | 1491 | | |
1470 | 1492 | | |
1471 | 1493 | | |
| |||
1501 | 1523 | | |
1502 | 1524 | | |
1503 | 1525 | | |
1504 | | - | |
| 1526 | + | |
1505 | 1527 | | |
1506 | 1528 | | |
1507 | 1529 | | |
| |||
1603 | 1625 | | |
1604 | 1626 | | |
1605 | 1627 | | |
1606 | | - | |
| 1628 | + | |
1607 | 1629 | | |
1608 | 1630 | | |
1609 | 1631 | | |
| |||
1616 | 1638 | | |
1617 | 1639 | | |
1618 | 1640 | | |
1619 | | - | |
| 1641 | + | |
1620 | 1642 | | |
1621 | 1643 | | |
1622 | 1644 | | |
| |||
This file was deleted.
0 commit comments