webstudio 0.227.0 → 0.229.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/lib/cli.js +53 -12
- package/package.json +12 -12
- package/templates/defaults/app/route-templates/html.tsx +3 -2
- package/templates/defaults/package.json +7 -7
- package/templates/react-router/app/route-templates/html.tsx +3 -2
- package/templates/react-router/package.json +7 -7
- package/templates/react-router-docker/app/constants.mjs +4 -0
- package/templates/ssg/package.json +6 -6
package/lib/cli.js
CHANGED
|
@@ -1702,7 +1702,8 @@ var baseAsset = {
|
|
|
1702
1702
|
projectId: z.string(),
|
|
1703
1703
|
size: z.number(),
|
|
1704
1704
|
name: z.string(),
|
|
1705
|
-
|
|
1705
|
+
filename: z.string().optional(),
|
|
1706
|
+
description: z.union([z.string().optional(), z.null()]),
|
|
1706
1707
|
createdAt: z.string()
|
|
1707
1708
|
};
|
|
1708
1709
|
var FontAsset = z.object({
|
|
@@ -1930,11 +1931,6 @@ var Method = z.union([
|
|
|
1930
1931
|
z.literal("put"),
|
|
1931
1932
|
z.literal("delete")
|
|
1932
1933
|
]);
|
|
1933
|
-
var Header = z.object({
|
|
1934
|
-
name: z.string(),
|
|
1935
|
-
// expression
|
|
1936
|
-
value: z.string()
|
|
1937
|
-
});
|
|
1938
1934
|
var Resource = z.object({
|
|
1939
1935
|
id: ResourceId,
|
|
1940
1936
|
name: z.string(),
|
|
@@ -1942,16 +1938,41 @@ var Resource = z.object({
|
|
|
1942
1938
|
method: Method,
|
|
1943
1939
|
// expression
|
|
1944
1940
|
url: z.string(),
|
|
1945
|
-
|
|
1941
|
+
searchParams: z.array(
|
|
1942
|
+
z.object({
|
|
1943
|
+
name: z.string(),
|
|
1944
|
+
// expression
|
|
1945
|
+
value: z.string()
|
|
1946
|
+
})
|
|
1947
|
+
).optional(),
|
|
1948
|
+
headers: z.array(
|
|
1949
|
+
z.object({
|
|
1950
|
+
name: z.string(),
|
|
1951
|
+
// expression
|
|
1952
|
+
value: z.string()
|
|
1953
|
+
})
|
|
1954
|
+
),
|
|
1946
1955
|
// expression
|
|
1947
1956
|
body: z.optional(z.string())
|
|
1948
1957
|
});
|
|
1949
1958
|
z.object({
|
|
1950
|
-
id: ResourceId,
|
|
1951
1959
|
name: z.string(),
|
|
1952
1960
|
method: Method,
|
|
1953
1961
|
url: z.string(),
|
|
1954
|
-
|
|
1962
|
+
searchParams: z.array(
|
|
1963
|
+
z.object({
|
|
1964
|
+
name: z.string(),
|
|
1965
|
+
// can be string or object which should be serialized
|
|
1966
|
+
value: z.unknown()
|
|
1967
|
+
})
|
|
1968
|
+
),
|
|
1969
|
+
headers: z.array(
|
|
1970
|
+
z.object({
|
|
1971
|
+
name: z.string(),
|
|
1972
|
+
// can be string or object which should be serialized
|
|
1973
|
+
value: z.unknown()
|
|
1974
|
+
})
|
|
1975
|
+
),
|
|
1955
1976
|
body: z.optional(z.unknown())
|
|
1956
1977
|
});
|
|
1957
1978
|
z.map(ResourceId, Resource);
|
|
@@ -3670,8 +3691,6 @@ var generateResources = ({
|
|
|
3670
3691
|
let generatedRequest = "";
|
|
3671
3692
|
const resourceName = scope.getName(resource.id, resource.name);
|
|
3672
3693
|
generatedRequest += ` const ${resourceName}: ResourceRequest = {
|
|
3673
|
-
`;
|
|
3674
|
-
generatedRequest += ` id: "${resource.id}",
|
|
3675
3694
|
`;
|
|
3676
3695
|
generatedRequest += ` name: ${JSON.stringify(resource.name)},
|
|
3677
3696
|
`;
|
|
@@ -3682,6 +3701,20 @@ var generateResources = ({
|
|
|
3682
3701
|
scope
|
|
3683
3702
|
});
|
|
3684
3703
|
generatedRequest += ` url: ${url},
|
|
3704
|
+
`;
|
|
3705
|
+
generatedRequest += ` searchParams: [
|
|
3706
|
+
`;
|
|
3707
|
+
for (const searchParam of resource.searchParams ?? []) {
|
|
3708
|
+
const value = generateExpression({
|
|
3709
|
+
expression: searchParam.value,
|
|
3710
|
+
dataSources,
|
|
3711
|
+
usedDataSources,
|
|
3712
|
+
scope
|
|
3713
|
+
});
|
|
3714
|
+
generatedRequest += ` { name: "${searchParam.name}", value: ${value} },
|
|
3715
|
+
`;
|
|
3716
|
+
}
|
|
3717
|
+
generatedRequest += ` ],
|
|
3685
3718
|
`;
|
|
3686
3719
|
generatedRequest += ` method: "${resource.method}",
|
|
3687
3720
|
`;
|
|
@@ -4259,6 +4292,14 @@ var normalizeProps = ({
|
|
|
4259
4292
|
});
|
|
4260
4293
|
continue;
|
|
4261
4294
|
}
|
|
4295
|
+
if (prop.name === "alt" && asset.type === "image") {
|
|
4296
|
+
newProps.push({
|
|
4297
|
+
...propBase,
|
|
4298
|
+
type: "string",
|
|
4299
|
+
value: asset.description ?? ""
|
|
4300
|
+
});
|
|
4301
|
+
continue;
|
|
4302
|
+
}
|
|
4262
4303
|
newProps.push({
|
|
4263
4304
|
...propBase,
|
|
4264
4305
|
type: "string",
|
|
@@ -9046,7 +9087,7 @@ const getDeploymentInstructions = (deployTarget) => {
|
|
|
9046
9087
|
}
|
|
9047
9088
|
};
|
|
9048
9089
|
const name = "webstudio";
|
|
9049
|
-
const version = "0.
|
|
9090
|
+
const version = "0.229.0";
|
|
9050
9091
|
const description = "Webstudio CLI";
|
|
9051
9092
|
const author = "Webstudio <github@webstudio.is>";
|
|
9052
9093
|
const homepage = "https://webstudio.is";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webstudio",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.229.0",
|
|
4
4
|
"description": "Webstudio CLI",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -70,17 +70,17 @@
|
|
|
70
70
|
"vite": "^6.3.4",
|
|
71
71
|
"vitest": "^3.1.2",
|
|
72
72
|
"wrangler": "^3.63.2",
|
|
73
|
-
"@webstudio-is/css-engine": "0.
|
|
74
|
-
"@webstudio-is/http-client": "0.
|
|
75
|
-
"@webstudio-is/image": "0.
|
|
76
|
-
"@webstudio-is/react-sdk": "0.
|
|
77
|
-
"@webstudio-is/sdk
|
|
78
|
-
"@webstudio-is/sdk-components-react": "0.
|
|
79
|
-
"@webstudio-is/sdk": "0.
|
|
80
|
-
"@webstudio-is/sdk-components-react-
|
|
81
|
-
"@webstudio-is/sdk-components-react
|
|
82
|
-
"@webstudio-is/
|
|
83
|
-
"@webstudio-is/
|
|
73
|
+
"@webstudio-is/css-engine": "0.229.0",
|
|
74
|
+
"@webstudio-is/http-client": "0.229.0",
|
|
75
|
+
"@webstudio-is/image": "0.229.0",
|
|
76
|
+
"@webstudio-is/react-sdk": "0.229.0",
|
|
77
|
+
"@webstudio-is/sdk": "0.229.0",
|
|
78
|
+
"@webstudio-is/sdk-components-react-radix": "0.229.0",
|
|
79
|
+
"@webstudio-is/sdk-components-animation": "0.229.0",
|
|
80
|
+
"@webstudio-is/sdk-components-react-remix": "0.229.0",
|
|
81
|
+
"@webstudio-is/sdk-components-react": "0.229.0",
|
|
82
|
+
"@webstudio-is/tsconfig": "1.0.7",
|
|
83
|
+
"@webstudio-is/sdk-components-react-router": "0.229.0"
|
|
84
84
|
},
|
|
85
85
|
"scripts": {
|
|
86
86
|
"typecheck": "tsc",
|
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
isLocalResource,
|
|
14
14
|
loadResource,
|
|
15
15
|
loadResources,
|
|
16
|
+
cachedFetch,
|
|
16
17
|
formIdFieldName,
|
|
17
18
|
formBotFieldName,
|
|
18
19
|
} from "@webstudio-is/sdk/runtime";
|
|
@@ -43,7 +44,7 @@ import { sitemap } from "__SITEMAP__";
|
|
|
43
44
|
|
|
44
45
|
const customFetch: typeof fetch = (input, init) => {
|
|
45
46
|
if (typeof input !== "string") {
|
|
46
|
-
return
|
|
47
|
+
return cachedFetch(projectId, input, init);
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
if (isLocalResource(input, "sitemap.xml")) {
|
|
@@ -53,7 +54,7 @@ const customFetch: typeof fetch = (input, init) => {
|
|
|
53
54
|
return Promise.resolve(response);
|
|
54
55
|
}
|
|
55
56
|
|
|
56
|
-
return
|
|
57
|
+
return cachedFetch(projectId, input, init);
|
|
57
58
|
};
|
|
58
59
|
|
|
59
60
|
export const loader = async (arg: LoaderFunctionArgs) => {
|
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
"@remix-run/node": "2.16.5",
|
|
12
12
|
"@remix-run/react": "2.16.5",
|
|
13
13
|
"@remix-run/server-runtime": "2.16.5",
|
|
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.
|
|
20
|
-
"@webstudio-is/sdk-components-react-remix": "0.
|
|
14
|
+
"@webstudio-is/image": "0.229.0",
|
|
15
|
+
"@webstudio-is/react-sdk": "0.229.0",
|
|
16
|
+
"@webstudio-is/sdk": "0.229.0",
|
|
17
|
+
"@webstudio-is/sdk-components-react": "0.229.0",
|
|
18
|
+
"@webstudio-is/sdk-components-animation": "0.229.0",
|
|
19
|
+
"@webstudio-is/sdk-components-react-radix": "0.229.0",
|
|
20
|
+
"@webstudio-is/sdk-components-react-remix": "0.229.0",
|
|
21
21
|
"isbot": "^5.1.25",
|
|
22
22
|
"react": "18.3.0-canary-14898b6a9-20240318",
|
|
23
23
|
"react-dom": "18.3.0-canary-14898b6a9-20240318"
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
loadResources,
|
|
16
16
|
formIdFieldName,
|
|
17
17
|
formBotFieldName,
|
|
18
|
+
cachedFetch,
|
|
18
19
|
} from "@webstudio-is/sdk/runtime";
|
|
19
20
|
import {
|
|
20
21
|
ReactSdkContext,
|
|
@@ -42,7 +43,7 @@ import { sitemap } from "__SITEMAP__";
|
|
|
42
43
|
|
|
43
44
|
const customFetch: typeof fetch = (input, init) => {
|
|
44
45
|
if (typeof input !== "string") {
|
|
45
|
-
return
|
|
46
|
+
return cachedFetch(projectId, input, init);
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
if (isLocalResource(input, "sitemap.xml")) {
|
|
@@ -52,7 +53,7 @@ const customFetch: typeof fetch = (input, init) => {
|
|
|
52
53
|
return Promise.resolve(response);
|
|
53
54
|
}
|
|
54
55
|
|
|
55
|
-
return
|
|
56
|
+
return cachedFetch(projectId, input, init);
|
|
56
57
|
};
|
|
57
58
|
|
|
58
59
|
export const loader = async (arg: LoaderFunctionArgs) => {
|
|
@@ -10,13 +10,13 @@
|
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"@react-router/dev": "^7.5.3",
|
|
12
12
|
"@react-router/fs-routes": "^7.5.3",
|
|
13
|
-
"@webstudio-is/image": "0.
|
|
14
|
-
"@webstudio-is/react-sdk": "0.
|
|
15
|
-
"@webstudio-is/sdk": "0.
|
|
16
|
-
"@webstudio-is/sdk-components-animation": "0.
|
|
17
|
-
"@webstudio-is/sdk-components-react-radix": "0.
|
|
18
|
-
"@webstudio-is/sdk-components-react-router": "0.
|
|
19
|
-
"@webstudio-is/sdk-components-react": "0.
|
|
13
|
+
"@webstudio-is/image": "0.229.0",
|
|
14
|
+
"@webstudio-is/react-sdk": "0.229.0",
|
|
15
|
+
"@webstudio-is/sdk": "0.229.0",
|
|
16
|
+
"@webstudio-is/sdk-components-animation": "0.229.0",
|
|
17
|
+
"@webstudio-is/sdk-components-react-radix": "0.229.0",
|
|
18
|
+
"@webstudio-is/sdk-components-react-router": "0.229.0",
|
|
19
|
+
"@webstudio-is/sdk-components-react": "0.229.0",
|
|
20
20
|
"isbot": "^5.1.25",
|
|
21
21
|
"react": "18.3.0-canary-14898b6a9-20240318",
|
|
22
22
|
"react-dom": "18.3.0-canary-14898b6a9-20240318",
|
|
@@ -24,6 +24,10 @@ export const imageLoader = (props) => {
|
|
|
24
24
|
if (props.format === "raw") {
|
|
25
25
|
return props.src;
|
|
26
26
|
}
|
|
27
|
+
// IPX (sharp) does not support ico
|
|
28
|
+
if (props.src.endsWith('.ico')) {
|
|
29
|
+
return props.src;
|
|
30
|
+
}
|
|
27
31
|
// handle absolute urls
|
|
28
32
|
const path = UrlCanParse(props.src) ? `/${props.src}` : props.src;
|
|
29
33
|
// https://github.com/unjs/ipx?tab=readme-ov-file#modifiers
|
|
@@ -8,12 +8,12 @@
|
|
|
8
8
|
"typecheck": "tsc"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@webstudio-is/image": "0.
|
|
12
|
-
"@webstudio-is/react-sdk": "0.
|
|
13
|
-
"@webstudio-is/sdk": "0.
|
|
14
|
-
"@webstudio-is/sdk-components-react": "0.
|
|
15
|
-
"@webstudio-is/sdk-components-animation": "0.
|
|
16
|
-
"@webstudio-is/sdk-components-react-radix": "0.
|
|
11
|
+
"@webstudio-is/image": "0.229.0",
|
|
12
|
+
"@webstudio-is/react-sdk": "0.229.0",
|
|
13
|
+
"@webstudio-is/sdk": "0.229.0",
|
|
14
|
+
"@webstudio-is/sdk-components-react": "0.229.0",
|
|
15
|
+
"@webstudio-is/sdk-components-animation": "0.229.0",
|
|
16
|
+
"@webstudio-is/sdk-components-react-radix": "0.229.0",
|
|
17
17
|
"react": "18.3.0-canary-14898b6a9-20240318",
|
|
18
18
|
"react-dom": "18.3.0-canary-14898b6a9-20240318",
|
|
19
19
|
"vike": "^0.4.229"
|