@servicetitan/startup 26.0.0 → 26.0.2-canary.0

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.
Files changed (179) hide show
  1. package/dist/__mocks__/create-package.js +14 -5
  2. package/dist/__mocks__/index.js +31 -18
  3. package/dist/cli/commands/build.js +83 -34
  4. package/dist/cli/commands/bundle-package.js +91 -39
  5. package/dist/cli/commands/eslint.js +74 -31
  6. package/dist/cli/commands/get-command.js +16 -16
  7. package/dist/cli/commands/get-user-commands.js +9 -9
  8. package/dist/cli/commands/index.js +45 -32
  9. package/dist/cli/commands/init.js +93 -42
  10. package/dist/cli/commands/install.js +77 -32
  11. package/dist/cli/commands/kendo-ui-license.js +86 -39
  12. package/dist/cli/commands/mfe-publish.js +176 -79
  13. package/dist/cli/commands/prepare-package.js +84 -35
  14. package/dist/cli/commands/start.js +107 -58
  15. package/dist/cli/commands/styles-check.js +63 -35
  16. package/dist/cli/commands/tests.js +77 -32
  17. package/dist/cli/commands/types.d.ts +1 -1
  18. package/dist/cli/commands/types.js +3 -3
  19. package/dist/cli/index.js +23 -18
  20. package/dist/cli/utils/assets-copy.js +52 -23
  21. package/dist/cli/utils/bundle.js +130 -56
  22. package/dist/cli/utils/cli-git.js +4 -4
  23. package/dist/cli/utils/cli-npm.js +73 -27
  24. package/dist/cli/utils/cli-os.js +14 -15
  25. package/dist/cli/utils/compile-less.d.ts +1 -1
  26. package/dist/cli/utils/compile-less.js +42 -18
  27. package/dist/cli/utils/compile-sass.d.ts +1 -1
  28. package/dist/cli/utils/compile-sass.js +41 -17
  29. package/dist/cli/utils/eslint.js +70 -34
  30. package/dist/cli/utils/get-module-type.js +17 -11
  31. package/dist/cli/utils/index.js +42 -29
  32. package/dist/cli/utils/is-module-installed.d.ts +1 -1
  33. package/dist/cli/utils/is-module-installed.js +4 -5
  34. package/dist/cli/utils/lerna-exec.js +52 -20
  35. package/dist/cli/utils/maybe-create-git-folder.d.ts +1 -1
  36. package/dist/cli/utils/maybe-create-git-folder.js +9 -7
  37. package/dist/cli/utils/publish.d.ts +1 -1
  38. package/dist/cli/utils/publish.js +3 -3
  39. package/dist/cli/utils/set-node-options.js +28 -12
  40. package/dist/cli/utils/styles-copy.js +52 -23
  41. package/dist/cli/utils/tcm.js +60 -34
  42. package/dist/cli/utils/tsc.js +46 -18
  43. package/dist/index.d.ts +1 -0
  44. package/dist/index.d.ts.map +1 -1
  45. package/dist/index.js +1 -0
  46. package/dist/index.js.map +1 -1
  47. package/dist/jest/index.js +4 -4
  48. package/dist/utils/debug.d.ts +1 -1
  49. package/dist/utils/debug.js +9 -7
  50. package/dist/utils/find-packages.d.ts +1 -1
  51. package/dist/utils/find-packages.js +37 -20
  52. package/dist/utils/get-destination-folders.js +27 -22
  53. package/dist/utils/get-folders.js +15 -9
  54. package/dist/utils/get-jest-config.js +78 -36
  55. package/dist/utils/get-package-data.d.ts +5 -2
  56. package/dist/utils/get-package-data.js +14 -8
  57. package/dist/utils/get-package-name.d.ts +1 -1
  58. package/dist/utils/get-package-name.js +10 -8
  59. package/dist/utils/get-packages.js +37 -19
  60. package/dist/utils/get-startup-version.d.ts +1 -1
  61. package/dist/utils/get-startup-version.js +16 -9
  62. package/dist/utils/get-tsconfig.d.ts +1 -1
  63. package/dist/utils/get-tsconfig.js +13 -9
  64. package/dist/utils/index.js +44 -31
  65. package/dist/utils/load-shared-dependencies.d.ts +5 -2
  66. package/dist/utils/load-shared-dependencies.js +12 -6
  67. package/dist/utils/log.d.ts +5 -2
  68. package/dist/utils/log.js +13 -12
  69. package/dist/utils/read-json.d.ts +1 -1
  70. package/dist/utils/read-json.js +10 -9
  71. package/dist/utils/to-array.d.ts +1 -1
  72. package/dist/utils/to-array.js +3 -3
  73. package/dist/webpack/__mocks__/file-rules.d.ts +1 -1
  74. package/dist/webpack/__mocks__/file-rules.js +3 -3
  75. package/dist/webpack/__mocks__/index.d.ts +1 -1
  76. package/dist/webpack/__mocks__/index.js +32 -19
  77. package/dist/webpack/configs/amd-config.js +3 -3
  78. package/dist/webpack/configs/cache-config.js +5 -5
  79. package/dist/webpack/configs/dev-server-config.js +38 -20
  80. package/dist/webpack/configs/dev-server-config.js.map +1 -1
  81. package/dist/webpack/configs/devtool-config.js +4 -5
  82. package/dist/webpack/configs/entry.config.js +4 -4
  83. package/dist/webpack/configs/externals-config.js +9 -7
  84. package/dist/webpack/configs/index.js +43 -30
  85. package/dist/webpack/configs/loaders/css-loader.js +15 -9
  86. package/dist/webpack/configs/loaders/index.js +34 -21
  87. package/dist/webpack/configs/loaders/less-loader.d.ts +1 -1
  88. package/dist/webpack/configs/loaders/less-loader.js +3 -3
  89. package/dist/webpack/configs/loaders/style-loader.js +11 -8
  90. package/dist/webpack/configs/loaders/types.d.ts +1 -1
  91. package/dist/webpack/configs/loaders/types.js +3 -3
  92. package/dist/webpack/configs/module-config.js +4 -4
  93. package/dist/webpack/configs/optimization-config.js +3 -3
  94. package/dist/webpack/configs/output-config.js +20 -9
  95. package/dist/webpack/configs/plugins/assets-manifest-plugin.js +15 -10
  96. package/dist/webpack/configs/plugins/bundle-analyser-plugin.js +10 -8
  97. package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.js +21 -14
  98. package/dist/webpack/configs/plugins/define-web-component-name-plugin.js +4 -4
  99. package/dist/webpack/configs/plugins/filter-warnings-plugin.js +3 -3
  100. package/dist/webpack/configs/plugins/html-plugin.js +43 -22
  101. package/dist/webpack/configs/plugins/ignore-plugin/check-resource.d.ts +1 -1
  102. package/dist/webpack/configs/plugins/ignore-plugin/check-resource.js +5 -6
  103. package/dist/webpack/configs/plugins/ignore-plugin/ignore-plugin.js +5 -5
  104. package/dist/webpack/configs/plugins/ignore-plugin/index.js +31 -18
  105. package/dist/webpack/configs/plugins/ignore-plugin/is-optional-peer-dependency.d.ts +1 -1
  106. package/dist/webpack/configs/plugins/ignore-plugin/is-optional-peer-dependency.js +6 -4
  107. package/dist/webpack/configs/plugins/index.js +42 -29
  108. package/dist/webpack/configs/plugins/mini-css-extract-plugin.js +20 -11
  109. package/dist/webpack/configs/plugins/moment-locales-plugin.js +9 -7
  110. package/dist/webpack/configs/plugins/provide-react-plugin.js +4 -4
  111. package/dist/webpack/configs/plugins/ts-checker-plugin.js +31 -23
  112. package/dist/webpack/configs/plugins/virtual-modules-plugin.js +14 -10
  113. package/dist/webpack/configs/plugins-config.js +4 -4
  114. package/dist/webpack/configs/resolve-config.js +3 -3
  115. package/dist/webpack/configs/rules/css-rules.js +25 -16
  116. package/dist/webpack/configs/rules/font-rules.js +3 -3
  117. package/dist/webpack/configs/rules/image-rules.js +3 -3
  118. package/dist/webpack/configs/rules/index.js +38 -25
  119. package/dist/webpack/configs/rules/js-rules.js +3 -3
  120. package/dist/webpack/configs/rules/less-rules.js +9 -5
  121. package/dist/webpack/configs/rules/scss-rules.js +9 -5
  122. package/dist/webpack/configs/rules/svg-rules.js +3 -3
  123. package/dist/webpack/configs/rules/tsx-rules.js +3 -3
  124. package/dist/webpack/configs/rules-config.js +8 -6
  125. package/dist/webpack/configs/stats-config.js +3 -3
  126. package/dist/webpack/configs/types.js +3 -3
  127. package/dist/webpack/configs/utils/generate-metadata.js +21 -14
  128. package/dist/webpack/configs/utils/get-web-components-version.js +16 -9
  129. package/dist/webpack/configs/utils/index.js +31 -18
  130. package/dist/webpack/create-webpack-config.js +70 -30
  131. package/dist/webpack/index.js +32 -19
  132. package/dist/webpack/loaders/expose-loader/index.d.ts +1 -1
  133. package/dist/webpack/loaders/expose-loader/index.js +11 -5
  134. package/dist/webpack/loaders/expose-loader/runtime/get-global-this.d.ts +1 -1
  135. package/dist/webpack/loaders/expose-loader/runtime/get-global-this.js +3 -4
  136. package/dist/webpack/loaders/expose-loader/utils/contextify-request.d.ts +1 -1
  137. package/dist/webpack/loaders/expose-loader/utils/contextify-request.js +23 -21
  138. package/dist/webpack/loaders/expose-loader/utils/get-new-user-request.d.ts +1 -1
  139. package/dist/webpack/loaders/expose-loader/utils/get-new-user-request.js +18 -9
  140. package/dist/webpack/loaders/expose-loader/utils/index.d.ts +1 -1
  141. package/dist/webpack/loaders/expose-loader/utils/index.js +33 -20
  142. package/dist/webpack/loaders/expose-loader/utils/stringify-request.d.ts +1 -1
  143. package/dist/webpack/loaders/expose-loader/utils/stringify-request.js +23 -19
  144. package/dist/webpack/types.d.ts +1 -1
  145. package/dist/webpack/types.js +3 -3
  146. package/dist/webpack/utils/bundle.d.ts +1 -1
  147. package/dist/webpack/utils/bundle.js +3 -3
  148. package/dist/webpack/utils/feature-cohort.js +6 -6
  149. package/dist/webpack/utils/get-caller-filename.d.ts +1 -1
  150. package/dist/webpack/utils/get-caller-filename.js +4 -5
  151. package/dist/webpack/utils/hash-mod.d.ts +1 -1
  152. package/dist/webpack/utils/hash-mod.js +3 -3
  153. package/dist/webpack/utils/index.js +34 -21
  154. package/dist/webpack/utils/split-by-entry.d.ts +6 -2
  155. package/dist/webpack/utils/split-by-entry.js +4 -5
  156. package/dist/webpack/utils/testing/compile.d.ts +1 -1
  157. package/dist/webpack/utils/testing/compile.js +3 -3
  158. package/dist/webpack/utils/testing/execute.d.ts +11 -5
  159. package/dist/webpack/utils/testing/execute.js +17 -10
  160. package/dist/webpack/utils/testing/get-compiler.d.ts +4 -2
  161. package/dist/webpack/utils/testing/get-compiler.js +37 -30
  162. package/dist/webpack/utils/testing/get-errors.d.ts +1 -1
  163. package/dist/webpack/utils/testing/get-errors.js +4 -4
  164. package/dist/webpack/utils/testing/get-module-source.d.ts +1 -1
  165. package/dist/webpack/utils/testing/get-module-source.js +9 -4
  166. package/dist/webpack/utils/testing/get-warnings.d.ts +1 -1
  167. package/dist/webpack/utils/testing/get-warnings.js +4 -4
  168. package/dist/webpack/utils/testing/index.d.ts +16 -6
  169. package/dist/webpack/utils/testing/index.js +12 -12
  170. package/dist/webpack/utils/testing/normalize-errors.d.ts +1 -1
  171. package/dist/webpack/utils/testing/normalize-errors.js +3 -3
  172. package/dist/webpack/utils/testing/read-asset.d.ts +1 -1
  173. package/dist/webpack/utils/testing/read-asset.js +12 -10
  174. package/dist/webpack/utils/testing/read-assets.d.ts +1 -1
  175. package/dist/webpack/utils/testing/read-assets.js +4 -4
  176. package/package.json +7 -8
  177. package/src/index.ts +1 -0
  178. package/src/webpack/__tests__/create-webpack-config.test.ts +4 -0
  179. package/src/webpack/configs/dev-server-config.ts +6 -1
