mol_regexp 0.0.1729 → 0.0.1731
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 -31
- package/node.test.js.map +1 -1
- package/package.json +1 -1
package/node.test.js
CHANGED
|
@@ -484,34 +484,41 @@ var $;
|
|
|
484
484
|
|
|
485
485
|
;
|
|
486
486
|
"use strict";
|
|
487
|
-
var
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
return target.require(name);
|
|
494
|
-
if (name[0] === '.')
|
|
495
|
-
return target.require(name);
|
|
487
|
+
var $;
|
|
488
|
+
(function ($) {
|
|
489
|
+
const path = require('path');
|
|
490
|
+
const mod = require('module');
|
|
491
|
+
const localRequire = mod.createRequire(path.join(process.cwd(), 'package.json'));
|
|
492
|
+
function $node_autoinstall(name) {
|
|
496
493
|
try {
|
|
497
|
-
|
|
494
|
+
localRequire.resolve(name);
|
|
498
495
|
}
|
|
499
496
|
catch {
|
|
500
|
-
|
|
497
|
+
this.$mol_run.spawn({ command: ['npm', 'install', '--omit=dev', name], dir: '.' });
|
|
501
498
|
try {
|
|
502
|
-
|
|
499
|
+
this.$mol_run.spawn({ command: ['npm', 'install', '--omit=dev', '@types/' + name], dir: '.' });
|
|
503
500
|
}
|
|
504
501
|
catch (e) {
|
|
505
|
-
if (
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
}
|
|
509
|
-
const mam_node_modules = target.require('node:path').join(process.cwd(), 'node_modules');
|
|
510
|
-
if (!process.env.NODE_PATH?.includes(mam_node_modules)) {
|
|
511
|
-
process.env.NODE_PATH = `${mam_node_modules}${process.env.NODE_PATH ? `:${process.env.NODE_PATH}` : ''}`;
|
|
512
|
-
target.require('node:module').Module._initPaths();
|
|
502
|
+
if (this.$mol_promise_like(e))
|
|
503
|
+
this.$mol_fail_hidden(e);
|
|
504
|
+
this.$mol_fail_log(e);
|
|
513
505
|
}
|
|
514
506
|
}
|
|
507
|
+
}
|
|
508
|
+
$.$node_autoinstall = $node_autoinstall;
|
|
509
|
+
})($ || ($ = {}));
|
|
510
|
+
|
|
511
|
+
;
|
|
512
|
+
"use strict";
|
|
513
|
+
var $node = new Proxy({ require }, {
|
|
514
|
+
get(target, name, wrapper) {
|
|
515
|
+
if (target[name])
|
|
516
|
+
return target[name];
|
|
517
|
+
if ($.$node_internal_check(name))
|
|
518
|
+
return target.require(name);
|
|
519
|
+
if (name[0] === '.')
|
|
520
|
+
return target.require(name);
|
|
521
|
+
$.$node_autoinstall(name);
|
|
515
522
|
return target.require(name);
|
|
516
523
|
},
|
|
517
524
|
set(target, name, value) {
|
|
@@ -519,7 +526,6 @@ var $node = new Proxy({ require }, {
|
|
|
519
526
|
return true;
|
|
520
527
|
},
|
|
521
528
|
});
|
|
522
|
-
const cache = new Map();
|
|
523
529
|
require = (req => Object.assign(function require(name) {
|
|
524
530
|
return $node[name];
|
|
525
531
|
}, req))(require);
|
|
@@ -2484,16 +2490,6 @@ var $;
|
|
|
2484
2490
|
});
|
|
2485
2491
|
})($ || ($ = {}));
|
|
2486
2492
|
|
|
2487
|
-
;
|
|
2488
|
-
"use strict";
|
|
2489
|
-
var $;
|
|
2490
|
-
(function ($) {
|
|
2491
|
-
function $mol_exec(dir, command, ...args) {
|
|
2492
|
-
return this.$mol_run.spawn({ command: [command, ...args], dir });
|
|
2493
|
-
}
|
|
2494
|
-
$.$mol_exec = $mol_exec;
|
|
2495
|
-
})($ || ($ = {}));
|
|
2496
|
-
|
|
2497
2493
|
;
|
|
2498
2494
|
"use strict";
|
|
2499
2495
|
var $;
|