vue-ssr-lite 0.2.9 → 0.2.12

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 CHANGED
@@ -28,7 +28,7 @@ It includes routing, browser hydration, production builds, a managed Node server
28
28
  - Health and readiness checks
29
29
  - Request timeouts
30
30
  - Optional response caching
31
- - Cookie allowlists and denylists
31
+ - Cookie allow / deny filtering (including deny-only)
32
32
  - Proxy-aware host and protocol resolution
33
33
  - Graceful shutdown
34
34
  - TypeScript support
@@ -68,39 +68,50 @@ yarn add vue-ssr-lite vue vue-router @vue/server-renderer
68
68
  yarn add --dev vite @vitejs/plugin-vue
69
69
  ```
70
70
 
71
- ## Choose Your Application Type
71
+ ## Clean consumer (canonical path)
72
72
 
73
- `vue-ssr-lite` supports two render modes, both declared only in `ssr.config.ts`:
73
+ Every project follows the same five pieces. `ssr.config` is the single source of
74
+ truth — there is no `spaEntries`, no `kind`, no manual `main.ts` mount, and no
75
+ `server.role`.
74
76
 
75
- | `render` | Behavior |
77
+ | Piece | Role |
76
78
  | --- | --- |
77
- | `spa` | Serves the HTML shell; the library generates the browser mount entry |
78
- | `ssr` | Server-renders Vue and generates the hydration client entry |
79
+ | `ssr.config.ts` | Apps, domains, `runtime`, cookies, endpoints |
80
+ | `defineSsrApplication()` modules | One module per app (`application.module`) |
81
+ | HTML shells | Mount node only — **no** bootstrap `<script type="module" src>` |
82
+ | `vite.config.ts` | `vue()` + `vueSsrLite()` |
83
+ | CLI scripts | `vue-ssr-lite dev \| build \| start` |
79
84
 
80
- Define each application once with `defineSsrApplication()` and point
81
- `application: { module, exportName }` at that module. Do not maintain a separate
82
- `main.ts` / `ErpClient.ts` bootstrap — `vueSsrLite()` injects the client entry
83
- from `ssr.config`.
85
+ Render modes (declared as `render` on each application):
84
86
 
87
+ | `render` | Behavior |
88
+ | --- | --- |
89
+ | `spa` | Serves the HTML shell; the plugin generates the browser mount entry |
90
+ | `ssr` | Server-renders Vue and generates the hydration client entry |
85
91
 
86
- A plain Vite `main.ts` (`createApp(App).use(router).mount('#app')`) still works
87
- for an application that never needs SSR, but prefer the unified definition when
88
- the same app also has an SSR entry.
92
+ `vueSsrLite()` defaults the client Vite `build.outDir` to `dist/client` so
93
+ `vue-ssr-lite start` finds assets without a consumer override. Set
94
+ `build.outDir` or `server.clientOutDir` only when you need a different path.
89
95
 
90
- ### SSR
96
+ Production compile requires top-level `runtime` (typically `APP_RUNTIME`) and
97
+ each app’s `domain.production`. `publicConfig` is opaque — validating API URLs
98
+ is the consumer’s job.
91
99
 
92
- Use `kind: 'ssr'` for a Vue application that should render on the server and hydrate in the browser.
100
+ For async config, export a factory that *returns* `defineSsrConfig(...)`:
93
101
 
94
- Examples:
102
+ ```ts
103
+ export default async () =>
104
+ defineSsrConfig({
105
+ name: 'my-platform',
106
+ runtime: process.env.APP_RUNTIME,
107
+ applications: { /* ... */ },
108
+ })
109
+ ```
95
110
 
96
- - Public website
97
- - Storefront
98
- - Blog
99
- - Marketing website
100
- - Documentation website
101
- - SEO-focused application
111
+ `defineSsrConfig` itself is synchronous and accepts a plain object.
102
112
 
103
- An SSR application is defined with `defineSsrApplication()`.
113
+ See `fixtures/clean-consumer` in this repo for a minimal SPA project that
114
+ matches this contract.
104
115
 
105
116
  ## Quick Start: SPA and SSR Together
106
117
 
@@ -111,17 +122,17 @@ The following example creates:
111
122
 
112
123
  ## 1. Create the SPA Application
113
124
 
114
- Define the application once and mount it through the package. Router creation,
115
- plugin installation, public-config delivery and mounting are owned by
116
- `vue-ssr-lite`, identically to the SSR and hydration paths:
125
+ Define the application once. The library owns router creation, plugin
126
+ installation, public-config delivery, and mounting via the generated virtual
127
+ client do **not** add a `main.ts` bootstrap.
117
128
 
118
129
  ```ts
