@servicetitan/startup 31.5.0 → 31.6.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 (143) hide show
  1. package/dist/cli/commands/build.d.ts +1 -1
  2. package/dist/cli/commands/build.d.ts.map +1 -1
  3. package/dist/cli/commands/build.js.map +1 -1
  4. package/dist/cli/commands/bundle-package.d.ts +1 -1
  5. package/dist/cli/commands/bundle-package.d.ts.map +1 -1
  6. package/dist/cli/commands/bundle-package.js.map +1 -1
  7. package/dist/cli/commands/eslint.d.ts +1 -1
  8. package/dist/cli/commands/eslint.d.ts.map +1 -1
  9. package/dist/cli/commands/eslint.js.map +1 -1
  10. package/dist/cli/commands/get-command.js +2 -2
  11. package/dist/cli/commands/get-command.js.map +1 -1
  12. package/dist/cli/commands/index.d.ts +1 -1
  13. package/dist/cli/commands/index.d.ts.map +1 -1
  14. package/dist/cli/commands/index.js +1 -1
  15. package/dist/cli/commands/index.js.map +1 -1
  16. package/dist/cli/commands/init.d.ts +1 -1
  17. package/dist/cli/commands/init.d.ts.map +1 -1
  18. package/dist/cli/commands/init.js.map +1 -1
  19. package/dist/cli/commands/lint.d.ts +1 -1
  20. package/dist/cli/commands/lint.d.ts.map +1 -1
  21. package/dist/cli/commands/lint.js.map +1 -1
  22. package/dist/cli/commands/mfe-publish.d.ts +1 -1
  23. package/dist/cli/commands/mfe-publish.d.ts.map +1 -1
  24. package/dist/cli/commands/mfe-publish.js.map +1 -1
  25. package/dist/cli/commands/prepare-package.d.ts +1 -1
  26. package/dist/cli/commands/prepare-package.d.ts.map +1 -1
  27. package/dist/cli/commands/prepare-package.js.map +1 -1
  28. package/dist/cli/commands/review/rules/index.d.ts.map +1 -1
  29. package/dist/cli/commands/review/rules/index.js +4 -0
  30. package/dist/cli/commands/review/rules/index.js.map +1 -1
  31. package/dist/cli/commands/review/rules/require-all-react-dependencies.d.ts +14 -0
  32. package/dist/cli/commands/review/rules/require-all-react-dependencies.d.ts.map +1 -0
  33. package/dist/cli/commands/review/rules/require-all-react-dependencies.js +64 -0
  34. package/dist/cli/commands/review/rules/require-all-react-dependencies.js.map +1 -0
  35. package/dist/cli/commands/review/rules/require-one-react-version.d.ts +5 -0
  36. package/dist/cli/commands/review/rules/require-one-react-version.d.ts.map +1 -0
  37. package/dist/cli/commands/review/rules/require-one-react-version.js +25 -0
  38. package/dist/cli/commands/review/rules/require-one-react-version.js.map +1 -0
  39. package/dist/cli/commands/review/rules/require-one-uikit-version.d.ts.map +1 -1
  40. package/dist/cli/commands/review/rules/require-one-uikit-version.js +1 -0
  41. package/dist/cli/commands/review/rules/require-one-uikit-version.js.map +1 -1
  42. package/dist/cli/commands/review/utils/format-depends-on.d.ts +1 -0
  43. package/dist/cli/commands/review/utils/format-depends-on.d.ts.map +1 -1
  44. package/dist/cli/commands/review/utils/format-depends-on.js +15 -8
  45. package/dist/cli/commands/review/utils/format-depends-on.js.map +1 -1
  46. package/dist/cli/commands/review/utils/set-version.d.ts +2 -1
  47. package/dist/cli/commands/review/utils/set-version.d.ts.map +1 -1
  48. package/dist/cli/commands/review/utils/set-version.js +4 -2
  49. package/dist/cli/commands/review/utils/set-version.js.map +1 -1
  50. package/dist/cli/commands/start.d.ts +1 -1
  51. package/dist/cli/commands/start.d.ts.map +1 -1
  52. package/dist/cli/commands/start.js.map +1 -1
  53. package/dist/cli/commands/test/index.d.ts +2 -0
  54. package/dist/cli/commands/test/index.d.ts.map +1 -0
  55. package/dist/cli/commands/test/index.js +20 -0
  56. package/dist/cli/commands/test/index.js.map +1 -0
  57. package/dist/cli/commands/test/runners/index.d.ts +3 -0
  58. package/dist/cli/commands/test/runners/index.d.ts.map +1 -0
  59. package/dist/cli/commands/test/runners/index.js +21 -0
  60. package/dist/cli/commands/test/runners/index.js.map +1 -0
  61. package/dist/cli/commands/test/runners/jest.d.ts +7 -0
  62. package/dist/cli/commands/test/runners/jest.d.ts.map +1 -0
  63. package/dist/cli/commands/test/runners/jest.js +43 -0
  64. package/dist/cli/commands/test/runners/jest.js.map +1 -0
  65. package/dist/cli/commands/test/runners/vitest.d.ts +4 -0
  66. package/dist/cli/commands/test/runners/vitest.d.ts.map +1 -0
  67. package/dist/cli/commands/test/runners/vitest.js +86 -0
  68. package/dist/cli/commands/test/runners/vitest.js.map +1 -0
  69. package/dist/cli/commands/test/tests.d.ts +18 -0
  70. package/dist/cli/commands/test/tests.d.ts.map +1 -0
  71. package/dist/cli/commands/{tests.js → test/tests.js} +10 -9
  72. package/dist/cli/commands/test/tests.js.map +1 -0
  73. package/dist/cli/utils/bundle.d.ts.map +1 -1
  74. package/dist/cli/utils/bundle.js +7 -4
  75. package/dist/cli/utils/bundle.js.map +1 -1
  76. package/dist/cli/utils/set-node-options.d.ts.map +1 -1
  77. package/dist/cli/utils/set-node-options.js.map +1 -1
  78. package/dist/index.d.ts +0 -1
  79. package/dist/index.d.ts.map +1 -1
  80. package/dist/index.js +0 -1
  81. package/dist/index.js.map +1 -1
  82. package/dist/utils/get-configuration.d.ts +8 -2
  83. package/dist/utils/get-configuration.d.ts.map +1 -1
  84. package/dist/utils/get-configuration.js +10 -2
  85. package/dist/utils/get-configuration.js.map +1 -1
  86. package/dist/utils/get-jest-config.d.ts +1 -7
  87. package/dist/utils/get-jest-config.d.ts.map +1 -1
  88. package/dist/utils/get-jest-config.js +49 -58
  89. package/dist/utils/get-jest-config.js.map +1 -1
  90. package/dist/webpack/create-webpack-config.js +1 -2
  91. package/dist/webpack/create-webpack-config.js.map +1 -1
  92. package/dist/webpack/utils/testing/get-compiler.js.map +1 -1
  93. package/package.json +16 -14
  94. package/src/cli/commands/build.ts +1 -1
  95. package/src/cli/commands/bundle-package.ts +1 -1
  96. package/src/cli/commands/eslint.ts +1 -1
  97. package/src/cli/commands/get-command.ts +1 -1
  98. package/src/cli/commands/index.ts +1 -1
  99. package/src/cli/commands/init.ts +1 -1
  100. package/src/cli/commands/lint.ts +1 -1
  101. package/src/cli/commands/mfe-publish.ts +1 -1
  102. package/src/cli/commands/prepare-package.ts +1 -1
  103. package/src/cli/commands/review/rules/__tests__/require-all-react-dependencies.test.ts +132 -0
  104. package/src/cli/commands/review/rules/__tests__/require-one-package-version.test.ts +0 -1
  105. package/src/cli/commands/review/rules/__tests__/require-one-react-version.test.ts +22 -0
  106. package/src/cli/commands/review/rules/__tests__/{require-one-uikit-version.ts → require-one-uikit-version.test.ts} +1 -0
  107. package/src/cli/commands/review/rules/index.ts +4 -0
  108. package/src/cli/commands/review/rules/require-all-react-dependencies.ts +53 -0
  109. package/src/cli/commands/review/rules/require-one-react-version.ts +9 -0
  110. package/src/cli/commands/review/rules/require-one-uikit-version.ts +1 -0
  111. package/src/cli/commands/review/utils/__tests__/set-version.test.ts +18 -8
  112. package/src/cli/commands/review/utils/format-depends-on.ts +8 -5
  113. package/src/cli/commands/review/utils/set-version.ts +10 -2
  114. package/src/cli/commands/start.ts +1 -1
  115. package/src/cli/commands/test/__tests__/tests.test.ts +78 -0
  116. package/src/cli/commands/test/index.ts +1 -0
  117. package/src/cli/commands/{__tests__/tests.test.ts → test/runners/__tests__/jest.test.ts} +10 -13
  118. package/src/cli/commands/test/runners/__tests__/vitest.test.ts +150 -0
  119. package/src/cli/commands/test/runners/index.ts +2 -0
  120. package/src/cli/commands/{tests.ts → test/runners/jest.ts} +5 -16
  121. package/src/cli/commands/test/runners/vitest.ts +70 -0
  122. package/src/cli/commands/test/tests.ts +34 -0
  123. package/src/cli/utils/__tests__/bundle.test.ts +1 -1
  124. package/src/cli/utils/bundle.ts +8 -3
  125. package/src/cli/utils/set-node-options.ts +2 -2
  126. package/src/index.ts +0 -1
  127. package/src/utils/__tests__/get-configuration.test.ts +48 -11
  128. package/src/utils/__tests__/get-jest-config.test.ts +35 -61
  129. package/src/utils/get-configuration.ts +14 -3
  130. package/src/utils/get-jest-config.ts +39 -47
  131. package/src/webpack/__tests__/create-webpack-config-shared-dependencies.test.ts +1 -1
  132. package/src/webpack/__tests__/create-webpack-config-web-component.test.ts +1 -1
  133. package/src/webpack/__tests__/create-webpack-config.test.ts +1 -1
  134. package/src/webpack/create-webpack-config.ts +1 -2
  135. package/src/webpack/utils/testing/get-compiler.ts +1 -1
  136. package/dist/cli/commands/tests.d.ts +0 -13
  137. package/dist/cli/commands/tests.d.ts.map +0 -1
  138. package/dist/cli/commands/tests.js.map +0 -1
  139. package/dist/jest/index.d.ts +0 -2
  140. package/dist/jest/index.d.ts.map +0 -1
  141. package/dist/jest/index.js +0 -16
  142. package/dist/jest/index.js.map +0 -1
  143. package/src/jest/index.ts +0 -5
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './webpack';\nexport * from './jest';\nexport * from './utils/get-packages';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA"}
1
+ {"version":3,"sources":["../src/index.ts"],"sourcesContent":["export * from './webpack';\nexport * from './utils/get-packages';\n"],"names":[],"mappings":";;;;qBAAc;qBACA"}
@@ -2,6 +2,7 @@ import { Config } from '@jest/types';
2
2
  import { swcDir } from '@swc/cli';
