@webflow/cloud-app 0.1.0-beta.10

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 (195) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +161 -0
  3. package/dist/bindings.d.ts +190 -0
  4. package/dist/bindings.d.ts.map +1 -0
  5. package/dist/bindings.js +126 -0
  6. package/dist/bindings.js.map +1 -0
  7. package/dist/compat-date.d.ts +68 -0
  8. package/dist/compat-date.d.ts.map +1 -0
  9. package/dist/compat-date.js +169 -0
  10. package/dist/compat-date.js.map +1 -0
  11. package/dist/config/package-json.d.ts +57 -0
  12. package/dist/config/package-json.d.ts.map +1 -0
  13. package/dist/config/package-json.js +94 -0
  14. package/dist/config/package-json.js.map +1 -0
  15. package/dist/config/webflow-json.d.ts +47 -0
  16. package/dist/config/webflow-json.d.ts.map +1 -0
  17. package/dist/config/webflow-json.js +72 -0
  18. package/dist/config/webflow-json.js.map +1 -0
  19. package/dist/create-webflow-json.d.ts +21 -0
  20. package/dist/create-webflow-json.d.ts.map +1 -0
  21. package/dist/create-webflow-json.js +168 -0
  22. package/dist/create-webflow-json.js.map +1 -0
  23. package/dist/diagnostics.d.ts +23 -0
  24. package/dist/diagnostics.d.ts.map +1 -0
  25. package/dist/diagnostics.js +31 -0
  26. package/dist/diagnostics.js.map +1 -0
  27. package/dist/errors.d.ts +13 -0
  28. package/dist/errors.d.ts.map +1 -0
  29. package/dist/errors.js +23 -0
  30. package/dist/errors.js.map +1 -0
  31. package/dist/frameworks/astro/adapter-patches/assert-adapter-nested-under-mount.d.ts +28 -0
  32. package/dist/frameworks/astro/adapter-patches/assert-adapter-nested-under-mount.d.ts.map +1 -0
  33. package/dist/frameworks/astro/adapter-patches/assert-adapter-nested-under-mount.js +148 -0
  34. package/dist/frameworks/astro/adapter-patches/assert-adapter-nested-under-mount.js.map +1 -0
  35. package/dist/frameworks/astro/adapter-patches/ensure-compatible-cloudflare-adapter.d.ts +34 -0
  36. package/dist/frameworks/astro/adapter-patches/ensure-compatible-cloudflare-adapter.d.ts.map +1 -0
  37. package/dist/frameworks/astro/adapter-patches/ensure-compatible-cloudflare-adapter.js +89 -0
  38. package/dist/frameworks/astro/adapter-patches/ensure-compatible-cloudflare-adapter.js.map +1 -0
  39. package/dist/frameworks/astro/adapter-patches/resolve-cloudflare-adapter.d.ts +39 -0
  40. package/dist/frameworks/astro/adapter-patches/resolve-cloudflare-adapter.d.ts.map +1 -0
  41. package/dist/frameworks/astro/adapter-patches/resolve-cloudflare-adapter.js +93 -0
  42. package/dist/frameworks/astro/adapter-patches/resolve-cloudflare-adapter.js.map +1 -0
  43. package/dist/frameworks/astro/astro5.d.ts +28 -0
  44. package/dist/frameworks/astro/astro5.d.ts.map +1 -0
  45. package/dist/frameworks/astro/astro5.js +276 -0
  46. package/dist/frameworks/astro/astro5.js.map +1 -0
  47. package/dist/frameworks/astro/astro6.d.ts +28 -0
  48. package/dist/frameworks/astro/astro6.d.ts.map +1 -0
  49. package/dist/frameworks/astro/astro6.js +305 -0
  50. package/dist/frameworks/astro/astro6.js.map +1 -0
  51. package/dist/frameworks/astro/astro7.d.ts +28 -0
  52. package/dist/frameworks/astro/astro7.d.ts.map +1 -0
  53. package/dist/frameworks/astro/astro7.js +303 -0
  54. package/dist/frameworks/astro/astro7.js.map +1 -0
  55. package/dist/frameworks/astro/index.d.ts +10 -0
  56. package/dist/frameworks/astro/index.d.ts.map +1 -0
  57. package/dist/frameworks/astro/index.js +16 -0
  58. package/dist/frameworks/astro/index.js.map +1 -0
  59. package/dist/frameworks/astro/session-check.d.ts +24 -0
  60. package/dist/frameworks/astro/session-check.d.ts.map +1 -0
  61. package/dist/frameworks/astro/session-check.js +166 -0
  62. package/dist/frameworks/astro/session-check.js.map +1 -0
  63. package/dist/frameworks/astro/templates/astro.config.webflow.ts +61 -0
  64. package/dist/frameworks/astro/templates/v5/astro.config.mjs.template +25 -0
  65. package/dist/frameworks/astro/templates/v5/webflow-loader.ts +126 -0
  66. package/dist/frameworks/astro/templates/v5/wrangler.json +6 -0
  67. package/dist/frameworks/astro/templates/v6/astro.config.mjs.template +35 -0
  68. package/dist/frameworks/astro/templates/v6/webflow-loader.ts +126 -0
  69. package/dist/frameworks/astro/templates/v6/wrangler.json +9 -0
  70. package/dist/frameworks/astro/templates/v7/astro.config.mjs.template +34 -0
  71. package/dist/frameworks/astro/templates/v7/webflow-loader.ts +125 -0
  72. package/dist/frameworks/astro/templates/v7/wrangler.json +9 -0
  73. package/dist/frameworks/astro/templates/webflow-image-url.ts +140 -0
  74. package/dist/frameworks/base.d.ts +134 -0
  75. package/dist/frameworks/base.d.ts.map +1 -0
  76. package/dist/frameworks/base.js +175 -0
  77. package/dist/frameworks/base.js.map +1 -0
  78. package/dist/frameworks/errors.d.ts +72 -0
  79. package/dist/frameworks/errors.d.ts.map +1 -0
  80. package/dist/frameworks/errors.js +120 -0
  81. package/dist/frameworks/errors.js.map +1 -0
  82. package/dist/frameworks/nextjs/adapter-resolver.d.ts +72 -0
  83. package/dist/frameworks/nextjs/adapter-resolver.d.ts.map +1 -0
  84. package/dist/frameworks/nextjs/adapter-resolver.js +246 -0
  85. package/dist/frameworks/nextjs/adapter-resolver.js.map +1 -0
  86. package/dist/frameworks/nextjs/index.d.ts +38 -0
  87. package/dist/frameworks/nextjs/index.d.ts.map +1 -0
  88. package/dist/frameworks/nextjs/index.js +268 -0
  89. package/dist/frameworks/nextjs/index.js.map +1 -0
  90. package/dist/frameworks/nextjs/templates/next.config.ts.template +13 -0
  91. package/dist/frameworks/nextjs/templates/next.config.webflow.ts +46 -0
  92. package/dist/frameworks/nextjs/templates/open-next.config.ts +3 -0
  93. package/dist/frameworks/nextjs/templates/webflow-loader.ts +44 -0
  94. package/dist/frameworks/nextjs/templates/wrangler.json +6 -0
  95. package/dist/frameworks/registry.d.ts +127 -0
  96. package/dist/frameworks/registry.d.ts.map +1 -0
  97. package/dist/frameworks/registry.js +257 -0
  98. package/dist/frameworks/registry.js.map +1 -0
  99. package/dist/frameworks/static/index.d.ts +116 -0
  100. package/dist/frameworks/static/index.d.ts.map +1 -0
  101. package/dist/frameworks/static/index.js +394 -0
  102. package/dist/frameworks/static/index.js.map +1 -0
  103. package/dist/frameworks/static/templates/wrangler.json +8 -0
  104. package/dist/frameworks/types.d.ts +138 -0
  105. package/dist/frameworks/types.d.ts.map +1 -0
  106. package/dist/frameworks/types.js +3 -0
  107. package/dist/frameworks/types.js.map +1 -0
  108. package/dist/frameworks/vite/index.d.ts +46 -0
  109. package/dist/frameworks/vite/index.d.ts.map +1 -0
  110. package/dist/frameworks/vite/index.js +303 -0
  111. package/dist/frameworks/vite/index.js.map +1 -0
  112. package/dist/frameworks/vite/templates/vite.config.ts.template +14 -0
  113. package/dist/frameworks/vite/templates/vite.config.webflow.ts +52 -0
  114. package/dist/frameworks/vite/templates/wrangler.json +10 -0
  115. package/dist/index.d.ts +49 -0
  116. package/dist/index.d.ts.map +1 -0
  117. package/dist/index.js +136 -0
  118. package/dist/index.js.map +1 -0
  119. package/dist/pipeline.d.ts +12 -0
  120. package/dist/pipeline.d.ts.map +1 -0
  121. package/dist/pipeline.js +293 -0
  122. package/dist/pipeline.js.map +1 -0
  123. package/dist/ports/command-runner.d.ts +59 -0
  124. package/dist/ports/command-runner.d.ts.map +1 -0
  125. package/dist/ports/command-runner.js +126 -0
  126. package/dist/ports/command-runner.js.map +1 -0
  127. package/dist/ports/filesystem.d.ts +19 -0
  128. package/dist/ports/filesystem.d.ts.map +1 -0
  129. package/dist/ports/filesystem.js +68 -0
  130. package/dist/ports/filesystem.js.map +1 -0
  131. package/dist/ports/index.d.ts +17 -0
  132. package/dist/ports/index.d.ts.map +1 -0
  133. package/dist/ports/index.js +14 -0
  134. package/dist/ports/index.js.map +1 -0
  135. package/dist/ports/logger.d.ts +22 -0
  136. package/dist/ports/logger.d.ts.map +1 -0
  137. package/dist/ports/logger.js +18 -0
  138. package/dist/ports/logger.js.map +1 -0
  139. package/dist/ports/telemetry.d.ts +23 -0
  140. package/dist/ports/telemetry.d.ts.map +1 -0
  141. package/dist/ports/telemetry.js +12 -0
  142. package/dist/ports/telemetry.js.map +1 -0
  143. package/dist/static-base-href.d.ts +31 -0
  144. package/dist/static-base-href.d.ts.map +1 -0
  145. package/dist/static-base-href.js +183 -0
  146. package/dist/static-base-href.js.map +1 -0
  147. package/dist/toolchain/errors.d.ts +32 -0
  148. package/dist/toolchain/errors.d.ts.map +1 -0
  149. package/dist/toolchain/errors.js +31 -0
  150. package/dist/toolchain/errors.js.map +1 -0
  151. package/dist/toolchain/resolver.d.ts +25 -0
  152. package/dist/toolchain/resolver.d.ts.map +1 -0
  153. package/dist/toolchain/resolver.js +200 -0
  154. package/dist/toolchain/resolver.js.map +1 -0
  155. package/dist/toolchain/types.d.ts +52 -0
  156. package/dist/toolchain/types.d.ts.map +1 -0
  157. package/dist/toolchain/types.js +10 -0
  158. package/dist/toolchain/types.js.map +1 -0
  159. package/dist/types.d.ts +71 -0
  160. package/dist/types.d.ts.map +1 -0
  161. package/dist/types.js +3 -0
  162. package/dist/types.js.map +1 -0
  163. package/dist/utils/fs.d.ts +29 -0
  164. package/dist/utils/fs.d.ts.map +1 -0
  165. package/dist/utils/fs.js +126 -0
  166. package/dist/utils/fs.js.map +1 -0
  167. package/dist/utils/index.d.ts +11 -0
  168. package/dist/utils/index.d.ts.map +1 -0
  169. package/dist/utils/index.js +27 -0
  170. package/dist/utils/index.js.map +1 -0
  171. package/dist/utils/node-version.d.ts +20 -0
  172. package/dist/utils/node-version.d.ts.map +1 -0
  173. package/dist/utils/node-version.js +113 -0
  174. package/dist/utils/node-version.js.map +1 -0
  175. package/dist/utils/process.d.ts +25 -0
  176. package/dist/utils/process.d.ts.map +1 -0
  177. package/dist/utils/process.js +40 -0
  178. package/dist/utils/process.js.map +1 -0
  179. package/dist/utils/reserved-env.d.ts +26 -0
  180. package/dist/utils/reserved-env.d.ts.map +1 -0
  181. package/dist/utils/reserved-env.js +51 -0
  182. package/dist/utils/reserved-env.js.map +1 -0
  183. package/dist/utils/template.d.ts +15 -0
  184. package/dist/utils/template.d.ts.map +1 -0
  185. package/dist/utils/template.js +75 -0
  186. package/dist/utils/template.js.map +1 -0
  187. package/dist/utils/version.d.ts +9 -0
  188. package/dist/utils/version.d.ts.map +1 -0
  189. package/dist/utils/version.js +52 -0
  190. package/dist/utils/version.js.map +1 -0
  191. package/dist/wrangler.d.ts +195 -0
  192. package/dist/wrangler.d.ts.map +1 -0
  193. package/dist/wrangler.js +372 -0
  194. package/dist/wrangler.js.map +1 -0
  195. package/package.json +48 -0
