@flatjs/evolve 2.1.0-next.9 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (160) hide show
  1. package/dist/compiler/create-global-compiler.d.ts +2 -0
  2. package/dist/compiler/create-global-compiler.js +1 -0
  3. package/dist/constants.d.ts +9 -0
  4. package/dist/constants.js +1 -1
  5. package/dist/create-webpack/create-externals.d.ts +1 -1
  6. package/dist/create-webpack/create-externals.js +1 -1
  7. package/dist/create-webpack/create-optimization.d.ts +1 -1
  8. package/dist/create-webpack/create-optimization.js +1 -1
  9. package/dist/create-webpack/create-output.d.ts +1 -1
  10. package/dist/create-webpack/create-performance.d.ts +1 -1
  11. package/dist/create-webpack/create-plugins.d.ts +2 -1
  12. package/dist/create-webpack/create-plugins.js +1 -1
  13. package/dist/create-webpack/create-resolve.js +1 -1
  14. package/dist/create-webpack/create-rule-sets.d.ts +1 -1
  15. package/dist/create-webpack/create-rule-sets.js +1 -1
  16. package/dist/create-webpack/load-watch-options.d.ts +12 -0
  17. package/dist/create-webpack/load-watch-options.js +1 -0
  18. package/dist/create-webpack/load-webpack-config.d.ts +2 -1
  19. package/dist/create-webpack/load-webpack-config.js +1 -1
  20. package/dist/create-webpack/rule-sets/rule-assets.d.ts +2 -2
  21. package/dist/create-webpack/rule-sets/rule-assets.js +1 -1
  22. package/dist/create-webpack/rule-sets/rule-css.js +1 -1
  23. package/dist/create-webpack/rule-sets/rule-scripts.d.ts +2 -0
  24. package/dist/create-webpack/rule-sets/rule-scripts.js +1 -1
  25. package/dist/create-webpack/types.d.ts +1 -1
  26. package/dist/default-options.js +1 -1
  27. package/dist/define-config/define-config.d.ts +2 -2
  28. package/dist/dev-server/add-compiler-to-dev-server.js +1 -1
  29. package/dist/dev-server/create-dev-server-compiler-task.d.ts +3 -0
  30. package/dist/dev-server/create-dev-server-compiler-task.js +1 -0
  31. package/dist/dev-server/create-dev-server-entries.d.ts +1 -1
  32. package/dist/dev-server/create-dev-server-entries.js +1 -1
  33. package/dist/dev-server/create-dev-server.js +1 -1
  34. package/dist/dev-server/index.d.ts +3 -3
  35. package/dist/dev-server/index.js +1 -1
  36. package/dist/dev-server/middlewares/get-bundle-asset.d.ts +1 -1
  37. package/dist/dev-server/middlewares/get-page-main-html.js +1 -1
  38. package/dist/dev-server/middlewares/get-page-module-html.js +1 -1
  39. package/dist/helpers/assert-group-entry-item.d.ts +7 -0
  40. package/dist/helpers/assert-group-entry-item.js +1 -0
  41. package/dist/helpers/assert-single-compiler.d.ts +15 -0
  42. package/dist/helpers/assert-single-compiler.js +1 -0
  43. package/dist/helpers/check-runtime-env.d.ts +4 -0
  44. package/dist/helpers/check-runtime-env.js +1 -0
  45. package/dist/helpers/custom-listr-renderer.d.ts +41 -0
  46. package/dist/helpers/custom-listr-renderer.js +1 -0
  47. package/dist/helpers/custom-message-channel.d.ts +17 -0
  48. package/dist/helpers/custom-message-channel.js +1 -0
  49. package/dist/helpers/delete-object-keys.d.ts +11 -0
  50. package/dist/helpers/delete-object-keys.js +1 -0
  51. package/dist/helpers/flat-entry-map.d.ts +8 -0
  52. package/dist/helpers/flat-entry-map.js +1 -0
  53. package/dist/helpers/format-spinner-text.d.ts +8 -0
  54. package/dist/helpers/format-spinner-text.js +1 -0
  55. package/dist/helpers/get-bundle-file-name.d.ts +1 -1
  56. package/dist/helpers/get-runtime-cdn-base.d.ts +2 -0
  57. package/dist/helpers/get-runtime-cdn-base.js +1 -0
  58. package/dist/helpers/get-stats-file-name.d.ts +2 -0
  59. package/dist/helpers/get-stats-file-name.js +1 -0
  60. package/dist/helpers/index.d.ts +18 -4
  61. package/dist/helpers/index.js +1 -1
  62. package/dist/helpers/is-deep-equal.d.ts +9 -0
  63. package/dist/helpers/is-deep-equal.js +1 -0
  64. package/dist/helpers/json-serializer.js +1 -1
  65. package/dist/helpers/merge-babel-options.d.ts +1 -1
  66. package/dist/helpers/merge-babel-options.js +1 -1
  67. package/dist/helpers/normalize-check-entry-options.d.ts +10 -0
  68. package/dist/helpers/normalize-check-entry-options.js +1 -0
  69. package/dist/helpers/normalize-entry-map.d.ts +1 -0
  70. package/dist/helpers/normalize-entry-map.js +1 -1
  71. package/dist/helpers/normalize-entry-module-absolute-path.d.ts +10 -0
  72. package/dist/helpers/normalize-entry-module-absolute-path.js +1 -0
  73. package/dist/helpers/normalize-group-name.d.ts +8 -0
  74. package/dist/helpers/normalize-group-name.js +1 -0
  75. package/dist/helpers/normalize-template-inject-tokens.d.ts +16 -0
  76. package/dist/helpers/normalize-template-inject-tokens.js +1 -0
  77. package/dist/helpers/open-page.js +1 -1
  78. package/dist/helpers/refresh-evolve-mock-options.js +1 -1
  79. package/dist/helpers/script-injects.d.ts +1 -1
  80. package/dist/helpers/split-to-entry-group.d.ts +52 -0
  81. package/dist/helpers/split-to-entry-group.js +1 -0
  82. package/dist/helpers/verify-group-entry-options.d.ts +9 -0
  83. package/dist/helpers/verify-group-entry-options.js +1 -0
  84. package/dist/index.d.ts +1 -1
  85. package/dist/index.js +1 -1
  86. package/dist/load-config/load-evolve-config.js +1 -1
  87. package/dist/loaders/loader-icon.cjs +2 -1
  88. package/dist/main/create-thread-worker.d.ts +29 -14
  89. package/dist/main/create-thread-worker.js +1 -1
  90. package/dist/main/index.d.ts +1 -1
  91. package/dist/main/index.js +1 -1
  92. package/dist/main/prepare-analyzer.d.ts +9 -0
  93. package/dist/main/prepare-analyzer.js +1 -0
  94. package/dist/main/prepare-build.d.ts +4 -3
  95. package/dist/main/prepare-build.js +1 -1
  96. package/dist/main/prepare-serve.d.ts +1 -1
  97. package/dist/main/prepare-serve.js +1 -1
  98. package/dist/main/start-analyzer.d.ts +10 -0
  99. package/dist/main/start-analyzer.js +1 -0
  100. package/dist/main/start-build-dynamic.d.ts +2 -2
  101. package/dist/main/start-build-dynamic.js +1 -1
  102. package/dist/main/start-build-worker.d.ts +17 -6
  103. package/dist/main/start-build-worker.js +1 -1
  104. package/dist/main/start-build.d.ts +3 -2
  105. package/dist/main/start-build.js +1 -1
  106. package/dist/main/start-group-entry-build.d.ts +15 -0
  107. package/dist/main/start-group-entry-build.js +1 -0
  108. package/dist/main/start-serve.d.ts +1 -1
  109. package/dist/main/start-serve.js +1 -1
  110. package/dist/minimizer/create-minimizers.js +1 -1
  111. package/dist/minimizer/image-minimizer.js +1 -1
  112. package/dist/minimizer/terser-minimizer.js +1 -1
  113. package/dist/plugins/circular-dependency/circular-dependency-plugin.js +1 -1
  114. package/dist/plugins/clean-webpack/index.d.ts +1 -1
  115. package/dist/plugins/clean-webpack/index.js +1 -1
  116. package/dist/plugins/define-variable/define-variable-plugin.js +1 -1
  117. package/dist/plugins/module-federation/module-federation.d.ts +1 -1
  118. package/dist/plugins/module-federation/module-federation.js +1 -1
  119. package/dist/plugins/multi-html/index.d.ts +1 -1
  120. package/dist/plugins/multi-html/index.js +1 -1
  121. package/dist/plugins/multi-html/multi-html-cdn-plugin.js +1 -1
  122. package/dist/plugins/multi-html/multi-html-plugin.d.ts +1 -1
  123. package/dist/plugins/multi-html/multi-html-plugin.js +1 -1
  124. package/dist/plugins/stats-webpack/helper-write-stats.d.ts +28 -0
  125. package/dist/plugins/stats-webpack/helper-write-stats.js +1 -0
  126. package/dist/plugins/stats-webpack/index.d.ts +12 -0
  127. package/dist/plugins/stats-webpack/index.js +1 -0
  128. package/dist/plugins/stats-webpack/stats-webpack-plugin.d.ts +25 -0
  129. package/dist/plugins/stats-webpack/stats-webpack-plugin.js +1 -0
  130. package/dist/plugins/ts-checker/ts-checker-guard-plugin.d.ts +13 -0
  131. package/dist/plugins/ts-checker/ts-checker-guard-plugin.js +1 -0
  132. package/dist/plugins/ts-checker/ts-checker-plugin.d.ts +1 -2
  133. package/dist/plugins/ts-checker/ts-checker-plugin.js +1 -1
  134. package/dist/types/index.d.ts +3 -1
  135. package/dist/types/index.js +1 -1
  136. package/dist/types/types-analyzer.d.ts +70 -0
  137. package/dist/types/types-analyzer.js +1 -0
  138. package/dist/types/types-cli-options.d.ts +12 -0
  139. package/dist/types/types-cli-options.js +1 -0
  140. package/dist/types/types-dev-server.d.ts +17 -6
  141. package/dist/types/types-entry-map.d.ts +19 -1
  142. package/dist/types/types-global-compiler-options.d.ts +7 -0
  143. package/dist/types/types-global-compiler-options.js +1 -0
  144. package/dist/types/types-loader-options.d.ts +31 -9
  145. package/dist/types/types-options.d.ts +30 -15
  146. package/dist/types/types-threads-options.d.ts +18 -0
  147. package/dist/types/types-threads-options.js +1 -0
  148. package/dist/types/types-webpack.d.ts +5 -2
  149. package/package.json +66 -64
  150. package/templates/html-plugin/index-ntv.html +61 -0
  151. package/dist/dev-server/create-dev-server-compiler-tasks.d.ts +0 -3
  152. package/dist/dev-server/create-dev-server-compiler-tasks.js +0 -1
  153. package/dist/helpers/assert-only-single-entry-item.d.ts +0 -7
  154. package/dist/helpers/assert-only-single-entry-item.js +0 -1
  155. package/dist/helpers/split-to-multi-compiler.d.ts +0 -8
  156. package/dist/helpers/split-to-multi-compiler.js +0 -1
  157. package/dist/main/start-one-entry-build.d.ts +0 -13
  158. package/dist/main/start-one-entry-build.js +0 -1
  159. package/dist/plugins/ts-checker/index.d.ts +0 -1
  160. package/dist/plugins/ts-checker/index.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flatjs/evolve",
