webstudio 0.304.0 → 0.305.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.304.0",
3
+ "version": "0.305.0",
4
4
  "description": "Webstudio CLI",
5
5
  "author": "Webstudio <github@webstudio.is>",
6
6
  "homepage": "https://webstudio.is",
@@ -53,10 +53,10 @@
53
53
  "which": "^5.0.0",
54
54
  "yargs": "^17.7.2",
55
55
  "zod": "^4.4.3",
56
- "@webstudio-is/http-client": "0.304.0",
57
- "@webstudio-is/project-migrations": "0.304.0",
58
- "@webstudio-is/sync-client": "0.0.0",
59
- "@webstudio-is/protocol": "0.304.0"
56
+ "@webstudio-is/http-client": "0.305.0",
57
+ "@webstudio-is/project-migrations": "0.305.0",
58
+ "@webstudio-is/protocol": "0.305.0",
59
+ "@webstudio-is/sync-client": "0.0.0"
60
60
  },
61
61
  "devDependencies": {
62
62
  "@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": "4.130.0",
102
- "@webstudio-is/css-engine": "0.304.0",
103
- "@webstudio-is/expression": "0.304.0",
104
- "@webstudio-is/content-engine": "0.304.0",
105
- "@webstudio-is/fonts": "0.304.0",
106
- "@webstudio-is/image": "0.304.0",
102
+ "@webstudio-is/css-engine": "0.305.0",
103
+ "@webstudio-is/content-engine": "0.305.0",
104
+ "@webstudio-is/fonts": "0.305.0",
105
+ "@webstudio-is/image": "0.305.0",
106
+ "@webstudio-is/expression": "0.305.0",
107
107
  "@webstudio-is/project-build": "0.0.0",
108
- "@webstudio-is/query-builder": "0.304.0",
109
- "@webstudio-is/sdk-components-react-radix": "0.304.0",
110
- "@webstudio-is/sdk-components-react-remix": "0.304.0",
111
- "@webstudio-is/sdk-components-react": "0.304.0",
112
- "@webstudio-is/sdk-components-react-router": "0.304.0",
108
+ "@webstudio-is/query-builder": "0.305.0",
109
+ "@webstudio-is/sdk": "0.305.0",
110
+ "@webstudio-is/sdk-components-animation": "0.305.0",
111
+ "@webstudio-is/sdk-components-react-radix": "0.305.0",
112
+ "@webstudio-is/sdk-components-react": "0.305.0",
113
+ "@webstudio-is/sdk-components-react-remix": "0.305.0",
114
+ "@webstudio-is/react-sdk": "0.305.0",
115
+ "@webstudio-is/sdk-components-registry": "0.305.0",
113
116
  "@webstudio-is/vision": "0.0.0",
114
- "@webstudio-is/sdk-components-animation": "0.304.0",
115
- "@webstudio-is/sdk-components-registry": "0.304.0",
116
117
  "@webstudio-is/tsconfig": "1.0.7",
117
- "@webstudio-is/react-sdk": "0.304.0",
118
- "@webstudio-is/sdk": "0.304.0",
119
- "@webstudio-is/wsauth": "0.304.0"
118
+ "@webstudio-is/sdk-components-react-router": "0.305.0",
119
+ "@webstudio-is/wsauth": "0.305.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.304.0",
15
+ "@webstudio-is/wsauth": "0.305.0",
16
16
  "@remix-run/cloudflare": "2.16.5",
17
17
  "@remix-run/cloudflare-pages": "2.16.5"
18
18
  },
@@ -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.304.0",
17
- "@webstudio-is/react-sdk": "0.304.0",
18
- "@webstudio-is/sdk": "0.304.0",
19
- "@webstudio-is/sdk-components-react": "0.304.0",
20
- "@webstudio-is/sdk-components-animation": "0.304.0",
21
- "@webstudio-is/sdk-components-react-radix": "0.304.0",
22
- "@webstudio-is/sdk-components-react-remix": "0.304.0",
23
- "@webstudio-is/wsauth": "0.304.0",
16
+ "@webstudio-is/image": "0.305.0",
17
+ "@webstudio-is/react-sdk": "0.305.0",
18
+ "@webstudio-is/sdk": "0.305.0",
19
+ "@webstudio-is/sdk-components-react": "0.305.0",
20
+ "@webstudio-is/sdk-components-animation": "0.305.0",
21
+ "@webstudio-is/sdk-components-react-radix": "0.305.0",
22
+ "@webstudio-is/sdk-components-react-remix": "0.305.0",
23
+ "@webstudio-is/wsauth": "0.305.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",
@@ -18,7 +18,7 @@ import {
18
18
  formBotFieldName,
19
19
  cachedFetch,
20
20
  } from "@webstudio-is/sdk/runtime";
