@webflow/cloud-app 0.1.0-beta.7
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.
- package/LICENSE +21 -0
- package/README.md +93 -0
- package/dist/bindings.d.ts +185 -0
- package/dist/bindings.d.ts.map +1 -0
- package/dist/bindings.js +120 -0
- package/dist/bindings.js.map +1 -0
- package/dist/config/package-json.d.ts +57 -0
- package/dist/config/package-json.d.ts.map +1 -0
- package/dist/config/package-json.js +94 -0
- package/dist/config/package-json.js.map +1 -0
- package/dist/config/webflow-json.d.ts +53 -0
- package/dist/config/webflow-json.d.ts.map +1 -0
- package/dist/config/webflow-json.js +72 -0
- package/dist/config/webflow-json.js.map +1 -0
- package/dist/create-webflow-json.d.ts +24 -0
- package/dist/create-webflow-json.d.ts.map +1 -0
- package/dist/create-webflow-json.js +170 -0
- package/dist/create-webflow-json.js.map +1 -0
- package/dist/errors.d.ts +13 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +23 -0
- package/dist/errors.js.map +1 -0
- package/dist/frameworks/astro/adapter-patches/ensure-fixed-cloudflare-adapter.d.ts +36 -0
- package/dist/frameworks/astro/adapter-patches/ensure-fixed-cloudflare-adapter.d.ts.map +1 -0
- package/dist/frameworks/astro/adapter-patches/ensure-fixed-cloudflare-adapter.js +94 -0
- package/dist/frameworks/astro/adapter-patches/ensure-fixed-cloudflare-adapter.js.map +1 -0
- package/dist/frameworks/astro/adapter-patches/strip-cloudflare-base-nesting.d.ts +2 -0
- package/dist/frameworks/astro/adapter-patches/strip-cloudflare-base-nesting.d.ts.map +1 -0
- package/dist/frameworks/astro/adapter-patches/strip-cloudflare-base-nesting.js +97 -0
- package/dist/frameworks/astro/adapter-patches/strip-cloudflare-base-nesting.js.map +1 -0
- package/dist/frameworks/astro/astro5.d.ts +28 -0
- package/dist/frameworks/astro/astro5.d.ts.map +1 -0
- package/dist/frameworks/astro/astro5.js +259 -0
- package/dist/frameworks/astro/astro5.js.map +1 -0
- package/dist/frameworks/astro/astro6.d.ts +28 -0
- package/dist/frameworks/astro/astro6.d.ts.map +1 -0
- package/dist/frameworks/astro/astro6.js +286 -0
- package/dist/frameworks/astro/astro6.js.map +1 -0
- package/dist/frameworks/astro/astro7.d.ts +28 -0
- package/dist/frameworks/astro/astro7.d.ts.map +1 -0
- package/dist/frameworks/astro/astro7.js +283 -0
- package/dist/frameworks/astro/astro7.js.map +1 -0
- package/dist/frameworks/astro/index.d.ts +10 -0
- package/dist/frameworks/astro/index.d.ts.map +1 -0
- package/dist/frameworks/astro/index.js +16 -0
- package/dist/frameworks/astro/index.js.map +1 -0
- package/dist/frameworks/astro/templates/astro.config.webflow.ts +61 -0
- package/dist/frameworks/astro/templates/v5/astro.config.mjs.template +25 -0
- package/dist/frameworks/astro/templates/v5/webflow-loader.ts +103 -0
- package/dist/frameworks/astro/templates/v5/wrangler.json +6 -0
- package/dist/frameworks/astro/templates/v6/astro.config.mjs.template +35 -0
- package/dist/frameworks/astro/templates/v6/webflow-loader.ts +112 -0
- package/dist/frameworks/astro/templates/v6/wrangler.json +9 -0
- package/dist/frameworks/astro/templates/v7/astro.config.mjs.template +34 -0
- package/dist/frameworks/astro/templates/v7/webflow-loader.ts +113 -0
- package/dist/frameworks/astro/templates/v7/wrangler.json +9 -0
- package/dist/frameworks/base.d.ts +134 -0
- package/dist/frameworks/base.d.ts.map +1 -0
- package/dist/frameworks/base.js +175 -0
- package/dist/frameworks/base.js.map +1 -0
- package/dist/frameworks/errors.d.ts +72 -0
- package/dist/frameworks/errors.d.ts.map +1 -0
- package/dist/frameworks/errors.js +120 -0
- package/dist/frameworks/errors.js.map +1 -0
- package/dist/frameworks/nextjs/adapter-resolver.d.ts +72 -0
- package/dist/frameworks/nextjs/adapter-resolver.d.ts.map +1 -0
- package/dist/frameworks/nextjs/adapter-resolver.js +246 -0
- package/dist/frameworks/nextjs/adapter-resolver.js.map +1 -0
- package/dist/frameworks/nextjs/index.d.ts +38 -0
- package/dist/frameworks/nextjs/index.d.ts.map +1 -0
- package/dist/frameworks/nextjs/index.js +268 -0
- package/dist/frameworks/nextjs/index.js.map +1 -0
- package/dist/frameworks/nextjs/templates/next.config.ts.template +13 -0
- package/dist/frameworks/nextjs/templates/next.config.webflow.ts +46 -0
- package/dist/frameworks/nextjs/templates/open-next.config.ts +3 -0
- package/dist/frameworks/nextjs/templates/webflow-loader.ts +44 -0
- package/dist/frameworks/nextjs/templates/wrangler.json +6 -0
- package/dist/frameworks/registry.d.ts +127 -0
- package/dist/frameworks/registry.d.ts.map +1 -0
- package/dist/frameworks/registry.js +257 -0
- package/dist/frameworks/registry.js.map +1 -0
- package/dist/frameworks/static/index.d.ts +93 -0
- package/dist/frameworks/static/index.d.ts.map +1 -0
- package/dist/frameworks/static/index.js +352 -0
- package/dist/frameworks/static/index.js.map +1 -0
- package/dist/frameworks/static/templates/wrangler.json +7 -0
- package/dist/frameworks/types.d.ts +138 -0
- package/dist/frameworks/types.d.ts.map +1 -0
- package/dist/frameworks/types.js +3 -0
- package/dist/frameworks/types.js.map +1 -0
- package/dist/frameworks/vite/index.d.ts +46 -0
- package/dist/frameworks/vite/index.d.ts.map +1 -0
- package/dist/frameworks/vite/index.js +303 -0
- package/dist/frameworks/vite/index.js.map +1 -0
- package/dist/frameworks/vite/templates/vite.config.ts.template +14 -0
- package/dist/frameworks/vite/templates/vite.config.webflow.ts +52 -0
- package/dist/frameworks/vite/templates/wrangler.json +10 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +118 -0
- package/dist/index.js.map +1 -0
- package/dist/pipeline.d.ts +8 -0
- package/dist/pipeline.d.ts.map +1 -0
- package/dist/pipeline.js +263 -0
- package/dist/pipeline.js.map +1 -0
- package/dist/ports/command-runner.d.ts +60 -0
- package/dist/ports/command-runner.d.ts.map +1 -0
- package/dist/ports/command-runner.js +116 -0
- package/dist/ports/command-runner.js.map +1 -0
- package/dist/ports/filesystem.d.ts +19 -0
- package/dist/ports/filesystem.d.ts.map +1 -0
- package/dist/ports/filesystem.js +68 -0
- package/dist/ports/filesystem.js.map +1 -0
- package/dist/ports/index.d.ts +17 -0
- package/dist/ports/index.d.ts.map +1 -0
- package/dist/ports/index.js +14 -0
- package/dist/ports/index.js.map +1 -0
- package/dist/ports/logger.d.ts +22 -0
- package/dist/ports/logger.d.ts.map +1 -0
- package/dist/ports/logger.js +18 -0
- package/dist/ports/logger.js.map +1 -0
- package/dist/ports/telemetry.d.ts +23 -0
- package/dist/ports/telemetry.d.ts.map +1 -0
- package/dist/ports/telemetry.js +12 -0
- package/dist/ports/telemetry.js.map +1 -0
- package/dist/toolchain/errors.d.ts +32 -0
- package/dist/toolchain/errors.d.ts.map +1 -0
- package/dist/toolchain/errors.js +31 -0
- package/dist/toolchain/errors.js.map +1 -0
- package/dist/toolchain/resolver.d.ts +25 -0
- package/dist/toolchain/resolver.d.ts.map +1 -0
- package/dist/toolchain/resolver.js +200 -0
- package/dist/toolchain/resolver.js.map +1 -0
- package/dist/toolchain/types.d.ts +52 -0
- package/dist/toolchain/types.d.ts.map +1 -0
- package/dist/toolchain/types.js +10 -0
- package/dist/toolchain/types.js.map +1 -0
- package/dist/types.d.ts +66 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/utils/fs.d.ts +29 -0
- package/dist/utils/fs.d.ts.map +1 -0
- package/dist/utils/fs.js +126 -0
- package/dist/utils/fs.js.map +1 -0
- package/dist/utils/index.d.ts +11 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +27 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/node-version.d.ts +20 -0
- package/dist/utils/node-version.d.ts.map +1 -0
- package/dist/utils/node-version.js +113 -0
- package/dist/utils/node-version.js.map +1 -0
- package/dist/utils/process.d.ts +25 -0
- package/dist/utils/process.d.ts.map +1 -0
- package/dist/utils/process.js +40 -0
- package/dist/utils/process.js.map +1 -0
- package/dist/utils/reserved-env.d.ts +26 -0
- package/dist/utils/reserved-env.d.ts.map +1 -0
- package/dist/utils/reserved-env.js +51 -0
- package/dist/utils/reserved-env.js.map +1 -0
- package/dist/utils/template.d.ts +15 -0
- package/dist/utils/template.d.ts.map +1 -0
- package/dist/utils/template.js +75 -0
- package/dist/utils/template.js.map +1 -0
- package/dist/utils/version.d.ts +9 -0
- package/dist/utils/version.d.ts.map +1 -0
- package/dist/utils/version.js +52 -0
- package/dist/utils/version.js.map +1 -0
- package/dist/wrangler.d.ts +192 -0
- package/dist/wrangler.d.ts.map +1 -0
- package/dist/wrangler.js +246 -0
- package/dist/wrangler.js.map +1 -0
- package/package.json +47 -0
|
@@ -0,0 +1,259 @@
|
|
|
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 [loader.templatePath, path.join(SHARED_TEMPLATE_BASE, 'astro.config.webflow.ts')];
|
|
192
|
+
}
|
|
193
|
+
async prepareConfig() {
|
|
194
|
+
const { log, cwd, userEnv } = this.ctx;
|
|
195
|
+
// Rename user's astro.config.* to clouduser.astro.config.*; if there is no
|
|
196
|
+
// user config, write an empty stub so the generated template's static
|
|
197
|
+
// import always resolves.
|
|
198
|
+
const renamedUserConfig = (0, utils_1.renameUserConfig)(log, cwd, 'astro.config', [
|
|
199
|
+
'mjs',
|
|
200
|
+
'cjs',
|
|
201
|
+
'js',
|
|
202
|
+
'ts',
|
|
203
|
+
]);
|
|
204
|
+
if (renamedUserConfig === null) {
|
|
205
|
+
log.info('no user astro.config.{mjs,cjs,js,ts} found — writing empty clouduser.astro.config.mjs stub');
|
|
206
|
+
fs.writeFileSync(path.join(cwd, 'clouduser.astro.config.mjs'), 'export default {};\n');
|
|
207
|
+
}
|
|
208
|
+
// Copy the merge-logic library (real source, not a template).
|
|
209
|
+
const webflowConfigSrc = path.join(SHARED_TEMPLATE_BASE, 'astro.config.webflow.ts');
|
|
210
|
+
if ((0, utils_1.fileExists)(webflowConfigSrc)) {
|
|
211
|
+
log.info('Copying astro.config.webflow.ts...');
|
|
212
|
+
fs.copyFileSync(webflowConfigSrc, path.join(cwd, 'astro.config.webflow.ts'));
|
|
213
|
+
}
|
|
214
|
+
// Render the single astro.config.mjs template.
|
|
215
|
+
const templatePath = path.join(TEMPLATE_BASE, 'astro.config.mjs.template');
|
|
216
|
+
const destPath = path.join(cwd, 'astro.config.mjs');
|
|
217
|
+
log.info('Generating astro.config.mjs from template...');
|
|
218
|
+
await (0, utils_1.envsubst)(log, templatePath, destPath, {
|
|
219
|
+
...process.env,
|
|
220
|
+
...userEnv,
|
|
221
|
+
});
|
|
222
|
+
// Copy webflow-loader.ts.
|
|
223
|
+
const loader = this.getWebflowLoader();
|
|
224
|
+
if ((0, utils_1.fileExists)(loader.templatePath)) {
|
|
225
|
+
log.info(`Copying ${loader.destinationName}...`);
|
|
226
|
+
fs.copyFileSync(loader.templatePath, path.join(cwd, loader.destinationName));
|
|
227
|
+
}
|
|
228
|
+
// wrangler.json is owned exclusively by `handleWranglerJson`, which runs
|
|
229
|
+
// before this hook and is the only function permitted to write
|
|
230
|
+
// /wrangler.json.
|
|
231
|
+
}
|
|
232
|
+
// ───────────────────────────────────────────────────────────────────────────
|
|
233
|
+
// BUILD
|
|
234
|
+
// ───────────────────────────────────────────────────────────────────────────
|
|
235
|
+
getBuildCommand() {
|
|
236
|
+
return 'astro build';
|
|
237
|
+
}
|
|
238
|
+
getNodeVersionRequirement() {
|
|
239
|
+
return {
|
|
240
|
+
minimum: '18.0.0',
|
|
241
|
+
severity: 'error',
|
|
242
|
+
};
|
|
243
|
+
}
|
|
244
|
+
// ───────────────────────────────────────────────────────────────────────────
|
|
245
|
+
// OUTPUT
|
|
246
|
+
// ───────────────────────────────────────────────────────────────────────────
|
|
247
|
+
static getOutputDeployMetadata() {
|
|
248
|
+
return {
|
|
249
|
+
staticAssetsPath: 'dist',
|
|
250
|
+
staticAssetsExclude: ['_worker.js'],
|
|
251
|
+
workerEntryPath: 'dist/_worker.js/index.js',
|
|
252
|
+
deploymentType: 'ssr',
|
|
253
|
+
// After wrangler dry-run, the bundled output is ./index.js
|
|
254
|
+
dryRunEntryPath: './index.js',
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
exports.Astro5Builder = Astro5Builder;
|
|
259
|
+
//# 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,4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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;;AAjQH,sCAkQC"}
|
|
@@ -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;AAgBlB,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;IAUtC,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;IAK9B,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAoDpC,eAAe,IAAI,MAAM;IAIzB,yBAAyB,IAAI,sBAAsB;WAWnC,uBAAuB,IAAI,WAAW;CAkBvD"}
|
|
@@ -0,0 +1,286 @@
|
|
|
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_fixed_cloudflare_adapter_1 = require("./adapter-patches/ensure-fixed-cloudflare-adapter");
|
|
53
|
+
const utils_1 = require("../../utils");
|
|
54
|
+
/** Base path for Astro 6 templates. */
|
|
55
|
+
const TEMPLATE_BASE = path.join(__dirname, 'templates', 'v6');
|
|
56
|
+
const SHARED_TEMPLATE_BASE = path.join(__dirname, 'templates');
|
|
57
|
+
class Astro6Builder extends base_1.FrameworkBuilder {
|
|
58
|
+
static frameworkName = 'astro';
|
|
59
|
+
// ───────────────────────────────────────────────────────────────────────────
|
|
60
|
+
// FRAMEWORK INFO
|
|
61
|
+
// ───────────────────────────────────────────────────────────────────────────
|
|
62
|
+
get info() {
|
|
63
|
+
return {
|
|
64
|
+
name: 'astro',
|
|
65
|
+
version: '6.x',
|
|
66
|
+
displayName: 'Astro 6',
|
|
67
|
+
packageName: 'astro',
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
getFrameworkVersion() {
|
|
71
|
+
return this.resolveFrameworkVersion('astro');
|
|
72
|
+
}
|
|
73
|
+
// ───────────────────────────────────────────────────────────────────────────
|
|
74
|
+
// DETECTION
|
|
75
|
+
// ───────────────────────────────────────────────────────────────────────────
|
|
76
|
+
/**
|
|
77
|
+
* Detect if this is an Astro 6 project.
|
|
78
|
+
*
|
|
79
|
+
* Version is always determined from package.json, not webflow.json. The
|
|
80
|
+
* registry checks Astro6Builder before Astro5Builder, so Astro 6+ projects
|
|
81
|
+
* are detected here first.
|
|
82
|
+
*/
|
|
83
|
+
static detect(packageJson, webflowJson) {
|
|
84
|
+
const specifiedFramework = webflowJson?.cloud?.framework;
|
|
85
|
+
// If webflow.json specifies a DIFFERENT framework, don't match.
|
|
86
|
+
if (specifiedFramework && specifiedFramework !== 'astro') {
|
|
87
|
+
return { detected: false };
|
|
88
|
+
}
|
|
89
|
+
const astroVersion = packageJson.dependencies?.astro || packageJson.devDependencies?.astro;
|
|
90
|
+
if (!astroVersion) {
|
|
91
|
+
return { detected: false };
|
|
92
|
+
}
|
|
93
|
+
const majorVersion = (0, utils_1.getMajorVersion)(astroVersion);
|
|
94
|
+
// Astro 7+ has its own builder; defer even when detection order changes.
|
|
95
|
+
if (majorVersion !== null && majorVersion >= 7) {
|
|
96
|
+
return { detected: false };
|
|
97
|
+
}
|
|
98
|
+
if (majorVersion !== null && majorVersion >= 6) {
|
|
99
|
+
return { detected: true, reason: `Found astro@${astroVersion} (Astro ${majorVersion}.x)` };
|
|
100
|
+
}
|
|
101
|
+
return { detected: false };
|
|
102
|
+
}
|
|
103
|
+
// ───────────────────────────────────────────────────────────────────────────
|
|
104
|
+
// VALIDATION
|
|
105
|
+
// ───────────────────────────────────────────────────────────────────────────
|
|
106
|
+
async validate() {
|
|
107
|
+
const { log, packageJson } = this.ctx;
|
|
108
|
+
// Astro 6 requires Node 22+.
|
|
109
|
+
const nodeReq = this.getNodeVersionRequirement();
|
|
110
|
+
if (nodeReq) {
|
|
111
|
+
(0, utils_1.validateNodeVersion)(log, nodeReq, this.info.displayName);
|
|
112
|
+
}
|
|
113
|
+
const astroVersion = packageJson.dependencies?.astro || packageJson.devDependencies?.astro;
|
|
114
|
+
if (!astroVersion) {
|
|
115
|
+
throw new errors_1.FrameworkValidationError('Astro is not installed in this project.', {
|
|
116
|
+
remediation: 'Install Astro by running: npm install astro@^6.0.0',
|
|
117
|
+
documentationUrl: 'https://docs.astro.build/en/install/',
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
// Reject "latest" explicitly.
|
|
121
|
+
if (astroVersion === 'latest') {
|
|
122
|
+
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' });
|
|
123
|
+
}
|
|
124
|
+
const majorVersion = (0, utils_1.getMajorVersion)(astroVersion);
|
|
125
|
+
if (majorVersion !== null && majorVersion < 6) {
|
|
126
|
+
throw new errors_1.FrameworkValidationError(`Astro ${majorVersion}.x detected but Astro6Builder was selected. This is likely a configuration error.`, {
|
|
127
|
+
remediation: 'Use Astro5Builder for Astro 5.x projects, or upgrade: npm install astro@^6.0.0',
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
if (majorVersion !== null && majorVersion >= 7) {
|
|
131
|
+
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.' });
|
|
132
|
+
}
|
|
133
|
+
log.info(`Validated Astro 6 project: astro@${astroVersion}`);
|
|
134
|
+
}
|
|
135
|
+
// ───────────────────────────────────────────────────────────────────────────
|
|
136
|
+
// DEPENDENCIES
|
|
137
|
+
// ───────────────────────────────────────────────────────────────────────────
|
|
138
|
+
getCloudflareAdapter() {
|
|
139
|
+
// Floor is the first release that fixes the base-path bug (withastro/astro#16276);
|
|
140
|
+
// 13.0.0–13.3.0 emit the client tree without the base prefix and break mounted apps.
|
|
141
|
+
return {
|
|
142
|
+
name: '@astrojs/cloudflare',
|
|
143
|
+
version: '^13.3.1',
|
|
144
|
+
peerDependencies: ['@cloudflare/vite-plugin'],
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
getRequiredIntegrations() {
|
|
148
|
+
return [
|
|
149
|
+
{
|
|
150
|
+
name: '@astrojs/react',
|
|
151
|
+
version: '^5.0.0', // Astro 6 compatible version
|
|
152
|
+
reason: 'Required for Webflow React components',
|
|
153
|
+
},
|
|
154
|
+
];
|
|
155
|
+
}
|
|
156
|
+
async installDependencies() {
|
|
157
|
+
const { log, cwd, runCommand } = this.ctx;
|
|
158
|
+
// @astrojs/cloudflare < 13.3.1 has the base-path bug (withastro/astro#16276); force a
|
|
159
|
+
// fixed version so stripCloudflareBaseNesting stays a rare backstop rather than papering
|
|
160
|
+
// over broken (unprefixed) asset URLs.
|
|
161
|
+
const adapter = this.getCloudflareAdapter();
|
|
162
|
+
await (0, ensure_fixed_cloudflare_adapter_1.ensureFixedCloudflareAdapter)({
|
|
163
|
+
log,
|
|
164
|
+
runCommand,
|
|
165
|
+
cwd,
|
|
166
|
+
adapterName: adapter.name,
|
|
167
|
+
installVersion: adapter.version,
|
|
168
|
+
fixedFloor: '13.3.1',
|
|
169
|
+
declaredVersion: this.getDependencyVersion(adapter.name),
|
|
170
|
+
});
|
|
171
|
+
// Install peer dependencies.
|
|
172
|
+
if (adapter.peerDependencies) {
|
|
173
|
+
for (const peer of adapter.peerDependencies) {
|
|
174
|
+
if (!this.hasDependency(peer)) {
|
|
175
|
+
log.warn(`Installing ${peer} (peer dependency of ${adapter.name})...`);
|
|
176
|
+
await (0, utils_1.npm)({ log, runCommand, cwd, args: ['install', '--save', peer] });
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
for (const integration of this.getRequiredIntegrations()) {
|
|
181
|
+
if (!this.hasDependency(integration.name)) {
|
|
182
|
+
log.warn(`Installing ${integration.name}@${integration.version} (${integration.reason})...`);
|
|
183
|
+
await (0, utils_1.npm)({
|
|
184
|
+
log,
|
|
185
|
+
runCommand,
|
|
186
|
+
cwd,
|
|
187
|
+
args: ['install', '--save', `${integration.name}@${integration.version}`],
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
// ───────────────────────────────────────────────────────────────────────────
|
|
193
|
+
// CONFIGURATION
|
|
194
|
+
// ───────────────────────────────────────────────────────────────────────────
|
|
195
|
+
getWebflowLoader() {
|
|
196
|
+
return {
|
|
197
|
+
templatePath: path.join(TEMPLATE_BASE, 'webflow-loader.ts'),
|
|
198
|
+
destinationName: 'webflow-loader.ts',
|
|
199
|
+
configPath: './webflow-loader.ts',
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
getUserConfigPatterns() {
|
|
203
|
+
return ['astro.config.mjs', 'astro.config.cjs', 'astro.config.js', 'astro.config.ts'];
|
|
204
|
+
}
|
|
205
|
+
getWranglerTemplatePath() {
|
|
206
|
+
return path.join(TEMPLATE_BASE, 'wrangler.json');
|
|
207
|
+
}
|
|
208
|
+
getAdditionalConfigFiles() {
|
|
209
|
+
const loader = this.getWebflowLoader();
|
|
210
|
+
return [loader.templatePath, path.join(SHARED_TEMPLATE_BASE, 'astro.config.webflow.ts')];
|
|
211
|
+
}
|
|
212
|
+
async prepareConfig() {
|
|
213
|
+
const { log, cwd, userEnv } = this.ctx;
|
|
214
|
+
// Rename user's astro.config.* to clouduser.astro.config.*; if there is no
|
|
215
|
+
// user config, write an empty stub so the generated template's static
|
|
216
|
+
// import always resolves.
|
|
217
|
+
const renamedUserConfig = (0, utils_1.renameUserConfig)(log, cwd, 'astro.config', [
|
|
218
|
+
'mjs',
|
|
219
|
+
'cjs',
|
|
220
|
+
'js',
|
|
221
|
+
'ts',
|
|
222
|
+
]);
|
|
223
|
+
if (renamedUserConfig === null) {
|
|
224
|
+
log.info('no user astro.config.{mjs,cjs,js,ts} found — writing empty clouduser.astro.config.mjs stub');
|
|
225
|
+
fs.writeFileSync(path.join(cwd, 'clouduser.astro.config.mjs'), 'export default {};\n');
|
|
226
|
+
}
|
|
227
|
+
// Copy the merge-logic library (real source, not a template).
|
|
228
|
+
const webflowConfigSrc = path.join(SHARED_TEMPLATE_BASE, 'astro.config.webflow.ts');
|
|
229
|
+
if ((0, utils_1.fileExists)(webflowConfigSrc)) {
|
|
230
|
+
log.info('Copying astro.config.webflow.ts...');
|
|
231
|
+
fs.copyFileSync(webflowConfigSrc, path.join(cwd, 'astro.config.webflow.ts'));
|
|
232
|
+
}
|
|
233
|
+
// Render the single astro.config.mjs template.
|
|
234
|
+
const templatePath = path.join(TEMPLATE_BASE, 'astro.config.mjs.template');
|
|
235
|
+
const destPath = path.join(cwd, 'astro.config.mjs');
|
|
236
|
+
log.info('Generating astro.config.mjs from template (Astro 6)...');
|
|
237
|
+
await (0, utils_1.envsubst)(log, templatePath, destPath, {
|
|
238
|
+
...process.env,
|
|
239
|
+
...userEnv,
|
|
240
|
+
});
|
|
241
|
+
// Copy webflow-loader.ts.
|
|
242
|
+
const loader = this.getWebflowLoader();
|
|
243
|
+
if ((0, utils_1.fileExists)(loader.templatePath)) {
|
|
244
|
+
log.info(`Copying ${loader.destinationName}...`);
|
|
245
|
+
fs.copyFileSync(loader.templatePath, path.join(cwd, loader.destinationName));
|
|
246
|
+
}
|
|
247
|
+
// wrangler.json is owned exclusively by `handleWranglerJson`, which runs
|
|
248
|
+
// before this hook and is the only function permitted to write
|
|
249
|
+
// /wrangler.json.
|
|
250
|
+
}
|
|
251
|
+
// ───────────────────────────────────────────────────────────────────────────
|
|
252
|
+
// BUILD
|
|
253
|
+
// ───────────────────────────────────────────────────────────────────────────
|
|
254
|
+
getBuildCommand() {
|
|
255
|
+
return 'astro build';
|
|
256
|
+
}
|
|
257
|
+
getNodeVersionRequirement() {
|
|
258
|
+
return {
|
|
259
|
+
minimum: '22.12.0',
|
|
260
|
+
severity: 'error', // Astro 6 will definitely fail without Node 22+
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
// ───────────────────────────────────────────────────────────────────────────
|
|
264
|
+
// OUTPUT
|
|
265
|
+
// ───────────────────────────────────────────────────────────────────────────
|
|
266
|
+
static getOutputDeployMetadata() {
|
|
267
|
+
return {
|
|
268
|
+
staticAssetsPath: 'dist/client',
|
|
269
|
+
// No exclude needed — Astro 6 has clean separation.
|
|
270
|
+
workerEntryPath: 'dist/server/entry.mjs',
|
|
271
|
+
wranglerMainOverride: '@astrojs/cloudflare/entrypoints/server',
|
|
272
|
+
deploymentType: 'ssr',
|
|
273
|
+
usesAssetsBinding: true,
|
|
274
|
+
// Astro 6 outputs multiple files (entry.mjs + chunks/*) that need bundling.
|
|
275
|
+
skipNoBundle: true,
|
|
276
|
+
// A fixed @astrojs/cloudflare nests the client tree under dist/client/<mount>/
|
|
277
|
+
// (base = mountPath), so the copy descends into that mount dir via
|
|
278
|
+
// stripCloudflareBaseNesting instead of the blind Astro 5 / Next.js append.
|
|
279
|
+
assetsSourceSkipMountPath: true,
|
|
280
|
+
// After wrangler dry-run, the bundled output is ./entry.mjs
|
|
281
|
+
dryRunEntryPath: './entry.mjs',
|
|
282
|
+
};
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
exports.Astro6Builder = Astro6Builder;
|
|
286
|
+
//# 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,uGAAiG;AACjG,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;IACjD,MAAM,CAAU,aAAa,GAAG,OAAO,CAAC;IAExC,8EAA8E;IAC9E,iBAAiB;IACjB,8EAA8E;IAE9E,IAAI,IAAI;QACN,OAAO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E,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,SAAS;YAClB,QAAQ,EAAE,OAAO,EAAE,gDAAgD;SACpE,CAAC;IACJ,CAAC;IAED,8EAA8E;IAC9E,SAAS;IACT,8EAA8E;IAE9E,MAAM,CAAU,uBAAuB;QACrC,OAAO;YACL,gBAAgB,EAAE,aAAa;YAC/B,oDAAoD;YACpD,eAAe,EAAE,uBAAuB;YACxC,oBAAoB,EAAE,wCAAwC;YAC9D,cAAc,EAAE,KAAK;YACrB,iBAAiB,EAAE,IAAI;YACvB,4EAA4E;YAC5E,YAAY,EAAE,IAAI;YAClB,+EAA+E;YAC/E,mEAAmE;YACnE,4EAA4E;YAC5E,yBAAyB,EAAE,IAAI;YAC/B,4DAA4D;YAC5D,eAAe,EAAE,aAAa;SAC/B,CAAC;IACJ,CAAC;;AA9RH,sCA+RC"}
|
|
@@ -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 Astro7Builder extends FrameworkBuilder {
|
|
4
|
+
static frameworkName: string;
|
|
5
|
+
get info(): FrameworkInfo;
|
|
6
|
+
getFrameworkVersion(): string | undefined;
|
|
7
|
+
/**
|
|
8
|
+
* Detect if this is an Astro 7 project.
|
|
9
|
+
*
|
|
10
|
+
* Version is always determined from package.json, not webflow.json. The
|
|
11
|
+
* registry checks Astro7Builder before Astro6Builder, so Astro 7+ 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=astro7.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"astro7.d.ts","sourceRoot":"","sources":["../../../src/frameworks/astro/astro7.ts"],"names":[],"mappings":"AAmBA,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;AAgBlB,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;IA2BtF,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IA6C/B,oBAAoB,IAAI,cAAc;IAQtC,uBAAuB,IAAI,kBAAkB,EAAE;IAUzC,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IA+C1C,gBAAgB,IAAI,mBAAmB;IAQvC,qBAAqB,IAAI,MAAM,EAAE;IAIjC,uBAAuB,IAAI,MAAM;IAIjC,wBAAwB,IAAI,MAAM,EAAE;IAK9B,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAoDpC,eAAe,IAAI,MAAM;IAIzB,yBAAyB,IAAI,sBAAsB;WAWnC,uBAAuB,IAAI,WAAW;CAkBvD"}
|