@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
|
@@ -1,25 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Webflow Image Loader for Astro 6
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* Cloudflare's
|
|
4
|
+
* A custom Astro image service that resizes images on demand through
|
|
5
|
+
* Cloudflare's zone-level Image Resizing (`/cdn-cgi/image/...`). URL-building
|
|
6
|
+
* and responsive-width logic live in the framework-agnostic ./webflow-image-url
|
|
7
|
+
* helper (unit-tested); this file is the thin Astro-typed glue. Same loader as
|
|
8
|
+
* Astro 5 and 7.
|
|
6
9
|
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
10
|
+
* We set the adapter's imageService to 'custom' to keep resizing on the zone
|
|
11
|
+
* endpoint rather than the Worker Images binding.
|
|
9
12
|
*/
|
|
10
|
-
import type { ExternalImageService, ImageTransform, AstroConfig } from 'astro';
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
if (deployUrl && src.startsWith(deployUrl)) {
|
|
15
|
-
return `${src.slice(deployUrl.length)}`.slice(1);
|
|
16
|
-
} else if (mountPath && src.startsWith(mountPath)) {
|
|
17
|
-
return src.slice(1);
|
|
18
|
-
} else if (src.startsWith('/')) {
|
|
19
|
-
return `${mountPath}${src}`.slice(1);
|
|
20
|
-
}
|
|
21
|
-
return src;
|
|
22
|
-
}
|
|
14
|
+
import type { ExternalImageService, ImageTransform, AstroConfig } from 'astro';
|
|
15
|
+
import { normalizeSrc, isRemote, buildImageUrl, computeSrcSetWidths } from './webflow-image-url';
|
|
23
16
|
|
|
24
17
|
// Default implementation copied from Astro's baseService
|
|
25
18
|
function getTargetDimensions(options: ImageTransform) {
|
|
@@ -47,37 +40,58 @@ function getTargetDimensions(options: ImageTransform) {
|
|
|
47
40
|
|
|
48
41
|
const cloudflareLoader: ExternalImageService = {
|
|
49
42
|
getURL(options: ImageTransform, imageConfig: AstroConfig['image']) {
|
|
43
|
+
const { deployUrl, mountPath } = imageConfig.service.config;
|
|
50
44
|
const normalizedSrc = normalizeSrc(
|
|
51
45
|
typeof options.src === 'object' ? options.src.src : options.src,
|
|
52
|
-
|
|
53
|
-
|
|
46
|
+
deployUrl,
|
|
47
|
+
mountPath,
|
|
54
48
|
);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
// because optimizing them would result in two bandwidth charges: one from the website-files zone (for the full image)
|
|
58
|
-
// and one from the cosmic.webflow.services zone (for the resized image)
|
|
59
|
-
if (normalizedSrc.startsWith('http://') || normalizedSrc.startsWith('https://')) {
|
|
60
|
-
return normalizedSrc;
|
|
61
|
-
}
|
|
49
|
+
const isSvg =
|
|
50
|
+
typeof options.src === 'object' ? options.src.format === 'svg' : options.src.endsWith('.svg');
|
|
62
51
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
52
|
+
return buildImageUrl(
|
|
53
|
+
normalizedSrc,
|
|
54
|
+
{
|
|
55
|
+
width: options.width,
|
|
56
|
+
height: options.height,
|
|
57
|
+
quality: options.quality,
|
|
58
|
+
format: options.format,
|
|
59
|
+
},
|
|
60
|
+
deployUrl,
|
|
61
|
+
isSvg,
|
|
62
|
+
);
|
|
63
|
+
},
|
|
70
64
|
|
|
71
|
-
|
|
72
|
-
|
|
65
|
+
// Responsive variants. Astro resolves each entry's URL by calling getURL on
|
|
66
|
+
// its `transform`, so format=auto (set in getURL) flows through here too.
|
|
67
|
+
getSrcSet(options: ImageTransform, imageConfig: AstroConfig['image']) {
|
|
68
|
+
// Mirror getURL's passthrough: remote and SVG sources are not resized, so a
|
|
69
|
+
// srcset of identical URLs would be misleading markup. Normalize first, as
|
|
70
|
+
// getURL does, since build.assetsPrefix makes local asset srcs absolute on
|
|
71
|
+
// the deploy origin.
|
|
72
|
+
const { deployUrl, mountPath } = imageConfig.service.config;
|
|
73
|
+
const srcString = typeof options.src === 'object' ? options.src.src : options.src;
|
|
74
|
+
const normalizedSrc = normalizeSrc(srcString, deployUrl, mountPath);
|
|
73
75
|
const isSvg =
|
|
74
|
-
typeof options.src === 'object' ? options.src.format === 'svg' :
|
|
75
|
-
if (isSvg ||
|
|
76
|
-
return
|
|
76
|
+
typeof options.src === 'object' ? options.src.format === 'svg' : srcString.endsWith('.svg');
|
|
77
|
+
if (isSvg || isRemote(normalizedSrc)) {
|
|
78
|
+
return [];
|
|
77
79
|
}
|
|
78
80
|
|
|
79
|
-
const
|
|
80
|
-
|
|
81
|
+
const { targetWidth, targetHeight } = getTargetDimensions(options);
|
|
82
|
+
const maxWidth =
|
|
83
|
+
typeof options.src === 'object' && 'width' in options.src ? options.src.width : undefined;
|
|
84
|
+
|
|
85
|
+
return computeSrcSetWidths(options, targetWidth, targetHeight, maxWidth).map(
|
|
86
|
+
({ width, height, descriptor }) => ({
|
|
87
|
+
transform: { ...options, width, height },
|
|
88
|
+
descriptor,
|
|
89
|
+
// Only advertise a MIME type when a concrete format was requested. With
|
|
90
|
+
// the default (format=auto) Cloudflare negotiates the output, so
|
|
91
|
+
// `type: "image/auto"` would be an invalid, misleading hint.
|
|
92
|
+
attributes: options.format ? { type: `image/${options.format}` } : {},
|
|
93
|
+
}),
|
|
94
|
+
);
|
|
81
95
|
},
|
|
82
96
|
|
|
83
97
|
// Default implementation copied from Astro's baseService
|
|
@@ -1,26 +1,17 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Webflow Image Loader for Astro 7
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* A custom Astro image service that resizes images on demand through
|
|
5
|
+
* Cloudflare's zone-level Image Resizing (`/cdn-cgi/image/...`). URL-building
|
|
6
|
+
* and responsive-width logic live in the framework-agnostic ./webflow-image-url
|
|
7
|
+
* helper (unit-tested); this file is the thin Astro-typed glue.
|
|
6
8
|
*
|
|
7
|
-
* Note: Astro 7 defaults to 'cloudflare-binding' for imageService,
|
|
8
|
-
*
|
|
9
|
+
* Note: Astro 7 defaults to 'cloudflare-binding' for imageService, but we use
|
|
10
|
+
* 'custom' to keep resizing on the zone endpoint rather than the Worker binding.
|
|
9
11
|
*/
|
|
10
12
|
|
|
11
13
|
import type { ExternalImageService, ImageTransform, AstroConfig } from 'astro';
|
|
12
|
-
|
|
13
|
-
function normalizeSrc(src: string, deployUrl?: string, mountPath?: string) {
|
|
14
|
-
// For local assets, include the mount path but not the deploy url, and remove the leading slash
|
|
15
|
-
if (deployUrl && src.startsWith(deployUrl)) {
|
|
16
|
-
return `${src.slice(deployUrl.length)}`.slice(1);
|
|
17
|
-
} else if (mountPath && src.startsWith(mountPath)) {
|
|
18
|
-
return src.slice(1);
|
|
19
|
-
} else if (src.startsWith('/')) {
|
|
20
|
-
return `${mountPath}${src}`.slice(1);
|
|
21
|
-
}
|
|
22
|
-
return src;
|
|
23
|
-
}
|
|
14
|
+
import { normalizeSrc, isRemote, buildImageUrl, computeSrcSetWidths } from './webflow-image-url';
|
|
24
15
|
|
|
25
16
|
// Default implementation copied from Astro's baseService
|
|
26
17
|
function getTargetDimensions(options: ImageTransform) {
|
|
@@ -48,37 +39,58 @@ function getTargetDimensions(options: ImageTransform) {
|
|
|
48
39
|
|
|
49
40
|
const cloudflareLoader: ExternalImageService = {
|
|
50
41
|
getURL(options: ImageTransform, imageConfig: AstroConfig['image']) {
|
|
42
|
+
const { deployUrl, mountPath } = imageConfig.service.config;
|
|
51
43
|
const normalizedSrc = normalizeSrc(
|
|
52
44
|
typeof options.src === 'object' ? options.src.src : options.src,
|
|
53
|
-
|
|
54
|
-
|
|
45
|
+
deployUrl,
|
|
46
|
+
mountPath,
|
|
55
47
|
);
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
// because optimizing them would result in two bandwidth charges: one from the website-files zone (for the full image)
|
|
59
|
-
// and one from the cosmic.webflow.services zone (for the resized image)
|
|
60
|
-
if (normalizedSrc.startsWith('http://') || normalizedSrc.startsWith('https://')) {
|
|
61
|
-
return normalizedSrc;
|
|
62
|
-
}
|
|
48
|
+
const isSvg =
|
|
49
|
+
typeof options.src === 'object' ? options.src.format === 'svg' : options.src.endsWith('.svg');
|
|
63
50
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
51
|
+
return buildImageUrl(
|
|
52
|
+
normalizedSrc,
|
|
53
|
+
{
|
|
54
|
+
width: options.width,
|
|
55
|
+
height: options.height,
|
|
56
|
+
quality: options.quality,
|
|
57
|
+
format: options.format,
|
|
58
|
+
},
|
|
59
|
+
deployUrl,
|
|
60
|
+
isSvg,
|
|
61
|
+
);
|
|
62
|
+
},
|
|
71
63
|
|
|
72
|
-
|
|
73
|
-
|
|
64
|
+
// Responsive variants. Astro resolves each entry's URL by calling getURL on
|
|
65
|
+
// its `transform`, so format=auto (set in getURL) flows through here too.
|
|
66
|
+
getSrcSet(options: ImageTransform, imageConfig: AstroConfig['image']) {
|
|
67
|
+
// Mirror getURL's passthrough: remote and SVG sources are not resized, so a
|
|
68
|
+
// srcset of identical URLs would be misleading markup. Normalize first, as
|
|
69
|
+
// getURL does, since build.assetsPrefix makes local asset srcs absolute on
|
|
70
|
+
// the deploy origin.
|
|
71
|
+
const { deployUrl, mountPath } = imageConfig.service.config;
|
|
72
|
+
const srcString = typeof options.src === 'object' ? options.src.src : options.src;
|
|
73
|
+
const normalizedSrc = normalizeSrc(srcString, deployUrl, mountPath);
|
|
74
74
|
const isSvg =
|
|
75
|
-
typeof options.src === 'object' ? options.src.format === 'svg' :
|
|
76
|
-
if (isSvg ||
|
|
77
|
-
return
|
|
75
|
+
typeof options.src === 'object' ? options.src.format === 'svg' : srcString.endsWith('.svg');
|
|
76
|
+
if (isSvg || isRemote(normalizedSrc)) {
|
|
77
|
+
return [];
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
-
const
|
|
81
|
-
|
|
80
|
+
const { targetWidth, targetHeight } = getTargetDimensions(options);
|
|
81
|
+
const maxWidth =
|
|
82
|
+
typeof options.src === 'object' && 'width' in options.src ? options.src.width : undefined;
|
|
83
|
+
|
|
84
|
+
return computeSrcSetWidths(options, targetWidth, targetHeight, maxWidth).map(
|
|
85
|
+
({ width, height, descriptor }) => ({
|
|
86
|
+
transform: { ...options, width, height },
|
|
87
|
+
descriptor,
|
|
88
|
+
// Only advertise a MIME type when a concrete format was requested. With
|
|
89
|
+
// the default (format=auto) Cloudflare negotiates the output, so
|
|
90
|
+
// `type: "image/auto"` would be an invalid, misleading hint.
|
|
91
|
+
attributes: options.format ? { type: `image/${options.format}` } : {},
|
|
92
|
+
}),
|
|
93
|
+
);
|
|
82
94
|
},
|
|
83
95
|
|
|
84
96
|
// Default implementation copied from Astro's baseService
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
// Pure helpers for Webflow Cloud's on-demand Cloudflare image URLs.
|
|
2
|
+
//
|
|
3
|
+
// Copied verbatim into the user's project (imported by webflow-loader.ts) and
|
|
4
|
+
// unit-tested directly in @webflow/cloud-app. Deliberately free of any `astro`
|
|
5
|
+
// import so it can be type-checked and tested without the framework installed;
|
|
6
|
+
// the loader supplies the Astro-typed glue. Shared across Astro 5/6/7.
|
|
7
|
+
|
|
8
|
+
export type ImageUrlOptions = {
|
|
9
|
+
width?: number;
|
|
10
|
+
height?: number;
|
|
11
|
+
quality?: number | string;
|
|
12
|
+
format?: string;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Rewrite an image src to a path relative to the deploy: add the mount path,
|
|
17
|
+
* drop the deploy URL, and remove the leading slash. Remote URLs are returned
|
|
18
|
+
* unchanged so the caller can detect and pass them through.
|
|
19
|
+
*/
|
|
20
|
+
export function normalizeSrc(src: string, deployUrl?: string, mountPath?: string): string {
|
|
21
|
+
// For local assets, include the mount path but not the deploy url, and remove the leading slash
|
|
22
|
+
if (deployUrl && src.startsWith(deployUrl)) {
|
|
23
|
+
return `${src.slice(deployUrl.length)}`.slice(1);
|
|
24
|
+
} else if (mountPath && src.startsWith(mountPath)) {
|
|
25
|
+
return src.slice(1);
|
|
26
|
+
} else if (src.startsWith('/')) {
|
|
27
|
+
return `${mountPath}${src}`.slice(1);
|
|
28
|
+
}
|
|
29
|
+
return src;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function isRemote(normalizedSrc: string): boolean {
|
|
33
|
+
return normalizedSrc.startsWith('http://') || normalizedSrc.startsWith('https://');
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Build the on-demand Cloudflare Image Resizing URL (`/cdn-cgi/image/...`) for a
|
|
38
|
+
* local asset. Remote images and SVGs, and requests with nothing to transform,
|
|
39
|
+
* are returned as the plain asset URL.
|
|
40
|
+
*
|
|
41
|
+
* When the caller pins no `format`, default to `auto` so Cloudflare negotiates
|
|
42
|
+
* WebP/AVIF (via the Accept header) instead of serving the heavier source
|
|
43
|
+
* format. An explicit `format` is honored as-is.
|
|
44
|
+
*/
|
|
45
|
+
export function buildImageUrl(
|
|
46
|
+
normalizedSrc: string,
|
|
47
|
+
options: ImageUrlOptions,
|
|
48
|
+
deployUrl: string,
|
|
49
|
+
isSvg: boolean,
|
|
50
|
+
): string {
|
|
51
|
+
// Remote images are served as-is, never routed through Cloudflare resizing:
|
|
52
|
+
// our zone does not optimize external images, and re-optimizing Webflow-hosted
|
|
53
|
+
// images (cdn.website-files.com) would double-bill bandwidth (the origin zone
|
|
54
|
+
// for the full image plus the cosmic zone for the resized one). Astro hands
|
|
55
|
+
// http(s) srcs straight through.
|
|
56
|
+
if (isRemote(normalizedSrc)) {
|
|
57
|
+
return normalizedSrc;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const params: string[] = [];
|
|
61
|
+
for (const key of ['width', 'height', 'quality'] as const) {
|
|
62
|
+
const value = options[key];
|
|
63
|
+
if (value) {
|
|
64
|
+
params.push(`${key}=${value}`);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// Only route through /cdn-cgi/image when there is something to transform. An
|
|
69
|
+
// explicit format alone still counts (e.g. `<Image format="webp" />`).
|
|
70
|
+
const transforming = params.length > 0 || Boolean(options.format);
|
|
71
|
+
if (isSvg || !transforming) {
|
|
72
|
+
return `${deployUrl}/${normalizedSrc}`;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
params.push(`format=${options.format || 'auto'}`);
|
|
76
|
+
return `${deployUrl}/cdn-cgi/image/${params.join(',')}/${normalizedSrc}`;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export type SrcSetWidth = { width: number; height?: number; descriptor: string };
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Compute the responsive variants Astro's `<Image>` asked for, mirroring
|
|
83
|
+
* Astro's own baseService: `densities` yield `Nx` descriptors, `widths` yield
|
|
84
|
+
* `Nw` descriptors. Each width's height is derived from the target aspect ratio.
|
|
85
|
+
* Variants are de-duplicated and kept within `maxWidth` (the source's intrinsic
|
|
86
|
+
* width, when known): `widths` above it are clamped, and `densities` that would
|
|
87
|
+
* resolve above it are dropped (matching Astro, which never upscales). Returns
|
|
88
|
+
* `[]` when no responsive variants were requested, so the loader can omit
|
|
89
|
+
* `srcset` entirely.
|
|
90
|
+
*/
|
|
91
|
+
export function computeSrcSetWidths(
|
|
92
|
+
options: { widths?: number[]; densities?: Array<number | string> },
|
|
93
|
+
targetWidth: number | undefined,
|
|
94
|
+
targetHeight: number | undefined,
|
|
95
|
+
maxWidth?: number,
|
|
96
|
+
): SrcSetWidth[] {
|
|
97
|
+
if (!targetWidth) {
|
|
98
|
+
return [];
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const aspectRatio = targetHeight ? targetWidth / targetHeight : undefined;
|
|
102
|
+
const heightFor = (w: number) => (aspectRatio ? Math.round(w / aspectRatio) : undefined);
|
|
103
|
+
|
|
104
|
+
if (options.densities?.length) {
|
|
105
|
+
const seen = new Set<number>();
|
|
106
|
+
const result: SrcSetWidth[] = [];
|
|
107
|
+
for (const d of options.densities) {
|
|
108
|
+
const density = typeof d === 'string' ? parseFloat(d) : d;
|
|
109
|
+
const width = Math.round(targetWidth * density);
|
|
110
|
+
// Drop densities that would upscale past the source's intrinsic width:
|
|
111
|
+
// Astro's baseService ignores them rather than clamping, so an `Nx`
|
|
112
|
+
// descriptor never ends up pointing at a smaller image.
|
|
113
|
+
if (maxWidth && width > maxWidth) {
|
|
114
|
+
continue;
|
|
115
|
+
}
|
|
116
|
+
if (seen.has(width)) {
|
|
117
|
+
continue;
|
|
118
|
+
}
|
|
119
|
+
seen.add(width);
|
|
120
|
+
result.push({ width, height: heightFor(width), descriptor: `${density}x` });
|
|
121
|
+
}
|
|
122
|
+
return result;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (options.widths?.length) {
|
|
126
|
+
const seen = new Set<number>();
|
|
127
|
+
const result: SrcSetWidth[] = [];
|
|
128
|
+
for (const raw of options.widths) {
|
|
129
|
+
const width = maxWidth ? Math.min(raw, maxWidth) : raw;
|
|
130
|
+
if (seen.has(width)) {
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
seen.add(width);
|
|
134
|
+
result.push({ width, height: heightFor(width), descriptor: `${width}w` });
|
|
135
|
+
}
|
|
136
|
+
return result;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return [];
|
|
140
|
+
}
|
|
@@ -106,7 +106,7 @@ export declare abstract class FrameworkBuilder {
|
|
|
106
106
|
* Subclasses override to point at the correct npm package (`next`, `astro`,
|
|
107
107
|
* `vite`). The default returns undefined — when that happens the producer
|
|
108
108
|
* omits `framework_version` from webflow.json (the field is optional under
|
|
109
|
-
* the deploy contract).
|
|
109
|
+
* the deploy contract).
|
|
110
110
|
*/
|
|
111
111
|
getFrameworkVersion(): string | undefined;
|
|
112
112
|
/** Check if a dependency exists in package.json (deps or devDeps). */
|
package/dist/frameworks/base.js
CHANGED
|
@@ -120,7 +120,7 @@ class FrameworkBuilder {
|
|
|
120
120
|
* Subclasses override to point at the correct npm package (`next`, `astro`,
|
|
121
121
|
* `vite`). The default returns undefined — when that happens the producer
|
|
122
122
|
* omits `framework_version` from webflow.json (the field is optional under
|
|
123
|
-
* the deploy contract).
|
|
123
|
+
* the deploy contract).
|
|
124
124
|
*/
|
|
125
125
|
getFrameworkVersion() {
|
|
126
126
|
return undefined;
|
|
@@ -48,6 +48,29 @@ export declare const RUNTIME_BUILD_INDICATORS: string[];
|
|
|
48
48
|
* static assets — so it must not be inferred as static.
|
|
49
49
|
*/
|
|
50
50
|
export declare const SERVER_ENTRYPOINT_FILES: string[];
|
|
51
|
+
/**
|
|
52
|
+
* Evaluate repo-relative file paths for build/runtime/server indicators,
|
|
53
|
+
* returning matching paths in input order.
|
|
54
|
+
*
|
|
55
|
+
* This helper is filesystem-free so hosts that only have a remote file listing
|
|
56
|
+
* (for example a GitHub recursive tree result) can reuse exactly the same
|
|
57
|
+
* indicator semantics as the local filesystem scanner.
|
|
58
|
+
*
|
|
59
|
+
* Input contract:
|
|
60
|
+
* - `paths` must represent regular file paths only (blob/file entries).
|
|
61
|
+
* - Callers must pre-filter non-file items (directories, submodules, symlinks).
|
|
62
|
+
* For a GitHub recursive tree this means keeping only `type === 'blob'` with
|
|
63
|
+
* `mode !== '120000'` (symlink); submodules arrive as `type === 'commit'`.
|
|
64
|
+
* The local filesystem scanner skips symlinks, so a caller that keeps them
|
|
65
|
+
* would diverge from it.
|
|
66
|
+
* - Exclusion applies to ancestor directory segments only; the final basename
|
|
67
|
+
* is always considered as an indicator candidate.
|
|
68
|
+
* - Leading/duplicate slashes and `.` segments are normalized for matching
|
|
69
|
+
* only. Matches are returned with the caller's original spelling
|
|
70
|
+
* (`./api/server.py` in, `./api/server.py` out), so callers that key off the
|
|
71
|
+
* returned paths must not assume they are canonicalized.
|
|
72
|
+
*/
|
|
73
|
+
export declare function findRuntimeBuildIndicatorsInPaths(paths: string[]): string[];
|
|
51
74
|
/**
|
|
52
75
|
* Scan the **published tree** (not just the root) for build/runtime/server
|
|
53
76
|
* indicators, returning their repo-relative paths.
|
|
@@ -1 +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,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H,wBAAgB,0BAA0B,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CA+BhE;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;IAI3B,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAUpC,eAAe,IAAI,MAAM,GAAG,IAAI;WAShB,uBAAuB,IAAI,WAAW;CAYvD"}
|
|
@@ -35,6 +35,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.StaticBuilder = exports.SERVER_ENTRYPOINT_FILES = exports.RUNTIME_BUILD_INDICATORS = exports.STATIC_ASSET_EXCLUDES = exports.ASSET_ROOT_METADATA = void 0;
|
|
37
37
|
exports.shouldExcludeStaticAsset = shouldExcludeStaticAsset;
|
|
38
|
+
exports.findRuntimeBuildIndicatorsInPaths = findRuntimeBuildIndicatorsInPaths;
|
|
38
39
|
exports.findRuntimeBuildIndicators = findRuntimeBuildIndicators;
|
|
39
40
|
/**
|
|
40
41
|
* Static Framework Builder
|
|
@@ -196,6 +197,52 @@ exports.SERVER_ENTRYPOINT_FILES = [
|
|
|
196
197
|
'index.php',
|
|
197
198
|
];
|
|
198
199
|
const RUNTIME_INDICATOR_NAMES = new Set([...exports.RUNTIME_BUILD_INDICATORS, ...exports.SERVER_ENTRYPOINT_FILES]);
|
|
200
|
+
/**
|
|
201
|
+
* Evaluate repo-relative file paths for build/runtime/server indicators,
|
|
202
|
+
* returning matching paths in input order.
|
|
203
|
+
*
|
|
204
|
+
* This helper is filesystem-free so hosts that only have a remote file listing
|
|
205
|
+
* (for example a GitHub recursive tree result) can reuse exactly the same
|
|
206
|
+
* indicator semantics as the local filesystem scanner.
|
|
207
|
+
*
|
|
208
|
+
* Input contract:
|
|
209
|
+
* - `paths` must represent regular file paths only (blob/file entries).
|
|
210
|
+
* - Callers must pre-filter non-file items (directories, submodules, symlinks).
|
|
211
|
+
* For a GitHub recursive tree this means keeping only `type === 'blob'` with
|
|
212
|
+
* `mode !== '120000'` (symlink); submodules arrive as `type === 'commit'`.
|
|
213
|
+
* The local filesystem scanner skips symlinks, so a caller that keeps them
|
|
214
|
+
* would diverge from it.
|
|
215
|
+
* - Exclusion applies to ancestor directory segments only; the final basename
|
|
216
|
+
* is always considered as an indicator candidate.
|
|
217
|
+
* - Leading/duplicate slashes and `.` segments are normalized for matching
|
|
218
|
+
* only. Matches are returned with the caller's original spelling
|
|
219
|
+
* (`./api/server.py` in, `./api/server.py` out), so callers that key off the
|
|
220
|
+
* returned paths must not assume they are canonicalized.
|
|
221
|
+
*/
|
|
222
|
+
function findRuntimeBuildIndicatorsInPaths(paths) {
|
|
223
|
+
const found = [];
|
|
224
|
+
for (const relPath of paths) {
|
|
225
|
+
// Drop empty segments (`/a`, `a//b`) and `.` (`./a`) so those spellings
|
|
226
|
+
// behave exactly like the clean path. `.` would otherwise count as a
|
|
227
|
+
// dot-directory ancestor and hide real indicators such as `./api/server.py`.
|
|
228
|
+
const segments = relPath.split('/').filter((segment) => segment && segment !== '.');
|
|
229
|
+
if (segments.length === 0) {
|
|
230
|
+
continue;
|
|
231
|
+
}
|
|
232
|
+
const directorySegments = segments.slice(0, -1);
|
|
233
|
+
if (directorySegments.some((segment) => shouldExcludeStaticAsset(segment))) {
|
|
234
|
+
continue;
|
|
235
|
+
}
|
|
236
|
+
const basename = segments[segments.length - 1];
|
|
237
|
+
// A package.json anywhere below the root is a nested Node runtime (at least
|
|
238
|
+
// one directory segment); the root one is handled upstream, not here.
|
|
239
|
+
const isNestedPackageManifest = basename === 'package.json' && segments.length > 1;
|
|
240
|
+
if (isNestedPackageManifest || RUNTIME_INDICATOR_NAMES.has(basename)) {
|
|
241
|
+
found.push(relPath);
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
return found;
|
|
245
|
+
}
|
|
199
246
|
/**
|
|
200
247
|
* Scan the **published tree** (not just the root) for build/runtime/server
|
|
201
248
|
* indicators, returning their repo-relative paths.
|
|
@@ -216,7 +263,7 @@ const RUNTIME_INDICATOR_NAMES = new Set([...exports.RUNTIME_BUILD_INDICATORS, ..
|
|
|
216
263
|
* be no root `package.json`).
|
|
217
264
|
*/
|
|
218
265
|
function findRuntimeBuildIndicators(cwd) {
|
|
219
|
-
const
|
|
266
|
+
const filePaths = [];
|
|
220
267
|
const walk = (dir, rel) => {
|
|
221
268
|
let entries;
|
|
222
269
|
try {
|
|
@@ -240,16 +287,11 @@ function findRuntimeBuildIndicators(cwd) {
|
|
|
240
287
|
if (!entry.isFile()) {
|
|
241
288
|
continue;
|
|
242
289
|
}
|
|
243
|
-
|
|
244
|
-
// root one (`relPath === 'package.json'`) is handled upstream, not here.
|
|
245
|
-
const isNestedPackageManifest = entry.name === 'package.json' && relPath !== 'package.json';
|
|
246
|
-
if (isNestedPackageManifest || RUNTIME_INDICATOR_NAMES.has(entry.name)) {
|
|
247
|
-
found.push(relPath);
|
|
248
|
-
}
|
|
290
|
+
filePaths.push(relPath);
|
|
249
291
|
}
|
|
250
292
|
};
|
|
251
293
|
walk(cwd, '');
|
|
252
|
-
return
|
|
294
|
+
return findRuntimeBuildIndicatorsInPaths(filePaths);
|
|
253
295
|
}
|
|
254
296
|
class StaticBuilder extends base_1.FrameworkBuilder {
|
|
255
297
|
static frameworkName = 'static';
|
|
@@ -289,7 +331,7 @@ class StaticBuilder extends base_1.FrameworkBuilder {
|
|
|
289
331
|
// Inferred static apps never reach here with runtime files (inference
|
|
290
332
|
// requires none). An explicit `framework: "static"` bypasses that check, so
|
|
291
333
|
// warn if the repo ships build/runtime files: they'll be published verbatim
|
|
292
|
-
// as static assets.
|
|
334
|
+
// as static assets.
|
|
293
335
|
const runtimeIndicators = findRuntimeBuildIndicators(this.cwd);
|
|
294
336
|
if (runtimeIndicators.length > 0) {
|
|
295
337
|
this.log.warn(`static app declared, but build/runtime files are present ` +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/frameworks/static/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+FA,4DAWC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/frameworks/static/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+FA,4DAWC;AAgGD,8EA2BC;AAqBD,gEA+BC;AAzRD;;;;;;;;;;;;GAYG;AACH,4CAA8B;AAC9B,gDAAkC;AAElC,kCAA2C;AAC3C,uCAAoD;AAapD,sCAAsC;AACtC,MAAM,aAAa,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAC;AAExD;;;;;GAKG;AACU,QAAA,mBAAmB,GAAG,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;AAE9D;;;;GAIG;AACU,QAAA,qBAAqB,GAAG;IACnC,eAAe;IACf,cAAc;IACd,cAAc;IACd,mBAAmB;IACnB,WAAW;IACX,gBAAgB;IAChB,4DAA4D;IAC5D,cAAc;IACd,eAAe;IACf,eAAe;IACf,gBAAgB;IAChB,eAAe;IACf,yBAAyB;IACzB,WAAW;IACX,sDAAsD;IACtD,mBAAmB;IACnB,qBAAqB;IACrB,UAAU;IACV,+EAA+E;IAC/E,WAAW;IACX,e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C;IACd,CAAC;IAED,8EAA8E;IAC9E,gBAAgB;IAChB,8EAA8E;IAE9E,uBAAuB;QACrB,OAAO,IAAI,CAAC,IAAI,CAAC,aAAa,EAAE,eAAe,CAAC,CAAC;IACnD,CAAC;IAED,KAAK,CAAC,aAAa;QACjB,2EAA2E;QAC3E,2EAA2E;QAC3E,0CAA0C;IAC5C,CAAC;IAED,8EAA8E;IAC9E,QAAQ;IACR,8EAA8E;IAE9E,eAAe;QACb,4EAA4E;QAC5E,OAAO,IAAI,CAAC;IACd,CAAC;IAED,8EAA8E;IAC9E,SAAS;IACT,8EAA8E;IAE9E,MAAM,CAAU,uBAAuB;QACrC,OAAO;YACL,0EAA0E;YAC1E,0EAA0E;YAC1E,qEAAqE;YACrE,gBAAgB,EAAE,GAAG;YACrB,kEAAkE;YAClE,cAAc,EAAE,QAAQ;YACxB,iBAAiB,EAAE,KAAK;YACxB,YAAY,EAAE,KAAK;SACpB,CAAC;IACJ,CAAC;;AApHH,sCAqHC"}
|
|
@@ -76,13 +76,13 @@ export interface BuildOutput {
|
|
|
76
76
|
*/
|
|
77
77
|
skipNoBundle?: boolean;
|
|
78
78
|
/**
|
|
79
|
-
* Set by the Astro 6/7 builders
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
* instead of the blind append used for Astro 5 / Next.js.
|
|
79
|
+
* Set by the Astro 6/7 builders: `staticAssetsPath` already mirrors the served URL layout,
|
|
80
|
+
* including the mount. The generated astro.config sets `base = mountPath`, so a fixed
|
|
81
|
+
* `@astrojs/cloudflare` (>= 13.3.1 / all 14.x; withastro/astro#16276) nests the client tree
|
|
82
|
+
* under `<staticAssetsPath>/<mount>/`. `copyAssets` then copies `staticAssetsPath` verbatim
|
|
83
|
+
* into the assets root instead of the blind mount append used for Astro 5 / Next.js.
|
|
84
84
|
*/
|
|
85
|
-
|
|
85
|
+
staticAssetsMirrorUrlLayout?: boolean;
|
|
86
86
|
/**
|
|
87
87
|
* The entry file path after wrangler dry-run bundles the worker. Frameworks
|
|
88
88
|
* produce different output filenames (Astro 5: './index.js', Astro 6:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/frameworks/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAEtE,OAAO,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACjF,OAAO,KAAK,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAC7E,OAAO,KAAK,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAE7E,YAAY,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AAGtE,MAAM,MAAM,WAAW,GAAG,eAAe,CAAC;AAC1C,MAAM,MAAM,WAAW,GAAG,eAAe,CAAC;AAM1C,mDAAmD;AACnD,MAAM,WAAW,YAAY;IAC3B,qFAAqF;IACrF,GAAG,EAAE,MAAM,CAAC;IACZ,mBAAmB;IACnB,GAAG,EAAE,MAAM,CAAC;IACZ,4DAA4D;IAC5D,UAAU,EAAE,aAAa,CAAC;IAC1B,0DAA0D;IAC1D,SAAS,EAAE,SAAS,CAAC;IACrB,sDAAsD;IACtD,EAAE,EAAE,cAAc,CAAC;IACnB,2BAA2B;IAC3B,WAAW,EAAE,WAAW,CAAC;IACzB;;8CAE0C;IAC1C,OAAO,EAAE,MAAM,CAAC,UAAU,CAAC;IAC3B,yEAAyE;IACzE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,4EAA4E;IAC5E,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAMD,gCAAgC;AAChC,MAAM,WAAW,aAAa;IAC5B,gDAAgD;IAChD,IAAI,EAAE,MAAM,CAAC;IACb;2CACuC;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,gEAAgE;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qCAAqC;AACrC,MAAM,WAAW,kBAAkB;IACjC,6CAA6C;IAC7C,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,OAAO,EAAE,MAAM,CAAC;IAChB,oDAAoD;IACpD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,4EAA4E;IAC5E,GAAG,CAAC,EAAE,OAAO,CAAC;CACf;AAED,oCAAoC;AACpC,MAAM,WAAW,mBAAmB;IAClC,wCAAwC;IACxC,YAAY,EAAE,MAAM,CAAC;IACrB,wDAAwD;IACxD,eAAe,EAAE,MAAM,CAAC;IACxB,2EAA2E;IAC3E,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAMD,uCAAuC;AACvC,MAAM,WAAW,eAAe;IAC9B,mDAAmD;IACnD,QAAQ,EAAE,OAAO,CAAC;IAClB,0CAA0C;IAC1C,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAMD,mCAAmC;AACnC,MAAM,WAAW,sBAAsB;IACrC,kDAAkD;IAClD,OAAO,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sFAAsF;IACtF,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;CAC5B"}
|
package/dist/index.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export { NodeToolchainError } from './toolchain/errors';
|
|
|
20
20
|
export type { NodeToolchainFailureCode, NodeToolchainFailurePhase } from './toolchain/errors';
|
|
21
21
|
export type { NodeRuntimePort, NodeToolchainPolicy, NodeToolchainResolution, NodeVersionDeclarationSource, PreparedNodeRuntime, ResolvedNodeToolchain, } from './toolchain/types';
|
|
22
22
|
export { FrameworkBuilder, FRAMEWORK_BUILDERS, detectFrameworkBuilder, detectFrameworkFromBuiltOutput, detectAndCreateBuilder, resolveIsStaticApp, detectStaticApp, validateFrameworkName, getCustomerMajorVersion, ALLOWED_FRAMEWORKS, Astro5Builder, Astro6Builder, Astro7Builder, NextJsBuilder, ViteBuilder, StaticBuilder, FrameworkError, FrameworkValidationError, FrameworkBuildError, FrameworkConfigError, FrameworkDetectionError, } from './frameworks/registry';
|
|
23
|
-
export { shouldExcludeStaticAsset, findRuntimeBuildIndicators, ASSET_ROOT_METADATA, STATIC_ASSET_EXCLUDES, RUNTIME_BUILD_INDICATORS, SERVER_ENTRYPOINT_FILES, } from './frameworks/static';
|
|
23
|
+
export { shouldExcludeStaticAsset, findRuntimeBuildIndicators, findRuntimeBuildIndicatorsInPaths, ASSET_ROOT_METADATA, STATIC_ASSET_EXCLUDES, RUNTIME_BUILD_INDICATORS, SERVER_ENTRYPOINT_FILES, } from './frameworks/static';
|
|
24
24
|
export type { BuilderClass, DetectionMatch, AllowedFramework } from './frameworks/registry';
|
|
25
25
|
export type { BuildContext, FrameworkInfo, BuildOutput, AdapterPackage, IntegrationPackage, WebflowLoaderConfig, DetectionResult, NodeVersionRequirement, PackageJson, } from './frameworks/types';
|
|
26
26
|
export { loadPackageJson } from './config/package-json';
|
|
@@ -28,6 +28,8 @@ export { loadWebflowJson } from './config/webflow-json';
|
|
|
28
28
|
export type { WebflowJson } from './config/webflow-json';
|
|
29
29
|
export { handleWranglerJson, loadWranglerJson } from './wrangler';
|
|
30
30
|
export type { WranglerJson } from './wrangler';
|
|
31
|
+
export { COMPAT_DATE_FLOOR, COMPAT_DATE_RECORD_FILE, applyCompatDateAtBuild, resolveCompatDate, } from './compat-date';
|
|
32
|
+
export type { CompatDateInputs, CompatDateRecord, CompatDateResolution, CompatDateSource, } from './compat-date';
|
|
31
33
|
export { createWebflowJson, deriveCloudFields } from './create-webflow-json';
|
|
32
34
|
export { BindingsSchema, parseBindings, hasAnyBindings, validateBindings, validateR2BucketName, bindingsToWranglerJson, MAX_BINDINGS_PER_TYPE, } from './bindings';
|
|
33
35
|
export type { WebflowBindings } from './bindings';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"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