@napi-rs/cli 3.0.0-alpha.9 → 3.0.0-alpha.91

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/cli.mjs +1 -1
  2. package/dist/api/__tests__/new.spec.d.ts +1 -0
  3. package/dist/api/build.d.ts +1 -1
  4. package/dist/api/templates/ci-template.d.ts +3 -1
  5. package/dist/api/templates/ci.yml.d.ts +3 -1
  6. package/dist/api/templates/js-binding.d.ts +1 -0
  7. package/dist/api/templates/load-wasi-template.d.ts +2 -0
  8. package/dist/api/templates/package.json.d.ts +9 -2
  9. package/dist/api/templates/wasi-worker-template.d.ts +2 -0
  10. package/dist/cli.js +3867 -15
  11. package/dist/def/artifacts.d.ts +21 -1
  12. package/dist/def/build.d.ts +149 -4
  13. package/dist/def/create-npm-dirs.d.ts +10 -0
  14. package/dist/def/new.d.ts +25 -7
  15. package/dist/def/pre-publish.d.ts +12 -2
  16. package/dist/def/rename.d.ts +16 -6
  17. package/dist/def/universalize.d.ts +10 -0
  18. package/dist/def/version.d.ts +10 -0
  19. package/dist/index.cjs +9946 -15669
  20. package/dist/index.js +3618 -32
  21. package/dist/utils/__tests__/config.spec.d.ts +1 -0
  22. package/dist/utils/config.d.ts +48 -4
  23. package/dist/utils/index.d.ts +1 -1
  24. package/dist/utils/metadata.d.ts +13 -1
  25. package/dist/utils/misc.d.ts +3 -3
  26. package/dist/utils/read-config.d.ts +7 -0
  27. package/dist/utils/target.d.ts +7 -5
  28. package/dist/utils/typegen.d.ts +1 -1
  29. package/dist/utils/version.d.ts +2 -1
  30. package/package.json +38 -34
  31. package/src/api/__tests__/new.spec.ts +429 -0
  32. package/src/api/artifacts.ts +81 -9
  33. package/src/api/build.ts +498 -149
  34. package/src/api/create-npm-dirs.ts +57 -9
  35. package/src/api/new.ts +389 -122
  36. package/src/api/pre-publish.ts +13 -7
  37. package/src/api/rename.ts +103 -17
  38. package/src/api/templates/cargo.toml.ts +1 -0
  39. package/src/api/templates/ci-template.ts +150 -125
  40. package/src/api/templates/ci.yml.ts +27 -6
  41. package/src/api/templates/js-binding.ts +148 -220
  42. package/src/api/templates/load-wasi-template.ts +182 -0
  43. package/src/api/templates/package.json.ts +47 -5
  44. package/src/api/templates/wasi-worker-template.ts +122 -0
  45. package/src/api/universalize.ts +13 -8
  46. package/src/api/version.ts +5 -2
  47. package/src/commands/artifacts.ts +2 -2
  48. package/src/commands/build.ts +1 -1
  49. package/src/commands/new.ts +46 -45
  50. package/src/def/artifacts.ts +22 -3
  51. package/src/def/build.ts +55 -8
  52. package/src/def/create-npm-dirs.ts +9 -0
  53. package/src/def/new.ts +28 -3
  54. package/src/def/pre-publish.ts +12 -3
  55. package/src/def/rename.ts +11 -2
  56. package/src/def/universalize.ts +9 -0
  57. package/src/def/version.ts +9 -0
  58. package/src/utils/__tests__/__fixtures__/napi_type_def +130 -130
  59. package/src/utils/__tests__/__snapshots__/config.spec.ts.md +97 -0
  60. package/src/utils/__tests__/__snapshots__/config.spec.ts.snap +0 -0
  61. package/src/utils/__tests__/__snapshots__/target.spec.ts.md +28 -0
  62. package/src/utils/__tests__/__snapshots__/target.spec.ts.snap +0 -0
  63. package/src/utils/__tests__/__snapshots__/typegen.spec.ts.md +316 -332
  64. package/src/utils/__tests__/__snapshots__/typegen.spec.ts.snap +0 -0
  65. package/src/utils/__tests__/__snapshots__/version.spec.ts.md +8 -7
  66. package/src/utils/__tests__/__snapshots__/version.spec.ts.snap +0 -0
  67. package/src/utils/__tests__/config.spec.ts +81 -0
  68. package/src/utils/cargo.ts +2 -2
  69. package/src/utils/config.ts +110 -9
  70. package/src/utils/index.ts +1 -1
  71. package/src/utils/log.ts +1 -1
  72. package/src/utils/metadata.ts +52 -14
  73. package/src/utils/misc.ts +21 -12
  74. package/src/utils/read-config.ts +20 -0
  75. package/src/utils/target.ts +22 -4
  76. package/src/utils/typegen.ts +87 -52
  77. package/src/utils/version.ts +10 -8
  78. package/dist/api/artifacts.js +0 -53
  79. package/dist/api/artifacts.js.map +0 -1
  80. package/dist/api/build.js +0 -498
  81. package/dist/api/build.js.map +0 -1
  82. package/dist/api/create-npm-dirs.js +0 -64
  83. package/dist/api/create-npm-dirs.js.map +0 -1
  84. package/dist/api/load-wasi-template.d.ts +0 -1
  85. package/dist/api/load-wasi-template.js +0 -64
  86. package/dist/api/load-wasi-template.js.map +0 -1
  87. package/dist/api/new.js +0 -155
  88. package/dist/api/new.js.map +0 -1
  89. package/dist/api/pre-publish.js +0 -158
  90. package/dist/api/pre-publish.js.map +0 -1
  91. package/dist/api/rename.js +0 -29
  92. package/dist/api/rename.js.map +0 -1
  93. package/dist/api/templates/.gitignore.js +0 -200
  94. package/dist/api/templates/.gitignore.js.map +0 -1
  95. package/dist/api/templates/.npmignore.js +0 -15
  96. package/dist/api/templates/.npmignore.js.map +0 -1
  97. package/dist/api/templates/build.rs.js +0 -5
  98. package/dist/api/templates/build.rs.js.map +0 -1
  99. package/dist/api/templates/cargo.toml.js +0 -26
  100. package/dist/api/templates/cargo.toml.js.map +0 -1
  101. package/dist/api/templates/ci-template.js +0 -578
  102. package/dist/api/templates/ci-template.js.map +0 -1
  103. package/dist/api/templates/ci.yml.js +0 -99
  104. package/dist/api/templates/ci.yml.js.map +0 -1
  105. package/dist/api/templates/index.js +0 -9
  106. package/dist/api/templates/index.js.map +0 -1
  107. package/dist/api/templates/js-binding.js +0 -293
  108. package/dist/api/templates/js-binding.js.map +0 -1
  109. package/dist/api/templates/lib.rs.js +0 -8
  110. package/dist/api/templates/lib.rs.js.map +0 -1
  111. package/dist/api/templates/package.json.js +0 -32
  112. package/dist/api/templates/package.json.js.map +0 -1
  113. package/dist/api/universalize.js +0 -39
  114. package/dist/api/universalize.js.map +0 -1
  115. package/dist/api/version.js +0 -17
  116. package/dist/api/version.js.map +0 -1
  117. package/dist/api/wasi-worker-template.d.ts +0 -1
  118. package/dist/api/wasi-worker-template.js +0 -53
  119. package/dist/api/wasi-worker-template.js.map +0 -1
  120. package/dist/cli.js.map +0 -1
  121. package/dist/commands/artifacts.js +0 -20
  122. package/dist/commands/artifacts.js.map +0 -1
  123. package/dist/commands/build.js +0 -35
  124. package/dist/commands/build.js.map +0 -1
  125. package/dist/commands/create-npm-dirs.js +0 -8
  126. package/dist/commands/create-npm-dirs.js.map +0 -1
  127. package/dist/commands/help.js +0 -13
  128. package/dist/commands/help.js.map +0 -1
  129. package/dist/commands/new.js +0 -110
  130. package/dist/commands/new.js.map +0 -1
  131. package/dist/commands/pre-publish.js +0 -9
  132. package/dist/commands/pre-publish.js.map +0 -1
  133. package/dist/commands/rename.js +0 -8
  134. package/dist/commands/rename.js.map +0 -1
  135. package/dist/commands/universalize.js +0 -8
  136. package/dist/commands/universalize.js.map +0 -1
  137. package/dist/commands/version.js +0 -8
  138. package/dist/commands/version.js.map +0 -1
  139. package/dist/def/artifacts.js +0 -39
  140. package/dist/def/artifacts.js.map +0 -1
  141. package/dist/def/build.js +0 -118
  142. package/dist/def/build.js.map +0 -1
  143. package/dist/def/create-npm-dirs.js +0 -39
  144. package/dist/def/create-npm-dirs.js.map +0 -1
  145. package/dist/def/new.js +0 -67
  146. package/dist/def/new.js.map +0 -1
  147. package/dist/def/pre-publish.js +0 -57
  148. package/dist/def/pre-publish.js.map +0 -1
  149. package/dist/def/rename.js +0 -59
  150. package/dist/def/rename.js.map +0 -1
  151. package/dist/def/universalize.js +0 -34
  152. package/dist/def/universalize.js.map +0 -1
  153. package/dist/def/version.js +0 -34
  154. package/dist/def/version.js.map +0 -1
  155. package/dist/index.js.map +0 -1
  156. package/dist/utils/__tests__/target.spec.js +0 -11
  157. package/dist/utils/__tests__/target.spec.js.map +0 -1
  158. package/dist/utils/__tests__/typegen.spec.js +0 -42
  159. package/dist/utils/__tests__/typegen.spec.js.map +0 -1
  160. package/dist/utils/__tests__/version.spec.js +0 -6
  161. package/dist/utils/__tests__/version.spec.js.map +0 -1
  162. package/dist/utils/cargo.js +0 -34
  163. package/dist/utils/cargo.js.map +0 -1
  164. package/dist/utils/ci.d.ts +0 -11
  165. package/dist/utils/ci.js +0 -96
  166. package/dist/utils/ci.js.map +0 -1
  167. package/dist/utils/config.js +0 -43
  168. package/dist/utils/config.js.map +0 -1
  169. package/dist/utils/index.js +0 -10
  170. package/dist/utils/index.js.map +0 -1
  171. package/dist/utils/log.js +0 -15
  172. package/dist/utils/log.js.map +0 -1
  173. package/dist/utils/metadata.js +0 -20
  174. package/dist/utils/metadata.js.map +0 -1
  175. package/dist/utils/misc.js +0 -41
  176. package/dist/utils/misc.js.map +0 -1
  177. package/dist/utils/target.js +0 -121
  178. package/dist/utils/target.js.map +0 -1
  179. package/dist/utils/typegen.js +0 -179
  180. package/dist/utils/typegen.js.map +0 -1
  181. package/dist/utils/version.js +0 -60
  182. package/dist/utils/version.js.map +0 -1
  183. package/src/api/load-wasi-template.ts +0 -66
  184. package/src/api/wasi-worker-template.ts +0 -52
  185. package/src/utils/ci.ts +0 -111