3
- "version": "2.1.0-next.9",
3
+ "version": "2.1.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -18,90 +18,92 @@
18
18
  "./templates"
19
19
  ],
20
20
  "scripts": {
21
- "serve": "yarn node --import=@armit/path-alias/register ./tests/dev-server/dev-server.ts",
21
+ "serve": "yarn node --import=@hyperse/ts-node-paths/register ./tests/dev-server/dev-server.ts",
22
+ "analyzer": "yarn node --import=@hyperse/ts-node-paths/register ./tests/build-analyzer/start-analyzer.ts",
22
23
  "build": "rimraf dist && tsc -p ./tsconfig.build.json && npm run minify",
23
24
  "?build-release": "When https://github.com/atlassian/changesets/issues/432 has a solution we can remove this trick",
24
25
  "build-release": "yarn build && rimraf ./_release && yarn pack && mkdir ./_release && tar zxvf ./package.tgz --directory ./_release && rm ./package.tgz",
25
26
  "minify": "node ../../scripts/minify.mjs --dest=dist",
26
27
  "codegen": "graphql-codegen --config ./codegen.cjs",
27
28
  "clean": "rimraf --no-glob ./dist ./coverage ./__data__ ./config/__data__ ./_release ./tsconfig.tsbuildinfo",
28
- "lint": "eslint . --ext .ts,.mts,.tsx,.js,.jsx,.cjs,.mjs --cache --cache-location ../../.cache/eslint/evolve.eslintcache",
29
+ "lint": "eslint . --cache --cache-location ../../.cache/eslint/evolve.eslintcache",
29
30
  "test": "run-s test-unit",
30
31
  "test-task": "vitest run",
31
32
  "test-unit": "vitest run --passWithNoTests",
32
33
  "test-watch": "vitest watch --ui",
33
- "fix-all-files": "eslint . --ext .ts,.tsx,.js,.jsx,.cjs,.mjs,.mdx,.graphql --fix",
34
+ "fix-all-files": "eslint . --fix",
34
35
  "typecheck": "tsc --project ./tsconfig.json --noEmit"
35
36
  },
