webstudio 0.290.0 → 0.292.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "webstudio",
3
- "version": "0.290.0",
3
+ "version": "0.292.0",
4
4
  "description": "Webstudio CLI",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -54,10 +54,10 @@
54
54
  "which": "^5.0.0",
55
55
  "yargs": "^17.7.2",
56
56
  "zod": "^4.4.3",
57
- "@webstudio-is/http-client": "0.290.0",
58
- "@webstudio-is/project-migrations": "0.290.0",
59
- "@webstudio-is/sync-client": "0.0.0",
60
- "@webstudio-is/protocol": "0.290.0"
57
+ "@webstudio-is/http-client": "0.292.0",
58
+ "@webstudio-is/project-migrations": "0.292.0",
59
+ "@webstudio-is/protocol": "0.292.0",
60
+ "@webstudio-is/sync-client": "0.0.0"
61
61
  },
62
62
  "devDependencies": {
63
63
  "@cloudflare/vite-plugin": "^1.1.0",
@@ -99,24 +99,24 @@
99
99
  "vite": "^6.3.4",
100
100
  "vitest": "^3.1.2",
101
101
  "wrangler": "^3.63.2",
102
- "@webstudio-is/content-engine": "0.290.0",
103
- "@webstudio-is/css-engine": "0.290.0",
104
- "@webstudio-is/expression": "0.290.0",
105
- "@webstudio-is/fonts": "0.290.0",
106
- "@webstudio-is/image": "0.290.0",
102
+ "@webstudio-is/css-engine": "0.292.0",
103
+ "@webstudio-is/expression": "0.292.0",
104
+ "@webstudio-is/content-engine": "0.292.0",
105
+ "@webstudio-is/fonts": "0.292.0",
106
+ "@webstudio-is/image": "0.292.0",
107
107
  "@webstudio-is/project-build": "0.0.0",
108
- "@webstudio-is/query-builder": "0.290.0",
109
- "@webstudio-is/sdk": "0.290.0",
110
- "@webstudio-is/react-sdk": "0.290.0",
111
- "@webstudio-is/sdk-components-animation": "0.290.0",
112
- "@webstudio-is/sdk-components-react": "0.290.0",
113
- "@webstudio-is/sdk-components-react-remix": "0.290.0",
114
- "@webstudio-is/sdk-components-react-radix": "0.290.0",
115
- "@webstudio-is/sdk-components-react-router": "0.290.0",
116
- "@webstudio-is/sdk-components-registry": "0.290.0",
117
- "@webstudio-is/vision": "0.0.0",
108
+ "@webstudio-is/query-builder": "0.292.0",
109
+ "@webstudio-is/react-sdk": "0.292.0",
110
+ "@webstudio-is/sdk": "0.292.0",
111
+ "@webstudio-is/sdk-components-animation": "0.292.0",
112
+ "@webstudio-is/sdk-components-react": "0.292.0",
113
+ "@webstudio-is/sdk-components-react-radix": "0.292.0",
114
+ "@webstudio-is/sdk-components-react-remix": "0.292.0",
115
+ "@webstudio-is/sdk-components-react-router": "0.292.0",
116
+ "@webstudio-is/sdk-components-registry": "0.292.0",
118
117
  "@webstudio-is/tsconfig": "1.0.7",
119
- "@webstudio-is/wsauth": "0.290.0"
118
+ "@webstudio-is/vision": "0.0.0",
119
+ "@webstudio-is/wsauth": "0.292.0"
120
120
  },
121
121
  "scripts": {
122
122
  "typecheck": "tsc --noEmit",
@@ -12,7 +12,7 @@
12
12
  "build-cf-types": "wrangler types"
13
13
  },
14
14
  "dependencies": {
15
- "@webstudio-is/wsauth": "0.290.0",
15
+ "@webstudio-is/wsauth": "0.292.0",
16
16
  "@remix-run/cloudflare": "2.16.5",
17
17
  "@remix-run/cloudflare-pages": "2.16.5"
18
18
  },
@@ -5,6 +5,7 @@ import {
5
5
  parsePath,
6
6
  } from "@remix-run/react";
7
7
  import { redirect } from "@remix-run/server-runtime";
8
+ import { removeTrailingSlash } from "@webstudio-is/sdk";
8
9
 
