@servicetitan/startup 31.0.0 → 31.1.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 (148) hide show
  1. package/dist/cli/commands/build.d.ts.map +1 -1
  2. package/dist/cli/commands/build.js +1 -7
  3. package/dist/cli/commands/build.js.map +1 -1
  4. package/dist/cli/commands/prepare-package.d.ts +1 -2
  5. package/dist/cli/commands/prepare-package.d.ts.map +1 -1
  6. package/dist/cli/commands/prepare-package.js +4 -6
  7. package/dist/cli/commands/prepare-package.js.map +1 -1
  8. package/dist/cli/commands/run-task.test.js +59 -0
  9. package/dist/cli/commands/run-task.test.js.map +1 -0
  10. package/dist/cli/commands/start.d.ts.map +1 -1
  11. package/dist/cli/commands/start.js +2 -11
  12. package/dist/cli/commands/start.js.map +1 -1
  13. package/dist/cli/tasks/swc-cli.d.js +3 -0
  14. package/dist/cli/tasks/swc-cli.d.js.map +1 -0
  15. package/dist/cli/tasks/swc-compile-package.d.ts.map +1 -1
  16. package/dist/cli/tasks/swc-compile-package.js +22 -19
  17. package/dist/cli/tasks/swc-compile-package.js.map +1 -1
  18. package/dist/cli/types/cpx2.d.js +3 -0
  19. package/dist/cli/types/cpx2.d.js.map +1 -0
  20. package/dist/cli/utils/bundle.d.ts +2 -2
  21. package/dist/cli/utils/bundle.d.ts.map +1 -1
  22. package/dist/cli/utils/bundle.js +18 -4
  23. package/dist/cli/utils/bundle.js.map +1 -1
  24. package/dist/cli/utils/copy-files.d.ts +1 -1
  25. package/dist/cli/utils/copy-files.d.ts.map +1 -1
  26. package/dist/cli/utils/copy-files.js +18 -11
  27. package/dist/cli/utils/copy-files.js.map +1 -1
  28. package/dist/cli/utils/get-module-type.d.ts.map +1 -1
  29. package/dist/cli/utils/get-module-type.js +2 -16
  30. package/dist/cli/utils/get-module-type.js.map +1 -1
  31. package/dist/cli/utils/index.d.ts +1 -1
  32. package/dist/cli/utils/index.d.ts.map +1 -1
  33. package/dist/cli/utils/index.js +1 -1
  34. package/dist/cli/utils/index.js.map +1 -1
  35. package/dist/cli/utils/ts-config.d.ts +11 -0
  36. package/dist/cli/utils/ts-config.d.ts.map +1 -0
  37. package/dist/cli/utils/ts-config.js +80 -0
  38. package/dist/cli/utils/ts-config.js.map +1 -0
  39. package/dist/utils/get-configuration.d.ts +1 -0
  40. package/dist/utils/get-configuration.d.ts.map +1 -1
  41. package/dist/utils/get-configuration.js +14 -0
  42. package/dist/utils/get-configuration.js.map +1 -1
  43. package/dist/webpack/configs/index.d.ts +0 -1
  44. package/dist/webpack/configs/index.d.ts.map +1 -1
  45. package/dist/webpack/configs/index.js +0 -1
  46. package/dist/webpack/configs/index.js.map +1 -1
  47. package/dist/webpack/configs/optimization-config.js +6 -6
  48. package/dist/webpack/configs/optimization-config.js.map +1 -1
  49. package/dist/webpack/configs/output-config.d.ts.map +1 -1
  50. package/dist/webpack/configs/output-config.js +3 -2
  51. package/dist/webpack/configs/output-config.js.map +1 -1
  52. package/dist/webpack/configs/plugins/html-plugin.d.ts +1 -1
  53. package/dist/webpack/configs/plugins/html-plugin.d.ts.map +1 -1
  54. package/dist/webpack/configs/plugins/html-plugin.js +2 -2
  55. package/dist/webpack/configs/plugins/html-plugin.js.map +1 -1
  56. package/dist/webpack/configs/plugins/virtual-modules-plugin.js +14 -4
  57. package/dist/webpack/configs/plugins/virtual-modules-plugin.js.map +1 -1
  58. package/dist/webpack/configs/utils/generate-metadata.d.ts.map +1 -1
  59. package/dist/webpack/configs/utils/generate-metadata.js +4 -0
  60. package/dist/webpack/configs/utils/generate-metadata.js.map +1 -1
  61. package/dist/webpack/create-webpack-config.d.ts.map +1 -1
  62. package/dist/webpack/create-webpack-config.js +0 -1
  63. package/dist/webpack/create-webpack-config.js.map +1 -1
  64. package/dist/webpack/types.d.ts +1 -0
  65. package/dist/webpack/types.d.ts.map +1 -1
  66. package/dist/webpack/utils/index.d.ts +0 -1
  67. package/dist/webpack/utils/index.d.ts.map +1 -1
  68. package/dist/webpack/utils/index.js +0 -1
  69. package/dist/webpack/utils/index.js.map +1 -1
  70. package/package.json +7 -8
  71. package/src/cli/commands/__tests__/build.test.ts +2 -4
  72. package/src/cli/commands/__tests__/prepare-package.test.ts +5 -28
  73. package/src/cli/commands/__tests__/start.test.ts +3 -5
  74. package/src/cli/commands/build.ts +0 -2
  75. package/src/cli/commands/prepare-package.ts +4 -7
  76. package/src/cli/commands/start.ts +1 -3
  77. package/src/cli/tasks/__tests__/swc-compile-package.test.ts +71 -12
  78. package/src/cli/tasks/swc-compile-package.ts +21 -20
  79. package/src/cli/utils/__tests__/bundle.test.ts +48 -7
  80. package/src/cli/utils/__tests__/copy-files.test.ts +5 -5
  81. package/src/cli/utils/bundle.ts +27 -5
  82. package/src/cli/utils/copy-files.ts +16 -6
  83. package/src/cli/utils/get-module-type.ts +2 -18
  84. package/src/cli/utils/index.ts +1 -1
  85. package/src/cli/utils/ts-config.ts +64 -0
  86. package/src/utils/__tests__/get-configuration.test.ts +20 -0
  87. package/src/utils/get-configuration.ts +12 -0
  88. package/src/webpack/__tests__/create-webpack-config-shared-dependencies.test.ts +0 -1
  89. package/src/webpack/__tests__/create-webpack-config-web-component.test.ts +17 -28
  90. package/src/webpack/__tests__/create-webpack-config.test.ts +27 -38
  91. package/src/webpack/configs/index.ts +0 -1
  92. package/src/webpack/configs/optimization-config.ts +6 -6
  93. package/src/webpack/configs/output-config.ts +4 -2
  94. package/src/webpack/configs/plugins/html-plugin.ts +5 -2
  95. package/src/webpack/configs/plugins/virtual-modules-plugin.ts +15 -2
  96. package/src/webpack/configs/utils/__tests__/generate-metadata.test.ts +3 -1
  97. package/src/webpack/configs/utils/generate-metadata.ts +6 -1
  98. package/src/webpack/create-webpack-config.ts +0 -2
  99. package/src/webpack/types.ts +1 -0
  100. package/src/webpack/utils/index.ts +0 -1
  101. package/dist/__mocks__/create-package.d.ts +0 -3
  102. package/dist/__mocks__/create-package.d.ts.map +0 -1
  103. package/dist/__mocks__/index.d.ts +0 -2
  104. package/dist/__mocks__/index.d.ts.map +0 -1
  105. package/dist/cli/commands/review/__mocks__/expect-calls.d.ts +0 -23
  106. package/dist/cli/commands/review/__mocks__/expect-calls.d.ts.map +0 -1
  107. package/dist/cli/commands/review/__mocks__/index.d.ts +0 -2
  108. package/dist/cli/commands/review/__mocks__/index.d.ts.map +0 -1
  109. package/dist/cli/commands/review/rules/__mocks__/index.d.ts +0 -4
  110. package/dist/cli/commands/review/rules/__mocks__/index.d.ts.map +0 -1
  111. package/dist/cli/commands/review/rules/__mocks__/mock-config.d.ts +0 -7
  112. package/dist/cli/commands/review/rules/__mocks__/mock-config.d.ts.map +0 -1
  113. package/dist/cli/commands/review/rules/__mocks__/mock-packages.d.ts +0 -21
  114. package/dist/cli/commands/review/rules/__mocks__/mock-packages.d.ts.map +0 -1
  115. package/dist/cli/commands/review/rules/__mocks__/mock-project.d.ts +0 -3
  116. package/dist/cli/commands/review/rules/__mocks__/mock-project.d.ts.map +0 -1
  117. package/dist/cli/utils/style-extensions.d.ts +0 -2
  118. package/dist/cli/utils/style-extensions.d.ts.map +0 -1
  119. package/dist/cli/utils/style-extensions.js +0 -17
  120. package/dist/cli/utils/style-extensions.js.map +0 -1
  121. package/dist/cli/utils/tcm.d.ts +0 -6
  122. package/dist/cli/utils/tcm.d.ts.map +0 -1
  123. package/dist/cli/utils/tcm.js +0 -72
  124. package/dist/cli/utils/tcm.js.map +0 -1
  125. package/dist/webpack/__mocks__/file-rules.d.ts +0 -3
  126. package/dist/webpack/__mocks__/file-rules.d.ts.map +0 -1
  127. package/dist/webpack/__mocks__/index.d.ts +0 -3
  128. package/dist/webpack/__mocks__/index.d.ts.map +0 -1
  129. package/dist/webpack/__mocks__/style-rules.d.ts +0 -8
  130. package/dist/webpack/__mocks__/style-rules.d.ts.map +0 -1
  131. package/dist/webpack/configs/cache-config.d.ts +0 -6
  132. package/dist/webpack/configs/cache-config.d.ts.map +0 -1
  133. package/dist/webpack/configs/cache-config.js +0 -34
  134. package/dist/webpack/configs/cache-config.js.map +0 -1
  135. package/dist/webpack/utils/feature-cohort.d.ts +0 -5
  136. package/dist/webpack/utils/feature-cohort.d.ts.map +0 -1
  137. package/dist/webpack/utils/feature-cohort.js +0 -26
  138. package/dist/webpack/utils/feature-cohort.js.map +0 -1
  139. package/dist/webpack/utils/hash-mod.d.ts +0 -9
  140. package/dist/webpack/utils/hash-mod.d.ts.map +0 -1
  141. package/dist/webpack/utils/hash-mod.js +0 -39
  142. package/dist/webpack/utils/hash-mod.js.map +0 -1
  143. package/src/cli/utils/__tests__/tcm.test.ts +0 -195
  144. package/src/cli/utils/style-extensions.ts +0 -1
  145. package/src/cli/utils/tcm.ts +0 -66
  146. package/src/webpack/configs/cache-config.ts +0 -25
  147. package/src/webpack/utils/feature-cohort.ts +0 -19
  148. package/src/webpack/utils/hash-mod.ts +0 -32
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/cli/utils/copy-files.ts"],"sourcesContent":["import cpx from 'cpx2';\nimport fs from 'fs';\nimport { glob } from 'glob';\nimport DtsCreator from 'typed-css-modules';\n\nimport { getFolders, log } from '../../utils';\nimport { compileLess } from './compile-less';\nimport { compileSass } from './compile-sass';\n\nexport const assetExtensions = ['eot', 'gif', 'jpg', 'otf', 'png', 'svg', 'ttf', 'woff', 'woff2'];\nexport const styleExtensions = ['css', 'less', 'scss'];\n\nconst styleModuleRegex = new RegExp(`\\\\.module\\\\.(${styleExtensions.join('|')})$`);\n\ninterface CopyFilesOptions {\n watch?: boolean;\n}\n\nexport async function copyFiles({ watch }: CopyFilesOptions) {\n const { source, destination } = getFolders();\n if (!fs.existsSync(source)) {\n return;\n }\n\n const filesPattern = `${source}/**/*.{${[...assetExtensions, ...styleExtensions].join()}}`;\n const creator = new DtsCreator({ camelCase: true, namedExports: true });\n const generateDefinitions = async (file: string) => {\n try {\n const css = await compile(file);\n const content = await creator.create(file, css, !!watch);\n await content.writeFile();\n } catch (error) {\n log.error(String(error));\n }\n };\n\n if (!watch) {\n log.info(`Copying ${filesPattern} -> ${destination}`);\n cpx.copy(filesPattern, destination);\n\n const modulesPattern = `${source}/**/*.module.{${styleExtensions.join()}}`;\n log.info(`Generating types for ${modulesPattern}`);\n const modules = await glob(modulesPattern);\n await Promise.all(modules.map(generateDefinitions));\n return;\n }\n\n log.info(`Watching ${filesPattern} -> ${destination}`);\n cpx.watch(filesPattern, destination, {\n initialCopy: false,\n // Optimization so cpx2 doesn't waste resources watching irrelevant files\n ignore: ['__tests__', '__mocks__', '**/*.ts', '**/*.tsx'],\n })\n .on('copy', async ({ srcPath, dstPath }: { srcPath: string; dstPath: string }) => {\n log.info(`Copied ${srcPath} -> ${dstPath}`);\n if (styleModuleRegex.test(srcPath)) {\n log.info(`Generating types for ${srcPath}`);\n await generateDefinitions(srcPath);\n }\n })\n .on('watch-error', (error: unknown) => log.error(String(error)));\n\n /* istanbul ignore next: not executed in test environment */\n if (process.env.NODE_ENV !== 'test') {\n await new Promise<void>(() => {});\n }\n}\n\nasync function compile(filePath: string) {\n if (filePath.endsWith('.less')) {\n return compileLess(filePath);\n }\n if (filePath.endsWith('.scss')) {\n return compileSass(filePath);\n }\n}\n"],"names":["assetExtensions","copyFiles","styleExtensions","styleModuleRegex","RegExp","join","watch","source","destination","getFolders","fs","existsSync","filesPattern","creator","DtsCreator","camelCase","namedExports","generateDefinitions","file","css","compile","content","create","writeFile","error","log","String","info","cpx","copy","modulesPattern","modules","glob","Promise","all","map","initialCopy","ignore","on","srcPath","dstPath","test","process","env","NODE_ENV","filePath","endsWith","compileLess","compileSass"],"mappings":";;;;;;;;;;;QASaA;eAAAA;;QASSC;eAAAA;;QARTC;eAAAA;;;6DAVG;2DACD;sBACM;wEACE;uBAES;6BACJ;6BACA;;;;;;AAErB,MAAMF,kBAAkB;IAAC;IAAO;IAAO;IAAO;IAAO;IAAO;IAAO;IAAO;IAAQ;CAAQ;AAC1F,MAAME,kBAAkB;IAAC;IAAO;IAAQ;CAAO;AAEtD,MAAMC,mBAAmB,IAAIC,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;YAAC;YAAa;YAAa;YAAW;SAAW;IAC7D,GACKC,EAAE,CAAC,QAAQ,OAAO,EAAEC,OAAO,EAAEC,OAAO,EAAwC;QACzEf,UAAG,CAACE,IAAI,CAAC,CAAC,OAAO,EAAEY,QAAQ,IAAI,EAAEC,SAAS;QAC1C,IAAIrC,iBAAiBsC,IAAI,CAACF,UAAU;YAChCd,UAAG,CAACE,IAAI,CAAC,CAAC,qBAAqB,EAAEY,SAAS;YAC1C,MAAMtB,oBAAoBsB;QAC9B;IACJ,GACCD,EAAE,CAAC,eAAe,CAACd,QAAmBC,UAAG,CAACD,KAAK,CAACE,OAAOF;IAE5D,0DAA0D,GAC1D,IAAIkB,QAAQC,GAAG,CAACC,QAAQ,KAAK,QAAQ;QACjC,MAAM,IAAIX,QAAc,KAAO;IACnC;AACJ;AAEA,eAAeb,QAAQyB,QAAgB;IACnC,IAAIA,SAASC,QAAQ,CAAC,UAAU;QAC5B,OAAOC,IAAAA,wBAAW,EAACF;IACvB;IACA,IAAIA,SAASC,QAAQ,CAAC,UAAU;QAC5B,OAAOE,IAAAA,wBAAW,EAACH;IACvB;AACJ"}
1
+ {"version":3,"sources":["../../../src/cli/utils/copy-files.ts"],"sourcesContent":["import cpx from 'cpx2';\nimport fs from 'fs';\nimport { glob } from 'glob';\nimport DtsCreator from 'typed-css-modules';\n\nimport { getFolders, log } from '../../utils';\nimport { compileLess } from './compile-less';\nimport { compileSass } from './compile-sass';\n\nconst assetExtensions = ['eot', 'gif', 'jpg', 'otf', 'png', 'svg', 'ttf', 'woff', 'woff2'];\nconst resourceExtensions = ['json'];\nexport const styleExtensions = ['css', 'less', 'scss'];\nconst styleTypeDefinitionExtensions = styleExtensions.map(ext => `${ext}.d.ts`);\n\nexport const supportedExtensions = [\n assetExtensions,\n resourceExtensions,\n styleExtensions,\n styleTypeDefinitionExtensions,\n].flat();\n\nconst styleModuleRegex = new RegExp(`\\\\.module\\\\.(${styleExtensions.join('|')})$`);\n\ninterface CopyFilesOptions {\n watch?: boolean;\n}\n\nexport async function copyFiles({ watch }: CopyFilesOptions) {\n const { source, destination } = getFolders();\n if (!fs.existsSync(source)) {\n return;\n }\n\n const filesPattern = `${source}/**/*.{${supportedExtensions.join()}}`;\n const creator = new DtsCreator({ camelCase: true, namedExports: true });\n const generateDefinitions = async (file: string) => {\n try {\n const css = await compile(file);\n const content = await creator.create(file, css, !!watch);\n await content.writeFile();\n } catch (error) {\n log.error(String(error));\n }\n };\n\n if (!watch) {\n const modulesPattern = `${source}/**/*.module.{${styleExtensions.join()}}`;\n log.info(`Generating types for ${modulesPattern}`);\n const modules = await glob(modulesPattern);\n await Promise.all(modules.map(generateDefinitions));\n\n log.info(`Copying ${filesPattern} -> ${destination}`);\n cpx.copySync(filesPattern, destination);\n\n return;\n }\n\n log.info(`Watching ${filesPattern} -> ${destination}`);\n cpx.watch(filesPattern, destination, {\n initialCopy: false,\n // Optimization so cpx2 doesn't waste resources watching irrelevant files\n ignore: ['__tests__', '__mocks__', '*.*', ...supportedExtensions.map(ext => `!*.${ext}`)],\n })\n .on('copy', async ({ srcPath, dstPath }: { srcPath: string; dstPath: string }) => {\n log.info(`Copied ${srcPath} -> ${dstPath}`);\n if (styleModuleRegex.test(srcPath)) {\n log.info(`Generating types for ${srcPath}`);\n await generateDefinitions(srcPath);\n }\n })\n .on('watch-error', (error: unknown) => log.error(String(error)));\n\n /* istanbul ignore next: not executed in test environment */\n if (process.env.NODE_ENV !== 'test') {\n await new Promise<void>(() => {});\n }\n}\n\nasync function compile(filePath: string) {\n if (filePath.endsWith('.less')) {\n return compileLess(filePath);\n }\n if (filePath.endsWith('.scss')) {\n return compileSass(filePath);\n }\n}\n"],"names":["copyFiles","styleExtensions","supportedExtensions","assetExtensions","resourceExtensions","styleTypeDefinitionExtensions","map","ext","flat","styleModuleRegex","RegExp","join","watch","source","destination","getFolders","fs","existsSync","filesPattern","creator","DtsCreator","camelCase","namedExports","generateDefinitions","file","css","compile","content","create","writeFile","error","log","String","modulesPattern","info","modules","glob","Promise","all","cpx","copySync","initialCopy","ignore","on","srcPath","dstPath","test","process","env","NODE_ENV","filePath","endsWith","compileLess","compileSass"],"mappings":";;;;;;;;;;;QA2BsBA;eAAAA;;QAhBTC;eAAAA;;QAGAC;eAAAA;;;6DAdG;2DACD;sBACM;wEACE;uBAES;6BACJ;6BACA;;;;;;AAE5B,MAAMC,kBAAkB;IAAC;IAAO;IAAO;IAAO;IAAO;IAAO;IAAO;IAAO;IAAQ;CAAQ;AAC1F,MAAMC,qBAAqB;IAAC;CAAO;AAC5B,MAAMH,kBAAkB;IAAC;IAAO;IAAQ;CAAO;AACtD,MAAMI,gCAAgCJ,gBAAgBK,GAAG,CAACC,CAAAA,MAAO,GAAGA,IAAI,KAAK,CAAC;AAEvE,MAAML,sBAAsB;IAC/BC;IACAC;IACAH;IACAI;CACH,CAACG,IAAI;AAEN,MAAMC,mBAAmB,IAAIC,OAAO,CAAC,aAAa,EAAET,gBAAgBU,IAAI,CAAC,KAAK,EAAE,CAAC;AAM1E,eAAeX,UAAU,EAAEY,KAAK,EAAoB;IACvD,MAAM,EAAEC,MAAM,EAAEC,WAAW,EAAE,GAAGC,IAAAA,iBAAU;IAC1C,IAAI,CAACC,WAAE,CAACC,UAAU,CAACJ,SAAS;QACxB;IACJ;IAEA,MAAMK,eAAe,GAAGL,OAAO,OAAO,EAAEX,oBAAoBS,IAAI,GAAG,CAAC,CAAC;IACrE,MAAMQ,UAAU,IAAIC,wBAAU,CAAC;QAAEC,WAAW;QAAMC,cAAc;IAAK;IACrE,MAAMC,sBAAsB,OAAOC;QAC/B,IAAI;YACA,MAAMC,MAAM,MAAMC,QAAQF;YAC1B,MAAMG,UAAU,MAAMR,QAAQS,MAAM,CAACJ,MAAMC,KAAK,CAAC,CAACb;YAClD,MAAMe,QAAQE,SAAS;QAC3B,EAAE,OAAOC,OAAO;YACZC,UAAG,CAACD,KAAK,CAACE,OAAOF;QACrB;IACJ;IAEA,IAAI,CAAClB,OAAO;QACR,MA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A,IAAIA,SAASC,QAAQ,CAAC,UAAU;QAC5B,OAAOE,IAAAA,wBAAW,EAACH;IACvB;AACJ"}
@@ -1 +1 @@
1
- {"version":3,"file":"get-module-type.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/get-module-type.ts"],"names":[],"mappings":"AAIA,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAgBxD"}
1
+ {"version":3,"file":"get-module-type.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/get-module-type.ts"],"names":[],"mappings":"AAEA,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAExD"}
@@ -8,23 +8,9 @@ Object.defineProperty(exports, "getModuleType", {
8
8
  return getModuleType;
9
9
  }
10
10
  });
