@webflow/cloud-app 0.1.0-beta.7 → 0.1.0-beta.9
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/README.md +68 -0
- package/dist/bindings.d.ts +5 -0
- package/dist/bindings.d.ts.map +1 -1
- package/dist/bindings.js +7 -2
- package/dist/bindings.js.map +1 -1
- package/dist/compat-date.d.ts +68 -0
- package/dist/compat-date.d.ts.map +1 -0
- package/dist/compat-date.js +169 -0
- package/dist/compat-date.js.map +1 -0
- package/dist/config/webflow-json.d.ts +0 -6
- package/dist/config/webflow-json.d.ts.map +1 -1
- package/dist/config/webflow-json.js.map +1 -1
- package/dist/create-webflow-json.d.ts +2 -5
- package/dist/create-webflow-json.d.ts.map +1 -1
- package/dist/create-webflow-json.js +7 -9
- package/dist/create-webflow-json.js.map +1 -1
- package/dist/frameworks/astro/adapter-patches/assert-adapter-nested-under-mount.d.ts +28 -0
- package/dist/frameworks/astro/adapter-patches/assert-adapter-nested-under-mount.d.ts.map +1 -0
- package/dist/frameworks/astro/adapter-patches/assert-adapter-nested-under-mount.js +148 -0
- package/dist/frameworks/astro/adapter-patches/assert-adapter-nested-under-mount.js.map +1 -0
- package/dist/frameworks/astro/adapter-patches/ensure-fixed-cloudflare-adapter.d.ts +2 -2
- package/dist/frameworks/astro/adapter-patches/ensure-fixed-cloudflare-adapter.js +2 -2
- package/dist/frameworks/astro/astro5.d.ts.map +1 -1
- package/dist/frameworks/astro/astro5.js +22 -5
- package/dist/frameworks/astro/astro5.js.map +1 -1
- package/dist/frameworks/astro/astro6.d.ts.map +1 -1
- package/dist/frameworks/astro/astro6.js +27 -10
- package/dist/frameworks/astro/astro6.js.map +1 -1
- package/dist/frameworks/astro/astro7.d.ts.map +1 -1
- package/dist/frameworks/astro/astro7.js +25 -8
- package/dist/frameworks/astro/astro7.js.map +1 -1
- package/dist/frameworks/astro/templates/v5/webflow-loader.ts +58 -35
- package/dist/frameworks/astro/templates/v6/webflow-loader.ts +53 -39
- package/dist/frameworks/astro/templates/v7/webflow-loader.ts +51 -39
- package/dist/frameworks/astro/templates/webflow-image-url.ts +140 -0
- package/dist/frameworks/base.d.ts +1 -1
- package/dist/frameworks/base.js +1 -1
- package/dist/frameworks/static/index.d.ts +23 -0
- package/dist/frameworks/static/index.d.ts.map +1 -1
- package/dist/frameworks/static/index.js +51 -9
- package/dist/frameworks/static/index.js.map +1 -1
- package/dist/frameworks/types.d.ts +6 -6
- package/dist/frameworks/types.d.ts.map +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -1
- package/dist/index.js.map +1 -1
- package/dist/pipeline.d.ts +4 -0
- package/dist/pipeline.d.ts.map +1 -1
- package/dist/pipeline.js +29 -11
- package/dist/pipeline.js.map +1 -1
- package/dist/ports/command-runner.d.ts +5 -6
- package/dist/ports/command-runner.d.ts.map +1 -1
- package/dist/ports/command-runner.js +17 -7
- package/dist/ports/command-runner.js.map +1 -1
- package/dist/types.d.ts +5 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/wrangler.d.ts +5 -2
- package/dist/wrangler.d.ts.map +1 -1
- package/dist/wrangler.js +9 -2
- package/dist/wrangler.js.map +1 -1
- package/package.json +2 -1
- package/dist/frameworks/astro/adapter-patches/strip-cloudflare-base-nesting.d.ts +0 -2
- package/dist/frameworks/astro/adapter-patches/strip-cloudflare-base-nesting.d.ts.map +0 -1
- package/dist/frameworks/astro/adapter-patches/strip-cloudflare-base-nesting.js +0 -97
- package/dist/frameworks/astro/adapter-patches/strip-cloudflare-base-nesting.js.map +0 -1
package/README.md
CHANGED
|
@@ -91,3 +91,71 @@ npm test # jest
|
|
|
91
91
|
npm run build # tsc → dist/
|
|
92
92
|
npm run type-check
|
|
93
93
|
```
|
|
94
|
+
|
|
95
|
+
## How consumers resolve this package
|
|
96
|
+
|
|
97
|
+
Two consumers build with this engine: the Webflow CLI (`apps/webflow-cli`, same
|
|
98
|
+
monorepo) and the cosmic-builder image (`webflow/infrastructure`, a separate
|
|
99
|
+
repo). Which copy of `@webflow/cloud-app` they load is decided by **where
|
|
100
|
+
`npm install` ran**, not by how the code is bundled and not at runtime — a
|
|
101
|
+
`require("@webflow/cloud-app")` just reads whatever `npm` put in `node_modules`.
|
|
102
|
+
|
|
103
|
+
| Scenario | `node_modules/@webflow/cloud-app` is… | Source |
|
|
104
|
+
| ---------------------------------------------------------------------------- | ------------------------------------- | --------------------- |
|
|
105
|
+
| End user runs `npm i -g @webflow/webflow-cli` | the registry copy npm fetched | npm registry |
|
|
106
|
+
| Engineer working in the webflow-cli repo (`npm ci`, build, run local `dist`) | a symlink to `apps/webflow-cloud-app` | workspace (repo tree) |
|
|
107
|
+
| CI for webflow-cli (unit, regression, e2e) | a symlink to `apps/webflow-cloud-app` | workspace (repo tree) |
|
|
108
|
+
| cosmic-builder (separate repo) | the registry copy npm fetched | npm registry |
|
|
109
|
+
|
|
110
|
+
- **Inside this monorepo the CLI always uses the workspace copy.**
|
|
111
|
+
`apps/webflow-cloud-app` is a workspace member, so npm links it by name
|
|
112
|
+
while the declared version matches — `apps/webflow-cli`
|
|
113
|
+
depends on it at an exact pin equal to this package's version (enforced in CI
|
|
114
|
+
by `npm run check:cloud-app-pin`; a mismatched pin would make npm silently
|
|
115
|
+
install the registry copy instead). Edit the source here and it takes effect on
|
|
116
|
+
the next build.
|
|
117
|
+
- **The published CLI uses the registry copy.** The engine is kept external in
|
|
118
|
+
the CLI's tsup bundle (it is CJS, not inlined), so the shipped `dist` keeps
|
|
119
|
+
`require("@webflow/cloud-app")` and resolves it at the user's install time.
|
|
120
|
+
The CLI's `package.json` carries an exact pin (not a caret, since this is a
|
|
121
|
+
prerelease line the CLI is built and tested against), so released builds
|
|
122
|
+
resolve exactly that version from npm.
|
|
123
|
+
- **cosmic-builder is a different repo**, so it has no workspace copy and always
|
|
124
|
+
resolves from the registry. That is why publishing to npm (below) still
|
|
125
|
+
matters even though the CLI links the workspace in development.
|
|
126
|
+
|
|
127
|
+
## Publishing
|
|
128
|
+
|
|
129
|
+
Published **manually** from this folder — there is no GitHub Action. Its release
|
|
130
|
+
cadence follows the build engine, not the CLI. It is a regular changesets
|
|
131
|
+
workspace package, but `changeset publish` always publishes with `--tag latest`,
|
|
132
|
+
which would move `latest` onto a beta, so it must already be on npm before a CLI
|
|
133
|
+
release: `publish-packages.sh` refuses to run otherwise, and skips it once it is.
|
|
134
|
+
Don't add changesets for this package — changesets can't increment a prerelease
|
|
135
|
+
(it would turn `0.1.0-beta.7` into `0.1.0`); bump the version by hand. CI fails
|
|
136
|
+
(`npm run check:cloud-app-pin`) if a changeset names it.
|
|
137
|
+
|
|
138
|
+
This is a prerelease line (`0.1.0-beta.x`), so always pass an explicit
|
|
139
|
+
`--tag` — npm would otherwise move the `latest` tag onto a beta. The CLI pins
|
|
140
|
+
this exact version, so move the pin in the same PR (CI runs
|
|
141
|
+
`npm run check:cloud-app-pin`):
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
# from apps/webflow-cloud-app
|
|
145
|
+
npm version prerelease --preid beta --no-git-tag-version # 0.1.0-beta.7 → 0.1.0-beta.8
|
|
146
|
+
# set "@webflow/cloud-app" in apps/webflow-cli/package.json to the same version
|
|
147
|
+
# and run `npm install` from the repo root
|
|
148
|
+
npm publish --tag beta # installs via @webflow/cloud-app@beta
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
To test a build against the consumers (webflow-cli, cosmic-builder) before a
|
|
152
|
+
real release, publish the same version under a throwaway ticket-scoped tag so
|
|
153
|
+
it never touches `latest` or `beta`:
|
|
154
|
+
|
|
155
|
+
```bash
|
|
156
|
+
npm publish --tag beta7-cloud888 # installs via @webflow/cloud-app@beta7-cloud888
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
Consumers then pin that exact version (e.g. `"@webflow/cloud-app": "0.1.0-beta.8"`)
|
|
160
|
+
and CI resolves it from the registry. Remove a throwaway tag when done with
|
|
161
|
+
`npm dist-tag rm @webflow/cloud-app beta7-cloud888`.
|
package/dist/bindings.d.ts
CHANGED
|
@@ -174,6 +174,11 @@ export declare function hasAnyBindings(bindings: WebflowBindings | undefined): b
|
|
|
174
174
|
export declare function validateR2BucketName(name: string): void;
|
|
175
175
|
/** Enforce per-type count limits and R2 naming rules. Mirrors the deployer's checks. */
|
|
176
176
|
export declare function validateBindings(bindings: WebflowBindings): void;
|
|
177
|
+
/**
|
|
178
|
+
* `compatibility_date` written into the binding bridge. A schema placeholder the deployer
|
|
179
|
+
* ignores, not a date the user chose; the compat date policy never treats it as one.
|
|
180
|
+
*/
|
|
181
|
+
export declare const BINDINGS_BRIDGE_COMPAT_DATE = "2025-01-01";
|
|
177
182
|
/**
|
|
178
183
|
* Synthesize the wrangler-shaped binding bridge from webflow.json bindings.
|
|
179
184
|
*
|
package/dist/bindings.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bindings.d.ts","sourceRoot":"","sources":["../src/bindings.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAE/C,uEAAuE;AACvE,eAAO,MAAM,qBAAqB,IAAI,CAAC;AASvC,eAAO,MAAM,eAAe;;;;;;;;;gCAEZ,CAAC;AACjB,eAAO,MAAM,eAAe;;;;;;;;;gCAEZ,CAAC;AACjB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;gCAOZ,CAAC;AAEjB,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAMX,CAAC;AAEjB,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE7D,6FAA6F;AAC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AQ,EAAE,eAAe,GAAG,SAAS,GAAG,OAAO,CAG7E;AAED,2GAA2G;AAC3G,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAgBvD;AAED,wFAAwF;AACxF,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,eAAe,GAAG,IAAI,CAmBhE;AAED;;;GAGG;AACH,eAAO,MAAM,2BAA2B,eAAe,CAAC;AAExD;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,eAAe,EACzB,IAAI,SAAgB,GACnB,YAAY,CAmBd"}
|
package/dist/bindings.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BindingsSchema = exports.D1BindingSchema = exports.R2BindingSchema = exports.KvBindingSchema = exports.MAX_BINDINGS_PER_TYPE = void 0;
|
|
3
|
+
exports.BINDINGS_BRIDGE_COMPAT_DATE = exports.BindingsSchema = exports.D1BindingSchema = exports.R2BindingSchema = exports.KvBindingSchema = exports.MAX_BINDINGS_PER_TYPE = void 0;
|
|
4
4
|
exports.parseBindings = parseBindings;
|
|
5
5
|
exports.hasAnyBindings = hasAnyBindings;
|
|
6
6
|
exports.validateR2BucketName = validateR2BucketName;
|
|
@@ -90,6 +90,11 @@ function validateBindings(bindings) {
|
|
|
90
90
|
validateR2BucketName(bucket.bucket_name);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
|
+
/**
|
|
94
|
+
* `compatibility_date` written into the binding bridge. A schema placeholder the deployer
|
|
95
|
+
* ignores, not a date the user chose; the compat date policy never treats it as one.
|
|
96
|
+
*/
|
|
97
|
+
exports.BINDINGS_BRIDGE_COMPAT_DATE = '2025-01-01';
|
|
93
98
|
/**
|
|
94
99
|
* Synthesize the wrangler-shaped binding bridge from webflow.json bindings.
|
|
95
100
|
*
|
|
@@ -100,7 +105,7 @@ function validateBindings(bindings) {
|
|
|
100
105
|
function bindingsToWranglerJson(bindings, name = 'webflow-app') {
|
|
101
106
|
return {
|
|
102
107
|
name,
|
|
103
|
-
compatibility_date:
|
|
108
|
+
compatibility_date: exports.BINDINGS_BRIDGE_COMPAT_DATE,
|
|
104
109
|
kv_namespaces: (bindings.kv ?? []).map((k) => ({
|
|
105
110
|
binding: k.binding,
|
|
106
111
|
id: k.id ?? KV_ID_PLACEHOLDER,
|
package/dist/bindings.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bindings.js","sourceRoot":"","sources":["../src/bindings.ts"],"names":[],"mappings":";;;AAwDA,sCAGC;AAGD,wCAGC;AAGD,oDAgBC;AAGD,4CAmBC;
|
|
1
|
+
{"version":3,"file":"bindings.js","sourceRoot":"","sources":["../src/bindings.ts"],"names":[],"mappings":";;;AAwDA,sCAGC;AAGD,wCAGC;AAGD,oDAgBC;AAGD,4CAmBC;AAeD,wDAsBC;AA/ID;;;;;;;;;;;;;;GAcG;AACH,6BAAwB;AAExB,gDAA2D;AAG3D,uEAAuE;AAC1D,QAAA,qBAAqB,GAAG,CAAC,CAAC;AAEvC,yEAAyE;AACzE,6DAA6D;AAC7D,MAAM,iBAAiB,GAAG,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;AACzC,MAAM,iBAAiB,GAAG,sCAAsC,CAAC;AAEjE,gFAAgF;AAChF,wEAAwE;AAC3D,QAAA,eAAe,GAAG,OAAC;KAC7B,MAAM,CAAC,EAAE,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC;KAC1D,WAAW,EAAE,CAAC;AACJ,QAAA,eAAe,GAAG,OAAC;KAC7B,MAAM,CAAC,EAAE,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,CAAC;KACxD,WAAW,EAAE,CAAC;AACJ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C3C,CAAC;AACH,CAAC;AAED;;;GAGG;AACU,QAAA,2BAA2B,GAAG,YAAY,CAAC;AAExD;;;;;;GAMG;AACH,SAAgB,sBAAsB,CACpC,QAAyB,EACzB,IAAI,GAAG,aAAa;IAEpB,OAAO;QACL,IAAI;QACJ,kBAAkB,EAAE,mCAA2B;QAC/C,aAAa,EAAE,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC7C,OAAO,EAAE,CAAC,CAAC,OAAO;YAClB,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,iBAAiB;SAC9B,CAAC,CAAC;QACH,UAAU,EAAE,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC1C,OAAO,EAAE,CAAC,CAAC,OAAO;YAClB,WAAW,EAAE,CAAC,CAAC,WAAW;SAC3B,CAAC,CAAC;QACH,YAAY,EAAE,CAAC,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC;YAC5C,OAAO,EAAE,CAAC,CAAC,OAAO;YAClB,aAAa,EAAE,CAAC,CAAC,aAAa;YAC9B,WAAW,EAAE,CAAC,CAAC,WAAW,IAAI,iBAAiB;YAC/C,GAAG,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,EAAE,cAAc,EAAE,CAAC,CAAC,cAAc,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAClE,CAAC,CAAC;KACJ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { Logger } from './ports';
|
|
2
|
+
/**
|
|
3
|
+
* Lowest `compatibility_date` the platform runs a worker at once the policy is on.
|
|
4
|
+
* workerd only provides a working `node:http` / `node:https` client from this date.
|
|
5
|
+
*/
|
|
6
|
+
export declare const COMPAT_DATE_FLOOR = "2025-08-16";
|
|
7
|
+
/**
|
|
8
|
+
* Where the build records the date it settled on, next to `clouduser.wrangler.json`
|
|
9
|
+
* (which already travels from the build to the deploy). Keep in sync with the
|
|
10
|
+
* deployer.
|
|
11
|
+
*/
|
|
12
|
+
export declare const COMPAT_DATE_RECORD_FILE = "clouduser.compat-date.json";
|
|
13
|
+
export type CompatDateSource = 'template' | 'floor' | 'user';
|
|
14
|
+
export interface CompatDateInputs {
|
|
15
|
+
/** `compatibility_date` of the template the build's wrangler.json was copied from. */
|
|
16
|
+
templateDate: string;
|
|
17
|
+
/** `compatibility_date` from the user's own wrangler config, if any. */
|
|
18
|
+
userDate?: string;
|
|
19
|
+
/**
|
|
20
|
+
* When false the template date is used unchanged. When true, the result is always
|
|
21
|
+
* a valid date at or above COMPAT_DATE_FLOOR: the user's date when it qualifies,
|
|
22
|
+
* otherwise the template's date or the floor, whichever is later.
|
|
23
|
+
*/
|
|
24
|
+
policyEnabled: boolean;
|
|
25
|
+
/** Injected for tests. */
|
|
26
|
+
now?: Date;
|
|
27
|
+
}
|
|
28
|
+
export interface CompatDateResolution {
|
|
29
|
+
date: string;
|
|
30
|
+
source: CompatDateSource;
|
|
31
|
+
/** Present when the user's date was unusable. */
|
|
32
|
+
warning?: string;
|
|
33
|
+
}
|
|
34
|
+
/** What the build leaves for the deploy. */
|
|
35
|
+
export interface CompatDateRecord {
|
|
36
|
+
compatibilityDate: string;
|
|
37
|
+
source: CompatDateSource;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Pure resolution of the date a worker is built and deployed with.
|
|
41
|
+
*
|
|
42
|
+
* policy off -> template date, unchanged
|
|
43
|
+
* policy on, user date valid, <= today, >= floor -> user date
|
|
44
|
+
* policy on, otherwise -> default, plus a warning if a
|
|
45
|
+
* user date was given but unusable
|
|
46
|
+
*
|
|
47
|
+
* where default = the template date if it is a valid date at or above the floor,
|
|
48
|
+
* else the floor.
|
|
49
|
+
*/
|
|
50
|
+
export declare function resolveCompatDate(inputs: CompatDateInputs): CompatDateResolution;
|
|
51
|
+
/**
|
|
52
|
+
* Settles the date on `<cwd>/wrangler.json` (just copied from the framework
|
|
53
|
+
* template) and records it for the deploy.
|
|
54
|
+
*
|
|
55
|
+
* `userCompatDate` is the date from the user's own wrangler config, if any. The
|
|
56
|
+
* bindings-bridge placeholder is not a user choice and is ignored. With the policy
|
|
57
|
+
* off nothing changes and no record is written; a record already in the checkout is
|
|
58
|
+
* removed either way, because the deploy trusts that file and a repo must not be
|
|
59
|
+
* able to supply it.
|
|
60
|
+
*
|
|
61
|
+
* Never throws: an error keeps the template date and logs a warning, so this cannot
|
|
62
|
+
* fail a build.
|
|
63
|
+
*/
|
|
64
|
+
export declare function applyCompatDateAtBuild(log: Logger, cwd: string, userCompatDate: string | undefined, opts?: {
|
|
65
|
+
policyEnabled?: boolean;
|
|
66
|
+
now?: Date;
|
|
67
|
+
}): CompatDateResolution | undefined;
|
|
68
|
+
//# sourceMappingURL=compat-date.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compat-date.d.ts","sourceRoot":"","sources":["../src/compat-date.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAGtC;;;GAGG;AACH,eAAO,MAAM,iBAAiB,eAAe,CAAC;AAE9C;;;;GAIG;AACH,eAAO,MAAM,uBAAuB,+BAA+B,CAAC;AAEpE,MAAM,MAAM,gBAAgB,GAAG,UAAU,GAAG,OAAO,GAAG,MAAM,CAAC;AAE7D,MAAM,WAAW,gBAAgB;IAC/B,sFAAsF;IACtF,YAAY,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,aAAa,EAAE,OAAO,CAAC;IACvB,0BAA0B;IAC1B,GAAG,CAAC,EAAE,IAAI,CAAC;CACZ;AAED,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,gBAAgB,CAAC;IACzB,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,4CAA4C;AAC5C,MAAM,WAAW,gBAAgB;IAC/B,iBAAiB,EAAE,MAAM,CAAC;IAC1B,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AAUD;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,gBAAgB,GAAG,oBAAoB,CAgChF;AAMD;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,cAAc,EAAE,MAAM,GAAG,SAAS,EAClC,IAAI,GAAE;IAAE,aAAa,CAAC,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,EAAE,IAAI,CAAA;CAAO,GACjD,oBAAoB,GAAG,SAAS,CAwClC"}
|
|
@@ -0,0 +1,169 @@
|
|
|
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.COMPAT_DATE_RECORD_FILE = exports.COMPAT_DATE_FLOOR = void 0;
|
|
37
|
+
exports.resolveCompatDate = resolveCompatDate;
|
|
38
|
+
exports.applyCompatDateAtBuild = applyCompatDateAtBuild;
|
|
39
|
+
/**
|
|
40
|
+
* Build-phase `compatibility_date` policy.
|
|
41
|
+
*
|
|
42
|
+
* wrangler bundles the worker at build time, and the date decides whether Node's
|
|
43
|
+
* `http`/`https` are inlined unenv polyfills or native imports. A bundle built at
|
|
44
|
+
* an old date still throws at a newer runtime date (so SDKs on Node's http client,
|
|
45
|
+
* like Sentry's server transport, silently drop data), and a bundle built at a new
|
|
46
|
+
* date fails to start at an old one. So the build settles the date once, on the
|
|
47
|
+
* `wrangler.json` it just copied from the framework template, and records it for
|
|
48
|
+
* the deploy, which applies the record and never decides a date itself.
|
|
49
|
+
*
|
|
50
|
+
* The policy is switched on by the host (the server's feature gate, via
|
|
51
|
+
* `compatDatePolicy`); off keeps today's behavior exactly.
|
|
52
|
+
*/
|
|
53
|
+
const fs = __importStar(require("node:fs"));
|
|
54
|
+
const path = __importStar(require("node:path"));
|
|
55
|
+
const bindings_1 = require("./bindings");
|
|
56
|
+
/**
|
|
57
|
+
* Lowest `compatibility_date` the platform runs a worker at once the policy is on.
|
|
58
|
+
* workerd only provides a working `node:http` / `node:https` client from this date.
|
|
59
|
+
*/
|
|
60
|
+
exports.COMPAT_DATE_FLOOR = '2025-08-16';
|
|
61
|
+
/**
|
|
62
|
+
* Where the build records the date it settled on, next to `clouduser.wrangler.json`
|
|
63
|
+
* (which already travels from the build to the deploy). Keep in sync with the
|
|
64
|
+
* deployer.
|
|
65
|
+
*/
|
|
66
|
+
exports.COMPAT_DATE_RECORD_FILE = 'clouduser.compat-date.json';
|
|
67
|
+
function isValidDate(value) {
|
|
68
|
+
if (!/^\d{4}-\d{2}-\d{2}$/.test(value)) {
|
|
69
|
+
return false;
|
|
70
|
+
}
|
|
71
|
+
const parsed = new Date(`${value}T00:00:00Z`);
|
|
72
|
+
return !Number.isNaN(parsed.getTime()) && parsed.toISOString().slice(0, 10) === value;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Pure resolution of the date a worker is built and deployed with.
|
|
76
|
+
*
|
|
77
|
+
* policy off -> template date, unchanged
|
|
78
|
+
* policy on, user date valid, <= today, >= floor -> user date
|
|
79
|
+
* policy on, otherwise -> default, plus a warning if a
|
|
80
|
+
* user date was given but unusable
|
|
81
|
+
*
|
|
82
|
+
* where default = the template date if it is a valid date at or above the floor,
|
|
83
|
+
* else the floor.
|
|
84
|
+
*/
|
|
85
|
+
function resolveCompatDate(inputs) {
|
|
86
|
+
const { templateDate, userDate, policyEnabled } = inputs;
|
|
87
|
+
const today = (inputs.now ?? new Date()).toISOString().slice(0, 10);
|
|
88
|
+
if (!policyEnabled) {
|
|
89
|
+
return { date: templateDate, source: 'template' };
|
|
90
|
+
}
|
|
91
|
+
const templateUsable = isValidDate(templateDate) && templateDate >= exports.COMPAT_DATE_FLOOR;
|
|
92
|
+
const fallback = templateUsable
|
|
93
|
+
? { date: templateDate, source: 'template' }
|
|
94
|
+
: { date: exports.COMPAT_DATE_FLOOR, source: 'floor' };
|
|
95
|
+
if (userDate === undefined) {
|
|
96
|
+
return fallback;
|
|
97
|
+
}
|
|
98
|
+
let problem;
|
|
99
|
+
if (!isValidDate(userDate)) {
|
|
100
|
+
problem = 'is not a valid YYYY-MM-DD date';
|
|
101
|
+
}
|
|
102
|
+
else if (userDate > today) {
|
|
103
|
+
problem = 'is in the future';
|
|
104
|
+
}
|
|
105
|
+
else if (userDate < exports.COMPAT_DATE_FLOOR) {
|
|
106
|
+
problem = `is below the platform minimum ${exports.COMPAT_DATE_FLOOR}`;
|
|
107
|
+
}
|
|
108
|
+
if (problem) {
|
|
109
|
+
return {
|
|
110
|
+
...fallback,
|
|
111
|
+
warning: `compatibility_date ${userDate} in your wrangler config ${problem}, using ${fallback.date}`,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
return { date: userDate, source: 'user' };
|
|
115
|
+
}
|
|
116
|
+
function recordPath(cwd) {
|
|
117
|
+
return path.join(cwd, exports.COMPAT_DATE_RECORD_FILE);
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Settles the date on `<cwd>/wrangler.json` (just copied from the framework
|
|
121
|
+
* template) and records it for the deploy.
|
|
122
|
+
*
|
|
123
|
+
* `userCompatDate` is the date from the user's own wrangler config, if any. The
|
|
124
|
+
* bindings-bridge placeholder is not a user choice and is ignored. With the policy
|
|
125
|
+
* off nothing changes and no record is written; a record already in the checkout is
|
|
126
|
+
* removed either way, because the deploy trusts that file and a repo must not be
|
|
127
|
+
* able to supply it.
|
|
128
|
+
*
|
|
129
|
+
* Never throws: an error keeps the template date and logs a warning, so this cannot
|
|
130
|
+
* fail a build.
|
|
131
|
+
*/
|
|
132
|
+
function applyCompatDateAtBuild(log, cwd, userCompatDate, opts = {}) {
|
|
133
|
+
try {
|
|
134
|
+
fs.rmSync(recordPath(cwd), { force: true });
|
|
135
|
+
const wranglerPath = path.join(cwd, 'wrangler.json');
|
|
136
|
+
const generated = JSON.parse(fs.readFileSync(wranglerPath, 'utf8'));
|
|
137
|
+
const templateDate = generated.compatibility_date;
|
|
138
|
+
const userDate = userCompatDate === bindings_1.BINDINGS_BRIDGE_COMPAT_DATE ? undefined : userCompatDate;
|
|
139
|
+
const policyEnabled = opts.policyEnabled === true;
|
|
140
|
+
const resolution = resolveCompatDate({ templateDate, userDate, policyEnabled, now: opts.now });
|
|
141
|
+
log.info(`compatibility_date: ${resolution.date} (${resolution.source}; policy ${policyEnabled ? 'on' : 'off'}, template ${templateDate}${userDate ? `, user ${userDate}` : ''})`);
|
|
142
|
+
if (resolution.warning) {
|
|
143
|
+
log.warn(resolution.warning);
|
|
144
|
+
}
|
|
145
|
+
if (policyEnabled) {
|
|
146
|
+
if (resolution.date !== templateDate) {
|
|
147
|
+
generated.compatibility_date = resolution.date;
|
|
148
|
+
fs.writeFileSync(wranglerPath, `${JSON.stringify(generated, null, 2)}\n`);
|
|
149
|
+
}
|
|
150
|
+
const record = {
|
|
151
|
+
compatibilityDate: resolution.date,
|
|
152
|
+
source: resolution.source,
|
|
153
|
+
};
|
|
154
|
+
fs.writeFileSync(recordPath(cwd), JSON.stringify(record));
|
|
155
|
+
}
|
|
156
|
+
return resolution;
|
|
157
|
+
}
|
|
158
|
+
catch (err) {
|
|
159
|
+
log.warn(`could not apply the compatibility_date policy, keeping the template date: ${err}`);
|
|
160
|
+
try {
|
|
161
|
+
fs.rmSync(recordPath(cwd), { force: true });
|
|
162
|
+
}
|
|
163
|
+
catch {
|
|
164
|
+
// nothing more to do
|
|
165
|
+
}
|
|
166
|
+
return undefined;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
//# sourceMappingURL=compat-date.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compat-date.js","sourceRoot":"","sources":["../src/compat-date.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkFA,8CAgCC;AAmBD,wDA6CC;AAlLD;;;;;;;;;;;;;GAaG;AACH,4CA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,CAAC;QAC7F,IAAI,CAAC;YACH,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAC9C,CAAC;QAAC,MAAM,CAAC;YACP,qBAAqB;QACvB,CAAC;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;AACH,CAAC"}
|
|
@@ -31,12 +31,6 @@ export type WebflowJson = {
|
|
|
31
31
|
* Build-only: URL prefix for static assets. NOT part of the deploy contract.
|
|
32
32
|
*/
|
|
33
33
|
assets_path_prefix?: string;
|
|
34
|
-
/**
|
|
35
|
-
* Build-only: skip appending the mount path to the assets source dir
|
|
36
|
-
* (Astro 6 writes to `dist/client/` regardless of mount config). NOT part
|
|
37
|
-
* of the deploy contract.
|
|
38
|
-
*/
|
|
39
|
-
assets_source_skip_mount_path?: boolean;
|
|
40
34
|
[key: string]: unknown;
|
|
41
35
|
};
|
|
42
36
|
[key: string]: unknown;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webflow-json.d.ts","sourceRoot":"","sources":["../../src/config/webflow-json.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE;QACN,iGAAiG;QACjG,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB;;;;WAIG;QACH,QAAQ,CAAC,EAAE,eAAe,CAAC;QAC3B;;WAEG;QACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B
|
|
1
|
+
{"version":3,"file":"webflow-json.d.ts","sourceRoot":"","sources":["../../src/config/webflow-json.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACvC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAEnD;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,KAAK,CAAC,EAAE;QACN,iGAAiG;QACjG,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;QAC1B,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,cAAc,CAAC,EAAE,OAAO,CAAC;QACzB;;;;WAIG;QACH,QAAQ,CAAC,EAAE,eAAe,CAAC;QAC3B;;WAEG;QACH,kBAAkB,CAAC,EAAE,MAAM,CAAC;QAC5B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;KACxB,CAAC;IACF,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB,CAAC;AAEF;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAC7B,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,IAAI,SAAiB,GACpB,WAAW,GAAG,SAAS,CAyBzB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webflow-json.js","sourceRoot":"","sources":["../../src/config/webflow-json.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"webflow-json.js","sourceRoot":"","sources":["../../src/config/webflow-json.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoDA,0CA6BC;AAjFD,4CAA8B;AAC9B,gDAAkC;AAElC,oDAAsC;AAyCtC;;;;;;;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derClass } from './frameworks/registry';
|
|
|
6
6
|
* Compute the cloud.* fields createWebflowJson would write for a given framework.
|
|
7
7
|
*
|
|
8
8
|
* The returned object satisfies `DeployContractV1` for the contract fields the
|
|
9
|
-
* deployer reads
|
|
10
|
-
* that the contract tolerates via passthrough.
|
|
9
|
+
* deployer reads.
|
|
11
10
|
*/
|
|
12
|
-
export declare function deriveCloudFields(frameworkName: string, builder: FrameworkBuilder | BuilderClass): DeployContractV1
|
|
13
|
-
assets_source_skip_mount_path?: boolean;
|
|
14
|
-
};
|
|
11
|
+
export declare function deriveCloudFields(frameworkName: string, builder: FrameworkBuilder | BuilderClass): DeployContractV1;
|
|
15
12
|
/**
|
|
16
13
|
* Create or update webflow.json with the detected framework and build output
|
|
17
14
|
* info.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-webflow-json.d.ts","sourceRoot":"","sources":["../src/create-webflow-json.ts"],"names":[],"mappings":"AAYA,OAAO,EAEL,KAAK,gBAAgB,EAEtB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D
|
|
1
|
+
{"version":3,"file":"create-webflow-json.d.ts","sourceRoot":"","sources":["../src/create-webflow-json.ts"],"names":[],"mappings":"AAYA,OAAO,EAEL,KAAK,gBAAgB,EAEtB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAC/B,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,gBAAgB,GAAG,YAAY,GACvC,gBAAgB,CAqClB;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,GAAG,EAAE,MAAM,EACX,GAAG,EAAE,MAAM,EACX,aAAa,EAAE,MAAM,EACrB,OAAO,EAAE,gBAAgB,GAAG,YAAY,GACvC,IAAI,CA8EN"}
|
|
@@ -51,8 +51,7 @@ const cosmic_deploy_contract_1 = require("@webflow/cosmic-deploy-contract");
|
|
|
51
51
|
* Compute the cloud.* fields createWebflowJson would write for a given framework.
|
|
52
52
|
*
|
|
53
53
|
* The returned object satisfies `DeployContractV1` for the contract fields the
|
|
54
|
-
* deployer reads
|
|
55
|
-
* that the contract tolerates via passthrough.
|
|
54
|
+
* deployer reads.
|
|
56
55
|
*/
|
|
57
56
|
function deriveCloudFields(frameworkName, builder) {
|
|
58
57
|
const output = typeof builder === 'function'
|
|
@@ -79,18 +78,12 @@ function deriveCloudFields(frameworkName, builder) {
|
|
|
79
78
|
// capability (reads the user's package.json via the builder's ctx), so it's
|
|
80
79
|
// only available for the build-phase instance path — not the deploy-phase
|
|
81
80
|
// BuilderClass path. Omitted when unresolvable (e.g. `workspace:*`, `latest`).
|
|
82
|
-
// CLD-1785.
|
|
83
81
|
if (typeof builder !== 'function') {
|
|
84
82
|
const frameworkVersion = builder.getFrameworkVersion();
|
|
85
83
|
if (frameworkVersion) {
|
|
86
84
|
cloud.framework_version = frameworkVersion;
|
|
87
85
|
}
|
|
88
86
|
}
|
|
89
|
-
// Build-only field, outside the deploy contract but written here so build-phase
|
|
90
|
-
// code can read a single source of truth.
|
|
91
|
-
if (output.assetsSourceSkipMountPath) {
|
|
92
|
-
cloud.assets_source_skip_mount_path = true;
|
|
93
|
-
}
|
|
94
87
|
return cloud;
|
|
95
88
|
}
|
|
96
89
|
/**
|
|
@@ -131,13 +124,17 @@ function createWebflowJson(log, cwd, frameworkName, builder) {
|
|
|
131
124
|
'deployment_type',
|
|
132
125
|
'entrypoint_path',
|
|
133
126
|
'skip_no_bundle',
|
|
134
|
-
'assets_source_skip_mount_path',
|
|
135
127
|
];
|
|
136
128
|
for (const key of trackedKeys) {
|
|
137
129
|
if (existing[key] !== desired[key]) {
|
|
138
130
|
changed.push(`${key}: ${JSON.stringify(existing[key])} -> ${JSON.stringify(desired[key])}`);
|
|
139
131
|
}
|
|
140
132
|
}
|
|
133
|
+
// Retired build-only flag; a stale copy from an earlier version must not be re-emitted. Its
|
|
134
|
+
// presence counts as a change so the file is rewritten even when it is the only difference.
|
|
135
|
+
if ('assets_source_skip_mount_path' in existing) {
|
|
136
|
+
changed.push('assets_source_skip_mount_path: removed (retired)');
|
|
137
|
+
}
|
|
141
138
|
if (changed.length === 0) {
|
|
142
139
|
log.info('webflow.json output metadata is correct, skipping write');
|
|
143
140
|
}
|
|
@@ -145,6 +142,7 @@ function createWebflowJson(log, cwd, frameworkName, builder) {
|
|
|
145
142
|
log.info(`webflow.json output metadata changed: ${changed.join(', ')}`);
|
|
146
143
|
// Apply desired values, preserving any other keys (e.g. assets_path_prefix).
|
|
147
144
|
Object.assign(existing, desired);
|
|
145
|
+
delete existing.assets_source_skip_mount_path;
|
|
148
146
|
}
|
|
149
147
|
// Self-check: a producer should never write a file that fails the deploy
|
|
150
148
|
// contract. Throw here so a builder bug surfaces during build, not deploy.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"create-webflow-json.js","sourceRoot":"","sources":["../src/create-webflow-json.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"create-webflow-json.js","sourceRoot":"","sources":["../src/create-webflow-json.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6BA,8CAwCC;AAUD,8CAmFC;AAlKD;;;;;;;;GAQG;AACH,4CAA8B;AAC9B,gDAAkC;AAElC,4EAIyC;AAOzC;;;;;GAKG;AACH,SAAgB,iBAAiB,CAC/B,aAAqB,EACrB,OAAwC;IA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AAI,CAAC,SAAS,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC1E,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Guard for the Astro 6/7 verbatim assets copy (`staticAssetsMirrorUrlLayout`).
|
|
3
|
+
*
|
|
4
|
+
* The generated `astro.config` sets `base = mountPath`, so a correct `@astrojs/cloudflare`
|
|
5
|
+
* (>= 13.3.1 on Astro 6, all 14.x on Astro 7) nests the client tree under
|
|
6
|
+
* `<assetsPath>/<mount>/`, and `copyAssets` copies `assetsPath` as-is into the assets root.
|
|
7
|
+
* A buggy adapter (withastro/astro#16276) emits a FLAT tree instead, which would be published
|
|
8
|
+
* at the wrong URLs, so fail the build rather than ship it.
|
|
9
|
+
*
|
|
10
|
+
* A tree is nested only when `<assetsPath>/<mount>` is a directory AND the mount's top-level
|
|
11
|
+
* directory is the only entry next to adapter/platform metadata files. The mount dir alone is not
|
|
12
|
+
* proof: a flat tree plus a same-named page route (e.g. `src/pages/<mount>/`) also produces
|
|
13
|
+
* `<assetsPath>/<mount>/`. Any other root entry (`_astro/`, a custom `build.assets` dir, public
|
|
14
|
+
* files) means the client tree is flat, so this is deliberately not tied to the `_astro` name.
|
|
15
|
+
*
|
|
16
|
+
* Throws only when ALL of these hold:
|
|
17
|
+
* - the mount is not the root,
|
|
18
|
+
* - the tree is not nested (see above),
|
|
19
|
+
* - `<assetsPath>` exists and holds an entry other than adapter/platform metadata files.
|
|
20
|
+
* Everything else passes: a missing `assetsPath`, a metadata-only tree, and an asset-less app
|
|
21
|
+
* (an empty `<mount>/` dir still counts as nested).
|
|
22
|
+
*
|
|
23
|
+
* `ensureFixedCloudflareAdapter` forces a fixed adapter, which is what keeps this nearly
|
|
24
|
+
* unreachable. It is reachable through a non-semver adapter spec (git URL, `file:`, alias) or a
|
|
25
|
+
* cross-major pin the forced upgrade leaves alone.
|
|
26
|
+
*/
|
|
27
|
+
export declare function assertAdapterNestedUnderMount(cwd: string, assetsPath: string, cleanMountPath: string): void;
|
|
28
|
+
//# sourceMappingURL=assert-adapter-nested-under-mount.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"assert-adapter-nested-under-mount.d.ts","sourceRoot":"","sources":["../../../../src/frameworks/astro/adapter-patches/assert-adapter-nested-under-mount.ts"],"names":[],"mappings":"AAuCA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,6BAA6B,CAC3C,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,MAAM,GACrB,IAAI,CA4CN"}
|