@@ -1,40 +1,80 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
12
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
13
- return new (P || (P = Promise))(function (resolve, reject) {
14
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
15
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
16
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
17
- step((generator = generator.apply(thisArg, _arguments || [])).next());
18
- });
19
- };
20
- var __importDefault = (this && this.__importDefault) || function (mod) {
21
- return (mod && mod.__esModule) ? mod : { "default": mod };
22
- };
23
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ 'use strict';
2
+ var __decorate =
3
+ (this && this.__decorate) ||
4
+ function (decorators, target, key, desc) {
5
+ var c = arguments.length,
6
+ r =
7
+ c < 3
8
+ ? target
9
+ : desc === null
10
+ ? (desc = Object.getOwnPropertyDescriptor(target, key))
11
+ : desc,
12
+ d;
13
+ if (typeof Reflect === 'object' && typeof Reflect.decorate === 'function')
14
+ r = Reflect.decorate(decorators, target, key, desc);
15
+ else
16
+ for (var i = decorators.length - 1; i >= 0; i--)
17
+ if ((d = decorators[i]))
18
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
19
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
20
+ };
21
+ var __metadata =
22
+ (this && this.__metadata) ||
23
+ function (k, v) {
24
+ if (typeof Reflect === 'object' && typeof Reflect.metadata === 'function')
25
+ return Reflect.metadata(k, v);
26
+ };
27
+ var __awaiter =
28
+ (this && this.__awaiter) ||
29
+ function (thisArg, _arguments, P, generator) {
30
+ function adopt(value) {
31
+ return value instanceof P
32
+ ? value
33
+ : new P(function (resolve) {
34
+ resolve(value);
35
+ });
36
+ }
37
+ return new (P || (P = Promise))(function (resolve, reject) {
38
+ function fulfilled(value) {
39
+ try {
40
+ step(generator.next(value));
41
+ } catch (e) {
42
+ reject(e);
43
+ }
44
+ }
45
+ function rejected(value) {
46
+ try {
47
+ step(generator['throw'](value));
48
+ } catch (e) {
49
+ reject(e);
50
+ }
51
+ }
52
+ function step(result) {
53
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
54
+ }
55
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
56
+ });
57
+ };
58
+ var __importDefault =
59
+ (this && this.__importDefault) ||
60
+ function (mod) {
61
+ return mod && mod.__esModule ? mod : { default: mod };
62
+ };
63
+ Object.defineProperty(exports, '__esModule', { value: true });
24
64
  exports.MFEPackageClean = exports.MFEPackagePublish = exports.MFEPublish = void 0;
