@bleedingdev/modern-js-app-tools 3.8.3-ultramodern.1 → 3.8.3-ultramodern.3

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 (238) hide show
  1. package/bin/modern-bundle-docs.js +11 -0
  2. package/bin/modern.js +11 -0
  3. package/dist/cjs/builder/generator/getBuilderEnvironments.js +13 -241
  4. package/dist/cjs/builder/generator/index.js +0 -1
  5. package/dist/cjs/builder/shared/builderPlugins/adapterSSR.js +37 -9
  6. package/dist/cjs/builder/shared/builderPlugins/index.js +6 -13
  7. package/dist/cjs/builder/shared/bundlerPlugins/index.js +6 -13
  8. package/dist/cjs/builder/shared/lazyCompilation.js +9 -9
  9. package/dist/cjs/bundleDocs.js +1 -1
  10. package/dist/cjs/index.js +59 -60
  11. package/dist/cjs/plugins/analyze/getServerRoutes.js +1 -1
  12. package/dist/cjs/plugins/analyze/isDefaultExportFunction.js +1 -9
  13. package/dist/cjs/plugins/backend-federation/codegen.js +2 -1
  14. package/dist/cjs/plugins/backend-federation/config.js +2 -2
  15. package/dist/cjs/plugins/backend-federation/emit.js +6 -4
  16. package/dist/cjs/plugins/deploy/index.js +4 -4
  17. package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/index.js +23 -149
  18. package/dist/cjs/plugins/deploy/platforms/templates/netlify-entry.cjs +41 -62
  19. package/dist/cjs/plugins/deploy/platforms/templates/netlify-entry.mjs +41 -63
  20. package/dist/cjs/plugins/deploy/platforms/templates/node-entry.cjs +35 -52
  21. package/dist/cjs/plugins/deploy/platforms/templates/node-entry.mjs +35 -53
  22. package/dist/cjs/plugins/deploy/platforms/templates/vercel-entry.cjs +41 -61
  23. package/dist/cjs/plugins/deploy/platforms/templates/vercel-entry.mjs +40 -61
  24. package/dist/cjs/plugins/ultramodernReleaseEnvelope.js +3 -59
  25. package/dist/cjs/presetUltramodern.js +9 -4
  26. package/dist/cjs/run/index.js +9 -9
  27. package/dist/cjs/utils/register.js +6 -3
  28. package/dist/esm/builder/generator/getBuilderEnvironments.mjs +12 -231
  29. package/dist/esm/builder/generator/index.mjs +1 -2
  30. package/dist/esm/builder/shared/builderPlugins/adapterSSR.mjs +34 -9
  31. package/dist/esm/builder/shared/builderPlugins/index.mjs +0 -1
  32. package/dist/esm/builder/shared/bundlerPlugins/index.mjs +0 -1
  33. package/dist/esm/builder/shared/lazyCompilation.mjs +4 -4
  34. package/dist/esm/bundleDocs.mjs +1 -1
  35. package/dist/esm/index.mjs +3 -3
  36. package/dist/esm/plugins/analyze/getServerRoutes.mjs +1 -1
  37. package/dist/esm/plugins/analyze/isDefaultExportFunction.mjs +1 -9
  38. package/dist/esm/plugins/backend-federation/codegen.mjs +2 -1
  39. package/dist/esm/plugins/backend-federation/config.mjs +1 -1
  40. package/dist/esm/plugins/backend-federation/emit.mjs +5 -3
  41. package/dist/esm/plugins/deploy/index.mjs +1 -1
  42. package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/index.mjs +1 -133
  43. package/dist/esm/plugins/deploy/platforms/templates/netlify-entry.cjs +41 -62
  44. package/dist/esm/plugins/deploy/platforms/templates/netlify-entry.mjs +41 -63
  45. package/dist/esm/plugins/deploy/platforms/templates/node-entry.cjs +35 -52
  46. package/dist/esm/plugins/deploy/platforms/templates/node-entry.mjs +35 -53
  47. package/dist/esm/plugins/deploy/platforms/templates/vercel-entry.cjs +41 -61
  48. package/dist/esm/plugins/deploy/platforms/templates/vercel-entry.mjs +40 -61
  49. package/dist/esm/plugins/ultramodernReleaseEnvelope.mjs +3 -49
  50. package/dist/esm/presetUltramodern.mjs +2 -1
  51. package/dist/esm/run/index.mjs +9 -9
  52. package/dist/esm/utils/register.mjs +6 -3
  53. package/dist/esm-node/builder/generator/getBuilderEnvironments.mjs +12 -234
  54. package/dist/esm-node/builder/generator/index.mjs +1 -2
  55. package/dist/esm-node/builder/shared/builderPlugins/adapterSSR.mjs +34 -9
  56. package/dist/esm-node/builder/shared/builderPlugins/index.mjs +0 -1
  57. package/dist/esm-node/builder/shared/bundlerPlugins/index.mjs +0 -1
  58. package/dist/esm-node/builder/shared/lazyCompilation.mjs +4 -4
  59. package/dist/esm-node/bundleDocs.mjs +1 -1
  60. package/dist/esm-node/index.mjs +3 -3
  61. package/dist/esm-node/plugins/analyze/getServerRoutes.mjs +1 -1
  62. package/dist/esm-node/plugins/analyze/isDefaultExportFunction.mjs +1 -9
  63. package/dist/esm-node/plugins/backend-federation/codegen.mjs +2 -1
  64. package/dist/esm-node/plugins/backend-federation/config.mjs +1 -1
  65. package/dist/esm-node/plugins/backend-federation/emit.mjs +5 -3
  66. package/dist/esm-node/plugins/deploy/index.mjs +1 -1
  67. package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/index.mjs +1 -133
  68. package/dist/esm-node/plugins/deploy/platforms/templates/netlify-entry.cjs +41 -62
  69. package/dist/esm-node/plugins/deploy/platforms/templates/netlify-entry.mjs +41 -63
  70. package/dist/esm-node/plugins/deploy/platforms/templates/node-entry.cjs +35 -52
  71. package/dist/esm-node/plugins/deploy/platforms/templates/node-entry.mjs +35 -53
  72. package/dist/esm-node/plugins/deploy/platforms/templates/vercel-entry.cjs +41 -61
  73. package/dist/esm-node/plugins/deploy/platforms/templates/vercel-entry.mjs +40 -61
  74. package/dist/esm-node/plugins/ultramodernReleaseEnvelope.mjs +3 -49
  75. package/dist/esm-node/presetUltramodern.mjs +2 -1
  76. package/dist/esm-node/run/index.mjs +9 -9
  77. package/dist/esm-node/utils/register.mjs +6 -3
  78. package/dist/types/builder/generator/getBuilderEnvironments.d.ts +0 -29
  79. package/dist/types/builder/shared/builderPlugins/adapterSSR.d.ts +11 -0
  80. package/dist/types/builder/shared/builderPlugins/index.d.ts +0 -1
  81. package/dist/types/builder/shared/bundlerPlugins/index.d.ts +0 -1
  82. package/dist/types/builder/shared/lazyCompilation.d.ts +7 -7
  83. package/dist/types/plugins/analyze/getServerRoutes.d.ts +1 -1
  84. package/dist/types/plugins/backend-federation/codegen.d.ts +4 -1
  85. package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/index.d.ts +1 -18
  86. package/dist/types/presetUltramodern.d.ts +1 -0
  87. package/dist/types/types/config/deploy.d.ts +2 -2
  88. package/docs/community/showcase.md +3 -5
  89. package/docs/guides/advanced-features/bff/frameworks.md +1 -1
  90. package/docs/guides/basic-features/deploy.md +2 -2
  91. package/docs/guides/get-started/quick-start.md +9 -8
  92. package/docs/guides/get-started/tech-stack.md +1 -1
  93. package/docs/guides/get-started/ultramodern.md +18 -18
  94. package/docs/guides/troubleshooting/cli.md +1 -1
  95. package/docs/llms.txt +2 -2
  96. package/docs/tutorials/examples/csr-auth.md +1 -1
  97. package/package.json +15 -27
  98. package/rslib.config.mts +4 -7
  99. package/dist/cjs/builder/shared/builderPlugins/adapterLazyCompilation.js +0 -74
  100. package/dist/cjs/builder/shared/bundlerPlugins/CssExtractRuntimePlugin.js +0 -72
  101. package/dist/cjs/plugins/deploy/platforms/cloudflare/artifacts.js +0 -127
  102. package/dist/cjs/plugins/deploy/platforms/cloudflare/constants.js +0 -141
  103. package/dist/cjs/plugins/deploy/platforms/cloudflare/delivery-unit.js +0 -139
  104. package/dist/cjs/plugins/deploy/platforms/cloudflare/i18n-worker.js +0 -135
  105. package/dist/cjs/plugins/deploy/platforms/cloudflare/index.js +0 -150
  106. package/dist/cjs/plugins/deploy/platforms/cloudflare/security-policies.js +0 -205
  107. package/dist/cjs/plugins/deploy/platforms/cloudflare/types.js +0 -18
  108. package/dist/cjs/plugins/deploy/platforms/cloudflare/utils.js +0 -66
  109. package/dist/cjs/plugins/deploy/platforms/cloudflare/worker-manifest.js +0 -208
  110. package/dist/cjs/plugins/deploy/platforms/cloudflare/wrangler-config.js +0 -204
  111. package/dist/cjs/plugins/deploy/platforms/cloudflare-output-contract.js +0 -108
  112. package/dist/cjs/plugins/deploy/platforms/cloudflare-output-plan.js +0 -93
  113. package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/identity.js +0 -83
  114. package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/issues.js +0 -54
  115. package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/manifest.js +0 -89
  116. package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/mutation-policy.js +0 -151
  117. package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.js +0 -378
  118. package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +0 -251
  119. package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.002-assets-routes.mjs +0 -191
  120. package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.003-i18n-locales.mjs +0 -514
  121. package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.004-rendering-css.mjs +0 -1012
  122. package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.005-worker-dispatch.mjs +0 -363
  123. package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.006-fetch-handler.mjs +0 -93
  124. package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-worker-fs-promises.mjs +0 -11
  125. package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-worker-loadable-server.mjs +0 -281
  126. package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-worker-mf-ssr-runtime-plugin.mjs +0 -14
  127. package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-worker-path.mjs +0 -98
  128. package/dist/cjs/types/config/cloudflareDeploy.js +0 -18
  129. package/dist/cjs/ultramodern-release-envelope/canonical.js +0 -68
  130. package/dist/cjs/ultramodern-release-envelope/framework-output.js +0 -649
  131. package/dist/cjs/ultramodern-release-envelope/index.js +0 -399
  132. package/dist/cjs/ultramodern-release-envelope/types.js +0 -51
  133. package/dist/cjs/ultramodern-release-identity.js +0 -110
  134. package/dist/esm/builder/shared/builderPlugins/adapterLazyCompilation.mjs +0 -36
  135. package/dist/esm/builder/shared/bundlerPlugins/CssExtractRuntimePlugin.mjs +0 -30
  136. package/dist/esm/plugins/deploy/platforms/cloudflare/artifacts.mjs +0 -64
  137. package/dist/esm/plugins/deploy/platforms/cloudflare/constants.mjs +0 -34
  138. package/dist/esm/plugins/deploy/platforms/cloudflare/delivery-unit.mjs +0 -88
  139. package/dist/esm/plugins/deploy/platforms/cloudflare/i18n-worker.mjs +0 -97
  140. package/dist/esm/plugins/deploy/platforms/cloudflare/index.mjs +0 -102
  141. package/dist/esm/plugins/deploy/platforms/cloudflare/security-policies.mjs +0 -167
  142. package/dist/esm/plugins/deploy/platforms/cloudflare/types.mjs +0 -0
  143. package/dist/esm/plugins/deploy/platforms/cloudflare/utils.mjs +0 -12
  144. package/dist/esm/plugins/deploy/platforms/cloudflare/worker-manifest.mjs +0 -148
  145. package/dist/esm/plugins/deploy/platforms/cloudflare/wrangler-config.mjs +0 -150
  146. package/dist/esm/plugins/deploy/platforms/cloudflare-output-contract.mjs +0 -31
  147. package/dist/esm/plugins/deploy/platforms/cloudflare-output-plan.mjs +0 -45
  148. package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/identity.mjs +0 -45
  149. package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/issues.mjs +0 -10
  150. package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/manifest.mjs +0 -51
  151. package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/mutation-policy.mjs +0 -99
  152. package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.mjs +0 -313
  153. package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +0 -251
  154. package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.002-assets-routes.mjs +0 -191
  155. package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.003-i18n-locales.mjs +0 -514
  156. package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.004-rendering-css.mjs +0 -1012
  157. package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.005-worker-dispatch.mjs +0 -363
  158. package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.006-fetch-handler.mjs +0 -93
  159. package/dist/esm/plugins/deploy/platforms/templates/cloudflare-worker-fs-promises.mjs +0 -11
  160. package/dist/esm/plugins/deploy/platforms/templates/cloudflare-worker-loadable-server.mjs +0 -281
  161. package/dist/esm/plugins/deploy/platforms/templates/cloudflare-worker-mf-ssr-runtime-plugin.mjs +0 -14
  162. package/dist/esm/plugins/deploy/platforms/templates/cloudflare-worker-path.mjs +0 -98
  163. package/dist/esm/types/config/cloudflareDeploy.mjs +0 -0
  164. package/dist/esm/ultramodern-release-envelope/canonical.mjs +0 -21
  165. package/dist/esm/ultramodern-release-envelope/framework-output.mjs +0 -573
  166. package/dist/esm/ultramodern-release-envelope/index.mjs +0 -335
  167. package/dist/esm/ultramodern-release-envelope/types.mjs +0 -7
  168. package/dist/esm/ultramodern-release-identity.mjs +0 -66
  169. package/dist/esm-node/builder/shared/builderPlugins/adapterLazyCompilation.mjs +0 -37
  170. package/dist/esm-node/builder/shared/bundlerPlugins/CssExtractRuntimePlugin.mjs +0 -31
  171. package/dist/esm-node/plugins/deploy/platforms/cloudflare/artifacts.mjs +0 -65
  172. package/dist/esm-node/plugins/deploy/platforms/cloudflare/constants.mjs +0 -35
  173. package/dist/esm-node/plugins/deploy/platforms/cloudflare/delivery-unit.mjs +0 -89
  174. package/dist/esm-node/plugins/deploy/platforms/cloudflare/i18n-worker.mjs +0 -98
  175. package/dist/esm-node/plugins/deploy/platforms/cloudflare/index.mjs +0 -103
  176. package/dist/esm-node/plugins/deploy/platforms/cloudflare/security-policies.mjs +0 -168
  177. package/dist/esm-node/plugins/deploy/platforms/cloudflare/types.mjs +0 -1
  178. package/dist/esm-node/plugins/deploy/platforms/cloudflare/utils.mjs +0 -13
  179. package/dist/esm-node/plugins/deploy/platforms/cloudflare/worker-manifest.mjs +0 -149
  180. package/dist/esm-node/plugins/deploy/platforms/cloudflare/wrangler-config.mjs +0 -151
  181. package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-contract.mjs +0 -32
  182. package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-plan.mjs +0 -46
  183. package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/identity.mjs +0 -46
  184. package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/issues.mjs +0 -11
  185. package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/manifest.mjs +0 -52
  186. package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/mutation-policy.mjs +0 -100
  187. package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.mjs +0 -314
  188. package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +0 -251
  189. package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.002-assets-routes.mjs +0 -191
  190. package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.003-i18n-locales.mjs +0 -514
  191. package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.004-rendering-css.mjs +0 -1012
  192. package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.005-worker-dispatch.mjs +0 -363
  193. package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.006-fetch-handler.mjs +0 -93
  194. package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-worker-fs-promises.mjs +0 -11
  195. package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-worker-loadable-server.mjs +0 -281
  196. package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-worker-mf-ssr-runtime-plugin.mjs +0 -14
  197. package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-worker-path.mjs +0 -98
  198. package/dist/esm-node/types/config/cloudflareDeploy.mjs +0 -1
  199. package/dist/esm-node/ultramodern-release-envelope/canonical.mjs +0 -22
  200. package/dist/esm-node/ultramodern-release-envelope/framework-output.mjs +0 -574
  201. package/dist/esm-node/ultramodern-release-envelope/index.mjs +0 -336
  202. package/dist/esm-node/ultramodern-release-envelope/types.mjs +0 -8
  203. package/dist/esm-node/ultramodern-release-identity.mjs +0 -67
  204. package/dist/types/builder/shared/builderPlugins/adapterLazyCompilation.d.ts +0 -3
  205. package/dist/types/builder/shared/bundlerPlugins/CssExtractRuntimePlugin.d.ts +0 -6
  206. package/dist/types/plugins/deploy/platforms/cloudflare/artifacts.d.ts +0 -15
  207. package/dist/types/plugins/deploy/platforms/cloudflare/constants.d.ts +0 -24
  208. package/dist/types/plugins/deploy/platforms/cloudflare/delivery-unit.d.ts +0 -23
  209. package/dist/types/plugins/deploy/platforms/cloudflare/i18n-worker.d.ts +0 -22
  210. package/dist/types/plugins/deploy/platforms/cloudflare/index.d.ts +0 -2
  211. package/dist/types/plugins/deploy/platforms/cloudflare/security-policies.d.ts +0 -51
  212. package/dist/types/plugins/deploy/platforms/cloudflare/types.d.ts +0 -5
  213. package/dist/types/plugins/deploy/platforms/cloudflare/utils.d.ts +0 -6
  214. package/dist/types/plugins/deploy/platforms/cloudflare/worker-manifest.d.ts +0 -122
  215. package/dist/types/plugins/deploy/platforms/cloudflare/wrangler-config.d.ts +0 -46
  216. package/dist/types/plugins/deploy/platforms/cloudflare-output-contract.d.ts +0 -14
  217. package/dist/types/plugins/deploy/platforms/cloudflare-output-plan.d.ts +0 -34
  218. package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/identity.d.ts +0 -4
  219. package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/issues.d.ts +0 -14
  220. package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/manifest.d.ts +0 -2
  221. package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/mutation-policy.d.ts +0 -14
  222. package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.d.ts +0 -20
  223. package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.d.mts +0 -1
  224. package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.002-assets-routes.d.mts +0 -1
  225. package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.003-i18n-locales.d.mts +0 -1
  226. package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.004-rendering-css.d.mts +0 -1
  227. package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.005-worker-dispatch.d.mts +0 -1
  228. package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.006-fetch-handler.d.mts +0 -4
  229. package/dist/types/plugins/deploy/platforms/templates/cloudflare-worker-fs-promises.d.mts +0 -5
  230. package/dist/types/plugins/deploy/platforms/templates/cloudflare-worker-loadable-server.d.mts +0 -48
  231. package/dist/types/plugins/deploy/platforms/templates/cloudflare-worker-mf-ssr-runtime-plugin.d.mts +0 -13
  232. package/dist/types/plugins/deploy/platforms/templates/cloudflare-worker-path.d.mts +0 -21
  233. package/dist/types/types/config/cloudflareDeploy.d.ts +0 -161
  234. package/dist/types/ultramodern-release-envelope/canonical.d.ts +0 -5
  235. package/dist/types/ultramodern-release-envelope/framework-output.d.ts +0 -32
  236. package/dist/types/ultramodern-release-envelope/index.d.ts +0 -6
  237. package/dist/types/ultramodern-release-envelope/types.d.ts +0 -62
  238. package/dist/types/ultramodern-release-identity.d.ts +0 -16