21
- import { authenticateRequest } from "@webstudio-is/wsauth";
21
+ import { authenticateProjectRequest } from "@webstudio-is/wsauth";
22
22
  import {
23
23
  ReactSdkContext,
24
24
  PageSettingsMeta,
@@ -47,24 +47,6 @@ import { authRoutes } from "__AUTH__";
47
47
  import { createGeneratedAssetResourceFetch } from "__ASSET_QUERY_RUNTIME__";
48
48
  import { assetUrlsByPath } from "__ASSETS__";
49
49
 
50
- const authenticateProductionRequest = (request: Request) => {
51
- const host =
52
- request.headers.get("x-forwarded-host") ||
53
- request.headers.get("host") ||
54
- "";
55
-
56
- const requestHost = host.split(":")[0];
57
- if (
58
- projectDomain !== undefined &&
59
- (requestHost === projectDomain ||
60
- requestHost.startsWith(`${projectDomain}.`))
61
- ) {
62
- return;
63
- }
64
-
65
- return authenticateRequest(request, authRoutes);
66
- };
67
-
68
50
  const customFetch: typeof fetch = (input, init) => {
69
51
  if (typeof input !== "string") {
70
52
  return cachedFetch(projectId, input, init);
@@ -99,7 +81,11 @@ const customFetch: typeof fetch = (input, init) => {
99
81
  };
100
82
 
101
83
  export const loader = async (arg: LoaderFunctionArgs) => {
102
- const authRoute = authenticateProductionRequest(arg.request);
84
+ const authRoute = authenticateProjectRequest(
85
+ arg.request,
86
+ authRoutes,
87
+ projectDomain
88
+ );
103
89
 
104
90
  const url = new URL(arg.request.url);
105
91
  const host =
@@ -259,7 +245,7 @@ export const action = async ({
259
245
  }: ActionFunctionArgs): Promise<
260
246
  { success: true } | { success: false; errors: string[] }
261
247
  > => {
262
- authenticateProductionRequest(request);
248
+ authenticateProjectRequest(request, authRoutes, projectDomain);
263
249
 
264
250
  try {
265
251
  const url = new URL(request.url);
@@ -1,30 +1,12 @@
1
1
  import { type LoaderFunctionArgs, redirect } from "react-router";
2
2
  import { isLocalResource, loadResources } from "@webstudio-is/sdk/runtime";
3
- import { authenticateRequest } from "@webstudio-is/wsauth";
3
+ import { authenticateProjectRequest } from "@webstudio-is/wsauth";
4
4
  import { projectDomain } from "__CLIENT__";
5
5
  import { getPageMeta, getRemixParams, getResources } from "__SERVER__";
6
6
  import { sitemap } from "__SITEMAP__";
7
7
  import { authRoutes } from "__AUTH__";
8
8
  import { createGeneratedAssetResourceFetch } from "__ASSET_QUERY_RUNTIME__";
9
9
 
10
- const authenticateProductionRequest = (request: Request) => {
11
- const host =
12
- request.headers.get("x-forwarded-host") ||
13
- request.headers.get("host") ||
14
- "";
15
-
16
- const requestHost = host.split(":")[0];
17
- if (
18
- projectDomain !== undefined &&
19
- (requestHost === projectDomain ||
20
- requestHost.startsWith(`${projectDomain}.`))
21
- ) {
22
- return;
23
- }
24
-
25
- return authenticateRequest(request, authRoutes);
26
- };
27
-
28
10
  const customFetch: typeof fetch = (input, init) => {
29
11
  if (typeof input !== "string") {
30
12
  return fetch(input, init);
@@ -57,7 +39,11 @@ const customFetch: typeof fetch = (input, init) => {
57
39
  };
58
40
 
59
41
  export const loader = async (arg: LoaderFunctionArgs) => {
60
- const authRoute = authenticateProductionRequest(arg.request);
42
+ const authRoute = authenticateProjectRequest(
43
+ arg.request,
44
+ authRoutes,
45
+ projectDomain
46
+ );
61
47
 
62
48
  const url = new URL(arg.request.url);
63
49
  const host =
@@ -1,7 +1,7 @@
1
1
  import { renderToString } from "react-dom/server";
2
2
  import { type LoaderFunctionArgs, redirect } from "react-router";
3
3
  import { isLocalResource, loadResources } from "@webstudio-is/sdk/runtime";
4
- import { authenticateRequest } from "@webstudio-is/wsauth";
4
+ import { authenticateProjectRequest } from "@webstudio-is/wsauth";
5
5
  import {
6
6
  ReactSdkContext,
7
7
  xmlNodeTagSuffix,
@@ -13,24 +13,6 @@ import { sitemap } from "__SITEMAP__";
13
13
  import { authRoutes } from "__AUTH__";
14
14
  import { createGeneratedAssetResourceFetch } from "__ASSET_QUERY_RUNTIME__";
15
15
 
16
- const authenticateProductionRequest = (request: Request) => {
17
- const host =
18
- request.headers.get("x-forwarded-host") ||
19
- request.headers.get("host") ||
20
- "";
21
-
22
- const requestHost = host.split(":")[0];
23
- if (
24
- projectDomain !== undefined &&
25
- (requestHost === projectDomain ||
26
- requestHost.startsWith(`${projectDomain}.`))
27
- ) {
28
- return;
29
- }
30
-
31
- return authenticateRequest(request, authRoutes);
32
- };
33
-
34
16
  const customFetch: typeof fetch = (input, init) => {
35
17
  if (typeof input !== "string") {
36
18
  return fetch(input, init);
@@ -65,7 +47,11 @@ const customFetch: typeof fetch = (input, init) => {
65
47
  };
66
48
 
67
49
  export const loader = async (arg: LoaderFunctionArgs) => {
68
- const authRoute = authenticateProductionRequest(arg.request);
50
+ const authRoute = authenticateProjectRequest(
51
+ arg.request,
52
+ authRoutes,
53
+ projectDomain
54
+ );
69
55
 
70
56
  const url = new URL(arg.request.url);
71
57
  const host =
@@ -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.304.0",
19
- "@webstudio-is/react-sdk": "0.304.0",
20
- "@webstudio-is/sdk": "0.304.0",
21
- "@webstudio-is/sdk-components-animation": "0.304.0",
22
- "@webstudio-is/sdk-components-react-radix": "0.304.0",
23
- "@webstudio-is/sdk-components-react-router": "0.304.0",
24
- "@webstudio-is/sdk-components-react": "0.304.0",
25
- "@webstudio-is/wsauth": "0.304.0",
18
+ "@webstudio-is/image": "0.305.0",
19
+ "@webstudio-is/react-sdk": "0.305.0",
20
+ "@webstudio-is/sdk": "0.305.0",
21
+ "@webstudio-is/sdk-components-animation": "0.305.0",
22
+ "@webstudio-is/sdk-components-react-radix": "0.305.0",
23
+ "@webstudio-is/sdk-components-react-router": "0.305.0",
24
+ "@webstudio-is/sdk-components-react": "0.305.0",
25
+ "@webstudio-is/wsauth": "0.305.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.304.0",
10
+ "@webstudio-is/wsauth": "0.305.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.304.0",
15
- "@webstudio-is/react-sdk": "0.304.0",
16
- "@webstudio-is/sdk": "0.304.0",
17
- "@webstudio-is/sdk-components-react": "0.304.0",
18
- "@webstudio-is/sdk-components-animation": "0.304.0",
19
- "@webstudio-is/sdk-components-react-radix": "0.304.0",
14
+ "@webstudio-is/image": "0.305.0",
15
+ "@webstudio-is/react-sdk": "0.305.0",
16
+ "@webstudio-is/sdk": "0.305.0",
17
+ "@webstudio-is/sdk-components-react": "0.305.0",
18
+ "@webstudio-is/sdk-components-animation": "0.305.0",
19
+ "@webstudio-is/sdk-components-react-radix": "0.305.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",