36
37
  "dependencies": {
37
- "@armit/babel-merge": "^0.1.5",
38
- "@armit/config-loader": "^0.1.7",
39
- "@armit/file-utility": "^0.1.4",
40
- "@armit/git": "^0.1.4",
41
- "@armit/package": "^0.1.5",
42
- "@armit/worker-threads": "^0.1.4",
43
- "@babel/core": "7.24.3",
44
- "@flatjs/babel-plugin-import": "2.1.0-next.4",
45
- "@flatjs/common": "2.1.0-next.3",
46
- "@flatjs/evolve-preset-babel": "2.1.0-next.3",
47
- "@flatjs/forge-postcss-plugin-pixel": "2.1.0-next.3",
48
- "@flatjs/graph": "2.1.0-next.5",
49
- "@flatjs/mock": "2.1.0-next.5",
50
- "@pmmmwh/react-refresh-webpack-plugin": "0.5.11",
51
- "@types/babel__core": "7.20.5",
52
- "babel-loader": "9.1.3",
53
- "better-opn": "3.0.2",
54
- "case-sensitive-paths-webpack-plugin": "2.4.0",
55
- "css-loader": "6.10.0",
56
- "cssnano": "6.1.2",
57
- "express": "4.19.2",
58
- "fork-ts-checker-webpack-plugin": "9.0.2",
59
- "happy-dom": "14.3.10",
60
- "html-webpack-plugin": "5.6.0",
61
- "image-minimizer-webpack-plugin": "4.0.0",
62
- "less": "4.2.0",
63
- "less-loader": "12.2.0",
64
- "listr": "0.14.3",
65
- "lodash": "4.17.21",
66
- "mini-css-extract-plugin": "2.8.1",
67
- "postcss": "8.4.38",
68
- "postcss-loader": "8.1.1",
69
- "react-refresh": "0.14.0",
70
- "svgo": "3.2.0",
71
- "tarjan-graph": "3.0.0",
72
- "terser-webpack-plugin": "5.3.10",
73
- "tsconfig-paths-webpack-plugin": "4.1.0",
74
- "type-fest": "^4.14.0",
75
- "typescript": "5.4.3",
76
- "webpack": "5.91.0",
77
- "webpack-bundle-analyzer": "4.10.1",
78
- "webpack-dev-server": "5.0.4",
79
- "webpack-sources": "3.2.3"
38
+ "@armit/babel-merge": "^0.2.4",
39
+ "@armit/config-loader": "^0.2.7",
40
+ "@armit/file-utility": "^0.2.4",
41
+ "@armit/git": "^0.2.4",
42
+ "@armit/package": "^0.2.7",
43
+ "@babel/core": "^7.24.9",
44
+ "@clack/prompts": "^0.7.0",
45
+ "@discoveryjs/json-ext": "0.6.0",
46
+ "@flatjs/babel-plugin-import": "2.1.0",
47
+ "@flatjs/common": "2.1.0",
48
+ "@flatjs/evolve-preset-babel": "2.1.0",
49
+ "@flatjs/forge-postcss-plugin-pixel": "2.1.0",
50
+ "@flatjs/graph": "2.1.0",
51
+ "@flatjs/mock": "2.1.0",
52
+ "@pmmmwh/react-refresh-webpack-plugin": "^0.5.15",
53
+ "@types/babel__core": "^7.20.5",
54
+ "babel-loader": "^9.1.3",
55
+ "better-opn": "^3.0.2",
56
+ "case-sensitive-paths-webpack-plugin": "^2.4.0",
57
+ "ci-info": "^4.0.0",
58
+ "css-loader": "^7.1.2",
59
+ "cssnano": "^7.0.4",
60
+ "express": "^4.19.2",
61
+ "fork-ts-checker-webpack-plugin": "^9.0.2",
62
+ "happy-dom": "^14.12.3",
63
+ "html-webpack-plugin": "^5.6.0",
64
+ "image-minimizer-webpack-plugin": "^4.0.2",
65
+ "less": "^4.2.0",
66
+ "less-loader": "^12.2.0",
67
+ "listr": "^0.14.3",
68
+ "lodash": "^4.17.21",
69
+ "log-update": "^6.0.0",
70
+ "mini-css-extract-plugin": "^2.9.0",
71
+ "postcss": "^8.4.39",
72
+ "postcss-loader": "^8.1.1",
73
+ "react-refresh": "^0.14.2",
74
+ "svgo": "^3.3.2",
75
+ "tarjan-graph": "^3.0.0",
76
+ "terser-webpack-plugin": "^5.3.10",
77
+ "tinypool": "^1.0.0",
78
+ "tsconfig-paths-webpack-plugin": "^4.1.0",
79
+ "type-fest": "^4.23.0",
80
+ "typescript": "^5.5.4",
81
+ "webpack": "^5.93.0",
82
+ "webpack-bundle-analyzer": "^4.10.2",
83
+ "webpack-dev-server": "^5.0.4",
84
+ "webpack-sources": "^3.2.3"
80
85
  },