@@ -1,61 +1,44 @@
1
1
  const fs = require('node:fs/promises');
2
2
  const path = require('node:path');
3
3
  const { createProdServer } = require('@modern-js/prod-server');
4
-
5
4
  p_genPluginImportsCode;
6
-
7
- if (!process.env.NODE_ENV) {
8
- process.env.NODE_ENV = 'production';
9
- }
10
-
5
+ if (!process.env.NODE_ENV) process.env.NODE_ENV = 'production';
11
6
  async function loadRoutes(routeFilepath) {
12
- try {
13
- await fs.access(routeFilepath);
14
- const content = await fs.readFile(routeFilepath, 'utf-8');
15
- const routeSpec = JSON.parse(content);
16
- return routeSpec.routes || [];
17
- } catch (error) {
18
- console.warn(
19
- 'route.json not found or invalid, continuing with empty routes.',
20
- );
21
- return [];
22
- }
7
+ try {
8
+ await fs.access(routeFilepath);
9
+ const content = await fs.readFile(routeFilepath, 'utf-8');
10
+ const routeSpec = JSON.parse(content);
11
+ return routeSpec.routes || [];
12
+ } catch (error) {
13
+ console.warn('route.json not found or invalid, continuing with empty routes.');
14
+ return [];
15
+ }
23
16
  }
