Context
Stacks is moving from a vendored framework (storage/framework/ as workspace packages) to consuming it as published @stacksjs/* npm packages (the newer workflow; also enables buddy extension:* browser-extension builds).
postline is on the vendored-workspace model (like bench-review), and the most entangled of the apps assessed - its core @stacksjs/* are live symlinks into the vendored tree, so storage/framework/ is actively load-bearing, not dead weight.
Current state (assessed 2026-07-20)
- Framework = vendored workspace, actively symlinked:
node_modules/@stacksjs/{orm,router,actions,database,validation}andnode_modules/stacksare symlinks intostorage/framework/core/*.stacks: "workspace:*",workspaces: ['storage/framework', 'storage/framework/core/*', ...],storage/framework/= ~55M (89 core packages), package namestacks-framework@0.70.40. - Mixed resolution:
@stacksjs/stxis a real npm package (stx repo), while the core framework resolves to the vendored tree. - tsconfig inherits the vendored framework:
"extends": "./storage/framework/core/tsconfig.json". build:resetbuilds the vendored tree (cd storage/framework && bun run build).- No
config/crosswind.ts. App version0.0.0.
Migration surface
package.json-stacks: "workspace:*"→ published^0.70.x(vendored is 0.70.40; published meta ~0.70.73); remove theworkspaces: ['storage/framework/**', ...]block.tsconfig.json- replaceextends: "./storage/framework/core/tsconfig.json"with a self-contained config resolving@stacksjs/*fromnode_modulesand excludingstorage/framework/(mirror bughq's / ghostanalytics's target tsconfig).package.jsonbuild:reset- remove thecd storage/framework && bun run buildstep.bun install- replaces the symlinks-into-storage/frameworkwith real npm packages ofstacks+ the core@stacksjs/*.- Delete
storage/framework/(~55M) - only after step 4. Keepstorage/{logs,keys,app,cloud}.
Plan
- Confirm a working baseline:
buddy devruns today (+/stacks-browseQA), so a regression is attributable. - Branch
chore/adopt-framework-deps. package.json:stacks→ published version; remove thestorage/framework/**workspaces.tsconfig.json: swap the vendoredextendsfor a self-contained config (copy the sibling apps').- Remove the vendored-build step from
build:reset. bun install- the pivotal step. Confirmnode_modules/@stacksjs/{orm,router,...}andnode_modules/stacksare now real dirs, not symlinks intostorage/framework.mv storage/framework storage/framework.bak- only after step 5 (see risks).- Verify end-to-end:
buddy dev+/stacks-browsebrowser QA,buddy build,buddy lint,buddy test. - Green →
rm -rf storage/framework.bak.
Risks / watch-outs (highest coupling of the apps assessed)
- Order-critical: the core
@stacksjs/*+stacksare live symlinks intostorage/framework. Removing the tree before the npm re-install (step 5) breaksorm/router/actions/database/validation/stacks. Rewire +bun installfirst,mvsecond. - Version drift: vendored
stacks-framework@0.70.40→ publishedstacks@~0.70.73; the app (v0.0.0) was built against 0.70.40 - expect to reconcile API/version drift. - tsconfig replacement is load-bearing (the whole TS/build setup is inherited from the vendored tree).
- Verify in the running app with
/stacks-browse, not isolatedrenderView(a recent framework sidebar change passed a headless render but was broken live). - Sequence: pilot the near-drop-in apps (bughq/ghostanalytics) first; do the vendored-workspace apps (bench-review, postline) last - postline is the most entangled.
Rollback
Nothing destructive until step 8 - mv storage/framework.bak storage/framework + git checkout restores everything.