@neon-rs/cli 0.0.184 → 0.0.186
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.
- package/index.js +198 -59
- package/package.json +8 -8
package/index.js
CHANGED
|
@@ -44449,7 +44449,7 @@ function wrappy (fn, cb) {
|
|
|
44449
44449
|
|
|
44450
44450
|
/***/ }),
|
|
44451
44451
|
|
|
44452
|
-
/***/
|
|
44452
|
+
/***/ 4528:
|
|
44453
44453
|
/***/ ((__unused_webpack_module, __webpack_exports__, __nccwpck_require__) => {
|
|
44454
44454
|
|
|
44455
44455
|
|
|
@@ -44489,7 +44489,7 @@ const OPTIONS = [
|
|
|
44489
44489
|
{ name: 'log', alias: 'l', type: String, defaultValue: null },
|
|
44490
44490
|
{ name: 'mount', alias: 'm', type: String, defaultValue: null },
|
|
44491
44491
|
{ name: 'manifest-path', type: String, defaultValue: null },
|
|
44492
|
-
{ name: 'out', alias: 'o', type: String, defaultValue:
|
|
44492
|
+
{ name: 'out', alias: 'o', type: String, defaultValue: null },
|
|
44493
44493
|
{ name: 'verbose', alias: 'v', type: Boolean, defaultValue: false }
|
|
44494
44494
|
];
|
|
44495
44495
|
function createInputStream(file) {
|
|
@@ -44517,7 +44517,7 @@ class Dist {
|
|
|
44517
44517
|
summary: 'Mounted path of target directory in virtual filesystem. This is used to map paths from the log data back to their real paths, needed when tools such as cross-rs report messages from within a mounted Docker filesystem.'
|
|
44518
44518
|
},
|
|
44519
44519
|
{ name: '--manifest-path <path>', summary: 'Real path to Cargo.toml. (Default: cargo behavior)' },
|
|
44520
|
-
{ name: '-o, --out <dist>', summary: 'Copy output to file <dist>. (Default: index.node)' },
|
|
44520
|
+
{ name: '-o, --out <dist>', summary: 'Copy output to file <dist>. (Default: $NEON_DIST_OUTPUT or index.node)' },
|
|
44521
44521
|
{ name: '-v, --verbose', summary: 'Enable verbose logging. (Default: false)' }
|
|
44522
44522
|
];
|
|
44523
44523
|
}
|
|
@@ -44552,7 +44552,9 @@ class Dist {
|
|
|
44552
44552
|
this._manifestPath = options['manifest-path'];
|
|
44553
44553
|
this._crateName = options.name ||
|
|
44554
44554
|
basename(ensureDefined(process.env['npm_package_name'], '$npm_package_name'));
|
|
44555
|
-
this._out = options.out
|
|
44555
|
+
this._out = options.out ||
|
|
44556
|
+
process.env['NEON_DIST_OUTPUT'] ||
|
|
44557
|
+
'index.node';
|
|
44556
44558
|
this._verbose = !!options.verbose;
|
|
44557
44559
|
this.log(`crate name = "${this._crateName}"`);
|
|
44558
44560
|
}
|
|
@@ -46459,7 +46461,7 @@ function assertIsBinaryV1(json) {
|
|
|
46459
46461
|
throw new TypeError(`expected "neon.binary.abi" to be a string or null, found ${binary.abi}`);
|
|
46460
46462
|
}
|
|
46461
46463
|
}
|
|
46462
|
-
function
|
|
46464
|
+
function assertIsLibraryV1(json) {
|
|
46463
46465
|
assertIsObject(json, "neon");
|
|
46464
46466
|
for (const key in json) {
|
|
46465
46467
|
const value = json[key];
|
|
@@ -46471,10 +46473,10 @@ function assertIsSourceV1(json) {
|
|
|
46471
46473
|
}
|
|
46472
46474
|
}
|
|
46473
46475
|
}
|
|
46474
|
-
function
|
|
46476
|
+
function assertIsLibraryCfg(json) {
|
|
46475
46477
|
assertHasProps(['type', 'org', 'platforms'], json, "neon");
|
|
46476
|
-
if (json.type !== '
|
|
46477
|
-
throw new TypeError(`expected "neon.type" property to be "
|
|
46478
|
+
if (json.type !== 'library') {
|
|
46479
|
+
throw new TypeError(`expected "neon.type" property to be "library", found ${json.type}`);
|
|
46478
46480
|
}
|
|
46479
46481
|
if (typeof json.org !== 'string') {
|
|
46480
46482
|
throw new TypeError(`expected "neon.org" to be a string, found ${json.org}`);
|
|
@@ -46529,9 +46531,9 @@ function assertHasBinaryCfg(json) {
|
|
|
46529
46531
|
assertHasCfg(json);
|
|
46530
46532
|
assertIsBinaryCfg(json.neon);
|
|
46531
46533
|
}
|
|
46532
|
-
function
|
|
46534
|
+
function assertHasLibraryCfg(json) {
|
|
46533
46535
|
assertHasCfg(json);
|
|
46534
|
-
|
|
46536
|
+
assertIsLibraryCfg(json.neon);
|
|
46535
46537
|
}
|
|
46536
46538
|
async function readManifest(dir) {
|
|
46537
46539
|
dir = dir ?? process.cwd();
|
|
@@ -46595,8 +46597,17 @@ function normalizeBinaryCfg(json) {
|
|
|
46595
46597
|
json.neon = upgradeBinaryV1(json.neon);
|
|
46596
46598
|
return true;
|
|
46597
46599
|
}
|
|
46598
|
-
function
|
|
46600
|
+
function normalizeLibraryCfg(json) {
|
|
46599
46601
|
assertHasCfg(json);
|
|
46602
|
+
// V5 format: {
|
|
46603
|
+
// type: 'library',
|
|
46604
|
+
// org: string,
|
|
46605
|
+
// platforms: PlatformFamily,
|
|
46606
|
+
// load?: string | undefined
|
|
46607
|
+
// }
|
|
46608
|
+
if ('type' in json.neon && json.neon.type === 'library') {
|
|
46609
|
+
return false;
|
|
46610
|
+
}
|
|
46600
46611
|
// V4 format: {
|
|
46601
46612
|
// neon: {
|
|
46602
46613
|
// type: 'source',
|
|
@@ -46606,7 +46617,8 @@ function normalizeSourceCfg(json) {
|
|
|
46606
46617
|
// }
|
|
46607
46618
|
// }
|
|
46608
46619
|
if ('type' in json.neon && 'platforms' in json.neon) {
|
|
46609
|
-
|
|
46620
|
+
json.neon.type = 'library';
|
|
46621
|
+
return true;
|
|
46610
46622
|
}
|
|
46611
46623
|
// V3 format: {
|
|
46612
46624
|
// neon: {
|
|
@@ -46620,7 +46632,7 @@ function normalizeSourceCfg(json) {
|
|
|
46620
46632
|
const targets = json.neon['targets'];
|
|
46621
46633
|
assertIsPlatformFamily(targets, "neon.targets");
|
|
46622
46634
|
json.neon = {
|
|
46623
|
-
type: '
|
|
46635
|
+
type: 'library',
|
|
46624
46636
|
org,
|
|
46625
46637
|
platforms: targets
|
|
46626
46638
|
};
|
|
@@ -46636,7 +46648,7 @@ function normalizeSourceCfg(json) {
|
|
|
46636
46648
|
const platforms = json.neon['targets'];
|
|
46637
46649
|
assertIsPlatformMap(platforms, "neon.targets");
|
|
46638
46650
|
json.neon = {
|
|
46639
|
-
type: '
|
|
46651
|
+
type: 'library',
|
|
46640
46652
|
org: json.neon.org,
|
|
46641
46653
|
platforms
|
|
46642
46654
|
};
|
|
@@ -46648,8 +46660,8 @@ function normalizeSourceCfg(json) {
|
|
|
46648
46660
|
// }
|
|
46649
46661
|
// }
|
|
46650
46662
|
const targets = json.neon['targets'];
|
|
46651
|
-
|
|
46652
|
-
json.neon =
|
|
46663
|
+
assertIsLibraryV1(targets);
|
|
46664
|
+
json.neon = upgradeLibraryV1(targets);
|
|
46653
46665
|
return true;
|
|
46654
46666
|
}
|
|
46655
46667
|
// The source manifest is the source of truth for all Neon
|
|
@@ -46657,18 +46669,18 @@ function normalizeSourceCfg(json) {
|
|
|
46657
46669
|
// for any other files to query the Neon project's metadata.
|
|
46658
46670
|
// (Some data is replicated in the binary manifests, however,
|
|
46659
46671
|
// since they are independently published in npm.)
|
|
46660
|
-
class
|
|
46672
|
+
class LibraryManifest extends AbstractManifest {
|
|
46661
46673
|
_sourceJSON;
|
|
46662
46674
|
_expandedPlatforms;
|
|
46663
46675
|
constructor(json) {
|
|
46664
46676
|
super(json);
|
|
46665
|
-
this._upgraded =
|
|
46666
|
-
|
|
46677
|
+
this._upgraded = normalizeLibraryCfg(this._json);
|
|
46678
|
+
assertHasLibraryCfg(this._json);
|
|
46667
46679
|
this._sourceJSON = this._json;
|
|
46668
46680
|
this._expandedPlatforms = expandPlatformFamily(this._sourceJSON.neon.platforms);
|
|
46669
46681
|
}
|
|
46670
46682
|
static async load(dir) {
|
|
46671
|
-
return new
|
|
46683
|
+
return new LibraryManifest(await readManifest(dir));
|
|
46672
46684
|
}
|
|
46673
46685
|
cfg() {
|
|
46674
46686
|
return this._sourceJSON.neon;
|
|
@@ -46808,6 +46820,11 @@ class SourceManifest extends AbstractManifest {
|
|
|
46808
46820
|
platformsSrc.push(preset);
|
|
46809
46821
|
return this.addPlatforms(expandPlatformFamily(preset));
|
|
46810
46822
|
}
|
|
46823
|
+
// Edge case: an empty object can be treated like an empty array
|
|
46824
|
+
if (Object.keys(platformsSrc).length === 0) {
|
|
46825
|
+
this.cfg().platforms = [];
|
|
46826
|
+
return await this.addPlatformPreset(preset);
|
|
46827
|
+
}
|
|
46811
46828
|
return this.addPlatforms(expandPlatformFamily(preset), { platformsSrc });
|
|
46812
46829
|
}
|
|
46813
46830
|
async updateTargets(log, bundle) {
|
|
@@ -46840,7 +46857,7 @@ if (0) {
|
|
|
46840
46857
|
await promises_namespaceObject.writeFile(bundle, PREAMBLE + requires + '\n}\n');
|
|
46841
46858
|
}
|
|
46842
46859
|
}
|
|
46843
|
-
function
|
|
46860
|
+
function upgradeLibraryV1(object) {
|
|
46844
46861
|
function splitSwap([key, value]) {
|
|
46845
46862
|
if (!/^@.*\//.test(value)) {
|
|
46846
46863
|
throw new TypeError(`expected namespaced npm package name, found ${value}`);
|
|
@@ -46859,7 +46876,7 @@ function upgradeSourceV1(object) {
|
|
|
46859
46876
|
throw new Error(`multiple npm orgs found: ${orgs}`);
|
|
46860
46877
|
}
|
|
46861
46878
|
return {
|
|
46862
|
-
type: '
|
|
46879
|
+
type: 'library',
|
|
46863
46880
|
org: [...orgs][0],
|
|
46864
46881
|
platforms: Object.fromEntries(entries)
|
|
46865
46882
|
};
|
|
@@ -46941,12 +46958,12 @@ class Tarball {
|
|
|
46941
46958
|
console.error("[neon tarball] " + msg);
|
|
46942
46959
|
}
|
|
46943
46960
|
}
|
|
46944
|
-
async createTempDir(
|
|
46961
|
+
async createTempDir(libManifest) {
|
|
46945
46962
|
const target = this._target || await getCurrentTarget(msg => this.log(msg));
|
|
46946
46963
|
if (!isRustTarget(target)) {
|
|
46947
46964
|
throw new Error(`Rust target ${target} not supported.`);
|
|
46948
46965
|
}
|
|
46949
|
-
const binaryManifest =
|
|
46966
|
+
const binaryManifest = libManifest.manifestFor(target);
|
|
46950
46967
|
this.log(`prebuild manifest: ${binaryManifest.stringify()}`);
|
|
46951
46968
|
this.log("creating temp dir");
|
|
46952
46969
|
const tmpdir = await mktemp('neon-');
|
|
@@ -46959,11 +46976,11 @@ class Tarball {
|
|
|
46959
46976
|
await promises_namespaceObject.writeFile(external_node_path_namespaceObject.join(tmpdir, "README.md"), `# \`${binaryManifest.name}\`\n\n${binaryManifest.description}\n`);
|
|
46960
46977
|
return tmpdir;
|
|
46961
46978
|
}
|
|
46962
|
-
async prepareInDir(
|
|
46979
|
+
async prepareInDir(libManifest) {
|
|
46963
46980
|
if (!this._inDir) {
|
|
46964
|
-
return await this.createTempDir(
|
|
46981
|
+
return await this.createTempDir(libManifest);
|
|
46965
46982
|
}
|
|
46966
|
-
const version =
|
|
46983
|
+
const version = libManifest.version;
|
|
46967
46984
|
const binaryManifest = await BinaryManifest.load(this._inDir);
|
|
46968
46985
|
const cfg = binaryManifest.cfg();
|
|
46969
46986
|
// Since the source manifest is the source of truth, any time there's a
|
|
@@ -46990,9 +47007,9 @@ class Tarball {
|
|
|
46990
47007
|
this.log(`creating directory ${this._outDir}`);
|
|
46991
47008
|
await promises_namespaceObject.mkdir(this._outDir, { recursive: true });
|
|
46992
47009
|
this.log(`reading package.json`);
|
|
46993
|
-
const
|
|
46994
|
-
this.log(`manifest: ${
|
|
46995
|
-
const inDir = await this.prepareInDir(
|
|
47010
|
+
const libManifest = await LibraryManifest.load();
|
|
47011
|
+
this.log(`manifest: ${libManifest.stringify()}`);
|
|
47012
|
+
const inDir = await this.prepareInDir(libManifest);
|
|
46996
47013
|
this.log(`npm pack --json`);
|
|
46997
47014
|
const result = await execa("npm", ["pack", "--json"], {
|
|
46998
47015
|
shell: true,
|
|
@@ -47112,29 +47129,29 @@ class AddPlatform {
|
|
|
47112
47129
|
console.error("[neon add-platform] " + msg);
|
|
47113
47130
|
}
|
|
47114
47131
|
}
|
|
47115
|
-
async addPlatform(
|
|
47132
|
+
async addPlatform(libManifest) {
|
|
47116
47133
|
if (!this._platform) {
|
|
47117
47134
|
this.log('adding default system platform');
|
|
47118
|
-
return optionArray(await
|
|
47135
|
+
return optionArray(await libManifest.addRustTarget(await getCurrentTarget(msg => this.log(msg))));
|
|
47119
47136
|
}
|
|
47120
47137
|
else if (isRustTarget(this._platform)) {
|
|
47121
47138
|
this.log(`adding Rust target ${this._platform}`);
|
|
47122
|
-
return optionArray(await
|
|
47139
|
+
return optionArray(await libManifest.addRustTarget(this._platform));
|
|
47123
47140
|
}
|
|
47124
47141
|
else if (isNodePlatform(this._platform)) {
|
|
47125
47142
|
this.log(`adding Node platform ${this._platform}`);
|
|
47126
|
-
return optionArray(await
|
|
47143
|
+
return optionArray(await libManifest.addNodePlatform(this._platform));
|
|
47127
47144
|
}
|
|
47128
47145
|
else if (isPlatformPreset(this._platform)) {
|
|
47129
|
-
return
|
|
47146
|
+
return libManifest.addPlatformPreset(this._platform);
|
|
47130
47147
|
}
|
|
47131
47148
|
else {
|
|
47132
47149
|
throw new Error(`unrecognized platform or preset ${this._platform}`);
|
|
47133
47150
|
}
|
|
47134
47151
|
}
|
|
47135
|
-
async createTemplateTree(
|
|
47152
|
+
async createTemplateTree(libManifest, pair) {
|
|
47136
47153
|
const { node, rust } = pair;
|
|
47137
|
-
const binaryManifest =
|
|
47154
|
+
const binaryManifest = libManifest.manifestFor(rust);
|
|
47138
47155
|
this.log(`prebuild manifest: ${binaryManifest.stringify()}`);
|
|
47139
47156
|
const treeDir = external_node_path_namespaceObject.join(this._outDir, node);
|
|
47140
47157
|
this.log(`creating ${treeDir}`);
|
|
@@ -47147,13 +47164,13 @@ class AddPlatform {
|
|
|
47147
47164
|
}
|
|
47148
47165
|
async run() {
|
|
47149
47166
|
this.log(`reading package.json`);
|
|
47150
|
-
const
|
|
47151
|
-
this.log(`manifest: ${
|
|
47152
|
-
const modified = await this.addPlatform(
|
|
47167
|
+
const libManifest = await LibraryManifest.load();
|
|
47168
|
+
this.log(`manifest: ${libManifest.stringify()}`);
|
|
47169
|
+
const modified = await this.addPlatform(libManifest);
|
|
47153
47170
|
if (modified.length) {
|
|
47154
|
-
|
|
47171
|
+
libManifest.updateTargets(msg => this.log(msg), this._bundle);
|
|
47155
47172
|
for (const pair of modified) {
|
|
47156
|
-
await this.createTemplateTree(
|
|
47173
|
+
await this.createTemplateTree(libManifest, pair);
|
|
47157
47174
|
}
|
|
47158
47175
|
}
|
|
47159
47176
|
}
|
|
@@ -47199,15 +47216,15 @@ class UpdatePlatforms {
|
|
|
47199
47216
|
}
|
|
47200
47217
|
async run() {
|
|
47201
47218
|
this.log(`reading package.json (CWD=${process.cwd()})`);
|
|
47202
|
-
const
|
|
47203
|
-
const version =
|
|
47204
|
-
this.log(`package.json before: ${
|
|
47219
|
+
const libManifest = await LibraryManifest.load();
|
|
47220
|
+
const version = libManifest.version;
|
|
47221
|
+
this.log(`package.json before: ${libManifest.stringify()}`);
|
|
47205
47222
|
this.log(`determined version: ${version}`);
|
|
47206
|
-
if (
|
|
47223
|
+
if (libManifest.upgraded) {
|
|
47207
47224
|
this.log(`upgrading manifest format`);
|
|
47208
|
-
await
|
|
47225
|
+
await libManifest.save();
|
|
47209
47226
|
}
|
|
47210
|
-
|
|
47227
|
+
libManifest.updateTargets(msg => this.log(msg), this._bundle);
|
|
47211
47228
|
}
|
|
47212
47229
|
}
|
|
47213
47230
|
|
|
@@ -47239,9 +47256,9 @@ class ListPlatforms {
|
|
|
47239
47256
|
}
|
|
47240
47257
|
async run() {
|
|
47241
47258
|
this.log(`reading package.json`);
|
|
47242
|
-
const
|
|
47243
|
-
this.log(`manifest: ${
|
|
47244
|
-
const platforms =
|
|
47259
|
+
const libManifest = await LibraryManifest.load();
|
|
47260
|
+
this.log(`manifest: ${libManifest.stringify()}`);
|
|
47261
|
+
const platforms = libManifest.allPlatforms();
|
|
47245
47262
|
console.log(JSON.stringify(platforms, null, 2));
|
|
47246
47263
|
}
|
|
47247
47264
|
}
|
|
@@ -47363,9 +47380,9 @@ class RustTarget {
|
|
|
47363
47380
|
}
|
|
47364
47381
|
async run() {
|
|
47365
47382
|
this.log(`reading package.json`);
|
|
47366
|
-
const
|
|
47367
|
-
this.log(`manifest: ${
|
|
47368
|
-
const rust =
|
|
47383
|
+
const libManifest = await LibraryManifest.load();
|
|
47384
|
+
this.log(`manifest: ${libManifest.stringify()}`);
|
|
47385
|
+
const rust = libManifest.rustTargetFor(this._platform);
|
|
47369
47386
|
if (!rust) {
|
|
47370
47387
|
throw new Error(`no Rust target found for ${this._platform}`);
|
|
47371
47388
|
}
|
|
@@ -47416,6 +47433,124 @@ class Preset {
|
|
|
47416
47433
|
}
|
|
47417
47434
|
}
|
|
47418
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
|
+
|
|
47419
47554
|
// EXTERNAL MODULE: ./src/print.ts + 26 modules
|
|
47420
47555
|
var print = __nccwpck_require__(9050);
|
|
47421
47556
|
;// CONCATENATED MODULE: ./src/commands/help.ts
|
|
@@ -47459,6 +47594,7 @@ class Help {
|
|
|
47459
47594
|
|
|
47460
47595
|
|
|
47461
47596
|
|
|
47597
|
+
|
|
47462
47598
|
var CommandName;
|
|
47463
47599
|
(function (CommandName) {
|
|
47464
47600
|
CommandName["Help"] = "help";
|
|
@@ -47475,6 +47611,7 @@ var CommandName;
|
|
|
47475
47611
|
CommandName["CurrentPlatform"] = "current-platform";
|
|
47476
47612
|
CommandName["RustTarget"] = "rust-target";
|
|
47477
47613
|
CommandName["Preset"] = "preset";
|
|
47614
|
+
CommandName["Ci"] = "ci";
|
|
47478
47615
|
})(CommandName || (CommandName = {}));
|
|
47479
47616
|
;
|
|
47480
47617
|
function isCommandName(s) {
|
|
@@ -47501,7 +47638,8 @@ const COMMANDS = {
|
|
|
47501
47638
|
[CommandName.ListPlatforms]: ListPlatforms,
|
|
47502
47639
|
[CommandName.CurrentPlatform]: CurrentPlatform,
|
|
47503
47640
|
[CommandName.RustTarget]: RustTarget,
|
|
47504
|
-
[CommandName.Preset]: Preset
|
|
47641
|
+
[CommandName.Preset]: Preset,
|
|
47642
|
+
[CommandName.Ci]: Ci
|
|
47505
47643
|
};
|
|
47506
47644
|
function commandFor(name) {
|
|
47507
47645
|
return COMMANDS[name];
|
|
@@ -47515,7 +47653,8 @@ function summaries() {
|
|
|
47515
47653
|
{ name: CommandName.UpdatePlatforms, summary: UpdatePlatforms.summary() },
|
|
47516
47654
|
{ name: CommandName.ListPlatforms, summary: ListPlatforms.summary() },
|
|
47517
47655
|
{ name: CommandName.CurrentPlatform, summary: CurrentPlatform.summary() },
|
|
47518
|
-
{ name: CommandName.Preset, summary: Preset.summary() }
|
|
47656
|
+
{ name: CommandName.Preset, summary: Preset.summary() },
|
|
47657
|
+
{ name: CommandName.Ci, summary: Ci.summary() }
|
|
47519
47658
|
];
|
|
47520
47659
|
}
|
|
47521
47660
|
|
|
@@ -47529,7 +47668,7 @@ __nccwpck_require__.a(module, async (__webpack_handle_async_dependencies__, __we
|
|
|
47529
47668
|
/* harmony import */ var command_line_commands__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(5046);
|
|
47530
47669
|
/* harmony import */ var command_line_commands__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nccwpck_require__.n(command_line_commands__WEBPACK_IMPORTED_MODULE_0__);
|
|
47531
47670
|
/* harmony import */ var _print_js__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(9050);
|
|
47532
|
-
/* harmony import */ var _command_js__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(
|
|
47671
|
+
/* harmony import */ var _command_js__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(4528);
|
|
47533
47672
|
/* harmony import */ var node_module__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(2033);
|
|
47534
47673
|
/* harmony import */ var node_module__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nccwpck_require__.n(node_module__WEBPACK_IMPORTED_MODULE_3__);
|
|
47535
47674
|
|
|
@@ -50552,8 +50691,8 @@ const chalkStderr = createChalk({level: stderrColor ? stderrColor.level : 0});
|
|
|
50552
50691
|
|
|
50553
50692
|
/* harmony default export */ const chalk_source = (chalk);
|
|
50554
50693
|
|
|
50555
|
-
// EXTERNAL MODULE: ./src/command.ts +
|
|
50556
|
-
var command = __nccwpck_require__(
|
|
50694
|
+
// EXTERNAL MODULE: ./src/command.ts + 46 modules
|
|
50695
|
+
var command = __nccwpck_require__(4528);
|
|
50557
50696
|
;// CONCATENATED MODULE: ./src/print.ts
|
|
50558
50697
|
|
|
50559
50698
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neon-rs/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.186",
|
|
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.
|
|
31
|
-
"@cargo-messages/darwin-arm64": "0.0.
|
|
32
|
-
"@cargo-messages/darwin-x64": "0.0.
|
|
33
|
-
"@cargo-messages/linux-arm-gnueabihf": "0.0.
|
|
34
|
-
"@cargo-messages/linux-x64-gnu": "0.0.
|
|
35
|
-
"@cargo-messages/win32-arm64-msvc": "0.0.
|
|
36
|
-
"@cargo-messages/win32-x64-msvc": "0.0.
|
|
30
|
+
"@cargo-messages/android-arm-eabi": "0.0.186",
|
|
31
|
+
"@cargo-messages/darwin-arm64": "0.0.186",
|
|
32
|
+
"@cargo-messages/darwin-x64": "0.0.186",
|
|
33
|
+
"@cargo-messages/linux-arm-gnueabihf": "0.0.186",
|
|
34
|
+
"@cargo-messages/linux-x64-gnu": "0.0.186",
|
|
35
|
+
"@cargo-messages/win32-arm64-msvc": "0.0.186",
|
|
36
|
+
"@cargo-messages/win32-x64-msvc": "0.0.186"
|
|
37
37
|
}
|
|
38
38
|
}
|