@@ -1,110 +0,0 @@
1
- import path from 'path';
2
- import { Option } from 'clipanion';
3
- import inquirer from 'inquirer';
4
- import { newProject } from '../api/new.js';
5
- import { BaseNewCommand } from '../def/new.js';
6
- import { AVAILABLE_TARGETS, debugFactory, DEFAULT_TARGETS, } from '../utils/index.js';
7
- import { napiEngineRequirement } from '../utils/version.js';
8
- const debug = debugFactory('new');
9
- export class NewCommand extends BaseNewCommand {
10
- interactive = Option.Boolean('--interactive,-i', false, {
11
- description: 'Ask project basic information interactively without just using the default.',
12
- });
13
- async execute() {
14
- try {
15
- const options = await this.fetchOptions();
16
- await newProject(options);
17
- return 0;
18
- }
19
- catch (e) {
20
- debug('Failed to create new project');
21
- debug.error(e);
22
- return 1;
23
- }
24
- }
25
- async fetchOptions() {
26
- const cmdOptions = super.getOptions();
27
- if (this.interactive) {
28
- return {
29
- ...cmdOptions,
30
- name: await this.fetchName(path.parse(cmdOptions.path).base),
31
- minNodeApiVersion: await this.fetchNapiVersion(),
32
- targets: await this.fetchTargets(),
33
- license: await this.fetchLicense(),
34
- enableTypeDef: await this.fetchTypeDef(),
35
- enableGithubActions: await this.fetchGithubActions(),
36
- };
37
- }
38
- return cmdOptions;
39
- }
40
- async fetchName(defaultName) {
41
- return (this.$$name ??
42
- (await inquirer
43
- .prompt({
44
- type: 'input',
45
- name: 'name',
46
- message: 'Package name (the name field in your package.json file)',
47
- default: defaultName,
48
- })
49
- .then(({ name }) => name)));
50
- }
51
- async fetchLicense() {
52
- return inquirer
53
- .prompt({
54
- type: 'input',
55
- name: 'license',
56
- message: 'License for open-sourced project',
57
- default: this.license,
58
- })
59
- .then(({ license }) => license);
60
- }
61
- async fetchNapiVersion() {
62
- return inquirer
63
- .prompt({
64
- type: 'list',
65
- name: 'minNodeApiVersion',
66
- message: 'Minimum node-api version (with node version requirement)',
67
- loop: false,
68
- choices: new Array(8).fill(0).map((_, i) => ({
69
- name: `napi${i + 1} (${napiEngineRequirement(i + 1)})`,
70
- value: i + 1,
71
- })),
72
- // choice index
73
- default: this.minNodeApiVersion - 1,
74
- })
75
- .then(({ minNodeApiVersion }) => minNodeApiVersion);
76
- }
77
- async fetchTargets() {
78
- if (this.enableAllTargets) {
79
- return AVAILABLE_TARGETS.concat();
80
- }
81
- const { targets } = await inquirer.prompt({
82
- name: 'targets',
83
- type: 'checkbox',
84
- loop: false,
85
- message: 'Choose target(s) your crate will be compiled to',
86
- default: this.enableDefaultTargets ? DEFAULT_TARGETS : [],
87
- choices: AVAILABLE_TARGETS,
88
- });
89
- return targets;
90
- }
91
- async fetchTypeDef() {
92
- const { enableTypeDef } = await inquirer.prompt({
93
- name: 'enableTypeDef',
94
- type: 'confirm',
95
- message: 'Enable type definition auto-generation',
96
- default: this.enableTypeDef,
97
- });
98
- return enableTypeDef;
99
- }
100
- async fetchGithubActions() {
101
- const { enableGithubActions } = await inquirer.prompt({
102
- name: 'enableGithubActions',
103
- type: 'confirm',
104
- message: 'Enable Github Actions CI',
105
- default: this.enableGithubActions,
106
- });
107
- return enableGithubActions;
108
-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SAClC,CAAC,CAAA;QAEF,OAAO,mBAAmB,CAAA;IAC5B,CAAC;CACF"}
@@ -1,9 +0,0 @@
1
- import { prePublish } from '../api/pre-publish.js';
2
- import { BasePrePublishCommand } from '../def/pre-publish.js';
3
- export class PrePublishCommand extends BasePrePublishCommand {
4
- async execute() {
5
- // @ts-expect-error const 'npm' | 'lerna' to string
6
- await prePublish(this.getOptions());
7
- }
8
- }
9
- //# sourceMappingURL=pre-publish.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"pre-publish.js","sourceRoot":"","sources":["../../src/commands/pre-publish.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAE7D,MAAM,OAAO,iBAAkB,SAAQ,qBAAqB;IAC1D,KAAK,CAAC,OAAO;QACX,mDAAmD;QACnD,MAAM,UAAU,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAA;IACrC,CAAC;CACF"}
@@ -1,8 +0,0 @@
1
- import { renameProject } from '../api/rename.js';
2
- import { BaseRenameCommand } from '../def/rename.js';
3
- export class RenameCommand extends BaseRenameCommand {
4
- async execute() {
5
- await renameProject(this.getOptions());
6
- }
7
- }
8
- //# sourceMappingURL=rename.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"rename.js","sourceRoot":"","sources":["../../src/commands/rename.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAA;AAEpD,MAAM,OAAO,aAAc,SAAQ,iBAAiB;IAClD,KAAK,CAAC,OAAO;QACX,MAAM,aAAa,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAA;IACxC,CAAC;CACF"}
@@ -1,8 +0,0 @@
1
- import { universalizeBinaries } from '../api/universalize.js';
2
- import { BaseUniversalizeCommand } from '../def/universalize.js';
3
- export class UniversalizeCommand extends BaseUniversalizeCommand {
4
- async execute() {
5
- await universalizeBinaries(this.getOptions());
6
- }
7
- }
8
- //# sourceMappingURL=universalize.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"universalize.js","sourceRoot":"","sources":["../../src/commands/universalize.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAC7D,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAA;AAEhE,MAAM,OAAO,mBAAoB,SAAQ,uBAAuB;IAC9D,KAAK,CAAC,OAAO;QACX,MAAM,oBAAoB,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAA;IAC/C,CAAC;CACF"}
@@ -1,8 +0,0 @@
1
- import { version } from '../api/version.js';
2
- import { BaseVersionCommand } from '../def/version.js';
3
- export class VersionCommand extends BaseVersionCommand {
4
- async execute() {
5
- await version(this.getOptions());
6
- }
7
- }
8
- //# sourceMappingURL=version.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/commands/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AAC3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAA;AAEtD,MAAM,OAAO,cAAe,SAAQ,kBAAkB;IACpD,KAAK,CAAC,OAAO;QACX,MAAM,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAA;IAClC,CAAC;CACF"}
@@ -1,39 +0,0 @@
1
- // This file is generated by codegen/index.ts
2
- // Do not edit this file manually
3
- import { Command, Option } from 'clipanion';
4
- export class BaseArtifactsCommand extends Command {
5
- static paths = [['artifacts']];
6
- static usage = Command.Usage({
7
- description: 'Copy artifacts from Github Actions into npm packages and ready to publish',
8
- });
9
- cwd = Option.String('--cwd', process.cwd(), {
10
- description: 'The working directory of where napi command will be executed in, all other paths options are relative to this path',
11
- });
12
- packageJsonPath = Option.String('--package-json-path', 'package.json', {
13
- description: 'Path to `package.json`',
14
- });
15
- outputDir = Option.String('--output-dir,-o', './', {
16
- description: 'Path to the folder where all built `.node` files put, same as `--output-dir` of build command',
17
- });
18
- npmDir = Option.String('--npm-dir', 'npm', {
19
- description: 'Path to the folder where the npm packages put',
20
- });
21
- getOptions() {
22
- return {
23
- cwd: this.cwd,
24
- packageJsonPath: this.packageJsonPath,
25
- outputDir: this.outputDir,
26
- npmDir: this.npmDir,
27
- };
28
- }
29
- }
30
- export function applyDefaultArtifactsOptions(options) {
31
- return {
32
- cwd: process.cwd(),
33
- packageJsonPath: 'package.json',
34
- outputDir: './',
35
- npmDir: 'npm',
36
- ...options,
37
- };
38
- }
39
- //# sourceMappingURL=artifacts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../src/def/artifacts.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,iCAAiC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAE3C,MAAM,OAAgB,oBAAqB,SAAQ,OAAO;IACxD,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,CAAA;IAE9B,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC3B,WAAW,EACT,2EAA2E;KAC9E,CAAC,CAAA;IAEF,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE;QAC1C,WAAW,EACT,oHAAoH;KACvH,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,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,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAA;IACH,CAAC;;AAiCH,MAAM,UAAU,4BAA4B,CAAC,OAAyB;IACpE,OAAO;QACL,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;QAClB,eAAe,EAAE,cAAc;QAC/B,SAAS,EAAE,IAAI;QACf,MAAM,EAAE,KAAK;QACb,GAAG,OAAO;KACX,CAAA;AACH,CAAC"}
package/dist/def/build.js DELETED
@@ -1,118 +0,0 @@
1
- // This file is generated by codegen/index.ts
2
- // Do not edit this file manually
3
- import { Command, Option } from 'clipanion';
4
- export class BaseBuildCommand extends Command {
5
- static paths = [['build']];
6
- static usage = Command.Usage({
7
- description: 'Build the napi-rs project',
8
- });
9
- target = Option.String('--target,-t', {
10
- description: 'Build for the target triple, bypassed to `cargo build --target`',
11
- });
12
- cwd = Option.String('--cwd', {
13
- description: 'The working directory of where napi command will be executed in, all other paths options are relative to this path',
14
- });
15
- manifestPath = Option.String('--manifest-path', {
16
- description: 'Path to `Cargo.toml`',
17
- });
18
- packageJsonPath = Option.String('--package-json-path', {
19
- description: 'Path to `package.json`',
20
- });
21
- targetDir = Option.String('--target-dir', {
22
- description: 'Directory for all crate generated artifacts, see `cargo build --target-dir`',
23
- });
24
- outputDir = Option.String('--output-dir,-o', {
25
- description: 'Path to where all the built files would be put. Default to the crate folder',
26
- });
27
- platform = Option.Boolean('--platform', {
28
- description: 'Add platform triple to the generated nodejs binding file, eg: `[name].linux-x64-gnu.node`',
29
- });
30
- jsPackageName = Option.String('--js-package-name', {
31
- description: 'Package name in generated js binding file. Only works with `--platform` flag',
32
- });
33
- constEnum = Option.Boolean('--const-enum', {
34
- description: 'Whether generate const enum for typescript bindings',
35
- });
36
- jsBinding = Option.String('--js', {
37
- description: 'Path and filename of generated JS binding file. Only works with `--platform` flag. Relative to `--output_dir`.',
38
- });
39
- noJsBinding = Option.Boolean('--no-js', {
40
- description: 'Whether to disable the generation JS binding file. Only works with `--platform` flag.',
41
- });
42
- dts = Option.String('--dts', {
43
- description: 'Path and filename of generated type def file. Relative to `--output_dir`',
44
- });
45
- dtsHeader = Option.String('--dts-header', {
46
- description: 'Custom file header for generated type def file. Only works when `typedef` feature enabled.',
47
- });
48
- noDtsHeader = Option.Boolean('--no-dts-header', {
49
- description: 'Whether to disable the default file header for generated type def file. Only works when `typedef` feature enabled.',
50
- });
51
- strip = Option.Boolean('--strip,-s', {
52
- description: 'Whether strip the library to achieve the minimum file size',
53
- });
54
- release = Option.Boolean('--release,-r', {
55
- description: 'Build in release mode',
56
- });
57
- verbose = Option.Boolean('--verbose,-v', {
58
- description: 'Verbosely log build command trace',
59
- });
60
- bin = Option.String('--bin', {
61
- description: 'Build only the specified binary',
62
- });
63
- package = Option.String('--package,-p', {
64
- description: 'Build the specified library or the one at cwd',
65
- });
66
- profile = Option.String('--profile', {
67
- description: 'Build artifacts with the specified profile',
68
- });
69
- crossCompile = Option.Boolean('--cross-compile,-x', {
70
- description: '[experimental] cross-compile for the specified target with `cargo-xwin` on windows and `cargo-zigbuild` on other platform',
71
- });
72
- useCross = Option.Boolean('--use-cross', {
73
- description: '[experimental] use [cross](https://github.com/cross-rs/cross) instead of `cargo`',
74
- });
75
- watch = Option.Boolean('--watch,-w', {
76
- description: 'watch the crate changes and build continiously with `cargo-watch` crates',
77
- });
78
- features = Option.Array('--features,-F', {
79
- description: 'Space-separated list of features to activate',
80
- });
81
- allFeatures = Option.Boolean('--all-features', {
82
- description: 'Activate all available features',
83
- });
84
- noDefaultFeatures = Option.Boolean('--no-default-features', {
85
- description: 'Do not activate the `default` feature',
86
- });
87
- getOptions() {
88
- return {
89
- target: this.target,
90
- cwd: this.cwd,
91
- manifestPath: this.manifestPath,
92
- packageJsonPath: this.packageJsonPath,
93
- targetDir: this.targetDir,
94
- outputDir: this.outputDir,
95
- platform: this.platform,
96
- jsPackageName: this.jsPackageName,
97
- constEnum: this.constEnum,
98
- jsBinding: this.jsBinding,
99
- noJsBinding: this.noJsBinding,
100
- dts: this.dts,
101
- dtsHeader: this.dtsHeader,
102
- noDtsHeader: this.noDtsHeader,
103
- strip: this.strip,
104
- release: this.release,
105
- verbose: this.verbose,
106
- bin: this.bin,
107
- package: this.package,
108
- profile: this.profile,
109
- crossCompile: this.crossCompile,
110
- useCross: this.useCross,
111
- watch: this.watch,
112
- features: this.features,
113
- allFeatures: this.allFeatures,
114
- noDefaultFeatures: this.noDefaultFeatures,
115
- };
116
- }
117
- }
118
- //# sourceMappingURL=build.js.map
@@ -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,eAAe,GAAY,MAAM,C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,CAAC,SAAS;YACzB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,YAAY,EAAE,IAAI,CAAC,YAAY;YAC/B,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;SAC1C,CAAA;IACH,CAAC"}
@@ -1,39 +0,0 @@
1
- // This file is generated by codegen/index.ts
2
- // Do not edit this file manually
3
- import { Command, Option } from 'clipanion';
4
- export class BaseCreateNpmDirsCommand extends Command {
5
- static paths = [['create-npm-dirs']];
6
- static usage = Command.Usage({
7
- description: 'Create npm package dirs for different platforms',
8
- });
9
- cwd = Option.String('--cwd', process.cwd(), {
10
- description: 'The working directory of where napi command will be executed in, all other paths options are relative to this path',
11
- });
12
- packageJsonPath = Option.String('--package-json-path', 'package.json', {
13
- description: 'Path to `package.json`',
14
- });
15
- npmDir = Option.String('--npm-dir', 'npm', {
16
- description: 'Path to the folder where the npm packages put',
17
- });
18
- dryRun = Option.Boolean('--dry-run', false, {
19
- description: 'Dry run without touching file system',
20
- });
21
- getOptions() {
22
- return {
23
- cwd: this.cwd,
24
- packageJsonPath: this.packageJsonPath,
25
- npmDir: this.npmDir,
26
- dryRun: this.dryRun,
27
- };
28
- }
29
- }
30
- export function applyDefaultCreateNpmDirsOptions(options) {
31
- return {
32
- cwd: process.cwd(),
33
- packageJsonPath: 'package.json',
34
- npmDir: 'npm',
35
- dryRun: false,
36
- ...options,
37
- };
38
- }
39
- //# 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,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,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAA;IACH,CAAC;;AAiCH,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,67 +0,0 @@
1
- // This file is generated by codegen/index.ts
2
- // Do not edit this file manually
3
- import { Command, Option } from 'clipanion';
4
- import * as typanion from 'typanion';
5
- export class BaseNewCommand extends Command {
6
- static paths = [['new']];
7
- static usage = Command.Usage({
8
- description: 'Create a new project with pre-configured boilerplate',
9
- });
10
- $$path = Option.String({ required: true });
11
- $$name = Option.String('--name,-n', {
12
- description: 'The name of the project, default to the name of the directory if not provided',
13
- });
14
- minNodeApiVersion = Option.String('--min-node-api,-v', '4', {
15
- validator: typanion.isNumber(),
16
- description: 'The minimum Node-API version to support',
17
- });
18
- license = Option.String('--license,-l', 'MIT', {
19
- description: 'License for open-sourced project',
20
- });
21
- targets = Option.Array('--targets,-t', [], {
22
- description: 'All targets the crate will be compiled for.',
23
- });
24
- enableDefaultTargets = Option.Boolean('--enable-default-targets', true, {
25
- description: 'Whether enable default targets',
26
- });
27
- enableAllTargets = Option.Boolean('--enable-all-targets', false, {
28
- description: 'Whether enable all targets',
29
- });
30
- enableTypeDef = Option.Boolean('--enable-type-def', true, {
31
- description: 'Whether enable the `type-def` feature for typescript definitions auto-generation',
32
- });
33
- enableGithubActions = Option.Boolean('--enable-github-actions', true, {
34
- description: 'Whether generate preconfigured GitHub Actions workflow',
35
- });
36
- dryRun = Option.Boolean('--dry-run', false, {
37
- description: 'Whether to run the command in dry-run mode',
38
- });
39
- getOptions() {
40
- return {
41
- path: this.$$path,
42
- name: this.$$name,
43
- minNodeApiVersion: this.minNodeApiVersion,
44
- license: this.license,
45
- targets: this.targets,
46
- enableDefaultTargets: this.enableDefaultTargets,
47
- enableAllTargets: this.enableAllTargets,
48
- enableTypeDef: this.enableTypeDef,
49
- enableGithubActions: this.enableGithubActions,
50
- dryRun: this.dryRun,
51
- };
52
- }
53
- }
54
- export function applyDefaultNewOptions(options) {
55
- return {
56
- minNodeApiVersion: 4,
57
- license: 'MIT',
58
- targets: [],
59
- enableDefaultTargets: true,
60
- enableAllTargets: false,
61
- enableTypeDef: true,
62
- enableGithubActions: true,
63
- dryRun: false,
64
- ...options,
65
- };
66
- }
67
- //# sourceMappingURL=new.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new.js","sourceRoot":"","sources":["../../src/def/new.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,iCAAiC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAC3C,OAAO,KAAK,QAAQ,MAAM,UAAU,CAAA;AAEpC,MAAM,OAAgB,cAAe,SAAQ,OAAO;IAClD,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAA;IAExB,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC3B,WAAW,EAAE,sDAAsD;KACpE,CAAC,CAAA;IAEF,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAA;IAE1C,MAAM,GAAY,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE;QAC3C,WAAW,EACT,+EAA+E;KAClF,CAAC,CAAA;IAEF,iBAAiB,GAAG,MAAM,CAAC,MAAM,CAAC,mBAAmB,EAAE,GAAG,EAAE;QAC1D,SAAS,EAAE,QAAQ,CAAC,QAAQ,EAAE;QAC9B,WAAW,EAAE,yCAAyC;KACvD,CAAC,CAAA;IAEF,OAAO,GAA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BAAsB,CAAC,OAAmB;IACxD,OAAO;QACL,iBAAiB,EAAE,CAAC;QACpB,OAAO,EAAE,KAAK;QACd,OAAO,EAAE,EAAE;QACX,oBAAoB,EAAE,IAAI;QAC1B,gBAAgB,EAAE,KAAK;QACvB,aAAa,EAAE,IAAI;QACnB,mBAAmB,EAAE,IAAI;QACzB,MAAM,EAAE,KAAK;QACb,GAAG,OAAO;KACX,CAAA;AACH,CAAC"}
@@ -1,57 +0,0 @@
1
- // This file is generated by codegen/index.ts
2
- // Do not edit this file manually
3
- import { Command, Option } from 'clipanion';
4
- export class BasePrePublishCommand extends Command {
5
- static paths = [['pre-publish']];
6
- static usage = Command.Usage({
7
- description: 'Update package.json and copy addons into per platform packages',
8
- });
9
- cwd = Option.String('--cwd', process.cwd(), {
10
- description: 'The working directory of where napi command will be executed in, all other paths options are relative to this path',
11
- });
12
- packageJsonPath = Option.String('--package-json-path', 'package.json', {
13
- description: 'Path to `package.json`',
14
- });
15
- npmDir = Option.String('--npm-dir', 'npm', {
16
- description: 'Path to the folder where the npm packages put',
17
- });
18
- tagStyle = Option.String('--tag-style', 'lerna', {
19
- description: 'git tag style, `npm` or `lerna`',
20
- });
21
- ghRelease = Option.Boolean('--gh-release', true, {
22
- description: 'Whether create GitHub release',
23
- });
24
- ghReleaseName = Option.String('--gh-release-name', {
25
- description: 'GitHub release name',
26
- });
27
- ghReleaseId = Option.String('--gh-release-id', {
28
- description: 'Existing GitHub release id',
29
- });
30
- dryRun = Option.Boolean('--dry-run', false, {
31
- description: 'Dry run without touching file system',
32
- });
33
- getOptions() {
34
- return {
35
- cwd: this.cwd,
36
- packageJsonPath: this.packageJsonPath,
37
- npmDir: this.npmDir,
38
- tagStyle: this.tagStyle,
39
- ghRelease: this.ghRelease,
40
- ghReleaseName: this.ghReleaseName,
41
- ghReleaseId: this.ghReleaseId,
42
- dryRun: this.dryRun,
43
- };
44
- }
45
- }
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
- }
57
- //# 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,CAAC,CAAA;IAEhC,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC3B,WAAW,EACT,gEAAgE;KACnE,CAAC,CAAA;IAEF,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE;QAC1C,WAAW,EACT,oHAAoH;KACvH,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,QAAQ,GAAG,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE,OAAO,EAAE;QAC/C,WAAW,EAAE,iCAAiC;KAC/C,CAAC,CAAA;IAEF,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,cAAc,EAAE,IAAI,EAAE;QAC/C,WAAW,EAAE,+BAA+B;KAC7C,CAAC,CAAA;IAEF,aAAa,GAAY,MAAM,CAAC,MAAM,CAAC,mBAAmB,EAAE;QAC1D,WAAW,EAAE,qBAAqB;KACnC,CAAC,CAAA;IAEF,WAAW,GAAY,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE;QACtD,WAAW,EAAE,4BAA4B;KAC1C,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,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAA;IACH,CAAC;;AAqDH,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"}
@@ -1,59 +0,0 @@
1
- // This file is generated by codegen/index.ts
2
- // Do not edit this file manually
3
- import { Command, Option } from 'clipanion';
4
- export class BaseRenameCommand extends Command {
5
- static paths = [['rename']];
6
- static usage = Command.Usage({
7
- description: 'Rename the napi-rs project',
8
- });
9
- cwd = Option.String('--cwd', process.cwd(), {
10
- description: 'The working directory of where napi command will be executed in, all other paths options are relative to this path',
11
- });
12
- packageJsonPath = Option.String('--package-json-path', 'package.json', {
13
- description: 'Path to `package.json`',
14
- });
15
- npmDir = Option.String('--npm-dir', 'npm', {
16
- description: 'Path to the folder where the npm packages put',
17
- });
18
- $$name = Option.String('--name,-n', {
19
- description: 'The new name of the project',
20
- });
21
- binaryName = Option.String('--binary-name,-b', {
22
- description: 'The new binary name *.node files',
23
- });
24
- packageName = Option.String('--package-name', {
25
- description: 'The new package name of the project',
26
- });
27
- manifestPath = Option.String('--manifest-path', 'Cargo.toml', {
28
- description: 'Path to `Cargo.toml`',
29
- });
30
- repository = Option.String('--repository', {
31
- description: 'The new repository of the project',
32
- });
33
- description = Option.String('--description', {
34
- description: 'The new description of the project',
35
- });
36
- getOptions() {
37
- return {
38
- cwd: this.cwd,
39
- packageJsonPath: this.packageJsonPath,
40
- npmDir: this.npmDir,
41
- name: this.$$name,
42
- binaryName: this.binaryName,
43
- packageName: this.packageName,
44
- manifestPath: this.manifestPath,
45
- repository: this.repository,
46
- description: this.description,
47
- };
48
- }
49
- }
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
- }
59
- //# sourceMappingURL=rename.js.map
@@ -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;KAC1C,CAAC,CAAA;IAEF,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE;QAC1C,WAAW,EACT,oHAAoH;KACvH,CAAC,CAAA;IAEF,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,qBAAqB,EAAE,cAAc,EAAE;QACrE,WAAW,EAAE,wBAAwB;KACtC,CAAC,CAAA;I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,EAAE,KAAK;QACb,YAAY,EAAE,YAAY;QAC1B,GAAG,OAAO;KACX,CAAA;AACH,CAAC"}
@@ -1,34 +0,0 @@
1
- // This file is generated by codegen/index.ts
2
- // Do not edit this file manually
3
- import { Command, Option } from 'clipanion';
4
- export class BaseUniversalizeCommand extends Command {
5
- static paths = [['universalize']];
6
- static usage = Command.Usage({
7
- description: 'Combile built binaries into one universal binary',
8
- });
9
- cwd = Option.String('--cwd', process.cwd(), {
10
- description: 'The working directory of where napi command will be executed in, all other paths options are relative to this path',
11
- });
12
- packageJsonPath = Option.String('--package-json-path', 'package.json', {
13
- description: 'Path to `package.json`',
14
- });
15
- outputDir = Option.String('--output-dir,-o', './', {
16
- description: 'Path to the folder where all built `.node` files put, same as `--output-dir` of build command',
17
- });
18
- getOptions() {
19
- return {
20
- cwd: this.cwd,
21
- packageJsonPath: this.packageJsonPath,
22
- outputDir: this.outputDir,
23
- };
24
- }
25
- }
26
- export function applyDefaultUniversalizeOptions(options) {
27
- return {
28
- cwd: process.cwd(),
29
- packageJsonPath: 'package.json',
30
- outputDir: './',
31
- ...options,
32
- };
33
- }
34
- //# 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,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,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,SAAS,EAAE,IAAI,CAAC,SAAS;SAC1B,CAAA;IACH,CAAC;;AA2BH,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"}