@napi-rs/cli 3.0.0-alpha.90 → 3.0.0-alpha.92
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/create-npm-dirs.d.ts +5 -0
- package/dist/api/templates/index.d.ts +0 -7
- package/dist/cli.js +3892 -15
- package/dist/index.cjs +9212 -8791
- package/dist/index.js +3643 -32
- package/package.json +10 -8
- package/src/api/build.ts +15 -15
- package/src/api/create-npm-dirs.ts +4 -2
- package/src/api/templates/index.ts +0 -7
- package/src/api/templates/load-wasi-template.ts +23 -0
- package/src/utils/config.ts +9 -0
- package/dist/api/__tests__/new.spec.js +0 -283
- package/dist/api/__tests__/new.spec.js.map +0 -1
- package/dist/api/artifacts.js +0 -74
- package/dist/api/artifacts.js.map +0 -1
- package/dist/api/build.js +0 -707
- package/dist/api/build.js.map +0 -1
- package/dist/api/create-npm-dirs.js +0 -101
- package/dist/api/create-npm-dirs.js.map +0 -1
- package/dist/api/new.js +0 -360
- package/dist/api/new.js.map +0 -1
- package/dist/api/pre-publish.js +0 -160
- package/dist/api/pre-publish.js.map +0 -1
- package/dist/api/rename.js +0 -91
- package/dist/api/rename.js.map +0 -1
- package/dist/api/templates/.gitignore.d.ts +0 -1
- package/dist/api/templates/.gitignore.js +0 -200
- package/dist/api/templates/.gitignore.js.map +0 -1
- package/dist/api/templates/.npmignore.d.ts +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.d.ts +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.d.ts +0 -6
- package/dist/api/templates/cargo.toml.js +0 -27
- package/dist/api/templates/cargo.toml.js.map +0 -1
- package/dist/api/templates/ci-template.d.ts +0 -3
- package/dist/api/templates/ci-template.js +0 -593
- package/dist/api/templates/ci-template.js.map +0 -1
- package/dist/api/templates/ci.yml.d.ts +0 -3
- package/dist/api/templates/ci.yml.js +0 -115
- 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 -213
- package/dist/api/templates/js-binding.js.map +0 -1
- package/dist/api/templates/lib.rs.d.ts +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/load-wasi-template.js +0 -168
- package/dist/api/templates/load-wasi-template.js.map +0 -1
- package/dist/api/templates/package.json.d.ts +0 -15
- package/dist/api/templates/package.json.js +0 -54
- package/dist/api/templates/package.json.js.map +0 -1
- package/dist/api/templates/wasi-worker-template.js +0 -122
- package/dist/api/templates/wasi-worker-template.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/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 -47
- package/dist/def/artifacts.js.map +0 -1
- package/dist/def/build.js +0 -140
- package/dist/def/build.js.map +0 -1
- package/dist/def/create-npm-dirs.js +0 -43
- package/dist/def/create-npm-dirs.js.map +0 -1
- package/dist/def/new.js +0 -77
- package/dist/def/new.js.map +0 -1
- package/dist/def/pre-publish.js +0 -61
- package/dist/def/pre-publish.js.map +0 -1
- package/dist/def/rename.js +0 -63
- package/dist/def/rename.js.map +0 -1
- package/dist/def/universalize.js +0 -38
- package/dist/def/universalize.js.map +0 -1
- package/dist/def/version.js +0 -38
- package/dist/def/version.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/utils/__tests__/config.spec.js +0 -63
- package/dist/utils/__tests__/config.spec.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/config.js +0 -75
- 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 -40
- package/dist/utils/metadata.js.map +0 -1
- package/dist/utils/misc.js +0 -43
- package/dist/utils/misc.js.map +0 -1
- package/dist/utils/read-config.js +0 -8
- package/dist/utils/read-config.js.map +0 -1
- package/dist/utils/target.js +0 -135
- package/dist/utils/target.js.map +0 -1
- package/dist/utils/typegen.js +0 -210
- package/dist/utils/typegen.js.map +0 -1
- package/dist/utils/version.js +0 -62
- package/dist/utils/version.js.map +0 -1
- package/src/api/templates/.gitignore.ts +0 -199
- package/src/api/templates/.npmignore.ts +0 -14
- package/src/api/templates/build.rs.ts +0 -4
- package/src/api/templates/cargo.toml.ts +0 -36
- package/src/api/templates/ci-template.ts +0 -602
- package/src/api/templates/ci.yml.ts +0 -140
- package/src/api/templates/lib.rs.ts +0 -7
- package/src/api/templates/package.json.ts +0 -90
package/dist/def/build.js
DELETED
|
@@ -1,140 +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
|
-
configPath = Option.String('--config-path,-c', {
|
|
19
|
-
description: 'Path to `napi` config json file',
|
|
20
|
-
});
|
|
21
|
-
packageJsonPath = Option.String('--package-json-path', {
|
|
22
|
-
description: 'Path to `package.json`',
|
|
23
|
-
});
|
|
24
|
-
targetDir = Option.String('--target-dir', {
|
|
25
|
-
description: 'Directory for all crate generated artifacts, see `cargo build --target-dir`',
|
|
26
|
-
});
|
|
27
|
-
outputDir = Option.String('--output-dir,-o', {
|
|
28
|
-
description: 'Path to where all the built files would be put. Default to the crate folder',
|
|
29
|
-
});
|
|
30
|
-
platform = Option.Boolean('--platform', {
|
|
31
|
-
description: 'Add platform triple to the generated nodejs binding file, eg: `[name].linux-x64-gnu.node`',
|
|
32
|
-
});
|
|
33
|
-
jsPackageName = Option.String('--js-package-name', {
|
|
34
|
-
description: 'Package name in generated js binding file. Only works with `--platform` flag',
|
|
35
|
-
});
|
|
36
|
-
constEnum = Option.Boolean('--const-enum', {
|
|
37
|
-
description: 'Whether generate const enum for typescript bindings',
|
|
38
|
-
});
|
|
39
|
-
jsBinding = Option.String('--js', {
|
|
40
|
-
description: 'Path and filename of generated JS binding file. Only works with `--platform` flag. Relative to `--output-dir`.',
|
|
41
|
-
});
|
|
42
|
-
noJsBinding = Option.Boolean('--no-js', {
|
|
43
|
-
description: 'Whether to disable the generation JS binding file. Only works with `--platform` flag.',
|
|
44
|
-
});
|
|
45
|
-
dts = Option.String('--dts', {
|
|
46
|
-
description: 'Path and filename of generated type def file. Relative to `--output-dir`',
|
|
47
|
-
});
|
|
48
|
-
dtsHeader = Option.String('--dts-header', {
|
|
49
|
-
description: 'Custom file header for generated type def file. Only works when `typedef` feature enabled.',
|
|
50
|
-
});
|
|
51
|
-
noDtsHeader = Option.Boolean('--no-dts-header', {
|
|
52
|
-
description: 'Whether to disable the default file header for generated type def file. Only works when `typedef` feature enabled.',
|
|
53
|
-
});
|
|
54
|
-
dtsCache = Option.Boolean('--dts-cache', true, {
|
|
55
|
-
description: 'Whether to enable the dts cache, default to true',
|
|
56
|
-
});
|
|
57
|
-
esm = Option.Boolean('--esm', {
|
|
58
|
-
description: 'Whether to emit an ESM JS binding file instead of CJS format. Only works with `--platform` flag.',
|
|
59
|
-
});
|
|
60
|
-
strip = Option.Boolean('--strip,-s', {
|
|
61
|
-
description: 'Whether strip the library to achieve the minimum file size',
|
|
62
|
-
});
|
|
63
|
-
release = Option.Boolean('--release,-r', {
|
|
64
|
-
description: 'Build in release mode',
|
|
65
|
-
});
|
|
66
|
-
verbose = Option.Boolean('--verbose,-v', {
|
|
67
|
-
description: 'Verbosely log build command trace',
|
|
68
|
-
});
|
|
69
|
-
bin = Option.String('--bin', {
|
|
70
|
-
description: 'Build only the specified binary',
|
|
71
|
-
});
|
|
72
|
-
package = Option.String('--package,-p', {
|
|
73
|
-
description: 'Build the specified library or the one at cwd',
|
|
74
|
-
});
|
|
75
|
-
profile = Option.String('--profile', {
|
|
76
|
-
description: 'Build artifacts with the specified profile',
|
|
77
|
-
});
|
|
78
|
-
crossCompile = Option.Boolean('--cross-compile,-x', {
|
|
79
|
-
description: '[experimental] cross-compile for the specified target with `cargo-xwin` on windows and `cargo-zigbuild` on other platform',
|
|
80
|
-
});
|
|
81
|
-
useCross = Option.Boolean('--use-cross', {
|
|
82
|
-
description: '[experimental] use [cross](https://github.com/cross-rs/cross) instead of `cargo`',
|
|
83
|
-
});
|
|
84
|
-
useNapiCross = Option.Boolean('--use-napi-cross', {
|
|
85
|
-
description: '[experimental] use @napi-rs/cross-toolchain to cross-compile Linux arm/arm64/x64 gnu targets.',
|
|
86
|
-
});
|
|
87
|
-
watch = Option.Boolean('--watch,-w', {
|
|
88
|
-
description: 'watch the crate changes and build continuously with `cargo-watch` crates',
|
|
89
|
-
});
|
|
90
|
-
features = Option.Array('--features,-F', {
|
|
91
|
-
description: 'Space-separated list of features to activate',
|
|
92
|
-
});
|
|
93
|
-
allFeatures = Option.Boolean('--all-features', {
|
|
94
|
-
description: 'Activate all available features',
|
|
95
|
-
});
|
|
96
|
-
noDefaultFeatures = Option.Boolean('--no-default-features', {
|
|
97
|
-
description: 'Do not activate the `default` feature',
|
|
98
|
-
});
|
|
99
|
-
getOptions() {
|
|
100
|
-
return {
|
|
101
|
-
target: this.target,
|
|
102
|
-
cwd: this.cwd,
|
|
103
|
-
manifestPath: this.manifestPath,
|
|
104
|
-
configPath: this.configPath,
|
|
105
|
-
packageJsonPath: this.packageJsonPath,
|
|
106
|
-
targetDir: this.targetDir,
|
|
107
|
-
outputDir: this.outputDir,
|
|
108
|
-
platform: this.platform,
|
|
109
|
-
jsPackageName: this.jsPackageName,
|
|
110
|
-
constEnum: this.constEnum,
|
|
111
|
-
jsBinding: this.jsBinding,
|
|
112
|
-
noJsBinding: this.noJsBinding,
|
|
113
|
-
dts: this.dts,
|
|
114
|
-
dtsHeader: this.dtsHeader,
|
|
115
|
-
noDtsHeader: this.noDtsHeader,
|
|
116
|
-
dtsCache: this.dtsCache,
|
|
117
|
-
esm: this.esm,
|
|
118
|
-
strip: this.strip,
|
|
119
|
-
release: this.release,
|
|
120
|
-
verbose: this.verbose,
|
|
121
|
-
bin: this.bin,
|
|
122
|
-
package: this.package,
|
|
123
|
-
profile: this.profile,
|
|
124
|
-
crossCompile: this.crossCompile,
|
|
125
|
-
useCross: this.useCross,
|
|
126
|
-
useNapiCross: this.useNapiCross,
|
|
127
|
-
watch: this.watch,
|
|
128
|
-
features: this.features,
|
|
129
|
-
allFeatures: this.allFeatures,
|
|
130
|
-
noDefaultFeatures: this.noDefaultFeatures,
|
|
131
|
-
};
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
export function applyDefaultBuildOptions(options) {
|
|
135
|
-
return {
|
|
136
|
-
dtsCache: true,
|
|
137
|
-
...options,
|
|
138
|
-
};
|
|
139
|
-
}
|
|
140
|
-
//# sourceMappingURL=build.js.map
|
package/dist/def/build.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/def/build.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,iCAAiC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAE3C,MAAM,OAAgB,gBAAiB,SAAQ,OAAO;IACpD,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAA;IAE1B,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC3B,WAAW,EAAE,2BAA2B;KACzC,CAAC,CAAA;IAEF,MAAM,GAAY,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE;QAC7C,WAAW,EACT,iEAAiE;KACpE,CAAC,CAAA;IAEF,GAAG,GAAY,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE;QACpC,WAAW,EACT,oHAAoH;KACvH,CAAC,CAAA;IAEF,YAAY,GAAY,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE;QACvD,WAAW,EAAE,sBAAsB;KACpC,CAAC,CAAA;IAEF,UAAU,GAAY,MAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE;QACtD,WAAW,EAAE,iCAAiC;KAC/C,CAAC,CA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YAC7B,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;SAC1C,CAAA;IACH,CAAC;;AAmIH,MAAM,UAAU,wBAAwB,CAAC,OAAqB;IAC5D,OAAO;QACL,QAAQ,EAAE,IAAI;QACd,GAAG,OAAO;KACX,CAAA;AACH,CAAC"}
|
|
@@ -1,43 +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
|
-
configPath = Option.String('--config-path,-c', {
|
|
13
|
-
description: 'Path to `napi` config json file',
|
|
14
|
-
});
|
|
15
|
-
packageJsonPath = Option.String('--package-json-path', 'package.json', {
|
|
16
|
-
description: 'Path to `package.json`',
|
|
17
|
-
});
|
|
18
|
-
npmDir = Option.String('--npm-dir', 'npm', {
|
|
19
|
-
description: 'Path to the folder where the npm packages put',
|
|
20
|
-
});
|
|
21
|
-
dryRun = Option.Boolean('--dry-run', false, {
|
|
22
|
-
description: 'Dry run without touching file system',
|
|
23
|
-
});
|
|
24
|
-
getOptions() {
|
|
25
|
-
return {
|
|
26
|
-
cwd: this.cwd,
|
|
27
|
-
configPath: this.configPath,
|
|
28
|
-
packageJsonPath: this.packageJsonPath,
|
|
29
|
-
npmDir: this.npmDir,
|
|
30
|
-
dryRun: this.dryRun,
|
|
31
|
-
};
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
export function applyDefaultCreateNpmDirsOptions(options) {
|
|
35
|
-
return {
|
|
36
|
-
cwd: process.cwd(),
|
|
37
|
-
packageJsonPath: 'package.json',
|
|
38
|
-
npmDir: 'npm',
|
|
39
|
-
dryRun: false,
|
|
40
|
-
...options,
|
|
41
|
-
};
|
|
42
|
-
}
|
|
43
|
-
//# sourceMappingURL=create-npm-dirs.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"create-npm-dirs.js","sourceRoot":"","sources":["../../src/def/create-npm-dirs.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,iCAAiC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAE3C,MAAM,OAAgB,wBAAyB,SAAQ,OAAO;IAC5D,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAA;IAEpC,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC3B,WAAW,EAAE,iDAAiD;KAC/D,CAAC,CAAA;IAEF,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE;QAC1C,WAAW,EACT,oHAAoH;KACvH,CAAC,CAAA;IAEF,UAAU,GAAY,MAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE;QACtD,WAAW,EAAE,iCAAiC;KAC/C,CAAC,CAAA;IAEF,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,qBAAqB,EAAE,cAAc,EAAE;QACrE,WAAW,EAAE,wBAAwB;KACtC,CAAC,CAAA;IAEF,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,EAAE;QACzC,WAAW,EAAE,+CAA+C;KAC7D,CAAC,CAAA;IAEF,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,EAAE;QAC1C,WAAW,EAAE,sCAAsC;KACpD,CAAC,CAAA;IAEF,UAAU;QACR,OAAO;YACL,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAA;IACH,CAAC;;AAqCH,MAAM,UAAU,gCAAgC,CAC9C,OAA6B;IAE7B,OAAO;QACL,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;QAClB,eAAe,EAAE,cAAc;QAC/B,MAAM,EAAE,KAAK;QACb,MAAM,EAAE,KAAK;QACb,GAAG,OAAO;KACX,CAAA;AACH,CAAC"}
|
package/dist/def/new.js
DELETED
|
@@ -1,77 +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: false });
|
|
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
|
-
packageManager = Option.String('--package-manager', 'yarn', {
|
|
19
|
-
description: 'The package manager to use. Only support yarn 4.x for now.',
|
|
20
|
-
});
|
|
21
|
-
license = Option.String('--license,-l', 'MIT', {
|
|
22
|
-
description: 'License for open-sourced project',
|
|
23
|
-
});
|
|
24
|
-
targets = Option.Array('--targets,-t', [], {
|
|
25
|
-
description: 'All targets the crate will be compiled for.',
|
|
26
|
-
});
|
|
27
|
-
enableDefaultTargets = Option.Boolean('--enable-default-targets', true, {
|
|
28
|
-
description: 'Whether enable default targets',
|
|
29
|
-
});
|
|
30
|
-
enableAllTargets = Option.Boolean('--enable-all-targets', false, {
|
|
31
|
-
description: 'Whether enable all targets',
|
|
32
|
-
});
|
|
33
|
-
enableTypeDef = Option.Boolean('--enable-type-def', true, {
|
|
34
|
-
description: 'Whether enable the `type-def` feature for typescript definitions auto-generation',
|
|
35
|
-
});
|
|
36
|
-
enableGithubActions = Option.Boolean('--enable-github-actions', true, {
|
|
37
|
-
description: 'Whether generate preconfigured GitHub Actions workflow',
|
|
38
|
-
});
|
|
39
|
-
testFramework = Option.String('--test-framework', 'ava', {
|
|
40
|
-
description: 'The JavaScript test framework to use, only support `ava` for now',
|
|
41
|
-
});
|
|
42
|
-
dryRun = Option.Boolean('--dry-run', false, {
|
|
43
|
-
description: 'Whether to run the command in dry-run mode',
|
|
44
|
-
});
|
|
45
|
-
getOptions() {
|
|
46
|
-
return {
|
|
47
|
-
path: this.$$path,
|
|
48
|
-
name: this.$$name,
|
|
49
|
-
minNodeApiVersion: this.minNodeApiVersion,
|
|
50
|
-
packageManager: this.packageManager,
|
|
51
|
-
license: this.license,
|
|
52
|
-
targets: this.targets,
|
|
53
|
-
enableDefaultTargets: this.enableDefaultTargets,
|
|
54
|
-
enableAllTargets: this.enableAllTargets,
|
|
55
|
-
enableTypeDef: this.enableTypeDef,
|
|
56
|
-
enableGithubActions: this.enableGithubActions,
|
|
57
|
-
testFramework: this.testFramework,
|
|
58
|
-
dryRun: this.dryRun,
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
export function applyDefaultNewOptions(options) {
|
|
63
|
-
return {
|
|
64
|
-
minNodeApiVersion: 4,
|
|
65
|
-
packageManager: 'yarn',
|
|
66
|
-
license: 'MIT',
|
|
67
|
-
targets: [],
|
|
68
|
-
enableDefaultTargets: true,
|
|
69
|
-
enableAllTargets: false,
|
|
70
|
-
enableTypeDef: true,
|
|
71
|
-
enableGithubActions: true,
|
|
72
|
-
testFramework: 'ava',
|
|
73
|
-
dryRun: false,
|
|
74
|
-
...options,
|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,CAAC;QACpB,cAAc,EAAE,MAAM;QACtB,OAAO,EAAE,KAAK;QACd,OAAO,EAAE,EAAE;QACX,oBAAoB,EAAE,IAAI;QAC1B,gBAAgB,EAAE,KAAK;QACvB,aAAa,EAAE,IAAI;QACnB,mBAAmB,EAAE,IAAI;QACzB,aAAa,EAAE,KAAK;QACpB,MAAM,EAAE,KAAK;QACb,GAAG,OAAO;KACX,CAAA;AACH,CAAC"}
|
package/dist/def/pre-publish.js
DELETED
|
@@ -1,61 +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'], ['prepublish']];
|
|
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
|
-
configPath = Option.String('--config-path,-c', {
|
|
13
|
-
description: 'Path to `napi` config json file',
|
|
14
|
-
});
|
|
15
|
-
packageJsonPath = Option.String('--package-json-path', 'package.json', {
|
|
16
|
-
description: 'Path to `package.json`',
|
|
17
|
-
});
|
|
18
|
-
npmDir = Option.String('--npm-dir,-p', 'npm', {
|
|
19
|
-
description: 'Path to the folder where the npm packages put',
|
|
20
|
-
});
|
|
21
|
-
tagStyle = Option.String('--tag-style,--tagstyle,-t', 'lerna', {
|
|
22
|
-
description: 'git tag style, `npm` or `lerna`',
|
|
23
|
-
});
|
|
24
|
-
ghRelease = Option.Boolean('--gh-release', true, {
|
|
25
|
-
description: 'Whether create GitHub release',
|
|
26
|
-
});
|
|
27
|
-
ghReleaseName = Option.String('--gh-release-name', {
|
|
28
|
-
description: 'GitHub release name',
|
|
29
|
-
});
|
|
30
|
-
ghReleaseId = Option.String('--gh-release-id', {
|
|
31
|
-
description: 'Existing GitHub release id',
|
|
32
|
-
});
|
|
33
|
-
dryRun = Option.Boolean('--dry-run', false, {
|
|
34
|
-
description: 'Dry run without touching file system',
|
|
35
|
-
});
|
|
36
|
-
getOptions() {
|
|
37
|
-
return {
|
|
38
|
-
cwd: this.cwd,
|
|
39
|
-
configPath: this.configPath,
|
|
40
|
-
packageJsonPath: this.packageJsonPath,
|
|
41
|
-
npmDir: this.npmDir,
|
|
42
|
-
tagStyle: this.tagStyle,
|
|
43
|
-
ghRelease: this.ghRelease,
|
|
44
|
-
ghReleaseName: this.ghReleaseName,
|
|
45
|
-
ghReleaseId: this.ghReleaseId,
|
|
46
|
-
dryRun: this.dryRun,
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
export function applyDefaultPrePublishOptions(options) {
|
|
51
|
-
return {
|
|
52
|
-
cwd: process.cwd(),
|
|
53
|
-
packageJsonPath: 'package.json',
|
|
54
|
-
npmDir: 'npm',
|
|
55
|
-
tagStyle: 'lerna',
|
|
56
|
-
ghRelease: true,
|
|
57
|
-
dryRun: false,
|
|
58
|
-
...options,
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
//# sourceMappingURL=pre-publish.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"pre-publish.js","sourceRoot":"","sources":["../../src/def/pre-publish.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,iCAAiC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAE3C,MAAM,OAAgB,qBAAsB,SAAQ,OAAO;IACzD,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,aAAa,CAAC,EAAE,CAAC,YAAY,CAAC,CAAC,CAAA;IAEhD,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC3B,WAAW,EACT,gEAAgE;KACnE,CAAC,CAAA;IAEF,GAAG,GAAG,MAAM,C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AAE,IAAI,CAAC,aAAa;YACjC,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAA;IACH,CAAC;;AAyDH,MAAM,UAAU,6BAA6B,CAAC,OAA0B;IACtE,OAAO;QACL,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;QAClB,eAAe,EAAE,cAAc;QAC/B,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,OAAO;QACjB,SAAS,EAAE,IAAI;QACf,MAAM,EAAE,KAAK;QACb,GAAG,OAAO;KACX,CAAA;AACH,CAAC"}
|
package/dist/def/rename.js
DELETED
|
@@ -1,63 +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
|
-
configPath = Option.String('--config-path,-c', {
|
|
13
|
-
description: 'Path to `napi` config json file',
|
|
14
|
-
});
|
|
15
|
-
packageJsonPath = Option.String('--package-json-path', 'package.json', {
|
|
16
|
-
description: 'Path to `package.json`',
|
|
17
|
-
});
|
|
18
|
-
npmDir = Option.String('--npm-dir', 'npm', {
|
|
19
|
-
description: 'Path to the folder where the npm packages put',
|
|
20
|
-
});
|
|
21
|
-
$$name = Option.String('--name,-n', {
|
|
22
|
-
description: 'The new name of the project',
|
|
23
|
-
});
|
|
24
|
-
binaryName = Option.String('--binary-name,-b', {
|
|
25
|
-
description: 'The new binary name *.node files',
|
|
26
|
-
});
|
|
27
|
-
packageName = Option.String('--package-name', {
|
|
28
|
-
description: 'The new package name of the project',
|
|
29
|
-
});
|
|
30
|
-
manifestPath = Option.String('--manifest-path', 'Cargo.toml', {
|
|
31
|
-
description: 'Path to `Cargo.toml`',
|
|
32
|
-
});
|
|
33
|
-
repository = Option.String('--repository', {
|
|
34
|
-
description: 'The new repository of the project',
|
|
35
|
-
});
|
|
36
|
-
description = Option.String('--description', {
|
|
37
|
-
description: 'The new description of the project',
|
|
38
|
-
});
|
|
39
|
-
getOptions() {
|
|
40
|
-
return {
|
|
41
|
-
cwd: this.cwd,
|
|
42
|
-
configPath: this.configPath,
|
|
43
|
-
packageJsonPath: this.packageJsonPath,
|
|
44
|
-
npmDir: this.npmDir,
|
|
45
|
-
name: this.$$name,
|
|
46
|
-
binaryName: this.binaryName,
|
|
47
|
-
packageName: this.packageName,
|
|
48
|
-
manifestPath: this.manifestPath,
|
|
49
|
-
repository: this.repository,
|
|
50
|
-
description: this.description,
|
|
51
|
-
};
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
export function applyDefaultRenameOptions(options) {
|
|
55
|
-
return {
|
|
56
|
-
cwd: process.cwd(),
|
|
57
|
-
packageJsonPath: 'package.json',
|
|
58
|
-
npmDir: 'npm',
|
|
59
|
-
manifestPath: 'Cargo.toml',
|
|
60
|
-
...options,
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
//# sourceMappingURL=rename.js.map
|
package/dist/def/rename.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"rename.js","sourceRoot":"","sources":["../../src/def/rename.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,iCAAiC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAE3C,MAAM,OAAgB,iBAAkB,SAAQ,OAAO;IACrD,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAA;IAE3B,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC3B,WAAW,EAAE,4BAA4B;KA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AE,IAAI,CAAC,MAAM;YACnB,IAAI,EAAE,IAAI,CAAC,MAAM;YACjB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,WAAW,EAAE,IAAI,CAAC,WAAW;SAC9B,CAAA;IACH,CAAC;;AAyDH,MAAM,UAAU,yBAAyB,CAAC,OAAsB;IAC9D,OAAO;QACL,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;QAClB,eAAe,EAAE,cAAc;QAC/B,MAAM,EAAE,KAAK;QACb,YAAY,EAAE,YAAY;QAC1B,GAAG,OAAO;KACX,CAAA;AACH,CAAC"}
|
package/dist/def/universalize.js
DELETED
|
@@ -1,38 +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
|
-
configPath = Option.String('--config-path,-c', {
|
|
13
|
-
description: 'Path to `napi` config json file',
|
|
14
|
-
});
|
|
15
|
-
packageJsonPath = Option.String('--package-json-path', 'package.json', {
|
|
16
|
-
description: 'Path to `package.json`',
|
|
17
|
-
});
|
|
18
|
-
outputDir = Option.String('--output-dir,-o', './', {
|
|
19
|
-
description: 'Path to the folder where all built `.node` files put, same as `--output-dir` of build command',
|
|
20
|
-
});
|
|
21
|
-
getOptions() {
|
|
22
|
-
return {
|
|
23
|
-
cwd: this.cwd,
|
|
24
|
-
configPath: this.configPath,
|
|
25
|
-
packageJsonPath: this.packageJsonPath,
|
|
26
|
-
outputDir: this.outputDir,
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
export function applyDefaultUniversalizeOptions(options) {
|
|
31
|
-
return {
|
|
32
|
-
cwd: process.cwd(),
|
|
33
|
-
packageJsonPath: 'package.json',
|
|
34
|
-
outputDir: './',
|
|
35
|
-
...options,
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=universalize.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"universalize.js","sourceRoot":"","sources":["../../src/def/universalize.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,iCAAiC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAE3C,MAAM,OAAgB,uBAAwB,SAAQ,OAAO;IAC3D,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,cAAc,CAAC,CAAC,CAAA;IAEjC,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC3B,WAAW,EAAE,kDAAkD;KAChE,CAAC,CAAA;IAEF,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE;QAC1C,WAAW,EACT,oHAAoH;KACvH,CAAC,CAAA;IAEF,UAAU,GAAY,MAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE;QACtD,WAAW,EAAE,iCAAiC;KAC/C,CAAC,CAAA;IAEF,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,qBAAqB,EAAE,cAAc,EAAE;QACrE,WAAW,EAAE,wBAAwB;KACtC,CAAC,CAAA;IAEF,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,IAAI,EAAE;QACjD,WAAW,EACT,+FAA+F;KAClG,CAAC,CAAA;IAEF,UAAU;QACR,OAAO;YACL,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAA;IACH,CAAC;;AA+BH,MAAM,UAAU,+BAA+B,CAAC,OAA4B;IAC1E,OAAO;QACL,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;QAClB,eAAe,EAAE,cAAc;QAC/B,SAAS,EAAE,IAAI;QACf,GAAG,OAAO;KACX,CAAA;AACH,CAAC"}
|
package/dist/def/version.js
DELETED
|
@@ -1,38 +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
|
-
configPath = Option.String('--config-path,-c', {
|
|
13
|
-
description: 'Path to `napi` config json file',
|
|
14
|
-
});
|
|
15
|
-
packageJsonPath = Option.String('--package-json-path', 'package.json', {
|
|
16
|
-
description: 'Path to `package.json`',
|
|
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
|
-
configPath: this.configPath,
|
|
25
|
-
packageJsonPath: this.packageJsonPath,
|
|
26
|
-
npmDir: this.npmDir,
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
export function applyDefaultVersionOptions(options) {
|
|
31
|
-
return {
|
|
32
|
-
cwd: process.cwd(),
|
|
33
|
-
packageJsonPath: 'package.json',
|
|
34
|
-
npmDir: 'npm',
|
|
35
|
-
...options,
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
//# sourceMappingURL=version.js.map
|
package/dist/def/version.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/def/version.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,iCAAiC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAE3C,MAAM,OAAgB,kBAAmB,SAAQ,OAAO;IACtD,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,CAAA;IAE5B,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC3B,WAAW,EAAE,wCAAwC;KACtD,CAAC,CAAA;IAEF,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE;QAC1C,WAAW,EACT,oHAAoH;KACvH,CAAC,CAAA;IAEF,UAAU,GAAY,MAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE;QACtD,WAAW,EAAE,iCAAiC;KAC/C,CAAC,CAAA;IAEF,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,qBAAqB,EAAE,cAAc,EAAE;QACrE,WAAW,EAAE,wBAAwB;KACtC,CAAC,CAAA;IAEF,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,EAAE;QACzC,WAAW,EAAE,+CAA+C;KAC7D,CAAC,CAAA;IAEF,UAAU;QACR,OAAO;YACL,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAA;IACH,CAAC;;AA+BH,MAAM,UAAU,0BAA0B,CAAC,OAAuB;IAChE,OAAO;QACL,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;QAClB,eAAe,EAAE,cAAc;QAC/B,MAAM,EAAE,KAAK;QACb,GAAG,OAAO;KACX,CAAA;AACH,CAAC"}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAA;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAA;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAA;AAE1C;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,OAAO;IAClB,SAAS,GAAG,gBAAgB,CAAA;IAC5B,GAAG,GAAG,UAAU,CAAA;IAChB,KAAK,GAAG,YAAY,CAAA;IACpB,aAAa,GAAG,aAAa,CAAA;IAC7B,UAAU,GAAG,UAAU,CAAA;IACvB,MAAM,GAAG,aAAa,CAAA;IACtB,YAAY,GAAG,oBAAoB,CAAA;IACnC,OAAO,GAAG,OAAO,CAAA;CAClB;AAED,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA"}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { unlink, writeFile } from 'node:fs/promises';
|
|
2
|
-
import { tmpdir } from 'node:os';
|
|
3
|
-
import { join } from 'node:path';
|
|
4
|
-
import ava from 'ava';
|
|
5
|
-
import { readNapiConfig, } from '../config.js';
|
|
6
|
-
const NON_EXISTENT_FILE = 'non-existent-file';
|
|
7
|
-
const test = ava;
|
|
8
|
-
test.before(async (t) => {
|
|
9
|
-
const tmp = tmpdir();
|
|
10
|
-
const configPath = join(tmp, 'napi.json');
|
|
11
|
-
const packageJson = join(tmp, 'package.json');
|
|
12
|
-
const pkgJson = {
|
|
13
|
-
name: '@napi-rs/testing',
|
|
14
|
-
version: '0.0.0',
|
|
15
|
-
napi: {
|
|
16
|
-
binaryName: 'testing',
|
|
17
|
-
packageName: '@napi-rs/testing',
|
|
18
|
-
targets: [
|
|
19
|
-
'x86_64-unknown-linux-gnu',
|
|
20
|
-
'x86_64-pc-windows-msvc',
|
|
21
|
-
'x86_64-apple-darwin',
|
|
22
|
-
],
|
|
23
|
-
},
|
|
24
|
-
};
|
|
25
|
-
await writeFile(packageJson, JSON.stringify(pkgJson, null, 2));
|
|
26
|
-
const config = {
|
|
27
|
-
binaryName: 'testing',
|
|
28
|
-
packageName: '@node-rs/testing',
|
|
29
|
-
targets: [
|
|
30
|
-
'x86_64-unknown-linux-gnu',
|
|
31
|
-
'x86_64-apple-darwin',
|
|
32
|
-
'aarch64-apple-darwin',
|
|
33
|
-
],
|
|
34
|
-
};
|
|
35
|
-
await writeFile(configPath, JSON.stringify(config, null, 2));
|
|
36
|
-
t.context = { configPath, config, packageJson, pkgJson };
|
|
37
|
-
});
|
|
38
|
-
test.after(async (t) => {
|
|
39
|
-
await unlink(t.context.configPath);
|
|
40
|
-
await unlink(t.context.packageJson);
|
|
41
|
-
});
|
|
42
|
-
test('should throw if package.json not found', async (t) => {
|
|
43
|
-
await t.throwsAsync(() => readNapiConfig(NON_EXISTENT_FILE), {
|
|
44
|
-
message: `package.json not found at ${NON_EXISTENT_FILE}`,
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
test('should throw if napi.json not found', async (t) => {
|
|
48
|
-
const { packageJson } = t.context;
|
|
49
|
-
await t.throwsAsync(() => readNapiConfig(packageJson, NON_EXISTENT_FILE), {
|
|
50
|
-
message: `NAPI-RS config not found at ${NON_EXISTENT_FILE}`,
|
|
51
|
-
});
|
|
52
|
-
});
|
|
53
|
-
test('should be able to read config from package.json', async (t) => {
|
|
54
|
-
const { packageJson } = t.context;
|
|
55
|
-
const config = await readNapiConfig(packageJson);
|
|
56
|
-
t.snapshot(config);
|
|
57
|
-
});
|
|
58
|
-
test('should be able to read config from napi.json', async (t) => {
|
|
59
|
-
const { packageJson, configPath } = t.context;
|
|
60
|
-
const config = await readNapiConfig(packageJson, configPath);
|
|
61
|
-
t.snapshot(config);
|
|
62
|
-
});
|
|
63
|
-
//# sourceMappingURL=config.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.spec.js","sourceRoot":"","sources":["../../../src/utils/__tests__/config.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAChC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAA;AAEhC,OAAO,GAAe,MAAM,KAAK,CAAA;AAEjC,OAAO,EAGL,cAAc,GACf,MAAM,cAAc,CAAA;AAErB,MAAM,iBAAiB,GAAG,mBAAmB,CAAA;AAE7C,MAAM,IAAI,GAAG,GAKX,CAAA;AAEF,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC,EAAE,EAAE;IACtB,MAAM,GAAG,GAAG,MAAM,EAAE,CAAA;IACpB,MAAM,UAAU,GAAG,IAAI,CAAC,GAAG,EAAE,WAAW,CAAC,CAAA;IACzC,MAAM,WAAW,GAAG,IAAI,CAAC,GAAG,EAAE,cAAc,CAAC,CAAA;IAC7C,MAAM,OAAO,GAAG;QACd,IAAI,EAAE,kBAAkB;QACxB,OAAO,EAAE,OAAO;QAChB,IAAI,EAAE;YACJ,UAAU,EAAE,SAAS;YACrB,WAAW,EAAE,kBAAkB;YAC/B,OAAO,EAAE;gBACP,0BAA0B;gBAC1B,wBAAwB;gBACxB,qBAA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AAC,CAAA;AACJ,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,iDAAiD,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IAClE,MAAM,EAAE,WAAW,EAAE,GAAG,CAAC,CAAC,OAAO,CAAA;IACjC,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,WAAW,CAAC,CAAA;IAChD,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;AACpB,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,8CAA8C,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IAC/D,MAAM,EAAE,WAAW,EAAE,UAAU,EAAE,GAAG,CAAC,CAAC,OAAO,CAAA;IAC7C,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,WAAW,EAAE,UAAU,CAAC,CAAA;IAC5D,CAAC,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;AACpB,CAAC,CAAC,CAAA"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import os from 'os';
|
|
2
|
-
import test from 'ava';
|
|
3
|
-
import { parseTriple, getSystemDefaultTarget, AVAILABLE_TARGETS, } from '../target.js';
|
|
4
|
-
test('should parse triple correctly', (t) => {
|
|
5
|
-
t.snapshot(AVAILABLE_TARGETS.map(parseTriple));
|
|
6
|
-
});
|
|
7
|
-
test('should get system default target correctly', (t) => {
|
|
8
|
-
const target = getSystemDefaultTarget();
|
|
9
|
-
t.is(target.platform, os.platform());
|
|
10
|
-
});
|
|
11
|
-
//# sourceMappingURL=target.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"target.spec.js","sourceRoot":"","sources":["../../../src/utils/__tests__/target.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAA;AAEnB,OAAO,IAAI,MAAM,KAAK,CAAA;AAEtB,OAAO,EACL,WAAW,EACX,sBAAsB,EACtB,iBAAiB,GAClB,MAAM,cAAc,CAAA;AAErB,IAAI,CAAC,+BAA+B,EAAE,CAAC,CAAC,EAAE,EAAE;IAC1C,CAAC,CAAC,QAAQ,CAAC,iBAAiB,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC,CAAA;AAChD,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,4CAA4C,EAAE,CAAC,CAAC,EAAE,EAAE;IACvD,MAAM,MAAM,GAAG,sBAAsB,EAAE,CAAA;IAEvC,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,QAAQ,EAAE,EAAE,CAAC,QAAQ,EAAE,CAAC,CAAA;AACtC,CAAC,CAAC,CAAA"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { join } from 'path';
|
|
2
|
-
import { fileURLToPath } from 'url';
|
|
3
|
-
import test from 'ava';
|
|
4
|
-
import { correctStringIdent, processTypeDef } from '../typegen.js';
|
|
5
|
-
test('should ident string correctly', (t) => {
|
|
6
|
-
const input = `
|
|
7
|
-
/**
|
|
8
|
-
* should keep
|
|
9
|
-
* class A {
|
|
10
|
-
* foo = () => {}
|
|
11
|
-
* bar = () => {}
|
|
12
|
-
* }
|
|
13
|
-
*/
|
|
14
|
-
class A {
|
|
15
|
-
foo() {
|
|
16
|
-
a = b
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
bar = () => {
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
boz = 1
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
namespace B {
|
|
26
|
-
namespace C {
|
|
27
|
-
type D = A
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
`;
|
|
31
|
-
t.snapshot(correctStringIdent(input, 0), 'original ident is 0');
|
|
32
|
-
t.snapshot(correctStringIdent(input, 2), 'original ident is 2');
|
|
33
|
-
});
|
|
34
|
-
test('should process type def correctly', async (t) => {
|
|
35
|
-
const { dts } = await processTypeDef(join(fileURLToPath(import.meta.url), '../', '__fixtures__', 'napi_type_def'), true);
|
|
36
|
-
t.snapshot(dts);
|
|
37
|
-
});
|
|
38
|
-
test('should process type def with noConstEnum correctly', async (t) => {
|
|
39
|
-
const { dts } = await processTypeDef(join(fileURLToPath(import.meta.url), '../', '__fixtures__', 'napi_type_def'), false);
|
|
40
|
-
t.snapshot(dts);
|
|
41
|
-
});
|
|
42
|
-
//# sourceMappingURL=typegen.spec.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typegen.spec.js","sourceRoot":"","sources":["../../../src/utils/__tests__/typegen.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAC3B,OAAO,EAAE,aAAa,EAAE,MAAM,KAAK,CAAA;AAEnC,OAAO,IAAI,MAAM,KAAK,CAAA;AAEtB,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAElE,IAAI,CAAC,+BAA+B,EAAE,CAAC,CAAC,EAAE,EAAE;IAC1C,MAAM,KAAK,GAAG;;;;;;;;;;;;;;;;;;;;;;;;CAwBf,CAAA;IACC,CAAC,CAAC,QAAQ,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,qBAAqB,CAAC,CAAA;IAC/D,CAAC,CAAC,QAAQ,CAAC,kBAAkB,CAAC,KAAK,EAAE,CAAC,CAAC,EAAE,qBAAqB,CAAC,CAAA;AACjE,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,mCAAmC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IACpD,MAAM,EAAE,GAAG,EAAE,GAAG,MAAM,cAAc,CAClC,IAAI,CACF,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,EAC9B,KAAK,EACL,cAAc,EACd,eAAe,CAChB,EACD,IAAI,CACL,CAAA;IAED,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAA;AACjB,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,oDAAoD,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IACrE,MAAM,E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