@foliwake/server 0.8.0 → 0.10.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/CHANGELOG.md +60 -0
- package/README.md +589 -7
- package/dist/blocks-header.d.ts +5 -0
- package/dist/blocks-header.js +47 -0
- package/dist/config-checks.d.ts +9 -0
- package/dist/config-checks.js +53 -0
- package/dist/config-parts.d.ts +50 -0
- package/dist/config-parts.js +190 -0
- package/dist/config-v3.d.ts +22 -0
- package/dist/config-v3.js +104 -0
- package/dist/config.d.ts +11 -11
- package/dist/config.js +7 -222
- package/dist/discovery.d.ts +48 -0
- package/dist/discovery.js +150 -0
- package/dist/handler.d.ts +46 -0
- package/dist/handler.js +153 -0
- package/dist/hook-endpoint.d.ts +35 -0
- package/dist/hook-endpoint.js +143 -0
- package/dist/hook.d.ts +91 -0
- package/dist/hook.js +188 -0
- package/dist/page-title.d.ts +3 -0
- package/dist/page-title.js +16 -0
- package/dist/page.d.ts +12 -2
- package/dist/page.js +32 -12
- package/dist/preload.d.ts +1 -1
- package/dist/preload.js +4 -4
- package/dist/resolve.d.ts +31 -0
- package/dist/resolve.js +76 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +3 -0
- package/package.json +25 -3
- package/schemas/remote-3.schema.json +204 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,66 @@ minor release may break; breaking changes are marked **BREAKING**.
|
|
|
7
7
|
|
|
8
8
|
Entries are written from the changesets of each pull request (`.changeset/`, CONTRIBUTING.md), newest first.
|
|
9
9
|
|
|
10
|
+
## 0.10.0
|
|
11
|
+
|
|
12
|
+
### Minor Changes
|
|
13
|
+
|
|
14
|
+
- 339fb47: A page's code release names its blocks module. `readEnvelope` reads `X-Foliwake-Blocks`
|
|
15
|
+
(`entry="scripts/blocks.js", contract=2, prefix="demo"`) into `envelope.blocks`; with a version 3 config without
|
|
16
|
+
`app.blocks`, `preparePage` mounts that entry with its contract and event prefix (`app.blocks` still wins, and a
|
|
17
|
+
version 2 config is unchanged). Preload hints follow the page's entry. `FoliwakePageData.title` is the text of the
|
|
18
|
+
body's first `<h1>`. `@foliwake/site-check` accepts and checks the optional `blocks` key of
|
|
19
|
+
`components/components.json` with the engine's rule (an entry under scripts, components or _foliwake ending in .js
|
|
20
|
+
that exists, a contract major, an event prefix).
|
|
21
|
+
- 69caab7: Configure an app by one address. `@foliwake/server/discovery` reads a site's `/.well-known/foliwake.json`
|
|
22
|
+
(no redirects, 5 s, one retry, at most 16 KiB; `live.url` must be the origin it was read from; the discovery format
|
|
23
|
+
and the plain contract are checked). `@foliwake/server/resolve` builds the app config from `FOLIWAKE_URL` and the
|
|
24
|
+
optional `foliwake.remote.json` version 3 (overrides only: pages, revalidate, proxies, media, blocks, auth by
|
|
25
|
+
variable name; schema `schemas/remote-3.schema.json`, also shipped in `@foliwake/next`). Defaults: pages `/**`
|
|
26
|
+
(required explicitly when live uses a service token), proxies `/foliwake/code` and `/foliwake/media`, preview
|
|
27
|
+
read with Basic `preview` and `FOLIWAKE_PREVIEW_TOKEN`. A version 2 file without `FOLIWAKE_URL` works unchanged.
|
|
28
|
+
`FoliwakeAppConfig.version` is now `2 | 3` and `app.blocks` has `fromRelease`. The compatibility metadata is
|
|
29
|
+
`remoteConfig: 3, discovery: 1`.
|
|
30
|
+
- df85d39: `@foliwake/server/handler`: `createFoliwakeHandler()` serves every Foliwake route of an app as one
|
|
31
|
+
`(request: Request) => Promise<Response>` on the Web Fetch API, for any framework: the code and media proxies under
|
|
32
|
+
the config's prefixes (`/foliwake/code`, `/foliwake/media` by default), `POST /foliwake/hook` (secret in
|
|
33
|
+
`FOLIWAKE_HOOK_SECRET`, `onDelivery` for the app's caches) and `GET /foliwake/health`. Preview is off unless
|
|
34
|
+
`authorizePreview` is given. The config is read on the first request (`FOLIWAKE_URL`), or passed as `config`.
|
|
35
|
+
The hook endpoint core moved from `@foliwake/next` to `@foliwake/server/hook-endpoint` (`createHookEndpoint`);
|
|
36
|
+
a ping of the Next route still answers `@foliwake/next/<version>`. New guide: "Any framework: one handler".
|
|
37
|
+
|
|
38
|
+
### Patch Changes
|
|
39
|
+
|
|
40
|
+
- Updated dependencies [339fb47]
|
|
41
|
+
- @foliwake/blocks-contract@0.10.0
|
|
42
|
+
|
|
43
|
+
## 0.9.0
|
|
44
|
+
|
|
45
|
+
### Minor Changes
|
|
46
|
+
|
|
47
|
+
- 003f643: Apps can be told when the live site changes. `@foliwake/server/hook` verifies the signed hook a Foliwake server
|
|
48
|
+
sends once a change is live and the caches in front of the origin serve it (`verifyFoliwakeSignature`,
|
|
49
|
+
`parseFoliwakeHook`, `signFoliwakeHook` for tests, payload types). `@foliwake/next/revalidate` adds
|
|
50
|
+
`foliwakeRevalidateHandler({ secretEnv })`, a route handler that expires the live tag of every changed path, or
|
|
51
|
+
of the whole site when every page changed, with `{ expire: 0 }` by default (`mode: 'max'` for background
|
|
52
|
+
refresh), reads up to 20 changed pages again after answering (`warm`), accepts a previous secret while it is
|
|
53
|
+
rotated (`previousSecretEnv`) and calls `onDelivery(payload)`.
|
|
54
|
+
- 6dd1fd4: **BREAKING** `PageEnvelope.generation` is now a number (`X-Site-Generation`, the live generation, which only
|
|
55
|
+
grows), or null when the origin sends none; it was a string. An origin that sends a value that is not a
|
|
56
|
+
non-negative integer is refused (`FoliwakePageError` kind `invalid`). Code that compared or stored the string
|
|
57
|
+
needs updating.
|
|
58
|
+
|
|
59
|
+
`@foliwake/next/cache` adds `setGenerationFloor((site) => Promise<number | null>)`: the app's highest known live
|
|
60
|
+
generation (for example written by the hook's `onDelivery`). A cached live read whose generation is below the
|
|
61
|
+
floor no longer stays for `app.revalidate` seconds: it lives at most 15 seconds and is read again, and the old
|
|
62
|
+
page is shown meanwhile instead of an error. A floor that cannot be read turns the check off for that read and
|
|
63
|
+
logs; without a floor nothing changes.
|
|
64
|
+
|
|
65
|
+
### Patch Changes
|
|
66
|
+
|
|
67
|
+
- Updated dependencies [6dd1fd4]
|
|
68
|
+
- @foliwake/blocks-contract@0.9.0
|
|
69
|
+
|
|
10
70
|
## 0.8.0
|
|
11
71
|
|
|
12
72
|
### Patch Changes
|