Skip to content

Commit d07cef8

Browse files
authored
refactor: drop --preview flag from CLI (#4707)
We figured assets can be loaded from shared url without additional manipulation. Here got rid of asset origin detection and dropped excessive --preview flag. Now local, staging and prod will work automatically.
1 parent 71f56ea commit d07cef8

File tree

19 files changed

+26
-37
lines changed

19 files changed

+26
-37
lines changed

.github/workflows/cli-r2-static.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ jobs:
9696
run: tar --use-compress-program="zstd -d" -xf ssg-template.tar.zst -C .
9797

9898
- name: Webstudio Build
99-
run: pnpm webstudio build --template ssg --template internal --preview
99+
run: pnpm webstudio build --template ssg --template internal
100100
working-directory: ${{ github.workspace }}/ssg-template
101101

102102
- name: Build

fixtures/ssg-netlify-by-project-id/.webstudio/data.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,5 +136,6 @@
136136
"email": "hello@webstudio.is"
137137
},
138138
"projectDomain": "fixture-client-do-not-touch-wsmel",
139-
"projectTitle": "FIXTURE-CLIENT-DO-NOT-TOUCH"
139+
"projectTitle": "FIXTURE-CLIENT-DO-NOT-TOUCH",
140+
"origin": "https://main.development.webstudio.is"
140141
}

fixtures/ssg-netlify-by-project-id/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"cli": "NODE_OPTIONS='--conditions=webstudio --import=tsx' webstudio",
1111
"fixtures:link": "pnpm cli link --link https://p-8a7358b1-7de3-459d-b7b1-56dddfb6ce1e-dot-${BUILDER_HOST:-main.development.webstudio.is}'?authToken=f55154e6-36b9-4920-bc81-3095cc88f8ff'",
1212
"fixtures:sync": "pnpm cli sync && pnpm prettier --write ./.webstudio/",
13-
"fixtures:build": "rm -rf pages && pnpm cli build --template ssg-netlify --template internal --preview && prettier --write ."
13+
"fixtures:build": "rm -rf pages && pnpm cli build --template ssg-netlify --template internal && prettier --write ."
1414
},
1515
"engines": {
1616
"node": ">=20.0.0"

fixtures/ssg/.webstudio/data.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,5 +493,6 @@
493493
"email": "hello@webstudio.is"
494494
},
495495
"projectDomain": "cli-basic-test-d0osr",
496-
"projectTitle": "cli-basic-test"
496+
"projectTitle": "cli-basic-test",
497+
"origin": "https://main.development.webstudio.is"
497498
}

fixtures/ssg/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"cli": "NODE_OPTIONS='--conditions=webstudio --import=tsx' webstudio",
1111
"fixtures:link": "pnpm cli link --link ${BUILDER_URL_DEPRECATED:-https://main.development.webstudio.is}'/builder/d845c167-ea07-4875-b08d-83e97c09dcce?authToken=e9d1343f-9298-4fd3-a66e-f89a5af2dd93'",
1212
"fixtures:sync": "pnpm cli sync --buildId a2e8de30-03d5-4514-a3a6-406b3266a3af && pnpm prettier --write ./.webstudio/",
13-
"fixtures:build": "rm -rf pages && pnpm cli build --template ssg --template internal --preview && prettier --write ."
13+
"fixtures:build": "rm -rf pages && pnpm cli build --template ssg --template internal && prettier --write ."
1414
},
1515
"engines": {
1616
"node": ">=20.0.0"

fixtures/webstudio-cloudflare-template/.webstudio/data.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,5 +493,6 @@
493493
"email": "hello@webstudio.is"
494494
},
495495
"projectDomain": "cli-basic-test-d0osr",
496-
"projectTitle": "cli-basic-test"
496+
"projectTitle": "cli-basic-test",
497+
"origin": "https://main.development.webstudio.is"
497498
}

fixtures/webstudio-cloudflare-template/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"cli": "NODE_OPTIONS='--conditions=webstudio --import=tsx' webstudio",
55
"fixtures:link": "pnpm cli link --link https://p-d845c167-ea07-4875-b08d-83e97c09dcce-dot-${BUILDER_HOST:-main.development.webstudio.is}'?authToken=e9d1343f-9298-4fd3-a66e-f89a5af2dd93'",
66
"fixtures:sync": "pnpm cli sync --buildId a2e8de30-03d5-4514-a3a6-406b3266a3af && pnpm prettier --write ./.webstudio/",
7-
"fixtures:build": "pnpm cli build --template cloudflare --template saas-helpers --template internal --preview && pnpm prettier --write ./app/ ./package.json ./tsconfig.json",
7+
"fixtures:build": "pnpm cli build --template cloudflare --template saas-helpers --template internal && pnpm prettier --write ./app/ ./package.json ./tsconfig.json",
88
"build": "remix vite:build",
99
"dev": "remix vite:dev",
1010
"typecheck": "tsc",

fixtures/webstudio-custom-template/.webstudio/data.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2331,5 +2331,6 @@
23312331
"email": "hello@webstudio.is"
23322332
},
23332333
"projectDomain": "webstudio-custom-template-cochj",
2334-
"projectTitle": "webstudio-custom-template"
2334+
"projectTitle": "webstudio-custom-template",
2335+
"origin": "https://main.development.webstudio.is"
23352336
}

fixtures/webstudio-custom-template/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"cli": "NODE_OPTIONS='--conditions=webstudio --import=tsx' webstudio",
88
"fixtures:link": "pnpm cli link --link https://p-0d856812-61d8-4014-a20a-82e01c0eb8ee-dot-${BUILDER_HOST:-main.development.webstudio.is}'?authToken=d225fafb-4f20-4340-9359-c21df7c49a3f'",
99
"fixtures:sync": "pnpm cli sync --buildId d48c7c5e-fdd3-4ef6-9173-ff2eaaf851d9 && pnpm prettier --write ./.webstudio/",
10-
"fixtures:build": "pnpm cli build --template defaults --template ./custom-template --template ./custom-template-stage --template internal --preview --assets false && pnpm prettier --write ./app/ ./package.json ./tsconfig.json"
10+
"fixtures:build": "pnpm cli build --template defaults --template ./custom-template --template ./custom-template-stage --template internal --assets false && pnpm prettier --write ./app/ ./package.json ./tsconfig.json"
1111
},
1212
"private": true,
1313
"sideEffects": false,

fixtures/webstudio-remix-netlify-edge-functions/.webstudio/data.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,5 +493,6 @@
493493
"email": "hello@webstudio.is"
494494
},
495495
"projectDomain": "cli-basic-test-d0osr",
496-
"projectTitle": "cli-basic-test"
496+
"projectTitle": "cli-basic-test",
497+
"origin": "https://main.development.webstudio.is"
497498
}

0 commit comments

Comments
 (0)