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
This commit is contained in:
LongYinan 2023-12-13 14:13:14 +08:00 committed by GitHub
parent af248435ac
commit 8d4202e5f4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 7 deletions

View file

@ -300,7 +300,7 @@ const ARTIFACTS_OPTIONS: CommandSchema = {
description: description:
'Path to the folder where all built `.node` files put, same as `--output-dir` of build command', 'Path to the folder where all built `.node` files put, same as `--output-dir` of build command',
short: 'o', short: 'o',
default: "'./'", default: "'./artifacts'",
}, },
{ {
name: 'npmDir', name: 'npmDir',

View file

@ -27,5 +27,5 @@ new NapiCli().artifacts({
| | --help,-h | | | | get help | | | --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 | | 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` | | 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 | | npmDir | --npm-dir | string | false | 'npm' | Path to the folder where the npm packages put |

View file

@ -47,7 +47,7 @@ new NapiCli().build({
| profile | --profile | string | false | | Build artifacts with the specified profile | | 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 | | 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` | | 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 | | 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 | | features | --features,-F | string[] | false | | Space-separated list of features to activate |
| allFeatures | --all-features | boolean | false | | Activate all available features | | allFeatures | --all-features | boolean | false | | Activate all available features |

View file

@ -19,7 +19,7 @@ export abstract class BaseArtifactsCommand extends Command {
description: 'Path to `package.json`', description: 'Path to `package.json`',
}) })
outputDir = Option.String('--output-dir,-o', './', { outputDir = Option.String('--output-dir,-o', './artifacts', {
description: description:
'Path to the folder where all built `.node` files put, same as `--output-dir` of build command', '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 * Path to the folder where all built `.node` files put, same as `--output-dir` of build command
* *
* @default './' * @default './artifacts'
*/ */
outputDir?: string outputDir?: string
/** /**

View file

@ -112,7 +112,7 @@ export abstract class BaseBuildCommand extends Command {
useNapiCross?: boolean = Option.Boolean('--use-napi-cross', { useNapiCross?: boolean = Option.Boolean('--use-napi-cross', {
description: 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', { watch?: boolean = Option.Boolean('--watch,-w', {
@ -258,7 +258,7 @@ export interface BuildOptions {
*/ */
useCross?: boolean 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 useNapiCross?: boolean
/** /**