@crombolo/crombolo 0.28.0 → 0.29.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 +14 -14
- package/src/index.ts +19 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crombolo/crombolo",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0",
|
|
4
4
|
"crombolo": {
|
|
5
5
|
"migrations": "compatible"
|
|
6
6
|
},
|
|
@@ -47,19 +47,19 @@
|
|
|
47
47
|
"NOTICE"
|
|
48
48
|
],
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@crombolo/api-delivery": "0.
|
|
51
|
-
"@crombolo/api-management": "0.
|
|
52
|
-
"@crombolo/auth": "0.
|
|
50
|
+
"@crombolo/api-delivery": "0.29.0",
|
|
51
|
+
"@crombolo/api-management": "0.29.0",
|
|
52
|
+
"@crombolo/auth": "0.29.0",
|
|
53
53
|
"@crombolo/backoffice-dist": "18.2.0",
|
|
54
|
-
"@crombolo/backoffice-host": "0.
|
|
55
|
-
"@crombolo/cli": "0.
|
|
56
|
-
"@crombolo/content": "0.
|
|
57
|
-
"@crombolo/contracts": "0.
|
|
58
|
-
"@crombolo/core": "0.
|
|
59
|
-
"@crombolo/data": "0.
|
|
60
|
-
"@crombolo/render": "0.
|
|
61
|
-
"@crombolo/schema": "0.
|
|
62
|
-
"@crombolo/server": "0.
|
|
63
|
-
"@crombolo/transfer": "0.
|
|
54
|
+
"@crombolo/backoffice-host": "0.29.0",
|
|
55
|
+
"@crombolo/cli": "0.29.0",
|
|
56
|
+
"@crombolo/content": "0.29.0",
|
|
57
|
+
"@crombolo/contracts": "0.29.0",
|
|
58
|
+
"@crombolo/core": "0.29.0",
|
|
59
|
+
"@crombolo/data": "0.29.0",
|
|
60
|
+
"@crombolo/render": "0.29.0",
|
|
61
|
+
"@crombolo/schema": "0.29.0",
|
|
62
|
+
"@crombolo/server": "0.29.0",
|
|
63
|
+
"@crombolo/transfer": "0.29.0"
|
|
64
64
|
}
|
|
65
65
|
}
|
package/src/index.ts
CHANGED
|
@@ -16,7 +16,9 @@ import {
|
|
|
16
16
|
} from '@crombolo/server'
|
|
17
17
|
|
|
18
18
|
// What a bundle's package.json declares; see `docs/bundles.md`.
|
|
19
|
-
export type { BundlePackage, CromboloField } from '@crombolo/backoffice-host'
|
|
19
|
+
export type { BundlePackage, CromboloField, PackageJson } from '@crombolo/backoffice-host'
|
|
20
|
+
// The CMS's own checks of a bundle package, for a host that installs them (story 181).
|
|
21
|
+
export { peerRangeProblem, validateBundlePackage } from '@crombolo/backoffice-host'
|
|
20
22
|
// A view reads a form definition and a submission's state; both are domain
|
|
21
23
|
// types, so they come from core rather than from the renderer.
|
|
22
24
|
export type {
|
|
@@ -108,6 +110,7 @@ export {
|
|
|
108
110
|
type BundleRedirectInput,
|
|
109
111
|
type BundleRedirectRule,
|
|
110
112
|
type BundleRedirects,
|
|
113
|
+
type BundleReload,
|
|
111
114
|
type BundleRequest,
|
|
112
115
|
type BundleSection,
|
|
113
116
|
type CromboloConfig,
|
|
@@ -132,6 +135,7 @@ export {
|
|
|
132
135
|
type PostmarkOptions,
|
|
133
136
|
type Principal,
|
|
134
137
|
postmarkEmail,
|
|
138
|
+
type ReloadedBundle,
|
|
135
139
|
type ResendOptions,
|
|
136
140
|
resendEmail,
|
|
137
141
|
type S3MediaStoreOptions,
|
|
@@ -152,10 +156,20 @@ export async function crombolo(
|
|
|
152
156
|
overrides: Partial<CromboloConfig> = {},
|
|
153
157
|
cwd = process.cwd(),
|
|
154
158
|
): Promise<ServerHandle['serveOptions']> {
|
|
159
|
+
return (await cromboloServer(overrides, cwd)).serveOptions
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Boots a site and returns the server handle: `serveOptions` for `Bun.serve`,
|
|
164
|
+
* and `reloadBundles()` for a host that changes the site's packages while it
|
|
165
|
+
* runs (story 181). `crombolo()` is this, for a `server.ts` that needs neither.
|
|
166
|
+
*/
|
|
167
|
+
export async function cromboloServer(
|
|
168
|
+
overrides: Partial<CromboloConfig> = {},
|
|
169
|
+
cwd = process.cwd(),
|
|
170
|
+
): Promise<ServerHandle> {
|
|
155
171
|
const config = loadConfig(overrides, cwd)
|
|
156
|
-
// The caller is about to serve
|
|
157
|
-
// migration and a seed.
|
|
172
|
+
// The caller is about to serve, so fail here rather than after a migration and a seed.
|
|
158
173
|
await assertPortAvailable(config.port)
|
|
159
|
-
|
|
160
|
-
return server.serveOptions
|
|
174
|
+
return createServer(config)
|
|
161
175
|
}
|