@napi-rs/cli 3.0.0-alpha.9 → 3.0.0-alpha.91
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/cli.mjs +1 -1
- package/dist/api/__tests__/new.spec.d.ts +1 -0
- package/dist/api/build.d.ts +1 -1
- package/dist/api/templates/ci-template.d.ts +3 -1
- package/dist/api/templates/ci.yml.d.ts +3 -1
- package/dist/api/templates/js-binding.d.ts +1 -0
- package/dist/api/templates/load-wasi-template.d.ts +2 -0
- package/dist/api/templates/package.json.d.ts +9 -2
- package/dist/api/templates/wasi-worker-template.d.ts +2 -0
- package/dist/cli.js +3867 -15
- package/dist/def/artifacts.d.ts +21 -1
- package/dist/def/build.d.ts +149 -4
- package/dist/def/create-npm-dirs.d.ts +10 -0
- package/dist/def/new.d.ts +25 -7
- package/dist/def/pre-publish.d.ts +12 -2
- package/dist/def/rename.d.ts +16 -6
- package/dist/def/universalize.d.ts +10 -0
- package/dist/def/version.d.ts +10 -0
- package/dist/index.cjs +9946 -15669
- package/dist/index.js +3618 -32
- package/dist/utils/__tests__/config.spec.d.ts +1 -0
- package/dist/utils/config.d.ts +48 -4
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/metadata.d.ts +13 -1
- package/dist/utils/misc.d.ts +3 -3
- package/dist/utils/read-config.d.ts +7 -0
- package/dist/utils/target.d.ts +7 -5
- package/dist/utils/typegen.d.ts +1 -1
- package/dist/utils/version.d.ts +2 -1
- package/package.json +38 -34
- package/src/api/__tests__/new.spec.ts +429 -0
- package/src/api/artifacts.ts +81 -9
- package/src/api/build.ts +498 -149
- package/src/api/create-npm-dirs.ts +57 -9
- package/src/api/new.ts +389 -122
- package/src/api/pre-publish.ts +13 -7
- package/src/api/rename.ts +103 -17
- package/src/api/templates/cargo.toml.ts +1 -0
- package/src/api/templates/ci-template.ts +150 -125
- package/src/api/templates/ci.yml.ts +27 -6
- package/src/api/templates/js-binding.ts +148 -220
- package/src/api/templates/load-wasi-template.ts +182 -0
- package/src/api/templates/package.json.ts +47 -5
- package/src/api/templates/wasi-worker-template.ts +122 -0
- package/src/api/universalize.ts +13 -8
- package/src/api/version.ts +5 -2
- package/src/commands/artifacts.ts +2 -2
- package/src/commands/build.ts +1 -1
- package/src/commands/new.ts +46 -45
- package/src/def/artifacts.ts +22 -3
- package/src/def/build.ts +55 -8
- package/src/def/create-npm-dirs.ts +9 -0
- package/src/def/new.ts +28 -3
- package/src/def/pre-publish.ts +12 -3
- package/src/def/rename.ts +11 -2
- package/src/def/universalize.ts +9 -0
- package/src/def/version.ts +9 -0
- package/src/utils/__tests__/__fixtures__/napi_type_def +130 -130
- package/src/utils/__tests__/__snapshots__/config.spec.ts.md +97 -0
- package/src/utils/__tests__/__snapshots__/config.spec.ts.snap +0 -0
- package/src/utils/__tests__/__snapshots__/target.spec.ts.md +28 -0
- package/src/utils/__tests__/__snapshots__/target.spec.ts.snap +0 -0
- package/src/utils/__tests__/__snapshots__/typegen.spec.ts.md +316 -332
- package/src/utils/__tests__/__snapshots__/typegen.spec.ts.snap +0 -0
- package/src/utils/__tests__/__snapshots__/version.spec.ts.md +8 -7
- package/src/utils/__tests__/__snapshots__/version.spec.ts.snap +0 -0
- package/src/utils/__tests__/config.spec.ts +81 -0
- package/src/utils/cargo.ts +2 -2
- package/src/utils/config.ts +110 -9
- package/src/utils/index.ts +1 -1
- package/src/utils/log.ts +1 -1
- package/src/utils/metadata.ts +52 -14
- package/src/utils/misc.ts +21 -12
- package/src/utils/read-config.ts +20 -0
- package/src/utils/target.ts +22 -4
- package/src/utils/typegen.ts +87 -52
- package/src/utils/version.ts +10 -8
- package/dist/api/artifacts.js +0 -53
- package/dist/api/artifacts.js.map +0 -1
- package/dist/api/build.js +0 -498
- package/dist/api/build.js.map +0 -1
- package/dist/api/create-npm-dirs.js +0 -64
- package/dist/api/create-npm-dirs.js.map +0 -1
- package/dist/api/load-wasi-template.d.ts +0 -1
- package/dist/api/load-wasi-template.js +0 -64
- package/dist/api/load-wasi-template.js.map +0 -1
- package/dist/api/new.js +0 -155
- package/dist/api/new.js.map +0 -1
- package/dist/api/pre-publish.js +0 -158
- package/dist/api/pre-publish.js.map +0 -1
- package/dist/api/rename.js +0 -29
- package/dist/api/rename.js.map +0 -1
- package/dist/api/templates/.gitignore.js +0 -200
- package/dist/api/templates/.gitignore.js.map +0 -1
- package/dist/api/templates/.npmignore.js +0 -15
- package/dist/api/templates/.npmignore.js.map +0 -1
- package/dist/api/templates/build.rs.js +0 -5
- package/dist/api/templates/build.rs.js.map +0 -1
- package/dist/api/templates/cargo.toml.js +0 -26
- package/dist/api/templates/cargo.toml.js.map +0 -1
- package/dist/api/templates/ci-template.js +0 -578
- package/dist/api/templates/ci-template.js.map +0 -1
- package/dist/api/templates/ci.yml.js +0 -99
- package/dist/api/templates/ci.yml.js.map +0 -1
- package/dist/api/templates/index.js +0 -9
- package/dist/api/templates/index.js.map +0 -1
- package/dist/api/templates/js-binding.js +0 -293
- package/dist/api/templates/js-binding.js.map +0 -1
- package/dist/api/templates/lib.rs.js +0 -8
- package/dist/api/templates/lib.rs.js.map +0 -1
- package/dist/api/templates/package.json.js +0 -32
- package/dist/api/templates/package.json.js.map +0 -1
- package/dist/api/universalize.js +0 -39
- package/dist/api/universalize.js.map +0 -1
- package/dist/api/version.js +0 -17
- package/dist/api/version.js.map +0 -1
- package/dist/api/wasi-worker-template.d.ts +0 -1
- package/dist/api/wasi-worker-template.js +0 -53
- package/dist/api/wasi-worker-template.js.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/commands/artifacts.js +0 -20
- package/dist/commands/artifacts.js.map +0 -1
- package/dist/commands/build.js +0 -35
- package/dist/commands/build.js.map +0 -1
- package/dist/commands/create-npm-dirs.js +0 -8
- package/dist/commands/create-npm-dirs.js.map +0 -1
- package/dist/commands/help.js +0 -13
- package/dist/commands/help.js.map +0 -1
- package/dist/commands/new.js +0 -110
- package/dist/commands/new.js.map +0 -1
- package/dist/commands/pre-publish.js +0 -9
- package/dist/commands/pre-publish.js.map +0 -1
- package/dist/commands/rename.js +0 -8
- package/dist/commands/rename.js.map +0 -1
- package/dist/commands/universalize.js +0 -8
- package/dist/commands/universalize.js.map +0 -1
- package/dist/commands/version.js +0 -8
- package/dist/commands/version.js.map +0 -1
- package/dist/def/artifacts.js +0 -39
- package/dist/def/artifacts.js.map +0 -1
- package/dist/def/build.js +0 -118
- package/dist/def/build.js.map +0 -1
- package/dist/def/create-npm-dirs.js +0 -39
- package/dist/def/create-npm-dirs.js.map +0 -1
- package/dist/def/new.js +0 -67
- package/dist/def/new.js.map +0 -1
- package/dist/def/pre-publish.js +0 -57
- package/dist/def/pre-publish.js.map +0 -1
- package/dist/def/rename.js +0 -59
- package/dist/def/rename.js.map +0 -1
- package/dist/def/universalize.js +0 -34
- package/dist/def/universalize.js.map +0 -1
- package/dist/def/version.js +0 -34
- package/dist/def/version.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/utils/__tests__/target.spec.js +0 -11
- package/dist/utils/__tests__/target.spec.js.map +0 -1
- package/dist/utils/__tests__/typegen.spec.js +0 -42
- package/dist/utils/__tests__/typegen.spec.js.map +0 -1
- package/dist/utils/__tests__/version.spec.js +0 -6
- package/dist/utils/__tests__/version.spec.js.map +0 -1
- package/dist/utils/cargo.js +0 -34
- package/dist/utils/cargo.js.map +0 -1
- package/dist/utils/ci.d.ts +0 -11
- package/dist/utils/ci.js +0 -96
- package/dist/utils/ci.js.map +0 -1
- package/dist/utils/config.js +0 -43
- package/dist/utils/config.js.map +0 -1
- package/dist/utils/index.js +0 -10
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/log.js +0 -15
- package/dist/utils/log.js.map +0 -1
- package/dist/utils/metadata.js +0 -20
- package/dist/utils/metadata.js.map +0 -1
- package/dist/utils/misc.js +0 -41
- package/dist/utils/misc.js.map +0 -1
- package/dist/utils/target.js +0 -121
- package/dist/utils/target.js.map +0 -1
- package/dist/utils/typegen.js +0 -179
- package/dist/utils/typegen.js.map +0 -1
- package/dist/utils/version.js +0 -60
- package/dist/utils/version.js.map +0 -1
- package/src/api/load-wasi-template.ts +0 -66
- package/src/api/wasi-worker-template.ts +0 -52
- package/src/utils/ci.ts +0 -111
package/dist/def/artifacts.d.ts
CHANGED
|
@@ -3,14 +3,18 @@ export declare abstract class BaseArtifactsCommand extends Command {
|
|
|
3
3
|
static paths: string[][];
|
|
4
4
|
static usage: import("clipanion").Usage;
|
|
5
5
|
cwd: string;
|
|
6
|
+
configPath?: string;
|
|
6
7
|
packageJsonPath: string;
|
|
7
8
|
outputDir: string;
|
|
8
9
|
npmDir: string;
|
|
10
|
+
buildOutputDir?: string;
|
|
9
11
|
getOptions(): {
|
|
10
12
|
cwd: string;
|
|
13
|
+
configPath: string | undefined;
|
|
11
14
|
packageJsonPath: string;
|
|
12
15
|
outputDir: string;
|
|
13
16
|
npmDir: string;
|
|
17
|
+
buildOutputDir: string | undefined;
|
|
14
18
|
};
|
|
15
19
|
}
|
|
16
20
|
/**
|
|
@@ -23,6 +27,10 @@ export interface ArtifactsOptions {
|
|
|
23
27
|
* @default process.cwd()
|
|
24
28
|
*/
|
|
25
29
|
cwd?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Path to `napi` config json file
|
|
32
|
+
*/
|
|
33
|
+
configPath?: string;
|
|
26
34
|
/**
|
|
27
35
|
* Path to `package.json`
|
|
28
36
|
*
|
|
@@ -32,7 +40,7 @@ export interface ArtifactsOptions {
|
|
|
32
40
|
/**
|
|
33
41
|
* Path to the folder where all built `.node` files put, same as `--output-dir` of build command
|
|
34
42
|
*
|
|
35
|
-
* @default './'
|
|
43
|
+
* @default './artifacts'
|
|
36
44
|
*/
|
|
37
45
|
outputDir?: string;
|
|
38
46
|
/**
|
|
@@ -41,10 +49,22 @@ export interface ArtifactsOptions {
|
|
|
41
49
|
* @default 'npm'
|
|
42
50
|
*/
|
|
43
51
|
npmDir?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Path to the build output dir, only needed when targets contains `wasm32-wasi-*`
|
|
54
|
+
*/
|
|
55
|
+
buildOutputDir?: string;
|
|
44
56
|
}
|
|
45
57
|
export declare function applyDefaultArtifactsOptions(options: ArtifactsOptions): {
|
|
46
58
|
cwd: string;
|
|
59
|
+
/**
|
|
60
|
+
* Path to `napi` config json file
|
|
61
|
+
*/
|
|
62
|
+
configPath?: string;
|
|
47
63
|
packageJsonPath: string;
|
|
48
64
|
outputDir: string;
|
|
49
65
|
npmDir: string;
|
|
66
|
+
/**
|
|
67
|
+
* Path to the build output dir, only needed when targets contains `wasm32-wasi-*`
|
|
68
|
+
*/
|
|
69
|
+
buildOutputDir?: string;
|
|
50
70
|
};
|
package/dist/def/build.d.ts
CHANGED
|
@@ -5,6 +5,7 @@ export declare abstract class BaseBuildCommand extends Command {
|
|
|
5
5
|
target?: string;
|
|
6
6
|
cwd?: string;
|
|
7
7
|
manifestPath?: string;
|
|
8
|
+
configPath?: string;
|
|
8
9
|
packageJsonPath?: string;
|
|
9
10
|
targetDir?: string;
|
|
10
11
|
outputDir?: string;
|
|
@@ -16,6 +17,8 @@ export declare abstract class BaseBuildCommand extends Command {
|
|
|
16
17
|
dts?: string;
|
|
17
18
|
dtsHeader?: string;
|
|
18
19
|
noDtsHeader?: boolean;
|
|
20
|
+
dtsCache: boolean;
|
|
21
|
+
esm?: boolean;
|
|
19
22
|
strip?: boolean;
|
|
20
23
|
release?: boolean;
|
|
21
24
|
verbose?: boolean;
|
|
@@ -24,6 +27,7 @@ export declare abstract class BaseBuildCommand extends Command {
|
|
|
24
27
|
profile?: string;
|
|
25
28
|
crossCompile?: boolean;
|
|
26
29
|
useCross?: boolean;
|
|
30
|
+
useNapiCross?: boolean;
|
|
27
31
|
watch?: boolean;
|
|
28
32
|
features?: string[];
|
|
29
33
|
allFeatures?: boolean;
|
|
@@ -32,6 +36,7 @@ export declare abstract class BaseBuildCommand extends Command {
|
|
|
32
36
|
target: string | undefined;
|
|
33
37
|
cwd: string | undefined;
|
|
34
38
|
manifestPath: string | undefined;
|
|
39
|
+
configPath: string | undefined;
|
|
35
40
|
packageJsonPath: string | undefined;
|
|
36
41
|
targetDir: string | undefined;
|
|
37
42
|
outputDir: string | undefined;
|
|
@@ -43,6 +48,8 @@ export declare abstract class BaseBuildCommand extends Command {
|
|
|
43
48
|
dts: string | undefined;
|
|
44
49
|
dtsHeader: string | undefined;
|
|
45
50
|
noDtsHeader: boolean | undefined;
|
|
51
|
+
dtsCache: boolean;
|
|
52
|
+
esm: boolean | undefined;
|
|
46
53
|
strip: boolean | undefined;
|
|
47
54
|
release: boolean | undefined;
|
|
48
55
|
verbose: boolean | undefined;
|
|
@@ -51,6 +58,7 @@ export declare abstract class BaseBuildCommand extends Command {
|
|
|
51
58
|
profile: string | undefined;
|
|
52
59
|
crossCompile: boolean | undefined;
|
|
53
60
|
useCross: boolean | undefined;
|
|
61
|
+
useNapiCross: boolean | undefined;
|
|
54
62
|
watch: boolean | undefined;
|
|
55
63
|
features: string[] | undefined;
|
|
56
64
|
allFeatures: boolean | undefined;
|
|
@@ -58,7 +66,7 @@ export declare abstract class BaseBuildCommand extends Command {
|
|
|
58
66
|
};
|
|
59
67
|
}
|
|
60
68
|
/**
|
|
61
|
-
* Build the
|
|
69
|
+
* Build the NAPI-RS project
|
|
62
70
|
*/
|
|
63
71
|
export interface BuildOptions {
|
|
64
72
|
/**
|
|
@@ -73,6 +81,10 @@ export interface BuildOptions {
|
|
|
73
81
|
* Path to `Cargo.toml`
|
|
74
82
|
*/
|
|
75
83
|
manifestPath?: string;
|
|
84
|
+
/**
|
|
85
|
+
* Path to `napi` config json file
|
|
86
|
+
*/
|
|
87
|
+
configPath?: string;
|
|
76
88
|
/**
|
|
77
89
|
* Path to `package.json`
|
|
78
90
|
*/
|
|
@@ -98,7 +110,7 @@ export interface BuildOptions {
|
|
|
98
110
|
*/
|
|
99
111
|
constEnum?: boolean;
|
|
100
112
|
/**
|
|
101
|
-
* Path and filename of generated JS binding file. Only works with `--platform` flag. Relative to `--
|
|
113
|
+
* Path and filename of generated JS binding file. Only works with `--platform` flag. Relative to `--output-dir`.
|
|
102
114
|
*/
|
|
103
115
|
jsBinding?: string;
|
|
104
116
|
/**
|
|
@@ -106,7 +118,7 @@ export interface BuildOptions {
|
|
|
106
118
|
*/
|
|
107
119
|
noJsBinding?: boolean;
|
|
108
120
|
/**
|
|
109
|
-
* Path and filename of generated type def file. Relative to `--
|
|
121
|
+
* Path and filename of generated type def file. Relative to `--output-dir`
|
|
110
122
|
*/
|
|
111
123
|
dts?: string;
|
|
112
124
|
/**
|
|
@@ -117,6 +129,16 @@ export interface BuildOptions {
|
|
|
117
129
|
* Whether to disable the default file header for generated type def file. Only works when `typedef` feature enabled.
|
|
118
130
|
*/
|
|
119
131
|
noDtsHeader?: boolean;
|
|
132
|
+
/**
|
|
133
|
+
* Whether to enable the dts cache, default to true
|
|
134
|
+
*
|
|
135
|
+
* @default true
|
|
136
|
+
*/
|
|
137
|
+
dtsCache?: boolean;
|
|
138
|
+
/**
|
|
139
|
+
* Whether to emit an ESM JS binding file instead of CJS format. Only works with `--platform` flag.
|
|
140
|
+
*/
|
|
141
|
+
esm?: boolean;
|
|
120
142
|
/**
|
|
121
143
|
* Whether strip the library to achieve the minimum file size
|
|
122
144
|
*/
|
|
@@ -150,7 +172,11 @@ export interface BuildOptions {
|
|
|
150
172
|
*/
|
|
151
173
|
useCross?: boolean;
|
|
152
174
|
/**
|
|
153
|
-
*
|
|
175
|
+
* [experimental] use @napi-rs/cross-toolchain to cross-compile Linux arm/arm64/x64 gnu targets.
|
|
176
|
+
*/
|
|
177
|
+
useNapiCross?: boolean;
|
|
178
|
+
/**
|
|
179
|
+
* watch the crate changes and build continuously with `cargo-watch` crates
|
|
154
180
|
*/
|
|
155
181
|
watch?: boolean;
|
|
156
182
|
/**
|
|
@@ -166,3 +192,122 @@ export interface BuildOptions {
|
|
|
166
192
|
*/
|
|
167
193
|
noDefaultFeatures?: boolean;
|
|
168
194
|
}
|
|
195
|
+
export declare function applyDefaultBuildOptions(options: BuildOptions): {
|
|
196
|
+
/**
|
|
197
|
+
* Build for the target triple, bypassed to `cargo build --target`
|
|
198
|
+
*/
|
|
199
|
+
target?: string;
|
|
200
|
+
/**
|
|
201
|
+
* The working directory of where napi command will be executed in, all other paths options are relative to this path
|
|
202
|
+
*/
|
|
203
|
+
cwd?: string;
|
|
204
|
+
/**
|
|
205
|
+
* Path to `Cargo.toml`
|
|
206
|
+
*/
|
|
207
|
+
manifestPath?: string;
|
|
208
|
+
/**
|
|
209
|
+
* Path to `napi` config json file
|
|
210
|
+
*/
|
|
211
|
+
configPath?: string;
|
|
212
|
+
/**
|
|
213
|
+
* Path to `package.json`
|
|
214
|
+
*/
|
|
215
|
+
packageJsonPath?: string;
|
|
216
|
+
/**
|
|
217
|
+
* Directory for all crate generated artifacts, see `cargo build --target-dir`
|
|
218
|
+
*/
|
|
219
|
+
targetDir?: string;
|
|
220
|
+
/**
|
|
221
|
+
* Path to where all the built files would be put. Default to the crate folder
|
|
222
|
+
*/
|
|
223
|
+
outputDir?: string;
|
|
224
|
+
/**
|
|
225
|
+
* Add platform triple to the generated nodejs binding file, eg: `[name].linux-x64-gnu.node`
|
|
226
|
+
*/
|
|
227
|
+
platform?: boolean;
|
|
228
|
+
/**
|
|
229
|
+
* Package name in generated js binding file. Only works with `--platform` flag
|
|
230
|
+
*/
|
|
231
|
+
jsPackageName?: string;
|
|
232
|
+
/**
|
|
233
|
+
* Whether generate const enum for typescript bindings
|
|
234
|
+
*/
|
|
235
|
+
constEnum?: boolean;
|
|
236
|
+
/**
|
|
237
|
+
* Path and filename of generated JS binding file. Only works with `--platform` flag. Relative to `--output-dir`.
|
|
238
|
+
*/
|
|
239
|
+
jsBinding?: string;
|
|
240
|
+
/**
|
|
241
|
+
* Whether to disable the generation JS binding file. Only works with `--platform` flag.
|
|
242
|
+
*/
|
|
243
|
+
noJsBinding?: boolean;
|
|
244
|
+
/**
|
|
245
|
+
* Path and filename of generated type def file. Relative to `--output-dir`
|
|
246
|
+
*/
|
|
247
|
+
dts?: string;
|
|
248
|
+
/**
|
|
249
|
+
* Custom file header for generated type def file. Only works when `typedef` feature enabled.
|
|
250
|
+
*/
|
|
251
|
+
dtsHeader?: string;
|
|
252
|
+
/**
|
|
253
|
+
* Whether to disable the default file header for generated type def file. Only works when `typedef` feature enabled.
|
|
254
|
+
*/
|
|
255
|
+
noDtsHeader?: boolean;
|
|
256
|
+
dtsCache: boolean;
|
|
257
|
+
/**
|
|
258
|
+
* Whether to emit an ESM JS binding file instead of CJS format. Only works with `--platform` flag.
|
|
259
|
+
*/
|
|
260
|
+
esm?: boolean;
|
|
261
|
+
/**
|
|
262
|
+
* Whether strip the library to achieve the minimum file size
|
|
263
|
+
*/
|
|
264
|
+
strip?: boolean;
|
|
265
|
+
/**
|
|
266
|
+
* Build in release mode
|
|
267
|
+
*/
|
|
268
|
+
release?: boolean;
|
|
269
|
+
/**
|
|
270
|
+
* Verbosely log build command trace
|
|
271
|
+
*/
|
|
272
|
+
verbose?: boolean;
|
|
273
|
+
/**
|
|
274
|
+
* Build only the specified binary
|
|
275
|
+
*/
|
|
276
|
+
bin?: string;
|
|
277
|
+
/**
|
|
278
|
+
* Build the specified library or the one at cwd
|
|
279
|
+
*/
|
|
280
|
+
package?: string;
|
|
281
|
+
/**
|
|
282
|
+
* Build artifacts with the specified profile
|
|
283
|
+
*/
|
|
284
|
+
profile?: string;
|
|
285
|
+
/**
|
|
286
|
+
* [experimental] cross-compile for the specified target with `cargo-xwin` on windows and `cargo-zigbuild` on other platform
|
|
287
|
+
*/
|
|
288
|
+
crossCompile?: boolean;
|
|
289
|
+
/**
|
|
290
|
+
* [experimental] use [cross](https://github.com/cross-rs/cross) instead of `cargo`
|
|
291
|
+
*/
|
|
292
|
+
useCross?: boolean;
|
|
293
|
+
/**
|
|
294
|
+
* [experimental] use @napi-rs/cross-toolchain to cross-compile Linux arm/arm64/x64 gnu targets.
|
|
295
|
+
*/
|
|
296
|
+
useNapiCross?: boolean;
|
|
297
|
+
/**
|
|
298
|
+
* watch the crate changes and build continuously with `cargo-watch` crates
|
|
299
|
+
*/
|
|
300
|
+
watch?: boolean;
|
|
301
|
+
/**
|
|
302
|
+
* Space-separated list of features to activate
|
|
303
|
+
*/
|
|
304
|
+
features?: string[];
|
|
305
|
+
/**
|
|
306
|
+
* Activate all available features
|
|
307
|
+
*/
|
|
308
|
+
allFeatures?: boolean;
|
|
309
|
+
/**
|
|
310
|
+
* Do not activate the `default` feature
|
|
311
|
+
*/
|
|
312
|
+
noDefaultFeatures?: boolean;
|
|
313
|
+
};
|
|
@@ -3,11 +3,13 @@ export declare abstract class BaseCreateNpmDirsCommand extends Command {
|
|
|
3
3
|
static paths: string[][];
|
|
4
4
|
static usage: import("clipanion").Usage;
|
|
5
5
|
cwd: string;
|
|
6
|
+
configPath?: string;
|
|
6
7
|
packageJsonPath: string;
|
|
7
8
|
npmDir: string;
|
|
8
9
|
dryRun: boolean;
|
|
9
10
|
getOptions(): {
|
|
10
11
|
cwd: string;
|
|
12
|
+
configPath: string | undefined;
|
|
11
13
|
packageJsonPath: string;
|
|
12
14
|
npmDir: string;
|
|
13
15
|
dryRun: boolean;
|
|
@@ -23,6 +25,10 @@ export interface CreateNpmDirsOptions {
|
|
|
23
25
|
* @default process.cwd()
|
|
24
26
|
*/
|
|
25
27
|
cwd?: string;
|
|
28
|
+
/**
|
|
29
|
+
* Path to `napi` config json file
|
|
30
|
+
*/
|
|
31
|
+
configPath?: string;
|
|
26
32
|
/**
|
|
27
33
|
* Path to `package.json`
|
|
28
34
|
*
|
|
@@ -44,6 +50,10 @@ export interface CreateNpmDirsOptions {
|
|
|
44
50
|
}
|
|
45
51
|
export declare function applyDefaultCreateNpmDirsOptions(options: CreateNpmDirsOptions): {
|
|
46
52
|
cwd: string;
|
|
53
|
+
/**
|
|
54
|
+
* Path to `napi` config json file
|
|
55
|
+
*/
|
|
56
|
+
configPath?: string;
|
|
47
57
|
packageJsonPath: string;
|
|
48
58
|
npmDir: string;
|
|
49
59
|
dryRun: boolean;
|
package/dist/def/new.d.ts
CHANGED
|
@@ -2,26 +2,30 @@ import { Command } from 'clipanion';
|
|
|
2
2
|
export declare abstract class BaseNewCommand extends Command {
|
|
3
3
|
static paths: string[][];
|
|
4
4
|
static usage: import("clipanion").Usage;
|
|
5
|
-
$$path: string;
|
|
5
|
+
$$path: string | undefined;
|
|
6
6
|
$$name?: string;
|
|
7
7
|
minNodeApiVersion: number;
|
|
8
|
+
packageManager: string;
|
|
8
9
|
license: string;
|
|
9
10
|
targets: string[];
|
|
10
11
|
enableDefaultTargets: boolean;
|
|
11
12
|
enableAllTargets: boolean;
|
|
12
13
|
enableTypeDef: boolean;
|
|
13
14
|
enableGithubActions: boolean;
|
|
15
|
+
testFramework: string;
|
|
14
16
|
dryRun: boolean;
|
|
15
17
|
getOptions(): {
|
|
16
|
-
path: string;
|
|
18
|
+
path: string | undefined;
|
|
17
19
|
name: string | undefined;
|
|
18
20
|
minNodeApiVersion: number;
|
|
21
|
+
packageManager: string;
|
|
19
22
|
license: string;
|
|
20
23
|
targets: string[];
|
|
21
24
|
enableDefaultTargets: boolean;
|
|
22
25
|
enableAllTargets: boolean;
|
|
23
26
|
enableTypeDef: boolean;
|
|
24
27
|
enableGithubActions: boolean;
|
|
28
|
+
testFramework: string;
|
|
25
29
|
dryRun: boolean;
|
|
26
30
|
};
|
|
27
31
|
}
|
|
@@ -30,9 +34,9 @@ export declare abstract class BaseNewCommand extends Command {
|
|
|
30
34
|
*/
|
|
31
35
|
export interface NewOptions {
|
|
32
36
|
/**
|
|
33
|
-
* The path where the
|
|
37
|
+
* The path where the NAPI-RS project will be created.
|
|
34
38
|
*/
|
|
35
|
-
path
|
|
39
|
+
path?: string;
|
|
36
40
|
/**
|
|
37
41
|
* The name of the project, default to the name of the directory if not provided
|
|
38
42
|
*/
|
|
@@ -43,6 +47,12 @@ export interface NewOptions {
|
|
|
43
47
|
* @default 4
|
|
44
48
|
*/
|
|
45
49
|
minNodeApiVersion?: number;
|
|
50
|
+
/**
|
|
51
|
+
* The package manager to use. Only support yarn 4.x for now.
|
|
52
|
+
*
|
|
53
|
+
* @default 'yarn'
|
|
54
|
+
*/
|
|
55
|
+
packageManager?: string;
|
|
46
56
|
/**
|
|
47
57
|
* License for open-sourced project
|
|
48
58
|
*
|
|
@@ -79,6 +89,12 @@ export interface NewOptions {
|
|
|
79
89
|
* @default true
|
|
80
90
|
*/
|
|
81
91
|
enableGithubActions?: boolean;
|
|
92
|
+
/**
|
|
93
|
+
* The JavaScript test framework to use, only support `ava` for now
|
|
94
|
+
*
|
|
95
|
+
* @default 'ava'
|
|
96
|
+
*/
|
|
97
|
+
testFramework?: string;
|
|
82
98
|
/**
|
|
83
99
|
* Whether to run the command in dry-run mode
|
|
84
100
|
*
|
|
@@ -88,19 +104,21 @@ export interface NewOptions {
|
|
|
88
104
|
}
|
|
89
105
|
export declare function applyDefaultNewOptions(options: NewOptions): {
|
|
90
106
|
/**
|
|
91
|
-
* The path where the
|
|
107
|
+
* The path where the NAPI-RS project will be created.
|
|
92
108
|
*/
|
|
93
|
-
path
|
|
109
|
+
path?: string;
|
|
94
110
|
/**
|
|
95
111
|
* The name of the project, default to the name of the directory if not provided
|
|
96
112
|
*/
|
|
97
|
-
name?: string
|
|
113
|
+
name?: string;
|
|
98
114
|
minNodeApiVersion: number;
|
|
115
|
+
packageManager: string;
|
|
99
116
|
license: string;
|
|
100
117
|
targets: string[];
|
|
101
118
|
enableDefaultTargets: boolean;
|
|
102
119
|
enableAllTargets: boolean;
|
|
103
120
|
enableTypeDef: boolean;
|
|
104
121
|
enableGithubActions: boolean;
|
|
122
|
+
testFramework: string;
|
|
105
123
|
dryRun: boolean;
|
|
106
124
|
};
|
|
@@ -3,6 +3,7 @@ export declare abstract class BasePrePublishCommand extends Command {
|
|
|
3
3
|
static paths: string[][];
|
|
4
4
|
static usage: import("clipanion").Usage;
|
|
5
5
|
cwd: string;
|
|
6
|
+
configPath?: string;
|
|
6
7
|
packageJsonPath: string;
|
|
7
8
|
npmDir: string;
|
|
8
9
|
tagStyle: string;
|
|
@@ -12,6 +13,7 @@ export declare abstract class BasePrePublishCommand extends Command {
|
|
|
12
13
|
dryRun: boolean;
|
|
13
14
|
getOptions(): {
|
|
14
15
|
cwd: string;
|
|
16
|
+
configPath: string | undefined;
|
|
15
17
|
packageJsonPath: string;
|
|
16
18
|
npmDir: string;
|
|
17
19
|
tagStyle: string;
|
|
@@ -31,6 +33,10 @@ export interface PrePublishOptions {
|
|
|
31
33
|
* @default process.cwd()
|
|
32
34
|
*/
|
|
33
35
|
cwd?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Path to `napi` config json file
|
|
38
|
+
*/
|
|
39
|
+
configPath?: string;
|
|
34
40
|
/**
|
|
35
41
|
* Path to `package.json`
|
|
36
42
|
*
|
|
@@ -72,6 +78,10 @@ export interface PrePublishOptions {
|
|
|
72
78
|
}
|
|
73
79
|
export declare function applyDefaultPrePublishOptions(options: PrePublishOptions): {
|
|
74
80
|
cwd: string;
|
|
81
|
+
/**
|
|
82
|
+
* Path to `napi` config json file
|
|
83
|
+
*/
|
|
84
|
+
configPath?: string;
|
|
75
85
|
packageJsonPath: string;
|
|
76
86
|
npmDir: string;
|
|
77
87
|
tagStyle: string;
|
|
@@ -79,10 +89,10 @@ export declare function applyDefaultPrePublishOptions(options: PrePublishOptions
|
|
|
79
89
|
/**
|
|
80
90
|
* GitHub release name
|
|
81
91
|
*/
|
|
82
|
-
ghReleaseName?: string
|
|
92
|
+
ghReleaseName?: string;
|
|
83
93
|
/**
|
|
84
94
|
* Existing GitHub release id
|
|
85
95
|
*/
|
|
86
|
-
ghReleaseId?: string
|
|
96
|
+
ghReleaseId?: string;
|
|
87
97
|
dryRun: boolean;
|
|
88
98
|
};
|
package/dist/def/rename.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export declare abstract class BaseRenameCommand extends Command {
|
|
|
3
3
|
static paths: string[][];
|
|
4
4
|
static usage: import("clipanion").Usage;
|
|
5
5
|
cwd: string;
|
|
6
|
+
configPath?: string;
|
|
6
7
|
packageJsonPath: string;
|
|
7
8
|
npmDir: string;
|
|
8
9
|
$$name?: string;
|
|
@@ -13,6 +14,7 @@ export declare abstract class BaseRenameCommand extends Command {
|
|
|
13
14
|
description?: string;
|
|
14
15
|
getOptions(): {
|
|
15
16
|
cwd: string;
|
|
17
|
+
configPath: string | undefined;
|
|
16
18
|
packageJsonPath: string;
|
|
17
19
|
npmDir: string;
|
|
18
20
|
name: string | undefined;
|
|
@@ -24,7 +26,7 @@ export declare abstract class BaseRenameCommand extends Command {
|
|
|
24
26
|
};
|
|
25
27
|
}
|
|
26
28
|
/**
|
|
27
|
-
* Rename the
|
|
29
|
+
* Rename the NAPI-RS project
|
|
28
30
|
*/
|
|
29
31
|
export interface RenameOptions {
|
|
30
32
|
/**
|
|
@@ -33,6 +35,10 @@ export interface RenameOptions {
|
|
|
33
35
|
* @default process.cwd()
|
|
34
36
|
*/
|
|
35
37
|
cwd?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Path to `napi` config json file
|
|
40
|
+
*/
|
|
41
|
+
configPath?: string;
|
|
36
42
|
/**
|
|
37
43
|
* Path to `package.json`
|
|
38
44
|
*
|
|
@@ -74,27 +80,31 @@ export interface RenameOptions {
|
|
|
74
80
|
}
|
|
75
81
|
export declare function applyDefaultRenameOptions(options: RenameOptions): {
|
|
76
82
|
cwd: string;
|
|
83
|
+
/**
|
|
84
|
+
* Path to `napi` config json file
|
|
85
|
+
*/
|
|
86
|
+
configPath?: string;
|
|
77
87
|
packageJsonPath: string;
|
|
78
88
|
npmDir: string;
|
|
79
89
|
/**
|
|
80
90
|
* The new name of the project
|
|
81
91
|
*/
|
|
82
|
-
name?: string
|
|
92
|
+
name?: string;
|
|
83
93
|
/**
|
|
84
94
|
* The new binary name *.node files
|
|
85
95
|
*/
|
|
86
|
-
binaryName?: string
|
|
96
|
+
binaryName?: string;
|
|
87
97
|
/**
|
|
88
98
|
* The new package name of the project
|
|
89
99
|
*/
|
|
90
|
-
packageName?: string
|
|
100
|
+
packageName?: string;
|
|
91
101
|
manifestPath: string;
|
|
92
102
|
/**
|
|
93
103
|
* The new repository of the project
|
|
94
104
|
*/
|
|
95
|
-
repository?: string
|
|
105
|
+
repository?: string;
|
|
96
106
|
/**
|
|
97
107
|
* The new description of the project
|
|
98
108
|
*/
|
|
99
|
-
description?: string
|
|
109
|
+
description?: string;
|
|
100
110
|
};
|
|
@@ -3,10 +3,12 @@ export declare abstract class BaseUniversalizeCommand extends Command {
|
|
|
3
3
|
static paths: string[][];
|
|
4
4
|
static usage: import("clipanion").Usage;
|
|
5
5
|
cwd: string;
|
|
6
|
+
configPath?: string;
|
|
6
7
|
packageJsonPath: string;
|
|
7
8
|
outputDir: string;
|
|
8
9
|
getOptions(): {
|
|
9
10
|
cwd: string;
|
|
11
|
+
configPath: string | undefined;
|
|
10
12
|
packageJsonPath: string;
|
|
11
13
|
outputDir: string;
|
|
12
14
|
};
|
|
@@ -21,6 +23,10 @@ export interface UniversalizeOptions {
|
|
|
21
23
|
* @default process.cwd()
|
|
22
24
|
*/
|
|
23
25
|
cwd?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Path to `napi` config json file
|
|
28
|
+
*/
|
|
29
|
+
configPath?: string;
|
|
24
30
|
/**
|
|
25
31
|
* Path to `package.json`
|
|
26
32
|
*
|
|
@@ -36,6 +42,10 @@ export interface UniversalizeOptions {
|
|
|
36
42
|
}
|
|
37
43
|
export declare function applyDefaultUniversalizeOptions(options: UniversalizeOptions): {
|
|
38
44
|
cwd: string;
|
|
45
|
+
/**
|
|
46
|
+
* Path to `napi` config json file
|
|
47
|
+
*/
|
|
48
|
+
configPath?: string;
|
|
39
49
|
packageJsonPath: string;
|
|
40
50
|
outputDir: string;
|
|
41
51
|
};
|
package/dist/def/version.d.ts
CHANGED
|
@@ -3,10 +3,12 @@ export declare abstract class BaseVersionCommand extends Command {
|
|
|
3
3
|
static paths: string[][];
|
|
4
4
|
static usage: import("clipanion").Usage;
|
|
5
5
|
cwd: string;
|
|
6
|
+
configPath?: string;
|
|
6
7
|
packageJsonPath: string;
|
|
7
8
|
npmDir: string;
|
|
8
9
|
getOptions(): {
|
|
9
10
|
cwd: string;
|
|
11
|
+
configPath: string | undefined;
|
|
10
12
|
packageJsonPath: string;
|
|
11
13
|
npmDir: string;
|
|
12
14
|
};
|
|
@@ -21,6 +23,10 @@ export interface VersionOptions {
|
|
|
21
23
|
* @default process.cwd()
|
|
22
24
|
*/
|
|
23
25
|
cwd?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Path to `napi` config json file
|
|
28
|
+
*/
|
|
29
|
+
configPath?: string;
|
|
24
30
|
/**
|
|
25
31
|
* Path to `package.json`
|
|
26
32
|
*
|
|
@@ -36,6 +42,10 @@ export interface VersionOptions {
|
|
|
36
42
|
}
|
|
37
43
|
export declare function applyDefaultVersionOptions(options: VersionOptions): {
|
|
38
44
|
cwd: string;
|
|
45
|
+
/**
|
|
46
|
+
* Path to `napi` config json file
|
|
47
|
+
*/
|
|
48
|
+
configPath?: string;
|
|
39
49
|
packageJsonPath: string;
|
|
40
50
|
npmDir: string;
|
|
41
51
|
};
|