@napi-rs/cli 3.0.0-alpha.3 → 3.0.0-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/build.js +34 -14
- package/dist/api/templates/ci-template.js +10 -11
- package/dist/api/templates/ci.yml.js +8 -2
- package/dist/api/templates/js-binding.d.ts +1 -1
- package/dist/api/templates/js-binding.js +243 -109
- package/dist/api/templates/package.json.js +29 -27
- package/dist/cli.js +0 -0
- package/dist/commands/new.js +1 -4
- package/dist/def/build.d.ts +12 -0
- package/dist/def/build.js +8 -0
- package/dist/index.cjs +2734 -7836
- package/dist/utils/__tests__/typegen.spec.js +1 -1
- package/dist/utils/ci.js +9 -0
- package/dist/utils/config.d.ts +9 -1
- package/dist/utils/target.d.ts +2 -2
- package/dist/utils/target.js +4 -0
- package/dist/utils/typegen.d.ts +4 -1
- package/dist/utils/typegen.js +20 -1
- package/dist/utils/version.js +2 -2
- package/package.json +13 -13
- package/src/api/artifacts.ts +2 -2
- package/src/api/build.ts +45 -18
- package/src/api/pre-publish.ts +8 -5
- package/src/api/templates/ci-template.ts +10 -11
- package/src/api/templates/ci.yml.ts +8 -2
- package/src/api/templates/js-binding.ts +236 -104
- package/src/api/templates/package.json.ts +31 -26
- package/src/commands/new.ts +1 -5
- package/src/def/build.ts +19 -0
- package/src/utils/__tests__/__snapshots__/target.spec.ts.md +7 -0
- package/src/utils/__tests__/__snapshots__/target.spec.ts.snap +0 -0
- package/src/utils/__tests__/__snapshots__/version.spec.ts.md +7 -7
- package/src/utils/__tests__/__snapshots__/version.spec.ts.snap +0 -0
- package/src/utils/__tests__/typegen.spec.ts +1 -1
- package/src/utils/ci.ts +9 -0
- package/src/utils/config.ts +12 -1
- package/src/utils/target.ts +5 -0
- package/src/utils/typegen.ts +20 -1
- package/src/utils/version.ts +1 -1
- package/dist/def/commands/artifacts.d.ts +0 -15
- package/dist/def/commands/artifacts.js +0 -29
- package/dist/def/commands/build.d.ts +0 -53
- package/dist/def/commands/build.js +0 -105
- package/dist/def/commands/create-npm-dirs.d.ts +0 -15
- package/dist/def/commands/create-npm-dirs.js +0 -29
- package/dist/def/commands/new.d.ts +0 -27
- package/dist/def/commands/new.js +0 -53
- package/dist/def/commands/pre-publish.d.ts +0 -23
- package/dist/def/commands/pre-publish.js +0 -45
- package/dist/def/commands/rename.d.ts +0 -25
- package/dist/def/commands/rename.js +0 -49
- package/dist/def/commands/universalize.d.ts +0 -13
- package/dist/def/commands/universalize.js +0 -25
- package/dist/def/commands/version.d.ts +0 -13
- package/dist/def/commands/version.js +0 -25
- package/dist/def/options/artifacts.d.ts +0 -35
- package/dist/def/options/artifacts.js +0 -11
- package/dist/def/options/build.d.ts +0 -97
- package/dist/def/options/build.js +0 -3
- package/dist/def/options/create-npm-dirs.d.ts +0 -35
- package/dist/def/options/create-npm-dirs.js +0 -11
- package/dist/def/options/new.d.ts +0 -79
- package/dist/def/options/new.js +0 -15
- package/dist/def/options/pre-publish.d.ts +0 -65
- package/dist/def/options/pre-publish.js +0 -13
- package/dist/def/options/rename.d.ts +0 -75
- package/dist/def/options/rename.js +0 -11
- package/dist/def/options/universalize.d.ts +0 -28
- package/dist/def/options/universalize.js +0 -10
- package/dist/def/options/version.d.ts +0 -28
- package/dist/def/options/version.js +0 -10
package/src/utils/version.ts
CHANGED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Command } from 'clipanion';
|
|
2
|
-
export declare abstract class BaseArtifactsCommand extends Command {
|
|
3
|
-
static paths: string[][];
|
|
4
|
-
static usage: import("clipanion").Usage;
|
|
5
|
-
cwd: string;
|
|
6
|
-
packageJsonPath: string;
|
|
7
|
-
outputDir: string;
|
|
8
|
-
npmDir: string;
|
|
9
|
-
getOptions(): {
|
|
10
|
-
cwd: string;
|
|
11
|
-
packageJsonPath: string;
|
|
12
|
-
outputDir: string;
|
|
13
|
-
npmDir: string;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// This file is generated by codegen/index.ts
|
|
2
|
-
// Do not edit this file manually
|
|
3
|
-
import { Command, Option } from 'clipanion';
|
|
4
|
-
export class BaseArtifactsCommand extends Command {
|
|
5
|
-
static paths = [['artifacts']];
|
|
6
|
-
static usage = Command.Usage({
|
|
7
|
-
description: 'Copy artifacts from Github Actions into npm packages and ready to publish',
|
|
8
|
-
});
|
|
9
|
-
cwd = Option.String('--cwd', process.cwd(), {
|
|
10
|
-
description: 'The working directory of where napi command will be executed in, all other paths options are relative to this path',
|
|
11
|
-
});
|
|
12
|
-
packageJsonPath = Option.String('--package-json-path', 'package.json', {
|
|
13
|
-
description: 'Path to `package.json`',
|
|
14
|
-
});
|
|
15
|
-
outputDir = Option.String('--output-dir,-o', './', {
|
|
16
|
-
description: 'Path to the folder where all built `.node` files put, same as `--output-dir` of build command',
|
|
17
|
-
});
|
|
18
|
-
npmDir = Option.String('--npm-dir', 'npm', {
|
|
19
|
-
description: 'Path to the folder where the npm packages put',
|
|
20
|
-
});
|
|
21
|
-
getOptions() {
|
|
22
|
-
return {
|
|
23
|
-
cwd: this.cwd,
|
|
24
|
-
packageJsonPath: this.packageJsonPath,
|
|
25
|
-
outputDir: this.outputDir,
|
|
26
|
-
npmDir: this.npmDir,
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import { Command } from 'clipanion';
|
|
2
|
-
export declare abstract class BaseBuildCommand extends Command {
|
|
3
|
-
static paths: string[][];
|
|
4
|
-
static usage: import("clipanion").Usage;
|
|
5
|
-
target?: string;
|
|
6
|
-
cwd?: string;
|
|
7
|
-
manifestPath?: string;
|
|
8
|
-
packageJsonPath?: string;
|
|
9
|
-
targetDir?: string;
|
|
10
|
-
outputDir?: string;
|
|
11
|
-
platform?: boolean;
|
|
12
|
-
jsPackageName?: string;
|
|
13
|
-
jsBinding?: string;
|
|
14
|
-
noJsBinding?: boolean;
|
|
15
|
-
dts?: string;
|
|
16
|
-
dtsHeader?: string;
|
|
17
|
-
noDtsHeader?: boolean;
|
|
18
|
-
strip?: boolean;
|
|
19
|
-
release?: boolean;
|
|
20
|
-
verbose?: boolean;
|
|
21
|
-
bin?: string;
|
|
22
|
-
package?: string;
|
|
23
|
-
crossCompile?: boolean;
|
|
24
|
-
watch?: boolean;
|
|
25
|
-
features?: string[];
|
|
26
|
-
allFeatures?: boolean;
|
|
27
|
-
noDefaultFeatures?: boolean;
|
|
28
|
-
getOptions(): {
|
|
29
|
-
target: string | undefined;
|
|
30
|
-
cwd: string | undefined;
|
|
31
|
-
manifestPath: string | undefined;
|
|
32
|
-
packageJsonPath: string | undefined;
|
|
33
|
-
targetDir: string | undefined;
|
|
34
|
-
outputDir: string | undefined;
|
|
35
|
-
platform: boolean | undefined;
|
|
36
|
-
jsPackageName: string | undefined;
|
|
37
|
-
jsBinding: string | undefined;
|
|
38
|
-
noJsBinding: boolean | undefined;
|
|
39
|
-
dts: string | undefined;
|
|
40
|
-
dtsHeader: string | undefined;
|
|
41
|
-
noDtsHeader: boolean | undefined;
|
|
42
|
-
strip: boolean | undefined;
|
|
43
|
-
release: boolean | undefined;
|
|
44
|
-
verbose: boolean | undefined;
|
|
45
|
-
bin: string | undefined;
|
|
46
|
-
package: string | undefined;
|
|
47
|
-
crossCompile: boolean | undefined;
|
|
48
|
-
watch: boolean | undefined;
|
|
49
|
-
features: string[] | undefined;
|
|
50
|
-
allFeatures: boolean | undefined;
|
|
51
|
-
noDefaultFeatures: boolean | undefined;
|
|
52
|
-
};
|
|
53
|
-
}
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
// This file is generated by codegen/index.ts
|
|
2
|
-
// Do not edit this file manually
|
|
3
|
-
import { Command, Option } from 'clipanion';
|
|
4
|
-
export class BaseBuildCommand extends Command {
|
|
5
|
-
static paths = [['build']];
|
|
6
|
-
static usage = Command.Usage({
|
|
7
|
-
description: 'Build the napi-rs project',
|
|
8
|
-
});
|
|
9
|
-
target = Option.String('--target,-t', {
|
|
10
|
-
description: 'Build for the target triple, bypassed to `cargo build --target`',
|
|
11
|
-
});
|
|
12
|
-
cwd = Option.String('--cwd', {
|
|
13
|
-
description: 'The working directory of where napi command will be executed in, all other paths options are relative to this path',
|
|
14
|
-
});
|
|
15
|
-
manifestPath = Option.String('--manifest-path', {
|
|
16
|
-
description: 'Path to `Cargo.toml`',
|
|
17
|
-
});
|
|
18
|
-
packageJsonPath = Option.String('--package-json-path', {
|
|
19
|
-
description: 'Path to `package.json`',
|
|
20
|
-
});
|
|
21
|
-
targetDir = Option.String('--target-dir', {
|
|
22
|
-
description: 'Directory for all crate generated artifacts, see `cargo build --target-dir`',
|
|
23
|
-
});
|
|
24
|
-
outputDir = Option.String('--output-dir,-o', {
|
|
25
|
-
description: 'Path to where all the built files would be put. Default to the crate folder',
|
|
26
|
-
});
|
|
27
|
-
platform = Option.Boolean('--platform', {
|
|
28
|
-
description: 'Add platform triple to the generated nodejs binding file, eg: `[name].linux-x64-gnu.node`',
|
|
29
|
-
});
|
|
30
|
-
jsPackageName = Option.String('--js-package-name', {
|
|
31
|
-
description: 'Package name in generated js binding file. Only works with `--platform` flag',
|
|
32
|
-
});
|
|
33
|
-
jsBinding = Option.String('--js', {
|
|
34
|
-
description: 'Path and filename of generated JS binding file. Only works with `--platform` flag. Relative to `--output_dir`.',
|
|
35
|
-
});
|
|
36
|
-
noJsBinding = Option.Boolean('--no-js', {
|
|
37
|
-
description: 'Whether to disable the generation JS binding file. Only works with `--platform` flag.',
|
|
38
|
-
});
|
|
39
|
-
dts = Option.String('--dts', {
|
|
40
|
-
description: 'Path and filename of generated type def file. Relative to `--output_dir`',
|
|
41
|
-
});
|
|
42
|
-
dtsHeader = Option.String('--dts-header', {
|
|
43
|
-
description: 'Custom file header for generated type def file. Only works when `typedef` feature enabled.',
|
|
44
|
-
});
|
|
45
|
-
noDtsHeader = Option.Boolean('--no-dts-header', {
|
|
46
|
-
description: 'Whether to disable the default file header for generated type def file. Only works when `typedef` feature enabled.',
|
|
47
|
-
});
|
|
48
|
-
strip = Option.Boolean('--strip,-s', {
|
|
49
|
-
description: 'Whether strip the library to achieve the minimum file size',
|
|
50
|
-
});
|
|
51
|
-
release = Option.Boolean('--release,-r', {
|
|
52
|
-
description: 'Build in release mode',
|
|
53
|
-
});
|
|
54
|
-
verbose = Option.Boolean('--verbose,-v', {
|
|
55
|
-
description: 'Verbosely log build command trace',
|
|
56
|
-
});
|
|
57
|
-
bin = Option.String('--bin', {
|
|
58
|
-
description: 'Build only the specified binary',
|
|
59
|
-
});
|
|
60
|
-
package = Option.String('--package,-p', {
|
|
61
|
-
description: 'Build the specified library or the one at cwd',
|
|
62
|
-
});
|
|
63
|
-
crossCompile = Option.Boolean('--cross-compile', {
|
|
64
|
-
description: '[experimental] cross-compile for the specified target with `cargo-xwin` on windows and `cargo-zigbuild` on other platform',
|
|
65
|
-
});
|
|
66
|
-
watch = Option.Boolean('--watch,-w', {
|
|
67
|
-
description: 'watch the crate changes and build continiously with `cargo-watch` crates',
|
|
68
|
-
});
|
|
69
|
-
features = Option.Array('--features,-F', {
|
|
70
|
-
description: 'Space-separated list of features to activate',
|
|
71
|
-
});
|
|
72
|
-
allFeatures = Option.Boolean('--all-features', {
|
|
73
|
-
description: 'Activate all available features',
|
|
74
|
-
});
|
|
75
|
-
noDefaultFeatures = Option.Boolean('--no-default-features', {
|
|
76
|
-
description: 'Do not activate the `default` feature',
|
|
77
|
-
});
|
|
78
|
-
getOptions() {
|
|
79
|
-
return {
|
|
80
|
-
target: this.target,
|
|
81
|
-
cwd: this.cwd,
|
|
82
|
-
manifestPath: this.manifestPath,
|
|
83
|
-
packageJsonPath: this.packageJsonPath,
|
|
84
|
-
targetDir: this.targetDir,
|
|
85
|
-
outputDir: this.outputDir,
|
|
86
|
-
platform: this.platform,
|
|
87
|
-
jsPackageName: this.jsPackageName,
|
|
88
|
-
jsBinding: this.jsBinding,
|
|
89
|
-
noJsBinding: this.noJsBinding,
|
|
90
|
-
dts: this.dts,
|
|
91
|
-
dtsHeader: this.dtsHeader,
|
|
92
|
-
noDtsHeader: this.noDtsHeader,
|
|
93
|
-
strip: this.strip,
|
|
94
|
-
release: this.release,
|
|
95
|
-
verbose: this.verbose,
|
|
96
|
-
bin: this.bin,
|
|
97
|
-
package: this.package,
|
|
98
|
-
crossCompile: this.crossCompile,
|
|
99
|
-
watch: this.watch,
|
|
100
|
-
features: this.features,
|
|
101
|
-
allFeatures: this.allFeatures,
|
|
102
|
-
noDefaultFeatures: this.noDefaultFeatures,
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Command } from 'clipanion';
|
|
2
|
-
export declare abstract class BaseCreateNpmDirsCommand extends Command {
|
|
3
|
-
static paths: string[][];
|
|
4
|
-
static usage: import("clipanion").Usage;
|
|
5
|
-
cwd: string;
|
|
6
|
-
packageJsonPath: string;
|
|
7
|
-
npmDir: string;
|
|
8
|
-
dryRun: boolean;
|
|
9
|
-
getOptions(): {
|
|
10
|
-
cwd: string;
|
|
11
|
-
packageJsonPath: string;
|
|
12
|
-
npmDir: string;
|
|
13
|
-
dryRun: boolean;
|
|
14
|
-
};
|
|
15
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
// This file is generated by codegen/index.ts
|
|
2
|
-
// Do not edit this file manually
|
|
3
|
-
import { Command, Option } from 'clipanion';
|
|
4
|
-
export class BaseCreateNpmDirsCommand extends Command {
|
|
5
|
-
static paths = [['create-npm-dirs']];
|
|
6
|
-
static usage = Command.Usage({
|
|
7
|
-
description: 'Create npm package dirs for different platforms',
|
|
8
|
-
});
|
|
9
|
-
cwd = Option.String('--cwd', process.cwd(), {
|
|
10
|
-
description: 'The working directory of where napi command will be executed in, all other paths options are relative to this path',
|
|
11
|
-
});
|
|
12
|
-
packageJsonPath = Option.String('--package-json-path', 'package.json', {
|
|
13
|
-
description: 'Path to `package.json`',
|
|
14
|
-
});
|
|
15
|
-
npmDir = Option.String('--npm-dir', 'npm', {
|
|
16
|
-
description: 'Path to the folder where the npm packages put',
|
|
17
|
-
});
|
|
18
|
-
dryRun = Option.Boolean('--dry-run', false, {
|
|
19
|
-
description: 'Dry run without touching file system',
|
|
20
|
-
});
|
|
21
|
-
getOptions() {
|
|
22
|
-
return {
|
|
23
|
-
cwd: this.cwd,
|
|
24
|
-
packageJsonPath: this.packageJsonPath,
|
|
25
|
-
npmDir: this.npmDir,
|
|
26
|
-
dryRun: this.dryRun,
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { Command } from 'clipanion';
|
|
2
|
-
export declare abstract class BaseNewCommand extends Command {
|
|
3
|
-
static paths: string[][];
|
|
4
|
-
static usage: import("clipanion").Usage;
|
|
5
|
-
$$path: string;
|
|
6
|
-
$$name?: string;
|
|
7
|
-
minNodeApiVersion: number;
|
|
8
|
-
license: string;
|
|
9
|
-
targets: string[];
|
|
10
|
-
enableDefaultTargets: boolean;
|
|
11
|
-
enableAllTargets: boolean;
|
|
12
|
-
enableTypeDef: boolean;
|
|
13
|
-
enableGithubActions: boolean;
|
|
14
|
-
dryRun: boolean;
|
|
15
|
-
getOptions(): {
|
|
16
|
-
path: string;
|
|
17
|
-
name: string | undefined;
|
|
18
|
-
minNodeApiVersion: number;
|
|
19
|
-
license: string;
|
|
20
|
-
targets: string[];
|
|
21
|
-
enableDefaultTargets: boolean;
|
|
22
|
-
enableAllTargets: boolean;
|
|
23
|
-
enableTypeDef: boolean;
|
|
24
|
-
enableGithubActions: boolean;
|
|
25
|
-
dryRun: boolean;
|
|
26
|
-
};
|
|
27
|
-
}
|
package/dist/def/commands/new.js
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
// This file is generated by codegen/index.ts
|
|
2
|
-
// Do not edit this file manually
|
|
3
|
-
import { Command, Option } from 'clipanion';
|
|
4
|
-
import * as typanion from 'typanion';
|
|
5
|
-
export class BaseNewCommand extends Command {
|
|
6
|
-
static paths = [['new']];
|
|
7
|
-
static usage = Command.Usage({
|
|
8
|
-
description: 'Create a new project with pre-configured boilerplate',
|
|
9
|
-
});
|
|
10
|
-
$$path = Option.String({ required: true });
|
|
11
|
-
$$name = Option.String('--name,-n', {
|
|
12
|
-
description: 'The name of the project, default to the name of the directory if not provided',
|
|
13
|
-
});
|
|
14
|
-
minNodeApiVersion = Option.String('--min-node-api,-v', '4', {
|
|
15
|
-
validator: typanion.isNumber(),
|
|
16
|
-
description: 'The minimum Node-API version to support',
|
|
17
|
-
});
|
|
18
|
-
license = Option.String('--license,-l', 'MIT', {
|
|
19
|
-
description: 'License for open-sourced project',
|
|
20
|
-
});
|
|
21
|
-
targets = Option.Array('--targets,-t', [], {
|
|
22
|
-
description: 'All targets the crate will be compiled for.',
|
|
23
|
-
});
|
|
24
|
-
enableDefaultTargets = Option.Boolean('--enable-default-targets', true, {
|
|
25
|
-
description: 'Whether enable default targets',
|
|
26
|
-
});
|
|
27
|
-
enableAllTargets = Option.Boolean('--enable-all-targets', false, {
|
|
28
|
-
description: 'Whether enable all targets',
|
|
29
|
-
});
|
|
30
|
-
enableTypeDef = Option.Boolean('--enable-type-def', true, {
|
|
31
|
-
description: 'Whether enable the `type-def` feature for typescript definitions auto-generation',
|
|
32
|
-
});
|
|
33
|
-
enableGithubActions = Option.Boolean('--enable-github-actions', true, {
|
|
34
|
-
description: 'Whether generate preconfigured GitHub Actions workflow',
|
|
35
|
-
});
|
|
36
|
-
dryRun = Option.Boolean('--dry-run', false, {
|
|
37
|
-
description: 'Whether to run the command in dry-run mode',
|
|
38
|
-
});
|
|
39
|
-
getOptions() {
|
|
40
|
-
return {
|
|
41
|
-
path: this.$$path,
|
|
42
|
-
name: this.$$name,
|
|
43
|
-
minNodeApiVersion: this.minNodeApiVersion,
|
|
44
|
-
license: this.license,
|
|
45
|
-
targets: this.targets,
|
|
46
|
-
enableDefaultTargets: this.enableDefaultTargets,
|
|
47
|
-
enableAllTargets: this.enableAllTargets,
|
|
48
|
-
enableTypeDef: this.enableTypeDef,
|
|
49
|
-
enableGithubActions: this.enableGithubActions,
|
|
50
|
-
dryRun: this.dryRun,
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Command } from 'clipanion';
|
|
2
|
-
export declare abstract class BasePrePublishCommand extends Command {
|
|
3
|
-
static paths: string[][];
|
|
4
|
-
static usage: import("clipanion").Usage;
|
|
5
|
-
cwd: string;
|
|
6
|
-
packageJsonPath: string;
|
|
7
|
-
npmDir: string;
|
|
8
|
-
tagStyle: string;
|
|
9
|
-
ghRelease: boolean;
|
|
10
|
-
ghReleaseName?: string;
|
|
11
|
-
ghReleaseId?: string;
|
|
12
|
-
dryRun: boolean;
|
|
13
|
-
getOptions(): {
|
|
14
|
-
cwd: string;
|
|
15
|
-
packageJsonPath: string;
|
|
16
|
-
npmDir: string;
|
|
17
|
-
tagStyle: string;
|
|
18
|
-
ghRelease: boolean;
|
|
19
|
-
ghReleaseName: string | undefined;
|
|
20
|
-
ghReleaseId: string | undefined;
|
|
21
|
-
dryRun: boolean;
|
|
22
|
-
};
|
|
23
|
-
}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
// This file is generated by codegen/index.ts
|
|
2
|
-
// Do not edit this file manually
|
|
3
|
-
import { Command, Option } from 'clipanion';
|
|
4
|
-
export class BasePrePublishCommand extends Command {
|
|
5
|
-
static paths = [['pre-publish']];
|
|
6
|
-
static usage = Command.Usage({
|
|
7
|
-
description: 'Update package.json and copy addons into per platform packages',
|
|
8
|
-
});
|
|
9
|
-
cwd = Option.String('--cwd', process.cwd(), {
|
|
10
|
-
description: 'The working directory of where napi command will be executed in, all other paths options are relative to this path',
|
|
11
|
-
});
|
|
12
|
-
packageJsonPath = Option.String('--package-json-path', 'package.json', {
|
|
13
|
-
description: 'Path to `package.json`',
|
|
14
|
-
});
|
|
15
|
-
npmDir = Option.String('--npm-dir', 'npm', {
|
|
16
|
-
description: 'Path to the folder where the npm packages put',
|
|
17
|
-
});
|
|
18
|
-
tagStyle = Option.String('--tag-style', 'lerna', {
|
|
19
|
-
description: 'git tag style, `npm` or `lerna`',
|
|
20
|
-
});
|
|
21
|
-
ghRelease = Option.Boolean('--gh-release', true, {
|
|
22
|
-
description: 'Whether create GitHub release',
|
|
23
|
-
});
|
|
24
|
-
ghReleaseName = Option.String('--gh-release-name', {
|
|
25
|
-
description: 'GitHub release name',
|
|
26
|
-
});
|
|
27
|
-
ghReleaseId = Option.String('--gh-release-id', {
|
|
28
|
-
description: 'Existing GitHub release id',
|
|
29
|
-
});
|
|
30
|
-
dryRun = Option.Boolean('--dry-run', false, {
|
|
31
|
-
description: 'Dry run without touching file system',
|
|
32
|
-
});
|
|
33
|
-
getOptions() {
|
|
34
|
-
return {
|
|
35
|
-
cwd: this.cwd,
|
|
36
|
-
packageJsonPath: this.packageJsonPath,
|
|
37
|
-
npmDir: this.npmDir,
|
|
38
|
-
tagStyle: this.tagStyle,
|
|
39
|
-
ghRelease: this.ghRelease,
|
|
40
|
-
ghReleaseName: this.ghReleaseName,
|
|
41
|
-
ghReleaseId: this.ghReleaseId,
|
|
42
|
-
dryRun: this.dryRun,
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import { Command } from 'clipanion';
|
|
2
|
-
export declare abstract class BaseRenameCommand extends Command {
|
|
3
|
-
static paths: string[][];
|
|
4
|
-
static usage: import("clipanion").Usage;
|
|
5
|
-
cwd: string;
|
|
6
|
-
packageJsonPath: string;
|
|
7
|
-
npmDir: string;
|
|
8
|
-
$$name?: string;
|
|
9
|
-
binaryName?: string;
|
|
10
|
-
packageName?: string;
|
|
11
|
-
manifestPath: string;
|
|
12
|
-
repository?: string;
|
|
13
|
-
description?: string;
|
|
14
|
-
getOptions(): {
|
|
15
|
-
cwd: string;
|
|
16
|
-
packageJsonPath: string;
|
|
17
|
-
npmDir: string;
|
|
18
|
-
name: string | undefined;
|
|
19
|
-
binaryName: string | undefined;
|
|
20
|
-
packageName: string | undefined;
|
|
21
|
-
manifestPath: string;
|
|
22
|
-
repository: string | undefined;
|
|
23
|
-
description: string | undefined;
|
|
24
|
-
};
|
|
25
|
-
}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
// This file is generated by codegen/index.ts
|
|
2
|
-
// Do not edit this file manually
|
|
3
|
-
import { Command, Option } from 'clipanion';
|
|
4
|
-
export class BaseRenameCommand extends Command {
|
|
5
|
-
static paths = [['rename']];
|
|
6
|
-
static usage = Command.Usage({
|
|
7
|
-
description: 'Rename the napi-rs project',
|
|
8
|
-
});
|
|
9
|
-
cwd = Option.String('--cwd', process.cwd(), {
|
|
10
|
-
description: 'The working directory of where napi command will be executed in, all other paths options are relative to this path',
|
|
11
|
-
});
|
|
12
|
-
packageJsonPath = Option.String('--package-json-path', 'package.json', {
|
|
13
|
-
description: 'Path to `package.json`',
|
|
14
|
-
});
|
|
15
|
-
npmDir = Option.String('--npm-dir', 'npm', {
|
|
16
|
-
description: 'Path to the folder where the npm packages put',
|
|
17
|
-
});
|
|
18
|
-
$$name = Option.String('--name,-n', {
|
|
19
|
-
description: 'The new name of the project',
|
|
20
|
-
});
|
|
21
|
-
binaryName = Option.String('--binary-name,-b', {
|
|
22
|
-
description: 'The new binary name *.node files',
|
|
23
|
-
});
|
|
24
|
-
packageName = Option.String('--package-name', {
|
|
25
|
-
description: 'The new package name of the project',
|
|
26
|
-
});
|
|
27
|
-
manifestPath = Option.String('--manifest-path', 'Cargo.toml', {
|
|
28
|
-
description: 'Path to `Cargo.toml`',
|
|
29
|
-
});
|
|
30
|
-
repository = Option.String('--repository', {
|
|
31
|
-
description: 'The new repository of the project',
|
|
32
|
-
});
|
|
33
|
-
description = Option.String('--description', {
|
|
34
|
-
description: 'The new description of the project',
|
|
35
|
-
});
|
|
36
|
-
getOptions() {
|
|
37
|
-
return {
|
|
38
|
-
cwd: this.cwd,
|
|
39
|
-
packageJsonPath: this.packageJsonPath,
|
|
40
|
-
npmDir: this.npmDir,
|
|
41
|
-
name: this.$$name,
|
|
42
|
-
binaryName: this.binaryName,
|
|
43
|
-
packageName: this.packageName,
|
|
44
|
-
manifestPath: this.manifestPath,
|
|
45
|
-
repository: this.repository,
|
|
46
|
-
description: this.description,
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Command } from 'clipanion';
|
|
2
|
-
export declare abstract class BaseUniversalizeCommand extends Command {
|
|
3
|
-
static paths: string[][];
|
|
4
|
-
static usage: import("clipanion").Usage;
|
|
5
|
-
cwd: string;
|
|
6
|
-
packageJsonPath: string;
|
|
7
|
-
outputDir: string;
|
|
8
|
-
getOptions(): {
|
|
9
|
-
cwd: string;
|
|
10
|
-
packageJsonPath: string;
|
|
11
|
-
outputDir: string;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// This file is generated by codegen/index.ts
|
|
2
|
-
// Do not edit this file manually
|
|
3
|
-
import { Command, Option } from 'clipanion';
|
|
4
|
-
export class BaseUniversalizeCommand extends Command {
|
|
5
|
-
static paths = [['universalize']];
|
|
6
|
-
static usage = Command.Usage({
|
|
7
|
-
description: 'Combile built binaries into one universal binary',
|
|
8
|
-
});
|
|
9
|
-
cwd = Option.String('--cwd', process.cwd(), {
|
|
10
|
-
description: 'The working directory of where napi command will be executed in, all other paths options are relative to this path',
|
|
11
|
-
});
|
|
12
|
-
packageJsonPath = Option.String('--package-json-path', 'package.json', {
|
|
13
|
-
description: 'Path to `package.json`',
|
|
14
|
-
});
|
|
15
|
-
outputDir = Option.String('--output-dir,-o', './', {
|
|
16
|
-
description: 'Path to the folder where all built `.node` files put, same as `--output-dir` of build command',
|
|
17
|
-
});
|
|
18
|
-
getOptions() {
|
|
19
|
-
return {
|
|
20
|
-
cwd: this.cwd,
|
|
21
|
-
packageJsonPath: this.packageJsonPath,
|
|
22
|
-
outputDir: this.outputDir,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Command } from 'clipanion';
|
|
2
|
-
export declare abstract class BaseVersionCommand extends Command {
|
|
3
|
-
static paths: string[][];
|
|
4
|
-
static usage: import("clipanion").Usage;
|
|
5
|
-
cwd: string;
|
|
6
|
-
packageJsonPath: string;
|
|
7
|
-
npmDir: string;
|
|
8
|
-
getOptions(): {
|
|
9
|
-
cwd: string;
|
|
10
|
-
packageJsonPath: string;
|
|
11
|
-
npmDir: string;
|
|
12
|
-
};
|
|
13
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// This file is generated by codegen/index.ts
|
|
2
|
-
// Do not edit this file manually
|
|
3
|
-
import { Command, Option } from 'clipanion';
|
|
4
|
-
export class BaseVersionCommand extends Command {
|
|
5
|
-
static paths = [['version']];
|
|
6
|
-
static usage = Command.Usage({
|
|
7
|
-
description: 'Update version in created npm packages',
|
|
8
|
-
});
|
|
9
|
-
cwd = Option.String('--cwd', process.cwd(), {
|
|
10
|
-
description: 'The working directory of where napi command will be executed in, all other paths options are relative to this path',
|
|
11
|
-
});
|
|
12
|
-
packageJsonPath = Option.String('--package-json-path', 'package.json', {
|
|
13
|
-
description: 'Path to `package.json`',
|
|
14
|
-
});
|
|
15
|
-
npmDir = Option.String('--npm-dir', 'npm', {
|
|
16
|
-
description: 'Path to the folder where the npm packages put',
|
|
17
|
-
});
|
|
18
|
-
getOptions() {
|
|
19
|
-
return {
|
|
20
|
-
cwd: this.cwd,
|
|
21
|
-
packageJsonPath: this.packageJsonPath,
|
|
22
|
-
npmDir: this.npmDir,
|
|
23
|
-
};
|
|
24
|
-
}
|
|
25
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Copy artifacts from Github Actions into npm packages and ready to publish
|
|
3
|
-
*/
|
|
4
|
-
export interface ArtifactsOptions {
|
|
5
|
-
/**
|
|
6
|
-
* The working directory of where napi command will be executed in, all other paths options are relative to this path
|
|
7
|
-
*
|
|
8
|
-
* @default process.cwd()
|
|
9
|
-
*/
|
|
10
|
-
cwd?: string;
|
|
11
|
-
/**
|
|
12
|
-
* Path to `package.json`
|
|
13
|
-
*
|
|
14
|
-
* @default 'package.json'
|
|
15
|
-
*/
|
|
16
|
-
packageJsonPath?: string;
|
|
17
|
-
/**
|
|
18
|
-
* Path to the folder where all built `.node` files put, same as `--output-dir` of build command
|
|
19
|
-
*
|
|
20
|
-
* @default './'
|
|
21
|
-
*/
|
|
22
|
-
outputDir?: string;
|
|
23
|
-
/**
|
|
24
|
-
* Path to the folder where the npm packages put
|
|
25
|
-
*
|
|
26
|
-
* @default 'npm'
|
|
27
|
-
*/
|
|
28
|
-
npmDir?: string;
|
|
29
|
-
}
|
|
30
|
-
export declare function applyDefaultArtifactsOptions(options: ArtifactsOptions): {
|
|
31
|
-
cwd: string;
|
|
32
|
-
packageJsonPath: string;
|
|
33
|
-
outputDir: string;
|
|
34
|
-
npmDir: string;
|
|
35
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// This file is generated by codegen/index.ts
|
|
2
|
-
// Do not edit this file manually
|
|
3
|
-
export function applyDefaultArtifactsOptions(options) {
|
|
4
|
-
return {
|
|
5
|
-
cwd: process.cwd(),
|
|
6
|
-
packageJsonPath: 'package.json',
|
|
7
|
-
outputDir: './',
|
|
8
|
-
npmDir: 'npm',
|
|
9
|
-
...options,
|
|
10
|
-
};
|
|
11
|
-
}
|