innetjs 3.0.3 → 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 +12 -5
- package/index.d.ts +4 -1
- package/index.js +7 -2
- package/index.mjs +7 -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) {
|
|
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) => {
|
|
@@ -505,6 +505,7 @@ class InnetJS {
|
|
|
505
505
|
pluginNodeResolve.nodeResolve(),
|
|
506
506
|
json__default["default"](),
|
|
507
507
|
ts__default["default"]({
|
|
508
|
+
tsconfig: config || false,
|
|
508
509
|
compilerOptions: {
|
|
509
510
|
sourceMap: true,
|
|
510
511
|
declaration: false,
|
|
@@ -522,7 +523,11 @@ class InnetJS {
|
|
|
522
523
|
yield bundle.close();
|
|
523
524
|
}));
|
|
524
525
|
yield logger__default["default"].start('Running of the script', () => tslib.__awaiter(this, void 0, void 0, function* () {
|
|
525
|
-
|
|
526
|
+
const flags = [];
|
|
527
|
+
if (exposeGc) {
|
|
528
|
+
flags.push('--expose-gc');
|
|
529
|
+
}
|
|
530
|
+
spawn('node', [...flags, '-r', 'source-map-support/register', jsFilePath], { stdio: 'inherit' });
|
|
526
531
|
}));
|
|
527
532
|
});
|
|
528
533
|
}
|
|
@@ -814,7 +819,7 @@ class InnetJS {
|
|
|
814
819
|
}
|
|
815
820
|
|
|
816
821
|
(function () {
|
|
817
|
-
const env = {"__INNETJS__PACKAGE_VERSION":"3.0
|
|
822
|
+
const env = {"__INNETJS__PACKAGE_VERSION":"3.1.0"};
|
|
818
823
|
if (typeof process === 'undefined') {
|
|
819
824
|
globalThis.process = { env: env };
|
|
820
825
|
} else if (process.env) {
|
|
@@ -844,9 +849,11 @@ commander.program
|
|
|
844
849
|
commander.program
|
|
845
850
|
.command('run <file-path>')
|
|
846
851
|
.description('Run js, ts or tsx file')
|
|
852
|
+
.option('-c, --config <file-path>', 'Config file for TypeScript')
|
|
853
|
+
.option('--expose-gc', 'Run node with global.gc support')
|
|
847
854
|
.addOption(errorOption)
|
|
848
|
-
.action((filePath, { error }) => {
|
|
849
|
-
innetJS.run(filePath).catch(e => {
|
|
855
|
+
.action((filePath, { error, config, exposeGc }) => {
|
|
856
|
+
innetJS.run(filePath, { config, exposeGc }).catch(e => {
|
|
850
857
|
if (error) {
|
|
851
858
|
console.error(e);
|
|
852
859
|
process.exit(1);
|
package/index.d.ts
CHANGED
|
@@ -68,7 +68,10 @@ export declare class InnetJS {
|
|
|
68
68
|
error?: boolean;
|
|
69
69
|
index?: string;
|
|
70
70
|
}): Promise<void>;
|
|
71
|
-
run(file: any
|
|
71
|
+
run(file: any, { config, exposeGc }?: {
|
|
72
|
+
config?: string;
|
|
73
|
+
exposeGc?: boolean;
|
|
74
|
+
}): Promise<void>;
|
|
72
75
|
release({ index, pub, min }?: ReleaseOptions): Promise<void>;
|
|
73
76
|
private _lintUsage;
|
|
74
77
|
withLint(options: rollup.RollupOptions, prod?: boolean): void;
|
package/index.js
CHANGED
|
@@ -411,7 +411,7 @@ class InnetJS {
|
|
|
411
411
|
}));
|
|
412
412
|
});
|
|
413
413
|
}
|
|
414
|
-
run(file) {
|
|
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) => {
|
|
@@ -433,6 +433,7 @@ class InnetJS {
|
|
|
433
433
|
pluginNodeResolve.nodeResolve(),
|
|
434
434
|
json__default["default"](),
|
|
435
435
|
ts__default["default"]({
|
|
436
|
+
tsconfig: config || false,
|
|
436
437
|
compilerOptions: {
|
|
437
438
|
sourceMap: true,
|
|
438
439
|
declaration: false,
|
|
@@ -450,7 +451,11 @@ class InnetJS {
|
|
|
450
451
|
yield bundle.close();
|
|
451
452
|
}));
|
|
452
453
|
yield logger__default["default"].start('Running of the script', () => tslib.__awaiter(this, void 0, void 0, function* () {
|
|
453
|
-
|
|
454
|
+
const flags = [];
|
|
455
|
+
if (exposeGc) {
|
|
456
|
+
flags.push('--expose-gc');
|
|
457
|
+
}
|
|
458
|
+
spawn('node', [...flags, '-r', 'source-map-support/register', jsFilePath], { stdio: 'inherit' });
|
|
454
459
|
}));
|
|
455
460
|
});
|
|
456
461
|
}
|
package/index.mjs
CHANGED
|
@@ -374,7 +374,7 @@ class InnetJS {
|
|
|
374
374
|
}));
|
|
375
375
|
});
|
|
376
376
|
}
|
|
377
|
-
run(file) {
|
|
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) => {
|
|
@@ -396,6 +396,7 @@ class InnetJS {
|
|
|
396
396
|
nodeResolve(),
|
|
397
397
|
json(),
|
|
398
398
|
ts({
|
|
399
|
+
tsconfig: config || false,
|
|
399
400
|
compilerOptions: {
|
|
400
401
|
sourceMap: true,
|
|
401
402
|
declaration: false,
|
|
@@ -413,7 +414,11 @@ class InnetJS {
|
|
|
413
414
|
yield bundle.close();
|
|
414
415
|
}));
|
|
415
416
|
yield logger.start('Running of the script', () => __awaiter(this, void 0, void 0, function* () {
|
|
416
|
-
|
|
417
|
+
const flags = [];
|
|
418
|
+
if (exposeGc) {
|
|
419
|
+
flags.push('--expose-gc');
|
|
420
|
+
}
|
|
421
|
+
spawn('node', [...flags, '-r', 'source-map-support/register', jsFilePath], { stdio: 'inherit' });
|
|
417
422
|
}));
|
|
418
423
|
});
|
|
419
424
|
}
|