@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,205 @@
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 DEFAULT_SECURITY_HEADERS = {
31
+ referrerPolicy: 'strict-origin-when-cross-origin',
32
+ contentTypeOptions: 'nosniff',
33
+ permissionsPolicy: 'camera=(), geolocation=(), microphone=(), payment=(), usb=()'
34
+ };
35
+ const DEFAULT_CORS_ALLOWED_METHODS = [
36
+ 'GET',
37
+ 'HEAD',
38
+ 'POST',
39
+ 'PUT',
40
+ 'PATCH',
41
+ 'DELETE',
42
+ 'OPTIONS'
43
+ ];
44
+ const DEFAULT_CSP_DIRECTIVES = {
45
+ 'base-uri': [
46
+ "'self'"
47
+ ],
48
+ 'connect-src': [
49
+ "'self'",
50
+ 'https:',
51
+ 'http:',
52
+ 'wss:',
53
+ 'ws:'
54
+ ],
55
+ 'default-src': [
56
+ "'self'"
57
+ ],
58
+ 'font-src': [
59
+ "'self'",
60
+ 'data:',
61
+ 'https:',
62
+ 'http:'
63
+ ],
64
+ 'form-action': [
65
+ "'self'"
66
+ ],
67
+ 'frame-ancestors': [
68
+ "'self'"
69
+ ],
70
+ 'img-src': [
71
+ "'self'",
72
+ 'data:',
73
+ 'blob:',
74
+ 'https:',
75
+ 'http:'
76
+ ],
77
+ 'manifest-src': [
78
+ "'self'",
79
+ 'https:',
80
+ 'http:'
81
+ ],
82
+ 'object-src': [
83
+ "'none'"
84
+ ],
85
+ "script-src": [
86
+ "'self'",
87
+ "'unsafe-inline'",
88
+ "'unsafe-eval'",
89
+ 'https:',
90
+ 'http:',
91
+ 'blob:'
92
+ ],
93
+ 'style-src': [
94
+ "'self'",
95
+ "'unsafe-inline'",
96
+ 'https:',
97
+ 'http:'
98
+ ],
99
+ 'worker-src': [
100
+ "'self'",
101
+ 'blob:'
102
+ ]
103
+ };
104
+ const normalizeDirectiveValues = (value)=>{
105
+ const values = Array.isArray(value) ? value : [
106
+ value
107
+ ];
108
+ return [
109
+ ...new Set(values.map((entry)=>entry.trim()).filter(Boolean))
110
+ ];
111
+ };
112
+ const appendDirectiveValues = (directives, name, values)=>{
113
+ if (!values?.length) return;
114
+ directives[name] = normalizeDirectiveValues([
115
+ ...directives[name] ?? [],
116
+ ...values
117
+ ]);
118
+ };
119
+ const createContentSecurityPolicy = (config)=>{
120
+ const mode = config?.mode ?? 'report-only';
121
+ if ('off' === mode) return {
122
+ mode,
123
+ directives: {},
124
+ reason: config?.reason
125
+ };
126
+ const directives = Object.fromEntries(Object.entries(DEFAULT_CSP_DIRECTIVES).map(([name, values])=>[
127
+ name,
128
+ [
129
+ ...values
130
+ ]
131
+ ]));
132
+ for (const [name, value] of Object.entries(config?.directives ?? {}))if (false === value) delete directives[name];
133
+ else directives[name] = normalizeDirectiveValues(value);
134
+ if (config?.frameAncestors === false) delete directives['frame-ancestors'];
135
+ else if (config?.frameAncestors) directives['frame-ancestors'] = normalizeDirectiveValues(config.frameAncestors);
136
+ appendDirectiveValues(directives, "script-src", config?.additionalScriptSrc);
137
+ appendDirectiveValues(directives, 'style-src', config?.additionalStyleSrc);
138
+ appendDirectiveValues(directives, 'connect-src', config?.additionalConnectSrc);
139
+ appendDirectiveValues(directives, 'img-src', config?.additionalImgSrc);
140
+ if (config?.reportUri) directives['report-uri'] = [
141
+ config.reportUri
142
+ ];
143
+ return {
144
+ mode,
145
+ directives,
146
+ reason: config?.reason
147
+ };
148
+ };
149
+ const createNoindexPolicy = (noindex)=>{
150
+ if (false === noindex) return {
151
+ workersDev: false,
152
+ localhost: false,
153
+ previewHostnames: []
154
+ };
155
+ if (true === noindex || void 0 === noindex) return {
156
+ workersDev: true,
157
+ localhost: true,
158
+ previewHostnames: []
159
+ };
160
+ return {
161
+ workersDev: noindex.workersDev ?? true,
162
+ localhost: noindex.localhost ?? true,
163
+ previewHostnames: noindex.previewHostnames ?? [],
164
+ reason: noindex.reason
165
+ };
166
+ };
167
+ const createCloudflareWorkerCorsPolicy = (cors)=>({
168
+ assets: cors?.assets ?? true,
169
+ allowedOrigins: normalizeDirectiveValues(cors?.allowedOrigins ?? []),
170
+ allowedMethods: cors?.allowedMethods?.length ? normalizeDirectiveValues(cors.allowedMethods.map((method)=>method.toUpperCase())) : DEFAULT_CORS_ALLOWED_METHODS,
171
+ allowedHeaders: cors?.allowedHeaders?.length ? normalizeDirectiveValues(cors.allowedHeaders) : [
172
+ '*'
173
+ ],
174
+ reason: cors?.reason
175
+ });
176
+ const createCloudflareWorkerSecurityPolicy = (modernConfig)=>{
177
+ const security = modernConfig.deploy?.worker?.security;
178
+ if (security?.enabled === false) return {
179
+ enabled: false,
180
+ cors: createCloudflareWorkerCorsPolicy(security.cors),
181
+ reason: security.reason
182
+ };
183
+ return {
184
+ enabled: true,
185
+ headers: {
186
+ referrerPolicy: security?.headers?.referrerPolicy ?? DEFAULT_SECURITY_HEADERS.referrerPolicy,
187
+ contentTypeOptions: security?.headers?.contentTypeOptions ?? DEFAULT_SECURITY_HEADERS.contentTypeOptions,
188
+ permissionsPolicy: security?.headers?.permissionsPolicy ?? DEFAULT_SECURITY_HEADERS.permissionsPolicy
189
+ },
190
+ contentSecurityPolicy: createContentSecurityPolicy(security?.contentSecurityPolicy),
191
+ noindex: createNoindexPolicy(security?.noindex),
192
+ cors: createCloudflareWorkerCorsPolicy(security?.cors),
193
+ reason: security?.reason
194
+ };
195
+ };
196
+ __webpack_require__.d(__webpack_exports__, {}, {
197
+ createCloudflareWorkerSecurityPolicy: createCloudflareWorkerSecurityPolicy
198
+ });
199
+ exports.createCloudflareWorkerSecurityPolicy = __webpack_exports__.createCloudflareWorkerSecurityPolicy;
200
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
201
+ "createCloudflareWorkerSecurityPolicy"
202
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
203
+ Object.defineProperty(exports, '__esModule', {
204
+ value: true
205
+ });
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ var __webpack_require__ = {};
3
+ (()=>{
4
+ __webpack_require__.r = (exports1)=>{
5
+ if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
6
+ value: 'Module'
7
+ });
8
+ Object.defineProperty(exports1, '__esModule', {
9
+ value: true
10
+ });
11
+ };
12
+ })();
13
+ var __webpack_exports__ = {};
14
+ __webpack_require__.r(__webpack_exports__);
15
+ for(var __rspack_i in __webpack_exports__)exports[__rspack_i] = __webpack_exports__[__rspack_i];
16
+ Object.defineProperty(exports, '__esModule', {
17
+ value: true
18
+ });
@@ -0,0 +1,66 @@
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
+ isJsonRecord: ()=>isJsonRecord,
41
+ isRecord: ()=>isRecord,
42
+ normalizeRelativePath: ()=>normalizeRelativePath
43
+ });
44
+ const external_node_path_namespaceObject = require("node:path");
45
+ var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
46
+ const isRecord = (value)=>null !== value && 'object' == typeof value && !Array.isArray(value);
47
+ const normalizeRelativePath = (value, label, scope = 'app output', options = {})=>{
48
+ if ('string' != typeof value) throw new Error(`${label} must be a relative path inside the ${scope}.`);
49
+ const normalized = value.trim().replace(/\\/g, '/').replace(/^\.\/+/u, '').replace(/\/+$/u, '');
50
+ const segments = normalized.split('/');
51
+ const isRootDestination = '.' === normalized;
52
+ if (!normalized || external_node_path_default().isAbsolute(normalized) || !options.allowRoot && isRootDestination || segments.includes('..')) throw new Error(`${label} must be a relative path inside the ${scope}.`);
53
+ return normalized;
54
+ };
55
+ const isJsonRecord = (value)=>'object' == typeof value && null !== value && !Array.isArray(value);
56
+ exports.isJsonRecord = __webpack_exports__.isJsonRecord;
57
+ exports.isRecord = __webpack_exports__.isRecord;
58
+ exports.normalizeRelativePath = __webpack_exports__.normalizeRelativePath;
59
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
60
+ "isJsonRecord",
61
+ "isRecord",
62
+ "normalizeRelativePath"
63
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
64
+ Object.defineProperty(exports, '__esModule', {
65
+ value: true
66
+ });
@@ -0,0 +1,178 @@
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
+ createWorkerManifest: ()=>createWorkerManifest,
41
+ createWorkerModuleLoaders: ()=>createWorkerModuleLoaders,
42
+ getPublicAssetExcludes: ()=>getPublicAssetExcludes,
43
+ shouldCopyToPublicAssets: ()=>shouldCopyToPublicAssets,
44
+ shouldCopyToWorkerBundle: ()=>shouldCopyToWorkerBundle
45
+ });
46
+ const external_node_path_namespaceObject = require("node:path");
47
+ var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
48
+ const utils_namespaceObject = require("@modern-js/utils");
49
+ const external_artifacts_js_namespaceObject = require("./artifacts.js");
50
+ const external_constants_js_namespaceObject = require("./constants.js");
51
+ const external_i18n_worker_js_namespaceObject = require("./i18n-worker.js");
52
+ const external_security_policies_js_namespaceObject = require("./security-policies.js");
53
+ const external_utils_js_namespaceObject = require("./utils.js");
54
+ const external_wrangler_config_js_namespaceObject = require("./wrangler-config.js");
55
+ const createMissingEffectBffWorkerError = (outputDirectory, worker)=>new Error(`Cloudflare Effect API runtime is configured, but the BFF worker bundle is missing: ${external_node_path_default().join(outputDirectory, worker)}. ${external_constants_js_namespaceObject.EFFECT_BFF_CLOUDFLARE_IMPORT_GUIDANCE}`);
56
+ const createWorkerManifest = async (outputDirectory, modernConfig, appContext, deliveryUnitStamp)=>{
57
+ const routeSpec = await (0, external_artifacts_js_namespaceObject.readRouteSpec)(outputDirectory);
58
+ const routes = await Promise.all(routeSpec.routes.map(async (route)=>{
59
+ const worker = 'string' == typeof route.worker ? route.worker : void 0;
60
+ return {
61
+ urlPath: route.urlPath,
62
+ entryName: route.entryName,
63
+ entryPath: route.entryPath,
64
+ isSSR: Boolean(route.isSSR),
65
+ worker,
66
+ workerExists: worker ? await utils_namespaceObject.fs.pathExists(external_node_path_default().join(outputDirectory, worker)) : false
67
+ };
68
+ }));
69
+ const bffPrefix = modernConfig.bff?.prefix;
70
+ const primaryBffPrefix = Array.isArray(bffPrefix) ? bffPrefix[0] : bffPrefix;
71
+ const isEffectApi = Boolean(modernConfig.bff) && modernConfig.bff?.runtimeFramework !== 'hono';
72
+ const effectApiWorkerExists = await utils_namespaceObject.fs.pathExists(external_node_path_default().join(outputDirectory, external_constants_js_namespaceObject.BFF_EFFECT_WORKER_ENTRY));
73
+ const serviceBindings = (0, external_wrangler_config_js_namespaceObject.createWorkerManifestServiceBindings)((0, external_wrangler_config_js_namespaceObject.createWorkerServiceBindings)(modernConfig, void 0));
74
+ if (isEffectApi && primaryBffPrefix && !effectApiWorkerExists) throw createMissingEffectBffWorkerError(outputDirectory, external_constants_js_namespaceObject.BFF_EFFECT_WORKER_ENTRY);
75
+ return {
76
+ version: 1,
77
+ runtime: {
78
+ type: external_constants_js_namespaceObject.CLOUDFLARE_RUNTIME_TYPE,
79
+ entry: external_constants_js_namespaceObject.WORKER_ENTRY,
80
+ fetchExport: true,
81
+ nodeListen: false
82
+ },
83
+ assets: {
84
+ binding: external_constants_js_namespaceObject.ASSETS_BINDING,
85
+ directory: `./${external_constants_js_namespaceObject.PUBLIC_ASSETS_DIRECTORY}`,
86
+ runWorkerFirst: true
87
+ },
88
+ routeSpec: {
89
+ file: external_constants_js_namespaceObject.ROUTE_SPEC_OUTPUT,
90
+ routes
91
+ },
92
+ workerBundles: {
93
+ directory: external_constants_js_namespaceObject.WORKER_BUNDLE_DIRECTORY,
94
+ format: external_constants_js_namespaceObject.CLOUDFLARE_WORKER_BUNDLE_FORMAT,
95
+ importableFromModuleWorker: true,
96
+ requestHandlerExport: 'requestHandler'
97
+ },
98
+ resources: {
99
+ loadableStats: external_constants_js_namespaceObject.LOADABLE_STATS_FILE,
100
+ routeManifest: external_constants_js_namespaceObject.ROUTE_MANIFEST_FILE
101
+ },
102
+ security: (0, external_security_policies_js_namespaceObject.createCloudflareWorkerSecurityPolicy)(modernConfig),
103
+ ...deliveryUnitStamp ? {
104
+ deliveryUnit: deliveryUnitStamp
105
+ } : {},
106
+ i18n: (0, external_i18n_worker_js_namespaceObject.createI18nWorkerManifest)(routeSpec, appContext),
107
+ bff: isEffectApi && primaryBffPrefix && effectApiWorkerExists ? {
108
+ runtimeFramework: 'effect',
109
+ prefix: primaryBffPrefix,
110
+ worker: external_constants_js_namespaceObject.BFF_EFFECT_WORKER_ENTRY
111
+ } : void 0,
112
+ ...void 0 === serviceBindings ? {} : {
113
+ serviceBindings
114
+ }
115
+ };
116
+ };
117
+ const createWorkerModuleLoaders = (manifest)=>{
118
+ const imports = new Map();
119
+ for (const route of manifest.routeSpec.routes)if (route.worker && route.workerExists) {
120
+ const importPath = `../${String(route.worker).replace(/^\/+/u, '')}`;
121
+ imports.set(route.worker, `() => import(${JSON.stringify(importPath)})`);
122
+ }
123
+ if (manifest.bff?.worker) {
124
+ const importPath = `../${String(manifest.bff.worker).replace(/^\/+/u, '')}`;
125
+ imports.set(manifest.bff.worker, `() => import(${JSON.stringify(importPath)})`);
126
+ }
127
+ if (0 === imports.size) return '{}';
128
+ const loaders = [
129
+ ...imports.entries()
130
+ ].map(([worker, loader])=>`${JSON.stringify(worker)}: ${loader}`);
131
+ return `{\n${loaders.join(',\n')}\n}`;
132
+ };
133
+ const getPublicAssetExcludes = (appDirectory, modernConfig)=>[
134
+ ...external_constants_js_namespaceObject.DEFAULT_SERVER_ONLY_PUBLIC_ASSET_EXCLUDES.filter((directory)=>{
135
+ try {
136
+ return utils_namespaceObject.fs.statSync(external_node_path_default().join(appDirectory, directory)).isDirectory();
137
+ } catch {
138
+ return false;
139
+ }
140
+ }),
141
+ ...modernConfig.deploy?.worker?.publicAssetExcludes ?? []
142
+ ].map((entry)=>(0, external_utils_js_namespaceObject.normalizeRelativePath)(entry, 'deploy.worker.publicAssetExcludes'));
143
+ const shouldCopyToPublicAssets = (src, distDirectory, publicAssetExcludes)=>{
144
+ const relativePath = external_node_path_default().relative(distDirectory, src);
145
+ if (!relativePath) return true;
146
+ const normalizedRelativePath = relativePath.replace(/\\/g, '/');
147
+ const [topLevelDirectory] = normalizedRelativePath.split('/');
148
+ const basename = normalizedRelativePath.split('/').pop() ?? '';
149
+ return normalizedRelativePath !== external_constants_js_namespaceObject.ROUTE_SPEC_FILE && topLevelDirectory !== external_constants_js_namespaceObject.WORKER_BUNDLE_DIRECTORY && topLevelDirectory !== external_constants_js_namespaceObject.SERVER_BUNDLE_DIRECTORY && '.env' !== basename && !basename.startsWith('.env.') && !publicAssetExcludes.some((exclude)=>normalizedRelativePath === exclude || normalizedRelativePath.startsWith(`${exclude}/`));
150
+ };
151
+ const shouldCopyToWorkerBundle = (src, workerBundleDirectory)=>{
152
+ const relativePath = external_node_path_default().relative(workerBundleDirectory, src);
153
+ if (!relativePath) return true;
154
+ const normalizedRelativePath = relativePath.replace(/\\/g, '/');
155
+ const basename = external_node_path_default().basename(normalizedRelativePath);
156
+ if (basename.startsWith('.') || normalizedRelativePath.includes('/.')) return false;
157
+ if (utils_namespaceObject.fs.statSync(src).isDirectory()) return true;
158
+ return [
159
+ '.cjs',
160
+ '.js',
161
+ '.mjs'
162
+ ].includes(external_node_path_default().extname(normalizedRelativePath));
163
+ };
164
+ exports.createWorkerManifest = __webpack_exports__.createWorkerManifest;
165
+ exports.createWorkerModuleLoaders = __webpack_exports__.createWorkerModuleLoaders;
166
+ exports.getPublicAssetExcludes = __webpack_exports__.getPublicAssetExcludes;
167
+ exports.shouldCopyToPublicAssets = __webpack_exports__.shouldCopyToPublicAssets;
168
+ exports.shouldCopyToWorkerBundle = __webpack_exports__.shouldCopyToWorkerBundle;
169
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
170
+ "createWorkerManifest",
171
+ "createWorkerModuleLoaders",
172
+ "getPublicAssetExcludes",
173
+ "shouldCopyToPublicAssets",
174
+ "shouldCopyToWorkerBundle"
175
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
176
+ Object.defineProperty(exports, '__esModule', {
177
+ value: true
178
+ });
@@ -0,0 +1,189 @@
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
+ createWorkerManifestServiceBindings: ()=>createWorkerManifestServiceBindings,
41
+ createWorkerServiceBindings: ()=>createWorkerServiceBindings,
42
+ createWranglerConfig: ()=>createWranglerConfig
43
+ });
44
+ const external_node_path_namespaceObject = require("node:path");
45
+ var external_node_path_default = /*#__PURE__*/ __webpack_require__.n(external_node_path_namespaceObject);
46
+ const external_constants_js_namespaceObject = require("./constants.js");
47
+ const external_utils_js_namespaceObject = require("./utils.js");
48
+ const getCompatibilityDate = (modernConfig)=>{
49
+ const configuredDate = modernConfig.deploy?.worker?.compatibilityDate?.trim();
50
+ const compatibilityDate = configuredDate || external_constants_js_namespaceObject.DEFAULT_COMPATIBILITY_DATE;
51
+ if (!external_constants_js_namespaceObject.COMPATIBILITY_DATE_PATTERN.test(compatibilityDate)) throw new Error(`deploy.worker.compatibilityDate must use YYYY-MM-DD, received ${JSON.stringify(compatibilityDate)}.`);
52
+ return compatibilityDate;
53
+ };
54
+ const getWorkerName = (appDirectory)=>{
55
+ const basename = external_node_path_default().basename(appDirectory);
56
+ return basename.replace(/[^a-zA-Z0-9-_]/g, '-') || 'modern-cloudflare-worker';
57
+ };
58
+ const getConfiguredWorkerName = (appDirectory, modernConfig)=>{
59
+ const configuredName = modernConfig.deploy?.worker?.name?.trim();
60
+ return configuredName || getWorkerName(appDirectory);
61
+ };
62
+ const getConfiguredWrangler = (modernConfig)=>{
63
+ const wrangler = modernConfig.deploy?.worker?.wrangler;
64
+ if (void 0 === wrangler) return {};
65
+ if (!(0, external_utils_js_namespaceObject.isJsonRecord)(wrangler)) throw new Error('deploy.worker.wrangler must be a JSON object.');
66
+ return wrangler;
67
+ };
68
+ const createWranglerCompatibilityFlags = (configuredFlags)=>{
69
+ if (void 0 === configuredFlags) return [
70
+ ...external_constants_js_namespaceObject.REQUIRED_COMPATIBILITY_FLAGS
71
+ ];
72
+ if (!Array.isArray(configuredFlags) || configuredFlags.some((flag)=>'string' != typeof flag)) throw new Error('deploy.worker.wrangler.compatibility_flags must be an array of strings.');
73
+ return [
74
+ ...new Set([
75
+ ...configuredFlags,
76
+ ...external_constants_js_namespaceObject.REQUIRED_COMPATIBILITY_FLAGS
77
+ ])
78
+ ];
79
+ };
80
+ const createWranglerAssetsConfig = (configuredAssets)=>{
81
+ if (void 0 !== configuredAssets && !(0, external_utils_js_namespaceObject.isJsonRecord)(configuredAssets)) throw new Error('deploy.worker.wrangler.assets must be an object.');
82
+ return {
83
+ ...(0, external_utils_js_namespaceObject.isJsonRecord)(configuredAssets) ? configuredAssets : {},
84
+ directory: `./${external_constants_js_namespaceObject.PUBLIC_ASSETS_DIRECTORY}`,
85
+ binding: external_constants_js_namespaceObject.ASSETS_BINDING,
86
+ run_worker_first: true
87
+ };
88
+ };
89
+ const assertNonEmptyString = (value, label)=>{
90
+ if ('string' != typeof value || 0 === value.trim().length) throw new Error(`${label} must be a non-empty string.`);
91
+ return value.trim();
92
+ };
93
+ const normalizeD1Database = (database, index)=>{
94
+ const binding = assertNonEmptyString(database.binding, `deploy.worker.d1Databases[${index}].binding`);
95
+ const databaseName = assertNonEmptyString(database.databaseName, `deploy.worker.d1Databases[${index}].databaseName`);
96
+ const databaseId = assertNonEmptyString(database.databaseId, `deploy.worker.d1Databases[${index}].databaseId`);
97
+ const migrationsDir = void 0 === database.migrationsDir ? void 0 : (0, external_utils_js_namespaceObject.normalizeRelativePath)(database.migrationsDir, `deploy.worker.d1Databases[${index}].migrationsDir`, 'app root');
98
+ const previewDatabaseId = void 0 === database.previewDatabaseId ? void 0 : assertNonEmptyString(database.previewDatabaseId, `deploy.worker.d1Databases[${index}].previewDatabaseId`);
99
+ return {
100
+ binding,
101
+ database_name: databaseName,
102
+ database_id: databaseId,
103
+ ...void 0 === migrationsDir ? {} : {
104
+ migrations_dir: migrationsDir
105
+ },
106
+ ...void 0 === previewDatabaseId ? {} : {
107
+ preview_database_id: previewDatabaseId
108
+ },
109
+ ...void 0 === database.remote ? {} : {
110
+ remote: database.remote
111
+ }
112
+ };
113
+ };
114
+ const createWranglerD1Databases = (modernConfig, configuredWranglerD1)=>{
115
+ const d1Databases = modernConfig.deploy?.worker?.d1Databases;
116
+ if (void 0 === d1Databases) return configuredWranglerD1;
117
+ if (void 0 !== configuredWranglerD1) throw new Error('Use deploy.worker.d1Databases or deploy.worker.wrangler.d1_databases, not both.');
118
+ if (!Array.isArray(d1Databases)) throw new Error('deploy.worker.d1Databases must be an array.');
119
+ return d1Databases.map(normalizeD1Database);
120
+ };
121
+ const normalizeServiceBinding = (service, index)=>{
122
+ const binding = assertNonEmptyString(service.binding, `deploy.worker.services[${index}].binding`);
123
+ const serviceName = assertNonEmptyString(service.service, `deploy.worker.services[${index}].service`);
124
+ const prefix = void 0 === service.prefix ? void 0 : assertNonEmptyString(service.prefix, `deploy.worker.services[${index}].prefix`);
125
+ return {
126
+ binding,
127
+ service: serviceName,
128
+ ...void 0 === prefix ? {} : {
129
+ prefix
130
+ }
131
+ };
132
+ };
133
+ const createWorkerServiceBindings = (modernConfig, configuredWranglerServices)=>{
134
+ const services = modernConfig.deploy?.worker?.services;
135
+ if (void 0 === services) return configuredWranglerServices;
136
+ if (void 0 !== configuredWranglerServices) throw new Error('Use deploy.worker.services or deploy.worker.wrangler.services, not both.');
137
+ if (!Array.isArray(services)) throw new Error('deploy.worker.services must be an array.');
138
+ return services.map(normalizeServiceBinding);
139
+ };
140
+ const createWranglerServices = (serviceBindings)=>{
141
+ if (!Array.isArray(serviceBindings)) return serviceBindings;
142
+ if (!serviceBindings.every(external_utils_js_namespaceObject.isJsonRecord)) return serviceBindings;
143
+ return serviceBindings.map((service)=>{
144
+ const { prefix, ...wranglerService } = service;
145
+ return wranglerService;
146
+ });
147
+ };
148
+ const createWorkerManifestServiceBindings = (serviceBindings)=>{
149
+ if (!Array.isArray(serviceBindings)) return;
150
+ const dispatchBindings = serviceBindings.filter((service)=>(0, external_utils_js_namespaceObject.isJsonRecord)(service) && 'string' == typeof service.binding && 'string' == typeof service.service && 'string' == typeof service.prefix).map((service)=>({
151
+ binding: service.binding,
152
+ service: service.service,
153
+ prefix: service.prefix,
154
+ interface: 'fetch'
155
+ }));
156
+ return dispatchBindings.length > 0 ? dispatchBindings : void 0;
157
+ };
158
+ const createWranglerConfig = (appDirectory, modernConfig)=>{
159
+ const wrangler = getConfiguredWrangler(modernConfig);
160
+ const d1Databases = createWranglerD1Databases(modernConfig, wrangler.d1_databases);
161
+ const serviceBindings = createWorkerServiceBindings(modernConfig, wrangler.services);
162
+ const wranglerServices = createWranglerServices(serviceBindings);
163
+ return {
164
+ $schema: 'node_modules/wrangler/config-schema.json',
165
+ name: getConfiguredWorkerName(appDirectory, modernConfig),
166
+ compatibility_date: getCompatibilityDate(modernConfig),
167
+ ...wrangler,
168
+ main: external_constants_js_namespaceObject.WORKER_ENTRY,
169
+ compatibility_flags: createWranglerCompatibilityFlags(wrangler.compatibility_flags),
170
+ assets: createWranglerAssetsConfig(wrangler.assets),
171
+ ...void 0 === d1Databases ? {} : {
172
+ d1_databases: d1Databases
173
+ },
174
+ ...void 0 === wranglerServices ? {} : {
175
+ services: wranglerServices
176
+ }
177
+ };
178
+ };
179
+ exports.createWorkerManifestServiceBindings = __webpack_exports__.createWorkerManifestServiceBindings;
180
+ exports.createWorkerServiceBindings = __webpack_exports__.createWorkerServiceBindings;
181
+ exports.createWranglerConfig = __webpack_exports__.createWranglerConfig;
182
+ for(var __rspack_i in __webpack_exports__)if (-1 === [
183
+ "createWorkerManifestServiceBindings",
184
+ "createWorkerServiceBindings",
185
+ "createWranglerConfig"
186
+ ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
187
+ Object.defineProperty(exports, '__esModule', {
188
+ value: true
189
+ });