@alxia/create 0.5.2 → 0.5.4

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
@@ -223,7 +223,7 @@ or CI.
223
223
  rules the template was not checked against.
224
224
  - **The code generators** are pinned exactly and kept at the template's
225
225
  versions, never moved to a newer patch: `@nxgt/openapi-codegen` (`api`,
226
- `0.7.0`) and GraphQL Code Generator's `@graphql-codegen/cli`,
226
+ `0.11.0`) and GraphQL Code Generator's `@graphql-codegen/cli`,
227
227
  `typescript` and `typescript-resolvers` (`graphql`). `bun run verify` runs
228
228
  `generate --check` over the committed `src/generated/`, which a release
229
229
  that writes the files differently would fail in a fresh project.
package/docs/guide.md CHANGED
@@ -249,6 +249,13 @@ files a client reads (`types.ts`, `zod.ts`, `operations.ts`,
249
249
  `paths.ts`). alxia never sends that body. Turned off, the generated files
250
250
  declare only the spec's own 400, which is the one alxia sends.
251
251
 
252
+ `readOnly` and `writeOnly` are `"omit"` by default (since 0.11): a request
253
+ body uses a `<Name>Write` view of its schema without the `readOnly`
254
+ properties, a reply a `<Name>Read` view without the `writeOnly` ones, and a
255
+ schema used in one direction only is stripped in place, with no copy. The
256
+ template's `openapi.yaml` marks none, so nothing changes here; `"keep"`
257
+ restores the schema as written.
258
+
252
259
  ### `src/generated/`
253
260
 
254
261
  `bun run generate` runs `nxgt-openapi generate`, the bin of
@@ -263,7 +270,7 @@ openapi.yaml → src/generated: 5 written, 0 unchanged
263
270
  | `alxia.ts` | one `as const` constant per operation, `{ method, path, schema }`, with the path in alxia's form (`/todos/:id`), the request's Zod schemas, a schema per response status and the `operationId`; and `operations`, all of them by `operationId` |
264
271
  | `zod.ts` | a Zod schema per component schema: `zTodo`, `zNewTodo`, … |
265
272
  | `types.ts` | a TypeScript type per component schema: `Todo`, `NewTodo`, … |
266
- | `operations.ts`, `paths.ts` | `operations.ts` is the table `@nxgt/openapi-httpyz` binds onto a client, which the template's spec uses; `paths.ts` is the same document in openapi-typescript's shape, for a client that reads it, and the template does not use it |
273
+ | `operations.ts`, `paths.ts` | `operations.ts` is the table `@nxgt/openapi-httpyz` binds onto a client, which the template's spec uses; an operation sent as a `QUERY` over `POST` (`x-nxgt-method: query`) has `queryMethod: true`; `paths.ts` is the same document in openapi-typescript's shape, for a client that reads it, and the template does not use it |
267
274
 
268
275
  ```ts
269
276
  // src/generated/alxia.ts, in part
@@ -310,7 +317,7 @@ bun run generate
310
317
  git diff src/generated
311
318
  ```
312
319
 
313
- What the generator does not write, in 0.7.0, and how the app does it
320
+ What the generator does not write, in 0.11.0, and how the app does it
314
321
  instead:
315
322
 
316
323
  - **`security`**: no middleware is generated from it. Authentication is
@@ -1055,7 +1062,7 @@ front of the pages, write it out and edit it:
1055
1062
  bunx alxia-react-router reveal
