@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.
Files changed (174) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +93 -0
  3. package/dist/bindings.d.ts +185 -0
  4. package/dist/bindings.d.ts.map +1 -0
  5. package/dist/bindings.js +120 -0
  6. package/dist/bindings.js.map +1 -0
  7. package/dist/config/package-json.d.ts +57 -0
  8. package/dist/config/package-json.d.ts.map +1 -0
  9. package/dist/config/package-json.js +94 -0
  10. package/dist/config/package-json.js.map +1 -0
  11. package/dist/config/webflow-json.d.ts +53 -0
  12. package/dist/config/webflow-json.d.ts.map +1 -0
  13. package/dist/config/webflow-json.js +72 -0
  14. package/dist/config/webflow-json.js.map +1 -0
  15. package/dist/create-webflow-json.d.ts +24 -0
  16. package/dist/create-webflow-json.d.ts.map +1 -0
  17. package/dist/create-webflow-json.js +170 -0
  18. package/dist/create-webflow-json.js.map +1 -0
  19. package/dist/errors.d.ts +13 -0
  20. package/dist/errors.d.ts.map +1 -0
  21. package/dist/errors.js +23 -0
  22. package/dist/errors.js.map +1 -0
  23. package/dist/frameworks/astro/adapter-patches/ensure-fixed-cloudflare-adapter.d.ts +36 -0
  24. package/dist/frameworks/astro/adapter-patches/ensure-fixed-cloudflare-adapter.d.ts.map +1 -0
  25. package/dist/frameworks/astro/adapter-patches/ensure-fixed-cloudflare-adapter.js +94 -0
  26. package/dist/frameworks/astro/adapter-patches/ensure-fixed-cloudflare-adapter.js.map +1 -0
  27. package/dist/frameworks/astro/adapter-patches/strip-cloudflare-base-nesting.d.ts +2 -0
  28. package/dist/frameworks/astro/adapter-patches/strip-cloudflare-base-nesting.d.ts.map +1 -0
  29. package/dist/frameworks/astro/adapter-patches/strip-cloudflare-base-nesting.js +97 -0
  30. package/dist/frameworks/astro/adapter-patches/strip-cloudflare-base-nesting.js.map +1 -0
  31. package/dist/frameworks/astro/astro5.d.ts +28 -0
  32. package/dist/frameworks/astro/astro5.d.ts.map +1 -0
  33. package/dist/frameworks/astro/astro5.js +259 -0
  34. package/dist/frameworks/astro/astro5.js.map +1 -0
  35. package/dist/frameworks/astro/astro6.d.ts +28 -0
  36. package/dist/frameworks/astro/astro6.d.ts.map +1 -0
  37. package/dist/frameworks/astro/astro6.js +286 -0
  38. package/dist/frameworks/astro/astro6.js.map +1 -0
  39. package/dist/frameworks/astro/astro7.d.ts +28 -0
  40. package/dist/frameworks/astro/astro7.d.ts.map +1 -0
  41. package/dist/frameworks/astro/astro7.js +283 -0
  42. package/dist/frameworks/astro/astro7.js.map +1 -0
  43. package/dist/frameworks/astro/index.d.ts +10 -0
  44. package/dist/frameworks/astro/index.d.ts.map +1 -0
  45. package/dist/frameworks/astro/index.js +16 -0
  46. package/dist/frameworks/astro/index.js.map +1 -0
  47. package/dist/frameworks/astro/templates/astro.config.webflow.ts +61 -0
  48. package/dist/frameworks/astro/templates/v5/astro.config.mjs.template +25 -0
  49. package/dist/frameworks/astro/templates/v5/webflow-loader.ts +103 -0
  50. package/dist/frameworks/astro/templates/v5/wrangler.json +6 -0
  51. package/dist/frameworks/astro/templates/v6/astro.config.mjs.template +35 -0
  52. package/dist/frameworks/astro/templates/v6/webflow-loader.ts +112 -0
  53. package/dist/frameworks/astro/templates/v6/wrangler.json +9 -0
  54. package/dist/frameworks/astro/templates/v7/astro.config.mjs.template +34 -0
  55. package/dist/frameworks/astro/templates/v7/webflow-loader.ts +113 -0
  56. package/dist/frameworks/astro/templates/v7/wrangler.json +9 -0
  57. package/dist/frameworks/base.d.ts +134 -0
  58. package/dist/frameworks/base.d.ts.map +1 -0
  59. package/dist/frameworks/base.js +175 -0
  60. package/dist/frameworks/base.js.map +1 -0
  61. package/dist/frameworks/errors.d.ts +72 -0
  62. package/dist/frameworks/errors.d.ts.map +1 -0
  63. package/dist/frameworks/errors.js +120 -0
  64. package/dist/frameworks/errors.js.map +1 -0
  65. package/dist/frameworks/nextjs/adapter-resolver.d.ts +72 -0
  66. package/dist/frameworks/nextjs/adapter-resolver.d.ts.map +1 -0
  67. package/dist/frameworks/nextjs/adapter-resolver.js +246 -0
  68. package/dist/frameworks/nextjs/adapter-resolver.js.map +1 -0
  69. package/dist/frameworks/nextjs/index.d.ts +38 -0
  70. package/dist/frameworks/nextjs/index.d.ts.map +1 -0
  71. package/dist/frameworks/nextjs/index.js +268 -0
  72. package/dist/frameworks/nextjs/index.js.map +1 -0
  73. package/dist/frameworks/nextjs/templates/next.config.ts.template +13 -0
  74. package/dist/frameworks/nextjs/templates/next.config.webflow.ts +46 -0
  75. package/dist/frameworks/nextjs/templates/open-next.config.ts +3 -0
  76. package/dist/frameworks/nextjs/templates/webflow-loader.ts +44 -0
  77. package/dist/frameworks/nextjs/templates/wrangler.json +6 -0
  78. package/dist/frameworks/registry.d.ts +127 -0
  79. package/dist/frameworks/registry.d.ts.map +1 -0
  80. package/dist/frameworks/registry.js +257 -0
  81. package/dist/frameworks/registry.js.map +1 -0
  82. package/dist/frameworks/static/index.d.ts +93 -0
  83. package/dist/frameworks/static/index.d.ts.map +1 -0
  84. package/dist/frameworks/static/index.js +352 -0
  85. package/dist/frameworks/static/index.js.map +1 -0
  86. package/dist/frameworks/static/templates/wrangler.json +7 -0
  87. package/dist/frameworks/types.d.ts +138 -0
  88. package/dist/frameworks/types.d.ts.map +1 -0
  89. package/dist/frameworks/types.js +3 -0
  90. package/dist/frameworks/types.js.map +1 -0
  91. package/dist/frameworks/vite/index.d.ts +46 -0
  92. package/dist/frameworks/vite/index.d.ts.map +1 -0
  93. package/dist/frameworks/vite/index.js +303 -0
  94. package/dist/frameworks/vite/index.js.map +1 -0
  95. package/dist/frameworks/vite/templates/vite.config.ts.template +14 -0
  96. package/dist/frameworks/vite/templates/vite.config.webflow.ts +52 -0
  97. package/dist/frameworks/vite/templates/wrangler.json +10 -0
  98. package/dist/index.d.ts +44 -0
  99. package/dist/index.d.ts.map +1 -0
  100. package/dist/index.js +118 -0
  101. package/dist/index.js.map +1 -0
  102. package/dist/pipeline.d.ts +8 -0
  103. package/dist/pipeline.d.ts.map +1 -0
  104. package/dist/pipeline.js +263 -0
  105. package/dist/pipeline.js.map +1 -0
  106. package/dist/ports/command-runner.d.ts +60 -0
  107. package/dist/ports/command-runner.d.ts.map +1 -0
  108. package/dist/ports/command-runner.js +116 -0
  109. package/dist/ports/command-runner.js.map +1 -0
  110. package/dist/ports/filesystem.d.ts +19 -0
  111. package/dist/ports/filesystem.d.ts.map +1 -0
  112. package/dist/ports/filesystem.js +68 -0
  113. package/dist/ports/filesystem.js.map +1 -0
  114. package/dist/ports/index.d.ts +17 -0
  115. package/dist/ports/index.d.ts.map +1 -0
  116. package/dist/ports/index.js +14 -0
  117. package/dist/ports/index.js.map +1 -0
  118. package/dist/ports/logger.d.ts +22 -0
  119. package/dist/ports/logger.d.ts.map +1 -0
  120. package/dist/ports/logger.js +18 -0
  121. package/dist/ports/logger.js.map +1 -0
  122. package/dist/ports/telemetry.d.ts +23 -0
  123. package/dist/ports/telemetry.d.ts.map +1 -0
  124. package/dist/ports/telemetry.js +12 -0
  125. package/dist/ports/telemetry.js.map +1 -0
  126. package/dist/toolchain/errors.d.ts +32 -0
  127. package/dist/toolchain/errors.d.ts.map +1 -0
  128. package/dist/toolchain/errors.js +31 -0
  129. package/dist/toolchain/errors.js.map +1 -0
  130. package/dist/toolchain/resolver.d.ts +25 -0
  131. package/dist/toolchain/resolver.d.ts.map +1 -0
  132. package/dist/toolchain/resolver.js +200 -0
  133. package/dist/toolchain/resolver.js.map +1 -0
  134. package/dist/toolchain/types.d.ts +52 -0
  135. package/dist/toolchain/types.d.ts.map +1 -0
  136. package/dist/toolchain/types.js +10 -0
  137. package/dist/toolchain/types.js.map +1 -0
  138. package/dist/types.d.ts +66 -0
  139. package/dist/types.d.ts.map +1 -0
  140. package/dist/types.js +3 -0
  141. package/dist/types.js.map +1 -0
  142. package/dist/utils/fs.d.ts +29 -0
  143. package/dist/utils/fs.d.ts.map +1 -0
  144. package/dist/utils/fs.js +126 -0
  145. package/dist/utils/fs.js.map +1 -0
  146. package/dist/utils/index.d.ts +11 -0
  147. package/dist/utils/index.d.ts.map +1 -0
  148. package/dist/utils/index.js +27 -0
  149. package/dist/utils/index.js.map +1 -0
  150. package/dist/utils/node-version.d.ts +20 -0
  151. package/dist/utils/node-version.d.ts.map +1 -0
  152. package/dist/utils/node-version.js +113 -0
  153. package/dist/utils/node-version.js.map +1 -0
  154. package/dist/utils/process.d.ts +25 -0
  155. package/dist/utils/process.d.ts.map +1 -0
  156. package/dist/utils/process.js +40 -0
  157. package/dist/utils/process.js.map +1 -0
  158. package/dist/utils/reserved-env.d.ts +26 -0
  159. package/dist/utils/reserved-env.d.ts.map +1 -0
  160. package/dist/utils/reserved-env.js +51 -0
  161. package/dist/utils/reserved-env.js.map +1 -0
  162. package/dist/utils/template.d.ts +15 -0
  163. package/dist/utils/template.d.ts.map +1 -0
  164. package/dist/utils/template.js +75 -0
  165. package/dist/utils/template.js.map +1 -0
  166. package/dist/utils/version.d.ts +9 -0
  167. package/dist/utils/version.d.ts.map +1 -0
  168. package/dist/utils/version.js +52 -0
  169. package/dist/utils/version.js.map +1 -0
  170. package/dist/wrangler.d.ts +192 -0
  171. package/dist/wrangler.d.ts.map +1 -0
  172. package/dist/wrangler.js +246 -0
  173. package/dist/wrangler.js.map +1 -0
  174. package/package.json +47 -0
