@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,23 +1,47 @@
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.tcmWatch = exports.tcm = void 0;
16
- const glob_1 = require("glob");
17
- const chokidar_1 = __importDefault(require("chokidar"));
18
- const typed_css_modules_1 = __importDefault(require("typed-css-modules"));
19
- const utils_1 = require("../../utils");
20
- const _1 = require(".");
40
+ const glob_1 = require('glob');
41
+ const chokidar_1 = __importDefault(require('chokidar'));
42
+ const typed_css_modules_1 = __importDefault(require('typed-css-modules'));
43
+ const utils_1 = require('../../utils');
44
+ const _1 = require('.');
21
45
  function compile(filePath) {
22
46
  return __awaiter(this, void 0, void 0, function* () {
23
47
  if (filePath.endsWith('.less')) {
@@ -31,32 +55,34 @@ function compile(filePath) {
31
55
  function run() {
32
56
  return __awaiter(this, arguments, void 0, function* ({ watch } = {}) {
33
57
  const { source } = (0, utils_1.getFolders)();
34
- const filesPattern = `${source}/**/*.module.{${_1.styleExtensions.join()}}`.replace(/\\/g, '/');
58
+ const filesPattern = `${source}/**/*.module.{${_1.styleExtensions.join()}}`.replace(
59
+ /\\/g,
60
+ '/'
61
+ );
35
62
  const creator = new typed_css_modules_1.default({
36
63
  camelCase: true,
37
64
  namedExports: true,
38
65
  });
39
- const writeFile = (filePath) => __awaiter(this, void 0, void 0, function* () {
40
- try {
41
- const initialContents = yield compile(filePath);
42
- const content = yield creator.create(filePath, initialContents, !!watch);
43
- yield content.writeFile();
44
- }
45
- catch (error) {
46
- utils_1.log.error(String(error));
47
- }
48
- });
66
+ const writeFile = filePath =>
67
+ __awaiter(this, void 0, void 0, function* () {
68
+ try {
69
+ const initialContents = yield compile(filePath);
70
+ const content = yield creator.create(filePath, initialContents, !!watch);
71
+ yield content.writeFile();
72
+ } catch (error) {
73
+ utils_1.log.error(String(error));
74
+ }
75
+ });
49
76
  if (!watch) {
50
77
  const files = yield (0, glob_1.glob)(filesPattern);
51
78
  yield Promise.all(files.map(writeFile));
52
- }
53
- else {
79
+ } else {
54
80
  utils_1.log.info('Watch ' + filesPattern + '...');
55
81
  const watcher = chokidar_1.default.watch([filesPattern], { ignoreInitial: true });
56
82
  watcher.on('add', writeFile);
57
83
  watcher.on('change', writeFile);
58
84
  if (process.env.NODE_ENV !== 'test') {
59
- yield new Promise(() => { });
85
+ yield new Promise(() => {});
60
86
  }
61
87
  }
62
88
  });
@@ -74,4 +100,4 @@ function tcmWatch() {
74
100
  });
75
101
  }
76
102
  exports.tcmWatch = tcmWatch;
77
- //# sourceMappingURL=tcm.js.map
103
+ //# sourceMappingURL=tcm.js.map
@@ -1,20 +1,44 @@
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.tscWatch = exports.tsc = void 0;
16
- const execa_1 = __importDefault(require("execa"));
17
- const utils_1 = require("../../utils");
40
+ const execa_1 = __importDefault(require('execa'));
41
+ const utils_1 = require('../../utils');
18
42
  function tsc(packages) {
19
43
  utils_1.log.info('Building TypeScript files...');
20
44
  return transpile(packages);
@@ -39,7 +63,11 @@ function transpile(packages_1) {
39
63
  * Exclude dependant packages as they will be built through project references
40
64
  */
41
65
  function collapsePackages(packages) {
42
- const dependencies = new Set(Object.values((0, utils_1.getPackagesGraph)({ scope: packages.map(({ name }) => name) })).flat());
66
+ const dependencies = new Set(
67
+ Object.values(
68
+ (0, utils_1.getPackagesGraph)({ scope: packages.map(({ name }) => name) })
69
+ ).flat()
70
+ );
43
71
  return packages.filter(({ name }) => !dependencies.has(name));
44
72
  }
45
- //# sourceMappingURL=tsc.js.map
73
+ //# sourceMappingURL=tsc.js.map
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './webpack';
2
2
  export * from './jest';
3
+ export * from './utils/get-packages';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,QAAQ,CAAC;AACvB,cAAc,sBAAsB,CAAC"}
package/dist/index.js CHANGED
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./webpack"), exports);
18
18
  __exportStar(require("./jest"), exports);
19
+ __exportStar(require("./utils/get-packages"), exports);
19
20
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,yCAAuB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,yCAAuB;AACvB,uDAAqC"}
@@ -1,9 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ 'use strict';
2
+ Object.defineProperty(exports, '__esModule', { value: true });
3
3
  exports.createJestConfig = void 0;
4
- const utils_1 = require("../utils");
4
+ const utils_1 = require('../utils');
5
5
  function createJestConfig() {
6
6
  return (0, utils_1.getJestConfig)();
7
7
  }
8
8
  exports.createJestConfig = createJestConfig;
9
- //# sourceMappingURL=index.js.map
9
+ //# sourceMappingURL=index.js.map
@@ -2,4 +2,4 @@ import debug from 'debug';
2
2
  export declare function createDebug(namespace: string): debug.Debugger & {
3
3
  enable(): void;
4
4
  };
5
- //# sourceMappingURL=debug.d.ts.map
5
+ //# sourceMappingURL=debug.d.ts.map
@@ -1,10 +1,12 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ 'use strict';
2
+ var __importDefault =
3
+ (this && this.__importDefault) ||
4
+ function (mod) {
5
+ return mod && mod.__esModule ? mod : { default: mod };
6
+ };
7
+ Object.defineProperty(exports, '__esModule', { value: true });
6
8
  exports.createDebug = void 0;
7
- const debug_1 = __importDefault(require("debug"));
9
+ const debug_1 = __importDefault(require('debug'));
8
10
  const CONTEXT = 'startup';
9
11
  function createDebug(namespace) {
10
12
  const result = (0, debug_1.default)(CONTEXT).extend(namespace);
@@ -16,4 +18,4 @@ function createDebug(namespace) {
16
18
  });
17
19
  }
18
20
  exports.createDebug = createDebug;
19
- //# sourceMappingURL=debug.js.map
21
+ //# sourceMappingURL=debug.js.map
@@ -3,4 +3,4 @@ export interface ProjectPackage extends Record<string, any> {
3
3
  location: string;
4
4
  }
5
5
  export declare function findPackages(): ProjectPackage[];
6
- //# sourceMappingURL=find-packages.d.ts.map
6
+ //# sourceMappingURL=find-packages.d.ts.map
@@ -1,13 +1,15 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ 'use strict';
2
+ var __importDefault =
3
+ (this && this.__importDefault) ||
4
+ function (mod) {
5
+ return mod && mod.__esModule ? mod : { default: mod };
6
+ };
7
+ Object.defineProperty(exports, '__esModule', { value: true });
6
8
  exports.findPackages = void 0;
7
- const glob_1 = require("glob");
8
- const path_1 = __importDefault(require("path"));
9
- const read_json_1 = require("./read-json");
10
- const log_1 = require("./log");
9
+ const glob_1 = require('glob');
10
+ const path_1 = __importDefault(require('path'));
11
+ const read_json_1 = require('./read-json');
12
+ const log_1 = require('./log');
11
13
  function findPackages() {
12
14
  const workspaces = findWorkspaces();
13
15
  if (!workspaces) {
@@ -16,13 +18,18 @@ function findPackages() {
16
18
  const result = workspaces
17
19
  .flatMap(pattern => (0, glob_1.globSync)(pattern))
18
20
  .map(location => {
19
- const dir = path_1.default.resolve(location);
20
- const file = path_1.default.join(dir, 'package.json');
21
- return Object.assign(Object.assign({}, (0, read_json_1.readJsonSafe)(file)), { location: dir });
22
- })
21
+ const dir = path_1.default.resolve(location);
22
+ const file = path_1.default.join(dir, 'package.json');
23
+ return Object.assign(Object.assign({}, (0, read_json_1.readJsonSafe)(file)), {
24
+ location: dir,
25
+ });
26
+ })
23
27
  .filter(({ name }) => name !== undefined);
24
28
  /* istanbul ignore next: debug only */
25
- log_1.log.debug(`find-packages`, () => `found packages: ${JSON.stringify(result.map(({ name }) => name))}`);
29
+ log_1.log.debug(
30
+ `find-packages`,
31
+ () => `found packages: ${JSON.stringify(result.map(({ name }) => name))}`
32
+ );
26
33
  return result;
27
34
  }
28
35
  exports.findPackages = findPackages;
@@ -32,21 +39,31 @@ function findWorkspaces() {
32
39
  do {
33
40
  const packageJson = path_1.default.resolve(path_1.default.join(directory, 'package.json'));
34
41
  log_1.log.debug('find-packages', `reading: ${packageJson}`);
35
- let workspaces = (_a = (0, read_json_1.readJsonSafe)(packageJson)) === null || _a === void 0 ? void 0 : _a.workspaces;
42
+ let workspaces =
43
+ (_a = (0, read_json_1.readJsonSafe)(packageJson)) === null || _a === void 0
44
+ ? void 0
45
+ : _a.workspaces;
36
46
  if (!workspaces) {
37
47
  const lernaJson = path_1.default.resolve(path_1.default.join(directory, 'lerna.json'));
38
48
  log_1.log.debug('find-packages', `reading: ${lernaJson}`);
39
- workspaces = (_b = (0, read_json_1.readJsonSafe)(lernaJson)) === null || _b === void 0 ? void 0 : _b.packages;
49
+ workspaces =
50
+ (_b = (0, read_json_1.readJsonSafe)(lernaJson)) === null || _b === void 0
51
+ ? void 0
52
+ : _b.packages;
40
53
  }
41
54
  if (workspaces) {
42
55
  workspaces = workspaces.map(
43
- // Note, glob requires "/" as path separator, even on Windows
44
- workspace => path_1.default.join(directory, workspace).replace(/\\/g, '/'));
56
+ // Note, glob requires "/" as path separator, even on Windows
57
+ workspace => path_1.default.join(directory, workspace).replace(/\\/g, '/')
58
+ );
45
59
  /* istanbul ignore next: debug only */
46
- log_1.log.debug('find-packages', () => `found workspaces: ${JSON.stringify(workspaces)}`);
60
+ log_1.log.debug(
61
+ 'find-packages',
62
+ () => `found workspaces: ${JSON.stringify(workspaces)}`
63
+ );
47
64
  return workspaces;
48
65
  }
49
66
  directory = path_1.default.resolve(path_1.default.join(directory, '../'));
50
67
  } while (path_1.default.parse(directory).name);
51
68
  }
52
- //# sourceMappingURL=find-packages.js.map
69
+ //# sourceMappingURL=find-packages.js.map
@@ -1,12 +1,14 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ 'use strict';
2
+ var __importDefault =
3
+ (this && this.__importDefault) ||
4
+ function (mod) {
5
+ return mod && mod.__esModule ? mod : { default: mod };
6
+ };
7
+ Object.defineProperty(exports, '__esModule', { value: true });
6
8
  exports.getDestinationFolders = void 0;
7
- const fs_1 = __importDefault(require("fs"));
8
- const path_1 = __importDefault(require("path"));
9
- const _1 = require(".");
9
+ const fs_1 = __importDefault(require('fs'));
10
+ const path_1 = __importDefault(require('path'));
11
+ const _1 = require('.');
10
12
  /**
11
13
  * Returns compilation targets for all packages
12
14
  */
@@ -14,20 +16,23 @@ function getDestinationFolders() {
14
16
  const packages = (0, _1.getPackages)();
15
17
  return packages
16
18
  .map(({ location }) => {
17
- var _a;
18
- const tsConfigPath = path_1.default.join(location, 'tsconfig.json');
19
- if (!fs_1.default.existsSync(tsConfigPath)) {
20
- return '';
21
- }
22
- const { outDir } = (_a = (0, _1.readJson)(tsConfigPath).compilerOptions) !== null && _a !== void 0 ? _a : {};
23
- if (!outDir) {
24
- return '';
25
- }
26
- return path_1.default
27
- .join('/', path_1.default.relative(process.cwd(), location), outDir, '/')
28
- .replace(/\\/g, '/');
29
- })
19
+ var _a;
20
+ const tsConfigPath = path_1.default.join(location, 'tsconfig.json');
21
+ if (!fs_1.default.existsSync(tsConfigPath)) {
22
+ return '';
23
+ }
24
+ const { outDir } =
25
+ (_a = (0, _1.readJson)(tsConfigPath).compilerOptions) !== null && _a !== void 0
26
+ ? _a
27
+ : {};
28
+ if (!outDir) {
29
+ return '';
30
+ }
31
+ return path_1.default
32
+ .join('/', path_1.default.relative(process.cwd(), location), outDir, '/')
33
+ .replace(/\\/g, '/');
34
+ })
30
35
  .filter(path => !!path);
31
36
  }
32
37
  exports.getDestinationFolders = getDestinationFolders;
33
- //# sourceMappingURL=get-destination-folders.js.map
38
+ //# sourceMappingURL=get-destination-folders.js.map
@@ -1,17 +1,23 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ 'use strict';
2
+ var __importDefault =
3
+ (this && this.__importDefault) ||
4
+ function (mod) {
5
+ return mod && mod.__esModule ? mod : { default: mod };
6
+ };
7
+ Object.defineProperty(exports, '__esModule', { value: true });
6
8
  exports.getFolders = void 0;
7
- const path_1 = __importDefault(require("path"));
8
- const _1 = require(".");
9
+ const path_1 = __importDefault(require('path'));
10
+ const _1 = require('.');
9
11
  /**
10
12
  * Returns folders of sources and compilation target
11
13
  */
12
14
  function getFolders(location = './') {
13
15
  var _a;
14
- const { rootDir, outDir } = (_a = (0, _1.readJson)(path_1.default.join(location, 'tsconfig.json')).compilerOptions) !== null && _a !== void 0 ? _a : {};
16
+ const { rootDir, outDir } =
17
+ (_a = (0, _1.readJson)(path_1.default.join(location, 'tsconfig.json')).compilerOptions) !==
18
+ null && _a !== void 0
19
+ ? _a
20
+ : {};
15
21
  if (!rootDir) {
16
22
  throw '"compilerOptions.rootDir" must be defined in the "tsconfig.json"!';
17
23
  }
@@ -24,4 +30,4 @@ function getFolders(location = './') {
24
30
  };
25
31
  }
26
32
  exports.getFolders = getFolders;
27
- //# sourceMappingURL=get-folders.js.map
33
+ //# sourceMappingURL=get-folders.js.map
@@ -1,25 +1,33 @@
1
- "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
- var __importDefault = (this && this.__importDefault) || function (mod) {
14
- return (mod && mod.__esModule) ? mod : { "default": mod };
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ 'use strict';
2
+ var __rest =
3
+ (this && this.__rest) ||
4
+ function (s, e) {
5
+ var t = {};
6
+ for (var p in s)
7
+ if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
8
+ if (s != null && typeof Object.getOwnPropertySymbols === 'function')
9
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
10
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
11
+ t[p[i]] = s[p[i]];
12
+ }
13
+ return t;
14
+ };
15
+ var __importDefault =
16
+ (this && this.__importDefault) ||
17
+ function (mod) {
18
+ return mod && mod.__esModule ? mod : { default: mod };
19
+ };
20
+ Object.defineProperty(exports, '__esModule', { value: true });
17
21
  exports.getJestConfigCLI = exports.getJestConfig = void 0;
18
- const path_1 = __importDefault(require("path"));
19
- const get_configuration_1 = require("./get-configuration");
20
- const get_destination_folders_1 = require("./get-destination-folders");
21
- const to_array_1 = require("./to-array");
22
- const getJestConfigBase = ({ coveragePathIgnorePatterns = [], setupFiles = [], testPathIgnorePatterns = [], }) => {
22
+ const path_1 = __importDefault(require('path'));
23
+ const get_configuration_1 = require('./get-configuration');
24
+ const get_destination_folders_1 = require('./get-destination-folders');
25
+ const to_array_1 = require('./to-array');
26
+ const getJestConfigBase = ({
27
+ coveragePathIgnorePatterns = [],
28
+ setupFiles = [],
29
+ testPathIgnorePatterns = [],
30
+ }) => {
23
31
  const transform = {
24
32
  '^.+\\.jsx?$': [
25
33
  'babel-jest',
@@ -43,7 +51,10 @@ const getJestConfigBase = ({ coveragePathIgnorePatterns = [], setupFiles = [], t
43
51
  ...(0, get_destination_folders_1.getDestinationFolders)(),
44
52
  ...(0, to_array_1.toArray)(testPathIgnorePatterns),
45
53
  ],
46
- setupFiles: [path_1.default.join(__dirname, '../../jest/setup.js'), ...(0, to_array_1.toArray)(setupFiles)],
54
+ setupFiles: [
55
+ path_1.default.join(__dirname, '../../jest/setup.js'),
56
+ ...(0, to_array_1.toArray)(setupFiles),
57
+ ],
47
58
  coveragePathIgnorePatterns: ['^.+\\.d\\.ts$', ...coveragePathIgnorePatterns],
48
59
  coverageReporters: ['html-spa', 'text', 'json', 'cobertura', 'lcov'],
49
60
  collectCoverageFrom: ['**/*.{ts,tsx}'],
@@ -54,25 +65,56 @@ const getJestConfigBase = ({ coveragePathIgnorePatterns = [], setupFiles = [], t
54
65
  * Jest config files.
55
66
  */
56
67
  const getJestConfig = () => {
57
- const _a = (0, get_configuration_1.getJestConfiguration)(), { coveragePathIgnorePatterns, setupFiles, testPathIgnorePatterns } = _a, config = __rest(_a, ["coveragePathIgnorePatterns", "setupFiles", "testPathIgnorePatterns"]);
58
- return Object.assign(Object.assign({}, getJestConfigBase({
59
- coveragePathIgnorePatterns,
60
- setupFiles,
61
- testPathIgnorePatterns,
62
- })), config);
68
+ const _a = (0, get_configuration_1.getJestConfiguration)(),
69
+ { coveragePathIgnorePatterns, setupFiles, testPathIgnorePatterns } = _a,
70
+ config = __rest(_a, ['coveragePathIgnorePatterns', 'setupFiles', 'testPathIgnorePatterns']);
71
+ return Object.assign(
72
+ Object.assign(
73
+ {},
74
+ getJestConfigBase({
75
+ coveragePathIgnorePatterns,
76
+ setupFiles,
77
+ testPathIgnorePatterns,
78
+ })
79
+ ),
80
+ config
81
+ );
63
82
  };
64
83
  exports.getJestConfig = getJestConfig;
65
84
  /**
66
85
  * Get Jest config for running it using jest CLI (see jest runCLI function)
67
86
  */
68
- const getJestConfigCLI = (args) => {
69
- const _a = Object.assign(Object.assign({}, (0, get_configuration_1.getJestConfiguration)()), args), { coveragePathIgnorePatterns, setupFiles, testPathIgnorePatterns, globals } = _a, config = __rest(_a, ["coveragePathIgnorePatterns", "setupFiles", "testPathIgnorePatterns", "globals"]);
87
+ const getJestConfigCLI = args => {
88
+ const _a = Object.assign(
89
+ Object.assign({}, (0, get_configuration_1.getJestConfiguration)()),
90
+ args
91
+ ),
92
+ { coveragePathIgnorePatterns, setupFiles, testPathIgnorePatterns, globals } = _a,
93
+ config = __rest(_a, [
94
+ 'coveragePathIgnorePatterns',
95
+ 'setupFiles',
96
+ 'testPathIgnorePatterns',
97
+ 'globals',
98
+ ]);
70
99
  const _b = getJestConfigBase({
71
- coveragePathIgnorePatterns,
72
- setupFiles,
73
- testPathIgnorePatterns,
74
- }), { collectCoverageFrom, moduleNameMapper, transform } = _b, rest = __rest(_b, ["collectCoverageFrom", "moduleNameMapper", "transform"]);
75
- return Object.assign(Object.assign({ collectCoverageFrom: JSON.stringify(collectCoverageFrom), globals: JSON.stringify(globals), moduleNameMapper: JSON.stringify(moduleNameMapper), transform: JSON.stringify(transform) }, rest), config);
100
+ coveragePathIgnorePatterns,
101
+ setupFiles,
102
+ testPathIgnorePatterns,
103
+ }),
104
+ { collectCoverageFrom, moduleNameMapper, transform } = _b,
105
+ rest = __rest(_b, ['collectCoverageFrom', 'moduleNameMapper', 'transform']);
106
+ return Object.assign(
107
+ Object.assign(
108
+ {
109
+ collectCoverageFrom: JSON.stringify(collectCoverageFrom),
110
+ globals: JSON.stringify(globals),
111
+ moduleNameMapper: JSON.stringify(moduleNameMapper),
112
+ transform: JSON.stringify(transform),
113
+ },
114
+ rest
115
+ ),
116
+ config
117
+ );
76
118
  };
77
119
  exports.getJestConfigCLI = getJestConfigCLI;
78
- //# sourceMappingURL=get-jest-config.js.map
120
+ //# sourceMappingURL=get-jest-config.js.map
@@ -3,5 +3,8 @@ export declare function getPackageData(): {
3
3
  dependencies: Record<string, string>;
4
4
  sharedDependencies?: Record<string, string>;
5
5
  };
6
- export declare function getPackageDependencyVersion(dependency: string, defaultVersion?: string): any;
7
- //# sourceMappingURL=get-package-data.d.ts.map
6
+ export declare function getPackageDependencyVersion(
7
+ dependency: string,
8
+ defaultVersion?: string
9
+ ): any;
10
+ //# sourceMappingURL=get-package-data.d.ts.map