81
86
  "devDependencies": {
82
- "@armit/eslint-config-bases": "^0.1.5",
83
- "@dimjs/model-react": "1.2.3",
84
- "@flatjs/testing": "2.1.0-next.3",
85
- "@swc/core": "1.4.11",
87
+ "@dimjs/lang": "2.0.0",
88
+ "@dimjs/model": "2.0.0",
89
+ "@dimjs/model-react": "2.0.0",
90
+ "@dimjs/utils": "2.0.0",
91
+ "@flatjs/testing": "2.1.0",
92
+ "@hyperse/eslint-config-hyperse": "^1.0.10",
93
+ "@swc/core": "1.7.1",
86
94
  "@types/express": "4.17.21",
87
95
  "@types/listr": "0.14.9",
88
- "@types/node": "20.12.2",
89
- "@vitest/coverage-istanbul": "1.4.0",
90
- "@vitest/ui": "1.4.0",
91
- "@wove/react": "1.2.23",
92
- "eslint": "8.57.0",
96
+ "@types/node": "20.14.12",
97
+ "eslint": "^9.7.0",
93
98
  "imagemin-gifsicle": "7.0.0",
94
99
  "imagemin-jpegtran": "7.0.0",
95
- "imagemin-pngquant": "9.0.2",
96
- "imagemin-svgo": "10.0.1",
100
+ "imagemin-pngquant": "10.0.0",
101
+ "imagemin-svgo": "11.0.1",
97
102
  "npm-run-all": "4.1.5",
98
- "prettier": "3.2.5",
99
- "react": "18.2.0",
100
- "rimraf": "5.0.5",
101
- "swc-unplugin-ts": "1.0.3",
102
- "ts-node": "11.0.0-beta.1",
103
+ "react": "18.3.1",
104
+ "rimraf": "6.0.1",
103
105
  "vite-tsconfig-paths": "4.3.2",
104
- "vitest": "1.4.0",
106
+ "vitest": "2.0.4",
105
107
  "vue-loader": "17.4.2"
106
108
  },
