Skip to content

Commit b131d06

Browse files
committed
feat(ferric): default ferric init to Node-API version 10
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01U2xSE1mz5goMZqhntiYJfa
1 parent 269d422 commit b131d06

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎.changeset/ferric-init-command.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ Add a `ferric init [path]` command, scaffolding a package building a Rust Node-A
66

77
It writes the `package.json`, `Cargo.toml`, `build.rs`, `src/lib.rs` and `.gitignore` a package needs, and adds it to the workspace of the mono-repo it is initialized into. Run against a package that already exists, it bumps outdated dependencies and crates in place, and prints a diff for every update. A differing entrypoint or source file is skipped with a diff to merge by hand, unless `--force` is passed. `--dry-run` prints all of this without writing anything.
88

9-
A new `Cargo.toml` can be configured with `--node-api-version`, `--napi-crate-version`, `--napi-derive-crate-version`, `--napi-build-crate-version` and `--release-profile`.
9+
A new `Cargo.toml` enables Node-API version 10 by default, and can be configured with `--node-api-version`, `--napi-crate-version`, `--napi-derive-crate-version`, `--napi-build-crate-version` and `--release-profile`.

‎packages/ferric/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Running it against a package which already exists updates rather than overwrites
4343

4444
A newly created `Cargo.toml` can be configured with:
4545

46-
- `--node-api-version <version>`: the `napiN` feature to enable, defaulting to 3.
46+
- `--node-api-version <version>`: the `napiN` feature to enable, defaulting to 10.
4747
- `--napi-crate-version`, `--napi-derive-crate-version` and `--napi-build-crate-version`: the crate versions, defaulting to those tested with `ferric-example`. These also set what an existing `Cargo.toml` is bumped to.
4848
- `--release-profile <speed|size|none>`: `speed` (the default) enables `lto` and a single codegen unit, `size` also optimizes for size and strips symbols, and `none` leaves `[profile.release]` out.
4949

‎packages/ferric/src/init.test.ts‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -381,15 +381,15 @@ describe("planInit", () => {
381381
assert.match(change.contents, /"\r?\n$/);
382382
});
383383

384-
it("defaults to Node-API version 3", async (context) => {
384+
it("defaults to Node-API version 10", async (context) => {
385385
const packagePath = setupTempDirectory(context);
386386
const plan = await planInit({ packagePath });
387-
assert.equal(DEFAULT_NODE_API_VERSION, 3);
387+
assert.equal(DEFAULT_NODE_API_VERSION, 10);
388388
const change = plan.changes.find(({ path: filePath }) =>
389389
filePath.endsWith("Cargo.toml"),
390390
);
391391
assert(change);
392-
assert.match(change.contents, /features = \["napi3"\]/);
392+
assert.match(change.contents, /features = \["napi10"\]/);
393393
});
394394

395395
it("rejects versions it cannot use", async (context) => {

‎packages/ferric/src/init.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ import {
3838
const PACKAGE_ROOT = path.join(import.meta.dirname, "..");
3939
const TEMPLATES_PATH = path.join(PACKAGE_ROOT, "templates");
4040

41-
export const DEFAULT_NODE_API_VERSION = 3;
41+
export const DEFAULT_NODE_API_VERSION = 10;
4242

4343
export const DEFAULT_CRATE_VERSIONS: CrateVersions = {
4444
napi: "3.14.2",

0 commit comments

Comments
 (0)