@stacksjs/sites 0.74.51 → 0.74.53
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/README.md +7 -4
- package/dist/snapshot.d.ts +2 -2
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -14,10 +14,13 @@ A host resolves in this order:
|
|
|
14
14
|
|
|
15
15
|
- **API / bun-router:** the `siteResolver` middleware stamps `request.site`
|
|
16
16
|
and the ambient AsyncLocalStorage context (`currentSite()`, `requireSite()`).
|
|
17
|
-
- **STX pages:**
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
`
|
|
17
|
+
- **STX pages:** the view servers resolve the site after an `await` in stx
|
|
18
|
+
serve's `onRequest` hook, and the ALS context `setCurrentSite` enters there
|
|
19
|
+
ends with the hook, before the render. The serving layer stores
|
|
20
|
+
`toSiteSnapshot(site)` on the request's snapshot (`enterRequestScope` in
|
|
21
|
+
`@stacksjs/config`), and `<script server>` blocks read
|
|
22
|
+
`requestContext.site()`. Never call `currentSite()` from an stx server
|
|
23
|
+
script.
|
|
21
24
|
|
|
22
25
|
## Scoping is explicit
|
|
23
26
|
|
package/dist/snapshot.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ export declare function toSiteSnapshot(site: SiteContext | null | undefined): Si
|
|
|
3
3
|
/**
|
|
4
4
|
* The shape the stx serving layer stashes on the request-context snapshot
|
|
5
5
|
* (`RequestContextSnapshot.site` in `@stacksjs/config`), which is how
|
|
6
|
-
* `<script server>` blocks see the site
|
|
7
|
-
*
|
|
6
|
+
* `<script server>` blocks see the site. The snapshot rides on the request
|
|
7
|
+
* scope both view servers enter at the start of onRequest.
|
|
8
8
|
*/
|
|
9
9
|
export declare interface SiteSnapshotShape {
|
|
10
10
|
id: number
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/sites",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.74.
|
|
4
|
+
"version": "0.74.53",
|
|
5
5
|
"description": "The Stacks multi-site (request-level tenancy) functionality.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"contributors": [
|
|
@@ -56,18 +56,18 @@
|
|
|
56
56
|
"prepublishOnly": "bun run build"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@stacksjs/auth": "0.74.
|
|
60
|
-
"@stacksjs/config": "0.74.
|
|
61
|
-
"@stacksjs/database": "0.74.
|
|
62
|
-
"@stacksjs/router": "0.74.
|
|
59
|
+
"@stacksjs/auth": "0.74.53",
|
|
60
|
+
"@stacksjs/config": "0.74.53",
|
|
61
|
+
"@stacksjs/database": "0.74.53",
|
|
62
|
+
"@stacksjs/router": "0.74.53"
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
|
-
"@stacksjs/error-handling": "0.74.
|
|
65
|
+
"@stacksjs/error-handling": "0.74.53",
|
|
66
66
|
"better-dx": "^0.2.24"
|
|
67
67
|
},
|
|
68
68
|
"sideEffects": false,
|
|
69
69
|
"peerDependencies": {
|
|
70
|
-
"@stacksjs/cms": "0.74.
|
|
70
|
+
"@stacksjs/cms": "0.74.53"
|
|
71
71
|
},
|
|
72
72
|
"peerDependenciesMeta": {
|
|
73
73
|
"@stacksjs/cms": {
|