innetjs 3.2.1 → 3.2.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/_virtual/_rollup-plugin-process-env.js +1 -1
- package/_virtual/_rollup-plugin-process-env.mjs +1 -1
- package/bin/innet +14 -10
- package/index.js +13 -9
- package/index.mjs +13 -9
- package/package.json +1 -1
package/bin/innet
CHANGED
|
@@ -675,12 +675,16 @@ class InnetJS {
|
|
|
675
675
|
yield bundle.write(options.output);
|
|
676
676
|
yield bundle.close();
|
|
677
677
|
});
|
|
678
|
-
|
|
679
|
-
yield
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
678
|
+
if (!pkg.type || pkg.type === 'commonjs') {
|
|
679
|
+
yield logger__default["default"].start('Build cjs bundle', () => tslib.__awaiter(this, void 0, void 0, function* () {
|
|
680
|
+
yield build('cjs');
|
|
681
|
+
}));
|
|
682
|
+
}
|
|
683
|
+
if (!pkg.type || pkg.type === 'module') {
|
|
684
|
+
yield logger__default["default"].start('Build es6 bundle', () => tslib.__awaiter(this, void 0, void 0, function* () {
|
|
685
|
+
yield build('es');
|
|
686
|
+
}));
|
|
687
|
+
}
|
|
684
688
|
if (min) {
|
|
685
689
|
yield logger__default["default"].start('Build min bundle', () => tslib.__awaiter(this, void 0, void 0, function* () {
|
|
686
690
|
yield build('iife');
|
|
@@ -690,11 +694,11 @@ class InnetJS {
|
|
|
690
694
|
const data = Object.assign({}, pkg);
|
|
691
695
|
delete data.private;
|
|
692
696
|
delete data.devDependencies;
|
|
693
|
-
|
|
697
|
+
fs__default["default"].writeFile(path__default["default"].resolve(this.releaseFolder, 'package.json'), JSON.stringify(data, undefined, 2), 'UTF-8');
|
|
694
698
|
}));
|
|
695
699
|
if (pkg.bin) {
|
|
696
700
|
yield logger__default["default"].start('Build bin', () => tslib.__awaiter(this, void 0, void 0, function* () {
|
|
697
|
-
const { bin } = pkg;
|
|
701
|
+
const { bin, type } = pkg;
|
|
698
702
|
for (const name in bin) {
|
|
699
703
|
const value = bin[name];
|
|
700
704
|
const input = glob__default["default"].sync(`src/${value}.{${indexExt}}`);
|
|
@@ -704,7 +708,7 @@ class InnetJS {
|
|
|
704
708
|
external: [...Object.keys(pkg.dependencies), 'tslib'],
|
|
705
709
|
output: {
|
|
706
710
|
file,
|
|
707
|
-
format: 'cjs',
|
|
711
|
+
format: type === 'module' ? 'es' : 'cjs',
|
|
708
712
|
},
|
|
709
713
|
plugins: [
|
|
710
714
|
rollupPluginPreserveShebangs.preserveShebangs(),
|
|
@@ -905,7 +909,7 @@ class InnetJS {
|
|
|
905
909
|
}
|
|
906
910
|
|
|
907
911
|
(function () {
|
|
908
|
-
const env = {"__INNETJS__PACKAGE_VERSION":"3.2.
|
|
912
|
+
const env = {"__INNETJS__PACKAGE_VERSION":"3.2.3"};
|
|
909
913
|
if (typeof process === 'undefined') {
|
|
910
914
|
globalThis.process = { env: env };
|
|
911
915
|
} else if (process.env) {
|
package/index.js
CHANGED
|
@@ -603,12 +603,16 @@ class InnetJS {
|
|
|
603
603
|
yield bundle.write(options.output);
|
|
604
604
|
yield bundle.close();
|
|
605
605
|
});
|
|
606
|
-
|
|
607
|
-
yield
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
606
|
+
if (!pkg.type || pkg.type === 'commonjs') {
|
|
607
|
+
yield logger__default["default"].start('Build cjs bundle', () => tslib.__awaiter(this, void 0, void 0, function* () {
|
|
608
|
+
yield build('cjs');
|
|
609
|
+
}));
|
|
610
|
+
}
|
|
611
|
+
if (!pkg.type || pkg.type === 'module') {
|
|
612
|
+
yield logger__default["default"].start('Build es6 bundle', () => tslib.__awaiter(this, void 0, void 0, function* () {
|
|
613
|
+
yield build('es');
|
|
614
|
+
}));
|
|
615
|
+
}
|
|
612
616
|
if (min) {
|
|
613
617
|
yield logger__default["default"].start('Build min bundle', () => tslib.__awaiter(this, void 0, void 0, function* () {
|
|
614
618
|
yield build('iife');
|
|
@@ -618,11 +622,11 @@ class InnetJS {
|
|
|
618
622
|
const data = Object.assign({}, pkg);
|
|
619
623
|
delete data.private;
|
|
620
624
|
delete data.devDependencies;
|
|
621
|
-
|
|
625
|
+
fs__default["default"].writeFile(path__default["default"].resolve(this.releaseFolder, 'package.json'), JSON.stringify(data, undefined, 2), 'UTF-8');
|
|
622
626
|
}));
|
|
623
627
|
if (pkg.bin) {
|
|
624
628
|
yield logger__default["default"].start('Build bin', () => tslib.__awaiter(this, void 0, void 0, function* () {
|
|
625
|
-
const { bin } = pkg;
|
|
629
|
+
const { bin, type } = pkg;
|
|
626
630
|
for (const name in bin) {
|
|
627
631
|
const value = bin[name];
|
|
628
632
|
const input = glob__default["default"].sync(`src/${value}.{${indexExt}}`);
|
|
@@ -632,7 +636,7 @@ class InnetJS {
|
|
|
632
636
|
external: [...Object.keys(pkg.dependencies), 'tslib'],
|
|
633
637
|
output: {
|
|
634
638
|
file,
|
|
635
|
-
format: 'cjs',
|
|
639
|
+
format: type === 'module' ? 'es' : 'cjs',
|
|
636
640
|
},
|
|
637
641
|
plugins: [
|
|
638
642
|
rollupPluginPreserveShebangs.preserveShebangs(),
|
package/index.mjs
CHANGED
|
@@ -566,12 +566,16 @@ class InnetJS {
|
|
|
566
566
|
yield bundle.write(options.output);
|
|
567
567
|
yield bundle.close();
|
|
568
568
|
});
|
|
569
|
-
|
|
570
|
-
yield
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
569
|
+
if (!pkg.type || pkg.type === 'commonjs') {
|
|
570
|
+
yield logger.start('Build cjs bundle', () => __awaiter(this, void 0, void 0, function* () {
|
|
571
|
+
yield build('cjs');
|
|
572
|
+
}));
|
|
573
|
+
}
|
|
574
|
+
if (!pkg.type || pkg.type === 'module') {
|
|
575
|
+
yield logger.start('Build es6 bundle', () => __awaiter(this, void 0, void 0, function* () {
|
|
576
|
+
yield build('es');
|
|
577
|
+
}));
|
|
578
|
+
}
|
|
575
579
|
if (min) {
|
|
576
580
|
yield logger.start('Build min bundle', () => __awaiter(this, void 0, void 0, function* () {
|
|
577
581
|
yield build('iife');
|
|
@@ -581,11 +585,11 @@ class InnetJS {
|
|
|
581
585
|
const data = Object.assign({}, pkg);
|
|
582
586
|
delete data.private;
|
|
583
587
|
delete data.devDependencies;
|
|
584
|
-
|
|
588
|
+
fs.writeFile(path.resolve(this.releaseFolder, 'package.json'), JSON.stringify(data, undefined, 2), 'UTF-8');
|
|
585
589
|
}));
|
|
586
590
|
if (pkg.bin) {
|
|
587
591
|
yield logger.start('Build bin', () => __awaiter(this, void 0, void 0, function* () {
|
|
588
|
-
const { bin } = pkg;
|
|
592
|
+
const { bin, type } = pkg;
|
|
589
593
|
for (const name in bin) {
|
|
590
594
|
const value = bin[name];
|
|
591
595
|
const input = glob.sync(`src/${value}.{${indexExt}}`);
|
|
@@ -595,7 +599,7 @@ class InnetJS {
|
|
|
595
599
|
external: [...Object.keys(pkg.dependencies), 'tslib'],
|
|
596
600
|
output: {
|
|
597
601
|
file,
|
|
598
|
-
format: 'cjs',
|
|
602
|
+
format: type === 'module' ? 'es' : 'cjs',
|
|
599
603
|
},
|
|
600
604
|
plugins: [
|
|
601
605
|
preserveShebangs(),
|