innetjs 2.2.16 → 2.2.17

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 CHANGED
@@ -24,6 +24,7 @@ var linesAndColumns = require('lines-and-columns');
24
24
  var path$1 = require('node:path');
25
25
  var prompt = require('prompts');
26
26
  var rollup = require('rollup');
27
+ var external = require('rollup-plugin-external-node-modules');
27
28
  var filesize = require('rollup-plugin-filesize');
28
29
  var jsx = require('rollup-plugin-innet-jsx');
29
30
  var externals = require('rollup-plugin-node-externals');
@@ -58,6 +59,7 @@ var https__default = /*#__PURE__*/_interopDefaultLegacy(https);
58
59
  var path__default = /*#__PURE__*/_interopDefaultLegacy(path$1);
59
60
  var prompt__default = /*#__PURE__*/_interopDefaultLegacy(prompt);
60
61
  var rollup__default = /*#__PURE__*/_interopDefaultLegacy(rollup);
62
+ var external__default = /*#__PURE__*/_interopDefaultLegacy(external);
61
63
  var filesize__default = /*#__PURE__*/_interopDefaultLegacy(filesize);
62
64
  var jsx__default = /*#__PURE__*/_interopDefaultLegacy(jsx);
63
65
  var externals__default = /*#__PURE__*/_interopDefaultLegacy(externals);
@@ -497,7 +499,7 @@ class InnetJS {
497
499
  }));
498
500
  });
499
501
  }