24
-
25
17
  async function main() {
26
- const routeFilepath = path.join(__dirname, p_ROUTE_SPEC_FILE);
27
- const routes = await loadRoutes(routeFilepath);
28
-
29
- const dynamicProdOptions = p_dynamicProdOptions;
30
- const prodServerOptions = {
31
- pwd: __dirname,
32
- routes,
33
- disableCustomHook: true,
34
- appContext: {
35
- sharedDirectory: p_sharedDirectory,
36
- apiDirectory: p_apiDirectory,
37
- lambdaDirectory: p_lambdaDirectory,
38
- bffRuntimeFramework: p_bffRuntimeFramework,
39
- },
40
- plugins: p_plugins,
41
- serverConfigPath: p_serverDirectory,
42
- ...dynamicProdOptions,
43
- };
44
-
45
- const app = await createProdServer(prodServerOptions);
46
- const port = process.env.PORT || 8080;
47
- app.listen(
48
- {
49
- host: '::',
50
- port,
51
- },
52
- () => {
53
- console.log(
54
- `\x1b[32mServer is listening on http://[::]:${port}`,
55
- '\x1b[0m',
56
- );
57
- },
58
- );
18
+ const routeFilepath = path.join(__dirname, p_ROUTE_SPEC_FILE);
19
+ const routes = await loadRoutes(routeFilepath);
20
+ const dynamicProdOptions = p_dynamicProdOptions;
21
+ const prodServerOptions = {
22
+ pwd: __dirname,
23
+ routes,
24
+ disableCustomHook: true,
25
+ appContext: {
26
+ sharedDirectory: p_sharedDirectory,
27
+ apiDirectory: p_apiDirectory,
28
+ lambdaDirectory: p_lambdaDirectory,
29
+ bffRuntimeFramework: p_bffRuntimeFramework
30
+ },
31
+ plugins: p_plugins,
32
+ serverConfigPath: p_serverDirectory,
33
+ ...dynamicProdOptions
34
+ };
35
+ const app = await createProdServer(prodServerOptions);
36
+ const port = process.env.PORT || 8080;
37
+ app.listen({
38
+ host: '::',
39
+ port
40
+ }, ()=>{
41
+ console.log(`\x1b[32mServer is listening on http://[::]:${port}`, '\x1b[0m');
42
+ });
59
43
  }
