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.

Enable CLI Usage in CI Environment (#2321)

Ivan Starkovb538b74ef2f5
diff --git a/apps/builder/package.json b/apps/builder/package.json
index d1ee93461d..a8c5c0f56b 100644
--- a/apps/builder/package.json
+++ b/apps/builder/package.json
@@ -38,29 +38,29 @@
"@sentry/types": "7.47.0",
"@trpc/server": "^10.38.1",
"@vercel/remix": "^1.19.2",
- "@webstudio-is/asset-uploader": "workspace:^",
- "@webstudio-is/authorization-token": "workspace:^",
- "@webstudio-is/css-data": "workspace:^",
- "@webstudio-is/css-engine": "workspace:^",
- "@webstudio-is/css-vars": "workspace:^",
- "@webstudio-is/dashboard": "workspace:^",
- "@webstudio-is/design-system": "workspace:^",
- "@webstudio-is/domain": "workspace:^",
- "@webstudio-is/error-utils": "workspace:^",
- "@webstudio-is/feature-flags": "workspace:^",
- "@webstudio-is/fonts": "workspace:^",
- "@webstudio-is/http-client": "workspace:^",
- "@webstudio-is/icons": "workspace:^",
- "@webstudio-is/image": "workspace:^",
- "@webstudio-is/prisma-client": "workspace:^",
- "@webstudio-is/project": "workspace:^",
- "@webstudio-is/project-build": "workspace:^",
- "@webstudio-is/react-sdk": "workspace:^",
- "@webstudio-is/sdk": "workspace:^",
- "@webstudio-is/sdk-components-react": "workspace:^",
- "@webstudio-is/sdk-components-react-radix": "workspace:^",
- "@webstudio-is/sdk-components-react-remix": "workspace:^",
- "@webstudio-is/trpc-interface": "workspace:^",
+ "@webstudio-is/asset-uploader": "workspace:*",
+ "@webstudio-is/authorization-token": "workspace:*",
+ "@webstudio-is/css-data": "workspace:*",
+ "@webstudio-is/css-engine": "workspace:*",
+ "@webstudio-is/css-vars": "workspace:*",
+ "@webstudio-is/dashboard": "workspace:*",
+ "@webstudio-is/design-system": "workspace:*",
+ "@webstudio-is/domain": "workspace:*",
+ "@webstudio-is/error-utils": "workspace:*",
+ "@webstudio-is/feature-flags": "workspace:*",
+ "@webstudio-is/fonts": "workspace:*",
+ "@webstudio-is/http-client": "workspace:*",
+ "@webstudio-is/icons": "workspace:*",
+ "@webstudio-is/image": "workspace:*",
+ "@webstudio-is/prisma-client": "workspace:*",
+ "@webstudio-is/project": "workspace:*",
+ "@webstudio-is/project-build": "workspace:*",
+ "@webstudio-is/react-sdk": "workspace:*",
+ "@webstudio-is/sdk": "workspace:*",
+ "@webstudio-is/sdk-components-react": "workspace:*",
+ "@webstudio-is/sdk-components-react-radix": "workspace:*",
+ "@webstudio-is/sdk-components-react-remix": "workspace:*",
+ "@webstudio-is/trpc-interface": "workspace:*",
"colord": "^2.9.3",
"date-fns": "^2.30.0",
"debug": "^4.3.4",
@@ -113,9 +113,9 @@
"@types/react-color": "^3.0.6",
"@types/react-dom": "^18.2.7",
"@types/uuid": "^8.3.4",
- "@webstudio-is/jest-config": "workspace:^",
- "@webstudio-is/storybook-config": "workspace:^",
- "@webstudio-is/tsconfig": "workspace:^",
+ "@webstudio-is/jest-config": "workspace:*",
+ "@webstudio-is/storybook-config": "workspace:*",
+ "@webstudio-is/tsconfig": "workspace:*",
"dotenv": "^16.3.1",
"html-tags": "^3.3.1",
"jest": "^29.6.4",
diff --git a/fixtures/webstudio-custom-template/.vercelignore b/fixtures/webstudio-custom-template/.vercelignore
new file mode 100644
index 0000000000..6a0e67a2fb
--- /dev/null
+++ b/fixtures/webstudio-custom-template/.vercelignore
@@ -0,0 +1,8 @@
+node_modules
+
+.cache
+.env
+.vercel
+.webstudio
+build
+public/build
diff --git a/fixtures/webstudio-custom-template/.webstudio/config.json b/fixtures/webstudio-custom-template/.webstudio/config.json
new file mode 100644
index 0000000000..6d36358e5c
--- /dev/null
+++ b/fixtures/webstudio-custom-template/.webstudio/config.json
@@ -0,0 +1,3 @@
+{
+ "projectId": "0d856812-61d8-4014-a20a-82e01c0eb8ee"
+}
diff --git a/fixtures/webstudio-custom-template/.webstudio/data.json b/fixtures/webstudio-custom-template/.webstudio/data.json
new file mode 100644
index 0000000000..80df7d87f2
--- /dev/null
+++ b/fixtures/webstudio-custom-template/.webstudio/data.json
@@ -0,0 +1,144 @@
+{
+ "build": {
+ "id": "d1e8a55b-972b-46f9-bcfd-a8b67c4846f6",
+ "projectId": "0d856812-61d8-4014-a20a-82e01c0eb8ee",
+ "version": 1,
+ "createdAt": "2023-09-17T07:56:30.814Z",
+ "pages": {
+ "homePage": {
+ "id": "nfzls_SkTc9jKYyxcZ8Lw",
+ "name": "Home",
+ "title": "Home",
+ "meta": {},
+ "rootInstanceId": "ibXgMoi9_ipHx1gVrvii0",
+ "path": ""
+ },
+ "pages": []
+ },
+ "breakpoints": [
+ [
+ "mIDIDBHsdlix3RVZAVmv7",
+ {
+ "id": "mIDIDBHsdlix3RVZAVmv7",
+ "label": "Base"
+ }
+ ],
+ [
+ "i96QYeYTHXPxfB_HOc1Yy",
+ {
+ "id": "i96QYeYTHXPxfB_HOc1Yy",
+ "label": "Tablet",
+ "maxWidth": 991
+ }
+ ],
+ [
+ "Khs__QBlUTJw8v4GU1-6R",
+ {
+ "id": "Khs__QBlUTJw8v4GU1-6R",
+ "label": "Mobile landscape",
+ "maxWidth": 767
+ }
+ ],
+ [
+ "RX7bPMPNIiqEdG__-RcTL",
+ {
+ "id": "RX7bPMPNIiqEdG__-RcTL",
+ "label": "Mobile portrait",
+ "maxWidth": 479
+ }
+ ]
+ ],
+ "styles": [
+ [
+ "NfeivFkbA_acBLVg7dn9P:mIDIDBHsdlix3RVZAVmv7:fontSize:",
+ {
+ "styleSourceId": "NfeivFkbA_acBLVg7dn9P",
+ "breakpointId": "mIDIDBHsdlix3RVZAVmv7",
+ "property": "fontSize",
+ "value": {
+ "type": "unit",
+ "unit": "em",
+ "value": 4
+ }
+ }
+ ]
+ ],
+ "styleSources": [
+ [
+ "NfeivFkbA_acBLVg7dn9P",
+ {
+ "type": "local",
+ "id": "NfeivFkbA_acBLVg7dn9P"
+ }
+ ]
+ ],
+ "styleSourceSelections": [
+ [
+ "7pwqBSgrfuuOfk1JblWcL",
+ {
+ "instanceId": "7pwqBSgrfuuOfk1JblWcL",
+ "values": ["NfeivFkbA_acBLVg7dn9P"]
+ }
+ ]
+ ],
+ "props": [],
+ "dataSources": [],
+ "instances": [
+ [
+ "ibXgMoi9_ipHx1gVrvii0",
+ {
+ "type": "instance",
+ "id": "ibXgMoi9_ipHx1gVrvii0",
+ "component": "Body",
+ "children": [
+ {
+ "type": "id",
+ "value": "7pwqBSgrfuuOfk1JblWcL"
+ }
+ ]
+ }
+ ],
+ [
+ "7pwqBSgrfuuOfk1JblWcL",
+ {
+ "type": "instance",
+ "id": "7pwqBSgrfuuOfk1JblWcL",
+ "component": "Heading",
+ "children": [
+ {
+ "type": "text",
+ "value": "DO NOT TOUCH THIS PROJECT, IT'S USED FOR FIXTURES"
+ }
+ ]
+ }
+ ]
+ ],
+ "deployment": {
+ "domains": [],
+ "projectDomain": "webstudio-custom-template-cochj"
+ }
+ },
+ "page": {
+ "id": "nfzls_SkTc9jKYyxcZ8Lw",
+ "name": "Home",
+ "title": "Home",
+ "meta": {},
+ "rootInstanceId": "ibXgMoi9_ipHx1gVrvii0",
+ "path": ""
+ },
+ "pages": [
+ {
+ "id": "nfzls_SkTc9jKYyxcZ8Lw",
+ "name": "Home",
+ "title": "Home",
+ "meta": {},
+ "rootInstanceId": "ibXgMoi9_ipHx1gVrvii0",
+ "path": ""
+ }
+ ],
+ "assets": [],
+ "user": {
+ "email": "[email protected]"
+ },
+ "projectDomain": "webstudio-custom-template-cochj"
+}
diff --git a/fixtures/webstudio-custom-template/README.md b/fixtures/webstudio-custom-template/README.md
new file mode 100644
index 0000000000..e1756bab81
--- /dev/null
+++ b/fixtures/webstudio-custom-template/README.md
@@ -0,0 +1,21 @@
+# Fixture to test/play with webstudio-cli
+
+## How to develop
+
+```bash
+# Terminal 1
+cd packages/webstudio-cli
+pnpm dev
+```
+
+```bash
+# Terminal 2
+pnpm webstudio-cli link
+# add following link https://webstudio-builder-git-main-webstudio-is.vercel.app/builder/0d856812-61d8-4014-a20a-82e01c0eb8ee?authToken=d225fafb-4f20-4340-9359-c21df7c49a3f&mode=preview
+
+pnpm webstudio-cli sync && pnpm prettier --write ./.webstudio/
+# data.json generated
+
+pnpm webstudio-cli build --preview --template ./custom-template && pnpm prettier --write ./app/ ./package.json
+# exec `pnpm run dev` to see result
+```
diff --git a/fixtures/webstudio-custom-template/app/__generated__/_index.tsx b/fixtures/webstudio-custom-template/app/__generated__/_index.tsx
new file mode 100644
index 0000000000..e8728b0e0b
--- /dev/null
+++ b/fixtures/webstudio-custom-template/app/__generated__/_index.tsx
@@ -0,0 +1,93 @@
+/* eslint-disable */
+/* This is a auto generated file for building the project */
+
+import type { PageData } from "~/routes/_index";
+import type { Components } from "@webstudio-is/react-sdk";
+import type { Asset } from "@webstudio-is/sdk";
+import {
+ Body as Body,
+ Heading as Heading,
+} from "@webstudio-is/sdk-components-react";
+
+export const components = new Map(
+ Object.entries({ Body: Body, Heading: Heading })
+) as Components;
+export const fontAssets: Asset[] = [];
+export const pageData: PageData = {
+ build: {
+ props: [],
+ instances: [
+ [
+ "ibXgMoi9_ipHx1gVrvii0",
+ {
+ type: "instance",
+ id: "ibXgMoi9_ipHx1gVrvii0",
+ component: "Body",
+ children: [{ type: "id", value: "7pwqBSgrfuuOfk1JblWcL" }],
+ },
+ ],
+ [
+ "7pwqBSgrfuuOfk1JblWcL",
+ {
+ type: "instance",
+ id: "7pwqBSgrfuuOfk1JblWcL",
+ component: "Heading",
+ children: [
+ {
+ type: "text",
+ value: "DO NOT TOUCH THIS PROJECT, IT'S USED FOR FIXTURES",
+ },
+ ],
+ },
+ ],
+ ],
+ dataSources: [],
+ },
+ pages: [
+ {
+ id: "nfzls_SkTc9jKYyxcZ8Lw",
+ name: "Home",
+ title: "Home",
+ meta: {},
+ rootInstanceId: "ibXgMoi9_ipHx1gVrvii0",
+ path: "",
+ },
+ ],
+ page: {
+ id: "nfzls_SkTc9jKYyxcZ8Lw",
+ name: "Home",
+ title: "Home",
+ meta: {},
+ rootInstanceId: "ibXgMoi9_ipHx1gVrvii0",
+ path: "",
+ },
+ assets: [],
+};
+export const user: { email: string | null } | undefined = {
+ email: "[email protected]",
+};
+export const projectId = "0d856812-61d8-4014-a20a-82e01c0eb8ee";
+
+/* eslint-disable */
+
+const indexesWithinAncestors = new Map<string, number>([]);
+
+const getDataSourcesLogic = (
+ _getVariable: (id: string) => unknown,
+ _setVariable: (id: string, value: unknown) => void
+) => {
+ let _output = new Map();
+ return _output;
+};
+
+export const formsProperties = new Map<
+ string,
+ { method?: string; action?: string }
+>([]);
+
+export const utils = {
+ indexesWithinAncestors,
+ getDataSourcesLogic,
+};
+
+/* eslint-enable */
diff --git a/fixtures/webstudio-custom-template/app/__generated__/index.css b/fixtures/webstudio-custom-template/app/__generated__/index.css
new file mode 100644
index 0000000000..c9f0f495fa
--- /dev/null
+++ b/fixtures/webstudio-custom-template/app/__generated__/index.css
@@ -0,0 +1,992 @@
+html {
+ margin: 0;
+ display: grid;
+ min-height: 100%;
+}
+@media all {
+ blockquote:where([data-ws-component="Blockquote"]) {
+ margin-top: 0;
+ margin-right: 0;
+ margin-bottom: 10px;
+ margin-left: 0;
+ padding-top: 10px;
+ padding-bottom: 10px;
+ padding-left: 20px;
+ padding-right: 20px;
+ border-left-width: 5px;
+ border-left-style: solid;
+ border-left-color: rgba(226, 226, 226, 1);
+ }
+ body:where([data-ws-component="Body"]) {
+ margin-top: 0;
+ margin-right: 0;
+ margin-bottom: 0;
+ margin-left: 0;
+ font-family: Arial, Roboto, sans-serif;
+ font-size: 16px;
+ line-height: 1.2;
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ }
+ b:where([data-ws-component="Bold"]) {
+ font-weight: 700;
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ }
+ div:where([data-ws-component="Box"]) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ address:where([data-ws-component="Box"]) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ article:where([data-ws-component="Box"]) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ aside:where([data-ws-component="Box"]) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ figure:where([data-ws-component="Box"]) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ footer:where([data-ws-component="Box"]) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ header:where([data-ws-component="Box"]) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ main:where([data-ws-component="Box"]) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ nav:where([data-ws-component="Box"]) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ section:where([data-ws-component="Box"]) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ button:where([data-ws-component="Button"]) {
+ font-family: inherit;
+ font-size: 100%;
+ line-height: 1.15;
+ margin-top: 0;
+ margin-right: 0;
+ margin-bottom: 0;
+ margin-left: 0;
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ text-transform: none;
+ }
+ input:where([data-ws-component="Checkbox"]) {
+ font-family: inherit;
+ font-size: 100%;
+ line-height: 1.15;
+ margin-top: 0;
+ margin-right: 0.5em;
+ margin-bottom: 0;
+ margin-left: 0;
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ }
+ code:where([data-ws-component="CodeText"]) {
+ font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono",
+ Menlo, monospace;
+ font-size: 1em;
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ display: block;
+ white-space: pre-wrap;
+ padding-left: 0.2em;
+ padding-right: 0.2em;
+ background-color: rgba(238, 238, 238, 1);
+ }
+ form:where([data-ws-component="Form"]) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ min-height: 20px;
+ }
+ h1:where([data-ws-component="Heading"]) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ h2:where([data-ws-component="Heading"]) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ h3:where([data-ws-component="Heading"]) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ h4:where([data-ws-component="Heading"]) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ h5:where([data-ws-component="Heading"]) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ h6:where([data-ws-component="Heading"]) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ img:where([data-ws-component="Image"]) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ max-width: 100%;
+ display: block;
+ }
+ input:where([data-ws-component="Input"]) {
+ font-family: inherit;
+ font-size: 100%;
+ line-height: 1.15;
+ margin-top: 0;
+ margin-right: 0;
+ margin-bottom: 0;
+ margin-left: 0;
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ display: block;
+ }
+ i:where([data-ws-component="Italic"]) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ font-style: italic;
+ }
+ label:where([data-ws-component="Label"]) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ display: block;
+ }
+ a:where([data-ws-component="Link"]) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ min-height: 1em;
+ display: inline-block;
+ }
+ ol:where([data-ws-component="List"]) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ margin-top: 0;
+ margin-bottom: 10px;
+ padding-left: 40px;
+ }
+ ul:where([data-ws-component="List"]) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ margin-top: 0;
+ margin-bottom: 10px;
+ padding-left: 40px;
+ }
+ li:where([data-ws-component="ListItem"]) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ p:where([data-ws-component="Paragraph"]) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ input:where([data-ws-component="RadioButton"]) {
+ font-family: inherit;
+ font-size: 100%;
+ line-height: 1.15;
+ margin-top: 0;
+ margin-right: 0.5em;
+ margin-bottom: 0;
+ margin-left: 0;
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ }
+ a:where([data-ws-component="RichTextLink"]) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ min-height: 1em;
+ display: inline-block;
+ }
+ hr:where([data-ws-component="Separator"]) {
+ height: 1px;
+ color: inherit;
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ background-color: gray;
+ border-top-style: none;
+ border-right-style: none;
+ border-left-style: none;
+ border-bottom-style: none;
+ }
+ span:where([data-ws-component="Span"]) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ sub:where([data-ws-component="Subscript"]) {
+ font-size: 75%;
+ line-height: 0;
+ position: relative;
+ vertical-align: baseline;
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ bottom: -0.25em;
+ }
+ sup:where([data-ws-component="Superscript"]) {
+ font-size: 75%;
+ line-height: 0;
+ position: relative;
+ vertical-align: baseline;
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ top: -0.5em;
+ }
+ div:where([data-ws-component="Text"]) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ min-height: 1em;
+ }
+ textarea:where([data-ws-component="Textarea"]) {
+ font-family: inherit;
+ font-size: 100%;
+ line-height: 1.15;
+ margin-top: 0;
+ margin-right: 0;
+ margin-bottom: 0;
+ margin-left: 0;
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ resize: none;
+ display: block;
+ }
+ div:where([data-ws-component="Vimeo"]) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ button:where([data-ws-component="VimeoPlayButton"]) {
+ font-family: inherit;
+ font-size: 100%;
+ line-height: 1.15;
+ margin-top: 0;
+ margin-right: 0;
+ margin-bottom: 0;
+ margin-left: 0;
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ text-transform: none;
+ }
+ img:where([data-ws-component="VimeoPreviewImage"]) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ max-width: 100%;
+ display: block;
+ }
+ div:where([data-ws-component="VimeoSpinner"]) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ div:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:Accordion"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ div:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:AccordionContent"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ h3:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:AccordionHeader"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ margin-top: 0px;
+ margin-bottom: 0px;
+ }
+ div:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:AccordionItem"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ button:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:AccordionTrigger"]
+ ) {
+ font-family: inherit;
+ font-size: 100%;
+ line-height: 1.15;
+ margin-top: 0;
+ margin-right: 0;
+ margin-bottom: 0;
+ margin-left: 0;
+ box-sizing: border-box;
+ border-top-width: 0px;
+ border-right-width: 0px;
+ border-bottom-width: 0px;
+ border-left-width: 0px;
+ text-transform: none;
+ background-color: transparent;
+ background-image: none;
+ border-top-style: solid;
+ border-right-style: solid;
+ border-bottom-style: solid;
+ border-left-style: solid;
+ border-top-color: rgba(226, 232, 240, 1);
+ border-right-color: rgba(226, 232, 240, 1);
+ border-bottom-color: rgba(226, 232, 240, 1);
+ border-left-color: rgba(226, 232, 240, 1);
+ padding-left: 0px;
+ padding-right: 0px;
+ padding-top: 0px;
+ padding-bottom: 0px;
+ }
+ button:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:Checkbox"]
+ ) {
+ font-family: inherit;
+ font-size: 100%;
+ line-height: 1.15;
+ margin-top: 0;
+ margin-right: 0;
+ margin-bottom: 0;
+ margin-left: 0;
+ box-sizing: border-box;
+ border-top-width: 0px;
+ border-right-width: 0px;
+ border-bottom-width: 0px;
+ border-left-width: 0px;
+ text-transform: none;
+ background-color: transparent;
+ background-image: none;
+ border-top-style: solid;
+ border-right-style: solid;
+ border-bottom-style: solid;
+ border-left-style: solid;
+ border-top-color: rgba(226, 232, 240, 1);
+ border-right-color: rgba(226, 232, 240, 1);
+ border-bottom-color: rgba(226, 232, 240, 1);
+ border-left-color: rgba(226, 232, 240, 1);
+ padding-left: 0px;
+ padding-right: 0px;
+ padding-top: 0px;
+ padding-bottom: 0px;
+ }
+ span:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:CheckboxIndicator"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ div:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:Collapsible"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ div:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:CollapsibleContent"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ button:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:DialogClose"]
+ ) {
+ background-color: transparent;
+ background-image: none;
+ border-top-style: solid;
+ border-right-style: solid;
+ border-bottom-style: solid;
+ border-left-style: solid;
+ border-top-color: rgba(226, 232, 240, 1);
+ border-right-color: rgba(226, 232, 240, 1);
+ border-bottom-color: rgba(226, 232, 240, 1);
+ border-left-color: rgba(226, 232, 240, 1);
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ padding-left: 0px;
+ padding-right: 0px;
+ padding-top: 0px;
+ padding-bottom: 0px;
+ font-family: inherit;
+ font-size: 100%;
+ line-height: 1.15;
+ margin-top: 0;
+ margin-right: 0;
+ margin-bottom: 0;
+ margin-left: 0;
+ box-sizing: border-box;
+ text-transform: none;
+ }
+ div:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:DialogContent"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ p:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:DialogDescription"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ div:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:DialogOverlay"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ h2:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:DialogTitle"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ label:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:Label"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ div:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:NavigationMenu"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ div:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:NavigationMenuContent"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ div:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:NavigationMenuItem"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ div:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:NavigationMenuLink"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ div:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:NavigationMenuList"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ div:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:NavigationMenuTrigger"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ div:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:NavigationMenuViewport"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ div:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:PopoverContent"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ div:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:RadioGroup"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ span:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:RadioGroupIndicator"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ button:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:RadioGroupItem"]
+ ) {
+ font-family: inherit;
+ font-size: 100%;
+ line-height: 1.15;
+ margin-top: 0;
+ margin-right: 0;
+ margin-bottom: 0;
+ margin-left: 0;
+ box-sizing: border-box;
+ border-top-width: 0px;
+ border-right-width: 0px;
+ border-bottom-width: 0px;
+ border-left-width: 0px;
+ text-transform: none;
+ background-color: transparent;
+ background-image: none;
+ border-top-style: solid;
+ border-right-style: solid;
+ border-bottom-style: solid;
+ border-left-style: solid;
+ border-top-color: rgba(226, 232, 240, 1);
+ border-right-color: rgba(226, 232, 240, 1);
+ border-bottom-color: rgba(226, 232, 240, 1);
+ border-left-color: rgba(226, 232, 240, 1);
+ padding-left: 0px;
+ padding-right: 0px;
+ padding-top: 0px;
+ padding-bottom: 0px;
+ }
+ div:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:SelectContent"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ div:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:SelectItem"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ span:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:SelectItemIndicator"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ span:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:SelectItemText"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ button:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:SelectTrigger"]
+ ) {
+ font-family: inherit;
+ font-size: 100%;
+ line-height: 1.15;
+ margin-top: 0;
+ margin-right: 0;
+ margin-bottom: 0;
+ margin-left: 0;
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ text-transform: none;
+ }
+ span:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:SelectValue"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ div:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:SelectViewport"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ button:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:Switch"]
+ ) {
+ font-family: inherit;
+ font-size: 100%;
+ line-height: 1.15;
+ margin-top: 0;
+ margin-right: 0;
+ margin-bottom: 0;
+ margin-left: 0;
+ box-sizing: border-box;
+ border-top-width: 0px;
+ border-right-width: 0px;
+ border-bottom-width: 0px;
+ border-left-width: 0px;
+ text-transform: none;
+ background-color: transparent;
+ background-image: none;
+ border-top-style: solid;
+ border-right-style: solid;
+ border-bottom-style: solid;
+ border-left-style: solid;
+ border-top-color: rgba(226, 232, 240, 1);
+ border-right-color: rgba(226, 232, 240, 1);
+ border-bottom-color: rgba(226, 232, 240, 1);
+ border-left-color: rgba(226, 232, 240, 1);
+ padding-left: 0px;
+ padding-right: 0px;
+ padding-top: 0px;
+ padding-bottom: 0px;
+ }
+ span:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:SwitchThumb"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ div:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:Tabs"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ div:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:TabsContent"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ div:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:TabsList"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+ button:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:TabsTrigger"]
+ ) {
+ font-family: inherit;
+ font-size: 100%;
+ line-height: 1.15;
+ margin-top: 0;
+ margin-right: 0;
+ margin-bottom: 0;
+ margin-left: 0;
+ box-sizing: border-box;
+ border-top-width: 0px;
+ border-right-width: 0px;
+ border-bottom-width: 0px;
+ border-left-width: 0px;
+ text-transform: none;
+ background-color: transparent;
+ background-image: none;
+ border-top-style: solid;
+ border-right-style: solid;
+ border-bottom-style: solid;
+ border-left-style: solid;
+ border-top-color: rgba(226, 232, 240, 1);
+ border-right-color: rgba(226, 232, 240, 1);
+ border-bottom-color: rgba(226, 232, 240, 1);
+ border-left-color: rgba(226, 232, 240, 1);
+ padding-left: 0px;
+ padding-right: 0px;
+ padding-top: 0px;
+ padding-bottom: 0px;
+ }
+ div:where(
+ [data-ws-component="@webstudio-is/sdk-components-react-radix:TooltipContent"]
+ ) {
+ box-sizing: border-box;
+ border-top-width: 1px;
+ border-right-width: 1px;
+ border-bottom-width: 1px;
+ border-left-width: 1px;
+ outline-width: 1px;
+ }
+}
+@media all {
+ [data-ws-id="7pwqBSgrfuuOfk1JblWcL"] {
+ font-size: 4em;
+ }
+}
diff --git a/fixtures/webstudio-custom-template/app/constants.mjs b/fixtures/webstudio-custom-template/app/constants.mjs
new file mode 100644
index 0000000000..86296ca05c
--- /dev/null
+++ b/fixtures/webstudio-custom-template/app/constants.mjs
@@ -0,0 +1,25 @@
+/**
+ * We use mjs extension as constants in this file is shared with the build script
+ * and we use `node --eval` to extract the constants.
+ */
+export const assetBaseUrl = "/custom-folder/";
+export const imageBaseUrl = "/custom-folder/";
+
+/**
+ * @type {import("@webstudio-is/image").ImageLoader}
+ */
+export const imageLoader = ({ quality, src, width }) => {
+ if (process.env.NODE_ENV !== "production") {
+ return imageBaseUrl + src;
+ }
+
+ // https://vercel.com/blog/build-your-own-web-framework#automatic-image-optimization
+ return (
+ "/_vercel/image?url=" +
+ encodeURIComponent(imageBaseUrl + src) +
+ "&w=" +
+ width +
+ "&q=" +
+ quality
+ );
+};
diff --git a/fixtures/webstudio-custom-template/app/root.tsx b/fixtures/webstudio-custom-template/app/root.tsx
new file mode 100644
index 0000000000..d873875663
--- /dev/null
+++ b/fixtures/webstudio-custom-template/app/root.tsx
@@ -0,0 +1 @@
+export { Root as default } from "@webstudio-is/react-sdk";
diff --git a/fixtures/webstudio-custom-template/app/routes/_index.tsx b/fixtures/webstudio-custom-template/app/routes/_index.tsx
new file mode 100644
index 0000000000..ea8e762907
--- /dev/null
+++ b/fixtures/webstudio-custom-template/app/routes/_index.tsx
@@ -0,0 +1,183 @@
+/* eslint-disable camelcase */
+import {
+ type V2_ServerRuntimeMetaFunction,
+ type LinksFunction,
+ type LinkDescriptor,
+ type ActionArgs,
+ json,
+} from "@remix-run/server-runtime";
+
+import {
+ InstanceRoot,
+ type RootPropsData,
+ type Params,
+} from "@webstudio-is/react-sdk";
+import { n8nHandler, getFormId } from "@webstudio-is/form-handlers";
+import { Scripts, ScrollRestoration } from "@remix-run/react";
+import {
+ fontAssets,
+ components,
+ pageData,
+ user,
+ projectId,
+ utils,
+ formsProperties,
+} from "../__generated__/_index.tsx";
+import css from "../__generated__/index.css";
+import type { Data } from "@webstudio-is/http-client";
+import { assetBaseUrl, imageBaseUrl, imageLoader } from "~/constants.mjs";
+
+export type PageData = Omit<Data, "build"> & {
+ build: Pick<Data["build"], "props" | "instances" | "dataSources">;
+};
+
+export const meta: V2_ServerRuntimeMetaFunction = () => {
+ const { page } = pageData;
+ return [{ title: page?.title || "Webstudio", ...page?.meta }];
+};
+
+export const links: LinksFunction = () => {
+ const result: LinkDescriptor[] = [];
+
+ result.push({
+ rel: "stylesheet",
+ href: css,
+ });
+
+ for (const asset of fontAssets) {
+ if (asset.type === "font") {
+ result.push({
+ rel: "preload",
+ href: assetBaseUrl + asset.name,
+ as: "font",
+ crossOrigin: "anonymous",
+ // @todo add mimeType
+ // type: asset.mimeType,
+ });
+ }
+ }
+
+ return result;
+};
+
+const getRequestHost = (request: Request): string =>
+ request.headers.get("x-forwarded-host") || request.headers.get("host") || "";
+
+const getMethod = (value: string | undefined) => {
+ if (value === undefined) {
+ return "post";
+ }
+
+ switch (value.toLowerCase()) {
+ case "get":
+ return "get";
+ default:
+ return "post";
+ }
+};
+
+export const action = async ({ request, context }: ActionArgs) => {
+ const formData = await request.formData();
+
+ const formId = getFormId(formData);
+ if (formId === undefined) {
+ // We're throwing rather than returning { success: false }
+ // because this isn't supposed to happen normally: bug or malicious user
+ throw json("Form not found", { status: 404 });
+ }
+
+ const formProperties = formsProperties.get(formId);
+
+ // form properties are not defined when defaults are used
+ const { action, method } = formProperties ?? {};
+
+ const email = user?.email;
+
+ if (email == null) {
+ return { success: false };
+ }
+
+ // wrapped in try/catch just in cases new URL() throws
+ // (should not happen)
+ let pageUrl: URL;
+ try {
+ pageUrl = new URL(request.url);
+ pageUrl.host = getRequestHost(request);
+ } catch {
+ return { success: false };
+ }
+
+ if (action !== undefined) {
+ try {
+ // Test that action is full URL
+ new URL(action);
+ } catch {
+ return json(
+ {
+ success: false,
+ error: "Invalid action URL, must be valid http/https protocol",
+ },
+ { status: 200 }
+ );
+ }
+ }
+
+ const formInfo = {
+ formData,
+ projectId,
+ action: action ?? null,
+ method: getMethod(method),
+ pageUrl: pageUrl.toString(),
+ toEmail: email,
+ fromEmail: pageUrl.hostname + "@webstudio.email",
+ } as const;
+
+ const result = await n8nHandler({
+ formInfo,
+ hookUrl: context.N8N_FORM_EMAIL_HOOK as string,
+ });
+
+ return result;
+};
+
+const Outlet = () => {
+ const pagesCanvasData: PageData = pageData;
+
+ const page = pagesCanvasData.page;
+
+ if (page === undefined) {
+ throw json("Page not found", {
+ status: 404,
+ });
+ }
+
+ const params: Params = {
+ assetBaseUrl,
+ imageBaseUrl,
+ };
+
+ const data: RootPropsData = {
+ build: pagesCanvasData.build,
+ assets: pagesCanvasData.assets,
+ page,
+ pages: pagesCanvasData.pages,
+ params,
+ };
+
+ return (
+ <InstanceRoot
+ imageLoader={imageLoader}
+ data={data}
+ components={components}
+ utils={utils}
+ scripts={
+ <>
+ <Scripts />
+ <ScrollRestoration />
+ </>
+ }
+ />
+ );
+};
+
+export default Outlet;
diff --git a/fixtures/webstudio-custom-template/custom-template/app/constants.mjs b/fixtures/webstudio-custom-template/custom-template/app/constants.mjs
new file mode 100644
index 0000000000..86296ca05c
--- /dev/null
+++ b/fixtures/webstudio-custom-template/custom-template/app/constants.mjs
@@ -0,0 +1,25 @@
+/**
+ * We use mjs extension as constants in this file is shared with the build script
+ * and we use `node --eval` to extract the constants.
+ */
+export const assetBaseUrl = "/custom-folder/";
+export const imageBaseUrl = "/custom-folder/";
+
+/**
+ * @type {import("@webstudio-is/image").ImageLoader}
+ */
+export const imageLoader = ({ quality, src, width }) => {
+ if (process.env.NODE_ENV !== "production") {
+ return imageBaseUrl + src;
+ }
+
+ // https://vercel.com/blog/build-your-own-web-framework#automatic-image-optimization
+ return (
+ "/_vercel/image?url=" +
+ encodeURIComponent(imageBaseUrl + src) +
+ "&w=" +
+ width +
+ "&q=" +
+ quality
+ );
+};
diff --git a/fixtures/webstudio-custom-template/custom-template/package.json b/fixtures/webstudio-custom-template/custom-template/package.json
new file mode 100644
index 0000000000..a3c6e2442b
--- /dev/null
+++ b/fixtures/webstudio-custom-template/custom-template/package.json
@@ -0,0 +1,5 @@
+{
+ "scripts": {
+ "custom-template-script": "echo \"This is a custom template script\""
+ }
+}
diff --git a/fixtures/webstudio-custom-template/package.json b/fixtures/webstudio-custom-template/package.json
new file mode 100644
index 0000000000..4191085d1d
--- /dev/null
+++ b/fixtures/webstudio-custom-template/package.json
@@ -0,0 +1,47 @@
+{
+ "scripts": {
+ "custom-template-script": "echo \"This is a custom template script\"",
+ "build": "remix build",
+ "dev": "remix dev",
+ "start": "remix-serve build",
+ "typecheck": "tsc",
+ "checks": "pnpm typecheck"
+ },
+ "private": true,
+ "sideEffects": false,
+ "dependencies": {
+ "@remix-run/react": "^1.19.2",
+ "@remix-run/server-runtime": "^1.19.2",
+ "@remix-run/node": "^1.19.2",
+ "@webstudio-is/react-sdk": "workspace:*",
+ "@webstudio-is/sdk-components-react-radix": "workspace:*",
+ "@webstudio-is/sdk-components-react-remix": "workspace:*",
+ "@webstudio-is/sdk-components-react": "workspace:*",
+ "@webstudio-is/form-handlers": "workspace:*",
+ "@webstudio-is/image": "workspace:*",
+ "@webstudio-is/sdk": "workspace:*",
+ "isbot": "^3.6.8",
+ "react": "^18.2.0",
+ "react-dom": "^18.2.0"
+ },
+ "devDependencies": {
+ "@remix-run/serve": "^1.19.2",
+ "@remix-run/dev": "^1.19.2",
+ "@types/react": "^18.2.20",
+ "@types/react-dom": "^18.2.7",
+ "@webstudio-is/http-client": "workspace:*",
+ "eslint": "^8.48.0",
+ "typescript": "5.2.2",
+ "webstudio-cli": "workspace:*"
+ },
+ "engines": {
+ "node": ">=18.0.0"
+ },
+ "name": "webstudio-custom-template",
+ "version": "0.0.1",
+ "description": "",
+ "main": "index.js",
+ "keywords": [],
+ "author": "",
+ "license": "AGPL-3.0-or-later"
+}
diff --git a/fixtures/webstudio-custom-template/public/favicon.ico b/fixtures/webstudio-custom-template/public/favicon.ico
new file mode 100644
index 0000000000..9cb8c815dc
Binary files /dev/null and b/fixtures/webstudio-custom-template/public/favicon.ico differ
diff --git a/fixtures/webstudio-custom-template/remix.config.js b/fixtures/webstudio-custom-template/remix.config.js
new file mode 100644
index 0000000000..1499566045
--- /dev/null
+++ b/fixtures/webstudio-custom-template/remix.config.js
@@ -0,0 +1,20 @@
+/** @type {import('@remix-run/dev').AppConfig} */
+module.exports = {
+ ignoredRouteFiles: ["**/.*"],
+ serverModuleFormat: "cjs",
+ serverDependenciesToBundle: [
+ /@webstudio-is\//,
+ "nanoid",
+ "nanostores",
+ "@nanostores/react",
+ "@jsep-plugin/assignment",
+ ],
+ future: {
+ v2_errorBoundary: true,
+ v2_headers: true,
+ v2_meta: true,
+ v2_normalizeFormMethod: true,
+ v2_routeConvention: true,
+ v2_dev: true,
+ },
+};
diff --git a/fixtures/webstudio-custom-template/remix.env.d.ts b/fixtures/webstudio-custom-template/remix.env.d.ts
new file mode 100644
index 0000000000..dcf8c45e1d
--- /dev/null
+++ b/fixtures/webstudio-custom-template/remix.env.d.ts
@@ -0,0 +1,2 @@
+/// <reference types="@remix-run/dev" />
+/// <reference types="@remix-run/node" />
diff --git a/fixtures/webstudio-custom-template/tsconfig.json b/fixtures/webstudio-custom-template/tsconfig.json
new file mode 100644
index 0000000000..b93e0d4486
--- /dev/null
+++ b/fixtures/webstudio-custom-template/tsconfig.json
@@ -0,0 +1,26 @@
+{
+ "include": ["remix.env.d.ts", "**/*.ts", "**/*.tsx", "**/*.mjs"],
+ "compilerOptions": {
+ "lib": ["DOM", "DOM.Iterable", "ES2022"],
+ "isolatedModules": true,
+ "esModuleInterop": true,
+ "jsx": "react-jsx",
+ "moduleResolution": "bundler",
+ "resolveJsonModule": true,
+ "target": "ES2022",
+ "strict": true,
+ "allowJs": true,
+ "checkJs": true,
+ "forceConsistentCasingInFileNames": true,
+ "allowImportingTsExtensions": true,
+ "baseUrl": ".",
+ "paths": {
+ "~/*": ["./app/*"]
+ },
+ "customConditions": ["source"],
+
+ // Remix takes care of building everything in `remix build`.
+ "noEmit": true,
+ "skipLibCheck": true
+ }
+}
diff --git a/fixtures/webstudio-custom-template/vercel.json b/fixtures/webstudio-custom-template/vercel.json
new file mode 100644
index 0000000000..18097e0c38
--- /dev/null
+++ b/fixtures/webstudio-custom-template/vercel.json
@@ -0,0 +1,11 @@
+{
+ "images": {
+ "domains": [],
+ "sizes": [
+ 16, 32, 48, 64, 96, 128, 256, 384, 640, 750, 828, 1080, 1200, 1920, 2048,
+ 3840
+ ],
+ "minimumCacheTTL": 60,
+ "formats": ["image/webp", "image/avif"]
+ }
+}
diff --git a/fixtures/webstudio-remix-vercel/README.md b/fixtures/webstudio-remix-vercel/README.md
index c23e315438..04901a8d32 100644
--- a/fixtures/webstudio-remix-vercel/README.md
+++ b/fixtures/webstudio-remix-vercel/README.md
@@ -16,6 +16,6 @@ pnpm webstudio-cli link
pnpm webstudio-cli sync && pnpm prettier --write ./.webstudio/
# data.json generated
-pnpm webstudio-cli build --preview && pnpm prettier --write ./app/
+pnpm webstudio-cli build --preview && pnpm prettier --write ./app/ ./package.json
# exec `pnpm run dev` to see result
```
diff --git a/fixtures/webstudio-remix-vercel/app/framework.ts b/fixtures/webstudio-remix-vercel/app/framework.ts
new file mode 100644
index 0000000000..1364cdaf6f
--- /dev/null
+++ b/fixtures/webstudio-remix-vercel/app/framework.ts
@@ -0,0 +1,9 @@
+/* eslint-disable camelcase */
+
+export {
+ type V2_MetaFunction,
+ type LinksFunction,
+ type LinkDescriptor,
+ type ActionArgs,
+ json,
+} from "@remix-run/node";
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 be42984a0b..f7aeff7216 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
@@ -1,11 +1,11 @@
/* eslint-disable camelcase */
import {
- type V2_MetaFunction,
+ type V2_ServerRuntimeMetaFunction,
type LinksFunction,
type LinkDescriptor,
type ActionArgs,
json,
-} from "@remix-run/node";
+} from "@remix-run/server-runtime";
import {
InstanceRoot,
@@ -31,7 +31,7 @@ export type PageData = Omit<Data, "build"> & {
build: Pick<Data["build"], "props" | "instances" | "dataSources">;
};
-export const meta: V2_MetaFunction = () => {
+export const meta: V2_ServerRuntimeMetaFunction = () => {
const { page } = pageData;
return [{ title: page?.title || "Webstudio", ...page?.meta }];
};
diff --git a/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx
index 6c82476941..794b67bc7f 100644
--- a/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx
+++ b/fixtures/webstudio-remix-vercel/app/routes/[form]._index.tsx
@@ -1,11 +1,11 @@
/* eslint-disable camelcase */
import {
- type V2_MetaFunction,
+ type V2_ServerRuntimeMetaFunction,
type LinksFunction,
type LinkDescriptor,
type ActionArgs,
json,
-} from "@remix-run/node";
+} from "@remix-run/server-runtime";
import {
InstanceRoot,
@@ -31,7 +31,7 @@ export type PageData = Omit<Data, "build"> & {
build: Pick<Data["build"], "props" | "instances" | "dataSources">;
};
-export const meta: V2_MetaFunction = () => {
+export const meta: V2_ServerRuntimeMetaFunction = () => {
const { page } = pageData;
return [{ title: page?.title || "Webstudio", ...page?.meta }];
};
diff --git a/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx b/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx
index a9dd8e2bc5..3f92afc2d5 100644
--- a/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx
+++ b/fixtures/webstudio-remix-vercel/app/routes/[radix]._index.tsx
@@ -1,11 +1,11 @@
/* eslint-disable camelcase */
import {
- type V2_MetaFunction,
+ type V2_ServerRuntimeMetaFunction,
type LinksFunction,
type LinkDescriptor,
type ActionArgs,
json,
-} from "@remix-run/node";
+} from "@remix-run/server-runtime";
import {
InstanceRoot,
@@ -31,7 +31,7 @@ export type PageData = Omit<Data, "build"> & {
build: Pick<Data["build"], "props" | "instances" | "dataSources">;
};
-export const meta: V2_MetaFunction = () => {
+export const meta: V2_ServerRuntimeMetaFunction = () => {
const { page } = pageData;
return [{ title: page?.title || "Webstudio", ...page?.meta }];
};
diff --git a/fixtures/webstudio-remix-vercel/app/routes/_index.tsx b/fixtures/webstudio-remix-vercel/app/routes/_index.tsx
index c516eda92f..ea8e762907 100644
--- a/fixtures/webstudio-remix-vercel/app/routes/_index.tsx
+++ b/fixtures/webstudio-remix-vercel/app/routes/_index.tsx
@@ -1,11 +1,11 @@
/* eslint-disable camelcase */
import {
- type V2_MetaFunction,
+ type V2_ServerRuntimeMetaFunction,
type LinksFunction,
type LinkDescriptor,
type ActionArgs,
json,
-} from "@remix-run/node";
+} from "@remix-run/server-runtime";
import {
InstanceRoot,
@@ -31,7 +31,7 @@ export type PageData = Omit<Data, "build"> & {
build: Pick<Data["build"], "props" | "instances" | "dataSources">;
};
-export const meta: V2_MetaFunction = () => {
+export const meta: V2_ServerRuntimeMetaFunction = () => {
const { page } = pageData;
return [{ title: page?.title || "Webstudio", ...page?.meta }];
};
diff --git a/fixtures/webstudio-remix-vercel/package.json b/fixtures/webstudio-remix-vercel/package.json
index 972c0e0a72..d747a1c29a 100644
--- a/fixtures/webstudio-remix-vercel/package.json
+++ b/fixtures/webstudio-remix-vercel/package.json
@@ -9,15 +9,16 @@
"checks": "pnpm typecheck"
},
"dependencies": {
- "@remix-run/node": "^1.19.2",
"@remix-run/react": "^1.19.2",
- "@webstudio-is/react-sdk": "workspace:^",
- "@webstudio-is/sdk-components-react-radix": "workspace:^",
- "@webstudio-is/sdk-components-react-remix": "workspace:^",
- "@webstudio-is/sdk-components-react": "workspace:^",
- "@webstudio-is/form-handlers": "workspace:^",
- "@webstudio-is/image": "workspace:^",
- "@webstudio-is/sdk": "workspace:^",
+ "@remix-run/server-runtime": "^1.19.2",
+ "@remix-run/node": "^1.19.2",
+ "@webstudio-is/react-sdk": "workspace:*",
+ "@webstudio-is/sdk-components-react-radix": "workspace:*",
+ "@webstudio-is/sdk-components-react-remix": "workspace:*",
+ "@webstudio-is/sdk-components-react": "workspace:*",
+ "@webstudio-is/form-handlers": "workspace:*",
+ "@webstudio-is/image": "workspace:*",
+ "@webstudio-is/sdk": "workspace:*",
"isbot": "^3.6.8",
"react": "^18.2.0",
"react-dom": "^18.2.0"
@@ -27,10 +28,10 @@
"@remix-run/dev": "^1.19.2",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
- "@webstudio-is/http-client": "workspace:^",
+ "@webstudio-is/http-client": "workspace:*",
"eslint": "^8.48.0",
"typescript": "5.2.2",
- "webstudio-cli": "workspace:^"
+ "webstudio-cli": "workspace:*"
},
"engines": {
"node": ">=18.0.0"
diff --git a/fixtures/webstudio-remix-vercel/public/assets/_937084ed-a798-49fe-8664-df93a2af605e_uiBk3o6UWdqolyakMvQJ9.jpeg b/fixtures/webstudio-remix-vercel/public/assets/_937084ed-a798-49fe-8664-df93a2af605e_uiBk3o6UWdqolyakMvQJ9.jpeg
index 1c8219b73b..ba43ae9a7a 100644
Binary files a/fixtures/webstudio-remix-vercel/public/assets/_937084ed-a798-49fe-8664-df93a2af605e_uiBk3o6UWdqolyakMvQJ9.jpeg and b/fixtures/webstudio-remix-vercel/public/assets/_937084ed-a798-49fe-8664-df93a2af605e_uiBk3o6UWdqolyakMvQJ9.jpeg differ
diff --git a/package.json b/package.json
index 8e7a697df3..b8cc0b12d4 100644
--- a/package.json
+++ b/package.json
@@ -28,7 +28,7 @@
"devDependencies": {
"@storybook/react-vite": "^7.4.0",
"@types/css-tree": "^2.3.1",
- "@webstudio-is/eslint-config-custom": "workspace:^",
+ "@webstudio-is/eslint-config-custom": "workspace:*",
"esbuild": "^0.19.2",
"nano-staged": "^0.8.0",
"prettier": "3.0.3",
diff --git a/packages/asset-uploader/package.json b/packages/asset-uploader/package.json
index ee6a090e1b..380777c503 100644
--- a/packages/asset-uploader/package.json
+++ b/packages/asset-uploader/package.json
@@ -16,10 +16,10 @@
"dependencies": {
"@aws-crypto/sha256-js": "^5.0.0",
"@smithy/signature-v4": "^2.0.2",
- "@webstudio-is/fonts": "workspace:^",
- "@webstudio-is/prisma-client": "workspace:^",
- "@webstudio-is/sdk": "workspace:^",
- "@webstudio-is/trpc-interface": "workspace:^",
+ "@webstudio-is/fonts": "workspace:*",
+ "@webstudio-is/prisma-client": "workspace:*",
+ "@webstudio-is/sdk": "workspace:*",
+ "@webstudio-is/trpc-interface": "workspace:*",
"fontkit": "^2.0.2",
"image-size": "^1.0.2",
"immer": "^10.0.2",
@@ -30,8 +30,8 @@
"@jest/globals": "^29.6.4",
"@types/fontkit": "^2.0.3",
"@types/node": "^18.11.18",
- "@webstudio-is/jest-config": "workspace:^",
- "@webstudio-is/tsconfig": "workspace:^",
+ "@webstudio-is/jest-config": "workspace:*",
+ "@webstudio-is/tsconfig": "workspace:*",
"jest": "^29.6.4",
"typescript": "5.2.2",
"zod": "^3.21.4"
diff --git a/packages/authorization-token/package.json b/packages/authorization-token/package.json
index 92a9f02354..d8e7140079 100644
--- a/packages/authorization-token/package.json
+++ b/packages/authorization-token/package.json
@@ -13,12 +13,12 @@
"dts": "tsc --project tsconfig.dts.json"
},
"dependencies": {
- "@webstudio-is/prisma-client": "workspace:^",
- "@webstudio-is/trpc-interface": "workspace:^",
+ "@webstudio-is/prisma-client": "workspace:*",
+ "@webstudio-is/trpc-interface": "workspace:*",
"zod": "^3.21.4"
},
"devDependencies": {
- "@webstudio-is/tsconfig": "workspace:^",
+ "@webstudio-is/tsconfig": "workspace:*",
"typescript": "5.2.2"
},
"exports": {
diff --git a/packages/cli/package.json b/packages/cli/package.json
index 8772a5c0ab..2fe4519406 100644
--- a/packages/cli/package.json
+++ b/packages/cli/package.json
@@ -23,13 +23,13 @@
},
"license": "AGPL-3.0-or-later",
"dependencies": {
- "@webstudio-is/http-client": "workspace:^",
- "@webstudio-is/image": "workspace:^",
- "@webstudio-is/react-sdk": "workspace:^",
- "@webstudio-is/sdk": "workspace:^",
- "@webstudio-is/sdk-components-react": "workspace:^",
- "@webstudio-is/sdk-components-react-radix": "workspace:^",
- "@webstudio-is/sdk-components-react-remix": "workspace:^",
+ "@webstudio-is/http-client": "workspace:*",
+ "@webstudio-is/image": "workspace:*",
+ "@webstudio-is/react-sdk": "workspace:*",
+ "@webstudio-is/sdk": "workspace:*",
+ "@webstudio-is/sdk-components-react": "workspace:*",
+ "@webstudio-is/sdk-components-react-radix": "workspace:*",
+ "@webstudio-is/sdk-components-react-remix": "workspace:*",
"deepmerge": "^4.3.1",
"env-paths": "^3.0.0",
"execa": "^7.2.0",
@@ -38,13 +38,14 @@
"picocolors": "^1.0.0",
"prompts": "^2.4.2",
"strip-indent": "^4.0.0",
- "yargs": "^17.7.2"
+ "yargs": "^17.7.2",
+ "zod": "^3.21.4"
},
"devDependencies": {
"@types/node": "^18.13.0",
"@types/prompts": "^2.4.4",
- "@webstudio-is/form-handlers": "workspace:^",
- "@webstudio-is/tsconfig": "workspace:^",
+ "@webstudio-is/form-handlers": "workspace:*",
+ "@webstudio-is/tsconfig": "workspace:*",
"tsx": "^3.12.8",
"typescript": "5.2.2"
}
diff --git a/packages/cli/src/cli.ts b/packages/cli/src/cli.ts
index 8b94551bf9..f197110fb2 100644
--- a/packages/cli/src/cli.ts
+++ b/packages/cli/src/cli.ts
@@ -4,7 +4,7 @@ import { hideBin } from "yargs/helpers";
import { GLOBAL_CONFIG_FILE } from "./config";
import { ensureFileInPath } from "./fs-utils";
import { link, linkOptions } from "./commands/link";
-import { sync } from "./commands/sync";
+import { sync, syncOptions } from "./commands/sync";
import { build, buildOptions } from "./commands/build";
import { initFlow } from "./commands/init-flow";
import makeCLI from "yargs";
@@ -47,7 +47,7 @@ export const main = async () => {
cmd.command(["build"], "Build the project", buildOptions, build);
cmd.command(["link"], "Link the project with the cloud", linkOptions, link);
- cmd.command(["sync"], "Sync your project", {}, sync);
+ cmd.command(["sync"], "Sync your project", syncOptions, sync);
cmd.command(["$0", "init"], "Setup the project", buildOptions, initFlow);
await cmd.parse();
diff --git a/packages/cli/src/commands/build.ts b/packages/cli/src/commands/build.ts
index acb985858f..eec4dc4b1e 100644
--- a/packages/cli/src/commands/build.ts
+++ b/packages/cli/src/commands/build.ts
@@ -17,6 +17,10 @@ export const buildOptions = (yargs: CommonYargsArgv) =>
type: "boolean",
default: false,
describe: "[Experimental] Use preview version of the project",
+ })
+ .option("template", {
+ type: "string",
+ describe: "[Experimental] Template to use for the build",
});
// @todo: use options.assets to define if we need to download assets
diff --git a/packages/cli/src/commands/init-flow.ts b/packages/cli/src/commands/init-flow.ts
index 3c80d2341f..aaa9d0cea4 100644
--- a/packages/cli/src/commands/init-flow.ts
+++ b/packages/cli/src/commands/init-flow.ts
@@ -62,7 +62,7 @@ export const initFlow = async (
shouldInstallDeps = installDeps;
}
- await sync();
+ await sync({ buildId: undefined, origin: undefined, authToken: undefined });
await build(options);
if (shouldInstallDeps === true) {
diff --git a/packages/cli/src/commands/link.ts b/packages/cli/src/commands/link.ts
index 12ee993db8..e52f152222 100644
--- a/packages/cli/src/commands/link.ts
+++ b/packages/cli/src/commands/link.ts
@@ -2,7 +2,13 @@ import { stdin, stdout, cwd } from "node:process";
import { join } from "node:path";
import * as readline from "node:readline/promises";
import { readFile, writeFile } from "node:fs/promises";
-import { GLOBAL_CONFIG_FILE, LOCAL_CONFIG_FILE } from "../config";
+import {
+ GLOBAL_CONFIG_FILE,
+ LOCAL_CONFIG_FILE,
+ type GlobalConfig,
+ jsonToGlobalConfig,
+ type LocalConfig,
+} from "../config";
import { ensureFileInPath } from "../fs-utils";
import type {
CommonYargsArgv,
@@ -31,25 +37,28 @@ export const link = async (
}
const shareLinkUrl = new URL(shareLink);
- const host = shareLinkUrl.origin;
+ const origin = shareLinkUrl.origin;
const token = shareLinkUrl.searchParams.get("authToken");
const paths = shareLinkUrl.pathname.split("/").slice(1);
if (paths[0] !== "builder" || paths.length !== 2) {
throw new Error("Invalid share link.");
}
+
const projectId = paths[1];
- if (token === undefined || projectId === undefined || host === undefined) {
+
+ if (token == null) {
throw new Error("Invalid share link.");
}
try {
const currentConfig = await readFile(GLOBAL_CONFIG_FILE, "utf-8");
- const currentConfigJson = JSON.parse(currentConfig);
- const newConfig = {
+ const currentConfigJson = jsonToGlobalConfig(JSON.parse(currentConfig));
+
+ const newConfig: GlobalConfig = {
...currentConfigJson,
[projectId]: {
- host,
+ origin,
token,
},
};
@@ -59,9 +68,13 @@ export const link = async (
You can find your config at ${GLOBAL_CONFIG_FILE}
`);
+ const localConfig: LocalConfig = {
+ projectId,
+ };
+
await ensureFileInPath(
join(cwd(), LOCAL_CONFIG_FILE),
- JSON.stringify({ projectId }, null, 2)
+ JSON.stringify(localConfig, null, 2)
);
} catch (error: unknown) {
if (error instanceof Error && "code" in error && error.code === "ENONET") {
diff --git a/packages/cli/src/commands/sync.ts b/packages/cli/src/commands/sync.ts
index cb391c5b51..b255f96dbb 100644
--- a/packages/cli/src/commands/sync.ts
+++ b/packages/cli/src/commands/sync.ts
@@ -1,59 +1,121 @@
-import { writeFile } from "node:fs/promises";
+import { readFile, writeFile } from "node:fs/promises";
import { cwd } from "node:process";
import { join } from "node:path";
import ora from "ora";
-import { loadProjectDataById } from "@webstudio-is/http-client";
+import {
+ loadProjectDataByBuildId,
+ loadProjectDataById,
+ type Data,
+} from "@webstudio-is/http-client";
import pc from "picocolors";
-import { ensureFileInPath, loadJSONFile } from "../fs-utils";
+import { ensureFileInPath, isFileExists } from "../fs-utils";
import {
GLOBAL_CONFIG_FILE,
LOCAL_CONFIG_FILE,
- type GlobalConfig,
- type LocalConfig,
LOCAL_DATA_FILE,
+ jsonToGlobalConfig,
+ jsonToLocalConfig,
} from "../config";
+import type {
+ CommonYargsArgv,
+ StrictYargsOptionsToInterface,
+} from "./yargs-types";
+
+export const syncOptions = (yargs: CommonYargsArgv) =>
+ yargs
+ .option("buildId", {
+ type: "string",
+ describe: "[Experimental] Project build id to sync",
+ })
+ .option("origin", {
+ type: "string",
+ describe: "[Experimental] Remote origin to sync with",
+ })
+ .option("authToken", {
+ type: "string",
+ describe: "[Experimental] Service token",
+ });
-export const sync = async () => {
+export const sync = async (
+ options: StrictYargsOptionsToInterface<typeof syncOptions>
+) => {
const spinner = ora("Syncing project data").start();
spinner.text = "Loading project data from config file";
- const globalConfig = await loadJSONFile<GlobalConfig>(GLOBAL_CONFIG_FILE);
- if (globalConfig === null) {
- spinner.fail(
- `Global config file is not found. Please link your project using webstudio link command`
- );
- return;
- }
- const localConfig = await loadJSONFile<LocalConfig>(
- join(cwd(), LOCAL_CONFIG_FILE)
- );
+ const definedOptionValues = [
+ options.buildId,
+ options.origin,
+ options.authToken,
+ ].filter(Boolean);
- if (localConfig === null) {
- spinner.fail(
- `Local config file is not found. Please make sure current directory is a webstudio project`
- );
+ if (definedOptionValues.length > 0 && definedOptionValues.length < 3) {
+ spinner.fail(`Please provide buildId, origin and authToken`);
return;
}
- const projectConfig = globalConfig[localConfig.projectId];
+ let project: Data | undefined;
+
+ if (
+ options.buildId !== undefined &&
+ options.origin !== undefined &&
+ options.authToken !== undefined
+ ) {
+ project = await loadProjectDataByBuildId({
+ buildId: options.buildId,
+ authToken: options.authToken,
+ origin: options.origin,
+ });
+ } else {
+ if ((await isFileExists(GLOBAL_CONFIG_FILE)) === false) {
+ spinner.fail(
+ `Global config file at path ${GLOBAL_CONFIG_FILE} is not found. Please link your project using webstudio link command`
+ );
+ return;
+ }
+
+ const globalConfigText = await readFile(GLOBAL_CONFIG_FILE, "utf-8");
+ const globalConfig = jsonToGlobalConfig(JSON.parse(globalConfigText));
+
+ if ((await isFileExists(LOCAL_CONFIG_FILE)) === false) {
+ spinner.fail(
+ `Local config file is not found. Please make sure current directory is a webstudio project`
+ );
+ return;
+ }
- if (projectConfig === undefined) {
- spinner.fail(
- `Project config is not found, please run ${pc.dim("webstudio-cli link")}`
+ const localConfigText = await readFile(
+ join(cwd(), LOCAL_CONFIG_FILE),
+ "utf-8"
);
- return;
- }
- const { host, token } = projectConfig;
+ const localConfig = jsonToLocalConfig(JSON.parse(localConfigText));
+
+ const projectConfig = globalConfig[localConfig.projectId];
+
+ if (projectConfig === undefined) {
+ spinner.fail(
+ `Project config is not found, please run ${pc.dim(
+ "webstudio-cli link"
+ )}`
+ );
+ return;
+ }
+
+ const { origin, token } = projectConfig;
+
+ spinner.text = "Loading project data from webstudio\n";
+
+ project = await loadProjectDataById({
+ projectId: localConfig.projectId,
+ authToken: token,
+ origin,
+ });
+ }
- spinner.text = "Loading project data from webstudio\n";
- const project = await loadProjectDataById({
- projectId: localConfig.projectId,
- authToken: token,
- host: host,
- });
+ // Check that project defined
+ project satisfies Data;
spinner.text = "Saving project data to config file";
diff --git a/packages/cli/src/commands/yargs-types.ts b/packages/cli/src/commands/yargs-types.ts
index 04683d6817..f620be8709 100644
--- a/packages/cli/src/commands/yargs-types.ts
+++ b/packages/cli/src/commands/yargs-types.ts
@@ -61,5 +61,5 @@ type RemoveIndex<T> = {
export type StrictYargsOptionsToInterface<
T extends (yargs: CommonYargsArgv) => Argv,
> = T extends (yargs: CommonYargsArgv) => Argv<infer P>
- ? RemoveIndex<ArgumentsCamelCase<P>>
+ ? Omit<RemoveIndex<ArgumentsCamelCase<P>>, "v" | "h" | "$0" | "_">
: never;
diff --git a/packages/cli/src/config.ts b/packages/cli/src/config.ts
index de2c170006..c3acc13455 100644
--- a/packages/cli/src/config.ts
+++ b/packages/cli/src/config.ts
@@ -1,5 +1,6 @@
import { join } from "node:path";
import envPaths from "env-paths";
+import { z } from "zod";
const GLOBAL_CONFIG_FOLDER = envPaths("webstudio").config;
const GLOBAL_CONFIG_FILE_NAME = "webstudio-config.json";
@@ -11,13 +12,42 @@ export const GLOBAL_CONFIG_FILE = join(
export const LOCAL_CONFIG_FILE = ".webstudio/config.json";
export const LOCAL_DATA_FILE = ".webstudio/data.json";
-export type LocalConfig = {
- projectId: string;
+const zLocalConfig = z.object({
+ projectId: z.string(),
+});
+
+export type LocalConfig = z.infer<typeof zLocalConfig>;
+
+export const jsonToLocalConfig = (json: unknown) => {
+ return zLocalConfig.parse(json);
};
-export type GlobalConfig = {
- [projectId: string]: {
- host: string;
- token: string;
- };
+const zGlobalConfig = z.record(
+ z
+ .union([
+ z.object({
+ // origin mistakenly called host in the past
+ host: z.string(),
+ token: z.string(),
+ }),
+ z.object({
+ origin: z.string(),
+ token: z.string(),
+ }),
+ ])
+ .transform((value) => {
+ if ("host" in value) {
+ return {
+ origin: value.host,
+ token: value.token,
+ };
+ }
+ return value;
+ })
+);
+
+export const jsonToGlobalConfig = (json: unknown) => {
+ return zGlobalConfig.parse(json);
};
+
+export type GlobalConfig = z.infer<typeof zGlobalConfig>;
diff --git a/packages/cli/src/prebuild.ts b/packages/cli/src/prebuild.ts
index ec30385b07..3acecf4b9a 100644
--- a/packages/cli/src/prebuild.ts
+++ b/packages/cli/src/prebuild.ts
@@ -8,6 +8,7 @@ import {
cp,
readFile,
writeFile,
+ readdir,
} from "node:fs/promises";
import { pipeline } from "node:stream/promises";
import { tmpdir } from "node:os";
@@ -134,13 +135,30 @@ const mergeJsonFiles = async (sourcePath: string, destinationPath: string) => {
await writeFile(destinationPath, content, "utf8");
};
-const copyTemplates = async () => {
+const isCliTemplate = async (template: string) => {
const currentPath = fileURLToPath(new URL(import.meta.url));
const templatesPath = normalize(
- join(dirname(currentPath), "..", "templates", "defaults")
+ join(dirname(currentPath), "..", "templates")
);
+ const dirents = await readdir(templatesPath, { withFileTypes: true });
+
+ for (const dirent of dirents) {
+ if (dirent.isDirectory() && dirent.name === template) {
+ return true;
+ }
+ }
+ return false;
+};
+
+const copyTemplates = async (template: string = "defaults") => {
+ const currentPath = fileURLToPath(new URL(import.meta.url));
+
+ const templatesPath = (await isCliTemplate(template))
+ ? normalize(join(dirname(currentPath), "..", "templates", template))
+ : template;
+
await cp(templatesPath, cwd(), {
recursive: true,
filter: (source) => {
@@ -163,6 +181,10 @@ export const prebuild = async (options: {
* Do we need download assets
**/
assets: boolean;
+ /**
+ * Template to use for the build in addition to defaults template
+ **/
+ template?: string;
}) => {
const spinner = ora("Scaffolding the project files");
spinner.start();
@@ -171,6 +193,10 @@ export const prebuild = async (options: {
await copyTemplates();
+ if (options.template !== undefined) {
+ await copyTemplates(options.template);
+ }
+
const constantsJson =
await $`node --input-type=module --eval ${`import * as consts from './app/constants.mjs'; console.log(JSON.stringify(consts))`}`;
@@ -292,34 +318,36 @@ export const prebuild = async (options: {
imageBaseUrl: assetBuildUrl,
});
- for (const asset of siteData.assets) {
- if (asset.type === "image") {
- const imageSrc = imageLoader({
- width: 16,
- quality: 100,
- src: asset.name,
- format: "raw",
- });
-
- assetsToDownload.push(
- limit(() =>
- downloadAsset(imageSrc, asset.name, assetBaseUrl, temporaryDir)
- )
- );
- }
+ if (options.assets === true) {
+ for (const asset of siteData.assets) {
+ if (asset.type === "image") {
+ const imageSrc = imageLoader({
+ width: 16,
+ quality: 100,
+ src: asset.name,
+ format: "raw",
+ });
+
+ assetsToDownload.push(
+ limit(() =>
+ downloadAsset(imageSrc, asset.name, assetBaseUrl, temporaryDir)
+ )
+ );
+ }
- if (asset.type === "font") {
- assetsToDownload.push(
- limit(() =>
- downloadAsset(
- `${assetBuildUrl}${asset.name}`,
- asset.name,
- assetBaseUrl,
- temporaryDir
+ if (asset.type === "font") {
+ assetsToDownload.push(
+ limit(() =>
+ downloadAsset(
+ `${assetBuildUrl}${asset.name}`,
+ asset.name,
+ assetBaseUrl,
+ temporaryDir
+ )
)
- )
- );
- fontAssets.push(asset);
+ );
+ fontAssets.push(asset);
+ }
}
}
diff --git a/packages/cli/templates/defaults/package.json b/packages/cli/templates/defaults/package.json
index b30e30fd85..e3edb781c6 100644
--- a/packages/cli/templates/defaults/package.json
+++ b/packages/cli/templates/defaults/package.json
@@ -8,8 +8,9 @@
"typecheck": "tsc"
},
"dependencies": {
- "@remix-run/node": "^1.19.2",
"@remix-run/react": "^1.19.2",
+ "@remix-run/server-runtime": "^1.19.2",
+ "@remix-run/node": "^1.19.2",
"@webstudio-is/react-sdk": "^0.99.0",
"@webstudio-is/sdk-components-react-radix": "^0.99.0",
"@webstudio-is/sdk-components-react-remix": "^0.99.0",
diff --git a/packages/cli/templates/route-template.tsx b/packages/cli/templates/route-template.tsx
index cb137be5b8..7d1bb8f8fb 100644
--- a/packages/cli/templates/route-template.tsx
+++ b/packages/cli/templates/route-template.tsx
@@ -1,11 +1,11 @@
/* eslint-disable camelcase */
import {
- type V2_MetaFunction,
+ type V2_ServerRuntimeMetaFunction,
type LinksFunction,
type LinkDescriptor,
type ActionArgs,
json,
-} from "@remix-run/node";
+} from "@remix-run/server-runtime";
import {
InstanceRoot,
@@ -31,7 +31,7 @@ export type PageData = Omit<Data, "build"> & {
build: Pick<Data["build"], "props" | "instances" | "dataSources">;
};
-export const meta: V2_MetaFunction = () => {
+export const meta: V2_ServerRuntimeMetaFunction = () => {
const { page } = pageData;
return [{ title: page?.title || "Webstudio", ...page?.meta }];
};
diff --git a/packages/css-data/package.json b/packages/css-data/package.json
index 9deaed4e11..d429d5c28a 100644
--- a/packages/css-data/package.json
+++ b/packages/css-data/package.json
@@ -17,8 +17,8 @@
},
"devDependencies": {
"@types/css-tree": "^2.3.1",
- "@webstudio-is/jest-config": "workspace:^",
- "@webstudio-is/tsconfig": "workspace:^",
+ "@webstudio-is/jest-config": "workspace:*",
+ "@webstudio-is/tsconfig": "workspace:*",
"camelcase": "^7.0.1",
"html-tags": "^3.3.1",
"jest": "^29.6.4",
@@ -44,7 +44,7 @@
"private": true,
"sideEffects": false,
"dependencies": {
- "@webstudio-is/css-engine": "workspace:^",
+ "@webstudio-is/css-engine": "workspace:*",
"colord": "^2.9.3",
"css-tree": "^2.3.1",
"hyphenate-style-name": "^1.0.4",
diff --git a/packages/css-engine/package.json b/packages/css-engine/package.json
index 097d96fc4c..da03c6f2ac 100644
--- a/packages/css-engine/package.json
+++ b/packages/css-engine/package.json
@@ -16,8 +16,8 @@
"storybook:build": "storybook build"
},
"dependencies": {
- "@webstudio-is/error-utils": "workspace:^",
- "@webstudio-is/fonts": "workspace:^",
+ "@webstudio-is/error-utils": "workspace:*",
+ "@webstudio-is/fonts": "workspace:*",
"hyphenate-style-name": "^1.0.4"
},
"devDependencies": {
@@ -25,9 +25,9 @@
"@types/hyphenate-style-name": "^1.0.0",
"@types/react": "^18.2.21",
"@types/react-dom": "^18.2.7",
- "@webstudio-is/jest-config": "workspace:^",
- "@webstudio-is/storybook-config": "workspace:^",
- "@webstudio-is/tsconfig": "workspace:^",
+ "@webstudio-is/jest-config": "workspace:*",
+ "@webstudio-is/storybook-config": "workspace:*",
+ "@webstudio-is/tsconfig": "workspace:*",
"jest": "^29.6.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
diff --git a/packages/css-vars/package.json b/packages/css-vars/package.json
index 6d7d3c5836..40072741a8 100644
--- a/packages/css-vars/package.json
+++ b/packages/css-vars/package.json
@@ -13,7 +13,7 @@
"dts": "tsc --project tsconfig.dts.json"
},
"devDependencies": {
- "@webstudio-is/tsconfig": "workspace:^"
+ "@webstudio-is/tsconfig": "workspace:*"
},
"exports": {
"source": "./src/index.ts",
diff --git a/packages/dashboard/package.json b/packages/dashboard/package.json
index 71273e210e..c7ad385316 100644
--- a/packages/dashboard/package.json
+++ b/packages/dashboard/package.json
@@ -13,13 +13,13 @@
"dts": "tsc --project tsconfig.dts.json"
},
"dependencies": {
- "@webstudio-is/prisma-client": "workspace:^",
- "@webstudio-is/project": "workspace:^",
- "@webstudio-is/trpc-interface": "workspace:^",
+ "@webstudio-is/prisma-client": "workspace:*",
+ "@webstudio-is/project": "workspace:*",
+ "@webstudio-is/trpc-interface": "workspace:*",
"zod": "^3.21.4"
},
"devDependencies": {
- "@webstudio-is/tsconfig": "workspace:^",
+ "@webstudio-is/tsconfig": "workspace:*",
"typescript": "5.2.2"
},
"exports": {
diff --git a/packages/design-system/package.json b/packages/design-system/package.json
index 1a405095fc..70fe46b332 100644
--- a/packages/design-system/package.json
+++ b/packages/design-system/package.json
@@ -22,9 +22,9 @@
"@testing-library/react-hooks": "^8.0.1",
"@types/react": "^18.2.21",
"@types/react-dom": "^18.2.7",
- "@webstudio-is/jest-config": "workspace:^",
- "@webstudio-is/storybook-config": "workspace:^",
- "@webstudio-is/tsconfig": "workspace:^",
+ "@webstudio-is/jest-config": "workspace:*",
+ "@webstudio-is/storybook-config": "workspace:*",
+ "@webstudio-is/tsconfig": "workspace:*",
"jest": "^29.6.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
@@ -65,8 +65,8 @@
"@react-aria/interactions": "^3.17.0",
"@react-aria/utils": "^3.19.0",
"@stitches/react": "1.3.1-1",
- "@webstudio-is/css-vars": "workspace:^",
- "@webstudio-is/icons": "workspace:^",
+ "@webstudio-is/css-vars": "workspace:*",
+ "@webstudio-is/icons": "workspace:*",
"camelcase": "^7.0.1",
"downshift": "^6.1.7",
"immer": "^10.0.2",
diff --git a/packages/domain/package.json b/packages/domain/package.json
index b8fe1f4038..ce60f09509 100644
--- a/packages/domain/package.json
+++ b/packages/domain/package.json
@@ -13,14 +13,14 @@
"dts": "tsc --project tsconfig.dts.json"
},
"dependencies": {
- "@webstudio-is/prisma-client": "workspace:^",
- "@webstudio-is/project": "workspace:^",
- "@webstudio-is/project-build": "workspace:^",
- "@webstudio-is/trpc-interface": "workspace:^",
+ "@webstudio-is/prisma-client": "workspace:*",
+ "@webstudio-is/project": "workspace:*",
+ "@webstudio-is/project-build": "workspace:*",
+ "@webstudio-is/trpc-interface": "workspace:*",
"zod": "^3.21.4"
},
"devDependencies": {
- "@webstudio-is/tsconfig": "workspace:^",
+ "@webstudio-is/tsconfig": "workspace:*",
"typescript": "5.2.2"
},
"exports": {
diff --git a/packages/error-utils/package.json b/packages/error-utils/package.json
index 6493f60975..b415a8650e 100644
--- a/packages/error-utils/package.json
+++ b/packages/error-utils/package.json
@@ -13,7 +13,7 @@
"dts": "tsc --project tsconfig.dts.json"
},
"devDependencies": {
- "@webstudio-is/tsconfig": "workspace:^"
+ "@webstudio-is/tsconfig": "workspace:*"
},
"exports": {
"source": "./src/index.ts",
diff --git a/packages/feature-flags/package.json b/packages/feature-flags/package.json
index 80ec7f2528..7a20472387 100644
--- a/packages/feature-flags/package.json
+++ b/packages/feature-flags/package.json
@@ -14,7 +14,7 @@
},
"dependencies": {},
"devDependencies": {
- "@webstudio-is/tsconfig": "workspace:^"
+ "@webstudio-is/tsconfig": "workspace:*"
},
"exports": {
"source": "./src/index.ts",
diff --git a/packages/fonts/package.json b/packages/fonts/package.json
index 00dbc5277c..2c5ebe11a7 100644
--- a/packages/fonts/package.json
+++ b/packages/fonts/package.json
@@ -15,8 +15,8 @@
},
"devDependencies": {
"@jest/globals": "^29.6.4",
- "@webstudio-is/jest-config": "workspace:^",
- "@webstudio-is/tsconfig": "workspace:^",
+ "@webstudio-is/jest-config": "workspace:*",
+ "@webstudio-is/tsconfig": "workspace:*",
"jest": "^29.6.4",
"typescript": "5.2.2",
"zod": "^3.21.4"
diff --git a/packages/form-handlers-mailchannels-test/package.json b/packages/form-handlers-mailchannels-test/package.json
index 52993bb9d2..934e5999bf 100644
--- a/packages/form-handlers-mailchannels-test/package.json
+++ b/packages/form-handlers-mailchannels-test/package.json
@@ -7,11 +7,11 @@
"local-dev": "wrangler dev src/index.ts"
},
"dependencies": {
- "@webstudio-is/form-handlers": "workspace:^"
+ "@webstudio-is/form-handlers": "workspace:*"
},
"devDependencies": {
"@cloudflare/workers-types": "^3.0.0",
- "@webstudio-is/tsconfig": "workspace:^",
+ "@webstudio-is/tsconfig": "workspace:*",
"typescript": "5.2.2",
"wrangler": "^2.18.0"
}
diff --git a/packages/form-handlers/package.json b/packages/form-handlers/package.json
index ee866465cb..8f532e0f4a 100644
--- a/packages/form-handlers/package.json
+++ b/packages/form-handlers/package.json
@@ -13,7 +13,7 @@
"dts": "tsc --project tsconfig.dts.json"
},
"devDependencies": {
- "@webstudio-is/tsconfig": "workspace:^"
+ "@webstudio-is/tsconfig": "workspace:*"
},
"exports": {
"source": "./src/index.ts",
diff --git a/packages/generate-arg-types/package.json b/packages/generate-arg-types/package.json
index 436cc91ba8..cc6b003f81 100644
--- a/packages/generate-arg-types/package.json
+++ b/packages/generate-arg-types/package.json
@@ -11,14 +11,14 @@
"checks": "pnpm typecheck"
},
"dependencies": {
- "@webstudio-is/html-data": "workspace:^",
- "@webstudio-is/react-sdk": "workspace:^",
+ "@webstudio-is/html-data": "workspace:*",
+ "@webstudio-is/react-sdk": "workspace:*",
"fast-glob": "^3.2.12",
"react-docgen-typescript": "^2.2.2",
"zod": "^3.21.4"
},
"devDependencies": {
- "@webstudio-is/tsconfig": "workspace:^",
+ "@webstudio-is/tsconfig": "workspace:*",
"tsx": "^3.12.8",
"typescript": "5.2.2"
},
diff --git a/packages/html-data/package.json b/packages/html-data/package.json
index 1da6775250..307d316e03 100644
--- a/packages/html-data/package.json
+++ b/packages/html-data/package.json
@@ -14,7 +14,7 @@
"test": "NODE_OPTIONS=--experimental-vm-modules jest"
},
"devDependencies": {
- "@webstudio-is/tsconfig": "workspace:^"
+ "@webstudio-is/tsconfig": "workspace:*"
},
"peerDependencies": {},
"exports": {
diff --git a/packages/http-client/package.json b/packages/http-client/package.json
index 39aafb4795..2bab031bb0 100644
--- a/packages/http-client/package.json
+++ b/packages/http-client/package.json
@@ -14,12 +14,12 @@
"checks": "pnpm typecheck"
},
"dependencies": {
- "@webstudio-is/sdk": "workspace:^"
+ "@webstudio-is/sdk": "workspace:*"
},
"devDependencies": {
"@jest/globals": "^29.6.4",
- "@webstudio-is/jest-config": "workspace:^",
- "@webstudio-is/tsconfig": "workspace:^",
+ "@webstudio-is/jest-config": "workspace:*",
+ "@webstudio-is/tsconfig": "workspace:*",
"jest": "^29.6.4",
"typescript": "5.2.2"
},
diff --git a/packages/http-client/src/index.test.ts b/packages/http-client/src/index.test.ts
index 9a07dfb3d1..6a97e7f882 100644
--- a/packages/http-client/src/index.test.ts
+++ b/packages/http-client/src/index.test.ts
@@ -11,7 +11,7 @@ const host = "http://localhost:3000";
describe("getProjectDetails", () => {
test("include pages", async () => {
const response = await loadProjectDataById({
- host,
+ origin: host,
projectId: morePagesProjectId,
});
@@ -22,7 +22,7 @@ describe("getProjectDetails", () => {
});
test("does not include pages", async () => {
const response = await loadProjectDataById({
- host,
+ origin: host,
projectId: onlyHomeProjectId,
});
if (typeof response === "object") {
@@ -32,14 +32,14 @@ describe("getProjectDetails", () => {
});
test("loads existing project", async () => {
const response = await loadProjectDataById({
- host,
+ origin: host,
projectId: existingProjectId,
});
expect(response).toBeTruthy();
});
test("loads not published project", async () => {
const response = await loadProjectDataById({
- host,
+ origin: host,
projectId: notPublishedProjectId,
});
if (response instanceof Error) {
diff --git a/packages/http-client/src/index.ts b/packages/http-client/src/index.ts
index f3308ed057..64ea165cea 100644
--- a/packages/http-client/src/index.ts
+++ b/packages/http-client/src/index.ts
@@ -34,24 +34,19 @@ export type Data = {
assets: Array<Asset>;
};
-interface DefaultArgs {
- host: string;
+export const loadProjectDataById = async (params: {
+ projectId: string;
+ origin: string;
authToken?: string;
-}
-
-type ResourceFactory<T, K> = (params: DefaultArgs & T) => Promise<K>;
-
-export const loadProjectDataById: ResourceFactory<
- { projectId: string },
- Data
-> = async (params) => {
+}): Promise<Data> => {
const result = await getLatestBuildUsingProjectId(params);
- if (result === null) {
- throw new Error(``);
+ if (result.buildId === null) {
+ throw new Error(`The project is not published yet`);
}
- const url = new URL(params.host);
+ const url = new URL(params.origin);
url.pathname = `/rest/build/${result.buildId}`;
+
if (params.authToken) {
url.searchParams.append("authToken", params.authToken);
}
@@ -66,13 +61,38 @@ export const loadProjectDataById: ResourceFactory<
throw new Error(message.slice(0, 1000));
};
-export const getLatestBuildUsingProjectId: ResourceFactory<
- { projectId: string },
- { buildId: string }
-> = async (params) => {
- const { host, projectId, authToken } = params;
- const url = new URL(host);
+export const loadProjectDataByBuildId = async (params: {
+ buildId: string;
+ origin: string;
+ authToken: string;
+}): Promise<Data> => {
+ const url = new URL(params.origin);
+ url.pathname = `/rest/build/${params.buildId}`;
+
+ const response = await fetch(url.href, {
+ headers: {
+ Authorization: params.authToken,
+ },
+ });
+
+ if (response.ok) {
+ return await response.json();
+ }
+
+ const message = await response.text();
+ throw new Error(message.slice(0, 1000));
+};
+
+// @todo: broken as expects non 200 code
+export const getLatestBuildUsingProjectId = async (params: {
+ projectId: string;
+ origin: string;
+ authToken?: string;
+}): Promise<{ buildId: string | null }> => {
+ const { origin, projectId, authToken } = params;
+ const url = new URL(origin);
url.pathname = `/rest/buildId/${projectId}`;
+
if (authToken) {
url.searchParams.append("authToken", authToken);
}
diff --git a/packages/icons/package.json b/packages/icons/package.json
index 8afc5629d2..1e86fe4a17 100644
--- a/packages/icons/package.json
+++ b/packages/icons/package.json
@@ -18,8 +18,8 @@
"devDependencies": {
"@svgo/jsx": "^0.4.2",
"@types/react": "^18.2.21",
- "@webstudio-is/storybook-config": "workspace:^",
- "@webstudio-is/tsconfig": "workspace:^",
+ "@webstudio-is/storybook-config": "workspace:*",
+ "@webstudio-is/tsconfig": "workspace:*",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"svgo": "^3.0.2",
@@ -31,7 +31,7 @@
"react-dom": "^18.2.0"
},
"dependencies": {
- "@webstudio-is/css-vars": "workspace:^"
+ "@webstudio-is/css-vars": "workspace:*"
},
"exports": {
".": {
diff --git a/packages/image/package.json b/packages/image/package.json
index 5ea5c5fbc9..c223dc2427 100644
--- a/packages/image/package.json
+++ b/packages/image/package.json
@@ -23,9 +23,9 @@
"@jest/globals": "^29.6.4",
"@storybook/react": "^7.4.0",
"@types/react": "^18.2.21",
- "@webstudio-is/jest-config": "workspace:^",
- "@webstudio-is/storybook-config": "workspace:^",
- "@webstudio-is/tsconfig": "workspace:^",
+ "@webstudio-is/jest-config": "workspace:*",
+ "@webstudio-is/storybook-config": "workspace:*",
+ "@webstudio-is/tsconfig": "workspace:*",
"jest": "^29.6.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
diff --git a/packages/prisma-client/package.json b/packages/prisma-client/package.json
index 268d8c57e9..4ba98f5c10 100644
--- a/packages/prisma-client/package.json
+++ b/packages/prisma-client/package.json
@@ -19,8 +19,8 @@
"devDependencies": {
"@prisma/client": "^4.14.0",
"@types/node": "^18.11.18",
- "@webstudio-is/scripts": "workspace:^",
- "@webstudio-is/tsconfig": "workspace:^",
+ "@webstudio-is/scripts": "workspace:*",
+ "@webstudio-is/tsconfig": "workspace:*",
"prisma": "^4.14.0",
"tsx": "^3.12.8",
"typescript": "5.2.2",
diff --git a/packages/project-build/package.json b/packages/project-build/package.json
index a343fc0ecc..a9c8c47ce7 100644
--- a/packages/project-build/package.json
+++ b/packages/project-build/package.json
@@ -33,16 +33,16 @@
"dts": "tsc --project tsconfig.dts.json"
},
"dependencies": {
- "@webstudio-is/prisma-client": "workspace:^",
- "@webstudio-is/sdk": "workspace:^",
- "@webstudio-is/trpc-interface": "workspace:^",
+ "@webstudio-is/prisma-client": "workspace:*",
+ "@webstudio-is/sdk": "workspace:*",
+ "@webstudio-is/trpc-interface": "workspace:*",
"nanoid": "^4.0.2",
"zod": "^3.21.4"
},
"devDependencies": {
"@jest/globals": "^29.6.4",
- "@webstudio-is/jest-config": "workspace:^",
- "@webstudio-is/tsconfig": "workspace:^",
+ "@webstudio-is/jest-config": "workspace:*",
+ "@webstudio-is/tsconfig": "workspace:*",
"jest": "^29.6.4",
"type-fest": "^4.3.1",
"typescript": "5.2.2"
diff --git a/packages/project/package.json b/packages/project/package.json
index 1117107e0e..b60f426788 100644
--- a/packages/project/package.json
+++ b/packages/project/package.json
@@ -14,10 +14,10 @@
},
"dependencies": {
"@trpc/server": "^10.38.1",
- "@webstudio-is/asset-uploader": "workspace:^",
- "@webstudio-is/prisma-client": "workspace:^",
- "@webstudio-is/project-build": "workspace:^",
- "@webstudio-is/trpc-interface": "workspace:^",
+ "@webstudio-is/asset-uploader": "workspace:*",
+ "@webstudio-is/prisma-client": "workspace:*",
+ "@webstudio-is/project-build": "workspace:*",
+ "@webstudio-is/trpc-interface": "workspace:*",
"nanoid": "^4.0.2",
"slugify": "^1.6.6",
"uuid": "^9.0.0",
@@ -25,7 +25,7 @@
},
"devDependencies": {
"@types/uuid": "^8.3.4",
- "@webstudio-is/tsconfig": "workspace:^",
+ "@webstudio-is/tsconfig": "workspace:*",
"typescript": "5.2.2"
},
"exports": {
diff --git a/packages/react-sdk/package.json b/packages/react-sdk/package.json
index 773aabcf3a..ab24c944dd 100644
--- a/packages/react-sdk/package.json
+++ b/packages/react-sdk/package.json
@@ -18,8 +18,8 @@
"@remix-run/react": "^1.19.2",
"@types/react": "^18.2.21",
"@types/react-dom": "^18.2.7",
- "@webstudio-is/jest-config": "workspace:^",
- "@webstudio-is/tsconfig": "workspace:^",
+ "@webstudio-is/jest-config": "workspace:*",
+ "@webstudio-is/tsconfig": "workspace:*",
"jest": "^29.6.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
@@ -37,10 +37,10 @@
"dependencies": {
"@jsep-plugin/assignment": "^1.2.1",
"@nanostores/react": "^0.7.1",
- "@webstudio-is/css-engine": "workspace:^",
- "@webstudio-is/fonts": "workspace:^",
- "@webstudio-is/image": "workspace:^",
- "@webstudio-is/sdk": "workspace:^",
+ "@webstudio-is/css-engine": "workspace:*",
+ "@webstudio-is/fonts": "workspace:*",
+ "@webstudio-is/image": "workspace:*",
+ "@webstudio-is/sdk": "workspace:*",
"html-tags": "^3.3.1",
"jsep": "^1.3.8",
"nanoid": "^4.0.2",
diff --git a/packages/scripts/package.json b/packages/scripts/package.json
index 26edb38dca..09c71375fc 100644
--- a/packages/scripts/package.json
+++ b/packages/scripts/package.json
@@ -19,7 +19,7 @@
},
"devDependencies": {
"@types/node": "^18.11.18",
- "@webstudio-is/tsconfig": "workspace:^",
+ "@webstudio-is/tsconfig": "workspace:*",
"tsx": "^3.12.8",
"typescript": "5.2.2"
}
diff --git a/packages/sdk-components-react-radix/package.json b/packages/sdk-components-react-radix/package.json
index da66011415..446b71b0ee 100644
--- a/packages/sdk-components-react-radix/package.json
+++ b/packages/sdk-components-react-radix/package.json
@@ -67,20 +67,20 @@
"@radix-ui/react-switch": "^1.0.3",
"@radix-ui/react-tabs": "^1.0.4",
"@radix-ui/react-tooltip": "^1.0.6",
- "@webstudio-is/css-engine": "workspace:^",
- "@webstudio-is/icons": "workspace:^",
- "@webstudio-is/react-sdk": "workspace:^"
+ "@webstudio-is/css-engine": "workspace:*",
+ "@webstudio-is/icons": "workspace:*",
+ "@webstudio-is/react-sdk": "workspace:*"
},
"devDependencies": {
"@storybook/react": "^7.4.0",
"@types/react": "^18.2.21",
"@types/react-dom": "^18.2.7",
- "@webstudio-is/css-data": "workspace:^",
- "@webstudio-is/generate-arg-types": "workspace:^",
+ "@webstudio-is/css-data": "workspace:*",
+ "@webstudio-is/generate-arg-types": "workspace:*",
"@webstudio-is/sdk-cli": "workspace:^",
- "@webstudio-is/sdk-components-react": "workspace:^",
- "@webstudio-is/storybook-config": "workspace:^",
- "@webstudio-is/tsconfig": "workspace:^",
+ "@webstudio-is/sdk-components-react": "workspace:*",
+ "@webstudio-is/storybook-config": "workspace:*",
+ "@webstudio-is/tsconfig": "workspace:*",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"tailwindcss": "^3.3.3",
diff --git a/packages/sdk-components-react-remix/package.json b/packages/sdk-components-react-remix/package.json
index 05df27ecf6..f41a558e6a 100644
--- a/packages/sdk-components-react-remix/package.json
+++ b/packages/sdk-components-react-remix/package.json
@@ -46,17 +46,17 @@
"react-dom": "^18.2.0"
},
"dependencies": {
- "@webstudio-is/form-handlers": "workspace:^",
- "@webstudio-is/icons": "workspace:^",
- "@webstudio-is/react-sdk": "workspace:^",
- "@webstudio-is/sdk-components-react": "workspace:^"
+ "@webstudio-is/form-handlers": "workspace:*",
+ "@webstudio-is/icons": "workspace:*",
+ "@webstudio-is/react-sdk": "workspace:*",
+ "@webstudio-is/sdk-components-react": "workspace:*"
},
"devDependencies": {
"@remix-run/react": "^1.19.2",
"@types/react": "^18.2.21",
"@types/react-dom": "^18.2.7",
- "@webstudio-is/generate-arg-types": "workspace:^",
- "@webstudio-is/tsconfig": "workspace:^",
+ "@webstudio-is/generate-arg-types": "workspace:*",
+ "@webstudio-is/tsconfig": "workspace:*",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "5.2.2"
diff --git a/packages/sdk-components-react/package.json b/packages/sdk-components-react/package.json
index 2d01b1d84a..7c18975a67 100644
--- a/packages/sdk-components-react/package.json
+++ b/packages/sdk-components-react/package.json
@@ -48,10 +48,10 @@
},
"dependencies": {
"@react-aria/utils": "^3.19.0",
- "@webstudio-is/css-vars": "workspace:^",
- "@webstudio-is/icons": "workspace:^",
- "@webstudio-is/image": "workspace:^",
- "@webstudio-is/react-sdk": "workspace:^",
+ "@webstudio-is/css-vars": "workspace:*",
+ "@webstudio-is/icons": "workspace:*",
+ "@webstudio-is/image": "workspace:*",
+ "@webstudio-is/react-sdk": "workspace:*",
"colord": "^2.9.3",
"shallow-equal": "^3.1.0"
},
@@ -59,9 +59,9 @@
"@storybook/react": "^7.4.0",
"@types/react": "^18.2.21",
"@types/react-dom": "^18.2.7",
- "@webstudio-is/generate-arg-types": "workspace:^",
- "@webstudio-is/storybook-config": "workspace:^",
- "@webstudio-is/tsconfig": "workspace:^",
+ "@webstudio-is/generate-arg-types": "workspace:*",
+ "@webstudio-is/storybook-config": "workspace:*",
+ "@webstudio-is/tsconfig": "workspace:*",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "5.2.2"
diff --git a/packages/sdk-size-test/package.json b/packages/sdk-size-test/package.json
index 9e9b23db38..9cd673e59a 100644
--- a/packages/sdk-size-test/package.json
+++ b/packages/sdk-size-test/package.json
@@ -23,10 +23,10 @@
"@remix-run/cloudflare": "^1.19.2",
"@remix-run/cloudflare-pages": "^1.19.2",
"@remix-run/react": "^1.19.2",
- "@webstudio-is/project": "workspace:^",
- "@webstudio-is/project-build": "workspace:^",
- "@webstudio-is/react-sdk": "workspace:^",
- "@webstudio-is/sdk-components-react": "workspace:^",
+ "@webstudio-is/project": "workspace:*",
+ "@webstudio-is/project-build": "workspace:*",
+ "@webstudio-is/react-sdk": "workspace:*",
+ "@webstudio-is/sdk-components-react": "workspace:*",
"isbot": "^3.6.13",
"react": "^18.2.0",
"react-dom": "^18.2.0"
@@ -36,7 +36,7 @@
"@size-limit/file": "^8.2.6",
"@types/react": "^18.2.21",
"@types/react-dom": "^18.2.7",
- "@webstudio-is/tsconfig": "workspace:^",
+ "@webstudio-is/tsconfig": "workspace:*",
"size-limit": "^8.2.6",
"typescript": "5.2.2"
}
diff --git a/packages/sdk/package.json b/packages/sdk/package.json
index 34c4b4a626..b3183e6d87 100644
--- a/packages/sdk/package.json
+++ b/packages/sdk/package.json
@@ -26,14 +26,14 @@
"dts": "tsc --project tsconfig.dts.json"
},
"dependencies": {
- "@webstudio-is/fonts": "workspace:^",
- "@webstudio-is/css-engine": "workspace:^",
+ "@webstudio-is/fonts": "workspace:*",
+ "@webstudio-is/css-engine": "workspace:*",
"zod": "^3.21.4"
},
"devDependencies": {
"@jest/globals": "^29.6.4",
- "@webstudio-is/jest-config": "workspace:^",
- "@webstudio-is/tsconfig": "workspace:^",
+ "@webstudio-is/jest-config": "workspace:*",
+ "@webstudio-is/tsconfig": "workspace:*",
"jest": "^29.6.4"
}
}
diff --git a/packages/trpc-interface/package.json b/packages/trpc-interface/package.json
index dbce11394b..8d51f8f1a9 100644
--- a/packages/trpc-interface/package.json
+++ b/packages/trpc-interface/package.json
@@ -16,15 +16,15 @@
"dependencies": {
"@trpc/client": "^10.38.1",
"@trpc/server": "^10.38.1",
- "@webstudio-is/prisma-client": "workspace:^",
+ "@webstudio-is/prisma-client": "workspace:*",
"ts-custom-error": "^3.3.1",
"uuid": "^9.0.0",
"zod": "^3.21.4"
},
"devDependencies": {
"@types/node": "^18.11.18",
- "@webstudio-is/jest-config": "workspace:^",
- "@webstudio-is/tsconfig": "workspace:^",
+ "@webstudio-is/jest-config": "workspace:*",
+ "@webstudio-is/tsconfig": "workspace:*",
"typescript": "5.2.2"
},
"exports": {
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 7914df50f3..5b18c4957e 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -25,7 +25,7 @@ importers:
specifier: ^2.3.1
version: 2.3.1(patch_hash=ac22lciodhaj6xmoeignv36gyq)
'@webstudio-is/eslint-config-custom':
- specifier: workspace:^
+ specifier: workspace:*
version: link:packages/eslint-config-custom
esbuild:
specifier: ^0.19.2
@@ -118,73 +118,73 @@ importers:
specifier: ^1.19.2
'@webstudio-is/asset-uploader':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/asset-uploader
'@webstudio-is/authorization-token':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/authorization-token
'@webstudio-is/css-data':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/css-data
'@webstudio-is/css-engine':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/css-engine
'@webstudio-is/css-vars':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/css-vars
'@webstudio-is/dashboard':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/dashboard
'@webstudio-is/design-system':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/design-system
'@webstudio-is/domain':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/domain
'@webstudio-is/error-utils':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/error-utils
'@webstudio-is/feature-flags':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/feature-flags
'@webstudio-is/fonts':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/fonts
'@webstudio-is/http-client':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/http-client
'@webstudio-is/icons':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/icons
'@webstudio-is/image':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/image
'@webstudio-is/prisma-client':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/prisma-client
'@webstudio-is/project':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/project
'@webstudio-is/project-build':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/project-build
'@webstudio-is/react-sdk':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/react-sdk
'@webstudio-is/sdk':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/sdk
'@webstudio-is/sdk-components-react':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/sdk-components-react
'@webstudio-is/sdk-components-react-radix':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/sdk-components-react-radix
'@webstudio-is/sdk-components-react-remix':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/sdk-components-react-remix
'@webstudio-is/trpc-interface':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/trpc-interface
colord:
specifier: ^2.9.3
@@ -338,13 +338,13 @@ importers:
specifier: ^8.3.4
version: 8.3.4
'@webstudio-is/jest-config':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/jest-config
'@webstudio-is/storybook-config':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/storybook-config
'@webstudio-is/tsconfig':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/tsconfig
dotenv:
specifier: ^16.3.1
@@ -365,6 +365,73 @@ importers:
specifier: 5.2.2
version: 5.2.2
+ fixtures/webstudio-custom-template:
+ dependencies:
+ '@remix-run/node':
+ specifier: ^1.19.2
+ version: 1.19.2
+ '@remix-run/react':
+ specifier: ^1.19.2
+ '@remix-run/server-runtime':
+ specifier: ^1.19.2
+ version: 1.19.2
+ '@webstudio-is/form-handlers':
+ specifier: workspace:*
+ version: link:../../packages/form-handlers
+ '@webstudio-is/image':
+ specifier: workspace:*
+ version: link:../../packages/image
+ '@webstudio-is/react-sdk':
+ specifier: workspace:*
+ version: link:../../packages/react-sdk
+ '@webstudio-is/sdk':
+ specifier: workspace:*
+ version: link:../../packages/sdk
+ '@webstudio-is/sdk-components-react':
+ specifier: workspace:*
+ version: link:../../packages/sdk-components-react
+ '@webstudio-is/sdk-components-react-radix':
+ specifier: workspace:*
+ version: link:../../packages/sdk-components-react-radix
+ '@webstudio-is/sdk-components-react-remix':
+ specifier: workspace:*
+ version: link:../../packages/sdk-components-react-remix
+ isbot:
+ specifier: ^3.6.8
+ version: 3.6.13
+ react:
+ specifier: ^18.2.0
+ version: 18.2.0
+ react-dom:
+ specifier: ^18.2.0
+ version: 18.2.0([email protected])
+ devDependencies:
+ '@remix-run/dev':
+ specifier: ^1.19.2
+ version: 1.19.2(@remix-run/[email protected])
+ '@remix-run/serve':
+ specifier: ^1.19.2
+ version: 1.19.2
+ '@types/react':
+ specifier: ^18.2.20
+ version: 18.2.21
+ '@types/react-dom':
+ specifier: ^18.2.7
+ version: 18.2.7
+ '@webstudio-is/http-client':
+ specifier: workspace:*
+ version: link:../../packages/http-client
+ eslint:
+ specifier: ^8.48.0
+ version: 8.48.0
+ typescript:
+ specifier: 5.2.2
+ version: 5.2.2
+ webstudio-cli:
+ specifier: workspace:*
+ version: link:../../packages/cli
+
fixtures/webstudio-remix-vercel:
dependencies:
'@remix-run/node':
@@ -373,26 +440,29 @@ importers:
'@remix-run/react':
specifier: ^1.19.2
+ '@remix-run/server-runtime':
+ specifier: ^1.19.2
+ version: 1.19.2
'@webstudio-is/form-handlers':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/form-handlers
'@webstudio-is/image':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/image
'@webstudio-is/react-sdk':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/react-sdk
'@webstudio-is/sdk':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/sdk
'@webstudio-is/sdk-components-react':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/sdk-components-react
'@webstudio-is/sdk-components-react-radix':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/sdk-components-react-radix
'@webstudio-is/sdk-components-react-remix':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/sdk-components-react-remix
isbot:
specifier: ^3.6.8
@@ -417,7 +487,7 @@ importers:
specifier: ^18.2.7
version: 18.2.7
'@webstudio-is/http-client':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/http-client
eslint:
specifier: ^8.48.0
@@ -426,7 +496,7 @@ importers:
specifier: 5.2.2
version: 5.2.2
webstudio-cli:
- specifier: workspace:^
+ specifier: workspace:*
version: link:../../packages/cli
packages/asset-uploader:
@@ -438,16 +508,16 @@ importers:
specifier: ^2.0.2
version: 2.0.2
'@webstudio-is/fonts':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../fonts
'@webstudio-is/prisma-client':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../prisma-client
'@webstudio-is/sdk':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../sdk
'@webstudio-is/trpc-interface':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../trpc-interface
fontkit:
specifier: ^2.0.2
@@ -475,10 +545,10 @@ importers:
specifier: ^18.11.18
version: 18.13.0
'@webstudio-is/jest-config':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../jest-config
'@webstudio-is/tsconfig':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../tsconfig
jest:
specifier: ^29.6.4
@@ -493,17 +563,17 @@ importers:
packages/authorization-token:
dependencies:
'@webstudio-is/prisma-client':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../prisma-client
'@webstudio-is/trpc-interface':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../trpc-interface
zod:
specifier: ^3.21.4
version: 3.21.4
devDependencies:
'@webstudio-is/tsconfig':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../tsconfig
typescript:
specifier: 5.2.2
@@ -512,25 +582,25 @@ importers:
packages/cli:
dependencies:
'@webstudio-is/http-client':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../http-client
'@webstudio-is/image':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../image
'@webstudio-is/react-sdk':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../react-sdk
'@webstudio-is/sdk':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../sdk
'@webstudio-is/sdk-components-react':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../sdk-components-react
'@webstudio-is/sdk-components-react-radix':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../sdk-components-react-radix
'@webstudio-is/sdk-components-react-remix':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../sdk-components-react-remix
deepmerge:
specifier: ^4.3.1
@@ -559,6 +629,9 @@ importers:
yargs:
specifier: ^17.7.2
version: 17.7.2
+ zod:
+ specifier: ^3.21.4
+ version: 3.21.4
devDependencies:
'@types/node':
specifier: ^18.13.0
@@ -567,10 +640,10 @@ importers:
specifier: ^2.4.4
version: 2.4.4
'@webstudio-is/form-handlers':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../form-handlers
'@webstudio-is/tsconfig':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../tsconfig
tsx:
specifier: ^3.12.8
@@ -582,7 +655,7 @@ importers:
packages/css-data:
dependencies:
'@webstudio-is/css-engine':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../css-engine
colord:
specifier: ^2.9.3
@@ -604,10 +677,10 @@ importers:
specifier: ^2.3.1
version: 2.3.1(patch_hash=ac22lciodhaj6xmoeignv36gyq)
'@webstudio-is/jest-config':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../jest-config
'@webstudio-is/tsconfig':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../tsconfig
camelcase:
specifier: ^7.0.1
@@ -637,10 +710,10 @@ importers:
packages/css-engine:
dependencies:
'@webstudio-is/error-utils':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../error-utils
'@webstudio-is/fonts':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../fonts
hyphenate-style-name:
specifier: ^1.0.4
@@ -659,13 +732,13 @@ importers:
specifier: ^18.2.7
version: 18.2.7
'@webstudio-is/jest-config':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../jest-config
'@webstudio-is/storybook-config':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../storybook-config
'@webstudio-is/tsconfig':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../tsconfig
jest:
specifier: ^29.6.4
@@ -683,26 +756,26 @@ importers:
packages/css-vars:
devDependencies:
'@webstudio-is/tsconfig':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../tsconfig
packages/dashboard:
dependencies:
'@webstudio-is/prisma-client':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../prisma-client
'@webstudio-is/project':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../project
'@webstudio-is/trpc-interface':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../trpc-interface
zod:
specifier: ^3.21.4
version: 3.21.4
devDependencies:
'@webstudio-is/tsconfig':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../tsconfig
typescript:
specifier: 5.2.2
@@ -798,10 +871,10 @@ importers:
specifier: 1.3.1-1
version: 1.3.1-1(patch_hash=knml42mpr6mlzseo3d6gjljiq4)([email protected])
'@webstudio-is/css-vars':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../css-vars
'@webstudio-is/icons':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../icons
camelcase:
specifier: ^7.0.1
@@ -844,13 +917,13 @@ importers:
specifier: ^18.2.7
version: 18.2.7
'@webstudio-is/jest-config':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../jest-config
'@webstudio-is/storybook-config':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../storybook-config
'@webstudio-is/tsconfig':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../tsconfig
jest:
specifier: ^29.6.4
@@ -871,23 +944,23 @@ importers:
packages/domain:
dependencies:
'@webstudio-is/prisma-client':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../prisma-client
'@webstudio-is/project':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../project
'@webstudio-is/project-build':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../project-build
'@webstudio-is/trpc-interface':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../trpc-interface
zod:
specifier: ^3.21.4
version: 3.21.4
devDependencies:
'@webstudio-is/tsconfig':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../tsconfig
typescript:
specifier: 5.2.2
@@ -896,7 +969,7 @@ importers:
packages/error-utils:
devDependencies:
'@webstudio-is/tsconfig':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../tsconfig
packages/eslint-config-custom:
@@ -929,7 +1002,7 @@ importers:
packages/feature-flags:
devDependencies:
'@webstudio-is/tsconfig':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../tsconfig
packages/fonts:
@@ -938,10 +1011,10 @@ importers:
specifier: ^29.6.4
version: 29.6.4
'@webstudio-is/jest-config':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../jest-config
'@webstudio-is/tsconfig':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../tsconfig
jest:
specifier: ^29.6.4
@@ -956,20 +1029,20 @@ importers:
packages/form-handlers:
devDependencies:
'@webstudio-is/tsconfig':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../tsconfig
packages/form-handlers-mailchannels-test:
dependencies:
'@webstudio-is/form-handlers':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../form-handlers
devDependencies:
'@cloudflare/workers-types':
specifier: ^3.0.0
version: 3.19.0
'@webstudio-is/tsconfig':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../tsconfig
typescript:
specifier: 5.2.2
@@ -981,10 +1054,10 @@ importers:
packages/generate-arg-types:
dependencies:
'@webstudio-is/html-data':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../html-data
'@webstudio-is/react-sdk':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../react-sdk
fast-glob:
specifier: ^3.2.12
@@ -997,7 +1070,7 @@ importers:
version: 3.21.4
devDependencies:
'@webstudio-is/tsconfig':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../tsconfig
tsx:
specifier: ^3.12.8
@@ -1009,23 +1082,23 @@ importers:
packages/html-data:
devDependencies:
'@webstudio-is/tsconfig':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../tsconfig
packages/http-client:
dependencies:
'@webstudio-is/sdk':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../sdk
devDependencies:
'@jest/globals':
specifier: ^29.6.4
version: 29.6.4
'@webstudio-is/jest-config':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../jest-config
'@webstudio-is/tsconfig':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../tsconfig
jest:
specifier: ^29.6.4
@@ -1037,7 +1110,7 @@ importers:
packages/icons:
dependencies:
'@webstudio-is/css-vars':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../css-vars
devDependencies:
'@svgo/jsx':
@@ -1047,10 +1120,10 @@ importers:
specifier: ^18.2.21
version: 18.2.21
'@webstudio-is/storybook-config':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../storybook-config
'@webstudio-is/tsconfig':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../tsconfig
react:
specifier: ^18.2.0
@@ -1087,13 +1160,13 @@ importers:
specifier: ^18.2.21
version: 18.2.21
'@webstudio-is/jest-config':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../jest-config
'@webstudio-is/storybook-config':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../storybook-config
'@webstudio-is/tsconfig':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../tsconfig
jest:
specifier: ^29.6.4
@@ -1142,10 +1215,10 @@ importers:
specifier: ^18.11.18
version: 18.13.0
'@webstudio-is/scripts':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../scripts
'@webstudio-is/tsconfig':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../tsconfig
prisma:
specifier: ^4.14.0
@@ -1166,16 +1239,16 @@ importers:
specifier: ^10.38.1
version: 10.38.1
'@webstudio-is/asset-uploader':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../asset-uploader
'@webstudio-is/prisma-client':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../prisma-client
'@webstudio-is/project-build':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../project-build
'@webstudio-is/trpc-interface':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../trpc-interface
nanoid:
specifier: ^4.0.2
@@ -1194,7 +1267,7 @@ importers:
specifier: ^8.3.4
version: 8.3.4
'@webstudio-is/tsconfig':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../tsconfig
typescript:
specifier: 5.2.2
@@ -1203,13 +1276,13 @@ importers:
packages/project-build:
dependencies:
'@webstudio-is/prisma-client':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../prisma-client
'@webstudio-is/sdk':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../sdk
'@webstudio-is/trpc-interface':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../trpc-interface
nanoid:
specifier: ^4.0.2
@@ -1222,10 +1295,10 @@ importers:
specifier: ^29.6.4
version: 29.6.4
'@webstudio-is/jest-config':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../jest-config
'@webstudio-is/tsconfig':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../tsconfig
jest:
specifier: ^29.6.4
@@ -1246,16 +1319,16 @@ importers:
specifier: ^0.7.1
'@webstudio-is/css-engine':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../css-engine
'@webstudio-is/fonts':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../fonts
'@webstudio-is/image':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../image
'@webstudio-is/sdk':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../sdk
html-tags:
specifier: ^3.3.1
@@ -1289,10 +1362,10 @@ importers:
specifier: ^18.2.7
version: 18.2.7
'@webstudio-is/jest-config':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../jest-config
'@webstudio-is/tsconfig':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../tsconfig
jest:
specifier: ^29.6.4
@@ -1329,7 +1402,7 @@ importers:
specifier: ^18.11.18
version: 18.13.0
'@webstudio-is/tsconfig':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../tsconfig
tsx:
specifier: ^3.12.8
@@ -1341,10 +1414,10 @@ importers:
packages/sdk:
dependencies:
'@webstudio-is/css-engine':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../css-engine
'@webstudio-is/fonts':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../fonts
zod:
specifier: ^3.21.4
@@ -1354,10 +1427,10 @@ importers:
specifier: ^29.6.4
version: 29.6.4
'@webstudio-is/jest-config':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../jest-config
'@webstudio-is/tsconfig':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../tsconfig
jest:
specifier: ^29.6.4
@@ -1391,16 +1464,16 @@ importers:
specifier: ^3.19.0
version: 3.19.0([email protected])
'@webstudio-is/css-vars':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../css-vars
'@webstudio-is/icons':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../icons
'@webstudio-is/image':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../image
'@webstudio-is/react-sdk':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../react-sdk
colord:
specifier: ^2.9.3
@@ -1419,13 +1492,13 @@ importers:
specifier: ^18.2.7
version: 18.2.7
'@webstudio-is/generate-arg-types':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../generate-arg-types
'@webstudio-is/storybook-config':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../storybook-config
'@webstudio-is/tsconfig':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../tsconfig
react:
specifier: ^18.2.0
@@ -1476,13 +1549,13 @@ importers:
specifier: ^1.0.6
'@webstudio-is/css-engine':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../css-engine
'@webstudio-is/icons':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../icons
'@webstudio-is/react-sdk':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../react-sdk
devDependencies:
'@storybook/react':
@@ -1495,22 +1568,22 @@ importers:
specifier: ^18.2.7
version: 18.2.7
'@webstudio-is/css-data':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../css-data
'@webstudio-is/generate-arg-types':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../generate-arg-types
'@webstudio-is/sdk-cli':
specifier: workspace:^
version: link:../sdk-cli
'@webstudio-is/sdk-components-react':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../sdk-components-react
'@webstudio-is/storybook-config':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../storybook-config
'@webstudio-is/tsconfig':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../tsconfig
react:
specifier: ^18.2.0
@@ -1528,16 +1601,16 @@ importers:
packages/sdk-components-react-remix:
dependencies:
'@webstudio-is/form-handlers':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../form-handlers
'@webstudio-is/icons':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../icons
'@webstudio-is/react-sdk':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../react-sdk
'@webstudio-is/sdk-components-react':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../sdk-components-react
devDependencies:
'@remix-run/react':
@@ -1550,10 +1623,10 @@ importers:
specifier: ^18.2.7
version: 18.2.7
'@webstudio-is/generate-arg-types':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../generate-arg-types
'@webstudio-is/tsconfig':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../tsconfig
react:
specifier: ^18.2.0
@@ -1577,16 +1650,16 @@ importers:
specifier: ^1.19.2
'@webstudio-is/project':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../project
'@webstudio-is/project-build':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../project-build
'@webstudio-is/react-sdk':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../react-sdk
'@webstudio-is/sdk-components-react':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../sdk-components-react
isbot:
specifier: ^3.6.13
@@ -1611,7 +1684,7 @@ importers:
specifier: ^18.2.7
version: 18.2.7
'@webstudio-is/tsconfig':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../tsconfig
size-limit:
specifier: ^8.2.6
@@ -1659,7 +1732,7 @@ importers:
specifier: ^10.38.1
version: 10.38.1
'@webstudio-is/prisma-client':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../prisma-client
ts-custom-error:
specifier: ^3.3.1
@@ -1675,10 +1748,10 @@ importers:
specifier: ^18.11.18
version: 18.13.0
'@webstudio-is/jest-config':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../jest-config
'@webstudio-is/tsconfig':
- specifier: workspace:^
+ specifier: workspace:*
version: link:../tsconfig
typescript:
specifier: 5.2.2