@servicetitan/startup 31.3.2 → 31.5.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 (234) hide show
  1. package/dist/cli/commands/build.d.ts +0 -7
  2. package/dist/cli/commands/build.d.ts.map +1 -1
  3. package/dist/cli/commands/build.js +28 -17
  4. package/dist/cli/commands/build.js.map +1 -1
  5. package/dist/cli/commands/bundle-package.d.ts +1 -1
  6. package/dist/cli/commands/bundle-package.d.ts.map +1 -1
  7. package/dist/cli/commands/bundle-package.js +13 -21
  8. package/dist/cli/commands/bundle-package.js.map +1 -1
  9. package/dist/cli/commands/clean.js +1 -1
  10. package/dist/cli/commands/clean.js.map +1 -1
  11. package/dist/cli/commands/eslint.d.ts +0 -1
  12. package/dist/cli/commands/eslint.d.ts.map +1 -1
  13. package/dist/cli/commands/eslint.js +0 -3
  14. package/dist/cli/commands/eslint.js.map +1 -1
  15. package/dist/cli/commands/get-command.d.ts.map +1 -1
  16. package/dist/cli/commands/get-command.js +3 -1
  17. package/dist/cli/commands/get-command.js.map +1 -1
  18. package/dist/cli/commands/get-user-commands.js +3 -2
  19. package/dist/cli/commands/get-user-commands.js.map +1 -1
  20. package/dist/cli/commands/init.js.map +1 -1
  21. package/dist/cli/commands/install.js.map +1 -1
  22. package/dist/cli/commands/lint.js.map +1 -1
  23. package/dist/cli/commands/mfe-package-clean.d.ts +3 -4
  24. package/dist/cli/commands/mfe-package-clean.d.ts.map +1 -1
  25. package/dist/cli/commands/mfe-package-clean.js +0 -3
  26. package/dist/cli/commands/mfe-package-clean.js.map +1 -1
  27. package/dist/cli/commands/mfe-package-publish.d.ts +9 -4
  28. package/dist/cli/commands/mfe-package-publish.d.ts.map +1 -1
  29. package/dist/cli/commands/mfe-package-publish.js +70 -47
  30. package/dist/cli/commands/mfe-package-publish.js.map +1 -1
  31. package/dist/cli/commands/mfe-publish.d.ts +3 -3
  32. package/dist/cli/commands/mfe-publish.d.ts.map +1 -1
  33. package/dist/cli/commands/mfe-publish.js +7 -1
  34. package/dist/cli/commands/mfe-publish.js.map +1 -1
  35. package/dist/cli/commands/prepare-package.d.ts +0 -1
  36. package/dist/cli/commands/prepare-package.d.ts.map +1 -1
  37. package/dist/cli/commands/prepare-package.js +0 -3
  38. package/dist/cli/commands/prepare-package.js.map +1 -1
  39. package/dist/cli/commands/review/review.js.map +1 -1
  40. package/dist/cli/commands/review/rules/require-one-anvil-uikit-contrib-version.js.map +1 -1
  41. package/dist/cli/commands/review/rules/require-one-collection-version.js.map +1 -1
  42. package/dist/cli/commands/review/rules/require-one-uikit-version.js.map +1 -1
  43. package/dist/cli/commands/run-task.d.ts +0 -1
  44. package/dist/cli/commands/run-task.d.ts.map +1 -1
  45. package/dist/cli/commands/run-task.js +0 -3
  46. package/dist/cli/commands/run-task.js.map +1 -1
  47. package/dist/cli/commands/start.d.ts +0 -8
  48. package/dist/cli/commands/start.d.ts.map +1 -1
  49. package/dist/cli/commands/start.js +28 -16
  50. package/dist/cli/commands/start.js.map +1 -1
  51. package/dist/cli/commands/styles-check.d.ts +0 -1
  52. package/dist/cli/commands/styles-check.d.ts.map +1 -1
  53. package/dist/cli/commands/styles-check.js +40 -99
  54. package/dist/cli/commands/styles-check.js.map +1 -1
  55. package/dist/cli/commands/tests.js.map +1 -1
  56. package/dist/cli/commands/types.d.ts +1 -1
  57. package/dist/cli/commands/types.d.ts.map +1 -1
  58. package/dist/cli/commands/upload-sourcemaps.d.ts +22 -0
  59. package/dist/cli/commands/upload-sourcemaps.d.ts.map +1 -0
  60. package/dist/cli/commands/upload-sourcemaps.js +179 -0
  61. package/dist/cli/commands/upload-sourcemaps.js.map +1 -0
  62. package/dist/cli/tasks/cli-task.js.map +1 -1
  63. package/dist/cli/tasks/swc-compile-package.js.map +1 -1
  64. package/dist/cli/tasks/task.js.map +1 -1
  65. package/dist/cli/tasks/tsc-compile-package.js.map +1 -1
  66. package/dist/cli/tasks/tsc-compile.js.map +1 -1
  67. package/dist/cli/utils/bundle.d.ts +4 -1
  68. package/dist/cli/utils/bundle.d.ts.map +1 -1
  69. package/dist/cli/utils/bundle.js +67 -74
  70. package/dist/cli/utils/bundle.js.map +1 -1
  71. package/dist/cli/utils/cli-os.js +2 -2
  72. package/dist/cli/utils/cli-os.js.map +1 -1
  73. package/dist/cli/utils/ts-config.js.map +1 -1
  74. package/dist/utils/find-packages.d.ts.map +1 -1
  75. package/dist/utils/find-packages.js +3 -4
  76. package/dist/utils/find-packages.js.map +1 -1
  77. package/dist/utils/find-up.d.ts +2 -0
  78. package/dist/utils/find-up.d.ts.map +1 -0
  79. package/dist/utils/find-up.js +28 -0
  80. package/dist/utils/find-up.js.map +1 -0
  81. package/dist/utils/get-configuration.d.ts +3 -1
  82. package/dist/utils/get-configuration.d.ts.map +1 -1
  83. package/dist/utils/get-configuration.js +1 -0
  84. package/dist/utils/get-configuration.js.map +1 -1
  85. package/dist/utils/index.d.ts +1 -0
  86. package/dist/utils/index.d.ts.map +1 -1
  87. package/dist/utils/index.js +1 -0
  88. package/dist/utils/index.js.map +1 -1
  89. package/dist/utils/log.js.map +1 -1
  90. package/dist/webpack/configs/cache-config.d.ts +6 -0
  91. package/dist/webpack/configs/cache-config.d.ts.map +1 -0
  92. package/dist/webpack/configs/cache-config.js +52 -0
  93. package/dist/webpack/configs/cache-config.js.map +1 -0
  94. package/dist/webpack/configs/dev-server-config.js +1 -1
  95. package/dist/webpack/configs/dev-server-config.js.map +1 -1
  96. package/dist/webpack/configs/entry.config.d.ts.map +1 -1
  97. package/dist/webpack/configs/entry.config.js +15 -6
  98. package/dist/webpack/configs/entry.config.js.map +1 -1
  99. package/dist/webpack/configs/externals-config.d.ts.map +1 -1
  100. package/dist/webpack/configs/externals-config.js +6 -2
  101. package/dist/webpack/configs/externals-config.js.map +1 -1
  102. package/dist/webpack/configs/index.d.ts +1 -0
  103. package/dist/webpack/configs/index.d.ts.map +1 -1
  104. package/dist/webpack/configs/index.js +1 -0
  105. package/dist/webpack/configs/index.js.map +1 -1
  106. package/dist/webpack/configs/optimization-config.d.ts.map +1 -1
  107. package/dist/webpack/configs/optimization-config.js +7 -11
  108. package/dist/webpack/configs/optimization-config.js.map +1 -1
  109. package/dist/webpack/configs/output-config.d.ts.map +1 -1
  110. package/dist/webpack/configs/output-config.js +25 -4
  111. package/dist/webpack/configs/output-config.js.map +1 -1
  112. package/dist/webpack/configs/plugins/assets-manifest-plugin.d.ts +6 -0
  113. package/dist/webpack/configs/plugins/assets-manifest-plugin.d.ts.map +1 -1
  114. package/dist/webpack/configs/plugins/assets-manifest-plugin.js +50 -8
  115. package/dist/webpack/configs/plugins/assets-manifest-plugin.js.map +1 -1
  116. package/dist/webpack/configs/plugins/bundle-analyser-plugin.d.ts.map +1 -1
  117. package/dist/webpack/configs/plugins/bundle-analyser-plugin.js +3 -7
  118. package/dist/webpack/configs/plugins/bundle-analyser-plugin.js.map +1 -1
  119. package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.d.ts.map +1 -1
  120. package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.js +3 -2
  121. package/dist/webpack/configs/plugins/define-exposed-dependencies-plugin.js.map +1 -1
  122. package/dist/webpack/configs/plugins/define-exposed-instance-dependencies-plugin.js +2 -2
  123. package/dist/webpack/configs/plugins/define-exposed-instance-dependencies-plugin.js.map +1 -1
  124. package/dist/webpack/configs/plugins/html-plugin.d.ts +1 -1
  125. package/dist/webpack/configs/plugins/html-plugin.d.ts.map +1 -1
  126. package/dist/webpack/configs/plugins/html-plugin.js +2 -3
  127. package/dist/webpack/configs/plugins/html-plugin.js.map +1 -1
  128. package/dist/webpack/configs/plugins/html-tags-plugin.d.ts +4 -0
  129. package/dist/webpack/configs/plugins/html-tags-plugin.d.ts.map +1 -0
  130. package/dist/webpack/configs/plugins/html-tags-plugin.js +49 -0
  131. package/dist/webpack/configs/plugins/html-tags-plugin.js.map +1 -0
  132. package/dist/webpack/configs/plugins/index.d.ts +2 -0
  133. package/dist/webpack/configs/plugins/index.d.ts.map +1 -1
  134. package/dist/webpack/configs/plugins/index.js +2 -0
  135. package/dist/webpack/configs/plugins/index.js.map +1 -1
  136. package/dist/webpack/configs/plugins/remove-empty-scripts-plugin.d.ts +4 -0
  137. package/dist/webpack/configs/plugins/remove-empty-scripts-plugin.d.ts.map +1 -0
  138. package/dist/webpack/configs/plugins/remove-empty-scripts-plugin.js +25 -0
  139. package/dist/webpack/configs/plugins/remove-empty-scripts-plugin.js.map +1 -0
  140. package/dist/webpack/configs/plugins/virtual-modules-plugin.d.ts +1 -0
  141. package/dist/webpack/configs/plugins/virtual-modules-plugin.d.ts.map +1 -1
  142. package/dist/webpack/configs/plugins/virtual-modules-plugin.js +23 -14
  143. package/dist/webpack/configs/plugins/virtual-modules-plugin.js.map +1 -1
  144. package/dist/webpack/configs/plugins-config.d.ts.map +1 -1
  145. package/dist/webpack/configs/plugins-config.js +2 -0
  146. package/dist/webpack/configs/plugins-config.js.map +1 -1
  147. package/dist/webpack/configs/rules/css-rules.d.ts.map +1 -1
  148. package/dist/webpack/configs/rules/css-rules.js +13 -18
  149. package/dist/webpack/configs/rules/css-rules.js.map +1 -1
  150. package/dist/webpack/configs/utils/get-bundle-type.d.ts +3 -0
  151. package/dist/webpack/configs/utils/get-bundle-type.d.ts.map +1 -0
  152. package/dist/webpack/configs/utils/get-bundle-type.js +24 -0
  153. package/dist/webpack/configs/utils/get-bundle-type.js.map +1 -0
  154. package/dist/webpack/configs/utils/index.d.ts +1 -0
  155. package/dist/webpack/configs/utils/index.d.ts.map +1 -1
  156. package/dist/webpack/configs/utils/index.js +1 -0
  157. package/dist/webpack/configs/utils/index.js.map +1 -1
  158. package/dist/webpack/create-webpack-config.d.ts.map +1 -1
  159. package/dist/webpack/create-webpack-config.js +37 -48
  160. package/dist/webpack/create-webpack-config.js.map +1 -1
  161. package/dist/webpack/types.d.ts +4 -0
  162. package/dist/webpack/types.d.ts.map +1 -1
  163. package/dist/webpack/utils/index.d.ts +1 -0
  164. package/dist/webpack/utils/index.d.ts.map +1 -1
  165. package/dist/webpack/utils/index.js +1 -0
  166. package/dist/webpack/utils/index.js.map +1 -1
  167. package/dist/webpack/utils/stringify-config.d.ts +2 -0
  168. package/dist/webpack/utils/stringify-config.d.ts.map +1 -0
  169. package/dist/webpack/utils/stringify-config.js +35 -0
  170. package/dist/webpack/utils/stringify-config.js.map +1 -0
  171. package/package.json +17 -15
  172. package/src/cli/commands/__tests__/build.test.ts +19 -2
  173. package/src/cli/commands/__tests__/bundle-package.test.ts +29 -8
  174. package/src/cli/commands/__tests__/clean.test.ts +2 -0
  175. package/src/cli/commands/__tests__/get-user-commands.test.ts +1 -1
  176. package/src/cli/commands/__tests__/mfe-package-publish.test.ts +91 -15
  177. package/src/cli/commands/__tests__/mfe-publish.test.ts +2 -0
  178. package/src/cli/commands/__tests__/start.test.ts +15 -1
  179. package/src/cli/commands/__tests__/styles-check.test.ts +27 -80
  180. package/src/cli/commands/__tests__/upload-sourcemaps.test.ts +127 -0
  181. package/src/cli/commands/build.ts +33 -17
  182. package/src/cli/commands/bundle-package.ts +10 -19
  183. package/src/cli/commands/clean.ts +1 -1
  184. package/src/cli/commands/eslint.ts +0 -4
  185. package/src/cli/commands/get-command.ts +2 -0
  186. package/src/cli/commands/get-user-commands.ts +1 -1
  187. package/src/cli/commands/mfe-package-clean.ts +2 -6
  188. package/src/cli/commands/mfe-package-publish.ts +104 -70
  189. package/src/cli/commands/mfe-publish.ts +8 -5
  190. package/src/cli/commands/prepare-package.ts +0 -4
  191. package/src/cli/commands/run-task.ts +0 -4
  192. package/src/cli/commands/start.ts +22 -5
  193. package/src/cli/commands/styles-check.ts +28 -131
  194. package/src/cli/commands/types.ts +1 -1
  195. package/src/cli/commands/upload-sourcemaps.ts +108 -0
  196. package/src/cli/utils/__tests__/bundle.test.ts +119 -9
  197. package/src/cli/utils/__tests__/cli-os.test.ts +2 -2
  198. package/src/cli/utils/__tests__/compile.test.ts +2 -0
  199. package/src/cli/utils/__tests__/type-check.test.ts +2 -0
  200. package/src/cli/utils/bundle.ts +76 -54
  201. package/src/cli/utils/cli-os.ts +2 -2
  202. package/src/utils/__tests__/get-configuration.test.ts +1 -1
  203. package/src/utils/find-packages.ts +3 -5
  204. package/src/utils/find-up.ts +12 -0
  205. package/src/utils/get-configuration.ts +2 -0
  206. package/src/utils/index.ts +1 -0
  207. package/src/webpack/__mocks__/style-rules.ts +1 -1
  208. package/src/webpack/__tests__/create-webpack-config-shared-dependencies.test.ts +274 -45
  209. package/src/webpack/__tests__/create-webpack-config-web-component.test.ts +25 -1
  210. package/src/webpack/__tests__/create-webpack-config.test.ts +9 -57
  211. package/src/webpack/configs/cache-config.ts +37 -0
  212. package/src/webpack/configs/dev-server-config.ts +1 -1
  213. package/src/webpack/configs/entry.config.ts +18 -8
  214. package/src/webpack/configs/externals-config.ts +7 -2
  215. package/src/webpack/configs/index.ts +1 -0
  216. package/src/webpack/configs/optimization-config.ts +7 -11
  217. package/src/webpack/configs/output-config.ts +23 -7
  218. package/src/webpack/configs/plugins/assets-manifest-plugin.ts +46 -10
  219. package/src/webpack/configs/plugins/bundle-analyser-plugin.ts +1 -6
  220. package/src/webpack/configs/plugins/define-exposed-dependencies-plugin.ts +3 -2
  221. package/src/webpack/configs/plugins/define-exposed-instance-dependencies-plugin.ts +2 -2
  222. package/src/webpack/configs/plugins/html-plugin.ts +2 -3
  223. package/src/webpack/configs/plugins/html-tags-plugin.ts +28 -0
  224. package/src/webpack/configs/plugins/index.ts +2 -0
  225. package/src/webpack/configs/plugins/remove-empty-scripts-plugin.ts +11 -0
  226. package/src/webpack/configs/plugins/virtual-modules-plugin.ts +27 -16
  227. package/src/webpack/configs/plugins-config.ts +4 -0
  228. package/src/webpack/configs/rules/css-rules.ts +19 -20
  229. package/src/webpack/configs/utils/get-bundle-type.ts +22 -0
  230. package/src/webpack/configs/utils/index.ts +1 -0
  231. package/src/webpack/create-webpack-config.ts +46 -52
  232. package/src/webpack/types.ts +4 -0
  233. package/src/webpack/utils/index.ts +1 -0
  234. package/src/webpack/utils/stringify-config.ts +19 -0