11
- const _path = /*#__PURE__*/ _interop_require_default(require("path"));
12
- const _utils = require("../../utils");
13
- function _interop_require_default(obj) {
14
- return obj && obj.__esModule ? obj : {
15
- default: obj
16
- };
17
- }
11
+ const _tsconfig = require("./ts-config");
18
12
  function getModuleType(configPath) {
19
- var _config_compilerOptions;
20
- const config = (0, _utils.readJson)(configPath);
21
- if ((_config_compilerOptions = config.compilerOptions) === null || _config_compilerOptions === void 0 ? void 0 : _config_compilerOptions.module) {
22
- return config.compilerOptions.module.toLowerCase();
23
- }
24
- if (config.extends) {
25
- return getModuleType(/^\.?\.\//.test(config.extends) ? _path.default.join(_path.default.dirname(configPath), config.extends) : require.resolve(config.extends));
26
- }
27
- return 'commonjs';
13
+ return new _tsconfig.TSConfig(configPath).getValue('compilerOptions.module', 'commonjs');
28
14
  }
29
15
 
30
16
  //# sourceMappingURL=get-module-type.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/cli/utils/get-module-type.ts"],"sourcesContent":["import path from 'path';\n\nimport { readJson } from '../../utils';\n\nexport function getModuleType(configPath: string): string {\n const config = readJson<{ compilerOptions?: { module: string }; extends?: string }>(configPath);\n\n if (config.compilerOptions?.module) {\n return config.compilerOptions.module.toLowerCase();\n }\n\n if (config.extends) {\n return getModuleType(\n /^\\.?\\.\\//.test(config.extends)\n ? path.join(path.dirname(configPath), config.extends)\n : require.resolve(config.extends)\n );\n }\n\n return 'commonjs';\n}\n"],"names":["getModuleType","configPath","config","readJson","compilerOptions","module","toLowerCase","extends","test","path","join","dirname","require","resolve"],"mappings":";;;;+BAIgBA;;;eAAAA;;;6DAJC;uBAEQ;;;;;;AAElB,SAASA,cAAcC,UAAkB;QAGxCC;IAFJ,MAAMA,SAASC,IAAAA,eAAQ,EAA6DF;IAEpF,KAAIC,0BAAAA,OAAOE,eAAe,cAAtBF,8CAAAA,wBAAwBG,MAAM,EAAE;QAChC,OAAOH,OAAOE,eAAe,CAACC,MAAM,CAACC,WAAW;IACpD;IAEA,IAAIJ,OAAOK,OAAO,EAAE;QAChB,OAAOP,cACH,WAAWQ,IAAI,CAACN,OAAOK,OAAO,IACxBE,aAAI,CAACC,IAAI,CAACD,aAAI,CAACE,OAAO,CAACV,aAAaC,OAAOK,OAAO,IAClDK,QAAQC,OAAO,CAACX,OAAOK,OAAO;IAE5C;IAEA,OAAO;AACX"}
1
+ {"version":3,"sources":["../../../src/cli/utils/get-module-type.ts"],"sourcesContent":["import { TSConfig } from './ts-config';\n\nexport function getModuleType(configPath: string): string {\n return new TSConfig(configPath).getValue('compilerOptions.module', 'commonjs');\n}\n"],"names":["getModuleType","configPath","TSConfig","getValue"],"mappings":";;;;+BAEgBA;;;eAAAA;;;0BAFS;AAElB,SAASA,cAAcC,UAAkB;IAC5C,OAAO,IAAIC,kBAAQ,CAACD,YAAYE,QAAQ,CAAC,0BAA0B;AACvE"}
@@ -11,7 +11,7 @@ export * from './lerna-exec';
11
11
  export * from './pipe-stdout';
12
12
  export * from './process-tree';
13
13
  export * from './set-node-options';
14
- export * from './tcm';
14
+ export * from './ts-config';
15
15
  export * from './type-check';
16
16
  export * from './watch-stdout';
17
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,OAAO,CAAC;AACtB,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,uBAAuB,CAAC;AACtC,cAAc,cAAc,CAAC;AAC7B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,aAAa,CAAC;AAC5B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC"}
@@ -15,7 +15,7 @@ _export_star(require("./lerna-exec"), exports);
15
15
  _export_star(require("./pipe-stdout"), exports);
16
16
  _export_star(require("./process-tree"), exports);
17
17
  _export_star(require("./set-node-options"), exports);
18
- _export_star(require("./tcm"), exports);
18
+ _export_star(require("./ts-config"), exports);
19
19
  _export_star(require("./type-check"), exports);
20
20
  _export_star(require("./watch-stdout"), exports);
21
21
  function _export_star(from, to) {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/cli/utils/index.ts"],"sourcesContent":["export * from './bundle';\nexport * from './check-args';\nexport * from './compile';\nexport * from './compile-less';\nexport * from './compile-sass';\nexport * from './copy-files';\nexport * from './eslint';\nexport * from './get-module-type';\nexport * from './is-module-installed';\nexport * from './lerna-exec';\nexport * from './pipe-stdout';\nexport * from './process-tree';\nexport * from './set-node-options';\nexport * from './tcm';\nexport * from './type-check';\nexport * from './watch-stdout';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA"}
1
+ {"version":3,"sources":["../../../src/cli/utils/index.ts"],"sourcesContent":["export * from './bundle';\nexport * from './check-args';\nexport * from './compile';\nexport * from './compile-less';\nexport * from './compile-sass';\nexport * from './copy-files';\nexport * from './eslint';\nexport * from './get-module-type';\nexport * from './is-module-installed';\nexport * from './lerna-exec';\nexport * from './pipe-stdout';\nexport * from './process-tree';\nexport * from './set-node-options';\nexport * from './ts-config';\nexport * from './type-check';\nexport * from './watch-stdout';\n"],"names":[],"mappings":";;;;qBAAc;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA;qBACA"}
@@ -0,0 +1,11 @@
1
+ export declare class TSConfig {
2
+ private readonly configPath;
3
+ private readonly json;
4
+ constructor(configPath: string);
5
+ getValue<T>(key: string, defaultValue: T): NoInfer<T>;
6
+ getValue<T>(key: string, defaultValue?: T): T | undefined;
7
+ private getValueInternal;
8
+ private getExtendsPath;
9
+ private getJson;
10
+ }
11
+ //# sourceMappingURL=ts-config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ts-config.d.ts","sourceRoot":"","sources":["../../../src/cli/utils/ts-config.ts"],"names":[],"mappings":"AAIA,qBAAa,QAAQ;IAGL,OAAO,CAAC,QAAQ,CAAC,UAAU;IAFvC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAmB;gBAEX,UAAU,EAAE,MAAM;IAK/C,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC;IACrD,QAAQ,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,SAAS;IAOzD,OAAO,CAAC,gBAAgB;IAkBxB,OAAO,CAAC,cAAc;IAetB,OAAO,CAAC,OAAO;CAUlB"}
@@ -0,0 +1,80 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", {
3
+ value: true
4
+ });
5
+ Object.defineProperty(exports, "TSConfig", {
6
+ enumerable: true,
7
+ get: function() {
8
+ return TSConfig;
9
+ }
10
+ });
11
+ const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
12
+ const _path = /*#__PURE__*/ _interop_require_default(require("path"));
13
+ const _utils = require("../../utils");
14
+ function _define_property(obj, key, value) {
15
+ if (key in obj) {
16
+ Object.defineProperty(obj, key, {
17
+ value: value,
18
+ enumerable: true,
19
+ configurable: true,
20
+ writable: true
21
+ });
22
+ } else {
23
+ obj[key] = value;
24
+ }
25
+ return obj;
26
+ }
27
+ function _interop_require_default(obj) {
28
+ return obj && obj.__esModule ? obj : {
29
+ default: obj
30
+ };
31
+ }
32
+ class TSConfig {
33
+ // Implementation signature
34
+ getValue(key, defaultValue) {
35
+ return this.getValueInternal(this.configPath, key.split('.'), defaultValue);
36
+ }
37
+ getValueInternal(configPath, key, defaultValue) {
38
+ const config = this.getJson(configPath);
39
+ const value = key.reduce((result, el)=>{
40
+ return result && typeof result === 'object' ? result[el] : undefined;
41
+ }, config);
42
+ if (value !== undefined) {
43
+ return value;
44
+ }
45
+ const extendsPath = this.getExtendsPath(configPath, config);
46
+ if (extendsPath) {
47
+ return this.getValueInternal(extendsPath, key, defaultValue);
48
+ }
49
+ return defaultValue;
50
+ }
51
+ getExtendsPath(configPath, config) {
52
+ if (!config.extends) {
53
+ return;
54
+ }
55
+ if (!/^\.?\.\//.test(config.extends)) {
56
+ return require.resolve(config.extends);
57
+ }
58
+ const dir = _path.default.dirname(configPath);
59
+ return [
60
+ config.extends,
61
+ `${config.extends}.json`
62
+ ].map((name)=>_path.default.join(dir, name)).find(_fs.default.existsSync);
63
+ }
64
+ getJson(configPath) {
65
+ let result = this.json.get(configPath);
66
+ if (!result) {
67
+ result = (0, _utils.readJson)(configPath);
68
+ this.json.set(configPath, result);
69
+ }
70
+ return result;
71
+ }
72
+ constructor(configPath){
73
+ _define_property(this, "configPath", void 0);
74
+ _define_property(this, "json", void 0);
75
+ this.configPath = configPath;
76
+ this.json = new Map();
77
+ }
78
+ }
79
+
80
+ //# sourceMappingURL=ts-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/cli/utils/ts-config.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport { readJson } from '../../utils';\n\nexport class TSConfig {\n private readonly json: Map<string, any>;\n\n constructor(private readonly configPath: string) {\n this.json = new Map();\n }\n\n // Overload signatures\n getValue<T>(key: string, defaultValue: T): NoInfer<T>;\n getValue<T>(key: string, defaultValue?: T): T | undefined;\n\n // Implementation signature\n getValue<T>(key: string, defaultValue?: T) {\n return this.getValueInternal<T>(this.configPath, key.split('.'), defaultValue);\n }\n\n private getValueInternal<T>(configPath: string, key: string[], defaultValue?: T): T {\n const config = this.getJson<{ extends?: string }>(configPath);\n const value = key.reduce<any>((result, el) => {\n return result && typeof result === 'object' ? result[el] : undefined;\n }, config);\n\n if (value !== undefined) {\n return value;\n }\n\n const extendsPath = this.getExtendsPath(configPath, config);\n if (extendsPath) {\n return this.getValueInternal(extendsPath, key, defaultValue);\n }\n\n return defaultValue as T;\n }\n\n private getExtendsPath(configPath: string, config: { extends?: string }) {\n if (!config.extends) {\n return;\n }\n\n if (!/^\\.?\\.\\//.test(config.extends)) {\n return require.resolve(config.extends);\n }\n\n const dir = path.dirname(configPath);\n return [config.extends, `${config.extends}.json`]\n .map(name => path.join(dir, name))\n .find(fs.existsSync);\n }\n\n private getJson<T>(configPath: string): T {\n let result: T = this.json.get(configPath);\n\n if (!result) {\n result = readJson<T>(configPath);\n this.json.set(configPath, result);\n }\n\n return result;\n }\n}\n"],"names":["TSConfig","getValue","key","defaultValue","getValueInternal","configPath","split","config","getJson","value","reduce","result","el","undefined","extendsPath","getExtendsPath","extends","test","require","resolve","dir","path","dirname","map","name","join","find","fs","existsSync","json","get","readJson","set","constructor","Map"],"mappings":";;;;+BAIaA;;;eAAAA;;;2DAJE;6DACE;uBACQ;;;;;;;;;;;;;;;;;;;AAElB,MAAMA;IAWT,2BAA2B;IAC3BC,SAAYC,GAAW,EAAEC,YAAgB,EAAE;QACvC,OAAO,IAAI,CAACC,gBAAgB,CAAI,IAAI,CAACC,UAAU,EAAEH,IAAII,KAAK,CAAC,MAAMH;IACrE;IAEQC,iBAAoBC,UAAkB,EAAEH,GAAa,EAAEC,YAAgB,EAAK;QAChF,MAAMI,SAAS,IAAI,CAACC,OAAO,CAAuBH;QAClD,MAAMI,QAAQP,IAAIQ,MAAM,CAAM,CAACC,QAAQC;YACnC,OAAOD,UAAU,OAAOA,WAAW,WAAWA,MAAM,CAACC,GAAG,GAAGC;QAC/D,GAAGN;QAEH,IAAIE,UAAUI,WAAW;YACrB,OAAOJ;QACX;QAEA,MAAMK,cAAc,IAAI,CAACC,cAAc,CAACV,YAAYE;QACpD,IAAIO,aAAa;YACb,OAAO,IAAI,CAACV,gBAAgB,CAACU,aAAaZ,KAAKC;QACnD;QAEA,OAAOA;IACX;IAEQY,eAAeV,UAAkB,EAAEE,MAA4B,EAAE;QACrE,IAAI,CAACA,OAAOS,OAAO,EAAE;YACjB;QACJ;QAEA,IAAI,CAAC,WAAWC,IAAI,CAACV,OAAOS,OAAO,GAAG;YAClC,OAAOE,QAAQC,OAAO,CAACZ,OAAOS,OAAO;QACzC;QAEA,MAAMI,MAAMC,aAAI,CAACC,OAAO,CAACjB;QACzB,OAAO;YAACE,OAAOS,OAAO;YAAE,GAAGT,OAAOS,OAAO,CAAC,KAAK,CAAC;SAAC,CAC5CO,GAAG,CAACC,CAAAA,OAAQH,aAAI,CAACI,IAAI,CAACL,KAAKI,OAC3BE,IAAI,CAACC,WAAE,CAACC,UAAU;IAC3B;IAEQpB,QAAWH,UAAkB,EAAK;QACtC,IAAIM,SAAY,IAAI,CAACkB,IAAI,CAACC,GAAG,CAACzB;QAE9B,IAAI,CAACM,QAAQ;YACTA,SAASoB,IAAAA,eAAQ,EAAI1B;YACrB,IAAI,CAACwB,IAAI,CAACG,GAAG,CAAC3B,YAAYM;QAC9B;QAEA,OAAOA;IACX;IAvDAsB,YAAY,AAAiB5B,UAAkB,CAAE;;QAFjD,uBAAiBwB,QAAjB,KAAA;aAE6BxB,aAAAA;QACzB,IAAI,CAACwB,IAAI,GAAG,IAAIK;IACpB;AAsDJ"}
@@ -91,6 +91,7 @@ export declare function getStylelintConfiguration(): StylelintConfiguration;
91
91
  export declare function getWebpackConfiguration(locationOrJson?: LocationOrJson): WebpackConfiguration;
