innetjs 3.0.0 → 3.0.2-alpha.1

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.0"};
4
+ const env = {"__INNETJS__PACKAGE_VERSION":"3.0.2-alpha.1"};
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.0"};
2
+ const env = {"__INNETJS__PACKAGE_VERSION":"3.0.2-alpha.1"};
3
3
  if (typeof process === 'undefined') {
4
4
  globalThis.process = { env: env };
5
5
  } else if (process.env) {
package/bin/innet CHANGED
@@ -162,6 +162,11 @@ const REG_CLEAR_TEXT = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0
162
162
  const REG_RPT_ERROR_FILE = /(src[^:]+):(\d+):(\d+)/;
163
163
  const REG_TJSX = /\.[tj]sx?$/;
164
164
  const REG_EXT = /\.([^.]+)$/;
165
+ const NPM_TAG = /-(.+?)(?:\.|$)/;
166
+ function getNpmTag(version) {
167
+ const match = version.match(NPM_TAG);
168
+ return match ? match[1] : 'latest';
169
+ }
165
170
  const scriptExtensions = ['ts', 'js', 'tsx', 'jsx'];
166
171
  const indexExt = scriptExtensions.join(',');
167
172
  class InnetJS {
@@ -302,6 +307,9 @@ class InnetJS {
302
307
  include: imageInclude.map(img => `src/${img}`),
303
308
  publicPath: this.baseUrl,
304
309
  }), styles__default["default"]({
310
+ sass: {
311
+ outputStyle: 'compressed',
312
+ },
305
313
  mode: this.cssInJs ? 'inject' : 'extract',
306
314
  url: {
307
315
  inline: false,
@@ -426,6 +434,9 @@ class InnetJS {
426
434
  inline: false,
427
435
  publicPath: `${this.baseUrl}assets`,
428
436
  },
437
+ sass: {
438
+ silenceDeprecations: ['legacy-js-api'],
439
+ },
429
440
  plugins: [autoprefixer__default["default"]()],
430
441
  autoModules: this.cssModules ? (id) => !id.includes('.global.') : true,
431
442
  sourceMap: true,
@@ -514,7 +525,7 @@ class InnetJS {
514
525
  }));
515
526
  });
516
527
  }
