@flatjs/evolve 2.1.0-next.3 → 2.1.0-next.31

Sign up to get free protection for your applications and to get access to all the features.
Files changed (169) 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/should-enable-react-fast-refresh.js +1 -1
  81. package/dist/helpers/split-to-entry-group.d.ts +52 -0
  82. package/dist/helpers/split-to-entry-group.js +1 -0
  83. package/dist/helpers/verify-group-entry-options.d.ts +9 -0
  84. package/dist/helpers/verify-group-entry-options.js +1 -0
  85. package/dist/index.d.ts +1 -1
  86. package/dist/index.js +1 -1
  87. package/dist/load-config/load-evolve-config.js +1 -1
  88. package/dist/loaders/loader-icon.cjs +2 -1
  89. package/dist/main/create-thread-worker.d.ts +29 -14
  90. package/dist/main/create-thread-worker.js +1 -1
  91. package/dist/main/index.d.ts +1 -1
  92. package/dist/main/index.js +1 -1
  93. package/dist/main/prepare-analyzer.d.ts +9 -0
  94. package/dist/main/prepare-analyzer.js +1 -0
  95. package/dist/main/prepare-build.d.ts +4 -3
  96. package/dist/main/prepare-build.js +1 -1
  97. package/dist/main/prepare-serve.d.ts +1 -1
  98. package/dist/main/prepare-serve.js +1 -1
  99. package/dist/main/start-analyzer.d.ts +10 -0
  100. package/dist/main/start-analyzer.js +1 -0
  101. package/dist/main/start-build-dynamic.d.ts +2 -2
  102. package/dist/main/start-build-dynamic.js +1 -1
  103. package/dist/main/start-build-worker.d.ts +17 -6
  104. package/dist/main/start-build-worker.js +1 -1
  105. package/dist/main/start-build.d.ts +3 -2
  106. package/dist/main/start-build.js +1 -1
  107. package/dist/main/start-group-entry-build.d.ts +15 -0
  108. package/dist/main/start-group-entry-build.js +1 -0
  109. package/dist/main/start-serve.d.ts +1 -1
  110. package/dist/main/start-serve.js +1 -1
  111. package/dist/minimizer/create-minimizers.js +1 -1
  112. package/dist/minimizer/image-minimizer.js +1 -1
  113. package/dist/minimizer/terser-minimizer.js +1 -1
  114. package/dist/plugins/circular-dependency/circular-dependency-plugin.js +1 -1
  115. package/dist/plugins/clean-webpack/index.d.ts +1 -1
  116. package/dist/plugins/clean-webpack/index.js +1 -1
  117. package/dist/plugins/define-variable/define-variable-plugin.js +1 -1
  118. package/dist/plugins/module-federation/module-federation.d.ts +1 -1
  119. package/dist/plugins/module-federation/module-federation.js +1 -1
  120. package/dist/plugins/multi-html/index.d.ts +1 -1
  121. package/dist/plugins/multi-html/index.js +1 -1
  122. package/dist/plugins/multi-html/multi-html-cdn-plugin.js +1 -1
  123. package/dist/plugins/multi-html/multi-html-plugin.d.ts +1 -1
  124. package/dist/plugins/multi-html/multi-html-plugin.js +1 -1
  125. package/dist/plugins/stats-webpack/helper-write-stats.d.ts +28 -0
  126. package/dist/plugins/stats-webpack/helper-write-stats.js +1 -0
  127. package/dist/plugins/stats-webpack/index.d.ts +12 -0
  128. package/dist/plugins/stats-webpack/index.js +1 -0
  129. package/dist/plugins/stats-webpack/stats-webpack-plugin.d.ts +25 -0
  130. package/dist/plugins/stats-webpack/stats-webpack-plugin.js +1 -0
  131. package/dist/plugins/ts-checker/ts-checker-guard-plugin.d.ts +13 -0
  132. package/dist/plugins/ts-checker/ts-checker-guard-plugin.js +1 -0
  133. package/dist/plugins/ts-checker/ts-checker-plugin.d.ts +3 -0
  134. package/dist/plugins/ts-checker/ts-checker-plugin.js +1 -0
  135. package/dist/types/index.d.ts +3 -1
  136. package/dist/types/index.js +1 -1
  137. package/dist/types/types-analyzer.d.ts +70 -0
  138. package/dist/types/types-analyzer.js +1 -0
  139. package/dist/types/types-cli-options.d.ts +12 -0
  140. package/dist/types/types-cli-options.js +1 -0
  141. package/dist/types/types-dev-server.d.ts +17 -6
  142. package/dist/types/types-entry-map.d.ts +21 -3
  143. package/dist/types/types-global-compiler-options.d.ts +7 -0
  144. package/dist/types/types-global-compiler-options.js +1 -0
  145. package/dist/types/types-loader-options.d.ts +31 -9
  146. package/dist/types/types-options.d.ts +30 -15
  147. package/dist/types/types-threads-options.d.ts +18 -0
  148. package/dist/types/types-threads-options.js +1 -0
  149. package/dist/types/types-webpack.d.ts +5 -2
  150. package/package.json +69 -61
  151. package/templates/html-plugin/index-dev.html +2 -2
  152. package/templates/html-plugin/index-inte.html +2 -2
  153. package/templates/html-plugin/index-inte2.html +2 -2
  154. package/templates/html-plugin/index-inte3.html +2 -2
  155. package/templates/html-plugin/index-inte4.html +2 -2
  156. package/templates/html-plugin/index-me.html +2 -2
  157. package/templates/html-plugin/index-ntv.html +61 -0
  158. package/templates/html-plugin/index-prod.html +2 -2
  159. package/templates/html-plugin/index-rc.html +2 -2
  160. package/templates/html-plugin/index-uat.html +2 -2
  161. package/templates/module.html +2 -2
  162. package/dist/dev-server/create-dev-server-compiler-tasks.d.ts +0 -3
  163. package/dist/dev-server/create-dev-server-compiler-tasks.js +0 -1
  164. package/dist/helpers/assert-only-single-entry-item.d.ts +0 -7
  165. package/dist/helpers/assert-only-single-entry-item.js +0 -1
  166. package/dist/helpers/split-to-multi-compiler.d.ts +0 -8
  167. package/dist/helpers/split-to-multi-compiler.js +0 -1
  168. package/dist/main/start-one-entry-build.d.ts +0 -13
  169. package/dist/main/start-one-entry-build.js +0 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flatjs/evolve",
