innetjs 3.0.4 → 3.1.0
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/_virtual/_rollup-plugin-process-env.js +1 -1
- package/_virtual/_rollup-plugin-process-env.mjs +1 -1
- package/bin/innet +10 -5
- package/index.d.ts +2 -1
- package/index.js +6 -2
- package/index.mjs +6 -2
- package/package.json +1 -1
package/bin/innet
CHANGED
|
@@ -483,7 +483,7 @@ class InnetJS {
|
|
|
483
483
|
}));
|
|
484
484
|
});
|
|
485
485
|
}
|
|
486
|
-
run(file, { config = '' } = {}) {
|
|
486
|
+
run(file, { config = '', exposeGc = false } = {}) {
|
|
487
487
|
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
488
488
|
const input = yield logger__default["default"].start('Check file', () => getFile(file));
|
|
489
489
|
const folder = yield new Promise((resolve, reject) => {
|
|
@@ -523,7 +523,11 @@ class InnetJS {
|
|
|
523
523
|
yield bundle.close();
|
|
524
524
|
}));
|
|
525
525
|
yield logger__default["default"].start('Running of the script', () => tslib.__awaiter(this, void 0, void 0, function* () {
|
|
526
|
-
|
|
526
|
+
const flags = [];
|
|
527
|
+
if (exposeGc) {
|
|
528
|
+
flags.push('--expose-gc');
|
|
529
|
+
}
|
|
530
|
+
spawn('node', [...flags, '-r', 'source-map-support/register', jsFilePath], { stdio: 'inherit' });
|
|
527
531
|
}));
|
|
528
532
|
});
|
|
529
533
|
}
|
|
@@ -815,7 +819,7 @@ class InnetJS {
|
|
|
815
819
|
}
|
|
816
820
|
|
|
817
821
|
(function () {
|
|
818
|
-
const env = {"__INNETJS__PACKAGE_VERSION":"3.0
|
|
822
|
+
const env = {"__INNETJS__PACKAGE_VERSION":"3.1.0"};
|
|
819
823
|
if (typeof process === 'undefined') {
|
|
820
824
|
globalThis.process = { env: env };
|
|
821
825
|
} else if (process.env) {
|
|
@@ -846,9 +850,10 @@ commander.program
|
|
|
846
850
|
.command('run <file-path>')
|
|
847
851
|
.description('Run js, ts or tsx file')
|
|
848
852
|
.option('-c, --config <file-path>', 'Config file for TypeScript')
|
|
853
|
+
.option('--expose-gc', 'Run node with global.gc support')
|
|
849
854
|
.addOption(errorOption)
|
|
850
|
-
.action((filePath, { error, config }) => {
|
|
851
|
-
innetJS.run(filePath, { config }).catch(e => {
|
|
855
|
+
.action((filePath, { error, config, exposeGc }) => {
|
|
856
|
+
innetJS.run(filePath, { config, exposeGc }).catch(e => {
|
|
852
857
|
if (error) {
|
|
853
858
|
console.error(e);
|
|
854
859
|
process.exit(1);
|
package/index.d.ts
CHANGED
|
@@ -68,8 +68,9 @@ export declare class InnetJS {
|
|
|
68
68
|
error?: boolean;
|
|
69
69
|
index?: string;
|
|
70
70
|
}): Promise<void>;
|
|
71
|
-
run(file: any, { config }?: {
|
|
71
|
+
run(file: any, { config, exposeGc }?: {
|
|
72
72
|
config?: string;
|
|
73
|
+
exposeGc?: boolean;
|
|
73
74
|
}): Promise<void>;
|
|
74
75
|
release({ index, pub, min }?: ReleaseOptions): Promise<void>;
|
|
75
76
|
private _lintUsage;
|
package/index.js
CHANGED
|
@@ -411,7 +411,7 @@ class InnetJS {
|
|
|
411
411
|
}));
|
|
412
412
|
});
|
|
413
413
|
}
|
|
414
|
-
run(file, { config = '' } = {}) {
|
|
414
|
+
run(file, { config = '', exposeGc = false } = {}) {
|
|
415
415
|
return tslib.__awaiter(this, void 0, void 0, function* () {
|
|
416
416
|
const input = yield logger__default["default"].start('Check file', () => helpers.getFile(file));
|
|
417
417
|
const folder = yield new Promise((resolve, reject) => {
|
|
@@ -451,7 +451,11 @@ class InnetJS {
|
|
|
451
451
|
yield bundle.close();
|
|
452
452
|
}));
|
|
453
453
|
yield logger__default["default"].start('Running of the script', () => tslib.__awaiter(this, void 0, void 0, function* () {
|
|
454
|
-
|
|
454
|
+
const flags = [];
|
|
455
|
+
if (exposeGc) {
|
|
456
|
+
flags.push('--expose-gc');
|
|
457
|
+
}
|
|
458
|
+
spawn('node', [...flags, '-r', 'source-map-support/register', jsFilePath], { stdio: 'inherit' });
|
|
455
459
|
}));
|
|
456
460
|
});
|
|
457
461
|
}
|
package/index.mjs
CHANGED
|
@@ -374,7 +374,7 @@ class InnetJS {
|
|
|
374
374
|
}));
|
|
375
375
|
});
|
|
376
376
|
}
|
|
377
|
-
run(file, { config = '' } = {}) {
|
|
377
|
+
run(file, { config = '', exposeGc = false } = {}) {
|
|
378
378
|
return __awaiter(this, void 0, void 0, function* () {
|
|
379
379
|
const input = yield logger.start('Check file', () => getFile(file));
|
|
380
380
|
const folder = yield new Promise((resolve, reject) => {
|
|
@@ -414,7 +414,11 @@ class InnetJS {
|
|
|
414
414
|
yield bundle.close();
|
|
415
415
|
}));
|
|
416
416
|
yield logger.start('Running of the script', () => __awaiter(this, void 0, void 0, function* () {
|
|
417
|
-
|
|
417
|
+
const flags = [];
|
|
418
|
+
if (exposeGc) {
|
|
419
|
+
flags.push('--expose-gc');
|
|
420
|
+
}
|
|
421
|
+
spawn('node', [...flags, '-r', 'source-map-support/register', jsFilePath], { stdio: 'inherit' });
|
|
418
422
|
}));
|
|
419
423
|
});
|
|
420
424
|
}
|