@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.
Files changed (194) hide show
  1. package/README.md +17 -78
  2. package/cli.mjs +12 -0
  3. package/dist/api/artifacts.d.ts +2 -0
  4. package/dist/api/artifacts.js +50 -0
  5. package/dist/api/build.d.ts +14 -0
  6. package/dist/api/build.js +404 -0
  7. package/dist/api/create-npm-dirs.d.ts +2 -0
  8. package/dist/api/create-npm-dirs.js +63 -0
  9. package/dist/api/new.d.ts +4 -0
  10. package/dist/api/new.js +154 -0
  11. package/dist/api/pre-publish.d.ts +2 -0
  12. package/dist/api/pre-publish.js +157 -0
  13. package/dist/api/rename.d.ts +2 -0
  14. package/dist/api/rename.js +28 -0
  15. package/dist/api/templates/.gitignore.d.ts +1 -0
  16. package/dist/api/templates/.gitignore.js +198 -0
  17. package/dist/api/templates/.npmignore.d.ts +1 -0
  18. package/dist/api/templates/.npmignore.js +14 -0
  19. package/dist/api/templates/build.rs.d.ts +1 -0
  20. package/dist/api/templates/build.rs.js +4 -0
  21. package/dist/api/templates/cargo.toml.d.ts +6 -0
  22. package/dist/api/templates/cargo.toml.js +25 -0
  23. package/dist/api/templates/ci-template.d.ts +1 -0
  24. package/dist/api/templates/ci-template.js +566 -0
  25. package/dist/api/templates/ci.yml.d.ts +1 -0
  26. package/dist/api/templates/ci.yml.js +92 -0
  27. package/dist/api/templates/index.d.ts +8 -0
  28. package/dist/api/templates/index.js +8 -0
  29. package/dist/api/templates/js-binding.d.ts +1 -0
  30. package/dist/api/templates/js-binding.js +124 -0
  31. package/dist/api/templates/lib.rs.d.ts +1 -0
  32. package/dist/api/templates/lib.rs.js +10 -0
  33. package/dist/api/templates/package.json.d.ts +8 -0
  34. package/dist/api/templates/package.json.js +30 -0
  35. package/dist/api/universalize.d.ts +2 -0
  36. package/dist/api/universalize.js +38 -0
  37. package/dist/api/version.d.ts +2 -0
  38. package/dist/api/version.js +16 -0
  39. package/dist/cli.d.ts +1 -0
  40. package/dist/cli.js +25 -0
  41. package/dist/commands/artifacts.d.ts +6 -0
  42. package/dist/commands/artifacts.js +19 -0
  43. package/dist/commands/build.d.ts +6 -0
  44. package/dist/commands/build.js +34 -0
  45. package/dist/commands/create-npm-dirs.d.ts +4 -0
  46. package/dist/commands/create-npm-dirs.js +7 -0
  47. package/dist/commands/help.d.ts +10 -0
  48. package/dist/commands/help.js +12 -0
  49. package/dist/commands/new.d.ts +12 -0
  50. package/dist/commands/new.js +112 -0
  51. package/dist/commands/pre-publish.d.ts +4 -0
  52. package/dist/commands/pre-publish.js +8 -0
  53. package/dist/commands/rename.d.ts +4 -0
  54. package/dist/commands/rename.js +7 -0
  55. package/dist/commands/universalize.d.ts +4 -0
  56. package/dist/commands/universalize.js +7 -0
  57. package/dist/commands/version.d.ts +4 -0
  58. package/dist/commands/version.js +7 -0
  59. package/dist/def/artifacts.d.ts +50 -0
  60. package/dist/def/artifacts.js +38 -0
  61. package/dist/def/build.d.ts +150 -0
  62. package/dist/def/build.js +105 -0
  63. package/dist/def/commands/artifacts.d.ts +15 -0
  64. package/dist/def/commands/artifacts.js +29 -0
  65. package/dist/def/commands/build.d.ts +53 -0
  66. package/dist/def/commands/build.js +105 -0
  67. package/dist/def/commands/create-npm-dirs.d.ts +15 -0
  68. package/dist/def/commands/create-npm-dirs.js +29 -0
  69. package/dist/def/commands/new.d.ts +27 -0
  70. package/dist/def/commands/new.js +53 -0
  71. package/dist/def/commands/pre-publish.d.ts +23 -0
  72. package/dist/def/commands/pre-publish.js +45 -0
  73. package/dist/def/commands/rename.d.ts +25 -0
  74. package/dist/def/commands/rename.js +49 -0
  75. package/dist/def/commands/universalize.d.ts +13 -0
  76. package/dist/def/commands/universalize.js +25 -0
  77. package/dist/def/commands/version.d.ts +13 -0
  78. package/dist/def/commands/version.js +25 -0
  79. package/dist/def/create-npm-dirs.d.ts +50 -0
  80. package/dist/def/create-npm-dirs.js +38 -0
  81. package/dist/def/new.d.ts +106 -0
  82. package/dist/def/new.js +66 -0
  83. package/dist/def/options/artifacts.d.ts +35 -0
  84. package/dist/def/options/artifacts.js +11 -0
  85. package/dist/def/options/build.d.ts +97 -0
  86. package/dist/def/options/build.js +3 -0
  87. package/dist/def/options/create-npm-dirs.d.ts +35 -0
  88. package/dist/def/options/create-npm-dirs.js +11 -0
  89. package/dist/def/options/new.d.ts +79 -0
  90. package/dist/def/options/new.js +15 -0
  91. package/dist/def/options/pre-publish.d.ts +65 -0
  92. package/dist/def/options/pre-publish.js +13 -0
  93. package/dist/def/options/rename.d.ts +75 -0
  94. package/dist/def/options/rename.js +11 -0
  95. package/dist/def/options/universalize.d.ts +28 -0
  96. package/dist/def/options/universalize.js +10 -0
  97. package/dist/def/options/version.d.ts +28 -0
  98. package/dist/def/options/version.js +10 -0
  99. package/dist/def/pre-publish.d.ts +88 -0
  100. package/dist/def/pre-publish.js +56 -0
  101. package/dist/def/rename.d.ts +100 -0
  102. package/dist/def/rename.js +58 -0
  103. package/dist/def/universalize.d.ts +41 -0
  104. package/dist/def/universalize.js +33 -0
  105. package/dist/def/version.d.ts +41 -0
  106. package/dist/def/version.js +33 -0
  107. package/dist/index.cjs +20641 -0
  108. package/dist/index.d.ts +30 -0
  109. package/dist/index.js +30 -0
  110. package/dist/utils/__tests__/target.spec.d.ts +1 -0
  111. package/dist/utils/__tests__/target.spec.js +10 -0
  112. package/dist/utils/__tests__/typegen.spec.d.ts +1 -0
  113. package/dist/utils/__tests__/typegen.spec.js +37 -0
  114. package/dist/utils/__tests__/version.spec.d.ts +1 -0
  115. package/dist/utils/__tests__/version.spec.js +5 -0
  116. package/dist/utils/cargo.d.ts +1 -0
  117. package/dist/utils/cargo.js +33 -0
  118. package/dist/utils/ci.d.ts +11 -0
  119. package/dist/utils/ci.js +86 -0
  120. package/dist/utils/config.d.ts +65 -0
  121. package/dist/utils/config.js +42 -0
  122. package/dist/utils/index.d.ts +9 -0
  123. package/dist/utils/index.js +9 -0
  124. package/dist/utils/log.d.ts +10 -0
  125. package/dist/utils/log.js +14 -0
  126. package/dist/utils/metadata.d.ts +24 -0
  127. package/dist/utils/metadata.js +19 -0
  128. package/dist/utils/misc.d.ts +13 -0
  129. package/dist/utils/misc.js +35 -0
  130. package/dist/utils/target.d.ts +30 -0
  131. package/dist/utils/target.js +109 -0
  132. package/dist/utils/typegen.d.ts +3 -0
  133. package/dist/utils/typegen.js +158 -0
  134. package/dist/utils/version.d.ts +11 -0
  135. package/dist/utils/version.js +59 -0
  136. package/package.json +63 -27
  137. package/src/api/artifacts.ts +93 -0
  138. package/src/api/build.ts +549 -0
  139. package/src/api/create-npm-dirs.ts +105 -0
  140. package/src/api/new.ts +206 -0
  141. package/src/api/pre-publish.ts +216 -0
  142. package/src/api/rename.ts +51 -0
  143. package/src/api/templates/.gitignore.ts +198 -0
  144. package/src/api/templates/.npmignore.ts +14 -0
  145. package/src/api/templates/build.rs.ts +4 -0
  146. package/src/api/templates/cargo.toml.ts +35 -0
  147. package/src/api/templates/ci-template.ts +566 -0
  148. package/src/api/templates/ci.yml.ts +116 -0
  149. package/src/api/templates/index.ts +8 -0
  150. package/src/api/templates/js-binding.ts +130 -0
  151. package/src/api/templates/lib.rs.ts +10 -0
  152. package/src/api/templates/package.json.ts +44 -0
  153. package/src/api/universalize.ts +76 -0
  154. package/src/api/version.ts +26 -0
  155. package/src/cli.ts +29 -0
  156. package/src/commands/artifacts.ts +23 -0
  157. package/src/commands/build.ts +42 -0
  158. package/src/commands/create-npm-dirs.ts +8 -0
  159. package/src/commands/help.ts +13 -0
  160. package/src/commands/new.ts +138 -0
  161. package/src/commands/pre-publish.ts +9 -0
  162. package/src/commands/rename.ts +8 -0
  163. package/src/commands/universalize.ts +8 -0
  164. package/src/commands/version.ts +8 -0
  165. package/src/def/artifacts.ts +79 -0
  166. package/src/def/build.ts +242 -0
  167. package/src/def/create-npm-dirs.ts +79 -0
  168. package/src/def/new.ts +144 -0
  169. package/src/def/pre-publish.ts +120 -0
  170. package/src/def/rename.ts +122 -0
  171. package/src/def/universalize.ts +66 -0
  172. package/src/def/version.ts +65 -0
  173. package/src/index.ts +31 -0
  174. package/src/utils/__tests__/__fixtures__/napi_type_def +201 -0
  175. package/src/utils/__tests__/__snapshots__/target.spec.ts.md +110 -0
  176. package/src/utils/__tests__/__snapshots__/target.spec.ts.snap +0 -0
  177. package/src/utils/__tests__/__snapshots__/typegen.spec.ts.md +618 -0
  178. package/src/utils/__tests__/__snapshots__/typegen.spec.ts.snap +0 -0
  179. package/src/utils/__tests__/__snapshots__/version.spec.ts.md +20 -0
  180. package/src/utils/__tests__/__snapshots__/version.spec.ts.snap +0 -0
  181. package/src/utils/__tests__/target.spec.ts +19 -0
  182. package/src/utils/__tests__/typegen.spec.ts +49 -0
  183. package/src/utils/__tests__/version.spec.ts +13 -0
  184. package/src/utils/cargo.ts +35 -0
  185. package/src/utils/ci.ts +102 -0
  186. package/src/utils/config.ts +123 -0
  187. package/src/utils/index.ts +9 -0
  188. package/src/utils/log.ts +34 -0
  189. package/src/utils/metadata.ts +59 -0
  190. package/src/utils/misc.ts +45 -0
  191. package/src/utils/target.ts +145 -0
  192. package/src/utils/typegen.ts +193 -0
  193. package/src/utils/version.ts +76 -0
  194. 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,10 @@
1
+ // This file is generated by codegen/index.ts
2
+ // Do not edit this file manually
3
+ export function applyDefaultUniversalizeOptions(options) {
4
+ return {
5
+ cwd: process.cwd(),
6
+ packageJsonPath: 'package.json',
7
+ outputDir: './',
8
+ ...options,
9
+ };
10
+ }
@@ -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,10 @@
1
+ // This file is generated by codegen/index.ts
2
+ // Do not edit this file manually
3
+ export function applyDefaultVersionOptions(options) {
4
+ return {
5
+ cwd: process.cwd(),
6
+ packageJsonPath: 'package.json',
7
+ npmDir: 'npm',
8
+ ...options,
9
+ };
10
+ }
@@ -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
+ };