3
- "version": "2.1.0-next.3",
3
+ "version": "2.1.0-next.31",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "exports": {
@@ -18,88 +18,96 @@
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.6",
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.2",
45
- "@flatjs/common": "2.1.0-next.2",
46
- "@flatjs/evolve-preset-babel": "2.1.0-next.2",
47
- "@flatjs/forge-postcss-plugin-pixel": "2.1.0-next.2",
48
- "@flatjs/graph": "2.1.0-next.3",
49
- "@flatjs/mock": "2.1.0-next.3",
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.3",
39
+ "@armit/config-loader": "^0.2.5",
40
+ "@armit/file-utility": "^0.2.3",
41
+ "@armit/git": "^0.2.3",
42
+ "@armit/package": "^0.2.5",
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-next.10",
47
+ "@flatjs/common": "2.1.0-next.9",
48
+ "@flatjs/evolve-preset-babel": "2.1.0-next.12",
49
+ "@flatjs/forge-postcss-plugin-pixel": "2.1.0-next.9",
50
+ "@flatjs/graph": "2.1.0-next.13",
51
+ "@flatjs/mock": "2.1.0-next.14",
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.22.0",
80
+ "typescript": "^5.5.3",
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
- "@flatjs/testing": "2.1.0-next.2",
84
- "@swc/core": "1.4.11",
87
+ "@dimjs/lang": "1.5.0",
88
+ "@dimjs/model": "1.2.3",
89
+ "@dimjs/model-react": "1.2.3",
90
+ "@dimjs/utils": "1.5.1",
91
+ "@flatjs/testing": "2.1.0-next.10",
92
+ "@hyperse/eslint-config-hyperse": "^1.0.10",
93
+ "@swc/core": "1.6.13",
85
94
  "@types/express": "4.17.21",
86
95
  "@types/listr": "0.14.9",
87
- "@types/node": "20.12.2",
88
- "@vitest/coverage-istanbul": "1.4.0",
89
- "@vitest/ui": "1.4.0",
90
- "eslint": "8.57.0",
96
+ "@types/node": "20.14.11",
97
+ "@vitest/coverage-istanbul": "2.0.3",
98
+ "@vitest/ui": "2.0.3",
99
+ "@wove/react": "1.2.23",
100
+ "eslint": "^9.7.0",
91
101
  "imagemin-gifsicle": "7.0.0",
92
102
  "imagemin-jpegtran": "7.0.0",
93
- "imagemin-pngquant": "9.0.2",
94
- "imagemin-svgo": "10.0.1",
103
+ "imagemin-pngquant": "10.0.0",
104
+ "imagemin-svgo": "11.0.1",
95
105
  "npm-run-all": "4.1.5",
96
- "prettier": "3.2.5",
97
- "react": "18.2.0",
98
- "rimraf": "5.0.5",
106
+ "react": "18.3.1",
107
+ "rimraf": "6.0.1",
99
108
  "swc-unplugin-ts": "1.0.3",
100
- "ts-node": "11.0.0-beta.1",
101
109
  "vite-tsconfig-paths": "4.3.2",
102
- "vitest": "1.4.0",
110
+ "vitest": "2.0.3",
103
111
  "vue-loader": "17.4.2"
104
112
  },