60
-
61
44
  main();
@@ -2,63 +2,45 @@ import fs from 'node:fs/promises';
2
2
  import path from 'node:path';
3
3
  import { fileURLToPath } from 'node:url';
4
4
  import { createProdServer } from '@modern-js/prod-server';
5
-
6
5
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
7
-
8
6
  p_genPluginImportsCode;
9
-
10
- if (!process.env.NODE_ENV) {
11
- process.env.NODE_ENV = 'production';
12
- }
13
-
7
+ if (!process.env.NODE_ENV) process.env.NODE_ENV = 'production';
14
8
  async function loadRoutes(routeFilepath) {
15
- try {
16
- await fs.access(routeFilepath);
17
- const content = await fs.readFile(routeFilepath, 'utf-8');
18
- const routeSpec = JSON.parse(content);
19
- return routeSpec.routes || [];
20
- } catch (error) {
21
- console.warn(
22
- 'route.json not found or invalid, continuing with empty routes.',
23
- );
24
- return [];
25
- }
9
+ try {
10
+ await fs.access(routeFilepath);
11
+ const content = await fs.readFile(routeFilepath, 'utf-8');
12
+ const routeSpec = JSON.parse(content);
13
+ return routeSpec.routes || [];
14
+ } catch (error) {
15
+ console.warn('route.json not found or invalid, continuing with empty routes.');
16
+ return [];
17
+ }
26
18
  }