1056
1063
  ```
1057
1064
 
1058
- The [`@alxia/react-router` guide](https://github.com/softistx/alxia/blob/develop/packages/react-router/docs/guide.md)
1065
+ The [`@alxia/react-router` guide](https://github.com/softistx/alxia/blob/develop/packages/react-router/docs/README.md)
1059
1066
  goes from there.
1060
1067
 
1061
1068
  ## Behind a proxy
@@ -1294,7 +1301,7 @@ Two stages: every dependency and `bun run build`, then an image with
1294
1301
  `@alxia/react-router`'s plugin bundles every package into
1295
1302
  `build/server/index.js` under `react-router build`, so `build/` needs no
1296
1303
  `node_modules`
1297
- ([Self-contained](https://github.com/softistx/alxia/blob/develop/packages/react-router/docs/guide.md#self-contained)).
1304
+ ([Self-contained](https://github.com/softistx/alxia/blob/develop/packages/react-router/docs/guide/how-it-works.md#self-contained)).
1298
1305
  `.dockerignore` keeps `node_modules`, `build` and `.react-router` out of
1299
1306
  the context.
1300
1307
 
@@ -1306,7 +1313,7 @@ docker run -p 3000:3000 my-site
1306
1313
 
1307
1314
  The commented file, and what to change to write files from the container,
1308
1315
  are in
1309
- [`@alxia/react-router`'s guide](https://github.com/softistx/alxia/blob/develop/packages/react-router/docs/guide.md#docker).
1316
+ [`@alxia/react-router`'s guide](https://github.com/softistx/alxia/blob/develop/packages/react-router/docs/guide/deploying.md#docker).
1310
1317
 
1311
1318
  ## Versions
1312
1319
 
@@ -1327,7 +1334,7 @@ template pins exactly:
1327
1334
  | `graphql` | `^16.11.0 \|\| ^17.0.0`, `@alxia/graphql`'s; so a new project may declare `^17` where the template ships `^16.11.0` |
1328
1335
  | `graphql-yoga` | `^5.16.0`, `@alxia/graphql`'s |
1329
1336
  | `@graphql-codegen/cli`, `@graphql-codegen/typescript`, `@graphql-codegen/typescript-resolvers` | none: the template's exact versions, 7.4.3, 6.1.0 and 6.1.0, are kept, for the reason `@nxgt/openapi-codegen`'s are: `generate --check` |
1330
- | `@nxgt/openapi-codegen` | none: the template's exact version, `0.7.0`, is kept. Any release may write `src/generated/` differently, and `bun run verify` checks it with `generate --check` |
1337
+ | `@nxgt/openapi-codegen` | none: the template's exact version, `0.11.0`, is kept. Any release may write `src/generated/` differently, and `bun run verify` checks it with `generate --check` |
1331
1338
  | anything else: `react`, `isbot`, Tailwind, `@types/*` | no alxia range: npm's `latest` |
1332
1339
 
1333
1340
  The command prints each move, and each newer major it left out:
@@ -461,7 +461,7 @@ A change made by hand in `src/generated/` is lost: make it in
461
461
  right after `bun add --dev --exact @nxgt/openapi-codegen@…`, with no
462
462
  change to `openapi.yaml`.
463
463
 
464
- **When:** the generator moved to another minor, `0.7.x` to `0.8.0`. A new
464
+ **When:** the generator moved to another minor, `0.11.x` to `0.12.0`. A new
465
465
  project never hits it: the command keeps the template's version
466
466
  ([Versions](guide.md#versions)).
467
467
 
@@ -480,8 +480,8 @@ bun run verify
480
480
 
481
481
  The diff is what the new release writes differently; `bun run verify`
482
482
  tells whether the app still compiles and passes against it. To stay
483
- where you were, pin the previous version again, `0.7.0` after a move to `0.8.0`:
484
- `bun add --dev --exact @nxgt/openapi-codegen@0.7.0`.
483
+ where you were, pin the previous version again, `0.11.0` after a move to `0.12.0`:
484
+ `bun add --dev --exact @nxgt/openapi-codegen@0.11.0`.
485
485
 
486
486
  ### `TypeError: matchesSpec(): 1 operation has no route: DELETE /todos/:id (deleteTodo)`
487
487
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alxia/create",
3
- "version": "0.5.2",
3
+ "version": "0.5.4",
4
4
  "description": "Start an alxia app: `bun create @alxia` writes a minimal API, a spec-first one, a GraphQL one, or React Router's official template served by alxia",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -41,17 +41,17 @@
41
41
  ]
42
42
  },
43
43
  "devDependencies": {
44
- "@alxia/core": "^0.14.2",
45
- "@alxia/env": "^0.2.0",
46
- "@alxia/graphql": "^0.8.0",
47
- "@alxia/openapi": "^0.6.8",
48
- "@alxia/react-router": "^0.8.0",
44
+ "@alxia/core": "^0.15.1",
45
+ "@alxia/env": "^0.3.1",
46
+ "@alxia/graphql": "^0.8.2",
47
+ "@alxia/openapi": "^0.6.10",
48
+ "@alxia/react-router": "^0.9.0",
49
49
  "@graphql-codegen/cli": "7.4.3",
50
50
  "@graphql-codegen/typescript": "6.1.0",
51
51
  "@graphql-codegen/typescript-resolvers": "6.1.0",
52
- "@nxgt/httpyz": "^0.3.3",
53
- "@nxgt/openapi-codegen": "0.7.0",
54
- "@nxgt/openapi-httpyz": "^0.3.1",
52
+ "@nxgt/httpyz": "^0.4.1",
53
+ "@nxgt/openapi-codegen": "0.11.0",
54
+ "@nxgt/openapi-httpyz": "^0.3.2",
55
55
  "@types/bun": "^1.4.2",
56
56
  "dataloader": "^2.2.3",
57
57
  "graphql": "^16.11.0 || ^17.0.0",
@@ -23,9 +23,9 @@
23
23
  },
24
24
  "devDependencies": {
25
25
  "@biomejs/biome": "2.5.15",
26
- "@nxgt/httpyz": "^0.3.3",
27
- "@nxgt/openapi-codegen": "0.7.0",
28
- "@nxgt/openapi-httpyz": "^0.3.1",
26
+ "@nxgt/httpyz": "^0.4.1",
27
+ "@nxgt/openapi-codegen": "0.11.0",
28
+ "@nxgt/openapi-httpyz": "^0.3.2",
29
29
  "@types/bun": "^1.4.2",
30
30
  "typescript": "^6.0.3"
31
31
  }
@@ -30,6 +30,8 @@ export interface OperationSpec<Client = unknown> {
30
30
  readonly method: 'get' | 'put' | 'post' | 'delete' | 'options' | 'head' | 'patch' | 'trace' | 'query';
31
31
  readonly path: string;
32
32
  readonly honoPath: string;
33
+ /** A `QUERY` sent as a `POST` (`x-nxgt-method: query`): safe, its criteria in the body. */
34
+ readonly queryMethod?: true;
33
35
  readonly tags: readonly string[];
34
36
  readonly parameters: readonly ParameterSpec[];
35
37
  /** Validates the path parameters, each read as a string. */