105
113
  "peerDependencies": {
@@ -45,7 +45,7 @@
45
45
  <% } %>
46
46
  <% if (headBeforeScripts) { %>
47
47
  <% for (let index = 0; index < headBeforeScripts.length; index++) { %>
48
- <script crossorigin="anonymous" src="<%= headBeforeScripts[index]%>"></script>
48
+ <script src="<%= headBeforeScripts[index]%>"></script>
49
49
  <% } %>
50
50
  <% } %>
51
51
  </head>
@@ -54,7 +54,7 @@
54
54
  <div id="app"></div>
55
55
  <% if (bodyAfterScripts) { %>
56
56
  <% for (let index = 0; index < bodyAfterScripts.length; index++) { %>
57
- <script crossorigin="anonymous" src="<%= bodyAfterScripts[index]%>"></script>
57
+ <script src="<%= bodyAfterScripts[index]%>"></script>
58
58
  <% } %>
59
59
  <% } %>
60
60
  </body>
@@ -45,7 +45,7 @@
45
45
  <% } %>
46
46
  <% if (headBeforeScripts) { %>
47
47
  <% for (let index = 0; index < headBeforeScripts.length; index++) { %>
48
- <script crossorigin="anonymous" src="<%= headBeforeScripts[index]%>"></script>
48
+ <script src="<%= headBeforeScripts[index]%>"></script>
49
49
  <% } %>
50
50
  <% } %>
51
51
  </head>
@@ -54,7 +54,7 @@
54
54
  <div id="app"></div>
55
55
  <% if (bodyAfterScripts) { %>
56
56
  <% for (let index = 0; index < bodyAfterScripts.length; index++) { %>
57
- <script crossorigin="anonymous" src="<%= bodyAfterScripts[index]%>"></script>
57
+ <script src="<%= bodyAfterScripts[index]%>"></script>
58
58
  <% } %>
59
59
  <% } %>
60
60
  </body>
@@ -45,7 +45,7 @@
45
45
  <% } %>
46
46
  <% if (headBeforeScripts) { %>
47
47
  <% for (let index = 0; index < headBeforeScripts.length; index++) { %>
48
- <script crossorigin="anonymous" src="<%= headBeforeScripts[index]%>"></script>
48
+ <script src="<%= headBeforeScripts[index]%>"></script>
49
49
  <% } %>
50
50
  <% } %>
