@neon-rs/cli 0.0.151 → 0.0.153
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 +42 -19
- package/package.json +8 -8
package/index.js
CHANGED
|
@@ -2,13 +2,6 @@
|
|
|
2
2
|
import { createRequire as __WEBPACK_EXTERNAL_createRequire } from "module";
|
|
3
3
|
/******/ var __webpack_modules__ = ({
|
|
4
4
|
|
|
5
|
-
/***/ 8168:
|
|
6
|
-
/***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
|
|
7
|
-
|
|
8
|
-
module.exports = require(__nccwpck_require__.ab + "index.node")
|
|
9
|
-
|
|
10
|
-
/***/ }),
|
|
11
|
-
|
|
12
5
|
/***/ 4371:
|
|
13
6
|
/***/ ((__unused_webpack_module, exports) => {
|
|
14
7
|
|
|
@@ -10244,6 +10237,8 @@ __nccwpck_require__.d(__webpack_exports__, {
|
|
|
10244
10237
|
|
|
10245
10238
|
// UNUSED EXPORTS: isCommandName
|
|
10246
10239
|
|
|
10240
|
+
;// CONCATENATED MODULE: external "node:fs"
|
|
10241
|
+
const external_node_fs_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs");
|
|
10247
10242
|
;// CONCATENATED MODULE: external "node:fs/promises"
|
|
10248
10243
|
const promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs/promises");
|
|
10249
10244
|
// EXTERNAL MODULE: ./node_modules/command-line-args/dist/index.js
|
|
@@ -10258,6 +10253,7 @@ var lib = __nccwpck_require__(9048);
|
|
|
10258
10253
|
|
|
10259
10254
|
|
|
10260
10255
|
|
|
10256
|
+
|
|
10261
10257
|
// FIXME: add options to infer crate name from manifests
|
|
10262
10258
|
// --package <path/to/package.json>
|
|
10263
10259
|
// --crate <path/to/Cargo.toml>
|
|
@@ -10270,6 +10266,9 @@ const OPTIONS = [
|
|
|
10270
10266
|
{ name: 'out', alias: 'o', type: String, defaultValue: 'index.node' },
|
|
10271
10267
|
{ name: 'verbose', alias: 'v', type: Boolean, defaultValue: false }
|
|
10272
10268
|
];
|
|
10269
|
+
function createInputStream(file) {
|
|
10270
|
+
return file ? (0,external_node_fs_namespaceObject.createReadStream)(file) : process.stdin;
|
|
10271
|
+
}
|
|
10273
10272
|
class Dist {
|
|
10274
10273
|
static summary() { return 'Generate a .node file from a build.'; }
|
|
10275
10274
|
static syntax() { return 'neon dist [-n <name>] [-f <dylib>|[-l <log>] [-m <path>]] [-o <dist>]'; }
|
|
@@ -10312,25 +10311,43 @@ class Dist {
|
|
|
10312
10311
|
this._out = options.out;
|
|
10313
10312
|
this._verbose = !!options.verbose;
|
|
10314
10313
|
}
|
|
10315
|
-
findArtifact() {
|
|
10316
|
-
const
|
|
10314
|
+
async findArtifact() {
|
|
10315
|
+
const reader = new lib.CargoReader(createInputStream(this._log), {
|
|
10317
10316
|
mount: this._mount || undefined,
|
|
10318
10317
|
manifestPath: this._manifestPath || undefined,
|
|
10319
|
-
file: this._log || undefined,
|
|
10320
10318
|
verbose: this._verbose
|
|
10321
10319
|
});
|
|
10322
|
-
|
|
10323
|
-
|
|
10324
|
-
|
|
10320
|
+
let file = null;
|
|
10321
|
+
for await (const msg of reader) {
|
|
10322
|
+
if (msg.isCompilerArtifact() && msg.crateName() === this._crateName) {
|
|
10323
|
+
file = msg.findFileByCrateType('cdylib');
|
|
10324
|
+
if (!file) {
|
|
10325
|
+
throw new Error(`No artifacts were generated for crate ${this._crateName}`);
|
|
10326
|
+
}
|
|
10327
|
+
}
|
|
10325
10328
|
}
|
|
10326
|
-
const file = artifact.findFileByCrateType('cdylib');
|
|
10327
10329
|
if (!file) {
|
|
10328
|
-
throw new Error(`No
|
|
10330
|
+
throw new Error(`No artifacts were generated for crate ${this._crateName}`);
|
|
10329
10331
|
}
|
|
10330
10332
|
return file;
|
|
10333
|
+
// const messages: CargoMessages = new CargoMessages({
|
|
10334
|
+
// mount: this._mount || undefined,
|
|
10335
|
+
// manifestPath: this._manifestPath || undefined,
|
|
10336
|
+
// file: this._log || undefined,
|
|
10337
|
+
// verbose: this._verbose
|
|
10338
|
+
// });
|
|
10339
|
+
// const artifact = messages.findArtifact(this._crateName);
|
|
10340
|
+
// if (!artifact) {
|
|
10341
|
+
// throw new Error(`No artifacts were generated for crate ${this._crateName}`);
|
|
10342
|
+
// }
|
|
10343
|
+
// const file = artifact.findFileByCrateType('cdylib');
|
|
10344
|
+
// if (!file) {
|
|
10345
|
+
// throw new Error(`No cdylib artifact found for crate ${this._crateName}`);
|
|
10346
|
+
// }
|
|
10347
|
+
// return file;
|
|
10331
10348
|
}
|
|
10332
10349
|
async run() {
|
|
10333
|
-
const file = this._file || this.findArtifact();
|
|
10350
|
+
const file = this._file || (await this.findArtifact());
|
|
10334
10351
|
// FIXME: needs all the logic of cargo-cp-artifact (timestamp check, M1 workaround, async, errors)
|
|
10335
10352
|
await (0,promises_namespaceObject.copyFile)(file, this._out);
|
|
10336
10353
|
}
|
|
@@ -11177,8 +11194,6 @@ const setExitHandler = async (spawned, {cleanup, detached}, timedPromise) => {
|
|
|
11177
11194
|
});
|
|
11178
11195
|
};
|
|
11179
11196
|
|
|
11180
|
-
;// CONCATENATED MODULE: external "node:fs"
|
|
11181
|
-
const external_node_fs_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs");
|
|
11182
11197
|
;// CONCATENATED MODULE: ./node_modules/is-stream/index.js
|
|
11183
11198
|
function isStream(stream) {
|
|
11184
11199
|
return stream !== null
|
|
@@ -15453,6 +15468,14 @@ module.exports = eval("require")("@cargo-messages/darwin-x64");
|
|
|
15453
15468
|
module.exports = eval("require")("@cargo-messages/linux-arm-gnueabihf");
|
|
15454
15469
|
|
|
15455
15470
|
|
|
15471
|
+
/***/ }),
|
|
15472
|
+
|
|
15473
|
+
/***/ 9301:
|
|
15474
|
+
/***/ ((module) => {
|
|
15475
|
+
|
|
15476
|
+
module.exports = eval("require")("@cargo-messages/linux-x64-gnu");
|
|
15477
|
+
|
|
15478
|
+
|
|
15456
15479
|
/***/ }),
|
|
15457
15480
|
|
|
15458
15481
|
/***/ 9329:
|
|
@@ -15745,7 +15768,7 @@ module.exports = (__nccwpck_require__(4371)/* .lazy */ .Vo)({
|
|
|
15745
15768
|
'aarch64-pc-windows-msvc': () => __nccwpck_require__(9329),
|
|
15746
15769
|
'darwin-x64': () => __nccwpck_require__(5583),
|
|
15747
15770
|
'darwin-arm64': () => __nccwpck_require__(5111),
|
|
15748
|
-
'linux-x64-gnu': () => __nccwpck_require__(
|
|
15771
|
+
'linux-x64-gnu': () => __nccwpck_require__(9301),
|
|
15749
15772
|
'linux-arm-gnueabihf': () => __nccwpck_require__(6698),
|
|
15750
15773
|
'android-arm-eabi': () => __nccwpck_require__(5193)
|
|
15751
15774
|
}, [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neon-rs/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.153",
|
|
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.153",
|
|
31
|
+
"@cargo-messages/darwin-arm64": "0.0.153",
|
|
32
|
+
"@cargo-messages/darwin-x64": "0.0.153",
|
|
33
|
+
"@cargo-messages/linux-arm-gnueabihf": "0.0.153",
|
|
34
|
+
"@cargo-messages/linux-x64-gnu": "0.0.153",
|
|
35
|
+
"@cargo-messages/win32-arm64-msvc": "0.0.153",
|
|
36
|
+
"@cargo-messages/win32-x64-msvc": "0.0.153"
|
|
37
37
|
}
|
|
38
38
|
}
|