From 8d4202e5f4efcd9ec2ea80a9d6a145da20d3e774 Mon Sep 17 00:00:00 2001 From: LongYinan Date: Wed, 13 Dec 2023 14:13:14 +0800 Subject: [PATCH] fix(cli): artifacts default option value (#1853) https://github.com/napi-rs/napi-rs/pull/1850 was not fixed the problem because the default value is codegen from cli/codegen/commands.ts --- cli/codegen/commands.ts | 2 +- cli/docs/artifacts.md | 2 +- cli/docs/build.md | 2 +- cli/src/def/artifacts.ts | 4 ++-- cli/src/def/build.ts | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cli/codegen/commands.ts b/cli/codegen/commands.ts index 8e5e79a0..d78e8444 100644 --- a/cli/codegen/commands.ts +++ b/cli/codegen/commands.ts @@ -300,7 +300,7 @@ const ARTIFACTS_OPTIONS: CommandSchema = { description: 'Path to the folder where all built `.node` files put, same as `--output-dir` of build command', short: 'o', - default: "'./'", + default: "'./artifacts'", }, { name: 'npmDir', diff --git a/cli/docs/artifacts.md b/cli/docs/artifacts.md index bc15c19c..8a218f7b 100644 --- a/cli/docs/artifacts.md +++ b/cli/docs/artifacts.md @@ -27,5 +27,5 @@ new NapiCli().artifacts({ | | --help,-h | | | | get help | | cwd | --cwd | string | false | process.cwd() | The working directory of where napi command will be executed in, all other paths options are relative to this path | | packageJsonPath | --package-json-path | string | false | 'package.json' | Path to `package.json` | -| outputDir | --output-dir,-o | string | false | './' | Path to the folder where all built `.node` files put, same as `--output-dir` of build command | +| outputDir | --output-dir,-o | string | false | './artifacts' | Path to the folder where all built `.node` files put, same as `--output-dir` of build command | | npmDir | --npm-dir | string | false | 'npm' | Path to the folder where the npm packages put | diff --git a/cli/docs/build.md b/cli/docs/build.md index 6b13d3a7..00f4c257 100644 --- a/cli/docs/build.md +++ b/cli/docs/build.md @@ -47,7 +47,7 @@ new NapiCli().build({ | profile | --profile | string | false | | Build artifacts with the specified profile | | crossCompile | --cross-compile,-x | boolean | false | | [experimental] cross-compile for the specified target with `cargo-xwin` on windows and `cargo-zigbuild` on other platform | | useCross | --use-cross | boolean | false | | [experimental] use [cross](https://github.com/cross-rs/cross) instead of `cargo` | -| useNapiCross | --use-napi-cross | boolean | false | | [experimental] use @napi-rs/cross-toolchain to cross-compile Linux arm/arm64/x64 gnu targets | +| useNapiCross | --use-napi-cross | boolean | false | | [experimental] use @napi-rs/cross-toolchain to cross-compile Linux arm/arm64/x64 gnu targets. | | watch | --watch,-w | boolean | false | | watch the crate changes and build continiously with `cargo-watch` crates | | features | --features,-F | string[] | false | | Space-separated list of features to activate | | allFeatures | --all-features | boolean | false | | Activate all available features | diff --git a/cli/src/def/artifacts.ts b/cli/src/def/artifacts.ts index 67e8cd9d..2e50439f 100644 --- a/cli/src/def/artifacts.ts +++ b/cli/src/def/artifacts.ts @@ -19,7 +19,7 @@ export abstract class BaseArtifactsCommand extends Command { description: 'Path to `package.json`', }) - outputDir = Option.String('--output-dir,-o', './', { + outputDir = Option.String('--output-dir,-o', './artifacts', { description: 'Path to the folder where all built `.node` files put, same as `--output-dir` of build command', }) @@ -57,7 +57,7 @@ export interface ArtifactsOptions { /** * Path to the folder where all built `.node` files put, same as `--output-dir` of build command * - * @default './' + * @default './artifacts' */ outputDir?: string /** diff --git a/cli/src/def/build.ts b/cli/src/def/build.ts index 23e552b0..cb6ca2b7 100644 --- a/cli/src/def/build.ts +++ b/cli/src/def/build.ts @@ -112,7 +112,7 @@ export abstract class BaseBuildCommand extends Command { useNapiCross?: boolean = Option.Boolean('--use-napi-cross', { description: - '[experimental] use @napi-rs/cross-toolchain to cross-compile Linux arm/arm64/x64 gnu targets', + '[experimental] use @napi-rs/cross-toolchain to cross-compile Linux arm/arm64/x64 gnu targets.', }) watch?: boolean = Option.Boolean('--watch,-w', { @@ -258,7 +258,7 @@ export interface BuildOptions { */ useCross?: boolean /** - * [experimental] use @napi-rs/cross-toolchain to cross-compile Linux arm/arm64/x64 gnu targets + * [experimental] use @napi-rs/cross-toolchain to cross-compile Linux arm/arm64/x64 gnu targets. */ useNapiCross?: boolean /**