Repository navigation
feat(ferric): add --cwd option to build - #486
Merged
Merged
Conversation
2 tasks done
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
kraenhansen
force-pushed
the
ferric-cwd
branch
from
October 31, 2026 12:23
85f9857 to
7947ec6
Compare
kraenhansen
marked this pull request as ready for review
October 31, 2026 12:45
kraenhansen
added a commit
that referenced
this pull request
Oct 31, 2026
* feat(ferric): add --cwd option to build Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix(ferric): resolve target dir and toolchain from the crate Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * refactor(ferric): validate cargo metadata with zod Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(ferric): cover --cwd, workspaces and the toolchain check Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
kraenhansen
added a commit
that referenced
this pull request
Oct 31, 2026
* feat(ferric): add --cwd option to build Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix(ferric): resolve target dir and toolchain from the crate Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * refactor(ferric): validate cargo metadata with zod Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(ferric): cover --cwd, workspaces and the toolchain check Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
ferric build --cwd <path>, as agreed in #195, mirroring napi-rs'--cwd. This supersedes #205 (thanks to dougg0k for the original work), leaving out itsdistoutput change and dependency bumps.--cwdresolves against the invocation directory, so relative and absolute paths both work, and it applies to every cargo and napi-rs call, including--cleanand--dts-only.--outputdefaults to the--cwddirectory. An explicit relative--outputstill resolves against the invocation directory.cwdrather than--manifest-path, so the crate's.cargo/config.tomland toolchain files still apply.cargo metadata, and the library is picked by its exact name, so workspace members andCARGO_TARGET_DIRwork and a stale localtarget/is ignored.--cwddirectory, so a crate'srust-toolchain.tomlis respected.cargo metadataoutput is validated with zod.Test plan
pnpm run build,pnpm run lint,pnpm run prettier:checkpnpm --filter ferric-cli run test, with a CLI test that scaffolds a crate viaferric initand builds it with--cwdferric build --cwd packages/ferric-example --target aarch64-apple-ios-simfrom the repo root puts the outputs in the crate directory--dts-onlywith a relative--cwd, with an absolute--cwdplus relative--output, and with no--cwdfrom the crate directory--cwddirectory gives a clear errortarget/, andCARGO_TARGET_DIRonaarch64-apple-ios-sim--cwddirectory, using a stand-inrustup--cwd--cleanthrough--cwd🤖 Generated with Claude Code