119
- // src/spa/app.ts
130
+ // src/dashboard/DashboardBootstrap.ts
120
131
  import { defineSsrApplication } from 'vue-ssr-lite'
121
132
  import App from './App.vue'
122
133
  import routes from './routes'
123
134
 
124
- export const app = defineSsrApplication({
135
+ export const createDashboardApplication = defineSsrApplication({
125
136
  id: 'dashboard',
126
137
  rootComponent: App,
127
138
  routes,
@@ -129,18 +140,10 @@ export const app = defineSsrApplication({
129
140
  })
130
141
  ```
131
142
 
132
- ```ts
133
- // src/spa/main.ts — thin entry
134
- import { mountSpaApplication } from 'vue-ssr-lite/client'
135
- import { app } from './app'
136
-
137
- void mountSpaApplication(app)
138
- ```
139
-
140
143
  Create the SPA root component:
141
144
 
142
145
  ```vue
143
- <!-- src/spa/App.vue -->
146
+ <!-- src/dashboard/App.vue -->
144
147
  <script setup lang="ts">
145
148
  import { RouterView } from 'vue-router'
146
149
  </script>
@@ -150,7 +153,7 @@ import { RouterView } from 'vue-router'
150
153
  </template>
151
154
  ```
152
155
 
153
- Create the SPA HTML entry:
156
+ Create the SPA HTML shell (no bootstrap script):
154
157
 
155
158
  ```html
156
159
  <!-- index.html -->
@@ -166,16 +169,10 @@ Create the SPA HTML entry:
166
169
 
167
170
  <body>
168
171
  <div id="app"></div>
169
-
170
- <script
171
- type="module"
172
- src="/src/spa/main.ts"></script>
173
172
  </body>
174
173
  </html>
175
174
  ```
176
175
 
177
- The same definition backs the SSR entry, so the SPA and SSR paths cannot drift.
178
-
179
176
  ## 2. Create the SSR Application
180
177
 
181
178
  Create the SSR root component:
@@ -369,11 +366,14 @@ export default defineConfig({
369
366
  `vueSsrLite()` generates:
370
367
 
371
368
  - HTML Rollup inputs from each `template`
369
+ - Client `build.outDir` defaulting to `dist/client` (aligned with the Node server)
372
370
  - `virtual:vue-ssr-lite/client/<id>` SPA mount / SSR hydrate entries
373
- - `virtual:vue-ssr-lite/runtime` for the Node server (static application imports)
371
+ - `virtual:vue-ssr-lite/runtime` for the Node server (SSR apps only; SPA modules are omitted)
374
372
 
375
373
  HTML templates should not include a manual `<script type="module" src="...">`
376
- bootstrap — the plugin injects the generated client entry.
374
+ bootstrap — the plugin strips those tags from matched templates and injects the
375
+ generated client entry. Editing `ssr.config.*` invalidates the cached config and
376
+ triggers a full reload in dev.
377
377
 
378
378
  ## 5. Add Commands
379
379
 
@@ -600,30 +600,31 @@ For reusable REST caching and hydration, register an SSR-compatible Vue plugin i
600
600
 
601
601
  ## Public Configuration
602
602
 
603
- Pass public values from the runtime:
603
+ Pass opaque, browser-safe values per application in `ssr.config`:
604
604
 
605
605
  ```ts
606
- server: {
607
- publicConfig: {
608
- apiUrl:
609
- 'https://api.example.com',
610
- graphqlEndpoint:
611
- 'https://api.example.com/graphql',
606
+ applications: {
607
+ website: {
608
+ // ...
609
+ publicConfig: {
610
+ apiUrl: 'https://api.example.com',
611
+ graphqlEndpoint: 'https://api.example.com/graphql',
612
+ },
612
613
  },
613
614
  }
614
615
  ```
615
616
 
616
- Access them in an SSR component:
617
+ Access them in a component:
617
618
 
618
619
  ```ts
619
620
  import { useSsrRequestContext } from 'vue-ssr-lite'
620
621
 
621
622
  const context = useSsrRequestContext()
622
-
623
623
  const apiUrl = context.publicConfig.apiUrl
624
624
  ```
625
625
 
626
- Only include values that are safe to expose to the browser.
626
+ The library does not interpret `publicConfig` (no GraphQL/REST assumptions).
627
+ Validate transport URLs in your own plugins or env checks.
627
628
 
628
629
  ## SEO
629
630
 
@@ -755,6 +756,11 @@ catch-all (`*`) applications are rejected at startup.
755
756
 
756
757
  Do not include protocols, paths, query strings, or ports in domain values.
757
758
 
759
+ `localAliases: true` adds bare loopback hosts (`localhost`, `127.0.0.1`, …) only
760
+ when the app’s development base is itself a loopback hostname. Subdomain bases
761
+ such as `shop.localhost` already expand to `*.shop.localhost` and do not claim
762
+ bare `localhost`, so multiple apps can enable `localAliases` safely.
763
+
758
764
  Set `server.trustProxy` to `true` only when the Node process sits behind a trusted reverse proxy. Then `X-Forwarded-Host` and `X-Forwarded-Proto` are used for host matching and absolute URLs. Leave it `false` for direct local traffic.
759
765
 
760
766
  ## Runtime Roles
@@ -828,10 +834,12 @@ With that setup:
828
834
 
829
835
  If a host matches an application that the current role does not allow, the server responds with `421`.
830
836
 
831
- Development may default `runtime` in your `ssr.config`. Production compilation
832
- rejects a missing `runtime`, `domain.production`, or `publicConfig.api.endpoint`.
837
+ Development may omit `runtime` (the compiler defaults the process role to
838
+ `unified`). Production compilation rejects a missing `runtime` or
839
+ `domain.production`. It does **not** validate `publicConfig` shape — pass
840
+ whatever your plugins need and validate API URLs in the consumer.
833
841
 
834
- `defineSsrConfig` accepts either a plain object or an async factory function.
842
+ For async loading, export `async () => defineSsrConfig({ ... })`.
835
843
 
836
844
  ## Custom Endpoints
837
845
 
@@ -938,9 +946,9 @@ cookies: {
938
946
  }
939
947
  ```
940
948
 
941
- - If `allow` is non-empty, only listed cookies are forwarded.
942
- - `deny` always removes matching cookies.
943
- - Leave both empty when the browser talks to the API directly and SSR needs no cookies.
949
+ - Both empty forward nothing (secure default when SSR needs no cookies).
950
+ - `allow` empty and `deny` non-empty forward all cookies except `deny`.
951
+ - `allow` non-empty forward `allow ¬deny`.
944
952
 
945
953
  ## Server Configuration
946
954
 
@@ -1050,28 +1058,17 @@ warnings; production render paths are untouched.
1050
1058
 
1051
1059
  ## Summary
1052
1060
 
1053
- For a SPA:
1054
-
1055
- 1. Define the app once with `defineSsrApplication()`.
1056
- 2. Mount it in a thin `main.ts` with `mountSpaApplication()`.
1057
- 3. Register the HTML file in `spaEntries`.
1058
- 4. Add a runtime entry with `kind: 'spa'`.
1059
-
1060
- For SSR:
1061
-
1062
- 1. Create the Vue root component and routes.
1063
- 2. Define it with `defineSsrApplication()`.
1064
- 3. Create an SSR HTML template.
1065
- 4. Register it in `applications`.
1066
- 5. Add a runtime entry with `kind: 'ssr'`.
1067
-
1068
- Optional for multi-mode deployments:
1061
+ 1. Add `ssr.config.ts` with `defineSsrConfig({ name, runtime, applications })`.
1062
+ 2. For each app: `defineSsrApplication()` module, HTML shell (no bootstrap script),
1063
+ `render: 'spa' | 'ssr'`, and `application: { module, exportName }`.
1064
+ 3. Wire Vite with `vue()` + `vueSsrLite()` (client assets land in `dist/client`).
1065
+ 4. Run `vue-ssr-lite dev|build|start`.
1066
+ 5. In production set `APP_RUNTIME` / `runtime` and every `domain.production`.
1069
1067
 
1070
- 1. Choose role names for your project.
1071
- 2. Set `server.role` from an environment variable.
1072
- 3. Restrict each entry with `roles`.
1068
+ Optional: restrict apps with `roles`, filter cookies, add endpoints, or pass
1069
+ `server.onMetrics` / `server.renderError` through `ssr.config`.
1073
1070
 
1074
- Both application types can run from the same project, build process, and production server.
1071
+ SPA and SSR apps share one project, one build, and one production server.
1075
1072
 
1076
1073
  ## License
1077
1074
 
@@ -1 +1 @@
1
- {"version":3,"file":"SsrConfigCompileRuntime.d.ts","sourceRoot":"","sources":["../src/SsrConfigCompileRuntime.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAEV,0BAA0B,EAE1B,uBAAuB,EAEvB,SAAS,EAET,aAAa,EACb,aAAa,EACd,MAAM,kBAAkB,CAAA;AACzB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAEpD,OAAO,KAAK,EACV,wBAAwB,EACxB,qBAAqB,EACrB,YAAY,EACZ,iBAAiB,EACjB,wBAAwB,EACxB,gBAAgB,EACjB,MAAM,mBAAmB,CAAA;AAM1B,OAAO,EAAE,eAAe,EAAE,CAAA;AAU1B,eAAO,MAAM,sBAAsB,iCAAiC,CAAA;AACpE,eAAO,MAAM,yBAAyB,iCAAiC,CAAA;AAEvE,MAAM,WAAW,sBAAsB;IACrC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,YAAY,CAAA;IAClB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,KAAK,CAAC,EAAE,MAAM,EAAE,CAAA;IAChB,WAAW,CAAC,EAAE,wBAAwB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;IACrD,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,YAAY,CAAC,EAAE,MAAM,CAAA;IACrB,aAAa,CAAC,EAAE,wBAAwB,CAAC,GAAG,CAA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A;AAED,eAAO,MAAM,gBAAgB,GAC3B,QAAQ,OAAO,EACf,UAAS,uBAA4B,KACpC,OAAO,CAAC,iBAAiB,CAkI3B,CAAA"}
@@ -1,4 +1,4 @@
1
- import { SsrApplicationDefinition, SsrEndpointDefinition, SsrLogger, SsrReadinessProbe, SsrResponseCacheStrategy } from './SsrRuntimeTypes';
1
+ import { SsrApplicationDefinition, SsrEndpointDefinition, SsrErrorRenderContext, SsrHttpResponse, SsrLogger, SsrReadinessProbe, SsrRenderMetrics, SsrResponseCacheStrategy } from './SsrRuntimeTypes';
2
2
  /** How an application owns its apex hostname and subdomains. */
3
3
  export type SsrDomainMode = 'root' | 'subdomains' | 'root-and-subdomains';
4
4
  export type SsrRenderMode = 'spa' | 'ssr';
@@ -82,6 +82,8 @@ export interface SsrConfigServerOptions {
82
82
  resolutionDeadlineMs?: number;
83
83
  diagnostics?: boolean;
84
84
  logger?: SsrLogger;
85
+ onMetrics?: (metrics: SsrRenderMetrics) => void;
86
+ renderError?: (context: SsrErrorRenderContext) => SsrHttpResponse | null | Promise<SsrHttpResponse | null>;
85
87
  }
86
88
  /**
87
89
  * Flat Vite/Nuxt-style SSR configuration.
@@ -1 +1 @@
1
- {"version":3,"file":"SsrConfigTypes.d.ts","sourceRoot":"","sources":["../src/SsrConfigTypes.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mBAAmB,CAAA;AACjE,OAAO,KAAK,EACV,qBAAqB,EACrB,SAAS,EACT,iBAAiB,EACjB,wBAAwB,EACzB,MAAM,mBAAmB,CAAA;AAE1B,gEAAgE;AAChE,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,YAAY,GAAG,qBAAqB,CAAA;AAEzE,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,KAAK,CAAA;AAEzC,oEAAoE;AACpE,MAAM,MAAM,oBAAoB,GAC5B,sBAAsB,GACtB,uBAAuB,CAAA;AAE3B,MAAM,WAAW,wBAAwB;IACv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