@neon-rs/cli 0.1.71 → 0.1.73
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 +95 -9
- package/package.json +8 -8
package/index.js
CHANGED
|
@@ -40240,7 +40240,7 @@ which.sync = whichSync
|
|
|
40240
40240
|
|
|
40241
40241
|
/***/ }),
|
|
40242
40242
|
|
|
40243
|
-
/***/
|
|
40243
|
+
/***/ 5065:
|
|
40244
40244
|
/***/ ((__unused_webpack_module, __webpack_exports__, __nccwpck_require__) => {
|
|
40245
40245
|
|
|
40246
40246
|
|
|
@@ -40256,8 +40256,6 @@ __nccwpck_require__.d(__webpack_exports__, {
|
|
|
40256
40256
|
|
|
40257
40257
|
;// CONCATENATED MODULE: external "node:fs"
|
|
40258
40258
|
const external_node_fs_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs");
|
|
40259
|
-
// EXTERNAL MODULE: external "node:fs/promises"
|
|
40260
|
-
var promises_ = __nccwpck_require__(3977);
|
|
40261
40259
|
// EXTERNAL MODULE: ../node_modules/command-line-args/dist/index.js
|
|
40262
40260
|
var dist = __nccwpck_require__(7898);
|
|
40263
40261
|
var dist_default = /*#__PURE__*/__nccwpck_require__.n(dist);
|
|
@@ -40270,6 +40268,11 @@ var lib = __nccwpck_require__(3993);
|
|
|
40270
40268
|
var manifest_lib = __nccwpck_require__(347);
|
|
40271
40269
|
// EXTERNAL MODULE: ../node_modules/@neon-rs/manifest/lib/platform.mjs
|
|
40272
40270
|
var lib_platform = __nccwpck_require__(8140);
|
|
40271
|
+
// EXTERNAL MODULE: ../node_modules/@neon-rs/artifact/lib/index.cjs
|
|
40272
|
+
var artifact_lib = __nccwpck_require__(8893);
|
|
40273
|
+
;// CONCATENATED MODULE: ../node_modules/@neon-rs/artifact/lib/index.mjs
|
|
40274
|
+
|
|
40275
|
+
|
|
40273
40276
|
;// CONCATENATED MODULE: ./src/commands/dist.ts
|
|
40274
40277
|
|
|
40275
40278
|
|
|
@@ -40277,6 +40280,14 @@ var lib_platform = __nccwpck_require__(8140);
|
|
|
40277
40280
|
|
|
40278
40281
|
|
|
40279
40282
|
|
|
40283
|
+
// Starting around Rust 1.78 or 1.79, cargo will begin normalizing
|
|
40284
|
+
// crate names in the JSON output, so to support both old and new
|
|
40285
|
+
// versions of cargo, we need to compare against both variants.
|
|
40286
|
+
//
|
|
40287
|
+
// See: https://github.com/rust-lang/cargo/issues/13867
|
|
40288
|
+
function normalize(crateName) {
|
|
40289
|
+
return crateName.replaceAll(/-/g, "_");
|
|
40290
|
+
}
|
|
40280
40291
|
// FIXME: add options to infer crate name from manifests
|
|
40281
40292
|
// --package <path/to/package.json>
|
|
40282
40293
|
// --crate <path/to/Cargo.toml>
|
|
@@ -40366,6 +40377,7 @@ class Dist {
|
|
|
40366
40377
|
_mount;
|
|
40367
40378
|
_manifestPath;
|
|
40368
40379
|
_crateName;
|
|
40380
|
+
_normalizedCrateName;
|
|
40369
40381
|
_out;
|
|
40370
40382
|
_verbose;
|
|
40371
40383
|
constructor(argv) {
|
|
@@ -40385,6 +40397,7 @@ class Dist {
|
|
|
40385
40397
|
this._manifestPath = options['manifest-path'];
|
|
40386
40398
|
this._crateName = options.name ||
|
|
40387
40399
|
basename(ensureDefined(process.env['npm_package_name'], '$npm_package_name'));
|
|
40400
|
+
this._normalizedCrateName = normalize(this._crateName);
|
|
40388
40401
|
this._out = parseOutputFile(options.debug, options.out, options.platform);
|
|
40389
40402
|
this._verbose = !!options.verbose;
|
|
40390
40403
|
this.log(`crate name = "${this._crateName}"`);
|
|
@@ -40397,7 +40410,7 @@ class Dist {
|
|
|
40397
40410
|
});
|
|
40398
40411
|
let file = null;
|
|
40399
40412
|
for await (const msg of reader) {
|
|
40400
|
-
if (!file && msg.isCompilerArtifact() && msg.crateName() === this.
|
|
40413
|
+
if (!file && msg.isCompilerArtifact() && normalize(msg.crateName()) === this._normalizedCrateName) {
|
|
40401
40414
|
file = msg.findFileByCrateType('cdylib');
|
|
40402
40415
|
}
|
|
40403
40416
|
}
|
|
@@ -40416,8 +40429,7 @@ class Dist {
|
|
|
40416
40429
|
const { option, path } = await this._out;
|
|
40417
40430
|
this.log(`output type = ${option}`);
|
|
40418
40431
|
this.log(`output file = ${path}`);
|
|
40419
|
-
|
|
40420
|
-
await (0,promises_.copyFile)(file, path);
|
|
40432
|
+
await (0,artifact_lib.copyArtifact)(file, path);
|
|
40421
40433
|
}
|
|
40422
40434
|
}
|
|
40423
40435
|
|
|
@@ -41956,6 +41968,8 @@ function execaNode(scriptPath, args, options = {}) {
|
|
|
41956
41968
|
);
|
|
41957
41969
|
}
|
|
41958
41970
|
|
|
41971
|
+
// EXTERNAL MODULE: external "node:fs/promises"
|
|
41972
|
+
var promises_ = __nccwpck_require__(3977);
|
|
41959
41973
|
;// CONCATENATED MODULE: ./src/commands/bump.ts
|
|
41960
41974
|
|
|
41961
41975
|
|
|
@@ -42846,7 +42860,7 @@ __nccwpck_require__.a(module, async (__webpack_handle_async_dependencies__, __we
|
|
|
42846
42860
|
/* harmony import */ var command_line_commands__WEBPACK_IMPORTED_MODULE_0__ = __nccwpck_require__(5046);
|
|
42847
42861
|
/* harmony import */ var command_line_commands__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__nccwpck_require__.n(command_line_commands__WEBPACK_IMPORTED_MODULE_0__);
|
|
42848
42862
|
/* harmony import */ var _print_js__WEBPACK_IMPORTED_MODULE_1__ = __nccwpck_require__(9050);
|
|
42849
|
-
/* harmony import */ var _command_js__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(
|
|
42863
|
+
/* harmony import */ var _command_js__WEBPACK_IMPORTED_MODULE_2__ = __nccwpck_require__(5065);
|
|
42850
42864
|
/* harmony import */ var node_module__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(2033);
|
|
42851
42865
|
/* harmony import */ var node_module__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nccwpck_require__.n(node_module__WEBPACK_IMPORTED_MODULE_3__);
|
|
42852
42866
|
|
|
@@ -45875,8 +45889,8 @@ const chalkStderr = createChalk({level: stderrColor ? stderrColor.level : 0});
|
|
|
45875
45889
|
|
|
45876
45890
|
/* harmony default export */ const chalk_source = (chalk);
|
|
45877
45891
|
|
|
45878
|
-
// EXTERNAL MODULE: ./src/command.ts +
|
|
45879
|
-
var command = __nccwpck_require__(
|
|
45892
|
+
// EXTERNAL MODULE: ./src/command.ts + 36 modules
|
|
45893
|
+
var command = __nccwpck_require__(5065);
|
|
45880
45894
|
// EXTERNAL MODULE: ./src/commands/show.ts + 4 modules
|
|
45881
45895
|
var show = __nccwpck_require__(6264);
|
|
45882
45896
|
;// CONCATENATED MODULE: ./src/print.ts
|
|
@@ -60858,6 +60872,78 @@ module.exports = (__nccwpck_require__(8372)/* .proxy */ .sj)({
|
|
|
60858
60872
|
});
|
|
60859
60873
|
|
|
60860
60874
|
|
|
60875
|
+
/***/ }),
|
|
60876
|
+
|
|
60877
|
+
/***/ 8893:
|
|
60878
|
+
/***/ (function(__unused_webpack_module, exports, __nccwpck_require__) {
|
|
60879
|
+
|
|
60880
|
+
|
|
60881
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
60882
|
+
if (k2 === undefined) k2 = k;
|
|
60883
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
60884
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
60885
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
60886
|
+
}
|
|
60887
|
+
Object.defineProperty(o, k2, desc);
|
|
60888
|
+
}) : (function(o, m, k, k2) {
|
|
60889
|
+
if (k2 === undefined) k2 = k;
|
|
60890
|
+
o[k2] = m[k];
|
|
60891
|
+
}));
|
|
60892
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
60893
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
60894
|
+
}) : function(o, v) {
|
|
60895
|
+
o["default"] = v;
|
|
60896
|
+
});
|
|
60897
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
60898
|
+
if (mod && mod.__esModule) return mod;
|
|
60899
|
+
var result = {};
|
|
60900
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
60901
|
+
__setModuleDefault(result, mod);
|
|
60902
|
+
return result;
|
|
60903
|
+
};
|
|
60904
|
+
Object.defineProperty(exports, "__esModule", ({ value: true }));
|
|
60905
|
+
exports.copyArtifact = exports.isNewer = void 0;
|
|
60906
|
+
const fs = __importStar(__nccwpck_require__(3977));
|
|
60907
|
+
const path = __importStar(__nccwpck_require__(9411));
|
|
60908
|
+
async function isNewer(filename, outputFile) {
|
|
60909
|
+
try {
|
|
60910
|
+
const prevStats = await fs.stat(outputFile);
|
|
60911
|
+
const nextStats = await fs.stat(filename);
|
|
60912
|
+
return nextStats.mtime > prevStats.mtime;
|
|
60913
|
+
}
|
|
60914
|
+
catch (_err) { }
|
|
60915
|
+
return true;
|
|
60916
|
+
}
|
|
60917
|
+
exports.isNewer = isNewer;
|
|
60918
|
+
async function copyArtifact(src, dest) {
|
|
60919
|
+
if (!(await isNewer(src, dest))) {
|
|
60920
|
+
return;
|
|
60921
|
+
}
|
|
60922
|
+
const destDir = path.dirname(dest);
|
|
60923
|
+
await fs.mkdir(destDir, { recursive: true });
|
|
60924
|
+
// Apple Silicon (M1, etc.) requires shared libraries to be signed. However,
|
|
60925
|
+
// the macOS code signing cache isn't cleared when overwriting a file.
|
|
60926
|
+
// Deleting the file before copying works around the issue.
|
|
60927
|
+
//
|
|
60928
|
+
// Unfortunately, this workaround is incomplete because the file must be
|
|
60929
|
+
// deleted from the location it is loaded. If further steps in the user's
|
|
60930
|
+
// build process copy or move the file in place, the code signing cache
|
|
60931
|
+
// will not be cleared.
|
|
60932
|
+
//
|
|
60933
|
+
// https://github.com/neon-bindings/neon/issues/911
|
|
60934
|
+
if (path.extname(dest) === ".node") {
|
|
60935
|
+
try {
|
|
60936
|
+
await fs.unlink(dest);
|
|
60937
|
+
}
|
|
60938
|
+
catch (_e) {
|
|
60939
|
+
// Ignore errors; the file might not exist
|
|
60940
|
+
}
|
|
60941
|
+
}
|
|
60942
|
+
await fs.copyFile(src, dest);
|
|
60943
|
+
}
|
|
60944
|
+
exports.copyArtifact = copyArtifact;
|
|
60945
|
+
|
|
60946
|
+
|
|
60861
60947
|
/***/ }),
|
|
60862
60948
|
|
|
60863
60949
|
/***/ 9173:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neon-rs/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.73",
|
|
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.
|
|
31
|
-
"@cargo-messages/darwin-arm64": "0.1.
|
|
32
|
-
"@cargo-messages/darwin-x64": "0.1.
|
|
33
|
-
"@cargo-messages/linux-arm-gnueabihf": "0.1.
|
|
34
|
-
"@cargo-messages/linux-x64-gnu": "0.1.
|
|
35
|
-
"@cargo-messages/win32-arm64-msvc": "0.1.
|
|
36
|
-
"@cargo-messages/win32-x64-msvc": "0.1.
|
|
30
|
+
"@cargo-messages/android-arm-eabi": "0.1.72",
|
|
31
|
+
"@cargo-messages/darwin-arm64": "0.1.72",
|
|
32
|
+
"@cargo-messages/darwin-x64": "0.1.72",
|
|
33
|
+
"@cargo-messages/linux-arm-gnueabihf": "0.1.72",
|
|
34
|
+
"@cargo-messages/linux-x64-gnu": "0.1.72",
|
|
35
|
+
"@cargo-messages/win32-arm64-msvc": "0.1.72",
|
|
36
|
+
"@cargo-messages/win32-x64-msvc": "0.1.72"
|
|
37
37
|
}
|
|
38
38
|
}
|