cargo-messages 0.0.62 → 0.0.63
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/lib/load.cjs
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
const { currentTarget } = require('@neon-rs/load');
|
|
2
|
+
|
|
3
|
+
function lazy(loaders, exports) {
|
|
4
|
+
let loaded = null;
|
|
5
|
+
|
|
6
|
+
function load() {
|
|
7
|
+
if (loaded) {
|
|
8
|
+
return loaded;
|
|
9
|
+
}
|
|
10
|
+
const target = currentTarget();
|
|
11
|
+
if (!loaders.hasOwnProperty(target)) {
|
|
12
|
+
throw new Error(`no precompiled module found for ${target}`);
|
|
13
|
+
}
|
|
14
|
+
loaded = loaders[target]();
|
|
15
|
+
return loaded;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
let module = {};
|
|
19
|
+
|
|
20
|
+
for (const key of exports) {
|
|
21
|
+
Object.defineProperty(module, key, { get() { return load()[key]; } });
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
return module;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
module.exports = lazy({
|
|
28
|
+
'darwin-x64': () => require('@cargo-messages/darwin-x64'),
|
|
29
|
+
'win32-x64-msvc': () => require('@cargo-messages/win32-x64-msvc'),
|
|
30
|
+
'aarch64-pc-windows-msvc': () => require('@cargo-messages/win32-arm64-msvc'),
|
|
31
|
+
'darwin-x64': () => require('@cargo-messages/darwin-x64'),
|
|
32
|
+
'darwin-arm64': () => require('@cargo-messages/darwin-arm64'),
|
|
33
|
+
'linux-x64-gnu': () => require('@cargo-messages/linux-x64-gnu'),
|
|
34
|
+
'linux-arm-gnueabihf': () => require('@cargo-messages/linux-arm-gnueabihf'),
|
|
35
|
+
'android-arm-eabi': () => require('@cargo-messages/android-arm-eabi')
|
|
36
|
+
}, [
|
|
37
|
+
'fromFile',
|
|
38
|
+
'fromStdin',
|
|
39
|
+
'findArtifact',
|
|
40
|
+
'findFileByCrateType'
|
|
41
|
+
]);
|
package/package.json
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cargo-messages",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.63",
|
|
5
5
|
"description": "A streaming reader for JSON messages emitted from Cargo.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"exports": {
|
|
8
8
|
".": {
|
|
9
9
|
"import": {
|
|
10
|
-
"types": "./types/
|
|
11
|
-
"default": "./
|
|
10
|
+
"types": "./types/index.d.mts",
|
|
11
|
+
"default": "./lib/index.mjs"
|
|
12
12
|
},
|
|
13
13
|
"require": {
|
|
14
|
-
"types": "./types/
|
|
15
|
-
"default": "./
|
|
14
|
+
"types": "./types/index.d.cts",
|
|
15
|
+
"default": "./lib/index.cjs"
|
|
16
16
|
}
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
|
-
"types": "./types/
|
|
20
|
-
"main": "./
|
|
19
|
+
"types": "./types/index.d.cts",
|
|
20
|
+
"main": "./lib/index.cjs",
|
|
21
21
|
"files": [
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
"types/
|
|
22
|
+
"lib/index.cjs",
|
|
23
|
+
"lib/load.cjs",
|
|
24
|
+
"lib/index.mjs",
|
|
25
|
+
"types/index.d.cts",
|
|
26
|
+
"types/index.d.mts"
|
|
26
27
|
],
|
|
27
28
|
"scripts": {
|
|
28
29
|
"test": "cargo test",
|
/package/{cjs → lib}/index.cjs
RENAMED
|
File without changes
|
|
File without changes
|