27
-
28
19
  async function main() {
29
- const routeFilepath = path.join(__dirname, p_ROUTE_SPEC_FILE);
30
- const routes = await loadRoutes(routeFilepath);
31
-
32
- const dynamicProdOptions = p_dynamicProdOptions;
33
- const prodServerOptions = {
34
- pwd: __dirname,
35
- routes,
36
- disableCustomHook: true,
37
- appContext: {
38
- sharedDirectory: p_sharedDirectory,
39
- apiDirectory: p_apiDirectory,
40
- lambdaDirectory: p_lambdaDirectory,
41
- bffRuntimeFramework: p_bffRuntimeFramework,
42
- },
43
- plugins: p_plugins,
44
- serverConfigPath: p_serverDirectory,
45
- ...dynamicProdOptions,
46
- };
47
-
48
- const app = await createProdServer(prodServerOptions);
49
- const port = process.env.PORT || 8080;
50
- app.listen(
51
- {
52
- host: '::',
53
- port,
54
- },
55
- () => {
56
- console.log(
57
- `\x1b[32mServer is listening on http://[::]:${port}`,
58
- '\x1b[0m',
59
- );
60
- },
61
- );
20
+ const routeFilepath = path.join(__dirname, p_ROUTE_SPEC_FILE);
21
+ const routes = await loadRoutes(routeFilepath);
22
+ const dynamicProdOptions = p_dynamicProdOptions;
23
+ const prodServerOptions = {
24
+ pwd: __dirname,
25
+ routes,
26
+ disableCustomHook: true,
27
+ appContext: {
28
+ sharedDirectory: p_sharedDirectory,
29
+ apiDirectory: p_apiDirectory,
30
+ lambdaDirectory: p_lambdaDirectory,
31
+ bffRuntimeFramework: p_bffRuntimeFramework
32
+ },
33
+ plugins: p_plugins,
34
+ serverConfigPath: p_serverDirectory,
35
+ ...dynamicProdOptions
36
+ };
37
+ const app = await createProdServer(prodServerOptions);
38
+ const port = process.env.PORT || 8080;
39
+ app.listen({
40
+ host: '::',
41
+ port
42
+ }, ()=>{
43
+ console.log(`\x1b[32mServer is listening on http://[::]:${port}`, '\x1b[0m');
44
+ });
62
45
  }
63
-
64
46
  main();
@@ -1,77 +1,57 @@
1
1
  const fs = require('node:fs/promises');
2
2
  const path = require('node:path');
3
3
  const { createProdServer } = require('@modern-js/prod-server');
4
-
5
4
  p_genPluginImportsCode;
6
-
7
- if (!process.env.NODE_ENV) {
8
- process.env.NODE_ENV = 'production';
9
- }
10
-
5
+ if (!process.env.NODE_ENV) process.env.NODE_ENV = 'production';
11
6
  let requestHandler = null;
12
7
  let handlerCreationPromise = null;
13
-
14
8
  async function loadRoutes(routeFilepath) {
15
- try {
16
- await fs.access(routeFilepath);
17
- const content = await fs.readFile(routeFilepath, 'utf-8');
18
- const routeSpec = JSON.parse(content);
19
- return routeSpec.routes || [];
20
- } catch (error) {
21
- console.warn(
22
- 'route.json not found or invalid, continuing with empty routes.',
23
- );
24
- return [];
25
- }
9
+ try {
10
+ await fs.access(routeFilepath);
11
+ const content = await fs.readFile(routeFilepath, 'utf-8');
12
+ const routeSpec = JSON.parse(content);
13
+ return routeSpec.routes || [];
14
+ } catch (error) {
15
+ console.warn('route.json not found or invalid, continuing with empty routes.');
16
+ return [];
17
+ }
26
18
  }