51
51
  </head>
@@ -54,7 +54,7 @@
54
54
  <div id="app"></div>
55
55
  <% if (bodyAfterScripts) { %>
56
56
  <% for (let index = 0; index < bodyAfterScripts.length; index++) { %>
57
- <script crossorigin="anonymous" src="<%= bodyAfterScripts[index]%>"></script>
57
+ <script src="<%= bodyAfterScripts[index]%>"></script>
58
58
  <% } %>
59
59
  <% } %>
60
60
  </body>
@@ -45,7 +45,7 @@
45
45
  <% } %>
46
46
  <% if (headBeforeScripts) { %>
47
47
  <% for (let index = 0; index < headBeforeScripts.length; index++) { %>
48
- <script crossorigin="anonymous" src="<%= headBeforeScripts[index]%>"></script>
48
+ <script src="<%= headBeforeScripts[index]%>"></script>
49
49
  <% } %>
50
50
  <% } %>
51
51
  </head>
@@ -54,7 +54,7 @@
54
54
  <div id="app"></div>
55
55
  <% if (bodyAfterScripts) { %>
56
56
  <% for (let index = 0; index < bodyAfterScripts.length; index++) { %>
57
- <script crossorigin="anonymous" src="<%= bodyAfterScripts[index]%>"></script>
57
+ <script src="<%= bodyAfterScripts[index]%>"></script>
58
58
  <% } %>
59
59
  <% } %>
60
60
  </body>
@@ -45,7 +45,7 @@
45
45
  <% } %>
46
46
  <% if (headBeforeScripts) { %>
47
47
  <% for (let index = 0; index < headBeforeScripts.length; index++) { %>
48
- <script crossorigin="anonymous" src="<%= headBeforeScripts[index]%>"></script>
48
+ <script src="<%= headBeforeScripts[index]%>"></script>
49
49
  <% } %>
50
50
  <% } %>
51
51
  </head>
@@ -54,7 +54,7 @@
54
54
  <div id="app"></div>
55
55
  <% if (bodyAfterScripts) { %>
56
56
  <% for (let index = 0; index < bodyAfterScripts.length; index++) { %>
57
- <script crossorigin="anonymous" src="<%= bodyAfterScripts[index]%>"></script>
57
+ <script src="<%= bodyAfterScripts[index]%>"></script>
58
58
  <% } %>
59
59
  <% } %>
60
60
  </body>
@@ -45,7 +45,7 @@
45
45
  <% } %>
46
46
  <% if (headBeforeScripts) { %>
47
47
  <% for (let index = 0; index < headBeforeScripts.length; index++) { %>
48
- <script crossorigin="anonymous" src="<%= headBeforeScripts[index]%>"></script>
48
+ <script src="<%= headBeforeScripts[index]%>"></script>
49
49
  <% } %>
50
50
  <% } %>
51
51
  </head>
@@ -54,7 +54,7 @@
54
54
  <div id="app"></div>
55
55
  <% if (bodyAfterScripts) { %>
56
56
  <% for (let index = 0; index < bodyAfterScripts.length; index++) { %>
57
- <script crossorigin="anonymous" src="<%= bodyAfterScripts[index]%>"></script>
57
+ <script src="<%= bodyAfterScripts[index]%>"></script>
58
58
  <% } %>
59
59
  <% } %>
60
60
  </body>
@@ -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>
@@ -45,7 +45,7 @@
45
45
  <% } %>
46
46
  <% if (headBeforeScripts) { %>
47
47
  <% for (let index = 0; index < headBeforeScripts.length; index++) { %>
48
- <script crossorigin="anonymous" src="<%= headBeforeScripts[index]%>"></script>
48
+ <script src="<%= headBeforeScripts[index]%>"></script>
49
49
  <% } %>
50
50
  <% } %>
51
51
  </head>
