uncial-cms 5.0.0 → 5.1.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/README.md +1 -1
- package/dist/local/vite.d.ts +2 -0
- package/dist/local/vite.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -149,7 +149,7 @@ leaving it unrouted.
|
|
|
149
149
|
`createLocalVitePlugin` from `uncial-cms/local` is the same endpoint on its own,
|
|
150
150
|
for a site that is not using `defineSite`; it takes the repository `root` and the
|
|
151
151
|
repo-root-relative `permittedRoots` writes are confined to. It is serve-only and
|
|
152
|
-
|
|
152
|
+
binds Vite to `127.0.0.1` unless given a `host`. Every path it takes is repo-root-relative,
|
|
153
153
|
exactly as the GitHub adapter addresses one. The adapter calls it at the fixed,
|
|
154
154
|
development-only JSON endpoint `/__uncial-cms/local`:
|
|
155
155
|
|
package/dist/local/vite.d.ts
CHANGED
|
@@ -4,5 +4,7 @@ export interface LocalVitePluginOptions {
|
|
|
4
4
|
root: string;
|
|
5
5
|
/** Repo-root-relative directories a request may address, as the site declares them. */
|
|
6
6
|
permittedRoots: string[];
|
|
7
|
+
/** Vite `server.host`; defaults to loopback because the endpoint has no auth. */
|
|
8
|
+
host?: string | boolean;
|
|
7
9
|
}
|
|
8
10
|
export declare function createLocalVitePlugin(options: LocalVitePluginOptions): Plugin;
|
package/dist/local/vite.js
CHANGED
|
@@ -190,7 +190,7 @@ export function createLocalVitePlugin(options) {
|
|
|
190
190
|
const watched = roots.permitted.map((permitted) => permitted.absolute);
|
|
191
191
|
return {
|
|
192
192
|
server: {
|
|
193
|
-
host: '127.0.0.1',
|
|
193
|
+
host: options.host ?? '127.0.0.1',
|
|
194
194
|
// Every write under a permitted root arrives through this plugin's
|
|
195
195
|
// own endpoint, so a watcher event for one is the author's own
|
|
196
196
|
// autosave landing. Watched, it makes Vite full-reload the page
|