@bleedingdev/modern-js-app-tools 3.5.0-ultramodern.4 → 3.5.0-ultramodern.40

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (159) hide show
  1. package/dist/cjs/builder/generator/getBuilderEnvironments.js +1 -0
  2. package/dist/cjs/builder/shared/builderPlugins/adapterPrecompress.js +13 -4
  3. package/dist/cjs/builder/shared/lazyCompilation.js +2 -10
  4. package/dist/cjs/commands/index.js +0 -4
  5. package/dist/cjs/index.js +37 -66
  6. package/dist/cjs/plugins/backend-federation/codegen.js +209 -0
  7. package/dist/cjs/plugins/backend-federation/config.js +217 -0
  8. package/dist/cjs/plugins/backend-federation/emit.js +139 -0
  9. package/dist/cjs/plugins/backendFederationBuild.js +53 -0
  10. package/dist/cjs/plugins/deploy/index.js +4 -4
  11. package/dist/cjs/plugins/deploy/platforms/cloudflare/artifacts.js +127 -0
  12. package/dist/cjs/plugins/deploy/platforms/cloudflare/constants.js +137 -0
  13. package/dist/cjs/plugins/deploy/platforms/cloudflare/delivery-unit.js +121 -0
  14. package/dist/cjs/plugins/deploy/platforms/cloudflare/i18n-worker.js +135 -0
  15. package/dist/cjs/plugins/deploy/platforms/cloudflare/index.js +126 -0
  16. package/dist/cjs/plugins/deploy/platforms/cloudflare/security-policies.js +205 -0
  17. package/dist/cjs/plugins/deploy/platforms/cloudflare/types.js +18 -0
  18. package/dist/cjs/plugins/deploy/platforms/cloudflare/utils.js +66 -0
  19. package/dist/cjs/plugins/deploy/platforms/cloudflare/worker-manifest.js +178 -0
  20. package/dist/cjs/plugins/deploy/platforms/cloudflare/wrangler-config.js +189 -0
  21. package/dist/cjs/plugins/deploy/platforms/cloudflare-output-contract.js +91 -0
  22. package/dist/cjs/plugins/deploy/platforms/cloudflare-output-plan.js +93 -0
  23. package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/identity.js +83 -0
  24. package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/index.js +184 -0
  25. package/dist/cjs/{baseline.js → plugins/deploy/platforms/cloudflare-output-verifier/issues.js} +19 -10
  26. package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/manifest.js +83 -0
  27. package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/mutation-policy.js +149 -0
  28. package/dist/cjs/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.js +131 -0
  29. package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +22 -0
  30. package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.002-assets-routes.mjs +0 -0
  31. package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.003-i18n-locales.mjs +0 -0
  32. package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.004-rendering-css.mjs +0 -0
  33. package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.005-worker-dispatch.mjs +0 -0
  34. package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.006-fetch-handler.mjs +32 -0
  35. package/dist/esm/builder/generator/getBuilderEnvironments.mjs +1 -0
  36. package/dist/esm/builder/shared/builderPlugins/adapterPrecompress.mjs +13 -4
  37. package/dist/esm/builder/shared/lazyCompilation.mjs +1 -3
  38. package/dist/esm/commands/index.mjs +0 -1
  39. package/dist/esm/index.mjs +3 -4
  40. package/dist/esm/plugins/analyze/getHtmlTemplate.mjs +2 -2
  41. package/dist/esm/plugins/analyze/isDefaultExportFunction.mjs +2 -2
  42. package/dist/esm/plugins/backend-federation/codegen.mjs +158 -0
  43. package/dist/esm/plugins/backend-federation/config.mjs +141 -0
  44. package/dist/esm/plugins/backend-federation/emit.mjs +88 -0
  45. package/dist/esm/plugins/backendFederationBuild.mjs +1 -0
  46. package/dist/esm/plugins/deploy/index.mjs +1 -1
  47. package/dist/esm/plugins/deploy/platforms/cloudflare/artifacts.mjs +64 -0
  48. package/dist/esm/plugins/deploy/platforms/cloudflare/constants.mjs +33 -0
  49. package/dist/esm/plugins/deploy/platforms/cloudflare/delivery-unit.mjs +70 -0
  50. package/dist/esm/plugins/deploy/platforms/cloudflare/i18n-worker.mjs +97 -0
  51. package/dist/esm/plugins/deploy/platforms/cloudflare/index.mjs +78 -0
  52. package/dist/esm/plugins/deploy/platforms/cloudflare/security-policies.mjs +167 -0
  53. package/dist/esm/plugins/deploy/platforms/cloudflare/types.mjs +0 -0
  54. package/dist/esm/plugins/deploy/platforms/cloudflare/utils.mjs +12 -0
  55. package/dist/esm/plugins/deploy/platforms/cloudflare/worker-manifest.mjs +118 -0
  56. package/dist/esm/plugins/deploy/platforms/cloudflare/wrangler-config.mjs +135 -0
  57. package/dist/esm/plugins/deploy/platforms/cloudflare-output-contract.mjs +17 -0
  58. package/dist/esm/plugins/deploy/platforms/cloudflare-output-plan.mjs +45 -0
  59. package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/identity.mjs +45 -0
  60. package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/index.mjs +129 -0
  61. package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/issues.mjs +10 -0
  62. package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/manifest.mjs +45 -0
  63. package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/mutation-policy.mjs +97 -0
  64. package/dist/esm/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.mjs +68 -0
  65. package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +22 -0
  66. package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.002-assets-routes.mjs +0 -0
  67. package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.003-i18n-locales.mjs +0 -0
  68. package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.004-rendering-css.mjs +0 -0
  69. package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.005-worker-dispatch.mjs +0 -0
  70. package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.006-fetch-handler.mjs +32 -0
  71. package/dist/esm-node/builder/generator/getBuilderEnvironments.mjs +1 -0
  72. package/dist/esm-node/builder/shared/builderPlugins/adapterPrecompress.mjs +13 -4
  73. package/dist/esm-node/builder/shared/lazyCompilation.mjs +1 -3
  74. package/dist/esm-node/commands/index.mjs +0 -1
  75. package/dist/esm-node/index.mjs +3 -4
  76. package/dist/esm-node/plugins/analyze/getHtmlTemplate.mjs +2 -2
  77. package/dist/esm-node/plugins/analyze/isDefaultExportFunction.mjs +2 -2
  78. package/dist/esm-node/plugins/backend-federation/codegen.mjs +159 -0
  79. package/dist/esm-node/plugins/backend-federation/config.mjs +142 -0
  80. package/dist/esm-node/plugins/backend-federation/emit.mjs +89 -0
  81. package/dist/esm-node/plugins/backendFederationBuild.mjs +2 -0
  82. package/dist/esm-node/plugins/deploy/index.mjs +1 -1
  83. package/dist/esm-node/plugins/deploy/platforms/cloudflare/artifacts.mjs +65 -0
  84. package/dist/esm-node/plugins/deploy/platforms/cloudflare/constants.mjs +34 -0
  85. package/dist/esm-node/plugins/deploy/platforms/cloudflare/delivery-unit.mjs +71 -0
  86. package/dist/esm-node/plugins/deploy/platforms/cloudflare/i18n-worker.mjs +98 -0
  87. package/dist/esm-node/plugins/deploy/platforms/cloudflare/index.mjs +79 -0
  88. package/dist/esm-node/plugins/deploy/platforms/cloudflare/security-policies.mjs +168 -0
  89. package/dist/esm-node/plugins/deploy/platforms/cloudflare/types.mjs +1 -0
  90. package/dist/esm-node/plugins/deploy/platforms/cloudflare/utils.mjs +13 -0
  91. package/dist/esm-node/plugins/deploy/platforms/cloudflare/worker-manifest.mjs +119 -0
  92. package/dist/esm-node/plugins/deploy/platforms/cloudflare/wrangler-config.mjs +136 -0
  93. package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-contract.mjs +18 -0
  94. package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-plan.mjs +46 -0
  95. package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/identity.mjs +46 -0
  96. package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/index.mjs +130 -0
  97. package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/issues.mjs +11 -0
  98. package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/manifest.mjs +46 -0
  99. package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/mutation-policy.mjs +98 -0
  100. package/dist/esm-node/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.mjs +69 -0
  101. package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.mjs +22 -0
  102. package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.002-assets-routes.mjs +0 -0
  103. package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.003-i18n-locales.mjs +0 -0
  104. package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.004-rendering-css.mjs +0 -0
  105. package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.005-worker-dispatch.mjs +0 -0
  106. package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.006-fetch-handler.mjs +32 -0
  107. package/dist/types/builder/generator/createCopyPattern.d.ts +7 -5
  108. package/dist/types/builder/shared/lazyCompilation.d.ts +2 -4
  109. package/dist/types/commands/index.d.ts +0 -1
  110. package/dist/types/index.d.ts +0 -2
  111. package/dist/types/plugins/backend-federation/codegen.d.ts +83 -0
  112. package/dist/types/plugins/backend-federation/config.d.ts +103 -0
  113. package/dist/types/plugins/backend-federation/emit.d.ts +13 -0
  114. package/dist/types/plugins/backendFederationBuild.d.ts +2 -0
  115. package/dist/types/plugins/deploy/platforms/cloudflare/artifacts.d.ts +15 -0
  116. package/dist/types/plugins/deploy/platforms/cloudflare/constants.d.ts +23 -0
  117. package/dist/types/plugins/deploy/platforms/cloudflare/delivery-unit.d.ts +23 -0
  118. package/dist/types/plugins/deploy/platforms/cloudflare/i18n-worker.d.ts +22 -0
  119. package/dist/types/plugins/deploy/platforms/{cloudflare.d.ts → cloudflare/index.d.ts} +1 -1
  120. package/dist/types/plugins/deploy/platforms/cloudflare/security-policies.d.ts +51 -0
  121. package/dist/types/plugins/deploy/platforms/cloudflare/types.d.ts +5 -0
  122. package/dist/types/plugins/deploy/platforms/cloudflare/utils.d.ts +6 -0
  123. package/dist/types/plugins/deploy/platforms/cloudflare/worker-manifest.d.ts +113 -0
  124. package/dist/types/plugins/deploy/platforms/cloudflare/wrangler-config.d.ts +39 -0
  125. package/dist/types/plugins/deploy/platforms/cloudflare-output-contract.d.ts +13 -0
  126. package/dist/types/plugins/deploy/platforms/cloudflare-output-plan.d.ts +34 -0
  127. package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/identity.d.ts +4 -0
  128. package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/index.d.ts +18 -0
  129. package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/issues.d.ts +14 -0
  130. package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/manifest.d.ts +2 -0
  131. package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/mutation-policy.d.ts +6 -0
  132. package/dist/types/plugins/deploy/platforms/cloudflare-output-verifier/worker-bundles.d.ts +15 -0
  133. package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.001-bootstrap-security.d.mts +1 -0
  134. package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.002-assets-routes.d.mts +1 -0
  135. package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.003-i18n-locales.d.mts +1 -0
  136. package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.004-rendering-css.d.mts +1 -0
  137. package/dist/types/plugins/deploy/platforms/templates/cloudflare-entry.005-worker-dispatch.d.mts +1 -0
  138. package/dist/types/types/config/cloudflareDeploy.d.ts +22 -0
  139. package/dist/types/types/config/deploy.d.ts +15 -2
  140. package/lib/types.d.ts +2 -3
  141. package/package.json +24 -18
  142. package/dist/cjs/commands/runtime.js +0 -196
  143. package/dist/cjs/plugins/deploy/platforms/cloudflare.js +0 -540
  144. package/dist/cjs/plugins/deploy/platforms/templates/cloudflare-entry.mjs +0 -576
  145. package/dist/cjs/ultramodern/designSystem.js +0 -123
  146. package/dist/esm/baseline.mjs +0 -4
  147. package/dist/esm/commands/runtime.mjs +0 -146
  148. package/dist/esm/plugins/deploy/platforms/cloudflare.mjs +0 -492
  149. package/dist/esm/plugins/deploy/platforms/templates/cloudflare-entry.mjs +0 -576
  150. package/dist/esm/ultramodern/designSystem.mjs +0 -73
  151. package/dist/esm-node/baseline.mjs +0 -5
  152. package/dist/esm-node/commands/runtime.mjs +0 -147
  153. package/dist/esm-node/plugins/deploy/platforms/cloudflare.mjs +0 -493
  154. package/dist/esm-node/plugins/deploy/platforms/templates/cloudflare-entry.mjs +0 -576
  155. package/dist/esm-node/ultramodern/designSystem.mjs +0 -74
  156. package/dist/types/baseline.d.ts +0 -16
  157. package/dist/types/commands/runtime.d.ts +0 -12
  158. package/dist/types/ultramodern/designSystem.d.ts +0 -54
  159. /package/dist/types/plugins/deploy/platforms/templates/{cloudflare-entry.d.mts → cloudflare-entry.006-fetch-handler.d.mts} +0 -0
