@napi-rs/cli 2.15.2 → 3.0.0-alpha.0
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/README.md +17 -78
- package/cli.mjs +12 -0
- package/dist/api/artifacts.d.ts +2 -0
- package/dist/api/artifacts.js +50 -0
- package/dist/api/build.d.ts +14 -0
- package/dist/api/build.js +404 -0
- package/dist/api/create-npm-dirs.d.ts +2 -0
- package/dist/api/create-npm-dirs.js +63 -0
- package/dist/api/new.d.ts +4 -0
- package/dist/api/new.js +154 -0
- package/dist/api/pre-publish.d.ts +2 -0
- package/dist/api/pre-publish.js +157 -0
- package/dist/api/rename.d.ts +2 -0
- package/dist/api/rename.js +28 -0
- package/dist/api/templates/.gitignore.d.ts +1 -0
- package/dist/api/templates/.gitignore.js +198 -0
- package/dist/api/templates/.npmignore.d.ts +1 -0
- package/dist/api/templates/.npmignore.js +14 -0
- package/dist/api/templates/build.rs.d.ts +1 -0
- package/dist/api/templates/build.rs.js +4 -0
- package/dist/api/templates/cargo.toml.d.ts +6 -0
- package/dist/api/templates/cargo.toml.js +25 -0
- package/dist/api/templates/ci-template.d.ts +1 -0
- package/dist/api/templates/ci-template.js +566 -0
- package/dist/api/templates/ci.yml.d.ts +1 -0
- package/dist/api/templates/ci.yml.js +92 -0
- package/dist/api/templates/index.d.ts +8 -0
- package/dist/api/templates/index.js +8 -0
- package/dist/api/templates/js-binding.d.ts +1 -0
- package/dist/api/templates/js-binding.js +124 -0
- package/dist/api/templates/lib.rs.d.ts +1 -0
- package/dist/api/templates/lib.rs.js +10 -0
- package/dist/api/templates/package.json.d.ts +8 -0
- package/dist/api/templates/package.json.js +30 -0
- package/dist/api/universalize.d.ts +2 -0
- package/dist/api/universalize.js +38 -0
- package/dist/api/version.d.ts +2 -0
- package/dist/api/version.js +16 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +25 -0
- package/dist/commands/artifacts.d.ts +6 -0
- package/dist/commands/artifacts.js +19 -0
- package/dist/commands/build.d.ts +6 -0
- package/dist/commands/build.js +34 -0
- package/dist/commands/create-npm-dirs.d.ts +4 -0
- package/dist/commands/create-npm-dirs.js +7 -0
- package/dist/commands/help.d.ts +10 -0
- package/dist/commands/help.js +12 -0
- package/dist/commands/new.d.ts +12 -0
- package/dist/commands/new.js +112 -0
- package/dist/commands/pre-publish.d.ts +4 -0
- package/dist/commands/pre-publish.js +8 -0
- package/dist/commands/rename.d.ts +4 -0
- package/dist/commands/rename.js +7 -0
- package/dist/commands/universalize.d.ts +4 -0
- package/dist/commands/universalize.js +7 -0
- package/dist/commands/version.d.ts +4 -0
- package/dist/commands/version.js +7 -0
- package/dist/def/artifacts.d.ts +50 -0
- package/dist/def/artifacts.js +38 -0
- package/dist/def/build.d.ts +150 -0
- package/dist/def/build.js +105 -0
- package/dist/def/commands/artifacts.d.ts +15 -0
- package/dist/def/commands/artifacts.js +29 -0
- package/dist/def/commands/build.d.ts +53 -0
- package/dist/def/commands/build.js +105 -0
- package/dist/def/commands/create-npm-dirs.d.ts +15 -0
- package/dist/def/commands/create-npm-dirs.js +29 -0
- package/dist/def/commands/new.d.ts +27 -0
- package/dist/def/commands/new.js +53 -0
- package/dist/def/commands/pre-publish.d.ts +23 -0
- package/dist/def/commands/pre-publish.js +45 -0
- package/dist/def/commands/rename.d.ts +25 -0
- package/dist/def/commands/rename.js +49 -0
- package/dist/def/commands/universalize.d.ts +13 -0
- package/dist/def/commands/universalize.js +25 -0
- package/dist/def/commands/version.d.ts +13 -0
- package/dist/def/commands/version.js +25 -0
- package/dist/def/create-npm-dirs.d.ts +50 -0
- package/dist/def/create-npm-dirs.js +38 -0
- package/dist/def/new.d.ts +106 -0
- package/dist/def/new.js +66 -0
- package/dist/def/options/artifacts.d.ts +35 -0
- package/dist/def/options/artifacts.js +11 -0
- package/dist/def/options/build.d.ts +97 -0
- package/dist/def/options/build.js +3 -0
- package/dist/def/options/create-npm-dirs.d.ts +35 -0
- package/dist/def/options/create-npm-dirs.js +11 -0
- package/dist/def/options/new.d.ts +79 -0
- package/dist/def/options/new.js +15 -0
- package/dist/def/options/pre-publish.d.ts +65 -0
- package/dist/def/options/pre-publish.js +13 -0
- package/dist/def/options/rename.d.ts +75 -0
- package/dist/def/options/rename.js +11 -0
- package/dist/def/options/universalize.d.ts +28 -0
- package/dist/def/options/universalize.js +10 -0
- package/dist/def/options/version.d.ts +28 -0
- package/dist/def/options/version.js +10 -0
- package/dist/def/pre-publish.d.ts +88 -0
- package/dist/def/pre-publish.js +56 -0
- package/dist/def/rename.d.ts +100 -0
- package/dist/def/rename.js +58 -0
- package/dist/def/universalize.d.ts +41 -0
- package/dist/def/universalize.js +33 -0
- package/dist/def/version.d.ts +41 -0
- package/dist/def/version.js +33 -0
- package/dist/index.cjs +20641 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.js +30 -0
- package/dist/utils/__tests__/target.spec.d.ts +1 -0
- package/dist/utils/__tests__/target.spec.js +10 -0
- package/dist/utils/__tests__/typegen.spec.d.ts +1 -0
- package/dist/utils/__tests__/typegen.spec.js +37 -0
- package/dist/utils/__tests__/version.spec.d.ts +1 -0
- package/dist/utils/__tests__/version.spec.js +5 -0
- package/dist/utils/cargo.d.ts +1 -0
- package/dist/utils/cargo.js +33 -0
- package/dist/utils/ci.d.ts +11 -0
- package/dist/utils/ci.js +86 -0
- package/dist/utils/config.d.ts +65 -0
- package/dist/utils/config.js +42 -0
- package/dist/utils/index.d.ts +9 -0
- package/dist/utils/index.js +9 -0
- package/dist/utils/log.d.ts +10 -0
- package/dist/utils/log.js +14 -0
- package/dist/utils/metadata.d.ts +24 -0
- package/dist/utils/metadata.js +19 -0
- package/dist/utils/misc.d.ts +13 -0
- package/dist/utils/misc.js +35 -0
- package/dist/utils/target.d.ts +30 -0
- package/dist/utils/target.js +109 -0
- package/dist/utils/typegen.d.ts +3 -0
- package/dist/utils/typegen.js +158 -0
- package/dist/utils/version.d.ts +11 -0
- package/dist/utils/version.js +59 -0
- package/package.json +63 -27
- package/src/api/artifacts.ts +93 -0
- package/src/api/build.ts +549 -0
- package/src/api/create-npm-dirs.ts +105 -0
- package/src/api/new.ts +206 -0
- package/src/api/pre-publish.ts +216 -0
- package/src/api/rename.ts +51 -0
- package/src/api/templates/.gitignore.ts +198 -0
- package/src/api/templates/.npmignore.ts +14 -0
- package/src/api/templates/build.rs.ts +4 -0
- package/src/api/templates/cargo.toml.ts +35 -0
- package/src/api/templates/ci-template.ts +566 -0
- package/src/api/templates/ci.yml.ts +116 -0
- package/src/api/templates/index.ts +8 -0
- package/src/api/templates/js-binding.ts +130 -0
- package/src/api/templates/lib.rs.ts +10 -0
- package/src/api/templates/package.json.ts +44 -0
- package/src/api/universalize.ts +76 -0
- package/src/api/version.ts +26 -0
- package/src/cli.ts +29 -0
- package/src/commands/artifacts.ts +23 -0
- package/src/commands/build.ts +42 -0
- package/src/commands/create-npm-dirs.ts +8 -0
- package/src/commands/help.ts +13 -0
- package/src/commands/new.ts +138 -0
- package/src/commands/pre-publish.ts +9 -0
- package/src/commands/rename.ts +8 -0
- package/src/commands/universalize.ts +8 -0
- package/src/commands/version.ts +8 -0
- package/src/def/artifacts.ts +79 -0
- package/src/def/build.ts +242 -0
- package/src/def/create-npm-dirs.ts +79 -0
- package/src/def/new.ts +144 -0
- package/src/def/pre-publish.ts +120 -0
- package/src/def/rename.ts +122 -0
- package/src/def/universalize.ts +66 -0
- package/src/def/version.ts +65 -0
- package/src/index.ts +31 -0
- package/src/utils/__tests__/__fixtures__/napi_type_def +201 -0
- package/src/utils/__tests__/__snapshots__/target.spec.ts.md +110 -0
- package/src/utils/__tests__/__snapshots__/target.spec.ts.snap +0 -0
- package/src/utils/__tests__/__snapshots__/typegen.spec.ts.md +618 -0
- package/src/utils/__tests__/__snapshots__/typegen.spec.ts.snap +0 -0
- package/src/utils/__tests__/__snapshots__/version.spec.ts.md +20 -0
- package/src/utils/__tests__/__snapshots__/version.spec.ts.snap +0 -0
- package/src/utils/__tests__/target.spec.ts +19 -0
- package/src/utils/__tests__/typegen.spec.ts +49 -0
- package/src/utils/__tests__/version.spec.ts +13 -0
- package/src/utils/cargo.ts +35 -0
- package/src/utils/ci.ts +102 -0
- package/src/utils/config.ts +123 -0
- package/src/utils/index.ts +9 -0
- package/src/utils/log.ts +34 -0
- package/src/utils/metadata.ts +59 -0
- package/src/utils/misc.ts +45 -0
- package/src/utils/target.ts +145 -0
- package/src/utils/typegen.ts +193 -0
- package/src/utils/version.ts +76 -0
- package/scripts/index.js +0 -153779
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Update package.json and copy addons into per platform packages
|
|
3
|
+
*/
|
|
4
|
+
export interface PrePublishOptions {
|
|
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 the npm packages put
|
|
19
|
+
*
|
|
20
|
+
* @default 'npm'
|
|
21
|
+
*/
|
|
22
|
+
npmDir?: string;
|
|
23
|
+
/**
|
|
24
|
+
* git tag style, `npm` or `lerna`
|
|
25
|
+
*
|
|
26
|
+
* @default 'lerna'
|
|
27
|
+
*/
|
|
28
|
+
tagStyle?: 'npm' | 'lerna';
|
|
29
|
+
/**
|
|
30
|
+
* Whether create GitHub release
|
|
31
|
+
*
|
|
32
|
+
* @default true
|
|
33
|
+
*/
|
|
34
|
+
ghRelease?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* GitHub release name
|
|
37
|
+
*/
|
|
38
|
+
ghReleaseName?: string;
|
|
39
|
+
/**
|
|
40
|
+
* Existing GitHub release id
|
|
41
|
+
*/
|
|
42
|
+
ghReleaseId?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Dry run without touching file system
|
|
45
|
+
*
|
|
46
|
+
* @default false
|
|
47
|
+
*/
|
|
48
|
+
dryRun?: boolean;
|
|
49
|
+
}
|
|
50
|
+
export declare function applyDefaultPrePublishOptions(options: PrePublishOptions): {
|
|
51
|
+
cwd: string;
|
|
52
|
+
packageJsonPath: string;
|
|
53
|
+
npmDir: string;
|
|
54
|
+
tagStyle: string;
|
|
55
|
+
ghRelease: boolean;
|
|
56
|
+
/**
|
|
57
|
+
* GitHub release name
|
|
58
|
+
*/
|
|
59
|
+
ghReleaseName?: string | undefined;
|
|
60
|
+
/**
|
|
61
|
+
* Existing GitHub release id
|
|
62
|
+
*/
|
|
63
|
+
ghReleaseId?: string | undefined;
|
|
64
|
+
dryRun: boolean;
|
|
65
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// This file is generated by codegen/index.ts
|
|
2
|
+
// Do not edit this file manually
|
|
3
|
+
export function applyDefaultPrePublishOptions(options) {
|
|
4
|
+
return {
|
|
5
|
+
cwd: process.cwd(),
|
|
6
|
+
packageJsonPath: 'package.json',
|
|
7
|
+
npmDir: 'npm',
|
|
8
|
+
tagStyle: 'lerna',
|
|
9
|
+
ghRelease: true,
|
|
10
|
+
dryRun: false,
|
|
11
|
+
...options,
|
|
12
|
+
};
|
|
13
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Rename the napi-rs project
|
|
3
|
+
*/
|
|
4
|
+
export interface RenameOptions {
|
|
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 the npm packages put
|
|
19
|
+
*
|
|
20
|
+
* @default 'npm'
|
|
21
|
+
*/
|
|
22
|
+
npmDir?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The new name of the project
|
|
25
|
+
*/
|
|
26
|
+
name?: string;
|
|
27
|
+
/**
|
|
28
|
+
* The new binary name *.node files
|
|
29
|
+
*/
|
|
30
|
+
binaryName?: string;
|
|
31
|
+
/**
|
|
32
|
+
* The new package name of the project
|
|
33
|
+
*/
|
|
34
|
+
packageName?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Path to `Cargo.toml`
|
|
37
|
+
*
|
|
38
|
+
* @default 'Cargo.toml'
|
|
39
|
+
*/
|
|
40
|
+
manifestPath?: string;
|
|
41
|
+
/**
|
|
42
|
+
* The new repository of the project
|
|
43
|
+
*/
|
|
44
|
+
repository?: string;
|
|
45
|
+
/**
|
|
46
|
+
* The new description of the project
|
|
47
|
+
*/
|
|
48
|
+
description?: string;
|
|
49
|
+
}
|
|
50
|
+
export declare function applyDefaultRenameOptions(options: RenameOptions): {
|
|
51
|
+
cwd: string;
|
|
52
|
+
packageJsonPath: string;
|
|
53
|
+
npmDir: string;
|
|
54
|
+
/**
|
|
55
|
+
* The new name of the project
|
|
56
|
+
*/
|
|
57
|
+
name?: string | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* The new binary name *.node files
|
|
60
|
+
*/
|
|
61
|
+
binaryName?: string | undefined;
|
|
62
|
+
/**
|
|
63
|
+
* The new package name of the project
|
|
64
|
+
*/
|
|
65
|
+
packageName?: string | undefined;
|
|
66
|
+
manifestPath: string;
|
|
67
|
+
/**
|
|
68
|
+
* The new repository of the project
|
|
69
|
+
*/
|
|
70
|
+
repository?: string | undefined;
|
|
71
|
+
/**
|
|
72
|
+
* The new description of the project
|
|
73
|
+
*/
|
|
74
|
+
description?: string | undefined;
|
|
75
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// This file is generated by codegen/index.ts
|
|
2
|
+
// Do not edit this file manually
|
|
3
|
+
export function applyDefaultRenameOptions(options) {
|
|
4
|
+
return {
|
|
5
|
+
cwd: process.cwd(),
|
|
6
|
+
packageJsonPath: 'package.json',
|
|
7
|
+
npmDir: 'npm',
|
|
8
|
+
manifestPath: 'Cargo.toml',
|
|
9
|
+
...options,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Combile built binaries into one universal binary
|
|
3
|
+
*/
|
|
4
|
+
export interface UniversalizeOptions {
|
|
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
|
+
export declare function applyDefaultUniversalizeOptions(options: UniversalizeOptions): {
|
|
25
|
+
cwd: string;
|
|
26
|
+
packageJsonPath: string;
|
|
27
|
+
outputDir: string;
|
|
28
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Update version in created npm packages
|
|
3
|
+
*/
|
|
4
|
+
export interface VersionOptions {
|
|
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 the npm packages put
|
|
19
|
+
*
|
|
20
|
+
* @default 'npm'
|
|
21
|
+
*/
|
|
22
|
+
npmDir?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare function applyDefaultVersionOptions(options: VersionOptions): {
|
|
25
|
+
cwd: string;
|
|
26
|
+
packageJsonPath: string;
|
|
27
|
+
npmDir: string;
|
|
28
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
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
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Update package.json and copy addons into per platform packages
|
|
26
|
+
*/
|
|
27
|
+
export interface PrePublishOptions {
|
|
28
|
+
/**
|
|
29
|
+
* The working directory of where napi command will be executed in, all other paths options are relative to this path
|
|
30
|
+
*
|
|
31
|
+
* @default process.cwd()
|
|
32
|
+
*/
|
|
33
|
+
cwd?: string;
|
|
34
|
+
/**
|
|
35
|
+
* Path to `package.json`
|
|
36
|
+
*
|
|
37
|
+
* @default 'package.json'
|
|
38
|
+
*/
|
|
39
|
+
packageJsonPath?: string;
|
|
40
|
+
/**
|
|
41
|
+
* Path to the folder where the npm packages put
|
|
42
|
+
*
|
|
43
|
+
* @default 'npm'
|
|
44
|
+
*/
|
|
45
|
+
npmDir?: string;
|
|
46
|
+
/**
|
|
47
|
+
* git tag style, `npm` or `lerna`
|
|
48
|
+
*
|
|
49
|
+
* @default 'lerna'
|
|
50
|
+
*/
|
|
51
|
+
tagStyle?: 'npm' | 'lerna';
|
|
52
|
+
/**
|
|
53
|
+
* Whether create GitHub release
|
|
54
|
+
*
|
|
55
|
+
* @default true
|
|
56
|
+
*/
|
|
57
|
+
ghRelease?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* GitHub release name
|
|
60
|
+
*/
|
|
61
|
+
ghReleaseName?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Existing GitHub release id
|
|
64
|
+
*/
|
|
65
|
+
ghReleaseId?: string;
|
|
66
|
+
/**
|
|
67
|
+
* Dry run without touching file system
|
|
68
|
+
*
|
|
69
|
+
* @default false
|
|
70
|
+
*/
|
|
71
|
+
dryRun?: boolean;
|
|
72
|
+
}
|
|
73
|
+
export declare function applyDefaultPrePublishOptions(options: PrePublishOptions): {
|
|
74
|
+
cwd: string;
|
|
75
|
+
packageJsonPath: string;
|
|
76
|
+
npmDir: string;
|
|
77
|
+
tagStyle: string;
|
|
78
|
+
ghRelease: boolean;
|
|
79
|
+
/**
|
|
80
|
+
* GitHub release name
|
|
81
|
+
*/
|
|
82
|
+
ghReleaseName?: string | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* Existing GitHub release id
|
|
85
|
+
*/
|
|
86
|
+
ghReleaseId?: string | undefined;
|
|
87
|
+
dryRun: boolean;
|
|
88
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
}
|
|
46
|
+
export function applyDefaultPrePublishOptions(options) {
|
|
47
|
+
return {
|
|
48
|
+
cwd: process.cwd(),
|
|
49
|
+
packageJsonPath: 'package.json',
|
|
50
|
+
npmDir: 'npm',
|
|
51
|
+
tagStyle: 'lerna',
|
|
52
|
+
ghRelease: true,
|
|
53
|
+
dryRun: false,
|
|
54
|
+
...options,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
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
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Rename the napi-rs project
|
|
28
|
+
*/
|
|
29
|
+
export interface RenameOptions {
|
|
30
|
+
/**
|
|
31
|
+
* The working directory of where napi command will be executed in, all other paths options are relative to this path
|
|
32
|
+
*
|
|
33
|
+
* @default process.cwd()
|
|
34
|
+
*/
|
|
35
|
+
cwd?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Path to `package.json`
|
|
38
|
+
*
|
|
39
|
+
* @default 'package.json'
|
|
40
|
+
*/
|
|
41
|
+
packageJsonPath?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Path to the folder where the npm packages put
|
|
44
|
+
*
|
|
45
|
+
* @default 'npm'
|
|
46
|
+
*/
|
|
47
|
+
npmDir?: string;
|
|
48
|
+
/**
|
|
49
|
+
* The new name of the project
|
|
50
|
+
*/
|
|
51
|
+
name?: string;
|
|
52
|
+
/**
|
|
53
|
+
* The new binary name *.node files
|
|
54
|
+
*/
|
|
55
|
+
binaryName?: string;
|
|
56
|
+
/**
|
|
57
|
+
* The new package name of the project
|
|
58
|
+
*/
|
|
59
|
+
packageName?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Path to `Cargo.toml`
|
|
62
|
+
*
|
|
63
|
+
* @default 'Cargo.toml'
|
|
64
|
+
*/
|
|
65
|
+
manifestPath?: string;
|
|
66
|
+
/**
|
|
67
|
+
* The new repository of the project
|
|
68
|
+
*/
|
|
69
|
+
repository?: string;
|
|
70
|
+
/**
|
|
71
|
+
* The new description of the project
|
|
72
|
+
*/
|
|
73
|
+
description?: string;
|
|
74
|
+
}
|
|
75
|
+
export declare function applyDefaultRenameOptions(options: RenameOptions): {
|
|
76
|
+
cwd: string;
|
|
77
|
+
packageJsonPath: string;
|
|
78
|
+
npmDir: string;
|
|
79
|
+
/**
|
|
80
|
+
* The new name of the project
|
|
81
|
+
*/
|
|
82
|
+
name?: string | undefined;
|
|
83
|
+
/**
|
|
84
|
+
* The new binary name *.node files
|
|
85
|
+
*/
|
|
86
|
+
binaryName?: string | undefined;
|
|
87
|
+
/**
|
|
88
|
+
* The new package name of the project
|
|
89
|
+
*/
|
|
90
|
+
packageName?: string | undefined;
|
|
91
|
+
manifestPath: string;
|
|
92
|
+
/**
|
|
93
|
+
* The new repository of the project
|
|
94
|
+
*/
|
|
95
|
+
repository?: string | undefined;
|
|
96
|
+
/**
|
|
97
|
+
* The new description of the project
|
|
98
|
+
*/
|
|
99
|
+
description?: string | undefined;
|
|
100
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
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
|
+
}
|
|
50
|
+
export function applyDefaultRenameOptions(options) {
|
|
51
|
+
return {
|
|
52
|
+
cwd: process.cwd(),
|
|
53
|
+
packageJsonPath: 'package.json',
|
|
54
|
+
npmDir: 'npm',
|
|
55
|
+
manifestPath: 'Cargo.toml',
|
|
56
|
+
...options,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Combile built binaries into one universal binary
|
|
16
|
+
*/
|
|
17
|
+
export interface UniversalizeOptions {
|
|
18
|
+
/**
|
|
19
|
+
* The working directory of where napi command will be executed in, all other paths options are relative to this path
|
|
20
|
+
*
|
|
21
|
+
* @default process.cwd()
|
|
22
|
+
*/
|
|
23
|
+
cwd?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Path to `package.json`
|
|
26
|
+
*
|
|
27
|
+
* @default 'package.json'
|
|
28
|
+
*/
|
|
29
|
+
packageJsonPath?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Path to the folder where all built `.node` files put, same as `--output-dir` of build command
|
|
32
|
+
*
|
|
33
|
+
* @default './'
|
|
34
|
+
*/
|
|
35
|
+
outputDir?: string;
|
|
36
|
+
}
|
|
37
|
+
export declare function applyDefaultUniversalizeOptions(options: UniversalizeOptions): {
|
|
38
|
+
cwd: string;
|
|
39
|
+
packageJsonPath: string;
|
|
40
|
+
outputDir: string;
|
|
41
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
}
|
|
26
|
+
export function applyDefaultUniversalizeOptions(options) {
|
|
27
|
+
return {
|
|
28
|
+
cwd: process.cwd(),
|
|
29
|
+
packageJsonPath: 'package.json',
|
|
30
|
+
outputDir: './',
|
|
31
|
+
...options,
|
|
32
|
+
};
|
|
33
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
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
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Update version in created npm packages
|
|
16
|
+
*/
|
|
17
|
+
export interface VersionOptions {
|
|
18
|
+
/**
|
|
19
|
+
* The working directory of where napi command will be executed in, all other paths options are relative to this path
|
|
20
|
+
*
|
|
21
|
+
* @default process.cwd()
|
|
22
|
+
*/
|
|
23
|
+
cwd?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Path to `package.json`
|
|
26
|
+
*
|
|
27
|
+
* @default 'package.json'
|
|
28
|
+
*/
|
|
29
|
+
packageJsonPath?: string;
|
|
30
|
+
/**
|
|
31
|
+
* Path to the folder where the npm packages put
|
|
32
|
+
*
|
|
33
|
+
* @default 'npm'
|
|
34
|
+
*/
|
|
35
|
+
npmDir?: string;
|
|
36
|
+
}
|
|
37
|
+
export declare function applyDefaultVersionOptions(options: VersionOptions): {
|
|
38
|
+
cwd: string;
|
|
39
|
+
packageJsonPath: string;
|
|
40
|
+
npmDir: string;
|
|
41
|
+
};
|