Commit da4cb2b
committed
build: make web an npm workspace, with one lockfile and both runtimes working
`web/` had a tsconfig and a vite config but no manifest, so its build tooling —
vite, panda, preact, @types/react-dom — sat in the root manifest advertising
itself as a dependency of a launcher that never loads any of it. It is now
`@swisscode/web`, private, owning its own devDeps.
Nothing about the published artifact changes: `files` decides that, not the
layout. Still 75 files, 122.8 kB packed.
ONE LOCKFILE, AND IT HAS TO BE package-lock.json. Not preference: `bun install`
does not read it and resolves fresh — I diffed the resulting trees and found 5
transitive packages disagreeing (lightningcss, postcss, picomatch,
@babel/code-frame) while every declared dependency matched. Small, but that is
how "works on my machine" starts. And the choice is forced anyway: `bun publish`
has no OIDC/provenance equivalent, so npm stays in the release path permanently.
`bun.lock` is gitignored so the drift cannot be committed.
Bun loses nothing by this. It remains a first-class runtime — `bun run test`
passes 770/770 against an npm-installed tree, `bunx swisscode` works, and
swisscode runs under bun. It is simply not the installer.
Two things this shook out, both fixed rather than worked around:
- `npm run --workspace web typecheck` BREAKS UNDER BUN. Bun rewrites `npm run`
to `bun run` inside scripts and spells the same idea `--filter`, so the script
failed with "Script not found web". The fix is to not need workspace machinery
for what is one tsc invocation: `tsc --noEmit -p web/tsconfig.json` works
identically everywhere. No package-manager-specific flags in `scripts`.
- build.js hard-coded `../node_modules/vite/bin/vite.js`. npm and bun do not
agree on where workspace deps land, and either can nest on a version
conflict, so it now looks in both `web/node_modules` and the root — the
"works on my machine" this project runs two runtimes to avoid.
Verified end to end under both: npm install, npm ci, bun install, build, full
suite, and the packed artifact.
Signed-off-by: jellologic <31935831+jellologic@users.noreply.github.com>1 parent 24aaba2 commit da4cb2b
6 files changed
Lines changed: 85 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
56 | 57 | | |
57 | 58 | | |
58 | 59 | | |
| |||
196 | 197 | | |
197 | 198 | | |
198 | 199 | | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
199 | 211 | | |
200 | 212 | | |
201 | 213 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
18 | 34 | | |
19 | 35 | | |
20 | 36 | | |
| |||
63 | 79 | | |
64 | 80 | | |
65 | 81 | | |
66 | | - | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
67 | 85 | | |
68 | 86 | | |
69 | 87 | | |
70 | 88 | | |
71 | | - | |
| 89 | + | |
72 | 90 | | |
73 | 91 | | |
74 | 92 | | |
75 | | - | |
| 93 | + | |
76 | 94 | | |
77 | 95 | | |
78 | 96 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
| |||
75 | 78 | | |
76 | 79 | | |
77 | 80 | | |
78 | | - | |
79 | 81 | | |
80 | 82 | | |
81 | | - | |
82 | | - | |
83 | 83 | | |
84 | 84 | | |
85 | | - | |
86 | | - | |
87 | | - | |
| 85 | + | |
88 | 86 | | |
89 | 87 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
0 commit comments