@alxia/react-router 0.6.1 → 0.6.2

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
@@ -290,7 +290,8 @@ An API under `/api`, spec first, is checked against its OpenAPI document
290
290
  by [`@alxia/openapi`](https://www.npmjs.com/package/@alxia/openapi)'s
291
291
  `matchesSpec` (`bun add -d @alxia/openapi`), which reads `app.routes`. The
292
292
  catch-all and the client's files are routes too, and no operation of the
293
- document:
293
+ document: left alone, they only come back as `extra`, and `strict: true`
294
+ makes them fail:
294
295
 
295
296
  ```ts
296
297
  // app/server.test.ts
@@ -304,12 +305,12 @@ import server from './server';
304
305
  test('the API routes every operation of openapi.yaml, and nothing else', async () => {
305
306
  const build: ServerBuild = await import(new URL('../build/server/index.js', import.meta.url).href);
306
307
  const app = server.create({ build });
307
- matchesSpec(app, operations, { exclude: isReactRouterRoute });
308
+ matchesSpec(app, operations, { strict: true, exclude: isReactRouterRoute });
308
309
  });
309
310
  ```
310
311
 
311
312
  `isReactRouterRoute` is true for each route this package declared, so
312
- `matchesSpec` checks your own routes alone.
313
+ `matchesSpec` checks your own routes alone, under `strict`.
313
314
 
314
315
  ## Built for Bun
315
316
 
package/docs/guide.md CHANGED
@@ -1101,9 +1101,10 @@ refused when the server starts: see
1101
1101
  alxia is OpenAPI spec first: the document is written by hand, the API's
1102
1102
  routes are bound to the operations generated from it, and
1103
1103
  [`@alxia/openapi`](https://www.npmjs.com/package/@alxia/openapi)'s
1104
- `matchesSpec` checks, in a test, that `app.routes` and the operations
1105
- match both ways. The catch-all and the client's files are routes of
1106
- `app.routes`, and no operation of the document. Leave them out with
1104
+ `matchesSpec` checks, in a test, that every operation has its route; with
1105
+ `strict: true`, that `app.routes` and the operations match both ways. The
1106
+ catch-all and the client's files are routes of `app.routes`, and no
1107
+ operation of the document. Under `strict`, leave them out with
1107
1108
  `isReactRouterRoute`, which is true for each route this package declared:
1108
1109
 
1109
1110
  ```ts
@@ -1132,6 +1133,7 @@ test('the API routes every operation of openapi.yaml, and nothing else', async (
1132
1133
  const build: ServerBuild = await import(new URL('../build/server/index.js', import.meta.url).href);
1133
1134
  const app = server.create({ build });
1134
1135
  matchesSpec(app, operations, {
1136
+ strict: true,
1135
1137
  exclude: (route) => isReactRouterRoute(route) || route.path === '/api/health',
1136
1138
  });
1137
1139
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alxia/react-router",
3
- "version": "0.6.1",
3
+ "version": "0.6.2",
4
4
  "description": "alxia as the server of a React Router framework app: server rendering behind the app's hooks, loaders reading its typed context, the client's assets served",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -51,9 +51,9 @@
51
51
  ]
52
52
  },
53
53
  "devDependencies": {
54
- "@alxia/compress": "^0.3.1",
55
- "@alxia/core": "^0.6.0",
56
- "@alxia/openapi": "^0.5.1",
54
+ "@alxia/compress": "^0.3.2",
55
+ "@alxia/core": "^0.7.0",
56
+ "@alxia/openapi": "^0.6.1",
57
57
  "@react-router/dev": "^8.4.0",
58
58
  "@types/bun": "^1.4.2",
59
59
  "@types/react": "^19.3.0",
@@ -65,7 +65,7 @@
65
65
  "vite": "^7.0.0"
66
66
  },
67
67
  "peerDependencies": {
68
- "@alxia/core": "^0.6.0",
68
+ "@alxia/core": "^0.7.0",
69
69
  "react-router": "^8.0.0",
70
70
  "typescript": "^6.0.3 || ^7.0.0",
71
71
  "vite": "^7.0.0 || ^8.0.0"