500
- release({ node = false, index = 'index', pub } = {}) {
502
+ release({ index = 'index', pub } = {}) {
501
503
  return tslib.__awaiter(this, void 0, void 0, function* () {
502
504
  const { releaseFolder, cssModules } = this;
503
505
  yield logger__default["default"].start('Remove previous release', () => fs__default["default"].remove(releaseFolder));
@@ -513,59 +515,45 @@ class InnetJS {
513
515
  }
514
516
  const options = {
515
517
  input,
516
- external: [...Object.keys(pkg.dependencies), 'tslib'],
517
- preserveEntrySignatures: 'strict',
518
+ external: ['tslib'],
519
+ treeshake: false,
518
520
  output: {
519
521
  dir: releaseFolder,
520
522
  entryFileNames: `[name]${ext}`,
521
523
  format,
522
524
  preserveModules: true,
523
- exports: 'auto',
525
+ exports: 'named',
524
526
  },
525
527
  plugins: [
526
528
  json__default["default"](),
527
529
  typescript__default["default"]({
528
530
  clean: true,
529
- useTsconfigDeclarationDir: true,
530
531
  tsconfigOverride: {
531
532
  compilerOptions: {
532
- declarationDir: releaseFolder,
533
533
  sourceMap: false,
534
534
  },
535
535
  },
536
536
  }),
537
537
  jsx__default["default"](),
538
- ],
539
- };
540
- this.withLint(options);
541
- if (node) {
542
- options.plugins = [
543
- ...options.plugins,
538
+ external__default["default"](),
544
539
  externals__default["default"](),
545
- string({
546
- include: '**/*.*',
547
- exclude: stringExcludeNode,
548
- }),
549
- ];
550
- }
551
- else {
552
- options.plugins = [
553
- ...options.plugins,
554
540
  string({
555
541
  include: '**/*.*',
556
542
  exclude: stringExcludeDom,
557
543
  }),
558
- polyfill__default["default"](),
559
544
  image__default["default"](),
560
545
  styles__default["default"]({
561
- mode: 'inject',
562
- url: true,
546
+ mode: this.cssInJs ? 'inject' : 'extract',
563
547
  plugins: [autoprefixer__default["default"]()],
564
548
  modules: cssModules,
565
549
  minimize: true,
550
+ autoModules: true,
551
+ dts: true,
566
552
  }),
567
- ];
568
- }
553
+ pluginNodeResolve.nodeResolve(),
554
+ ],
555
+ };
556
+ this.withLint(options);
569
557
  this.withEnv(options);
570
558
  const bundle = yield rollup__default["default"].rollup(options);
571
559
  yield bundle.write(options.output);
@@ -765,7 +753,7 @@ class InnetJS {
765
753
  }
766
754
 
767
755
  (function () {
768
- const env = {"__INNETJS__PACKAGE_VERSION":"2.2.16"};
756
+ const env = {"__INNETJS__PACKAGE_VERSION":"2.2.17"};
769
757
  if (typeof process === 'undefined') {
770
758
  globalThis.process = { env: env };
771
759
  } else if (process.env) {
@@ -837,13 +825,12 @@ commander.program
837
825
  commander.program
838
826
  .command('release')
839
827
  .description('Release new version of your library')
840
- .option('-n, --node', 'Release for node.js')
841
828
  .option('-i, --index <index>', 'Root index file name', 'index')
842
829
  .option('-p, --public', 'Public the package')
843
830
  .addOption(releaseOption)
844
831
  .addOption(errorOption)
845
- .action(({ error, node, index, public: pub }) => {
846
- innetJS.release({ node, index, pub }).catch(e => {
832
+ .action(({ error, index, public: pub }) => {
833
+ innetJS.release({ index, pub }).catch(e => {
847
834
  if (error) {
848
835
  console.error(e);
849
836
  process.exit(1);
package/index.d.ts CHANGED
@@ -61,7 +61,7 @@ export declare class InnetJS {
61
61
  index?: string;
62
62
  }): Promise<void>;
63
63
  run(file: any): Promise<void>;
64
- release({ node, index, pub }?: ReleaseOptions): Promise<void>;
64
+ release({ index, pub }?: ReleaseOptions): Promise<void>;
65
65
  private _lintUsage;
66
66
  withLint(options: rollup.RollupOptions): void;
67
67
  withEnv(options: rollup.RollupOptions): void;
package/index.js CHANGED
@@ -24,6 +24,7 @@ var linesAndColumns = require('lines-and-columns');
24
24
  var path = require('node:path');
25
25
  var prompt = require('prompts');
26
26
  var rollup = require('rollup');
27
+ var external = require('rollup-plugin-external-node-modules');
27
28
  var filesize = require('rollup-plugin-filesize');
28
29
  var jsx = require('rollup-plugin-innet-jsx');
29
30
  var externals = require('rollup-plugin-node-externals');
@@ -61,6 +62,7 @@ var https__default = /*#__PURE__*/_interopDefaultLegacy(https);
61
62
  var path__default = /*#__PURE__*/_interopDefaultLegacy(path);
62
63
  var prompt__default = /*#__PURE__*/_interopDefaultLegacy(prompt);
63
64
  var rollup__default = /*#__PURE__*/_interopDefaultLegacy(rollup);
65
+ var external__default = /*#__PURE__*/_interopDefaultLegacy(external);
64
66
  var filesize__default = /*#__PURE__*/_interopDefaultLegacy(filesize);
65
67
  var jsx__default = /*#__PURE__*/_interopDefaultLegacy(jsx);
66
68
  var externals__default = /*#__PURE__*/_interopDefaultLegacy(externals);
@@ -71,7 +73,7 @@ var typescript__default = /*#__PURE__*/_interopDefaultLegacy(typescript);
71
73
  var tmp__default = /*#__PURE__*/_interopDefaultLegacy(tmp);
72
74
 
73
75
  (function () {
74
- const env = {"__INNETJS__PACKAGE_VERSION":"2.2.16"};
76
+ const env = {"__INNETJS__PACKAGE_VERSION":"2.2.17"};
75
77
  if (typeof process === 'undefined') {
76
78
  globalThis.process = { env: env };
77
79
  } else if (process.env) {
@@ -396,7 +398,7 @@ class InnetJS {
396
398
  }));
397
399
  });
398
400
  }
399
- release({ node = false, index = 'index', pub } = {}) {
401
+ release({ index = 'index', pub } = {}) {
400
402
  return tslib.__awaiter(this, void 0, void 0, function* () {
401
403
  const { releaseFolder, cssModules } = this;
402
404
  yield logger__default["default"].start('Remove previous release', () => fs__default["default"].remove(releaseFolder));
@@ -412,59 +414,45 @@ class InnetJS {
412
414
  }
413
415
  const options = {
414
416
  input,
415
- external: [...Object.keys(pkg.dependencies), 'tslib'],
416
- preserveEntrySignatures: 'strict',
417
+ external: ['tslib'],
418
+ treeshake: false,
417
419
  output: {
418
420
  dir: releaseFolder,
419
421
  entryFileNames: `[name]${ext}`,
420
422
  format,
421
423
  preserveModules: true,
422
- exports: 'auto',
424
+ exports: 'named',
423
425
  },
424
426
  plugins: [
425
427
  json__default["default"](),
426
428
  typescript__default["default"]({
427
429
  clean: true,
428
- useTsconfigDeclarationDir: true,
429
430
  tsconfigOverride: {
430
431
  compilerOptions: {
431
- declarationDir: releaseFolder,
432
432
  sourceMap: false,
433
433
  },
434
434
  },
435
435
  }),
436
436
  jsx__default["default"](),
437
- ],
438
- };
439
- this.withLint(options);
440
- if (node) {
441
- options.plugins = [
442
- ...options.plugins,
437
+ external__default["default"](),
443
438
  externals__default["default"](),
444
- string({
445
- include: '**/*.*',
446
- exclude: constants.stringExcludeNode,
447
- }),
448
- ];
449
- }
450
- else {
451
- options.plugins = [
452
- ...options.plugins,
453
439
  string({
454
440
  include: '**/*.*',
455
441
  exclude: constants.stringExcludeDom,
456
442
  }),
457
- polyfill__default["default"](),
458
443
  image__default["default"](),
459
444
  styles__default["default"]({
460
- mode: 'inject',
461
- url: true,
445
+ mode: this.cssInJs ? 'inject' : 'extract',
462
446
  plugins: [autoprefixer__default["default"]()],
463
447
  modules: cssModules,
464
448
  minimize: true,
449
+ autoModules: true,
450
+ dts: true,
465
451
  }),
466
- ];
467
- }
452
+ pluginNodeResolve.nodeResolve(),
453
+ ],
454
+ };
455
+ this.withLint(options);
468
456
  this.withEnv(options);
469
457
  const bundle = yield rollup__default["default"].rollup(options);
470
458
  yield bundle.write(options.output);
package/index.mjs CHANGED
@@ -20,6 +20,7 @@ import { LinesAndColumns } from 'lines-and-columns';
20
20
  import path from 'node:path';
21
21
  import prompt from 'prompts';
22
22
  import rollup from 'rollup';
23
+ import external from 'rollup-plugin-external-node-modules';
23
24
  import filesize from 'rollup-plugin-filesize';
24
25
  import jsx from 'rollup-plugin-innet-jsx';
25
26
  import externals from 'rollup-plugin-node-externals';
@@ -37,7 +38,7 @@ import { reporter, convertIndexFile, getFile } from './helpers.mjs';
37
38
  import { updateDotenv } from './updateDotenv.mjs';
38
39
 
39
40
  (function () {
40
- const env = {"__INNETJS__PACKAGE_VERSION":"2.2.16"};
41
+ const env = {"__INNETJS__PACKAGE_VERSION":"2.2.17"};
41
42
  if (typeof process === 'undefined') {
42
43
  globalThis.process = { env: env };
43
44
  } else if (process.env) {
@@ -362,7 +363,7 @@ class InnetJS {
362
363
  }));
363
364
  });
364
365
  }
365
- release({ node = false, index = 'index', pub } = {}) {
366
+ release({ index = 'index', pub } = {}) {
366
367
  return __awaiter(this, void 0, void 0, function* () {
367
368
  const { releaseFolder, cssModules } = this;
368
369
  yield logger.start('Remove previous release', () => fs.remove(releaseFolder));
@@ -378,59 +379,45 @@ class InnetJS {
378
379
  }
379
380
  const options = {
380
381
  input,
381
- external: [...Object.keys(pkg.dependencies), 'tslib'],
382
- preserveEntrySignatures: 'strict',
382
+ external: ['tslib'],
383
+ treeshake: false,
383
384
  output: {
384
385
  dir: releaseFolder,
385
386
  entryFileNames: `[name]${ext}`,
386
387
  format,
387
388
  preserveModules: true,
388
- exports: 'auto',
389
+ exports: 'named',
389
390
  },
390
391
  plugins: [
391
392
  json(),
392
393
  typescript({
393
394
  clean: true,
394
- useTsconfigDeclarationDir: true,
395
395
  tsconfigOverride: {
396
396
  compilerOptions: {
397
- declarationDir: releaseFolder,
398
397
  sourceMap: false,
399
398
  },
400
399
  },
401
400
  }),
402
401
  jsx(),
403
- ],
404
- };
405
- this.withLint(options);
406
- if (node) {
407
- options.plugins = [
408
- ...options.plugins,
402
+ external(),
409
403
  externals(),
410
- string({
411
- include: '**/*.*',
412
- exclude: stringExcludeNode,
413
- }),
414
- ];
415
- }
416
- else {
417
- options.plugins = [
418
- ...options.plugins,
419
404
  string({
420
405
  include: '**/*.*',
421
406
  exclude: stringExcludeDom,
422
407
  }),
423
- polyfill(),
424
408
  image(),
425
409
  styles({
426
- mode: 'inject',
427
- url: true,
410
+ mode: this.cssInJs ? 'inject' : 'extract',
428
411
  plugins: [autoprefixer()],
429
412
  modules: cssModules,
430
413
  minimize: true,
414
+ autoModules: true,
415
+ dts: true,
431
416
  }),
432
- ];
433
- }
417
+ nodeResolve(),
418
+ ],
419
+ };
420
+ this.withLint(options);
434
421
  this.withEnv(options);
435
422
  const bundle = yield rollup.rollup(options);
436
423
  yield bundle.write(options.output);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "innetjs",
3
- "version": "2.2.16",
3
+ "version": "2.2.17",
4
4
  "description": "CLI for innet boilerplate",
5
5
  "homepage": "https://github.com/d8corp/innetjs",
6
6
  "author": "Mikhail Lysikov <d8corp@mail.ru>",
@@ -71,17 +71,18 @@
71
71
  "postcss": "^8.4.18",
72
72
  "prompts": "^2.4.2",
73
73
  "rollup": "^2.79.1",
74
+ "rollup-plugin-external-node-modules": "^1.0.0",
74
75
  "rollup-plugin-filesize": "^9.1.2",
75
- "rollup-plugin-process-env": "^1.0.4",
76
76
  "rollup-plugin-innet-jsx": "^1.3.2",
77
77
  "rollup-plugin-livereload": "^2.0.5",
78
78
  "rollup-plugin-node-externals": "^5.0.2",
79
79
  "rollup-plugin-polyfill-node": "^0.11.0",
80
80
  "rollup-plugin-preserve-shebangs": "^0.2.0",
81
+ "rollup-plugin-process-env": "^1.0.4",
81
82
  "rollup-plugin-string": "^3.0.0",
82
83
  "rollup-plugin-styles": "^4.0.0",
83
84
  "rollup-plugin-terser": "^7.0.2",
84
- "rollup-plugin-typescript2": "^0.33.0",
85
+ "rollup-plugin-typescript2": "^0.34.1",
85
86
  "sass": "^1.55.0",
86
87
  "tmp": "^0.2.1",
87
88
  "typescript": "^4.8.4",