@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,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.Start = 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 Start {
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() {
@@ -35,7 +73,9 @@ class Start {
35
73
  }
36
74
  execute() {
37
75
  return __awaiter(this, void 0, void 0, function* () {
38
- const packages = (0, utils_1.splitPackagesByType)((0, utils_1.getPackages)({ scope: this.args.scope, ignore: this.args.ignore }));
76
+ const packages = (0, utils_1.splitPackagesByType)(
77
+ (0, utils_1.getPackages)({ scope: this.args.scope, ignore: this.args.ignore })
78
+ );
39
79
  const packagesWithPreparation = [
40
80
  ...packages[utils_1.PackageType.TSC],
41
81
  ...packages[utils_1.PackageType.Webpack],
@@ -53,45 +93,54 @@ class Start {
53
93
  yield Promise.all([
54
94
  ...(packagesWithPreparation.length
55
95
  ? [
56
- (0, utils_2.lernaExec)({
57
- 'cmd': 'startup prepare-package',
58
- 'scope': packagesWithPreparation.map(({ name }) => name),
59
- 'parallel': true,
60
- 'stream': true,
61
- '--': ['--watch'],
62
- }),
63
- ]
96
+ (0, utils_2.lernaExec)({
97
+ 'cmd': 'startup prepare-package',
98
+ 'scope': packagesWithPreparation.map(({ name }) => name),
99
+ 'parallel': true,
100
+ 'stream': true,
101
+ '--': ['--watch'],
102
+ }),
103
+ ]
104
+ : []),
105
+ ...(packages[utils_1.PackageType.TSC].length
106
+ ? [(0, utils_2.tscWatch)(packages[utils_1.PackageType.TSC])]
64
107
  : []),
65
- ...(packages[utils_1.PackageType.TSC].length ? [(0, utils_2.tscWatch)(packages[utils_1.PackageType.TSC])] : []),
66
108
  ...(packages[utils_1.PackageType.Webpack].length
67
109
  ? [
68
- (0, utils_2.lernaExec)({
69
- 'cmd': 'startup bundle-package',
70
- 'scope': packages[utils_1.PackageType.Webpack].map(({ name }) => name),
71
- 'parallel': true,
72
- 'stream': true,
73
- '--': [
74
- '--color',
75
- '--watch',
76
- this.args.config ? `--config "${this.args.config}"` : undefined,
77
- this.args['code-coverage'] ? '--code-coverage' : undefined,
78
- this.args.esbuild ? '--esbuild' : undefined,
79
- this.args['experimental-bundlers']
80
- ? '--experimental-bundlers'
81
- : undefined,
82
- ].filter(item => !!item),
83
- }),
84
- ]
110
+ (0, utils_2.lernaExec)({
111
+ 'cmd': 'startup bundle-package',
112
+ 'scope': packages[utils_1.PackageType.Webpack].map(
113
+ ({ name }) => name
114
+ ),
115
+ 'parallel': true,
116
+ 'stream': true,
117
+ '--': [
118
+ '--color',
119
+ '--watch',
120
+ this.args.config ? `--config "${this.args.config}"` : undefined,
121
+ this.args['code-coverage'] ? '--code-coverage' : undefined,
122
+ this.args.esbuild ? '--esbuild' : undefined,
123
+ this.args['experimental-bundlers']
124
+ ? '--experimental-bundlers'
125
+ : undefined,
126
+ ].filter(item => !!item),
127
+ }),
128
+ ]
85
129
  : []),
86
130
  ]);
87
131
  });
88
132
  }
89
133
  }
90
134
  exports.Start = Start;
91
- __decorate([
92
- utils_1.logErrors,
93
- __metadata("design:type", Function),
94
- __metadata("design:paramtypes", []),
95
- __metadata("design:returntype", Promise)
96
- ], Start.prototype, "execute", null);
97
- //# sourceMappingURL=start.js.map
135
+ __decorate(
136
+ [
137
+ utils_1.logErrors,
138
+ __metadata('design:type', Function),
139
+ __metadata('design:paramtypes', []),
140
+ __metadata('design:returntype', Promise),
141
+ ],
142
+ Start.prototype,
143
+ 'execute',
144
+ null
145
+ );
146
+ //# sourceMappingURL=start.js.map
@@ -1,22 +1,46 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ 'use strict';
2
+ var __awaiter =
3
+ (this && this.__awaiter) ||
4
+ function (thisArg, _arguments, P, generator) {
5
+ function adopt(value) {
6
+ return value instanceof P
7
+ ? value
8
+ : new P(function (resolve) {
9
+ resolve(value);
10
+ });
11
+ }
12
+ return new (P || (P = Promise))(function (resolve, reject) {
13
+ function fulfilled(value) {
14
+ try {
15
+ step(generator.next(value));
16
+ } catch (e) {
17
+ reject(e);
18
+ }
19
+ }
20
+ function rejected(value) {
21
+ try {
22
+ step(generator['throw'](value));
23
+ } catch (e) {
24
+ reject(e);
25
+ }
26
+ }
27
+ function step(result) {
28
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
29
+ }
30
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
31
+ });
32
+ };
33
+ var __importDefault =
34
+ (this && this.__importDefault) ||
35
+ function (mod) {
36
+ return mod && mod.__esModule ? mod : { default: mod };
37
+ };
38
+ Object.defineProperty(exports, '__esModule', { value: true });
15
39
  exports.StylesCheck = void 0;
16
- const fs_1 = __importDefault(require("fs"));
17
- const path_1 = __importDefault(require("path"));
18
- const process_1 = __importDefault(require("process"));
19
- const utils_1 = require("../../utils");
40
+ const fs_1 = __importDefault(require('fs'));
41
+ const path_1 = __importDefault(require('path'));
42
+ const process_1 = __importDefault(require('process'));
43
+ const utils_1 = require('../../utils');
20
44
  const styleCheckError = [
21
45
  '!!!!!!!!!!!!! STYLE CHECK ERROR !!!!!!!!!!!!!',
22
46
  'Style check failed with following errors:',
@@ -24,8 +48,8 @@ const styleCheckError = [
24
48
  const designSystem = 'design-system.css';
25
49
  var PackageType;
26
50
  (function (PackageType) {
27
- PackageType["App"] = "app";
28
- PackageType["WebComponent"] = "web_component";
51
+ PackageType['App'] = 'app';
52
+ PackageType['WebComponent'] = 'web_component';
29
53
  })(PackageType || (PackageType = {}));
30
54
  function readDir(startPath, filter) {
31
55
  let out = [];
@@ -38,8 +62,7 @@ function readDir(startPath, filter) {
38
62
  const stat = fs_1.default.lstatSync(filename);
39
63
  if (stat.isDirectory()) {
40
64
  out = [...out, ...readDir(filename, filter)];
41
- }
42
- else if (filter.some(f => filename.endsWith(f))) {
65
+ } else if (filter.some(f => filename.endsWith(f))) {
43
66
  out.push(filename);
44
67
  }
45
68
  }
@@ -61,8 +84,10 @@ const checkStyleFiles = (files, packageType) => {
61
84
  "@import '~@servicetitan/design-system/dist/system.min.css';",
62
85
  ];
63
86
  for (const file of files) {
64
- if ([PackageType.App, PackageType.WebComponent].includes(packageType) &&
65
- file.relativePath === designSystem) {
87
+ if (
88
+ [PackageType.App, PackageType.WebComponent].includes(packageType) &&
89
+ file.relativePath === designSystem
90
+ ) {
66
91
  continue;
67
92
  }
68
93
  const content = fs_1.default.readFileSync(file.path);
@@ -74,11 +99,10 @@ const checkStyleFiles = (files, packageType) => {
74
99
  }
75
100
  return errors.length ? errors : undefined;
76
101
  };
77
- const checkErrors = (errors) => {
102
+ const checkErrors = errors => {
78
103
  if (!errors) {
79
104
  utils_1.log.info('style check: OK');
80
- }
81
- else {
105
+ } else {
82
106
  utils_1.log.error([...styleCheckError, ...errors].join('\n'));
83
107
  throw new Error('style check error, please check logs above');
84
108
  }
@@ -88,9 +112,15 @@ function checkStylesLib(_files) {
88
112
  }
89
113
  function checkStylesApp(files) {
90
114
  const { dependencies, sharedDependencies } = (0, utils_1.getPackageData)();
91
- if ((0, utils_1.loadSharedDependencies)(dependencies, sharedDependencies)['@servicetitan/design-system'] &&
92
- !files.some(f => f.relativePath === designSystem)) {
93
- utils_1.log.warning("application doesn't have design-system.css. Please check https://docs.st.dev/docs/frontend/micro-frontends#host-configuration");
115
+ if (
116
+ (0, utils_1.loadSharedDependencies)(dependencies, sharedDependencies)[
117
+ '@servicetitan/design-system'
118
+ ] &&
119
+ !files.some(f => f.relativePath === designSystem)
120
+ ) {
121
+ utils_1.log.warning(
122
+ "application doesn't have design-system.css. Please check https://docs.st.dev/docs/frontend/micro-frontends#host-configuration"
123
+ );
94
124
  }
95
125
  checkErrors(checkStyleFiles(files, PackageType.App));
96
126
  }
@@ -115,15 +145,13 @@ class StylesCheck {
115
145
  const files = findStyleFiles(process_1.default.cwd(), projectFolders.source);
116
146
  if (!(0, utils_1.isBundle)()) {
117
147
  checkStylesLib(files);
118
- }
119
- else if ((0, utils_1.isWebComponent)()) {
148
+ } else if ((0, utils_1.isWebComponent)()) {
120
149
  checkStylesWebComponent(files);
121
- }
122
- else {
150
+ } else {
123
151
  checkStylesApp(files);
124
152
  }
125
153
  });
126
154
  }
127
155
  }
128
156
  exports.StylesCheck = StylesCheck;
129
- //# sourceMappingURL=styles-check.js.map
157
+ //# sourceMappingURL=styles-check.js.map
@@ -1,36 +1,74 @@
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.Tests = void 0;
22
- const core_1 = require("@jest/core");
23
- const utils_1 = require("../../utils");
60
+ const core_1 = require('@jest/core');
61
+ const utils_1 = require('../../utils');
24
62
  /**
25
63
  * Named as tests to exclude it from the Jest pattern
26
64
  */
27
65
  class Tests {
28
66
  constructor(args) {
29
- Object.defineProperty(this, "args", {
67
+ Object.defineProperty(this, 'args', {
30
68
  enumerable: true,
31
69
  configurable: true,
32
70
  writable: true,
33
- value: args
71
+ value: args,
34
72
  });
35
73
  }
36
74
  description() {
@@ -39,7 +77,9 @@ class Tests {
39
77
  execute() {
40
78
  return __awaiter(this, void 0, void 0, function* () {
41
79
  const jestConfig = (0, utils_1.getJestConfigCLI)(this.args);
42
- const { results: { success }, } = yield (0, core_1.runCLI)(jestConfig, [process.cwd()]);
80
+ const {
81
+ results: { success },
82
+ } = yield (0, core_1.runCLI)(jestConfig, [process.cwd()]);
43
83
  if (!success) {
44
84
  // eslint-disable-next-line require-atomic-updates
45
85
  process.exitCode = 1;
@@ -48,10 +88,15 @@ class Tests {
48
88
  }
49
89
  }
50
90
  exports.Tests = Tests;
51
- __decorate([
52
- utils_1.logErrors,
53
- __metadata("design:type", Function),
54
- __metadata("design:paramtypes", []),
55
- __metadata("design:returntype", Promise)
56
- ], Tests.prototype, "execute", null);
57
- //# sourceMappingURL=tests.js.map
91
+ __decorate(
92
+ [
93
+ utils_1.logErrors,
94
+ __metadata('design:type', Function),
95
+ __metadata('design:paramtypes', []),
96
+ __metadata('design:returntype', Promise),
97
+ ],
98
+ Tests.prototype,
99
+ 'execute',
100
+ null
101
+ );
102
+ //# sourceMappingURL=tests.js.map
@@ -2,4 +2,4 @@ export interface Command {
2
2
  execute(): Promise<void>;
3
3
  description(): string | undefined;
4
4
  }
5
- //# sourceMappingURL=types.d.ts.map
5
+ //# sourceMappingURL=types.d.ts.map
@@ -1,3 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=types.js.map
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
+ //# sourceMappingURL=types.js.map
package/dist/cli/index.js CHANGED
@@ -1,15 +1,17 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
1
+ 'use strict';
2
+ var __importDefault =
3
+ (this && this.__importDefault) ||
4
+ function (mod) {
5
+ return mod && mod.__esModule ? mod : { default: mod };
6
+ };
5
7
  var _a;
6
- Object.defineProperty(exports, "__esModule", { value: true });
7
- const execa_1 = __importDefault(require("execa"));
8
- const yargs_1 = require("yargs");
9
- const utils_1 = require("../utils");
10
- const commands_1 = require("./commands");
11
- const utils_2 = require("./utils");
12
- const maybe_create_git_folder_1 = require("./utils/maybe-create-git-folder");
8
+ Object.defineProperty(exports, '__esModule', { value: true });
9
+ const execa_1 = __importDefault(require('execa'));
10
+ const yargs_1 = require('yargs');
11
+ const utils_1 = require('../utils');
12
+ const commands_1 = require('./commands');
13
+ const utils_2 = require('./utils');
14
+ const maybe_create_git_folder_1 = require('./utils/maybe-create-git-folder');
13
15
  const argvSync = yargs_1.argv;
14
16
  const name = (_a = argvSync._[0]) === null || _a === void 0 ? void 0 : _a.toString();
15
17
  if (!name) {
@@ -26,13 +28,16 @@ if (!Command) {
26
28
  (0, maybe_create_git_folder_1.maybeCreateGitFolder)();
27
29
  if ((0, utils_2.setNodeOptions)(name)) {
28
30
  // Run command in child process with amended NODE_OPTIONS
29
- (0, execa_1.default)(process.argv[0], process.argv.slice(1), { stdio: 'inherit' }).catch(reason => {
30
- process.exit(reason.exitCode);
31
- });
32
- }
33
- else {
31
+ (0, execa_1.default)(process.argv[0], process.argv.slice(1), { stdio: 'inherit' }).catch(
32
+ reason => {
33
+ process.exit(reason.exitCode);
34
+ }
35
+ );
36
+ } else {
34
37
  // eslint-disable-next-line @typescript-eslint/naming-convention
35
- const command = new Command(Object.assign(Object.assign({}, argvSync), { _: argvSync._.slice(1) }));
38
+ const command = new Command(
39
+ Object.assign(Object.assign({}, argvSync), { _: argvSync._.slice(1) })
40
+ );
36
41
  command.execute().catch(() => {
37
42
  process.exit(1);
38
43
  });
@@ -48,4 +53,4 @@ function usage() {
48
53
  function write(text) {
49
54
  return console.info(text); // eslint-disable-line no-console
50
55
  }
51
- //# sourceMappingURL=index.js.map
56
+ //# sourceMappingURL=index.js.map
@@ -1,27 +1,54 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ 'use strict';
2
+ var __awaiter =
3
+ (this && this.__awaiter) ||
4
+ function (thisArg, _arguments, P, generator) {
5
+ function adopt(value) {
6
+ return value instanceof P
7
+ ? value
8
+ : new P(function (resolve) {
9
+ resolve(value);
10
+ });
11
+ }
12
+ return new (P || (P = Promise))(function (resolve, reject) {
13
+ function fulfilled(value) {
14
+ try {
15
+ step(generator.next(value));
16
+ } catch (e) {
17
+ reject(e);
18
+ }
19
+ }
20
+ function rejected(value) {
21
+ try {
22
+ step(generator['throw'](value));
23
+ } catch (e) {
24
+ reject(e);
25
+ }
26
+ }
27
+ function step(result) {
28
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
29
+ }
30
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
31
+ });
32
+ };
33
+ var __importDefault =
34
+ (this && this.__importDefault) ||
35
+ function (mod) {
36
+ return mod && mod.__esModule ? mod : { default: mod };
37
+ };
38
+ Object.defineProperty(exports, '__esModule', { value: true });
15
39
  exports.assetsCopyWatch = exports.assetsCopy = void 0;
16
- const cpx_1 = __importDefault(require("cpx"));
17
- const util_1 = __importDefault(require("util"));
18
- const utils_1 = require("../../utils");
19
- const _1 = require(".");
40
+ const cpx_1 = __importDefault(require('cpx'));
41
+ const util_1 = __importDefault(require('util'));
42
+ const utils_1 = require('../../utils');
43
+ const _1 = require('.');
20
44
  function assetsCopy() {
21
45
  return __awaiter(this, void 0, void 0, function* () {
22
46
  const { source, destination } = (0, utils_1.getFolders)();
23
47
  utils_1.log.info('Copying asset files...');
24
- yield util_1.default.promisify(cpx_1.default.copy)(`${source}/**/*.{${_1.assetExtensions.join()}}`, destination);
48
+ yield util_1.default.promisify(cpx_1.default.copy)(
49
+ `${source}/**/*.{${_1.assetExtensions.join()}}`,
50
+ destination
51
+ );
25
52
  });
26
53
  }
27
54
  exports.assetsCopy = assetsCopy;
@@ -29,11 +56,13 @@ function assetsCopyWatch() {
29
56
  return __awaiter(this, void 0, void 0, function* () {
30
57
  const { source, destination } = (0, utils_1.getFolders)();
31
58
  yield new Promise((_0, reject) => {
32
- cpx_1.default.watch(`${source}/**/*.{${_1.assetExtensions.join()}}`, destination, {
33
- initialCopy: false,
34
- }).on('watch-error', reject);
59
+ cpx_1.default
60
+ .watch(`${source}/**/*.{${_1.assetExtensions.join()}}`, destination, {
61
+ initialCopy: false,
62
+ })
63
+ .on('watch-error', reject);
35
64
  });
36
65
  });
37
66
  }
38
67
  exports.assetsCopyWatch = assetsCopyWatch;
39
- //# sourceMappingURL=assets-copy.js.map
68
+ //# sourceMappingURL=assets-copy.js.map