3
3
  import { ESLint } from 'eslint';
4
4
  import { LinterOptions } from 'stylelint';
5
+ import { ViteUserConfig } from 'vitest/config';
5
6
  import { Configuration as WebpackDevServerConfiguration } from 'webpack-dev-server';
6
7
  import { ReviewConfiguration } from '../cli/commands/review';
7
8
  export declare const allowedWebpackDevServerOptions: readonly ["headers", "port", "proxy", "static"];
@@ -57,6 +58,7 @@ export declare enum CommandName {
57
58
  'task' = "task",
58
59
  'upload-sourcemaps' = "upload-sourcemaps"
59
60
  }
61
+ export type VitestConfiguration = ViteUserConfig['test'];
60
62
  export interface WebComponentBranchConfigs {
61
63
  publishTag?: string;
62
64
  uploadSourcemaps?: boolean;
@@ -70,6 +72,7 @@ interface WebComponentOptions {
70
72
  branches?: Record<string, WebComponentBranchConfigs>;
71
73
  }
72
74
  type Configuration = {
75
+ 'jest'?: JestConfiguration;
73
76
  'legacy'?: boolean;
74
77
  'lint'?: {
75
78
  eslint: ESLintConfiguration;
@@ -78,18 +81,21 @@ type Configuration = {
78
81
  'review'?: ReviewConfiguration;
79
82
  'swc-compile-package'?: Parameters<typeof swcDir>[0];
80
83
  'test'?: JestConfiguration;
84
+ 'testRunner'?: string;
85
+ 'vitest'?: VitestConfiguration;
81
86
  'web-component'?: boolean | string | WebComponentOptions;
82
87
  'webpack'?: false | WebpackConfiguration;
83
88
  } & {
84
- [key in CommandName]: NodeConfiguration;
89
+ [key in CommandName]?: NodeConfiguration;
85
90
  } & NodeConfiguration;
86
91
  type LocationOrJson = string | Record<string, any>;
87
92
  export declare function getConfiguration(locationOrJson?: LocationOrJson): Configuration;
88
93
  export declare function getConfigurationSafe(locationOrJson?: LocationOrJson): Configuration;
89
94
  export declare function getESLintConfiguration(): ESLintConfiguration;
90
- export declare function getJestConfiguration(): JestConfiguration & NodeConfiguration;
95
+ export declare function getJestConfiguration(): JestConfiguration;
91
96
  export declare function getReviewConfiguration(): ReviewConfiguration & NodeConfiguration;
92
97
  export declare function getStylelintConfiguration(): StylelintConfiguration;
98
+ export declare function getVitestConfiguration(): import("vitest/node").InlineConfig;
93
99
  export declare function getWebpackConfiguration(locationOrJson?: LocationOrJson): WebpackConfiguration;
94
100
  export declare function getWebComponentConfiguration(locationOrJson?: LocationOrJson): WebComponentOptions | undefined;
95
101
  export declare function getWebComponentBranchConfigs(locationOrJson?: LocationOrJson): Record<string, WebComponentBranchConfigs> | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"get-configuration.d.ts","sourceRoot":"","sources":["../../src/utils/get-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,IAAI,6BAA6B,EAAE,MAAM,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cAAc,WAEvD;AAED,wBAAgB,YAAY,YAE3B;AAED,wBAAgB,oBAAoB,YAEnC;AAED,wBAAgB,cAAc,CAAC,cAAc,GAAE,cAAqB,WAEnE"}
@@ -36,6 +36,9 @@ _export(exports, {
36
36
  get getSwcCompilePackageConfiguration () {
37
37
  return getSwcCompilePackageConfiguration;
38
38
  },
39
+ get getVitestConfiguration () {
40
+ return getVitestConfiguration;
41
+ },
39
42
  get getWebComponentBranchConfigs () {
40
43
  return getWebComponentBranchConfigs;
41
44
  },
@@ -127,8 +130,9 @@ function getESLintConfiguration() {
127
130
  return (_getConfiguration_lint_eslint = (_getConfiguration_lint = getConfiguration().lint) === null || _getConfiguration_lint === void 0 ? void 0 : _getConfiguration_lint.eslint) !== null && _getConfiguration_lint_eslint !== void 0 ? _getConfiguration_lint_eslint : {};
128
131
  }
129
132
  function getJestConfiguration() {
130
- var _getConfiguration_test;
131
- return (_getConfiguration_test = getConfiguration().test) !== null && _getConfiguration_test !== void 0 ? _getConfiguration_test : {};
133
+ const configuration = getConfiguration();
134
+ var _configuration_jest, _ref;
135
+ return (_ref = (_configuration_jest = configuration.jest) !== null && _configuration_jest !== void 0 ? _configuration_jest : configuration.test) !== null && _ref !== void 0 ? _ref : {};
132
136
  }
133
137
  function getReviewConfiguration() {
134
138
  var _getConfiguration_review;
@@ -139,6 +143,10 @@ function getStylelintConfiguration() {
139
143
  var _getConfiguration_lint_stylelint;
140
144
  return (_getConfiguration_lint_stylelint = (_getConfiguration_lint = getConfiguration().lint) === null || _getConfiguration_lint === void 0 ? void 0 : _getConfiguration_lint.stylelint) !== null && _getConfiguration_lint_stylelint !== void 0 ? _getConfiguration_lint_stylelint : {};
141
145
  }
146
+ function getVitestConfiguration() {
147
+ var _getConfiguration_vitest;
148
+ return (_getConfiguration_vitest = getConfiguration().vitest) !== null && _getConfiguration_vitest !== void 0 ? _getConfiguration_vitest : {};
149
+ }
142
150
  function getWebpackConfiguration(locationOrJson) {
143
151
  const { webpack } = getConfiguration(locationOrJson);
144
152
  return typeof webpack === 'object' ? webpack : {};
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/get-configuration.ts"],"sourcesContent":["import { Config } from '@jest/types';\nimport { swcDir } from '@swc/cli';\nimport { ESLint } from 'eslint';\nimport fs from 'fs';\nimport path from 'path';\nimport { LinterOptions } from 'stylelint';\nimport { Configuration as WebpackDevServerConfiguration } from 'webpack-dev-server';\n\nimport { ReviewConfiguration } from '../cli/commands/review';\nimport { log } from './log';\nimport { getFolders } from './get-folders';\nimport { readJson, readJsonSafe } from './read-json';\n\nexport const allowedWebpackDevServerOptions = ['headers', 'port', 'proxy', 'static'] as const;\n\ntype ElementType<T> = T extends readonly (infer ElementType)[] ? ElementType : never;\n\nexport interface MinifyJSOptions {\n compress?: boolean;\n mangle?: boolean;\n}\n\nexport interface MinifyCssOptions {}\n\nexport interface MinifyOptions {\n css?: boolean | MinifyCssOptions;\n js?: boolean | MinifyJSOptions;\n}\n\nexport interface WebpackConfiguration\n extends Omit<\n Pick<WebpackDevServerConfiguration, ElementType<typeof allowedWebpackDevServerOptions>>,\n 'proxy'\n > {\n 'contentBase'?: boolean | string | string[] | number; // deprecated 2024-07\n 'custom-style-rules'?: boolean;\n 'expose-shared-dependencies'?: boolean;\n 'devServer'?: false | WebpackDevServerConfiguration;\n 'disable-style-check'?: boolean;\n 'minify'?: MinifyOptions;\n 'proxy'?: WebpackDevServerConfiguration['proxy'] | string;\n}\n\nexport interface ESLintConfiguration extends ESLint.Options {\n disabled?: boolean;\n}\n\nexport interface StylelintConfiguration extends Partial<LinterOptions> {\n ignorePattern?: string[];\n disabled?: boolean;\n}\n\nexport type JestConfiguration = Omit<Config.Argv, '_' | '$0'>;\n\nexport interface NodeConfiguration {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n NODE_OPTIONS?: string[];\n}\n\n/* eslint-disable @typescript-eslint/naming-convention */\nexport enum CommandName {\n 'build' = 'build',\n 'bundle-package' = 'bundle-package',\n 'clean' = 'clean',\n 'convert-eslint-config' = 'convert-eslint-config',\n 'eslint' = 'eslint',\n 'init' = 'init',\n 'install' = 'install',\n 'kendo-ui-license' = 'kendo-ui-license',\n 'lint' = 'lint',\n 'mfe-package-clean' = 'mfe-package-clean',\n 'mfe-package-publish' = 'mfe-package-publish',\n 'mfe-publish' = 'mfe-publish',\n 'prepare-package' = 'prepare-package',\n 'review' = 'review',\n 'start' = 'start',\n 'styles-check' = 'styles-check',\n 'test' = 'test',\n 'task' = 'task',\n 'upload-sourcemaps' = 'upload-sourcemaps',\n}\n/* eslint-enable @typescript-eslint/naming-convention */\n\nexport interface WebComponentBranchConfigs {\n publishTag?: string;\n uploadSourcemaps?: boolean;\n}\n\ninterface WebComponentOptions {\n legacyRoot?: boolean;\n /**\n * mapping of git branches to configs.\n * Used to separate configs (ex publish tag) depending on current branch\n */\n branches?: Record<string, WebComponentBranchConfigs>;\n}\n\ntype Configuration = {\n 'legacy'?: boolean;\n 'lint'?: { eslint: ESLintConfiguration; stylelint: StylelintConfiguration };\n 'review'?: ReviewConfiguration;\n 'swc-compile-package'?: Parameters<typeof swcDir>[0];\n 'test'?: JestConfiguration;\n 'web-component'?: boolean | string | WebComponentOptions;\n 'webpack'?: false | WebpackConfiguration;\n} & {\n [key in CommandName]: NodeConfiguration;\n} & NodeConfiguration;\n\ntype LocationOrJson = string | Record<string, any>;\n\nexport function getConfiguration(locationOrJson: LocationOrJson = './'): Configuration {\n const json =\n typeof locationOrJson === 'string'\n ? readJson(path.join(locationOrJson, 'package.json'))\n : locationOrJson;\n return json?.cli ?? {};\n}\n\nexport function getConfigurationSafe(locationOrJson: LocationOrJson = './'): Configuration {\n const json =\n typeof locationOrJson === 'string'\n ? readJsonSafe(path.join(locationOrJson, 'package.json'))\n : locationOrJson;\n return json?.cli ?? {};\n}\n\nexport function getESLintConfiguration() {\n return getConfiguration().lint?.eslint ?? {};\n}\n\nexport function getJestConfiguration() {\n return getConfiguration().test ?? {};\n}\n\nexport function getReviewConfiguration() {\n return getConfiguration().review ?? {};\n}\n\nexport function getStylelintConfiguration() {\n return getConfiguration().lint?.stylelint ?? {};\n}\n\nexport function getWebpackConfiguration(locationOrJson?: LocationOrJson) {\n const { webpack } = getConfiguration(locationOrJson);\n return typeof webpack === 'object' ? webpack : {};\n}\n\nexport function getWebComponentConfiguration(\n locationOrJson: LocationOrJson = './'\n): WebComponentOptions | undefined {\n const config = getConfigurationSafe(locationOrJson)['web-component'];\n\n if (config === true) {\n return {};\n }\n\n if (typeof config === 'object') {\n return config;\n }\n\n if (typeof config === 'string') {\n const configPath = path.resolve(\n typeof locationOrJson === 'string' ? path.join(locationOrJson, config) : config\n );\n if (fs.existsSync(configPath)) {\n return require(path.resolve(configPath));\n }\n log.warning(`could not find web-component configuration: \"${config}\"`);\n\n return undefined;\n }\n}\n\nexport function getWebComponentBranchConfigs(locationOrJson: LocationOrJson = './') {\n const config = getWebComponentConfiguration(locationOrJson);\n\n return config?.branches;\n}\n\nexport function hasHeadlessBundle() {\n let source: string;\n try {\n source = getFolders().source;\n } catch {\n return false;\n }\n const headlessPath = path.join(source, 'headless.ts');\n return fs.existsSync(headlessPath);\n}\n\nexport function getSwcCompilePackageConfiguration() {\n return getConfiguration()['swc-compile-package'] ?? {};\n}\n\nexport function isBundle(locationOrJson?: LocationOrJson) {\n return getConfiguration(locationOrJson).webpack !== false;\n}\n\nexport function isCustomStyleRules() {\n return getWebpackConfiguration()['custom-style-rules'] === true;\n}\n\nexport function isDevServerDisabled() {\n const webpackConfiguration = getWebpackConfiguration();\n return webpackConfiguration.devServer === false;\n}\n\nexport function isExposeSharedDependencies() {\n return getWebpackConfiguration()['expose-shared-dependencies'] === true;\n}\n\nexport function isLegacy(locationOrJson?: LocationOrJson) {\n return getConfiguration(locationOrJson).legacy === true;\n}\n\nexport function isLegacyRoot() {\n return getWebComponentConfiguration()?.legacyRoot === true;\n}\n\nexport function isStyleCheckDisabled() {\n return getWebpackConfiguration()['disable-style-check'] === true;\n}\n\nexport function isWebComponent(locationOrJson: LocationOrJson = './') {\n return !!getWebComponentConfiguration(locationOrJson);\n}\n"],"names":["CommandName","allowedWebpackDevServerOptions","getConfiguration","getConfigurationSafe","getESLintConfiguration","getJestConfiguration","getReviewConfiguration","getStylelintConfiguration","getSwcCompilePackageConfiguration","getWebComponentBranchConfigs","getWebComponentConfiguration","getWebpackConfiguration","hasHeadlessBundle","isBundle","isCustomStyleRules","isDevServerDisabled","isExposeSharedDependencies","isLegacy","isLegacyRoot","isStyleCheckDisabled","isWebComponent","locationOrJson","json","readJson","path","join","cli","readJsonSafe","lint","eslint","test","review","stylelint","webpack","config","configPath","resolve","fs","existsSync","require","log","warning","undefined","branches","source","getFolders","headlessPath","webpackConfiguration","devServer","legacy","legacyRoot"],"mappings":";;;;;;;;;;;QA4DYA;eAAAA;;QA/CCC;eAAAA;;QAkGGC;eAAAA;;QAQAC;eAAAA;;QAQAC;eAAAA;;QAIAC;eAAAA;;QAIAC;eAAAA;;QAIAC;eAAAA;;QAoDAC;eAAAA;;QAjBAC;eAAAA;;QA1BAC;eAAAA;;QALAC;eAAAA;;QAqCAC;eAAAA;;QAeAC;eAAAA;;QAIAC;eAAAA;;QAIAC;eAAAA;;QAKAC;eAAAA;;QAIAC;eAAAA;;QAIAC;eAAAA;;QAIAC;eAAAA;;QAIAC;eAAAA;;;2DA7ND;6DACE;qBAKG;4BACO;0BACY;;;;;;AAEhC,MAAMnB,iCAAiC;IAAC;IAAW;IAAQ;IAAS;CAAS;AA+C7E,IAAA,AAAKD,qCAAAA;;;;;;;;;;;;;;;;;;;;WAAAA;;AAmDL,SAASE,iBAAiBmB,iBAAiC,IAAI;IAClE,MAAMC,OACF,OAAOD,mBAAmB,WACpBE,IAAAA,kBAAQ,EAACC,aAAI,CAACC,IAAI,CAACJ,gBAAgB,mBACnCA;QACHC;IAAP,OAAOA,CAAAA,YAAAA,iBAAAA,2BAAAA,KAAMI,GAAG,cAATJ,uBAAAA,YAAa,CAAC;AACzB;AAEO,SAASnB,qBA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ts"],"sourcesContent":["import { Config } from '@jest/types';\nimport { swcDir } from '@swc/cli';\nimport { ESLint } from 'eslint';\nimport fs from 'fs';\nimport path from 'path';\nimport { LinterOptions } from 'stylelint';\nimport { ViteUserConfig } from 'vitest/config';\nimport { Configuration as WebpackDevServerConfiguration } from 'webpack-dev-server';\n\nimport { ReviewConfiguration } from '../cli/commands/review';\nimport { log } from './log';\nimport { getFolders } from './get-folders';\nimport { readJson, readJsonSafe } from './read-json';\n\nexport const allowedWebpackDevServerOptions = ['headers', 'port', 'proxy', 'static'] as const;\n\ntype ElementType<T> = T extends readonly (infer ElementType)[] ? ElementType : never;\n\nexport interface MinifyJSOptions {\n compress?: boolean;\n mangle?: boolean;\n}\n\nexport interface MinifyCssOptions {}\n\nexport interface MinifyOptions {\n css?: boolean | MinifyCssOptions;\n js?: boolean | MinifyJSOptions;\n}\n\nexport interface WebpackConfiguration\n extends Omit<\n Pick<WebpackDevServerConfiguration, ElementType<typeof allowedWebpackDevServerOptions>>,\n 'proxy'\n > {\n 'contentBase'?: boolean | string | string[] | number; // deprecated 2024-07\n 'custom-style-rules'?: boolean;\n 'expose-shared-dependencies'?: boolean;\n 'devServer'?: false | WebpackDevServerConfiguration;\n 'disable-style-check'?: boolean;\n 'minify'?: MinifyOptions;\n 'proxy'?: WebpackDevServerConfiguration['proxy'] | string;\n}\n\nexport interface ESLintConfiguration extends ESLint.Options {\n disabled?: boolean;\n}\n\nexport interface StylelintConfiguration extends Partial<LinterOptions> {\n ignorePattern?: string[];\n disabled?: boolean;\n}\n\nexport type JestConfiguration = Omit<Config.Argv, '_' | '$0'>;\n\nexport interface NodeConfiguration {\n // eslint-disable-next-line @typescript-eslint/naming-convention\n NODE_OPTIONS?: string[];\n}\n\n/* eslint-disable @typescript-eslint/naming-convention */\nexport enum CommandName {\n 'build' = 'build',\n 'bundle-package' = 'bundle-package',\n 'clean' = 'clean',\n 'convert-eslint-config' = 'convert-eslint-config',\n 'eslint' = 'eslint',\n 'init' = 'init',\n 'install' = 'install',\n 'kendo-ui-license' = 'kendo-ui-license',\n 'lint' = 'lint',\n 'mfe-package-clean' = 'mfe-package-clean',\n 'mfe-package-publish' = 'mfe-package-publish',\n 'mfe-publish' = 'mfe-publish',\n 'prepare-package' = 'prepare-package',\n 'review' = 'review',\n 'start' = 'start',\n 'styles-check' = 'styles-check',\n 'test' = 'test',\n 'task' = 'task',\n 'upload-sourcemaps' = 'upload-sourcemaps',\n}\n/* eslint-enable @typescript-eslint/naming-convention */\n\nexport type VitestConfiguration = ViteUserConfig['test'];\n\nexport interface WebComponentBranchConfigs {\n publishTag?: string;\n uploadSourcemaps?: boolean;\n}\n\ninterface WebComponentOptions {\n legacyRoot?: boolean;\n /**\n * mapping of git branches to configs.\n * Used to separate configs (ex publish tag) depending on current branch\n */\n branches?: Record<string, WebComponentBranchConfigs>;\n}\n\ntype Configuration = {\n 'jest'?: JestConfiguration;\n 'legacy'?: boolean;\n 'lint'?: { eslint: ESLintConfiguration; stylelint: StylelintConfiguration };\n 'review'?: ReviewConfiguration;\n 'swc-compile-package'?: Parameters<typeof swcDir>[0];\n 'test'?: JestConfiguration; // for backward-compatibility\n 'testRunner'?: string;\n 'vitest'?: VitestConfiguration;\n 'web-component'?: boolean | string | WebComponentOptions;\n 'webpack'?: false | WebpackConfiguration;\n} & {\n [key in CommandName]?: NodeConfiguration;\n} & NodeConfiguration;\n\ntype LocationOrJson = string | Record<string, any>;\n\nexport function getConfiguration(locationOrJson: LocationOrJson = './'): Configuration {\n const json =\n typeof locationOrJson === 'string'\n ? readJson(path.join(locationOrJson, 'package.json'))\n : locationOrJson;\n return json?.cli ?? {};\n}\n\nexport function getConfigurationSafe(locationOrJson: LocationOrJson = './'): Configuration {\n const json =\n typeof locationOrJson === 'string'\n ? readJsonSafe(path.join(locationOrJson, 'package.json'))\n : locationOrJson;\n return json?.cli ?? {};\n}\n\nexport function getESLintConfiguration() {\n return getConfiguration().lint?.eslint ?? {};\n}\n\nexport function getJestConfiguration() {\n const configuration = getConfiguration();\n return configuration.jest ?? configuration.test ?? {};\n}\n\nexport function getReviewConfiguration() {\n return getConfiguration().review ?? {};\n}\n\nexport function getStylelintConfiguration() {\n return getConfiguration().lint?.stylelint ?? {};\n}\n\nexport function getVitestConfiguration() {\n return getConfiguration().vitest ?? {};\n}\n\nexport function getWebpackConfiguration(locationOrJson?: LocationOrJson) {\n const { webpack } = getConfiguration(locationOrJson);\n return typeof webpack === 'object' ? webpack : {};\n}\n\nexport function getWebComponentConfiguration(\n locationOrJson: LocationOrJson = './'\n): WebComponentOptions | undefined {\n const config = getConfigurationSafe(locationOrJson)['web-component'];\n\n if (config === true) {\n return {};\n }\n\n if (typeof config === 'object') {\n return config;\n }\n\n if (typeof config === 'string') {\n const configPath = path.resolve(\n typeof locationOrJson === 'string' ? path.join(locationOrJson, config) : config\n );\n if (fs.existsSync(configPath)) {\n return require(path.resolve(configPath));\n }\n log.warning(`could not find web-component configuration: \"${config}\"`);\n\n return undefined;\n }\n}\n\nexport function getWebComponentBranchConfigs(locationOrJson: LocationOrJson = './') {\n const config = getWebComponentConfiguration(locationOrJson);\n\n return config?.branches;\n}\n\nexport function hasHeadlessBundle() {\n let source: string;\n try {\n source = getFolders().source;\n } catch {\n return false;\n }\n const headlessPath = path.join(source, 'headless.ts');\n return fs.existsSync(headlessPath);\n}\n\nexport function getSwcCompilePackageConfiguration() {\n return getConfiguration()['swc-compile-package'] ?? {};\n}\n\nexport function isBundle(locationOrJson?: LocationOrJson) {\n return getConfiguration(locationOrJson).webpack !== false;\n}\n\nexport function isCustomStyleRules() {\n return getWebpackConfiguration()['custom-style-rules'] === true;\n}\n\nexport function isDevServerDisabled() {\n const webpackConfiguration = getWebpackConfiguration();\n return webpackConfiguration.devServer === false;\n}\n\nexport function isExposeSharedDependencies() {\n return getWebpackConfiguration()['expose-shared-dependencies'] === true;\n}\n\nexport function isLegacy(locationOrJson?: LocationOrJson) {\n return getConfiguration(locationOrJson).legacy === true;\n}\n\nexport function isLegacyRoot() {\n return getWebComponentConfiguration()?.legacyRoot === true;\n}\n\nexport function isStyleCheckDisabled() {\n return getWebpackConfiguration()['disable-style-check'] === true;\n}\n\nexport function isWebComponent(locationOrJson: LocationOrJson = './') {\n return !!getWebComponentConfiguration(locationOrJson);\n}\n"],"names":["CommandName","allowedWebpackDevServerOptions","getConfiguration","getConfigurationSafe","getESLintConfiguration","getJestConfiguration","getReviewConfiguration","getStylelintConfiguration","getSwcCompilePackageConfiguration","getVitestConfiguration","getWebComponentBranchConfigs","getWebComponentConfiguration","getWebpackConfiguration","hasHeadlessBundle","isBundle","isCustomStyleRules","isDevServerDisabled","isExposeSharedDependencies","isLegacy","isLegacyRoot","isStyleCheckDisabled","isWebComponent","locationOrJson","json","readJson","path","join","cli","readJsonSafe","lint","eslint","configuration","jest","test","review","stylelint","vitest","webpack","config","configPath","resolve","fs","existsSync","require","log","warning","undefined","branches","source","getFolders","headlessPath","webpackConfiguration","devServer","legacy","legacyRoot"],"mappings":";;;;;;;;;;;QA6DYA;eAAAA;;QA/CCC;eAAAA;;QAuGGC;eAAAA;;QAQAC;eAAAA;;QAQAC;eAAAA;;QAIAC;eAAAA;;QAKAC;eAAAA;;QAIAC;eAAAA;;QAwDAC;eAAAA;;QApDAC;eAAAA;;QAmCAC;eAAAA;;QA1BAC;eAAAA;;QALAC;eAAAA;;QAqCAC;eAAAA;;QAeAC;eAAAA;;QAIAC;eAAAA;;QAIAC;eAAAA;;QAKAC;eAAAA;;QAIAC;eAAAA;;QAIAC;eAAAA;;QAIAC;eAAAA;;QAIAC;eAAAA;;;2DAxOD;6DACE;qBAMG;4BACO;0BACY;;;;;;AAEhC,MAAMpB,iCAAiC;IAAC;IAAW;IAAQ;IAAS;CAAS;AA+C7E,IAAA,AAAKD,qCAAAA;;;;;;;;;;;;;;;;;;;;WAAAA;;AAwDL,SAASE,iBAAiBoB,iBAAiC,IAAI;IAClE,MAAMC,OACF,OAAOD,mBAAmB,WACpBE,IAAAA,kBAAQ,EAACC,aA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AEO,SAASM,SAASI,cAA+B;IACpD,OAAOpB,iBAAiBoB,gBAAgB+B,MAAM,KAAK;AACvD;AAEO,SAASlC;QACLR;IAAP,OAAOA,EAAAA,gCAAAA,4CAAAA,oDAAAA,8BAAgC2C,UAAU,MAAK;AAC1D;AAEO,SAASlC;IACZ,OAAOR,yBAAyB,CAAC,sBAAsB,KAAK;AAChE;AAEO,SAASS,eAAeC,iBAAiC,IAAI;IAChE,OAAO,CAAC,CAACX,6BAA6BW;AAC1C"}
@@ -1,12 +1,6 @@
1
1
  import { Config } from '@jest/types';
2
- import { JestConfiguration } from './get-configuration';
3
- /**
4
- * Get Jest clean config for running tests. This config could be used to export Jest configuration into the
5
- * Jest config files.
6
- */
7
- export declare const getJestConfig: () => JestConfiguration;
8
2
  /**
9
3
  * Get Jest config for running it using jest CLI (see jest runCLI function)
10
4
  */
11
- export declare const getJestConfigCLI: (args: Config.Argv) => Config.Argv;
5
+ export declare function getJestConfigCLI(args: Config.Argv): Config.Argv;
12
6
  //# sourceMappingURL=get-jest-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-jest-config.d.ts","sourceRoot":"","sources":["../../src/utils/get-jest-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,iBAAiB,EAAwB,MAAM,qBAAqB,CAAC;AAqC9E;;;GAGG;AACH,eAAO,MAAM,aAAa,QAAO,iBAWhC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,gBAAgB,GAAI,MAAM,MAAM,CAAC,IAAI,KAAG,MAAM,CAAC,IAmB3D,CAAC"}
1
+ {"version":3,"file":"get-jest-config.d.ts","sourceRoot":"","sources":["../../src/utils/get-jest-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAwCrC;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,CAAC,IAAI,GAAG,MAAM,CAAC,IAAI,CAc/D"}
@@ -2,17 +2,9 @@
2
2
  Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
- function _export(target, all) {
6
- for(var name in all)Object.defineProperty(target, name, {
7
- enumerable: true,
8
- get: Object.getOwnPropertyDescriptor(all, name).get
9
- });
10
- }
11
- _export(exports, {
12
- get getJestConfig () {
13
- return getJestConfig;
14
- },
15
- get getJestConfigCLI () {
5
+ Object.defineProperty(exports, "getJestConfigCLI", {
6
+ enumerable: true,
7
+ get: function() {
16
8
  return getJestConfigCLI;
17
9
  }
18
10
  });
@@ -25,29 +17,13 @@ function _interop_require_default(obj) {
25
17
  default: obj
26
18
  };
27
19
  }
28
- const getJestConfigBase = ({ coveragePathIgnorePatterns = [], setupFiles = [], testPathIgnorePatterns = [] })=>{
20
+ function getDefaultJestConfiguration({ coveragePathIgnorePatterns = [], setupFiles = [], testPathIgnorePatterns = [] }) {
29
21
  const moduleNameMapper = {
30
- '\\.(css|scss|less|png|svg|jpg|jpeg|gif|woff|woff2|eot|ttf|otf)$': 'identity-obj-proxy'
22
+ '\\.(css|scss|less|png|svg|svg\\?\\w+|jpg|jpeg|gif|woff|woff2|eot|ttf|otf)$': 'identity-obj-proxy'
31
23
  };
32
24
  return {
33
- verbose: true,
34
- testEnvironment: 'jsdom',
35
- testRunner: 'jest-circus/runner',
36
- transformIgnorePatterns: [
37
- 'node_modules/(?!(@servicetitan|@react-hook|nanoid|axios)/)'
38
- ],
39
- modulePathIgnorePatterns: [
40
- '<rootDir>/.*/__mocks__'
41
- ],
42
- moduleNameMapper,
43
- testPathIgnorePatterns: [
44
- '\\.yalc',
45
- ...(0, _getdestinationfolders.getDestinationFolders)(),
46
- ...(0, _toarray.toArray)(testPathIgnorePatterns)
47
- ],
48
- setupFiles: [
49
- _path.default.join(__dirname, '../../jest/setup.js'),
50
- ...(0, _toarray.toArray)(setupFiles)
25
+ collectCoverageFrom: [
26
+ '**/*.{ts,tsx}'
51
27
  ],
52
28
  coveragePathIgnorePatterns: [
53
29
  '^.+\\.d\\.ts$',
@@ -60,40 +36,55 @@ const getJestConfigBase = ({ coveragePathIgnorePatterns = [], setupFiles = [], t
60
36
  'cobertura',
61
37
  'lcov'
62
38
  ],
63
- collectCoverageFrom: [
64
- '**/*.{ts,tsx}'
39
+ moduleNameMapper,
40
+ modulePathIgnorePatterns: [
41
+ '<rootDir>/.*/__mocks__'
42
+ ],
43
+ preset: _path.default.join(__dirname, '../../jest'),
44
+ setupFiles: [
45
+ _path.default.join(__dirname, '../../jest/setup.js'),
46
+ ...(0, _toarray.toArray)(setupFiles)
47
+ ],
48
+ testEnvironment: 'jsdom',
49
+ testPathIgnorePatterns: [
50
+ '\\.yalc',
51
+ ...(0, _getdestinationfolders.getDestinationFolders)(),
52
+ ...(0, _toarray.toArray)(testPathIgnorePatterns)
65
53
  ],
66
- preset: _path.default.join(__dirname, '../../jest')
54
+ testRunner: 'jest-circus/runner',
55
+ transformIgnorePatterns: [
56
+ 'node_modules/(?!(@servicetitan|@react-hook|nanoid|axios)/)'
57
+ ],
58
+ verbose: true
67
59
  };
68
- };
69
- const getJestConfig = ()=>{
70
- const { coveragePathIgnorePatterns, setupFiles, testPathIgnorePatterns, ...config } = (0, _getconfiguration.getJestConfiguration)();
71
- return {
72
- ...getJestConfigBase({
60
+ }
61
+ function getJestConfigCLI(args) {
62
+ const { coveragePathIgnorePatterns, setupFiles, testPathIgnorePatterns, ...config } = {
63
+ ...(0, _getconfiguration.getJestConfiguration)(),
64
+ ...args
65
+ };
66
+ return stringifyForCLI({
67
+ ...getDefaultJestConfiguration({
73
68
  coveragePathIgnorePatterns,
74
69
  setupFiles,
75
70
  testPathIgnorePatterns
76
71
  }),
77
72
  ...config
78
- };
79
- };
80
- const getJestConfigCLI = (args)=>{
81
- const { coveragePathIgnorePatterns, setupFiles, testPathIgnorePatterns, globals, ...config } = {
82
- ...(0, _getconfiguration.getJestConfiguration)(),
83
- ...args
84
- };
85
- const { collectCoverageFrom, moduleNameMapper, ...rest } = getJestConfigBase({
86
- coveragePathIgnorePatterns,
87
- setupFiles,
88
- testPathIgnorePatterns
89
73
  });
90
- return {
91
- collectCoverageFrom: JSON.stringify(collectCoverageFrom),
92
- globals: JSON.stringify(globals),
93
- moduleNameMapper: JSON.stringify(moduleNameMapper),
94
- ...rest,
95
- ...config
96
- };
97
- };
74
+ }
75
+ function stringifyForCLI(config) {
76
+ return [
77
+ 'collectCoverageFrom',
78
+ 'globals',
79
+ 'moduleNameMapper',
80
+ 'transform'
81
+ ].reduce((result, key)=>{
82
+ const value = result[key];
83
+ if (value && typeof value !== 'string') {
84
+ result[key] = JSON.stringify(result[key]);
85
+ }
86
+ return result;
87
+ }, config);
88
+ }
98
89
 
99
90
  //# sourceMappingURL=get-jest-config.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/get-jest-config.ts"],"sourcesContent":["import path from 'path';\nimport { Config } from '@jest/types';\nimport { JestConfiguration, getJestConfiguration } from './get-configuration';\nimport { getDestinationFolders } from './get-destination-folders';\nimport { toArray } from './to-array';\n\nconst getJestConfigBase = ({\n coveragePathIgnorePatterns = [],\n setupFiles = [],\n testPathIgnorePatterns = [],\n}: {\n coveragePathIgnorePatterns?: string[];\n setupFiles?: string[];\n testPathIgnorePatterns?: string[];\n}) => {\n const moduleNameMapper = {\n '\\\\.(css|scss|less|png|svg|jpg|jpeg|gif|woff|woff2|eot|ttf|otf)$': 'identity-obj-proxy',\n };\n\n return {\n verbose: true,\n testEnvironment: 'jsdom',\n testRunner: 'jest-circus/runner',\n transformIgnorePatterns: ['node_modules/(?!(@servicetitan|@react-hook|nanoid|axios)/)'],\n modulePathIgnorePatterns: ['<rootDir>/.*/__mocks__'],\n moduleNameMapper,\n testPathIgnorePatterns: [\n '\\\\.yalc',\n ...getDestinationFolders(),\n ...toArray(testPathIgnorePatterns),\n ],\n setupFiles: [path.join(__dirname, '../../jest/setup.js'), ...toArray(setupFiles)],\n coveragePathIgnorePatterns: ['^.+\\\\.d\\\\.ts$', ...coveragePathIgnorePatterns],\n coverageReporters: ['html-spa', 'text', 'json', 'cobertura', 'lcov'],\n collectCoverageFrom: ['**/*.{ts,tsx}'],\n preset: path.join(__dirname, '../../jest'),\n };\n};\n\n/**\n * Get Jest clean config for running tests. This config could be used to export Jest configuration into the\n * Jest config files.\n */\nexport const getJestConfig = (): JestConfiguration => {\n const { coveragePathIgnorePatterns, setupFiles, testPathIgnorePatterns, ...config } =\n getJestConfiguration() as Record<string, any>;\n return {\n ...getJestConfigBase({\n coveragePathIgnorePatterns,\n setupFiles,\n testPathIgnorePatterns,\n }),\n ...config,\n };\n};\n\n/**\n * Get Jest config for running it using jest CLI (see jest runCLI function)\n */\nexport const getJestConfigCLI = (args: Config.Argv): Config.Argv => {\n const { coveragePathIgnorePatterns, setupFiles, testPathIgnorePatterns, globals, ...config } = {\n ...getJestConfiguration(),\n ...args,\n };\n\n const { collectCoverageFrom, moduleNameMapper, ...rest } = getJestConfigBase({\n coveragePathIgnorePatterns,\n setupFiles,\n testPathIgnorePatterns,\n });\n\n return {\n collectCoverageFrom: JSON.stringify(collectCoverageFrom),\n globals: JSON.stringify(globals),\n moduleNameMapper: JSON.stringify(moduleNameMapper),\n ...rest,\n ...config,\n };\n};\n"],"names":["getJestConfig","getJestConfigCLI","getJestConfigBase","coveragePathIgnorePatterns","setupFiles","testPathIgnorePatterns","moduleNameMapper","verbose","testEnvironment","testRunner","transformIgnorePatterns","modulePathIgnorePatterns","getDestinationFolders","toArray","path","join","__dirname","coverageReporters","collectCoverageFrom","preset","config","getJestConfiguration","args","globals","rest","JSON","stringify"],"mappings":";;;;;;;;;;;QA2CaA;eAAAA;;QAgBAC;eAAAA;;;6DA3DI;kCAEuC;uCAClB;yBACd;;;;;;AAExB,MAAMC,oBAAoB,CAAC,EACvBC,6BAA6B,EAAE,EAC/BC,aAAa,EAAE,EACfC,yBAAyB,EAAE,EAK9B;IACG,MAAMC,mBAAmB;QACrB,mEAAmE;IACvE;IAEA,OAAO;QACHC,SAAS;QACTC,iBAAiB;QACjBC,YAAY;QACZC,yBAAyB;YAAC;SAA6D;QACvFC,0BAA0B;YAAC;SAAyB;QACpDL;QACAD,wBAAwB;YACpB;eACGO,IAAAA,4CAAqB;eACrBC,IAAAA,gBAAO,EAACR;SACd;QACDD,YAAY;YAACU,aAAI,CAACC,IAAI,CAACC,WAAW;eAA2BH,IAAAA,gBAAO,EAACT;SAAY;QACjFD,4BAA4B;YAAC;eAAoBA;SAA2B;QAC5Ec,mBAAmB;YAAC;YAAY;YAAQ;YAAQ;YAAa;SAAO;QACpEC,qBAAqB;YAAC;SAAgB;QACtCC,QAAQL,aAAI,CAACC,IAAI,CAACC,WAAW;IACjC;AACJ;AAMO,MAAMhB,gBAAgB;IACzB,MAAM,EAAEG,0BAA0B,EAAEC,UAAU,EAAEC,sBAAsB,EAAE,GAAGe,QAAQ,GAC/EC,IAAAA,sCAAoB;IACxB,OAAO;QACH,GAAGnB,kBAAkB;YACjBC;YACAC;YACAC;QACJ,EAAE;QACF,GAAGe,MAAM;IACb;AACJ;AAKO,MAAMnB,mBAAmB,CAACqB;IAC7B,MAAM,EAAEnB,0BAA0B,EAAEC,UAAU,EAAEC,sBAAsB,EAAEkB,OAAO,EAAE,GAAGH,QAAQ,GAAG;QAC3F,GAAGC,IAAAA,sCAAoB,GAAE;QACzB,GAAGC,IAAI;IACX;IAEA,MAAM,EAAEJ,mBAAmB,EAAEZ,gBAAgB,EAAE,GAAGkB,MAAM,GAAGtB,kBAAkB;QACzEC;QACAC;QACAC;IACJ;IAEA,OAAO;QACHa,qBAAqBO,KAAKC,SAAS,CAACR;QACpCK,SAASE,KAAKC,SAAS,CAACH;QACxBjB,kBAAkBmB,KAAKC,SAAS,CAACpB;QACjC,GAAGkB,IAAI;QACP,GAAGJ,MAAM;IACb;AACJ"}
1
+ {"version":3,"sources":["../../src/utils/get-jest-config.ts"],"sourcesContent":["import { Config } from '@jest/types';\nimport path from 'path';\nimport { getJestConfiguration } from './get-configuration';\nimport { getDestinationFolders } from './get-destination-folders';\nimport { toArray } from './to-array';\n\nfunction getDefaultJestConfiguration({\n coveragePathIgnorePatterns = [],\n setupFiles = [],\n testPathIgnorePatterns = [],\n}: {\n coveragePathIgnorePatterns?: string[];\n setupFiles?: string[];\n testPathIgnorePatterns?: string[];\n}) {\n const moduleNameMapper = {\n '\\\\.(css|scss|less|png|svg|svg\\\\?\\\\w+|jpg|jpeg|gif|woff|woff2|eot|ttf|otf)$':\n 'identity-obj-proxy',\n };\n\n return {\n collectCoverageFrom: ['**/*.{ts,tsx}'],\n coveragePathIgnorePatterns: ['^.+\\\\.d\\\\.ts$', ...coveragePathIgnorePatterns],\n coverageReporters: ['html-spa', 'text', 'json', 'cobertura', 'lcov'],\n moduleNameMapper,\n modulePathIgnorePatterns: ['<rootDir>/.*/__mocks__'],\n preset: path.join(__dirname, '../../jest'),\n setupFiles: [path.join(__dirname, '../../jest/setup.js'), ...toArray(setupFiles)],\n testEnvironment: 'jsdom',\n testPathIgnorePatterns: [\n '\\\\.yalc',\n ...getDestinationFolders(),\n ...toArray(testPathIgnorePatterns),\n ],\n testRunner: 'jest-circus/runner',\n transformIgnorePatterns: ['node_modules/(?!(@servicetitan|@react-hook|nanoid|axios)/)'],\n verbose: true,\n };\n}\n\n/**\n * Get Jest config for running it using jest CLI (see jest runCLI function)\n */\nexport function getJestConfigCLI(args: Config.Argv): Config.Argv {\n const { coveragePathIgnorePatterns, setupFiles, testPathIgnorePatterns, ...config } = {\n ...getJestConfiguration(),\n ...args,\n };\n\n return stringifyForCLI({\n ...getDefaultJestConfiguration({\n coveragePathIgnorePatterns,\n setupFiles,\n testPathIgnorePatterns,\n }),\n ...config,\n });\n}\n\nfunction stringifyForCLI(config: any): Config.Argv {\n return ['collectCoverageFrom', 'globals', 'moduleNameMapper', 'transform'].reduce(\n (result, key) => {\n const value = result[key];\n if (value && typeof value !== 'string') {\n result[key] = JSON.stringify(result[key]);\n }\n return result;\n },\n config\n );\n}\n"],"names":["getJestConfigCLI","getDefaultJestConfiguration","coveragePathIgnorePatterns","setupFiles","testPathIgnorePatterns","moduleNameMapper","collectCoverageFrom","coverageReporters","modulePathIgnorePatterns","preset","path","join","__dirname","toArray","testEnvironment","getDestinationFolders","testRunner","transformIgnorePatterns","verbose","args","config","getJestConfiguration","stringifyForCLI","reduce","result","key","value","JSON","stringify"],"mappings":";;;;+BA2CgBA;;;eAAAA;;;6DA1CC;kCACoB;uCACC;yBACd;;;;;;AAExB,SAASC,4BAA4B,EACjCC,6BAA6B,EAAE,EAC/BC,aAAa,EAAE,EACfC,yBAAyB,EAAE,EAK9B;IACG,MAAMC,mBAAmB;QACrB,8EACI;IACR;IAEA,OAAO;QACHC,qBAAqB;YAAC;SAAgB;QACtCJ,4BAA4B;YAAC;eAAoBA;SAA2B;QAC5EK,mBAAmB;YAAC;YAAY;YAAQ;YAAQ;YAAa;SAAO;QACpEF;QACAG,0BAA0B;YAAC;SAAyB;QACpDC,QAAQC,aAAI,CAACC,IAAI,CAACC,WAAW;QAC7BT,YAAY;YAACO,aAAI,CAACC,IAAI,CAACC,WAAW;eAA2BC,IAAAA,gBAAO,EAACV;SAAY;QACjFW,iBAAiB;QACjBV,wBAAwB;YACpB;eACGW,IAAAA,4CAAqB;eACrBF,IAAAA,gBAAO,EAACT;SACd;QACDY,YAAY;QACZC,yBAAyB;YAAC;SAA6D;QACvFC,SAAS;IACb;AACJ;AAKO,SAASlB,iBAAiBmB,IAAiB;IAC9C,MAAM,EAAEjB,0BAA0B,EAAEC,UAAU,EAAEC,sBAAsB,EAAE,GAAGgB,QAAQ,GAAG;QAClF,GAAGC,IAAAA,sCAAoB,GAAE;QACzB,GAAGF,IAAI;IACX;IAEA,OAAOG,gBAAgB;QACnB,GAAGrB,4BAA4B;YAC3BC;YACAC;YACAC;QACJ,EAAE;QACF,GAAGgB,MAAM;IACb;AACJ;AAEA,SAASE,gBAAgBF,MAAW;IAChC,OAAO;QAAC;QAAuB;QAAW;QAAoB;KAAY,CAACG,MAAM,CAC7E,CAACC,QAAQC;QACL,MAAMC,QAAQF,MAAM,CAACC,IAAI;QACzB,IAAIC,SAAS,OAAOA,UAAU,UAAU;YACpCF,MAAM,CAACC,IAAI,GAAGE,KAAKC,SAAS,CAACJ,MAAM,CAACC,IAAI;QAC5C;QACA,OAAOD;IACX,GACAJ;AAER"}
@@ -51,8 +51,7 @@ function getContext({ configuration = {} }, options) {
51
51
  const packageData = (0, _utils1.getPackageData)();
52
52
  const sharedDependencies = (0, _utils1.loadSharedDependencies)(packageData.dependencies, packageData.sharedDependencies);
53
53
  const args = _yargs.argv;
54
- var _options_emitExposedDependencies;
55
- const emitExposedDependencies = (_options_emitExposedDependencies = options.emitExposedDependencies) !== null && _options_emitExposedDependencies !== void 0 ? _options_emitExposedDependencies : !!args['exposed-dependencies'];
54
+ const emitExposedDependencies = options.emitExposedDependencies;
56
55
  var _options_codeCoverage;
57
56
  return {
58
57
  codeCoverage: (_options_codeCoverage = options.codeCoverage) !== null && _options_codeCoverage !== void 0 ? _options_codeCoverage : !!args['code-coverage'],
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/webpack/create-webpack-config.ts"],"sourcesContent":["import { Configuration } from 'webpack';\nimport { merge } from 'webpack-merge';\nimport { argv, Arguments } from 'yargs';\n\nimport { webpackDevConfigFileName, webpackProdConfigFileName } from '../cli/utils';\nimport {\n getFolders,\n getPackageData,\n getWebpackConfiguration,\n isCustomStyleRules,\n isExposeSharedDependencies,\n isLegacyRoot,\n isWebComponent,\n loadSharedDependencies,\n log,\n} from '../utils';\nimport {\n Context,\n amdConfig,\n cacheConfig,\n devServerConfig,\n devtoolConfig,\n entryConfig,\n externalsConfig,\n moduleConfig,\n optimizationConfig,\n outputConfig,\n pluginsConfig,\n resolveConfig,\n statsConfig,\n watchOptionsConfig,\n} from './configs';\nimport { Options, Overrides } from './types';\nimport { getCallerFile, stringifyConfig } from './utils';\n\nexport function createWebpackConfig(overrides: Overrides, options: Options = {}): Configuration {\n const context = getContext(overrides, options);\n if (context.isWebComponent && isCalledFromCustomWebpackConfigFile()) {\n throw new Error(WEB_COMPONENT_CONFIG_ERROR);\n }\n\n if (options.emitExposedDependencies && !context.isExposeSharedDependencies) {\n throw new Error('package does not expose shared dependencies');\n }\n\n const configs = [\n amdConfig,\n cacheConfig,\n devServerConfig,\n devtoolConfig,\n entryConfig,\n externalsConfig,\n moduleConfig,\n optimizationConfig,\n outputConfig,\n pluginsConfig,\n resolveConfig,\n statsConfig,\n watchOptionsConfig,\n ];\n\n const result = merge(\n configs.reduce((result, fn) => ({ ...result, ...fn(context, overrides) }), {}),\n overrides.configuration ?? {}\n );\n\n /* istanbul ignore next: debug only */\n log.debug('create-webpack-config', () => stringifyConfig(result));\n\n return result;\n}\n\nfunction getContext({ configuration = {} }: Overrides, options: Options): Context {\n const { source, destination } = getFolders();\n const { minify } = getWebpackConfiguration();\n const packageData = getPackageData();\n const sharedDependencies = loadSharedDependencies(\n packageData.dependencies,\n packageData.sharedDependencies\n );\n\n const args = argv as Arguments;\n const emitExposedDependencies =\n options.emitExposedDependencies ?? !!args['exposed-dependencies'];\n\n return {\n codeCoverage: options.codeCoverage ?? !!args['code-coverage'],\n destination,\n emitExposedDependencies,\n isCustomStyleRules: !emitExposedDependencies && isCustomStyleRules(),\n isExposeSharedDependencies: isExposeSharedDependencies(),\n isLegacyRoot: isLegacyRoot(),\n isProduction: configuration.mode === 'production',\n isWebComponent: isWebComponent(),\n minify,\n name: '',\n ...options,\n packageData,\n sharedDependencies,\n source,\n };\n}\n\nfunction isCalledFromCustomWebpackConfigFile() {\n const callerFileName = getCallerFile();\n return [webpackDevConfigFileName, webpackProdConfigFileName].some(configFileName =>\n callerFileName.includes(configFileName)\n );\n}\n\nconst WEB_COMPONENT_CONFIG_ERROR = `\n You cannot call createWebpackConfig in a custom webpack config file in a web component (MFE) project.\n Export webpack configuration itself as a default export from the config file instead.\n`\n .replace(/\\n\\s*/g, ' ')\n .trim();\n"],"names":["createWebpackConfig","overrides","options","context","getContext","isWebComponent","isCalledFromCustomWebpackConfigFile","Error","WEB_COMPONENT_CONFIG_ERROR","emitExposedDependencies","isExposeSharedDependencies","configs","amdConfig","cacheConfig","devServerConfig","devtoolConfig","entryConfig","externalsConfig","moduleConfig","optimizationConfig","outputConfig","pluginsConfig","resolveConfig","statsConfig","watchOptionsConfig","result","merge","reduce","fn","configuration","log","debug","stringifyConfig","source","destination","getFolders","minify","getWebpackConfiguration","packageData","getPackageData","sharedDependencies","loadSharedDependencies","dependencies","args","argv","codeCoverage","isCustomStyleRules","isLegacyRoot","isProduction","mode","name","callerFileName","getCallerFile","webpackDevConfigFileName","webpackProdConfigFileName","some","configFileName","includes","replace","trim"],"mappings":";;;;+BAmCgBA;;;eAAAA;;;8BAlCM;uBACU;uBAEoC;wBAW7D;yBAgBA;wBAEwC;AAExC,SAASA,oBAAoBC,SAAoB,EAAEC,UAAmB,CAAC,CAAC;IAC3E,MAAMC,UAAUC,WAAWH,WAAWC;IACtC,IAAIC,QAAQE,cAAc,IAAIC,uCAAuC;QACjE,MAAM,IAAIC,MAAMC;IACpB;IAEA,IAAIN,QAAQO,uBAAuB,IAAI,CAACN,QAAQO,0BAA0B,EAAE;QACxE,MAAM,IAAIH,MAAM;IACpB;IAEA,MAAMI,UAAU;QACZC,kBAAS;QACTC,oBAAW;QACXC,wBAAe;QACfC,sBAAa;QACbC,oBAAW;QACXC,wBAAe;QACfC,qBAAY;QACZC,2BAAkB;QAClBC,qBAAY;QACZC,sBAAa;QACbC,sBAAa;QACbC,oBAAW;QACXC,2BAAkB;KACrB;QAIGvB;IAFJ,MAAMwB,SAASC,IAAAA,mBAAK,EAChBf,QAAQgB,MAAM,CAAC,CAACF,QAAQG,KAAQ,CAAA;YAAE,GAAGH,MAAM;YAAE,GAAGG,GAAGzB,SAASF,UAAU;QAAC,CAAA,GAAI,CAAC,IAC5EA,CAAAA,2BAAAA,UAAU4B,aAAa,cAAvB5B,sCAAAA,2BAA2B,CAAC;IAGhC,oCAAo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.ts"],"sourcesContent":["import { Configuration } from 'webpack';\nimport { merge } from 'webpack-merge';\nimport { argv, Arguments } from 'yargs';\n\nimport { webpackDevConfigFileName, webpackProdConfigFileName } from '../cli/utils';\nimport {\n getFolders,\n getPackageData,\n getWebpackConfiguration,\n isCustomStyleRules,\n isExposeSharedDependencies,\n isLegacyRoot,\n isWebComponent,\n loadSharedDependencies,\n log,\n} from '../utils';\nimport {\n Context,\n amdConfig,\n cacheConfig,\n devServerConfig,\n devtoolConfig,\n entryConfig,\n externalsConfig,\n moduleConfig,\n optimizationConfig,\n outputConfig,\n pluginsConfig,\n resolveConfig,\n statsConfig,\n watchOptionsConfig,\n} from './configs';\nimport { Options, Overrides } from './types';\nimport { getCallerFile, stringifyConfig } from './utils';\n\nexport function createWebpackConfig(overrides: Overrides, options: Options = {}): Configuration {\n const context = getContext(overrides, options);\n if (context.isWebComponent && isCalledFromCustomWebpackConfigFile()) {\n throw new Error(WEB_COMPONENT_CONFIG_ERROR);\n }\n\n if (options.emitExposedDependencies && !context.isExposeSharedDependencies) {\n throw new Error('package does not expose shared dependencies');\n }\n\n const configs = [\n amdConfig,\n cacheConfig,\n devServerConfig,\n devtoolConfig,\n entryConfig,\n externalsConfig,\n moduleConfig,\n optimizationConfig,\n outputConfig,\n pluginsConfig,\n resolveConfig,\n statsConfig,\n watchOptionsConfig,\n ];\n\n const result = merge(\n configs.reduce((result, fn) => ({ ...result, ...fn(context, overrides) }), {}),\n overrides.configuration ?? {}\n );\n\n /* istanbul ignore next: debug only */\n log.debug('create-webpack-config', () => stringifyConfig(result));\n\n return result;\n}\n\nfunction getContext({ configuration = {} }: Overrides, options: Options): Context {\n const { source, destination } = getFolders();\n const { minify } = getWebpackConfiguration();\n const packageData = getPackageData();\n const sharedDependencies = loadSharedDependencies(\n packageData.dependencies,\n packageData.sharedDependencies\n );\n\n const args = argv as Arguments;\n const emitExposedDependencies = options.emitExposedDependencies;\n\n return {\n codeCoverage: options.codeCoverage ?? !!args['code-coverage'],\n destination,\n emitExposedDependencies,\n isCustomStyleRules: !emitExposedDependencies && isCustomStyleRules(),\n isExposeSharedDependencies: isExposeSharedDependencies(),\n isLegacyRoot: isLegacyRoot(),\n isProduction: configuration.mode === 'production',\n isWebComponent: isWebComponent(),\n minify,\n name: '',\n ...options,\n packageData,\n sharedDependencies,\n source,\n };\n}\n\nfunction isCalledFromCustomWebpackConfigFile() {\n const callerFileName = getCallerFile();\n return [webpackDevConfigFileName, webpackProdConfigFileName].some(configFileName =>\n callerFileName.includes(configFileName)\n );\n}\n\nconst WEB_COMPONENT_CONFIG_ERROR = `\n You cannot call createWebpackConfig in a custom webpack config file in a web component (MFE) project.\n Export webpack configuration itself as a default export from the config file instead.\n`\n .replace(/\\n\\s*/g, ' ')\n .trim();\n"],"names":["createWebpackConfig","overrides","options","context","getContext","isWebComponent","isCalledFromCustomWebpackConfigFile","Error","WEB_COMPONENT_CONFIG_ERROR","emitExposedDependencies","isExposeSharedDependencies","configs","amdConfig","cacheConfig","devServerConfig","devtoolConfig","entryConfig","externalsConfig","moduleConfig","optimizationConfig","outputConfig","pluginsConfig","resolveConfig","statsConfig","watchOptionsConfig","result","merge","reduce","fn","configuration","log","debug","stringifyConfig","source","destination","getFolders","minify","getWebpackConfiguration","packageData","getPackageData","sharedDependencies","loadSharedDependencies","dependencies","args","argv","codeCoverage","isCustomStyleRules","isLegacyRoot","isProduction","mode","name","callerFileName","getCallerFile","webpackDevConfigFileName","webpackProdConfigFileName","some","configFileName","includes","replace","trim"],"mappings":";;;;+BAmCgBA;;;eAAAA;;;8BAlCM;uBACU;uBAEoC;wBAW7D;yBAgBA;wBAEwC;AAExC,SAASA,oBAAoBC,SAAoB,EAAEC,UAAmB,CAAC,CAAC;IAC3E,MAAMC,UAAUC,WAAWH,WAAWC;IACtC,IAAIC,QAAQE,cAAc,IAAIC,uCAAuC;QACjE,MAAM,IAAIC,MAAMC;IACpB;IAEA,IAAIN,QAAQO,uBAAuB,IAAI,CAACN,QAAQO,0BAA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BC,cAAcnB,cAAcoB,IAAI,KAAK;QACrC5C,gBAAgBA,IAAAA,sBAAc;QAC9B+B;QACAc,MAAM;QACN,GAAGhD,OAAO;QACVoC;QACAE;QACAP;IACJ;AACJ;AAEA,SAAS3B;IACL,MAAM6C,iBAAiBC,IAAAA,qBAAa;IACpC,OAAO;QAACC,+BAAwB;QAAEC,gCAAyB;KAAC,CAACC,IAAI,CAACC,CAAAA,iBAC9DL,eAAeM,QAAQ,CAACD;AAEhC;AAEA,MAAMhD,6BAA6B,CAAC;;;AAGpC,CAAC,CACIkD,OAAO,CAAC,UAAU,KAClBC,IAAI"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/webpack/utils/testing/get-compiler.ts"],"sourcesContent":["import path from 'path';\n\nimport webpack, { Configuration } from 'webpack';\nimport { merge } from 'webpack-merge';\n\nimport { createFsFromVolume, Volume } from 'memfs';\n\nexport function getCompilerFactory(cwd: string) {\n return function getCompiler(entry: string, loaderOptions = {}, config: Configuration = {}) {\n const compiler = webpack(\n merge(\n {\n mode: 'development',\n devtool: config.devtool ?? false,\n context: path.resolve(cwd, './__tests__/__mocks__'),\n entry: path.resolve(cwd, './__tests__/__mocks__', entry),\n output: {\n path: path.resolve(cwd, './__tests__/dist'),\n filename: '[name].bundle.js',\n chunkFilename: '[name].chunk.js',\n },\n module: {\n rules: [\n {\n test: new RegExp(`\\\\.${path.basename(cwd)}\\\\.\\\\w+$`, 'i'),\n rules: [\n {\n loader: require.resolve(cwd),\n options: loaderOptions,\n },\n ],\n },\n ],\n },\n plugins: [],\n },\n config\n )\n );\n\n compiler.outputFileSystem = createFsFromVolume(new Volume()) as any;\n\n return compiler;\n };\n}\n"],"names":["getCompilerFactory","cwd","getCompiler","entry","loaderOptions","config","compiler","webpack","merge","mode","devtool","context","path","resolve","output","filename","chunkFilename","module","rules","test","RegExp","basename","loader","require","options","plugins","outputFileSystem","createFsFromVolume","Volume"],"mappings":";;;;+BAOgBA;;;eAAAA;;;6DAPC;gEAEsB;8BACjB;uBAEqB;;;;;;AAEpC,SAASA,mBAAmBC,GAAW;IAC1C,OAAO,SAASC,YAAYC,KAAa,EAAEC,gBAAgB,CAAC,CAAC,EAAEC,SAAwB,CAAC,CAAC;YAKhEA;QAJrB,MAAMC,WAAWC,IAAAA,gBAAO,EACpBC,IAAAA,mBAAK,EACD;YACIC,MAAM;YACNC,SAASL,CAAAA,kBAAAA,OAAOK,OAAO,cAAdL,6BAAAA,kBAAkB;YAC3BM,SAASC,aAAI,CAACC,OAAO,CAACZ,KAAK;YAC3BE,OAAOS,aAAI,CAACC,OAAO,CAACZ,KAAK,yBAAyBE;YAClDW,QAAQ;gBACJF,MAAMA,aAAI,CAACC,OAAO,CAACZ,KAAK;gBACxBc,UAAU;gBACVC,eAAe;YACnB;YACAC,QAAQ;gBACJC,OAAO;oBACH;wBACIC,MAAM,IAAIC,OAAO,CAAC,GAAG,EAAER,aAAI,CAACS,QAAQ,CAACpB,KAAK,QAAQ,CAAC,EAAE;wBACrDiB,OAAO;4BACH;gCACII,QAAQC,QAAQV,OAAO,CAACZ;gCACxBuB,SAASpB;4BACb;yBACH;oBACL;iBACH;YACL;YACAqB,SAAS,EAAE;QACf,GACApB;QAIRC,SAASoB,gBAAgB,GAAGC,IAAAA,yBAAkB,EAAC,IAAIC,aAAM;QAEzD,OAAOtB;IACX;AACJ"}
1
+ {"version":3,"sources":["../../../../src/webpack/utils/testing/get-compiler.ts"],"sourcesContent":["import path from 'path';\n\nimport webpack, { Configuration } from 'webpack';\nimport { merge } from 'webpack-merge';\n\nimport { createFsFromVolume, Volume } from 'memfs';\n\nexport function getCompilerFactory(cwd: string) {\n return function getCompiler(entry: string, loaderOptions = {}, config: Configuration = {}) {\n const compiler = webpack(\n merge(\n {\n mode: 'development',\n devtool: config.devtool ?? false,\n context: path.resolve(cwd, './__tests__/__mocks__'),\n entry: path.resolve(cwd, './__tests__/__mocks__', entry),\n output: {\n path: path.resolve(cwd, './__tests__/dist'),\n filename: '[name].bundle.js',\n chunkFilename: '[name].chunk.js',\n },\n module: {\n rules: [\n {\n test: new RegExp(`\\\\.${path.basename(cwd)}\\\\.\\\\w+$`, 'i'),\n rules: [\n {\n loader: require.resolve(cwd),\n options: loaderOptions,\n },\n ],\n },\n ],\n },\n plugins: [],\n },\n config\n )\n )!;\n\n compiler.outputFileSystem = createFsFromVolume(new Volume()) as any;\n\n return compiler;\n };\n}\n"],"names":["getCompilerFactory","cwd","getCompiler","entry","loaderOptions","config","compiler","webpack","merge","mode","devtool","context","path","resolve","output","filename","chunkFilename","module","rules","test","RegExp","basename","loader","require","options","plugins","outputFileSystem","createFsFromVolume","Volume"],"mappings":";;;;+BAOgBA;;;eAAAA;;;6DAPC;gEAEsB;8BACjB;uBAEqB;;;;;;AAEpC,SAASA,mBAAmBC,GAAW;IAC1C,OAAO,SAASC,YAAYC,KAAa,EAAEC,gBAAgB,CAAC,CAAC,EAAEC,SAAwB,CAAC,CAAC;YAKhEA;QAJrB,MAAMC,WAAWC,IAAAA,gBAAO,EACpBC,IAAAA,mBAAK,EACD;YACIC,MAAM;YACNC,SAASL,CAAAA,kBAAAA,OAAOK,OAAO,cAAdL,6BAAAA,kBAAkB;YAC3BM,SAASC,aAAI,CAACC,OAAO,CAACZ,KAAK;YAC3BE,OAAOS,aAAI,CAACC,OAAO,CAACZ,KAAK,yBAAyBE;YAClDW,QAAQ;gBACJF,MAAMA,aAAI,CAACC,OAAO,CAACZ,KAAK;gBACxBc,UAAU;gBACVC,eAAe;YACnB;YACAC,QAAQ;gBACJC,OAAO;oBACH;wBACIC,MAAM,IAAIC,OAAO,CAAC,GAAG,EAAER,aAAI,CAACS,QAAQ,CAACpB,KAAK,QAAQ,CAAC,EAAE;wBACrDiB,OAAO;4BACH;gCACII,QAAQC,QAAQV,OAAO,CAACZ;gCACxBuB,SAASpB;4BACb;yBACH;oBACL;iBACH;YACL;YACAqB,SAAS,EAAE;QACf,GACApB;QAIRC,SAASoB,gBAAgB,GAAGC,IAAAA,yBAAkB,EAAC,IAAIC,aAAM;QAEzD,OAAOtB;IACX;AACJ"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@servicetitan/startup",
3
- "version": "31.5.0",
3
+ "version": "31.6.0",
4
4
  "description": "",
5
5
  "homepage": "https://docs.st.dev/docs/frontend/startup",
6
6
  "repository": {
@@ -33,17 +33,18 @@
33
33
  "@types/yargs": "~17.0.24"
34
34
  },
35
35
  "dependencies": {
36
- "@babel/preset-env": "~7.28.0",
36
+ "@babel/preset-env": "~7.28.3",
37
37
  "@jest/core": "~29.7.0",
38
38
  "@jest/types": "~29.6.3",
39
39
  "@jsdevtools/coverage-istanbul-loader": "^3.0.5",
40
- "@servicetitan/eslint-config": "31.5.0",
41
- "@servicetitan/stylelint-config": "31.5.0",
40
+ "@servicetitan/eslint-config": "31.6.0",
41
+ "@servicetitan/stylelint-config": "31.6.0",
42
42
  "@svgr/webpack": "^8.1.0",
43
43
  "@swc/cli": "^0.5.0",
44
- "@swc/core": "1.13.3",
44
+ "@swc/core": "1.13.5",
45
45
  "@types/debug": "^4.1.12",
46
46
  "@types/jest": "~29.5.12",
47
+ "@vitest/coverage-v8": "^3.2.4",
47
48
  "chalk": "~4.1.2",
48
49
  "cpx2": "8.0.0",
49
50
  "css-loader": "~7.1.2",
@@ -51,10 +52,10 @@
51
52
  "debounce": "^2.2.0",
52
53
  "debug": "^4.4.1",
53
54
  "deepmerge": "~4.3.1",
54
- "eslint": "~9.33.0",
55
+ "eslint": "~9.35.0",
55
56
  "execa": "~5.1.1",
56
57
  "glob": "~11.0.3",
57
- "html-webpack-plugin": "~5.6.3",
58
+ "html-webpack-plugin": "~5.6.4",
58
59
  "html-webpack-tags-plugin": "^3.0.2",
59
60
  "identity-obj-proxy": "~3.0.0",
60
61
  "jest": "~29.7.0",
@@ -62,31 +63,32 @@
62
63
  "jest-environment-jsdom": "^29.7.0",
63
64
  "jest-fetch-mock": "~3.0.3",
64
65
  "json5": "^2.2.3",
65
- "lerna": "~8.2.3",
66
- "less": "~4.4.0",
66
+ "lerna": "~8.2.4",
67
+ "less": "~4.4.1",
67
68
  "less-loader": "~12.3.0",
68
69
  "less-plugin-npm-import": "~2.1.0",
69
70
  "lodash.memoize": "^4.1.2",
70
- "memfs": "~4.36.0",
71
+ "memfs": "~4.38.2",
71
72
  "mini-css-extract-plugin": "~2.9.4",
72
73
  "moment-locales-webpack-plugin": "~1.2.0",
73
74
  "multimatch": "~5.0.0",
74
75
  "portfinder": "~1.0.37",
75
76
  "postcss": "~8.5.6",
76
77
  "prettier": "~3.6.2",
77
- "sass": "~1.90.0",
78
+ "sass": "~1.92.1",
78
79
  "sass-loader": "~16.0.5",
79
80
  "semver": "~7.7.2",
80
81
  "source-map-loader": "~5.0.0",
81
82
  "style-loader": "~4.0.0",
82
- "stylelint": "~16.23.1",
83
+ "stylelint": "~16.24.0",
83
84
  "terminal-link": "^4.0.0",
84
85
  "terser-webpack-plugin": "^5.3.14",
85
86
  "ts-jest": "29.4.1",
86
87
  "ts-node": "~10.9.2",
87
88
  "typed-css-modules": "~0.9.1",
88
89
  "typescript": "5.9.2",
89
- "webpack": "~5.99.9",
90
+ "vitest": "^3.2.4",
91
+ "webpack": "~5.101.3",
90
92
  "webpack-assets-manifest": "~6.2.2",
91
93
  "webpack-bundle-analyzer": "^4.10.2",
92
94
  "webpack-dev-server": "~5.2.2",
@@ -118,5 +120,5 @@
118
120
  "cli": {
119
121
  "webpack": false
120
122
  },
121
- "gitHead": "6fce124ae36f2a36705247f6300ca8354aba6fb2"
123
+ "gitHead": "533bcbd267e11c88700b29f539ca1cb5de6440ae"
122
124
  }
@@ -25,7 +25,7 @@ enum BuildProcesses {
25
25
  export class Build implements Command {
26
26
  readonly greedy = true;
27
27
 
28
- constructor(private args: Args) {}
28
+ constructor(private readonly args: Args) {}
29
29
 
30
30
  description() {
31
31
  return 'build project for production';
@@ -11,7 +11,7 @@ interface Args {
11
11
  }
12
12
 
13
13
  export class BundlePackage implements Command {
14
- constructor(private args: Args) {}
14
+ constructor(private readonly args: Args) {}
15
15
 
16
16
  @logErrors
17
17
  async execute() {
@@ -9,7 +9,7 @@ interface Args {
9
9
  }
10
10
 
11
11
  export class ESLintCommand implements Command {
12
- constructor(private args: Args) {}
12
+ constructor(private readonly args: Args) {}
13
13
 
14
14
  @logErrors
15
15
  async execute() {
@@ -17,7 +17,7 @@ import { Review } from './review';
17
17
  import { RunTask } from './run-task';
18
18
  import { Start } from './start';
19
19
  import { StylesCheck } from './styles-check';
20
- import { Tests } from './tests';
20
+ import { Tests } from './test';
21
21
  import { Command, Newable } from './types';
22
22
  import { UploadSourcemaps } from './upload-sourcemaps';
23
23
 
@@ -9,7 +9,7 @@ export * from './kendo-ui-license';
9
9
  export * from './lint';
10
10
  export * from './prepare-package';
11
11
  export * from './start';
12
- export * from './tests';
12
+ export * from './test';
13
13
  export * from './styles-check';
14
14
  export * from './mfe-publish';
15
15
  export type * from './types';
@@ -13,7 +13,7 @@ const webUrl = 'https://github.com/servicetitan/frontend-example.git';
13
13
  const sshUrl = 'git@github.com:servicetitan/frontend-example.git';
14
14
 
15
15
  export class Init implements Command {
16
- constructor(private args: Args) {}
16
+ constructor(private readonly args: Args) {}
17
17
 
18
18
  description() {
19
19
  return 'create example project';
@@ -30,7 +30,7 @@ export class Lint implements Command {
30
30
 
31
31
  private readonly paths: string[];
32
32
 
33
- constructor(private args: Args) {
33
+ constructor(private readonly args: Args) {
34
34
  this.paths = [...args._];
35
35
  }
36
36
 
@@ -11,7 +11,7 @@ interface Args extends PublishArgs, CleanArgs {
11
11
  }
12
12
 
13
13
  export class MFEPublish implements Command {
14
- constructor(private args: Args) {}
14
+ constructor(private readonly args: Args) {}
15
15
 
16
16
  description() {
17
17
  return 'publish or unpublish MFE packages';
@@ -7,7 +7,7 @@ interface Args {
7
7
  }
8
8
 
9
9
  export class PreparePackage implements Command {
10
- constructor(private args: Args) {}
10
+ constructor(private readonly args: Args) {}
11
11
 
12
12
  @logErrors
13
13
  execute() {