@barefootjs/cli 0.2.0 → 0.4.0
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/dist/docs/core/adapters/hono-adapter.md +21 -0
- package/dist/index.js +2486 -1375
- package/dist/preview-globals.css +173 -0
- package/dist/preview-uno.config.ts +134 -0
- package/package.json +2 -2
|
@@ -197,3 +197,24 @@ Ternaries with element branches use `bf-c` markers. Text-only ternaries use comm
|
|
|
197
197
|
```
|
|
198
198
|
|
|
199
199
|
Loop markers (`<!--bf-loop-->...<!--bf-/loop-->`) are used for reconciliation. For child components in loops, the adapter generates unique instance IDs per iteration using the loop index or `key`.
|
|
200
|
+
|
|
201
|
+
## Deploying to Cloudflare Workers
|
|
202
|
+
|
|
203
|
+
`bf build` writes browser-served files (`barefoot.js`, `*.client.js`, vendor chunks) and server/build-only files (the SSR `.tsx` templates, `manifest.json`, `barefoot-externals.json`, `.bfemit.json`, `.buildcache.json`, `.dev/`) into the same `outDir`. With Workers Assets, `assets.directory` serves that whole directory, so a naive `wrangler deploy` would upload the server-only files too — shipping the SSR template source and build internals as publicly fetchable assets.
|
|
204
|
+
|
|
205
|
+
To prevent this, `bf build` maintains a [`.assetsignore`](https://developers.cloudflare.com/workers/static-assets/#ignoring-assets) in `outDir` whenever the project targets Workers (detected by a `wrangler.toml` / `wrangler.json` / `wrangler.jsonc` next to `barefoot.config.ts`). The server/build-only outputs are listed in a managed block that's regenerated on every build:
|
|
206
|
+
|
|
207
|
+
```
|
|
208
|
+
# >>> barefoot managed block (generated by `bf build`) >>>
|
|
209
|
+
# Server/build-only barefoot outputs — not browser-served. Regenerated on
|
|
210
|
+
# every `bf build`; add your own entries outside this block.
|
|
211
|
+
.bfemit.json
|
|
212
|
+
.buildcache.json
|
|
213
|
+
.dev/
|
|
214
|
+
barefoot-externals.json
|
|
215
|
+
components/Counter.tsx
|
|
216
|
+
components/manifest.json
|
|
217
|
+
# <<< barefoot managed block <<<
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
Anything you add outside the managed markers is preserved across rebuilds. The browser-served outputs (`barefoot.js`, `*.client.js`, vendor chunks) are intentionally left out so they still deploy.
|