@@ -0,0 +1,276 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Astro5Builder = void 0;
37
+ /**
38
+ * Astro 5 Framework Builder
39
+ *
40
+ * Builds Astro 5.x projects for Cloudflare Workers deployment.
41
+ *
42
+ * - Node.js 18+ required
43
+ * - @astrojs/cloudflare@^12.0.0
44
+ * - Build output: dist/_worker.js/index.js (worker) + dist/ (static assets)
45
+ * - Uses platformProxy for local dev
46
+ */
47
+ const path = __importStar(require("node:path"));
48
+ const fs = __importStar(require("node:fs"));
49
+ const base_1 = require("../base");
50
+ const errors_1 = require("../errors");
51
+ const utils_1 = require("../../utils");
52
+ /** Base path for Astro 5 templates. */
53
+ const TEMPLATE_BASE = path.join(__dirname, 'templates', 'v5');
54
+ const SHARED_TEMPLATE_BASE = path.join(__dirname, 'templates');
55
+ class Astro5Builder extends base_1.FrameworkBuilder {
56
+ static frameworkName = 'astro';
57
+ // ───────────────────────────────────────────────────────────────────────────
58
+ // FRAMEWORK INFO
59
+ // ───────────────────────────────────────────────────────────────────────────
60
+ get info() {
61
+ return {
62
+ name: 'astro',
63
+ version: '5.x',
64
+ displayName: 'Astro 5',
65
+ packageName: 'astro',
66
+ };
67
+ }
68
+ getFrameworkVersion() {
69
+ return this.resolveFrameworkVersion('astro');
70
+ }
71
+ // ───────────────────────────────────────────────────────────────────────────
72
+ // DETECTION
73
+ // ───────────────────────────────────────────────────────────────────────────
74
+ /**
75
+ * Detect if this is an Astro 5 (or older) project.
76
+ *
77
+ * Version is always determined from package.json, not webflow.json.
78
+ * Astro6Builder is checked first in the registry, so Astro 6+ projects won't
79
+ * reach this builder.
80
+ */
81
+ static detect(packageJson, webflowJson) {
82
+ const specifiedFramework = webflowJson?.cloud?.framework;
83
+ // If webflow.json specifies a DIFFERENT framework, don't match.
84
+ if (specifiedFramework && specifiedFramework !== 'astro') {
85
+ return { detected: false };
86
+ }
87
+ const astroVersion = packageJson.dependencies?.astro || packageJson.devDependencies?.astro;
88
+ if (!astroVersion) {
89
+ // If webflow.json says "astro" but no astro package, still try (might be installed later).
90
+ if (specifiedFramework === 'astro') {
91
+ return { detected: true, reason: 'Specified as astro in webflow.json' };
92
+ }
93
+ return { detected: false };
94
+ }
95
+ const majorVersion = (0, utils_1.getMajorVersion)(astroVersion);
96
+ // Astro 6+ is handled by Astro6Builder (checked first in registry).
97
+ if (majorVersion !== null && majorVersion >= 6) {
98
+ return { detected: false };
99
+ }
100
+ return { detected: true, reason: `Found astro@${astroVersion}` };
101
+ }
102
+ // ───────────────────────────────────────────────────────────────────────────
103
+ // VALIDATION
104
+ // ───────────────────────────────────────────────────────────────────────────
105
+ async validate() {
106
+ const { log, packageJson } = this.ctx;
107
+ const nodeReq = this.getNodeVersionRequirement();
108
+ if (nodeReq) {
109
+ (0, utils_1.validateNodeVersion)(log, nodeReq, this.info.displayName);
110
+ }
111
+ const astroVersion = packageJson.dependencies?.astro || packageJson.devDependencies?.astro;
112
+ if (!astroVersion) {
113
+ throw new errors_1.FrameworkValidationError('Astro is not installed in this project.', {
114
+ remediation: 'Install Astro by running: npm install astro@^5.0.0',
115
+ documentationUrl: 'https://docs.astro.build/en/install/',
116
+ });
117
+ }
118
+ // Reject "latest" explicitly — it could resolve to Astro 6.x.
119
+ if (astroVersion === 'latest') {
120
+ throw new errors_1.FrameworkValidationError('Astro version "latest" is not supported by Webflow Cloud.', { remediation: 'Please specify a version, e.g.: npm install astro@^5.0.0' });
121
+ }
122
+ const majorVersion = (0, utils_1.getMajorVersion)(astroVersion);
123
+ if (majorVersion !== null && majorVersion >= 6) {
124
+ throw new errors_1.FrameworkValidationError(`Astro ${majorVersion}.x detected but was routed to the Astro 5 builder. This is an internal error.`, {
125
+ remediation: 'Ensure your package.json has astro@^6.0.0 - the Astro 6 builder will be used automatically. ' +
126
+ 'If this persists, please report the issue.',
127
+ });
128
+ }
129
+ log.info(`Validated Astro project: astro@${astroVersion}`);
130
+ }
131
+ // ───────────────────────────────────────────────────────────────────────────
132
+ // DEPENDENCIES
133
+ // ───────────────────────────────────────────────────────────────────────────
134
+ getCloudflareAdapter() {
135
+ return {
136
+ name: '@astrojs/cloudflare',
137
+ version: '^12.0.0',
138
+ };
139
+ }
140
+ getRequiredIntegrations() {
141
+ return [
142
+ {
143
+ name: '@astrojs/react',
144
+ version: '^4.0.0',
145
+ reason: 'Required for Webflow React components',
146
+ },
147
+ ];
148
+ }
149
+ async installDependencies() {
150
+ const { log, cwd, runCommand } = this.ctx;
151
+ const adapter = this.getCloudflareAdapter();
152
+ if (!this.hasDependency(adapter.name)) {
153
+ log.warn(`Installing ${adapter.name}@${adapter.version} (required for Cloudflare deployment)...`);
154
+ await (0, utils_1.npm)({
155
+ log,
156
+ runCommand,
157
+ cwd,
158
+ args: ['install', '--save', `${adapter.name}@${adapter.version}`],
159
+ });
160
+ }
161
+ for (const integration of this.getRequiredIntegrations()) {
162
+ if (!this.hasDependency(integration.name)) {
163
+ log.warn(`Installing ${integration.name}@${integration.version} (${integration.reason})...`);
164
+ await (0, utils_1.npm)({
165
+ log,
166
+ runCommand,
167
+ cwd,
168
+ args: ['install', '--save', `${integration.name}@${integration.version}`],
169
+ });
170
+ }
171
+ }
172
+ }
173
+ // ───────────────────────────────────────────────────────────────────────────
174
+ // CONFIGURATION
175
+ // ───────────────────────────────────────────────────────────────────────────
176
+ getWebflowLoader() {
177
+ return {
178
+ templatePath: path.join(TEMPLATE_BASE, 'webflow-loader.ts'),
179
+ destinationName: 'webflow-loader.ts',
180
+ configPath: './webflow-loader.ts',
181
+ };
182
+ }
183
+ getUserConfigPatterns() {
184
+ return ['astro.config.mjs', 'astro.config.cjs', 'astro.config.js', 'astro.config.ts'];
185
+ }
186
+ getWranglerTemplatePath() {
187
+ return path.join(TEMPLATE_BASE, 'wrangler.json');
188
+ }
189
+ getAdditionalConfigFiles() {
190
+ const loader = this.getWebflowLoader();
191
+ return [
192
+ loader.templatePath,
193
+ path.join(SHARED_TEMPLATE_BASE, 'astro.config.webflow.ts'),
194
+ path.join(SHARED_TEMPLATE_BASE, 'webflow-image-url.ts'),
195
+ ];
196
+ }
197
+ async prepareConfig() {
198
+ const { log, cwd, userEnv } = this.ctx;
199
+ // Rename user's astro.config.* to clouduser.astro.config.*; if there is no
200
+ // user config, write an empty stub so the generated template's static
201
+ // import always resolves.
202
+ const renamedUserConfig = (0, utils_1.renameUserConfig)(log, cwd, 'astro.config', [
203
+ 'mjs',
204
+ 'cjs',
205
+ 'js',
206
+ 'ts',
207
+ ]);
208
+ if (renamedUserConfig === null) {
209
+ log.info('no user astro.config.{mjs,cjs,js,ts} found — writing empty clouduser.astro.config.mjs stub');
210
+ fs.writeFileSync(path.join(cwd, 'clouduser.astro.config.mjs'), 'export default {};\n');
211
+ }
212
+ // Copy the merge-logic library (real source, not a template). The generated
213
+ // astro.config.mjs statically imports it, so fail loudly if the package did
214
+ // not ship it rather than failing later with an opaque module error.
215
+ const webflowConfigSrc = path.join(SHARED_TEMPLATE_BASE, 'astro.config.webflow.ts');
216
+ if (!(0, utils_1.fileExists)(webflowConfigSrc)) {
217
+ throw new Error(`Missing packaged template: ${webflowConfigSrc}`);
218
+ }
219
+ log.info('Copying astro.config.webflow.ts...');
220
+ fs.copyFileSync(webflowConfigSrc, path.join(cwd, 'astro.config.webflow.ts'));
221
+ // Copy the shared image-url helper that webflow-loader.ts imports. It is a
222
+ // hard dependency of the generated loader, so fail loudly if the package did
223
+ // not ship it rather than letting the user's build fail later with an opaque
224
+ // "Cannot find module './webflow-image-url'".
225
+ const imageUrlSrc = path.join(SHARED_TEMPLATE_BASE, 'webflow-image-url.ts');
226
+ if (!(0, utils_1.fileExists)(imageUrlSrc)) {
227
+ throw new Error(`Missing packaged template: ${imageUrlSrc}`);
228
+ }
229
+ log.info('Copying webflow-image-url.ts...');
230
+ fs.copyFileSync(imageUrlSrc, path.join(cwd, 'webflow-image-url.ts'));
231
+ // Render the single astro.config.mjs template.
232
+ const templatePath = path.join(TEMPLATE_BASE, 'astro.config.mjs.template');
233
+ const destPath = path.join(cwd, 'astro.config.mjs');
234
+ log.info('Generating astro.config.mjs from template...');
235
+ await (0, utils_1.envsubst)(log, templatePath, destPath, {
236
+ ...process.env,
237
+ ...userEnv,
238
+ });
239
+ // Copy webflow-loader.ts.
240
+ const loader = this.getWebflowLoader();
241
+ if ((0, utils_1.fileExists)(loader.templatePath)) {
242
+ log.info(`Copying ${loader.destinationName}...`);
243
+ fs.copyFileSync(loader.templatePath, path.join(cwd, loader.destinationName));
244
+ }
245
+ // wrangler.json is owned exclusively by `handleWranglerJson`, which runs
246
+ // before this hook and is the only function permitted to write
247
+ // /wrangler.json.
248
+ }
249
+ // ───────────────────────────────────────────────────────────────────────────
250
+ // BUILD
251
+ // ───────────────────────────────────────────────────────────────────────────
252
+ getBuildCommand() {
253
+ return 'astro build';
254
+ }
255
+ getNodeVersionRequirement() {
256
+ return {
257
+ minimum: '18.0.0',
258
+ severity: 'error',
259
+ };
260
+ }
261
+ // ───────────────────────────────────────────────────────────────────────────
262
+ // OUTPUT
263
+ // ───────────────────────────────────────────────────────────────────────────
264
+ static getOutputDeployMetadata() {
265
+ return {
266
+ staticAssetsPath: 'dist',
267
+ staticAssetsExclude: ['_worker.js'],
268
+ workerEntryPath: 'dist/_worker.js/index.js',
269
+ deploymentType: 'ssr',
270
+ // After wrangler dry-run, the bundled output is ./index.js
271
+ dryRunEntryPath: './index.js',
272
+ };
273
+ }
274
+ }
275
+ exports.Astro5Builder = Astro5Builder;
276
+ //# sourceMappingURL=astro5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"astro5.js","sourceRoot":"","sources":["../../../src/frameworks/astro/astro5.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;GASG;AACH,gDAAkC;AAClC,4CAA8B;AAE9B,kCAA2C;AAY3C,sCAAqD;AACrD,uCAOqB;AAErB,uCAAuC;AACvC,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC;AAC9D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,GAAG,OAAO,CAAC,GAAG;YACd,GAAG,OAAO;SACX,CAAC,CAAC;QAEH,0BAA0B;QAC1B,MAAM,MAAM,GAAG,IAAI,CAAC,gBAAgB,EAAE,CAAC;QACvC,IAAI,IAAA,kBAAU,EAAC,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC;YACpC,GAAG,CAAC,IAAI,CAAC,WAAW,MAAM,CAAC,eAAe,KAAK,CAAC,CAAC;YACjD,EAAE,CAAC,YAAY,CAAC,MAAM,CAAC,YAAY,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,eAAe,CAAC,CAAC,CAAC;QAC/E,CAAC;QAED,yEAAyE;QACzE,+DAA+D;QAC/D,kBAAkB;IACpB,CAAC;IAED,8EAA8E;IAC9E,QAAQ;IACR,8EAA8E;IAE9E,eAAe;QACb,OAAO,aAAa,CAAC;IACvB,CAAC;IAED,yBAAyB;QACvB,OAAO;YACL,OAAO,EAAE,QAAQ;YACjB,QAAQ,EAAE,OAAO;SAClB,CAAC;IACJ,CAAC;IAED,8EAA8E;IAC9E,SAAS;IACT,8EAA8E;IAE9E,MAAM,CAAU,uBAAuB;QACrC,OAAO;YACL,gBAAgB,EAAE,MAAM;YACxB,mBAAmB,EAAE,CAAC,YAAY,CAAC;YACnC,eAAe,EAAE,0BAA0B;YAC3C,cAAc,EAAE,KAAK;YACrB,2DAA2D;YAC3D,eAAe,EAAE,YAAY;SAC9B,CAAC;IACJ,CAAC;;AAnRH,sCAoRC"}
@@ -0,0 +1,28 @@
1
+ import { FrameworkBuilder } from '../base';
2
+ import type { BuildOutput, FrameworkInfo, PackageJson, WebflowJson, DetectionResult, AdapterPackage, IntegrationPackage, WebflowLoaderConfig, NodeVersionRequirement } from '../types';
3
+ export declare class Astro6Builder extends FrameworkBuilder {
4
+ static frameworkName: string;
5
+ get info(): FrameworkInfo;
6
+ getFrameworkVersion(): string | undefined;
7
+ /**
8
+ * Detect if this is an Astro 6 project.
9
+ *
10
+ * Version is always determined from package.json, not webflow.json. The
11
+ * registry checks Astro6Builder before Astro5Builder, so Astro 6+ projects
12
+ * are detected here first.
13
+ */
14
+ static detect(packageJson: PackageJson, webflowJson?: WebflowJson): DetectionResult;
15
+ validate(): Promise<void>;
16
+ getCloudflareAdapter(): AdapterPackage;
17
+ getRequiredIntegrations(): IntegrationPackage[];
18
+ installDependencies(): Promise<void>;
19
+ getWebflowLoader(): WebflowLoaderConfig;
20
+ getUserConfigPatterns(): string[];
21
+ getWranglerTemplatePath(): string;
22
+ getAdditionalConfigFiles(): string[];
23
+ prepareConfig(): Promise<void>;
24
+ getBuildCommand(): string;
25
+ getNodeVersionRequirement(): NodeVersionRequirement;
26
+ static getOutputDeployMetadata(): BuildOutput;
27
+ }
28
+ //# sourceMappingURL=astro6.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"astro6.d.ts","sourceRoot":"","sources":["../../../src/frameworks/astro/astro6.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,WAAW,EACX,WAAW,EACX,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,UAAU,CAAC;AAiBlB,qBAAa,aAAc,SAAQ,gBAAgB;IACjD,OAAgB,aAAa,SAAW;IAMxC,IAAI,IAAI,IAAI,aAAa,CAOxB;IAEQ,mBAAmB,IAAI,MAAM,GAAG,SAAS;IAQlD;;;;;;OAMG;WACa,MAAM,CAAC,WAAW,EAAE,WAAW,EAAE,WAAW,CAAC,EAAE,WAAW,GAAG,eAAe;IAgCtF,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAoD/B,oBAAoB,IAAI,cAAc;IAWtC,uBAAuB,IAAI,kBAAkB,EAAE;IAUzC,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IA8C1C,gBAAgB,IAAI,mBAAmB;IAQvC,qBAAqB,IAAI,MAAM,EAAE;IAIjC,uBAAuB,IAAI,MAAM;IAIjC,wBAAwB,IAAI,MAAM,EAAE;IAS9B,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAkEpC,eAAe,IAAI,MAAM;IAIzB,yBAAyB,IAAI,sBAAsB;WAWnC,uBAAuB,IAAI,WAAW;CAkBvD"}
@@ -0,0 +1,305 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
15
+ }) : function(o, v) {
16
+ o["default"] = v;
17
+ });
18
+ var __importStar = (this && this.__importStar) || (function () {
19
+ var ownKeys = function(o) {
20
+ ownKeys = Object.getOwnPropertyNames || function (o) {
21
+ var ar = [];
22
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
+ return ar;
24
+ };
25
+ return ownKeys(o);
26
+ };
27
+ return function (mod) {
28
+ if (mod && mod.__esModule) return mod;
29
+ var result = {};
30
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
+ __setModuleDefault(result, mod);
32
+ return result;
33
+ };
34
+ })();
35
+ Object.defineProperty(exports, "__esModule", { value: true });
36
+ exports.Astro6Builder = void 0;
37
+ /**
38
+ * Astro 6 Framework Builder
39
+ *
40
+ * Builds Astro 6.x projects for Cloudflare Workers deployment.
41
+ *
42
+ * - Node.js 22.12.0+ required
43
+ * - @astrojs/cloudflare@^13.0.0 (uses @cloudflare/vite-plugin)
44
+ * - Build output: dist/server/entry.mjs (worker) + dist/client/ (static assets)
45
+ * - Uses workerd natively for dev (no platformProxy)
46
+ * - wrangler.json main: "@astrojs/cloudflare/entrypoints/server"
47
+ */
48
+ const path = __importStar(require("node:path"));
49
+ const fs = __importStar(require("node:fs"));
50
+ const base_1 = require("../base");
51
+ const errors_1 = require("../errors");
52
+ const ensure_compatible_cloudflare_adapter_1 = require("./adapter-patches/ensure-compatible-cloudflare-adapter");
53
+ const resolve_cloudflare_adapter_1 = require("./adapter-patches/resolve-cloudflare-adapter");
54
+ const utils_1 = require("../../utils");
55
+ /** Base path for Astro 6 templates. */
56
+ const TEMPLATE_BASE = path.join(__dirname, 'templates', 'v6');
57
+ const SHARED_TEMPLATE_BASE = path.join(__dirname, 'templates');
58
+ class Astro6Builder extends base_1.FrameworkBuilder {
59
+ static frameworkName = 'astro';
60
+ // ───────────────────────────────────────────────────────────────────────────
61
+ // FRAMEWORK INFO
62
+ // ───────────────────────────────────────────────────────────────────────────
63
+ get info() {
64
+ return {
65
+ name: 'astro',
66
+ version: '6.x',
67
+ displayName: 'Astro 6',
68
+ packageName: 'astro',
69
+ };
70
+ }
71
+ getFrameworkVersion() {
72
+ return this.resolveFrameworkVersion('astro');
73
+ }
74
+ // ───────────────────────────────────────────────────────────────────────────
75
+ // DETECTION
76
+ // ───────────────────────────────────────────────────────────────────────────
77
+ /**
78
+ * Detect if this is an Astro 6 project.
79
+ *
80
+ * Version is always determined from package.json, not webflow.json. The
81
+ * registry checks Astro6Builder before Astro5Builder, so Astro 6+ projects
82
+ * are detected here first.
83
+ */
84
+ static detect(packageJson, webflowJson) {
85
+ const specifiedFramework = webflowJson?.cloud?.framework;
86
+ // If webflow.json specifies a DIFFERENT framework, don't match.
87
+ if (specifiedFramework && specifiedFramework !== 'astro') {
88
+ return { detected: false };
89
+ }
90
+ const astroVersion = packageJson.dependencies?.astro || packageJson.devDependencies?.astro;
91
+ if (!astroVersion) {
92
+ return { detected: false };
93
+ }
94
+ const majorVersion = (0, utils_1.getMajorVersion)(astroVersion);
95
+ // Astro 7+ has its own builder; defer even when detection order changes.
96
+ if (majorVersion !== null && majorVersion >= 7) {
97
+ return { detected: false };
98
+ }
99
+ if (majorVersion !== null && majorVersion >= 6) {
100
+ return { detected: true, reason: `Found astro@${astroVersion} (Astro ${majorVersion}.x)` };
101
+ }
102
+ return { detected: false };
103
+ }
104
+ // ───────────────────────────────────────────────────────────────────────────
105
+ // VALIDATION
106
+ // ───────────────────────────────────────────────────────────────────────────
107
+ async validate() {
108
+ const { log, packageJson } = this.ctx;
109
+ // Astro 6 requires Node 22+.
110
+ const nodeReq = this.getNodeVersionRequirement();
111
+ if (nodeReq) {
112
+ (0, utils_1.validateNodeVersion)(log, nodeReq, this.info.displayName);
113
+ }
114
+ const astroVersion = packageJson.dependencies?.astro || packageJson.devDependencies?.astro;
115
+ if (!astroVersion) {
116
+ throw new errors_1.FrameworkValidationError('Astro is not installed in this project.', {
117
+ remediation: 'Install Astro by running: npm install astro@^6.0.0',
118
+ documentationUrl: 'https://docs.astro.build/en/install/',
119
+ });
120
+ }
121
+ // Reject "latest" explicitly.
122
+ if (astroVersion === 'latest') {
123
+ throw new errors_1.FrameworkValidationError('Astro version "latest" is not supported by Webflow Cloud.', { remediation: 'Please specify a version, e.g.: npm install astro@^6.0.0' });
124
+ }
125
+ const majorVersion = (0, utils_1.getMajorVersion)(astroVersion);
126
+ if (majorVersion !== null && majorVersion < 6) {
127
+ throw new errors_1.FrameworkValidationError(`Astro ${majorVersion}.x detected but Astro6Builder was selected. This is likely a configuration error.`, {
128
+ remediation: 'Use Astro5Builder for Astro 5.x projects, or upgrade: npm install astro@^6.0.0',
129
+ });
130
+ }
131
+ if (majorVersion !== null && majorVersion >= 7) {
132
+ throw new errors_1.FrameworkValidationError(`Astro ${majorVersion}.x detected but Astro6Builder was selected. This is likely a configuration error.`, { remediation: 'Astro 7+ projects are handled by Astro7Builder.' });
133
+ }
134
+ log.info(`Validated Astro 6 project: astro@${astroVersion}`);
135
+ }
136
+ // ───────────────────────────────────────────────────────────────────────────
137
+ // DEPENDENCIES
138
+ // ───────────────────────────────────────────────────────────────────────────
139
+ getCloudflareAdapter() {
140
+ // Range is resolved from the project's Astro version (Astro 6 -> `^13.3.1`). The
141
+ // floor is the first release that fixes the base-path bug (withastro/astro#16276);
142
+ // 13.0.0–13.3.0 emit the client tree without the base prefix and break mounted apps.
143
+ return {
144
+ name: '@astrojs/cloudflare',
145
+ version: (0, resolve_cloudflare_adapter_1.resolveCloudflareAdapterRange)(this.getDependencyVersion('astro')),
146
+ peerDependencies: ['@cloudflare/vite-plugin'],
147
+ };
148
+ }
149
+ getRequiredIntegrations() {
150
+ return [
151
+ {
152
+ name: '@astrojs/react',
153
+ version: '^5.0.0', // Astro 6 compatible version
154
+ reason: 'Required for Webflow React components',
155
+ },
156
+ ];
157
+ }
158
+ async installDependencies() {
159
+ const { log, cwd, runCommand } = this.ctx;
160
+ // @astrojs/cloudflare < 13.3.1 has the base-path bug (withastro/astro#16276); clamp the
161
+ // adapter into the compatible range so the assets-copy guard (assertAdapterNestedUnderMount)
162
+ // is nearly unreachable rather than papering over broken (unprefixed) asset URLs. Shared
163
+ // with Astro 7 so the two paths can't silently diverge.
164
+ const adapter = this.getCloudflareAdapter();
165
+ await (0, ensure_compatible_cloudflare_adapter_1.ensureCompatibleCloudflareAdapter)({
166
+ log,
167
+ runCommand,
168
+ cwd,
169
+ adapterName: adapter.name,
170
+ compatibleRange: adapter.version,
171
+ declaredVersion: this.getDependencyVersion(adapter.name),
172
+ });
173
+ // Install peer dependencies.
174
+ if (adapter.peerDependencies) {
175
+ for (const peer of adapter.peerDependencies) {
176
+ if (!this.hasDependency(peer)) {
177
+ log.warn(`Installing ${peer} (peer dependency of ${adapter.name})...`);
178
+ await (0, utils_1.npm)({ log, runCommand, cwd, args: ['install', '--save', peer] });
179
+ }
180
+ }
181
+ }
182
+ for (const integration of this.getRequiredIntegrations()) {
183
+ if (!this.hasDependency(integration.name)) {
184
+ log.warn(`Installing ${integration.name}@${integration.version} (${integration.reason})...`);
185
+ await (0, utils_1.npm)({
186
+ log,
187
+ runCommand,
188
+ cwd,
189
+ args: ['install', '--save', `${integration.name}@${integration.version}`],
190
+ });
191
+ }
192
+ }
193
+ }
194
+ // ───────────────────────────────────────────────────────────────────────────
195
+ // CONFIGURATION
196
+ // ───────────────────────────────────────────────────────────────────────────
197
+ getWebflowLoader() {
198
+ return {
199
+ templatePath: path.join(TEMPLATE_BASE, 'webflow-loader.ts'),
200
+ destinationName: 'webflow-loader.ts',
201
+ configPath: './webflow-loader.ts',
202
+ };
203
+ }
204
+ getUserConfigPatterns() {
205
+ return ['astro.config.mjs', 'astro.config.cjs', 'astro.config.js', 'astro.config.ts'];
206
+ }
207
+ getWranglerTemplatePath() {
208
+ return path.join(TEMPLATE_BASE, 'wrangler.json');
209
+ }
210
+ getAdditionalConfigFiles() {
211
+ const loader = this.getWebflowLoader();
212
+ return [
213
+ loader.templatePath,
214
+ path.join(SHARED_TEMPLATE_BASE, 'astro.config.webflow.ts'),
215
+ path.join(SHARED_TEMPLATE_BASE, 'webflow-image-url.ts'),
216
+ ];
217
+ }
218
+ async prepareConfig() {
219
+ const { log, cwd, userEnv } = this.ctx;
220
+ // Rename user's astro.config.* to clouduser.astro.config.*; if there is no
221
+ // user config, write an empty stub so the generated template's static
222
+ // import always resolves.
223
+ const renamedUserConfig = (0, utils_1.renameUserConfig)(log, cwd, 'astro.config', [
224
+ 'mjs',
225
+ 'cjs',
226
+ 'js',
227
+ 'ts',
228
+ ]);
229
+ if (renamedUserConfig === null) {
230
+ log.info('no user astro.config.{mjs,cjs,js,ts} found — writing empty clouduser.astro.config.mjs stub');
231
+ fs.writeFileSync(path.join(cwd, 'clouduser.astro.config.mjs'), 'export default {};\n');
232
+ }
233
+ // Copy the merge-logic library (real source, not a template). The generated
234
+ // astro.config.mjs statically imports it, so fail loudly if the package did
235
+ // not ship it rather than failing later with an opaque module error.
236
+ const webflowConfigSrc = path.join(SHARED_TEMPLATE_BASE, 'astro.config.webflow.ts');
237
+ if (!(0, utils_1.fileExists)(webflowConfigSrc)) {
238
+ throw new Error(`Missing packaged template: ${webflowConfigSrc}`);
239
+ }
240
+ log.info('Copying astro.config.webflow.ts...');
241
+ fs.copyFileSync(webflowConfigSrc, path.join(cwd, 'astro.config.webflow.ts'));
242
+ // Copy the shared image-url helper that webflow-loader.ts imports. It is a
243
+ // hard dependency of the generated loader, so fail loudly if the package did
244
+ // not ship it rather than letting the user's build fail later with an opaque
245
+ // "Cannot find module './webflow-image-url'".
246
+ const imageUrlSrc = path.join(SHARED_TEMPLATE_BASE, 'webflow-image-url.ts');
247
+ if (!(0, utils_1.fileExists)(imageUrlSrc)) {
248
+ throw new Error(`Missing packaged template: ${imageUrlSrc}`);
249
+ }
250
+ log.info('Copying webflow-image-url.ts...');
251
+ fs.copyFileSync(imageUrlSrc, path.join(cwd, 'webflow-image-url.ts'));
252
+ // Render the single astro.config.mjs template.
253
+ const templatePath = path.join(TEMPLATE_BASE, 'astro.config.mjs.template');
254
+ const destPath = path.join(cwd, 'astro.config.mjs');
255
+ log.info('Generating astro.config.mjs from template (Astro 6)...');
256
+ await (0, utils_1.envsubst)(log, templatePath, destPath, {
257
+ ...process.env,
258
+ ...userEnv,
259
+ });
260
+ // Copy webflow-loader.ts.
261
+ const loader = this.getWebflowLoader();
262
+ if ((0, utils_1.fileExists)(loader.templatePath)) {
263
+ log.info(`Copying ${loader.destinationName}...`);
264
+ fs.copyFileSync(loader.templatePath, path.join(cwd, loader.destinationName));
265
+ }
266
+ // wrangler.json is owned exclusively by `handleWranglerJson`, which runs
267
+ // before this hook and is the only function permitted to write
268
+ // /wrangler.json.
269
+ }
270
+ // ───────────────────────────────────────────────────────────────────────────
271
+ // BUILD
272
+ // ───────────────────────────────────────────────────────────────────────────
273
+ getBuildCommand() {
274
+ return 'astro build';
275
+ }
276
+ getNodeVersionRequirement() {
277
+ return {
278
+ minimum: '22.12.0',
279
+ severity: 'error', // Astro 6 will definitely fail without Node 22+
280
+ };
281
+ }
282
+ // ───────────────────────────────────────────────────────────────────────────
283
+ // OUTPUT
284
+ // ───────────────────────────────────────────────────────────────────────────
285
+ static getOutputDeployMetadata() {
286
+ return {
287
+ staticAssetsPath: 'dist/client',
288
+ // No exclude needed — Astro 6 has clean separation.
289
+ workerEntryPath: 'dist/server/entry.mjs',
290
+ wranglerMainOverride: '@astrojs/cloudflare/entrypoints/server',
291
+ deploymentType: 'ssr',
292
+ usesAssetsBinding: true,
293
+ // Astro 6 outputs multiple files (entry.mjs + chunks/*) that need bundling.
294
+ skipNoBundle: true,
295
+ // A fixed @astrojs/cloudflare nests the client tree under dist/client/<mount>/
296
+ // (base = mountPath), so the copy takes dist/client verbatim into the assets root
297
+ // instead of the blind Astro 5 / Next.js mount append.
298
+ staticAssetsMirrorUrlLayout: true,
299
+ // After wrangler dry-run, the bundled output is ./entry.mjs
300
+ dryRunEntryPath: './entry.mjs',
301
+ };
302
+ }
303
+ }
304
+ exports.Astro6Builder = Astro6Builder;
305
+ //# sourceMappingURL=astro6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"astro6.js","sourceRoot":"","sources":["../../../src/frameworks/astro/astro6.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;GAUG;AACH,gDAAkC;AAClC,4CAA8B;AAE9B,kCAA2C;AAY3C,sCAAqD;AACrD,iHAA2G;AAC3G,6FAA6F;AAC7F,uCAOqB;AAErB,uCAAuC;AACvC,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC;AAC9D,MAAM,oBAAoB,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AAE/D,MAAa,aAAc,SAAQ,uBAAgB;IACj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