mam 1.11.815 → 1.11.817
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.d.ts +5 -6
- package/node.d.ts.map +1 -1
- package/node.deps.json +1 -1
- package/node.js +29 -28
- package/node.js.map +1 -1
- package/node.mjs +29 -28
- package/node.test.js +29 -28
- package/node.test.js.map +1 -1
- package/package.json +3 -2
package/node.js
CHANGED
|
@@ -2435,29 +2435,41 @@ var $;
|
|
|
2435
2435
|
|
|
2436
2436
|
;
|
|
2437
2437
|
"use strict";
|
|
2438
|
-
var
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
return target.require(name);
|
|
2445
|
-
if (name[0] === '.')
|
|
2446
|
-
return target.require(name);
|
|
2438
|
+
var $;
|
|
2439
|
+
(function ($) {
|
|
2440
|
+
const path = require('path');
|
|
2441
|
+
const mod = require('module');
|
|
2442
|
+
const localRequire = mod.createRequire(path.join(process.cwd(), 'package.json'));
|
|
2443
|
+
function $node_autoinstall(name) {
|
|
2447
2444
|
try {
|
|
2448
|
-
|
|
2445
|
+
localRequire.resolve(name);
|
|
2449
2446
|
}
|
|
2450
2447
|
catch {
|
|
2451
|
-
|
|
2448
|
+
this.$mol_run.spawn({ command: ['npm', 'install', '--omit=dev', name], dir: '.' });
|
|
2452
2449
|
try {
|
|
2453
|
-
|
|
2450
|
+
this.$mol_run.spawn({ command: ['npm', 'install', '--omit=dev', '@types/' + name], dir: '.' });
|
|
2454
2451
|
}
|
|
2455
2452
|
catch (e) {
|
|
2456
|
-
if (
|
|
2457
|
-
|
|
2458
|
-
|
|
2453
|
+
if (this.$mol_promise_like(e))
|
|
2454
|
+
this.$mol_fail_hidden(e);
|
|
2455
|
+
this.$mol_fail_log(e);
|
|
2459
2456
|
}
|
|
2460
2457
|
}
|
|
2458
|
+
}
|
|
2459
|
+
$.$node_autoinstall = $node_autoinstall;
|
|
2460
|
+
})($ || ($ = {}));
|
|
2461
|
+
|
|
2462
|
+
;
|
|
2463
|
+
"use strict";
|
|
2464
|
+
var $node = new Proxy({ require }, {
|
|
2465
|
+
get(target, name, wrapper) {
|
|
2466
|
+
if (target[name])
|
|
2467
|
+
return target[name];
|
|
2468
|
+
if ($.$node_internal_check(name))
|
|
2469
|
+
return target.require(name);
|
|
2470
|
+
if (name[0] === '.')
|
|
2471
|
+
return target.require(name);
|
|
2472
|
+
$.$node_autoinstall(name);
|
|
2461
2473
|
return target.require(name);
|
|
2462
2474
|
},
|
|
2463
2475
|
set(target, name, value) {
|
|
@@ -2465,7 +2477,6 @@ var $node = new Proxy({ require }, {
|
|
|
2465
2477
|
return true;
|
|
2466
2478
|
},
|
|
2467
2479
|
});
|
|
2468
|
-
const cache = new Map();
|
|
2469
2480
|
require = (req => Object.assign(function require(name) {
|
|
2470
2481
|
return $node[name];
|
|
2471
2482
|
}, req))(require);
|
|
@@ -2676,16 +2687,6 @@ var $;
|
|
|
2676
2687
|
$.$mol_run = $mol_run;
|
|
2677
2688
|
})($ || ($ = {}));
|
|
2678
2689
|
|
|
2679
|
-
;
|
|
2680
|
-
"use strict";
|
|
2681
|
-
var $;
|
|
2682
|
-
(function ($) {
|
|
2683
|
-
function $mol_exec(dir, command, ...args) {
|
|
2684
|
-
return this.$mol_run.spawn({ command: [command, ...args], dir });
|
|
2685
|
-
}
|
|
2686
|
-
$.$mol_exec = $mol_exec;
|
|
2687
|
-
})($ || ($ = {}));
|
|
2688
|
-
|
|
2689
2690
|
;
|
|
2690
2691
|
"use strict";
|
|
2691
2692
|
var $;
|
|
@@ -5957,12 +5958,12 @@ var $;
|
|
|
5957
5958
|
if ([node, node_modules].includes(parent)
|
|
5958
5959
|
&& mod.name() !== 'node'
|
|
5959
5960
|
&& !mod.name().startsWith('@')) {
|
|
5960
|
-
|
|
5961
|
+
this.$.$node_autoinstall(mod.name());
|
|
5961
5962
|
return true;
|
|
5962
5963
|
}
|
|
5963
5964
|
if ([node, node_modules].includes(parent.parent())
|
|
5964
5965
|
&& parent.name().startsWith('@')) {
|
|
5965
|
-
|
|
5966
|
+
this.$.$node_autoinstall(`${parent.name()}/${mod.name()}`);
|
|
5966
5967
|
return true;
|
|
5967
5968
|
}
|
|
5968
5969
|
return false;
|