src/hosts all TypeScript sources (index.ts,prebundle.ts, helpers, sharedtypes.ts); export public symbols throughsrc/index.ts.dist/holdsrsliboutput and must stay generated-only, whilecompiled/stores bundled dependencies produced by the CLI; never edit either manually.bin.jsis the CAC-based CLI entry; root configs (prebundle.config.ts,rslib.config.ts,tsconfig.json) govern build targets and should evolve together.tests/contains@rstest/coresuites plus fixture configs undertests/fixtures/used to exercise the CLI.
pnpm installrespectspnpm-lock.yaml; mixing package managers is forbidden to avoid dependency drift.pnpm devrunsrslib build --watchfor tight feedback while hacking onsrc/.pnpm buildgenerates production artifacts and doubles as a pre-publish smoke test; run it before every PR or release.pnpm testtriggerspnpm build && rstest, which runs the CLI integration suite.pnpm prebundle [pkg1 pkg2 ...] --config path/to/configexecutes the CLI for all configured dependencies or a filtered subset; use--configto point at custom fixtures.pnpm bumpwrapsnpx bumppfor releases; only call afterdist/and configs are committed.
- The repo is pure ESM (
type: module), so keep relative imports with explicit.jsextensions that mirror emitted files. - Apply
Prettierdefaults (2-space indent, single quotes, trailing commas) before committing; configure your editor to format on save. - Prefer
camelCasefor functions,PascalCasefor types/interfaces, and SCREAMING_SNAKE_CASE for constants stored inconstant.ts. - Keep modules focused; common utilities belong in
helper.ts, and shared configuration goes throughsrc/types.tsfor better type inference.
- Automated coverage uses
@rstest/coreintests/prebundle.test.tsto snapshot bundled output and execute the emitted modules; add new cases there or create additional suites undertests/. - Prefer end-to-end checks that run
bin.js --config <fixture>so the CLI path stays covered across platforms. - When adding manual validation steps (e.g., testing new dependencies), document the exact
pnpm prebundle ...invocation and observed artifacts in the PR description.
- Follow Conventional Commits mirroring existing history (
feat:,fix(deps):,chore:); add scopes likefeat(cli):when touching a specific module. - Each PR should describe the motivation, list the commands you ran (
pnpm build,pnpm prebundle commander, etc.), and reference related issues. - Separate mechanical refactors from behavior changes to keep diffs reviewable, and ensure CI or manual checks are linked before requesting review.