webstudio 0.0.0-4f7bf18 → 0.0.0-588fe22
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
CHANGED
|
@@ -28,7 +28,6 @@ import { kebabCase, camelCase } from "change-case";
|
|
|
28
28
|
import "nanoid";
|
|
29
29
|
import { parseExpressionAt } from "acorn";
|
|
30
30
|
import { simple } from "acorn-walk";
|
|
31
|
-
import warnOnce from "warn-once";
|
|
32
31
|
import reservedIdentifiers from "reserved-identifiers";
|
|
33
32
|
import hash from "@emotion/hash";
|
|
34
33
|
import { x } from "tinyexec";
|
|
@@ -77,7 +76,16 @@ const PROJECT_TEMPLATES = [
|
|
|
77
76
|
label: "Vanilla",
|
|
78
77
|
expand: ["defaults"]
|
|
79
78
|
},
|
|
80
|
-
{
|
|
79
|
+
{
|
|
80
|
+
value: "docker",
|
|
81
|
+
label: "Docker",
|
|
82
|
+
expand: ["react-router-docker"]
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
value: "vercel",
|
|
86
|
+
label: "Vercel",
|
|
87
|
+
expand: ["defaults", "vercel"]
|
|
88
|
+
},
|
|
81
89
|
{
|
|
82
90
|
value: "netlify-functions",
|
|
83
91
|
label: "Netlify Functions",
|
|
@@ -88,7 +96,10 @@ const PROJECT_TEMPLATES = [
|
|
|
88
96
|
label: "Netlify Edge Functions",
|
|
89
97
|
expand: ["defaults", "netlify-edge-functions"]
|
|
90
98
|
},
|
|
91
|
-
{
|
|
99
|
+
{
|
|
100
|
+
value: "ssg",
|
|
101
|
+
label: "Static Site Generation (SSG)"
|
|
102
|
+
},
|
|
92
103
|
{
|
|
93
104
|
value: "ssg-netlify",
|
|
94
105
|
label: "Static Site Generation (SSG) Netlify",
|
|
@@ -105,11 +116,6 @@ const INTERNAL_TEMPLATES = [
|
|
|
105
116
|
value: "cloudflare",
|
|
106
117
|
label: "Cloudflare",
|
|
107
118
|
expand: ["defaults", "cloudflare"]
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
value: "react-router-docker",
|
|
111
|
-
label: "Dokcer",
|
|
112
|
-
expand: ["react-router-docker"]
|
|
113
119
|
}
|
|
114
120
|
];
|
|
115
121
|
const isFileExists = async (filePath) => {
|
|
@@ -2490,6 +2496,7 @@ const generateExpression = ({
|
|
|
2490
2496
|
usedDataSources == null ? void 0 : usedDataSources.set(dep.id, dep);
|
|
2491
2497
|
return scope.getName(dep.id, dep.name);
|
|
2492
2498
|
}
|
|
2499
|
+
return "undefined";
|
|
2493
2500
|
}
|
|
2494
2501
|
});
|
|
2495
2502
|
};
|
|
@@ -3637,47 +3644,6 @@ const generateWebstudioComponent = ({
|
|
|
3637
3644
|
`;
|
|
3638
3645
|
return generatedComponent;
|
|
3639
3646
|
};
|
|
3640
|
-
const imageSizes = [16, 32, 48, 64, 96, 128, 256, 384];
|
|
3641
|
-
const deviceSizes = [640, 750, 828, 1080, 1200, 1920, 2048, 3840];
|
|
3642
|
-
const allSizes = [...imageSizes, ...deviceSizes];
|
|
3643
|
-
const NON_EXISTING_DOMAIN = "https://a3cbcbec-cdb1-4ea4-ad60-43c795308ddc.ddc";
|
|
3644
|
-
const joinPath = (...segments) => {
|
|
3645
|
-
return segments.filter((segment) => segment !== "").map((segment) => segment.replace(/(^\/+|\/+$)/g, "")).join("/");
|
|
3646
|
-
};
|
|
3647
|
-
const encodePathFragment = (fragment) => {
|
|
3648
|
-
return encodeURIComponent(fragment).replace(/%2F/g, "/");
|
|
3649
|
-
};
|
|
3650
|
-
const wsImageLoader = (props2) => {
|
|
3651
|
-
const width = props2.format === "raw" ? 16 : props2.width;
|
|
3652
|
-
const quality = props2.format === "raw" ? 100 : props2.quality;
|
|
3653
|
-
if (process.env.NODE_ENV !== "production") {
|
|
3654
|
-
warnOnce(
|
|
3655
|
-
allSizes.includes(width) === false,
|
|
3656
|
-
"Width must be only from allowed values"
|
|
3657
|
-
);
|
|
3658
|
-
}
|
|
3659
|
-
let src = props2.src;
|
|
3660
|
-
if (src.startsWith("/cgi/asset")) {
|
|
3661
|
-
src = src.slice("/cgi/asset".length);
|
|
3662
|
-
}
|
|
3663
|
-
const resultUrl = new URL("/cgi/image/", NON_EXISTING_DOMAIN);
|
|
3664
|
-
if (props2.format !== "raw") {
|
|
3665
|
-
resultUrl.searchParams.set("width", width.toString());
|
|
3666
|
-
resultUrl.searchParams.set("quality", quality.toString());
|
|
3667
|
-
if (props2.height != null) {
|
|
3668
|
-
resultUrl.searchParams.set("height", props2.height.toString());
|
|
3669
|
-
}
|
|
3670
|
-
if (props2.fit != null) {
|
|
3671
|
-
resultUrl.searchParams.set("fit", props2.fit);
|
|
3672
|
-
}
|
|
3673
|
-
}
|
|
3674
|
-
resultUrl.searchParams.set("format", props2.format ?? "auto");
|
|
3675
|
-
resultUrl.pathname = joinPath(resultUrl.pathname, encodePathFragment(src));
|
|
3676
|
-
if (resultUrl.href.startsWith(NON_EXISTING_DOMAIN)) {
|
|
3677
|
-
return `${resultUrl.pathname}?${resultUrl.searchParams.toString()}`;
|
|
3678
|
-
}
|
|
3679
|
-
return resultUrl.href;
|
|
3680
|
-
};
|
|
3681
3647
|
const BOOLEAN_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
3682
3648
|
"async",
|
|
3683
3649
|
"autofocus",
|
|
@@ -5871,6 +5837,11 @@ const copyTemplates = async (template) => {
|
|
|
5871
5837
|
const importFrom = (importee, importer) => {
|
|
5872
5838
|
return relative(dirname(importer), importee).replaceAll("\\", "/");
|
|
5873
5839
|
};
|
|
5840
|
+
const npmrc = `force=true
|
|
5841
|
+
loglevel=error
|
|
5842
|
+
audit=false
|
|
5843
|
+
fund=false
|
|
5844
|
+
`;
|
|
5874
5845
|
const prebuild = async (options) => {
|
|
5875
5846
|
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
|
|
5876
5847
|
if (options.template.length === 0) {
|
|
@@ -5898,7 +5869,7 @@ Please check webstudio --help for more details`
|
|
|
5898
5869
|
await rm(generatedDir, { recursive: true, force: true });
|
|
5899
5870
|
const routesDir = join(appRoot, "routes");
|
|
5900
5871
|
await rm(routesDir, { recursive: true, force: true });
|
|
5901
|
-
await writeFile(join(cwd(), ".npmrc"),
|
|
5872
|
+
await writeFile(join(cwd(), ".npmrc"), npmrc);
|
|
5902
5873
|
for (const template of options.template) {
|
|
5903
5874
|
await copyTemplates(template);
|
|
5904
5875
|
}
|
|
@@ -6021,14 +5992,10 @@ Please check webstudio --help for more details`
|
|
|
6021
5992
|
const assetOrigin = siteData.origin;
|
|
6022
5993
|
for (const asset of siteData.assets) {
|
|
6023
5994
|
if (asset.type === "image") {
|
|
6024
|
-
const imagePath = wsImageLoader({
|
|
6025
|
-
src: asset.name,
|
|
6026
|
-
format: "raw"
|
|
6027
|
-
});
|
|
6028
5995
|
assetsToDownload.push(
|
|
6029
5996
|
limit(
|
|
6030
5997
|
() => downloadAsset(
|
|
6031
|
-
`${assetOrigin}
|
|
5998
|
+
`${assetOrigin}/cgi/image/${asset.name}?format=auto`,
|
|
6032
5999
|
asset.name,
|
|
6033
6000
|
assetBaseUrl
|
|
6034
6001
|
)
|
|
@@ -6459,7 +6426,7 @@ const getDeploymentInstructions = (deployTarget) => {
|
|
|
6459
6426
|
}
|
|
6460
6427
|
};
|
|
6461
6428
|
const name = "webstudio";
|
|
6462
|
-
const version = "0.0.0-
|
|
6429
|
+
const version = "0.0.0-588fe22";
|
|
6463
6430
|
const description = "Webstudio CLI";
|
|
6464
6431
|
const author = "Webstudio <github@webstudio.is>";
|
|
6465
6432
|
const homepage = "https://webstudio.is";
|
|
@@ -6501,10 +6468,8 @@ const dependencies = {
|
|
|
6501
6468
|
"p-limit": "^6.2.0",
|
|
6502
6469
|
parse5: "7.2.1",
|
|
6503
6470
|
picocolors: "^1.1.1",
|
|
6504
|
-
react: "18.3.0-canary-14898b6a9-20240318",
|
|
6505
6471
|
"reserved-identifiers": "^1.0.0",
|
|
6506
6472
|
tinyexec: "^0.3.2",
|
|
6507
|
-
"warn-once": "^0.1.1",
|
|
6508
6473
|
yargs: "^17.7.2",
|
|
6509
6474
|
zod: "^3.22.4"
|
|
6510
6475
|
};
|
|
@@ -6536,10 +6501,11 @@ const devDependencies = {
|
|
|
6536
6501
|
h3: "^1.14.0",
|
|
6537
6502
|
ipx: "^3.0.1",
|
|
6538
6503
|
prettier: "3.4.2",
|
|
6504
|
+
react: "18.3.0-canary-14898b6a9-20240318",
|
|
6539
6505
|
"react-dom": "18.3.0-canary-14898b6a9-20240318",
|
|
6540
6506
|
"react-router": "^7.1.3",
|
|
6541
6507
|
"ts-expect": "^1.3.0",
|
|
6542
|
-
vike: "^0.4.
|
|
6508
|
+
vike: "^0.4.219",
|
|
6543
6509
|
vite: "^5.4.11",
|
|
6544
6510
|
vitest: "^3.0.2",
|
|
6545
6511
|
wrangler: "^3.63.2"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webstudio",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-588fe22",
|
|
4
4
|
"description": "Webstudio CLI",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -37,10 +37,8 @@
|
|
|
37
37
|
"p-limit": "^6.2.0",
|
|
38
38
|
"parse5": "7.2.1",
|
|
39
39
|
"picocolors": "^1.1.1",
|
|
40
|
-
"react": "18.3.0-canary-14898b6a9-20240318",
|
|
41
40
|
"reserved-identifiers": "^1.0.0",
|
|
42
41
|
"tinyexec": "^0.3.2",
|
|
43
|
-
"warn-once": "^0.1.1",
|
|
44
42
|
"yargs": "^17.7.2",
|
|
45
43
|
"zod": "^3.22.4"
|
|
46
44
|
},
|
|
@@ -62,22 +60,23 @@
|
|
|
62
60
|
"h3": "^1.14.0",
|
|
63
61
|
"ipx": "^3.0.1",
|
|
64
62
|
"prettier": "3.4.2",
|
|
63
|
+
"react": "18.3.0-canary-14898b6a9-20240318",
|
|
65
64
|
"react-dom": "18.3.0-canary-14898b6a9-20240318",
|
|
66
65
|
"react-router": "^7.1.3",
|
|
67
66
|
"ts-expect": "^1.3.0",
|
|
68
|
-
"vike": "^0.4.
|
|
67
|
+
"vike": "^0.4.219",
|
|
69
68
|
"vite": "^5.4.11",
|
|
70
69
|
"vitest": "^3.0.2",
|
|
71
70
|
"wrangler": "^3.63.2",
|
|
72
|
-
"@webstudio-is/http-client": "0.0.0-
|
|
73
|
-
"@webstudio-is/
|
|
74
|
-
"@webstudio-is/
|
|
75
|
-
"@webstudio-is/
|
|
76
|
-
"@webstudio-is/sdk-components-animation": "0.0.0-
|
|
77
|
-
"@webstudio-is/sdk-components-react": "0.0.0-
|
|
78
|
-
"@webstudio-is/sdk-components-react-radix": "0.0.0-
|
|
79
|
-
"@webstudio-is/sdk-components-react-remix": "0.0.0-
|
|
80
|
-
"@webstudio-is/sdk-components-react-router": "0.0.0-
|
|
71
|
+
"@webstudio-is/http-client": "0.0.0-588fe22",
|
|
72
|
+
"@webstudio-is/react-sdk": "0.0.0-588fe22",
|
|
73
|
+
"@webstudio-is/sdk": "0.0.0-588fe22",
|
|
74
|
+
"@webstudio-is/image": "0.0.0-588fe22",
|
|
75
|
+
"@webstudio-is/sdk-components-animation": "0.0.0-588fe22",
|
|
76
|
+
"@webstudio-is/sdk-components-react": "0.0.0-588fe22",
|
|
77
|
+
"@webstudio-is/sdk-components-react-radix": "0.0.0-588fe22",
|
|
78
|
+
"@webstudio-is/sdk-components-react-remix": "0.0.0-588fe22",
|
|
79
|
+
"@webstudio-is/sdk-components-react-router": "0.0.0-588fe22",
|
|
81
80
|
"@webstudio-is/tsconfig": "1.0.7"
|
|
82
81
|
},
|
|
83
82
|
"scripts": {
|
|
@@ -11,14 +11,14 @@
|
|
|
11
11
|
"@remix-run/node": "2.15.2",
|
|
12
12
|
"@remix-run/react": "2.15.2",
|
|
13
13
|
"@remix-run/server-runtime": "2.15.2",
|
|
14
|
-
"@webstudio-is/image": "0.0.0-
|
|
15
|
-
"@webstudio-is/react-sdk": "0.0.0-
|
|
16
|
-
"@webstudio-is/sdk": "0.0.0-
|
|
17
|
-
"@webstudio-is/sdk-components-react": "0.0.0-
|
|
18
|
-
"@webstudio-is/sdk-components-animation": "0.0.0-
|
|
19
|
-
"@webstudio-is/sdk-components-react-radix": "0.0.0-
|
|
20
|
-
"@webstudio-is/sdk-components-react-remix": "0.0.0-
|
|
21
|
-
"isbot": "^5.1.
|
|
14
|
+
"@webstudio-is/image": "0.0.0-588fe22",
|
|
15
|
+
"@webstudio-is/react-sdk": "0.0.0-588fe22",
|
|
16
|
+
"@webstudio-is/sdk": "0.0.0-588fe22",
|
|
17
|
+
"@webstudio-is/sdk-components-react": "0.0.0-588fe22",
|
|
18
|
+
"@webstudio-is/sdk-components-animation": "0.0.0-588fe22",
|
|
19
|
+
"@webstudio-is/sdk-components-react-radix": "0.0.0-588fe22",
|
|
20
|
+
"@webstudio-is/sdk-components-react-remix": "0.0.0-588fe22",
|
|
21
|
+
"isbot": "^5.1.21",
|
|
22
22
|
"react": "18.3.0-canary-14898b6a9-20240318",
|
|
23
23
|
"react-dom": "18.3.0-canary-14898b6a9-20240318"
|
|
24
24
|
},
|
|
@@ -1,22 +1,17 @@
|
|
|
1
|
-
FROM node:22-alpine AS
|
|
2
|
-
COPY . /app
|
|
3
|
-
WORKDIR /app
|
|
4
|
-
RUN npm install
|
|
5
|
-
|
|
6
|
-
FROM node:22-alpine AS production-dependencies-env
|
|
7
|
-
COPY .npmrc ./package.json /app/
|
|
1
|
+
FROM node:22-alpine AS dependencies-env
|
|
2
|
+
COPY .npmrc package.json /app/
|
|
8
3
|
WORKDIR /app
|
|
9
4
|
RUN npm install --omit=dev
|
|
10
5
|
|
|
11
|
-
FROM
|
|
6
|
+
FROM dependencies-env AS build-env
|
|
12
7
|
COPY . /app/
|
|
13
|
-
COPY --from=development-dependencies-env /app/node_modules /app/node_modules
|
|
14
8
|
WORKDIR /app
|
|
9
|
+
RUN npm install
|
|
15
10
|
RUN npm run build
|
|
16
11
|
|
|
17
12
|
FROM node:22-alpine
|
|
18
|
-
COPY .npmrc
|
|
19
|
-
COPY --from=
|
|
13
|
+
COPY .npmrc package.json /app/
|
|
14
|
+
COPY --from=dependencies-env /app/node_modules /app/node_modules
|
|
20
15
|
COPY --from=build-env /app/build /app/build
|
|
21
16
|
COPY --from=build-env /app/public /app/public
|
|
22
17
|
WORKDIR /app
|
|
@@ -13,16 +13,16 @@
|
|
|
13
13
|
"@react-router/fs-routes": "^7.1.3",
|
|
14
14
|
"@react-router/node": "^7.1.3",
|
|
15
15
|
"@react-router/serve": "^7.1.3",
|
|
16
|
-
"@webstudio-is/image": "0.0.0-
|
|
17
|
-
"@webstudio-is/react-sdk": "0.0.0-
|
|
18
|
-
"@webstudio-is/sdk": "0.0.0-
|
|
19
|
-
"@webstudio-is/sdk-components-animation": "0.0.0-
|
|
20
|
-
"@webstudio-is/sdk-components-react-radix": "0.0.0-
|
|
21
|
-
"@webstudio-is/sdk-components-react-router": "0.0.0-
|
|
22
|
-
"@webstudio-is/sdk-components-react": "0.0.0-
|
|
16
|
+
"@webstudio-is/image": "0.0.0-588fe22",
|
|
17
|
+
"@webstudio-is/react-sdk": "0.0.0-588fe22",
|
|
18
|
+
"@webstudio-is/sdk": "0.0.0-588fe22",
|
|
19
|
+
"@webstudio-is/sdk-components-animation": "0.0.0-588fe22",
|
|
20
|
+
"@webstudio-is/sdk-components-react-radix": "0.0.0-588fe22",
|
|
21
|
+
"@webstudio-is/sdk-components-react-router": "0.0.0-588fe22",
|
|
22
|
+
"@webstudio-is/sdk-components-react": "0.0.0-588fe22",
|
|
23
23
|
"h3": "^1.14.0",
|
|
24
24
|
"ipx": "^3.0.1",
|
|
25
|
-
"isbot": "^5.1.
|
|
25
|
+
"isbot": "^5.1.21",
|
|
26
26
|
"react": "18.3.0-canary-14898b6a9-20240318",
|
|
27
27
|
"react-dom": "18.3.0-canary-14898b6a9-20240318",
|
|
28
28
|
"react-router": "^7.1.3",
|
|
@@ -8,15 +8,15 @@
|
|
|
8
8
|
"typecheck": "tsc"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@webstudio-is/image": "0.0.0-
|
|
12
|
-
"@webstudio-is/react-sdk": "0.0.0-
|
|
13
|
-
"@webstudio-is/sdk": "0.0.0-
|
|
14
|
-
"@webstudio-is/sdk-components-react": "0.0.0-
|
|
15
|
-
"@webstudio-is/sdk-components-animation": "0.0.0-
|
|
16
|
-
"@webstudio-is/sdk-components-react-radix": "0.0.0-
|
|
11
|
+
"@webstudio-is/image": "0.0.0-588fe22",
|
|
12
|
+
"@webstudio-is/react-sdk": "0.0.0-588fe22",
|
|
13
|
+
"@webstudio-is/sdk": "0.0.0-588fe22",
|
|
14
|
+
"@webstudio-is/sdk-components-react": "0.0.0-588fe22",
|
|
15
|
+
"@webstudio-is/sdk-components-animation": "0.0.0-588fe22",
|
|
16
|
+
"@webstudio-is/sdk-components-react-radix": "0.0.0-588fe22",
|
|
17
17
|
"react": "18.3.0-canary-14898b6a9-20240318",
|
|
18
18
|
"react-dom": "18.3.0-canary-14898b6a9-20240318",
|
|
19
|
-
"vike": "^0.4.
|
|
19
|
+
"vike": "^0.4.219"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@types/react": "^18.2.70",
|