@servicetitan/startup 31.0.0 → 31.2.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 (159) hide show
  1. package/bin/index.js +8 -0
  2. package/dist/cli/commands/build.d.ts.map +1 -1
  3. package/dist/cli/commands/build.js +1 -7
  4. package/dist/cli/commands/build.js.map +1 -1
  5. package/dist/cli/commands/prepare-package.d.ts +1 -2
  6. package/dist/cli/commands/prepare-package.d.ts.map +1 -1
  7. package/dist/cli/commands/prepare-package.js +4 -6
  8. package/dist/cli/commands/prepare-package.js.map +1 -1
  9. package/dist/cli/commands/run-task.test.js +59 -0
  10. package/dist/cli/commands/run-task.test.js.map +1 -0
  11. package/dist/cli/commands/start.d.ts.map +1 -1
  12. package/dist/cli/commands/start.js +2 -11
  13. package/dist/cli/commands/start.js.map +1 -1
  14. package/dist/cli/tasks/swc-cli.d.js +3 -0
  15. package/dist/cli/tasks/swc-cli.d.js.map +1 -0
  16. package/dist/cli/tasks/swc-compile-package.d.ts.map +1 -1
  17. package/dist/cli/tasks/swc-compile-package.js +22 -19
  18. package/dist/cli/tasks/swc-compile-package.js.map +1 -1
  19. package/dist/cli/types/cpx2.d.js +3 -0
  20. package/dist/cli/types/cpx2.d.js.map +1 -0
  21. package/dist/cli/utils/bundle.d.ts +2 -2
  22. package/dist/cli/utils/bundle.d.ts.map +1 -1
  23. package/dist/cli/utils/bundle.js +18 -4
  24. package/dist/cli/utils/bundle.js.map +1 -1
  25. package/dist/cli/utils/copy-files.d.ts +1 -1
  26. package/dist/cli/utils/copy-files.d.ts.map +1 -1
  27. package/dist/cli/utils/copy-files.js +18 -11
  28. package/dist/cli/utils/copy-files.js.map +1 -1
  29. package/dist/cli/utils/get-module-type.d.ts.map +1 -1
  30. package/dist/cli/utils/get-module-type.js +2 -16
  31. package/dist/cli/utils/get-module-type.js.map +1 -1
  32. package/dist/cli/utils/index.d.ts +1 -1
  33. package/dist/cli/utils/index.d.ts.map +1 -1
  34. package/dist/cli/utils/index.js +1 -1
  35. package/dist/cli/utils/index.js.map +1 -1
  36. package/dist/cli/utils/ts-config.d.ts +11 -0
  37. package/dist/cli/utils/ts-config.d.ts.map +1 -0
  38. package/dist/cli/utils/ts-config.js +80 -0
  39. package/dist/cli/utils/ts-config.js.map +1 -0
  40. package/dist/utils/get-configuration.d.ts +1 -0
  41. package/dist/utils/get-configuration.d.ts.map +1 -1
  42. package/dist/utils/get-configuration.js +14 -0
  43. package/dist/utils/get-configuration.js.map +1 -1
  44. package/dist/utils/log.d.ts +1 -0
  45. package/dist/utils/log.d.ts.map +1 -1
  46. package/dist/utils/log.js +9 -0
  47. package/dist/utils/log.js.map +1 -1
  48. package/dist/webpack/configs/dev-server-config.d.ts.map +1 -1
  49. package/dist/webpack/configs/dev-server-config.js +11 -0
  50. package/dist/webpack/configs/dev-server-config.js.map +1 -1
  51. package/dist/webpack/configs/index.d.ts +0 -1
  52. package/dist/webpack/configs/index.d.ts.map +1 -1
  53. package/dist/webpack/configs/index.js +0 -1
  54. package/dist/webpack/configs/index.js.map +1 -1
  55. package/dist/webpack/configs/optimization-config.js +6 -6
  56. package/dist/webpack/configs/optimization-config.js.map +1 -1
  57. package/dist/webpack/configs/output-config.d.ts.map +1 -1
  58. package/dist/webpack/configs/output-config.js +3 -2
  59. package/dist/webpack/configs/output-config.js.map +1 -1
  60. package/dist/webpack/configs/plugins/html-plugin.d.ts +1 -1
  61. package/dist/webpack/configs/plugins/html-plugin.d.ts.map +1 -1
  62. package/dist/webpack/configs/plugins/html-plugin.js +2 -2
  63. package/dist/webpack/configs/plugins/html-plugin.js.map +1 -1
  64. package/dist/webpack/configs/plugins/virtual-modules-plugin.js +14 -4
  65. package/dist/webpack/configs/plugins/virtual-modules-plugin.js.map +1 -1
  66. package/dist/webpack/configs/utils/generate-metadata.d.ts.map +1 -1
  67. package/dist/webpack/configs/utils/generate-metadata.js +4 -0
  68. package/dist/webpack/configs/utils/generate-metadata.js.map +1 -1
  69. package/dist/webpack/create-webpack-config.d.ts.map +1 -1
  70. package/dist/webpack/create-webpack-config.js +0 -1
  71. package/dist/webpack/create-webpack-config.js.map +1 -1
  72. package/dist/webpack/types.d.ts +1 -0
  73. package/dist/webpack/types.d.ts.map +1 -1
  74. package/dist/webpack/utils/index.d.ts +0 -1
  75. package/dist/webpack/utils/index.d.ts.map +1 -1
  76. package/dist/webpack/utils/index.js +0 -1
  77. package/dist/webpack/utils/index.js.map +1 -1
  78. package/package.json +7 -8
  79. package/src/cli/commands/__tests__/build.test.ts +2 -4
  80. package/src/cli/commands/__tests__/prepare-package.test.ts +5 -28
  81. package/src/cli/commands/__tests__/start.test.ts +3 -5
  82. package/src/cli/commands/build.ts +0 -2
  83. package/src/cli/commands/prepare-package.ts +4 -7
  84. package/src/cli/commands/start.ts +1 -3
  85. package/src/cli/tasks/__tests__/swc-compile-package.test.ts +71 -12
  86. package/src/cli/tasks/swc-compile-package.ts +21 -20
  87. package/src/cli/utils/__tests__/bundle.test.ts +48 -7
  88. package/src/cli/utils/__tests__/copy-files.test.ts +5 -5
  89. package/src/cli/utils/bundle.ts +27 -5
  90. package/src/cli/utils/copy-files.ts +16 -6
  91. package/src/cli/utils/get-module-type.ts +2 -18
  92. package/src/cli/utils/index.ts +1 -1
  93. package/src/cli/utils/ts-config.ts +64 -0
  94. package/src/utils/__tests__/get-configuration.test.ts +20 -0
  95. package/src/utils/__tests__/log.test.ts +8 -0
  96. package/src/utils/get-configuration.ts +12 -0
  97. package/src/utils/log.ts +10 -0
  98. package/src/webpack/__tests__/create-webpack-config-shared-dependencies.test.ts +0 -1
  99. package/src/webpack/__tests__/create-webpack-config-web-component.test.ts +17 -28
  100. package/src/webpack/__tests__/create-webpack-config.test.ts +113 -42
  101. package/src/webpack/configs/dev-server-config.ts +13 -1
  102. package/src/webpack/configs/index.ts +0 -1
  103. package/src/webpack/configs/optimization-config.ts +6 -6
  104. package/src/webpack/configs/output-config.ts +4 -2
  105. package/src/webpack/configs/plugins/html-plugin.ts +5 -2
  106. package/src/webpack/configs/plugins/virtual-modules-plugin.ts +15 -2
  107. package/src/webpack/configs/utils/__tests__/generate-metadata.test.ts +3 -1
  108. package/src/webpack/configs/utils/generate-metadata.ts +6 -1
  109. package/src/webpack/create-webpack-config.ts +0 -2
  110. package/src/webpack/types.ts +1 -0
  111. package/src/webpack/utils/index.ts +0 -1
  112. package/dist/__mocks__/create-package.d.ts +0 -3
  113. package/dist/__mocks__/create-package.d.ts.map +0 -1
  114. package/dist/__mocks__/index.d.ts +0 -2
  115. package/dist/__mocks__/index.d.ts.map +0 -1
  116. package/dist/cli/commands/review/__mocks__/expect-calls.d.ts +0 -23
  117. package/dist/cli/commands/review/__mocks__/expect-calls.d.ts.map +0 -1
  118. package/dist/cli/commands/review/__mocks__/index.d.ts +0 -2
  119. package/dist/cli/commands/review/__mocks__/index.d.ts.map +0 -1
  120. package/dist/cli/commands/review/rules/__mocks__/index.d.ts +0 -4
  121. package/dist/cli/commands/review/rules/__mocks__/index.d.ts.map +0 -1
  122. package/dist/cli/commands/review/rules/__mocks__/mock-config.d.ts +0 -7
  123. package/dist/cli/commands/review/rules/__mocks__/mock-config.d.ts.map +0 -1
  124. package/dist/cli/commands/review/rules/__mocks__/mock-packages.d.ts +0 -21
  125. package/dist/cli/commands/review/rules/__mocks__/mock-packages.d.ts.map +0 -1
  126. package/dist/cli/commands/review/rules/__mocks__/mock-project.d.ts +0 -3
  127. package/dist/cli/commands/review/rules/__mocks__/mock-project.d.ts.map +0 -1
  128. package/dist/cli/utils/style-extensions.d.ts +0 -2
  129. package/dist/cli/utils/style-extensions.d.ts.map +0 -1
  130. package/dist/cli/utils/style-extensions.js +0 -17
  131. package/dist/cli/utils/style-extensions.js.map +0 -1
  132. package/dist/cli/utils/tcm.d.ts +0 -6
  133. package/dist/cli/utils/tcm.d.ts.map +0 -1
  134. package/dist/cli/utils/tcm.js +0 -72
  135. package/dist/cli/utils/tcm.js.map +0 -1
  136. package/dist/webpack/__mocks__/file-rules.d.ts +0 -3
  137. package/dist/webpack/__mocks__/file-rules.d.ts.map +0 -1
  138. package/dist/webpack/__mocks__/index.d.ts +0 -3
  139. package/dist/webpack/__mocks__/index.d.ts.map +0 -1
  140. package/dist/webpack/__mocks__/style-rules.d.ts +0 -8
  141. package/dist/webpack/__mocks__/style-rules.d.ts.map +0 -1
  142. package/dist/webpack/configs/cache-config.d.ts +0 -6
  143. package/dist/webpack/configs/cache-config.d.ts.map +0 -1
  144. package/dist/webpack/configs/cache-config.js +0 -34
  145. package/dist/webpack/configs/cache-config.js.map +0 -1
  146. package/dist/webpack/utils/feature-cohort.d.ts +0 -5
  147. package/dist/webpack/utils/feature-cohort.d.ts.map +0 -1
  148. package/dist/webpack/utils/feature-cohort.js +0 -26
  149. package/dist/webpack/utils/feature-cohort.js.map +0 -1
  150. package/dist/webpack/utils/hash-mod.d.ts +0 -9
  151. package/dist/webpack/utils/hash-mod.d.ts.map +0 -1
  152. package/dist/webpack/utils/hash-mod.js +0 -39
  153. package/dist/webpack/utils/hash-mod.js.map +0 -1
  154. package/src/cli/utils/__tests__/tcm.test.ts +0 -195
  155. package/src/cli/utils/style-extensions.ts +0 -1
  156. package/src/cli/utils/tcm.ts +0 -66
  157. package/src/webpack/configs/cache-config.ts +0 -25
  158. package/src/webpack/utils/feature-cohort.ts +0 -19
  159. package/src/webpack/utils/hash-mod.ts +0 -32
