innetjs 3.0.2-alpha.3 → 3.0.2-alpha.5

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.2-alpha.3"};
4
+ const env = {"__INNETJS__PACKAGE_VERSION":"3.0.2-alpha.5"};
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.2-alpha.3"};
2
+ const env = {"__INNETJS__PACKAGE_VERSION":"3.0.2-alpha.5"};
3
3
  if (typeof process === 'undefined') {
4
4
  globalThis.process = { env: env };
5
5
  } else if (process.env) {
package/bin/innet CHANGED
@@ -531,22 +531,27 @@ class InnetJS {
531
531
  yield logger__default["default"].start('Remove previous release', () => fs__default["default"].remove(releaseFolder));
532
532
  const pkg = yield this.getPackage();
533
533
  const build = (format) => tslib.__awaiter(this, void 0, void 0, function* () {
534
- var _a, _b, _c;
535
- const ext = format === 'iife'
536
- ? ((_a = (pkg.browser || pkg.unpkg || pkg.jsdelivr)) === null || _a === void 0 ? void 0 : _a.replace('index', '')) || '.min.js'
537
- : format === 'es'
538
- ? ((_b = (pkg.module || pkg.esnext || pkg['jsnext:main'])) === null || _b === void 0 ? void 0 : _b.replace('index', '')) || '.mjs'
539
- : ((_c = pkg.main) === null || _c === void 0 ? void 0 : _c.replace('index', '')) || '.js';
534
+ var _a, _b;
535
+ const ext = format === 'es'
536
+ ? ((_a = (pkg.module || pkg.esnext || pkg['jsnext:main'])) === null || _a === void 0 ? void 0 : _a.replace('index', '')) || '.mjs'
537
+ : ((_b = pkg.main) === null || _b === void 0 ? void 0 : _b.replace('index', '')) || '.js';
540
538
  const input = glob__default["default"].sync(`src/${index}.{${indexExt}}`);
541
539
  if (!input.length) {
542
540
  throw Error('index file is not detected');
543
541
  }
544
- const options = {
545
- input,
546
- external: ['tslib'],
547
- treeshake: false,
548
- output: {
542
+ const output = format === 'iife'
543
+ ? {
544
+ file: path__default["default"].join(releaseFolder, pkg.browser || 'index.min.js'),
545
+ inlineDynamicImports: true,
546
+ name: pkg.browserName || pkg.name
547
+ .split('-')
548
+ .map((part) => part.charAt(0).toUpperCase() + part.slice(1))
549
+ .join(''),
550
+ }
551
+ : {
549
552
  dir: releaseFolder,
553
+ preserveModules: true,
554
+ exports: 'named',
550
555
  entryFileNames: ({ name, facadeModuleId }) => {
551
556
  if (REG_TJSX.test(facadeModuleId)) {
552
557
  return `${name}${ext}`;
@@ -554,11 +559,12 @@ class InnetJS {
554
559
  const match = facadeModuleId.match(REG_EXT);
555
560
  return match ? `${name}${match[0]}${ext}` : `${name}${ext}`;
556
561
  },
557
- format,
558
- preserveModules: format !== 'iife',
559
- inlineDynamicImports: format === 'iife',
560
- exports: 'named',
561
- },
562
+ };
563
+ const options = {
564
+ input,
565
+ external: ['tslib'],
566
+ treeshake: false,
567
+ output: Object.assign(Object.assign({}, output), { format }),
562
568
  plugins: [
563
569
  json__default["default"](),
564
570
  ts__default["default"]({
@@ -598,7 +604,7 @@ class InnetJS {
598
604
  yield build('es');
599
605
  }));
600
606
  if (min) {
601
- yield logger__default["default"].start('Build es6 bundle', () => tslib.__awaiter(this, void 0, void 0, function* () {
607
+ yield logger__default["default"].start('Build min bundle', () => tslib.__awaiter(this, void 0, void 0, function* () {
602
608
  yield build('iife');
603
609
  }));
604
610
  }
@@ -804,7 +810,7 @@ class InnetJS {
804
810
  }
805
811
 
806
812
  (function () {
807
- const env = {"__INNETJS__PACKAGE_VERSION":"3.0.2-alpha.3"};
813
+ const env = {"__INNETJS__PACKAGE_VERSION":"3.0.2-alpha.5"};
808
814
  if (typeof process === 'undefined') {
809
815
  globalThis.process = { env: env };
810
816
  } else if (process.env) {
package/index.js CHANGED
@@ -459,22 +459,27 @@ class InnetJS {
459
459
  yield logger__default["default"].start('Remove previous release', () => fs__default["default"].remove(releaseFolder));
460
460
  const pkg = yield this.getPackage();
461
461
  const build = (format) => tslib.__awaiter(this, void 0, void 0, function* () {
462
- var _a, _b, _c;
463
- const ext = format === 'iife'
464
- ? ((_a = (pkg.browser || pkg.unpkg || pkg.jsdelivr)) === null || _a === void 0 ? void 0 : _a.replace('index', '')) || '.min.js'
465
- : format === 'es'
466
- ? ((_b = (pkg.module || pkg.esnext || pkg['jsnext:main'])) === null || _b === void 0 ? void 0 : _b.replace('index', '')) || '.mjs'
467
- : ((_c = pkg.main) === null || _c === void 0 ? void 0 : _c.replace('index', '')) || '.js';
462
+ var _a, _b;
463
+ const ext = format === 'es'
464
+ ? ((_a = (pkg.module || pkg.esnext || pkg['jsnext:main'])) === null || _a === void 0 ? void 0 : _a.replace('index', '')) || '.mjs'
465
+ : ((_b = pkg.main) === null || _b === void 0 ? void 0 : _b.replace('index', '')) || '.js';
468
466
  const input = glob__default["default"].sync(`src/${index}.{${indexExt}}`);
469
467
  if (!input.length) {
470
468
  throw Error('index file is not detected');
471
469
  }
472
- const options = {
473
- input,
474
- external: ['tslib'],
475
- treeshake: false,
476
- output: {
470
+ const output = format === 'iife'
471
+ ? {
472
+ file: path__default["default"].join(releaseFolder, pkg.browser || 'index.min.js'),
473
+ inlineDynamicImports: true,
474
+ name: pkg.browserName || pkg.name
475
+ .split('-')
476
+ .map((part) => part.charAt(0).toUpperCase() + part.slice(1))
477
+ .join(''),
478
+ }
479
+ : {
477
480
  dir: releaseFolder,
481
+ preserveModules: true,
482
+ exports: 'named',
478
483
  entryFileNames: ({ name, facadeModuleId }) => {
479
484
  if (REG_TJSX.test(facadeModuleId)) {
480
485
  return `${name}${ext}`;
@@ -482,11 +487,12 @@ class InnetJS {
482
487
  const match = facadeModuleId.match(REG_EXT);
483
488
  return match ? `${name}${match[0]}${ext}` : `${name}${ext}`;
484
489
  },
485
- format,
486
- preserveModules: format !== 'iife',
487
- inlineDynamicImports: format === 'iife',
488
- exports: 'named',
489
- },
490
+ };
491
+ const options = {
492
+ input,
493
+ external: ['tslib'],
494
+ treeshake: false,
495
+ output: Object.assign(Object.assign({}, output), { format }),
490
496
  plugins: [
491
497
  json__default["default"](),
492
498
  ts__default["default"]({
@@ -526,7 +532,7 @@ class InnetJS {
526
532
  yield build('es');
527
533
  }));
528
534
  if (min) {
529
- yield logger__default["default"].start('Build es6 bundle', () => tslib.__awaiter(this, void 0, void 0, function* () {
535
+ yield logger__default["default"].start('Build min bundle', () => tslib.__awaiter(this, void 0, void 0, function* () {
530
536
  yield build('iife');
531
537
  }));
532
538
  }
package/index.mjs CHANGED
@@ -422,22 +422,27 @@ class InnetJS {
422
422
  yield logger.start('Remove previous release', () => fs.remove(releaseFolder));
423
423
  const pkg = yield this.getPackage();
424
424
  const build = (format) => __awaiter(this, void 0, void 0, function* () {
425
- var _a, _b, _c;
426
- const ext = format === 'iife'
427
- ? ((_a = (pkg.browser || pkg.unpkg || pkg.jsdelivr)) === null || _a === void 0 ? void 0 : _a.replace('index', '')) || '.min.js'
428
- : format === 'es'
429
- ? ((_b = (pkg.module || pkg.esnext || pkg['jsnext:main'])) === null || _b === void 0 ? void 0 : _b.replace('index', '')) || '.mjs'
430
- : ((_c = pkg.main) === null || _c === void 0 ? void 0 : _c.replace('index', '')) || '.js';
425
+ var _a, _b;
426
+ const ext = format === 'es'
427
+ ? ((_a = (pkg.module || pkg.esnext || pkg['jsnext:main'])) === null || _a === void 0 ? void 0 : _a.replace('index', '')) || '.mjs'
428
+ : ((_b = pkg.main) === null || _b === void 0 ? void 0 : _b.replace('index', '')) || '.js';
431
429
  const input = glob.sync(`src/${index}.{${indexExt}}`);
432
430
  if (!input.length) {
433
431
  throw Error('index file is not detected');
434
432
  }
435
- const options = {
436
- input,
437
- external: ['tslib'],
438
- treeshake: false,
439
- output: {
433
+ const output = format === 'iife'
434
+ ? {
435
+ file: path.join(releaseFolder, pkg.browser || 'index.min.js'),
436
+ inlineDynamicImports: true,
437
+ name: pkg.browserName || pkg.name
438
+ .split('-')
439
+ .map((part) => part.charAt(0).toUpperCase() + part.slice(1))
440
+ .join(''),
441
+ }
442
+ : {
440
443
  dir: releaseFolder,
444
+ preserveModules: true,
445
+ exports: 'named',
441
446
  entryFileNames: ({ name, facadeModuleId }) => {
442
447
  if (REG_TJSX.test(facadeModuleId)) {
443
448
  return `${name}${ext}`;
@@ -445,11 +450,12 @@ class InnetJS {
445
450
  const match = facadeModuleId.match(REG_EXT);
446
451
  return match ? `${name}${match[0]}${ext}` : `${name}${ext}`;
447
452
  },
448
- format,
449
- preserveModules: format !== 'iife',
450
- inlineDynamicImports: format === 'iife',
451
- exports: 'named',
452
- },
453
+ };
454
+ const options = {
455
+ input,
456
+ external: ['tslib'],
457
+ treeshake: false,
458
+ output: Object.assign(Object.assign({}, output), { format }),
453
459
  plugins: [
454
460
  json(),
455
461
  ts({
@@ -489,7 +495,7 @@ class InnetJS {
489
495
  yield build('es');
490
496
  }));
491
497
  if (min) {
492
- yield logger.start('Build es6 bundle', () => __awaiter(this, void 0, void 0, function* () {
498
+ yield logger.start('Build min bundle', () => __awaiter(this, void 0, void 0, function* () {
493
499
  yield build('iife');
494
500
  }));
495
501
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "innetjs",
3
- "version": "3.0.2-alpha.3",
3
+ "version": "3.0.2-alpha.5",
4
4
  "description": "CLI for innet boilerplate",
5
5
  "homepage": "https://github.com/d8corp/innetjs",
6
6
  "author": "Mikhail Lysikov <d8corp@mail.ru>",
@@ -10,9 +10,6 @@
10
10
  "esnext": "index.mjs",
11
11
  "jsnext:main": "index.mjs",
12
12
  "types": "index.d.ts",
13
- "unpkg": "dist/index.min.js",
14
- "jsdelivr": "dist/index.min.js",
15
- "browser": "dist/index.min.js",
16
13
  "bin": {
17
14
  "innetjs": "bin/innet"
18
15
  },