Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

refactor: remove project meta from client (#3290)

Bogdan Chadkinc5cdfa122211
diff --git a/fixtures/webstudio-cloudflare-template/app/__generated__/_index.server.tsx b/fixtures/webstudio-cloudflare-template/app/__generated__/_index.server.tsx
index b94deb5bbb..4470a4f427 100644
--- a/fixtures/webstudio-cloudflare-template/app/__generated__/_index.server.tsx
+++ b/fixtures/webstudio-cloudflare-template/app/__generated__/_index.server.tsx
@@ -1,7 +1,7 @@
/* eslint-disable */
/* This is a auto generated file for building the project */
-import type { ProjectMeta, PageMeta } from "@webstudio-is/sdk";
+import type { PageMeta } from "@webstudio-is/sdk";
import { loadResource, isLocalResource, type System } from "@webstudio-is/sdk";
export const loadResources = async (_props: { system: System }) => {
return {} as Record<string, unknown>;
@@ -41,8 +41,4 @@ export const user: { email: string | null } | undefined = {
};
-export const projectMeta: ProjectMeta = {
- siteName: "",
- faviconAssetId: "",
- code: "",
-};
+export const customCode = "";
diff --git a/fixtures/webstudio-cloudflare-template/app/__generated__/_index.tsx b/fixtures/webstudio-cloudflare-template/app/__generated__/_index.tsx
index 155935e267..2fdcfda98c 100644
--- a/fixtures/webstudio-cloudflare-template/app/__generated__/_index.tsx
+++ b/fixtures/webstudio-cloudflare-template/app/__generated__/_index.tsx
@@ -10,6 +10,8 @@ import {
Text as Text,
} from "@webstudio-is/sdk-components-react";
+export const siteName = "";
+
export const favIconAsset: ImageAsset | undefined = undefined;
export const socialImageAsset: ImageAsset | undefined = undefined;
diff --git a/fixtures/webstudio-cloudflare-template/app/routes/_index.tsx b/fixtures/webstudio-cloudflare-template/app/routes/_index.tsx
index 2725464e6b..7e3ddebbeb 100644
--- a/fixtures/webstudio-cloudflare-template/app/routes/_index.tsx
+++ b/fixtures/webstudio-cloudflare-template/app/routes/_index.tsx
@@ -14,6 +14,7 @@ import { ReactSdkContext } from "@webstudio-is/react-sdk";
import { n8nHandler, getFormId } from "@webstudio-is/form-handlers";
import {
Page,
+ siteName,
favIconAsset,
socialImageAsset,
pageFontAssets,
@@ -26,7 +27,6 @@ import {
getRemixParams,
projectId,
user,
- projectMeta,
} from "../__generated__/_index.server";
import css from "../__generated__/index.css?url";
@@ -70,7 +70,6 @@ export const loader = async (arg: LoaderFunctionArgs) => {
system,
resources,
pageMeta,
- projectMeta,
},
// No way for current information to change, so add cache for 10 minutes
// In case of CRM Data, this should be set to 0
@@ -96,7 +95,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
if (data === undefined) {
return metas;
}
- const { pageMeta, projectMeta } = data;
+ const { pageMeta } = data;
if (data.url) {
metas.push({
@@ -118,16 +117,16 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
const origin = `https://${data.host}`;
- if (projectMeta?.siteName) {
+ if (siteName) {
metas.push({
property: "og:site_name",
- content: projectMeta.siteName,
+ content: siteName,
});
metas.push({
"script:ld+json": {
"@context": "https://schema.org",
"@type": "WebSite",
- name: projectMeta.siteName,
+ name: siteName,
url: origin,
},
});
diff --git a/fixtures/webstudio-custom-template/app/__generated__/[script-test]._index.server.tsx b/fixtures/webstudio-custom-template/app/__generated__/[script-test]._index.server.tsx
index 7ab53a77df..431ccaff7d 100644
--- a/fixtures/webstudio-custom-template/app/__generated__/[script-test]._index.server.tsx
+++ b/fixtures/webstudio-custom-template/app/__generated__/[script-test]._index.server.tsx
@@ -1,7 +1,7 @@
/* eslint-disable */
/* This is a auto generated file for building the project */
-import type { ProjectMeta, PageMeta } from "@webstudio-is/sdk";
+import type { PageMeta } from "@webstudio-is/sdk";
import { loadResource, isLocalResource, type System } from "@webstudio-is/sdk";
export const loadResources = async (_props: { system: System }) => {
return {} as Record<string, unknown>;
@@ -41,8 +41,5 @@ export const user: { email: string | null } | undefined = {
};
-export const projectMeta: ProjectMeta = {
- siteName: "Fixture Site",
- faviconAssetId: "cd1e9fad-8df1-45c6-800f-05fda2d2469f",
- code: '<script>console.log(\'HELLO\')</script>\n<meta property="saas:test" content="test">',
-};
+export const customCode =
+ '<script>console.log(\'HELLO\')</script>\n<meta property="saas:test" content="test">';
diff --git a/fixtures/webstudio-custom-template/app/__generated__/[script-test]._index.tsx b/fixtures/webstudio-custom-template/app/__generated__/[script-test]._index.tsx
index 9527f34891..5107c49969 100644
--- a/fixtures/webstudio-custom-template/app/__generated__/[script-test]._index.tsx
+++ b/fixtures/webstudio-custom-template/app/__generated__/[script-test]._index.tsx
@@ -13,6 +13,8 @@ import {
HtmlEmbed as HtmlEmbed,
} from "@webstudio-is/sdk-components-react";
+export const siteName = "Fixture Site";
+
export const favIconAsset: ImageAsset | undefined = {
id: "cd1e9fad-8df1-45c6-800f-05fda2d2469f",
name: "home_wsKvRSqvkajPPBeycZ-C8.svg",
diff --git a/fixtures/webstudio-custom-template/app/__generated__/[sitemap-html]._index.server.tsx b/fixtures/webstudio-custom-template/app/__generated__/[sitemap-html]._index.server.tsx
index e9d5418248..fe8f6737c7 100644
--- a/fixtures/webstudio-custom-template/app/__generated__/[sitemap-html]._index.server.tsx
+++ b/fixtures/webstudio-custom-template/app/__generated__/[sitemap-html]._index.server.tsx
@@ -1,7 +1,7 @@
/* eslint-disable */
/* This is a auto generated file for building the project */
-import type { ProjectMeta, PageMeta } from "@webstudio-is/sdk";
+import type { PageMeta } from "@webstudio-is/sdk";
import { loadResource, isLocalResource, type System } from "@webstudio-is/sdk";
import { sitemap } from "./[sitemap.xml]";
export const loadResources = async (_props: { system: System }) => {
@@ -67,8 +67,5 @@ export const user: { email: string | null } | undefined = {
};
-export const projectMeta: ProjectMeta = {
- siteName: "Fixture Site",
- faviconAssetId: "cd1e9fad-8df1-45c6-800f-05fda2d2469f",
- code: '<script>console.log(\'HELLO\')</script>\n<meta property="saas:test" content="test">',
-};
+export const customCode =
+ '<script>console.log(\'HELLO\')</script>\n<meta property="saas:test" content="test">';
diff --git a/fixtures/webstudio-custom-template/app/__generated__/[sitemap-html]._index.tsx b/fixtures/webstudio-custom-template/app/__generated__/[sitemap-html]._index.tsx
index b1d1e46995..53b70d2992 100644
--- a/fixtures/webstudio-custom-template/app/__generated__/[sitemap-html]._index.tsx
+++ b/fixtures/webstudio-custom-template/app/__generated__/[sitemap-html]._index.tsx
@@ -7,6 +7,8 @@ import { useResource } from "@webstudio-is/react-sdk";
import { Body as Body } from "@webstudio-is/sdk-components-react-remix";
import { Box as Box, Text as Text } from "@webstudio-is/sdk-components-react";
+export const siteName = "Fixture Site";
+
export const favIconAsset: ImageAsset | undefined = {
id: "cd1e9fad-8df1-45c6-800f-05fda2d2469f",
name: "home_wsKvRSqvkajPPBeycZ-C8.svg",
diff --git a/fixtures/webstudio-custom-template/app/__generated__/[world]._index.server.tsx b/fixtures/webstudio-custom-template/app/__generated__/[world]._index.server.tsx
index 481ee6fc25..8eb96562d9 100644
--- a/fixtures/webstudio-custom-template/app/__generated__/[world]._index.server.tsx
+++ b/fixtures/webstudio-custom-template/app/__generated__/[world]._index.server.tsx
@@ -1,7 +1,7 @@
/* eslint-disable */
/* This is a auto generated file for building the project */
-import type { ProjectMeta, PageMeta } from "@webstudio-is/sdk";
+import type { PageMeta } from "@webstudio-is/sdk";
import { loadResource, isLocalResource, type System } from "@webstudio-is/sdk";
export const loadResources = async (_props: { system: System }) => {
return {} as Record<string, unknown>;
@@ -41,8 +41,5 @@ export const user: { email: string | null } | undefined = {
};
-export const projectMeta: ProjectMeta = {
- siteName: "Fixture Site",
- faviconAssetId: "cd1e9fad-8df1-45c6-800f-05fda2d2469f",
- code: '<script>console.log(\'HELLO\')</script>\n<meta property="saas:test" content="test">',
-};
+export const customCode =
+ '<script>console.log(\'HELLO\')</script>\n<meta property="saas:test" content="test">';
diff --git a/fixtures/webstudio-custom-template/app/__generated__/[world]._index.tsx b/fixtures/webstudio-custom-template/app/__generated__/[world]._index.tsx
index b742d26a40..673b0c5120 100644
--- a/fixtures/webstudio-custom-template/app/__generated__/[world]._index.tsx
+++ b/fixtures/webstudio-custom-template/app/__generated__/[world]._index.tsx
@@ -7,6 +7,8 @@ import { useResource } from "@webstudio-is/react-sdk";
import { Body as Body } from "@webstudio-is/sdk-components-react-remix";
import { Heading as Heading } from "@webstudio-is/sdk-components-react";
+export const siteName = "Fixture Site";
+
export const favIconAsset: ImageAsset | undefined = {
id: "cd1e9fad-8df1-45c6-800f-05fda2d2469f",
name: "home_wsKvRSqvkajPPBeycZ-C8.svg",
diff --git a/fixtures/webstudio-custom-template/app/__generated__/_index.server.tsx b/fixtures/webstudio-custom-template/app/__generated__/_index.server.tsx
index 7266514e9d..4422864176 100644
--- a/fixtures/webstudio-custom-template/app/__generated__/_index.server.tsx
+++ b/fixtures/webstudio-custom-template/app/__generated__/_index.server.tsx
@@ -1,7 +1,7 @@
/* eslint-disable */
/* This is a auto generated file for building the project */
-import type { ProjectMeta, PageMeta } from "@webstudio-is/sdk";
+import type { PageMeta } from "@webstudio-is/sdk";
import { loadResource, isLocalResource, type System } from "@webstudio-is/sdk";
export const loadResources = async (_props: { system: System }) => {
return {} as Record<string, unknown>;
@@ -41,8 +41,5 @@ export const user: { email: string | null } | undefined = {
};
-export const projectMeta: ProjectMeta = {
- siteName: "Fixture Site",
- faviconAssetId: "cd1e9fad-8df1-45c6-800f-05fda2d2469f",
- code: '<script>console.log(\'HELLO\')</script>\n<meta property="saas:test" content="test">',
-};
+export const customCode =
+ '<script>console.log(\'HELLO\')</script>\n<meta property="saas:test" content="test">';
diff --git a/fixtures/webstudio-custom-template/app/__generated__/_index.tsx b/fixtures/webstudio-custom-template/app/__generated__/_index.tsx
index 4de27416bb..784c1cba16 100644
--- a/fixtures/webstudio-custom-template/app/__generated__/_index.tsx
+++ b/fixtures/webstudio-custom-template/app/__generated__/_index.tsx
@@ -19,6 +19,8 @@ import {
Image as Image,
} from "@webstudio-is/sdk-components-react";
+export const siteName = "Fixture Site";
+
export const favIconAsset: ImageAsset | undefined = {
id: "cd1e9fad-8df1-45c6-800f-05fda2d2469f",
name: "home_wsKvRSqvkajPPBeycZ-C8.svg",
diff --git a/fixtures/webstudio-custom-template/app/routes/[script-test]._index.tsx b/fixtures/webstudio-custom-template/app/routes/[script-test]._index.tsx
index 566c3bd38c..178b053d8b 100644
--- a/fixtures/webstudio-custom-template/app/routes/[script-test]._index.tsx
+++ b/fixtures/webstudio-custom-template/app/routes/[script-test]._index.tsx
@@ -14,6 +14,7 @@ import { ReactSdkContext } from "@webstudio-is/react-sdk";
import { n8nHandler, getFormId } from "@webstudio-is/form-handlers";
import {
Page,
+ siteName,
favIconAsset,
socialImageAsset,
pageFontAssets,
@@ -26,7 +27,6 @@ import {
getRemixParams,
projectId,
user,
- projectMeta,
} from "../__generated__/[script-test]._index.server";
import css from "../__generated__/index.css?url";
@@ -70,7 +70,6 @@ export const loader = async (arg: LoaderFunctionArgs) => {
system,
resources,
pageMeta,
- projectMeta,
},
// No way for current information to change, so add cache for 10 minutes
// In case of CRM Data, this should be set to 0
@@ -96,7 +95,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
if (data === undefined) {
return metas;
}
- const { pageMeta, projectMeta } = data;
+ const { pageMeta } = data;
if (data.url) {
metas.push({
@@ -118,16 +117,16 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
const origin = `https://${data.host}`;
- if (projectMeta?.siteName) {
+ if (siteName) {
metas.push({
property: "og:site_name",
- content: projectMeta.siteName,
+ content: siteName,
});
metas.push({
"script:ld+json": {
"@context": "https://schema.org",
"@type": "WebSite",
- name: projectMeta.siteName,
+ name: siteName,
url: origin,
},
});
diff --git a/fixtures/webstudio-custom-template/app/routes/[sitemap-html]._index.tsx b/fixtures/webstudio-custom-template/app/routes/[sitemap-html]._index.tsx
index ac65118f6d..36f6c6f55a 100644
--- a/fixtures/webstudio-custom-template/app/routes/[sitemap-html]._index.tsx
+++ b/fixtures/webstudio-custom-template/app/routes/[sitemap-html]._index.tsx
@@ -14,6 +14,7 @@ import { ReactSdkContext } from "@webstudio-is/react-sdk";
import { n8nHandler, getFormId } from "@webstudio-is/form-handlers";
import {
Page,
+ siteName,
favIconAsset,
socialImageAsset,
pageFontAssets,
@@ -26,7 +27,6 @@ import {
getRemixParams,
projectId,
user,
- projectMeta,
} from "../__generated__/[sitemap-html]._index.server";
import css from "../__generated__/index.css?url";
@@ -70,7 +70,6 @@ export const loader = async (arg: LoaderFunctionArgs) => {
system,
resources,
pageMeta,
- projectMeta,
},
// No way for current information to change, so add cache for 10 minutes
// In case of CRM Data, this should be set to 0
@@ -96,7 +95,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
if (data === undefined) {
return metas;
}
- const { pageMeta, projectMeta } = data;
+ const { pageMeta } = data;
if (data.url) {
metas.push({
@@ -118,16 +117,16 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
const origin = `https://${data.host}`;
- if (projectMeta?.siteName) {
+ if (siteName) {
metas.push({
property: "og:site_name",
- content: projectMeta.siteName,
+ content: siteName,
});
metas.push({
"script:ld+json": {
"@context": "https://schema.org",
"@type": "WebSite",
- name: projectMeta.siteName,
+ name: siteName,
url: origin,
},
});
diff --git a/fixtures/webstudio-custom-template/app/routes/[world]._index.tsx b/fixtures/webstudio-custom-template/app/routes/[world]._index.tsx
index d543c1d636..bf0574fa48 100644
--- a/fixtures/webstudio-custom-template/app/routes/[world]._index.tsx
+++ b/fixtures/webstudio-custom-template/app/routes/[world]._index.tsx
@@ -14,6 +14,7 @@ import { ReactSdkContext } from "@webstudio-is/react-sdk";
import { n8nHandler, getFormId } from "@webstudio-is/form-handlers";
import {
Page,
+ siteName,
favIconAsset,
socialImageAsset,
pageFontAssets,
@@ -26,7 +27,6 @@ import {
getRemixParams,
projectId,
user,
- projectMeta,
} from "../__generated__/[world]._index.server";
import css from "../__generated__/index.css?url";
@@ -70,7 +70,6 @@ export const loader = async (arg: LoaderFunctionArgs) => {
system,
resources,
pageMeta,
- projectMeta,
},
// No way for current information to change, so add cache for 10 minutes
// In case of CRM Data, this should be set to 0
@@ -96,7 +95,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
if (data === undefined) {
return metas;
}
- const { pageMeta, projectMeta } = data;
+ const { pageMeta } = data;
if (data.url) {
metas.push({
@@ -118,16 +117,16 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
const origin = `https://${data.host}`;
- if (projectMeta?.siteName) {
+ if (siteName) {
metas.push({
property: "og:site_name",
- content: projectMeta.siteName,
+ content: siteName,
});
metas.push({
"script:ld+json": {
"@context": "https://schema.org",
"@type": "WebSite",
- name: projectMeta.siteName,
+ name: siteName,
url: origin,
},
});
diff --git a/fixtures/webstudio-custom-template/app/routes/_index.tsx b/fixtures/webstudio-custom-template/app/routes/_index.tsx
index 2725464e6b..7e3ddebbeb 100644
--- a/fixtures/webstudio-custom-template/app/routes/_index.tsx
+++ b/fixtures/webstudio-custom-template/app/routes/_index.tsx
@@ -14,6 +14,7 @@ import { ReactSdkContext } from "@webstudio-is/react-sdk";
import { n8nHandler, getFormId } from "@webstudio-is/form-handlers";
import {
Page,
+ siteName,
favIconAsset,
socialImageAsset,
pageFontAssets,
@@ -26,7 +27,6 @@ import {
getRemixParams,
projectId,
user,
- projectMeta,
} from "../__generated__/_index.server";
import css from "../__generated__/index.css?url";
@@ -70,7 +70,6 @@ export const loader = async (arg: LoaderFunctionArgs) => {
system,
resources,
pageMeta,
- projectMeta,
},
// No way for current information to change, so add cache for 10 minutes
// In case of CRM Data, this should be set to 0
@@ -96,7 +95,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
if (data === undefined) {
return metas;
}
- const { pageMeta, projectMeta } = data;
+ const { pageMeta } = data;
if (data.url) {
metas.push({
@@ -118,16 +117,16 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
const origin = `https://${data.host}`;
- if (projectMeta?.siteName) {
+ if (siteName) {
metas.push({
property: "og:site_name",
- content: projectMeta.siteName,
+ content: siteName,
});
metas.push({
"script:ld+json": {
"@context": "https://schema.org",
"@type": "WebSite",
- name: projectMeta.siteName,
+ name: siteName,
url: origin,
},
});
diff --git a/fixtures/webstudio-remix-netlify-edge-functions/app/__generated__/_index.server.tsx b/fixtures/webstudio-remix-netlify-edge-functions/app/__generated__/_index.server.tsx
index b94deb5bbb..4470a4f427 100644
--- a/fixtures/webstudio-remix-netlify-edge-functions/app/__generated__/_index.server.tsx
+++ b/fixtures/webstudio-remix-netlify-edge-functions/app/__generated__/_index.server.tsx
@@ -1,7 +1,7 @@
/* eslint-disable */
/* This is a auto generated file for building the project */
-import type { ProjectMeta, PageMeta } from "@webstudio-is/sdk";
+import type { PageMeta } from "@webstudio-is/sdk";
import { loadResource, isLocalResource, type System } from "@webstudio-is/sdk";
export const loadResources = async (_props: { system: System }) => {
return {} as Record<string, unknown>;
@@ -41,8 +41,4 @@ export const user: { email: string | null } | undefined = {
};
-export const projectMeta: ProjectMeta = {
- siteName: "",
- faviconAssetId: "",
- code: "",
-};
+export const customCode = "";
diff --git a/fixtures/webstudio-remix-netlify-edge-functions/app/__generated__/_index.tsx b/fixtures/webstudio-remix-netlify-edge-functions/app/__generated__/_index.tsx
index 155935e267..2fdcfda98c 100644
--- a/fixtures/webstudio-remix-netlify-edge-functions/app/__generated__/_index.tsx
+++ b/fixtures/webstudio-remix-netlify-edge-functions/app/__generated__/_index.tsx
@@ -10,6 +10,8 @@ import {
Text as Text,
} from "@webstudio-is/sdk-components-react";
+export const siteName = "";
+
export const favIconAsset: ImageAsset | undefined = undefined;
export const socialImageAsset: ImageAsset | undefined = undefined;
diff --git a/fixtures/webstudio-remix-netlify-edge-functions/app/routes/_index.tsx b/fixtures/webstudio-remix-netlify-edge-functions/app/routes/_index.tsx
index 2725464e6b..7e3ddebbeb 100644
--- a/fixtures/webstudio-remix-netlify-edge-functions/app/routes/_index.tsx
+++ b/fixtures/webstudio-remix-netlify-edge-functions/app/routes/_index.tsx
@@ -14,6 +14,7 @@ import { ReactSdkContext } from "@webstudio-is/react-sdk";
import { n8nHandler, getFormId } from "@webstudio-is/form-handlers";
import {
Page,
+ siteName,
favIconAsset,
socialImageAsset,
pageFontAssets,
@@ -26,7 +27,6 @@ import {
getRemixParams,
projectId,
user,
- projectMeta,
} from "../__generated__/_index.server";
import css from "../__generated__/index.css?url";
@@ -70,7 +70,6 @@ export const loader = async (arg: LoaderFunctionArgs) => {
system,
resources,
pageMeta,
- projectMeta,
},
// No way for current information to change, so add cache for 10 minutes
// In case of CRM Data, this should be set to 0
@@ -96,7 +95,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
if (data === undefined) {
return metas;
}
- const { pageMeta, projectMeta } = data;
+ const { pageMeta } = data;
if (data.url) {
metas.push({
@@ -118,16 +117,16 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
const origin = `https://${data.host}`;
- if (projectMeta?.siteName) {
+ if (siteName) {
metas.push({
property: "og:site_name",
- content: projectMeta.siteName,
+ content: siteName,
});
metas.push({
"script:ld+json": {
"@context": "https://schema.org",
"@type": "WebSite",
- name: projectMeta.siteName,
+ name: siteName,
url: origin,
},
});
diff --git a/fixtures/webstudio-remix-netlify-functions/app/__generated__/_index.server.tsx b/fixtures/webstudio-remix-netlify-functions/app/__generated__/_index.server.tsx
index b94deb5bbb..4470a4f427 100644
--- a/fixtures/webstudio-remix-netlify-functions/app/__generated__/_index.server.tsx
+++ b/fixtures/webstudio-remix-netlify-functions/app/__generated__/_index.server.tsx
@@ -1,7 +1,7 @@
/* eslint-disable */
/* This is a auto generated file for building the project */
-import type { ProjectMeta, PageMeta } from "@webstudio-is/sdk";
+import type { PageMeta } from "@webstudio-is/sdk";
import { loadResource, isLocalResource, type System } from "@webstudio-is/sdk";
export const loadResources = async (_props: { system: System }) => {
return {} as Record<string, unknown>;
@@ -41,8 +41,4 @@ export const user: { email: string | null } | undefined = {
};
-export const projectMeta: ProjectMeta = {
- siteName: "",
- faviconAssetId: "",
- code: "",
-};
+export const customCode = "";
diff --git a/fixtures/webstudio-remix-netlify-functions/app/__generated__/_index.tsx b/fixtures/webstudio-remix-netlify-functions/app/__generated__/_index.tsx
index 155935e267..2fdcfda98c 100644
--- a/fixtures/webstudio-remix-netlify-functions/app/__generated__/_index.tsx
+++ b/fixtures/webstudio-remix-netlify-functions/app/__generated__/_index.tsx
@@ -10,6 +10,8 @@ import {
Text as Text,
} from "@webstudio-is/sdk-components-react";
+export const siteName = "";
+
export const favIconAsset: ImageAsset | undefined = undefined;
export const socialImageAsset: ImageAsset | undefined = undefined;
diff --git a/fixtures/webstudio-remix-netlify-functions/app/routes/_index.tsx b/fixtures/webstudio-remix-netlify-functions/app/routes/_index.tsx
index 2725464e6b..7e3ddebbeb 100644
--- a/fixtures/webstudio-remix-netlify-functions/app/routes/_index.tsx
+++ b/fixtures/webstudio-remix-netlify-functions/app/routes/_index.tsx
@@ -14,6 +14,7 @@ import { ReactSdkContext } from "@webstudio-is/react-sdk";
import { n8nHandler, getFormId } from "@webstudio-is/form-handlers";
import {
Page,
+ siteName,
favIconAsset,
socialImageAsset,
pageFontAssets,
@@ -26,7 +27,6 @@ import {
getRemixParams,
projectId,
user,
- projectMeta,
} from "../__generated__/_index.server";
import css from "../__generated__/index.css?url";
@@ -70,7 +70,6 @@ export const loader = async (arg: LoaderFunctionArgs) => {
system,
resources,
pageMeta,
- projectMeta,
},
// No way for current information to change, so add cache for 10 minutes
// In case of CRM Data, this should be set to 0
@@ -96,7 +95,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
if (data === undefined) {
return metas;
}
- const { pageMeta, projectMeta } = data;
+ const { pageMeta } = data;
if (data.url) {
metas.push({
@@ -118,16 +117,16 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
const origin = `https://${data.host}`;
- if (projectMeta?.siteName) {
+ if (siteName) {
metas.push({
property: "og:site_name",
- content: projectMeta.siteName,
+ content: siteName,
});
metas.push({
"script:ld+json": {
"@context": "https://schema.org",
"@type": "WebSite",
- name: projectMeta.siteName,
+ name: siteName,
url: origin,
},
});
diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[_route_with_symbols_]._index.server.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[_route_with_symbols_]._index.server.tsx
index bd657afc85..2cb9318f31 100644
--- a/fixtures/webstudio-remix-vercel/app/__generated__/[_route_with_symbols_]._index.server.tsx
+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[_route_with_symbols_]._index.server.tsx
@@ -1,7 +1,7 @@
/* eslint-disable */
/* This is a auto generated file for building the project */
-import type { ProjectMeta, PageMeta } from "@webstudio-is/sdk";
+import type { PageMeta } from "@webstudio-is/sdk";
import { loadResource, isLocalResource, type System } from "@webstudio-is/sdk";
export const loadResources = async (_props: { system: System }) => {
return {} as Record<string, unknown>;
@@ -41,8 +41,4 @@ export const user: { email: string | null } | undefined = {
};
-export const projectMeta: ProjectMeta = {
- siteName: "KittyGuardedZone",
- faviconAssetId: "88d5e2ff-b8f2-4899-aaf8-dde4ade6da10",
- code: "<script>console.log('KittyGuardedZone')</script>\n",
-};
+export const customCode = "<script>console.log('KittyGuardedZone')</script>";
diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[_route_with_symbols_]._index.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[_route_with_symbols_]._index.tsx
index fc4efa63a6..4a8ef4572b 100644
--- a/fixtures/webstudio-remix-vercel/app/__generated__/[_route_with_symbols_]._index.tsx
+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[_route_with_symbols_]._index.tsx
@@ -7,6 +7,8 @@ import { useResource } from "@webstudio-is/react-sdk";
import { Body as Body } from "@webstudio-is/sdk-components-react-remix";
import { Image as Image } from "@webstudio-is/sdk-components-react";
+export const siteName = "KittyGuardedZone";
+
export const favIconAsset: ImageAsset | undefined = {
id: "88d5e2ff-b8f2-4899-aaf8-dde4ade6da10",
name: "DALL_E_2023-10-30_12.39.46_-_Photo_logo_with_a_bold_cat_silhouette_centered_on_a_contrasting_background_designed_for_clarity_at_small_32x32_favicon_resolution_00h6cEA8u2pJRvVJv7hRe.png",
diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[form]._index.server.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[form]._index.server.tsx
index 95cf1ebe6a..b9cb201bb3 100644
--- a/fixtures/webstudio-remix-vercel/app/__generated__/[form]._index.server.tsx
+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[form]._index.server.tsx
@@ -1,7 +1,7 @@
/* eslint-disable */
/* This is a auto generated file for building the project */
-import type { ProjectMeta, PageMeta } from "@webstudio-is/sdk";
+import type { PageMeta } from "@webstudio-is/sdk";
import { loadResource, isLocalResource, type System } from "@webstudio-is/sdk";
export const loadResources = async (_props: { system: System }) => {
return {} as Record<string, unknown>;
@@ -43,8 +43,4 @@ export const user: { email: string | null } | undefined = {
};
-export const projectMeta: ProjectMeta = {
- siteName: "KittyGuardedZone",
- faviconAssetId: "88d5e2ff-b8f2-4899-aaf8-dde4ade6da10",
- code: "<script>console.log('KittyGuardedZone')</script>\n",
-};
+export const customCode = "<script>console.log('KittyGuardedZone')</script>";
diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[form]._index.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[form]._index.tsx
index ba26d27365..c094a84f06 100644
--- a/fixtures/webstudio-remix-vercel/app/__generated__/[form]._index.tsx
+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[form]._index.tsx
@@ -16,6 +16,8 @@ import {
Heading as Heading,
} from "@webstudio-is/sdk-components-react";
+export const siteName = "KittyGuardedZone";
+
export const favIconAsset: ImageAsset | undefined = {
id: "88d5e2ff-b8f2-4899-aaf8-dde4ade6da10",
name: "DALL_E_2023-10-30_12.39.46_-_Photo_logo_with_a_bold_cat_silhouette_centered_on_a_contrasting_background_designed_for_clarity_at_small_32x32_favicon_resolution_00h6cEA8u2pJRvVJv7hRe.png",
diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[heading-with-id]._index.server.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[heading-with-id]._index.server.tsx
index af4bf91eb2..d8e308e4da 100644
--- a/fixtures/webstudio-remix-vercel/app/__generated__/[heading-with-id]._index.server.tsx
+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[heading-with-id]._index.server.tsx
@@ -1,7 +1,7 @@
/* eslint-disable */
/* This is a auto generated file for building the project */
-import type { ProjectMeta, PageMeta } from "@webstudio-is/sdk";
+import type { PageMeta } from "@webstudio-is/sdk";
import { loadResource, isLocalResource, type System } from "@webstudio-is/sdk";
export const loadResources = async (_props: { system: System }) => {
return {} as Record<string, unknown>;
@@ -41,8 +41,4 @@ export const user: { email: string | null } | undefined = {
};
-export const projectMeta: ProjectMeta = {
- siteName: "KittyGuardedZone",
- faviconAssetId: "88d5e2ff-b8f2-4899-aaf8-dde4ade6da10",
- code: "<script>console.log('KittyGuardedZone')</script>\n",
-};
+export const customCode = "<script>console.log('KittyGuardedZone')</script>";
diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[heading-with-id]._index.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[heading-with-id]._index.tsx
index 9d3685c342..1484f8e1a1 100644
--- a/fixtures/webstudio-remix-vercel/app/__generated__/[heading-with-id]._index.tsx
+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[heading-with-id]._index.tsx
@@ -7,6 +7,8 @@ import { useResource } from "@webstudio-is/react-sdk";
import { Body as Body } from "@webstudio-is/sdk-components-react-remix";
import { Heading as Heading } from "@webstudio-is/sdk-components-react";
+export const siteName = "KittyGuardedZone";
+
export const favIconAsset: ImageAsset | undefined = {
id: "88d5e2ff-b8f2-4899-aaf8-dde4ade6da10",
name: "DALL_E_2023-10-30_12.39.46_-_Photo_logo_with_a_bold_cat_silhouette_centered_on_a_contrasting_background_designed_for_clarity_at_small_32x32_favicon_resolution_00h6cEA8u2pJRvVJv7hRe.png",
diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[nested].[nested-page]._index.server.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[nested].[nested-page]._index.server.tsx
index fca34ea7df..ba310340b1 100644
--- a/fixtures/webstudio-remix-vercel/app/__generated__/[nested].[nested-page]._index.server.tsx
+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[nested].[nested-page]._index.server.tsx
@@ -1,7 +1,7 @@
/* eslint-disable */
/* This is a auto generated file for building the project */
-import type { ProjectMeta, PageMeta } from "@webstudio-is/sdk";
+import type { PageMeta } from "@webstudio-is/sdk";
import { loadResource, isLocalResource, type System } from "@webstudio-is/sdk";
export const loadResources = async (_props: { system: System }) => {
return {} as Record<string, unknown>;
@@ -41,8 +41,4 @@ export const user: { email: string | null } | undefined = {
};
-export const projectMeta: ProjectMeta = {
- siteName: "KittyGuardedZone",
- faviconAssetId: "88d5e2ff-b8f2-4899-aaf8-dde4ade6da10",
- code: "<script>console.log('KittyGuardedZone')</script>\n",
-};
+export const customCode = "<script>console.log('KittyGuardedZone')</script>";
diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[nested].[nested-page]._index.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[nested].[nested-page]._index.tsx
index e72932ed07..d551eb77c4 100644
--- a/fixtures/webstudio-remix-vercel/app/__generated__/[nested].[nested-page]._index.tsx
+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[nested].[nested-page]._index.tsx
@@ -7,6 +7,8 @@ import { useResource } from "@webstudio-is/react-sdk";
import { Body as Body } from "@webstudio-is/sdk-components-react-remix";
import { Heading as Heading } from "@webstudio-is/sdk-components-react";
+export const siteName = "KittyGuardedZone";
+
export const favIconAsset: ImageAsset | undefined = {
id: "88d5e2ff-b8f2-4899-aaf8-dde4ade6da10",
name: "DALL_E_2023-10-30_12.39.46_-_Photo_logo_with_a_bold_cat_silhouette_centered_on_a_contrasting_background_designed_for_clarity_at_small_32x32_favicon_resolution_00h6cEA8u2pJRvVJv7hRe.png",
diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[radix]._index.server.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[radix]._index.server.tsx
index 3b6134cc3f..5e1e108ad1 100644
--- a/fixtures/webstudio-remix-vercel/app/__generated__/[radix]._index.server.tsx
+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[radix]._index.server.tsx
@@ -1,7 +1,7 @@
/* eslint-disable */
/* This is a auto generated file for building the project */
-import type { ProjectMeta, PageMeta } from "@webstudio-is/sdk";
+import type { PageMeta } from "@webstudio-is/sdk";
import { loadResource, isLocalResource, type System } from "@webstudio-is/sdk";
export const loadResources = async (_props: { system: System }) => {
return {} as Record<string, unknown>;
@@ -42,8 +42,4 @@ export const user: { email: string | null } | undefined = {
};
-export const projectMeta: ProjectMeta = {
- siteName: "KittyGuardedZone",
- faviconAssetId: "88d5e2ff-b8f2-4899-aaf8-dde4ade6da10",
- code: "<script>console.log('KittyGuardedZone')</script>\n",
-};
+export const customCode = "<script>console.log('KittyGuardedZone')</script>";
diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[radix]._index.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[radix]._index.tsx
index 3dda199c77..917d767f81 100644
--- a/fixtures/webstudio-remix-vercel/app/__generated__/[radix]._index.tsx
+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[radix]._index.tsx
@@ -18,6 +18,8 @@ import {
HtmlEmbed as HtmlEmbed,
} from "@webstudio-is/sdk-components-react";
+export const siteName = "KittyGuardedZone";
+
export const favIconAsset: ImageAsset | undefined = {
id: "88d5e2ff-b8f2-4899-aaf8-dde4ade6da10",
name: "DALL_E_2023-10-30_12.39.46_-_Photo_logo_with_a_bold_cat_silhouette_centered_on_a_contrasting_background_designed_for_clarity_at_small_32x32_favicon_resolution_00h6cEA8u2pJRvVJv7hRe.png",
diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[resources]._index.server.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[resources]._index.server.tsx
index 8319e1bf9b..f5fe8a7e83 100644
--- a/fixtures/webstudio-remix-vercel/app/__generated__/[resources]._index.server.tsx
+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[resources]._index.server.tsx
@@ -1,7 +1,7 @@
/* eslint-disable */
/* This is a auto generated file for building the project */
-import type { ProjectMeta, PageMeta } from "@webstudio-is/sdk";
+import type { PageMeta } from "@webstudio-is/sdk";
import { loadResource, isLocalResource, type System } from "@webstudio-is/sdk";
import { sitemap } from "./[sitemap.xml]";
export const loadResources = async (_props: { system: System }) => {
@@ -67,8 +67,4 @@ export const user: { email: string | null } | undefined = {
};
-export const projectMeta: ProjectMeta = {
- siteName: "KittyGuardedZone",
- faviconAssetId: "88d5e2ff-b8f2-4899-aaf8-dde4ade6da10",
- code: "<script>console.log('KittyGuardedZone')</script>\n",
-};
+export const customCode = "<script>console.log('KittyGuardedZone')</script>";
diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/[resources]._index.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/[resources]._index.tsx
index bc3aa02698..b5970009ed 100644
--- a/fixtures/webstudio-remix-vercel/app/__generated__/[resources]._index.tsx
+++ b/fixtures/webstudio-remix-vercel/app/__generated__/[resources]._index.tsx
@@ -10,6 +10,8 @@ import {
HtmlEmbed as HtmlEmbed,
} from "@webstudio-is/sdk-components-react";
+export const siteName = "KittyGuardedZone";
+
export const favIconAsset: ImageAsset | undefined = {
id: "88d5e2ff-b8f2-4899-aaf8-dde4ade6da10",
name: "DALL_E_2023-10-30_12.39.46_-_Photo_logo_with_a_bold_cat_silhouette_centered_on_a_contrasting_background_designed_for_clarity_at_small_32x32_favicon_resolution_00h6cEA8u2pJRvVJv7hRe.png",
diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/_index.server.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/_index.server.tsx
index 2ca763afbb..dd0baef2b7 100644
--- a/fixtures/webstudio-remix-vercel/app/__generated__/_index.server.tsx
+++ b/fixtures/webstudio-remix-vercel/app/__generated__/_index.server.tsx
@@ -1,7 +1,7 @@
/* eslint-disable */
/* This is a auto generated file for building the project */
-import type { ProjectMeta, PageMeta } from "@webstudio-is/sdk";
+import type { PageMeta } from "@webstudio-is/sdk";
import { loadResource, isLocalResource, type System } from "@webstudio-is/sdk";
export const loadResources = async (_props: { system: System }) => {
return {} as Record<string, unknown>;
@@ -47,8 +47,4 @@ export const user: { email: string | null } | undefined = {
};
-export const projectMeta: ProjectMeta = {
- siteName: "KittyGuardedZone",
- faviconAssetId: "88d5e2ff-b8f2-4899-aaf8-dde4ade6da10",
- code: "<script>console.log('KittyGuardedZone')</script>\n",
-};
+export const customCode = "<script>console.log('KittyGuardedZone')</script>";
diff --git a/fixtures/webstudio-remix-vercel/app/__generated__/_index.tsx b/fixtures/webstudio-remix-vercel/app/__generated__/_index.tsx
index c15daab46a..5a3a15e0ad 100644
--- a/fixtures/webstudio-remix-vercel/app/__generated__/_index.tsx
+++ b/fixtures/webstudio-remix-vercel/app/__generated__/_index.tsx
@@ -16,6 +16,8 @@ import {
Text as Text,
} from "@webstudio-is/sdk-components-react";
+export const siteName = "KittyGuardedZone";
+
export const favIconAsset: ImageAsset | undefined = {
id: "88d5e2ff-b8f2-4899-aaf8-dde4ade6da10",
name: "DALL_E_2023-10-30_12.39.46_-_Photo_logo_with_a_bold_cat_silhouette_centered_on_a_contrasting_background_designed_for_clarity_at_small_32x32_favicon_resolution_00h6cEA8u2pJRvVJv7hRe.png",
diff --git a/fixtures/webstudio-remix-vercel/app/routes/[_route_with_symbols_]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[_route_with_symbols_]._index.tsx
index b8f9d407f7..41e5f96f42 100644
--- a/fixtures/webstudio-remix-vercel/app/routes/[_route_with_symbols_]._index.tsx
+++ b/fixtures/webstudio-remix-vercel/app/routes/[_route_with_symbols_]._index.tsx
@@ -14,6 +14,7 @@ import { ReactSdkContext } from "@webstudio-is/react-sdk";
import { n8nHandler, getFormId } from "@webstudio-is/form-handlers";
import {
Page,
+ siteName,
favIconAsset,
socialImageAsset,
pageFontAssets,
@@ -26,7 +27,6 @@ import {
getRemixParams,
projectId,
user,
- projectMeta,
} from "../__generated__/[_route_with_symbols_]._index.server";
import css from "../__generated__/index.css?url";
@@ -70,7 +70,6 @@ export const loader = async (arg: LoaderFunctionArgs) => {
system,
resources,
pageMeta,
- projectMeta,
},
// No way for current information to change, so add cache for 10 minutes
// In case of CRM Data, this should be set to 0
@@ -96,7 +95,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
if (data === undefined) {
return metas;
}
- const { pageMeta, projectMeta } = data;
+ const { pageMeta } = data;
if (data.url) {
metas.push({
@@ -118,16 +117,16 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
const origin = `https://${data.host}`;
- if (projectMeta?.siteName) {
+ if (siteName) {
metas.push({
property: "og:site_name",
- content: projectMeta.siteName,
+ content: siteName,
});
metas.push({
"script:ld+json": {
"@context": "https://schema.org",
"@type": "WebSite",
- name: projectMeta.siteName,
+ name: siteName,
url: origin,
},
});
diff --git a/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx
index 90e66ffa50..41410de1cf 100644
--- a/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx
+++ b/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx
@@ -14,6 +14,7 @@ import { ReactSdkContext } from "@webstudio-is/react-sdk";
import { n8nHandler, getFormId } from "@webstudio-is/form-handlers";
import {
Page,
+ siteName,
favIconAsset,
socialImageAsset,
pageFontAssets,
@@ -26,7 +27,6 @@ import {
getRemixParams,
projectId,
user,
- projectMeta,
} from "../__generated__/[form]._index.server";
import css from "../__generated__/index.css?url";
@@ -70,7 +70,6 @@ export const loader = async (arg: LoaderFunctionArgs) => {
system,
resources,
pageMeta,
- projectMeta,
},
// No way for current information to change, so add cache for 10 minutes
// In case of CRM Data, this should be set to 0
@@ -96,7 +95,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
if (data === undefined) {
return metas;
}
- const { pageMeta, projectMeta } = data;
+ const { pageMeta } = data;
if (data.url) {
metas.push({
@@ -118,16 +117,16 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
const origin = `https://${data.host}`;
- if (projectMeta?.siteName) {
+ if (siteName) {
metas.push({
property: "og:site_name",
- content: projectMeta.siteName,
+ content: siteName,
});
metas.push({
"script:ld+json": {
"@context": "https://schema.org",
"@type": "WebSite",
- name: projectMeta.siteName,
+ name: siteName,
url: origin,
},
});
diff --git a/fixtures/webstudio-remix-vercel/app/routes/[heading-with-id]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[heading-with-id]._index.tsx
index 9cf54c3eea..af30d5a775 100644
--- a/fixtures/webstudio-remix-vercel/app/routes/[heading-with-id]._index.tsx
+++ b/fixtures/webstudio-remix-vercel/app/routes/[heading-with-id]._index.tsx
@@ -14,6 +14,7 @@ import { ReactSdkContext } from "@webstudio-is/react-sdk";
import { n8nHandler, getFormId } from "@webstudio-is/form-handlers";
import {
Page,
+ siteName,
favIconAsset,
socialImageAsset,
pageFontAssets,
@@ -26,7 +27,6 @@ import {
getRemixParams,
projectId,
user,
- projectMeta,
} from "../__generated__/[heading-with-id]._index.server";
import css from "../__generated__/index.css?url";
@@ -70,7 +70,6 @@ export const loader = async (arg: LoaderFunctionArgs) => {
system,
resources,
pageMeta,
- projectMeta,
},
// No way for current information to change, so add cache for 10 minutes
// In case of CRM Data, this should be set to 0
@@ -96,7 +95,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
if (data === undefined) {
return metas;
}
- const { pageMeta, projectMeta } = data;
+ const { pageMeta } = data;
if (data.url) {
metas.push({
@@ -118,16 +117,16 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
const origin = `https://${data.host}`;
- if (projectMeta?.siteName) {
+ if (siteName) {
metas.push({
property: "og:site_name",
- content: projectMeta.siteName,
+ content: siteName,
});
metas.push({
"script:ld+json": {
"@context": "https://schema.org",
"@type": "WebSite",
- name: projectMeta.siteName,
+ name: siteName,
url: origin,
},
});
diff --git a/fixtures/webstudio-remix-vercel/app/routes/[nested].[nested-page]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[nested].[nested-page]._index.tsx
index f5cbad9c49..baa48c53f0 100644
--- a/fixtures/webstudio-remix-vercel/app/routes/[nested].[nested-page]._index.tsx
+++ b/fixtures/webstudio-remix-vercel/app/routes/[nested].[nested-page]._index.tsx
@@ -14,6 +14,7 @@ import { ReactSdkContext } from "@webstudio-is/react-sdk";
import { n8nHandler, getFormId } from "@webstudio-is/form-handlers";
import {
Page,
+ siteName,
favIconAsset,
socialImageAsset,
pageFontAssets,
@@ -26,7 +27,6 @@ import {
getRemixParams,
projectId,
user,
- projectMeta,
} from "../__generated__/[nested].[nested-page]._index.server";
import css from "../__generated__/index.css?url";
@@ -70,7 +70,6 @@ export const loader = async (arg: LoaderFunctionArgs) => {
system,
resources,
pageMeta,
- projectMeta,
},
// No way for current information to change, so add cache for 10 minutes
// In case of CRM Data, this should be set to 0
@@ -96,7 +95,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
if (data === undefined) {
return metas;
}
- const { pageMeta, projectMeta } = data;
+ const { pageMeta } = data;
if (data.url) {
metas.push({
@@ -118,16 +117,16 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
const origin = `https://${data.host}`;
- if (projectMeta?.siteName) {
+ if (siteName) {
metas.push({
property: "og:site_name",
- content: projectMeta.siteName,
+ content: siteName,
});
metas.push({
"script:ld+json": {
"@context": "https://schema.org",
"@type": "WebSite",
- name: projectMeta.siteName,
+ name: siteName,
url: origin,
},
});
diff --git a/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx
index d3ab4369bb..a39cb5d5c3 100644
--- a/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx
+++ b/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx
@@ -14,6 +14,7 @@ import { ReactSdkContext } from "@webstudio-is/react-sdk";
import { n8nHandler, getFormId } from "@webstudio-is/form-handlers";
import {
Page,
+ siteName,
favIconAsset,
socialImageAsset,
pageFontAssets,
@@ -26,7 +27,6 @@ import {
getRemixParams,
projectId,
user,
- projectMeta,
} from "../__generated__/[radix]._index.server";
import css from "../__generated__/index.css?url";
@@ -70,7 +70,6 @@ export const loader = async (arg: LoaderFunctionArgs) => {
system,
resources,
pageMeta,
- projectMeta,
},
// No way for current information to change, so add cache for 10 minutes
// In case of CRM Data, this should be set to 0
@@ -96,7 +95,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
if (data === undefined) {
return metas;
}
- const { pageMeta, projectMeta } = data;
+ const { pageMeta } = data;
if (data.url) {
metas.push({
@@ -118,16 +117,16 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
const origin = `https://${data.host}`;
- if (projectMeta?.siteName) {
+ if (siteName) {
metas.push({
property: "og:site_name",
- content: projectMeta.siteName,
+ content: siteName,
});
metas.push({
"script:ld+json": {
"@context": "https://schema.org",
"@type": "WebSite",
- name: projectMeta.siteName,
+ name: siteName,
url: origin,
},
});
diff --git a/fixtures/webstudio-remix-vercel/app/routes/[resources]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[resources]._index.tsx
index d0ade4ceb4..6628ee354d 100644
--- a/fixtures/webstudio-remix-vercel/app/routes/[resources]._index.tsx
+++ b/fixtures/webstudio-remix-vercel/app/routes/[resources]._index.tsx
@@ -14,6 +14,7 @@ import { ReactSdkContext } from "@webstudio-is/react-sdk";
import { n8nHandler, getFormId } from "@webstudio-is/form-handlers";
import {
Page,
+ siteName,
favIconAsset,
socialImageAsset,
pageFontAssets,
@@ -26,7 +27,6 @@ import {
getRemixParams,
projectId,
user,
- projectMeta,
} from "../__generated__/[resources]._index.server";
import css from "../__generated__/index.css?url";
@@ -70,7 +70,6 @@ export const loader = async (arg: LoaderFunctionArgs) => {
system,
resources,
pageMeta,
- projectMeta,
},
// No way for current information to change, so add cache for 10 minutes
// In case of CRM Data, this should be set to 0
@@ -96,7 +95,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
if (data === undefined) {
return metas;
}
- const { pageMeta, projectMeta } = data;
+ const { pageMeta } = data;
if (data.url) {
metas.push({
@@ -118,16 +117,16 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
const origin = `https://${data.host}`;
- if (projectMeta?.siteName) {
+ if (siteName) {
metas.push({
property: "og:site_name",
- content: projectMeta.siteName,
+ content: siteName,
});
metas.push({
"script:ld+json": {
"@context": "https://schema.org",
"@type": "WebSite",
- name: projectMeta.siteName,
+ name: siteName,
url: origin,
},
});
diff --git a/fixtures/webstudio-remix-vercel/app/routes/_index.tsx b/fixtures/webstudio-remix-vercel/app/routes/_index.tsx
index 2725464e6b..7e3ddebbeb 100644
--- a/fixtures/webstudio-remix-vercel/app/routes/_index.tsx
+++ b/fixtures/webstudio-remix-vercel/app/routes/_index.tsx
@@ -14,6 +14,7 @@ import { ReactSdkContext } from "@webstudio-is/react-sdk";
import { n8nHandler, getFormId } from "@webstudio-is/form-handlers";
import {
Page,
+ siteName,
favIconAsset,
socialImageAsset,
pageFontAssets,
@@ -26,7 +27,6 @@ import {
getRemixParams,
projectId,
user,
- projectMeta,
} from "../__generated__/_index.server";
import css from "../__generated__/index.css?url";
@@ -70,7 +70,6 @@ export const loader = async (arg: LoaderFunctionArgs) => {
system,
resources,
pageMeta,
- projectMeta,
},
// No way for current information to change, so add cache for 10 minutes
// In case of CRM Data, this should be set to 0
@@ -96,7 +95,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
if (data === undefined) {
return metas;
}
- const { pageMeta, projectMeta } = data;
+ const { pageMeta } = data;
if (data.url) {
metas.push({
@@ -118,16 +117,16 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
const origin = `https://${data.host}`;
- if (projectMeta?.siteName) {
+ if (siteName) {
metas.push({
property: "og:site_name",
- content: projectMeta.siteName,
+ content: siteName,
});
metas.push({
"script:ld+json": {
"@context": "https://schema.org",
"@type": "WebSite",
- name: projectMeta.siteName,
+ name: siteName,
url: origin,
},
});
diff --git a/packages/cli/__generated__/_index.server.tsx b/packages/cli/__generated__/_index.server.tsx
index c24e357f37..1dc40fd9b8 100644
--- a/packages/cli/__generated__/_index.server.tsx
+++ b/packages/cli/__generated__/_index.server.tsx
@@ -1,7 +1,7 @@
/**
* The only intent of this file is to support typings inside ../templates/route-template for easier development.
**/
-import type { ProjectMeta, PageMeta, System } from "@webstudio-is/sdk";
+import type { PageMeta, System } from "@webstudio-is/sdk";
export const loadResources = async (_props: { system: System }) => {
const [] = await Promise.all([]);
@@ -34,8 +34,4 @@ export const user: { email: string | null } | undefined = {
email: "email@domain",
};
-export const projectMeta: undefined | ProjectMeta = {
- siteName: "",
- faviconAssetId: "",
- code: "",
-};
+export const customCode = "";
diff --git a/packages/cli/__generated__/_index.tsx b/packages/cli/__generated__/_index.tsx
index 0558216181..0e07c4732f 100644
--- a/packages/cli/__generated__/_index.tsx
+++ b/packages/cli/__generated__/_index.tsx
@@ -4,6 +4,8 @@
import type { FontAsset, ImageAsset } from "@webstudio-is/sdk";
+export const siteName = "";
+
export const favIconAsset: ImageAsset | undefined = undefined;
export const socialImageAsset: ImageAsset | undefined = undefined;
diff --git a/packages/cli/src/prebuild.ts b/packages/cli/src/prebuild.ts
index 0e9f76d34b..a0fe3be5cd 100644
--- a/packages/cli/src/prebuild.ts
+++ b/packages/cli/src/prebuild.ts
@@ -592,6 +592,8 @@ import type { FontAsset, ImageAsset } from "@webstudio-is/sdk";
import { useResource } from "@webstudio-is/react-sdk";
${componentImports}
+export const siteName = ${JSON.stringify(projectMeta?.siteName)};
+
export const favIconAsset: ImageAsset | undefined =
${JSON.stringify(favIconAsset)};
@@ -614,7 +616,7 @@ export { Page }
const serverExports = `/* eslint-disable */
/* This is a auto generated file for building the project */ \n
-import type { ProjectMeta, PageMeta } from "@webstudio-is/sdk";
+import type { PageMeta } from "@webstudio-is/sdk";
${generateResourcesLoader({
scope,
page: pageData.page,
@@ -637,8 +639,7 @@ export const projectId = "${siteData.build.projectId}";
export const user: { email: string | null } | undefined =
${JSON.stringify(siteData.user)};
-export const projectMeta: ProjectMeta =
- ${JSON.stringify(projectMeta)};
+export const customCode = ${JSON.stringify(projectMeta?.code?.trim() ?? "")};
`;
/*
diff --git a/packages/cli/templates/defaults/app/routes/template.tsx b/packages/cli/templates/defaults/app/routes/template.tsx
index f1b48eb193..0dce0c2ea9 100644
--- a/packages/cli/templates/defaults/app/routes/template.tsx
+++ b/packages/cli/templates/defaults/app/routes/template.tsx
@@ -14,6 +14,7 @@ import { ReactSdkContext } from "@webstudio-is/react-sdk";
import { n8nHandler, getFormId } from "@webstudio-is/form-handlers";
import {
Page,
+ siteName,
favIconAsset,
socialImageAsset,
pageFontAssets,
@@ -26,7 +27,6 @@ import {
getRemixParams,
projectId,
user,
- projectMeta,
} from "../../../../__generated__/_index.server";
import css from "../__generated__/index.css?url";
@@ -70,7 +70,6 @@ export const loader = async (arg: LoaderFunctionArgs) => {
system,
resources,
pageMeta,
- projectMeta,
},
// No way for current information to change, so add cache for 10 minutes
// In case of CRM Data, this should be set to 0
@@ -96,7 +95,7 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
if (data === undefined) {
return metas;
}
- const { pageMeta, projectMeta } = data;
+ const { pageMeta } = data;
if (data.url) {
metas.push({
@@ -118,16 +117,16 @@ export const meta: MetaFunction<typeof loader> = ({ data }) => {
const origin = `https://${data.host}`;
- if (projectMeta?.siteName) {
+ if (siteName) {
metas.push({
property: "og:site_name",
- content: projectMeta.siteName,
+ content: siteName,
});
metas.push({
"script:ld+json": {
"@context": "https://schema.org",
"@type": "WebSite",
- name: projectMeta.siteName,
+ name: siteName,
url: origin,
},
});