@stacksjs/types 0.70.318 → 0.70.320
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/server.d.ts +37 -6
- package/package.json +2 -2
package/dist/server.d.ts
CHANGED
|
@@ -15,14 +15,9 @@ export declare interface ApiProxyOptions {
|
|
|
15
15
|
paths?: string[]
|
|
16
16
|
methods?: string[]
|
|
17
17
|
}
|
|
18
|
-
/**
|
|
19
|
-
* **Server Options** - `config/server.ts`.
|
|
20
|
-
*
|
|
21
|
-
* How the views server behaves in the split views/API topology, shared by
|
|
22
|
-
* `buddy dev` and `buddy serve`.
|
|
23
|
-
*/
|
|
24
18
|
export declare interface ServerConfig {
|
|
25
19
|
proxy?: ApiProxyOptions
|
|
20
|
+
redirects?: RedirectsOptions
|
|
26
21
|
}
|
|
27
22
|
export declare interface ServerOptions {
|
|
28
23
|
type?:
|
|
@@ -40,3 +35,39 @@ export declare interface ServerOptions {
|
|
|
40
35
|
port?: number
|
|
41
36
|
open?: boolean
|
|
42
37
|
}
|
|
38
|
+
/**
|
|
39
|
+
* **Server Options** - `config/server.ts`.
|
|
40
|
+
*
|
|
41
|
+
* How the views server behaves in the split views/API topology, shared by
|
|
42
|
+
* `buddy dev` and `buddy serve`.
|
|
43
|
+
*/
|
|
44
|
+
/**
|
|
45
|
+
* URLs the site used to have, and where they go now.
|
|
46
|
+
*
|
|
47
|
+
* A site that replaces an older one inherits its URLs, and a 301 is the only
|
|
48
|
+
* thing that carries their standing in a search index across to the new page.
|
|
49
|
+
* Keys are the old paths; values are either the new path or an object.
|
|
50
|
+
*
|
|
51
|
+
* ```ts
|
|
52
|
+
* redirects: {
|
|
53
|
+
* '/old-page': '/new-page',
|
|
54
|
+
* '/summer-sale': { to: '/specials', status: 302 },
|
|
55
|
+
* '/docs': { to: 'https://docs.example.com', preserveQuery: false },
|
|
56
|
+
* }
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* Matching is exact on the path, ignoring a trailing slash. Rules are answered
|
|
60
|
+
* before a page is looked for and before `public/` is searched, so a rule
|
|
61
|
+
* shadows a static file of the same name — the same caveat as `proxy.paths`.
|
|
62
|
+
* Anything under `/api/` is ignored.
|
|
63
|
+
*
|
|
64
|
+
* `buddy dev` prints the effective rules at boot.
|
|
65
|
+
*/
|
|
66
|
+
export type RedirectsOptions = Record<string, string | {
|
|
67
|
+
/** Where to send the request. A path, or an absolute URL to leave the site. */
|
|
68
|
+
to: string
|
|
69
|
+
/** Defaults to 301. Use 302 for something genuinely temporary. */
|
|
70
|
+
status?: number
|
|
71
|
+
/** Carry the incoming query string onto the target. Defaults to true. */
|
|
72
|
+
preserveQuery?: boolean
|
|
73
|
+
}>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stacksjs/types",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.70.
|
|
4
|
+
"version": "0.70.320",
|
|
5
5
|
"description": "The Stacks framework types.",
|
|
6
6
|
"author": "Chris Breuer",
|
|
7
7
|
"contributors": [
|
|
@@ -71,7 +71,7 @@
|
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
|
74
|
-
"@stacksjs/validation": "0.70.
|
|
74
|
+
"@stacksjs/validation": "0.70.320",
|
|
75
75
|
"better-dx": "^0.2.17",
|
|
76
76
|
"meilisearch": "^0.59.0"
|
|
77
77
|
},
|