@crombolo/simple-redirects 0.9.1 → 0.11.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/package.json +7 -3
- package/src/index.ts +4 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crombolo/simple-redirects",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.11.0",
|
|
4
4
|
"description": "Manage redirects in the Crombolo backoffice: a Settings screen over the redirect engine in core.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Crombolo",
|
|
@@ -36,8 +36,9 @@
|
|
|
36
36
|
"access": "public"
|
|
37
37
|
},
|
|
38
38
|
"crombolo": {
|
|
39
|
-
"id": "
|
|
39
|
+
"id": "redirects",
|
|
40
40
|
"name": "Redirects",
|
|
41
|
+
"server": "redirects",
|
|
41
42
|
"extensions": [
|
|
42
43
|
{
|
|
43
44
|
"type": "menuItem",
|
|
@@ -65,6 +66,9 @@
|
|
|
65
66
|
]
|
|
66
67
|
},
|
|
67
68
|
"dependencies": {
|
|
68
|
-
"@crombolo/server": "0.
|
|
69
|
+
"@crombolo/server": "0.11.0"
|
|
70
|
+
},
|
|
71
|
+
"peerDependencies": {
|
|
72
|
+
"@crombolo/crombolo": "^0.11.0"
|
|
69
73
|
}
|
|
70
74
|
}
|
package/src/index.ts
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* Both halves ship in one npm package. The client half is discovered from the
|
|
12
12
|
* `crombolo` field once the package is a dependency; the server half runs only
|
|
13
13
|
* because a site imported `redirects()` into its `crombolo.config.ts` — see
|
|
14
|
-
* `docs/
|
|
14
|
+
* `docs/bundles.md` for why that asymmetry is the whole security story.
|
|
15
15
|
*/
|
|
16
16
|
import type {
|
|
17
17
|
BundleRedirectInput,
|
|
@@ -19,14 +19,15 @@ import type {
|
|
|
19
19
|
BundleSection,
|
|
20
20
|
ServerBundle,
|
|
21
21
|
} from '@crombolo/server'
|
|
22
|
+
import manifest from '../package.json' with { type: 'json' }
|
|
22
23
|
|
|
23
24
|
/** What this bundle asks the host for, and all it can reach. */
|
|
24
25
|
const CAPABILITIES = ['redirects', 'documents', 'log'] as const
|
|
25
26
|
|
|
26
27
|
type Capability = (typeof CAPABILITIES)[number]
|
|
27
28
|
|
|
28
|
-
/** The URL segment the endpoints answer below, and the name in the log. */
|
|
29
|
-
export const REDIRECTS_BUNDLE_ID =
|
|
29
|
+
/** The URL segment the endpoints answer below, and the name in the log: the package's `crombolo.id`. */
|
|
30
|
+
export const REDIRECTS_BUNDLE_ID = manifest.crombolo.id
|
|
30
31
|
|
|
31
32
|
export interface RedirectsBundleOptions {
|
|
32
33
|
/**
|
|
@@ -99,7 +100,6 @@ export function redirects(options: RedirectsBundleOptions = {}): ServerBundle<Ca
|
|
|
99
100
|
|
|
100
101
|
return {
|
|
101
102
|
id: REDIRECTS_BUNDLE_ID,
|
|
102
|
-
name: 'Redirects',
|
|
103
103
|
section,
|
|
104
104
|
capabilities: CAPABILITIES,
|
|
105
105
|
routes: [
|