mol_wire_lib 1.0.1633 → 1.0.1634
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/node.test.js +27 -26
- package/node.test.js.map +1 -1
- package/package.json +1 -1
package/node.test.js
CHANGED
|
@@ -2871,29 +2871,41 @@ var $;
|
|
|
2871
2871
|
|
|
2872
2872
|
;
|
|
2873
2873
|
"use strict";
|
|
2874
|
-
var
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
return target.require(name);
|
|
2881
|
-
if (name[0] === '.')
|
|
2882
|
-
return target.require(name);
|
|
2874
|
+
var $;
|
|
2875
|
+
(function ($) {
|
|
2876
|
+
const path = require('path');
|
|
2877
|
+
const mod = require('module');
|
|
2878
|
+
const localRequire = mod.createRequire(path.join(process.cwd(), 'package.json'));
|
|
2879
|
+
function $node_autoinstall(name) {
|
|
2883
2880
|
try {
|
|
2884
|
-
|
|
2881
|
+
localRequire.resolve(name);
|
|
2885
2882
|
}
|
|
2886
2883
|
catch {
|
|
2887
|
-
|
|
2884
|
+
this.$mol_run.spawn({ command: ['npm', 'install', '--omit=dev', name], dir: '.' });
|
|
2888
2885
|
try {
|
|
2889
|
-
|
|
2886
|
+
this.$mol_run.spawn({ command: ['npm', 'install', '--omit=dev', '@types/' + name], dir: '.' });
|
|
2890
2887
|
}
|
|
2891
2888
|
catch (e) {
|
|
2892
|
-
if (
|
|
2893
|
-
|
|
2894
|
-
|
|
2889
|
+
if (this.$mol_promise_like(e))
|
|
2890
|
+
this.$mol_fail_hidden(e);
|
|
2891
|
+
this.$mol_fail_log(e);
|
|
2895
2892
|
}
|
|
2896
2893
|
}
|
|
2894
|
+
}
|
|
2895
|
+
$.$node_autoinstall = $node_autoinstall;
|
|
2896
|
+
})($ || ($ = {}));
|
|
2897
|
+
|
|
2898
|
+
;
|
|
2899
|
+
"use strict";
|
|
2900
|
+
var $node = new Proxy({ require }, {
|
|
2901
|
+
get(target, name, wrapper) {
|
|
2902
|
+
if (target[name])
|
|
2903
|
+
return target[name];
|
|
2904
|
+
if ($.$node_internal_check(name))
|
|
2905
|
+
return target.require(name);
|
|
2906
|
+
if (name[0] === '.')
|
|
2907
|
+
return target.require(name);
|
|
2908
|
+
$.$node_autoinstall(name);
|
|
2897
2909
|
return target.require(name);
|
|
2898
2910
|
},
|
|
2899
2911
|
set(target, name, value) {
|
|
@@ -2901,7 +2913,6 @@ var $node = new Proxy({ require }, {
|
|
|
2901
2913
|
return true;
|
|
2902
2914
|
},
|
|
2903
2915
|
});
|
|
2904
|
-
const cache = new Map();
|
|
2905
2916
|
require = (req => Object.assign(function require(name) {
|
|
2906
2917
|
return $node[name];
|
|
2907
2918
|
}, req))(require);
|
|
@@ -3306,16 +3317,6 @@ var $;
|
|
|
3306
3317
|
});
|
|
3307
3318
|
})($ || ($ = {}));
|
|
3308
3319
|
|
|
3309
|
-
;
|
|
3310
|
-
"use strict";
|
|
3311
|
-
var $;
|
|
3312
|
-
(function ($) {
|
|
3313
|
-
function $mol_exec(dir, command, ...args) {
|
|
3314
|
-
return this.$mol_run.spawn({ command: [command, ...args], dir });
|
|
3315
|
-
}
|
|
3316
|
-
$.$mol_exec = $mol_exec;
|
|
3317
|
-
})($ || ($ = {}));
|
|
3318
|
-
|
|
3319
3320
|
;
|
|
3320
3321
|
"use strict";
|
|
3321
3322
|
var $;
|