@@ -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}\n/* eslint-enable @typescript-eslint/naming-convention */\n\nexport interface WebComponentBranchConfigs {\n publishTag?: string;\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;;QAgGGC;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;;;2DA3ND;6DACE;qBAKG;4BACO;0BACY;;;;;;AAEhC,MAAMnB,iCAAiC;IAAC;IAAW;IAAQ;IAAS;CAAS;AA+C7E,IAAA,AAAKD,qCAAAA;;;;;;;;;;;;;;;;;;;WAAAA;;AAiDL,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,qBAAqBkB,iBAAiC,IAAI;IACtE,MAAMC,OACF,OAAOD,mBAAmB,WACpBM,IAAAA,sBAAY,EAACH,aAAI,CAACC,IAAI,CAACJ,gBAAgB,mBACvCA;QACHC;IAAP,OAAOA,CAAAA,YAAAA,iBAAAA,2BAAAA,KAAMI,GAAG,cAATJ,uBAAAA,YAAa,CAAC;AACzB;AAEO,SAASlB;QACLF;QAAAA;IAAP,OAAOA,CAAAA,iCAAAA,yBAAAA,mBAAmB0B,IAAI,cAAvB1B,6CAAAA,uBAAyB2B,MAAM,cAA/B3B,2CAAAA,gCAAmC,CAAC;AAC/C;AAEO,SAASG;QACLH;IAAP,OAAOA,CAAAA,yBAAAA,mBAAmB4B,IAAI,cAAvB5B,oCAAAA,yBAA2B,CAAC;AACvC;AAEO,SAASI;QACLJ;IAAP,OAAOA,CAAAA,2BAAAA,mBAAmB6B,MAAM,cAAzB7B,sCAAAA,2BAA6B,CAAC;AACzC;AAEO,SAASK;QACLL;QAAAA;IAAP,OAAOA,CAAAA,oCAAAA,yBAAAA,mBAAmB0B,IAAI,cAAvB1B,6CAAAA,uBAAyB8B,SAAS,cAAlC9B,8CAAAA,mCAAsC,CAAC;AAClD;AAEO,SAASS,wBAAwBU,cAA+B;IACnE,MAAM,EAAEY,OAAO,EAAE,GAAG/B,iBAAiBmB;IACrC,OAAO,OAAOY,YAAY,WAAWA,UAAU,CAAC;AACpD;AAEO,SAASvB,6BACZW,iBAAiC,IAAI;IAErC,MAAMa,SAAS/B,qBAAqBkB,eAAe,CAAC,gBAAgB;IAEpE,IAAIa,WAAW,MAAM;QACjB,OAAO,CAAC;IACZ;IAEA,IAAI,OAAOA,WAAW,UAAU;QAC5B,OAAOA;IACX;IAEA,IAAI,OAAOA,WAAW,UAAU;QAC5B,MAAMC,aAAaX,aAAI,CAACY,OAAO,CAC3B,OAAOf,mBAAmB,WAAWG,aAAI,CAACC,IAAI,CAACJ,gBAAgBa,UAAUA;QAE7E,IAAIG,WAAE,CAACC,UAAU,CAACH,aAAa;YAC3B,OAAOI,QAAQf,aAAI,CAACY,OAAO,CAACD;QAChC;QACAK,QAAG,CAACC,OAAO,CAAC,CAAC,6CAA6C,EAAEP,OAAO,CAAC,CAAC;QAErE,OAAOQ;IACX;AACJ;AAEO,SAASjC,6BAA6BY,iBAAiC,IAAI;IAC9E,MAAMa,SAASxB,6BAA6BW;IAE5C,OAAOa,mBAAAA,6BAAAA,OAAQS,QAAQ;AAC3B;AAEO,SAAS/B;IACZ,IAAIgC;IACJ,IAAI;QACAA,SAASC,IAAAA,sBAAU,IAAGD,MAAM;IAChC,EAAE,UAAM;QACJ,OAAO;IACX;IACA,MAAME,eAAetB,aAAI,CAACC,IAAI,CAACmB,QAAQ;IACvC,OAAOP,WAAE,CAACC,UAAU,CAACQ;AACzB;AAEO,SAAStC;QACLN;IAAP,OAAOA,CAAAA,sCAAAA,kBAAkB,CAAC,sBAAsB,cAAzCA,iDAAAA,sCAA6C,CAAC;AACzD;AAEO,SAASW,SAASQ,cAA+B;IACpD,OAAOnB,iBAAiBmB,gBAAgBY,OAAO,KAAK;AACxD;AAEO,SAASnB;IACZ,OAAOH,yBAAyB,CAAC,qBAAqB,KAAK;AAC/D;AAEO,SAASI;IACZ,MAAMgC,uBAAuBpC;IAC7B,OAAOoC,qBAAqBC,SAAS,KAAK;AAC9C;AAEO,SAAShC;IACZ,OAAOL,yBAAyB,CAAC,6BAA6B,KAAK;AACvE;AAEO,SAASM,SAASI,cAA+B;IACpD,OAAOnB,iBAAiBmB,gBAAgB4B,MAAM,KAAK;AACvD;AAEO,SAAS/B;QACLR;IAAP,OAAOA,EAAAA,gCAAAA,4CAAAA,oDAAAA,8BAAgCwC,UAAU,MAAK;AAC1D;AAEO,SAAS/B;IACZ,OAAOR,yBAAyB,CAAC,sBAAsB,KAAK;AAChE;AAEO,SAASS,eAAeC,iBAAiC,IAAI;IAChE,OAAO,CAAC,CAACX,6BAA6BW;AAC1C"}
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":"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"}
@@ -1,4 +1,5 @@
1
1
  export * from './find-packages';
2
+ export * from './find-up';
2
3
  export * from './format-duration';
3
4
  export * from './get-configuration';
4
5
  export * from './get-destination-folders';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,YAAY,CAAC"}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
5
  _export_star(require("./find-packages"), exports);
6
+ _export_star(require("./find-up"), exports);
6
7
  _export_star(require("./format-duration"), exports);
7
8
  _export_star(require("./get-configuration"), exports);
8
9
  _export_star(require("./get-destination-folders"), exports);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/index.ts"],"sourcesContent":["export * from './find-packages';\nexport * from './format-duration';\nexport * from './get-configuration';\nexport * from './get-destination-folders';\nexport * from './get-folders';\nexport * from './get-jest-config';\nexport * from './get-package-data';\nexport * from './get-package-name';\nexport * from './get-packages';\nexport * from './get-startup-version';\nexport * from './get-tsconfig';\nexport * from './load-shared-dependencies';\nexport * from './log';\nexport * from './log-errors';\nexport * from './pick';\nexport * from './read-json';\nexport * from './to-array';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA"}
1
+ {"version":3,"sources":["../../src/utils/index.ts"],"sourcesContent":["export * from './find-packages';\nexport * from './find-up';\nexport * from './format-duration';\nexport * from './get-configuration';\nexport * from './get-destination-folders';\nexport * from './get-folders';\nexport * from './get-jest-config';\nexport * from './get-package-data';\nexport * from './get-package-name';\nexport * from './get-packages';\nexport * from './get-startup-version';\nexport * from './get-tsconfig';\nexport * from './load-shared-dependencies';\nexport * from './log';\nexport * from './log-errors';\nexport * from './pick';\nexport * from './read-json';\nexport * from './to-array';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/log.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { createDebug } from './debug';\n\ntype Debugger = ReturnType<typeof createDebug>;\n\nclass Log {\n private readonly debugMap: Map<string, Debugger>;\n\n constructor() {\n this.debugMap = new Map<string, Debugger>();\n }\n\n get timestamp() {\n return new Date().toLocaleTimeString(undefined, {\n hour12: false,\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n fractionalSecondDigits: 3,\n });\n }\n\n text(...text: string[]) {\n process.stdout.write(chalk(...text) + '\\n');\n }\n\n info(...text: string[]) {\n process.stdout.write(chalk.bold.cyan(...text) + '\\n');\n }\n\n success(...text: string[]) {\n process.stdout.write(chalk.bold.green(...text) + '\\n');\n }\n\n warning(...text: string[]) {\n process.stdout.write(chalk.bold.yellow(...text) + '\\n');\n }\n\n error(...text: string[]) {\n process.stdout.write(chalk.bold.red(...text) + '\\n');\n }\n\n debug(namespace: string, ...text: any[]) {\n let dbg = this.debugMap.get(namespace);\n if (!dbg) {\n dbg = createDebug(namespace);\n this.debugMap.set(namespace, dbg);\n }\n if (dbg.enabled && text.length) {\n const [formatter, ...args] = text.map(str => (typeof str === 'function' ? str() : str));\n dbg(formatter, ...args);\n }\n return dbg;\n }\n}\n\nexport const log = new Log();\n"],"names":["log","Log","timestamp","Date","toLocaleTimeString","undefined","hour12","hour","minute","second","fractionalSecondDigits","text","process","stdout","write","chalk","info","bold","cyan","success","green","warning","yellow","error","red","debug","namespace","dbg","debugMap","get","createDebug","set","enabled","length","formatter","args","map","str","constructor","Map"],"mappings":";;;;+BAwDaA;;;eAAAA;;;8DAxDK;uBACU;;;;;;;;;;;;;;;;;;;AAI5B,MAAMC;IAOF,IAAIC,YAAY;QACZ,OAAO,IAAIC,OAAOC,kBAAkB,CAACC,WAAW;YAC5CC,QAAQ;YACRC,MAAM;YACNC,QAAQ;YACRC,QAAQ;YACRC,wBAAwB;QAC5B;IACJ;IAEAC,KAAK,GAAGA,IAAc,EAAE;QACpBC,QAAQC,MAAM,CAACC,KAAK,CAACC,IAAAA,cAAK,KAAIJ,QAAQ;IAC1C;IAEAK,KAAK,GAAGL,IAAc,EAAE;QACpBC,QAAQC,MAAM,CAACC,KAAK,CAACC,cAAK,CAACE,IAAI,CAACC,IAAI,IAAIP,QAAQ;IACpD;IAEAQ,QAAQ,GAAGR,IAAc,EAAE;QACvBC,QAAQC,MAAM,CAACC,KAAK,CAACC,cAAK,CAACE,IAAI,CAACG,KAAK,IAAIT,QAAQ;IACrD;IAEAU,QAAQ,GAAGV,IAAc,EAAE;QACvBC,QAAQC,MAAM,CAACC,KAAK,CAACC,cAAK,CAACE,IAAI,CAACK,MAAM,IAAIX,QAAQ;IACtD;IAEAY,MAAM,GAAGZ,IAAc,EAAE;QACrBC,QAAQC,MAAM,CAACC,KAAK,CAACC,cAAK,CAACE,IAAI,CAACO,GAAG,IAAIb,QAAQ;IACnD;IAEAc,MAAMC,SAAiB,EAAE,GAAGf,IAAW,EAAE;QACrC,IAAIgB,MAAM,IAAI,CAACC,QAAQ,CAACC,GAAG,CAACH;QAC5B,IAAI,CAACC,KAAK;YACNA,MAAMG,IAAAA,kBAAW,EAACJ;YAClB,IAAI,CAACE,QAAQ,CAACG,GAAG,CAACL,WAAWC;QACjC;QACA,IAAIA,IAAIK,OAAO,IAAIrB,KAAKsB,MAAM,EAAE;YAC5B,MAAM,CAACC,WAAW,GAAGC,KAAK,GAAGxB,KAAKyB,GAAG,CAACC,CAAAA,MAAQ,OAAOA,QAAQ,aAAaA,QAAQA;YAClFV,IAAIO,cAAcC;QACtB;QACA,OAAOR;IACX;IA7CAW,aAAc;QAFd,uBAAiBV,YAAjB,KAAA;QAGI,IAAI,CAACA,QAAQ,GAAG,IAAIW;IACxB;AA4CJ;AAEO,MAAMvC,MAAM,IAAIC"}
1
+ {"version":3,"sources":["../../src/utils/log.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { createDebug } from './debug';\n\ntype Debugger = ReturnType<typeof createDebug>;\n\nclass Log {\n private readonly debugMap: Map<string, Debugger>;\n\n constructor() {\n this.debugMap = new Map<string, Debugger>();\n }\n\n get timestamp() {\n return new Date().toLocaleTimeString(undefined, {\n hour12: false,\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n fractionalSecondDigits: 3,\n });\n }\n\n text(...text: string[]) {\n process.stdout.write(chalk(...text) + '\\n');\n }\n\n info(...text: string[]) {\n process.stdout.write(chalk.bold.cyan(...text) + '\\n');\n }\n\n success(...text: string[]) {\n process.stdout.write(chalk.bold.green(...text) + '\\n');\n }\n\n warning(...text: string[]) {\n process.stdout.write(chalk.bold.yellow(...text) + '\\n');\n }\n\n error(...text: string[]) {\n process.stdout.write(chalk.bold.red(...text) + '\\n');\n }\n\n debug(namespace: string, ...text: any[]) {\n let dbg = this.debugMap.get(namespace);\n if (!dbg) {\n dbg = createDebug(namespace);\n this.debugMap.set(namespace, dbg);\n }\n if (dbg.enabled && text.length) {\n const [formatter, ...args] = text.map(str => (typeof str === 'function' ? str() : str));\n dbg(formatter, ...args);\n }\n return dbg;\n }\n}\n\nexport const log = new Log();\n"],"names":["log","Log","timestamp","Date","toLocaleTimeString","undefined","hour12","hour","minute","second","fractionalSecondDigits","text","process","stdout","write","chalk","info","bold","cyan","success","green","warning","yellow","error","red","debug","namespace","dbg","debugMap","get","createDebug","set","enabled","length","formatter","args","map","str","Map"],"mappings":";;;;+BAwDaA;;;eAAAA;;;8DAxDK;uBACU;;;;;;;;;;;;;;;;;;;AAI5B,MAAMC;IAOF,IAAIC,YAAY;QACZ,OAAO,IAAIC,OAAOC,kBAAkB,CAACC,WAAW;YAC5CC,QAAQ;YACRC,MAAM;YACNC,QAAQ;YACRC,QAAQ;YACRC,wBAAwB;QAC5B;IACJ;IAEAC,KAAK,GAAGA,IAAc,EAAE;QACpBC,QAAQC,MAAM,CAACC,KAAK,CAACC,IAAAA,cAAK,KAAIJ,QAAQ;IAC1C;IAEAK,KAAK,GAAGL,IAAc,EAAE;QACpBC,QAAQC,MAAM,CAACC,KAAK,CAACC,cAAK,CAACE,IAAI,CAACC,IAAI,IAAIP,QAAQ;IACpD;IAEAQ,QAAQ,GAAGR,IAAc,EAAE;QACvBC,QAAQC,MAAM,CAACC,KAAK,CAACC,cAAK,CAACE,IAAI,CAACG,KAAK,IAAIT,QAAQ;IACrD;IAEAU,QAAQ,GAAGV,IAAc,EAAE;QACvBC,QAAQC,MAAM,CAACC,KAAK,CAACC,cAAK,CAACE,IAAI,CAACK,MAAM,IAAIX,QAAQ;IACtD;IAEAY,MAAM,GAAGZ,IAAc,EAAE;QACrBC,QAAQC,MAAM,CAACC,KAAK,CAACC,cAAK,CAACE,IAAI,CAACO,GAAG,IAAIb,QAAQ;IACnD;IAEAc,MAAMC,SAAiB,EAAE,GAAGf,IAAW,EAAE;QACrC,IAAIgB,MAAM,IAAI,CAACC,QAAQ,CAACC,GAAG,CAACH;QAC5B,IAAI,CAACC,KAAK;YACNA,MAAMG,IAAAA,kBAAW,EAACJ;YAClB,IAAI,CAACE,QAAQ,CAACG,GAAG,CAACL,WAAWC;QACjC;QACA,IAAIA,IAAIK,OAAO,IAAIrB,KAAKsB,MAAM,EAAE;YAC5B,MAAM,CAACC,WAAW,GAAGC,KAAK,GAAGxB,KAAKyB,GAAG,CAACC,CAAAA,MAAQ,OAAOA,QAAQ,aAAaA,QAAQA;YAClFV,IAAIO,cAAcC;QACtB;QACA,OAAOR;IACX;IA7CA,aAAc;QAFd,uBAAiBC,YAAjB,KAAA;QAGI,IAAI,CAACA,QAAQ,GAAG,IAAIU;IACxB;AA4CJ;AAEO,MAAMtC,MAAM,IAAIC"}
@@ -0,0 +1,6 @@
1
+ import { Configuration } from 'webpack';
2
+ import { Context, Overrides } from './types';
3
+ type Result = Pick<Configuration, 'cache' | 'infrastructureLogging'> | undefined;
4
+ export declare function cacheConfig(context: Context, _overrides: Overrides): Result;
5
+ export {};
6
+ //# sourceMappingURL=cache-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cache-config.d.ts","sourceRoot":"","sources":["../../../src/webpack/configs/cache-config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAG7C,KAAK,MAAM,GAAG,IAAI,CAAC,aAAa,EAAE,OAAO,GAAG,uBAAuB,CAAC,GAAG,SAAS,CAAC;AAIjF,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,SAAS,GAAG,MAAM,CAkB3E"}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "cacheConfig", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return cacheConfig;
9
+ }
10
+ });
11
+ const _path = /*#__PURE__*/ _interop_require_default(require("path"));
12
+ const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
13
+ const _utils = require("../../utils");
14
+ function _interop_require_default(obj) {
15
+ return obj && obj.__esModule ? obj : {
16
+ default: obj
17
+ };
18
+ }
19
+ const CACHE_VERSION = '1';
20
+ function cacheConfig(context, _overrides) {
21
+ const { emitExposedDependencies } = context;
22
+ if (!emitExposedDependencies) {
23
+ return;
24
+ }
25
+ const packageLock = findPackageLock();
26
+ const cache = {
27
+ type: 'filesystem',
28
+ version: CACHE_VERSION,
29
+ ...packageLock ? {
30
+ buildDependencies: {
31
+ packageLock: [
32
+ packageLock
33
+ ]
34
+ }
35
+ } : {}
36
+ };
37
+ return {
38
+ cache,
39
+ // Suppress "Serializing big strings impacts deserialization performance" warnings
40
+ infrastructureLogging: {
41
+ level: 'error'
42
+ }
43
+ };
44
+ }
45
+ function findPackageLock() {
46
+ return (0, _utils.findUp)((directory)=>{
47
+ const lockFile = _path.default.resolve(_path.default.join(directory), 'package-lock.json');
48
+ return _fs.default.existsSync(lockFile) ? lockFile : undefined;
49
+ });
50
+ }
51
+
52
+ //# sourceMappingURL=cache-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/webpack/configs/cache-config.ts"],"sourcesContent":["import path from 'path';\nimport fs from 'fs';\nimport { Configuration } from 'webpack';\nimport { findUp } from '../../utils';\nimport { Context, Overrides } from './types';\n\ntype Config = Configuration['cache'];\ntype Result = Pick<Configuration, 'cache' | 'infrastructureLogging'> | undefined;\n\nconst CACHE_VERSION = '1';\n\nexport function cacheConfig(context: Context, _overrides: Overrides): Result {\n const { emitExposedDependencies } = context;\n if (!emitExposedDependencies) {\n return;\n }\n\n const packageLock = findPackageLock();\n const cache: Config = {\n type: 'filesystem',\n version: CACHE_VERSION,\n ...(packageLock ? { buildDependencies: { packageLock: [packageLock] } } : {}),\n };\n\n return {\n cache,\n // Suppress \"Serializing big strings impacts deserialization performance\" warnings\n infrastructureLogging: { level: 'error' },\n };\n}\n\nfunction findPackageLock() {\n return findUp(directory => {\n const lockFile = path.resolve(path.join(directory), 'package-lock.json');\n return fs.existsSync(lockFile) ? lockFile : undefined;\n });\n}\n"],"names":["cacheConfig","CACHE_VERSION","context","_overrides","emitExposedDependencies","packageLock","findPackageLock","cache","type","version","buildDependencies","infrastructureLogging","level","findUp","directory","lockFile","path","resolve","join","fs","existsSync","undefined"],"mappings":";;;;+BAWgBA;;;eAAAA;;;6DAXC;2DACF;uBAEQ;;;;;;AAMvB,MAAMC,gBAAgB;AAEf,SAASD,YAAYE,OAAgB,EAAEC,UAAqB;IAC/D,MAAM,EAAEC,uBAAuB,EAAE,GAAGF;IACpC,IAAI,CAACE,yBAAyB;QAC1B;IACJ;IAEA,MAAMC,cAAcC;IACpB,MAAMC,QAAgB;QAClBC,MAAM;QACNC,SAASR;QACT,GAAII,cAAc;YAAEK,mBAAmB;gBAAEL,aAAa;oBAACA;iBAAY;YAAC;QAAE,IAAI,CAAC,CAAC;IAChF;IAEA,OAAO;QACHE;QACA,kFAAkF;QAClFI,uBAAuB;YAAEC,OAAO;QAAQ;IAC5C;AACJ;AAEA,SAASN;IACL,OAAOO,IAAAA,aAAM,EAACC,CAAAA;QACV,MAAMC,WAAWC,aAAI,CAACC,OAAO,CAACD,aAAI,CAACE,IAAI,CAACJ,YAAY;QACpD,OAAOK,WAAE,CAACC,UAAU,CAACL,YAAYA,WAAWM;IAChD;AACJ"}
@@ -18,7 +18,7 @@ function _interop_require_default(obj) {
18
18
  };
