feat(cli): aube add bootstraps package.json + 10 misc.ts ports#417
Conversation
Greptile SummaryThis PR ports 9 new bats test cases from One note on the PR description: it lists case 245 ("bare Confidence Score: 5/5Safe to merge — code and tests are correct; only the PR description has minor inaccuracies. No P0 or P1 findings. The No files require special attention. Important Files Changed
Reviews (6): Last reviewed commit: "feat(cli): aube add creates package.json..." | Re-trigger Greptile |
Benchmark changesVersions:
Public ratios: warm installs vs Bun 3x -> 1.8x; warm installs vs pnpm 9x -> 8x.
13935c7 vs aecb50f | aube/bun/pnpm | 3 scenarios | 3 runs | 500mbit/50ms | generated by Codex. |
8951cc2 to
bd385f9
Compare
Adds --use-stderr, lockfile=false-in-workspace-yaml, --prefix, and spec-preserved-verbatim. is-positive substituted with is-odd (already in test/registry/storage/). Brings the misc.ts port to 5/37. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Use assert_file_not_exists instead of `assert [ ! -e ... ]` for bats-file diagnostic output on failure. - Wrap `[ -z "$output" ]` in `assert` to surface the actual value on failure. Note in code that `[[ ... ]]` can't be wrapped (bash keyword); switch the stderr-contains check to `assert grep -qF`. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Now that the @pnpm.e2e/* fixtures landed in test/registry/storage/ (via #424), three previously-skipped misc.ts ports become viable: - bin-on-PATH-in-root-postinstall (line 36) - run-script-invokes-dep-bin (line 219) - case-only-filename-collision-installs-cleanly (line 163) The case-collision port deliberately skips pnpm's StoreIndex-internal assertions (those probe pnpm-specific CAS internals) and instead asserts the user-visible parity guarantee: install succeeds and the package materializes under node_modules. Brings the misc.ts port to 8/37. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
bd385f9 to
e1da3cb
Compare
STORE_VERSION was a misread — it's just a path-component constant in pnpm's test, not the subject of any test. The actual scenario is strict-store-pkg-content-check: tamper with the cached store manifest and expect the next install to fail. Note the aube parity dependency. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
aube has no flag or setting for placing the lockfile outside the project root. Move misc.ts:112 from "remaining high-value" to "documented divergences" in the import TODO. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Mirrors pnpm: `pnpm install <pkg>` (= `aube add <pkg>`) in a directory
with no manifest writes a minimal `{}` package.json before continuing,
so users can bootstrap a project with a single command.
The home-boundary safety check on find_project_root still applies — the
auto-create only fires when the walk returns None (no ancestor up to
$HOME has package.json). `aube install` is unchanged: it still errors
clearly when there's no manifest.
Also ports two more misc.ts cases:
- create-package.json-if-missing (233) — uses the new behavior above
- pnpm-add-fails-with-no-name (245) — was a false-positive divergence in
the TODO; the original "exit=0" reading was a `$?`-after-pipe artifact.
aube already does the right thing.
Brings the misc.ts port to 10/37.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Summary
Two parts:
aube addnow creates a minimalpackage.jsonwhen run in a directory without one — mirrorspnpm install <pkg>. Bootstraps a project in a single command. The home-boundary safety check onfind_project_rootstill applies;aube installis unchanged (still errors clearly when no manifest exists).Ported (10)
--use-stderrredirects everything to stderr; stdout stays emptylockfile: falseinpnpm-workspace.yamlsuppresses the lockfile--prefixruns install in a subdirectory--save-exact+--save-devcombined~3.0.0doesn't get rewritten to^)aube add <pkg>in an empty dir createspackage.jsonaube add(no pkg name) exits 1 with a helpful errorTranslation choices
is-positivesubstituted withis-oddwhere it didn't matter to the scenario.pnpm install <pkg>translated toaube add <pkg>(aube splits the two commands).StoreIndex-internal assertions and only checks the user-visible parity guarantee.--use-stderrport usesassert grep -qFfor the stderr-contains check becauseassertcan't wrap the bash[[ ... ]]keyword.Divergences cleared
create-package.json-if-missing (233)— fixed in this PR.— was a false positive; aube already exits 1.pnpm addwith no name exits 1 (245)Divergences still recorded in the TODO
--lockfile-dir(112) — aube has no flag for placing the lockfile outside the project root.package.yamlmanifest (136) — aube's manifest reader ispackage.json-only; would need a multi-crate format-aware rewrite (out of scope here).strict-store-pkg-content-check(516) — needs investigation; depends on whether aube has an equivalent store-tamper detector.Test plan
mise run test:bats test/pnpm_install_misc.batspasses locally (10/10)mise run test:bats test/add.batspasses locally (no regressions)mise run test:bats test/project_root_walk_up.batspasses locally (the existingaube install errors clearly when no package.jsontest still works — the new behavior isaube add-only)cargo clippy -p aube --all-targets -- -D warningsclean🤖 Generated with Claude Code