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.
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  ;(function () {
4
- const env = {"__INNETJS__PACKAGE_VERSION":"3.0.4"};
4
+ const env = {"__INNETJS__PACKAGE_VERSION":"3.1.0"};
5
5
  if (typeof process === 'undefined') {
6
6
  globalThis.process = { env: env };
7
7
  } else if (process.env) {
@@ -1,5 +1,5 @@
1
1
  ;(function () {
2
- const env = {"__INNETJS__PACKAGE_VERSION":"3.0.4"};
2
+ const env = {"__INNETJS__PACKAGE_VERSION":"3.1.0"};
3
3
  if (typeof process === 'undefined') {
4
4
  globalThis.process = { env: env };
5
5
  } else if (process.env) {
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
- spawn('node', ['-r', 'source-map-support/register', jsFilePath], { stdio: 'inherit' });
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.4"};
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
- spawn('node', ['-r', 'source-map-support/register', jsFilePath], { stdio: 'inherit' });
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
- spawn('node', ['-r', 'source-map-support/register', jsFilePath], { stdio: 'inherit' });
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "innetjs",
3
- "version": "3.0.4",
3
+ "version": "3.1.0",
4
4
  "description": "CLI for innet boilerplate",
5
5
  "homepage": "https://github.com/d8corp/innetjs",
6
6
  "author": "Mikhail Lysikov <d8corp@mail.ru>",