@napi-rs/cli 3.0.0-alpha.90 → 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 (110) hide show
  1. package/dist/cli.js +3867 -15
  2. package/dist/index.cjs +9173 -8790
  3. package/dist/index.js +3618 -32
  4. package/package.json +10 -8
  5. package/dist/api/__tests__/new.spec.js +0 -283
  6. package/dist/api/__tests__/new.spec.js.map +0 -1
  7. package/dist/api/artifacts.js +0 -74
  8. package/dist/api/artifacts.js.map +0 -1
  9. package/dist/api/build.js +0 -707
  10. package/dist/api/build.js.map +0 -1
  11. package/dist/api/create-npm-dirs.js +0 -101
  12. package/dist/api/create-npm-dirs.js.map +0 -1
  13. package/dist/api/new.js +0 -360
  14. package/dist/api/new.js.map +0 -1
  15. package/dist/api/pre-publish.js +0 -160
  16. package/dist/api/pre-publish.js.map +0 -1
  17. package/dist/api/rename.js +0 -91
  18. package/dist/api/rename.js.map +0 -1
  19. package/dist/api/templates/.gitignore.js +0 -200
  20. package/dist/api/templates/.gitignore.js.map +0 -1
  21. package/dist/api/templates/.npmignore.js +0 -15
  22. package/dist/api/templates/.npmignore.js.map +0 -1
  23. package/dist/api/templates/build.rs.js +0 -5
  24. package/dist/api/templates/build.rs.js.map +0 -1
  25. package/dist/api/templates/cargo.toml.js +0 -27
  26. package/dist/api/templates/cargo.toml.js.map +0 -1
  27. package/dist/api/templates/ci-template.js +0 -593
  28. package/dist/api/templates/ci-template.js.map +0 -1
  29. package/dist/api/templates/ci.yml.js +0 -115
  30. package/dist/api/templates/ci.yml.js.map +0 -1
  31. package/dist/api/templates/index.js +0 -9
  32. package/dist/api/templates/index.js.map +0 -1
  33. package/dist/api/templates/js-binding.js +0 -213
  34. package/dist/api/templates/js-binding.js.map +0 -1
  35. package/dist/api/templates/lib.rs.js +0 -8
  36. package/dist/api/templates/lib.rs.js.map +0 -1
  37. package/dist/api/templates/load-wasi-template.js +0 -168
  38. package/dist/api/templates/load-wasi-template.js.map +0 -1
  39. package/dist/api/templates/package.json.js +0 -54
  40. package/dist/api/templates/package.json.js.map +0 -1
  41. package/dist/api/templates/wasi-worker-template.js +0 -122
  42. package/dist/api/templates/wasi-worker-template.js.map +0 -1
  43. package/dist/api/universalize.js +0 -39
  44. package/dist/api/universalize.js.map +0 -1
  45. package/dist/api/version.js +0 -17
  46. package/dist/api/version.js.map +0 -1
  47. package/dist/cli.js.map +0 -1
  48. package/dist/commands/artifacts.js +0 -20
  49. package/dist/commands/artifacts.js.map +0 -1
  50. package/dist/commands/build.js +0 -35
  51. package/dist/commands/build.js.map +0 -1
  52. package/dist/commands/create-npm-dirs.js +0 -8
  53. package/dist/commands/create-npm-dirs.js.map +0 -1
  54. package/dist/commands/help.js +0 -13
  55. package/dist/commands/help.js.map +0 -1
  56. package/dist/commands/new.js +0 -110
  57. package/dist/commands/new.js.map +0 -1
  58. package/dist/commands/pre-publish.js +0 -9
  59. package/dist/commands/pre-publish.js.map +0 -1
  60. package/dist/commands/rename.js +0 -8
  61. package/dist/commands/rename.js.map +0 -1
  62. package/dist/commands/universalize.js +0 -8
  63. package/dist/commands/universalize.js.map +0 -1
  64. package/dist/commands/version.js +0 -8
  65. package/dist/commands/version.js.map +0 -1
  66. package/dist/def/artifacts.js +0 -47
  67. package/dist/def/artifacts.js.map +0 -1
  68. package/dist/def/build.js +0 -140
  69. package/dist/def/build.js.map +0 -1
  70. package/dist/def/create-npm-dirs.js +0 -43
  71. package/dist/def/create-npm-dirs.js.map +0 -1
  72. package/dist/def/new.js +0 -77
  73. package/dist/def/new.js.map +0 -1
  74. package/dist/def/pre-publish.js +0 -61
  75. package/dist/def/pre-publish.js.map +0 -1
  76. package/dist/def/rename.js +0 -63
  77. package/dist/def/rename.js.map +0 -1
  78. package/dist/def/universalize.js +0 -38
  79. package/dist/def/universalize.js.map +0 -1
  80. package/dist/def/version.js +0 -38
  81. package/dist/def/version.js.map +0 -1
  82. package/dist/index.js.map +0 -1
  83. package/dist/utils/__tests__/config.spec.js +0 -63
  84. package/dist/utils/__tests__/config.spec.js.map +0 -1
  85. package/dist/utils/__tests__/target.spec.js +0 -11
  86. package/dist/utils/__tests__/target.spec.js.map +0 -1
  87. package/dist/utils/__tests__/typegen.spec.js +0 -42
  88. package/dist/utils/__tests__/typegen.spec.js.map +0 -1
  89. package/dist/utils/__tests__/version.spec.js +0 -6
  90. package/dist/utils/__tests__/version.spec.js.map +0 -1
  91. package/dist/utils/cargo.js +0 -34
  92. package/dist/utils/cargo.js.map +0 -1
  93. package/dist/utils/config.js +0 -75
  94. package/dist/utils/config.js.map +0 -1
  95. package/dist/utils/index.js +0 -10
  96. package/dist/utils/index.js.map +0 -1
  97. package/dist/utils/log.js +0 -15
  98. package/dist/utils/log.js.map +0 -1
  99. package/dist/utils/metadata.js +0 -40
  100. package/dist/utils/metadata.js.map +0 -1
  101. package/dist/utils/misc.js +0 -43
  102. package/dist/utils/misc.js.map +0 -1
  103. package/dist/utils/read-config.js +0 -8
  104. package/dist/utils/read-config.js.map +0 -1
  105. package/dist/utils/target.js +0 -135
  106. package/dist/utils/target.js.map +0 -1
  107. package/dist/utils/typegen.js +0 -210
  108. package/dist/utils/typegen.js.map +0 -1
  109. package/dist/utils/version.js +0 -62
  110. package/dist/utils/version.js.map +0 -1
