@neon-rs/cli 0.0.185 → 0.0.195

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 +128 -6
  2. package/package.json +8 -8
package/index.js CHANGED
@@ -44449,7 +44449,7 @@ function wrappy (fn, cb) {
44449
44449
 
44450
44450
  /***/ }),
44451
44451
 
44452
- /***/ 5291:
44452
+ /***/ 4528:
44453
44453
  /***/ ((__unused_webpack_module, __webpack_exports__, __nccwpck_require__) => {
44454
44454
 
44455
44455
 
@@ -47433,6 +47433,124 @@ class Preset {
47433
47433
  }
47434
47434
  }
47435
47435
 
47436
+ ;// CONCATENATED MODULE: ./data/github.json
47437
+ 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}');
47438
+ ;// CONCATENATED MODULE: ./src/ci/github.ts
47439
+
47440
+ function sort(platforms) {
47441
+ const macOS = new Set();
47442
+ const Windows = new Set();
47443
+ const Linux = new Set();
47444
+ const unsupported = new Set();
47445
+ for (const platform of platforms) {
47446
+ switch (github_namespaceObject[platform]) {
47447
+ case 'macOS':
47448
+ macOS.add(platform);
47449
+ break;
47450
+ case 'Windows':
47451
+ Windows.add(platform);
47452
+ break;
47453
+ case 'Linux':
47454
+ Linux.add(platform);
47455
+ break;
47456
+ default:
47457
+ unsupported.add(platform);
47458
+ break;
47459
+ }
47460
+ }
47461
+ return {
47462
+ macOS: [...macOS],
47463
+ Windows: [...Windows],
47464
+ Linux: [...Linux],
47465
+ unsupported: [...unsupported]
47466
+ };
47467
+ }
47468
+ class GitHub {
47469
+ metadata(platforms) {
47470
+ return sort(Object.keys(platforms));
47471
+ }
47472
+ }
47473
+
47474
+ ;// CONCATENATED MODULE: ./src/provider.ts
47475
+
47476
+ var ProviderName;
47477
+ (function (ProviderName) {
47478
+ ProviderName["GitHub"] = "github";
47479
+ })(ProviderName || (ProviderName = {}));
47480
+ ;
47481
+ const PROVIDERS = {
47482
+ [ProviderName.GitHub]: GitHub
47483
+ };
47484
+ function isProviderName(s) {
47485
+ const keys = Object.values(ProviderName);
47486
+ return keys.includes(s);
47487
+ }
47488
+ function asProviderName(name) {
47489
+ if (!isProviderName(name)) {
47490
+ throw new RangeError(`CI provider not recognized: ${name}`);
47491
+ }
47492
+ return name;
47493
+ }
47494
+ function providerFor(name) {
47495
+ return PROVIDERS[name];
47496
+ }
47497
+
47498
+ ;// CONCATENATED MODULE: ./src/commands/ci.ts
47499
+
47500
+
47501
+
47502
+ const ci_OPTIONS = [
47503
+ { name: 'verbose', alias: 'v', type: Boolean, defaultValue: false }
47504
+ ];
47505
+ class Ci {
47506
+ static summary() { return 'Display CI metadata for this project\'s platforms.'; }
47507
+ static syntax() { return 'neon ci [-v] <provider>'; }
47508
+ static options() {
47509
+ return [
47510
+ { name: '-v, --verbose', summary: 'Enable verbose logging. (Default: false)' },
47511
+ { name: '<provider>', summary: 'CI provider, which can be one of the supported providers listed below.' }
47512
+ ];
47513
+ }
47514
+ static seeAlso() {
47515
+ return [
47516
+ { name: 'GitHub Actions', summary: '<https://docs.github.com/actions>' }
47517
+ ];
47518
+ }
47519
+ static extraSection() {
47520
+ return {
47521
+ title: 'CI Providers',
47522
+ details: [
47523
+ { name: 'github', summary: 'GitHub Actions.' }
47524
+ ]
47525
+ };
47526
+ }
47527
+ _verbose;
47528
+ _provider;
47529
+ constructor(argv) {
47530
+ const options = dist_default()(ci_OPTIONS, { argv, partial: true });
47531
+ this._verbose = !!options.verbose;
47532
+ if (!options._unknown || options._unknown.length === 0) {
47533
+ throw new Error("No arguments found, expected <provider>.");
47534
+ }
47535
+ const providerName = asProviderName(options._unknown[0]);
47536
+ const providerCtor = providerFor(providerName);
47537
+ this._provider = new providerCtor();
47538
+ }
47539
+ log(msg) {
47540
+ if (this._verbose) {
47541
+ console.error("[neon ci] " + msg);
47542
+ }
47543
+ }
47544
+ async run() {
47545
+ this.log(`reading package.json`);
47546
+ const libManifest = await LibraryManifest.load();
47547
+ this.log(`manifest: ${libManifest.stringify()}`);
47548
+ const platforms = libManifest.allPlatforms();
47549
+ const metadata = this._provider.metadata(platforms);
47550
+ console.log(JSON.stringify(metadata, null, 2));
47551
+ }
47552
+ }
47553
+
47436
47554
  // EXTERNAL MODULE: ./src/print.ts + 26 modules
