Skip to content

Commit a3bebd0

Browse files
v2068: Migrate Sidebars previews and patch DOMPurify
Samebase-Source-Repository: samebase/samebase Samebase-Source-Commit: 7884296639df77b24c4f9e3242c46fff9b12325b Samebase-Source-Path: apps/sidebars-example
1 parent 6519f71 commit a3bebd0

5 files changed

Lines changed: 217 additions & 303 deletions

File tree

‎README.md‎

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ pnpm run dev
2727
pnpm run build
2828
pnpm run check
2929
pnpm run deploy:dry-run
30-
pnpm run deploy:preview:dry-run
3130
pnpm run format
3231
pnpm run format:check
3332
pnpm run lint
@@ -38,14 +37,20 @@ pnpm run typecheck
3837
## Cloudflare deployment
3938

4039
Use the repository root as the Cloudflare Workers Builds root directory. Run `pnpm run build`, then
41-
`pnpm run deploy` for `main` or `pnpm run deploy:preview` for other branches. The deploy script uses
42-
the connected Worker name that Cloudflare supplies and does not repeat the build during Workers
43-
Builds.
44-
45-
For a local upload check, set `CLOUDFLARE_WORKER_NAME` to `samebase-sidebars-example`, then run one
46-
of the dry-run commands above. `wrangler.jsonc` publishes `dist/client` with the standard Samebase
47-
observability and SPA settings. `public/_redirects` maps `/` to its prerendered HTML file while
48-
`index.html` remains the SPA fallback.
40+
`pnpm run deploy` for `main` or `pnpm run deploy:preview` for other branches. Wrangler uses the
41+
connected Worker name that Cloudflare supplies. Enable native Worker Previews for the existing
42+
connection as described in the
43+
[migration guide](https://samebase.com/docs/cloudflare-previews-migration). This app does not use
44+
Convex or deploy keys.
45+
46+
Build before a manual deploy. Use `pnpm run deploy --name samebase-sidebars-example` for production
47+
or `pnpm run deploy:preview --worker-name samebase-sidebars-example` for a preview. For a local
48+
check without an upload, run `pnpm run deploy:dry-run --name samebase-sidebars-example`. It builds
49+
the app before the production dry run. Worker Previews has no dry-run mode.
50+
51+
`wrangler.jsonc` publishes `dist/client` with the standard Samebase observability and SPA settings.
52+
`public/_redirects` maps `/` to its prerendered HTML file while `index.html` remains the SPA
53+
fallback.
4954

5055
## Architecture
5156

‎package.json‎

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,12 @@
1010
},
1111
"type": "module",
1212
"scripts": {
13-
"build": "vp run build:cloudflare",
13+
"build": "vp run build:app",
1414
"build:app": "vp build",
15-
"build:cloudflare": "vp run build:app",
1615
"check": "vp check && vp run typecheck && vp test && vp run build:app",
17-
"deploy": "node ./scripts/deploy-cloudflare.ts deploy",
18-
"deploy:preview": "node ./scripts/deploy-cloudflare.ts preview",
19-
"deploy:dry-run": "node ./scripts/deploy-cloudflare.ts deploy --dry-run",
20-
"deploy:preview:dry-run": "node ./scripts/deploy-cloudflare.ts preview --dry-run",
16+
"deploy": "wrangler deploy",
17+
"deploy:preview": "wrangler preview",
18+
"deploy:dry-run": "vp run build:app && wrangler deploy --dry-run",
2119
"dev": "vp dev",
2220
"format": "vp fmt",
2321
"format:check": "vp fmt --check",
@@ -44,7 +42,7 @@
4442
"typescript": "5.9.2",
4543
"vite": "npm:@voidzero-dev/vite-plus-core@0.3.0",
4644
"vite-plus": "0.3.0",
47-
"wrangler": "4.92.0"
45+
"wrangler": "4.136.2"
4846
},
4947
"engines": {
5048
"node": ">=24.11.0",

0 commit comments

Comments
 (0)