107
109
  "peerDependencies": {
@@ -0,0 +1,61 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
6
+ <meta http-equiv="Expires" content="0" />
7
+ <meta http-equiv="Pragma" content="no-cache" />
8
+ <meta http-equiv="Cache-control" content="no-cache" />
9
+ <meta http-equiv="Cache" content="no-cache" />
10
+ <meta name="format-detection" content="telephone=no,email=no" />
11
+ <meta name="apple-mobile-web-app-capable" content="yes" />
12
+ <meta name="apple-touch-fullscreen" content="yes" />
13
+ <meta name="apple-mobile-web-app-status-bar-style" content="black" />
14
+ <meta
15
+ name="viewport"
16
+ content="width=device-width,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, viewport-fit=cover"
17
+ />
18
+ <title><%= title %></title>
19
+
20
+ <% if (headBeforeHtmlTags) { %>
21
+ <% for (let index = 0; index < headBeforeHtmlTags.length; index++) { %>
22
+ <%= headBeforeHtmlTags[index] %>
23
+ <% } %>
24
+ <% } %>
25
+ <% if (inlineScripts) { %>
26
+ <script>
27
+ <% for (let index = 0; index < inlineScripts.length; index++) { %>
28
+ <%= inlineScripts[index] %>
29
+ <% } %>
30
+ </script>
31
+ <% } %>
32
+ <% if (viewport) { %>
33
+ <script>
34
+ <%= viewport %>
35
+ </script>
36
+ <% } %>
37
+ <% if (favicon) { %>
38
+ <link rel="shortcut icon" href="<%= favicon %>" type="image/x-icon" />
39
+ <link rel="icon" href="<%= favicon %>" type="image/x-icon" />
40
+ <% } %>
41
+ <% if (headBeforeStyles) { %>
42
+ <% for (let index = 0; index < headBeforeStyles.length; index++) { %>
43
+ <link href="<%= headBeforeStyles[index] %>" rel="stylesheet" />
44
+ <% } %>
45
+ <% } %>
46
+ <% if (headBeforeScripts) { %>
47
+ <% for (let index = 0; index < headBeforeScripts.length; index++) { %>
48
+ <script src="<%= headBeforeScripts[index]%>"></script>
49
+ <% } %>
50
+ <% } %>
51
+ </head>
52
+
53
+ <body>
54
+ <div id="app"></div>
55
+ <% if (bodyAfterScripts) { %>
56
+ <% for (let index = 0; index < bodyAfterScripts.length; index++) { %>
57
+ <script src="<%= bodyAfterScripts[index]%>"></script>
58
+ <% } %>
59
+ <% } %>
60
+ </body>
61
+ </html>
@@ -1,3 +0,0 @@
1
- import { type FlatEvolveOptions } from '../types/types-options.js';
2
- import { type EvolveDevServerEntryMap } from './middlewares/types.js';
3
- export declare const createDevServerCompilerTasks: (projectCwd: string, mainPage: string, publicIp: string, servedDevServerEntries: EvolveDevServerEntryMap, evolveOptions: FlatEvolveOptions) => Promise<Promise<boolean>[]>;
@@ -1 +0,0 @@
1
- import{relative}from"node:path";import{chalk,logger,mergeOptions,urlJoin}from"@flatjs/common";import webpack from"webpack";import{loadWebpackConfig}from"../create-webpack/load-webpack-config.js";import{shouldEnableReactFastRefresh}from"../helpers/should-enable-react-fast-refresh.js";import{splitToMultiCompilerConfigs}from"../helpers/split-to-multi-compiler.js";import{addCompilerToDevServer}from"./add-compiler-to-dev-server.js";export const createDevServerCompilerTasks=async(e,o,r,t,i)=>{const a=[];for(const[n,l]of Object.entries(t)){const s=l.entryConfig,p=s.options?.moduleFederation;(p?.remotes||[]).forEach((e=>{e.endpoint=e=>{const o=t[e];if(!o)throw new Error(`No servedDevServerEntry found via "${e}"`);return urlJoin(o?.devServerHostUri,["/public"])}}));const{devServerPort:c,devServerHostUri:m}=t[n],f={[n]:s},d=urlJoin(m,["public"]),v=await loadWebpackConfig("development",f,mergeOptions(i,{webpack:{publicPath:d}})),h=shouldEnableReactFastRefresh(!0,[n,s],i),g=webpack(splitToMultiCompilerConfigs(f,v,i,h)[0]);a.push(addCompilerToDevServer(g,h,c,r,i));const u=g.name||"";g.hooks.invalid.tap("fileChange",(o=>{const r=relative(e,o||"");logger.info(`file change ➩ ${chalk(["cyan"])(r)}`,u)})),g.hooks.done.tap("compileDone",(()=>{logger.info(`debug page ➩ ${chalk(["cyan"])(o)}`,u)}))}return a};
@@ -1,7 +0,0 @@
1
- import { type EntryMapItem, type EvolveEntryMap } from '../types/types-entry-map.js';
2
- import { type FlatEvolveOptions } from '../types/types-options.js';
3
- /**
4
- * Only fetch single one entry map once `serve`,`build` recycle.
5
- * @returns
6
- */
7
- export declare const assertOnlySingleEntryItem: (entryMap: EvolveEntryMap, evolveOptions: FlatEvolveOptions) => EntryMapItem;
@@ -1 +0,0 @@
1
- import{normalizeEvolveEntryName}from"./normalize-entry-map.js";export const assertOnlySingleEntryItem=(e,r)=>{if(Object.keys(e).length>1)throw new Error("Only single one entry map support right now for `serve`, `build`!");let t;for(const[r,o]of Object.entries(e)){t=[r,o];break}if(!t)throw new Error('No entry map found while "serve", "build" process!');const[o,n]=t;return[normalizeEvolveEntryName(o,r.projectVirtualPath),n]};
@@ -1,8 +0,0 @@
1
- import { type Configuration } from 'webpack';
2
- import { type EvolveEntryMap } from '../types/types-entry-map.js';
3
- import { type FlatEvolveOptions } from '../types/types-options.js';
4
- /**
5
- * Split the `webpack` to make sure that we have separated compiler process for each module
6
- * @param webpackConfig `Omit<Configuration, 'entry'>` webpack final configuration
7
- */
8
- export declare function splitToMultiCompilerConfigs(servedEntries: EvolveEntryMap, webpackConfig: Omit<Configuration, 'entry'>, evolveOptions: FlatEvolveOptions, enabledHmr?: boolean): Configuration[];
@@ -1 +0,0 @@
1
- import{dirname,join}from"path";import{searchPackageDir}from"@armit/package";import{mergeOptions,requireResolve}from"@flatjs/common";import{devReactFastRefresh}from"../constants.js";import{normalizeEvolveEntryName}from"./normalize-entry-map.js";export function splitToMultiCompilerConfigs(e,r,t,o=!1){const a=[];for(const[r,o]of Object.entries(e)){const e=normalizeEvolveEntryName(r,t.projectVirtualPath);a.push({[e]:o.entry})}return a.map((e=>{const t=Object.keys(e)[0];if(o){const r=join(t,devReactFastRefresh.reactRefreshSetup),o=requireResolve(import.meta.url,"@pmmmwh/react-refresh-webpack-plugin"),a=searchPackageDir({cwd:dirname(o)});if(!a)throw new Error("react-refresh-webpack-plugin package directory not found");e[r]=[join(a,"/client/ReactRefreshEntry.js")]}return mergeOptions(r,{name:t,entry:e})}))}
@@ -1,13 +0,0 @@
1
- import { type EvolveEntryMap } from '../types/types-entry-map.js';
2
- import { type FlatEvolveOptions } from '../types/types-options.js';
3
- export type EvolveBuildResult = {
4
- name?: string;
5
- warningStats?: unknown;
6
- };
7
- /**
8
- * The helpers to build one entry at a time
9
- * @param singleBuildEntry The single entry
10
- * @param buildPublicPath
11
- * @param evolveOptions
12
- */
13
- export declare const startOneEntryBuild: (singleBuildEntry: EvolveEntryMap, evolveOptions: FlatEvolveOptions) => Promise<EvolveBuildResult>;
@@ -1 +0,0 @@
1
- import webpack from"webpack";import{loadWebpackConfig}from"../create-webpack/load-webpack-config.js";import{splitToMultiCompilerConfigs}from"../helpers/split-to-multi-compiler.js";export const startOneEntryBuild=async(r,o)=>{const t=await loadWebpackConfig("production",r,o),n=splitToMultiCompilerConfigs(r,t,o,!1);if(n.length>1)throw new Error("startOneEntryBuild() only support `compiler` at a time");const e=n[0];return new Promise(((r,t)=>{webpack(e,((n,i)=>{if(n)return t(n);const a=i?.toJson();return a?.errors?.length?t(a.errors):o.rejectWarnings&&a?.warnings?.length?t(a.warnings):void r({name:e.name,warningStats:a?.warnings})}))}))};
@@ -1 +0,0 @@
1
- export * from './ts-checker-plugin.js';
@@ -1 +0,0 @@
1
- export*from"./ts-checker-plugin.js";