innetjs 2.3.1 → 2.3.3
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/bin/innet +7 -5
- package/index.d.ts +1 -1
- package/index.js +7 -5
- package/index.mjs +7 -5
- package/package.json +1 -1
package/bin/innet
CHANGED
|
@@ -191,6 +191,7 @@ const execAsync = node_util.promisify(exec);
|
|
|
191
191
|
const copyFiles = node_util.promisify(fs__default["default"].copy);
|
|
192
192
|
updateDotenv();
|
|
193
193
|
const REG_CLEAR_TEXT = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;
|
|
194
|
+
const REG_RPT_ERROR_FILE = /(src[^:]+):(\d+):(\d+)/;
|
|
194
195
|
const REG_TJSX = /\.[tj]sx?$/;
|
|
195
196
|
const REG_EXT = /\.([^.]+)$/;
|
|
196
197
|
const scriptExtensions = ['ts', 'js', 'tsx', 'jsx'];
|
|
@@ -295,7 +296,7 @@ class InnetJS {
|
|
|
295
296
|
jsx__default["default"](),
|
|
296
297
|
],
|
|
297
298
|
};
|
|
298
|
-
this.withLint(options);
|
|
299
|
+
this.withLint(options, true);
|
|
299
300
|
const outputOptions = {
|
|
300
301
|
dir: this.buildFolder,
|
|
301
302
|
sourcemap: this.sourcemap,
|
|
@@ -438,7 +439,7 @@ class InnetJS {
|
|
|
438
439
|
else if (e.error.code === 'PLUGIN_ERROR' && ['rpt2', 'commonjs'].includes(e.error.plugin)) {
|
|
439
440
|
const [, file, line, column] = e.error.message
|
|
440
441
|
.replace(REG_CLEAR_TEXT, '')
|
|
441
|
-
.match(
|
|
442
|
+
.match(REG_RPT_ERROR_FILE) || [];
|
|
442
443
|
logger__default["default"].end('Bundling', e.error.message);
|
|
443
444
|
if (file) {
|
|
444
445
|
console.log(`ERROR in ${file}:${line}:${column}`);
|
|
@@ -566,7 +567,7 @@ class InnetJS {
|
|
|
566
567
|
],
|
|
567
568
|
};
|
|
568
569
|
this.withLint(options);
|
|
569
|
-
this.withEnv(options);
|
|
570
|
+
this.withEnv(options, true);
|
|
570
571
|
const bundle = yield rollup__default["default"].rollup(options);
|
|
571
572
|
yield bundle.write(options.output);
|
|
572
573
|
yield bundle.close();
|
|
@@ -643,13 +644,14 @@ class InnetJS {
|
|
|
643
644
|
}
|
|
644
645
|
});
|
|
645
646
|
}
|
|
646
|
-
withLint(options) {
|
|
647
|
+
withLint(options, prod = false) {
|
|
647
648
|
if (this._lintUsage === undefined) {
|
|
648
649
|
this._lintUsage = fs__default["default"].existsSync(path__default["default"].join(this.projectFolder, '.eslintrc'));
|
|
649
650
|
}
|
|
650
651
|
if (this._lintUsage) {
|
|
651
652
|
options.plugins.push(eslint__default["default"]({
|
|
652
653
|
include: lintInclude,
|
|
654
|
+
throwOnError: prod,
|
|
653
655
|
}));
|
|
654
656
|
}
|
|
655
657
|
}
|
|
@@ -768,7 +770,7 @@ class InnetJS {
|
|
|
768
770
|
}
|
|
769
771
|
|
|
770
772
|
(function () {
|
|
771
|
-
const env = {"__INNETJS__PACKAGE_VERSION":"2.3.
|
|
773
|
+
const env = {"__INNETJS__PACKAGE_VERSION":"2.3.3"};
|
|
772
774
|
if (typeof process === 'undefined') {
|
|
773
775
|
globalThis.process = { env: env };
|
|
774
776
|
} else if (process.env) {
|
package/index.d.ts
CHANGED
|
@@ -63,7 +63,7 @@ export declare class InnetJS {
|
|
|
63
63
|
run(file: any): Promise<void>;
|
|
64
64
|
release({ index, pub }?: ReleaseOptions): Promise<void>;
|
|
65
65
|
private _lintUsage;
|
|
66
|
-
withLint(options: rollup.RollupOptions): void;
|
|
66
|
+
withLint(options: rollup.RollupOptions, prod?: boolean): void;
|
|
67
67
|
withEnv(options: rollup.RollupOptions, virtual?: boolean): void;
|
|
68
68
|
increaseVersion(release: string): Promise<void>;
|
|
69
69
|
getPackage(): Promise<Record<string, any>>;
|
package/index.js
CHANGED
|
@@ -73,7 +73,7 @@ var typescript__default = /*#__PURE__*/_interopDefaultLegacy(typescript);
|
|
|
73
73
|
var tmp__default = /*#__PURE__*/_interopDefaultLegacy(tmp);
|
|
74
74
|
|
|
75
75
|
;(function () {
|
|
76
|
-
const env = {"__INNETJS__PACKAGE_VERSION":"2.3.
|
|
76
|
+
const env = {"__INNETJS__PACKAGE_VERSION":"2.3.3"};
|
|
77
77
|
if (typeof process === 'undefined') {
|
|
78
78
|
globalThis.process = { env: env };
|
|
79
79
|
} else if (process.env) {
|
|
@@ -90,6 +90,7 @@ const execAsync = node_util.promisify(exec);
|
|
|
90
90
|
const copyFiles = node_util.promisify(fs__default["default"].copy);
|
|
91
91
|
updateDotenv.updateDotenv();
|
|
92
92
|
const REG_CLEAR_TEXT = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;
|
|
93
|
+
const REG_RPT_ERROR_FILE = /(src[^:]+):(\d+):(\d+)/;
|
|
93
94
|
const REG_TJSX = /\.[tj]sx?$/;
|
|
94
95
|
const REG_EXT = /\.([^.]+)$/;
|
|
95
96
|
const scriptExtensions = ['ts', 'js', 'tsx', 'jsx'];
|
|
@@ -194,7 +195,7 @@ class InnetJS {
|
|
|
194
195
|
jsx__default["default"](),
|
|
195
196
|
],
|
|
196
197
|
};
|
|
197
|
-
this.withLint(options);
|
|
198
|
+
this.withLint(options, true);
|
|
198
199
|
const outputOptions = {
|
|
199
200
|
dir: this.buildFolder,
|
|
200
201
|
sourcemap: this.sourcemap,
|
|
@@ -337,7 +338,7 @@ class InnetJS {
|
|
|
337
338
|
else if (e.error.code === 'PLUGIN_ERROR' && ['rpt2', 'commonjs'].includes(e.error.plugin)) {
|
|
338
339
|
const [, file, line, column] = e.error.message
|
|
339
340
|
.replace(REG_CLEAR_TEXT, '')
|
|
340
|
-
.match(
|
|
341
|
+
.match(REG_RPT_ERROR_FILE) || [];
|
|
341
342
|
logger__default["default"].end('Bundling', e.error.message);
|
|
342
343
|
if (file) {
|
|
343
344
|
console.log(`ERROR in ${file}:${line}:${column}`);
|
|
@@ -465,7 +466,7 @@ class InnetJS {
|
|
|
465
466
|
],
|
|
466
467
|
};
|
|
467
468
|
this.withLint(options);
|
|
468
|
-
this.withEnv(options);
|
|
469
|
+
this.withEnv(options, true);
|
|
469
470
|
const bundle = yield rollup__default["default"].rollup(options);
|
|
470
471
|
yield bundle.write(options.output);
|
|
471
472
|
yield bundle.close();
|
|
@@ -542,13 +543,14 @@ class InnetJS {
|
|
|
542
543
|
}
|
|
543
544
|
});
|
|
544
545
|
}
|
|
545
|
-
withLint(options) {
|
|
546
|
+
withLint(options, prod = false) {
|
|
546
547
|
if (this._lintUsage === undefined) {
|
|
547
548
|
this._lintUsage = fs__default["default"].existsSync(path__default["default"].join(this.projectFolder, '.eslintrc'));
|
|
548
549
|
}
|
|
549
550
|
if (this._lintUsage) {
|
|
550
551
|
options.plugins.push(eslint__default["default"]({
|
|
551
552
|
include: constants.lintInclude,
|
|
553
|
+
throwOnError: prod,
|
|
552
554
|
}));
|
|
553
555
|
}
|
|
554
556
|
}
|
package/index.mjs
CHANGED
|
@@ -38,7 +38,7 @@ import { reporter, convertIndexFile, getFile } from './helpers.mjs';
|
|
|
38
38
|
import { updateDotenv } from './updateDotenv.mjs';
|
|
39
39
|
|
|
40
40
|
;(function () {
|
|
41
|
-
const env = {"__INNETJS__PACKAGE_VERSION":"2.3.
|
|
41
|
+
const env = {"__INNETJS__PACKAGE_VERSION":"2.3.3"};
|
|
42
42
|
if (typeof process === 'undefined') {
|
|
43
43
|
globalThis.process = { env: env };
|
|
44
44
|
} else if (process.env) {
|
|
@@ -55,6 +55,7 @@ const execAsync = promisify(exec);
|
|
|
55
55
|
const copyFiles = promisify(fs.copy);
|
|
56
56
|
updateDotenv();
|
|
57
57
|
const REG_CLEAR_TEXT = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0-9A-ORZcf-nqry=><]/g;
|
|
58
|
+
const REG_RPT_ERROR_FILE = /(src[^:]+):(\d+):(\d+)/;
|
|
58
59
|
const REG_TJSX = /\.[tj]sx?$/;
|
|
59
60
|
const REG_EXT = /\.([^.]+)$/;
|
|
60
61
|
const scriptExtensions = ['ts', 'js', 'tsx', 'jsx'];
|
|
@@ -159,7 +160,7 @@ class InnetJS {
|
|
|
159
160
|
jsx(),
|
|
160
161
|
],
|
|
161
162
|
};
|
|
162
|
-
this.withLint(options);
|
|
163
|
+
this.withLint(options, true);
|
|
163
164
|
const outputOptions = {
|
|
164
165
|
dir: this.buildFolder,
|
|
165
166
|
sourcemap: this.sourcemap,
|
|
@@ -302,7 +303,7 @@ class InnetJS {
|
|
|
302
303
|
else if (e.error.code === 'PLUGIN_ERROR' && ['rpt2', 'commonjs'].includes(e.error.plugin)) {
|
|
303
304
|
const [, file, line, column] = e.error.message
|
|
304
305
|
.replace(REG_CLEAR_TEXT, '')
|
|
305
|
-
.match(
|
|
306
|
+
.match(REG_RPT_ERROR_FILE) || [];
|
|
306
307
|
logger.end('Bundling', e.error.message);
|
|
307
308
|
if (file) {
|
|
308
309
|
console.log(`ERROR in ${file}:${line}:${column}`);
|
|
@@ -430,7 +431,7 @@ class InnetJS {
|
|
|
430
431
|
],
|
|
431
432
|
};
|
|
432
433
|
this.withLint(options);
|
|
433
|
-
this.withEnv(options);
|
|
434
|
+
this.withEnv(options, true);
|
|
434
435
|
const bundle = yield rollup.rollup(options);
|
|
435
436
|
yield bundle.write(options.output);
|
|
436
437
|
yield bundle.close();
|
|
@@ -507,13 +508,14 @@ class InnetJS {
|
|
|
507
508
|
}
|
|
508
509
|
});
|
|
509
510
|
}
|
|
510
|
-
withLint(options) {
|
|
511
|
+
withLint(options, prod = false) {
|
|
511
512
|
if (this._lintUsage === undefined) {
|
|
512
513
|
this._lintUsage = fs.existsSync(path.join(this.projectFolder, '.eslintrc'));
|
|
513
514
|
}
|
|
514
515
|
if (this._lintUsage) {
|
|
515
516
|
options.plugins.push(eslint({
|
|
516
517
|
include: lintInclude,
|
|
518
|
+
throwOnError: prod,
|
|
517
519
|
}));
|
|
518
520
|
}
|
|
519
521
|
}
|