@@ -9,14 +9,14 @@ function _export(target, all) {
9
9
  });
10
10
  }
11
11
  _export(exports, {
12
- get assetExtensions () {
13
- return assetExtensions;
14
- },
15
12
  get copyFiles () {
16
13
  return copyFiles;
17
14
  },
18
15
  get styleExtensions () {
19
16
  return styleExtensions;
17
+ },
18
+ get supportedExtensions () {
19
+ return supportedExtensions;
20
20
  }
21
21
  });
22
22
  const _cpx2 = /*#__PURE__*/ _interop_require_default(require("cpx2"));
@@ -42,21 +42,28 @@ const assetExtensions = [
42
42
  'woff',
43
43
  'woff2'
44
44
  ];
45
+ const resourceExtensions = [
46
+ 'json'
47
+ ];
45
48
  const styleExtensions = [
46
49
  'css',
47
50
  'less',
48
51
  'scss'
49
52
  ];
53
+ const styleTypeDefinitionExtensions = styleExtensions.map((ext)=>`${ext}.d.ts`);
54
+ const supportedExtensions = [
55
+ assetExtensions,
56
+ resourceExtensions,
57
+ styleExtensions,
58
+ styleTypeDefinitionExtensions
59
+ ].flat();
50
60
  const styleModuleRegex = new RegExp(`\\.module\\.(${styleExtensions.join('|')})$`);
