webstudio 0.167.0 → 0.168.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/README.md +1 -1
- package/bin.js +1 -1
- package/lib/cli.js +18 -9
- package/package.json +23 -15
- package/templates/defaults/app/route-templates/html.tsx +4 -13
- package/templates/defaults/package.json +8 -8
package/README.md
CHANGED
package/bin.js
CHANGED
package/lib/cli.js
CHANGED
|
@@ -367,6 +367,7 @@ var convertStyleString = (style) => {
|
|
|
367
367
|
}
|
|
368
368
|
return JSON.stringify(res);
|
|
369
369
|
};
|
|
370
|
+
var escape = (value) => JSON.stringify(value);
|
|
370
371
|
var toAttrString = (name, value) => {
|
|
371
372
|
const attName = name.toLowerCase();
|
|
372
373
|
const jsxName = attName === "class" ? "className" : attName;
|
|
@@ -376,7 +377,7 @@ var toAttrString = (name, value) => {
|
|
|
376
377
|
if (attName === "style") {
|
|
377
378
|
return `${jsxName}={${convertStyleString(value)}}`;
|
|
378
379
|
}
|
|
379
|
-
return `${jsxName}=
|
|
380
|
+
return `${jsxName}={${escape(value)}}`;
|
|
380
381
|
};
|
|
381
382
|
var attributesToString = (attributes) => attributes.map(([attName, value]) => ` ${toAttrString(attName, value)}`).join("");
|
|
382
383
|
var convertTagName = (tagName) => {
|
|
@@ -389,15 +390,14 @@ var convertTagName = (tagName) => {
|
|
|
389
390
|
}
|
|
390
391
|
return tag;
|
|
391
392
|
};
|
|
392
|
-
var escapeValue = (value) => value.replace(/\\/g, "\\\\").replace(/`/g, "\\`").replace(/\$/g, "\\$").replace(/\r/g, "\\r").replace(/\n/g, "\\n");
|
|
393
393
|
var htmlToJsx = (html) => {
|
|
394
394
|
const parsedHtml = parseFragment(html, { scriptingEnabled: false });
|
|
395
395
|
let result = "";
|
|
396
396
|
for (const walkNode of walkChildNodes(parsedHtml)) {
|
|
397
397
|
switch (walkNode.type) {
|
|
398
398
|
case "text": {
|
|
399
|
-
const escapedValue =
|
|
400
|
-
result += escapedValue ? "{
|
|
399
|
+
const escapedValue = escape(walkNode.value);
|
|
400
|
+
result += escapedValue ? "{" + escapedValue + "}" : "";
|
|
401
401
|
break;
|
|
402
402
|
}
|
|
403
403
|
case "element-start": {
|
|
@@ -520,6 +520,7 @@ Please check webstudio --help for more details`
|
|
|
520
520
|
const routesDir = join4(appRoot, "routes");
|
|
521
521
|
await rm(routesDir, { recursive: true, force: true });
|
|
522
522
|
await copyTemplates();
|
|
523
|
+
await writeFile4(join4(cwd3(), ".npmrc"), "force=true");
|
|
523
524
|
for (const template of options.template) {
|
|
524
525
|
if (template === "vanilla") {
|
|
525
526
|
continue;
|
|
@@ -1092,7 +1093,7 @@ import makeCLI from "yargs";
|
|
|
1092
1093
|
// package.json
|
|
1093
1094
|
var package_default = {
|
|
1094
1095
|
name: "webstudio",
|
|
1095
|
-
version: "0.
|
|
1096
|
+
version: "0.168.0",
|
|
1096
1097
|
description: "Webstudio CLI",
|
|
1097
1098
|
author: "Webstudio <github@webstudio.is>",
|
|
1098
1099
|
homepage: "https://webstudio.is",
|
|
@@ -1101,6 +1102,12 @@ var package_default = {
|
|
|
1101
1102
|
"webstudio-cli": "./bin.js",
|
|
1102
1103
|
webstudio: "./bin.js"
|
|
1103
1104
|
},
|
|
1105
|
+
imports: {
|
|
1106
|
+
"#cli": {
|
|
1107
|
+
webstudio: "./src/cli.ts",
|
|
1108
|
+
default: "./lib/cli.js"
|
|
1109
|
+
}
|
|
1110
|
+
},
|
|
1104
1111
|
files: [
|
|
1105
1112
|
"lib/*",
|
|
1106
1113
|
"templates/*",
|
|
@@ -1111,11 +1118,13 @@ var package_default = {
|
|
|
1111
1118
|
typecheck: "tsc",
|
|
1112
1119
|
checks: "pnpm typecheck",
|
|
1113
1120
|
build: "rm -rf lib && esbuild src/cli.ts --outdir=lib --bundle --format=esm --packages=external",
|
|
1114
|
-
"local-run": "tsx --no-warnings ./src/bin.ts",
|
|
1115
1121
|
dev: "esbuild src/cli.ts --watch --bundle --format=esm --packages=external --outdir=./lib",
|
|
1116
1122
|
test: "NODE_OPTIONS=--experimental-vm-modules jest"
|
|
1117
1123
|
},
|
|
1118
1124
|
license: "AGPL-3.0-or-later",
|
|
1125
|
+
engines: {
|
|
1126
|
+
node: ">=20.12"
|
|
1127
|
+
},
|
|
1119
1128
|
dependencies: {
|
|
1120
1129
|
"@clack/prompts": "^0.7.0",
|
|
1121
1130
|
"@webstudio-is/http-client": "workspace:*",
|
|
@@ -1125,12 +1134,12 @@ var package_default = {
|
|
|
1125
1134
|
"@webstudio-is/sdk-components-react": "workspace:*",
|
|
1126
1135
|
"@webstudio-is/sdk-components-react-radix": "workspace:*",
|
|
1127
1136
|
"@webstudio-is/sdk-components-react-remix": "workspace:*",
|
|
1128
|
-
"change-case": "^5.
|
|
1137
|
+
"change-case": "^5.4.4",
|
|
1129
1138
|
deepmerge: "^4.3.1",
|
|
1130
1139
|
"env-paths": "^3.0.0",
|
|
1131
1140
|
execa: "^7.2.0",
|
|
1132
|
-
parse5: "7.1.2",
|
|
1133
1141
|
"p-limit": "^4.0.0",
|
|
1142
|
+
parse5: "7.1.2",
|
|
1134
1143
|
picocolors: "^1.0.1",
|
|
1135
1144
|
"strip-indent": "^4.0.0",
|
|
1136
1145
|
"title-case": "^4.1.0",
|
|
@@ -1157,7 +1166,7 @@ var package_default = {
|
|
|
1157
1166
|
react: "18.3.0-canary-14898b6a9-20240318",
|
|
1158
1167
|
"react-dom": "18.3.0-canary-14898b6a9-20240318",
|
|
1159
1168
|
typescript: "5.4.5",
|
|
1160
|
-
vite: "^5.2.
|
|
1169
|
+
vite: "^5.2.13",
|
|
1161
1170
|
wrangler: "^3.48.0"
|
|
1162
1171
|
}
|
|
1163
1172
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "webstudio",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.168.0",
|
|
4
4
|
"description": "Webstudio CLI",
|
|
5
5
|
"author": "Webstudio <github@webstudio.is>",
|
|
6
6
|
"homepage": "https://webstudio.is",
|
|
@@ -9,6 +9,12 @@
|
|
|
9
9
|
"webstudio-cli": "./bin.js",
|
|
10
10
|
"webstudio": "./bin.js"
|
|
11
11
|
},
|
|
12
|
+
"imports": {
|
|
13
|
+
"#cli": {
|
|
14
|
+
"webstudio": "./src/cli.ts",
|
|
15
|
+
"default": "./lib/cli.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
12
18
|
"files": [
|
|
13
19
|
"lib/*",
|
|
14
20
|
"templates/*",
|
|
@@ -16,26 +22,29 @@
|
|
|
16
22
|
"!*.{test,stories}.*"
|
|
17
23
|
],
|
|
18
24
|
"license": "AGPL-3.0-or-later",
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=20.12"
|
|
27
|
+
},
|
|
19
28
|
"dependencies": {
|
|
20
29
|
"@clack/prompts": "^0.7.0",
|
|
21
|
-
"change-case": "^5.
|
|
30
|
+
"change-case": "^5.4.4",
|
|
22
31
|
"deepmerge": "^4.3.1",
|
|
23
32
|
"env-paths": "^3.0.0",
|
|
24
33
|
"execa": "^7.2.0",
|
|
25
|
-
"parse5": "7.1.2",
|
|
26
34
|
"p-limit": "^4.0.0",
|
|
35
|
+
"parse5": "7.1.2",
|
|
27
36
|
"picocolors": "^1.0.1",
|
|
28
37
|
"strip-indent": "^4.0.0",
|
|
29
38
|
"title-case": "^4.1.0",
|
|
30
39
|
"yargs": "^17.7.2",
|
|
31
40
|
"zod": "^3.22.4",
|
|
32
|
-
"@webstudio-is/
|
|
33
|
-
"@webstudio-is/
|
|
34
|
-
"@webstudio-is/
|
|
35
|
-
"@webstudio-is/
|
|
36
|
-
"@webstudio-is/sdk-components-react
|
|
37
|
-
"@webstudio-is/sdk-components-react": "0.
|
|
38
|
-
"@webstudio-is/sdk-components-react-remix": "0.
|
|
41
|
+
"@webstudio-is/image": "0.168.0",
|
|
42
|
+
"@webstudio-is/react-sdk": "0.168.0",
|
|
43
|
+
"@webstudio-is/sdk": "0.168.0",
|
|
44
|
+
"@webstudio-is/http-client": "0.168.0",
|
|
45
|
+
"@webstudio-is/sdk-components-react": "0.168.0",
|
|
46
|
+
"@webstudio-is/sdk-components-react-radix": "0.168.0",
|
|
47
|
+
"@webstudio-is/sdk-components-react-remix": "0.168.0"
|
|
39
48
|
},
|
|
40
49
|
"devDependencies": {
|
|
41
50
|
"@jest/globals": "^29.7.0",
|
|
@@ -54,17 +63,16 @@
|
|
|
54
63
|
"react": "18.3.0-canary-14898b6a9-20240318",
|
|
55
64
|
"react-dom": "18.3.0-canary-14898b6a9-20240318",
|
|
56
65
|
"typescript": "5.4.5",
|
|
57
|
-
"vite": "^5.2.
|
|
66
|
+
"vite": "^5.2.13",
|
|
58
67
|
"wrangler": "^3.48.0",
|
|
59
|
-
"@webstudio-is/
|
|
60
|
-
"@webstudio-is/
|
|
61
|
-
"@webstudio-is/
|
|
68
|
+
"@webstudio-is/jest-config": "1.0.7",
|
|
69
|
+
"@webstudio-is/form-handlers": "0.168.0",
|
|
70
|
+
"@webstudio-is/tsconfig": "1.0.7"
|
|
62
71
|
},
|
|
63
72
|
"scripts": {
|
|
64
73
|
"typecheck": "tsc",
|
|
65
74
|
"checks": "pnpm typecheck",
|
|
66
75
|
"build": "rm -rf lib && esbuild src/cli.ts --outdir=lib --bundle --format=esm --packages=external",
|
|
67
|
-
"local-run": "tsx --no-warnings ./src/bin.ts",
|
|
68
76
|
"dev": "esbuild src/cli.ts --watch --bundle --format=esm --packages=external --outdir=./lib",
|
|
69
77
|
"test": "NODE_OPTIONS=--experimental-vm-modules jest"
|
|
70
78
|
}
|
|
@@ -186,24 +186,15 @@ export const links: LinksFunction = () => {
|
|
|
186
186
|
rel: "icon",
|
|
187
187
|
href: imageLoader({
|
|
188
188
|
src: favIconAsset.name,
|
|
189
|
-
width
|
|
189
|
+
// width,height must be multiple of 48 https://developers.google.com/search/docs/appearance/favicon-in-search
|
|
190
|
+
width: 144,
|
|
191
|
+
height: 144,
|
|
192
|
+
fit: "pad",
|
|
190
193
|
quality: 100,
|
|
191
194
|
format: "auto",
|
|
192
195
|
}),
|
|
193
196
|
type: undefined,
|
|
194
197
|
});
|
|
195
|
-
} else {
|
|
196
|
-
result.push({
|
|
197
|
-
rel: "icon",
|
|
198
|
-
href: "/favicon.ico",
|
|
199
|
-
type: "image/x-icon",
|
|
200
|
-
});
|
|
201
|
-
|
|
202
|
-
result.push({
|
|
203
|
-
rel: "shortcut icon",
|
|
204
|
-
href: "/favicon.ico",
|
|
205
|
-
type: "image/x-icon",
|
|
206
|
-
});
|
|
207
198
|
}
|
|
208
199
|
|
|
209
200
|
for (const asset of pageFontAssets) {
|
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
"@remix-run/node": "2.9.2",
|
|
12
12
|
"@remix-run/react": "2.9.2",
|
|
13
13
|
"@remix-run/server-runtime": "2.9.2",
|
|
14
|
-
"@webstudio-is/react-sdk": "0.
|
|
15
|
-
"@webstudio-is/sdk-components-react-radix": "0.
|
|
16
|
-
"@webstudio-is/sdk-components-react-remix": "0.
|
|
17
|
-
"@webstudio-is/sdk-components-react": "0.
|
|
18
|
-
"@webstudio-is/form-handlers": "0.
|
|
19
|
-
"@webstudio-is/image": "0.
|
|
20
|
-
"@webstudio-is/sdk": "0.
|
|
14
|
+
"@webstudio-is/react-sdk": "0.168.0",
|
|
15
|
+
"@webstudio-is/sdk-components-react-radix": "0.168.0",
|
|
16
|
+
"@webstudio-is/sdk-components-react-remix": "0.168.0",
|
|
17
|
+
"@webstudio-is/sdk-components-react": "0.168.0",
|
|
18
|
+
"@webstudio-is/form-handlers": "0.168.0",
|
|
19
|
+
"@webstudio-is/image": "0.168.0",
|
|
20
|
+
"@webstudio-is/sdk": "0.168.0",
|
|
21
21
|
"isbot": "^5.1.8",
|
|
22
22
|
"react": "18.3.0-canary-14898b6a9-20240318",
|
|
23
23
|
"react-dom": "18.3.0-canary-14898b6a9-20240318"
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"@types/react": "^18.2.70",
|
|
28
28
|
"@types/react-dom": "^18.2.25",
|
|
29
29
|
"typescript": "5.4.5",
|
|
30
|
-
"vite": "^5.2.
|
|
30
|
+
"vite": "^5.2.13"
|
|
31
31
|
},
|
|
32
32
|
"engines": {
|
|
33
33
|
"node": ">=20.0.0"
|