@neon-rs/cli 0.1.66 → 0.1.68

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 (2) hide show
  1. package/index.js +479 -116
  2. package/package.json +8 -8
package/index.js CHANGED
@@ -40240,7 +40240,7 @@ which.sync = whichSync
40240
40240
 
40241
40241
  /***/ }),
40242
40242
 
40243
- /***/ 3149:
40243
+ /***/ 3129:
40244
40244
  /***/ ((__unused_webpack_module, __webpack_exports__, __nccwpck_require__) => {
40245
40245
 
40246
40246
 
@@ -40266,16 +40266,10 @@ var lib = __nccwpck_require__(3993);
40266
40266
  ;// CONCATENATED MODULE: ./node_modules/cargo-messages/lib/index.mjs
40267
40267
 
40268
40268
 
40269
- // EXTERNAL MODULE: ../node_modules/@neon-rs/manifest/lib/index.cjs
40270
- var manifest_lib = __nccwpck_require__(4696);
40271
- ;// CONCATENATED MODULE: ../node_modules/@neon-rs/manifest/lib/index.mjs
40272
-
40273
-
40274
- // EXTERNAL MODULE: ../node_modules/@neon-rs/manifest/lib/platform.cjs
40275
- var lib_platform = __nccwpck_require__(2147);
40276
- ;// CONCATENATED MODULE: ../node_modules/@neon-rs/manifest/lib/platform.mjs
40277
-
40278
-
40269
+ // EXTERNAL MODULE: ../node_modules/@neon-rs/manifest/lib/index.mjs
40270
+ var manifest_lib = __nccwpck_require__(347);
40271
+ // EXTERNAL MODULE: ../node_modules/@neon-rs/manifest/lib/platform.mjs
40272
+ var lib_platform = __nccwpck_require__(8140);
40279
40273
  ;// CONCATENATED MODULE: ./src/commands/dist.ts
40280
40274
 
40281
40275
 
@@ -40323,7 +40317,7 @@ function parseOutputFile(debug, out, platform) {
40323
40317
  const NEON_BUILD_PLATFORM = process.env['NEON_BUILD_PLATFORM'];
40324
40318
  if (platform || (!debug && NEON_BUILD_PLATFORM)) {
40325
40319
  const p = platform || NEON_BUILD_PLATFORM;
40326
- (0,lib_platform.assertIsNodePlatform)(p);
40320
+ (0,lib_platform/* assertIsNodePlatform */.or)(p);
40327
40321
  return manifest_lib/* LibraryManifest.load */.N.load().then(manifest => {
40328
40322
  const path = manifest.getPlatformOutputPath(p);
40329
40323
  if (!path) {
@@ -42087,11 +42081,11 @@ async function getCurrentTarget(log) {
42087
42081
  }
42088
42082
  const target = hostLine.replace(/^host:\s+/, '');
42089
42083
  log(`currentTarget result: "${target}"`);
42090
- (0,lib_platform.assertIsRustTarget)(target);
42084
+ (0,lib_platform/* assertIsRustTarget */.sD)(target);
42091
42085
  return target;
42092
42086
  }
42093
42087
 
42094
- ;// CONCATENATED MODULE: ./src/commands/add-platform.ts
42088
+ ;// CONCATENATED MODULE: ./src/commands/add.ts
42095
42089
 
42096
42090
 
42097
42091
 
@@ -42099,16 +42093,16 @@ async function getCurrentTarget(log) {
42099
42093
  function optionArray(option) {
42100
42094
  return option == null ? [] : [option];
42101
42095
  }
42102
- const add_platform_OPTIONS = [
42096
+ const add_OPTIONS = [
42103
42097
  { name: 'os', type: String, defaultValue: null },
42104
42098
  { name: 'arch', type: String, defaultValue: null },
42105
42099
  { name: 'abi', type: String, defaultValue: null },
42106
42100
  { name: 'out-dir', alias: 'o', type: String, defaultValue: 'platforms' },
42107
42101
  { name: 'verbose', alias: 'v', type: Boolean, defaultValue: false }
42108
42102
  ];
42109
- class AddPlatform {
42103
+ class Add {
42110
42104
  static summary() { return 'Add a platform or platform preset to a Neon project.'; }
42111
- static syntax() { return 'neon add-platform [<p> | --os <a> --arch <b> [--abi <c>]] [-o <d>] [-b <f>]'; }
42105
+ static syntax() { return 'neon add [<p> | --os <a> --arch <b> [--abi <c>]] [-o <d>] [-b <f>]'; }
42112
42106
  static options() {
42113
42107
  return [
42114
42108
  { name: '<p>', summary: 'A Node platform or platform preset.' },
@@ -42145,7 +42139,7 @@ class AddPlatform {
42145
42139
  _outDir;
42146
42140
  _verbose;
42147
42141
  constructor(argv) {
42148
- const options = dist_default()(add_platform_OPTIONS, { argv, partial: true });
42142
+ const options = dist_default()(add_OPTIONS, { argv, partial: true });
42149
42143
  this._os = options.os || null;
42150
42144
  this._arch = options.arch || null;
42151
42145
  this._abi = options.abi || null;
@@ -42175,7 +42169,7 @@ class AddPlatform {
42175
42169
  }
42176
42170
  log(msg) {
42177
42171
  if (this._verbose) {
42178
- console.error("[neon add-platform] " + msg);
42172
+ console.error("[neon add] " + msg);
42179
42173
  }
42180
42174
  }
42181
42175
  async addPlatform(libManifest) {
@@ -42183,15 +42177,15 @@ class AddPlatform {
42183
42177
  this.log('adding default system platform');
42184
42178
  await libManifest.addRustTarget(await getCurrentTarget(msg => this.log(msg)));
42185
42179
  }
42186
- else if ((0,lib_platform.isRustTarget)(this._platform)) {
42180
+ else if ((0,lib_platform/* isRustTarget */.FZ)(this._platform)) {
42187
42181
  this.log(`adding Rust target ${this._platform}`);
42188
42182
  await libManifest.addRustTarget(this._platform);
42189
42183
  }
42190
- else if ((0,lib_platform.isNodePlatform)(this._platform)) {
42184
+ else if ((0,lib_platform/* isNodePlatform */.bC)(this._platform)) {
42191
42185
  this.log(`adding Node platform ${this._platform}`);
42192
42186
  await libManifest.addNodePlatform(this._platform);
42193
42187
  }
42194
- else if ((0,lib_platform.isPlatformPreset)(this._platform)) {
42188
+ else if ((0,lib_platform/* isPlatformPreset */.Qm)(this._platform)) {
42195
42189
  await libManifest.addPlatformPreset(this._platform);
42196
42190
  }
42197
42191
  else {
@@ -42210,34 +42204,30 @@ class AddPlatform {
42210
42204
  }
42211
42205
  }
42212
42206
 
42213
- ;// CONCATENATED MODULE: ./src/commands/update-platforms.ts
42207
+ ;// CONCATENATED MODULE: ./src/commands/update.ts
42214
42208
 
42215
42209
 
42216
- const update_platforms_OPTIONS = [
42210
+ const update_OPTIONS = [
42217
42211
  { name: 'verbose', alias: 'v', type: Boolean, defaultValue: false }
42218
42212
  ];
42219
- class UpdatePlatforms {
42213
+ class Update {
42220
42214
  static summary() { return 'Update configuration for all build platforms in package.json.'; }
42221
- static syntax() { return 'neon update-platforms [-b <file>]'; }
42215
+ static syntax() { return 'neon update [-v]'; }
42222
42216
  static options() {
42223
42217
  return [
42224
42218
  { name: '-v, --verbose', summary: 'Enable verbose logging. (Default: false)' }
42225
42219
  ];
42226
42220
  }
42227
- static seeAlso() {
42228
- return [
42229
- { name: 'ncc', summary: '<https://github.com/vercel/ncc>' }
42230
- ];
42231
- }
42221
+ static seeAlso() { }
42232
42222
  static extraSection() { }
42233
42223
  _verbose;
42234
42224
  constructor(argv) {
42235
- const options = dist_default()(update_platforms_OPTIONS, { argv });
42225
+ const options = dist_default()(update_OPTIONS, { argv });
42236
42226
  this._verbose = !!options.verbose;
42237
42227
  }
42238
42228
  log(msg) {
42239
42229
  if (this._verbose) {
42240
- console.error("[neon update-platforms] " + msg);
42230
+ console.error("[neon update] " + msg);
42241
42231
  }
42242
42232
  }
42243
42233
  async run() {
@@ -42365,7 +42355,7 @@ class Preset {
42365
42355
  if (options._unknown.length > 1) {
42366
42356
  throw new Error(`Unexpected argument ${options._unknown[1]}`);
42367
42357
  }
42368
- (0,lib_platform.assertIsPlatformPreset)(options._unknown[0]);
42358
+ (0,lib_platform/* assertIsPlatformPreset */.Zv)(options._unknown[0]);
42369
42359
  this._preset = options._unknown[0];
42370
42360
  }
42371
42361
  log(msg) {
@@ -42374,73 +42364,13 @@ class Preset {
42374
42364
  }
42375
42365
  }
42376
42366
  async run() {
42377
- const map = (0,lib_platform.expandPlatformPreset)(this._preset);
42367
+ const map = (0,lib_platform/* expandPlatformPreset */.EY)(this._preset);
42378
42368
  console.log(JSON.stringify(map, null, 2));
42379
42369
  }
42380
42370
  }
42381
42371
 
42382
- ;// CONCATENATED MODULE: ./data/github.json
42383
- const github_namespaceObject = JSON.parse('{"darwin-arm64":"macOS","darwin-x64":"macOS","ios-arm64":null,"ios-x64":null,"android-arm64":"Linux","android-arm-eabi":"Linux","android-ia32":null,"android-x64":"Linux","win32-arm64-msvc":"Windows","win32-ia32-gnu":null,"win32-ia32-msvc":null,"win32-x64-gnu":null,"win32-x64-msvc":"Windows","linux-arm64-gnu":"Linux","linux-arm64-musl":null,"linux-arm-gnueabihf":"Linux","linux-arm-musleabihf":null,"linux-ia32-gnu":null,"linux-ia32-musl":null,"linux-mips-gnu":null,"linux-mips-musl":null,"linux-mips64-gnuabi64":null,"linux-mips64-muslabi64":null,"linux-mips64el-gnuabi64":null,"linux-mips64el-muslabi64":null,"linux-mipsel-gnu":null,"linux-mipsel-musl":null,"linux-powerpc-gnu":null,"linux-powerpc64-gnu":null,"linux-powerpc64le-gnu":null,"linux-riscv64gc-gnu":null,"linux-s390x-gnu":null,"linux-sparc64-gnu":null,"linux-x64-gnu":"Linux","linux-x64-gnux32":null,"linux-x64-musl":null,"freebsd-ia32":null,"freebsd-x64":null}');
42384
- ;// CONCATENATED MODULE: ./src/ci/github.ts
42385
-
42386
- function sort(platforms) {
42387
- const macOS = new Set();
42388
- const Windows = new Set();
42389
- const Linux = new Set();
42390
- const unsupported = new Set();
42391
- for (const platform of platforms) {
42392
- switch (github_namespaceObject[platform]) {
42393
- case 'macOS':
42394
- macOS.add(platform);
42395
- break;
42396
- case 'Windows':
42397
- Windows.add(platform);
42398
- break;
42399
- case 'Linux':
42400
- Linux.add(platform);
42401
- break;
42402
- default:
42403
- unsupported.add(platform);
42404
- break;
42405
- }
42406
- }
42407
- return {
42408
- macOS: [...macOS],
42409
- Windows: [...Windows],
42410
- Linux: [...Linux],
42411
- unsupported: [...unsupported]
42412
- };
42413
- }
42414
- class GitHub {
42415
- metadata(platforms) {
42416
- return sort(Object.keys(platforms));
42417
- }
42418
- }
42419
-
42420
- ;// CONCATENATED MODULE: ./src/provider.ts
42421
-
42422
- var ProviderName;
42423
- (function (ProviderName) {
42424
- ProviderName["GitHub"] = "github";
42425
- })(ProviderName || (ProviderName = {}));
42426
- ;
42427
- const PROVIDERS = {
42428
- [ProviderName.GitHub]: GitHub
42429
- };
42430
- function isProviderName(s) {
42431
- const keys = Object.values(ProviderName);
42432
- return keys.includes(s);
42433
- }
42434
- function asProviderName(name) {
42435
- if (!isProviderName(name)) {
42436
- throw new RangeError(`CI provider not recognized: ${name}`);
42437
- }
42438
- return name;
42439
- }
42440
- function providerFor(name) {
42441
- return PROVIDERS[name];
42442
- }
42443
-
42372
+ // EXTERNAL MODULE: ./src/provider.ts + 2 modules
42373
+ var provider = __nccwpck_require__(545);
42444
42374
  ;// CONCATENATED MODULE: ./src/commands/ci.ts
42445
42375
 
42446
42376
 
@@ -42478,8 +42408,8 @@ class Ci {
42478
42408
  if (!options._unknown || options._unknown.length === 0) {
42479
42409
  throw new Error("No arguments found, expected <provider>.");
42480
42410
  }
42481
- const providerName = asProviderName(options._unknown[0]);
42482
- const providerCtor = providerFor(providerName);
42411
+ const providerName = (0,provider/* asProviderName */.tb)(options._unknown[0]);
42412
+ const providerCtor = (0,provider/* providerFor */.kq)(providerName);
42483
42413
  this._provider = new providerCtor();
42484
42414
  }
42485
42415
  log(msg) {
@@ -42499,9 +42429,12 @@ class Ci {
42499
42429
 
42500
42430
  // EXTERNAL MODULE: ./src/print.ts + 26 modules
42501
42431
  var print = __nccwpck_require__(9050);
42432
+ // EXTERNAL MODULE: ./src/commands/show.ts + 4 modules
42433
+ var show = __nccwpck_require__(6264);
42502
42434
  ;// CONCATENATED MODULE: ./src/commands/help.ts
42503
42435
 
42504
42436
 
42437
+
42505
42438
  class Help {
42506
42439
  static summary() { return 'Display help information about Neon.'; }
42507
42440
  static syntax() { return 'neon help <command>'; }
@@ -42513,14 +42446,27 @@ class Help {
42513
42446
  static seeAlso() { }
42514
42447
  static extraSection() { }
42515
42448
  _name;
42449
+ _topic;
42516
42450
  constructor(argv) {
42517
42451
  this._name = argv.length > 0 ? asCommandName(argv[0]) : undefined;
42518
- if (argv.length > 1) {
42452
+ this._topic = undefined;
42453
+ if (this._name === CommandName.Show) {
42454
+ if (argv.length === 2) {
42455
+ this._topic = (0,show/* asTopic */.sY)(argv[1]);
42456
+ }
42457
+ if (argv.length > 2) {
42458
+ throw new Error(`Unexpected argument: ${argv[2]}`);
42459
+ }
42460
+ }
42461
+ else if (argv.length > 1) {
42519
42462
  throw new Error(`Unexpected argument: ${argv[1]}`);
42520
42463
  }
42521
42464
  }
42522
42465
  async run() {
42523
- if (this._name) {
42466
+ if (this._topic) {
42467
+ (0,print/* printShowTopicUsage */.v9)(this._topic);
42468
+ }
42469
+ else if (this._name) {
42524
42470
  (0,print/* printCommandUsage */.CZ)(this._name);
42525
42471
  }
42526
42472
  else {
@@ -42539,17 +42485,21 @@ class Help {
42539
42485
 
42540
42486
 
42541
42487
 
42488
+
42542
42489
  var CommandName;
42543
42490
  (function (CommandName) {
42544
42491
  CommandName["Help"] = "help";
42545
42492
  CommandName["Dist"] = "dist";
42546
42493
  CommandName["Bump"] = "bump";
42494
+ CommandName["Add"] = "add";
42495
+ CommandName["Update"] = "update";
42547
42496
  CommandName["AddPlatform"] = "add-platform";
42548
42497
  CommandName["UpdatePlatforms"] = "update-platforms";
42549
42498
  CommandName["ListPlatforms"] = "list-platforms";
42550
42499
  CommandName["CurrentPlatform"] = "current-platform";
42551
42500
  CommandName["Preset"] = "preset";
42552
42501
  CommandName["Ci"] = "ci";
42502
+ CommandName["Show"] = "show";
42553
42503
  })(CommandName || (CommandName = {}));
42554
42504
  ;
42555
42505
  function isCommandName(s) {
@@ -42566,12 +42516,15 @@ const COMMANDS = {
42566
42516
  [CommandName.Help]: Help,
42567
42517
  [CommandName.Dist]: Dist,
42568
42518
  [CommandName.Bump]: Bump,
42569
- [CommandName.AddPlatform]: AddPlatform,
42570
- [CommandName.UpdatePlatforms]: UpdatePlatforms,
42519
+ [CommandName.Add]: Add,
42520
+ [CommandName.Update]: Update,
42521
+ [CommandName.AddPlatform]: Add,
42522
+ [CommandName.UpdatePlatforms]: Update,
42571
42523
  [CommandName.ListPlatforms]: ListPlatforms,
42572
42524
  [CommandName.CurrentPlatform]: CurrentPlatform,
42573
42525
  [CommandName.Preset]: Preset,
42574
- [CommandName.Ci]: Ci
42526
+ [CommandName.Ci]: Ci,
42527
+ [CommandName.Show]: show/* default */.ZP
42575
42528
  };
42576
42529
  function commandFor(name) {
42577
42530
  return COMMANDS[name];
@@ -42581,16 +42534,312 @@ function summaries() {
42581
42534
  { name: CommandName.Help, summary: Help.summary() },
42582
42535
  { name: CommandName.Dist, summary: Dist.summary() },
42583
42536
  { name: CommandName.Bump, summary: Bump.summary() },
42584
- { name: CommandName.AddPlatform, summary: AddPlatform.summary() },
42585
- { name: CommandName.UpdatePlatforms, summary: UpdatePlatforms.summary() },
42586
- { name: CommandName.ListPlatforms, summary: ListPlatforms.summary() },
42587
- { name: CommandName.CurrentPlatform, summary: CurrentPlatform.summary() },
42588
- { name: CommandName.Preset, summary: Preset.summary() },
42589
- { name: CommandName.Ci, summary: Ci.summary() }
42537
+ { name: CommandName.Add, summary: Add.summary() },
42538
+ { name: CommandName.Update, summary: Update.summary() },
42539
+ { name: CommandName.Show, summary: show/* default.summary */.ZP.summary() }
42590
42540
  ];
42591
42541
  }
42592
42542
 
42593
42543
 
42544
+ /***/ }),
42545
+
42546
+ /***/ 6264:
42547
+ /***/ ((__unused_webpack_module, __webpack_exports__, __nccwpck_require__) => {
42548
+
42549
+
42550
+ // EXPORTS
42551
+ __nccwpck_require__.d(__webpack_exports__, {
42552
+ "sY": () => (/* binding */ asTopic),
42553
+ "ZP": () => (/* binding */ Show),
42554
+ "D8": () => (/* binding */ subcommandFor)
42555
+ });
42556
+
42557
+ // UNUSED EXPORTS: Topic
42558
+
42559
+ // EXTERNAL MODULE: ../node_modules/command-line-args/dist/index.js
42560
+ var dist = __nccwpck_require__(7898);
42561
+ var dist_default = /*#__PURE__*/__nccwpck_require__.n(dist);
42562
+ // EXTERNAL MODULE: ../node_modules/@neon-rs/manifest/lib/index.mjs
42563
+ var lib = __nccwpck_require__(347);
42564
+ ;// CONCATENATED MODULE: ./src/commands/show/platforms.ts
42565
+
42566
+
42567
+ const OPTIONS = [
42568
+ { name: 'verbose', alias: 'v', type: Boolean, defaultValue: false }
42569
+ ];
42570
+ class Platforms {
42571
+ static summary() { return 'Display information about this project\'s supported platforms.'; }
42572
+ static syntax() { return 'neon show platforms [-v]'; }
42573
+ static options() {
42574
+ return [
42575
+ { name: '-v, --verbose', summary: 'Enable verbose logging. (Default: false)' }
42576
+ ];
42577
+ }
42578
+ static seeAlso() { }
42579
+ static extraSection() { }
42580
+ _verbose;
42581
+ constructor(argv) {
42582
+ const options = dist_default()(OPTIONS, { argv, partial: true });
42583
+ this._verbose = !!options.verbose;
42584
+ }
42585
+ log(msg) {
42586
+ if (this._verbose) {
42587
+ console.error("[neon show platforms] " + msg);
42588
+ }
42589
+ }
42590
+ async run() {
42591
+ this.log(`reading package.json`);
42592
+ const libManifest = await lib/* LibraryManifest.load */.N.load();
42593
+ this.log(`manifest: ${libManifest.stringify()}`);
42594
+ const platforms = libManifest.allPlatforms();
42595
+ console.log(JSON.stringify(platforms, null, 2));
42596
+ }
42597
+ }
42598
+
42599
+ // EXTERNAL MODULE: ./src/provider.ts + 2 modules
42600
+ var provider = __nccwpck_require__(545);
42601
+ ;// CONCATENATED MODULE: ./src/commands/show/ci.ts
42602
+
42603
+
42604
+
42605
+ const ci_OPTIONS = [
42606
+ { name: 'verbose', alias: 'v', type: Boolean, defaultValue: false }
42607
+ ];
42608
+ class CI {
42609
+ static summary() { return 'Display CI metadata for this project\'s platforms.'; }
42610
+ static syntax() { return 'neon show ci [-v] <provider>'; }
42611
+ static options() {
42612
+ return [
42613
+ { name: '-v, --verbose', summary: 'Enable verbose logging. (Default: false)' },
42614
+ { name: '<provider>', summary: 'CI provider, which can be one of the supported providers listed below.' }
42615
+ ];
42616
+ }
42617
+ static seeAlso() {
42618
+ return [
42619
+ { name: 'GitHub Actions', summary: '<https://docs.github.com/actions>' }
42620
+ ];
42621
+ }
42622
+ static extraSection() {
42623
+ return {
42624
+ title: 'CI Providers',
42625
+ details: [
42626
+ { name: 'github', summary: 'GitHub Actions.' }
42627
+ ]
42628
+ };
42629
+ }
42630
+ _verbose;
42631
+ _provider;
42632
+ constructor(argv) {
42633
+ const options = dist_default()(ci_OPTIONS, { argv, partial: true });
42634
+ this._verbose = !!options.verbose;
42635
+ if (!options._unknown || options._unknown.length === 0) {
42636
+ throw new Error("No arguments found, expected <provider>.");
42637
+ }
42638
+ const providerName = (0,provider/* asProviderName */.tb)(options._unknown[0]);
42639
+ const providerCtor = (0,provider/* providerFor */.kq)(providerName);
42640
+ this._provider = new providerCtor();
42641
+ }
42642
+ log(msg) {
42643
+ if (this._verbose) {
42644
+ console.error("[neon show ci] " + msg);
42645
+ }
42646
+ }
42647
+ async run() {
42648
+ this.log(`reading package.json`);
42649
+ const libManifest = await lib/* LibraryManifest.load */.N.load();
42650
+ this.log(`manifest: ${libManifest.stringify()}`);
42651
+ const platforms = libManifest.allPlatforms();
42652
+ const metadata = this._provider.metadata(platforms);
42653
+ console.log(JSON.stringify(metadata, null, 2));
42654
+ }
42655
+ }
42656
+
42657
+ // EXTERNAL MODULE: ../node_modules/@neon-rs/manifest/lib/platform.mjs
42658
+ var platform = __nccwpck_require__(8140);
42659
+ ;// CONCATENATED MODULE: ./src/commands/show/preset.ts
42660
+
42661
+
42662
+ const preset_OPTIONS = [
42663
+ { name: 'verbose', alias: 'v', type: Boolean, defaultValue: false }
42664
+ ];
42665
+ class Preset {
42666
+ static summary() { return 'Display target information about a platform preset.'; }
42667
+ static syntax() { return 'neon show preset [-v] <preset>'; }
42668
+ static options() {
42669
+ return [
42670
+ { name: '-v, --verbose', summary: 'Enable verbose logging. (Default: false)' },
42671
+ { name: '<preset>', summary: 'The target family preset to look up.' },
42672
+ ];
42673
+ }
42674
+ static seeAlso() { }
42675
+ static extraSection() { }
42676
+ _json;
42677
+ _verbose;
42678
+ _preset;
42679
+ constructor(argv) {
42680
+ const options = dist_default()(preset_OPTIONS, { argv, partial: true });
42681
+ this._json = options.json || false;
42682
+ this._verbose = !!options.verbose;
42683
+ if (!options._unknown || options._unknown.length === 0) {
42684
+ throw new Error("Missing argument, expected <preset>");
42685
+ }
42686
+ if (options._unknown.length > 1) {
42687
+ throw new Error(`Unexpected argument ${options._unknown[1]}`);
42688
+ }
42689
+ (0,platform/* assertIsPlatformPreset */.Zv)(options._unknown[0]);
42690
+ this._preset = options._unknown[0];
42691
+ }
42692
+ log(msg) {
42693
+ if (this._verbose) {
42694
+ console.error("[neon show preset] " + msg);
42695
+ }
42696
+ }
42697
+ async run() {
42698
+ const map = (0,platform/* expandPlatformPreset */.EY)(this._preset);
42699
+ console.log(JSON.stringify(map, null, 2));
42700
+ }
42701
+ }
42702
+
42703
+ // EXTERNAL MODULE: ./node_modules/@neon-rs/load/dist/index.js
42704
+ var load_dist = __nccwpck_require__(8938);
42705
+ ;// CONCATENATED MODULE: ./src/commands/show/system.ts
42706
+
42707
+
42708
+ const system_OPTIONS = [
42709
+ { name: 'json', type: Boolean, defaultValue: false },
42710
+ { name: 'verbose', alias: 'v', type: Boolean, defaultValue: false }
42711
+ ];
42712
+ class System {
42713
+ static summary() { return 'Display information about the current system.'; }
42714
+ static syntax() { return 'neon show system [--json] [-v]'; }
42715
+ static options() {
42716
+ return [
42717
+ { name: '--json', summary: 'Display platform info in JSON format. (Default: false)' },
42718
+ { name: '-v, --verbose', summary: 'Enable verbose logging. (Default: false)' }
42719
+ ];
42720
+ }
42721
+ static seeAlso() { }
42722
+ static extraSection() { }
42723
+ _json;
42724
+ _verbose;
42725
+ constructor(argv) {
42726
+ const options = dist_default()(system_OPTIONS, { argv, partial: true });
42727
+ this._json = options.json || false;
42728
+ this._verbose = !!options.verbose;
42729
+ }
42730
+ log(msg) {
42731
+ if (this._verbose) {
42732
+ console.error("[neon show system] " + msg);
42733
+ }
42734
+ }
42735
+ async run() {
42736
+ if (this._json) {
42737
+ const [os, arch, abi] = (0,load_dist/* currentPlatform */.ob)().split('-');
42738
+ const json = {
42739
+ os,
42740
+ arch,
42741
+ abi: abi || null
42742
+ };
42743
+ console.log(JSON.stringify(json, null, 2));
42744
+ }
42745
+ else {
42746
+ console.log((0,load_dist/* currentPlatform */.ob)());
42747
+ }
42748
+ }
42749
+ }
42750
+
42751
+ ;// CONCATENATED MODULE: ./src/commands/show.ts
42752
+
42753
+
42754
+
42755
+
42756
+
42757
+ const show_OPTIONS = [
42758
+ { name: 'verbose', alias: 'v', type: Boolean, defaultValue: false }
42759
+ ];
42760
+ var Topic;
42761
+ (function (Topic) {
42762
+ Topic["PLATFORMS"] = "platforms";
42763
+ Topic["SYSTEM"] = "system";
42764
+ Topic["PRESET"] = "preset";
42765
+ Topic["CI"] = "ci";
42766
+ })(Topic || (Topic = {}));
42767
+ function subcommandFor(topic) {
42768
+ switch (topic) {
42769
+ case Topic.CI:
42770
+ return CI;
42771
+ case Topic.PLATFORMS:
42772
+ return Platforms;
42773
+ case Topic.PRESET:
42774
+ return Preset;
42775
+ case Topic.SYSTEM:
42776
+ return System;
42777
+ }
42778
+ }
42779
+ function isTopic(x) {
42780
+ return ['platforms', 'system', 'preset', 'ci'].includes(x);
42781
+ }
42782
+ function asTopic(x) {
42783
+ if (!isTopic(x)) {
42784
+ throw new RangeError(`expected <topic>, got ${x}`);
42785
+ }
42786
+ return x;
42787
+ }
42788
+ function assertIsTopic(x) {
42789
+ if (!isTopic(x)) {
42790
+ throw new RangeError(`expected <topic>, got ${x}`);
42791
+ }
42792
+ }
42793
+ class Show {
42794
+ static summary() { return 'Display information about the project or current system.'; }
42795
+ static syntax() { return 'neon show <topic>'; }
42796
+ static options() {
42797
+ return [
42798
+ { name: '<topic>', summary: 'The topic to display information about.' },
42799
+ { name: '', summary: 'Run `neon help show <topic>` for details about a topic.' }
42800
+ ];
42801
+ }
42802
+ static seeAlso() { }
42803
+ static extraSection() {
42804
+ return {
42805
+ title: 'Topics',
42806
+ details: [
42807
+ { name: 'ci', summary: 'CI metadata for this project\'s platforms.' },
42808
+ { name: 'platforms', summary: 'Information about this project\'s supported platforms.' },
42809
+ { name: 'preset', summary: 'Target information about a platform preset.' },
42810
+ { name: 'system', summary: 'Information about the current system.' }
42811
+ ]
42812
+ };
42813
+ }
42814
+ _topic;
42815
+ _argv;
42816
+ constructor(argv) {
42817
+ const options = dist_default()(show_OPTIONS, { argv, stopAtFirstUnknown: true, partial: true });
42818
+ if (!options._unknown || options._unknown.length === 0) {
42819
+ throw new Error("Missing argument, expected <topic>");
42820
+ }
42821
+ assertIsTopic(options._unknown[0]);
42822
+ this._topic = options._unknown[0];
42823
+ this._argv = options._unknown.slice(1);
42824
+ }
42825
+ subcommand() {
42826
+ switch (this._topic) {
42827
+ case Topic.PLATFORMS:
42828
+ return new Platforms(this._argv);
42829
+ case Topic.CI:
42830
+ return new CI(this._argv);
42831
+ case Topic.PRESET:
42832
+ return new Preset(this._argv);
42833
+ case Topic.SYSTEM:
42834
+ return new System(this._argv);
42835
+ }
42836
+ }
42837
+ async run() {
42838
+ await this.subcommand().run();
42839
+ }
42840
+ }
42841
+
42842
+
42594
42843
  /***/ }),
42595
42844
 
42596
42845
  /***/ 8613:
@@ -42600,7 +42849,7 @@ __nccwpck_require__.a(module, async (__webpack_handle_async_dependencies__, __we
42600
42849
  /* harmony import */ var command_line_commands__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(5046);
42601
42850
  /* harmony import */ var command_line_commands__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nccwpck_require__.n(command_line_commands__WEBPACK_IMPORTED_MODULE_0__);
42602
42851
  /* harmony import */ var _print_js__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(9050);
42603
- /* harmony import */ var _command_js__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(3149);
42852
+ /* harmony import */ var _command_js__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(3129);
42604
42853
  /* harmony import */ var node_module__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(2033);
42605
42854
  /* harmony import */ var node_module__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nccwpck_require__.n(node_module__WEBPACK_IMPORTED_MODULE_3__);
42606
42855
 
@@ -42661,7 +42910,8 @@ __nccwpck_require__.d(__webpack_exports__, {
42661
42910
  "CZ": () => (/* binding */ printCommandUsage),
42662
42911
  "OS": () => (/* binding */ printError),
42663
42912
  "Yv": () => (/* binding */ printErrorWithUsage),
42664
- "yY": () => (/* binding */ printMainUsage)
42913
+ "yY": () => (/* binding */ printMainUsage),
42914
+ "v9": () => (/* binding */ printShowTopicUsage)
42665
42915
  });
42666
42916
 
42667
42917
  ;// CONCATENATED MODULE: ../node_modules/command-line-usage/node_modules/array-back/index.js
@@ -45628,12 +45878,15 @@ const chalkStderr = createChalk({level: stderrColor ? stderrColor.level : 0});
45628
45878
 
45629
45879
  /* harmony default export */ const chalk_source = (chalk);
45630
45880
 
45631
- // EXTERNAL MODULE: ./src/command.ts + 40 modules
45632
- var command = __nccwpck_require__(3149);
45881
+ // EXTERNAL MODULE: ./src/command.ts + 35 modules
45882
+ var command = __nccwpck_require__(3129);
45883
+ // EXTERNAL MODULE: ./src/commands/show.ts + 4 modules
45884
+ var show = __nccwpck_require__(6264);
45633
45885
  ;// CONCATENATED MODULE: ./src/print.ts
45634
45886
 
45635
45887
 
45636
45888
 
45889
+
45637
45890
  function pink(text) {
45638
45891
  return chalk_source.bold.hex('#e75480')(text);
45639
45892
  }
@@ -45652,7 +45905,7 @@ function purple(text) {
45652
45905
  function commandUsage(name, command) {
45653
45906
  const sections = [
45654
45907
  {
45655
- content: `${pink('Neon:')} ${name} - ${command.summary()}`,
45908
+ content: `${pink('neon ' + name)} - ${command.summary()}`,
45656
45909
  raw: true
45657
45910
  },
45658
45911
  {
@@ -45677,7 +45930,7 @@ function commandUsage(name, command) {
45677
45930
  function mainUsage() {
45678
45931
  const sections = [
45679
45932
  {
45680
- content: `${pink('Neon:')} the npm packaging tool for Rust addons`,
45933
+ content: `${pink('neon')} - manage and distribute Neon projects`,
45681
45934
  raw: true
45682
45935
  },
45683
45936
  {
@@ -45691,6 +45944,9 @@ function mainUsage() {
45691
45944
  ];
45692
45945
  return command_line_usage(sections).trim();
45693
45946
  }
45947
+ function printShowTopicUsage(topic) {
45948
+ console.error(commandUsage("show " + topic, (0,show/* subcommandFor */.D8)(topic)));
45949
+ }
45694
45950
  function printCommandUsage(name) {
45695
45951
  console.error(commandUsage(name, (0,command/* commandFor */.Nl)(name)));
45696
45952
  }
@@ -45709,6 +45965,83 @@ function printError(e) {
45709
45965
  }
45710
45966
 
45711
45967
 
45968
+ /***/ }),
45969
+
45970
+ /***/ 545:
45971
+ /***/ ((__unused_webpack_module, __webpack_exports__, __nccwpck_require__) => {
45972
+
45973
+
45974
+ // EXPORTS
45975
+ __nccwpck_require__.d(__webpack_exports__, {
45976
+ "tb": () => (/* binding */ asProviderName),
45977
+ "kq": () => (/* binding */ providerFor)
45978
+ });
45979
+
45980
+ // UNUSED EXPORTS: ProviderName, isProviderName
45981
+
45982
+ ;// CONCATENATED MODULE: ./data/github.json
45983
+ const github_namespaceObject = JSON.parse('{"darwin-arm64":"macOS","darwin-x64":"macOS","ios-arm64":null,"ios-x64":null,"android-arm64":"Linux","android-arm-eabi":"Linux","android-ia32":null,"android-x64":"Linux","win32-arm64-msvc":"Windows","win32-ia32-gnu":null,"win32-ia32-msvc":null,"win32-x64-gnu":null,"win32-x64-msvc":"Windows","linux-arm64-gnu":"Linux","linux-arm64-musl":null,"linux-arm-gnueabihf":"Linux","linux-arm-musleabihf":null,"linux-ia32-gnu":null,"linux-ia32-musl":null,"linux-mips-gnu":null,"linux-mips-musl":null,"linux-mips64-gnuabi64":null,"linux-mips64-muslabi64":null,"linux-mips64el-gnuabi64":null,"linux-mips64el-muslabi64":null,"linux-mipsel-gnu":null,"linux-mipsel-musl":null,"linux-powerpc-gnu":null,"linux-powerpc64-gnu":null,"linux-powerpc64le-gnu":null,"linux-riscv64gc-gnu":null,"linux-s390x-gnu":null,"linux-sparc64-gnu":null,"linux-x64-gnu":"Linux","linux-x64-gnux32":null,"linux-x64-musl":null,"freebsd-ia32":null,"freebsd-x64":null}');
45984
+ ;// CONCATENATED MODULE: ./src/ci/github.ts
45985
+
45986
+ function sort(platforms) {
45987
+ const macOS = new Set();
45988
+ const Windows = new Set();
45989
+ const Linux = new Set();
45990
+ const unsupported = new Set();
45991
+ for (const platform of platforms) {
45992
+ switch (github_namespaceObject[platform]) {
45993
+ case 'macOS':
45994
+ macOS.add(platform);
45995
+ break;
45996
+ case 'Windows':
45997
+ Windows.add(platform);
45998
+ break;
45999
+ case 'Linux':
46000
+ Linux.add(platform);
46001
+ break;
46002
+ default:
46003
+ unsupported.add(platform);
46004
+ break;
46005
+ }
46006
+ }
46007
+ return {
46008
+ macOS: [...macOS],
46009
+ Windows: [...Windows],
46010
+ Linux: [...Linux],
46011
+ unsupported: [...unsupported]
46012
+ };
46013
+ }
46014
+ class GitHub {
46015
+ metadata(platforms) {
46016
+ return sort(Object.keys(platforms));
46017
+ }
46018
+ }
46019
+
46020
+ ;// CONCATENATED MODULE: ./src/provider.ts
46021
+
46022
+ var ProviderName;
46023
+ (function (ProviderName) {
46024
+ ProviderName["GitHub"] = "github";
46025
+ })(ProviderName || (ProviderName = {}));
46026
+ ;
46027
+ const PROVIDERS = {
46028
+ [ProviderName.GitHub]: GitHub
46029
+ };
46030
+ function isProviderName(s) {
46031
+ const keys = Object.values(ProviderName);
46032
+ return keys.includes(s);
46033
+ }
46034
+ function asProviderName(name) {
46035
+ if (!isProviderName(name)) {
46036
+ throw new RangeError(`CI provider not recognized: ${name}`);
46037
+ }
46038
+ return name;
46039
+ }
46040
+ function providerFor(name) {
46041
+ return PROVIDERS[name];
46042
+ }
46043
+
46044
+
45712
46045
  /***/ }),
45713
46046
 
45714
46047
  /***/ 1738:
@@ -61533,6 +61866,36 @@ class AbstractManifest {
61533
61866
  exports.AbstractManifest = AbstractManifest;
61534
61867
 
61535
61868
 
61869
+ /***/ }),
61870
+
61871
+ /***/ 347:
61872
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __nccwpck_require__) => {
61873
+
61874
+ /* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
61875
+ /* harmony export */ "N": () => (/* reexport safe */ _index_cjs__WEBPACK_IMPORTED_MODULE_0__.N)
61876
+ /* harmony export */ });
61877
+ /* harmony import */ var _index_cjs__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(4696);
61878
+
61879
+
61880
+
61881
+ /***/ }),
61882
+
61883
+ /***/ 8140:
61884
+ /***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __nccwpck_require__) => {
61885
+
61886
+ /* harmony export */ __nccwpck_require__.d(__webpack_exports__, {
61887
+ /* harmony export */ "EY": () => (/* reexport safe */ _platform_cjs__WEBPACK_IMPORTED_MODULE_0__.expandPlatformPreset),
61888
+ /* harmony export */ "FZ": () => (/* reexport safe */ _platform_cjs__WEBPACK_IMPORTED_MODULE_0__.isRustTarget),
61889
+ /* harmony export */ "Qm": () => (/* reexport safe */ _platform_cjs__WEBPACK_IMPORTED_MODULE_0__.isPlatformPreset),
61890
+ /* harmony export */ "Zv": () => (/* reexport safe */ _platform_cjs__WEBPACK_IMPORTED_MODULE_0__.assertIsPlatformPreset),
61891
+ /* harmony export */ "bC": () => (/* reexport safe */ _platform_cjs__WEBPACK_IMPORTED_MODULE_0__.isNodePlatform),
61892
+ /* harmony export */ "or": () => (/* reexport safe */ _platform_cjs__WEBPACK_IMPORTED_MODULE_0__.assertIsNodePlatform),
61893
+ /* harmony export */ "sD": () => (/* reexport safe */ _platform_cjs__WEBPACK_IMPORTED_MODULE_0__.assertIsRustTarget)
61894
+ /* harmony export */ });
61895
+ /* harmony import */ var _platform_cjs__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(2147);
61896
+
61897
+
61898
+
61536
61899
  /***/ }),
61537
61900
 
61538
61901
  /***/ 2642:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neon-rs/cli",
3
- "version": "0.1.66",
3
+ "version": "0.1.68",
4
4
  "description": "Command-line build tool for Neon modules.",
5
5
  "type": "module",
6
6
  "exports": "./index.js",
@@ -27,12 +27,12 @@
27
27
  },
28
28
  "homepage": "https://github.com/dherman/neon-rs#readme",
29
29
  "optionalDependencies": {
30
- "@cargo-messages/android-arm-eabi": "0.1.65",
31
- "@cargo-messages/darwin-arm64": "0.1.65",
32
- "@cargo-messages/darwin-x64": "0.1.65",
33
- "@cargo-messages/linux-arm-gnueabihf": "0.1.65",
34
- "@cargo-messages/linux-x64-gnu": "0.1.65",
35
- "@cargo-messages/win32-arm64-msvc": "0.1.65",
36
- "@cargo-messages/win32-x64-msvc": "0.1.65"
30
+ "@cargo-messages/android-arm-eabi": "0.1.67",
31
+ "@cargo-messages/darwin-arm64": "0.1.67",
32
+ "@cargo-messages/darwin-x64": "0.1.67",
33
+ "@cargo-messages/linux-arm-gnueabihf": "0.1.67",
34
+ "@cargo-messages/linux-x64-gnu": "0.1.67",
35
+ "@cargo-messages/win32-arm64-msvc": "0.1.67",
36
+ "@cargo-messages/win32-x64-msvc": "0.1.67"
37
37
  }
38
38
  }