@neon-rs/cli 0.0.158 → 0.0.160

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/index.js +46 -21
  2. package/package.json +8 -8
package/index.js CHANGED
@@ -100,7 +100,14 @@ function bin(scope, ...rest) {
100
100
  return [...interleave(scope, rest)].join("") + "/" + currentTarget();
101
101
  }
102
102
  __webpack_unused_export__ = bin;
103
- function lazy(loaders, exports) {
103
+ function lazyV1(loaders, exports) {
104
+ return lazyV2({
105
+ targets: loaders,
106
+ exports
107
+ });
108
+ }
109
+ function lazyV2(options) {
110
+ const loaders = options.targets;
104
111
  let loaded = null;
105
112
  function load() {
106
113
  if (loaded) {
@@ -110,15 +117,30 @@ function lazy(loaders, exports) {
110
117
  if (!loaders.hasOwnProperty(target)) {
111
118
  throw new Error(`no precompiled module found for ${target}`);
112
119
  }
113
- loaded = loaders[target]();
120
+ if (options.debug) {
121
+ try {
122
+ loaded = options.debug();
123
+ }
124
+ catch (_e) {
125
+ loaded = null;
126
+ }
127
+ }
128
+ if (!loaded) {
129
+ loaded = loaders[target]();
130
+ }
114
131
  return loaded;
115
132
  }
116
133
  let module = {};
117
- for (const key of exports) {
134
+ for (const key of options.exports) {
118
135
  Object.defineProperty(module, key, { get() { return load()[key]; } });
119
136
  }
120
137
  return module;
121
138
  }
139
+ function lazy(optionsOrLoaders, exports) {
140
+ return exports
141
+ ? lazyV1(optionsOrLoaders, exports)
142
+ : lazyV2(optionsOrLoaders);
143
+ }
122
144
  exports.Vo = lazy;
123
145
 
124
146
 
@@ -15793,24 +15815,27 @@ module.exports = {
15793
15815
  /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
15794
15816
 
15795
15817
  module.exports = (__nccwpck_require__(4371)/* .lazy */ .Vo)({
15796
- 'darwin-x64': () => __nccwpck_require__(5583),
15797
- 'win32-x64-msvc': () => __nccwpck_require__(4459),
15798
- 'aarch64-pc-windows-msvc': () => __nccwpck_require__(9329),
15799
- 'darwin-x64': () => __nccwpck_require__(5583),
15800
- 'darwin-arm64': () => __nccwpck_require__(5111),
15801
- 'linux-x64-gnu': () => __nccwpck_require__(9301),
15802
- 'linux-arm-gnueabihf': () => __nccwpck_require__(6698),
15803
- 'android-arm-eabi': () => __nccwpck_require__(5193)
15804
- }, [
15805
- 'findArtifact',
15806
- 'findFileByCrateType',
15807
- 'fromStdin',
15808
- 'fromFile',
15809
- 'createReader',
15810
- 'compilerArtifactCrateName',
15811
- 'compilerArtifactFindFileByCrateType',
15812
- 'readline'
15813
- ]);
15818
+ targets: {
15819
+ 'darwin-x64': () => __nccwpck_require__(5583),
15820
+ 'win32-x64-msvc': () => __nccwpck_require__(4459),
15821
+ 'aarch64-pc-windows-msvc': () => __nccwpck_require__(9329),
15822
+ 'darwin-x64': () => __nccwpck_require__(5583),
15823
+ 'darwin-arm64': () => __nccwpck_require__(5111),
15824
+ 'linux-x64-gnu': () => __nccwpck_require__(9301),
15825
+ 'linux-arm-gnueabihf': () => __nccwpck_require__(6698),
15826
+ 'android-arm-eabi': () => __nccwpck_require__(5193)
15827
+ },
15828
+ exports: [
15829
+ 'findArtifact',
15830
+ 'findFileByCrateType',
15831
+ 'fromStdin',
15832
+ 'fromFile',
15833
+ 'createReader',
15834
+ 'compilerArtifactCrateName',
15835
+ 'compilerArtifactFindFileByCrateType',
15836
+ 'readline'
15837
+ ]
15838
+ });
15814
15839
 
15815
15840
 
15816
15841
  /***/ })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@neon-rs/cli",
3
- "version": "0.0.158",
3
+ "version": "0.0.160",
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.158",
31
- "@cargo-messages/darwin-arm64": "0.0.158",
32
- "@cargo-messages/darwin-x64": "0.0.158",
33
- "@cargo-messages/linux-arm-gnueabihf": "0.0.158",
34
- "@cargo-messages/linux-x64-gnu": "0.0.158",
35
- "@cargo-messages/win32-arm64-msvc": "0.0.158",
36
- "@cargo-messages/win32-x64-msvc": "0.0.158"
30
+ "@cargo-messages/android-arm-eabi": "0.0.160",
31
+ "@cargo-messages/darwin-arm64": "0.0.160",
32
+ "@cargo-messages/darwin-x64": "0.0.160",
33
+ "@cargo-messages/linux-arm-gnueabihf": "0.0.160",
34
+ "@cargo-messages/linux-x64-gnu": "0.0.160",
35
+ "@cargo-messages/win32-arm64-msvc": "0.0.160",
36
+ "@cargo-messages/win32-x64-msvc": "0.0.160"
37
37
  }
38
38
  }