innetjs 2.2.3 → 2.2.4

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_INNETJS_PACKAGE_VERSION":"2.2.2"};
4
+ const env = {"INNETJS_INNETJS_PACKAGE_VERSION":"2.2.3"};
5
5
  try {
6
6
  if (process) {
7
7
  process.env = Object.assign({}, process.env);
@@ -1,5 +1,5 @@
1
1
  (function() {
2
- const env = {"INNETJS_INNETJS_PACKAGE_VERSION":"2.2.2"};
2
+ const env = {"INNETJS_INNETJS_PACKAGE_VERSION":"2.2.3"};
3
3
  try {
4
4
  if (process) {
5
5
  process.env = Object.assign({}, process.env);
package/bin/innet CHANGED
@@ -68,7 +68,7 @@ var typescript__default = /*#__PURE__*/_interopDefaultLegacy(typescript);
68
68
  var tmp__default = /*#__PURE__*/_interopDefaultLegacy(tmp);
69
69
 
70
70
  (function() {
71
- const env = {"INNETJS_INNETJS_PACKAGE_VERSION":"2.2.2"};
71
+ const env = {"INNETJS_INNETJS_PACKAGE_VERSION":"2.2.3"};
72
72
  try {
73
73
  if (process) {
74
74
  process.env = Object.assign({}, process.env);
@@ -506,34 +506,11 @@ class InnetJS {
506
506
  }));
507
507
  });
508
508
  }
509
- release({ node = false, index = 'index', release, pub } = {}) {
509
+ release({ node = false, index = 'index', pub } = {}) {
510
510
  return tslib.__awaiter(this, void 0, void 0, function* () {
511
511
  const { releaseFolder, cssModules } = this;
512
512
  yield logger__default["default"].start('Remove previous release', () => fs__default["default"].remove(releaseFolder));
513
513
  const pkg = yield this.getPackage();
514
- yield logger__default["default"].start('Prepare package.json', () => tslib.__awaiter(this, void 0, void 0, function* () {
515
- const version = pkg.version.split('.');
516
- switch (release) {
517
- case 'patch': {
518
- version[2]++;
519
- break;
520
- }
521
- case 'minor': {
522
- version[1]++;
523
- version[2] = 0;
524
- break;
525
- }
526
- case 'major': {
527
- version[1] = 0;
528
- version[2] = 0;
529
- version[0]++;
530
- break;
531
- }
532
- default: return;
533
- }
534
- pkg.version = version.join('.');
535
- yield fs__default["default"].writeFile(path__default["default"].resolve(this.projectFolder, 'package.json'), JSON.stringify(pkg, undefined, 2), 'UTF-8');
536
- }));
537
514
  function build(format) {
538
515
  var _a, _b;
539
516
  return tslib.__awaiter(this, void 0, void 0, function* () {
@@ -673,6 +650,34 @@ class InnetJS {
673
650
  }
674
651
  });
675
652
  }
653
+ increaseVersion(release) {
654
+ return tslib.__awaiter(this, void 0, void 0, function* () {
655
+ const pkg = yield this.getPackage();
656
+ yield logger__default["default"].start('Prepare package.json', () => tslib.__awaiter(this, void 0, void 0, function* () {
657
+ const version = pkg.version.split('.');
658
+ switch (release) {
659
+ case 'patch': {
660
+ version[2]++;
661
+ break;
662
+ }
663
+ case 'minor': {
664
+ version[1]++;
665
+ version[2] = 0;
666
+ break;
667
+ }
668
+ case 'major': {
669
+ version[1] = 0;
670
+ version[2] = 0;
671
+ version[0]++;
672
+ break;
673
+ }
674
+ default: return;
675
+ }
676
+ pkg.version = version.join('.');
677
+ yield fs__default["default"].writeFile(path__default["default"].resolve(this.projectFolder, 'package.json'), JSON.stringify(pkg, undefined, 2), 'UTF-8');
678
+ }));
679
+ });
680
+ }
676
681
  getPackage() {
677
682
  return tslib.__awaiter(this, void 0, void 0, function* () {
678
683
  if (this.package) {
@@ -822,8 +827,44 @@ commander.program
822
827
  .option('-p, --public', 'Public the package')
823
828
  .addOption(releaseOption)
824
829
  .addOption(errorOption)
825
- .action(({ error, node, index, release, public: pub }) => {
826
- innetJS.release({ node, index, release, pub }).catch(e => {
830
+ .action(({ error, node, index, public: pub }) => {
831
+ innetJS.release({ node, index, pub }).catch(e => {
832
+ if (error) {
833
+ console.error(e);
834
+ process.exit(1);
835
+ }
836
+ });
837
+ });
838
+ commander.program
839
+ .command('patch')
840
+ .description('Increase patch version of package')
841
+ .addOption(errorOption)
842
+ .action(({ error }) => {
843
+ innetJS.increaseVersion('patch').catch(e => {
844
+ if (error) {
845
+ console.error(e);
846
+ process.exit(1);
847
+ }
848
+ });
849
+ });
850
+ commander.program
851
+ .command('minor')
852
+ .description('Increase minor version of package')
853
+ .addOption(errorOption)
854
+ .action(({ error }) => {
855
+ innetJS.increaseVersion('minor').catch(e => {
856
+ if (error) {
857
+ console.error(e);
858
+ process.exit(1);
859
+ }
860
+ });
861
+ });
862
+ commander.program
863
+ .command('major')
864
+ .description('Increase major version of package')
865
+ .addOption(errorOption)
866
+ .action(({ error }) => {
867
+ innetJS.increaseVersion('major').catch(e => {
827
868
  if (error) {
828
869
  console.error(e);
829
870
  process.exit(1);
package/index.d.ts CHANGED
@@ -2,7 +2,6 @@ import rollup from 'rollup';
2
2
  export interface ReleaseOptions {
3
3
  node?: boolean;
4
4
  index?: string;
5
- release?: string;
6
5
  pub?: boolean;
7
6
  }
8
7
  export declare const scriptExtensions: string[];
@@ -60,7 +59,8 @@ export declare class InnetJS {
60
59
  index?: string;
61
60
  }): Promise<void>;
62
61
  run(file: any): Promise<void>;
63
- release({ node, index, release, pub }?: ReleaseOptions): Promise<void>;
62
+ release({ node, index, pub }?: ReleaseOptions): Promise<void>;
63
+ increaseVersion(release: string): Promise<void>;
64
64
  getPackage(): Promise<Record<string, any>>;
65
65
  createClient(key: any, cert: any, pkg: any): rollup.Plugin;
66
66
  createServer(): rollup.Plugin;
package/index.js CHANGED
@@ -392,34 +392,11 @@ class InnetJS {
392
392
  }));
393
393
  });
394
394
  }
395
- release({ node = false, index = 'index', release, pub } = {}) {
395
+ release({ node = false, index = 'index', pub } = {}) {
396
396
  return tslib.__awaiter(this, void 0, void 0, function* () {
397
397
  const { releaseFolder, cssModules } = this;
398
398
  yield logger__default["default"].start('Remove previous release', () => fs__default["default"].remove(releaseFolder));
399
399
  const pkg = yield this.getPackage();
400
- yield logger__default["default"].start('Prepare package.json', () => tslib.__awaiter(this, void 0, void 0, function* () {
401
- const version = pkg.version.split('.');
402
- switch (release) {
403
- case 'patch': {
404
- version[2]++;
405
- break;
406
- }
407
- case 'minor': {
408
- version[1]++;
409
- version[2] = 0;
410
- break;
411
- }
412
- case 'major': {
413
- version[1] = 0;
414
- version[2] = 0;
415
- version[0]++;
416
- break;
417
- }
418
- default: return;
419
- }
420
- pkg.version = version.join('.');
421
- yield fs__default["default"].writeFile(path__default["default"].resolve(this.projectFolder, 'package.json'), JSON.stringify(pkg, undefined, 2), 'UTF-8');
422
- }));
423
400
  function build(format) {
424
401
  var _a, _b;
425
402
  return tslib.__awaiter(this, void 0, void 0, function* () {
@@ -559,6 +536,34 @@ class InnetJS {
559
536
  }
560
537
  });
561
538
  }
539
+ increaseVersion(release) {
540
+ return tslib.__awaiter(this, void 0, void 0, function* () {
541
+ const pkg = yield this.getPackage();
542
+ yield logger__default["default"].start('Prepare package.json', () => tslib.__awaiter(this, void 0, void 0, function* () {
543
+ const version = pkg.version.split('.');
544
+ switch (release) {
545
+ case 'patch': {
546
+ version[2]++;
547
+ break;
548
+ }
549
+ case 'minor': {
550
+ version[1]++;
551
+ version[2] = 0;
552
+ break;
553
+ }
554
+ case 'major': {
555
+ version[1] = 0;
556
+ version[2] = 0;
557
+ version[0]++;
558
+ break;
559
+ }
560
+ default: return;
561
+ }
562
+ pkg.version = version.join('.');
563
+ yield fs__default["default"].writeFile(path__default["default"].resolve(this.projectFolder, 'package.json'), JSON.stringify(pkg, undefined, 2), 'UTF-8');
564
+ }));
565
+ });
566
+ }
562
567
  getPackage() {
563
568
  return tslib.__awaiter(this, void 0, void 0, function* () {
564
569
  if (this.package) {
package/index.mjs CHANGED
@@ -358,34 +358,11 @@ class InnetJS {
358
358
  }));
359
359
  });
360
360
  }
361
- release({ node = false, index = 'index', release, pub } = {}) {
361
+ release({ node = false, index = 'index', pub } = {}) {
362
362
  return __awaiter(this, void 0, void 0, function* () {
363
363
  const { releaseFolder, cssModules } = this;
364
364
  yield logger.start('Remove previous release', () => fs.remove(releaseFolder));
365
365
  const pkg = yield this.getPackage();
366
- yield logger.start('Prepare package.json', () => __awaiter(this, void 0, void 0, function* () {
367
- const version = pkg.version.split('.');
368
- switch (release) {
369
- case 'patch': {
370
- version[2]++;
371
- break;
372
- }
373
- case 'minor': {
374
- version[1]++;
375
- version[2] = 0;
376
- break;
377
- }
378
- case 'major': {
379
- version[1] = 0;
380
- version[2] = 0;
381
- version[0]++;
382
- break;
383
- }
384
- default: return;
385
- }
386
- pkg.version = version.join('.');
387
- yield fs.writeFile(path.resolve(this.projectFolder, 'package.json'), JSON.stringify(pkg, undefined, 2), 'UTF-8');
388
- }));
389
366
  function build(format) {
390
367
  var _a, _b;
391
368
  return __awaiter(this, void 0, void 0, function* () {
@@ -525,6 +502,34 @@ class InnetJS {
525
502
  }
526
503
  });
527
504
  }
505
+ increaseVersion(release) {
506
+ return __awaiter(this, void 0, void 0, function* () {
507
+ const pkg = yield this.getPackage();
508
+ yield logger.start('Prepare package.json', () => __awaiter(this, void 0, void 0, function* () {
509
+ const version = pkg.version.split('.');
510
+ switch (release) {
511
+ case 'patch': {
512
+ version[2]++;
513
+ break;
514
+ }
515
+ case 'minor': {
516
+ version[1]++;
517
+ version[2] = 0;
518
+ break;
519
+ }
520
+ case 'major': {
521
+ version[1] = 0;
522
+ version[2] = 0;
523
+ version[0]++;
524
+ break;
525
+ }
526
+ default: return;
527
+ }
528
+ pkg.version = version.join('.');
529
+ yield fs.writeFile(path.resolve(this.projectFolder, 'package.json'), JSON.stringify(pkg, undefined, 2), 'UTF-8');
530
+ }));
531
+ });
532
+ }
528
533
  getPackage() {
529
534
  return __awaiter(this, void 0, void 0, function* () {
530
535
  if (this.package) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "innetjs",
3
- "version": "2.2.3",
3
+ "version": "2.2.4",
4
4
  "description": "CLI for innet boilerplate",
5
5
  "homepage": "https://github.com/d8corp/innetjs",
6
6
  "author": "Mikhail Lysikov <d8corp@mail.ru>",