@@ -54,7 +54,7 @@
54
54
  <div id="app"></div>
55
55
  <% if (bodyAfterScripts) { %>
56
56
  <% for (let index = 0; index < bodyAfterScripts.length; index++) { %>
57
- <script crossorigin="anonymous" src="<%= bodyAfterScripts[index]%>"></script>
57
+ <script src="<%= bodyAfterScripts[index]%>"></script>
58
58
  <% } %>
59
59
  <% } %>
60
60
  </body>
@@ -45,7 +45,7 @@
45
45
  <% } %>
46
46
  <% if (headBeforeScripts) { %>
47
47
  <% for (let index = 0; index < headBeforeScripts.length; index++) { %>
48
- <script crossorigin="anonymous" src="<%= headBeforeScripts[index]%>"></script>
48
+ <script src="<%= headBeforeScripts[index]%>"></script>
49
49
  <% } %>
50
50
  <% } %>
51
51
  </head>
@@ -54,7 +54,7 @@
54
54
  <div id="app"></div>
55
55
  <% if (bodyAfterScripts) { %>
56
56
  <% for (let index = 0; index < bodyAfterScripts.length; index++) { %>
57
- <script crossorigin="anonymous" src="<%= bodyAfterScripts[index]%>"></script>
57
+ <script src="<%= bodyAfterScripts[index]%>"></script>
58
58
  <% } %>
59
59
  <% } %>
60
60
  </body>
@@ -45,7 +45,7 @@
45
45
  <% } %>
46
46
  <% if (headBeforeScripts) { %>
47
47
  <% for (let index = 0; index < headBeforeScripts.length; index++) { %>
48
- <script crossorigin="anonymous" src="<%= headBeforeScripts[index]%>"></script>
48
+ <script src="<%= headBeforeScripts[index]%>"></script>
49
49
  <% } %>
50
50
  <% } %>
51
51
  </head>
@@ -54,7 +54,7 @@
54
54
  <div id="app"></div>
55
55
  <% if (bodyAfterScripts) { %>
56
56
  <% for (let index = 0; index < bodyAfterScripts.length; index++) { %>
57
- <script crossorigin="anonymous" src="<%= bodyAfterScripts[index]%>"></script>
57
+ <script src="<%= bodyAfterScripts[index]%>"></script>
58
58
  <% } %>
59
59
  <% } %>
60
60
  </body>
@@ -56,7 +56,7 @@
56
56
 
57
57
  <% if (headBeforeScripts) { %>
58
58
  <% for (let index = 0; index < headBeforeScripts.length; index++) { %>
59
- <script crossorigin="anonymous" src="<%= headBeforeScripts[index]%>"></script>
59
+ <script src="<%= headBeforeScripts[index]%>"></script>
60
60
  <% } %>
61
61
  <% } %>
62
62
  </head>
@@ -75,7 +75,7 @@
75
75
  <% } %>
76
76
  <% if (bodyAfterScripts) { %>
77
77
  <% for (let index = 0; index < bodyAfterScripts.length; index++) { %>
78
- <script crossorigin="anonymous" src="<%= bodyAfterScripts[index]%>"></script>
78
+ <script src="<%= bodyAfterScripts[index]%>"></script>
79
79
  <% } %>
80
80
  <% } %>
81
81
  </body>
@@ -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{join}from"path";import{mergeOptions}from"@flatjs/common";import{devReactFastRefresh}from"../constants.js";import{normalizeEvolveEntryName}from"./normalize-entry-map.js";export function splitToMultiCompilerConfigs(e,t,r,o=!1){const n=[];for(const[t,o]of Object.entries(e)){const e=normalizeEvolveEntryName(t,r.projectVirtualPath);n.push({[e]:o.entry})}return n.map((e=>{const r=Object.keys(e)[0];if(o){e[join(r,devReactFastRefresh.reactRefreshSetup)]=["@pmmmwh/react-refresh-webpack-plugin/client/ReactRefreshEntry.js"]}return mergeOptions(t,{name:r,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})}))}))};