nerve init: generate pnpm workspace config + align with new conventions #229
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
nerve initscaffolds a workspace that is outdated after recent changes:pnpm-workspace.yaml— workspace should declaresenses/*andworkflows/*as packagesscripts.buildin rootpackage.json— should have"build": "pnpm -r build"cpu-usage) still uses rawindex.jsinstead ofsrc/index.ts+ esbuild bundle (fixed in #225 fornerve create sensebut not for init)Tasks
1. Generate
pnpm-workspace.yaml2. Update
PACKAGE_JSONtemplateAdd build script:
3. Update example sense to TypeScript + esbuild
The
cpu-usageexample sense should match the pattern from #225:senses/cpu-usage/src/index.ts(notindex.js)senses/cpu-usage/src/schema.ts(notschema.tsat root)senses/cpu-usage/package.jsonwith esbuild build scriptmigrations/stays at sense root4. Run
pnpm install && pnpm buildafter scaffoldingAfter generating all files, the init should run a workspace-level install and build so the example sense is ready.
5. Update tests
Update
e2e-validate-init.test.tsand any other init-related tests.Reference
nerve create sensealready generates the right structure)