@shop-on/create-theme 0.14.0-next.0 → 0.14.0-next.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -249,7 +249,7 @@ pnpm theme:check
|
|
|
249
249
|
pnpm theme:check --release # before you hand the theme off: also theme_info
|
|
250
250
|
|
|
251
251
|
# Build (prebuild backfills defaults + runs oxfmt; postbuild emits .output/theme.json
|
|
252
|
-
# and fails on a server bundle over
|
|
252
|
+
# and fails on a server bundle over 3.5 MB or holding a test file)
|
|
253
253
|
pnpm build
|
|
254
254
|
|
|
255
255
|
# Fetching/resolver changes
|
|
@@ -262,7 +262,7 @@ If you added a section/block, it's available in the editor immediately after a h
|
|
|
262
262
|
|
|
263
263
|
## Bundle hygiene — the server artifact is downloaded per cold start
|
|
264
264
|
|
|
265
|
-
`pnpm build` emits a Nitro `cloudflare-module` artifact. Every file under `.output/server/` is packed into the module map a storefront Worker loads on a cold start, whether or not a request ever imports it — so a leaked module costs every shop on every cold start. A full-featured theme sits around ~
|
|
265
|
+
`pnpm build` emits a Nitro `cloudflare-module` artifact. Every file under `.output/server/` is packed into the module map a storefront Worker loads on a cold start, whether or not a request ever imports it — so a leaked module costs every shop on every cold start. A full-featured theme sits around ~2.3.5 MB (minified, names kept); a jump on a small change is a leak. Postbuild fails the build past 3.5 MB, or when `.output/server` holds a `*.test*` file.
|
|
266
266
|
|
|
267
267
|
- **Tests may sit beside the component they cover.** The registries in `src/components/template-renderer.tsx` glob `*.tsx` with `!*.test.tsx` excluded; a `.test.tsx` that slipped in would register as a phantom type and pull the vitest runtime (~800 KB) into the artifact. Don't widen those globs. `src/components/template-renderer.test.ts` guards this.
|
|
268
268
|
- **Browser-only libraries: dynamic `import()` in an effect or handler, AND an entry in `BROWSER_ONLY_IMPORTS`.** A static import puts the library in the server graph; a dynamic one alone still gets inlined, because Nitro's cloudflare preset has no externals. The list makes Nitro leave `import("hls.js/light")` as a bare specifier the server never executes. It lives inside the published `@shop-on/theme-config` (`createThemeViteConfig` takes only `port`), so a theme can't extend it from `vite.config.ts`; it covers `hls.js/light`, `photoswipe`, `photoswipe/lightbox` and `simple-parallax-js/vanilla`. Any other client-only dependency (player, lightbox, parallax, chart) lands in the server artifact — check `_libs/` after adding one.
|
|
@@ -271,7 +271,7 @@ If you added a section/block, it's available in the editor immediately after a h
|
|
|
271
271
|
|
|
272
272
|
```bash
|
|
273
273
|
pnpm build
|
|
274
|
-
du -sh .output/server # postbuild fails past
|
|
274
|
+
du -sh .output/server # postbuild fails past 3.5 MB
|
|
275
275
|
ls -S .output/server/_libs | head # biggest third-party chunks
|
|
276
276
|
```
|
|
277
277
|
|
|
@@ -50,7 +50,7 @@ by hand, as each one says.
|
|
|
50
50
|
| Line | How | Learn it in |
|
|
51
51
|
| ------------------------------------------------------------------------------------------- | ------------------------------------- | --------------------------------------------------------------------------------------------------------- |
|
|
52
52
|
| Lighthouse performance ≥ 60, averaged over home, product and collection, desktop and mobile | audit: 3 runs each, the median counts | [data-fetching.md](data-fetching.md) |
|
|
53
|
-
| `.output/server` under
|
|
53
|
+
| `.output/server` under 3.5 MB | build | [SKILL.md § Bundle hygiene](../SKILL.md#bundle-hygiene--the-server-artifact-is-downloaded-per-cold-start) |
|
|
54
54
|
| no test file in `.output/server` | build | [SKILL.md § Bundle hygiene](../SKILL.md#bundle-hygiene--the-server-artifact-is-downloaded-per-cold-start) |
|
|
55
55
|
| no browser-only library in `.output/server/_libs` | review: `ls -S .output/server/_libs` | [SKILL.md § Bundle hygiene](../SKILL.md#bundle-hygiene--the-server-artifact-is-downloaded-per-cold-start) |
|
|
56
56
|
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
# What `shop-on theme source` leaves out of the tarball you submit, in gitignore
|
|
2
|
+
# syntax. It already leaves out installs, build output, credentials, `.git` and
|
|
3
|
+
# `.claude/`, and nothing here brings those back. Keep what the build needs.
|
|
4
|
+
#
|
|
5
|
+
# /notes/
|
|
6
|
+
# *.stories.tsx
|
package/template/package.json
CHANGED
|
@@ -17,14 +17,14 @@
|
|
|
17
17
|
},
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@bprogress/core": "1.3.4",
|
|
20
|
-
"@shop-on/i18n": "^0.14.0-next.
|
|
21
|
-
"@shop-on/theme-contract": "^0.14.0-next.
|
|
22
|
-
"@shop-on/theme-loader": "^0.14.0-next.
|
|
23
|
-
"@shop-on/theme-react": "^0.14.0-next.
|
|
24
|
-
"@shop-on/theme-routes": "^0.14.0-next.
|
|
25
|
-
"@shop-on/theme-runtime": "^0.14.0-next.
|
|
26
|
-
"@shop-on/theme-server": "^0.14.0-next.
|
|
27
|
-
"@shop-on/theme-system": "^0.14.0-next.
|
|
20
|
+
"@shop-on/i18n": "^0.14.0-next.1",
|
|
21
|
+
"@shop-on/theme-contract": "^0.14.0-next.1",
|
|
22
|
+
"@shop-on/theme-loader": "^0.14.0-next.1",
|
|
23
|
+
"@shop-on/theme-react": "^0.14.0-next.1",
|
|
24
|
+
"@shop-on/theme-routes": "^0.14.0-next.1",
|
|
25
|
+
"@shop-on/theme-runtime": "^0.14.0-next.1",
|
|
26
|
+
"@shop-on/theme-server": "^0.14.0-next.1",
|
|
27
|
+
"@shop-on/theme-system": "^0.14.0-next.1",
|
|
28
28
|
"@tailwindcss/vite": "4.3.5",
|
|
29
29
|
"@tanstack/react-router": "1.170.46",
|
|
30
30
|
"@tanstack/react-start": "1.169.5",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"tailwindcss": "4.3.5"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@shop-on/theme-config": "^0.14.0-next.
|
|
39
|
-
"@shop-on/theme-dev-host": "^0.14.0-next.
|
|
38
|
+
"@shop-on/theme-config": "^0.14.0-next.1",
|
|
39
|
+
"@shop-on/theme-dev-host": "^0.14.0-next.1",
|
|
40
40
|
"@spiriit/vite-plugin-svg-spritemap": "7.2.0",
|
|
41
41
|
"@types/node": "26.6.6",
|
|
42
42
|
"@types/react": "19.3.0",
|