@@ -1,17 +0,0 @@
1
- import { join, resolve } from 'node:path';
2
- import { applyDefaultVersionOptions } from '../def/version.js';
3
- import { readNapiConfig, debugFactory, updatePackageJson, } from '../utils/index.js';
4
- const debug = debugFactory('version');
5
- export async function version(userOptions) {
6
- const options = applyDefaultVersionOptions(userOptions);
7
- const packageJsonPath = resolve(options.cwd, options.packageJsonPath);
8
- const config = await readNapiConfig(packageJsonPath, options.configPath ? resolve(options.cwd, options.configPath) : undefined);
9
- for (const target of config.targets) {
10
- const pkgDir = resolve(options.cwd, options.npmDir, target.platformArchABI);
11
- debug(`Update version to %i in [%i]`, config.packageJson.version, pkgDir);
12
- await updatePackageJson(join(pkgDir, 'package.json'), {
13
- version: config.packageJson.version,
14
- });
15
- }
16
- }
17
- //# sourceMappingURL=version.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/api/version.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEzC,OAAO,EAAE,0BAA0B,EAAkB,MAAM,mBAAmB,CAAA;AAC9E,OAAO,EACL,cAAc,EACd,YAAY,EACZ,iBAAiB,GAClB,MAAM,mBAAmB,CAAA;AAE1B,MAAM,KAAK,GAAG,YAAY,CAAC,SAAS,CAAC,CAAA;AAErC,MAAM,CAAC,KAAK,UAAU,OAAO,CAAC,WAA2B;IACvD,MAAM,OAAO,GAAG,0BAA0B,CAAC,WAAW,CAAC,CAAA;IACvD,MAAM,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,eAAe,CAAC,CAAA;IAErE,MAAM,MAAM,GAAG,MAAM,cAAc,CACjC,eAAe,EACf,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,SAAS,CAC1E,CAAA;IAED,KAAK,MAAM,MAAM,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;QACpC,MAAM,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,OAAO,CAAC,MAAM,EAAE,MAAM,CAAC,eAAe,CAAC,CAAA;QAE3E,KAAK,CAAC,8BAA8B,EAAE,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;QACzE,MAAM,iBAAiB,CAAC,IAAI,CAAC,MAAM,EAAE,cAAc,CAAC,EAAE;YACpD,OAAO,EAAE,MAAM,CAAC,WAAW,CAAC,OAAO;SACpC,CAAC,CAAA;IACJ,CAAC;AACH,CAAC"}
package/dist/cli.js.map DELETED
@@ -1 +0,0 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AO,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAA"}
@@ -1,20 +0,0 @@
1
- import { Command } from 'clipanion';
2
- import { collectArtifacts } from '../api/artifacts.js';
3
- import { BaseArtifactsCommand } from '../def/artifacts.js';
4
- export class ArtifactsCommand extends BaseArtifactsCommand {
5
- static usage = Command.Usage({
6
- description: 'Copy artifacts from Github Actions into specified dir',
7
- examples: [
8
- [
9
- '$0 artifacts --output-dir ./artifacts --dist ./npm',
10
- `Copy [binaryName].[platform].node under current dir(.) into packages under npm dir.
11
- e.g: index.linux-x64-gnu.node --> ./npm/linux-x64-gnu/index.linux-x64-gnu.node`,
12
- ],
13
- ],
14
- });
15
- static paths = [['artifacts']];
16
- async execute() {
17
- await collectArtifacts(this.getOptions());
18
- }
19
- }
20
- //# sourceMappingURL=artifacts.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"artifacts.js","sourceRoot":"","sources":["../../src/commands/artifacts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAA;AACtD,OAAO,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAA;AAE1D,MAAM,OAAO,gBAAiB,SAAQ,oBAAoB;IACxD,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC3B,WAAW,EAAE,uDAAuD;QACpE,QAAQ,EAAE;YACR;gBACE,oDAAoD;gBACpD;+EACuE;aACxE;SACF;KACF,CAAC,CAAA;IAEF,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,WAAW,CAAC,CAAC,CAAA;IAE9B,KAAK,CAAC,OAAO;QACX,MAAM,gBAAgB,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAA;IAC3C,CAAC"}
@@ -1,35 +0,0 @@
1
- import { execSync } from 'node:child_process';
2
- import { Option } from 'clipanion';
3
- import { buildProject } from '../api/build.js';
4
- import { BaseBuildCommand } from '../def/build.js';
5
- import { debugFactory } from '../utils/index.js';
6
- const debug = debugFactory('build');
7
- export class BuildCommand extends BaseBuildCommand {
8
- pipe = Option.String('--pipe', {
9
- description: 'Pipe all outputs file to given command. e.g. `napi build --pipe "npx prettier --write"`',
10
- });
11
- cargoOptions = Option.Rest();
12
- async execute() {
13
- const { task } = await buildProject({
14
- ...this.getOptions(),
15
- cargoOptions: this.cargoOptions,
16
- });
17
- const outputs = await task;
18
- if (this.pipe) {
19
- for (const output of outputs) {
20
- debug('Piping output file to command: %s', this.pipe);
21
- try {
22
- execSync(`${this.pipe} ${output.path}`, {
23
- stdio: 'inherit',
24
- cwd: this.cwd,
25
- });
26
- }
27
- catch (e) {
28
- debug.error(`Failed to pipe output file ${output.path} to command`);
29
- debug.error(e);
30
- }
31
- }
32
- }
33
- }
34
- }
35
- //# sourceMappingURL=build.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/commands/build.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAE7C,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAElC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAA;AAC9C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AAClD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEhD,MAAM,KAAK,GAAG,YAAY,CAAC,OAAO,CAAC,CAAA;AAEnC,MAAM,OAAO,YAAa,SAAQ,gBAAgB;IAChD,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE;QAC7B,WAAW,EACT,yFAAyF;KAC5F,CAAC,CAAA;IAEF,YAAY,GAAG,MAAM,CAAC,IAAI,EAAE,CAAA;IAE5B,KAAK,CAAC,OAAO;QACX,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,YAAY,CAAC;YAClC,GAAG,IAAI,CAAC,UAAU,EAAE;YACpB,YAAY,EAAE,IAAI,CAAC,YAAY;SAChC,CAAC,CAAA;QAEF,MAAM,OAAO,GAAG,MAAM,IAAI,CAAA;QAE1B,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC;YACd,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;gBAC7B,KAAK,CAAC,mCAAmC,EAAE,IAAI,CAAC,IAAI,CAAC,CAAA;gBACrD,IAAI,CAAC;oBACH,QAAQ,CAAC,GAAG,IAAI,CAAC,IAAI,IAAI,MAAM,CAAC,IAAI,EAAE,EAAE;wBACtC,KAAK,EAAE,SAAS;wBAChB,GAAG,EAAE,IAAI,CAAC,GAAG;qBACd,CAAC,CAAA;gBACJ,CAAC;gBAAC,OAAO,CAAC,EAAE,CAAC;oBACX,KAAK,CAAC,KAAK,CAAC,8BAA8B,MAAM,CAAC,IAAI,aAAa,CAAC,CAAA;oBACnE,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;gBAChB,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;CACF"}
@@ -1,8 +0,0 @@
1
- import { createNpmDirs } from '../api/create-npm-dirs.js';
2
- import { BaseCreateNpmDirsCommand } from '../def/create-npm-dirs.js';
3
- export class CreateNpmDirsCommand extends BaseCreateNpmDirsCommand {
4
- async execute() {
5
- await createNpmDirs(this.getOptions());
6
- }
7
- }
8
- //# sourceMappingURL=create-npm-dirs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-npm-dirs.js","sourceRoot":"","sources":["../../src/commands/create-npm-dirs.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AACzD,OAAO,EAAE,wBAAwB,EAAE,MAAM,2BAA2B,CAAA;AAEpE,MAAM,OAAO,oBAAqB,SAAQ,wBAAwB;IAChE,KAAK,CAAC,OAAO;QACX,MAAM,aAAa,CAAC,IAAI,CAAC,UAAU,EAAE,CAAC,CAAA;IACxC,CAAC;CACF"}
@@ -1,13 +0,0 @@
1
- import { Command } from 'clipanion';
2
- /**
3
- * A command that prints the usage of all commands.
4
- *
5
- * Paths: `-h`, `--help`
6
- */
7
- export class HelpCommand extends Command {
8
- static paths = [[`-h`], [`--help`]];
9
- async execute() {
10
- await this.context.stdout.write(this.cli.usage());
11
- }
12
- }
13
- //# sourceMappingURL=help.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/commands/help.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAEnC;;;;GAIG;AACH,MAAM,OAAO,WAAY,SAAQ,OAAY;IAC3C,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAA;IACnC,KAAK,CAAC,OAAO;QACX,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,CAAC,CAAA;IACnD,CAAC"}
@@ -1,110 +0,0 @@
1
- import path from 'node:path';
2
- import { input, select, checkbox, confirm } from '@inquirer/prompts';
3
- import { Option } from 'clipanion';
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', true, {
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
- const targetPath = cmdOptions.path
29
- ? cmdOptions.path
30
- : await inquirerProjectPath();
31
- cmdOptions.path = targetPath;
32
- return {
33
- ...cmdOptions,
34
- name: await this.fetchName(path.parse(targetPath).base),
35
- minNodeApiVersion: await this.fetchNapiVersion(),
36
- targets: await this.fetchTargets(),
37
- license: await this.fetchLicense(),
38
- enableTypeDef: await this.fetchTypeDef(),
39
- enableGithubActions: await this.fetchGithubActions(),
40
- };
41
- }
42
- return cmdOptions;
43
- }
44
- async fetchName(defaultName) {
45
- return (this.$$name ??
46
- input({
47
- message: 'Package name (the name field in your package.json file)',
48
- default: defaultName,
49
- }));
50
- }
51
- async fetchLicense() {
52
- return input({
53
- message: 'License for open-sourced project',
54
- default: this.license,
55
- });
56
- }
57
- async fetchNapiVersion() {
58
- return select({
59
- message: 'Minimum node-api version (with node version requirement)',
60
- loop: false,
61
- choices: Array.from({ length: 8 }, (_, i) => ({
62
- name: `napi${i + 1} (${napiEngineRequirement(i + 1)})`,
63
- value: i + 1,
64
- })),
65
- // choice index
66
- default: this.minNodeApiVersion - 1,
67
- });
68
- }
69
- async fetchTargets() {
70
- if (this.enableAllTargets) {
71
- return AVAILABLE_TARGETS.concat();
72
- }
73
- const targets = await checkbox({
74
- loop: false,
75
- message: 'Choose target(s) your crate will be compiled to',
76
- choices: AVAILABLE_TARGETS.map((target) => ({
77
- name: target,
78
- value: target,
79
- // @ts-expect-error
80
- checked: DEFAULT_TARGETS.includes(target),
81
- })),
82
- });
83
- return targets;
84
- }
85
- async fetchTypeDef() {
86
- const enableTypeDef = await confirm({
87
- message: 'Enable type definition auto-generation',
88
- default: this.enableTypeDef,
89
- });
90
- return enableTypeDef;
91
- }
92
- async fetchGithubActions() {
93
- const enableGithubActions = await confirm({
94
- message: 'Enable Github Actions CI',
95
- default: this.enableGithubActions,
96
- });
97
- return enableGithubActions;
98
- }
99
- }
100
- async function inquirerProjectPath() {
101
- return input({
102
- message: 'Target path to create the project, relative to cwd.',
103
- }).then((path) => {
104
- if (!path) {
105
- return inquirerProjectPath();
106
- }
107
- return path;
108
- });
109
- }
110
- //# sourceMappingURL=new.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"new.js","sourceRoot":"","sources":["../../src/commands/new.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAA;AAE5B,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAA;AACpE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAElC,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EACL,iBAAiB,EACjB,YAAY,EACZ,eAAe,GAEhB,MAAM,mBAAmB,CAAA;AAC1B,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAA;AAE3D,MAAM,KAAK,GAAG,YAAY,CAAC,KAAK,CAAC,CAAA;AAEjC,MAAM,OAAO,UAAW,SAAQ,cAAc;IAC5C,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,kBAAkB,EAAE,IAAI,EAAE;QACrD,WAAW,EACT,6EAA6E;KAChF,CAAC,CAAA;IAEF,KAAK,CAAC,OAAO;QACX,IAAI,CAAC;YACH,MAAM,OAAO,GAAG,MAAM,IAAI,CAAC,YAAY,EAAE,CAAA;YACzC,MAAM,UAAU,CAAC,OAAO,CAAC,CAAA;YACzB,OAAO,CAAC,CAAA;QACV,CAAC;QAAC,OAAO,CAAC,EAAE,CAAC;YACX,KAAK,CAAC,8BAA8B,CAAC,CAAA;YACrC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;YACd,OAAO,CAAC,CAAA;QACV,CAAC;IACH,CAAC;IAEO,KAAK,CAAC,YAAY;QACxB,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,EAAE,CAAA;QAErC,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACrB,MAAM,UAAU,GAAW,UAAU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,OAAO,IAAI,CAAA;IACb,CAAC,CAAC,CAAA;AACJ,CAAC"}
@@ -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,47 +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
- configPath = Option.String('--config-path,-c', {
13
- description: 'Path to `napi` config json file',
14
- });
15
- packageJsonPath = Option.String('--package-json-path', 'package.json', {
16
- description: 'Path to `package.json`',
17
- });
18
- outputDir = Option.String('--output-dir,-o,-d', './artifacts', {
19
- description: 'Path to the folder where all built `.node` files put, same as `--output-dir` of build command',
20
- });
21
- npmDir = Option.String('--npm-dir', 'npm', {
22
- description: 'Path to the folder where the npm packages put',
23
- });
24
- buildOutputDir = Option.String('--build-output-dir', {
25
- description: 'Path to the build output dir, only needed when targets contains `wasm32-wasi-*`',
26
- });
27
- getOptions() {
28
- return {
29
- cwd: this.cwd,
30
- configPath: this.configPath,
31
- packageJsonPath: this.packageJsonPath,
32
- outputDir: this.outputDir,
33
- npmDir: this.npmDir,
34
- buildOutputDir: this.buildOutputDir,
35
- };
36
- }
37
- }
38
- export function applyDefaultArtifactsOptions(options) {
39
- return {
40
- cwd: process.cwd(),
41
- packageJsonPath: 'package.json',
42
- outputDir: './artifacts',
43
- npmDir: 'npm',
44
- ...options,
45
- };
46
- }
47
- //# 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,UAAU,GAAY,MAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE;QACtD,WAAW,EAAE,iCAAiC;KAC/C,CAAC,CAAA;IAEF,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,qBAAqB,EAAE,cAAc,EAAE;QACrE,WAAW,EAAE,wBAAwB;KACtC,CAAC,CAAA;IAEF,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC,oBAAoB,EAAE,aAAa,EAAE;QAC7D,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,cAAc,GAAY,MAAM,CAAC,MAAM,CAAC,oBAAoB,EAAE;QAC5D,WAAW,EACT,iFAAiF;KACpF,CAAC,CAAA;IAEF,UAAU;QACR,OAAO;YACL,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,cAAc,EAAE,IAAI,CAAC,cAAc;SACpC,CAAA;IACH,CAAC;;AAyCH,MAAM,UAAU,4BAA4B,CAAC,OAAyB;IACpE,OAAO;QACL,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;QAClB,eAAe,EAAE,cAAc;QAC/B,SAAS,EAAE,aAAa;QACxB,MAAM,EAAE,KAAK;QACb,GAAG,OAAO;KACX,CAAA;AACH,CAAC"}
package/dist/def/build.js DELETED
@@ -1,140 +0,0 @@
1
- // This file is generated by codegen/index.ts
2
- // Do not edit this file manually
3
- import { Command, Option } from 'clipanion';
4
- export class BaseBuildCommand extends Command {
5
- static paths = [['build']];
6
- static usage = Command.Usage({
7
- description: 'Build the NAPI-RS project',
8
- });
9
- target = Option.String('--target,-t', {
10
- description: 'Build for the target triple, bypassed to `cargo build --target`',
11
- });
12
- cwd = Option.String('--cwd', {
13
- description: 'The working directory of where napi command will be executed in, all other paths options are relative to this path',
14
- });
15
- manifestPath = Option.String('--manifest-path', {
16
- description: 'Path to `Cargo.toml`',
17
- });
18
- configPath = Option.String('--config-path,-c', {
19
- description: 'Path to `napi` config json file',
20
- });
21
- packageJsonPath = Option.String('--package-json-path', {
22
- description: 'Path to `package.json`',
23
- });
24
- targetDir = Option.String('--target-dir', {
25
- description: 'Directory for all crate generated artifacts, see `cargo build --target-dir`',
26
- });
27
- outputDir = Option.String('--output-dir,-o', {
28
- description: 'Path to where all the built files would be put. Default to the crate folder',
29
- });
30
- platform = Option.Boolean('--platform', {
31
- description: 'Add platform triple to the generated nodejs binding file, eg: `[name].linux-x64-gnu.node`',
32
- });
33
- jsPackageName = Option.String('--js-package-name', {
34
- description: 'Package name in generated js binding file. Only works with `--platform` flag',
35
- });
36
- constEnum = Option.Boolean('--const-enum', {
37
- description: 'Whether generate const enum for typescript bindings',
38
- });
39
- jsBinding = Option.String('--js', {
40
- description: 'Path and filename of generated JS binding file. Only works with `--platform` flag. Relative to `--output-dir`.',
41
- });
42
- noJsBinding = Option.Boolean('--no-js', {
43
- description: 'Whether to disable the generation JS binding file. Only works with `--platform` flag.',
44
- });
45
- dts = Option.String('--dts', {
46
- description: 'Path and filename of generated type def file. Relative to `--output-dir`',
47
- });
48
- dtsHeader = Option.String('--dts-header', {
49
- description: 'Custom file header for generated type def file. Only works when `typedef` feature enabled.',
50
- });
51
- noDtsHeader = Option.Boolean('--no-dts-header', {
52
- description: 'Whether to disable the default file header for generated type def file. Only works when `typedef` feature enabled.',
53
- });
54
- dtsCache = Option.Boolean('--dts-cache', true, {
55
- description: 'Whether to enable the dts cache, default to true',
56
- });
57
- esm = Option.Boolean('--esm', {
58
- description: 'Whether to emit an ESM JS binding file instead of CJS format. Only works with `--platform` flag.',
59
- });
60
- strip = Option.Boolean('--strip,-s', {
61
- description: 'Whether strip the library to achieve the minimum file size',
62
- });
63
- release = Option.Boolean('--release,-r', {
64
- description: 'Build in release mode',
65
- });
66
- verbose = Option.Boolean('--verbose,-v', {
67
- description: 'Verbosely log build command trace',
68
- });
69
- bin = Option.String('--bin', {
70
- description: 'Build only the specified binary',
71
- });
72
- package = Option.String('--package,-p', {
73
- description: 'Build the specified library or the one at cwd',
74
- });
75
- profile = Option.String('--profile', {
76
- description: 'Build artifacts with the specified profile',
77
- });
78
- crossCompile = Option.Boolean('--cross-compile,-x', {
79
- description: '[experimental] cross-compile for the specified target with `cargo-xwin` on windows and `cargo-zigbuild` on other platform',
80
- });
81
- useCross = Option.Boolean('--use-cross', {
82
- description: '[experimental] use [cross](https://github.com/cross-rs/cross) instead of `cargo`',
83
- });
84
- useNapiCross = Option.Boolean('--use-napi-cross', {
85
- description: '[experimental] use @napi-rs/cross-toolchain to cross-compile Linux arm/arm64/x64 gnu targets.',
86
- });
87
- watch = Option.Boolean('--watch,-w', {
88
- description: 'watch the crate changes and build continuously with `cargo-watch` crates',
89
- });
90
- features = Option.Array('--features,-F', {
91
- description: 'Space-separated list of features to activate',
92
- });
93
- allFeatures = Option.Boolean('--all-features', {
94
- description: 'Activate all available features',
95
- });
96
- noDefaultFeatures = Option.Boolean('--no-default-features', {
97
- description: 'Do not activate the `default` feature',
98
- });
99
- getOptions() {
100
- return {
101
- target: this.target,
102
- cwd: this.cwd,
103
- manifestPath: this.manifestPath,
104
- configPath: this.configPath,
105
- packageJsonPath: this.packageJsonPath,
106
- targetDir: this.targetDir,
107
- outputDir: this.outputDir,
108
- platform: this.platform,
109
- jsPackageName: this.jsPackageName,
110
- constEnum: this.constEnum,
111
- jsBinding: this.jsBinding,
112
- noJsBinding: this.noJsBinding,
113
- dts: this.dts,
114
- dtsHeader: this.dtsHeader,
115
- noDtsHeader: this.noDtsHeader,
116
- dtsCache: this.dtsCache,
117
- esm: this.esm,
118
- strip: this.strip,
119
- release: this.release,
120
- verbose: this.verbose,
121
- bin: this.bin,
122
- package: this.package,
123
- profile: this.profile,
124
- crossCompile: this.crossCompile,
125
- useCross: this.useCross,
126
- useNapiCross: this.useNapiCross,
127
- watch: this.watch,
128
- features: this.features,
129
- allFeatures: this.allFeatures,
130
- noDefaultFeatures: this.noDefaultFeatures,
131
- };
132
- }
133
- }
134
- export function applyDefaultBuildOptions(options) {
135
- return {
136
- dtsCache: true,
137
- ...options,
138
- };
139
- }
140
- //# sourceMappingURL=build.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"build.js","sourceRoot":"","sources":["../../src/def/build.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,iCAAiC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAE3C,MAAM,OAAgB,gBAAiB,SAAQ,OAAO;IACpD,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAA;IAE1B,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC3B,WAAW,EAAE,2BAA2B;KACzC,CAAC,CAAA;IAEF,MAAM,GAAY,MAAM,CAAC,MAAM,CAAC,aAAa,EAAE;QAC7C,WAAW,EACT,iEAAiE;KACpE,CAAC,CAAA;IAEF,GAAG,GAAY,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE;QACpC,WAAW,EACT,oHAAoH;KACvH,CAAC,CAAA;IAEF,YAAY,GAAY,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE;QACvD,WAAW,EAAE,sBAAsB;KACpC,CAAC,CAAA;IAEF,UAAU,GAAY,MAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE;QACtD,WAAW,EAAE,iCAAiC;KAC/C,CAAC,CAAA;IAEF,eAAe,GAAY,MAAM,CAAC,MAAM,CAAC,qBAAqB,EAAE;QAC9D,WAAW,EAAE,wBAAwB;KACtC,CAAC,CAAA;IAEF,SAAS,GAAY,MAAM,CAAC,MAAM,CAAC,cAAc,EAAE;QACjD,WAAW,EACT,6EAA6E;KAChF,CAAC,CAAA;IAEF,SAAS,GAAY,MAAM,CAAC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// Do not edit this file manually
3
- import { Command, Option } from 'clipanion';
4
- export class BaseCreateNpmDirsCommand extends Command {
5
- static paths = [['create-npm-dirs']];
6
- static usage = Command.Usage({
7
- description: 'Create npm package dirs for different platforms',
8
- });
9
- cwd = Option.String('--cwd', process.cwd(), {
10
- description: 'The working directory of where napi command will be executed in, all other paths options are relative to this path',
11
- });
12
- configPath = Option.String('--config-path,-c', {
13
- description: 'Path to `napi` config json file',
14
- });
15
- packageJsonPath = Option.String('--package-json-path', 'package.json', {
16
- description: 'Path to `package.json`',
17
- });
18
- npmDir = Option.String('--npm-dir', 'npm', {
19
- description: 'Path to the folder where the npm packages put',
20
- });
21
- dryRun = Option.Boolean('--dry-run', false, {
22
- description: 'Dry run without touching file system',
23
- });
24
- getOptions() {
25
- return {
26
- cwd: this.cwd,
27
- configPath: this.configPath,
28
- packageJsonPath: this.packageJsonPath,
29
- npmDir: this.npmDir,
30
- dryRun: this.dryRun,
31
- };
32
- }
33
- }
34
- export function applyDefaultCreateNpmDirsOptions(options) {
35
- return {
36
- cwd: process.cwd(),
37
- packageJsonPath: 'package.json',
38
- npmDir: 'npm',
39
- dryRun: false,
40
- ...options,
41
- };
42
- }
43
- //# sourceMappingURL=create-npm-dirs.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"create-npm-dirs.js","sourceRoot":"","sources":["../../src/def/create-npm-dirs.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,iCAAiC;AACjC,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAE3C,MAAM,OAAgB,wBAAyB,SAAQ,OAAO;IAC5D,MAAM,CAAC,KAAK,GAAG,CAAC,CAAC,iBAAiB,CAAC,CAAC,CAAA;IAEpC,MAAM,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC3B,WAAW,EAAE,iDAAiD;KAC/D,CAAC,CAAA;IAEF,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,EAAE,EAAE;QAC1C,WAAW,EACT,oHAAoH;KACvH,CAAC,CAAA;IAEF,UAAU,GAAY,MAAM,CAAC,MAAM,CAAC,kBAAkB,EAAE;QACtD,WAAW,EAAE,iCAAiC;KAC/C,CAAC,CAAA;IAEF,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,qBAAqB,EAAE,cAAc,EAAE;QACrE,WAAW,EAAE,wBAAwB;KACtC,CAAC,CAAA;IAEF,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,WAAW,EAAE,KAAK,EAAE;QACzC,WAAW,EAAE,+CAA+C;KAC7D,CAAC,CAAA;IAEF,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,WAAW,EAAE,KAAK,EAAE;QAC1C,WAAW,EAAE,sCAAsC;KACpD,CAAC,CAAA;IAEF,UAAU;QACR,OAAO;YACL,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,eAAe,EAAE,IAAI,CAAC,eAAe;YACrC,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,MAAM,EAAE,IAAI,CAAC,MAAM;SACpB,CAAA;IACH,CAAC;;AAqCH,MAAM,UAAU,gCAAgC,CAC9C,OAA6B;IAE7B,OAAO;QACL,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE;QAClB,eAAe,EAAE,cAAc;QAC/B,MAAM,EAAE,KAAK;QACb,MAAM,EAAE,KAAK;QACb,GAAG,OAAO;KACX,CAAA;AACH,CAAC"}
package/dist/def/new.js DELETED
@@ -1,77 +0,0 @@
1
- // This file is generated by codegen/index.ts
2
- // Do not edit this file manually
3
- import { Command, Option } from 'clipanion';
4
- import * as typanion from 'typanion';
5
- export class BaseNewCommand extends Command {
6
- static paths = [['new']];
7
- static usage = Command.Usage({
8
- description: 'Create a new project with pre-configured boilerplate',
9
- });
10
- $$path = Option.String({ required: false });
11
- $$name = Option.String('--name,-n', {
12
- description: 'The name of the project, default to the name of the directory if not provided',
13
- });
14
- minNodeApiVersion = Option.String('--min-node-api,-v', '4', {
15
- validator: typanion.isNumber(),
16
- description: 'The minimum Node-API version to support',
17
- });
18
- packageManager = Option.String('--package-manager', 'yarn', {
19
- description: 'The package manager to use. Only support yarn 4.x for now.',
20
- });
21
- license = Option.String('--license,-l', 'MIT', {
22
- description: 'License for open-sourced project',
23
- });
24
- targets = Option.Array('--targets,-t', [], {
25
- description: 'All targets the crate will be compiled for.',
26
- });
27
- enableDefaultTargets = Option.Boolean('--enable-default-targets', true, {
28
- description: 'Whether enable default targets',
29
- });
30
- enableAllTargets = Option.Boolean('--enable-all-targets', false, {
31
- description: 'Whether enable all targets',
32
- });
33
- enableTypeDef = Option.Boolean('--enable-type-def', true, {
34
- description: 'Whether enable the `type-def` feature for typescript definitions auto-generation',
35
- });
36
- enableGithubActions = Option.Boolean('--enable-github-actions', true, {
37
- description: 'Whether generate preconfigured GitHub Actions workflow',
38
- });
39
- testFramework = Option.String('--test-framework', 'ava', {
40
- description: 'The JavaScript test framework to use, only support `ava` for now',
41
- });
42
- dryRun = Option.Boolean('--dry-run', false, {
43
- description: 'Whether to run the command in dry-run mode',
44
- });
45
- getOptions() {
46
- return {
47
- path: this.$$path,
48
- name: this.$$name,
49
- minNodeApiVersion: this.minNodeApiVersion,
50
- packageManager: this.packageManager,
51
- license: this.license,
52
- targets: this.targets,
53
- enableDefaultTargets: this.enableDefaultTargets,
54
- enableAllTargets: this.enableAllTargets,
55
- enableTypeDef: this.enableTypeDef,
56
- enableGithubActions: this.enableGithubActions,
57
- testFramework: this.testFramework,
58
- dryRun: this.dryRun,
59
- };
60
- }
61
- }
62
- export function applyDefaultNewOptions(options) {
63
- return {
64
- minNodeApiVersion: 4,
65
- packageManager: 'yarn',
66
- license: 'MIT',
67
- targets: [],
68
- enableDefaultTargets: true,
69
- enableAllTargets: false,
70
- enableTypeDef: true,
71
- enableGithubActions: true,
72
- testFramework: 'ava',
73
- dryRun: false,
74
- ...options,
75
- };
76
- }
77
-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