9
10
  type RedirectItem = {
10
11
  old: string;
@@ -160,8 +161,19 @@ export const redirectRequest = (
160
161
  redirects: RedirectItem[]
161
162
  ): Response | undefined => {
162
163
  const matchedRedirect = matchRedirect(request.url, redirects);
163
- if (matchedRedirect === undefined) {
164
+ if (matchedRedirect !== undefined) {
165
+ return redirect(matchedRedirect.url, matchedRedirect.status);
166
+ }
167
+
168
+ const url = new URL(request.url);
169
+ if (url.pathname.startsWith("//")) {
170
+ return;
171
+ }
172
+
173
+ const pathname = removeTrailingSlash(url.pathname);
174
+ if (pathname === url.pathname) {
164
175
  return;
165
176
  }
166
- return redirect(matchedRedirect.url, matchedRedirect.status);
177
+
178
+ return redirect(`${pathname}${url.search}`, 301);
167
179
  };
@@ -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.290.0",
17
- "@webstudio-is/react-sdk": "0.290.0",
18
- "@webstudio-is/sdk": "0.290.0",
19
- "@webstudio-is/sdk-components-react": "0.290.0",
20
- "@webstudio-is/sdk-components-animation": "0.290.0",
21
- "@webstudio-is/sdk-components-react-radix": "0.290.0",
22
- "@webstudio-is/sdk-components-react-remix": "0.290.0",
23
- "@webstudio-is/wsauth": "0.290.0",
16
+ "@webstudio-is/image": "0.292.0",
17
+ "@webstudio-is/react-sdk": "0.292.0",
18
+ "@webstudio-is/sdk": "0.292.0",
19
+ "@webstudio-is/sdk-components-react": "0.292.0",
20
+ "@webstudio-is/sdk-components-animation": "0.292.0",
21
+ "@webstudio-is/sdk-components-react-radix": "0.292.0",
22
+ "@webstudio-is/sdk-components-react-remix": "0.292.0",
23
+ "@webstudio-is/wsauth": "0.292.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",
@@ -5,6 +5,7 @@ import {
5
5
  parsePath,
6
6
  redirect,
7
7
  } from "react-router";
8
+ import { removeTrailingSlash } from "@webstudio-is/sdk";
8
9
 
9
10
  type RedirectItem = {
10
11
  old: string;
@@ -160,8 +161,19 @@ export const redirectRequest = (
160
161
  redirects: RedirectItem[]
161
162
  ): Response | undefined => {
162
163
  const matchedRedirect = matchRedirect(request.url, redirects);
163
- if (matchedRedirect === undefined) {
164
+ if (matchedRedirect !== undefined) {
165
+ return redirect(matchedRedirect.url, matchedRedirect.status);
166
+ }
167
+
168
+ const url = new URL(request.url);
169
+ if (url.pathname.startsWith("//")) {
170
+ return;
171
+ }
172
+
173
+ const pathname = removeTrailingSlash(url.pathname);
174
+ if (pathname === url.pathname) {
164
175
  return;
165
176
  }
166
- return redirect(matchedRedirect.url, matchedRedirect.status);
177
+
178
+ return redirect(`${pathname}${url.search}`, 301);
167
179
  };
@@ -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.290.0",
19
- "@webstudio-is/react-sdk": "0.290.0",
20
- "@webstudio-is/sdk": "0.290.0",
21
- "@webstudio-is/sdk-components-animation": "0.290.0",
22
- "@webstudio-is/sdk-components-react-radix": "0.290.0",
23
- "@webstudio-is/sdk-components-react-router": "0.290.0",
24
- "@webstudio-is/sdk-components-react": "0.290.0",
25
- "@webstudio-is/wsauth": "0.290.0",
18
+ "@webstudio-is/image": "0.292.0",
19
+ "@webstudio-is/react-sdk": "0.292.0",
20
+ "@webstudio-is/sdk": "0.292.0",
21
+ "@webstudio-is/sdk-components-animation": "0.292.0",
22
+ "@webstudio-is/sdk-components-react-radix": "0.292.0",
23
+ "@webstudio-is/sdk-components-react-router": "0.292.0",
24
+ "@webstudio-is/sdk-components-react": "0.292.0",
25
+ "@webstudio-is/wsauth": "0.292.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",
@@ -7,7 +7,7 @@
7
7
  },
8
8
  "dependencies": {
9
9
  "@cloudflare/vite-plugin": "^1.1.0",
10
- "@webstudio-is/wsauth": "0.290.0",
10
+ "@webstudio-is/wsauth": "0.292.0",
11
11
  "wrangler": "^4.14.1"
12
12
  }
13
13
  }
@@ -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.290.0",
15
- "@webstudio-is/react-sdk": "0.290.0",
16
- "@webstudio-is/sdk": "0.290.0",
17
- "@webstudio-is/sdk-components-react": "0.290.0",
18
- "@webstudio-is/sdk-components-animation": "0.290.0",
19
- "@webstudio-is/sdk-components-react-radix": "0.290.0",
14
+ "@webstudio-is/image": "0.292.0",
15
+ "@webstudio-is/react-sdk": "0.292.0",
16
+ "@webstudio-is/sdk": "0.292.0",
17
+ "@webstudio-is/sdk-components-react": "0.292.0",
18
+ "@webstudio-is/sdk-components-animation": "0.292.0",
19
+ "@webstudio-is/sdk-components-react-radix": "0.292.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",