27
-
28
19
  async function initServer() {
29
- const routeFilepath = path.join(__dirname, p_ROUTE_SPEC_FILE);
30
- const routes = await loadRoutes(routeFilepath);
31
-
32
- const dynamicProdOptions = p_dynamicProdOptions;
33
-
34
- const prodServerOptions = {
35
- pwd: __dirname,
36
- routes,
37
- disableCustomHook: true,
38
- appContext: {
39
- sharedDirectory: p_sharedDirectory,
40
- apiDirectory: p_apiDirectory,
41
- lambdaDirectory: p_lambdaDirectory,
42
- bffRuntimeFramework: p_bffRuntimeFramework,
43
- },
44
- plugins: p_plugins,
45
- serverConfigPath: p_serverDirectory,
46
- ...dynamicProdOptions,
47
- };
48
- const app = await createProdServer(prodServerOptions);
49
-
50
- return app.getRequestListener();
20
+ const routeFilepath = path.join(__dirname, p_ROUTE_SPEC_FILE);
21
+ const routes = await loadRoutes(routeFilepath);
22
+ const dynamicProdOptions = p_dynamicProdOptions;
23
+ const prodServerOptions = {
24
+ pwd: __dirname,
25
+ routes,
26
+ disableCustomHook: true,
27
+ appContext: {
28
+ sharedDirectory: p_sharedDirectory,
29
+ apiDirectory: p_apiDirectory,
30
+ lambdaDirectory: p_lambdaDirectory,
31
+ bffRuntimeFramework: p_bffRuntimeFramework
32
+ },
33
+ plugins: p_plugins,
34
+ serverConfigPath: p_serverDirectory,
35
+ ...dynamicProdOptions
36
+ };
37
+ const app = await createProdServer(prodServerOptions);
38
+ return app.getRequestListener();
51
39
  }