92
92
  export declare function getWebComponentConfiguration(locationOrJson?: LocationOrJson): WebComponentOptions | undefined;
93
93
  export declare function getWebComponentBranchConfigs(locationOrJson?: LocationOrJson): Record<string, WebComponentBranchConfigs> | undefined;
94
+ export declare function hasHeadlessBundle(): boolean;
94
95
  export declare function getSwcCompilePackageConfiguration(): import("@swc/cli").Options;
95
96
  export declare function isBundle(locationOrJson?: LocationOrJson): boolean;
96
97
  export declare function isCustomStyleRules(): boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"get-configuration.d.ts","sourceRoot":"","sources":["../../src/utils/get-configuration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,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AAS,CAAC,EAAE,KAAK,GAAG,oBAAoB,CAAC;CAC5C,GAAG;KACC,GAAG,IAAI,WAAW,GAAG,iBAAiB;CAC1C,GAAG,iBAAiB,CAAC;AAEtB,KAAK,cAAc,GAAG,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAEnD,wBAAgB,gBAAgB,CAAC,cAAc,GAAE,cAAqB,GAAG,aAAa,CAMrF;AAED,wBAAgB,oBAAoB,CAAC,cAAc,GAAE,cAAqB,GAAG,aAAa,CAMzF;AAED,wBAAgB,sBAAsB,wBAErC;AAED,wBAAgB,oBAAoB,0CAEnC;AAED,wBAAgB,sBAAsB,4CAErC;AAED,wBAAgB,yBAAyB,2BAExC;AAED,wBAAgB,uBAAuB,CAAC,cAAc,CAAC,EAAE,cAAc,wBAGtE;AAED,wBAAgB,4BAA4B,CACxC,cAAc,GAAE,cAAqB,GACtC,mBAAmB,GAAG,SAAS,CAsBjC;AAED,wBAAgB,4BAA4B,CAAC,cAAc,GAAE,cAAqB,yDAIjF;AAED,wBAAgB,iBAAiB,YAShC;AAED,wBAAgB,iCAAiC,+BAEhD;AAED,wBAAgB,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,WAEvD;AAED,wBAAgB,kBAAkB,YAEjC;AAED,wBAAgB,mBAAmB,YAGlC;AAED,wBAAgB,0BAA0B,YAEzC;AAED,wBAAgB,QAAQ,CAAC,cAAc,CAAC,EAAE,cAAc,WAEvD;AAED,wBAAgB,YAAY,YAE3B;AAED,wBAAgB,oBAAoB,YAEnC;AAED,wBAAgB,cAAc,CAAC,cAAc,GAAE,cAAqB,WAEnE"}
