@servicetitan/startup 37.0.2 → 38.0.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 (53) hide show
  1. package/dist/cli/commands/review/types.d.ts.map +1 -1
  2. package/dist/cli/commands/review/types.js.map +1 -1
  3. package/dist/cypress/config/vite-config.d.ts.map +1 -1
  4. package/dist/cypress/config/vite-config.js +23 -3
  5. package/dist/cypress/config/vite-config.js.map +1 -1
  6. package/dist/cypress/config/webpack-config.d.ts.map +1 -1
  7. package/dist/cypress/config/webpack-config.js +5 -0
  8. package/dist/cypress/config/webpack-config.js.map +1 -1
  9. package/dist/storybook-config/vite-final.d.ts.map +1 -1
  10. package/dist/storybook-config/vite-final.js +32 -6
  11. package/dist/storybook-config/vite-final.js.map +1 -1
  12. package/dist/storybook-config/webpack-final.js +2 -1
  13. package/dist/storybook-config/webpack-final.js.map +1 -1
  14. package/dist/vite/config/base-config.d.ts.map +1 -1
  15. package/dist/vite/config/base-config.js +2 -0
  16. package/dist/vite/config/base-config.js.map +1 -1
  17. package/dist/vite/config/create-filtering-logger.d.ts.map +1 -1
  18. package/dist/vite/config/create-filtering-logger.js +12 -1
  19. package/dist/vite/config/create-filtering-logger.js.map +1 -1
  20. package/dist/vite/config/create-vite-build-context.d.ts.map +1 -1
  21. package/dist/vite/config/create-vite-build-context.js +4 -1
  22. package/dist/vite/config/create-vite-build-context.js.map +1 -1
  23. package/dist/vite/plugins/dev-server-routing-plugin.d.ts +1 -1
  24. package/dist/vite/plugins/dev-server-routing-plugin.d.ts.map +1 -1
  25. package/dist/vite/plugins/dev-server-routing-plugin.js +3 -2
  26. package/dist/vite/plugins/dev-server-routing-plugin.js.map +1 -1
  27. package/dist/vite/plugins/istanbul-plugin.d.ts.map +1 -1
  28. package/dist/vite/plugins/istanbul-plugin.js +33 -1
  29. package/dist/vite/plugins/istanbul-plugin.js.map +1 -1
  30. package/dist/vite/types.d.ts +4 -1
  31. package/dist/vite/types.d.ts.map +1 -1
  32. package/package.json +10 -10
  33. package/src/cli/commands/__tests__/bundle-vite.test.ts +1 -0
  34. package/src/cli/commands/review/types.ts +1 -3
  35. package/src/cypress/config/__tests__/vite-config.test.ts +21 -11
  36. package/src/cypress/config/__tests__/webpack-config.test.ts +17 -0
  37. package/src/cypress/config/vite-config.ts +18 -3
  38. package/src/cypress/config/webpack-config.ts +2 -0
  39. package/src/storybook-config/__tests__/vite-final.test.ts +65 -11
  40. package/src/storybook-config/__tests__/webpack-final.test.ts +16 -6
  41. package/src/storybook-config/vite-final.ts +23 -2
  42. package/src/storybook-config/webpack-final.ts +4 -2
  43. package/src/vite/config/__tests__/base-config.test.ts +4 -0
  44. package/src/vite/config/__tests__/create-filtering-logger.test.ts +9 -0
  45. package/src/vite/config/__tests__/create-vite-build-context.test.ts +25 -0
  46. package/src/vite/config/base-config.ts +5 -1
  47. package/src/vite/config/create-filtering-logger.ts +13 -2
  48. package/src/vite/config/create-vite-build-context.ts +1 -0
  49. package/src/vite/plugins/__tests__/dev-server-routing-plugin.test.ts +120 -98
  50. package/src/vite/plugins/__tests__/istanbul-plugin.test.ts +42 -1
  51. package/src/vite/plugins/dev-server-routing-plugin.ts +3 -3
  52. package/src/vite/plugins/istanbul-plugin.ts +28 -1
  53. package/src/vite/types.ts +4 -1
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/cli/commands/review/types.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEvD,8BAAsB,WAAW;IAC7B,QAAQ,KAAK,EAAE,IAAI,MAAM,CAAC;IAC1B,QAAQ,CAAC,GAAG,CAAC,OAAO,EAAE,OAAO,GAAG,YAAY,GAAG,YAAY,EAAE,GAAG,SAAS;IACzE,QAAQ,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,YAAY,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI;CAC7D;AAED,MAAM,WAAW,OAA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,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,aAAa,CAAC;CAC5B;AAED,oBAAY,aAAa;IACrB,KAAK,IAAI;IACT,OAAO,IAAI;CACd;AAED,oBAAY,WAAW;IACnB,QAAQ,aAAa,CAAE,0EAA0E;IACjG,MAAM,WAAW,CAAE,6DAA6D;IAChF,QAAQ,aAAa;CACxB;AAED,MAAM,WAAW,mBAAmB;IAChC,KAAK,CAAC,EAAE;QAAE,CAAC,EAAE,EAAE,MAAM,GAAG,iBAAiB,CAAA;KAAE,CAAC;CAC/C;AAED,MAAM,MAAM,iBAAiB,GACzB,KAAK,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,KAAK,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAA;CAAE,CAAC,CAAC;AAEjF,MAAM,MAAM,KAAK,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/cli/commands/review/types.ts"],"sourcesContent":["import { PackageManager } from '@servicetitan/install';\n\nexport abstract class PackageRule {\n abstract get id(): string;\n abstract run(project: Project): PackageError | PackageError[] | undefined;\n abstract fix?(error: PackageError, project: Project): void;\n}\n\nexport interface Project {\n config: ReviewConfiguration;\n dependencies: Dependencies;\n packageManager: PackageManager;\n packages: Package[];\n}\n\n/**\n * Maps package name to versions and dependents of those versions.\n */\nexport interface Dependencies {\n [packageName: string]: {\n [version: string]: string[];\n };\n}\n\n/**\n * Subset of package.json used by rules\n */\nexport interface Package {\n cli?: CliOptions;\n dependencies?: Record<string, string>;\n devDependencies?: Record<string, string>;\n exports?: string | Record<string, string | Record<string, string>> | null;\n location: string;\n main?: string;\n module?: string;\n name: string;\n peerDependencies?: Record<string, string>;\n private?: boolean;\n scripts?: Record<string, string>;\n sideEffects?: any;\n workspaces?: string[];\n}\n\ninterface CliOptions {\n webpack?: false | Record<string, any>;\n}\n\nexport interface PackageError<T = any> {\n data?: T;\n details?: string | string[];\n fixable?: FixCategory;\n id: string;\n location?: string;\n message: string;\n severity?: ErrorSeverity;\n}\n\nexport enum ErrorSeverity {\n error = 1,\n warning = 2,\n}\n\nexport enum FixCategory {\n isolated = 'isolated', // fix examines and changes at most one dependency or package.json, if any\n normal = 'normal', // fix potentially examines and changes multiple dependencies\n lockFile = 'lockFile', // fix examines and changes package-lock.json\n}\n\nexport interface ReviewConfiguration {\n rules?: { [id: string]: RuleConfiguration };\n}\n\nexport type RuleConfiguration =\n | Level\n | [Level]\n | [Level, { exclude?: string[] | Record<string, string[]> }];\n\nexport type Level = 'warn' | 'error' | 'off';\n"],"names":["ErrorSeverity","FixCategory","PackageRule"],"mappings":";;;;;;;;;;;QAyDYA;eAAAA;;QAKAC;eAAAA;;QA5DUC;eAAAA;;;AAAf,MAAeA;AAItB;AAmDO,IAAA,AAAKF,uCAAAA;;;WAAAA;;AAKL,IAAA,AAAKC,qCAAAA;;;;WAAAA"}
1
+ {"version":3,"sources":["../../../../src/cli/commands/review/types.ts"],"sourcesContent":["import { PackageManager } from '@servicetitan/install';\n\nexport abstract class PackageRule {\n abstract get id(): string;\n abstract run(project: Project): PackageError | PackageError[] | undefined;\n abstract fix?(error: PackageError, project: Project): void;\n}\n\nexport interface Project {\n config: ReviewConfiguration;\n dependencies: Dependencies;\n packageManager: PackageManager;\n packages: Package[];\n}\n\n/**\n * Maps package name to versions and dependents of those versions.\n */\nexport interface Dependencies {\n [packageName: string]: {\n [version: string]: string[];\n };\n}\n\n/**\n * Subset of package.json used by rules\n */\nexport interface Package {\n cli?: CliOptions;\n dependencies?: Record<string, string>;\n devDependencies?: Record<string, string>;\n exports?: string | Record<string, string | Record<string, string>> | null;\n location: string;\n main?: string;\n module?: string;\n name: string;\n peerDependencies?: Record<string, string>;\n private?: boolean;\n scripts?: Record<string, string>;\n sideEffects?: any;\n workspaces?: string[];\n}\n\ninterface CliOptions {\n webpack?: false | Record<string, any>;\n}\n\nexport interface PackageError<T = any> {\n data?: T;\n details?: string | string[];\n fixable?: FixCategory;\n id: string;\n location?: string;\n message: string;\n severity?: ErrorSeverity;\n}\n\nexport enum ErrorSeverity {\n error = 1,\n warning = 2,\n}\n\nexport enum FixCategory {\n isolated = 'isolated', // fix examines and changes at most one dependency or package.json, if any\n normal = 'normal', // fix potentially examines and changes multiple dependencies\n lockFile = 'lockFile', // fix examines and changes package-lock.json\n}\n\nexport interface ReviewConfiguration {\n rules?: { [id: string]: RuleConfiguration };\n}\n\nexport type RuleConfiguration =\n Level | [Level] | [Level, { exclude?: string[] | Record<string, string[]> }];\n\nexport type Level = 'warn' | 'error' | 'off';\n"],"names":["ErrorSeverity","FixCategory","PackageRule"],"mappings":";;;;;;;;;;;QAyDYA;eAAAA;;QAKAC;eAAAA;;QA5DUC;eAAAA;;;AAAf,MAAeA;AAItB;AAmDO,IAAA,AAAKF,uCAAAA;;;WAAAA;;AAKL,IAAA,AAAKC,qCAAAA;;;;WAAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"vite-config.d.ts","sourceRoot":"","sources":["../../../src/cypress/config/vite-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAe,MAAM,MAAM,CAAC;AAatD,wBAAgB,UAAU,CAAC,SAAS,CAAC,EAAE,YAAY,GAAG,YAAY,CAWjE"}
1
+ {"version":3,"file":"vite-config.d.ts","sourceRoot":"","sources":["../../../src/cypress/config/vite-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,YAAY,EAAe,MAAM,MAAM,CAAC;AAatD,wBAAgB,UAAU,CAAC,SAAS,CAAC,EAAE,YAAY,GAAG,YAAY,CAyBjE"}
@@ -31,11 +31,30 @@ function viteConfig(overrides) {
31
31
  dedupe: REACT_DEDUPE
32
32
  },
33
33
  optimizeDeps: {
34
- include: REACT_OPTIMIZE
34
+ include: REACT_OPTIMIZE /*
35
+ * Top-level plugins don't run during dependency pre-bundling, so
36
+ * register ignoreModulesPlugin again here. Without this, missing
37
+ * optional peer dependencies inside pre-bundled packages throw at
38
+ * runtime instead of resolving to an empty module.
39
+ */ ,
40
+ rolldownOptions: {
41
+ plugins: [
42
+ (0, _plugins.ignoreModulesPlugin)({
43
+ package: {
44
+ dependencies: {}
45
+ }
46
+ })
47
+ ]
48
+ }
35
49
  },
36
50
  plugins: [
37
51
  (0, _plugins.svgrPlugin)(context),
38
- (0, _plugins.istanbulPlugin)(context)
52
+ (0, _plugins.istanbulPlugin)(context),
53
+ (0, _plugins.ignoreModulesPlugin)({
54
+ package: {
55
+ dependencies: {}
56
+ }
57
+ })
39
58
  ]
40
59
  };
41
60
  return (0, _vite.mergeConfig)(config, overrides !== null && overrides !== void 0 ? overrides : {});
@@ -51,7 +70,8 @@ function getContext() {
51
70
  },
52
71
  bundlerConfig: {
53
72
  pluginOverrides: {}
54
- }
73
+ },
74
+ package: {}
55
75
  };
56
76
  }
