mol_data_all 1.1.1679 → 1.1.1680
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
|
@@ -749,29 +749,41 @@ var $;
|
|
|
749
749
|
|
|
750
750
|
;
|
|
751
751
|
"use strict";
|
|
752
|
-
var
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
return target.require(name);
|
|
759
|
-
if (name[0] === '.')
|
|
760
|
-
return target.require(name);
|
|
752
|
+
var $;
|
|
753
|
+
(function ($) {
|
|
754
|
+
const path = require('path');
|
|
755
|
+
const mod = require('module');
|
|
756
|
+
const localRequire = mod.createRequire(path.join(process.cwd(), 'package.json'));
|
|
757
|
+
function $node_autoinstall(name) {
|
|
761
758
|
try {
|
|
762
|
-
|
|
759
|
+
localRequire.resolve(name);
|
|
763
760
|
}
|
|
764
761
|
catch {
|
|
765
|
-
|
|
762
|
+
this.$mol_run.spawn({ command: ['npm', 'install', '--omit=dev', name], dir: '.' });
|
|
766
763
|
try {
|
|
767
|
-
|
|
764
|
+
this.$mol_run.spawn({ command: ['npm', 'install', '--omit=dev', '@types/' + name], dir: '.' });
|
|
768
765
|
}
|
|
769
766
|
catch (e) {
|
|
770
|
-
if (
|
|
771
|
-
|
|
772
|
-
|
|
767
|
+
if (this.$mol_promise_like(e))
|
|
768
|
+
this.$mol_fail_hidden(e);
|
|
769
|
+
this.$mol_fail_log(e);
|
|
773
770
|
}
|
|
774
771
|
}
|
|
772
|
+
}
|
|
773
|
+
$.$node_autoinstall = $node_autoinstall;
|
|
774
|
+
})($ || ($ = {}));
|
|
775
|
+
|
|
776
|
+
;
|
|
777
|
+
"use strict";
|
|
778
|
+
var $node = new Proxy({ require }, {
|
|
779
|
+
get(target, name, wrapper) {
|
|
780
|
+
if (target[name])
|
|
781
|
+
return target[name];
|
|
782
|
+
if ($.$node_internal_check(name))
|
|
783
|
+
return target.require(name);
|
|
784
|
+
if (name[0] === '.')
|
|
785
|
+
return target.require(name);
|
|
786
|
+
$.$node_autoinstall(name);
|
|
775
787
|
return target.require(name);
|
|
776
788
|
},
|
|
777
789
|
set(target, name, value) {
|
|
@@ -779,7 +791,6 @@ var $node = new Proxy({ require }, {
|
|
|
779
791
|
return true;
|
|
780
792
|
},
|
|
781
793
|
});
|
|
782
|
-
const cache = new Map();
|
|
783
794
|
require = (req => Object.assign(function require(name) {
|
|
784
795
|
return $node[name];
|
|
785
796
|
}, req))(require);
|
|
@@ -2675,16 +2686,6 @@ var $;
|
|
|
2675
2686
|
});
|
|
2676
2687
|
})($ || ($ = {}));
|
|
2677
2688
|
|
|
2678
|
-
;
|
|
2679
|
-
"use strict";
|
|
2680
|
-
var $;
|
|
2681
|
-
(function ($) {
|
|
2682
|
-
function $mol_exec(dir, command, ...args) {
|
|
2683
|
-
return this.$mol_run.spawn({ command: [command, ...args], dir });
|
|
2684
|
-
}
|
|
2685
|
-
$.$mol_exec = $mol_exec;
|
|
2686
|
-
})($ || ($ = {}));
|
|
2687
|
-
|
|
2688
2689
|
;
|
|
2689
2690
|
"use strict";
|
|
2690
2691
|
var $;
|