51
61
  async function copyFiles({ watch }) {
52
62
  const { source, destination } = (0, _utils.getFolders)();
53
63
  if (!_fs.default.existsSync(source)) {
54
64
  return;
55
65
  }
56
- const filesPattern = `${source}/**/*.{${[
57
- ...assetExtensions,
58
- ...styleExtensions
59
- ].join()}}`;
66
+ const filesPattern = `${source}/**/*.{${supportedExtensions.join()}}`;
60
67
  const creator = new _typedcssmodules.default({
61
68
  camelCase: true,
62
69
  namedExports: true
@@ -71,12 +78,12 @@ async function copyFiles({ watch }) {
71
78
  }
72
79
  };
73
80
  if (!watch) {
74
- _utils.log.info(`Copying ${filesPattern} -> ${destination}`);
75
- _cpx2.default.copy(filesPattern, destination);
76
81
  const modulesPattern = `${source}/**/*.module.{${styleExtensions.join()}}`;
77
82
  _utils.log.info(`Generating types for ${modulesPattern}`);
78
83
  const modules = await (0, _glob.glob)(modulesPattern);
79
84
  await Promise.all(modules.map(generateDefinitions));
85
+ _utils.log.info(`Copying ${filesPattern} -> ${destination}`);
86
+ _cpx2.default.copySync(filesPattern, destination);
80
87
  return;
81
88
  }
82
89
  _utils.log.info(`Watching ${filesPattern} -> ${destination}`);
@@ -86,8 +93,8 @@ async function copyFiles({ watch }) {
86
93
  ignore: [
87
94
  '__tests__',
88
95
  '__mocks__',
89
- '**/*.ts',
90
- '**/*.tsx'
96
+ '*.*',
97
+ ...supportedExtensions.map((ext)=>`!*.${ext}`)
91
98
  ]
92
99
  }).on('copy', async ({ srcPath, dstPath })=>{
93
100
  _utils.log.info(`Copied ${srcPath} -> ${dstPath}`);
@@ -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,OAAO,CAAC,aAAa,EAAEF,gBAAgBG,IAAI,CAAC,KAAK,EAAE,CAAC;AAM1E,eAAeJ,UAAU,EAAEK,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,EAAE;WAAIP;WAAoBE;KAAgB,CAACG,IAAI,GAAG,CAAC,CAAC;IAC1F,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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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,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QACb,yEAAyE;QACzEC,QAAQ;YAAC;YAAa;YAAa;eAAUxC,oBAAoBI,GAAG,CAACC,CAAAA,MAAO,CAAC,GAAG,EAAEA,KAAK;SAAE;IAC7F,GACKoC,EAAE,CAAC,QAAQ,OAAO,EAAEC,OAAO,EAAEC,OAAO,EAAwC;QACzEd,UAAG,CAACG,IAAI,CAAC,CAAC,OAAO,EAAEU,QAAQ,IAAI,EAAEC,SAAS;QAC1C,IAAIpC,iBAAiBqC,IAAI,CAACF,UAAU;YAChCb,UAAG,CAACG,IAAI,CAAC,CAAC,qBAAqB,EAAEU,SAAS;YAC1C,MAAMrB,oBAAoBqB;QAC9B;IACJ,GACCD,EAAE,CAAC,eAAe,CAACb,QAAmBC,UAAG,CAACD,KAAK,CAACE,OAAOF;IAE5D,0DAA0D,GAC1D,IAAIiB,QAAQC,GAAG,CAACC,QAAQ,KAAK,QAAQ;QACjC,MAAM,IAAIZ,QAAc,KAAO;IACnC;AACJ;AAEA,eAAeX,QAAQwB,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 +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,I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,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,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,IAAI,6BAA6B,EAAE,MAAM,oBAAoB,CAAC;AAEpF,OAAO,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAI7D,eAAO,MAAM,8BAA8B,iDAAkD,CAAC;AAE9F,KAAK,WAAW,CAAC,CAAC,IAAI,CAAC,SAAS,SAAS,CAAC,MAAM,WAAW,CAAC,EAAE,GAAG,WAAW,GAAG,KAAK,CAAC;AAErF,MAAM,WAAW,eAAe;IAC5B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,gBAAgB;CAAG;AAEpC,MAAM,WAAW,aAAa;IAC1B,GAAG,CAAC,EAAE,OAAO,GAAG,gBAAgB,C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gB,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,iCAAiC;IAAC;IAAW;IAAQ;IAAS;CAAS;AA+C7E,IAAA,AAAKD,qCAAAA;;;;;;;;;;;;;;;;;;;WAAAA;;AAiDL,SAASE,iBAAiBkB,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,SAASlB,qBAAqBiB,iBAAiC,IAAI;IACtE,MAAMC,OACF,OAAOD,mBAAmB,WACpBM,IAAAA,sBAAY,EAACH,aAAI,CAACC,IAAI,CAACJ,gBAAgB,mBACvCA;QACHC;IAAP,OAAOA,CAAAA,YAAAA,iBAAAA,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,6BAA6BW,iBAAiC,IAAI;IAC9E,MAAMa,SAASvB,6BAA6BU;IAE5C,OAAOa,mBAAAA,6BAAAA,OAAQS,QAAQ;AAC3B;AAEO,SAASlC;QACLN;IAAP,OAAOA,CAAAA,sCAAAA,kBAAkB,CAAC,sBAAsB,cAAzCA,iDAAAA,sCAA6C,CAAC;AACzD;AAEO,SAASU,SAASQ,cAA+B;IACpD,OAAOlB,iBAAiBkB,gBAAgBY,OAAO,KAAK;AACxD;AAEO,SAASnB;IACZ,OAAOF,yBAAyB,CAAC,qBAAqB,KAAK;AAC/D;AAEO,SAASG;IACZ,MAAM6B,uBAAuBhC;IAC7B,OAAOgC,qBAAqBC,SAAS,KAAK;AAC9C;AAEO,SAAS7B;IACZ,OAAOJ,yBAAyB,CAAC,6BAA6B,KAAK;AACvE;AAEO,SAASK,SAASI,cAA+B;IACpD,OAAOlB,iBAAiBkB,gBAAgByB,MAAM,KAAK;AACvD;AAEO,SAAS5B;QACLP;IAAP,OAAOA,EAAAA,gCAAAA,4CAAAA,oDAAAA,8BAAgCoC,UAAU,MAAK;AAC1D;AAEO,SAAS5B;IACZ,OAAOP,yBAAyB,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;;QAgGG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CAAAA,sCAAAA,kBAAkB,CAAC,sBAAsB,cAAzCA,iDAAAA,sCAA6C,CAAC;AACzD;AAEO,SAASW,SAASQ,cAA+B;IACpD,OAAOnB,iBAAiBmB,gBAAgBY,OAAO,KAAK;AACxD;AAEO,SAASnB;IACZ,OAAOH,yBAAyB,CAAC,qBAAqB,KAAK;AAC/D;AAEO,SAASI;IACZ,MAAMgC,uBAAuBpC;IAC7B,OAAOoC,qBAAqBC,SAAS,KAAK;AAC9C;AAEO,SAAShC;IACZ,OAAOL,yBAAyB,CAAC,6BAA6B,KAAK;AACvE;AAEO,SAASM,SAASI,cAA+B;IACpD,OAAOnB,iBAAiBmB,gBAAgB4B,MAAM,KAAK;AACvD;AAEO,SAAS/B;QACLR;IAAP,OAAOA,EAAAA,gCAAAA,4CAAAA,oDAAAA,8BAAgCwC,UAAU,MAAK;AAC1D;AAEO,SAAS/B;IACZ,OAAOR,yBAAyB,CAAC,sBAAsB,KAAK;AAChE;AAEO,SAASS,eAAeC,iBAAiC,IAAI;IAChE,OAAO,CAAC,CAACX,6BAA6BW;AAC1C"}
@@ -1,6 +1,7 @@
1
1
  declare class Log {
2
2
  private readonly debugMap;
3
3
  constructor();
4
+ get timestamp(): string;
4
5
  text(...text: string[]): void;
5
6
  info(...text: string[]): void;
6
7
  success(...text: string[]): void;
@@ -1 +1 @@
1
- {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/utils/log.ts"],"names":[],"mappings":"AAKA,cAAM,GAAG;IACL,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAwB;;IAMjD,IAAI,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE;IAItB,IAAI,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE;IAItB,OAAO,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE;IAIzB,OAAO,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE;IAIzB,KAAK,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE;IAIvB,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE;;;CAY1C;AAED,eAAO,MAAM,GAAG,KAAY,CAAC"}
1
+ {"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../../src/utils/log.ts"],"names":[],"mappings":"AAKA,cAAM,GAAG;IACL,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAwB;;IAMjD,IAAI,SAAS,WAQZ;IAED,IAAI,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE;IAItB,IAAI,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE;IAItB,OAAO,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE;IAIzB,OAAO,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE;IAIzB,KAAK,CAAC,GAAG,IAAI,EAAE,MAAM,EAAE;IAIvB,KAAK,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE;;;CAY1C;AAED,eAAO,MAAM,GAAG,KAAY,CAAC"}
package/dist/utils/log.js CHANGED
@@ -29,6 +29,15 @@ function _interop_require_default(obj) {
29
29
  };
30
30
  }
31
31
  class Log {
32
+ get timestamp() {
33
+ return new Date().toLocaleTimeString(undefined, {
34
+ hour12: false,
35
+ hour: '2-digit',
36
+ minute: '2-digit',
37
+ second: '2-digit',
38
+ fractionalSecondDigits: 3
39
+ });
40
+ }
32
41
  text(...text) {
33
42
  process.stdout.write((0, _chalk.default)(...text) + '\n');
34
43
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/utils/log.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { createDebug } from './debug';\n\ntype Debugger = ReturnType<typeof createDebug>;\n\nclass Log {\n private readonly debugMap: Map<string, Debugger>;\n\n constructor() {\n this.debugMap = new Map<string, Debugger>();\n }\n\n text(...text: string[]) {\n process.stdout.write(chalk(...text) + '\\n');\n }\n\n info(...text: string[]) {\n process.stdout.write(chalk.bold.cyan(...text) + '\\n');\n }\n\n success(...text: string[]) {\n process.stdout.write(chalk.bold.green(...text) + '\\n');\n }\n\n warning(...text: string[]) {\n process.stdout.write(chalk.bold.yellow(...text) + '\\n');\n }\n\n error(...text: string[]) {\n process.stdout.write(chalk.bold.red(...text) + '\\n');\n }\n\n debug(namespace: string, ...text: any[]) {\n let dbg = this.debugMap.get(namespace);\n if (!dbg) {\n dbg = createDebug(namespace);\n this.debugMap.set(namespace, dbg);\n }\n if (dbg.enabled && text.length) {\n const [formatter, ...args] = text.map(str => (typeof str === 'function' ? str() : str));\n dbg(formatter, ...args);\n }\n return dbg;\n }\n}\n\nexport const log = new Log();\n"],"names":["log","Log","text","process","stdout","write","chalk","info","bold","cyan","success","green","warning","yellow","error","red","debug","namespace","dbg","debugMap","get","createDebug","set","enabled","length","formatter","args","map","str","constructor","Map"],"mappings":";;;;+BA8CaA;;;eAAAA;;;8DA9CK;uBACU;;;;;;;;;;;;;;;;;;;AAI5B,MAAMC;IAOFC,KAAK,GAAGA,IAAc,EAAE;QACpBC,QAAQC,MAAM,CAACC,KAAK,CAACC,IAAAA,cAAK,KAAIJ,QAAQ;IAC1C;IAEAK,KAAK,GAAGL,IAAc,EAAE;QACpBC,QAAQC,MAAM,CAACC,KAAK,CAACC,cAAK,CAACE,IAAI,CAACC,IAAI,IAAIP,QAAQ;IACpD;IAEAQ,QAAQ,GAAGR,IAAc,EAAE;QACvBC,QAAQC,MAAM,CAACC,KAAK,CAACC,cAAK,CAACE,IAAI,CAACG,KAAK,IAAIT,QAAQ;IACrD;IAEAU,QAAQ,GAAGV,IAAc,EAAE;QACvBC,QAAQC,MAAM,CAACC,KAAK,CAACC,cAAK,CAACE,IAAI,CAACK,MAAM,IAAIX,QAAQ;IACtD;IAEAY,MAAM,GAAGZ,IAAc,EAAE;QACrBC,QAAQC,MAAM,CAACC,KAAK,CAACC,cAAK,CAACE,IAAI,CAACO,GAAG,IAAIb,QAAQ;IACnD;IAEAc,MAAMC,SAAiB,EAAE,GAAGf,IAAW,EAAE;QACrC,IAAIgB,MAAM,IAAI,CAACC,QAAQ,CAACC,GAAG,CAACH;QAC5B,IAAI,CAACC,KAAK;YACNA,MAAMG,IAAAA,kBAAW,EAACJ;YAClB,IAAI,CAACE,QAAQ,CAACG,GAAG,CAACL,WAAWC;QACjC;QACA,IAAIA,IAAIK,OAAO,IAAIrB,KAAKsB,MAAM,EAAE;YAC5B,MAAM,CAACC,WAAW,GAAGC,KAAK,GAAGxB,KAAKyB,GAAG,CAACC,CAAAA,MAAQ,OAAOA,QAAQ,aAAaA,QAAQA;YAClFV,IAAIO,cAAcC;QACtB;QACA,OAAOR;IACX;IAnCAW,aAAc;QAFd,uBAAiBV,YAAjB,KAAA;QAGI,IAAI,CAACA,QAAQ,GAAG,IAAIW;IACxB;AAkCJ;AAEO,MAAM9B,MAAM,IAAIC"}
1
+ {"version":3,"sources":["../../src/utils/log.ts"],"sourcesContent":["import chalk from 'chalk';\nimport { createDebug } from './debug';\n\ntype Debugger = ReturnType<typeof createDebug>;\n\nclass Log {\n private readonly debugMap: Map<string, Debugger>;\n\n constructor() {\n this.debugMap = new Map<string, Debugger>();\n }\n\n get timestamp() {\n return new Date().toLocaleTimeString(undefined, {\n hour12: false,\n hour: '2-digit',\n minute: '2-digit',\n second: '2-digit',\n fractionalSecondDigits: 3,\n });\n }\n\n text(...text: string[]) {\n process.stdout.write(chalk(...text) + '\\n');\n }\n\n info(...text: string[]) {\n process.stdout.write(chalk.bold.cyan(...text) + '\\n');\n }\n\n success(...text: string[]) {\n process.stdout.write(chalk.bold.green(...text) + '\\n');\n }\n\n warning(...text: string[]) {\n process.stdout.write(chalk.bold.yellow(...text) + '\\n');\n }\n\n error(...text: string[]) {\n process.stdout.write(chalk.bold.red(...text) + '\\n');\n }\n\n debug(namespace: string, ...text: any[]) {\n let dbg = this.debugMap.get(namespace);\n if (!dbg) {\n dbg = createDebug(namespace);\n this.debugMap.set(namespace, dbg);\n }\n if (dbg.enabled && text.length) {\n const [formatter, ...args] = text.map(str => (typeof str === 'function' ? str() : str));\n dbg(formatter, ...args);\n }\n return dbg;\n }\n}\n\nexport const log = new Log();\n"],"names":["log","Log","timestamp","Date","toLocaleTimeString","undefined","hour12","hour","minute","second","fractionalSecondDigits","text","process","stdout","write","chalk","info","bold","cyan","success","green","warning","yellow","error","red","debug","namespace","dbg","debugMap","get","createDebug","set","enabled","length","formatter","args","map","str","constructor","Map"],"mappings":";;;;+BAwDaA;;;eAAAA;;;8DAxDK;uBACU;;;;;;;;;;;;;;;;;;;AAI5B,MAAMC;IAOF,IAAIC,YAAY;QACZ,OAAO,IAAIC,OAAOC,kBAAkB,CAACC,WAAW;YAC5CC,QAAQ;YACRC,MAAM;YACNC,QAAQ;YACRC,QAAQ;YACRC,wBAAwB;QAC5B;IACJ;IAEAC,KAAK,GAAGA,IAAc,EAAE;QACpBC,QAAQC,MAAM,CAACC,KAAK,CAACC,IAAAA,cAAK,KAAIJ,QAAQ;IAC1C;IAEAK,KAAK,GAAGL,IAAc,EAAE;QACpBC,QAAQC,MAAM,CAACC,KAAK,CAACC,cAAK,CAACE,IAAI,CAACC,IAAI,IAAIP,QAAQ;IACpD;IAEAQ,QAAQ,GAAGR,IAAc,EAAE;QACvBC,QAAQC,MAAM,CAACC,KAAK,CAACC,cAAK,CAACE,IAAI,CAACG,KAAK,IAAIT,QAAQ;IACrD;IAEAU,QAAQ,GAAGV,IAAc,EAAE;QACvBC,QAAQC,MAAM,CAACC,KAAK,CAACC,cAAK,CAACE,IAAI,CAACK,MAAM,IAAIX,QAAQ;IACtD;IAEAY,MAAM,GAAGZ,IAAc,EAAE;QACrBC,QAAQC,MAAM,CAACC,KAAK,CAACC,cAAK,CAACE,IAAI,CAACO,GAAG,IAAIb,QAAQ;IACnD;IAEAc,MAAMC,SAAiB,EAAE,GAAGf,IAAW,EAAE;QACrC,IAAIgB,MAAM,IAAI,CAACC,QAAQ,CAACC,GAAG,CAACH;QAC5B,IAAI,CAACC,KAAK;YACNA,MAAMG,IAAAA,kBAAW,EAACJ;YAClB,IAAI,CAACE,QAAQ,CAACG,GAAG,CAACL,WAAWC;QACjC;QACA,IAAIA,IAAIK,OAAO,IAAIrB,KAAKsB,MAAM,EAAE;YAC5B,MAAM,CAACC,WAAW,GAAGC,KAAK,GAAGxB,KAAKyB,GAAG,CAACC,CAAAA,MAAQ,OAAOA,QAAQ,aAAaA,QAAQA;YAClFV,IAAIO,cAAcC;QACtB;QACA,OAAOR;IACX;IA7CAW,aAAc;QAFd,uBAAiBV,YAAjB,KAAA;QAGI,IAAI,CAACA,QAAQ,GAAG,IAAIW;IACxB;AA4CJ;AAEO,MAAMvC,MAAM,IAAIC"}
@@ -1 +1 @@
1
- {"version":3,"file":"dev-server-config.d.ts","sourceRoot":"","sources":["../../../src/webpack/configs/dev-server-config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AASxC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAG7C,KAAK,MAAM,GAAG,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,GAAG,SAAS,CAAC;AAE3D,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,GAAG,MAAM,CAoB9E"}
1
+ {"version":3,"file":"dev-server-config.d.ts","sourceRoot":"","sources":["../../../src/webpack/configs/dev-server-config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AASxC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAG7C,KAAK,MAAM,GAAG,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,GAAG,SAAS,CAAC;AAE3D,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,GAAG,MAAM,CAgC9E"}
@@ -33,6 +33,17 @@ function devServerConfig(context, overrides) {
33
33
  'Access-Control-Allow-Origin': '*',
34
34
  'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept'
35
35
  },
36
+ setupMiddlewares: (middlewares, devServer)=>{
37
+ if (devServer.app) {
38
+ devServer.app.use((request, _, next)=>{
39
+ _utils.log.info(`[${_utils.log.timestamp}]: ${request.method} ${request.url}`);
40
+ next();
41
+ });
42
+ } else {
43
+ _utils.log.warning('webpack-dev-server app is not defined');
44
+ }
45
+ return middlewares;
46
+ },
36
47
  ...getDevServerConfig()
37
48
  };
38
49
  /* istanbul ignore next: debug only */ _utils.log.debug('dev-server-config', ()=>JSON.stringify({
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/webpack/configs/dev-server-config.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport { Configuration } from 'webpack';\nimport {\n allowedWebpackDevServerOptions,\n getWebpackConfiguration,\n isDevServerDisabled,\n log,\n pick,\n} from '../../utils';\nimport { statsConfig } from './stats-config';\nimport { Context, Overrides } from './types';\n\ntype DevServerConfig = NonNullable<Configuration['devServer']>;\ntype Result = Pick<Configuration, 'devServer'> | undefined;\n\nexport function devServerConfig(context: Context, overrides: Overrides): Result {\n if (context.isProduction || isDevServerDisabled()) {\n return;\n }\n\n const devServer = {\n hot: false,\n port: 8080,\n historyApiFallback: true,\n devMiddleware: { writeToDisk: true, ...statsConfig(context, overrides) },\n headers: {\n 'Access-Control-Allow-Origin': '*',\n 'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept',\n },\n ...getDevServerConfig(),\n };\n\n /* istanbul ignore next: debug only */\n log.debug('dev-server-config', () => JSON.stringify({ devServer }, null, 2));\n return { devServer };\n}\n\nfunction getDevServerConfig() {\n const webpack = getWebpackConfiguration();\n /* istanbul ignore next: debug only */\n log.debug('dev-server-config', () => JSON.stringify({ webpack }, null, 2));\n\n const result = pick(webpack, allowedWebpackDevServerOptions);\n if (typeof result.proxy === 'string') {\n if (fs.existsSync(result.proxy)) {\n result.proxy = require(path.resolve(result.proxy));\n } else {\n delete result.proxy;\n }\n }\n\n if (result.static === undefined) {\n const contentBase = webpack.contentBase;\n if (contentBase !== undefined) {\n log.warning(CONTENT_BASE_DEPRECATION_WARNING);\n if (typeof contentBase !== 'number') {\n result.static = contentBase;\n }\n } else {\n result.static = '.';\n }\n }\n\n return { ...result, ...webpack.devServer } as Partial<DevServerConfig>;\n}\n\nconst CONTENT_BASE_DEPRECATION_WARNING = `\n DEPRECATION WARNING: webpack.contentBase in package.json is deprecated.\n Use webpack.static instead.\n`\n .replace(/\\n\\s*/g, ' ')\n .trim();\n"],"names":["devServerConfig","context","overrides","isProduction","isDevServerDisabled","devServer","hot","port","historyApiFallback","devMiddleware","writeToDisk","statsConfig","headers","getDevServerConfig","log","debug","JSON","stringify","webpack","getWebpackConfiguration","result","pick","allowedWebpackDevServerOptions","proxy","fs","existsSync","require","path","resolve","static","undefined","contentBase","warning","CONTENT_BASE_DEPRECATION_WARNING","replace","trim"],"mappings":";;;;+BAgBgBA;;;eAAAA;;;2DAhBD;6DACE;uBAQV;6BACqB;;;;;;AAMrB,SAASA,gBAAgBC,OAAgB,EAAEC,SAAoB;IAClE,IAAID,QAAQE,YAAY,IAAIC,IAAAA,0BAAmB,KAAI;QAC/C;IACJ;IAEA,MAAMC,YAAY;QACdC,KAAK;QACLC,MAAM;QACNC,oBAAoB;QACpBC,eAAe;YAAEC,aAAa;YAAM,GAAGC,IAAAA,wBAAW,EAACV,SAASC,UAAU;QAAC;QACvEU,SAAS;YACL,+BAA+B;YAC/B,gCAAgC;QACpC;QACA,GAAGC,oBAAoB;IAC3B;IAEA,oCAAoC,GACpCC,UAAG,CAACC,KAAK,CAAC,qBAAqB,IAAMC,KAAKC,SAAS,CAAC;YAAEZ;QAAU,GAAG,MAAM;IACzE,OAAO;QAAEA;IAAU;AACvB;AAEA,SAASQ;IACL,MAAMK,UAAUC,IAAAA,8BAAuB;IACvC,oCAAoC,GACpCL,UAAG,CAACC,KAAK,CAAC,qBAAqB,IAAMC,KAAKC,SAAS,CAAC;YAAEC;QAAQ,GAAG,MAAM;IAEvE,MAAME,SAASC,IAAAA,WAAI,EAACH,SAASI,qCAA8B;IAC3D,IAAI,OAAOF,OAAOG,KAAK,KAAK,UAAU;QAClC,IAAIC,WAAE,CAACC,UAAU,CAACL,OAAOG,KAAK,GAAG;YAC7BH,OAAOG,KAAK,GAAGG,QAAQC,aAAI,CAACC,OAAO,CAACR,OAAOG,KAAK;QACpD,OAAO;YACH,OAAOH,OAAOG,KAAK;QACvB;IACJ;IAEA,IAAIH,OAAOS,MAAM,KAAKC,WAAW;QAC7B,MAAMC,cAAcb,QAAQa,WAAW;QACvC,IAAIA,gBAAgBD,WAAW;YAC3BhB,UAAG,CAACkB,OAAO,CAACC;YACZ,IAAI,OAAOF,gBAAgB,UAAU;gBACjCX,OAAOS,MAAM,GAAGE;YACpB;QACJ,OAAO;YACHX,OAAOS,MAAM,GAAG;QACpB;IACJ;IAEA,OAAO;QAAE,GAAGT,MAAM;QAAE,GAAGF,QAAQb,SAAS;IAAC;AAC7C;AAEA,MAAM4B,mCAAmC,CAAC;;;AAG1C,CAAC,CACIC,OAAO,CAAC,UAAU,KAClBC,IAAI"}
1
+ {"version":3,"sources":["../../../src/webpack/configs/dev-server-config.ts"],"sourcesContent":["import fs from 'fs';\nimport path from 'path';\nimport { Configuration } from 'webpack';\nimport {\n allowedWebpackDevServerOptions,\n getWebpackConfiguration,\n isDevServerDisabled,\n log,\n pick,\n} from '../../utils';\nimport { statsConfig } from './stats-config';\nimport { Context, Overrides } from './types';\n\ntype DevServerConfig = NonNullable<Configuration['devServer']>;\ntype Result = Pick<Configuration, 'devServer'> | undefined;\n\nexport function devServerConfig(context: Context, overrides: Overrides): Result {\n if (context.isProduction || isDevServerDisabled()) {\n return;\n }\n\n const devServer: DevServerConfig = {\n hot: false,\n port: 8080,\n historyApiFallback: true,\n devMiddleware: { writeToDisk: true, ...statsConfig(context, overrides) },\n headers: {\n 'Access-Control-Allow-Origin': '*',\n 'Access-Control-Allow-Headers': 'Origin, X-Requested-With, Content-Type, Accept',\n },\n setupMiddlewares: (middlewares, devServer) => {\n if (devServer.app) {\n devServer.app.use((request, _, next) => {\n log.info(`[${log.timestamp}]: ${request.method} ${request.url}`);\n next();\n });\n } else {\n log.warning('webpack-dev-server app is not defined');\n }\n\n return middlewares;\n },\n ...getDevServerConfig(),\n };\n\n /* istanbul ignore next: debug only */\n log.debug('dev-server-config', () => JSON.stringify({ devServer }, null, 2));\n return { devServer };\n}\n\nfunction getDevServerConfig() {\n const webpack = getWebpackConfiguration();\n /* istanbul ignore next: debug only */\n log.debug('dev-server-config', () => JSON.stringify({ webpack }, null, 2));\n\n const result = pick(webpack, allowedWebpackDevServerOptions);\n if (typeof result.proxy === 'string') {\n if (fs.existsSync(result.proxy)) {\n result.proxy = require(path.resolve(result.proxy));\n } else {\n delete result.proxy;\n }\n }\n\n if (result.static === undefined) {\n const contentBase = webpack.contentBase;\n if (contentBase !== undefined) {\n log.warning(CONTENT_BASE_DEPRECATION_WARNING);\n if (typeof contentBase !== 'number') {\n result.static = contentBase;\n }\n } else {\n result.static = '.';\n }\n }\n\n return { ...result, ...webpack.devServer } as Partial<DevServerConfig>;\n}\n\nconst CONTENT_BASE_DEPRECATION_WARNING = `\n DEPRECATION WARNING: webpack.contentBase in package.json is deprecated.\n Use webpack.static instead.\n`\n .replace(/\\n\\s*/g, ' ')\n .trim();\n"],"names":["devServerConfig","context","overrides","isProduction","isDevServerDisabled","devServer","hot","port","historyApiFallback","devMiddleware","writeToDisk","statsConfig","headers","setupMiddlewares","middlewares","app","use","request","_","next","log","info","timestamp","method","url","warning","getDevServerConfig","debug","JSON","stringify","webpack","getWebpackConfiguration","result","pick","allowedWebpackDevServerOptions","proxy","fs","existsSync","require","path","resolve","static","undefined","contentBase","CONTENT_BASE_DEPRECATION_WARNING","replace","trim"],"mappings":";;;;+BAgBgBA;;;eAAAA;;;2DAhBD;6DACE;uBAQV;6BACqB;;;;;;AAMrB,SAASA,gBAAgBC,OAAgB,EAAEC,SAAoB;IAClE,IAAID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,MAAMC,cAAcb,QAAQa,WAAW;QACvC,IAAIA,gBAAgBD,WAAW;YAC3BtB,UAAG,CAACK,OAAO,CAACmB;YACZ,IAAI,OAAOD,gBAAgB,UAAU;gBACjCX,OAAOS,MAAM,GAAGE;YACpB;QACJ,OAAO;YACHX,OAAOS,MAAM,GAAG;QACpB;IACJ;IAEA,OAAO;QAAE,GAAGT,MAAM;QAAE,GAAGF,QAAQzB,SAAS;IAAC;AAC7C;AAEA,MAAMuC,mCAAmC,CAAC;;;AAG1C,CAAC,CACIC,OAAO,CAAC,UAAU,KAClBC,IAAI"}
@@ -1,5 +1,4 @@
1
1
  export * from './amd-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, {