25
- const path_1 = __importDefault(require("path"));
26
- const utils_1 = require("../../utils");
27
- const utils_2 = require("../utils");
28
- const cli_git_1 = require("../utils/cli-git");
29
- const cli_npm_1 = require("../utils/cli-npm");
30
- const publish_1 = require("../utils/publish");
65
+ const path_1 = __importDefault(require('path'));
66
+ const utils_1 = require('../../utils');
67
+ const utils_2 = require('../utils');
68
+ const cli_git_1 = require('../utils/cli-git');
69
+ const cli_npm_1 = require('../utils/cli-npm');
70
+ const publish_1 = require('../utils/publish');
31
71
  class MFEPublish {
32
72
  constructor(args) {
33
- Object.defineProperty(this, "args", {
73
+ Object.defineProperty(this, 'args', {
34
74
  enumerable: true,
35
75
  configurable: true,
36
76
  writable: true,
37
- value: args
77
+ value: args,
38
78
  });
39
79
  }
40
80
  description() {
@@ -43,16 +83,32 @@ class MFEPublish {
43
83
  execute() {
44
84
  return __awaiter(this, void 0, void 0, function* () {
45
85
  var _a, _b;
46
- let packages = (_a = (0, utils_1.splitPackagesByType)((0, utils_1.getPackages)())[utils_1.PackageType.Webpack]) !== null && _a !== void 0 ? _a : [];
86
+ let packages =
87
+ (_a = (0, utils_1.splitPackagesByType)((0, utils_1.getPackages)())[
88
+ utils_1.PackageType.Webpack
89
+ ]) !== null && _a !== void 0
90
+ ? _a
91
+ : [];
47
92
  packages = packages.filter(p => {
48
93
  var _a;
49
- const packageJson = (0, utils_1.readJson)(path_1.default.join(p.location, 'package.json'));
50
- return ((_a = packageJson === null || packageJson === void 0 ? void 0 : packageJson.cli) === null || _a === void 0 ? void 0 : _a['web-component']) === true;
94
+ const packageJson = (0, utils_1.readJson)(
95
+ path_1.default.join(p.location, 'package.json')
96
+ );
97
+ return (
98
+ ((_a =
99
+ packageJson === null || packageJson === void 0
100
+ ? void 0
101
+ : packageJson.cli) === null || _a === void 0
102
+ ? void 0
103
+ : _a['web-component']) === true
104
+ );
51
105
  });
52
106
  if (this.args.scope) {
53
- packages = packages.filter(p => Array.isArray(this.args.scope)
54
- ? this.args.scope.includes(p.name)
55
- : this.args.scope === p.name);
107
+ packages = packages.filter(p =>
108
+ Array.isArray(this.args.scope)
109
+ ? this.args.scope.includes(p.name)
110
+ : this.args.scope === p.name
111
+ );
56
112
  }
57
113
  if (!packages.length) {
58
114
  throw new Error('no packages found for publication');
@@ -81,19 +137,24 @@ class MFEPublish {
81
137
  }
82
138
  }
83
139
  exports.MFEPublish = MFEPublish;
84
- __decorate([
85
- utils_1.logErrors,
86
- __metadata("design:type", Function),
87
- __metadata("design:paramtypes", []),
88
- __metadata("design:returntype", Promise)
89
- ], MFEPublish.prototype, "execute", null);
140
+ __decorate(
141
+ [
142
+ utils_1.logErrors,
143
+ __metadata('design:type', Function),
144
+ __metadata('design:paramtypes', []),
145
+ __metadata('design:returntype', Promise),
146
+ ],
147
+ MFEPublish.prototype,
148
+ 'execute',
149
+ null
150
+ );
90
151
  class MFEPackagePublish {
91
152
  constructor(args) {
92
- Object.defineProperty(this, "args", {
153
+ Object.defineProperty(this, 'args', {
93
154
  enumerable: true,
94
155
  configurable: true,
95
156
  writable: true,
96
- value: args
157
+ value: args,
97
158
  });
98
159
  }
99
160
  description() {
@@ -116,15 +177,21 @@ class MFEPackagePublish {
116
177
  return;
117
178
  }
118
179
  if (!data.isBranchConfigured && !data.force) {
119
- utils_1.log.info('branch is not configured for publishing, use --force flag to publish if needed');
180
+ utils_1.log.info(
181
+ 'branch is not configured for publishing, use --force flag to publish if needed'
182
+ );
120
183
  return;
121
184
  }
122
185
  const versions = (0, cli_npm_1.npmGetPackageVersions)(data.registry, packageName);
123
186
  const dryRunPrefix = data.dry ? '(dry-run) ' : '';
124
187
  if (versions.includes(data.version)) {
125
- utils_1.log.info(`${dryRunPrefix}${packageName} version ${data.version} is already published, skipping publish`);
188
+ utils_1.log.info(
189
+ `${dryRunPrefix}${packageName} version ${data.version} is already published, skipping publish`
190
+ );
126
191
  if (data.tag) {
127
- utils_1.log.info(`${dryRunPrefix}adding tag "${data.tag}" to ${packageName} version ${data.version}`);
192
+ utils_1.log.info(
193
+ `${dryRunPrefix}adding tag "${data.tag}" to ${packageName} version ${data.version}`
194
+ );
128
195
  if (!data.dry) {
129
196
  yield (0, cli_npm_1.npmTagVersion)({
130
197
  packageName,
@@ -144,8 +211,7 @@ class MFEPackagePublish {
144
211
  }
145
212
  if (data.dry) {
146
213
  yield (0, cli_npm_1.npmPublishDry)();
147
- }
148
- else {
214
+ } else {
149
215
  yield (0, cli_npm_1.npmPublish)(data.tag);
150
216
  }
151
217
  utils_1.log.info(`${dryRunPrefix}published ${packageName} version ${data.version}`);
@@ -154,11 +220,15 @@ class MFEPackagePublish {
154
220
  getPublishData() {
155
221
  var _a, _b, _c;
156
222
  const cli = this.args;
157
- const branch = (_a = cli.branch) !== null && _a !== void 0 ? _a : (0, cli_git_1.gitGetBranch)();
223
+ const branch =
224
+ (_a = cli.branch) !== null && _a !== void 0 ? _a : (0, cli_git_1.gitGetBranch)();
158
225
  const branchConfig = getBranchConfigs()[branch];
159
226
  let buildVersion = cli.build;
160
227
  if (!buildVersion) {
161
- buildVersion = (0, publish_1.getDefaultBuildVersion)(branch, (0, cli_git_1.gitGetCommitHash)());
228
+ buildVersion = (0, publish_1.getDefaultBuildVersion)(
229
+ branch,
230
+ (0, cli_git_1.gitGetCommitHash)()
231
+ );
162
232
  }
163
233
  if (!buildVersion) {
164
234
  throw new Error('build version is not set');
@@ -166,14 +236,21 @@ class MFEPackagePublish {
166
236
  let tag;
167
237
  if (cli.tag === false) {
168
238
  tag = '';
169
- }
170
- else if (cli.tag) {
239
+ } else if (cli.tag) {
171
240
  tag = cli.tag;
241
+ } else {
242
+ tag =
243
+ (_b =
244
+ branchConfig === null || branchConfig === void 0
245
+ ? void 0
246
+ : branchConfig.tag) !== null && _b !== void 0
247
+ ? _b
248
+ : '';
172
249
  }
173
- else {
174
- tag = (_b = branchConfig === null || branchConfig === void 0 ? void 0 : branchConfig.tag) !== null && _b !== void 0 ? _b : '';
175
- }
176
- const registry = (_c = cli.registry) !== null && _c !== void 0 ? _c : 'https://verdaccio.servicetitan.com';
250
+ const registry =
251
+ (_c = cli.registry) !== null && _c !== void 0
252
+ ? _c
253
+ : 'https://verdaccio.servicetitan.com';
177
254
  return {
178
255
  tag,
179
256
  version: '0.0.0-' + buildVersion,
@@ -186,19 +263,24 @@ class MFEPackagePublish {
186
263
  }
187
264
  }
188
265
  exports.MFEPackagePublish = MFEPackagePublish;
189
- __decorate([
190
- utils_1.logErrors,
191
- __metadata("design:type", Function),
192
- __metadata("design:paramtypes", []),
193
- __metadata("design:returntype", Promise)
194
- ], MFEPackagePublish.prototype, "execute", null);
266
+ __decorate(
267
+ [
268
+ utils_1.logErrors,
269
+ __metadata('design:type', Function),
270
+ __metadata('design:paramtypes', []),
271
+ __metadata('design:returntype', Promise),
272
+ ],
273
+ MFEPackagePublish.prototype,
274
+ 'execute',
275
+ null
276
+ );
195
277
  class MFEPackageClean {
196
278
  constructor(args) {
197
- Object.defineProperty(this, "args", {
279
+ Object.defineProperty(this, 'args', {
198
280
  enumerable: true,
199
281
  configurable: true,
200
282
  writable: true,
201
- value: args
283
+ value: args,
202
284
  });
203
285
  }
204
286
  description() {
@@ -213,7 +295,10 @@ class MFEPackageClean {
213
295
  const packageJson = (0, utils_1.readJson)('package.json');
214
296
  const packageName = packageJson.name;
215
297
  const branchedVersions = this.getBranchedVersions(packageName, data.registry);
216
- utils_1.log.info(`branched versions (${data.count}):`, JSON.stringify(branchedVersions, undefined, 4));
298
+ utils_1.log.info(
299
+ `branched versions (${data.count}):`,
300
+ JSON.stringify(branchedVersions, undefined, 4)
301
+ );
217
302
  const branchedVersionsToClean = {};
218
303
  for (const branch of Object.keys(branchedVersions)) {
219
304
  // limit branches for now
@@ -223,14 +308,19 @@ class MFEPackageClean {
223
308
  branchedVersions[branch].sort(([, adt], [, bdt]) => (adt > bdt ? -1 : 1));
224
309
  branchedVersionsToClean[branch] = branchedVersions[branch].slice(data.count);
225
310
  }
226
- utils_1.log.info('found versions for unpublish:', JSON.stringify(branchedVersionsToClean, undefined, 4));
227
- const unVersions = Object.keys(branchedVersionsToClean).reduce((out, br) => [...out, ...branchedVersionsToClean[br].map(([v]) => v)], []);
311
+ utils_1.log.info(
312
+ 'found versions for unpublish:',
313
+ JSON.stringify(branchedVersionsToClean, undefined, 4)
314
+ );
315
+ const unVersions = Object.keys(branchedVersionsToClean).reduce(
316
+ (out, br) => [...out, ...branchedVersionsToClean[br].map(([v]) => v)],
317
+ []
318
+ );
228
319
  for (const version of unVersions) {
229
320
  try {
230
321
  // eslint-disable-next-line no-await-in-loop
231
322
  yield (0, cli_npm_1.npmUnpublish)(data.registry, packageName, version);
232
- }
233
- catch (_a) {
323
+ } catch (_a) {
234
324
  utils_1.log.error(`error while removing ${packageName} version ${version}`);
235
325
  }
236
326
  }
@@ -264,7 +354,9 @@ class MFEPackageClean {
264
354
  addVersion('master', version, dt);
265
355
  continue;
266
356
  }
267
- const match1 = buildVersion.match(/^(\d+)\.(\d+)\.(\d+)-([\dA-Za-z\-]+).([\dA-Za-z]+)$/);
357
+ const match1 = buildVersion.match(
358
+ /^(\d+)\.(\d+)\.(\d+)-([\dA-Za-z\-]+).([\dA-Za-z]+)$/
359
+ );
268
360
  if (match1 === null || match1 === void 0 ? void 0 : match1.length) {
269
361
  // branch version generated by nerdbank versioning
270
362
  addVersion(match1[4], version, dt);
@@ -285,12 +377,17 @@ class MFEPackageClean {
285
377
  }
286
378
  }
287
379
  exports.MFEPackageClean = MFEPackageClean;
288
- __decorate([
289
- utils_1.logErrors,
290
- __metadata("design:type", Function),
291
- __metadata("design:paramtypes", []),
292
- __metadata("design:returntype", Promise)
293
- ], MFEPackageClean.prototype, "execute", null);
380
+ __decorate(
381
+ [
382
+ utils_1.logErrors,
383
+ __metadata('design:type', Function),
384
+ __metadata('design:paramtypes', []),
385
+ __metadata('design:returntype', Promise),
386
+ ],
387
+ MFEPackageClean.prototype,
388
+ 'execute',
389
+ null
390
+ );
294
391
  const getBranchConfigs = () => {
295
392
  // ToDo: add ability to configure it in a package.json
296
393
  return {
@@ -300,4 +397,4 @@ const getBranchConfigs = () => {
300
397
  master: { tag: 'prod' },
301
398
  };
302
399
  };
303
- //# sourceMappingURL=mfe-publish.js.map
400
+ //# sourceMappingURL=mfe-publish.js.map
@@ -1,33 +1,71 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
12
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
13
- return new (P || (P = Promise))(function (resolve, reject) {
14
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
15
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
16
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
17
- step((generator = generator.apply(thisArg, _arguments || [])).next());
18
- });
19
- };
20
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ 'use strict';
2
+ var __decorate =
3
+ (this && this.__decorate) ||
4
+ function (decorators, target, key, desc) {
5
+ var c = arguments.length,
6
+ r =
7
+ c < 3
8
+ ? target
9
+ : desc === null
10
+ ? (desc = Object.getOwnPropertyDescriptor(target, key))
11
+ : desc,
12
+ d;
13
+ if (typeof Reflect === 'object' && typeof Reflect.decorate === 'function')
14
+ r = Reflect.decorate(decorators, target, key, desc);
15
+ else
16
+ for (var i = decorators.length - 1; i >= 0; i--)
17
+ if ((d = decorators[i]))
18
+ r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
19
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
20
+ };
21
+ var __metadata =
22
+ (this && this.__metadata) ||
23
+ function (k, v) {
24
+ if (typeof Reflect === 'object' && typeof Reflect.metadata === 'function')
25
+ return Reflect.metadata(k, v);
26
+ };
27
+ var __awaiter =
28
+ (this && this.__awaiter) ||
29
+ function (thisArg, _arguments, P, generator) {
30
+ function adopt(value) {
31
+ return value instanceof P
32
+ ? value
33
+ : new P(function (resolve) {
34
+ resolve(value);
35
+ });
36
+ }
37
+ return new (P || (P = Promise))(function (resolve, reject) {
38
+ function fulfilled(value) {
39
+ try {
40
+ step(generator.next(value));
41
+ } catch (e) {
42
+ reject(e);
43
+ }
44
+ }
45
+ function rejected(value) {
46
+ try {
47
+ step(generator['throw'](value));
48
+ } catch (e) {
49
+ reject(e);
50
+ }
51
+ }
52
+ function step(result) {
53
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
54
+ }
55
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
56
+ });
57
+ };
58
+ Object.defineProperty(exports, '__esModule', { value: true });
21
59
  exports.PreparePackage = void 0;
22
- const utils_1 = require("../../utils");
23
- const utils_2 = require("../utils");
60
+ const utils_1 = require('../../utils');
61
+ const utils_2 = require('../utils');
24
62
  class PreparePackage {
25
63
  constructor(args) {
26
- Object.defineProperty(this, "args", {
64
+ Object.defineProperty(this, 'args', {
27
65
  enumerable: true,
28
66
  configurable: true,
29
67
  writable: true,
30
- value: args
68
+ value: args,
31
69
  });
32
70
  }
33
71
  description() {
@@ -36,11 +74,17 @@ class PreparePackage {
36
74
  execute() {
37
75
  return __awaiter(this, void 0, void 0, function* () {
38
76
  if (!this.args.watch) {
39
- yield Promise.all([...(!(0, utils_1.isBundle)() ? [(0, utils_2.assetsCopy)(), (0, utils_2.stylesCopy)()] : []), (0, utils_2.tcm)()]);
40
- }
41
- else {
42
77
  yield Promise.all([
43
- ...(!(0, utils_1.isBundle)() ? [(0, utils_2.assetsCopyWatch)(), (0, utils_2.stylesCopyWatch)()] : []),
78
+ ...(!(0, utils_1.isBundle)()
79
+ ? [(0, utils_2.assetsCopy)(), (0, utils_2.stylesCopy)()]
80
+ : []),
81
+ (0, utils_2.tcm)(),
82
+ ]);
83
+ } else {
84
+ yield Promise.all([
85
+ ...(!(0, utils_1.isBundle)()
86
+ ? [(0, utils_2.assetsCopyWatch)(), (0, utils_2.stylesCopyWatch)()]
87
+ : []),
44
88
  (0, utils_2.tcmWatch)(),
45
89
  ]);
46
90
  }
@@ -48,10 +92,15 @@ class PreparePackage {
48
92
  }
49
93
  }
50
94
  exports.PreparePackage = PreparePackage;
51
- __decorate([
52
- utils_1.logErrors,
53
- __metadata("design:type", Function),
54
- __metadata("design:paramtypes", []),
55
- __metadata("design:returntype", Promise)
56
- ], PreparePackage.prototype, "execute", null);
57
- //# sourceMappingURL=prepare-package.js.map
95
+ __decorate(
96
+ [
97
+ utils_1.logErrors,
98
+ __metadata('design:type', Function),
99
+ __metadata('design:paramtypes', []),
100
+ __metadata('design:returntype', Promise),
101
+ ],
102
+ PreparePackage.prototype,
103
+ 'execute',
104
+ null
105
+ );
106
+ //# sourceMappingURL=prepare-package.js.map