cargo-messages 0.0.56 → 0.0.57

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/cjs/index.cjs +8 -39
  2. package/package.json +1 -1
package/cjs/index.cjs CHANGED
@@ -1,40 +1,9 @@
1
- const { currentTarget } = require('@neon-rs/load');
2
-
3
- /*
4
- const TABLE = {
5
- 'darwin-x64': () => require('@cargo-messages/darwin-x64'),
6
- 'win32-x64-msvc': () => require('@cargo-messages/win32-x64-msvc'),
7
- 'aarch64-pc-windows-msvc': () => require('@cargo-messages/win32-arm64-msvc'),
8
- 'darwin-x64': () => require('@cargo-messages/darwin-x64'),
9
- 'darwin-arm64': () => require('@cargo-messages/darwin-arm64'),
10
- 'linux-x64-gnu': () => require('@cargo-messages/linux-x64-gnu'),
11
- 'linux-arm-gnueabihf': () => require('@cargo-messages/linux-arm-gnueabihf'),
12
- 'android-arm-eabi': () => require('@cargo-messages/android-arm-eabi')
13
- };
14
- */
15
-
16
- let saved = null;
17
-
18
- function addon() {
19
- if (saved) {
20
- return saved;
21
- }
22
- const target = currentTarget();
23
- switch (target) {
24
- case 'darwin-x64': saved = require('@cargo-messages/darwin-x64'); break;
25
- default: throw new Error(`no binary @cargo-messages module found for ${target}`);
26
- }
27
- return addon();
28
- }
29
-
30
- /*
31
1
  const {
32
- findArtifact,
33
- findFileByCrateType,
34
2
  fromFile,
35
- fromStdin
36
- } = addon();
37
- */
3
+ fromStdin,
4
+ findArtifact,
5
+ findFileByCrateType
6
+ } = require('./load.cjs');
38
7
 
39
8
  const PRIVATE = {};
40
9
 
@@ -51,7 +20,7 @@ class CargoArtifact {
51
20
  }
52
21
 
53
22
  findFileByCrateType(crateType) {
54
- return addon().findFileByCrateType(this._kernel, crateType);
23
+ return findFileByCrateType(this._kernel, crateType);
55
24
  }
56
25
  }
57
26
 
@@ -61,12 +30,12 @@ class CargoMessages {
61
30
  this._mount = options.mount || null;
62
31
  this._manifestPath = options.manifestPath || null;
63
32
  this._kernel = options.file
64
- ? addon().fromFile(options.file, this._mount, this._manifestPath)
65
- : addon().fromStdin(this._mount, this._manifestPath);
33
+ ? fromFile(options.file, this._mount, this._manifestPath)
34
+ : fromStdin(this._mount, this._manifestPath);
66
35
  }
67
36
 
68
37
  findArtifact(crateName) {
69
- const found = addon().findArtifact(this._kernel, crateName);
38
+ const found = findArtifact(this._kernel, crateName);
70
39
  return found
71
40
  ? new CargoArtifact(PRIVATE, found)
72
41
  : null;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cargo-messages",
3
3
  "private": false,
4
- "version": "0.0.56",
4
+ "version": "0.0.57",
5
5
  "description": "A streaming reader for JSON messages emitted from Cargo.",
6
6
  "type": "module",
7
7
  "exports": {