@@ -45,6 +45,9 @@ _export(exports, {
45
45
  get getWebpackConfiguration () {
46
46
  return getWebpackConfiguration;
47
47
  },
48
+ get hasHeadlessBundle () {
49
+ return hasHeadlessBundle;
50
+ },
48
51
  get isBundle () {
49
52
  return isBundle;
50
53
  },
@@ -73,6 +76,7 @@ _export(exports, {
73
76
  const _fs = /*#__PURE__*/ _interop_require_default(require("fs"));
74
77
  const _path = /*#__PURE__*/ _interop_require_default(require("path"));
75
78
  const _log = require("./log");
79
+ const _getfolders = require("./get-folders");
76
80
  const _readjson = require("./read-json");
77
81
  function _interop_require_default(obj) {
78
82
  return obj && obj.__esModule ? obj : {
@@ -159,6 +163,16 @@ function getWebComponentBranchConfigs(locationOrJson = './') {
159
163
  const config = getWebComponentConfiguration(locationOrJson);
160
164
  return config === null || config === void 0 ? void 0 : config.branches;
161
165
  }
166
+ function hasHeadlessBundle() {
167
+ let source;
168
+ try {
169
+ source = (0, _getfolders.getFolders)().source;
170
+ } catch (e) {
171
+ return false;
172
+ }
173
+ const headlessPath = _path.default.join(source, 'headless.ts');
174
+ return _fs.default.existsSync(headlessPath);
175
+ }
162
176
  function getSwcCompilePackageConfiguration() {
163
177
  var _getConfiguration_swccompilepackage;
164
178
  return (_getConfiguration_swccompilepackage = getConfiguration()['swc-compile-package']) !== null && _getConfiguration_swccompilepackage !== void 0 ? _getConfiguration_swccompilepackage : {};
@@ -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 { 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 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","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","webpackConfiguration","devServer","legacy","legacyRoot"],"mappings":";;;;;;;;;;;QA2DYA;eAAAA;;QA/CCC;eAAAA;;QAgGGC;eAAAA;;QAQAC;eAAAA;;QAQAC;eAAAA;;QAIAC;eAAAA;;QAIAC;eAAAA;;QAIAC;eAAAA;;QAyCAC;eAAAA;;QANAC;eAAAA;;QA1BAC;eAAAA;;QALAC;eAAAA;;QAyCAC;eAAAA;;QAIAC;eAAAA;;QAIAC;eAAAA;;QAKAC;eAAAA;;QAIAC;eAAAA;;QAIAC;eAAAA;;QAIAC;eAAAA;;QAIAC;eAAAA;;;2DA/MD;6DACE;qBAKG;0BACmB;;;;;;AAEhC,MAAMlB,iC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AAyB,CAAC,sBAAsB,KAAK;AAChE;AAEO,SAASQ,eAAeC,iBAAiC,IAAI;IAChE,OAAO,CAAC,CAACV,6BAA6BU;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}\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,qBA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config';
2
- export * from './cache-config';
3
2
  export * from './dev-server-config';
4
3
  export * from './devtool-config';
5
4
  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,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"}
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"}
@@ -3,7 +3,6 @@ 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);
7
6
  _export_star(require("./dev-server-config"), exports);
8
7
  _export_star(require("./devtool-config"), exports);
9
8
  _export_star(require("./entry.config"), exports);
@@ -1 +1 @@
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
+ {"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"}
@@ -16,7 +16,7 @@ function _interop_require_default(obj) {
16
16
  };
17
17
  }
18
18
  function optimizationConfig(context, _) {
19
- const { isProduction } = context;
19
+ const { headless, isProduction } = context;
20
20
  const optimization = {
21
21
  chunkIds: isProduction ? 'deterministic' : 'named',
22
22
  moduleIds: 'size',
@@ -25,7 +25,7 @@ function optimizationConfig(context, _) {
25
25
  cacheGroups: {}
26
26
  }
27
27
  };
28
- if (isProduction) {
28
+ if (!headless && isProduction) {
29
29
  optimization.runtimeChunk = 'single';
30
30
  }
31
31
  [
@@ -71,8 +71,8 @@ function minimizeConfig(optimization, context) {
71
71
  ];
72
72
  }
73
73
  function sharedDependenciesConfig(optimization, context) {
74
- const { isExposeSharedDependencies } = context;
75
- if (!isExposeSharedDependencies) {
74
+ const { headless, isExposeSharedDependencies } = context;
75
+ if (!isExposeSharedDependencies || headless) {
76
76
  return;
77
77
  }
78
78
  Object.assign(optimization.splitChunks.cacheGroups, {
@@ -91,8 +91,8 @@ function sharedDependenciesConfig(optimization, context) {
91
91
  });
92
92
  }
93
93
  function webComponentConfig(optimization, context) {
94
- const { isWebComponent, isProduction } = context;
95
- if (!isWebComponent) {
94
+ const { headless, isWebComponent, isProduction } = context;
95
+ if (!isWebComponent || headless) {
96
96
  return;
97
97
  }
98
98
  Object.assign(optimization.splitChunks.cacheGroups, {
@@ -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 { 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 (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 { isExposeSharedDependencies } = context;\n if (!isExposeSharedDependencies) {\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 { isWebComponent, isProduction } = context;\n if (!isWebComponent) {\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","_","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","isW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,CAAC;gBAAEL;YAAc;SAAG,GAAG,EAAE;WACrDH,YAAY;YAAC,IAAIS,kCAAyB,CAACH;SAA2B,GAAG,EAAE;KAClF;AACL;AAEA,SAASd,yBAAyBR,YAAmC,EAAEH,OAAgB;IACnF,MAAM,EAAE6B,0BAA0B,EAAE,GAAG7B;IACvC,IAAI,CAAC6B,4BAA4B;QAC7B;IACJ;IAEAC,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,EAAEH,OAAgB;IAC7E,MAAM,EAAEoC,cAAc,EAAElC,YAAY,EAAE,GAAGF;IACzC,IAAI,CAACoC,gBAAgB;QACjB;IACJ;IAEAN,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 { 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;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M;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 +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,CAqBnE"}
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"}
@@ -15,10 +15,11 @@ function _interop_require_default(obj) {
15
15
  };
16
16
  }
17
17
  function outputConfig(context, _) {
18
- const { destination, embed, isProduction, isWebComponent, name } = context;
18
+ const { destination, embed, headless, isProduction, isWebComponent, name } = context;
19
+ const bundleDir = headless ? 'headless' : embed ? 'light' : 'full';
19
20
  const output = {
20
21
  filename: '[name].bundle.js',
21
- path: isWebComponent ? _path.default.join(process.cwd(), `${destination}/bundle/${embed ? 'light' : 'full'}`) : _path.default.join(process.cwd(), `${destination}/bundle`)
22
+ path: isWebComponent ? _path.default.join(process.cwd(), `${destination}/bundle/${bundleDir}`) : _path.default.join(process.cwd(), `${destination}/bundle`)
22
23
  };
23
24
  if (isProduction) {
24
25
  const cdnPath = process.env.CLIENT_CDN_PATH;
@@ -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, isProduction, isWebComponent, name } = context;\n\n const output: Config = {\n filename: '[name].bundle.js',\n path: isWebComponent\n ? path.join(process.cwd(), `${destination}/bundle/${embed ? 'light' : 'full'}`)\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","isProduction","isWebComponent","name","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,YAAY,EAAEC,cAAc,EAAEC,IAAI,EAAE,GAAGN;IAEnE,MAAMO,SAAiB;QACnBC,UAAU;QACVC,MAAMJ,iBACAI,aAAI,CAACC,IAAI,CAACC,QAAQC,GAAG,IAAI,GAAGV,YAAY,QAAQ,EAAEC,QAAQ,UAAU,QAAQ,IAC5EM,aAAI,CAACC,IAAI,CAACC,QAAQC,GAAG,IAAI,GAAGV,YAAY,OAAO,CAAC;IAC1D;IAEA,IAAIE,cAAc;QACd,MAAMS,UAAUF,QAAQG,GAAG,CAACC,eAAe;QAC3CC,OAAOC,MAAM,CAACV,QAAQ;YAClBC,UAAU;YACVU,OAAO;YACP,GAAIb,iBAAiB;gBAAEc,YAAYb;YAAK,IAAI,CAAC,CAAC;YAC9C,GAAIO,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';\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,4 +1,4 @@
1
1
  import HtmlWebpackPlugin from 'html-webpack-plugin';
2
2
  import { Context, Overrides } from '../types';
3
- export declare function htmlPlugin({ embed, isWebComponent, name }: Context, { plugins }: Overrides): HtmlWebpackPlugin | undefined;
3
+ export declare function htmlPlugin({ embed, headless, isWebComponent, name }: Context, { plugins }: Overrides): HtmlWebpackPlugin | undefined;
4
4
  //# sourceMappingURL=html-plugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"html-plugin.d.ts","sourceRoot":"","sources":["../../../../src/webpack/configs/plugins/html-plugin.ts"],"names":[],"mappings":"AACA,OAAO,iBAA0D,MAAM,qBAAqB,CAAC;AAE7F,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE9C,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,cAAc,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,SAAS,iCA+C1F"}
1
+ {"version":3,"file":"html-plugin.d.ts","sourceRoot":"","sources":["../../../../src/webpack/configs/plugins/html-plugin.ts"],"names":[],"mappings":"AACA,OAAO,iBAA0D,MAAM,qBAAqB,CAAC;AAE7F,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE9C,wBAAgB,UAAU,CACtB,EAAE,KAAK,EAAE,QAAQ,EAAE,cAAc,EAAE,IAAI,EAAE,EAAE,OAAO,EAClD,EAAE,OAAO,EAAE,EAAE,SAAS,iCAgDzB"}
@@ -16,9 +16,9 @@ function _interop_require_default(obj) {
16
16
  default: obj
17
17
  };
18
18
  }
19
- function htmlPlugin({ embed, isWebComponent, name }, { plugins }) {
19
+ function htmlPlugin({ embed, headless, isWebComponent, name }, { plugins }) {
20
20
  const { HtmlWebpackPlugin: htmlWebpackPluginOptions = {} } = plugins !== null && plugins !== void 0 ? plugins : {};
21
- if (embed) {
21
+ if (embed || headless) {
22
22
  return;
23
23
  }
24
24
  return new _htmlwebpackplugin.default((0, _deepmerge.default)({
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/webpack/configs/plugins/html-plugin.ts"],"sourcesContent":["import deepmerge from 'deepmerge';\nimport HtmlWebpackPlugin, { Options as HtmlWebpackPluginOptions } from 'html-webpack-plugin';\nimport { splitByEntry } from '../../utils';\nimport { Context, Overrides } from '../types';\n\nexport function htmlPlugin({ embed, isWebComponent, name }: Context, { plugins }: Overrides) {\n const { HtmlWebpackPlugin: htmlWebpackPluginOptions = {} } = plugins ?? {};\n\n if (embed) {\n return;\n }\n\n return new HtmlWebpackPlugin(\n deepmerge<HtmlWebpackPluginOptions>(\n {\n title: 'ServiceTitan',\n hash: true,\n ...(isWebComponent\n ? {\n inject: false,\n publicPath: '/',\n templateContent: ({\n htmlWebpackPlugin: {\n tags: { headTags, bodyTags },\n files,\n },\n }) => {\n const styleUrls = encodeURIComponent(JSON.stringify(files.css));\n return `\n <!DOCTYPE html>\n <html>\n <head>\n <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\n ${headTags}\n </head>\n <body>\n <${name} style-urls=\"${styleUrls}\" />\n\n ${bodyTags}\n </body>\n </html>\n `;\n },\n }\n : {}),\n templateParameters: {\n splitByEntry,\n },\n },\n htmlWebpackPluginOptions\n )\n );\n}\n"],"names":["htmlPlugin","embed","isWebComponent","name","plugins","HtmlWebpackPlugin","htmlWebpackPluginOptions","deepmerge","title","hash","inject","publicPath","templateContent","htmlWebpackPlugin","tags","headTags","bodyTags","files","styleUrls","encodeURIComponent","JSON","stringify","css","templateParameters","splitByEntry"],"mappings":";;;;+BAKgBA;;;eAAAA;;;kEALM;0EACiD;uBAC1C;;;;;;AAGtB,SAASA,WAAW,EAAEC,KAAK,EAAEC,cAAc,EAAEC,IAAI,EAAW,EAAE,EAAEC,OAAO,EAAa;IACvF,MAAM,EAAEC,mBAAmBC,2BAA2B,CAAC,CAAC,EAAE,GAAGF,oBAAAA,qBAAAA,UAAW,CAAC;IAEzE,IAAIH,OAAO;QACP;IACJ;IAEA,OAAO,IAAII,0BAAiB,CACxBE,IAAAA,kBAAS,EACL;QACIC,OAAO;QACPC,MAAM;QACN,GAAIP,iBACE;YACIQ,QAAQ;YACRC,YAAY;YACZC,iBAAiB,CAAC,EACdC,mBAAmB,EACfC,MAAM,EAAEC,QAAQ,EAAEC,QAAQ,EAAE,EAC5BC,KAAK,EACR,EACJ;gBACG,MAAMC,YAAYC,mBAAmBC,KAAKC,SAAS,CAACJ,MAAMK,GAAG;gBAC7D,OAAO,CAAC;;;;;wCAKE,EAAEP,SAAS;;;yCAGV,EAAEZ,KAAK,aAAa,EAAEe,UAAU;;wCAEjC,EAAEF,SAAS;;;4BAGvB,CAAC;YACH;QACJ,IACA,CAAC,CAAC;QACRO,oBAAoB;YAChBC,cAAAA,mBAAY;QAChB;IACJ,GACAlB;AAGZ"}
1
+ {"version":3,"sources":["../../../../src/webpack/configs/plugins/html-plugin.ts"],"sourcesContent":["import deepmerge from 'deepmerge';\nimport HtmlWebpackPlugin, { Options as HtmlWebpackPluginOptions } from 'html-webpack-plugin';\nimport { splitByEntry } from '../../utils';\nimport { Context, Overrides } from '../types';\n\nexport function htmlPlugin(\n { embed, headless, isWebComponent, name }: Context,\n { plugins }: Overrides\n) {\n const { HtmlWebpackPlugin: htmlWebpackPluginOptions = {} } = plugins ?? {};\n\n if (embed || headless) {\n return;\n }\n\n return new HtmlWebpackPlugin(\n deepmerge<HtmlWebpackPluginOptions>(\n {\n title: 'ServiceTitan',\n hash: true,\n ...(isWebComponent\n ? {\n inject: false,\n publicPath: '/',\n templateContent: ({\n htmlWebpackPlugin: {\n tags: { headTags, bodyTags },\n files,\n },\n }) => {\n const styleUrls = encodeURIComponent(JSON.stringify(files.css));\n return `\n <!DOCTYPE html>\n <html>\n <head>\n <meta name=\"viewport\" content=\"width=device-width,initial-scale=1\">\n ${headTags}\n </head>\n <body>\n <${name} style-urls=\"${styleUrls}\" />\n\n ${bodyTags}\n </body>\n </html>\n `;\n },\n }\n : {}),\n templateParameters: {\n splitByEntry,\n },\n },\n htmlWebpackPluginOptions\n )\n );\n}\n"],"names":["htmlPlugin","embed","headless","isWebComponent","name","plugins","HtmlWebpackPlugin","htmlWebpackPluginOptions","deepmerge","title","hash","inject","publicPath","templateContent","htmlWebpackPlugin","tags","headTags","bodyTags","files","styleUrls","encodeURIComponent","JSON","stringify","css","templateParameters","splitByEntry"],"mappings":";;;;+BAKgBA;;;eAAAA;;;kEALM;0EACiD;uBAC1C;;;;;;AAGtB,SAASA,WACZ,EAAEC,KAAK,EAAEC,QAAQ,EAAEC,cAAc,EAAEC,IAAI,EAAW,EAClD,EAAEC,OAAO,EAAa;IAEtB,MAAM,EAAEC,mBAAmBC,2BAA2B,CAAC,CAAC,EAAE,GAAGF,oBAAAA,qBAAAA,UAAW,CAAC;IAEzE,IAAIJ,SAASC,UAAU;QACnB;IACJ;IAEA,OAAO,IAAII,0BAAiB,CACxBE,IAAAA,kBAAS,EACL;QACIC,OAAO;QACPC,MAAM;QACN,GAAIP,iBACE;YACIQ,QAAQ;YACRC,YAAY;YACZC,iBAAiB,CAAC,EACdC,mBAAmB,EACfC,MAAM,EAAEC,QAAQ,EAAEC,QAAQ,EAAE,EAC5BC,KAAK,EACR,EACJ;gBACG,MAAMC,YAAYC,mBAAmBC,KAAKC,SAAS,CAACJ,MAAMK,GAAG;gBAC7D,OAAO,CAAC;;;;;wCAKE,EAAEP,SAAS;;;yCAGV,EAAEZ,KAAK,aAAa,EAAEe,UAAU;;wCAEjC,EAAEF,SAAS;;;4BAGvB,CAAC;YACH;QACJ,IACA,CAAC,CAAC;QACRO,oBAAoB;YAChBC,cAAAA,mBAAY;QAChB;IACJ,GACAlB;AAGZ"}
@@ -41,7 +41,10 @@ function designSystemCode() {
41
41
  ].join('\n');
42
42
  }
43
43
  function indexCode(context) {
44
- const { embed = false, isLegacyRoot, sharedDependencies } = context;
44
+ const { embed = false, headless, isLegacyRoot, sharedDependencies } = context;
45
+ if (headless) {
46
+ return headlessIndex();
47
+ }
45
48
  const options = `{ legacyRoot: ${isLegacyRoot}, sharedDependenciesNames: ${JSON.stringify(Object.keys(sharedDependencies))} }`;
46
49
  return [
47
50
  ...needsToIncludeDesignSystem(context) ? [
@@ -52,10 +55,17 @@ function indexCode(context) {
52
55
  `register(App, ${embed}, ${options});`
53
56
  ].join('\n');
54
57
  }
55
- function needsToIncludeDesignSystem({ embed, packageData, sharedDependencies }) {
56
- return(// Depends on design system
58
+ function needsToIncludeDesignSystem({ embed, headless, packageData, sharedDependencies }) {
59
+ return !headless && // Depends on design system
57
60
  !!packageData.dependencies['@servicetitan/design-system'] && // ... and is not light bundle with private copy of design system
58
- !(embed && !!sharedDependencies['@servicetitan/design-system']));
61
+ !(embed && !!sharedDependencies['@servicetitan/design-system']);
62
+ }
63
+ function headlessIndex() {
64
+ return [
65
+ "import { registerHeadless } from '@servicetitan/web-components';",
66
+ "import { connectedCallback, disconnectedCallback } from './headless';",
67
+ 'registerHeadless(connectedCallback, disconnectedCallback);'
68
+ ].join('\n');
59
69
  }
60
70
 
61
71
  //# sourceMappingURL=virtual-modules-plugin.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/webpack/configs/plugins/virtual-modules-plugin.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport VirtualModulesPlugin from 'webpack-virtual-modules';\nimport { Context, Overrides } from '../types';\n\nexport function virtualModulesPlugin(context: Context, _: Overrides) {\n if (!context.isWebComponent) {\n return;\n }\n\n const { destination } = context;\n\n const indexPath = path.join(process.cwd(), `${destination}/index`);\n const modules: ConstructorParameters<typeof VirtualModulesPlugin>[0] = {\n [indexPath]: indexCode(context),\n };\n\n if (needsToIncludeDesignSystem(context)) {\n const designSystemPath = path.join(process.cwd(), `${destination}/design-system.css`);\n if (!fs.existsSync(designSystemPath)) {\n modules[designSystemPath] = designSystemCode();\n }\n }\n\n return new VirtualModulesPlugin(modules);\n}\n\nfunction designSystemCode() {\n return [\n `@import '~@servicetitan/tokens/core/tokens.css';`,\n `@import '~@servicetitan/anvil-fonts/dist/css/anvil-fonts.css';`,\n `@import '~@servicetitan/design-system/dist/system.min.css';`,\n ].join('\\n');\n}\n\nfunction indexCode(context: Context) {\n const { embed = false, isLegacyRoot, sharedDependencies } = context;\n const options = `{ legacyRoot: ${isLegacyRoot}, sharedDependenciesNames: ${JSON.stringify(\n Object.keys(sharedDependencies)\n )} }`;\n return [\n ...(needsToIncludeDesignSystem(context) ? [`require('./design-system.css');`] : []),\n `import { register } from '@servicetitan/web-components';`,\n `import { App } from './app';`,\n `register(App, ${embed}, ${options});`,\n ].join('\\n');\n}\n\nfunction needsToIncludeDesignSystem({ embed, packageData, sharedDependencies }: Context) {\n return (\n // Depends on design system\n !!packageData.dependencies['@servicetitan/design-system'] &&\n // ... and is not light bundle with private copy of design system\n !(embed && !!sharedDependencies['@servicetitan/design-system'])\n );\n}\n"],"names":["virtualModulesPlugin","context","_","isWebComponent","destination","indexPath","path","join","process","cwd","modules","indexCode","needsToIncludeDesignSystem","designSystemPath","fs","existsSync","designSystemCode","VirtualModulesPlugin","embed","isLegacyRoot","sharedDependencies","options","JSON","stringify","Object","keys","packageData","dependencies"],"mappings":";;;;+BAKgBA;;;eAAAA;;;2DALD;6DACE;8EACgB;;;;;;AAG1B,SAASA,qBAAqBC,OAAgB,EAAEC,CAAY;IAC/D,IAAI,CAACD,QAAQE,cAAc,EAAE;QACzB;IACJ;IAEA,MAAM,EAAEC,WAAW,EAAE,GAAGH;IAExB,MAAMI,YAAYC,aAAI,CAACC,IAAI,CAACC,QAAQC,GAAG,IAAI,GAAGL,YAAY,MAAM,CAAC;IACjE,MAAMM,UAAiE;QACnE,CAACL,UAAU,EAAEM,UAAUV;IAC3B;IAEA,IAAIW,2BAA2BX,UAAU;QACrC,MAAMY,mBAAmBP,aAAI,CAACC,IAAI,CAACC,QAAQC,GAAG,IAAI,GAAGL,YAAY,kBAAkB,CAAC;QACpF,IAAI,CAACU,WAAE,CAACC,UAAU,CAACF,mBAAmB;YAClCH,OAAO,CAACG,iBAAiB,GAAGG;QAChC;IACJ;IAEA,OAAO,IAAIC,8BAAoB,CAACP;AACpC;AAEA,SAASM;IACL,OAAO;QACH,CAAC,gDAAgD,CAAC;QAClD,CAAC,8DAA8D,CAAC;QAChE,CAAC,2DAA2D,CAAC;KAChE,CAACT,IAAI,CAAC;AACX;AAEA,SAASI,UAAUV,OAAgB;IAC/B,MAAM,EAAEiB,QAAQ,KAAK,EAAEC,YAAY,EAAEC,kBAAkB,EAAE,GAAGnB;IAC5D,MAAMoB,UAAU,CAAC,cAAc,EAAEF,aAAa,2BAA2B,EAAEG,KAAKC,SAAS,CACrFC,OAAOC,IAAI,CAACL,qBACd,EAAE,CAAC;IACL,OAAO;WACCR,2BAA2BX,WAAW;YAAC,CAAC,+BAA+B,CAAC;SAAC,GAAG,EAAE;QAClF,CAAC,wDAAwD,CAAC;QAC1D,CAAC,4BAA4B,CAAC;QAC9B,CAAC,cAAc,EAAEiB,MAAM,EAAE,EAAEG,QAAQ,EAAE,CAAC;KACzC,CAACd,IAAI,CAAC;AACX;AAEA,SAASK,2BAA2B,EAAEM,KAAK,EAAEQ,WAAW,EAAEN,kBAAkB,EAAW;IACnF,OACI,2BAA2B;IAC3B,CAAC,CAACM,YAAYC,YAAY,CAAC,8BAA8B,IACzD,iEAAiE;IACjE,CAAET,CAAAA,SAAS,CAAC,CAACE,kBAAkB,CAAC,8BAA8B,AAAD;AAErE"}
1
+ {"version":3,"sources":["../../../../src/webpack/configs/plugins/virtual-modules-plugin.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport VirtualModulesPlugin from 'webpack-virtual-modules';\nimport { Context, Overrides } from '../types';\n\nexport function virtualModulesPlugin(context: Context, _: Overrides) {\n if (!context.isWebComponent) {\n return;\n }\n\n const { destination } = context;\n\n const indexPath = path.join(process.cwd(), `${destination}/index`);\n const modules: ConstructorParameters<typeof VirtualModulesPlugin>[0] = {\n [indexPath]: indexCode(context),\n };\n\n if (needsToIncludeDesignSystem(context)) {\n const designSystemPath = path.join(process.cwd(), `${destination}/design-system.css`);\n if (!fs.existsSync(designSystemPath)) {\n modules[designSystemPath] = designSystemCode();\n }\n }\n\n return new VirtualModulesPlugin(modules);\n}\n\nfunction designSystemCode() {\n return [\n `@import '~@servicetitan/tokens/core/tokens.css';`,\n `@import '~@servicetitan/anvil-fonts/dist/css/anvil-fonts.css';`,\n `@import '~@servicetitan/design-system/dist/system.min.css';`,\n ].join('\\n');\n}\n\nfunction indexCode(context: Context) {\n const { embed = false, headless, isLegacyRoot, sharedDependencies } = context;\n if (headless) {\n return headlessIndex();\n }\n\n const options = `{ legacyRoot: ${isLegacyRoot}, sharedDependenciesNames: ${JSON.stringify(\n Object.keys(sharedDependencies)\n )} }`;\n return [\n ...(needsToIncludeDesignSystem(context) ? [`require('./design-system.css');`] : []),\n `import { register } from '@servicetitan/web-components';`,\n `import { App } from './app';`,\n `register(App, ${embed}, ${options});`,\n ].join('\\n');\n}\n\nfunction needsToIncludeDesignSystem({ embed, headless, packageData, sharedDependencies }: Context) {\n return (\n !headless &&\n // Depends on design system\n !!packageData.dependencies['@servicetitan/design-system'] &&\n // ... and is not light bundle with private copy of design system\n !(embed && !!sharedDependencies['@servicetitan/design-system'])\n );\n}\n\nfunction headlessIndex() {\n return [\n \"import { registerHeadless } from '@servicetitan/web-components';\",\n \"import { connectedCallback, disconnectedCallback } from './headless';\",\n 'registerHeadless(connectedCallback, disconnectedCallback);',\n ].join('\\n');\n}\n"],"names":["virtualModulesPlugin","context","_","isWebComponent","destination","indexPath","path","join","process","cwd","modules","indexCode","needsToIncludeDesignSystem","designSystemPath","fs","existsSync","designSystemCode","VirtualModulesPlugin","embed","headless","isLegacyRoot","sharedDependencies","headlessIndex","options","JSON","stringify","Object","keys","packageData","dependencies"],"mappings":";;;;+BAKgBA;;;eAAAA;;;2DALD;6DACE;8EACgB;;;;;;AAG1B,SAASA,qBAAqBC,OAAgB,EAAEC,CAAY;IAC/D,IAAI,CAACD,QAAQE,cAAc,EAAE;QACzB;IACJ;IAEA,MAAM,EAAEC,WAAW,EAAE,GAAGH;IAExB,MAAMI,YAAYC,aAAI,CAACC,IAAI,CAACC,QAAQC,GAAG,IAAI,GAAGL,YAAY,MAAM,CAAC;IACjE,MAAMM,UAAiE;QACnE,CAACL,UAAU,EAAEM,UAAUV;IAC3B;IAEA,IAAIW,2BAA2BX,UAAU;QACrC,MAAMY,mBAAmBP,aAAI,CAACC,IAAI,CAACC,QAAQC,GAAG,IAAI,GAAGL,YAAY,kBAAkB,CAAC;QACpF,IAAI,CAACU,WAAE,CAACC,UAAU,CAACF,mBAAmB;YAClCH,OAAO,CAACG,iBAAiB,GAAGG;QAChC;IACJ;IAEA,OAAO,IAAIC,8BAAoB,CAACP;AACpC;AAEA,SAASM;IACL,OAAO;QACH,CAAC,gDAAgD,CAAC;QAClD,CAAC,8DAA8D,CAAC;QAChE,CAAC,2DAA2D,CAAC;KAChE,CAACT,IAAI,CAAC;AACX;AAEA,SAASI,UAAUV,OAAgB;IAC/B,MAAM,EAAEiB,QAAQ,KAAK,EAAEC,QAAQ,EAAEC,YAAY,EAAEC,kBAAkB,EAAE,GAAGpB;IACtE,IAAIkB,UAAU;QACV,OAAOG;IACX;IAEA,MAAMC,UAAU,CAAC,cAAc,EAAEH,aAAa,2BAA2B,EAAEI,KAAKC,SAAS,CACrFC,OAAOC,IAAI,CAACN,qBACd,EAAE,CAAC;IACL,OAAO;WACCT,2BAA2BX,WAAW;YAAC,CAAC,+BAA+B,CAAC;SAAC,GAAG,EAAE;QAClF,CAAC,wDAAwD,CAAC;QAC1D,CAAC,4BAA4B,CAAC;QAC9B,CAAC,cAAc,EAAEiB,MAAM,EAAE,EAAEK,QAAQ,EAAE,CAAC;KACzC,CAAChB,IAAI,CAAC;AACX;AAEA,SAASK,2BAA2B,EAAEM,KAAK,EAAEC,QAAQ,EAAES,WAAW,EAAEP,kBAAkB,EAAW;IAC7F,OACI,CAACF,YACD,2BAA2B;IAC3B,CAAC,CAACS,YAAYC,YAAY,CAAC,8BAA8B,IACzD,iEAAiE;IACjE,CAAEX,CAAAA,SAAS,CAAC,CAACG,kBAAkB,CAAC,8BAA8B,AAAD;AAErE;AAEA,SAASC;IACL,OAAO;QACH;QACA;QACA;KACH,CAACf,IAAI,CAAC;AACX"}
@@ -1 +1 @@
1
- {"version":3,"file":"generate-metadata.d.ts","sourceRoot":"","sources":["../../../../src/webpack/configs/utils/generate-metadata.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAY,MAAM,UAAU,CAAC;AAK7C,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,QA2BhD"}
1
+ {"version":3,"file":"generate-metadata.d.ts","sourceRoot":"","sources":["../../../../src/webpack/configs/utils/generate-metadata.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAY,MAAM,UAAU,CAAC;AAK7C,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,QAgChD"}