57
77
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/cypress/config/vite-config.ts"],"sourcesContent":["import { type InlineConfig, mergeConfig } from 'vite';\nimport { createCssConfig } from '../../vite/config/create-css-config';\nimport { istanbulPlugin, svgrPlugin } from '../../vite/plugins';\nimport type { ViteBuildContext } from '../../vite/types';\n\n/*\n * Dedupe and pre-bundle React so component tests load a single React instance.\n * Mirrors how viteFinal handles Storybook, where automatic discovery can miss\n * React in monorepos.\n */\nconst REACT_DEDUPE = ['react', 'react-dom'];\nconst REACT_OPTIMIZE = [...REACT_DEDUPE, 'react/jsx-runtime'];\n\nexport function viteConfig(overrides?: InlineConfig): InlineConfig {\n const context = getContext();\n\n const config: InlineConfig = {\n css: createCssConfig(false),\n resolve: { dedupe: REACT_DEDUPE },\n optimizeDeps: { include: REACT_OPTIMIZE },\n plugins: [svgrPlugin(context), istanbulPlugin(context)],\n };\n\n return mergeConfig(config, overrides ?? {});\n}\n\nfunction getContext(): ViteBuildContext {\n /*\n * svgrPlugin reads bundlerConfig.pluginOverrides and istanbulPlugin reads\n * options.codeCoverage, so a minimal context reuses both. Component tests\n * always instrument for coverage, matching the webpack Cypress config.\n */\n return {\n options: { codeCoverage: true },\n bundlerConfig: { pluginOverrides: {} },\n } as ViteBuildContext;\n}\n"],"names":["viteConfig","REACT_DEDUPE","REACT_OPTIMIZE","overrides","context","getContext","config","css","createCssConfig","resolve","dedupe","optimizeDeps","include","plugins","svgrPlugin","istanbulPlugin","mergeConfig","options","codeCoverage","bundlerConfig","pluginOverrides"],"mappings":";;;;+BAagBA;;;eAAAA;;;sBAb+B;iCACf;yBACW;AAG3C;;;;CAIC,GACD,MAAMC,eAAe;IAAC;IAAS;CAAY;AAC3C,MAAMC,iBAAiB;OAAID;IAAc;CAAoB;AAEtD,SAASD,WAAWG,SAAwB;IAC/C,MAAMC,UAAUC;IAEhB,MAAMC,SAAuB;QACzBC,KAAKC,IAAAA,gCAAe,EAAC;QACrBC,SAAS;YAAEC,QAAQT;QAAa;QAChCU,cAAc;YAAEC,SAASV;QAAe;QACxCW,SAAS;YAACC,IAAAA,mBAAU,EAACV;YAAUW,IAAAA,uBAAc,EAACX;SAAS;IAC3D;IAEA,OAAOY,IAAAA,iBAAW,EAACV,QAAQH,sBAAAA,uBAAAA,YAAa,CAAC;AAC7C;AAEA,SAASE;IACL;;;;KAIC,GACD,OAAO;QACHY,SAAS;YAAEC,cAAc;QAAK;QAC9BC,eAAe;YAAEC,iBAAiB,CAAC;QAAE;IACzC;AACJ"}
1
+ {"version":3,"sources":["../../../src/cypress/config/vite-config.ts"],"sourcesContent":["import { type InlineConfig, mergeConfig } from 'vite';\nimport { createCssConfig } from '../../vite/config/create-css-config';\nimport { ignoreModulesPlugin, istanbulPlugin, svgrPlugin } from '../../vite/plugins';\nimport type { ViteBuildContext } from '../../vite/types';\n\n/*\n * Dedupe and pre-bundle React so component tests load a single React instance.\n * Mirrors how viteFinal handles Storybook, where automatic discovery can miss\n * React in monorepos.\n */\nconst REACT_DEDUPE = ['react', 'react-dom'];\nconst REACT_OPTIMIZE = [...REACT_DEDUPE, 'react/jsx-runtime'];\n\nexport function viteConfig(overrides?: InlineConfig): InlineConfig {\n const context = getContext();\n\n const config: InlineConfig = {\n css: createCssConfig(false),\n resolve: { dedupe: REACT_DEDUPE },\n optimizeDeps: {\n include: REACT_OPTIMIZE /*\n * Top-level plugins don't run during dependency pre-bundling, so\n * register ignoreModulesPlugin again here. Without this, missing\n * optional peer dependencies inside pre-bundled packages throw at\n * runtime instead of resolving to an empty module.\n */,\n rolldownOptions: {\n plugins: [ignoreModulesPlugin({ package: { dependencies: {} } })],\n },\n },\n plugins: [\n svgrPlugin(context),\n istanbulPlugin(context),\n ignoreModulesPlugin({ package: { dependencies: {} } }),\n ],\n };\n\n return mergeConfig(config, overrides ?? {});\n}\n\nfunction getContext(): ViteBuildContext {\n /*\n * svgrPlugin reads bundlerConfig.pluginOverrides and istanbulPlugin reads\n * options.codeCoverage, so a minimal context reuses both. Component tests\n * always instrument for coverage, matching the webpack Cypress config.\n */\n return {\n options: { codeCoverage: true },\n bundlerConfig: { pluginOverrides: {} },\n package: {},\n } as ViteBuildContext;\n}\n"],"names":["viteConfig","REACT_DEDUPE","REACT_OPTIMIZE","overrides","context","getContext","config","css","createCssConfig","resolve","dedupe","optimizeDeps","include","rolldownOptions","plugins","ignoreModulesPlugin","package","dependencies","svgrPlugin","istanbulPlugin","mergeConfig","options","codeCoverage","bundlerConfig","pluginOverrides"],"mappings":";;;;+BAagBA;;;eAAAA;;;sBAb+B;iCACf;yBACgC;AAGhE;;;;CAIC,GACD,MAAMC,eAAe;IAAC;IAAS;CAAY;AAC3C,MAAMC,iBAAiB;OAAID;IAAc;CAAoB;AAEtD,SAASD,WAAWG,SAAwB;IAC/C,MAAMC,UAAUC;IAEhB,MAAMC,SAAuB;QACzBC,KAAKC,IAAAA,gCAAe,EAAC;QACrBC,SAAS;YAAEC,QAAQT;QAAa;QAChCU,cAAc;YACVC,SAASV,eAAe;;;;;aAKvB;YACDW,iBAAiB;gBACbC,SAAS;oBAACC,IAAAA,4BAAmB,EAAC;wBAAEC,SAAS;4BAAEC,cAAc,CAAC;wBAAE;oBAAE;iBAAG;YACrE;QACJ;QACAH,SAAS;YACLI,IAAAA,mBAAU,EAACd;YACXe,IAAAA,uBAAc,EAACf;YACfW,IAAAA,4BAAmB,EAAC;gBAAEC,SAAS;oBAAEC,cAAc,CAAC;gBAAE;YAAE;SACvD;IACL;IAEA,OAAOG,IAAAA,iBAAW,EAACd,QAAQH,sBAAAA,uBAAAA,YAAa,CAAC;AAC7C;AAEA,SAASE;IACL;;;;KAIC,GACD,OAAO;QACHgB,SAAS;YAAEC,cAAc;QAAK;QAC9BC,eAAe;YAAEC,iBAAiB,CAAC;QAAE;QACrCR,SAAS,CAAC;IACd;AACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"webpack-config.d.ts","sourceRoot":"","sources":["../../../src/cypress/config/webpack-config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAe,MAAM,SAAS,CAAC;AAM1D,OAAO,EAAE,SAAS,EAAuB,MAAM,qBAAqB,CAAC;AAErE,wBAAgB,aAAa,CAAC,SAAS,CAAC,EAAE,SAAS,GAAG,aAAa,CAiBlE"}
1
+ {"version":3,"file":"webpack-config.d.ts","sourceRoot":"","sources":["../../../src/cypress/config/webpack-config.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAe,MAAM,SAAS,CAAC;AAO1D,OAAO,EAAE,SAAS,EAAuB,MAAM,qBAAqB,CAAC;AAErE,wBAAgB,aAAa,CAAC,SAAS,CAAC,EAAE,SAAS,GAAG,aAAa,CAkBlE"}
@@ -15,6 +15,7 @@ const _tasks = require("../../cli/tasks");
15
15
  const _utils = require("../../cli/utils");
16
16
  const _utils1 = require("../../utils");
17
17
  const _configs = require("../../webpack/configs");
18
+ const _plugins = require("../../webpack/configs/plugins");
18
19
  function _interop_require_default(obj) {
19
20
  return obj && obj.__esModule ? obj : {
20
21
  default: obj
@@ -33,6 +34,10 @@ function webpackConfig(overrides) {
33
34
  module: {
34
35
  rules
35
36
  },
37
+ plugins: [
38
+ (0, _plugins.ignorePlugin)(context, {}),
39
+ (0, _plugins.filterWarningsPlugin)(context, {})
40
+ ],
36
41
  resolve: {
37
42
  extensions: [
38
43
  '.ts',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/cypress/config/webpack-config.ts"],"sourcesContent":["import { getPackageManager } from '@servicetitan/install';\nimport { inspect } from 'node:util';\nimport type { Configuration, RuleSetRule } from 'webpack';\nimport merge from 'webpack-merge';\nimport { getSwcOptions } from '../../cli/tasks';\nimport { TSConfig } from '../../cli/utils';\nimport { getTsConfigWithFallback, log } from '../../utils';\nimport { JS_RULE_EXCLUDE, rulesConfig } from '../../webpack/configs';\nimport { Overrides, WebpackBuildContext } from '../../webpack/types';\n\nexport function webpackConfig(overrides?: Overrides): Configuration {\n const context = getContext();\n const rules = getRules(context, overrides ?? {});\n\n /* istanbul ignore next: debug only */\n log.debug('cypress-config:webpack-config', () => inspect({ rules }, { depth: null }));\n\n const config: Configuration = {\n module: {\n rules,\n },\n resolve: {\n extensions: ['.ts', '.tsx', '.js', '.jsx'],\n },\n };\n\n return merge(config, overrides?.configuration ?? {});\n}\n\nfunction getContext(): WebpackBuildContext {\n return {\n package: {\n name: '',\n version: '',\n destination: '',\n source: '',\n dependencies: {},\n sharedDependencies: {},\n isWebComponent: false,\n isLegacyRoot: false,\n isExposeSharedDependencies: false,\n packageManager: getPackageManager(),\n },\n build: {\n name: '',\n isProduction: false,\n },\n options: {\n codeCoverage: true,\n },\n bundlerConfig: {},\n };\n}\n\nfunction getRules(context: WebpackBuildContext, overrides: Overrides) {\n const { rules } = rulesConfig(context, overrides);\n\n return [getSwcLoaderRule(), getSwcIstanbulRule(), ...rules];\n}\n\nfunction getSwcLoaderRule(): RuleSetRule {\n const tsConfig = new TSConfig(getTsConfigWithFallback());\n\n const swcOptions = getSwcOptions(tsConfig);\n\n return {\n test: /\\.tsx?$/,\n exclude: JS_RULE_EXCLUDE,\n use: {\n loader: 'swc-loader',\n options: swcOptions,\n },\n };\n}\n\nfunction getSwcIstanbulRule(): RuleSetRule {\n return {\n /*\n * enforce: 'pre' ensures this loader runs BEFORE swc-loader, so istanbul\n * instruments the original TypeScript source rather than compiled JS output.\n * This means fnMap/statementMap positions reflect TypeScript line numbers,\n * matching what Jest and Vitest produce.\n * parserPlugins are required because istanbul-lib-instrument uses Babel\n * internally, which cannot parse TypeScript syntax by default.\n */\n enforce: 'pre',\n test: /\\.tsx?$/,\n exclude: JS_RULE_EXCLUDE,\n use: {\n loader: '@jsdevtools/coverage-istanbul-loader',\n options: {\n compact: false,\n produceSourceMap: true,\n parserPlugins: ['typescript', 'jsx'],\n },\n },\n };\n}\n"],"names":["webpackConfig","overrides","context","getContext","rules","getRules","log","debug","inspect","depth","config","module","resolve","extensions","merge","configuration","package","name","version","destination","source","dependencies","sharedDependencies","isWebComponent","isLegacyRoot","isExposeSharedDependencies","packageManager","getPackageManager","build","isProduction","options","codeCoverage","bundlerConfig","rulesConfig","getSwcLoaderRule","getSwcIstanbulRule","tsConfig","TSConfig","getTsConfigWithFallback","swcOptions","getSwcOptions","test","exclude","JS_RULE_EXCLUDE","use","loader","enforce","compact","produceSourceMap","parserPlugins"],"mappings":";;;;+BAUgBA;;;eAAAA;;;yBAVkB;0BACV;qEAEN;uBACY;uBACL;wBACoB;yBACA;;;;;;AAGtC,SAASA,cAAcC,SAAqB;;IAC/C,MAAMC,UAAUC;IAChB,MAAMC,QAAQC,SAASH,SAASD,sBAAAA,uBAAAA,YAAa,CAAC;IAE9C,oCAAoC,GACpCK,WAAG,CAACC,KAAK,CAAC,iCAAiC,IAAMC,IAAAA,iBAAO,EAAC;YAAEJ;QAAM,GAAG;YAAEK,OAAO;QAAK;IAElF,MAAMC,SAAwB;QAC1BC,QAAQ;YACJP;QACJ;QACAQ,SAAS;YACLC,YAAY;gBAAC;gBAAO;gBAAQ;gBAAO;aAAO;QAC9C;IACJ;IAEA,OAAOC,IAAAA,qBAAK,EAACJ,gBAAQT,sBAAAA,gCAAAA,UAAWc,aAAa,uCAAI,CAAC;AACtD;AAEA,SAASZ;IACL,OAAO;QACHa,SAAS;YACLC,MAAM;YACNC,SAAS;YACTC,aAAa;YACbC,QAAQ;YACRC,cAAc,CAAC;YACfC,oBAAoB,CAAC;YACrBC,gBAAgB;YAChBC,cAAc;YACdC,4BAA4B;YAC5BC,gBAAgBC,IAAAA,0BAAiB;QACrC;QACAC,OAAO;YACHX,MAAM;YACNY,cAAc;QAClB;QACAC,SAAS;YACLC,cAAc;QAClB;QACAC,eAAe,CAAC;IACpB;AACJ;AAEA,SAAS3B,SAASH,OAA4B,EAAED,SAAoB;IAChE,MAAM,EAAEG,KAAK,EAAE,GAAG6B,IAAAA,oBAAW,EAAC/B,SAASD;IAEvC,OAAO;QAACiC;QAAoBC;WAAyB/B;KAAM;AAC/D;AAEA,SAAS8B;IACL,MAAME,WAAW,IAAIC,eAAQ,CAACC,IAAAA,+BAAuB;IAErD,MAAMC,aAAaC,IAAAA,oBAAa,EAACJ;IAEjC,OAAO;QACHK,MAAM;QACNC,SAASC,wBAAe;QACxBC,KAAK;YACDC,QAAQ;YACRf,SAASS;QACb;IACJ;AACJ;AAEA,SAASJ;IACL,OAAO;QACH;;;;;;;SAOC,GACDW,SAAS;QACTL,MAAM;QACNC,SAASC,wBAAe;QACxBC,KAAK;YACDC,QAAQ;YACRf,SAAS;gBACLiB,SAAS;gBACTC,kBAAkB;gBAClBC,eAAe;oBAAC;oBAAc;iBAAM;YACxC;QACJ;IACJ;AACJ"}
1
+ {"version":3,"sources":["../../../src/cypress/config/webpack-config.ts"],"sourcesContent":["import { getPackageManager } from '@servicetitan/install';\nimport { inspect } from 'node:util';\nimport type { Configuration, RuleSetRule } from 'webpack';\nimport merge from 'webpack-merge';\nimport { getSwcOptions } from '../../cli/tasks';\nimport { TSConfig } from '../../cli/utils';\nimport { getTsConfigWithFallback, log } from '../../utils';\nimport { JS_RULE_EXCLUDE, rulesConfig } from '../../webpack/configs';\nimport { filterWarningsPlugin, ignorePlugin } from '../../webpack/configs/plugins';\nimport { Overrides, WebpackBuildContext } from '../../webpack/types';\n\nexport function webpackConfig(overrides?: Overrides): Configuration {\n const context = getContext();\n const rules = getRules(context, overrides ?? {});\n\n /* istanbul ignore next: debug only */\n log.debug('cypress-config:webpack-config', () => inspect({ rules }, { depth: null }));\n\n const config: Configuration = {\n module: {\n rules,\n },\n plugins: [ignorePlugin(context, {}), filterWarningsPlugin(context, {})],\n resolve: {\n extensions: ['.ts', '.tsx', '.js', '.jsx'],\n },\n };\n\n return merge(config, overrides?.configuration ?? {});\n}\n\nfunction getContext(): WebpackBuildContext {\n return {\n package: {\n name: '',\n version: '',\n destination: '',\n source: '',\n dependencies: {},\n sharedDependencies: {},\n isWebComponent: false,\n isLegacyRoot: false,\n isExposeSharedDependencies: false,\n packageManager: getPackageManager(),\n },\n build: {\n name: '',\n isProduction: false,\n },\n options: {\n codeCoverage: true,\n },\n bundlerConfig: {},\n };\n}\n\nfunction getRules(context: WebpackBuildContext, overrides: Overrides) {\n const { rules } = rulesConfig(context, overrides);\n\n return [getSwcLoaderRule(), getSwcIstanbulRule(), ...rules];\n}\n\nfunction getSwcLoaderRule(): RuleSetRule {\n const tsConfig = new TSConfig(getTsConfigWithFallback());\n\n const swcOptions = getSwcOptions(tsConfig);\n\n return {\n test: /\\.tsx?$/,\n exclude: JS_RULE_EXCLUDE,\n use: {\n loader: 'swc-loader',\n options: swcOptions,\n },\n };\n}\n\nfunction getSwcIstanbulRule(): RuleSetRule {\n return {\n /*\n * enforce: 'pre' ensures this loader runs BEFORE swc-loader, so istanbul\n * instruments the original TypeScript source rather than compiled JS output.\n * This means fnMap/statementMap positions reflect TypeScript line numbers,\n * matching what Jest and Vitest produce.\n * parserPlugins are required because istanbul-lib-instrument uses Babel\n * internally, which cannot parse TypeScript syntax by default.\n */\n enforce: 'pre',\n test: /\\.tsx?$/,\n exclude: JS_RULE_EXCLUDE,\n use: {\n loader: '@jsdevtools/coverage-istanbul-loader',\n options: {\n compact: false,\n produceSourceMap: true,\n parserPlugins: ['typescript', 'jsx'],\n },\n },\n };\n}\n"],"names":["webpackConfig","overrides","context","getContext","rules","getRules","log","debug","inspect","depth","config","module","plugins","ignorePlugin","filterWarningsPlugin","resolve","extensions","merge","configuration","package","name","version","destination","source","dependencies","sharedDependencies","isWebComponent","isLegacyRoot","isExposeSharedDependencies","packageManager","getPackageManager","build","isProduction","options","codeCoverage","bundlerConfig","rulesConfig","getSwcLoaderRule","getSwcIstanbulRule","tsConfig","TSConfig","getTsConfigWithFallback","swcOptions","getSwcOptions","test","exclude","JS_RULE_EXCLUDE","use","loader","enforce","compact","produceSourceMap","parserPlugins"],"mappings":";;;;+BAWgBA;;;eAAAA;;;yBAXkB;0BACV;qEAEN;uBACY;uBACL;wBACoB;yBACA;yBACM;;;;;;AAG5C,SAASA,cAAcC,SAAqB;;IAC/C,MAAMC,UAAUC;IAChB,MAAMC,QAAQC,SAASH,SAASD,sBAAAA,uBAAAA,YAAa,CAAC;IAE9C,oCAAoC,GACpCK,WAAG,CAACC,KAAK,CAAC,iCAAiC,IAAMC,IAAAA,iBAAO,EAAC;YAAEJ;QAAM,GAAG;YAAEK,OAAO;QAAK;IAElF,MAAMC,SAAwB;QAC1BC,QAAQ;YACJP;QACJ;QACAQ,SAAS;YAACC,IAAAA,qBAAY,EAACX,SAAS,CAAC;YAAIY,IAAAA,6BAAoB,EAACZ,SAAS,CAAC;SAAG;QACvEa,SAAS;YACLC,YAAY;gBAAC;gBAAO;gBAAQ;gBAAO;aAAO;QAC9C;IACJ;IAEA,OAAOC,IAAAA,qBAAK,EAACP,gBAAQT,sBAAAA,gCAAAA,UAAWiB,aAAa,uCAAI,CAAC;AACtD;AAEA,SAASf;IACL,OAAO;QACHgB,SAAS;YACLC,MAAM;YACNC,SAAS;YACTC,aAAa;YACbC,QAAQ;YACRC,cAAc,CAAC;YACfC,oBAAoB,CAAC;YACrBC,gBAAgB;YAChBC,cAAc;YACdC,4BAA4B;YAC5BC,gBAAgBC,IAAAA,0BAAiB;QACrC;QACAC,OAAO;YACHX,MAAM;YACNY,cAAc;QAClB;QACAC,SAAS;YACLC,cAAc;QAClB;QACAC,eAAe,CAAC;IACpB;AACJ;AAEA,SAAS9B,SAASH,OAA4B,EAAED,SAAoB;IAChE,MAAM,EAAEG,KAAK,EAAE,GAAGgC,IAAAA,oBAAW,EAAClC,SAASD;IAEvC,OAAO;QAACoC;QAAoBC;WAAyBlC;KAAM;AAC/D;AAEA,SAASiC;IACL,MAAME,WAAW,IAAIC,eAAQ,CAACC,IAAAA,+BAAuB;IAErD,MAAMC,aAAaC,IAAAA,oBAAa,EAACJ;IAEjC,OAAO;QACHK,MAAM;QACNC,SAASC,wBAAe;QACxBC,KAAK;YACDC,QAAQ;YACRf,SAASS;QACb;IACJ;AACJ;AAEA,SAASJ;IACL,OAAO;QACH;;;;;;;SAOC,GACDW,SAAS;QACTL,MAAM;QACNC,SAASC,wBAAe;QACxBC,KAAK;YACDC,QAAQ;YACRf,SAAS;gBACLiB,SAAS;gBACTC,kBAAkB;gBAClBC,eAAe;oBAAC;oBAAc;iBAAM;YACxC;QACJ;IACJ;AACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"vite-final.d.ts","sourceRoot":"","sources":["../../src/storybook-config/vite-final.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAMzC,UAAU,gBAAgB;IAKtB,UAAU,CAAC,EAAE,aAAa,GAAG,YAAY,CAAC;CAC7C;AAUD,wBAAgB,SAAS,CACrB,MAAM,EAAE,YAAY,EACpB,EAAE,UAAU,EAAE,GAAE,gBAAqB,GACtC,YAAY,CA8Bd"}
1
+ {"version":3,"file":"vite-final.d.ts","sourceRoot":"","sources":["../../src/storybook-config/vite-final.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,MAAM,CAAC;AAOzC,UAAU,gBAAgB;IAKtB,UAAU,CAAC,EAAE,aAAa,GAAG,YAAY,CAAC;CAC7C;AAUD,wBAAgB,SAAS,CACrB,MAAM,EAAE,YAAY,EACpB,EAAE,UAAU,EAAE,GAAE,gBAAqB,GACtC,YAAY,CAkDd"}
@@ -11,7 +11,8 @@ Object.defineProperty(exports, "viteFinal", {
11
11
  const _nodeutil = require("node:util");
12
12
  const _utils = require("../utils");
13
13
  const _createcssconfig = require("../vite/config/create-css-config");
14
- const _svgrplugin = require("../vite/plugins/svgr-plugin");
14
+ const _createfilteringlogger = require("../vite/config/create-filtering-logger");
15
+ const _plugins = require("../vite/plugins");
15
16
  /*
16
17
  * Pre-bundle and dedupe React so the Storybook preview loads a single React
17
18
  * instance. Storybook leaves this to Vite's automatic discovery, which can miss
@@ -26,12 +27,18 @@ const REACT_OPTIMIZE = [
26
27
  ];
27
28
  function viteFinal(config, { configType } = {}) {
28
29
  var _ref, _ref1, _config_plugins;
29
- var _config_css, _config_resolve, _config_optimizeDeps;
30
+ var _config_optimizeDeps_rolldownOptions, _config_optimizeDeps, _config_css, _config_resolve, _config_optimizeDeps1, _config_optimizeDeps2;
30
31
  const isProduction = configType === 'PRODUCTION';
31
32
  const css = (0, _createcssconfig.createCssConfig)(isProduction);
32
33
  const plugins = [
33
- (0, _svgrplugin.svgrPlugin)(getContext())
34
+ (0, _plugins.svgrPlugin)(getContext()),
35
+ (0, _plugins.ignoreModulesPlugin)({
36
+ package: {
37
+ dependencies: {}
38
+ }
39
+ })
34
40
  ];
41
+ const existingRolldownPlugins = (_config_optimizeDeps = config.optimizeDeps) === null || _config_optimizeDeps === void 0 ? void 0 : (_config_optimizeDeps_rolldownOptions = _config_optimizeDeps.rolldownOptions) === null || _config_optimizeDeps_rolldownOptions === void 0 ? void 0 : _config_optimizeDeps_rolldownOptions.plugins;
35
42
  const merged = {
36
43
  ...config,
37
44
  css: {
@@ -55,15 +62,34 @@ function viteFinal(config, { configType } = {}) {
55
62
  ...config.optimizeDeps,
56
63
  include: [
57
64
  ...new Set([
58
- ...(_ref1 = (_config_optimizeDeps = config.optimizeDeps) === null || _config_optimizeDeps === void 0 ? void 0 : _config_optimizeDeps.include) !== null && _ref1 !== void 0 ? _ref1 : [],
65
+ ...(_ref1 = (_config_optimizeDeps1 = config.optimizeDeps) === null || _config_optimizeDeps1 === void 0 ? void 0 : _config_optimizeDeps1.include) !== null && _ref1 !== void 0 ? _ref1 : [],
59
66
  ...REACT_OPTIMIZE
60
67
  ])
61
- ]
68
+ ],
69
+ /*
70
+ * Top-level plugins don't run during dependency pre-bundling, so
71
+ * register ignoreModulesPlugin again here. Without this, missing
72
+ * optional peer dependencies inside pre-bundled packages throw at
73
+ * runtime instead of resolving to an empty module.
74
+ */ rolldownOptions: {
75
+ ...(_config_optimizeDeps2 = config.optimizeDeps) === null || _config_optimizeDeps2 === void 0 ? void 0 : _config_optimizeDeps2.rolldownOptions,
76
+ plugins: [
77
+ ...Array.isArray(existingRolldownPlugins) ? existingRolldownPlugins : [
78
+ existingRolldownPlugins
79
+ ].filter(Boolean),
80
+ (0, _plugins.ignoreModulesPlugin)({
81
+ package: {
82
+ dependencies: {}
83
+ }
84
+ })
85
+ ]
86
+ }
62
87
  },
63
88
  plugins: [
64
89
  ...(_config_plugins = config.plugins) !== null && _config_plugins !== void 0 ? _config_plugins : [],
65
90
  ...plugins
66
- ]
91
+ ],
92
+ customLogger: (0, _createfilteringlogger.createFilteringLogger)()
67
93
  };
68
94
  /* istanbul ignore next: debug only */ _utils.log.debug('storybook-config:vite-final', ()=>(0, _nodeutil.inspect)({
69
95
  merged
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/storybook-config/vite-final.ts"],"sourcesContent":["import { inspect } from 'node:util';\nimport type { InlineConfig } from 'vite';\nimport { log } from '../utils';\nimport { createCssConfig } from '../vite/config/create-css-config';\nimport { svgrPlugin } from '../vite/plugins/svgr-plugin';\nimport type { ViteBuildContext } from '../vite/types';\n\ninterface ViteFinalOptions {\n /*\n * Storybook signals the build type through `configType`, not Vite's\n * `config.mode` (which Storybook's Vite builder leaves unset).\n */\n configType?: 'DEVELOPMENT' | 'PRODUCTION';\n}\n\n/*\n * Pre-bundle and dedupe React so the Storybook preview loads a single React\n * instance. Storybook leaves this to Vite's automatic discovery, which can miss\n * React in monorepos.\n */\nconst REACT_DEDUPE = ['react', 'react-dom'];\nconst REACT_OPTIMIZE = [...REACT_DEDUPE, 'react/jsx-runtime'];\n\nexport function viteFinal(\n config: InlineConfig,\n { configType }: ViteFinalOptions = {}\n): InlineConfig {\n const isProduction = configType === 'PRODUCTION';\n const css = createCssConfig(isProduction);\n const plugins = [svgrPlugin(getContext())];\n\n const merged: InlineConfig = {\n ...config,\n css: {\n ...config.css,\n modules: css.modules,\n preprocessorOptions: {\n ...config.css?.preprocessorOptions,\n ...css.preprocessorOptions,\n },\n },\n resolve: {\n ...config.resolve,\n dedupe: [...new Set([...(config.resolve?.dedupe ?? []), ...REACT_DEDUPE])],\n },\n optimizeDeps: {\n ...config.optimizeDeps,\n include: [...new Set([...(config.optimizeDeps?.include ?? []), ...REACT_OPTIMIZE])],\n },\n plugins: [...(config.plugins ?? []), ...plugins],\n };\n\n /* istanbul ignore next: debug only */\n log.debug('storybook-config:vite-final', () => inspect({ merged }, { depth: null }));\n\n return merged;\n}\n\nfunction getContext(): ViteBuildContext {\n /*\n * svgrPlugin only reads bundlerConfig.pluginOverrides, so a minimal context\n * is enough to reuse it with startup's default SVG include patterns.\n */\n return { bundlerConfig: { pluginOverrides: {} } } as ViteBuildContext;\n}\n"],"names":["viteFinal","REACT_DEDUPE","REACT_OPTIMIZE","config","configType","isProduction","css","createCssConfig","plugins","svgrPlugin","getContext","merged","modules","preprocessorOptions","resolve","dedupe","Set","optimizeDeps","include","log","debug","inspect","depth","bundlerConfig","pluginOverrides"],"mappings":";;;;+BAuBgBA;;;eAAAA;;;0BAvBQ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AE;AACpD"}
1
+ {"version":3,"sources":["../../src/storybook-config/vite-final.ts"],"sourcesContent":["import { inspect } from 'node:util';\nimport type { InlineConfig } from 'vite';\nimport { log } from '../utils';\nimport { createCssConfig } from '../vite/config/create-css-config';\nimport { createFilteringLogger } from '../vite/config/create-filtering-logger';\nimport { ignoreModulesPlugin, svgrPlugin } from '../vite/plugins';\nimport type { ViteBuildContext } from '../vite/types';\n\ninterface ViteFinalOptions {\n /*\n * Storybook signals the build type through `configType`, not Vite's\n * `config.mode` (which Storybook's Vite builder leaves unset).\n */\n configType?: 'DEVELOPMENT' | 'PRODUCTION';\n}\n\n/*\n * Pre-bundle and dedupe React so the Storybook preview loads a single React\n * instance. Storybook leaves this to Vite's automatic discovery, which can miss\n * React in monorepos.\n */\nconst REACT_DEDUPE = ['react', 'react-dom'];\nconst REACT_OPTIMIZE = [...REACT_DEDUPE, 'react/jsx-runtime'];\n\nexport function viteFinal(\n config: InlineConfig,\n { configType }: ViteFinalOptions = {}\n): InlineConfig {\n const isProduction = configType === 'PRODUCTION';\n const css = createCssConfig(isProduction);\n const plugins = [\n svgrPlugin(getContext()),\n ignoreModulesPlugin({ package: { dependencies: {} } }),\n ];\n const existingRolldownPlugins = config.optimizeDeps?.rolldownOptions?.plugins;\n\n const merged: InlineConfig = {\n ...config,\n css: {\n ...config.css,\n modules: css.modules,\n preprocessorOptions: {\n ...config.css?.preprocessorOptions,\n ...css.preprocessorOptions,\n },\n },\n resolve: {\n ...config.resolve,\n dedupe: [...new Set([...(config.resolve?.dedupe ?? []), ...REACT_DEDUPE])],\n },\n optimizeDeps: {\n ...config.optimizeDeps,\n include: [...new Set([...(config.optimizeDeps?.include ?? []), ...REACT_OPTIMIZE])],\n /*\n * Top-level plugins don't run during dependency pre-bundling, so\n * register ignoreModulesPlugin again here. Without this, missing\n * optional peer dependencies inside pre-bundled packages throw at\n * runtime instead of resolving to an empty module.\n */\n rolldownOptions: {\n ...config.optimizeDeps?.rolldownOptions,\n plugins: [\n ...(Array.isArray(existingRolldownPlugins)\n ? existingRolldownPlugins\n : [existingRolldownPlugins].filter(Boolean)),\n ignoreModulesPlugin({ package: { dependencies: {} } }),\n ],\n },\n },\n plugins: [...(config.plugins ?? []), ...plugins],\n customLogger: createFilteringLogger(),\n };\n\n /* istanbul ignore next: debug only */\n log.debug('storybook-config:vite-final', () => inspect({ merged }, { depth: null }));\n\n return merged;\n}\n\nfunction getContext(): ViteBuildContext {\n /*\n * svgrPlugin only reads bundlerConfig.pluginOverrides, so a minimal context\n * is enough to reuse it with startup's default SVG include patterns.\n */\n return { bundlerConfig: { pluginOverrides: {} } } as ViteBuildContext;\n}\n"],"names":["viteFinal","REACT_DEDUPE","REACT_OPTIMIZE","config","configType","isProduction","css","createCssConfig","plugins","svgrPlugin","getContext","ignoreModulesPlugin","package","dependencies","existingRolldownPlugins","optimizeDeps","rolldownOptions","merged","modules","preprocessorOptions","resolve","dedupe","Set","include","Array","isArray","filter","Boolean","customLogger","createFilteringLogger","log","debug","inspect","depth","bundlerConfig","pluginOverrides"],"mappings":";;;;+BAwBgBA;;;eAAAA;;;0BAxBQ;uBAEJ;iCACY;uCACM;yBACU;AAWhD;;;;CAIC,GACD,MAAMC,eAAe;IAAC;IAAS;CAAY;AAC3C,MAAMC,iBAAiB;OAAID;IAAc;CAAoB;AAEtD,SAASD,UACZG,MAAoB,EACpB,EAAEC,UAAU,EAAoB,GAAG,CAAC,CAAC;qBA2CnBD;QAnCcA,sCAAAA,sBAQjBA,aAMkBA,iBAICA,uBAQnBA;IAhCf,MAAME,eAAeD,eAAe;IACpC,MAAME,MAAMC,IAAAA,gCAAe,EAACF;IAC5B,MAAMG,UAAU;QACZC,IAAAA,mBAAU,EAACC;QACXC,IAAAA,4BAAmB,EAAC;YAAEC,SAAS;gBAAEC,cAAc,CAAC;YAAE;QAAE;KACvD;IACD,MAAMC,2BAA0BX,uBAAAA,OAAOY,YAAY,cAAnBZ,4CAAAA,uCAAAA,qBAAqBa,eAAe,cAApCb,2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AAC;QAAE;IAAE;AACpD"}
@@ -64,7 +64,8 @@ function getContext(config) {
64
64
  }
65
65
  function getPlugins(context, overrides) {
66
66
  return [
67
- (0, _plugins.miniCssExtractPlugin)(context, overrides)
67
+ (0, _plugins.miniCssExtractPlugin)(context, overrides),
68
+ (0, _plugins.ignorePlugin)(context, {})
68
69
  ].filter((plugin)=>!!plugin);
69
70
  }
70
71
  function getRules(context, overrides) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/storybook-config/webpack-final.ts"],"sourcesContent":["import { getPackageManager } from '@servicetitan/install';\nimport { inspect } from 'node:util';\nimport type { Configuration } from 'webpack';\nimport { log } from '../utils';\nimport { rulesConfig } from '../webpack/configs';\nimport { miniCssExtractPlugin } from '../webpack/configs/plugins';\nimport { Overrides, WebpackBuildContext } from '../webpack/types';\n\nexport function webpackFinal(config: Configuration, overrides: Overrides = {}): Configuration {\n const context = getContext(config);\n const rules = getRules(context, overrides);\n const plugins = getPlugins(context, overrides);\n\n /* istanbul ignore next: debug only */\n log.debug('storybook-config:webpack-final', () => inspect({ rules, plugins }, { depth: null }));\n\n return {\n ...config,\n module: {\n ...config.module,\n rules: [...transformDefaultRules(config.module?.rules), ...rules],\n },\n plugins: [...(config.plugins ?? []), ...plugins],\n };\n}\n\nfunction getContext(config: Configuration): WebpackBuildContext {\n return {\n package: {\n name: '',\n version: '',\n destination: '',\n source: '',\n dependencies: {},\n sharedDependencies: {},\n isWebComponent: false,\n isLegacyRoot: false,\n isExposeSharedDependencies: false,\n packageManager: getPackageManager(),\n },\n build: {\n name: '',\n isProduction: config.mode === 'production',\n },\n options: {},\n bundlerConfig: {},\n };\n}\n\nfunction getPlugins(context: WebpackBuildContext, overrides: Overrides) {\n return [miniCssExtractPlugin(context, overrides)].filter(plugin => !!plugin);\n}\n\nfunction getRules(context: WebpackBuildContext, overrides: Overrides) {\n const include = ['.module.css', '.module.less', '.less', '.module.scss', '.scss', '.svg'];\n const exclude = ['.css'];\n\n const { rules } = rulesConfig(context, overrides);\n\n return rules.filter(\n ({ test }) =>\n !(test instanceof RegExp) ||\n include.some(ext => test.exec(ext) && !exclude.some(ext => test.exec(ext)))\n );\n}\n\nfunction transformDefaultRules(rules: NonNullable<Configuration['module']>['rules'] = []) {\n const result = rules.map(rule => {\n if (rule && typeof rule === 'object' && rule.test instanceof RegExp) {\n if (rule.test.test('.css')) {\n return { ...rule, exclude: /\\.module.css$/ };\n }\n if (rule.test.test('.svg')) {\n return { ...rule, exclude: /\\.svg$/i };\n }\n }\n return rule;\n });\n\n /* istanbul ignore next: debug only */\n log.debug('storybook-config:transform-default-rules', () =>\n inspect({ result }, { depth: null })\n );\n\n return result;\n}\n"],"names":["webpackFinal","config","overrides","context","getContext","rules","getRules","plugins","getPlugins","log","debug","inspect","depth","module","transformDefaultRules","package","name","version","destination","source","dependencies","sharedDependencies","isWebComponent","isLegacyRoot","isExposeSharedDependencies","packageManager","getPackageManager","build","isProduction","mode","options","bundlerConfig","miniCssExtractPlugin","filter","plugin","include","exclude","rulesConfig","test","RegExp","some","ext","exec","result","map","rule"],"mappings":";;;;+BAQgBA;;;eAAAA;;;yBARkB;0BACV;uBAEJ;yBACQ;yBACS;AAG9B,SAASA,aAAaC,MAAqB,EAAEC,YAAuB,CAAC,CAAC;QAcvDD;QAFuBA;IAXzC,MAAME,UAAUC,WAAWH;IAC3B,MAAMI,QAAQC,SAASH,SAASD;IAChC,MAAMK,UAAUC,WAAWL,SAASD;IAEpC,oCAAoC,GACpCO,UAAG,CAACC,KAAK,CAAC,kCAAkC,IAAMC,IAAAA,iBAAO,EAAC;YAAEN;YAAOE;QAAQ,GAAG;YAAEK,OAAO;QAAK;IAE5F,OAAO;QACH,GAAGX,MAAM;QACTY,QAAQ;YACJ,GAAGZ,OAAOY,MAAM;YAChBR,OAAO;mBAAIS,uBAAsBb,iBAAAA,OAAOY,MAAM,cAAbZ,qCAAAA,eAAeI,KAAK;mBAAMA;aAAM;QACrE;QACAE,SAAS;gBAAKN,kBAAAA,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ET,SAAS;gBAAgB;YAC/C;YACA,IAAIS,KAAKP,IAAI,CAACA,IAAI,CAAC,SAAS;gBACxB,OAAO;oBAAE,GAAGO,IAAI;oBAAET,SAAS;gBAAU;YACzC;QACJ;QACA,OAAOS;IACX;IAEA,oCAAoC,GACpCpC,UAAG,CAACC,KAAK,CAAC,4CAA4C,IAClDC,IAAAA,iBAAO,EAAC;YAAEgC;QAAO,GAAG;YAAE/B,OAAO;QAAK;IAGtC,OAAO+B;AACX"}
1
+ {"version":3,"sources":["../../src/storybook-config/webpack-final.ts"],"sourcesContent":["import { getPackageManager } from '@servicetitan/install';\nimport { inspect } from 'node:util';\nimport type { Configuration } from 'webpack';\nimport { log } from '../utils';\nimport { rulesConfig } from '../webpack/configs';\nimport { ignorePlugin, miniCssExtractPlugin } from '../webpack/configs/plugins';\nimport { Overrides, WebpackBuildContext } from '../webpack/types';\n\nexport function webpackFinal(config: Configuration, overrides: Overrides = {}): Configuration {\n const context = getContext(config);\n const rules = getRules(context, overrides);\n const plugins = getPlugins(context, overrides);\n\n /* istanbul ignore next: debug only */\n log.debug('storybook-config:webpack-final', () => inspect({ rules, plugins }, { depth: null }));\n\n return {\n ...config,\n module: {\n ...config.module,\n rules: [...transformDefaultRules(config.module?.rules), ...rules],\n },\n plugins: [...(config.plugins ?? []), ...plugins],\n };\n}\n\nfunction getContext(config: Configuration): WebpackBuildContext {\n return {\n package: {\n name: '',\n version: '',\n destination: '',\n source: '',\n dependencies: {},\n sharedDependencies: {},\n isWebComponent: false,\n isLegacyRoot: false,\n isExposeSharedDependencies: false,\n packageManager: getPackageManager(),\n },\n build: {\n name: '',\n isProduction: config.mode === 'production',\n },\n options: {},\n bundlerConfig: {},\n };\n}\n\nfunction getPlugins(context: WebpackBuildContext, overrides: Overrides) {\n return [miniCssExtractPlugin(context, overrides), ignorePlugin(context, {})].filter(\n plugin => !!plugin\n );\n}\n\nfunction getRules(context: WebpackBuildContext, overrides: Overrides) {\n const include = ['.module.css', '.module.less', '.less', '.module.scss', '.scss', '.svg'];\n const exclude = ['.css'];\n\n const { rules } = rulesConfig(context, overrides);\n\n return rules.filter(\n ({ test }) =>\n !(test instanceof RegExp) ||\n include.some(ext => test.exec(ext) && !exclude.some(ext => test.exec(ext)))\n );\n}\n\nfunction transformDefaultRules(rules: NonNullable<Configuration['module']>['rules'] = []) {\n const result = rules.map(rule => {\n if (rule && typeof rule === 'object' && rule.test instanceof RegExp) {\n if (rule.test.test('.css')) {\n return { ...rule, exclude: /\\.module.css$/ };\n }\n if (rule.test.test('.svg')) {\n return { ...rule, exclude: /\\.svg$/i };\n }\n }\n return rule;\n });\n\n /* istanbul ignore next: debug only */\n log.debug('storybook-config:transform-default-rules', () =>\n inspect({ result }, { depth: null })\n );\n\n return result;\n}\n"],"names":["webpackFinal","config","overrides","context","getContext","rules","getRules","plugins","getPlugins","log","debug","inspect","depth","module","transformDefaultRules","package","name","version","destination","source","dependencies","sharedDependencies","isWebComponent","isLegacyRoot","isExposeSharedDependencies","packageManager","getPackageManager","build","isProduction","mode","options","bundlerConfig","miniCssExtractPlugin","ignorePlugin","filter","plugin","include","exclude","rulesConfig","test","RegExp","some","ext","exec","result","map","rule"],"mappings":";;;;+BAQgBA;;;eAAAA;;;yBARkB;0BACV;uBAEJ;yBACQ;yBACuB;AAG5C,SAASA,aAAaC,MAAqB,EAAEC,YAAuB,CAAC,CAAC;QAcvDD;QAFuBA;IAXzC,MAAME,UAAUC,WAAWH;IAC3B,MAAMI,QAAQC,SAASH,SAASD;IAChC,MAAMK,UAAUC,WAAWL,SAASD;IAEpC,oCAAoC,GACpCO,UAAG,CAACC,KAAK,CAAC,kCAAkC,IAAMC,IAAAA,iBAAO,EAAC;YAAEN;YAAOE;QAAQ,GAAG;YAAEK,OAAO;QAAK;IAE5F,OAAO;QACH,GAAGX,MAAM;QACTY,QAAQ;YACJ,GAAGZ,OAAOY,MAAM;YAChBR,OAAO;mBAAIS,uBAAsBb,iBAAAA,OAAOY,MAAM,cAAbZ,qCA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AKP,IAAI,YAAYC,QAAQ;YACjE,IAAIM,KAAKP,IAAI,CAACA,IAAI,CAAC,SAAS;gBACxB,OAAO;oBAAE,GAAGO,IAAI;oBAAET,SAAS;gBAAgB;YAC/C;YACA,IAAIS,KAAKP,IAAI,CAACA,IAAI,CAAC,SAAS;gBACxB,OAAO;oBAAE,GAAGO,IAAI;oBAAET,SAAS;gBAAU;YACzC;QACJ;QACA,OAAOS;IACX;IAEA,oCAAoC,GACpCrC,UAAG,CAACC,KAAK,CAAC,4CAA4C,IAClDC,IAAAA,iBAAO,EAAC;YAAEiC;QAAO,GAAG;YAAEhC,OAAO;QAAK;IAGtC,OAAOgC;AACX"}
@@ -1 +1 @@
1
- {"version":3,"file":"base-config.d.ts","sourceRoot":"","sources":["../../../src/vite/config/base-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAU,MAAM,MAAM,CAAC;AA6BjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAiD5C,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,GAAG,YAAY,CAkExE"}
1
+ {"version":3,"file":"base-config.d.ts","sourceRoot":"","sources":["../../../src/vite/config/base-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAU,MAAM,MAAM,CAAC;AA6BjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAiD5C,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,gBAAgB,GAAG,YAAY,CAsExE"}
@@ -99,6 +99,8 @@ function createBaseConfig(context) {
99
99
  cacheDir: `node_modules/.vite/${(_getBundleType = (0, _core.getBundleType)(context)) !== null && _getBundleType !== void 0 ? _getBundleType : 'host'}`,
100
100
  customLogger: (0, _createfilteringlogger.createFilteringLogger)(),
101
101
  server: {
102
+ // Windows machines can fail to connect to "localhost"; bind to a fixed address instead.
103
+ host: '127.0.0.1',
102
104
  port: (_context_bundlerConfig_port = context.bundlerConfig.port) !== null && _context_bundlerConfig_port !== void 0 ? _context_bundlerConfig_port : isWebComponent ? 8888 : 8080
103
105
  },
104
106
  mode: isProduction ? _core.bundleConstants.mode.production : _core.bundleConstants.mode.development,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/vite/config/base-config.ts"],"sourcesContent":["import type { InlineConfig, Plugin } from 'vite';\nimport {\n bundleConstants,\n defineExposedDependencies,\n defineExposedInstanceDependencies,\n defineWebComponentName,\n getBundleType,\n getCdnPath,\n getProcessEnv,\n} from '../../core';\nimport { omit } from '../../utils';\nimport {\n bundleStatPlugin,\n chainSourceMapsPlugin,\n cleanPlugin,\n cssInjectorPlugin,\n designSystemGuardPlugin,\n devServerRoutingPlugin,\n externalsPlugin,\n htmlPlugin,\n ignoreModulesPlugin,\n istanbulPlugin,\n magicCommentsPlugin,\n metadataPlugin,\n momentLocalesPlugin,\n styleUrlsPlugin,\n svgrPlugin,\n virtualModulesPlugin,\n} from '../plugins';\nimport { ViteBuildContext } from '../types';\nimport { assetFileNames } from './asset-file-names';\nimport { getCodeSplitting } from './code-splitting';\nimport { createCssConfig } from './create-css-config';\nimport { createFilteringLogger } from './create-filtering-logger';\n\nfunction importMetaRemap(\n ...definitions: (Record<string, string> | undefined)[]\n): Record<string, string> {\n const result: Record<string, string> = {};\n\n definitions\n .filter(definition => definition !== undefined)\n .forEach(definition =>\n Object.keys(definition).forEach(item => {\n result[`import.meta.env.${item}`] = definition[item];\n })\n );\n\n return result;\n}\n\nfunction createPlugins(context: ViteBuildContext) {\n const entries: [string, Plugin[] | Plugin | Promise<Plugin> | undefined][] = [\n ['bundleStat', bundleStatPlugin(context)],\n ['clean', cleanPlugin(context)],\n ['cssInjector', cssInjectorPlugin(context)],\n ['designSystemGuard', designSystemGuardPlugin(context)],\n ['devServerRouting', devServerRoutingPlugin(context)],\n ['externals', externalsPlugin(context)],\n ['html', htmlPlugin(context)],\n ['ignoreModules', ignoreModulesPlugin(context)],\n ['istanbul', istanbulPlugin(context)],\n ['magicComments', magicCommentsPlugin(context)],\n ['metadata', metadataPlugin(context)],\n ['momentLocales', momentLocalesPlugin(context)],\n ['styleUrls', styleUrlsPlugin(context)],\n ['svgr', svgrPlugin(context)],\n ['virtualModules', virtualModulesPlugin(context)],\n ];\n\n return entries\n .filter(\n ([name, plugin]) =>\n plugin && !context.bundlerConfig.omitDefault?.includes(`plugins.${name}`)\n )\n .flatMap(([, plugin]) => plugin);\n}\n\nexport function createBaseConfig(context: ViteBuildContext): InlineConfig {\n const { isProduction } = context.build;\n const { isWebComponent } = context.package;\n\n let config: InlineConfig = {\n cacheDir: `node_modules/.vite/${getBundleType(context) ?? 'host'}`,\n customLogger: createFilteringLogger(),\n server: { port: context.bundlerConfig.port ?? (isWebComponent ? 8888 : 8080) },\n mode: isProduction ? bundleConstants.mode.production : bundleConstants.mode.development,\n configFile: false,\n oxc: { legalComments: 'none' },\n base: getCdnPath(context) || './', // eslint-disable-line @typescript-eslint/prefer-nullish-coalescing\n css: createCssConfig(isProduction),\n build: {\n /*\n * MFEs render inside shadow DOM — lazy CSS chunks would inject into document.head,\n * leaking styles into the host. Bundling all CSS into one file avoids this.\n */\n cssCodeSplit: !isWebComponent,\n sourcemap: true,\n rolldownOptions: {\n output: { assetFileNames, codeSplitting: getCodeSplitting(context) },\n plugins: [chainSourceMapsPlugin()],\n },\n },\n define: {\n ...importMetaRemap(\n defineExposedDependencies(context),\n defineExposedInstanceDependencies(context),\n defineWebComponentName(context)\n ),\n ...(getProcessEnv(context) ?? {}),\n },\n optimizeDeps: {\n include: ['@servicetitan/startup-utils'],\n /*\n * Top-level plugins don't run during dependency pre-bundling, so\n * register ignoreModulesPlugin again here. Without this, missing\n * optional peer dependencies inside pre-bundled packages throw at\n * runtime instead of resolving to an empty module.\n */\n rolldownOptions: {\n plugins: [ignoreModulesPlugin(context)],\n },\n },\n plugins: createPlugins(context),\n };\n\n const omitKeys = context.bundlerConfig.omitDefault?.filter(k => !k.startsWith('plugins.'));\n if (omitKeys?.length) {\n config = omit({ ...config }, omitKeys);\n }\n\n if (context.bundlerConfig.minify.js !== undefined) {\n config.build = { ...config.build, minify: !!context.bundlerConfig.minify.js };\n }\n if (context.bundlerConfig.minify.css !== undefined) {\n config.build = { ...config.build, cssMinify: !!context.bundlerConfig.minify.css };\n }\n\n // Minified output can't be mapped back to source, so skip it when instrumenting.\n if (context.options.codeCoverage) {\n config.build = { ...config.build, minify: false };\n }\n\n return config;\n}\n"],"names":["createBaseConfig","importMetaRemap","definitions","result","filter","definition","undefined","forEach","Object","keys","item","createPlugins","context","entries","bundleStatPlugin","cleanPlugin","cssInjectorPlugin","designSystemGuardPlugin","devServerRoutingPlugin","externalsPlugin","htmlPlugin","ignoreModulesPlugin","istanbulPlugin","magicCommentsPlugin","metadataPlugin","momentLocalesPlugin","styleUrlsPlugin","svgrPlugin","virtualModulesPlugin","name","plugin","bundlerConfig","omitDefault","includes","flatMap","getBundleType","getProcessEnv","isProduction","build","isWebComponent","package","config","cacheDir","customLogger","createFilteringLogger","server","port","mode","bundleConstants","production","development","configFile","oxc","legalComments","base","getCdnPath","css","createCssConfig","cssCodeSplit","sourcemap","rolldownOptions","output","assetFileNames","codeSplitting","getCodeSplitting","plugins","chainSourceMapsPlugin","define","defineExposedDependencies","defineExposedInstanceDependencies","defineWebComponentName","optimizeDeps","include","omitKeys","k","startsWith","length","omit","minify","js","cssMinify","options","codeCoverage"],"mappings":";;;;+BA8EgBA;;;eAAAA;;;sBArET;uBACc;yBAkBd;gCAEwB;+BACE;iCACD;uCACM;AAEtC,SAASC,gBACL,GAAGC,WAAmD;IAEtD,MAAMC,SAAiC,CAAC;IAExCD,YACKE,MAAM,CAACC,CAAAA,aAAcA,eAAeC,WACpCC,OAAO,CAACF,CAAAA,aACLG,OAAOC,IAAI,CAACJ,YAAYE,OAAO,CAACG,CAAAA;YAC5BP,MAAM,CAAC,CAAC,gBAAgB,EAAEO,MAAM,CAAC,GAAGL,UAAU,CAACK,KAAK;QACxD;IAGR,OAAOP;AAC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G,MAAM,EAAE;QAClBnC,SAASoC,IAAAA,WAAI,EAAC;YAAE,GAAGpC,MAAM;QAAC,GAAGgC;IACjC;IAEA,IAAI7D,QAAQmB,aAAa,CAAC+C,MAAM,CAACC,EAAE,KAAKzE,WAAW;QAC/CmC,OAAOH,KAAK,GAAG;YAAE,GAAGG,OAAOH,KAAK;YAAEwC,QAAQ,CAAC,CAAClE,QAAQmB,aAAa,CAAC+C,MAAM,CAACC,EAAE;QAAC;IAChF;IACA,IAAInE,QAAQmB,aAAa,CAAC+C,MAAM,CAACtB,GAAG,KAAKlD,WAAW;QAChDmC,OAAOH,KAAK,GAAG;YAAE,GAAGG,OAAOH,KAAK;YAAE0C,WAAW,CAAC,CAACpE,QAAQmB,aAAa,CAAC+C,MAAM,CAACtB,GAAG;QAAC;IACpF;IAEA,iFAAiF;IACjF,IAAI5C,QAAQqE,OAAO,CAACC,YAAY,EAAE;QAC9BzC,OAAOH,KAAK,GAAG;YAAE,GAAGG,OAAOH,KAAK;YAAEwC,QAAQ;QAAM;IACpD;IAEA,OAAOrC;AACX"}
1
+ {"version":3,"sources":["../../../src/vite/config/base-config.ts"],"sourcesContent":["import type { InlineConfig, Plugin } from 'vite';\nimport {\n bundleConstants,\n defineExposedDependencies,\n defineExposedInstanceDependencies,\n defineWebComponentName,\n getBundleType,\n getCdnPath,\n getProcessEnv,\n} from '../../core';\nimport { omit } from '../../utils';\nimport {\n bundleStatPlugin,\n chainSourceMapsPlugin,\n cleanPlugin,\n cssInjectorPlugin,\n designSystemGuardPlugin,\n devServerRoutingPlugin,\n externalsPlugin,\n htmlPlugin,\n ignoreModulesPlugin,\n istanbulPlugin,\n magicCommentsPlugin,\n metadataPlugin,\n momentLocalesPlugin,\n styleUrlsPlugin,\n svgrPlugin,\n virtualModulesPlugin,\n} from '../plugins';\nimport { ViteBuildContext } from '../types';\nimport { assetFileNames } from './asset-file-names';\nimport { getCodeSplitting } from './code-splitting';\nimport { createCssConfig } from './create-css-config';\nimport { createFilteringLogger } from './create-filtering-logger';\n\nfunction importMetaRemap(\n ...definitions: (Record<string, string> | undefined)[]\n): Record<string, string> {\n const result: Record<string, string> = {};\n\n definitions\n .filter(definition => definition !== undefined)\n .forEach(definition =>\n Object.keys(definition).forEach(item => {\n result[`import.meta.env.${item}`] = definition[item];\n })\n );\n\n return result;\n}\n\nfunction createPlugins(context: ViteBuildContext) {\n const entries: [string, Plugin[] | Plugin | Promise<Plugin> | undefined][] = [\n ['bundleStat', bundleStatPlugin(context)],\n ['clean', cleanPlugin(context)],\n ['cssInjector', cssInjectorPlugin(context)],\n ['designSystemGuard', designSystemGuardPlugin(context)],\n ['devServerRouting', devServerRoutingPlugin(context)],\n ['externals', externalsPlugin(context)],\n ['html', htmlPlugin(context)],\n ['ignoreModules', ignoreModulesPlugin(context)],\n ['istanbul', istanbulPlugin(context)],\n ['magicComments', magicCommentsPlugin(context)],\n ['metadata', metadataPlugin(context)],\n ['momentLocales', momentLocalesPlugin(context)],\n ['styleUrls', styleUrlsPlugin(context)],\n ['svgr', svgrPlugin(context)],\n ['virtualModules', virtualModulesPlugin(context)],\n ];\n\n return entries\n .filter(\n ([name, plugin]) =>\n plugin && !context.bundlerConfig.omitDefault?.includes(`plugins.${name}`)\n )\n .flatMap(([, plugin]) => plugin);\n}\n\nexport function createBaseConfig(context: ViteBuildContext): InlineConfig {\n const { isProduction } = context.build;\n const { isWebComponent } = context.package;\n\n let config: InlineConfig = {\n cacheDir: `node_modules/.vite/${getBundleType(context) ?? 'host'}`,\n customLogger: createFilteringLogger(),\n server: {\n // Windows machines can fail to connect to \"localhost\"; bind to a fixed address instead.\n host: '127.0.0.1',\n port: context.bundlerConfig.port ?? (isWebComponent ? 8888 : 8080),\n },\n mode: isProduction ? bundleConstants.mode.production : bundleConstants.mode.development,\n configFile: false,\n oxc: { legalComments: 'none' },\n base: getCdnPath(context) || './', // eslint-disable-line @typescript-eslint/prefer-nullish-coalescing\n css: createCssConfig(isProduction),\n build: {\n /*\n * MFEs render inside shadow DOM — lazy CSS chunks would inject into document.head,\n * leaking styles into the host. Bundling all CSS into one file avoids this.\n */\n cssCodeSplit: !isWebComponent,\n sourcemap: true,\n rolldownOptions: {\n output: { assetFileNames, codeSplitting: getCodeSplitting(context) },\n plugins: [chainSourceMapsPlugin()],\n },\n },\n define: {\n ...importMetaRemap(\n defineExposedDependencies(context),\n defineExposedInstanceDependencies(context),\n defineWebComponentName(context)\n ),\n ...(getProcessEnv(context) ?? {}),\n },\n optimizeDeps: {\n include: ['@servicetitan/startup-utils'],\n /*\n * Top-level plugins don't run during dependency pre-bundling, so\n * register ignoreModulesPlugin again here. Without this, missing\n * optional peer dependencies inside pre-bundled packages throw at\n * runtime instead of resolving to an empty module.\n */\n rolldownOptions: {\n plugins: [ignoreModulesPlugin(context)],\n },\n },\n plugins: createPlugins(context),\n };\n\n const omitKeys = context.bundlerConfig.omitDefault?.filter(k => !k.startsWith('plugins.'));\n if (omitKeys?.length) {\n config = omit({ ...config }, omitKeys);\n }\n\n if (context.bundlerConfig.minify.js !== undefined) {\n config.build = { ...config.build, minify: !!context.bundlerConfig.minify.js };\n }\n if (context.bundlerConfig.minify.css !== undefined) {\n config.build = { ...config.build, cssMinify: !!context.bundlerConfig.minify.css };\n }\n\n // Minified output can't be mapped back to source, so skip it when instrumenting.\n if (context.options.codeCoverage) {\n config.build = { ...config.build, minify: false };\n }\n\n return config;\n}\n"],"names":["createBaseConfig","importMetaRemap","definitions","result","filter","definition","undefined","forEach","Object","keys","item","createPlugins","context","entries","bundleStatPlugin","cleanPlugin","cssInjectorPlugin","designSystemGuardPlugin","devServerRoutingPlugin","externalsPlugin","htmlPlugin","ignoreModulesPlugin","istanbulPlugin","magicCommentsPlugin","metadataPlugin","momentLocalesPlugin","styleUrlsPlugin","svgrPlugin","virtualModulesPlugin","name","plugin","bundlerConfig","omitDefault","includes","flatMap","getBundleType","getProcessEnv","isProduction","build","isWebComponent","package","config","cacheDir","customLogger","createFilteringLogger","server","host","port","mode","bundleConstants","production","development","configFile","oxc","legalComments","base","getCdnPath","css","createCssConfig","cssCodeSplit","sourcemap","rolldownOptions","output","assetFileNames","codeSplitting","getCodeSplitting","plugins","chainSourceMapsPlugin","define","defineExposedDependencies","defineExposedInstanceDependencies","defineWebComponentName","optimizeDeps","include","omitKeys","k","startsWith","length","omit","minify","js","cssMinify","options","codeCoverage"],"mappings":";;;;+BA8EgBA;;;eAAAA;;;sBArET;uBACc;yBAkBd;gCAEwB;+BACE;iCACD;uCACM;AAEtC,SAASC,gBACL,GAAGC,WAAmD;IAEtD,MAAMC,SAAiC,CAAC;IAExCD,YACKE,MAAM,CAACC,CAAAA,aAAcA,eAAeC,WACpCC,OAAO,CAACF,CAAAA,aACLG,OAAOC,IAAI,CAACJ,YAAYE,OAAO,CAACG,CAAAA;YAC5BP,MAAM,CAAC,CAAC,gBAAgB,EAAEO,MAAM,CAAC,GAAGL,UAAU,CAACK,KAAK;QACxD;IAGR,OAAOP;AACX;AAEA,SAASQ,cAAcC,OAAyB;IAC5C,MAAMC,UAAuE;QACzE;YAAC;YAAcC,IAAAA,yBAAgB,EAACF;SAAS;QACzC;YAAC;YAASG,IAAAA,oBAAW,EAACH;SAAS;QAC/B;YAAC;YAAeI,IAAAA,0BAAiB,EAACJ;SAAS;QAC3C;YAAC;YAAqBK,IAAAA,gCAAuB,EAACL;SAAS;QACvD;YAAC;YAAoBM,IAAAA,+BAAsB,EAACN;SAAS;QACrD;YAAC;YAAaO,IAAAA,wBAAe,EAACP;SAAS;QACvC;YAAC;YAAQQ,IAAAA,mBAAU,EAACR;SAAS;QAC7B;YAAC;YAAiBS,IAAAA,4BAAmB,EAACT;SAAS;QAC/C;YAAC;YAAYU,IAAAA,uBAAc,EAACV;SAAS;QACrC;YAAC;YAAiBW,IAAAA,4BAAmB,EAACX;SAAS;QAC/C;YAAC;YAAYY,IAAAA,uBAAc,EAACZ;SAAS;QACrC;YAAC;YAAiBa,IAAAA,4BAAmB,EAACb;SAAS;QAC/C;YAAC;YAAac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YAAEyC,QAAQ;QAAM;IACpD;IAEA,OAAOtC;AACX"}
@@ -1 +1 @@
1
- {"version":3,"file":"create-filtering-logger.d.ts","sourceRoot":"","sources":["../../../src/vite/config/create-filtering-logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AAejD,wBAAgB,qBAAqB,IAAI,MAAM,CAkB9C"}
1
+ {"version":3,"file":"create-filtering-logger.d.ts","sourceRoot":"","sources":["../../../src/vite/config/create-filtering-logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AA0BjD,wBAAgB,qBAAqB,IAAI,MAAM,CAkB9C"}
@@ -17,10 +17,21 @@ const _vite = require("vite");
17
17
  /<script src="\.\/shared\/[^"]+"> in "[^"]*" can't be bundled without type="module"/,
18
18
  /\.\/shared\/\S+ doesn't exist at build time/
19
19
  ];
20
+ /*
21
+ * Expected when code feature-detects an optional peer dependency (e.g. `Package.Export
22
+ * === undefined`) and ignoreModulesPlugin has substituted an empty module for it. Matched
23
+ * on the plugin's IGNORE_EMPTY marker so a genuinely undefined export elsewhere still warns.
24
+ */ const IGNORED_MODULE_WARNINGS = [
25
+ /Import `\w+` will always be undefined because there is no matching export in '\\0IGNORE_EMPTY:[^']+'/
26
+ ];
27
+ const SUPPRESSED_WARNINGS = [
28
+ ...SHARED_ASSET_WARNINGS,
29
+ ...IGNORED_MODULE_WARNINGS
30
+ ];
20
31
  function createFilteringLogger() {
21
32
  const logger = (0, _vite.createLogger)();
22
33
  const { warn, warnOnce } = logger;
23
- const isSuppressed = (message)=>SHARED_ASSET_WARNINGS.some((pattern)=>pattern.test(message));
34
+ const isSuppressed = (message)=>SUPPRESSED_WARNINGS.some((pattern)=>pattern.test(message));
24
35
  logger.warn = (message, options)=>{
25
36
  if (!isSuppressed(message)) {
26
37
  warn.call(logger, message, options);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/vite/config/create-filtering-logger.ts"],"sourcesContent":["import { createLogger, type Logger } from 'vite';\n\n/*\n * Expected warnings when a host's HTML references the shared-bundle assets created by\n * separate \"exposed dependencies\" build. Matched on ./shared/ so a genuinely missing\n * app asset still warns.\n */\nconst SHARED_ASSET_WARNINGS = [\n /<script src=\"\\.\\/shared\\/[^\"]+\"> in \"[^\"]*\" can't be bundled without type=\"module\"/,\n /\\.\\/shared\\/\\S+ doesn't exist at build time/,\n];\n\n/*\n * Wraps Vite's logger to drop the shared-asset HTML warnings. Everything else passes through.\n */\nexport function createFilteringLogger(): Logger {\n const logger = createLogger();\n const { warn, warnOnce } = logger;\n const isSuppressed = (message: string) =>\n SHARED_ASSET_WARNINGS.some(pattern => pattern.test(message));\n\n logger.warn = (message, options) => {\n if (!isSuppressed(message)) {\n warn.call(logger, message, options);\n }\n };\n logger.warnOnce = (message, options) => {\n if (!isSuppressed(message)) {\n warnOnce.call(logger, message, options);\n }\n };\n\n return logger;\n}\n"],"names":["createFilteringLogger","SHARED_ASSET_WARNINGS","logger","createLogger","warn","warnOnce","isSuppressed","message","some","pattern","test","options","call"],"mappings":";;;;+BAegBA;;;eAAAA;;;sBAf0B;AAE1C;;;;CAIC,GACD,MAAMC,wBAAwB;IAC1B;IACA;CACH;AAKM,SAASD;IACZ,MAAME,SAASC,IAAAA,kBAAY;IAC3B,MAAM,EAAEC,IAAI,EAAEC,QAAQ,EAAE,GAAGH;IAC3B,MAAMI,eAAe,CAACC,UAClBN,sBAAsBO,IAAI,CAACC,CAAAA,UAAWA,QAAQC,IAAI,CAACH;IAEvDL,OAAOE,IAAI,GAAG,CAACG,SAASI;QACpB,IAAI,CAACL,aAAaC,UAAU;YACxBH,KAAKQ,IAAI,CAACV,QAAQK,SAASI;QAC/B;IACJ;IACAT,OAAOG,QAAQ,GAAG,CAACE,SAASI;QACxB,IAAI,CAACL,aAAaC,UAAU;YACxBF,SAASO,IAAI,CAACV,QAAQK,SAASI;QACnC;IACJ;IAEA,OAAOT;AACX"}
1
+ {"version":3,"sources":["../../../src/vite/config/create-filtering-logger.ts"],"sourcesContent":["import { createLogger, type Logger } from 'vite';\n\n/*\n * Expected warnings when a host's HTML references the shared-bundle assets created by\n * separate \"exposed dependencies\" build. Matched on ./shared/ so a genuinely missing\n * app asset still warns.\n */\nconst SHARED_ASSET_WARNINGS = [\n /<script src=\"\\.\\/shared\\/[^\"]+\"> in \"[^\"]*\" can't be bundled without type=\"module\"/,\n /\\.\\/shared\\/\\S+ doesn't exist at build time/,\n];\n\n/*\n * Expected when code feature-detects an optional peer dependency (e.g. `Package.Export\n * === undefined`) and ignoreModulesPlugin has substituted an empty module for it. Matched\n * on the plugin's IGNORE_EMPTY marker so a genuinely undefined export elsewhere still warns.\n */\nconst IGNORED_MODULE_WARNINGS = [\n /Import `\\w+` will always be undefined because there is no matching export in '\\\\0IGNORE_EMPTY:[^']+'/,\n];\n\nconst SUPPRESSED_WARNINGS = [...SHARED_ASSET_WARNINGS, ...IGNORED_MODULE_WARNINGS];\n\n/*\n * Wraps Vite's logger to drop expected warnings. Everything else passes through.\n */\nexport function createFilteringLogger(): Logger {\n const logger = createLogger();\n const { warn, warnOnce } = logger;\n const isSuppressed = (message: string) =>\n SUPPRESSED_WARNINGS.some(pattern => pattern.test(message));\n\n logger.warn = (message, options) => {\n if (!isSuppressed(message)) {\n warn.call(logger, message, options);\n }\n };\n logger.warnOnce = (message, options) => {\n if (!isSuppressed(message)) {\n warnOnce.call(logger, message, options);\n }\n };\n\n return logger;\n}\n"],"names":["createFilteringLogger","SHARED_ASSET_WARNINGS","IGNORED_MODULE_WARNINGS","SUPPRESSED_WARNINGS","logger","createLogger","warn","warnOnce","isSuppressed","message","some","pattern","test","options","call"],"mappings":";;;;+BA0BgBA;;;eAAAA;;;sBA1B0B;AAE1C;;;;CAIC,GACD,MAAMC,wBAAwB;IAC1B;IACA;CACH;AAED;;;;CAIC,GACD,MAAMC,0BAA0B;IAC5B;CACH;AAED,MAAMC,sBAAsB;OAAIF;OAA0BC;CAAwB;AAK3E,SAASF;IACZ,MAAMI,SAASC,IAAAA,kBAAY;IAC3B,MAAM,EAAEC,IAAI,EAAEC,QAAQ,EAAE,GAAGH;IAC3B,MAAMI,eAAe,CAACC,UAClBN,oBAAoBO,IAAI,CAACC,CAAAA,UAAWA,QAAQC,IAAI,CAACH;IAErDL,OAAOE,IAAI,GAAG,CAACG,SAASI;QACpB,IAAI,CAACL,aAAaC,UAAU;YACxBH,KAAKQ,IAAI,CAACV,QAAQK,SAASI;QAC/B;IACJ;IACAT,OAAOG,QAAQ,GAAG,CAACE,SAASI;QACxB,IAAI,CAACL,aAAaC,UAAU;YACxBF,SAASO,IAAI,CAACV,QAAQK,SAASI;QACnC;IACJ;IAEA,OAAOT;AACX"}
@@ -1 +1 @@
1
- {"version":3,"file":"create-vite-build-context.d.ts","sourceRoot":"","sources":["../../../src/vite/config/create-vite-build-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAiCzD,wBAAgB,sBAAsB,CAClC,OAAO,EAAE,YAAY,EACrB,aAAa,EAAE,uBAAuB,EACtC,UAAU,EAAE,sBAAsB,GACnC,gBAAgB,CAElB"}
1
+ {"version":3,"file":"create-vite-build-context.d.ts","sourceRoot":"","sources":["../../../src/vite/config/create-vite-build-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,aAAa,CAAC;AACtD,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAE,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAkCzD,wBAAgB,sBAAsB,CAClC,OAAO,EAAE,YAAY,EACrB,aAAa,EAAE,uBAAuB,EACtC,UAAU,EAAE,sBAAsB,GACnC,gBAAgB,CAElB"}
@@ -9,6 +9,8 @@ Object.defineProperty(exports, "createViteBuildContext", {
9
9
  }
10
10
  });
11
11
  function createBundlerConfig(packageJsonConfig, fileConfig) {
12
+ var _ref;
13
+ var _fileConfig_config_build, _fileConfig_config, _packageJsonConfig_config_build, _packageJsonConfig_config;
12
14
  const { port: pkgPort, omitDefault: pkgOmit = [], pluginOverrides: pkgPluginOverrides = {}, minify: pkgMinify = {} } = packageJsonConfig;
13
15
  const { port: filePort, omitDefault: fileOmit = [], pluginOverrides: filePluginOverrides = {}, minify: fileMinify = {} } = fileConfig;
14
16
  return {
@@ -30,7 +32,8 @@ function createBundlerConfig(packageJsonConfig, fileConfig) {
30
32
  minify: {
31
33
  ...pkgMinify,
32
34
  ...fileMinify
33
- }
35
+ },
36
+ outDir: (_ref = (_fileConfig_config = fileConfig.config) === null || _fileConfig_config === void 0 ? void 0 : (_fileConfig_config_build = _fileConfig_config.build) === null || _fileConfig_config_build === void 0 ? void 0 : _fileConfig_config_build.outDir) !== null && _ref !== void 0 ? _ref : (_packageJsonConfig_config = packageJsonConfig.config) === null || _packageJsonConfig_config === void 0 ? void 0 : (_packageJsonConfig_config_build = _packageJsonConfig_config.build) === null || _packageJsonConfig_config_build === void 0 ? void 0 : _packageJsonConfig_config_build.outDir
34
37
  };
35
38
  }
36
39
  function createViteBuildContext(context, pkgJsonConfig, fileConfig) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/vite/config/create-vite-build-context.ts"],"sourcesContent":["import { BuildContext } from '../../core';\nimport { VitePackageJsonOverride } from '../../utils';\nimport { ViteBuildContext } from '../types';\nimport { ViteConfigFileOverride } from './define-config';\n\nfunction createBundlerConfig(\n packageJsonConfig: VitePackageJsonOverride,\n fileConfig: ViteConfigFileOverride\n): ViteBuildContext['bundlerConfig'] {\n const {\n port: pkgPort,\n omitDefault: pkgOmit = [],\n pluginOverrides: pkgPluginOverrides = {},\n minify: pkgMinify = {},\n } = packageJsonConfig;\n const {\n port: filePort,\n omitDefault: fileOmit = [],\n pluginOverrides: filePluginOverrides = {},\n minify: fileMinify = {},\n } = fileConfig;\n\n return {\n port: filePort ?? pkgPort,\n omitDefault: [...pkgOmit, ...fileOmit],\n pluginOverrides: {\n html: {\n ...pkgPluginOverrides.html,\n ...filePluginOverrides.html,\n },\n svgr: { ...pkgPluginOverrides.svgr, ...filePluginOverrides.svgr },\n },\n minify: { ...pkgMinify, ...fileMinify },\n };\n}\n\nexport function createViteBuildContext(\n context: BuildContext,\n pkgJsonConfig: VitePackageJsonOverride,\n fileConfig: ViteConfigFileOverride\n): ViteBuildContext {\n return { ...context, bundlerConfig: createBundlerConfig(pkgJsonConfig, fileConfig) };\n}\n"],"names":["createViteBuildContext","createBundlerConfig","packageJsonConfig","fileConfig","port","pkgPort","omitDefault","pkgOmit","pluginOverrides","pkgPluginOverrides","minify","pkgMinify","filePort","fileOmit","filePluginOverrides","fileMinify","html","svgr","context","pkgJsonConfig","bundlerConfig"],"mappings":";;;;+BAoCgBA;;;eAAAA;;;AA/BhB,SAASC,oBACLC,iBAA0C,EAC1CC,UAAkC;IAElC,MAAM,EACFC,MAAMC,OAAO,EACbC,aAAaC,UAAU,EAAE,EACzBC,iBAAiBC,qBAAqB,CAAC,CAAC,EACxCC,QAAQC,YAAY,CAAC,CAAC,EACzB,GAAGT;IACJ,MAAM,EACFE,MAAMQ,QAAQ,EACdN,aAAaO,WAAW,EAAE,EAC1BL,iBAAiBM,sBAAsB,CAAC,CAAC,EACzCJ,QAAQK,aAAa,CAAC,CAAC,EAC1B,GAAGZ;IAEJ,OAAO;QACHC,IAAI,EAAEQ,qBAAAA,sBAAAA,WAAYP;QAClBC,aAAa;eAAIC;eAAYM;SAAS;QACtCL,iBAAiB;YACbQ,MAAM;gBACF,GAAGP,mBAAmBO,IAAI;gBAC1B,GAAGF,oBAAoBE,IAAI;YAC/B;YACAC,MAAM;gBAAE,GAAGR,mBAAmBQ,IAAI;gBAAE,GAAGH,oBAAoBG,IAAI;YAAC;QACpE;QACAP,QAAQ;YAAE,GAAGC,SAAS;YAAE,GAAGI,UAAU;QAAC;IAC1C;AACJ;AAEO,SAASf,uBACZkB,OAAqB,EACrBC,aAAsC,EACtChB,UAAkC;IAElC,OAAO;QAAE,GAAGe,OAAO;QAAEE,eAAenB,oBAAoBkB,eAAehB;IAAY;AACvF"}
1
+ {"version":3,"sources":["../../../src/vite/config/create-vite-build-context.ts"],"sourcesContent":["import { BuildContext } from '../../core';\nimport { VitePackageJsonOverride } from '../../utils';\nimport { ViteBuildContext } from '../types';\nimport { ViteConfigFileOverride } from './define-config';\n\nfunction createBundlerConfig(\n packageJsonConfig: VitePackageJsonOverride,\n fileConfig: ViteConfigFileOverride\n): ViteBuildContext['bundlerConfig'] {\n const {\n port: pkgPort,\n omitDefault: pkgOmit = [],\n pluginOverrides: pkgPluginOverrides = {},\n minify: pkgMinify = {},\n } = packageJsonConfig;\n const {\n port: filePort,\n omitDefault: fileOmit = [],\n pluginOverrides: filePluginOverrides = {},\n minify: fileMinify = {},\n } = fileConfig;\n\n return {\n port: filePort ?? pkgPort,\n omitDefault: [...pkgOmit, ...fileOmit],\n pluginOverrides: {\n html: {\n ...pkgPluginOverrides.html,\n ...filePluginOverrides.html,\n },\n svgr: { ...pkgPluginOverrides.svgr, ...filePluginOverrides.svgr },\n },\n minify: { ...pkgMinify, ...fileMinify },\n outDir: fileConfig.config?.build?.outDir ?? packageJsonConfig.config?.build?.outDir,\n };\n}\n\nexport function createViteBuildContext(\n context: BuildContext,\n pkgJsonConfig: VitePackageJsonOverride,\n fileConfig: ViteConfigFileOverride\n): ViteBuildContext {\n return { ...context, bundlerConfig: createBundlerConfig(pkgJsonConfig, fileConfig) };\n}\n"],"names":["createViteBuildContext","createBundlerConfig","packageJsonConfig","fileConfig","port","pkgPort","omitDefault","pkgOmit","pluginOverrides","pkgPluginOverrides","minify","pkgMinify","filePort","fileOmit","filePluginOverrides","fileMinify","html","svgr","outDir","config","build","context","pkgJsonConfig","bundlerConfig"],"mappings":";;;;+BAqCgBA;;;eAAAA;;;AAhChB,SAASC,oBACLC,iBAA0C,EAC1CC,UAAkC;;QA0BtBA,0BAAAA,oBAAoCD,iCAAAA;IAxBhD,MAAM,EACFE,MAAMC,OAAO,EACbC,aAAaC,UAAU,EAAE,EACzBC,iBAAiBC,qBAAqB,CAAC,CAAC,EACxCC,QAAQC,YAAY,CAAC,CAAC,EACzB,GAAGT;IACJ,MAAM,EACFE,MAAMQ,QAAQ,EACdN,aAAaO,WAAW,EAAE,EAC1BL,iBAAiBM,sBAAsB,CAAC,CAAC,EACzCJ,QAAQK,aAAa,CAAC,CAAC,EAC1B,GAAGZ;IAEJ,OAAO;QACHC,IAAI,EAAEQ,qBAAAA,sBAAAA,WAAYP;QAClBC,aAAa;eAAIC;eAAYM;SAAS;QACtCL,iBAAiB;YACbQ,MAAM;gBACF,GAAGP,mBAAmBO,IAAI;gBAC1B,GAAGF,oBAAoBE,IAAI;YAC/B;YACAC,MAAM;gBAAE,GAAGR,mBAAmBQ,IAAI;gBAAE,GAAGH,oBAAoBG,IAAI;YAAC;QACpE;QACAP,QAAQ;YAAE,GAAGC,SAAS;YAAE,GAAGI,UAAU;QAAC;QACtCG,MAAM,WAAEf,qBAAAA,WAAWgB,MAAM,cAAjBhB,0CAAAA,2BAAAA,mBAAmBiB,KAAK,cAAxBjB,+CAAAA,yBAA0Be,MAAM,wCAAIhB,4BAAAA,kBAAkBiB,MAAM,cAAxBjB,iDAAAA,kCAAAA,0BAA0BkB,KAAK,cAA/BlB,sDAAAA,gCAAiCgB,MAAM;IACvF;AACJ;AAEO,SAASlB,uBACZqB,OAAqB,EACrBC,aAAsC,EACtCnB,UAAkC;IAElC,OAAO;QAAE,GAAGkB,OAAO;QAAEE,eAAetB,oBAAoBqB,eAAenB;IAAY;AACvF"}
@@ -1,4 +1,4 @@
1
- import type { Plugin } from 'vite';
1
+ import { type Plugin } from 'vite';
2
2
  import { type BuildContext } from '../../core';
3
3
  /**
4
4
  * URL rewrites for dev and preview servers.
@@ -1 +1 @@
1
- {"version":3,"file":"dev-server-routing-plugin.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/dev-server-routing-plugin.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,EAAiB,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAG9D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAqEpE"}
1
+ {"version":3,"file":"dev-server-routing-plugin.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/dev-server-routing-plugin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAiB,KAAK,MAAM,EAAE,MAAM,MAAM,CAAC;AAClD,OAAO,EAAiB,KAAK,YAAY,EAAE,MAAM,YAAY,CAAC;AAG9D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,YAAY,GAAG,MAAM,CAqEpE"}
@@ -10,6 +10,7 @@ Object.defineProperty(exports, "devServerRoutingPlugin", {
10
10
  });
11
11
  const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
12
12
  const _path = /*#__PURE__*/ _interop_require_default(require("path"));
13
+ const _vite = require("vite");
13
14
  const _core = require("../../core");
14
15
  const _utils = require("../../utils");
15
16
  function _interop_require_default(obj) {
@@ -36,7 +37,7 @@ function devServerRoutingPlugin(context) {
36
37
  outDir = config.build.outDir;
37
38
  },
38
39
  configureServer (server) {
39
- const outDirRelative = `/${_path.default.relative(process.cwd(), outDir)}/`;
40
+ const outDirRelative = `/${(0, _vite.normalizePath)(_path.default.relative(process.cwd(), outDir))}/`;
40
41
  server.middlewares.use((req, _res, next)=>{
41
42
  var _req_url;
42
43
  logRequest(req);
@@ -60,7 +61,7 @@ function devServerRoutingPlugin(context) {
60
61
  return;
61
62
  }
62
63
  const destDir = _path.default.resolve(destination);
63
- const mountPath = '/' + _path.default.relative(process.cwd(), destDir);
64
+ const mountPath = '/' + (0, _vite.normalizePath)(_path.default.relative(process.cwd(), destDir));
64
65
  const contentTypes = {
65
66
  '.js': 'application/javascript',
66
67
  '.css': 'text/css',
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/vite/plugins/dev-server-routing-plugin.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport type { Plugin } from 'vite';\nimport { getBundleType, type BuildContext } from '../../core';\nimport { log } from '../../utils';\n\n/**\n * URL rewrites for dev and preview servers.\n *\n * Dev serves from the project root, preview serves from outDir. Production builds output to\n * dist/bundle/. Paths that work in prod (relative to index.html in outDir) break in dev and\n * preview because the server root differs.\n *\n * - Host dev (root: project root): template uses ./shared/... which resolves to /shared/...\n * but files are at dist/bundle/shared/. Rewrites to /dist/bundle/shared/... so Vite serves them.\n *\n * - MFE dev (root: project root): Loader reads entrypoints.json and requests assets at\n * production output paths (e.g. /dist/bundle/full/index.js). Strips the outDir prefix\n * so files resolve from root.\n *\n * - Host preview (root: dist/bundle/): shared/ is inside outDir, no rewrites needed.\n *\n * - MFE preview (root: dist/bundle/full/): host requests metadata.json from the parent\n * dist/bundle/ and sibling bundle assets (light/, headless/). Serves the entire destination\n * directory as static files.\n */\nexport function devServerRoutingPlugin(context: BuildContext): Plugin {\n const { isWebComponent, destination } = context.package;\n let outDir = '';\n\n const sharedDepsDirname = getBundleType({\n ...context,\n build: { ...context.build, emitExposedDependencies: true },\n });\n\n const logRequest = (req: import('http').IncomingMessage) => {\n log.info(`[${log.timestamp}]: ${req.method} ${req.url}`);\n };\n\n return {\n name: 'dev-server-routing',\n\n configResolved(config) {\n outDir = config.build.outDir;\n },\n\n configureServer(server) {\n const outDirRelative = `/${path.relative(process.cwd(), outDir)}/`;\n\n server.middlewares.use((req, _res, next) => {\n logRequest(req);\n const url = req.url ?? '';\n if (isWebComponent) {\n if (url.startsWith(outDirRelative)) {\n req.url = url.slice(outDirRelative.length - 1);\n }\n } else if (url.startsWith(`/${sharedDepsDirname}/`)) {\n req.url = `${outDirRelative}${url.slice(1)}`;\n }\n next();\n });\n },\n\n configurePreviewServer(server) {\n server.middlewares.use((req, _res, next) => {\n logRequest(req);\n next();\n });\n\n if (!isWebComponent) {\n return;\n }\n\n const destDir = path.resolve(destination);\n const mountPath = '/' + path.relative(process.cwd(), destDir);\n\n const contentTypes: Record<string, string> = {\n '.js': 'application/javascript',\n '.css': 'text/css',\n '.json': 'application/json',\n };\n\n server.middlewares.use(mountPath, (req, res, next) => {\n const filePath = path.join(destDir, req.url ?? '');\n if (!filePath.startsWith(destDir + path.sep) || !fs.existsSync(filePath)) {\n return next();\n }\n const contentType = contentTypes[path.extname(filePath)];\n if (contentType) {\n res.setHeader('Content-Type', contentType);\n }\n fs.createReadStream(filePath).pipe(res);\n });\n },\n };\n}\n"],"names":["devServerRoutingPlugin","context","isWebComponent","destination","package","outDir","sharedDepsDirname","getBundleType","build","emitExposedDependencies","logRequest","req","log","info","timestamp","method","url","name","configResolved","config","configureServer","server","outDirRelative","path","relative","process","cwd","middlewares","use","_res","next","startsWith","slice","length","configurePreviewServer","destDir","resolve","mountPath","contentTypes","res","filePath","join","sep","fs","existsSync","contentType","extname","setHeader","createReadStream","pipe"],"mappings":";;;;+BA0BgBA;;;eAAAA;;;2DA1BD;6DACE;sBAEgC;uBAC7B;;;;;;AAsBb,SAASA,uBAAuBC,OAAqB;IACxD,MAAM,EAAEC,cAAc,EAAEC,WAAW,EAAE,GAAGF,QAAQG,OAAO;IACvD,IAAIC,SAAS;IAEb,MAAMC,oBAAoBC,IAAAA,mBAAa,EAAC;QACpC,GAAGN,OAAO;QACVO,OAAO;YAAE,GAAGP,QAAQO,KAAK;YAAEC,yBAAyB;QAAK;IAC7D;IAEA,MAAMC,aAAa,CAACC;QAChBC,UAAG,CAACC,IAAI,CAAC,CAAC,CAAC,EA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,WAAWjB,aAAI,CAACkB,IAAI,CAACN,UAASxB,WAAAA,IAAIK,GAAG,cAAPL,sBAAAA,WAAW;gBAC/C,IAAI,CAAC6B,SAAST,UAAU,CAACI,UAAUZ,aAAI,CAACmB,GAAG,KAAK,CAACC,WAAE,CAACC,UAAU,CAACJ,WAAW;oBACtE,OAAOV;gBACX;gBACA,MAAMe,cAAcP,YAAY,CAACf,aAAI,CAACuB,OAAO,CAACN,UAAU;gBACxD,IAAIK,aAAa;oBACbN,IAAIQ,SAAS,CAAC,gBAAgBF;gBAClC;gBACAF,WAAE,CAACK,gBAAgB,CAACR,UAAUS,IAAI,CAACV;YACvC;QACJ;IACJ;AACJ"}
1
+ {"version":3,"sources":["../../../src/vite/plugins/dev-server-routing-plugin.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport { normalizePath, type Plugin } from 'vite';\nimport { getBundleType, type BuildContext } from '../../core';\nimport { log } from '../../utils';\n\n/**\n * URL rewrites for dev and preview servers.\n *\n * Dev serves from the project root, preview serves from outDir. Production builds output to\n * dist/bundle/. Paths that work in prod (relative to index.html in outDir) break in dev and\n * preview because the server root differs.\n *\n * - Host dev (root: project root): template uses ./shared/... which resolves to /shared/...\n * but files are at dist/bundle/shared/. Rewrites to /dist/bundle/shared/... so Vite serves them.\n *\n * - MFE dev (root: project root): Loader reads entrypoints.json and requests assets at\n * production output paths (e.g. /dist/bundle/full/index.js). Strips the outDir prefix\n * so files resolve from root.\n *\n * - Host preview (root: dist/bundle/): shared/ is inside outDir, no rewrites needed.\n *\n * - MFE preview (root: dist/bundle/full/): host requests metadata.json from the parent\n * dist/bundle/ and sibling bundle assets (light/, headless/). Serves the entire destination\n * directory as static files.\n */\nexport function devServerRoutingPlugin(context: BuildContext): Plugin {\n const { isWebComponent, destination } = context.package;\n let outDir = '';\n\n const sharedDepsDirname = getBundleType({\n ...context,\n build: { ...context.build, emitExposedDependencies: true },\n });\n\n const logRequest = (req: import('http').IncomingMessage) => {\n log.info(`[${log.timestamp}]: ${req.method} ${req.url}`);\n };\n\n return {\n name: 'dev-server-routing',\n\n configResolved(config) {\n outDir = config.build.outDir;\n },\n\n configureServer(server) {\n const outDirRelative = `/${normalizePath(path.relative(process.cwd(), outDir))}/`;\n\n server.middlewares.use((req, _res, next) => {\n logRequest(req);\n const url = req.url ?? '';\n if (isWebComponent) {\n if (url.startsWith(outDirRelative)) {\n req.url = url.slice(outDirRelative.length - 1);\n }\n } else if (url.startsWith(`/${sharedDepsDirname}/`)) {\n req.url = `${outDirRelative}${url.slice(1)}`;\n }\n next();\n });\n },\n\n configurePreviewServer(server) {\n server.middlewares.use((req, _res, next) => {\n logRequest(req);\n next();\n });\n\n if (!isWebComponent) {\n return;\n }\n\n const destDir = path.resolve(destination);\n const mountPath = '/' + normalizePath(path.relative(process.cwd(), destDir));\n\n const contentTypes: Record<string, string> = {\n '.js': 'application/javascript',\n '.css': 'text/css',\n '.json': 'application/json',\n };\n\n server.middlewares.use(mountPath, (req, res, next) => {\n const filePath = path.join(destDir, req.url ?? '');\n if (!filePath.startsWith(destDir + path.sep) || !fs.existsSync(filePath)) {\n return next();\n }\n const contentType = contentTypes[path.extname(filePath)];\n if (contentType) {\n res.setHeader('Content-Type', contentType);\n }\n fs.createReadStream(filePath).pipe(res);\n });\n },\n };\n}\n"],"names":["devServerRoutingPlugin","context","isWebComponent","destination","package","outDir","sharedDepsDirname","getBundleType","build","emitExposedDependencies","logRequest","req","log","info","timestamp","method","url","name","configResolved","config","configureServer","server","outDirRelative","normalizePath","path","relative","process","cwd","middlewares","use","_res","next","startsWith","slice","length","configurePreviewServer","destDir","resolve","mountPath","contentTypes","res","filePath","join","sep","fs","existsSync","contentType","extname","setHeader","createReadStream","pipe"],"mappings":";;;;+BA0BgBA;;;eAAAA;;;2DA1BD;6DACE;sBAC0B;sBACM;uBAC7B;;;;;;AAsBb,SAASA,uBAAuBC,OAAqB;IACxD,MAAM,EAAEC,cAAc,EAAEC,WAAW,EAAE,GAAGF,QAAQG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AACa,OAAO,CAAClC;YAC7B,MAAMmC,YAAY,MAAMf,IAAAA,mBAAa,EAACC,aAAI,CAACC,QAAQ,CAACC,QAAQC,GAAG,IAAIS;YAEnE,MAAMG,eAAuC;gBACzC,OAAO;gBACP,QAAQ;gBACR,SAAS;YACb;YAEAlB,OAAOO,WAAW,CAACC,GAAG,CAACS,WAAW,CAAC3B,KAAK6B,KAAKT;oBACLpB;gBAApC,MAAM8B,WAAWjB,aAAI,CAACkB,IAAI,CAACN,UAASzB,WAAAA,IAAIK,GAAG,cAAPL,sBAAAA,WAAW;gBAC/C,IAAI,CAAC8B,SAAST,UAAU,CAACI,UAAUZ,aAAI,CAACmB,GAAG,KAAK,CAACC,WAAE,CAACC,UAAU,CAACJ,WAAW;oBACtE,OAAOV;gBACX;gBACA,MAAMe,cAAcP,YAAY,CAACf,aAAI,CAACuB,OAAO,CAACN,UAAU;gBACxD,IAAIK,aAAa;oBACbN,IAAIQ,SAAS,CAAC,gBAAgBF;gBAClC;gBACAF,WAAE,CAACK,gBAAgB,CAACR,UAAUS,IAAI,CAACV;YACvC;QACJ;IACJ;AACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"istanbul-plugin.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/istanbul-plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG5C,wBAAgB,cAAc,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,SAAS,CAcrF"}
1
+ {"version":3,"file":"istanbul-plugin.d.ts","sourceRoot":"","sources":["../../../src/vite/plugins/istanbul-plugin.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAEnC,OAAO,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG5C,wBAAgB,cAAc,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,CAAC,GAAG,SAAS,CAkBrF"}
@@ -8,7 +8,14 @@ Object.defineProperty(exports, "istanbulPlugin", {
8
8
  return istanbulPlugin;
9
9
  }
10
10
  });
11
+ const _path = /*#__PURE__*/ _interop_require_default(require("path"));
12
+ const _core = require("../../core");
11
13
  const _utils = require("./utils");
14
+ function _interop_require_default(obj) {
15
+ return obj && obj.__esModule ? obj : {
16
+ default: obj
17
+ };
18
+ }
12
19
  function istanbulPlugin(context) {
13
20
  if (!context.options.codeCoverage) {
14
21
  return;
@@ -17,11 +24,36 @@ function istanbulPlugin(context) {
17
24
  return (0, _utils.importEsm)('vite-plugin-istanbul').then(({ default: istanbul })=>istanbul({
18
25
  exclude: [
19
26
  '**/node_modules/**',
20
- '**/.yalc/**'
27
+ '**/.yalc/**',
28
+ ...sharedDependenciesExclude(context)
21
29
  ],
22
30
  requireEnv: false,
23
31
  forceBuildInstrument: true
24
32
  }));
25
33
  }
34
+ /*
35
+ * devServerRoutingPlugin serves the prebuilt shared-dependencies bundle (react, mobx, the
36
+ * design system, etc.) straight from disk at dev time. Instrumenting that vendor code breaks
37
+ * Vite's import analysis on the huge instrumented output and provides no useful coverage.
38
+ *
39
+ * vite-plugin-istanbul matches exclude patterns against paths relative to process.cwd()
40
+ * (via test-exclude's default `relativePath` behavior), so the pattern must be cwd-relative
41
+ * rather than absolute.
42
+ */ function sharedDependenciesExclude(context) {
43
+ if (!context.package.isExposeSharedDependencies) {
44
+ return [];
45
+ }
46
+ const sharedContext = {
47
+ ...context,
48
+ build: {
49
+ ...context.build,
50
+ emitExposedDependencies: true
51
+ }
52
+ };
53
+ const outputPath = (0, _core.resolveOutputPath)(sharedContext, context.bundlerConfig.outDir);
54
+ return [
55
+ _path.default.join(_path.default.relative(process.cwd(), outputPath), '**').replace(/\\/g, '/')
56
+ ];
57
+ }
26
58
 
27
59
  //# sourceMappingURL=istanbul-plugin.js.map