@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,399 +0,0 @@
1
- "use strict";
2
- var __webpack_require__ = {};
3
- (()=>{
4
- __webpack_require__.n = (module)=>{
5
- var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
6
- __webpack_require__.d(getter, {
7
- a: getter
8
- });
9
- return getter;
10
- };
11
- })();
12
- (()=>{
13
- __webpack_require__.d = (exports1, getters, values)=>{
14
- var define = (defs, kind)=>{
15
- for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
16
- enumerable: true,
17
- [kind]: defs[key]
18
- });
19
- };
20
- define(getters, "get");
21
- define(values, "value");
22
- };
23
- })();
24
- (()=>{
25
- __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
26
- })();
27
- (()=>{
28
- __webpack_require__.r = (exports1)=>{
29
- if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
30
- value: 'Module'
31
- });
32
- Object.defineProperty(exports1, '__esModule', {
33
- value: true
34
- });
35
- };
36
- })();
37
- var __webpack_exports__ = {};
38
- __webpack_require__.r(__webpack_exports__);
39
- __webpack_require__.d(__webpack_exports__, {
40
- MICROVERTICAL_RELEASE_ENVELOPE_KIND: ()=>external_types_js_namespaceObject.MICROVERTICAL_RELEASE_ENVELOPE_KIND,
41
- MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION: ()=>external_types_js_namespaceObject.MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION,
42
- MICROVERTICAL_RELEASE_TARGETS: ()=>external_types_js_namespaceObject.MICROVERTICAL_RELEASE_TARGETS,
43
- canonicalSerializeMicroVerticalReleaseEnvelope: ()=>external_canonical_js_namespaceObject.canonicalSerializeMicroVerticalReleaseEnvelope,
44
- createMicroVerticalReleaseEnvelope: ()=>createMicroVerticalReleaseEnvelope,
45
- verifyMicroVerticalReleaseEnvelope: ()=>verifyMicroVerticalReleaseEnvelope
46
- });
47
- const external_node_crypto_namespaceObject = require("node:crypto");
48
- const promises_namespaceObject = require("node:fs/promises");
49
- var promises_default = /*#__PURE__*/ __webpack_require__.n(promises_namespaceObject);
50
- const external_node_path_namespaceObject = require("node:path");
51
- var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
52
- const external_canonical_js_namespaceObject = require("./canonical.js");
53
- const external_types_js_namespaceObject = require("./types.js");
54
- const SHA256_PATTERN = /^[a-f0-9]{64}$/u;
55
- const SOURCE_REVISION_PATTERN = /^(?:[a-f0-9]{40}|[a-f0-9]{64})$/u;
56
- const TARGETS = new Set(external_types_js_namespaceObject.MICROVERTICAL_RELEASE_TARGETS);
57
- const isRecord = (value)=>'object' == typeof value && null !== value && !Array.isArray(value);
58
- const assertRecord = (value, location)=>{
59
- if (!isRecord(value)) throw new Error(`${location} must be an object.`);
60
- return value;
61
- };
62
- const assertExactKeys = (value, expected, location)=>{
63
- const expectedKeys = new Set(expected);
64
- for (const key of Object.keys(value))if (!expectedKeys.has(key)) throw new Error(`${location} contains unknown field "${key}".`);
65
- for (const key of expected)if (!(key in value)) throw new Error(`${location}.${key} is required.`);
66
- };
67
- const assertNonEmptyString = (value, location)=>{
68
- if ('string' != typeof value || 0 === value.trim().length) throw new Error(`${location} must be a non-empty string.`);
69
- if (value !== value.trim()) throw new Error(`${location} must not contain surrounding whitespace.`);
70
- return value;
71
- };
72
- const assertTarget = (value, location = 'target')=>{
73
- const target = assertNonEmptyString(value, location);
74
- if (!TARGETS.has(target)) throw new Error(`${location} must be one of: ${external_types_js_namespaceObject.MICROVERTICAL_RELEASE_TARGETS.join(', ')}.`);
75
- return target;
76
- };
77
- const assertReleaseIdentity = (value, location = 'identity')=>{
78
- const identity = assertRecord(value, location);
79
- assertExactKeys(identity, [
80
- 'unitId',
81
- 'buildMarker',
82
- 'sourceRevision',
83
- 'releaseVersion'
84
- ], location);
85
- const sourceRevision = assertNonEmptyString(identity.sourceRevision, `${location}.sourceRevision`);
86
- if (!SOURCE_REVISION_PATTERN.test(sourceRevision)) throw new Error(`${location}.sourceRevision must be an exact lowercase 40- or 64-character Git object ID; "${sourceRevision}" is not promotable.`);
87
- return {
88
- unitId: assertNonEmptyString(identity.unitId, `${location}.unitId`),
89
- buildMarker: assertNonEmptyString(identity.buildMarker, `${location}.buildMarker`),
90
- sourceRevision,
91
- releaseVersion: assertNonEmptyString(identity.releaseVersion, `${location}.releaseVersion`)
92
- };
93
- };
94
- const assertNormalizedLogicalPath = (value, location)=>{
95
- const logicalPath = assertNonEmptyString(value, location);
96
- if (logicalPath.includes('\\') || external_node_path_default().posix.isAbsolute(logicalPath) || external_node_path_default().posix.normalize(logicalPath) !== logicalPath || '.' === logicalPath || logicalPath.split('/').some((segment)=>'..' === segment || '.' === segment)) throw new Error(`${location} must be a normalized relative POSIX path.`);
97
- return logicalPath;
98
- };
99
- const isPathInside = (root, candidate)=>{
100
- const relative = external_node_path_default().relative(root, candidate);
101
- return '' === relative || !relative.startsWith(`..${external_node_path_default().sep}`) && '..' !== relative && !external_node_path_default().isAbsolute(relative);
102
- };
103
- const assertArtifactInput = (value, location)=>{
104
- const artifact = assertRecord(value, location);
105
- assertExactKeys(artifact, [
106
- 'logicalPath',
107
- 'runtime'
108
- ], location);
109
- return {
110
- logicalPath: assertNormalizedLogicalPath(artifact.logicalPath, `${location}.logicalPath`),
111
- runtime: assertNonEmptyString(artifact.runtime, `${location}.runtime`)
112
- };
113
- };
114
- const readFinalArtifact = async (artifactRoot, input, resolvedLogicalPath = input.logicalPath)=>{
115
- const artifactInput = {
116
- logicalPath: input.logicalPath,
117
- runtime: input.runtime
118
- };
119
- const logicalPath = assertNormalizedLogicalPath(resolvedLogicalPath, `staged path for ${input.logicalPath}`);
120
- const resolvedRoot = external_node_path_default().resolve(artifactRoot);
121
- const logicalSegments = logicalPath.split('/');
122
- const lexicalPath = external_node_path_default().resolve(resolvedRoot, ...logicalSegments);
123
- if (!isPathInside(resolvedRoot, lexicalPath)) throw new Error(`Artifact logicalPath "${logicalPath}" resolves outside artifactRoot.`);
124
- const realRoot = await promises_default().realpath(resolvedRoot);
125
- for(let index = 0; index < logicalSegments.length - 1; index++){
126
- const linkLogicalPath = logicalSegments.slice(0, index + 1).join('/');
127
- const candidate = external_node_path_default().join(resolvedRoot, ...logicalSegments.slice(0, index + 1));
128
- let candidateStat;
129
- try {
130
- candidateStat = await promises_default().lstat(candidate);
131
- } catch {
132
- throw new Error(`Artifact "${logicalPath}" does not exist.`);
133
- }
134
- if (candidateStat.isSymbolicLink()) throw new Error(`Artifact "${logicalPath}" traverses symbolic-link ancestor "${linkLogicalPath}"; bind the symbolic link itself.`);
135
- }
136
- let lexicalStat;
137
- try {
138
- lexicalStat = await promises_default().lstat(lexicalPath);
139
- } catch {
140
- throw new Error(`Artifact "${logicalPath}" does not exist.`);
141
- }
142
- if (lexicalStat.isSymbolicLink()) {
143
- let realTarget;
144
- try {
145
- realTarget = await promises_default().realpath(lexicalPath);
146
- } catch {
147
- throw new Error(`Artifact symbolic link "${logicalPath}" cannot be resolved.`);
148
- }
149
- if (!isPathInside(realRoot, realTarget)) throw new Error(`Artifact logicalPath "${logicalPath}" resolves outside artifactRoot.`);
150
- const targetStat = await promises_default().stat(realTarget);
151
- const targetKind = targetStat.isFile() ? 'file' : targetStat.isDirectory() ? 'directory' : void 0;
152
- if (!targetKind) throw new Error(`Artifact symbolic link "${logicalPath}" must resolve to a file or directory.`);
153
- const targetLogicalPath = external_node_path_default().relative(realRoot, realTarget).split(external_node_path_default().sep).join('/');
154
- if ('release' === targetLogicalPath || targetLogicalPath.startsWith('release/')) throw new Error(`Artifact symbolic link "${logicalPath}" targets private release metadata.`);
155
- if ('directory' === targetKind && isPathInside(realTarget, await promises_default().realpath(external_node_path_default().dirname(lexicalPath)))) throw new Error(`Artifact symbolic link "${logicalPath}" targets an ancestor directory.`);
156
- return {
157
- ...artifactInput,
158
- kind: 'symbolic-link',
159
- linkTarget: await promises_default().readlink(lexicalPath),
160
- targetKind,
161
- targetLogicalPath
162
- };
163
- }
164
- if (!lexicalStat.isFile()) throw new Error(`Artifact "${logicalPath}" must be a file or symlink.`);
165
- const realPath = await promises_default().realpath(lexicalPath);
166
- if (!isPathInside(realRoot, realPath)) throw new Error(`Artifact logicalPath "${logicalPath}" resolves outside artifactRoot.`);
167
- const bytes = await promises_default().readFile(realPath);
168
- return {
169
- ...artifactInput,
170
- kind: 'file',
171
- byteLength: bytes.byteLength,
172
- sha256: (0, external_node_crypto_namespaceObject.createHash)('sha256').update(bytes).digest('hex')
173
- };
174
- };
175
- const assertReleaseArtifact = (value, location)=>{
176
- const artifact = assertRecord(value, location);
177
- const kind = assertNonEmptyString(artifact.kind, `${location}.kind`);
178
- const input = {
179
- logicalPath: artifact.logicalPath,
180
- runtime: artifact.runtime
181
- };
182
- if ('file' === kind) {
183
- assertExactKeys(artifact, [
184
- 'kind',
185
- 'logicalPath',
186
- 'runtime',
187
- 'byteLength',
188
- 'sha256'
189
- ], location);
190
- const byteLength = artifact.byteLength;
191
- if ('number' != typeof byteLength || !Number.isSafeInteger(byteLength) || byteLength < 0) throw new Error(`${location}.byteLength must be a non-negative integer.`);
192
- const sha256 = assertNonEmptyString(artifact.sha256, `${location}.sha256`);
193
- if (!SHA256_PATTERN.test(sha256)) throw new Error(`${location}.sha256 must be a lowercase SHA-256 digest.`);
194
- return {
195
- ...assertArtifactInput(input, location),
196
- kind,
197
- byteLength,
198
- sha256
199
- };
200
- }
201
- if ('symbolic-link' === kind) {
202
- assertExactKeys(artifact, [
203
- 'kind',
204
- 'logicalPath',
205
- 'runtime',
206
- 'linkTarget',
207
- 'targetKind',
208
- 'targetLogicalPath'
209
- ], location);
210
- const targetKind = assertNonEmptyString(artifact.targetKind, `${location}.targetKind`);
211
- if ('directory' !== targetKind && 'file' !== targetKind) throw new Error(`${location}.targetKind must be "directory" or "file".`);
212
- return {
213
- ...assertArtifactInput(input, location),
214
- kind,
215
- linkTarget: assertNonEmptyString(artifact.linkTarget, `${location}.linkTarget`),
216
- targetKind,
217
- targetLogicalPath: assertNormalizedLogicalPath(artifact.targetLogicalPath, `${location}.targetLogicalPath`)
218
- };
219
- }
220
- throw new Error(`${location}.kind must be "file" or "symbolic-link".`);
221
- };
222
- const assertUniqueSortedArtifacts = (artifacts, location)=>{
223
- const paths = artifacts.map((artifact)=>artifact.logicalPath);
224
- const unique = new Set(paths);
225
- if (unique.size !== paths.length) {
226
- const duplicate = paths.find((logicalPath, index)=>paths.indexOf(logicalPath) !== index);
227
- throw new Error(`Duplicate artifact logicalPath "${duplicate}".`);
228
- }
229
- const sorted = [
230
- ...paths
231
- ].sort((left, right)=>left.localeCompare(right));
232
- if (paths.some((logicalPath, index)=>logicalPath !== sorted[index])) throw new Error(`${location} must be sorted by logicalPath.`);
233
- };
234
- const assertSurfacePaths = (value, location)=>{
235
- if (!Array.isArray(value) || 0 === value.length) throw new Error(`${location} must contain at least one artifact path.`);
236
- const paths = value.map((item, index)=>assertNormalizedLogicalPath(item, `${location}[${index}]`));
237
- const sorted = [
238
- ...paths
239
- ].sort((left, right)=>left.localeCompare(right));
240
- if (paths.some((logicalPath, index)=>logicalPath !== sorted[index])) throw new Error(`${location} must be sorted by logicalPath.`);
241
- if (new Set(paths).size !== paths.length) throw new Error(`${location} must not contain duplicate artifact paths.`);
242
- return paths;
243
- };
244
- const assertSurfaces = (value)=>{
245
- const surfaces = assertRecord(value, 'surfaces');
246
- assertExactKeys(surfaces, [
247
- 'uiClient',
248
- 'ssr',
249
- 'apiBackend',
250
- 'backendFederation'
251
- ], 'surfaces');
252
- const backendFederation = assertRecord(surfaces.backendFederation, 'surfaces.backendFederation');
253
- assertExactKeys(backendFederation, [
254
- 'manifest',
255
- 'container'
256
- ], 'surfaces.backendFederation');
257
- return {
258
- uiClient: assertSurfacePaths(surfaces.uiClient, 'surfaces.uiClient'),
259
- ssr: assertSurfacePaths(surfaces.ssr, 'surfaces.ssr'),
260
- apiBackend: assertSurfacePaths(surfaces.apiBackend, 'surfaces.apiBackend'),
261
- backendFederation: {
262
- manifest: assertNormalizedLogicalPath(backendFederation.manifest, 'surfaces.backendFederation.manifest'),
263
- container: assertNormalizedLogicalPath(backendFederation.container, 'surfaces.backendFederation.container')
264
- }
265
- };
266
- };
267
- const assertSurfaceReferences = (artifacts, surfaces)=>{
268
- const artifactPaths = new Set(artifacts.map((artifact)=>artifact.logicalPath));
269
- for (const [surface, paths] of Object.entries({
270
- uiClient: surfaces.uiClient,
271
- ssr: surfaces.ssr,
272
- apiBackend: surfaces.apiBackend,
273
- 'backendFederation.manifest': [
274
- surfaces.backendFederation.manifest
275
- ],
276
- 'backendFederation.container': [
277
- surfaces.backendFederation.container
278
- ]
279
- }))for (const logicalPath of paths)if (!artifactPaths.has(logicalPath)) throw new Error(`surfaces.${surface} references unbound artifact "${logicalPath}".`);
280
- };
281
- const assertTargetSurfaceContract = (target, artifacts, surfaces)=>{
282
- const byPath = new Map(artifacts.map((artifact)=>[
283
- artifact.logicalPath,
284
- artifact
285
- ]));
286
- const assertRuntime = (paths, expected, surface)=>{
287
- for (const logicalPath of paths){
288
- const artifact = byPath.get(logicalPath);
289
- if (artifact?.runtime !== expected) throw new Error(`${target} ${surface} artifact "${logicalPath}" must use runtime "${expected}"; received "${String(artifact?.runtime)}".`);
290
- if ('kind' in artifact && 'file' !== artifact.kind) throw new Error(`${target} ${surface} artifact "${logicalPath}" must be a file.`);
291
- }
292
- };
293
- assertRuntime(surfaces.uiClient, 'browser', 'UI/client');
294
- assertRuntime(surfaces.ssr, 'node' === target ? 'nodejs' : 'workerd', 'SSR');
295
- assertRuntime(surfaces.apiBackend, 'node' === target ? 'nodejs' : 'workerd-effect', 'API/backend');
296
- assertRuntime([
297
- surfaces.backendFederation.manifest
298
- ], 'module-federation-manifest', 'backend federation manifest');
299
- assertRuntime([
300
- surfaces.backendFederation.container
301
- ], 'node' === target ? 'nodejs' : 'commonjs-module', 'backend federation container');
302
- };
303
- const deepFreeze = (value)=>{
304
- if (null !== value && 'object' == typeof value && !Object.isFrozen(value)) {
305
- Object.freeze(value);
306
- for (const child of Object.values(value))deepFreeze(child);
307
- }
308
- return value;
309
- };
310
- const assertEnvelope = (value)=>{
311
- const envelope = assertRecord(value, 'envelope');
312
- assertExactKeys(envelope, [
313
- 'schemaVersion',
314
- 'kind',
315
- 'target',
316
- 'identity',
317
- 'artifacts',
318
- 'surfaces',
319
- 'envelopeDigest'
320
- ], 'envelope');
321
- if (envelope.schemaVersion !== external_types_js_namespaceObject.MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION) throw new Error(`envelope.schemaVersion must be ${external_types_js_namespaceObject.MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION}.`);
322
- if (envelope.kind !== external_types_js_namespaceObject.MICROVERTICAL_RELEASE_ENVELOPE_KIND) throw new Error(`envelope.kind must be "${external_types_js_namespaceObject.MICROVERTICAL_RELEASE_ENVELOPE_KIND}".`);
323
- if (!Array.isArray(envelope.artifacts) || 0 === envelope.artifacts.length) throw new Error('envelope.artifacts must contain at least one artifact.');
324
- const artifacts = envelope.artifacts.map((artifact, index)=>assertReleaseArtifact(artifact, `envelope.artifacts[${index}]`));
325
- assertUniqueSortedArtifacts(artifacts, 'envelope.artifacts');
326
- const target = assertTarget(envelope.target, 'envelope.target');
327
- const surfaces = assertSurfaces(envelope.surfaces);
328
- assertSurfaceReferences(artifacts, surfaces);
329
- assertTargetSurfaceContract(target, artifacts, surfaces);
330
- const parsed = {
331
- schemaVersion: external_types_js_namespaceObject.MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION,
332
- kind: external_types_js_namespaceObject.MICROVERTICAL_RELEASE_ENVELOPE_KIND,
333
- target,
334
- identity: assertReleaseIdentity(envelope.identity, 'envelope.identity'),
335
- artifacts,
336
- surfaces,
337
- envelopeDigest: assertNonEmptyString(envelope.envelopeDigest, 'envelope.envelopeDigest')
338
- };
339
- if (!SHA256_PATTERN.test(parsed.envelopeDigest)) throw new Error('envelope.envelopeDigest must be a lowercase SHA-256 digest.');
340
- const expectedDigest = (0, external_canonical_js_namespaceObject.digestMicroVerticalReleaseEnvelopePayload)((0, external_canonical_js_namespaceObject.releaseEnvelopePayload)(parsed));
341
- if (parsed.envelopeDigest !== expectedDigest) throw new Error('envelope.envelopeDigest does not match canonical payload.');
342
- return parsed;
343
- };
344
- const createMicroVerticalReleaseEnvelope = async (input)=>{
345
- const artifactRoot = await promises_default().realpath(external_node_path_default().resolve(input.artifactRoot));
346
- const target = assertTarget(input.target);
347
- const identity = assertReleaseIdentity(input.identity);
348
- if (!Array.isArray(input.artifacts) || 0 === input.artifacts.length) throw new Error('artifacts must contain at least one artifact.');
349
- const inputs = input.artifacts.map((artifact, index)=>assertArtifactInput(artifact, `artifacts[${index}]`));
350
- const sortedInputs = [
351
- ...inputs
352
- ].sort((left, right)=>left.logicalPath.localeCompare(right.logicalPath));
353
- assertUniqueSortedArtifacts(sortedInputs, 'artifacts');
354
- const surfaces = assertSurfaces(input.surfaces);
355
- assertSurfaceReferences(sortedInputs, surfaces);
356
- assertTargetSurfaceContract(target, sortedInputs, surfaces);
357
- const artifacts = await Promise.all(sortedInputs.map((artifact)=>readFinalArtifact(artifactRoot, artifact)));
358
- assertTargetSurfaceContract(target, artifacts, surfaces);
359
- const payload = {
360
- schemaVersion: external_types_js_namespaceObject.MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION,
361
- kind: external_types_js_namespaceObject.MICROVERTICAL_RELEASE_ENVELOPE_KIND,
362
- target,
363
- identity,
364
- artifacts,
365
- surfaces
366
- };
367
- return deepFreeze({
368
- ...payload,
369
- envelopeDigest: (0, external_canonical_js_namespaceObject.digestMicroVerticalReleaseEnvelopePayload)(payload)
370
- });
371
- };
372
- const verifyMicroVerticalReleaseEnvelope = async (value, options)=>{
373
- const envelope = assertEnvelope(value);
374
- if (void 0 !== options.expectedTarget && envelope.target !== options.expectedTarget) throw new Error(`envelope.target must be "${options.expectedTarget}" for this staging target; received "${envelope.target}".`);
375
- const artifactRoot = await promises_default().realpath(external_node_path_default().resolve(options.artifactRoot));
376
- for (const artifact of envelope.artifacts){
377
- const finalArtifact = await readFinalArtifact(artifactRoot, artifact, options.logicalPathForArtifact?.(artifact) ?? artifact.logicalPath);
378
- const matches = finalArtifact.kind === artifact.kind && ('file' === artifact.kind && 'file' === finalArtifact.kind ? finalArtifact.byteLength === artifact.byteLength && finalArtifact.sha256 === artifact.sha256 : 'symbolic-link' === artifact.kind && 'symbolic-link' === finalArtifact.kind && finalArtifact.linkTarget === artifact.linkTarget && finalArtifact.targetKind === artifact.targetKind && finalArtifact.targetLogicalPath === artifact.targetLogicalPath);
379
- if (!matches) throw new Error('file' === artifact.kind && 'file' === finalArtifact.kind ? `Artifact "${artifact.logicalPath}" digest does not match final artifact bytes.` : `Artifact "${artifact.logicalPath}" does not match its final filesystem binding.`);
380
- }
381
- return deepFreeze(envelope);
382
- };
383
- exports.MICROVERTICAL_RELEASE_ENVELOPE_KIND = __webpack_exports__.MICROVERTICAL_RELEASE_ENVELOPE_KIND;
384
- exports.MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION = __webpack_exports__.MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION;
385
- exports.MICROVERTICAL_RELEASE_TARGETS = __webpack_exports__.MICROVERTICAL_RELEASE_TARGETS;
386
- exports.canonicalSerializeMicroVerticalReleaseEnvelope = __webpack_exports__.canonicalSerializeMicroVerticalReleaseEnvelope;
387
- exports.createMicroVerticalReleaseEnvelope = __webpack_exports__.createMicroVerticalReleaseEnvelope;
388
- exports.verifyMicroVerticalReleaseEnvelope = __webpack_exports__.verifyMicroVerticalReleaseEnvelope;
389
- for(var __rspack_i in __webpack_exports__)if (-1 === [
390
- "MICROVERTICAL_RELEASE_ENVELOPE_KIND",
391
- "MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION",
392
- "MICROVERTICAL_RELEASE_TARGETS",
393
- "canonicalSerializeMicroVerticalReleaseEnvelope",
394
- "createMicroVerticalReleaseEnvelope",
395
- "verifyMicroVerticalReleaseEnvelope"
396
- ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
397
- Object.defineProperty(exports, '__esModule', {
398
- value: true
399
- });
@@ -1,51 +0,0 @@
1
- "use strict";
2
- var __webpack_require__ = {};
3
- (()=>{
4
- __webpack_require__.d = (exports1, getters, values)=>{
5
- var define = (defs, kind)=>{
6
- for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
7
- enumerable: true,
8
- [kind]: defs[key]
9
- });
10
- };
11
- define(getters, "get");
12
- define(values, "value");
13
- };
14
- })();
15
- (()=>{
16
- __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
17
- })();
18
- (()=>{
19
- __webpack_require__.r = (exports1)=>{
20
- if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
21
- value: 'Module'
22
- });
23
- Object.defineProperty(exports1, '__esModule', {
24
- value: true
25
- });
26
- };
27
- })();
28
- var __webpack_exports__ = {};
29
- __webpack_require__.r(__webpack_exports__);
30
- const MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION = 3;
31
- const MICROVERTICAL_RELEASE_ENVELOPE_KIND = 'ultramodern-target-microvertical-release-envelope';
32
- const MICROVERTICAL_RELEASE_TARGETS = [
33
- 'node',
34
- 'cloudflare'
35
- ];
36
- __webpack_require__.d(__webpack_exports__, {}, {
37
- MICROVERTICAL_RELEASE_ENVELOPE_KIND: MICROVERTICAL_RELEASE_ENVELOPE_KIND,
38
- MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION: MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION,
39
- MICROVERTICAL_RELEASE_TARGETS: MICROVERTICAL_RELEASE_TARGETS
40
- });
41
- exports.MICROVERTICAL_RELEASE_ENVELOPE_KIND = __webpack_exports__.MICROVERTICAL_RELEASE_ENVELOPE_KIND;
42
- exports.MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION = __webpack_exports__.MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION;
43
- exports.MICROVERTICAL_RELEASE_TARGETS = __webpack_exports__.MICROVERTICAL_RELEASE_TARGETS;
44
- for(var __rspack_i in __webpack_exports__)if (-1 === [
45
- "MICROVERTICAL_RELEASE_ENVELOPE_KIND",
46
- "MICROVERTICAL_RELEASE_ENVELOPE_SCHEMA_VERSION",
47
- "MICROVERTICAL_RELEASE_TARGETS"
48
- ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
49
- Object.defineProperty(exports, '__esModule', {
50
- value: true
51
- });
@@ -1,110 +0,0 @@
1
- "use strict";
2
- var __webpack_require__ = {};
3
- (()=>{
4
- __webpack_require__.d = (exports1, getters, values)=>{
5
- var define = (defs, kind)=>{
6
- for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
7
- enumerable: true,
8
- [kind]: defs[key]
9
- });
10
- };
11
- define(getters, "get");
12
- define(values, "value");
13
- };
14
- })();
15
- (()=>{
16
- __webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
17
- })();
18
- (()=>{
19
- __webpack_require__.r = (exports1)=>{
20
- if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
21
- value: 'Module'
22
- });
23
- Object.defineProperty(exports1, '__esModule', {
24
- value: true
25
- });
26
- };
27
- })();
28
- var __webpack_exports__ = {};
29
- __webpack_require__.r(__webpack_exports__);
30
- __webpack_require__.d(__webpack_exports__, {
31
- createUltramodernReleaseBuildMarker: ()=>createUltramodernReleaseBuildMarker,
32
- resolveUltramodernReleaseIdentity: ()=>resolveUltramodernReleaseIdentity,
33
- resolveUltramodernSourceRevision: ()=>resolveUltramodernSourceRevision
34
- });
35
- const external_node_child_process_namespaceObject = require("node:child_process");
36
- const external_node_crypto_namespaceObject = require("node:crypto");
37
- const BUILD_MARKER_NAMESPACE = 'ultramodern-delivery-unit-release-build-marker:v1';
38
- const PROMOTABLE_SOURCE_REVISION_PATTERN = /^(?:[a-f0-9]{40}|[a-f0-9]{64})$/u;
39
- const gitOutput = (workspaceRoot, args)=>{
40
- try {
41
- return (0, external_node_child_process_namespaceObject.execFileSync)('git', [
42
- '-C',
43
- workspaceRoot,
44
- ...args
45
- ], {
46
- encoding: 'utf8',
47
- stdio: [
48
- 'ignore',
49
- 'pipe',
50
- 'ignore'
51
- ]
52
- }).trim();
53
- } catch {
54
- return;
55
- }
56
- };
57
- const createUltramodernReleaseBuildMarker = ({ generationBuildMarker, sourceRevision, unitId })=>(0, external_node_crypto_namespaceObject.createHash)('sha256').update(`${BUILD_MARKER_NAMESPACE}:${unitId}:${generationBuildMarker}:${sourceRevision}`).digest('hex').slice(0, 16);
58
- const resolveUltramodernSourceRevision = (workspaceRoot = process.cwd(), configuredSourceRevision)=>{
59
- const configuredArgumentValue = configuredSourceRevision?.trim();
60
- const configuredEnvironmentValue = process.env.ULTRAMODERN_SOURCE_REVISION?.trim();
61
- const configuredArgument = configuredArgumentValue && 'workspace' !== configuredArgumentValue ? configuredArgumentValue : void 0;
62
- const configuredEnvironment = configuredEnvironmentValue && 'workspace' !== configuredEnvironmentValue ? configuredEnvironmentValue : void 0;
63
- if (configuredArgument && configuredEnvironment && configuredArgument !== configuredEnvironment) throw new Error(`Configured source revision ${configuredArgument} does not match environment source revision ${configuredEnvironment}.`);
64
- const configured = configuredArgument ?? configuredEnvironment;
65
- const gitRoot = gitOutput(workspaceRoot, [
66
- 'rev-parse',
67
- '--show-toplevel'
68
- ]);
69
- if (!gitRoot) {
70
- if (!configured) return 'workspace';
71
- if (!PROMOTABLE_SOURCE_REVISION_PATTERN.test(configured)) throw new Error(`Configured source revision ${configured} must be an exact lowercase 40- or 64-character Git object ID.`);
72
- return configured;
73
- }
74
- const revision = gitOutput(gitRoot, [
75
- 'rev-parse',
76
- 'HEAD'
77
- ]);
78
- const status = gitOutput(gitRoot, [
79
- 'status',
80
- '--porcelain=v1',
81
- '--untracked-files=all'
82
- ]);
83
- if (!revision || void 0 === status || status.length > 0) return 'workspace';
84
- if (!PROMOTABLE_SOURCE_REVISION_PATTERN.test(revision)) return 'workspace';
85
- if (configured && configured !== revision) throw new Error(`Configured source revision ${configured} does not match clean Git HEAD ${revision}.`);
86
- return revision;
87
- };
88
- const resolveUltramodernReleaseIdentity = ({ generationBuildMarker, sourceRevision: configuredSourceRevision, unitId, workspaceRoot })=>{
89
- const explicitSourceRevision = configuredSourceRevision?.trim();
90
- const sourceRevision = resolveUltramodernSourceRevision(workspaceRoot, explicitSourceRevision);
91
- return {
92
- buildMarker: 'workspace' === sourceRevision ? generationBuildMarker : createUltramodernReleaseBuildMarker({
93
- generationBuildMarker,
94
- sourceRevision,
95
- unitId
96
- }),
97
- sourceRevision
98
- };
99
- };
100
- exports.createUltramodernReleaseBuildMarker = __webpack_exports__.createUltramodernReleaseBuildMarker;
101
- exports.resolveUltramodernReleaseIdentity = __webpack_exports__.resolveUltramodernReleaseIdentity;
102
- exports.resolveUltramodernSourceRevision = __webpack_exports__.resolveUltramodernSourceRevision;
103
- for(var __rspack_i in __webpack_exports__)if (-1 === [
104
- "createUltramodernReleaseBuildMarker",
105
- "resolveUltramodernReleaseIdentity",
106
- "resolveUltramodernSourceRevision"
107
- ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
108
- Object.defineProperty(exports, '__esModule', {
109
- value: true
110
- });
@@ -1,36 +0,0 @@
1
- import { isUseRsc, logger } from "@modern-js/utils";
2
- import { aggregateEagerRouteComponentFiles, planRouteEagerLazyCompilation } from "../lazyCompilation.mjs";
3
- const builderPluginAdapterLazyCompilation = (options)=>({
4
- name: 'builder-plugin-adapter-modern-lazy-compilation',
5
- setup (api) {
6
- api.modifyRsbuildConfig((config)=>{
7
- const lazyCompilation = getRouteEagerLazyCompilation(options, config);
8
- if (void 0 === lazyCompilation) return config;
9
- return {
10
- ...config,
11
- dev: {
12
- ...config.dev,
13
- lazyCompilation
14
- }
15
- };
16
- });
17
- }
18
- });
19
- function getRouteEagerLazyCompilation(options, config) {
20
- const current = config.dev?.lazyCompilation;
21
- if (!current || isUseRsc(options.normalizedConfig)) return;
22
- const plan = planRouteEagerLazyCompilation(current, aggregateEagerRouteComponentFiles(options.eagerRouteComponentFilesByEntry));
23
- if (!plan.apply) {
24
- if (plan.unresolvedByEntry) warnUnresolvedRouteComponents(options.appContext.appDirectory, plan.unresolvedByEntry);
25
- return;
26
- }
27
- return plan.lazyCompilation;
28
- }
29
- const warnedLazyApps = new Set();
30
- function warnUnresolvedRouteComponents(appDirectory, unresolvedByEntry) {
31
- if (warnedLazyApps.has(appDirectory)) return;
32
- warnedLazyApps.add(appDirectory);
33
- const detail = Array.from(unresolvedByEntry).map(([entry, components])=>`${entry}: ${components.join(', ')}`).join('; ');
34
- logger.warn(`[lazyCompilation] Skipped route-eager optimization because some route components could not be resolved to a file (${detail}). Lazy compilation may delay route rendering for these routes.`);
35
- }
36
- export { builderPluginAdapterLazyCompilation };
@@ -1,30 +0,0 @@
1
- const PLUGIN_NAME = 'ModernjsCssExtractRuntimePlugin';
2
- const CSS_LOADING_RUNTIME_MODULE = 'webpack/runtime/css loading';
3
- const CSS_EXTRACT_STYLESHEET_MATCH = '\t\tif (tag.rel === "stylesheet" && (dataHref === href || dataHref === fullhref)) return tag;';
4
- const CSS_EXTRACT_STYLESHEET_MATCH_WITH_NORMALIZED_URL = `\t\tvar absoluteHref = tag.href;
5
- \t\tvar absoluteFullHref = new URL(fullhref, document.baseURI).href;
6
- \t\tif (tag.rel === "stylesheet" && (dataHref === href || dataHref === fullhref || absoluteHref === absoluteFullHref)) return tag;`;
7
- const isAutomaticPublicPath = (publicPath)=>'auto' === publicPath || 'auto/' === publicPath;
8
- const normalizeCssExtractRuntimeStylesheetLookup = (source)=>{
9
- if (!source.includes('__webpack_require__.miniCssF')) return source;
10
- const occurrences = source.split(CSS_EXTRACT_STYLESHEET_MATCH).length - 1;
11
- if (1 !== occurrences) throw new Error(`Unsupported CssExtractRspackPlugin runtime shape: expected one stylesheet lookup, found ${occurrences}.`);
12
- return source.replace(CSS_EXTRACT_STYLESHEET_MATCH, CSS_EXTRACT_STYLESHEET_MATCH_WITH_NORMALIZED_URL);
13
- };
14
- class CssExtractRuntimePlugin {
15
- apply(compiler) {
16
- if (!isAutomaticPublicPath(compiler.options.output.publicPath)) return;
17
- compiler.hooks.thisCompilation.tap(PLUGIN_NAME, (compilation)=>{
18
- compilation.hooks.runtimeModule.tap(PLUGIN_NAME, (runtimeModule)=>{
19
- if (runtimeModule.identifier() !== CSS_LOADING_RUNTIME_MODULE) return;
20
- const runtimeSource = runtimeModule.source?.source;
21
- if ('string' != typeof runtimeSource) return;
22
- runtimeModule.source.source = normalizeCssExtractRuntimeStylesheetLookup(runtimeSource);
23
- });
24
- });
25
- }
26
- constructor(){
27
- this.name = PLUGIN_NAME;
28
- }
29
- }
30
- export { CssExtractRuntimePlugin, normalizeCssExtractRuntimeStylesheetLookup };