517
- release({ index = 'index', pub } = {}) {
528
+ release({ index = 'index', pub, min } = {}) {
518
529
  return tslib.__awaiter(this, void 0, void 0, function* () {
519
530
  const { releaseFolder, cssModules } = this;
520
531
  yield logger__default["default"].start('Remove previous release', () => fs__default["default"].remove(releaseFolder));
@@ -583,6 +594,11 @@ class InnetJS {
583
594
  yield logger__default["default"].start('Build es6 bundle', () => tslib.__awaiter(this, void 0, void 0, function* () {
584
595
  yield build('es');
585
596
  }));
597
+ if (min) {
598
+ yield logger__default["default"].start('Build es6 bundle', () => tslib.__awaiter(this, void 0, void 0, function* () {
599
+ yield build('iife');
600
+ }));
601
+ }
586
602
  yield logger__default["default"].start('Copy package.json', () => tslib.__awaiter(this, void 0, void 0, function* () {
587
603
  const data = Object.assign({}, pkg);
588
604
  delete data.private;
@@ -641,7 +657,7 @@ class InnetJS {
641
657
  if (pub) {
642
658
  const date = (Date.now() / 1000) | 0;
643
659
  yield logger__default["default"].start(`publishing v${pkg.version} ${date}`, () => tslib.__awaiter(this, void 0, void 0, function* () {
644
- yield execAsync(`npm publish ${this.releaseFolder}`);
660
+ yield execAsync(`npm publish ${this.releaseFolder} --tag ${getNpmTag(pkg.version)}`);
645
661
  }));
646
662
  }
647
663
  });
@@ -785,7 +801,7 @@ class InnetJS {
785
801
  }
786
802
 
787
803
  (function () {
788
- const env = {"__INNETJS__PACKAGE_VERSION":"3.0.0"};
804
+ const env = {"__INNETJS__PACKAGE_VERSION":"3.0.2-alpha.1"};
789
805
  if (typeof process === 'undefined') {
790
806
  globalThis.process = { env: env };
791
807
  } else if (process.env) {
@@ -859,9 +875,10 @@ commander.program
859
875
  .description('Release new version of your library')
860
876
  .option('-i, --index <index>', 'Root index file name', 'index')
861
877
  .option('-p, --public', 'Public the package')
878
+ .option('-m, --min', 'Add minified version of your library')
862
879
  .addOption(errorOption)
863
- .action(({ error, index, public: pub }) => {
864
- innetJS.release({ index, pub }).catch(e => {
880
+ .action(({ error, index, public: pub, min }) => {
881
+ innetJS.release({ index, pub, min }).catch(e => {
865
882
  if (error) {
866
883
  console.error(e);
867
884
  process.exit(1);
package/index.d.ts CHANGED
@@ -4,6 +4,7 @@ export interface ReleaseOptions {
4
4
  node?: boolean;
5
5
  index?: string;
6
6
  pub?: boolean;
7
+ min?: boolean;
7
8
  }
8
9
  export declare const scriptExtensions: string[];
9
10
  export declare const indexExt: string;
@@ -68,7 +69,7 @@ export declare class InnetJS {
68
69
  index?: string;
69
70
  }): Promise<void>;
70
71
  run(file: any): Promise<void>;
71
- release({ index, pub }?: ReleaseOptions): Promise<void>;
72
+ release({ index, pub, min }?: ReleaseOptions): Promise<void>;
72
73
  private _lintUsage;
73
74
  withLint(options: rollup.RollupOptions, prod?: boolean): void;
74
75
  withEnv(options: rollup.RollupOptions, virtual?: boolean, preset?: EnvValues): void;
package/index.js CHANGED
@@ -90,6 +90,11 @@ const REG_CLEAR_TEXT = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0
90
90
  const REG_RPT_ERROR_FILE = /(src[^:]+):(\d+):(\d+)/;
91
91
  const REG_TJSX = /\.[tj]sx?$/;
92
92
  const REG_EXT = /\.([^.]+)$/;
93
+ const NPM_TAG = /-(.+?)(?:\.|$)/;
94
+ function getNpmTag(version) {
95
+ const match = version.match(NPM_TAG);
96
+ return match ? match[1] : 'latest';
97
+ }
93
98
  const scriptExtensions = ['ts', 'js', 'tsx', 'jsx'];
94
99
  const indexExt = scriptExtensions.join(',');
95
100
  class InnetJS {
@@ -230,6 +235,9 @@ class InnetJS {
230
235
  include: constants.imageInclude.map(img => `src/${img}`),
231
236
  publicPath: this.baseUrl,
232
237
  }), styles__default["default"]({
238
+ sass: {
239
+ outputStyle: 'compressed',
240
+ },
233
241
  mode: this.cssInJs ? 'inject' : 'extract',
234
242
  url: {
235
243
  inline: false,
@@ -354,6 +362,9 @@ class InnetJS {
354
362
  inline: false,
355
363
  publicPath: `${this.baseUrl}assets`,
356
364
  },
365
+ sass: {
366
+ silenceDeprecations: ['legacy-js-api'],
367
+ },
357
368
  plugins: [autoprefixer__default["default"]()],
358
369
  autoModules: this.cssModules ? (id) => !id.includes('.global.') : true,
359
370
  sourceMap: true,
@@ -442,7 +453,7 @@ class InnetJS {
442
453
  }));
443
454
  });
444
455
  }
445
- release({ index = 'index', pub } = {}) {
456
+ release({ index = 'index', pub, min } = {}) {
446
457
  return tslib.__awaiter(this, void 0, void 0, function* () {
447
458
  const { releaseFolder, cssModules } = this;
448
459
  yield logger__default["default"].start('Remove previous release', () => fs__default["default"].remove(releaseFolder));
@@ -511,6 +522,11 @@ class InnetJS {
511
522
  yield logger__default["default"].start('Build es6 bundle', () => tslib.__awaiter(this, void 0, void 0, function* () {
512
523
  yield build('es');
513
524
  }));
525
+ if (min) {
526
+ yield logger__default["default"].start('Build es6 bundle', () => tslib.__awaiter(this, void 0, void 0, function* () {
527
+ yield build('iife');
528
+ }));
529
+ }
514
530
  yield logger__default["default"].start('Copy package.json', () => tslib.__awaiter(this, void 0, void 0, function* () {
515
531
  const data = Object.assign({}, pkg);
516
532
  delete data.private;
@@ -569,7 +585,7 @@ class InnetJS {
569
585
  if (pub) {
570
586
  const date = (Date.now() / 1000) | 0;
571
587
  yield logger__default["default"].start(`publishing v${pkg.version} ${date}`, () => tslib.__awaiter(this, void 0, void 0, function* () {
572
- yield execAsync(`npm publish ${this.releaseFolder}`);
588
+ yield execAsync(`npm publish ${this.releaseFolder} --tag ${getNpmTag(pkg.version)}`);
573
589
  }));
574
590
  }
575
591
  });
package/index.mjs CHANGED
@@ -53,6 +53,11 @@ const REG_CLEAR_TEXT = /[\u001b\u009b][[()#;?]*(?:[0-9]{1,4}(?:;[0-9]{0,4})*)?[0
53
53
  const REG_RPT_ERROR_FILE = /(src[^:]+):(\d+):(\d+)/;
54
54
  const REG_TJSX = /\.[tj]sx?$/;
55
55
  const REG_EXT = /\.([^.]+)$/;
56
+ const NPM_TAG = /-(.+?)(?:\.|$)/;
57
+ function getNpmTag(version) {
58
+ const match = version.match(NPM_TAG);
59
+ return match ? match[1] : 'latest';
60
+ }
56
61
  const scriptExtensions = ['ts', 'js', 'tsx', 'jsx'];
57
62
  const indexExt = scriptExtensions.join(',');
58
63
  class InnetJS {
@@ -193,6 +198,9 @@ class InnetJS {
193
198
  include: imageInclude.map(img => `src/${img}`),
194
199
  publicPath: this.baseUrl,
195
200
  }), styles({
201
+ sass: {
202
+ outputStyle: 'compressed',
203
+ },
196
204
  mode: this.cssInJs ? 'inject' : 'extract',
197
205
  url: {
198
206
  inline: false,
@@ -317,6 +325,9 @@ class InnetJS {
317
325
  inline: false,
318
326
  publicPath: `${this.baseUrl}assets`,
319
327
  },
328
+ sass: {
329
+ silenceDeprecations: ['legacy-js-api'],
330
+ },
320
331
  plugins: [autoprefixer()],
321
332
  autoModules: this.cssModules ? (id) => !id.includes('.global.') : true,
322
333
  sourceMap: true,
@@ -405,7 +416,7 @@ class InnetJS {
405
416
  }));
406
417
  });
407
418
  }
408
- release({ index = 'index', pub } = {}) {
419
+ release({ index = 'index', pub, min } = {}) {
409
420
  return __awaiter(this, void 0, void 0, function* () {
410
421
  const { releaseFolder, cssModules } = this;
411
422
  yield logger.start('Remove previous release', () => fs.remove(releaseFolder));
@@ -474,6 +485,11 @@ class InnetJS {
474
485
  yield logger.start('Build es6 bundle', () => __awaiter(this, void 0, void 0, function* () {
475
486
  yield build('es');
476
487
  }));
488
+ if (min) {
489
+ yield logger.start('Build es6 bundle', () => __awaiter(this, void 0, void 0, function* () {
490
+ yield build('iife');
491
+ }));
492
+ }
477
493
  yield logger.start('Copy package.json', () => __awaiter(this, void 0, void 0, function* () {
478
494
  const data = Object.assign({}, pkg);
479
495
  delete data.private;
@@ -532,7 +548,7 @@ class InnetJS {
532
548
  if (pub) {
533
549
  const date = (Date.now() / 1000) | 0;
534
550
  yield logger.start(`publishing v${pkg.version} ${date}`, () => __awaiter(this, void 0, void 0, function* () {
535
- yield execAsync(`npm publish ${this.releaseFolder}`);
551
+ yield execAsync(`npm publish ${this.releaseFolder} --tag ${getNpmTag(pkg.version)}`);
536
552
  }));
537
553
  }
538
554
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "innetjs",
3
- "version": "3.0.0",
3
+ "version": "3.0.2-alpha.1",
4
4
  "description": "CLI for innet boilerplate",
5
5
  "homepage": "https://github.com/d8corp/innetjs",
6
6
  "author": "Mikhail Lysikov <d8corp@mail.ru>",
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "repository": {
30
30
  "type": "git",
31
- "url": "https://github.com/d8corp/innetjs.git"
31
+ "url": "git+https://github.com/d8corp/innetjs.git"
32
32
  },
33
33
  "keywords": [
34
34
  "watch",