innetjs 3.0.4 → 3.1.1

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.1"};
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.1"};
3
3
  if (typeof process === 'undefined') {
4
4
  globalThis.process = { env: env };
5
5
  } else if (process.env) {
package/bin/innet CHANGED
@@ -389,8 +389,11 @@ class InnetJS {
389
389
  if (warning.code === 'THIS_IS_UNDEFINED' || warning.code === 'SOURCEMAP_ERROR')
390
390
  return;
391
391
  if (warning.plugin === 'typescript') {
392
- const { loc: { line, column, file }, frame, message } = warning;
393
- console.log(`ERROR in ${file}:${line}:${column}`);
392
+ const { loc, frame, message } = warning;
393
+ if (loc) {
394
+ const { line, column, file } = loc;
395
+ console.log(`ERROR in ${file}:${line}:${column}`);
396
+ }
394
397
  console.log(message);
395
398
  console.log(frame);
396
399
  return;
@@ -483,7 +486,7 @@ class InnetJS {
483
486
  }));
484
487
  });
485
488
  }
486
- run(file, { config = '' } = {}) {
489
+ run(file, { config = '', exposeGc = false } = {}) {
487
490
  return tslib.__awaiter(this, void 0, void 0, function* () {
488
491
  const input = yield logger__default["default"].start('Check file', () => getFile(file));
489
492
  const folder = yield new Promise((resolve, reject) => {
@@ -523,7 +526,11 @@ class InnetJS {
523
526
  yield bundle.close();
524
527
  }));
525
528
  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' });
529
+ const flags = [];
530
+ if (exposeGc) {
531
+ flags.push('--expose-gc');
532
+ }
533
+ spawn('node', [...flags, '-r', 'source-map-support/register', jsFilePath], { stdio: 'inherit' });
527
534
  }));
528
535
  });
529
536
  }
@@ -815,7 +822,7 @@ class InnetJS {
815
822
  }
816
823
 
817
824
  (function () {
818
- const env = {"__INNETJS__PACKAGE_VERSION":"3.0.4"};
825
+ const env = {"__INNETJS__PACKAGE_VERSION":"3.1.1"};
819
826
  if (typeof process === 'undefined') {
820
827
  globalThis.process = { env: env };
821
828
  } else if (process.env) {
@@ -846,9 +853,10 @@ commander.program
846
853
  .command('run <file-path>')
847
854
  .description('Run js, ts or tsx file')
848
855
  .option('-c, --config <file-path>', 'Config file for TypeScript')
856
+ .option('--expose-gc', 'Run node with global.gc support')
849
857
  .addOption(errorOption)
850
- .action((filePath, { error, config }) => {
851
- innetJS.run(filePath, { config }).catch(e => {
858
+ .action((filePath, { error, config, exposeGc }) => {
859
+ innetJS.run(filePath, { config, exposeGc }).catch(e => {
852
860
  if (error) {
853
861
  console.error(e);
854
862
  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
@@ -317,8 +317,11 @@ class InnetJS {
317
317
  if (warning.code === 'THIS_IS_UNDEFINED' || warning.code === 'SOURCEMAP_ERROR')
318
318
  return;
319
319
  if (warning.plugin === 'typescript') {
320
- const { loc: { line, column, file }, frame, message } = warning;
321
- console.log(`ERROR in ${file}:${line}:${column}`);
320
+ const { loc, frame, message } = warning;
321
+ if (loc) {
322
+ const { line, column, file } = loc;
323
+ console.log(`ERROR in ${file}:${line}:${column}`);
324
+ }
322
325
  console.log(message);
323
326
  console.log(frame);
324
327
  return;
@@ -411,7 +414,7 @@ class InnetJS {
411
414
  }));
412
415
  });
413
416
  }
414
- run(file, { config = '' } = {}) {
417
+ run(file, { config = '', exposeGc = false } = {}) {
415
418
  return tslib.__awaiter(this, void 0, void 0, function* () {
416
419
  const input = yield logger__default["default"].start('Check file', () => helpers.getFile(file));
417
420
  const folder = yield new Promise((resolve, reject) => {
@@ -451,7 +454,11 @@ class InnetJS {
451
454
  yield bundle.close();
452
455
  }));
453
456
  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' });
457
+ const flags = [];
458
+ if (exposeGc) {
459
+ flags.push('--expose-gc');
460
+ }
461
+ spawn('node', [...flags, '-r', 'source-map-support/register', jsFilePath], { stdio: 'inherit' });
455
462
  }));
456
463
  });
457
464
  }
package/index.mjs CHANGED
@@ -280,8 +280,11 @@ class InnetJS {
280
280
  if (warning.code === 'THIS_IS_UNDEFINED' || warning.code === 'SOURCEMAP_ERROR')
281
281
  return;
282
282
  if (warning.plugin === 'typescript') {
283
- const { loc: { line, column, file }, frame, message } = warning;
284
- console.log(`ERROR in ${file}:${line}:${column}`);
283
+ const { loc, frame, message } = warning;
284
+ if (loc) {
285
+ const { line, column, file } = loc;
286
+ console.log(`ERROR in ${file}:${line}:${column}`);
287
+ }
285
288
  console.log(message);
286
289
  console.log(frame);
287
290
  return;
@@ -374,7 +377,7 @@ class InnetJS {
374
377
  }));
375
378
  });
376
379
  }
377
- run(file, { config = '' } = {}) {
380
+ run(file, { config = '', exposeGc = false } = {}) {
378
381
  return __awaiter(this, void 0, void 0, function* () {
379
382
  const input = yield logger.start('Check file', () => getFile(file));
380
383
  const folder = yield new Promise((resolve, reject) => {
@@ -414,7 +417,11 @@ class InnetJS {
414
417
  yield bundle.close();
415
418
  }));
416
419
  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' });
420
+ const flags = [];
421
+ if (exposeGc) {
422
+ flags.push('--expose-gc');
423
+ }
424
+ spawn('node', [...flags, '-r', 'source-map-support/register', jsFilePath], { stdio: 'inherit' });
418
425
  }));
419
426
  });
420
427
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "innetjs",
3
- "version": "3.0.4",
3
+ "version": "3.1.1",
4
4
  "description": "CLI for innet boilerplate",
5
5
  "homepage": "https://github.com/d8corp/innetjs",
6
6
  "author": "Mikhail Lysikov <d8corp@mail.ru>",