47437
47555
  var print = __nccwpck_require__(9050);
47438
47556
  ;// CONCATENATED MODULE: ./src/commands/help.ts
@@ -47476,6 +47594,7 @@ class Help {
47476
47594
 
47477
47595
 
47478
47596
 
47597
+
47479
47598
  var CommandName;
47480
47599
  (function (CommandName) {
47481
47600
  CommandName["Help"] = "help";
@@ -47492,6 +47611,7 @@ var CommandName;
47492
47611
  CommandName["CurrentPlatform"] = "current-platform";
47493
47612
  CommandName["RustTarget"] = "rust-target";
47494
47613
  CommandName["Preset"] = "preset";
47614
+ CommandName["Ci"] = "ci";
47495
47615
  })(CommandName || (CommandName = {}));
47496
47616
  ;
47497
47617
  function isCommandName(s) {
@@ -47518,7 +47638,8 @@ const COMMANDS = {
47518
47638
  [CommandName.ListPlatforms]: ListPlatforms,
47519
47639
  [CommandName.CurrentPlatform]: CurrentPlatform,
47520
47640
  [CommandName.RustTarget]: RustTarget,
47521
- [CommandName.Preset]: Preset
47641
+ [CommandName.Preset]: Preset,
47642
+ [CommandName.Ci]: Ci
47522
47643
  };
47523
47644
  function commandFor(name) {
47524
47645
  return COMMANDS[name];
@@ -47532,7 +47653,8 @@ function summaries() {
47532
47653
  { name: CommandName.UpdatePlatforms, summary: UpdatePlatforms.summary() },
47533
47654
  { name: CommandName.ListPlatforms, summary: ListPlatforms.summary() },
47534
47655
  { name: CommandName.CurrentPlatform, summary: CurrentPlatform.summary() },
47535
- { name: CommandName.Preset, summary: Preset.summary() }
47656
+ { name: CommandName.Preset, summary: Preset.summary() },
47657
+ { name: CommandName.Ci, summary: Ci.summary() }
47536
47658
  ];
47537
47659
  }
47538
47660
 
@@ -47546,7 +47668,7 @@ __nccwpck_require__.a(module, async (__webpack_handle_async_dependencies__, __we
47546
47668
  /* harmony import */ var command_line_commands__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(5046);
47547
47669
  /* harmony import */ var command_line_commands__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nccwpck_require__.n(command_line_commands__WEBPACK_IMPORTED_MODULE_0__);
47548
47670
  /* harmony import */ var _print_js__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(9050);
47549
- /* harmony import */ var _command_js__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(5291);
47671
+ /* harmony import */ var _command_js__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(4528);
47550
47672
  /* harmony import */ var node_module__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(2033);
47551
47673
  /* harmony import */ var node_module__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nccwpck_require__.n(node_module__WEBPACK_IMPORTED_MODULE_3__);
47552
47674
 
@@ -50569,8 +50691,8 @@ const chalkStderr = createChalk({level: stderrColor ? stderrColor.level : 0});
50569
50691
 
50570
50692
  /* harmony default export */ const chalk_source = (chalk);
50571
50693
 
50572
- // EXTERNAL MODULE: ./src/command.ts + 42 modules
50573
- var command = __nccwpck_require__(5291);
50694
+ // EXTERNAL MODULE: ./src/command.ts + 46 modules
50695
+ var command = __nccwpck_require__(4528);
50574
50696
  ;// CONCATENATED MODULE: ./src/print.ts
50575
50697
 
50576
50698
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neon-rs/cli",
3
- "version": "0.0.185",
3
+ "version": "0.0.195",
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.0.185",
31
- "@cargo-messages/darwin-arm64": "0.0.185",
32
- "@cargo-messages/darwin-x64": "0.0.185",
33
- "@cargo-messages/linux-arm-gnueabihf": "0.0.185",
34
- "@cargo-messages/linux-x64-gnu": "0.0.185",
35
- "@cargo-messages/win32-arm64-msvc": "0.0.185",
36
- "@cargo-messages/win32-x64-msvc": "0.0.185"
30
+ "@cargo-messages/android-arm-eabi": "0.0.195",
31
+ "@cargo-messages/darwin-arm64": "0.0.195",
32
+ "@cargo-messages/darwin-x64": "0.0.195",
33
+ "@cargo-messages/linux-arm-gnueabihf": "0.0.195",
34
+ "@cargo-messages/linux-x64-gnu": "0.0.195",
35
+ "@cargo-messages/win32-arm64-msvc": "0.0.195",
36
+ "@cargo-messages/win32-x64-msvc": "0.0.195"
37
37
  }
38
38
  }