Context
Stacks is moving from a vendored framework (the whole framework tree in storage/framework/) to consuming it as published @stacksjs/* npm packages (the newer workflow; also what enables buddy extension:* browser-extension builds). ghostanalytics is already transitional: the framework is installed as node_modules deps, storage/framework/ is excluded in tsconfig.json, and @stacksjs/* resolves from node_modules. The vendored tree is now mostly dead weight held in place by a couple of references.
Current state (assessed 2026-07-20)
- Framework-as-deps in place: ~106
@stacksjs/*packages innode_modules(via thestacksmeta-package v0.70.73). Framework defaults ship as@stacksjs/defaults(node_modules/@stacksjs/defaults/resources/...). - Vendored
storage/framework/: ~106M (core packages +defaults/), excluded in tsconfig - not used for type/module resolution.
Migration surface (small)
Load-bearing - fix before removing the tree:
config/crosswind.ts(~L9-11) - CSS content globs scan./storage/framework/defaults/resources/{views,components}andcore/error-handling/src/views. Repoint to the package locations:./node_modules/@stacksjs/defaults/resources/{views,components}/**(+ the error-handling package's views). Without this, dashboard / component / error-page CSS stops generating.package.jsonbuild:reset(~L22) - ends withcd storage/framework && bun run build. Remove that step; there is no vendored framework to build.
Cosmetic - clean up, not blocking:
config/code-style.ts(~L82-85): lint-ignore globs for framework-generated dirs.- Vendored-path mentions in comments:
config/cloud.ts,resources/plugins/preloader.ts,app/README.md(androutes/api.tswhere present).
Plan
- Branch
chore/drop-vendored-framework. - Repoint
config/crosswind.tscontent globs →node_modules/@stacksjs/defaults/...(+ error-handling package views). - Remove the
cd storage/framework && bun run buildstep frompackage.jsonbuild:reset. mv storage/framework storage/framework.bak(do not delete yet).- Verify end-to-end:
buddy dev+/stacks-browsebrowser QA on the dashboard/UI (render + CSS + hydration),buddy build,buddy lint,buddy test. - Green →
rm -rf storage/framework.bak(reclaims ~106M). Keepstorage/{logs,keys,app,cloud}(runtime data / deploy state). - Clean up cosmetic references; pin
@stacksjs/stacksversions (let buddy-bot drive upgrades). - Commit + PR.
Guardrails (learned the hard way)
- Verify in the running app with
/stacks-browse, not isolated renders. A recent framework sidebar change looked fine in headlessrenderViewbut was broken in the real dashboard (component resolution + no hydration). Browser QA is the source of truth for framework/UI changes. - Pilot one app first, fully verify, then apply to the sibling. The framework migration is still "in testing".
- Rollback is trivial: nothing destructive until step 6 -
mv storage/framework.bak storage/frameworkorgit checkout.