@@ -0,0 +1,137 @@
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
+ ASSETS_BINDING: ()=>ASSETS_BINDING,
32
+ BFF_EFFECT_WORKER_ENTRY: ()=>BFF_EFFECT_WORKER_ENTRY,
33
+ CLOUDFLARE_RUNTIME_TYPE: ()=>external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_RUNTIME_TYPE,
34
+ CLOUDFLARE_WORKER_BUNDLE_FORMAT: ()=>external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_WORKER_BUNDLE_FORMAT,
35
+ COMPATIBILITY_DATE_PATTERN: ()=>COMPATIBILITY_DATE_PATTERN,
36
+ DEFAULT_COMPATIBILITY_DATE: ()=>DEFAULT_COMPATIBILITY_DATE,
37
+ DEFAULT_SERVER_ONLY_PUBLIC_ASSET_EXCLUDES: ()=>DEFAULT_SERVER_ONLY_PUBLIC_ASSET_EXCLUDES,
38
+ EFFECT_BFF_CLOUDFLARE_IMPORT_GUIDANCE: ()=>EFFECT_BFF_CLOUDFLARE_IMPORT_GUIDANCE,
39
+ LOADABLE_STATS_FILE: ()=>LOADABLE_STATS_FILE,
40
+ OUTPUT_PACKAGE_FILE: ()=>OUTPUT_PACKAGE_FILE,
41
+ PUBLIC_ASSETS_DIRECTORY: ()=>PUBLIC_ASSETS_DIRECTORY,
42
+ REQUIRED_COMPATIBILITY_FLAGS: ()=>REQUIRED_COMPATIBILITY_FLAGS,
43
+ RESERVED_ARTIFACT_DESTINATION_DIRECTORIES: ()=>RESERVED_ARTIFACT_DESTINATION_DIRECTORIES,
44
+ RESERVED_ARTIFACT_DESTINATION_FILES: ()=>RESERVED_ARTIFACT_DESTINATION_FILES,
45
+ ROUTE_MANIFEST_FILE: ()=>ROUTE_MANIFEST_FILE,
46
+ ROUTE_SPEC_FILE: ()=>ROUTE_SPEC_FILE,
47
+ ROUTE_SPEC_OUTPUT: ()=>ROUTE_SPEC_OUTPUT,
48
+ SERVER_BUNDLE_DIRECTORY: ()=>SERVER_BUNDLE_DIRECTORY,
49
+ SERVER_OUTPUT_DIRECTORY: ()=>SERVER_OUTPUT_DIRECTORY,
50
+ WORKER_BUNDLE_DIRECTORY: ()=>WORKER_BUNDLE_DIRECTORY,
51
+ WORKER_ENTRY: ()=>WORKER_ENTRY,
52
+ WORKER_MANIFEST: ()=>WORKER_MANIFEST,
53
+ WRANGLER_CONFIG_FILE: ()=>WRANGLER_CONFIG_FILE
54
+ });
55
+ const external_cloudflare_output_contract_js_namespaceObject = require("../cloudflare-output-contract.js");
56
+ const WORKER_ENTRY = external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_WORKER_ENTRY;
57
+ const WORKER_MANIFEST = external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_WORKER_MANIFEST;
58
+ const WRANGLER_CONFIG_FILE = external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_WRANGLER_CONFIG_FILE;
59
+ const OUTPUT_PACKAGE_FILE = external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_OUTPUT_PACKAGE_FILE;
60
+ const ASSETS_BINDING = external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_ASSETS_BINDING;
61
+ const ROUTE_SPEC_FILE = 'route.json';
62
+ const ROUTE_SPEC_OUTPUT = `server/${ROUTE_SPEC_FILE}`;
63
+ const LOADABLE_STATS_FILE = 'loadable-stats.json';
64
+ const ROUTE_MANIFEST_FILE = 'routes-manifest.json';
65
+ const PUBLIC_ASSETS_DIRECTORY = external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_PUBLIC_ASSETS_DIRECTORY;
66
+ const WORKER_BUNDLE_DIRECTORY = external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_WORKER_BUNDLE_DIRECTORY;
67
+ const SERVER_BUNDLE_DIRECTORY = 'bundles';
68
+ const SERVER_OUTPUT_DIRECTORY = 'server';
69
+ const DEFAULT_SERVER_ONLY_PUBLIC_ASSET_EXCLUDES = [
70
+ 'api',
71
+ 'shared'
72
+ ];
73
+ const BFF_EFFECT_WORKER_ENTRY = `${WORKER_BUNDLE_DIRECTORY}/__modern_bff_effect.js`;
74
+ const EFFECT_BFF_CLOUDFLARE_IMPORT_GUIDANCE = 'Ensure the Effect API entry exists at api/index.ts or bff.effect.entry, and import Cloudflare edge handlers from @modern-js/plugin-bff/effect-edge instead of lambda/Hono server helpers.';
75
+ const DEFAULT_COMPATIBILITY_DATE = '2026-06-02';
76
+ const COMPATIBILITY_DATE_PATTERN = /^\d{4}-\d{2}-\d{2}$/u;
77
+ const REQUIRED_COMPATIBILITY_FLAGS = external_cloudflare_output_contract_js_namespaceObject.CLOUDFLARE_REQUIRED_COMPATIBILITY_FLAGS;
78
+ const RESERVED_ARTIFACT_DESTINATION_FILES = new Set([
79
+ WRANGLER_CONFIG_FILE,
80
+ OUTPUT_PACKAGE_FILE
81
+ ]);
82
+ const RESERVED_ARTIFACT_DESTINATION_DIRECTORIES = new Set([
83
+ PUBLIC_ASSETS_DIRECTORY,
84
+ SERVER_OUTPUT_DIRECTORY,
85
+ WORKER_BUNDLE_DIRECTORY
86
+ ]);
87
+ exports.ASSETS_BINDING = __webpack_exports__.ASSETS_BINDING;
88
+ exports.BFF_EFFECT_WORKER_ENTRY = __webpack_exports__.BFF_EFFECT_WORKER_ENTRY;
89
+ exports.CLOUDFLARE_RUNTIME_TYPE = __webpack_exports__.CLOUDFLARE_RUNTIME_TYPE;
90
+ exports.CLOUDFLARE_WORKER_BUNDLE_FORMAT = __webpack_exports__.CLOUDFLARE_WORKER_BUNDLE_FORMAT;
91
+ exports.COMPATIBILITY_DATE_PATTERN = __webpack_exports__.COMPATIBILITY_DATE_PATTERN;
92
+ exports.DEFAULT_COMPATIBILITY_DATE = __webpack_exports__.DEFAULT_COMPATIBILITY_DATE;
93
+ exports.DEFAULT_SERVER_ONLY_PUBLIC_ASSET_EXCLUDES = __webpack_exports__.DEFAULT_SERVER_ONLY_PUBLIC_ASSET_EXCLUDES;
94
+ exports.EFFECT_BFF_CLOUDFLARE_IMPORT_GUIDANCE = __webpack_exports__.EFFECT_BFF_CLOUDFLARE_IMPORT_GUIDANCE;
95
+ exports.LOADABLE_STATS_FILE = __webpack_exports__.LOADABLE_STATS_FILE;
96
+ exports.OUTPUT_PACKAGE_FILE = __webpack_exports__.OUTPUT_PACKAGE_FILE;
97
+ exports.PUBLIC_ASSETS_DIRECTORY = __webpack_exports__.PUBLIC_ASSETS_DIRECTORY;
98
+ exports.REQUIRED_COMPATIBILITY_FLAGS = __webpack_exports__.REQUIRED_COMPATIBILITY_FLAGS;
99
+ exports.RESERVED_ARTIFACT_DESTINATION_DIRECTORIES = __webpack_exports__.RESERVED_ARTIFACT_DESTINATION_DIRECTORIES;
100
+ exports.RESERVED_ARTIFACT_DESTINATION_FILES = __webpack_exports__.RESERVED_ARTIFACT_DESTINATION_FILES;
101
+ exports.ROUTE_MANIFEST_FILE = __webpack_exports__.ROUTE_MANIFEST_FILE;
102
+ exports.ROUTE_SPEC_FILE = __webpack_exports__.ROUTE_SPEC_FILE;
103
+ exports.ROUTE_SPEC_OUTPUT = __webpack_exports__.ROUTE_SPEC_OUTPUT;
104
+ exports.SERVER_BUNDLE_DIRECTORY = __webpack_exports__.SERVER_BUNDLE_DIRECTORY;
105
+ exports.SERVER_OUTPUT_DIRECTORY = __webpack_exports__.SERVER_OUTPUT_DIRECTORY;
106
+ exports.WORKER_BUNDLE_DIRECTORY = __webpack_exports__.WORKER_BUNDLE_DIRECTORY;
107
+ exports.WORKER_ENTRY = __webpack_exports__.WORKER_ENTRY;
108
+ exports.WORKER_MANIFEST = __webpack_exports__.WORKER_MANIFEST;
109
+ exports.WRANGLER_CONFIG_FILE = __webpack_exports__.WRANGLER_CONFIG_FILE;
110
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
111
+ "ASSETS_BINDING",
112
+ "BFF_EFFECT_WORKER_ENTRY",
113
+ "CLOUDFLARE_RUNTIME_TYPE",
114
+ "CLOUDFLARE_WORKER_BUNDLE_FORMAT",
115
+ "COMPATIBILITY_DATE_PATTERN",
116
+ "DEFAULT_COMPATIBILITY_DATE",
117
+ "DEFAULT_SERVER_ONLY_PUBLIC_ASSET_EXCLUDES",
118
+ "EFFECT_BFF_CLOUDFLARE_IMPORT_GUIDANCE",
119
+ "LOADABLE_STATS_FILE",
120
+ "OUTPUT_PACKAGE_FILE",
121
+ "PUBLIC_ASSETS_DIRECTORY",
122
+ "REQUIRED_COMPATIBILITY_FLAGS",
123
+ "RESERVED_ARTIFACT_DESTINATION_DIRECTORIES",
124
+ "RESERVED_ARTIFACT_DESTINATION_FILES",
125
+ "ROUTE_MANIFEST_FILE",
126
+ "ROUTE_SPEC_FILE",
127
+ "ROUTE_SPEC_OUTPUT",
128
+ "SERVER_BUNDLE_DIRECTORY",
129
+ "SERVER_OUTPUT_DIRECTORY",
130
+ "WORKER_BUNDLE_DIRECTORY",
131
+ "WORKER_ENTRY",
132
+ "WORKER_MANIFEST",
133
+ "WRANGLER_CONFIG_FILE"
134
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
135
+ Object.defineProperty(exports, '__esModule', {
136
+ value: true
137
+ });
@@ -0,0 +1,121 @@
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
+ resolveTopologyDeliveryUnit: ()=>resolveTopologyDeliveryUnit,
41
+ resolveWorkerDeliveryUnitStamp: ()=>resolveWorkerDeliveryUnitStamp
42
+ });
43
+ const external_node_path_namespaceObject = require("node:path");
44
+ var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
45
+ const utils_namespaceObject = require("@modern-js/utils");
46
+ const universal_namespaceObject = require("@modern-js/utils/universal");
47
+ const external_utils_js_namespaceObject = require("./utils.js");
48
+ const COMPACT_CONFIG_PATH = '.modernjs/ultramodern.json';
49
+ const findWorkspaceRoot = async (appDirectory)=>{
50
+ let current = external_node_path_default().resolve(appDirectory);
51
+ for(;;){
52
+ if (await utils_namespaceObject.fs.pathExists(external_node_path_default().join(current, COMPACT_CONFIG_PATH))) return current;
53
+ const parent = external_node_path_default().dirname(current);
54
+ if (parent === current) return;
55
+ current = parent;
56
+ }
57
+ };
58
+ const resolveTopologyDeliveryUnit = async (appDirectory)=>{
59
+ const workspaceRoot = await findWorkspaceRoot(appDirectory);
60
+ if (!workspaceRoot) return;
61
+ let compactConfig;
62
+ try {
63
+ compactConfig = await utils_namespaceObject.fs.readJSON(external_node_path_default().join(workspaceRoot, COMPACT_CONFIG_PATH));
64
+ } catch {
65
+ return;
66
+ }
67
+ if (!(0, external_utils_js_namespaceObject.isRecord)(compactConfig)) return;
68
+ const topology = (0, external_utils_js_namespaceObject.isRecord)(compactConfig.topology) ? compactConfig.topology : void 0;
69
+ const apps = Array.isArray(topology?.apps) ? topology.apps : void 0;
70
+ const resolvedAppDirectory = external_node_path_default().resolve(appDirectory);
71
+ if (apps) {
72
+ for (const app of apps){
73
+ if (!(0, external_utils_js_namespaceObject.isRecord)(app)) continue;
74
+ const appPath = (0, universal_namespaceObject.nonEmptyString)(app.path);
75
+ if (appPath && external_node_path_default().resolve(workspaceRoot, appPath.replace(/^\.\/+/u, '')) === resolvedAppDirectory) return (0, universal_namespaceObject.toDeliveryUnitIdentity)(app.deliveryUnit);
76
+ }
77
+ return;
78
+ }
79
+ return (0, universal_namespaceObject.toDeliveryUnitIdentity)(compactConfig.deliveryUnit);
80
+ };
81
+ const resolveWorkerDeliveryUnitStamp = async (appDirectory)=>{
82
+ const buildArtifactPath = external_node_path_default().join(appDirectory, universal_namespaceObject.ULTRAMODERN_BUILD_ARTIFACT_PATH);
83
+ const buildModulePath = external_node_path_default().join(appDirectory, universal_namespaceObject.ULTRAMODERN_BUILD_MODULE_PATH);
84
+ let identity;
85
+ if (await utils_namespaceObject.fs.pathExists(buildArtifactPath)) {
86
+ const artifact = await utils_namespaceObject.fs.readJSON(buildArtifactPath);
87
+ if (!(0, universal_namespaceObject.isUltramodernBuildArtifact)(artifact)) return;
88
+ identity = (0, universal_namespaceObject.toDeliveryUnitIdentity)(artifact.deliveryUnit);
89
+ } else if (await utils_namespaceObject.fs.pathExists(buildModulePath)) {
90
+ console.warn(`[cloudflare] ${buildArtifactPath} missing; falling back to legacy regex parsing of ${buildModulePath}. Regenerate the workspace to emit ultramodern-build.json.`);
91
+ const source = await utils_namespaceObject.fs.readFile(buildModulePath, 'utf8');
92
+ identity = (0, universal_namespaceObject.toDeliveryUnitIdentity)({
93
+ buildMarker: source.match(/\bbuild:\s*['"]([^'"]+)['"]/u)?.[1],
94
+ unitId: source.match(/\bunitId:\s*['"]([^'"]+)['"]/u)?.[1],
95
+ sourceRevision: source.match(/\bsourceRevision:\s*['"]([^'"]+)['"]/u)?.[1]
96
+ });
97
+ }
98
+ if (!identity) return;
99
+ return {
100
+ ...identity,
101
+ surfaces: {
102
+ ui: {
103
+ ...identity,
104
+ surface: 'ui'
105
+ },
106
+ api: {
107
+ ...identity,
108
+ surface: 'api'
109
+ }
110
+ }
111
+ };
112
+ };
113
+ exports.resolveTopologyDeliveryUnit = __webpack_exports__.resolveTopologyDeliveryUnit;
114
+ exports.resolveWorkerDeliveryUnitStamp = __webpack_exports__.resolveWorkerDeliveryUnitStamp;
115
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
116
+ "resolveTopologyDeliveryUnit",
117
+ "resolveWorkerDeliveryUnitStamp"
118
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
119
+ Object.defineProperty(exports, '__esModule', {
120
+ value: true
121
+ });
@@ -0,0 +1,135 @@
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
+ createI18nWorkerManifest: ()=>createI18nWorkerManifest
32
+ });
33
+ const external_utils_js_namespaceObject = require("./utils.js");
34
+ const I18N_SERVER_PLUGIN_NAME = 'plugin-i18n/server';
35
+ const DEFAULT_I18NEXT_DETECTION_OPTIONS = {
36
+ order: [
37
+ 'querystring',
38
+ 'cookie',
39
+ 'localStorage',
40
+ 'header',
41
+ 'navigator',
42
+ 'htmlTag',
43
+ 'path',
44
+ 'subdomain'
45
+ ],
46
+ lookupQuerystring: 'lng',
47
+ lookupCookie: 'i18next',
48
+ lookupHeader: 'accept-language'
49
+ };
50
+ const SERVER_SIDE_I18N_DETECTORS = new Set([
51
+ 'querystring',
52
+ 'cookie',
53
+ 'header'
54
+ ]);
55
+ const toStringArray = (value)=>Array.isArray(value) ? value.filter((entry)=>'string' == typeof entry) : [];
56
+ const getI18nServerPlugin = (appContext)=>appContext.serverPlugins?.find((plugin)=>plugin.name.includes(I18N_SERVER_PLUGIN_NAME));
57
+ const removeLocaleDetectionByEntry = (config)=>{
58
+ const { localeDetectionByEntry: _localeDetectionByEntry, ...rest } = config;
59
+ return rest;
60
+ };
61
+ const getEntryLocaleDetection = (entryName, localeDetection)=>{
62
+ const byEntry = (0, external_utils_js_namespaceObject.isRecord)(localeDetection.localeDetectionByEntry) ? localeDetection.localeDetectionByEntry : void 0;
63
+ const entryConfig = byEntry?.[entryName];
64
+ const globalConfig = removeLocaleDetectionByEntry(localeDetection);
65
+ return (0, external_utils_js_namespaceObject.isRecord)(entryConfig) ? {
66
+ ...globalConfig,
67
+ ...entryConfig
68
+ } : globalConfig;
69
+ };
70
+ const normalizeI18nDetection = (detection)=>{
71
+ const configured = (0, external_utils_js_namespaceObject.isRecord)(detection) ? detection : {};
72
+ const rawOrder = Array.isArray(configured.order) ? configured.order : DEFAULT_I18NEXT_DETECTION_OPTIONS.order;
73
+ const order = rawOrder.filter((entry)=>'string' == typeof entry && SERVER_SIDE_I18N_DETECTORS.has(entry));
74
+ return {
75
+ order: order.length > 0 ? order : [
76
+ 'querystring',
77
+ 'cookie',
78
+ 'header'
79
+ ],
80
+ lookupQuerystring: 'string' == typeof configured.lookupQuerystring && configured.lookupQuerystring ? configured.lookupQuerystring : DEFAULT_I18NEXT_DETECTION_OPTIONS.lookupQuerystring,
81
+ lookupCookie: 'string' == typeof configured.lookupCookie && configured.lookupCookie ? configured.lookupCookie : DEFAULT_I18NEXT_DETECTION_OPTIONS.lookupCookie,
82
+ lookupHeader: 'string' == typeof configured.lookupHeader && configured.lookupHeader ? configured.lookupHeader : DEFAULT_I18NEXT_DETECTION_OPTIONS.lookupHeader
83
+ };
84
+ };
85
+ const normalizeLocalisedUrls = (localisedUrls)=>{
86
+ if (!(0, external_utils_js_namespaceObject.isRecord)(localisedUrls) || 0 === Object.keys(localisedUrls).length) return;
87
+ const normalized = {};
88
+ for (const [canonicalPath, languageMap] of Object.entries(localisedUrls)){
89
+ if (!(0, external_utils_js_namespaceObject.isRecord)(languageMap)) continue;
90
+ const normalizedLanguageMap = Object.fromEntries(Object.entries(languageMap).filter((entry)=>'string' == typeof entry[1] && entry[1].length > 0));
91
+ if (Object.keys(normalizedLanguageMap).length > 0) normalized[canonicalPath] = normalizedLanguageMap;
92
+ }
93
+ return Object.keys(normalized).length > 0 ? normalized : void 0;
94
+ };
95
+ const normalizeWorkerI18nEntry = (entryName, localeDetection, staticRoutePrefixes)=>{
96
+ const entryConfig = getEntryLocaleDetection(entryName, localeDetection);
97
+ const languages = toStringArray(entryConfig.languages);
98
+ if (true !== entryConfig.localePathRedirect || 0 === languages.length) return;
99
+ const fallbackLanguage = 'string' == typeof entryConfig.fallbackLanguage && entryConfig.fallbackLanguage ? entryConfig.fallbackLanguage : 'en';
100
+ const ignoreRedirectRoutes = Array.isArray(entryConfig.ignoreRedirectRoutes) ? toStringArray(entryConfig.ignoreRedirectRoutes) : [];
101
+ const localisedUrls = normalizeLocalisedUrls(entryConfig.localisedUrls);
102
+ return {
103
+ i18nextDetector: false !== entryConfig.i18nextDetector,
104
+ languages,
105
+ fallbackLanguage,
106
+ detection: normalizeI18nDetection(entryConfig.detection),
107
+ ignoreRedirectRoutes,
108
+ staticRoutePrefixes,
109
+ ...localisedUrls ? {
110
+ localisedUrls
111
+ } : {}
112
+ };
113
+ };
114
+ const createI18nWorkerManifest = (routeSpec, appContext)=>{
115
+ const i18nServerPlugin = getI18nServerPlugin(appContext);
116
+ const localeDetection = i18nServerPlugin?.options?.localeDetection;
117
+ if (!(0, external_utils_js_namespaceObject.isRecord)(localeDetection)) return;
118
+ const staticRoutePrefixes = toStringArray(i18nServerPlugin?.options?.staticRoutePrefixes);
119
+ const entries = {};
120
+ for (const route of routeSpec.routes){
121
+ if ('string' != typeof route.entryName || entries[route.entryName]) continue;
122
+ const entry = normalizeWorkerI18nEntry(route.entryName, localeDetection, staticRoutePrefixes);
123
+ if (entry) entries[route.entryName] = entry;
124
+ }
125
+ return Object.keys(entries).length > 0 ? {
126
+ entries
127
+ } : void 0;
128
+ };
129
+ exports.createI18nWorkerManifest = __webpack_exports__.createI18nWorkerManifest;
130
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
131
+ "createI18nWorkerManifest"
132
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
133
+ Object.defineProperty(exports, '__esModule', {
134
+ value: true
135
+ });
@@ -0,0 +1,126 @@
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
+ createCloudflarePreset: ()=>createCloudflarePreset
41
+ });
42
+ const external_node_path_namespaceObject = require("node:path");
43
+ var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
44
+ const utils_namespaceObject = require("@modern-js/utils");
45
+ const index_js_namespaceObject = require("../../utils/index.js");
46
+ const external_cloudflare_output_plan_js_namespaceObject = require("../cloudflare-output-plan.js");
47
+ const external_cloudflare_output_verifier_index_js_namespaceObject = require("../cloudflare-output-verifier/index.js");
48
+ const external_artifacts_js_namespaceObject = require("./artifacts.js");
49
+ const external_constants_js_namespaceObject = require("./constants.js");
50
+ const external_delivery_unit_js_namespaceObject = require("./delivery-unit.js");
51
+ const external_worker_manifest_js_namespaceObject = require("./worker-manifest.js");
52
+ const external_wrangler_config_js_namespaceObject = require("./wrangler-config.js");
53
+ const CLOUDFLARE_ENTRY_TEMPLATE_FRAGMENTS = [
54
+ 'cloudflare-entry.001-bootstrap-security.mjs',
55
+ 'cloudflare-entry.002-assets-routes.mjs',
56
+ 'cloudflare-entry.003-i18n-locales.mjs',
57
+ 'cloudflare-entry.004-rendering-css.mjs',
58
+ 'cloudflare-entry.005-worker-dispatch.mjs',
59
+ 'cloudflare-entry.006-fetch-handler.mjs'
60
+ ];
61
+ const readCloudflareEntryTemplate = async ()=>(await Promise.all(CLOUDFLARE_ENTRY_TEMPLATE_FRAGMENTS.map((fragment)=>(0, index_js_namespaceObject.readTemplate)(fragment)))).join('');
62
+ const createCloudflarePreset = ({ appContext, modernConfig })=>{
63
+ const { appDirectory, distDirectory } = appContext;
64
+ const outputDirectory = external_node_path_default().join(appDirectory, '.output');
65
+ const outputPlan = (0, external_cloudflare_output_plan_js_namespaceObject.createCloudflareOutputPlan)(outputDirectory);
66
+ const publicDirectory = outputPlan.paths.publicAssets;
67
+ const workerEntryPath = outputPlan.paths.workerEntry;
68
+ const workerManifestPath = outputPlan.paths.workerManifest;
69
+ const routeSpecOutputPath = external_node_path_default().join(outputDirectory, external_constants_js_namespaceObject.ROUTE_SPEC_OUTPUT);
70
+ const wranglerConfigPath = outputPlan.paths.wranglerConfig;
71
+ const cloudflareArtifacts = (0, external_artifacts_js_namespaceObject.getCloudflareArtifacts)(modernConfig);
72
+ const publicAssetExcludes = (0, external_worker_manifest_js_namespaceObject.getPublicAssetExcludes)(appDirectory, modernConfig);
73
+ return {
74
+ async prepare () {
75
+ await utils_namespaceObject.fs.remove(outputDirectory);
76
+ },
77
+ async writeOutput () {
78
+ await utils_namespaceObject.fs.copy(distDirectory, publicDirectory, {
79
+ filter: (src)=>(0, external_worker_manifest_js_namespaceObject.shouldCopyToPublicAssets)(src, distDirectory, publicAssetExcludes)
80
+ });
81
+ await utils_namespaceObject.fs.ensureDir(external_node_path_default().dirname(workerEntryPath));
82
+ await utils_namespaceObject.fs.ensureDir(external_node_path_default().dirname(workerManifestPath));
83
+ const routeSpecSourcePath = external_node_path_default().join(distDirectory, external_constants_js_namespaceObject.ROUTE_SPEC_FILE);
84
+ if (await utils_namespaceObject.fs.pathExists(routeSpecSourcePath)) await utils_namespaceObject.fs.copy(routeSpecSourcePath, routeSpecOutputPath);
85
+ const workerBundleSourceDirectory = external_node_path_default().join(distDirectory, external_constants_js_namespaceObject.WORKER_BUNDLE_DIRECTORY);
86
+ const workerBundleOutputDirectory = outputPlan.paths.workerBundle;
87
+ if (await utils_namespaceObject.fs.pathExists(workerBundleSourceDirectory)) {
88
+ await utils_namespaceObject.fs.copy(workerBundleSourceDirectory, workerBundleOutputDirectory, {
89
+ filter: (src)=>(0, external_worker_manifest_js_namespaceObject.shouldCopyToWorkerBundle)(src, workerBundleSourceDirectory)
90
+ });
91
+ await utils_namespaceObject.fs.writeJSON(outputPlan.paths.workerPackage, outputPlan.packages.worker);
92
+ }
93
+ await (0, external_artifacts_js_namespaceObject.copyCloudflareArtifacts)(appDirectory, outputDirectory, cloudflareArtifacts);
94
+ await (0, external_artifacts_js_namespaceObject.copyCloudflarePublicAssets)(appDirectory, publicDirectory, (0, external_artifacts_js_namespaceObject.getCloudflarePublicAssets)(modernConfig));
95
+ await (0, external_artifacts_js_namespaceObject.copyCloudflareD1Migrations)(appDirectory, outputDirectory, modernConfig);
96
+ await utils_namespaceObject.fs.writeJSON(wranglerConfigPath, (0, external_wrangler_config_js_namespaceObject.createWranglerConfig)(appDirectory, modernConfig), {
97
+ spaces: 2
98
+ });
99
+ const deliveryUnitStamp = await (0, external_delivery_unit_js_namespaceObject.resolveWorkerDeliveryUnitStamp)(appDirectory);
100
+ await utils_namespaceObject.fs.writeJSON(workerManifestPath, await (0, external_worker_manifest_js_namespaceObject.createWorkerManifest)(outputDirectory, modernConfig, appContext, deliveryUnitStamp), {
101
+ spaces: 2
102
+ });
103
+ await utils_namespaceObject.fs.writeJSON(outputPlan.paths.outputPackage, outputPlan.packages.output);
104
+ },
105
+ async genEntry () {
106
+ const template = await readCloudflareEntryTemplate();
107
+ const manifest = await utils_namespaceObject.fs.readJSON(workerManifestPath);
108
+ await utils_namespaceObject.fs.writeFile(workerEntryPath, template.replace('p_workerManifest', JSON.stringify(manifest, null, 2)).replace('p_workerModuleLoaders', (0, external_worker_manifest_js_namespaceObject.createWorkerModuleLoaders)(manifest)));
109
+ const topologyDeliveryUnit = await (0, external_delivery_unit_js_namespaceObject.resolveTopologyDeliveryUnit)(appDirectory);
110
+ await (0, external_cloudflare_output_verifier_index_js_namespaceObject.assertCloudflareOutput)({
111
+ outputDirectory,
112
+ importWorker: false,
113
+ ...topologyDeliveryUnit ? {
114
+ deliveryUnit: topologyDeliveryUnit
115
+ } : {}
116
+ });
117
+ }
118
+ };
119
+ };
120
+ exports.createCloudflarePreset = __webpack_exports__.createCloudflarePreset;
121
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
122
+ "createCloudflarePreset"
123
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
124
+ Object.defineProperty(exports, '__esModule', {
125
+ value: true
126
+ });