19
19
  }
20
20
  function devServerConfig(context, overrides) {
21
- if (context.isProduction || (0, _utils.isDevServerDisabled)()) {
21
+ if (context.isProduction || context.emitExposedDependencies || (0, _utils.isDevServerDisabled)()) {
22
22
  return;
23
23
  }
24
24
  const devServer = {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/webpack/configs/dev-server-config.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport { Configuration } from 'webpack';\nimport {\n allowedWebpackDevServerOptions,\n getWebpackConfiguration,\n isDevServerDisabled,\n log,\n pick,\n} from '../../utils';\nimport { statsConfig } from './stats-config';\nimport { Context, Overrides } from './types';\n\ntype DevServerConfig = NonNullable<Configuration['devServer']>;\ntype Result = Pick<Configuration, 'devServer'> | undefined;\n\nexport function devServerConfig(context: Context, overrides: Overrides): Result {\n if (context.isProduction || isDevServerDisabled()) {\n return;\n }\n\n const devServer: DevServerConfig = {\n hot: false,\n port: 8080,\n historyApiFallback: true,\n devMiddleware: { writeToDisk: true, ...statsConfig(context, overrides) },\n headers: {\n 'Access-Control-Allow-Origin': '*',\n 'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept',\n },\n setupMiddlewares: (middlewares, devServer) => {\n if (devServer.app) {\n devServer.app.use((request, _, next) => {\n log.info(`[${log.timestamp}]: ${request.method} ${request.url}`);\n next();\n });\n } else {\n log.warning('webpack-dev-server app is not defined');\n }\n\n return middlewares;\n },\n ...getDevServerConfig(),\n };\n\n /* istanbul ignore next: debug only */\n log.debug('dev-server-config', () => JSON.stringify({ devServer }, null, 2));\n return { devServer };\n}\n\nfunction getDevServerConfig() {\n const webpack = getWebpackConfiguration();\n /* istanbul ignore next: debug only */\n log.debug('dev-server-config', () => JSON.stringify({ webpack }, null, 2));\n\n const result = pick(webpack, allowedWebpackDevServerOptions);\n if (typeof result.proxy === 'string') {\n if (fs.existsSync(result.proxy)) {\n result.proxy = require(path.resolve(result.proxy));\n } else {\n delete result.proxy;\n }\n }\n\n if (result.static === undefined) {\n const contentBase = webpack.contentBase;\n if (contentBase !== undefined) {\n log.warning(CONTENT_BASE_DEPRECATION_WARNING);\n if (typeof contentBase !== 'number') {\n result.static = contentBase;\n }\n } else {\n result.static = '.';\n }\n }\n\n return { ...result, ...webpack.devServer } as Partial<DevServerConfig>;\n}\n\nconst CONTENT_BASE_DEPRECATION_WARNING = `\n DEPRECATION WARNING: webpack.contentBase in package.json is deprecated.\n Use webpack.static instead.\n`\n .replace(/\\n\\s*/g, ' ')\n .trim();\n"],"names":["devServerConfig","context","overrides","isProduction","isDevServerDisabled","devServer","hot","port","historyApiFallback","devMiddleware","writeToDisk","statsConfig","headers","setupMiddlewares","middlewares","app","use","request","_","next","log","info","timestamp","method","url","warning","getDevServerConfig","debug","JSON","stringify","webpack","getWebpackConfiguration","result","pick","allowedWebpackDevServerOptions","proxy","fs","existsSync","require","path","resolve","static","undefined","contentBase","CONTENT_BASE_DEPRECATION_WARNING","replace","trim"],"mappings":";;;;+BAgBgBA;;;eAAAA;;;2DAhBD;6DACE;uBAQV;6BACqB;;;;;;AAMrB,SAASA,gBAAgBC,OAAgB,EAAEC,SAAoB;IAClE,IAAID,QAAQE,YAAY,IAAIC,IAAAA,0BAAmB,KAAI;QAC/C;IACJ;IAEA,MAAMC,YAA6B;QAC/BC,KAAK;QACLC,MAAM;QACNC,oBAAoB;QACpBC,eAAe;YAAEC,aAAa;YAAM,GAAGC,IAAAA,wBAAW,EAACV,SAASC,UAAU;QAAC;QACvEU,SAAS;YACL,+BAA+B;YAC/B,gCAAgC;QACpC;QACAC,kBAAkB,CAACC,aAAaT;YAC5B,IAAIA,UAAUU,GAAG,EAAE;gBACfV,UAAUU,GAAG,CAACC,GAAG,CAAC,CAACC,SAASC,GAAGC;oBAC3BC,UAAG,CAACC,IAAI,CAAC,CAAC,CAAC,EAAED,UAAG,CAACE,SAAS,CAAC,GAAG,EAAEL,QAAQM,MAAM,CAAC,CAAC,EAAEN,QAAQO,GAAG,EAAE;oBAC/DL;gBACJ;YACJ,OAAO;gBACHC,UAAG,CAACK,OAAO,CAAC;YAChB;YAEA,OAAOX;QACX;QACA,GAAGY,oBAAoB;IAC3B;IAEA,oCAAoC,GACpCN,UAAG,CAACO,KAAK,CAAC,qBAAqB,IAAMC,KAAKC,SAAS,CAAC;YAAExB;QAAU,GAAG,MAAM;IACzE,OAAO;QAAEA;IAAU;AACvB;AAEA,SAASqB;IACL,MAAMI,UAAUC,IAAAA,8BAAuB;IACvC,oCAAoC,GACpCX,UAAG,CAACO,KAAK,CAAC,qBAAqB,IAAMC,KAAKC,SAAS,CAAC;YAAEC;QAAQ,GAAG,MAAM;IAEvE,MAAME,SAASC,IAAAA,WAAI,EAACH,SAASI,qCAA8B;IAC3D,IAAI,OAAOF,OAAOG,KAAK,KAAK,UAAU;QAClC,IAAIC,WAAE,CAACC,UAAU,CAACL,OAAOG,KAAK,GAAG;YAC7BH,OAAOG,KAAK,GAAGG,QAAQC,aAAI,CAACC,OAAO,CAACR,OAAOG,KAAK;QACpD,OAAO;YACH,OAAOH,OAAOG,KAAK;QACvB;IACJ;IAEA,IAAIH,OAAOS,MAAM,KAAKC,WAAW;QAC7B,MAAMC,cAAcb,QAAQa,WAAW;QACvC,IAAIA,gBAAgBD,WAAW;YAC3BtB,UAAG,CAACK,OAAO,CAACmB;YACZ,IAAI,OAAOD,gBAAgB,UAAU;gBACjCX,OAAOS,MAAM,GAAGE;YACpB;QACJ,OAAO;YACHX,OAAOS,MAAM,GAAG;QACpB;IACJ;IAEA,OAAO;QAAE,GAAGT,MAAM;QAAE,GAAGF,QAAQzB,SAAS;IAAC;AAC7C;AAEA,MAAMuC,mCAAmC,CAAC;;;AAG1C,CAAC,CACIC,OAAO,CAAC,UAAU,KAClBC,IAAI"}
1
+ {"version":3,"sources":["../../../src/webpack/configs/dev-server-config.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport { Configuration } from 'webpack';\nimport {\n allowedWebpackDevServerOptions,\n getWebpackConfiguration,\n isDevServerDisabled,\n log,\n pick,\n} from '../../utils';\nimport { statsConfig } from './stats-config';\nimport { Context, Overrides } from './types';\n\ntype DevServerConfig = NonNullable<Configuration['devServer']>;\ntype Result = Pick<Configuration, 'devServer'> | undefined;\n\nexport function devServerConfig(context: Context, overrides: Overrides): Result {\n if (context.isProduction || context.emitExposedDependencies || isDevServerDisabled()) {\n return;\n }\n\n const devServer: DevServerConfig = {\n hot: false,\n port: 8080,\n historyApiFallback: true,\n devMiddleware: { writeToDisk: true, ...statsConfig(context, overrides) },\n headers: {\n 'Access-Control-Allow-Origin': '*',\n 'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept',\n },\n setupMiddlewares: (middlewares, devServer) => {\n if (devServer.app) {\n devServer.app.use((request, _, next) => {\n log.info(`[${log.timestamp}]: ${request.method} ${request.url}`);\n next();\n });\n } else {\n log.warning('webpack-dev-server app is not defined');\n }\n\n return middlewares;\n },\n ...getDevServerConfig(),\n };\n\n /* istanbul ignore next: debug only */\n log.debug('dev-server-config', () => JSON.stringify({ devServer }, null, 2));\n return { devServer };\n}\n\nfunction getDevServerConfig() {\n const webpack = getWebpackConfiguration();\n /* istanbul ignore next: debug only */\n log.debug('dev-server-config', () => JSON.stringify({ webpack }, null, 2));\n\n const result = pick(webpack, allowedWebpackDevServerOptions);\n if (typeof result.proxy === 'string') {\n if (fs.existsSync(result.proxy)) {\n result.proxy = require(path.resolve(result.proxy));\n } else {\n delete result.proxy;\n }\n }\n\n if (result.static === undefined) {\n const contentBase = webpack.contentBase;\n if (contentBase !== undefined) {\n log.warning(CONTENT_BASE_DEPRECATION_WARNING);\n if (typeof contentBase !== 'number') {\n result.static = contentBase;\n }\n } else {\n result.static = '.';\n }\n }\n\n return { ...result, ...webpack.devServer } as Partial<DevServerConfig>;\n}\n\nconst CONTENT_BASE_DEPRECATION_WARNING = `\n DEPRECATION WARNING: webpack.contentBase in package.json is deprecated.\n Use webpack.static instead.\n`\n .replace(/\\n\\s*/g, ' ')\n .trim();\n"],"names":["devServerConfig","context","overrides","isProduction","emitExposedDependencies","isDevServerDisabled","devServer","hot","port","historyApiFallback","devMiddleware","writeToDisk","statsConfig","headers","setupMiddlewares","middlewares","app","use","request","_","next","log","info","timestamp","method","url","warning","getDevServerConfig","debug","JSON","stringify","webpack","getWebpackConfiguration","result","pick","allowedWebpackDevServerOptions","proxy","fs","existsSync","require","path","resolve","static","undefined","contentBase","CONTENT_BASE_DEPRECATION_WARNING","replace","trim"],"mappings":";;;;+BAgBgBA;;;eAAAA;;;2DAhBD;6DACE;uBAQV;6BACqB;;;;;;AAMrB,SAASA,gBAAgBC,OAAgB,EAAEC,SAAoB;IAClE,IAAID,QAAQE,YAAY,IAAIF,QAAQG,uBAAuB,IAAIC,IAAAA,0BAAmB,KAAI;QAClF;IACJ;IAEA,MAAMC,YAA6B;QAC/BC,KAAK;QACLC,MAAM;QACNC,oBAAoB;QACpBC,eAAe;YAAEC,aAAa;YAAM,GAAGC,IAAAA,wBAAW,EAACX,SAASC,UAAU;QAAC;QACvEW,SAAS;YACL,+BAA+B;YAC/B,gCAAgC;QACpC;QACAC,kBAAkB,CAACC,aAAaT;YAC5B,IAAIA,UAAUU,GAAG,EAAE;gBACfV,UAAUU,GAAG,CAACC,GAAG,CAAC,CAACC,SAASC,GAAGC;oBAC3BC,UAAG,CAACC,IAAI,CAAC,CAAC,CAAC,EAAED,UAAG,CAACE,SAAS,CAAC,GAAG,EAAEL,QAAQM,MAAM,CAAC,CAAC,EAAEN,QAAQO,GAAG,EAAE;oBAC/DL;gBACJ;YACJ,OAAO;gBACHC,UAAG,CAACK,OAAO,CAAC;YAChB;YAEA,OAAOX;QACX;QACA,GAAGY,oBAAoB;IAC3B;IAEA,oCAAoC,GACpCN,UAAG,CAACO,KAAK,CAAC,qBAAqB,IAAMC,KAAKC,SAAS,CAAC;YAAExB;QAAU,GAAG,MAAM;IACzE,OAAO;QAAEA;IAAU;AACvB;AAEA,SAASqB;IACL,MAAMI,UAAUC,IAAAA,8BAAuB;IACvC,oCAAoC,GACpCX,UAAG,CAACO,KAAK,CAAC,qBAAqB,IAAMC,KAAKC,SAAS,CAAC;YAAEC;QAAQ,GAAG,MAAM;IAEvE,MAAME,SAASC,IAAAA,WAAI,EAACH,SAASI,qCAA8B;IAC3D,IAAI,OAAOF,OAAOG,KAAK,KAAK,UAAU;QAClC,IAAIC,WAAE,CAACC,UAAU,CAACL,OAAOG,KAAK,GAAG;YAC7BH,OAAOG,KAAK,GAAGG,QAAQC,aAAI,CAACC,OAAO,CAACR,OAAOG,KAAK;QACpD,OAAO;YACH,OAAOH,OAAOG,KAAK;QACvB;IACJ;IAEA,IAAIH,OAAOS,MAAM,KAAKC,WAAW;QAC7B,MAAMC,cAAcb,QAAQa,WAAW;QACvC,IAAIA,gBAAgBD,WAAW;YAC3BtB,UAAG,CAACK,OAAO,CAACmB;YACZ,IAAI,OAAOD,gBAAgB,UAAU;gBACjCX,OAAOS,MAAM,GAAGE;YACpB;QACJ,OAAO;YACHX,OAAOS,MAAM,GAAG;QACpB;IACJ;IAEA,OAAO;QAAE,GAAGT,MAAM;QAAE,GAAGF,QAAQzB,SAAS;IAAC;AAC7C;AAEA,MAAMuC,mCAAmC,CAAC;;;AAG1C,CAAC,CACIC,OAAO,CAAC,UAAU,KAClBC,IAAI"}
@@ -1 +1 @@
1
- {"version":3,"file":"entry.config.d.ts","sourceRoot":"","sources":["../../../src/webpack/configs/entry.config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAExC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAG7C,KAAK,MAAM,GAAG,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;AAE3C,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,CAclE"}
1
+ {"version":3,"file":"entry.config.d.ts","sourceRoot":"","sources":["../../../src/webpack/configs/entry.config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAGxC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAG7C,KAAK,MAAM,GAAG,IAAI,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;AAE3C,wBAAgB,WAAW,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,CAMlE"}
@@ -10,24 +10,33 @@ Object.defineProperty(exports, "entryConfig", {
10
10
  });
11
11
  const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
12
12
  const _utils = require("../utils");
13
+ const _plugins = require("./plugins");
13
14
  function _interop_require_default(obj) {
14
15
  return obj && obj.__esModule ? obj : {
15
16
  default: obj
16
17
  };
17
18
  }
18
19
  function entryConfig(context, _) {
19
- const { destination, isExposeSharedDependencies, sharedDependencies, source } = context;
20
+ const entry = context.emitExposedDependencies ? getSharedEntryPoints(context) : getIndexEntryPoint(context);
21
+ return {
22
+ entry
23
+ };
24
+ }
25
+ function getIndexEntryPoint({ source, destination }) {
20
26
  const index = _fs.default.existsSync(`./${source}/index.js`) ? `./${source}/index` : `./${destination}/index`;
21
- const entry = {
27
+ return {
22
28
  main: [
23
29
  index
24
30
  ]
25
31
  };
26
- if (isExposeSharedDependencies) {
27
- entry.main.push(...Object.keys(sharedDependencies).map(_utils.getModuleEntryPath));
28
- }
32
+ }
33
+ function getSharedEntryPoints(context) {
34
+ const { sharedDependencies } = context;
29
35
  return {
30
- entry
36
+ shared: Object.keys(sharedDependencies).map(_utils.getModuleEntryPath),
37
+ ...sharedDependencies['@servicetitan/design-system'] ? {
38
+ 'design-system': (0, _plugins.getDesignSystemPath)(context)
39
+ } : {}
31
40
  };
32
41
  }
33
42
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/webpack/configs/entry.config.ts"],"sourcesContent":["import fs from 'fs';\nimport { Configuration } from 'webpack';\nimport { getModuleEntryPath } from '../utils';\nimport { Context, Overrides } from './types';\n\ntype Config = Configuration['entry'];\ntype Result = Pick<Configuration, 'entry'>;\n\nexport function entryConfig(context: Context, _: Overrides): Result {\n const { destination, isExposeSharedDependencies, sharedDependencies, source } = context;\n\n const index = fs.existsSync(`./${source}/index.js`)\n ? `./${source}/index`\n : `./${destination}/index`;\n\n const entry: Config = { main: [index] };\n\n if (isExposeSharedDependencies) {\n (entry.main as string[]).push(...Object.keys(sharedDependencies).map(getModuleEntryPath));\n }\n\n return { entry };\n}\n"],"names":["entryConfig","context","_","destination","isExposeSharedDependencies","sharedDependencies","source","index","fs","existsSync","entry","main","push","Object","keys","map","getModuleEntryPath"],"mappings":";;;;+BAQgBA;;;eAAAA;;;2DARD;uBAEoB;;;;;;AAM5B,SAASA,YAAYC,OAAgB,EAAEC,CAAY;IACtD,MAAM,EAAEC,WAAW,EAAEC,0BAA0B,EAAEC,kBAAkB,EAAEC,MAAM,EAAE,GAAGL;IAEhF,MAAMM,QAAQC,WAAE,CAACC,UAAU,CAAC,CAAC,EAAE,EAAEH,OAAO,SAAS,CAAC,IAC5C,CAAC,EAAE,EAAEA,OAAO,MAAM,CAAC,GACnB,CAAC,EAAE,EAAEH,YAAY,MAAM,CAAC;IAE9B,MAAMO,QAAgB;QAAEC,MAAM;YAACJ;SAAM;IAAC;IAEtC,IAAIH,4BAA4B;QAC3BM,MAAMC,IAAI,CAAcC,IAAI,IAAIC,OAAOC,IAAI,CAACT,oBAAoBU,GAAG,CAACC,yBAAkB;IAC3F;IAEA,OAAO;QAAEN;IAAM;AACnB"}
1
+ {"version":3,"sources":["../../../src/webpack/configs/entry.config.ts"],"sourcesContent":["import fs from 'fs';\nimport { Configuration } from 'webpack';\nimport { getModuleEntryPath } from '../utils';\nimport { getDesignSystemPath } from './plugins';\nimport { Context, Overrides } from './types';\n\ntype Config = Configuration['entry'];\ntype Result = Pick<Configuration, 'entry'>;\n\nexport function entryConfig(context: Context, _: Overrides): Result {\n const entry: Config = context.emitExposedDependencies\n ? getSharedEntryPoints(context)\n : getIndexEntryPoint(context);\n\n return { entry };\n}\n\nfunction getIndexEntryPoint({ source, destination }: Context): Config {\n const index = fs.existsSync(`./${source}/index.js`)\n ? `./${source}/index`\n : `./${destination}/index`;\n return { main: [index] };\n}\n\nfunction getSharedEntryPoints(context: Context): Config {\n const { sharedDependencies } = context;\n return {\n shared: Object.keys(sharedDependencies).map(getModuleEntryPath),\n ...(sharedDependencies['@servicetitan/design-system']\n ? { 'design-system': getDesignSystemPath(context) }\n : {}),\n };\n}\n"],"names":["entryConfig","context","_","entry","emitExposedDependencies","getSharedEntryPoints","getIndexEntryPoint","source","destination","index","fs","existsSync","main","sharedDependencies","shared","Object","keys","map","getModuleEntryPath","getDesignSystemPath"],"mappings":";;;;+BASgBA;;;eAAAA;;;2DATD;uBAEoB;yBACC;;;;;;AAM7B,SAASA,YAAYC,OAAgB,EAAEC,CAAY;IACtD,MAAMC,QAAgBF,QAAQG,uBAAuB,GAC/CC,qBAAqBJ,WACrBK,mBAAmBL;IAEzB,OAAO;QAAEE;IAAM;AACnB;AAEA,SAASG,mBAAmB,EAAEC,MAAM,EAAEC,WAAW,EAAW;IACxD,MAAMC,QAAQC,WAAE,CAACC,UAAU,CAAC,CAAC,EAAE,EAAEJ,OAAO,SAAS,CAAC,IAC5C,CAAC,EAAE,EAAEA,OAAO,MAAM,CAAC,GACnB,CAAC,EAAE,EAAEC,YAAY,MAAM,CAAC;IAC9B,OAAO;QAAEI,MAAM;YAACH;SAAM;IAAC;AAC3B;AAEA,SAASJ,qBAAqBJ,OAAgB;IAC1C,MAAM,EAAEY,kBAAkB,EAAE,GAAGZ;IAC/B,OAAO;QACHa,QAAQC,OAAOC,IAAI,CAACH,oBAAoBI,GAAG,CAACC,yBAAkB;QAC9D,GAAIL,kBAAkB,CAAC,8BAA8B,GAC/C;YAAE,iBAAiBM,IAAAA,4BAAmB,EAAClB;QAAS,IAChD,CAAC,CAAC;IACZ;AACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"externals-config.d.ts","sourceRoot":"","sources":["../../../src/webpack/configs/externals-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAG7C,KAAK,MAAM,GAAG,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,GAAG,SAAS,CAAC;AAE3D,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,CActE"}
1
+ {"version":3,"file":"externals-config.d.ts","sourceRoot":"","sources":["../../../src/webpack/configs/externals-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAG7C,KAAK,MAAM,GAAG,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,GAAG,SAAS,CAAC;AAE3D,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,CAetE"}
@@ -9,10 +9,11 @@ Object.defineProperty(exports, "externalsConfig", {
9
9
  }
10
10
  });
11
11
  function externalsConfig(context, _) {
12
- const { embed, name, sharedDependencies } = context;
13
- if (!embed) {
12
+ if (!needsExternals(context)) {
14
13
  return;
15
14
  }
15
+ const { sharedDependencies } = context;
16
+ const name = context.name || context.packageData.name;
16
17
  const externals = Object.fromEntries(Object.entries(sharedDependencies).map(([dependency, variable])=>[
17
18
  dependency,
18
19
  `${variable}['${name}']`
@@ -21,5 +22,8 @@ function externalsConfig(context, _) {
21
22
  externals
22
23
  };
23
24
  }
25
+ function needsExternals({ embed, emitExposedDependencies, isExposeSharedDependencies }) {
26
+ return !!embed || isExposeSharedDependencies && !emitExposedDependencies;
27
+ }
24
28
 
25
29
  //# sourceMappingURL=externals-config.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/webpack/configs/externals-config.ts"],"sourcesContent":["import { Configuration } from 'webpack';\nimport { Context, Overrides } from './types';\n\ntype Config = Configuration['externals'];\ntype Result = Pick<Configuration, 'externals'> | undefined;\n\nexport function externalsConfig(context: Context, _: Overrides): Result {\n const { embed, name, sharedDependencies } = context;\n if (!embed) {\n return;\n }\n\n const externals: Config = Object.fromEntries(\n Object.entries(sharedDependencies).map(([dependency, variable]) => [\n dependency,\n `${variable}['${name}']`,\n ])\n );\n\n return { externals };\n}\n"],"names":["externalsConfig","context","_","embed","name","sharedDependencies","externals","Object","fromEntries","entries","map","dependency","variable"],"mappings":";;;;+BAMgBA;;;eAAAA;;;AAAT,SAASA,gBAAgBC,OAAgB,EAAEC,CAAY;IAC1D,MAAM,EAAEC,KAAK,EAAEC,IAAI,EAAEC,kBAAkB,EAAE,GAAGJ;IAC5C,IAAI,CAACE,OAAO;QACR;IACJ;IAEA,MAAMG,YAAoBC,OAAOC,WAAW,CACxCD,OAAOE,OAAO,CAACJ,oBAAoBK,GAAG,CAAC,CAAC,CAACC,YAAYC,SAAS,GAAK;YAC/DD;YACA,GAAGC,SAAS,EAAE,EAAER,KAAK,EAAE,CAAC;SAC3B;IAGL,OAAO;QAAEE;IAAU;AACvB"}
1
+ {"version":3,"sources":["../../../src/webpack/configs/externals-config.ts"],"sourcesContent":["import { Configuration } from 'webpack';\nimport { Context, Overrides } from './types';\n\ntype Config = Configuration['externals'];\ntype Result = Pick<Configuration, 'externals'> | undefined;\n\nexport function externalsConfig(context: Context, _: Overrides): Result {\n if (!needsExternals(context)) {\n return;\n }\n\n const { sharedDependencies } = context;\n const name = context.name || context.packageData.name;\n const externals: Config = Object.fromEntries(\n Object.entries(sharedDependencies).map(([dependency, variable]) => [\n dependency,\n `${variable}['${name}']`,\n ])\n );\n\n return { externals };\n}\n\nfunction needsExternals({ embed, emitExposedDependencies, isExposeSharedDependencies }: Context) {\n return !!embed || (isExposeSharedDependencies && !emitExposedDependencies);\n}\n"],"names":["externalsConfig","context","_","needsExternals","sharedDependencies","name","packageData","externals","Object","fromEntries","entries","map","dependency","variable","embed","emitExposedDependencies","isExposeSharedDependencies"],"mappings":";;;;+BAMgBA;;;eAAAA;;;AAAT,SAASA,gBAAgBC,OAAgB,EAAEC,CAAY;IAC1D,IAAI,CAACC,eAAeF,UAAU;QAC1B;IACJ;IAEA,MAAM,EAAEG,kBAAkB,EAAE,GAAGH;IAC/B,MAAMI,OAAOJ,QAAQI,IAAI,IAAIJ,QAAQK,WAAW,CAACD,IAAI;IACrD,MAAME,YAAoBC,OAAOC,WAAW,CACxCD,OAAOE,OAAO,CAACN,oBAAoBO,GAAG,CAAC,CAAC,CAACC,YAAYC,SAAS,GAAK;YAC/DD;YACA,GAAGC,SAAS,EAAE,EAAER,KAAK,EAAE,CAAC;SAC3B;IAGL,OAAO;QAAEE;IAAU;AACvB;AAEA,SAASJ,eAAe,EAAEW,KAAK,EAAEC,uBAAuB,EAAEC,0BAA0B,EAAW;IAC3F,OAAO,CAAC,CAACF,SAAUE,8BAA8B,CAACD;AACtD"}
@@ -1,4 +1,5 @@
1
1
  export * from './amd-config';
2
+ export * from './cache-config';
2
3
  export * from './dev-server-config';
3
4
  export * from './devtool-config';
4
5
  export * from './entry.config';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/webpack/configs/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,mBAAmB,SAAS,CAAC;AAC7B,cAAc,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/webpack/configs/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,iBAAiB,CAAC;AAChC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,mBAAmB,SAAS,CAAC;AAC7B,cAAc,wBAAwB,CAAC"}
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", {
3
3
  value: true
4
4
  });
5
5
  _export_star(require("./amd-config"), exports);
6
+ _export_star(require("./cache-config"), exports);
6
7
  _export_star(require("./dev-server-config"), exports);
7
8
  _export_star(require("./devtool-config"), exports);
8
9
  _export_star(require("./entry.config"), exports);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/webpack/configs/index.ts"],"sourcesContent":["export * from './amd-config';\nexport * from './dev-server-config';\nexport * from './devtool-config';\nexport * from './entry.config';\nexport * from './externals-config';\nexport * from './module-config';\nexport * from './optimization-config';\nexport * from './output-config';\nexport * from './plugins-config';\nexport * from './resolve-config';\nexport * from './stats-config';\nexport type * from './types';\nexport * from './watch-options-config';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBAEA"}
1
+ {"version":3,"sources":["../../../src/webpack/configs/index.ts"],"sourcesContent":["export * from './amd-config';\nexport * from './cache-config';\nexport * from './dev-server-config';\nexport * from './devtool-config';\nexport * from './entry.config';\nexport * from './externals-config';\nexport * from './module-config';\nexport * from './optimization-config';\nexport * from './output-config';\nexport * from './plugins-config';\nexport * from './resolve-config';\nexport * from './stats-config';\nexport type * from './types';\nexport * from './watch-options-config';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBAEA"}
@@ -1 +1 @@
1
- {"version":3,"file":"optimization-config.d.ts","sourceRoot":"","sources":["../../../src/webpack/configs/optimization-config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAI7C,KAAK,MAAM,GAAG,IAAI,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;AAElD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,CAmBzE"}
1
+ {"version":3,"file":"optimization-config.d.ts","sourceRoot":"","sources":["../../../src/webpack/configs/optimization-config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAI7C,KAAK,MAAM,GAAG,IAAI,CAAC,aAAa,EAAE,cAAc,CAAC,CAAC;AAElD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,CAqBzE"}
@@ -16,7 +16,7 @@ function _interop_require_default(obj) {
16
16
  };
17
17
  }
18
18
  function optimizationConfig(context, _) {
19
- const { headless, isProduction } = context;
19
+ const { emitExposedDependencies, headless, isProduction } = context;
20
20
  const optimization = {
21
21
  chunkIds: isProduction ? 'deterministic' : 'named',
22
22
  moduleIds: 'size',
@@ -25,7 +25,9 @@ function optimizationConfig(context, _) {
25
25
  cacheGroups: {}
26
26
  }
27
27
  };
28
- if (!headless && isProduction) {
28
+ if (emitExposedDependencies) {
29
+ optimization.runtimeChunk = false;
30
+ } else if (!headless && isProduction) {
29
31
  optimization.runtimeChunk = 'single';
30
32
  }
31
33
  [
@@ -71,18 +73,12 @@ function minimizeConfig(optimization, context) {
71
73
  ];
72
74
  }
73
75
  function sharedDependenciesConfig(optimization, context) {
74
- const { headless, isExposeSharedDependencies } = context;
75
- if (!isExposeSharedDependencies || headless) {
76
+ const { emitExposedDependencies } = context;
77
+ if (!emitExposedDependencies) {
76
78
  return;
77
79
  }
78
80
  Object.assign(optimization.splitChunks.cacheGroups, {
79
- 'design-system': {
80
- test: /[\\/]node_modules[\\/]@servicetitan[\\/](tokens|anvil-fonts|design-system)[\\/].*\.css$/,
81
- name: 'design-system',
82
- chunks: 'all',
83
- enforce: true
84
- },
85
- 'anvil2': {
81
+ anvil2: {
86
82
  test: /@servicetitan[\\/]anvil2[\\/].*\.css$/,
87
83
  name: 'anvil2',
88
84
  chunks: 'all',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/webpack/configs/optimization-config.ts"],"sourcesContent":["import CssMinimizerWebpackPlugin from 'css-minimizer-webpack-plugin';\nimport TerserPlugin from 'terser-webpack-plugin';\nimport { Configuration } from 'webpack';\nimport { Context, Overrides } from './types';\n\ntype Config = Configuration['optimization'];\ntype ConfigWithCacheGroups = Config & { splitChunks: { cacheGroups: Record<string, any> } };\ntype Result = Pick<Configuration, 'optimization'>;\n\nexport function optimizationConfig(context: Context, _: Overrides): Result {\n const { headless, isProduction } = context;\n\n const optimization: ConfigWithCacheGroups = {\n chunkIds: isProduction ? 'deterministic' : 'named',\n moduleIds: 'size',\n mangleExports: 'size',\n splitChunks: { cacheGroups: {} },\n };\n\n if (!headless && isProduction) {\n optimization.runtimeChunk = 'single';\n }\n\n [minimizeConfig, sharedDependenciesConfig, webComponentConfig].forEach(handler =>\n handler(optimization, context)\n );\n\n return { optimization };\n}\n\nfunction minimizeConfig(optimization: ConfigWithCacheGroups, context: Context) {\n const { isProduction, codeCoverage } = context;\n if (!isProduction) {\n return;\n }\n\n const minifyJs = context.minify?.js ?? true;\n const minifyCss = context.minify?.css ?? true;\n optimization.minimize = !codeCoverage && (!!minifyJs || !!minifyCss);\n if (!optimization.minimize) {\n return;\n }\n\n const terserOptions = {\n compress: false,\n mangle: false,\n ...(typeof minifyJs === 'object' ? minifyJs : {}),\n };\n\n const cssMinimizerPluginOptions = {\n ...(typeof minifyCss === 'object' ? minifyCss : {}),\n };\n\n optimization.minimizer = [\n ...(minifyJs ? [new TerserPlugin({ terserOptions })] : []),\n ...(minifyCss ? [new CssMinimizerWebpackPlugin(cssMinimizerPluginOptions)] : []),\n ];\n}\n\nfunction sharedDependenciesConfig(optimization: ConfigWithCacheGroups, context: Context) {\n const { headless, isExposeSharedDependencies } = context;\n if (!isExposeSharedDependencies || headless) {\n return;\n }\n\n Object.assign(optimization.splitChunks.cacheGroups, {\n 'design-system': {\n test: /[\\\\/]node_modules[\\\\/]@servicetitan[\\\\/](tokens|anvil-fonts|design-system)[\\\\/].*\\.css$/,\n name: 'design-system',\n chunks: 'all',\n enforce: true,\n },\n 'anvil2': {\n test: /@servicetitan[\\\\/]anvil2[\\\\/].*\\.css$/,\n name: 'anvil2',\n chunks: 'all',\n enforce: true,\n },\n });\n}\n\nfunction webComponentConfig(optimization: ConfigWithCacheGroups, context: Context) {\n const { headless, isWebComponent, isProduction } = context;\n if (!isWebComponent || headless) {\n return;\n }\n\n Object.assign(optimization.splitChunks.cacheGroups, {\n styles: {\n name: 'main',\n type: 'css/mini-extract',\n chunks: 'all',\n enforce: true,\n },\n });\n\n if (!isProduction) {\n return;\n }\n\n Object.assign(optimization.splitChunks.cacheGroups, {\n common: {\n name: 'common',\n test: /[\\\\/]node_modules[\\\\/](axios|classnames|formstate|mobx|mobx-react|mobx-utils|react|react-dom|react-router|react-router-dom)[\\\\/]/,\n chunks: 'all',\n },\n kendo: {\n name: 'kendo',\n test: /[\\\\/]node_modules[\\\\/](@progress|@telerik)[\\\\/]/,\n chunks: 'all',\n },\n servicetitan: {\n name: 'servicetitan',\n test: /[\\\\/]node_modules[\\\\/]@servicetitan[\\\\/]/,\n chunks: 'all',\n },\n });\n}\n"],"names":["optimizationConfig","context","_","headless","isProduction","optimization","chunkIds","moduleIds","mangleExports","splitChunks","cacheGroups","runtimeChunk","minimizeConfig","sharedDependenciesConfig","webComponentConfig","forEach","handler","codeCoverage","minifyJs","minify","js","minifyCss","css","minimize","terserOptions","compress","mangle","cssMinimizerPluginOptions","minimizer","TerserPlugin","CssMinimizerWebpackPlugin","isExposeSharedDependencies","Object","assign","test","name","chunks","enforce","isWebComponent","styles","type","common","kendo","servicetitan"],"mappings":";;;;+BASgBA;;;eAAAA;;;kFATsB;4EACb;;;;;;AAQlB,SAASA,mBAAmBC,OAAgB,EAAEC,CAAY;IAC7D,MAAM,EAAEC,QAAQ,EAAEC,YAAY,EAAE,GAAGH;IAEnC,MAAMI,eAAsC;QACxCC,UAAUF,eAAe,kBAAkB;QAC3CG,WAAW;QACXC,eAAe;QACfC,aAAa;YAAEC,aAAa,CAAC;QAAE;IACnC;IAEA,IAAI,CAACP,YAAYC,cAAc;QAC3BC,aAAaM,YAAY,GAAG;IAChC;IAEA;QAACC;QAAgBC;QAA0BC;KAAmB,CAACC,OAAO,CAACC,CAAAA,UACnEA,QAAQX,cAAcJ;IAG1B,OAAO;QAAEI;IAAa;AAC1B;AAEA,SAASO,eAAeP,YAAmC,EAAEJ,OAAgB;QAMxDA,iBACCA;IANlB,MAAM,EAAEG,YAAY,EAAEa,YAAY,EAAE,GAAGhB;IACvC,IAAI,CAACG,cAAc;QACf;IACJ;QAEiBH;IAAjB,MAAMiB,WAAWjB,CAAAA,sBAAAA,kBAAAA,QAAQkB,MAAM,cAAdlB,sCAAAA,gBAAgBmB,EAAE,cAAlBnB,gCAAAA,qBAAsB;QACrBA;IAAlB,MAAMoB,YAAYpB,CAAAA,uBAAAA,mBAAAA,QAAQkB,MAAM,cAAdlB,uCAAAA,iBAAgBqB,GAAG,cAAnBrB,iCAAAA,sBAAuB;IACzCI,aAAakB,QAAQ,GAAG,CAACN,gBAAiB,CAAA,CAAC,CAACC,YAAY,CAAC,CAACG,SAAQ;IAClE,IAAI,CAAChB,aAAakB,QAAQ,EAAE;QACxB;IACJ;IAEA,MAAMC,gBAAgB;QAClBC,UAAU;QACVC,QAAQ;QACR,GAAI,OAAOR,aAAa,WAAWA,WAAW,CAAC,CAAC;IACpD;IAEA,MAAMS,4BAA4B;QAC9B,GAAI,OAAON,cAAc,WAAWA,YAAY,CAAC,CAAC;IACtD;IAEAhB,aAAauB,SAAS,GAAG;WACjBV,WAAW;YAAC,IAAIW,4BAAY,CAAC;gBAAEL;YAAc;SAAG,GAAG,EAAE;WACrDH,YAAY;YAAC,IAAIS,kCAAyB,CAACH;SAA2B,GAAG,EAAE;KAClF;AACL;AAEA,SAASd,yBAAyBR,YAAmC,EAAEJ,OAAgB;IACnF,MAAM,EAAEE,QAAQ,EAAE4B,0BAA0B,EAAE,GAAG9B;IACjD,IAAI,CAAC8B,8BAA8B5B,UAAU;QACzC;IACJ;IAEA6B,OAAOC,MAAM,CAAC5B,aAAaI,WAAW,CAACC,WAAW,EAAE;QAChD,iBAAiB;YACbwB,MAAM;YACNC,MAAM;YACNC,QAAQ;YACRC,SAAS;QACb;QACA,UAAU;YACNH,MAAM;YACNC,MAAM;YACNC,QAAQ;YACRC,SAAS;QACb;IACJ;AACJ;AAEA,SAASvB,mBAAmBT,YAAmC,EAAEJ,OAAgB;IAC7E,MAAM,EAAEE,QAAQ,EAAEmC,cAAc,EAAElC,YAAY,EAAE,GAAGH;IACnD,IAAI,CAACqC,kBAAkBnC,UAAU;QAC7B;IACJ;IAEA6B,OAAOC,MAAM,CAAC5B,aAAaI,WAAW,CAACC,WAAW,EAAE;QAChD6B,QAAQ;YACJJ,MAAM;YACNK,MAAM;YACNJ,QAAQ;YACRC,SAAS;QACb;IACJ;IAEA,IAAI,CAACjC,cAAc;QACf;IACJ;IAEA4B,OAAOC,MAAM,CAAC5B,aAAaI,WAAW,CAACC,WAAW,EAAE;QAChD+B,QAAQ;YACJN,MAAM;YACND,MAAM;YACNE,QAAQ;QACZ;QACAM,OAAO;YACHP,MAAM;YACND,MAAM;YACNE,QAAQ;QACZ;QACAO,cAAc;YACVR,MAAM;YACND,MAAM;YACNE,QAAQ;QACZ;IACJ;AACJ"}
1
+ {"version":3,"sources":["../../../src/webpack/configs/optimization-config.ts"],"sourcesContent":["import CssMinimizerWebpackPlugin from 'css-minimizer-webpack-plugin';\nimport TerserPlugin from 'terser-webpack-plugin';\nimport { Configuration } from 'webpack';\nimport { Context, Overrides } from './types';\n\ntype Config = Configuration['optimization'];\ntype ConfigWithCacheGroups = Config & { splitChunks: { cacheGroups: Record<string, any> } };\ntype Result = Pick<Configuration, 'optimization'>;\n\nexport function optimizationConfig(context: Context, _: Overrides): Result {\n const { emitExposedDependencies, headless, isProduction } = context;\n\n const optimization: ConfigWithCacheGroups = {\n chunkIds: isProduction ? 'deterministic' : 'named',\n moduleIds: 'size',\n mangleExports: 'size',\n splitChunks: { cacheGroups: {} },\n };\n\n if (emitExposedDependencies) {\n optimization.runtimeChunk = false;\n } else if (!headless && isProduction) {\n optimization.runtimeChunk = 'single';\n }\n\n [minimizeConfig, sharedDependenciesConfig, webComponentConfig].forEach(handler =>\n handler(optimization, context)\n );\n\n return { optimization };\n}\n\nfunction minimizeConfig(optimization: ConfigWithCacheGroups, context: Context) {\n const { isProduction, codeCoverage } = context;\n if (!isProduction) {\n return;\n }\n\n const minifyJs = context.minify?.js ?? true;\n const minifyCss = context.minify?.css ?? true;\n optimization.minimize = !codeCoverage && (!!minifyJs || !!minifyCss);\n if (!optimization.minimize) {\n return;\n }\n\n const terserOptions = {\n compress: false,\n mangle: false,\n ...(typeof minifyJs === 'object' ? minifyJs : {}),\n };\n\n const cssMinimizerPluginOptions = {\n ...(typeof minifyCss === 'object' ? minifyCss : {}),\n };\n\n optimization.minimizer = [\n ...(minifyJs ? [new TerserPlugin({ terserOptions })] : []),\n ...(minifyCss ? [new CssMinimizerWebpackPlugin(cssMinimizerPluginOptions)] : []),\n ];\n}\n\nfunction sharedDependenciesConfig(optimization: ConfigWithCacheGroups, context: Context) {\n const { emitExposedDependencies } = context;\n if (!emitExposedDependencies) {\n return;\n }\n\n Object.assign(optimization.splitChunks.cacheGroups, {\n anvil2: {\n test: /@servicetitan[\\\\/]anvil2[\\\\/].*\\.css$/,\n name: 'anvil2',\n chunks: 'all',\n enforce: true,\n },\n });\n}\n\nfunction webComponentConfig(optimization: ConfigWithCacheGroups, context: Context) {\n const { headless, isWebComponent, isProduction } = context;\n if (!isWebComponent || headless) {\n return;\n }\n\n Object.assign(optimization.splitChunks.cacheGroups, {\n styles: {\n name: 'main',\n type: 'css/mini-extract',\n chunks: 'all',\n enforce: true,\n },\n });\n\n if (!isProduction) {\n return;\n }\n\n Object.assign(optimization.splitChunks.cacheGroups, {\n common: {\n name: 'common',\n test: /[\\\\/]node_modules[\\\\/](axios|classnames|formstate|mobx|mobx-react|mobx-utils|react|react-dom|react-router|react-router-dom)[\\\\/]/,\n chunks: 'all',\n },\n kendo: {\n name: 'kendo',\n test: /[\\\\/]node_modules[\\\\/](@progress|@telerik)[\\\\/]/,\n chunks: 'all',\n },\n servicetitan: {\n name: 'servicetitan',\n test: /[\\\\/]node_modules[\\\\/]@servicetitan[\\\\/]/,\n chunks: 'all',\n },\n });\n}\n"],"names":["optimizationConfig","context","_","emitExposedDependencies","headless","isProduction","optimization","chunkIds","moduleIds","mangleExports","splitChunks","cacheGroups","runtimeChunk","minimizeConfig","sharedDependenciesConfig","webComponentConfig","forEach","handler","codeCoverage","minifyJs","minify","js","minifyCss","css","minimize","terserOptions","compress","mangle","cssMinimizerPluginOptions","minimizer","TerserPlugin","CssMinimizerWebpackPlugin","Object","assign","anvil2","test","name","chunks","enforce","isWebComponent","styles","type","common","kendo","servicetitan"],"mappings":";;;;+BASgBA;;;eAAAA;;;kFATsB;4EACb;;;;;;AAQlB,SAASA,mBAAmBC,OAAgB,EAAEC,CAAY;IAC7D,MAAM,EAAEC,uBAAuB,EAAEC,QAAQ,EAAEC,YAAY,EAAE,GAAGJ;IAE5D,MAAMK,eAAsC;QACxCC,UAAUF,eAAe,kBAAkB;QAC3CG,WAAW;QACXC,eAAe;QACfC,aAAa;YAAEC,aAAa,CAAC;QAAE;IACnC;IAEA,IAAIR,yBAAyB;QACzBG,aAAaM,YAAY,GAAG;IAChC,OAAO,IAAI,CAACR,YAAYC,cAAc;QAClCC,aAAaM,YAAY,GAAG;IAChC;IAEA;QAACC;QAAgBC;QAA0BC;KAAmB,CAACC,OAAO,CAACC,CAAAA,UACnEA,QAAQX,cAAcL;IAG1B,OAAO;QAAEK;IAAa;AAC1B;AAEA,SAASO,eAAeP,YAAmC,EAAEL,OAAgB;QAMxDA,iBACCA;IANlB,MAAM,EAAEI,YAAY,EAAEa,YAAY,EAAE,GAAGjB;IACvC,IAAI,CAACI,cAAc;QACf;IACJ;QAEiBJ;IAAjB,MAAMkB,WAAWlB,CAAAA,sBAAAA,kBAAAA,QAAQmB,MAAM,cAAdnB,sCAAAA,gBAAgBoB,EAAE,cAAlBpB,gCAAAA,qBAAsB;QACrBA;IAAlB,MAAMqB,YAAYrB,CAAAA,uBAAAA,mBAAAA,QAAQmB,MAAM,cAAdnB,uCAAAA,iBAAgBsB,GAAG,cAAnBtB,iCAAAA,sBAAuB;IACzCK,aAAakB,QAAQ,GAAG,CAACN,gBAAiB,CAAA,CAAC,CAACC,YAAY,CAAC,CAACG,SAAQ;IAClE,IAAI,CAAChB,aAAakB,QAAQ,EAAE;QACxB;IACJ;IAEA,MAAMC,gBAAgB;QAClBC,UAAU;QACVC,QAAQ;QACR,GAAI,OAAOR,aAAa,WAAWA,WAAW,CAAC,CAAC;IACpD;IAEA,MAAMS,4BAA4B;QAC9B,GAAI,OAAON,cAAc,WAAWA,YAAY,CAAC,CAAC;IACtD;IAEAhB,aAAauB,SAAS,GAAG;WACjBV,WAAW;YAAC,IAAIW,4BAAY,CAAC;gBAAEL;YAAc;SAAG,GAAG,EAAE;WACrDH,YAAY;YAAC,IAAIS,kCAAyB,CAACH;SAA2B,GAAG,EAAE;KAClF;AACL;AAEA,SAASd,yBAAyBR,YAAmC,EAAEL,OAAgB;IACnF,MAAM,EAAEE,uBAAuB,EAAE,GAAGF;IACpC,IAAI,CAACE,yBAAyB;QAC1B;IACJ;IAEA6B,OAAOC,MAAM,CAAC3B,aAAaI,WAAW,CAACC,WAAW,EAAE;QAChDuB,QAAQ;YACJC,MAAM;YACNC,MAAM;YACNC,QAAQ;YACRC,SAAS;QACb;IACJ;AACJ;AAEA,SAASvB,mBAAmBT,YAAmC,EAAEL,OAAgB;IAC7E,MAAM,EAAEG,QAAQ,EAAEmC,cAAc,EAAElC,YAAY,EAAE,GAAGJ;IACnD,IAAI,CAACsC,kBAAkBnC,UAAU;QAC7B;IACJ;IAEA4B,OAAOC,MAAM,CAAC3B,aAAaI,WAAW,CAACC,WAAW,EAAE;QAChD6B,QAAQ;YACJJ,MAAM;YACNK,MAAM;YACNJ,QAAQ;YACRC,SAAS;QACb;IACJ;IAEA,IAAI,CAACjC,cAAc;QACf;IACJ;IAEA2B,OAAOC,MAAM,CAAC3B,aAAaI,WAAW,CAACC,WAAW,EAAE;QAChD+B,QAAQ;YACJN,MAAM;YACND,MAAM;YACNE,QAAQ;QACZ;QACAM,OAAO;YACHP,MAAM;YACND,MAAM;YACNE,QAAQ;QACZ;QACAO,cAAc;YACVR,MAAM;YACND,MAAM;YACNE,QAAQ;QACZ;IACJ;AACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"output-config.d.ts","sourceRoot":"","sources":["../../../src/webpack/configs/output-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAG7C,KAAK,MAAM,GAAG,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;AAE5C,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,CAuBnE"}
1
+ {"version":3,"file":"output-config.d.ts","sourceRoot":"","sources":["../../../src/webpack/configs/output-config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAI7C,KAAK,MAAM,GAAG,IAAI,CAAC,aAAa,EAAE,QAAQ,CAAC,CAAC;AAE5C,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,GAAG,MAAM,CAwBnE"}
@@ -9,23 +9,32 @@ Object.defineProperty(exports, "outputConfig", {
9
9
  }
10
10
  });
11
11
  const _path = /*#__PURE__*/ _interop_require_default(require("path"));
12
+ const _utils = require("./utils");
12
13
  function _interop_require_default(obj) {
13
14
  return obj && obj.__esModule ? obj : {
14
15
  default: obj
15
16
  };
16
17
  }
17
18
  function outputConfig(context, _) {
18
- const { destination, embed, headless, isProduction, isWebComponent, name } = context;
19
- const bundleDir = headless ? 'headless' : embed ? 'light' : 'full';
19
+ const { emitExposedDependencies, isProduction, isWebComponent, name } = context;
20
20
  const output = {
21
21
  filename: '[name].bundle.js',
22
- path: isWebComponent ? _path.default.join(process.cwd(), `${destination}/bundle/${bundleDir}`) : _path.default.join(process.cwd(), `${destination}/bundle`)
22
+ path: getOutputPath(context),
23
+ ...emitExposedDependencies ? {
24
+ chunkLoadingGlobal: `sharedChunk${name}`
25
+ } : {}
23
26
  };
24
27
  if (isProduction) {
25
28
  const cdnPath = process.env.CLIENT_CDN_PATH;
29
+ const exposedDependenciesDir = (0, _utils.getBundleType)({
30
+ ...context,
31
+ emitExposedDependencies: true
32
+ });
26
33
  Object.assign(output, {
27
34
  filename: '[name].[contenthash].bundle.js',
28
- clean: true,
35
+ clean: exposedDependenciesDir && !emitExposedDependencies ? {
36
+ keep: new RegExp(exposedDependenciesDir)
37
+ } : true,
29
38
  ...isWebComponent ? {
30
39
  uniqueName: name
31
40
  } : {},
@@ -38,5 +47,17 @@ function outputConfig(context, _) {
38
47
  output
39
48
  };
40
49
  }
50
+ function getOutputPath(context) {
51
+ const { destination, emitExposedDependencies } = context;
52
+ var _getBundleType;
53
+ const subdir = (_getBundleType = (0, _utils.getBundleType)(context)) !== null && _getBundleType !== void 0 ? _getBundleType : '';
54
+ if (typeof emitExposedDependencies === 'object') {
55
+ const { output } = emitExposedDependencies;
56
+ if (output === null || output === void 0 ? void 0 : output.path) {
57
+ return _path.default.join(output.path, subdir);
58
+ }
59
+ }
60
+ return _path.default.join(process.cwd(), destination, 'bundle', subdir);
61
+ }
41
62
 
42
63
  //# sourceMappingURL=output-config.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/webpack/configs/output-config.ts"],"sourcesContent":["import path from 'path';\nimport { Configuration } from 'webpack';\nimport { Context, Overrides } from './types';\n\ntype Config = Configuration['output'];\ntype Result = Pick<Configuration, 'output'>;\n\nexport function outputConfig(context: Context, _: Overrides): Result {\n const { destination, embed, headless, isProduction, isWebComponent, name } = context;\n\n const bundleDir = headless ? 'headless' : embed ? 'light' : 'full';\n\n const output: Config = {\n filename: '[name].bundle.js',\n path: isWebComponent\n ? path.join(process.cwd(), `${destination}/bundle/${bundleDir}`)\n : path.join(process.cwd(), `${destination}/bundle`),\n };\n\n if (isProduction) {\n const cdnPath = process.env.CLIENT_CDN_PATH;\n Object.assign(output, {\n filename: '[name].[contenthash].bundle.js',\n clean: true,\n ...(isWebComponent ? { uniqueName: name } : {}),\n ...(cdnPath ? { publicPath: cdnPath } : {}),\n });\n }\n\n return { output };\n}\n"],"names":["outputConfig","context","_","destination","embed","headless","isProduction","isWebComponent","name","bundleDir","output","filename","path","join","process","cwd","cdnPath","env","CLIENT_CDN_PATH","Object","assign","clean","uniqueName","publicPath"],"mappings":";;;;+BAOgBA;;;eAAAA;;;6DAPC;;;;;;AAOV,SAASA,aAAaC,OAAgB,EAAEC,CAAY;IACvD,MAAM,EAAEC,WAAW,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,YAAY,EAAEC,cAAc,EAAEC,IAAI,EAAE,GAAGP;IAE7E,MAAMQ,YAAYJ,WAAW,aAAaD,QAAQ,UAAU;IAE5D,MAAMM,SAAiB;QACnBC,UAAU;QACVC,MAAML,iBACAK,aAAI,CAACC,IAAI,CAACC,QAAQC,GAAG,IAAI,GAAGZ,YAAY,QAAQ,EAAEM,WAAW,IAC7DG,aAAI,CAACC,IAAI,CAACC,QAAQC,GAAG,IAAI,GAAGZ,YAAY,OAAO,CAAC;IAC1D;IAEA,IAAIG,cAAc;QACd,MAAMU,UAAUF,QAAQG,GAAG,CAACC,eAAe;QAC3CC,OAAOC,MAAM,CAACV,QAAQ;YAClBC,UAAU;YACVU,OAAO;YACP,GAAId,iBAAiB;gBAAEe,YAAYd;YAAK,IAAI,CAAC,CAAC;YAC9C,GAAIQ,UAAU;gBAAEO,YAAYP;YAAQ,IAAI,CAAC,CAAC;QAC9C;IACJ;IAEA,OAAO;QAAEN;IAAO;AACpB"}
1
+ {"version":3,"sources":["../../../src/webpack/configs/output-config.ts"],"sourcesContent":["import path from 'path';\nimport { Configuration } from 'webpack';\nimport { Context, Overrides } from './types';\nimport { getBundleType } from './utils';\n\ntype Config = Configuration['output'];\ntype Result = Pick<Configuration, 'output'>;\n\nexport function outputConfig(context: Context, _: Overrides): Result {\n const { emitExposedDependencies, isProduction, isWebComponent, name } = context;\n\n const output: Config = {\n filename: '[name].bundle.js',\n path: getOutputPath(context),\n ...(emitExposedDependencies ? { chunkLoadingGlobal: `sharedChunk${name}` } : {}),\n };\n\n if (isProduction) {\n const cdnPath = process.env.CLIENT_CDN_PATH;\n const exposedDependenciesDir = getBundleType({ ...context, emitExposedDependencies: true });\n Object.assign(output, {\n filename: '[name].[contenthash].bundle.js',\n clean:\n exposedDependenciesDir && !emitExposedDependencies\n ? { keep: new RegExp(exposedDependenciesDir) }\n : true,\n ...(isWebComponent ? { uniqueName: name } : {}),\n ...(cdnPath ? { publicPath: cdnPath } : {}),\n });\n }\n\n return { output };\n}\n\nfunction getOutputPath(context: Context) {\n const { destination, emitExposedDependencies } = context;\n\n const subdir = getBundleType(context) ?? '';\n if (typeof emitExposedDependencies === 'object') {\n const { output } = emitExposedDependencies;\n if (output?.path) {\n return path.join(output.path, subdir);\n }\n }\n\n return path.join(process.cwd(), destination, 'bundle', subdir);\n}\n"],"names":["outputConfig","context","_","emitExposedDependencies","isProduction","isWebComponent","name","output","filename","path","getOutputPath","chunkLoadingGlobal","cdnPath","process","env","CLIENT_CDN_PATH","exposedDependenciesDir","getBundleType","Object","assign","clean","keep","RegExp","uniqueName","publicPath","destination","subdir","join","cwd"],"mappings":";;;;+BAQgBA;;;eAAAA;;;6DARC;uBAGa;;;;;;AAKvB,SAASA,aAAaC,OAAgB,EAAEC,CAAY;IACvD,MAAM,EAAEC,uBAAuB,EAAEC,YAAY,EAAEC,cAAc,EAAEC,IAAI,EAAE,GAAGL;IAExE,MAAMM,SAAiB;QACnBC,UAAU;QACVC,MAAMC,cAAcT;QACpB,GAAIE,0BAA0B;YAAEQ,oBAAoB,CAAC,WAAW,EAAEL,MAAM;QAAC,IAAI,CAAC,CAAC;IACnF;IAEA,IAAIF,cAAc;QACd,MAAMQ,UAAUC,QAAQC,GAAG,CAACC,eAAe;QAC3C,MAAMC,yBAAyBC,IAAAA,oBAAa,EAAC;YAAE,GAAGhB,OAAO;YAAEE,yBAAyB;QAAK;QACzFe,OAAOC,MAAM,CAACZ,QAAQ;YAClBC,UAAU;YACVY,OACIJ,0BAA0B,CAACb,0BACrB;gBAAEkB,MAAM,IAAIC,OAAON;YAAwB,IAC3C;YACV,GAAIX,iBAAiB;gBAAEkB,YAAYjB;YAAK,IAAI,CAAC,CAAC;YAC9C,GAAIM,UAAU;gBAAEY,YAAYZ;YAAQ,IAAI,CAAC,CAAC;QAC9C;IACJ;IAEA,OAAO;QAAEL;IAAO;AACpB;AAEA,SAASG,cAAcT,OAAgB;IACnC,MAAM,EAAEwB,WAAW,EAAEtB,uBAAuB,EAAE,GAAGF;QAElCgB;IAAf,MAAMS,SAAST,CAAAA,iBAAAA,IAAAA,oBAAa,EAAChB,sBAAdgB,4BAAAA,iBAA0B;IACzC,IAAI,OAAOd,4BAA4B,UAAU;QAC7C,MAAM,EAAEI,MAAM,EAAE,GAAGJ;QACnB,IAAII,mBAAAA,6BAAAA,OAAQE,IAAI,EAAE;YACd,OAAOA,aAAI,CAACkB,IAAI,CAACpB,OAAOE,IAAI,EAAEiB;QAClC;IACJ;IAEA,OAAOjB,aAAI,CAACkB,IAAI,CAACd,QAAQe,GAAG,IAAIH,aAAa,UAAUC;AAC3D"}
@@ -1,4 +1,10 @@
1
1
  import { WebpackAssetsManifest } from 'webpack-assets-manifest';
2
2
  import { Context, Overrides } from '../types';
3
+ interface EntryPoints {
4
+ css: string[];
5
+ js: string[];
6
+ }
3
7
  export declare function assetsManifestPlugin(context: Context, _: Overrides): WebpackAssetsManifest | undefined;
8
+ export declare function getExposedDependenciesEntryPoints(context: Context): EntryPoints | undefined;
9
+ export {};
4
10
  //# sourceMappingURL=assets-manifest-plugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"assets-manifest-plugin.d.ts","sourceRoot":"","sources":["../../../../src/webpack/configs/plugins/assets-manifest-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAG9C,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,qCA8BlE"}
1
+ {"version":3,"file":"assets-manifest-plugin.d.ts","sourceRoot":"","sources":["../../../../src/webpack/configs/plugins/assets-manifest-plugin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAQ9C,UAAU,WAAW;IACjB,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,EAAE,EAAE,MAAM,EAAE,CAAC;CAChB;AAED,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,EAAE,CAAC,EAAE,SAAS,qCA+BlE;AAED,wBAAgB,iCAAiC,CAAC,OAAO,EAAE,OAAO,2BAMjE"}