webstudio 0.293.0 → 0.294.0
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/bin.js +21 -2
- package/lib/cli.js +89511 -59586
- package/lib/content-runtime.js +79 -79
- package/package.json +24 -21
- package/templates/cloudflare/package.json +1 -1
- package/templates/defaults/app/redirect-url.ts +39 -2
- package/templates/defaults/app/route-templates/html.tsx +9 -0
- package/templates/defaults/app/route-templates/text.tsx +9 -0
- package/templates/defaults/app/route-templates/xml.tsx +9 -0
- package/templates/defaults/package.json +8 -8
- package/templates/react-router/app/redirect-url.ts +39 -2
- package/templates/react-router/app/route-templates/html.tsx +9 -0
- package/templates/react-router/app/route-templates/text.tsx +9 -0
- package/templates/react-router/app/route-templates/xml.tsx +9 -0
- package/templates/react-router/package.json +8 -8
- package/templates/react-router-cloudflare/package.json +1 -1
- package/templates/ssg/app/route-templates/html/+data.ts +8 -0
- package/templates/ssg/package.json +6 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webstudio",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.294.0",
|
|
4
4
|
"description": "Webstudio CLI",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -48,16 +48,17 @@
|
|
|
48
48
|
"path-key": "^4.0.0",
|
|
49
49
|
"picocolors": "^1.1.1",
|
|
50
50
|
"reserved-identifiers": "^1.0.0",
|
|
51
|
+
"semver": "7.7.1",
|
|
51
52
|
"tinyexec": "^0.3.2",
|
|
52
53
|
"tus-js-client": "^4.3.1",
|
|
53
54
|
"warn-once": "^0.1.1",
|
|
54
55
|
"which": "^5.0.0",
|
|
55
56
|
"yargs": "^17.7.2",
|
|
56
57
|
"zod": "^4.4.3",
|
|
57
|
-
"@webstudio-is/
|
|
58
|
-
"@webstudio-is/
|
|
59
|
-
"@webstudio-is/project-migrations": "0.
|
|
60
|
-
"@webstudio-is/
|
|
58
|
+
"@webstudio-is/http-client": "0.294.0",
|
|
59
|
+
"@webstudio-is/protocol": "0.294.0",
|
|
60
|
+
"@webstudio-is/project-migrations": "0.294.0",
|
|
61
|
+
"@webstudio-is/sync-client": "0.0.0"
|
|
61
62
|
},
|
|
62
63
|
"devDependencies": {
|
|
63
64
|
"@cloudflare/vite-plugin": "^1.1.0",
|
|
@@ -77,6 +78,7 @@
|
|
|
77
78
|
"@types/mdast": "^4.0.4",
|
|
78
79
|
"@types/react": "^18.2.70",
|
|
79
80
|
"@types/react-dom": "^18.2.25",
|
|
81
|
+
"@types/semver": "^7.7.0",
|
|
80
82
|
"@types/which": "^3.0.4",
|
|
81
83
|
"@types/yargs": "^17.0.33",
|
|
82
84
|
"@vercel/react-router": "^1.1.0",
|
|
@@ -99,35 +101,36 @@
|
|
|
99
101
|
"vite": "^6.3.4",
|
|
100
102
|
"vitest": "^3.1.2",
|
|
101
103
|
"wrangler": "^3.63.2",
|
|
102
|
-
"@webstudio-is/css-engine": "0.
|
|
103
|
-
"@webstudio-is/content-engine": "0.
|
|
104
|
-
"@webstudio-is/
|
|
105
|
-
"@webstudio-is/
|
|
106
|
-
"@webstudio-is/image": "0.
|
|
107
|
-
"@webstudio-is/query-builder": "0.293.0",
|
|
104
|
+
"@webstudio-is/css-engine": "0.294.0",
|
|
105
|
+
"@webstudio-is/content-engine": "0.294.0",
|
|
106
|
+
"@webstudio-is/fonts": "0.294.0",
|
|
107
|
+
"@webstudio-is/expression": "0.294.0",
|
|
108
|
+
"@webstudio-is/image": "0.294.0",
|
|
108
109
|
"@webstudio-is/project-build": "0.0.0",
|
|
109
|
-
"@webstudio-is/sdk": "0.
|
|
110
|
-
"@webstudio-is/
|
|
111
|
-
"@webstudio-is/sdk
|
|
112
|
-
"@webstudio-is/sdk-components-react": "0.
|
|
113
|
-
"@webstudio-is/
|
|
114
|
-
"@webstudio-is/sdk-components-react-
|
|
115
|
-
"@webstudio-is/sdk-components-
|
|
116
|
-
"@webstudio-is/sdk-components-registry": "0.293.0",
|
|
110
|
+
"@webstudio-is/react-sdk": "0.294.0",
|
|
111
|
+
"@webstudio-is/query-builder": "0.294.0",
|
|
112
|
+
"@webstudio-is/sdk": "0.294.0",
|
|
113
|
+
"@webstudio-is/sdk-components-react": "0.294.0",
|
|
114
|
+
"@webstudio-is/sdk-components-animation": "0.294.0",
|
|
115
|
+
"@webstudio-is/sdk-components-react-radix": "0.294.0",
|
|
116
|
+
"@webstudio-is/sdk-components-registry": "0.294.0",
|
|
117
117
|
"@webstudio-is/tsconfig": "1.0.7",
|
|
118
|
+
"@webstudio-is/sdk-components-react-remix": "0.294.0",
|
|
118
119
|
"@webstudio-is/vision": "0.0.0",
|
|
119
|
-
"@webstudio-is/
|
|
120
|
+
"@webstudio-is/sdk-components-react-router": "0.294.0",
|
|
121
|
+
"@webstudio-is/wsauth": "0.294.0"
|
|
120
122
|
},
|
|
121
123
|
"scripts": {
|
|
122
124
|
"typecheck": "tsc --noEmit",
|
|
123
125
|
"generate-docs": "tsx scripts/generate-docs.ts && oxfmt src/docs.generated.ts",
|
|
124
|
-
"build:content-runtime": "esbuild @webstudio-is/content-engine/runtime --bundle --format=esm --platform=browser --target=es2022 --conditions=webstudio --minify --outfile=lib/content-runtime.js",
|
|
126
|
+
"build:content-runtime": "esbuild @webstudio-is/content-engine/runtime --bundle --format=esm --platform=browser --target=es2022 --conditions=webstudio,worker --minify --outfile=lib/content-runtime.js",
|
|
125
127
|
"fixtures:build": "pnpm build:content-runtime",
|
|
126
128
|
"build": "pnpm generate-docs && rm -rf lib && vite build && pnpm build:content-runtime",
|
|
127
129
|
"pretest": "mkdir -p lib && pnpm build:content-runtime",
|
|
128
130
|
"evaluations": "tsx --import ../../scripts/register-react-global.ts --conditions=webstudio evaluations/high-impact/run-local-agent.ts",
|
|
129
131
|
"test": "vitest run",
|
|
130
132
|
"test:ssg-package": "tsx --conditions=webstudio scripts/test-ssg-package.ts",
|
|
133
|
+
"check:published-cli-contract": "tsx --conditions=webstudio scripts/builder-contract-gate.ts",
|
|
131
134
|
"test:release-smoke": "pnpm build && tsx --conditions=webstudio scripts/release-smoke.ts",
|
|
132
135
|
"test:release-smoke:model": "WEBSTUDIO_RELEASE_SMOKE_MODEL_EVAL_REQUIRED=1 pnpm test:release-smoke",
|
|
133
136
|
"test:release-smoke:registry": "tsx --conditions=webstudio scripts/release-smoke.ts"
|
|
@@ -74,6 +74,35 @@ const getPathnameVariants = (pathname: string) => {
|
|
|
74
74
|
return Array.from(new Set([pathname, decodePathname(pathname)]));
|
|
75
75
|
};
|
|
76
76
|
|
|
77
|
+
const preserveRequestSearch = (
|
|
78
|
+
target: string,
|
|
79
|
+
search: string,
|
|
80
|
+
requestPathname: string
|
|
81
|
+
) => {
|
|
82
|
+
if (search === "") {
|
|
83
|
+
return target;
|
|
84
|
+
}
|
|
85
|
+
if (URL.canParse(target) || target.startsWith("//")) {
|
|
86
|
+
const url = new URL(target, "https://webstudio.invalid");
|
|
87
|
+
if (url.search !== "") {
|
|
88
|
+
return target;
|
|
89
|
+
}
|
|
90
|
+
url.search = search;
|
|
91
|
+
return target.startsWith("//")
|
|
92
|
+
? url.href.slice(url.protocol.length)
|
|
93
|
+
: url.href;
|
|
94
|
+
}
|
|
95
|
+
const path = parsePath(target);
|
|
96
|
+
if (path.search !== undefined && path.search !== "") {
|
|
97
|
+
return target;
|
|
98
|
+
}
|
|
99
|
+
return createPath({
|
|
100
|
+
...path,
|
|
101
|
+
pathname: path.pathname ?? requestPathname,
|
|
102
|
+
search,
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
|
|
77
106
|
const isOptionalSegmentMarker = (source: string, index: number) => {
|
|
78
107
|
const nextChar = source[index + 1];
|
|
79
108
|
if (nextChar !== undefined && nextChar !== "/") {
|
|
@@ -130,7 +159,11 @@ export const matchRedirect = (
|
|
|
130
159
|
if (isRedirectPattern(source) === false) {
|
|
131
160
|
if (requestPathnames.includes(source)) {
|
|
132
161
|
return {
|
|
133
|
-
url:
|
|
162
|
+
url: preserveRequestSearch(
|
|
163
|
+
generateRedirectUrl(redirect.new, {}),
|
|
164
|
+
url.search,
|
|
165
|
+
url.pathname
|
|
166
|
+
),
|
|
134
167
|
status: getRedirectStatus(redirect.status),
|
|
135
168
|
};
|
|
136
169
|
}
|
|
@@ -150,7 +183,11 @@ export const matchRedirect = (
|
|
|
150
183
|
}
|
|
151
184
|
|
|
152
185
|
return {
|
|
153
|
-
url:
|
|
186
|
+
url: preserveRequestSearch(
|
|
187
|
+
generateRedirectUrl(redirect.new, match.params),
|
|
188
|
+
url.search,
|
|
189
|
+
url.pathname
|
|
190
|
+
),
|
|
154
191
|
status: getRedirectStatus(redirect.status),
|
|
155
192
|
};
|
|
156
193
|
}
|
|
@@ -128,6 +128,15 @@ export const loader = async (arg: LoaderFunctionArgs) => {
|
|
|
128
128
|
url,
|
|
129
129
|
{ signal: arg.request.signal }
|
|
130
130
|
);
|
|
131
|
+
Object.assign(
|
|
132
|
+
resources,
|
|
133
|
+
await loadResources(
|
|
134
|
+
generatedFetch,
|
|
135
|
+
getResources({ system, resources }).contentData ?? new Map(),
|
|
136
|
+
url,
|
|
137
|
+
{ signal: arg.request.signal }
|
|
138
|
+
)
|
|
139
|
+
);
|
|
131
140
|
const pageMeta = getPageMeta({ system, resources });
|
|
132
141
|
|
|
133
142
|
if (pageMeta.redirect) {
|
|
@@ -87,6 +87,15 @@ export const loader = async (arg: LoaderFunctionArgs) => {
|
|
|
87
87
|
url,
|
|
88
88
|
{ signal: arg.request.signal }
|
|
89
89
|
);
|
|
90
|
+
Object.assign(
|
|
91
|
+
resources,
|
|
92
|
+
await loadResources(
|
|
93
|
+
generatedFetch,
|
|
94
|
+
getResources({ system, resources }).contentData ?? new Map(),
|
|
95
|
+
url,
|
|
96
|
+
{ signal: arg.request.signal }
|
|
97
|
+
)
|
|
98
|
+
);
|
|
90
99
|
const pageMeta = getPageMeta({ system, resources });
|
|
91
100
|
|
|
92
101
|
if (pageMeta.redirect) {
|
|
@@ -95,6 +95,15 @@ export const loader = async (arg: LoaderFunctionArgs) => {
|
|
|
95
95
|
url,
|
|
96
96
|
{ signal: arg.request.signal }
|
|
97
97
|
);
|
|
98
|
+
Object.assign(
|
|
99
|
+
resources,
|
|
100
|
+
await loadResources(
|
|
101
|
+
generatedFetch,
|
|
102
|
+
getResources({ system, resources }).contentData ?? new Map(),
|
|
103
|
+
url,
|
|
104
|
+
{ signal: arg.request.signal }
|
|
105
|
+
)
|
|
106
|
+
);
|
|
98
107
|
const pageMeta = getPageMeta({ system, resources });
|
|
99
108
|
|
|
100
109
|
if (pageMeta.redirect) {
|
|
@@ -13,14 +13,14 @@
|
|
|
13
13
|
"@remix-run/node": "2.16.5",
|
|
14
14
|
"@remix-run/react": "2.16.5",
|
|
15
15
|
"@remix-run/server-runtime": "2.16.5",
|
|
16
|
-
"@webstudio-is/image": "0.
|
|
17
|
-
"@webstudio-is/react-sdk": "0.
|
|
18
|
-
"@webstudio-is/sdk": "0.
|
|
19
|
-
"@webstudio-is/sdk-components-react": "0.
|
|
20
|
-
"@webstudio-is/sdk-components-animation": "0.
|
|
21
|
-
"@webstudio-is/sdk-components-react-radix": "0.
|
|
22
|
-
"@webstudio-is/sdk-components-react-remix": "0.
|
|
23
|
-
"@webstudio-is/wsauth": "0.
|
|
16
|
+
"@webstudio-is/image": "0.294.0",
|
|
17
|
+
"@webstudio-is/react-sdk": "0.294.0",
|
|
18
|
+
"@webstudio-is/sdk": "0.294.0",
|
|
19
|
+
"@webstudio-is/sdk-components-react": "0.294.0",
|
|
20
|
+
"@webstudio-is/sdk-components-animation": "0.294.0",
|
|
21
|
+
"@webstudio-is/sdk-components-react-radix": "0.294.0",
|
|
22
|
+
"@webstudio-is/sdk-components-react-remix": "0.294.0",
|
|
23
|
+
"@webstudio-is/wsauth": "0.294.0",
|
|
24
24
|
"isbot": "^5.1.25",
|
|
25
25
|
"react": "18.3.0-canary-14898b6a9-20240318",
|
|
26
26
|
"react-dom": "18.3.0-canary-14898b6a9-20240318",
|
|
@@ -74,6 +74,35 @@ const getPathnameVariants = (pathname: string) => {
|
|
|
74
74
|
return Array.from(new Set([pathname, decodePathname(pathname)]));
|
|
75
75
|
};
|
|
76
76
|
|
|
77
|
+
const preserveRequestSearch = (
|
|
78
|
+
target: string,
|
|
79
|
+
search: string,
|
|
80
|
+
requestPathname: string
|
|
81
|
+
) => {
|
|
82
|
+
if (search === "") {
|
|
83
|
+
return target;
|
|
84
|
+
}
|
|
85
|
+
if (URL.canParse(target) || target.startsWith("//")) {
|
|
86
|
+
const url = new URL(target, "https://webstudio.invalid");
|
|
87
|
+
if (url.search !== "") {
|
|
88
|
+
return target;
|
|
89
|
+
}
|
|
90
|
+
url.search = search;
|
|
91
|
+
return target.startsWith("//")
|
|
92
|
+
? url.href.slice(url.protocol.length)
|
|
93
|
+
: url.href;
|
|
94
|
+
}
|
|
95
|
+
const path = parsePath(target);
|
|
96
|
+
if (path.search !== undefined && path.search !== "") {
|
|
97
|
+
return target;
|
|
98
|
+
}
|
|
99
|
+
return createPath({
|
|
100
|
+
...path,
|
|
101
|
+
pathname: path.pathname ?? requestPathname,
|
|
102
|
+
search,
|
|
103
|
+
});
|
|
104
|
+
};
|
|
105
|
+
|
|
77
106
|
const isOptionalSegmentMarker = (source: string, index: number) => {
|
|
78
107
|
const nextChar = source[index + 1];
|
|
79
108
|
if (nextChar !== undefined && nextChar !== "/") {
|
|
@@ -130,7 +159,11 @@ export const matchRedirect = (
|
|
|
130
159
|
if (isRedirectPattern(source) === false) {
|
|
131
160
|
if (requestPathnames.includes(source)) {
|
|
132
161
|
return {
|
|
133
|
-
url:
|
|
162
|
+
url: preserveRequestSearch(
|
|
163
|
+
generateRedirectUrl(redirect.new, {}),
|
|
164
|
+
url.search,
|
|
165
|
+
url.pathname
|
|
166
|
+
),
|
|
134
167
|
status: getRedirectStatus(redirect.status),
|
|
135
168
|
};
|
|
136
169
|
}
|
|
@@ -150,7 +183,11 @@ export const matchRedirect = (
|
|
|
150
183
|
}
|
|
151
184
|
|
|
152
185
|
return {
|
|
153
|
-
url:
|
|
186
|
+
url: preserveRequestSearch(
|
|
187
|
+
generateRedirectUrl(redirect.new, match.params),
|
|
188
|
+
url.search,
|
|
189
|
+
url.pathname
|
|
190
|
+
),
|
|
154
191
|
status: getRedirectStatus(redirect.status),
|
|
155
192
|
};
|
|
156
193
|
}
|
|
@@ -127,6 +127,15 @@ export const loader = async (arg: LoaderFunctionArgs) => {
|
|
|
127
127
|
url,
|
|
128
128
|
{ signal: arg.request.signal }
|
|
129
129
|
);
|
|
130
|
+
Object.assign(
|
|
131
|
+
resources,
|
|
132
|
+
await loadResources(
|
|
133
|
+
generatedFetch,
|
|
134
|
+
getResources({ system, resources }).contentData ?? new Map(),
|
|
135
|
+
url,
|
|
136
|
+
{ signal: arg.request.signal }
|
|
137
|
+
)
|
|
138
|
+
);
|
|
130
139
|
const pageMeta = getPageMeta({ system, resources });
|
|
131
140
|
|
|
132
141
|
if (pageMeta.redirect) {
|
|
@@ -87,6 +87,15 @@ export const loader = async (arg: LoaderFunctionArgs) => {
|
|
|
87
87
|
url,
|
|
88
88
|
{ signal: arg.request.signal }
|
|
89
89
|
);
|
|
90
|
+
Object.assign(
|
|
91
|
+
resources,
|
|
92
|
+
await loadResources(
|
|
93
|
+
generatedFetch,
|
|
94
|
+
getResources({ system, resources }).contentData ?? new Map(),
|
|
95
|
+
url,
|
|
96
|
+
{ signal: arg.request.signal }
|
|
97
|
+
)
|
|
98
|
+
);
|
|
90
99
|
const pageMeta = getPageMeta({ system, resources });
|
|
91
100
|
|
|
92
101
|
if (pageMeta.redirect) {
|
|
@@ -95,6 +95,15 @@ export const loader = async (arg: LoaderFunctionArgs) => {
|
|
|
95
95
|
url,
|
|
96
96
|
{ signal: arg.request.signal }
|
|
97
97
|
);
|
|
98
|
+
Object.assign(
|
|
99
|
+
resources,
|
|
100
|
+
await loadResources(
|
|
101
|
+
generatedFetch,
|
|
102
|
+
getResources({ system, resources }).contentData ?? new Map(),
|
|
103
|
+
url,
|
|
104
|
+
{ signal: arg.request.signal }
|
|
105
|
+
)
|
|
106
|
+
);
|
|
98
107
|
const pageMeta = getPageMeta({ system, resources });
|
|
99
108
|
|
|
100
109
|
if (pageMeta.redirect) {
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
"@react-router/fs-routes": "^7.5.3",
|
|
16
16
|
"@react-router/node": "^7.5.3",
|
|
17
17
|
"@react-router/serve": "^7.5.3",
|
|
18
|
-
"@webstudio-is/image": "0.
|
|
19
|
-
"@webstudio-is/react-sdk": "0.
|
|
20
|
-
"@webstudio-is/sdk": "0.
|
|
21
|
-
"@webstudio-is/sdk-components-animation": "0.
|
|
22
|
-
"@webstudio-is/sdk-components-react-radix": "0.
|
|
23
|
-
"@webstudio-is/sdk-components-react-router": "0.
|
|
24
|
-
"@webstudio-is/sdk-components-react": "0.
|
|
25
|
-
"@webstudio-is/wsauth": "0.
|
|
18
|
+
"@webstudio-is/image": "0.294.0",
|
|
19
|
+
"@webstudio-is/react-sdk": "0.294.0",
|
|
20
|
+
"@webstudio-is/sdk": "0.294.0",
|
|
21
|
+
"@webstudio-is/sdk-components-animation": "0.294.0",
|
|
22
|
+
"@webstudio-is/sdk-components-react-radix": "0.294.0",
|
|
23
|
+
"@webstudio-is/sdk-components-react-router": "0.294.0",
|
|
24
|
+
"@webstudio-is/sdk-components-react": "0.294.0",
|
|
25
|
+
"@webstudio-is/wsauth": "0.294.0",
|
|
26
26
|
"isbot": "^5.1.25",
|
|
27
27
|
"react": "18.3.0-canary-14898b6a9-20240318",
|
|
28
28
|
"react-dom": "18.3.0-canary-14898b6a9-20240318",
|
|
@@ -67,6 +67,14 @@ export const data = async (pageContext: PageContextServer) => {
|
|
|
67
67
|
getResources({ system }).data,
|
|
68
68
|
url
|
|
69
69
|
);
|
|
70
|
+
Object.assign(
|
|
71
|
+
resources,
|
|
72
|
+
await loadResources(
|
|
73
|
+
customFetch,
|
|
74
|
+
getResources({ system, resources }).contentData ?? new Map(),
|
|
75
|
+
url
|
|
76
|
+
)
|
|
77
|
+
);
|
|
70
78
|
const pageMeta = getPageMeta({ system, resources });
|
|
71
79
|
|
|
72
80
|
return {
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@shikijs/langs": "4.4.1",
|
|
13
13
|
"@shikijs/themes": "4.4.1",
|
|
14
|
-
"@webstudio-is/image": "0.
|
|
15
|
-
"@webstudio-is/react-sdk": "0.
|
|
16
|
-
"@webstudio-is/sdk": "0.
|
|
17
|
-
"@webstudio-is/sdk-components-react": "0.
|
|
18
|
-
"@webstudio-is/sdk-components-animation": "0.
|
|
19
|
-
"@webstudio-is/sdk-components-react-radix": "0.
|
|
14
|
+
"@webstudio-is/image": "0.294.0",
|
|
15
|
+
"@webstudio-is/react-sdk": "0.294.0",
|
|
16
|
+
"@webstudio-is/sdk": "0.294.0",
|
|
17
|
+
"@webstudio-is/sdk-components-react": "0.294.0",
|
|
18
|
+
"@webstudio-is/sdk-components-animation": "0.294.0",
|
|
19
|
+
"@webstudio-is/sdk-components-react-radix": "0.294.0",
|
|
20
20
|
"react": "18.3.0-canary-14898b6a9-20240318",
|
|
21
21
|
"react-dom": "18.3.0-canary-14898b6a9-20240318",
|
|
22
22
|
"shiki": "4.4.1",
|