@stacksjs/types 0.75.99 → 0.75.100

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.
Files changed (2) hide show
  1. package/dist/server.d.ts +23 -2
  2. package/package.json +4 -4
package/dist/server.d.ts CHANGED
@@ -15,11 +15,32 @@ export declare interface ApiProxyOptions {
15
15
  paths?: string[]
16
16
  methods?: string[]
17
17
  }
18
+ /**
19
+ * A domain route that also says where the rest of the site lives.
20
+ *
21
+ * ```ts
22
+ * domains: {
23
+ * '{username}.example.com': { to: '/{username}', elsewhere: 'https://example.com' },
24
+ * }
25
+ * ```
26
+ *
27
+ * The host's root is still the page. Any other page on it redirects to
28
+ * `elsewhere` (`chris.example.com/pricing` → `example.com/pricing`), while
29
+ * its assets, `/api` and `public/` files are answered in place for the page
30
+ * at the root. A browser keeps a session per origin, so without this a
31
+ * visitor who signs in from a profile's own domain is signed in to that
32
+ * domain alone, and goes on using the app under someone else's name.
33
+ * stx >= 0.2.411.
34
+ */
35
+ export declare interface DomainRouteTarget {
36
+ to: string
37
+ elsewhere?: string
38
+ }
18
39
  export declare interface ServerConfig {
19
40
  proxy?: ApiProxyOptions
20
41
  redirects?: RedirectsOptions
21
42
  rewrites?: RewritesOptions
22
- domains?: DomainsOptions
43
+ domains?: DomainRoutes
23
44
  cache?: ServerCacheOptions
24
45
  security?: ServerSecurityOptions
25
46
  }
@@ -142,4 +163,4 @@ export type RewritesOptions = Record<string, string>;
142
163
  * Answered by stx's own router (`serve({ domains })`, stx >= 0.2.410) under
143
164
  * both `buddy dev` and `buddy serve`; `buddy dev` prints the routes at boot.
144
165
  */
145
- export type DomainsOptions = Record<string, string>;
166
+ export type DomainRoutes = Record<string, string | DomainRouteTarget>;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@stacksjs/types",
3
3
  "type": "module",
4
- "version": "0.75.99",
4
+ "version": "0.75.100",
5
5
  "description": "The Stacks framework types.",
6
6
  "author": "Chris Breuer",
7
7
  "contributors": [
@@ -58,8 +58,8 @@
58
58
  "dependencies": {
59
59
  "@stacksjs/bunpress": "^0.2.15",
60
60
  "@stacksjs/clapp": "^0.2.12",
61
- "@stacksjs/events": "0.75.99",
62
- "@stacksjs/strings": "0.75.99",
61
+ "@stacksjs/events": "0.75.100",
62
+ "@stacksjs/strings": "0.75.100",
63
63
  "@stacksjs/stx": "^0.2.408",
64
64
  "@stacksjs/ts-validation": "^0.5.6",
65
65
  "bun-query-builder": "^0.3.5"
@@ -73,7 +73,7 @@
73
73
  }
74
74
  },
75
75
  "devDependencies": {
76
- "@stacksjs/validation": "0.75.99",
76
+ "@stacksjs/validation": "0.75.100",
77
77
  "better-dx": "^0.2.24",
78
78
  "meilisearch": "^0.62.0"
79
79
  },