@@ -0,0 +1,257 @@
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
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
+ };
38
+ Object.defineProperty(exports, "__esModule", { value: true });
39
+ exports.FrameworkBuilder = exports.StaticBuilder = exports.ViteBuilder = exports.NextJsBuilder = exports.Astro7Builder = exports.Astro6Builder = exports.Astro5Builder = exports.ALLOWED_FRAMEWORKS = exports.FRAMEWORK_BUILDERS = void 0;
40
+ exports.detectFrameworkBuilder = detectFrameworkBuilder;
41
+ exports.detectFrameworkFromBuiltOutput = detectFrameworkFromBuiltOutput;
42
+ exports.detectAndCreateBuilder = detectAndCreateBuilder;
43
+ exports.resolveIsStaticApp = resolveIsStaticApp;
44
+ exports.detectStaticApp = detectStaticApp;
45
+ exports.getCustomerMajorVersion = getCustomerMajorVersion;
46
+ exports.validateFrameworkName = validateFrameworkName;
47
+ /**
48
+ * Framework Registry
49
+ *
50
+ * Central registry for all framework builders. Handles framework detection and
51
+ * builder creation.
52
+ */
53
+ const fs = __importStar(require("node:fs"));
54
+ const path = __importStar(require("node:path"));
55
+ const cosmic_deploy_contract_1 = require("@webflow/cosmic-deploy-contract");
56
+ const errors_1 = require("./errors");
57
+ const utils_1 = require("../utils");
58
+ const astro_1 = require("./astro");
59
+ const nextjs_1 = require("./nextjs");
60
+ const vite_1 = require("./vite");
61
+ const static_1 = require("./static");
62
+ // ───────────────────────────────────────────────────────────────────────────
63
+ // FRAMEWORK REGISTRY
64
+ // ───────────────────────────────────────────────────────────────────────────
65
+ /**
66
+ * All registered framework builders, in detection order.
67
+ *
68
+ * IMPORTANT: Order matters — first match wins. More specific frameworks must
69
+ * come before generic ones.
70
+ *
71
+ * - Astro 7 before Astro 6 before Astro 5 (version-specific, newest first)
72
+ * - Next.js before Vite (uses Vite internally)
73
+ * - Vite before Static (Vite catches generic Vite SPAs)
74
+ * - Static last: matches only an explicit `framework: "static"` here; implicit
75
+ * no-framework detection is a filesystem fallback the host resolves via
76
+ * `resolveIsStaticApp` before calling into detection.
77
+ */
78
+ exports.FRAMEWORK_BUILDERS = [
79
+ astro_1.Astro7Builder,
80
+ astro_1.Astro6Builder,
81
+ astro_1.Astro5Builder,
82
+ nextjs_1.NextJsBuilder,
83
+ vite_1.ViteBuilder,
84
+ static_1.StaticBuilder,
85
+ ];
86
+ /**
87
+ * Allowed framework names for webflow.json. Single source of truth is the
88
+ * deploy contract's `Framework` enum — what's deployable is what's allowed.
89
+ *
90
+ * Note: Astro version (5 vs 6) is detected automatically from package.json.
91
+ * Users should always specify 'astro', not 'astro5' or 'astro6'.
92
+ */
93
+ exports.ALLOWED_FRAMEWORKS = cosmic_deploy_contract_1.Framework.options;
94
+ // ───────────────────────────────────────────────────────────────────────────
95
+ // DETECTION
96
+ // ───────────────────────────────────────────────────────────────────────────
97
+ /**
98
+ * Detect which framework builder should handle this project. First-match-wins;
99
+ * order in FRAMEWORK_BUILDERS determines precedence.
100
+ *
101
+ * @returns The first matching builder class, or null if no match.
102
+ */
103
+ function detectFrameworkBuilder(packageJson, webflowJson) {
104
+ for (const Builder of exports.FRAMEWORK_BUILDERS) {
105
+ const result = Builder.detect(packageJson, webflowJson);
106
+ if (result.detected) {
107
+ return { Builder, result };
108
+ }
109
+ }
110
+ return null;
111
+ }
112
+ /**
113
+ * Detect which framework produced the build artifacts in `cwd`.
114
+ *
115
+ * Used at deploy time when webflow.json may not have been written by the
116
+ * producer. Iterates registered builders and returns the first one whose
117
+ * `detectFromBuiltOutput` recognizes the output. Returns null if none match.
118
+ */
119
+ function detectFrameworkFromBuiltOutput(cwd) {
120
+ for (const Builder of exports.FRAMEWORK_BUILDERS) {
121
+ if (Builder.detectFromBuiltOutput(cwd)) {
122
+ return Builder;
123
+ }
124
+ }
125
+ return null;
126
+ }
127
+ /**
128
+ * Detect and create the appropriate framework builder.
129
+ *
130
+ * @throws FrameworkDetectionError if no framework can be detected
131
+ */
132
+ function detectAndCreateBuilder(ctx, webflowJson) {
133
+ const match = detectFrameworkBuilder(ctx.packageJson, webflowJson);
134
+ if (!match) {
135
+ throw new errors_1.FrameworkDetectionError('Could not detect framework from package.json or webflow.json', {
136
+ remediation: 'Create a webflow.json file with: { "cloud": { "framework": "astro" } } ' +
137
+ `(or one of: ${exports.ALLOWED_FRAMEWORKS.join(', ')}). ` +
138
+ 'For a no-framework static site, use { "cloud": { "framework": "static" } }.',
139
+ });
140
+ }
141
+ ctx.log.info(`Detected framework: ${match.result.reason}`);
142
+ return new match.Builder(ctx);
143
+ }
144
+ /**
145
+ * Decide whether a project is a no-framework static app.
146
+ *
147
+ * Two ways in:
148
+ * - **explicit**: webflow.json declares `framework: "static"`. This wins
149
+ * unconditionally — even with a package.json present — so the explicit
150
+ * opt-in is honored ahead of the package/index guard in the build flow.
151
+ * - **inferred (zero-config)**: no package.json, a real `index.html` file at
152
+ * the root, no *other* framework explicitly declared, and **no runtime/build
153
+ * indicators** (`hasRuntimeIndicators`). `index.html` + no package.json is
154
+ * only a preflight signal; a repo that also ships a build/server manifest
155
+ * (requirements.txt, composer.json, Gemfile, Dockerfile, …) is a mixed
156
+ * static+runtime repo and must NOT be silently published — the caller
157
+ * rejects that case. The caller resolves `hasRootIndexHtmlFile` with a
158
+ * regular-file check (not `existsSync`), so a directory or symlink named
159
+ * `index.html` does not trigger inference.
160
+ */
161
+ function resolveIsStaticApp(params) {
162
+ const { hasPackageJson, specifiedFramework, hasRootIndexHtmlFile, hasRuntimeIndicators } = params;
163
+ if (specifiedFramework === 'static') {
164
+ return true;
165
+ }
166
+ const declaresOtherFramework = specifiedFramework != null && specifiedFramework !== 'static';
167
+ return (!hasPackageJson && !declaresOtherFramework && hasRootIndexHtmlFile && !hasRuntimeIndicators);
168
+ }
169
+ /**
170
+ * Resolve whether `cwd` is a no-framework static app, doing the filesystem
171
+ * checks that `resolveIsStaticApp` needs: a regular-file root index.html and a
172
+ * recursive scan for runtime indicators. This is the single implementation both
173
+ * producers (cosmic-builder, webflow-cli) call, so static detection is
174
+ * identical everywhere.
175
+ *
176
+ * `index.html` + no package.json is only a preflight signal: a repo that also
177
+ * ships a build/server manifest is a mixed static+runtime repo whose source
178
+ * must not be silently published as assets. On the inference path (no explicit
179
+ * framework) such a repo is rejected loudly, naming the offending files. An
180
+ * explicit `framework: "static"` is honored even when those files are present.
181
+ *
182
+ * Requires a regular file for the inferred index.html (lstat, not existsSync)
183
+ * so a directory or symlink named index.html can't trigger inference.
184
+ *
185
+ * @throws FrameworkDetectionError for a mixed static+runtime repo on inference.
186
+ */
187
+ function detectStaticApp(cwd, packageJson, webflowJson) {
188
+ const specifiedFramework = webflowJson?.cloud?.framework;
189
+ const indexHtmlStat = fs.lstatSync(path.join(cwd, 'index.html'), { throwIfNoEntry: false });
190
+ const hasRootIndexHtmlFile = indexHtmlStat?.isFile() ?? false;
191
+ const runtimeIndicators = (0, static_1.findRuntimeBuildIndicators)(cwd);
192
+ const isStatic = resolveIsStaticApp({
193
+ hasPackageJson: packageJson != null,
194
+ specifiedFramework,
195
+ hasRootIndexHtmlFile,
196
+ hasRuntimeIndicators: runtimeIndicators.length > 0,
197
+ });
198
+ if (!packageJson &&
199
+ !isStatic &&
200
+ hasRootIndexHtmlFile &&
201
+ runtimeIndicators.length > 0 &&
202
+ specifiedFramework == null) {
203
+ throw new errors_1.FrameworkDetectionError(`Found index.html but also build/runtime indicators (${runtimeIndicators.join(', ')}); this is not a no-framework static app and will not be published as static assets.`, {
204
+ remediation: 'Remove those files, or declare a framework in webflow.json (e.g. { "cloud": { "framework": "static" } } to force static).',
205
+ });
206
+ }
207
+ return { isStatic };
208
+ }
209
+ // ───────────────────────────────────────────────────────────────────────────
210
+ // TELEMETRY
211
+ // ───────────────────────────────────────────────────────────────────────────
212
+ /**
213
+ * Read the customer's installed major version of a framework's primary npm
214
+ * package. Used only for metric tagging.
215
+ *
216
+ * `getMajorVersion` is defensive on empty/non-semver input (dist-tags, git
217
+ * URLs, 'workspace:*', etc.), so the 'unknown' fallback is unreachable in the
218
+ * normal path — kept for resilience to silent dep-tree changes.
219
+ */
220
+ function getCustomerMajorVersion(packageName, packageJson) {
221
+ const spec = packageJson.dependencies?.[packageName] ?? packageJson.devDependencies?.[packageName] ?? '';
222
+ const major = (0, utils_1.getMajorVersion)(spec);
223
+ return major !== null ? String(major) : 'unknown';
224
+ }
225
+ // ───────────────────────────────────────────────────────────────────────────
226
+ // VALIDATION
227
+ // ───────────────────────────────────────────────────────────────────────────
228
+ /**
229
+ * Validate that a framework name from webflow.json is supported.
230
+ *
231
+ * @throws FrameworkDetectionError if framework is not supported
232
+ */
233
+ function validateFrameworkName(frameworkName) {
234
+ if (!exports.ALLOWED_FRAMEWORKS.includes(frameworkName)) {
235
+ throw new errors_1.FrameworkDetectionError(`Framework "${frameworkName}" is not supported`, {
236
+ remediation: `Must be one of: ${exports.ALLOWED_FRAMEWORKS.join(', ')}`,
237
+ });
238
+ }
239
+ }
240
+ // ───────────────────────────────────────────────────────────────────────────
241
+ // EXPORTS
242
+ // ───────────────────────────────────────────────────────────────────────────
243
+ var astro_2 = require("./astro");
244
+ Object.defineProperty(exports, "Astro5Builder", { enumerable: true, get: function () { return astro_2.Astro5Builder; } });
245
+ Object.defineProperty(exports, "Astro6Builder", { enumerable: true, get: function () { return astro_2.Astro6Builder; } });
246
+ Object.defineProperty(exports, "Astro7Builder", { enumerable: true, get: function () { return astro_2.Astro7Builder; } });
247
+ var nextjs_2 = require("./nextjs");
248
+ Object.defineProperty(exports, "NextJsBuilder", { enumerable: true, get: function () { return nextjs_2.NextJsBuilder; } });
249
+ var vite_2 = require("./vite");
250
+ Object.defineProperty(exports, "ViteBuilder", { enumerable: true, get: function () { return vite_2.ViteBuilder; } });
251
+ var static_2 = require("./static");
252
+ Object.defineProperty(exports, "StaticBuilder", { enumerable: true, get: function () { return static_2.StaticBuilder; } });
253
+ var base_1 = require("./base");
254
+ Object.defineProperty(exports, "FrameworkBuilder", { enumerable: true, get: function () { return base_1.FrameworkBuilder; } });
255
+ __exportStar(require("./types"), exports);
256
+ __exportStar(require("./errors"), exports);
257
+ //# sourceMappingURL=registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/frameworks/registry.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwFA,wDAWC;AASD,wEAOC;AAOD,wDAoBC;AAmBD,gDAcC;AAoBD,0CAsCC;AAcD,0DAKC;AAWD,sDAQC;AA/QD;;;;;GAKG;AACH,4CAA8B;AAC9B,gDAAkC;AAElC,4EAA4D;AAI5D,qCAAmD;AACnD,oCAA2C;AAE3C,mCAAsE;AACtE,qCAAyC;AACzC,iCAAqC;AACrC,qCAAqE;AAsBrE,8EAA8E;AAC9E,qBAAqB;AACrB,8EAA8E;AAE9E;;;;;;;;;;;;GAYG;AACU,QAAA,kBAAkB,GAAmB;IAChD,qBAAa;IACb,qBAAa;IACb,qBAAa;IACb,sBAAa;IACb,kBAAW;IACX,sBAAa;CACd,CAAC;AAEF;;;;;;GAMG;AACU,QAAA,kBAAkB,GAAG,kCAAS,CAAC,OAAO,CAAC;AAIpD,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAE9E;;;;;GA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AAED,8EAA8E;AAC9E,YAAY;AACZ,8EAA8E;AAE9E;;;;;;;GAOG;AACH,SAAgB,uBAAuB,CAAC,WAAmB,EAAE,WAAwB;IACnF,MAAM,IAAI,GACR,WAAW,CAAC,YAAY,EAAE,CAAC,WAAW,CAAC,IAAI,WAAW,CAAC,eAAe,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,CAAC;IAC9F,MAAM,KAAK,GAAG,IAAA,uBAAe,EAAC,IAAI,CAAC,CAAC;IACpC,OAAO,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACpD,CAAC;AAED,8EAA8E;AAC9E,aAAa;AACb,8EAA8E;AAE9E;;;;GAIG;AACH,SAAgB,qBAAqB,CACnC,aAAqB;IAErB,IAAI,CAAC,0BAAkB,CAAC,QAAQ,CAAC,aAAiC,CAAC,EAAE,CAAC;QACpE,MAAM,IAAI,gCAAuB,CAAC,cAAc,aAAa,oBAAoB,EAAE;YACjF,WAAW,EAAE,mBAAmB,0BAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE;SAChE,CAAC,CAAC;IACL,CAAC;AACH,CAAC;AAED,8EAA8E;AAC9E,UAAU;AACV,8EAA8E;AAE9E,iCAAsE;AAA7D,sGAAA,aAAa,OAAA;AAAE,sGAAA,aAAa,OAAA;AAAE,sGAAA,aAAa,OAAA;AACpD,mCAAyC;AAAhC,uGAAA,aAAa,OAAA;AACtB,+BAAqC;AAA5B,mGAAA,WAAW,OAAA;AACpB,mCAAyC;AAAhC,uGAAA,aAAa,OAAA;AAEtB,+BAA0C;AAAjC,wGAAA,gBAAgB,OAAA;AACzB,0CAAwB;AACxB,2CAAyB"}
@@ -0,0 +1,93 @@
1
+ import { FrameworkBuilder } from '../base';
2
+ import type { BuildOutput, FrameworkInfo, PackageJson, WebflowJson, DetectionResult, AdapterPackage, IntegrationPackage, WebflowLoaderConfig, NodeVersionRequirement } from '../types';
3
+ /**
4
+ * `_headers` / `_redirects` are Cloudflare asset-root metadata, not page
5
+ * content. They're only honored at the root of the assets directory, so the
6
+ * host relocates them there (regardless of mount path) rather than copying
7
+ * them under the mount-path prefix.
8
+ */
9
+ export declare const ASSET_ROOT_METADATA: string[];
10
+ /**
11
+ * Non-dotfile basename patterns that must never be published as static assets
12
+ * (`*` is a simple glob — see `matchesExcludePattern`). Dotfiles are handled
13
+ * separately by `shouldExcludeStaticAsset` (all excluded except `.well-known`).
14
+ */
15
+ export declare const STATIC_ASSET_EXCLUDES: string[];
16
+ /**
17
+ * The static publication boundary: decide whether a repo-root entry must be
18
+ * withheld from the published assets. Because the asset source is the whole
19
+ * checkout, the safe default is to treat anything config/secret/metadata-shaped
20
+ * as non-public rather than to enumerate every risky name.
21
+ *
22
+ * Policy:
23
+ * - `.well-known` IS published (ACME challenges, security.txt, etc.).
24
+ * - every OTHER dotfile / dot-directory is withheld — this covers `.env*`,
25
+ * `.envrc`, `.git`, `.git-credentials`, `.npmrc`, `.aws/`, `.docker/`,
26
+ * `.ssh/`, `.dev.vars`, … in one rule instead of a leaky enumeration.
27
+ * - `_headers` / `_redirects` are withheld here because they're relocated to
28
+ * the assets root separately.
29
+ * - plus the explicit non-dotfile deny patterns above (deps, control files,
30
+ * tf state, key material).
31
+ */
32
+ export declare function shouldExcludeStaticAsset(basename: string): boolean;
33
+ /**
34
+ * Build/runtime/package/auth manifest files whose presence means the repo is
35
+ * NOT a no-framework static site — it has a build step or a server runtime.
36
+ *
37
+ * Zero-config static inference (`index.html` + no package.json) is only a
38
+ * preflight signal; per the Static Site Hosting PRD it must be rejected when
39
+ * any of these appear alongside, so we never silently publish a mixed
40
+ * static+runtime repo's source (e.g. `server.py` next to a Composer
41
+ * `auth.json`). Node's `package.json` is handled separately by the detection
42
+ * flow, so it isn't listed here.
43
+ */
44
+ export declare const RUNTIME_BUILD_INDICATORS: string[];
45
+ /**
46
+ * Clear server entrypoint filenames. Unlike manifests these are source files,
47
+ * but a repo whose published tree contains one is running a server, not serving
48
+ * static assets — so it must not be inferred as static.
49
+ */
50
+ export declare const SERVER_ENTRYPOINT_FILES: string[];
51
+ /**
52
+ * Scan the **published tree** (not just the root) for build/runtime/server
53
+ * indicators, returning their repo-relative paths.
54
+ *
55
+ * The static copy publishes the whole checkout recursively, so a manifest or
56
+ * server entrypoint nested under e.g. `api/` (a root `index.html` next to
57
+ * `api/requirements.txt` + `api/server.py`) is just as much a mixed
58
+ * static+runtime signal as one at the root — and its source would otherwise be
59
+ * served publicly. Directories that are never published (dotfiles/dot-dirs,
60
+ * `node_modules`, and anything `shouldExcludeStaticAsset` withholds) are not
61
+ * descended into, and symlinks are not followed — matching the copy policy.
62
+ *
63
+ * A **nested** `package.json` (below the root) counts here too: it marks a
64
+ * Node runtime whose sibling source (e.g. `api/index.js`) would otherwise be
65
+ * published verbatim. The *root* `package.json` is intentionally NOT a signal —
66
+ * its presence means the repo isn't a zero-config static app at all, which the
67
+ * upstream detection flow already handles (static inference requires that there
68
+ * be no root `package.json`).
69
+ */
70
+ export declare function findRuntimeBuildIndicators(cwd: string): string[];
71
+ export declare class StaticBuilder extends FrameworkBuilder {
72
+ static frameworkName: string;
73
+ get info(): FrameworkInfo;
74
+ /**
75
+ * Match only when webflow.json explicitly opts in with framework "static".
76
+ *
77
+ * Implicit detection for a no-framework app (no package.json / index.html at
78
+ * the root) is handled as a fallback in the host, which has the working
79
+ * directory that this static, package.json-only signature cannot see.
80
+ */
81
+ static detect(packageJson: PackageJson, webflowJson?: WebflowJson): DetectionResult;
82
+ validate(): Promise<void>;
83
+ installDependencies(): Promise<void>;
84
+ getCloudflareAdapter(): AdapterPackage | null;
85
+ getRequiredIntegrations(): IntegrationPackage[];
86
+ getWebflowLoader(): WebflowLoaderConfig | null;
87
+ getNodeVersionRequirement(): NodeVersionRequirement | null;
88
+ getWranglerTemplatePath(): string;
89
+ prepareConfig(): Promise<void>;
90
+ getBuildCommand(): string | null;
91
+ static getOutputDeployMetadata(): BuildOutput;
92
+ }
93
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/frameworks/static/index.ts"],"names":[],"mappings":"AAgBA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,OAAO,KAAK,EACV,WAAW,EACX,aAAa,EACb,WAAW,EACX,WAAW,EACX,eAAe,EACf,cAAc,EACd,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACvB,MAAM,UAAU,CAAC;AAKlB;;;;;GAKG;AACH,eAAO,MAAM,mBAAmB,UAA6B,CAAC;AAE9D;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,UA+BjC,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAWlE;AAED;;;;;;;;;;GAUG;AACH,eAAO,MAAM,wBAAwB,UAmCpC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,UAenC,CAAC;AAIF;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAoChE;AAED,qBAAa,aAAc,SAAQ,gBAAgB;IACjD,OAAgB,aAAa,SAAY;IAMzC,IAAI,IAAI,IAAI,aAAa,CASxB;IAMD;;;;;;OAMG;WACa,MAAM,CAAC,WAAW,EAAE,WAAW,EAAE,WAAW,CAAC,EAAE,WAAW,GAAG,eAAe;IAWtF,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAiBzB,mBAAmB,IAAI,OAAO,CAAC,IAAI,CAAC;IAI1C,oBAAoB,IAAI,cAAc,GAAG,IAAI;IAI7C,uBAAuB,IAAI,kBAAkB,EAAE;IAI/C,gBAAgB,IAAI,mBAAmB,GAAG,IAAI;IAI9C,yBAAyB,IAAI,sBAAsB,GAAG,IAAI;IAS1D,uBAAuB,IAAI,MAAM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