52
-
53
40
  async function createHandler() {
54
- if (!handlerCreationPromise) {
55
- handlerCreationPromise = (async () => {
56
- try {
57
- requestHandler = await initServer();
58
- } catch (error) {
59
- console.error('Error creating server:', error);
60
- process.exit(1);
61
- }
41
+ if (!handlerCreationPromise) handlerCreationPromise = (async ()=>{
42
+ try {
43
+ requestHandler = await initServer();
44
+ } catch (error) {
45
+ console.error('Error creating server:', error);
46
+ process.exit(1);
47
+ }
62
48
  })();
63
- }
64
- await handlerCreationPromise;
65
- return requestHandler;
49
+ await handlerCreationPromise;
50
+ return requestHandler;
66
51
  }
67
-
68
52
  createHandler();
69
-
70
- const handler = async (req, res) => {
71
- if (!requestHandler) {
72
- await createHandler();
73
- }
74
- return requestHandler(req, res);
53
+ const handler = async (req, res)=>{
54
+ if (!requestHandler) await createHandler();
55
+ return requestHandler(req, res);
75
56
  };
76
-
77
57
  module.exports = handler;
@@ -2,78 +2,57 @@ import fs from 'node:fs/promises';
2
2
  import path from 'node:path';
3
3
  import { fileURLToPath } from 'node:url';
4
4
  import { createProdServer } from '@modern-js/prod-server';
5
-
6
5
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
7
-
8
6
  p_genPluginImportsCode;
9
-
10
- if (!process.env.NODE_ENV) {
11
- process.env.NODE_ENV = 'production';
12
- }
13
-
7
+ if (!process.env.NODE_ENV) process.env.NODE_ENV = 'production';
14
8
  let requestHandler = null;
15
9
  let handlerCreationPromise = null;
16
-
17
10
  async function loadRoutes(routeFilepath) {
18
- try {
19
- await fs.access(routeFilepath);
20
- const content = await fs.readFile(routeFilepath, 'utf-8');
21
- const routeSpec = JSON.parse(content);
22
- return routeSpec.routes || [];
23
- } catch (error) {
24
- console.warn(
25
- 'route.json not found or invalid, continuing with empty routes.',
26
- );
27
- return [];
28
- }
11
+ try {
12
+ await fs.access(routeFilepath);
13
+ const content = await fs.readFile(routeFilepath, 'utf-8');
14
+ const routeSpec = JSON.parse(content);
15
+ return routeSpec.routes || [];
16
+ } catch (error) {
17
+ console.warn('route.json not found or invalid, continuing with empty routes.');
18
+ return [];
19
+ }
29
20
  }
30
-
31
21
  async function initServer() {
32
- const routeFilepath = path.join(__dirname, p_ROUTE_SPEC_FILE);
33
- const routes = await loadRoutes(routeFilepath);
34
-
35
- const dynamicProdOptions = p_dynamicProdOptions;
36
-
37
- const prodServerOptions = {
38
- pwd: __dirname,
39
- routes,
40
- disableCustomHook: true,
41
- appContext: {
42
- sharedDirectory: p_sharedDirectory,
43
- apiDirectory: p_apiDirectory,
44
- lambdaDirectory: p_lambdaDirectory,
45
- },
46
- plugins: p_plugins,
47
- serverConfigPath: p_serverDirectory,
48
- ...dynamicProdOptions,
49
- };
50
- const app = await createProdServer(prodServerOptions);
51
-
52
- return app.getRequestListener();
22
+ const routeFilepath = path.join(__dirname, p_ROUTE_SPEC_FILE);
23
+ const routes = await loadRoutes(routeFilepath);
24
+ const dynamicProdOptions = p_dynamicProdOptions;
25
+ const prodServerOptions = {
26
+ pwd: __dirname,
27
+ routes,
28
+ disableCustomHook: true,
29
+ appContext: {
30
+ sharedDirectory: p_sharedDirectory,
31
+ apiDirectory: p_apiDirectory,
32
+ lambdaDirectory: p_lambdaDirectory
33
+ },
34
+ plugins: p_plugins,
35
+ serverConfigPath: p_serverDirectory,
36
+ ...dynamicProdOptions
37
+ };
38
+ const app = await createProdServer(prodServerOptions);
39
+ return app.getRequestListener();
53
40
  }
54
-
55
41
  async function createHandler() {
56
- if (!handlerCreationPromise) {
57
- handlerCreationPromise = (async () => {
58
- try {
59
- requestHandler = await initServer();
60
- } catch (error) {
61
- console.error('Error creating server:', error);
62
- process.exit(1);
63
- }
42
+ if (!handlerCreationPromise) handlerCreationPromise = (async ()=>{
43
+ try {
44
+ requestHandler = await initServer();
45
+ } catch (error) {
46
+ console.error('Error creating server:', error);
47
+ process.exit(1);
48
+ }
64
49
  })();
65
- }
66
- await handlerCreationPromise;
67
- return requestHandler;
50
+ await handlerCreationPromise;
51
+ return requestHandler;
68
52
  }
69
-
70
53
  createHandler();
71
-
72
- const handler = async (req, res) => {
73
- if (!requestHandler) {
74
- await createHandler();
75
- }
76
- return requestHandler(req, res);
54
+ const handler = async (req, res)=>{
55
+ if (!requestHandler) await createHandler();
56
+ return requestHandler(req, res);
77
57
  };
78
-
79
58
  export default handler;
@@ -1,52 +1,6 @@
1
- import node_path from "node:path";
2
- import { emitFrameworkMicroVerticalReleaseEnvelope, emitNodeStagedReleaseEnvelope, verifyBuildOutputReleaseEnvelope, verifyNodeReleaseEnvelopeStaging } from "../ultramodern-release-envelope/framework-output.mjs";
1
+ import { createUltramodernReleaseEnvelopePlugin } from "@modern-js/app-tools-extensions/release-envelope/plugin";
3
2
  import { resolveDeployTarget } from "./deploy/index.mjs";
4
- const resolveActiveDeployTarget = (api)=>{
5
- const { metaName } = api.getAppContext();
6
- const config = api.getNormalizedConfig();
7
- if ('modern-js' !== metaName && !config.deploy?.target && !process.env.MODERNJS_DEPLOY) return;
8
- return resolveDeployTarget(config);
9
- };
10
- const ultramodernReleaseEnvelope = ()=>({
11
- name: '@modern-js/ultramodern-release-envelope',
12
- pre: [
13
- '@modern-js/backend-federation-build',
14
- '@modern-js/plugin-bff'
15
- ],
16
- setup (api) {
17
- const emitBuildEnvelope = async (target)=>{
18
- const { apiOnly, distDirectory } = api.getAppContext();
19
- await emitFrameworkMicroVerticalReleaseEnvelope({
20
- apiOnly,
21
- distDirectory,
22
- target
23
- });
24
- };
25
- api.onAfterBuild(async ()=>{
26
- const configuredTarget = resolveDeployTarget(api.getNormalizedConfig());
27
- if ('node' !== configuredTarget && 'cloudflare' !== configuredTarget) return;
28
- await emitBuildEnvelope(configuredTarget);
29
- });
30
- api.onBeforeDeploy(async ()=>{
31
- const configuredTarget = resolveActiveDeployTarget(api);
32
- if ('node' !== configuredTarget) return;
33
- await emitBuildEnvelope(configuredTarget);
34
- const { distDirectory } = api.getAppContext();
35
- await verifyBuildOutputReleaseEnvelope(distDirectory, configuredTarget);
36
- });
37
- api.onAfterDeploy(async ()=>{
38
- const configuredTarget = resolveActiveDeployTarget(api);
39
- if ('node' !== configuredTarget) return;
40
- const { appDirectory, distDirectory } = api.getAppContext();
41
- const outputDirectory = node_path.join(appDirectory, '.output');
42
- const releaseEnvelope = await emitNodeStagedReleaseEnvelope({
43
- distDirectory,
44
- outputDirectory
45
- });
46
- if (releaseEnvelope) await verifyNodeReleaseEnvelopeStaging({
47
- outputDirectory
48
- });
49
- });
50
- }
3
+ const ultramodernReleaseEnvelope = ()=>createUltramodernReleaseEnvelopePlugin({
4
+ resolveDeployTarget: resolveDeployTarget
51
5
  });
52
6
  export default ultramodernReleaseEnvelope;
@@ -1,8 +1,8 @@
1
1
  import node_fs from "node:fs";
2
2
  import node_path from "node:path";
3
+ import { resolveUltramodernReleaseIdentity } from "@modern-js/app-tools-extensions/release-identity";
3
4
  import { mergeConfig } from "@modern-js/plugin/cli";
4
5
  import { rspack } from "@rsbuild/core";
5
- import { resolveUltramodernReleaseIdentity } from "./ultramodern-release-identity.mjs";
6
6
  const DEFAULT_OTLP_ENDPOINT = 'http://127.0.0.1:4318/v1/logs';
7
7
  const DEFAULT_VICTORIA_METRICS_ENDPOINT = 'http://127.0.0.1:8428/api/v1/import/prometheus';
8
8
  const resolveReactRouterPackageDir = (appDirectory)=>{
@@ -108,4 +108,5 @@ const presetUltramodern = (config, options = {})=>mergeConfig([
108
108
  createPresetUltramodernConfig(options),
109
109
  config
110
110
  ]);
111
+ export { default as ultramodernReleaseEnvelopePlugin } from "./plugins/ultramodernReleaseEnvelope.mjs";
111
112
  export { createPresetUltramodernConfig, presetUltramodern };
@@ -7,25 +7,25 @@ import { loadInternalPlugins } from "../utils/loadPlugins.mjs";
7
7
  async function createRunOptions({ cwd, initialLog, metaName = 'modern-js', version, internalPlugins, configFile }) {
8
8
  const nodeVersion = process.versions.node;
9
9
  const versionArr = nodeVersion.split('.').map(Number);
10
- if (versionArr[0] <= 16) console.warn(`
11
- ${chalk.bgRed.white.bold(' ⚠️ CRITICAL NODE.JS VERSION ALERT ⚠️ ')}
10
+ if (versionArr[0] < 26 || 26 === versionArr[0] && versionArr[1] < 7) throw new Error(`
11
+ ${chalk.bgRed.white.bold(' UNSUPPORTED NODE.JS RUNTIME ')}
12
12
 
13
- ${chalk.red.bold('Node.js 16 End-of-Life Notice:')}
14
- ${chalk.red('- Security updates and support have ended for Node.js 16')}
13
+ ${chalk.red.bold(`UltraModern.js requires Node.js >=26.7.0; detected v${nodeVersion}.`)}
14
+ ${chalk.red('- Legacy Node runtimes and TypeScript transpiler fallbacks are unsupported.')}
15
15
 
16
16
  ${chalk.yellow('▸ Detected Runtime:')} ${chalk.yellow.bold(`Node.js v${nodeVersion}`)}
17
- ${chalk.green('▸ Required Minimum:')} ${chalk.green.bold('Node.js LTS (v18.x or higher)')}
18
- ${chalk.green('▸ Recommended:')} ${chalk.green.bold('Node.js LTS (v22.x or higher)')}
17
+ ${chalk.green('▸ Required Minimum:')} ${chalk.green.bold('Node.js v26.7.0 or higher')}
18
+ ${chalk.green('▸ Pinned Runtime:')} ${chalk.green.bold('Node.js v26.7.0')}
19
19
 
20
20
  ${chalk.cyan('Immediate Action Required:')}
21
21
  ${chalk.gray('├──')} ${chalk.yellow('Recommended Upgrade')}
22
- ${chalk.bold('nvm install 22 --lts && nvm use 22')}
22
+ ${chalk.bold('mise install && mise exec -- node --version')}
23
23
  ${chalk.gray('├──')} ${chalk.yellow('Manual Installation')}
24
- ${chalk.underline('https://nodejs.org/download/release/lts-hydrogen/')}
24
+ ${chalk.underline('https://nodejs.org/download/release/v26.7.0/')}
25
25
  ${chalk.gray('└──')} ${chalk.yellow('Environment Verification')}
26
26
  ${chalk.bold('node -v && npm -v')}
27
27
 
28
- ${chalk.hex('#AAAAAA').italic('[Security Advisory] Node.js 16 is no longer supported. Upgrade immediately for security and compatibility.')}
28
+ ${chalk.hex('#AAAAAA').italic('[Runtime Policy] Upgrade Node; UltraModern.js intentionally carries no legacy transpiler fallback.')}
29
29
  `);
30
30
  const command = process.argv[2];
31
31
  const cliParams = minimist(process.argv.slice(2));
@@ -48,12 +48,16 @@ const createRuntimePaths = ({ alias, paths, absoluteBaseUrl })=>{
48
48
  };
49
49
  const resolveTsRuntimeRegisterMode = ()=>{
50
50
  const hasNativeTypeScriptSupport = process.features?.typescript;
51
- const nodeMajorVersion = Number(process.versions.node.split('.')[0]);
52
- const supportsNativeTypeScript = void 0 === hasNativeTypeScriptSupport ? nodeMajorVersion >= 22 : false !== hasNativeTypeScriptSupport;
51
+ const nodeVersion = process.versions.node.split('.').map(Number);
52
+ const supportsNativeTypeScript = (nodeVersion[0] > 26 || 26 === nodeVersion[0] && nodeVersion[1] >= 7) && [
53
+ true,
54
+ 'strip'
55
+ ].includes(hasNativeTypeScriptSupport);
53
56
  if (supportsNativeTypeScript) return 'node-loader';
54
57
  return 'unsupported';
55
58
  };
56
59
  const setupTsRuntime = async (appDir, distDir, alias, options = {})=>{
60
+ if ('unsupported' === resolveTsRuntimeRegisterMode()) throw new Error(`UltraModern.js requires Node.js >=26.7.0 with native TypeScript support; detected v${process.versions.node}. Legacy TypeScript runtime transpilers are unsupported.`);
57
61
  const tsconfigPath = resolveServerTsconfig(appDir, options.tsconfigPath);
58
62
  const isTsProject = await fs.pathExists(tsconfigPath);
59
63
  if (!isTsProject) return;
@@ -68,7 +72,6 @@ const setupTsRuntime = async (appDir, distDir, alias, options = {})=>{
68
72
  paths,
69
73
  absoluteBaseUrl
70
74
  });
71
- if ('unsupported' === registerMode) return;
72
75
  if ('node-loader' === registerMode) {
73
76
  const { registerPathsLoader } = await import("../esm/register-esm.mjs");
74
77
  await registerPathsLoader({