Skip to content
Open
Show file tree
Hide file tree
Changes from 49 commits
Commits
Show all changes
102 commits
Select commit Hold shift + click to select a range
2c98073
tmp: Adjusting trigger branches.
RobinTail Feb 7, 2026
25910d5
Adjusting engine requirements.
RobinTail Feb 7, 2026
ad4b5ec
Adjusting CI matrix.
RobinTail Feb 7, 2026
3e1d7a3
Merge branch 'master' into make-v28
RobinTail Feb 16, 2026
751feb6
migration(v28): require ESLint 10 (#3207)
renovate[bot] Feb 16, 2026
ba0de05
Merge branch 'master' into make-v28
RobinTail Feb 16, 2026
9801f9f
migration: adjusting peers
RobinTail Feb 23, 2026
1dafe94
Changelog: listing new requiremenets for Node.js.
RobinTail Feb 23, 2026
a1762d4
Merge branch 'master' into make-v28
RobinTail Feb 28, 2026
4bd1266
Merge branch 'master' into make-v28
RobinTail Mar 7, 2026
670535f
Drop Node 20 (#3242)
RobinTail Mar 7, 2026
0fd0d08
Merge branch 'master' into make-v28
RobinTail Mar 14, 2026
edb84ef
Merge branch 'master' into make-v28
RobinTail Mar 14, 2026
61bf5bd
Merge branch 'master' into make-v28
RobinTail Mar 15, 2026
52ba492
Merge branch 'master' into make-v28
RobinTail Mar 17, 2026
43fc509
fix(migration): mv defaultOptions.
RobinTail Mar 17, 2026
843bf23
Cleanup migration.
RobinTail Mar 17, 2026
606a45b
major(migration): Elevating to v28.
RobinTail Mar 17, 2026
d0813cf
feat(docs): Security, planning v28 for April, deprecating v23.
RobinTail Mar 17, 2026
a6f48d6
express-zod-api version 28.0.0-beta.1
github-actions[bot] Mar 18, 2026
f320254
Merge branch 'master' into make-v28
RobinTail Mar 21, 2026
495053c
ref(node22): Using `Promise.withResolvers()` (#3268)
RobinTail Mar 21, 2026
cdab2ac
Merge branch 'master' into make-v28
RobinTail Mar 25, 2026
db876a2
Merge branch 'master' into make-v28
RobinTail Mar 25, 2026
994d600
Using native typescript loader (#3267)
RobinTail Mar 25, 2026
ab4bd18
Merge branch 'master' into make-v28
RobinTail Mar 26, 2026
a9f4a0f
Merge branch 'master' into make-v28
RobinTail Mar 26, 2026
144c2d2
fix(engines): zod plugin v5 min node should be 22.18
RobinTail Mar 26, 2026
321bc7a
zod-plugin version 5.0.0-beta.1
github-actions[bot] Mar 26, 2026
061e59f
Merge branch 'master' into make-v28
RobinTail Mar 27, 2026
db7ecb2
Merge branch 'master' into make-v28
RobinTail Mar 27, 2026
2babbfe
Merge branch 'master' into make-v28
RobinTail Mar 27, 2026
fd0dae1
Merge branch 'master' into make-v28
RobinTail Mar 30, 2026
d82e00e
Upgrading `typescript-eslint` for TypeScript 6 support (#3287)
RobinTail Mar 31, 2026
6733c73
fix(migration): Require typescript-eslint 8.58.
RobinTail Mar 31, 2026
d29892b
Merge branch 'master' into make-v28
RobinTail Apr 1, 2026
9f91c4f
Merge branch 'master' into make-v28
RobinTail Apr 3, 2026
377fc3e
Merge branch 'master' into make-v28
RobinTail Apr 3, 2026
2f92153
Merge branch 'master' into make-v28
RobinTail Apr 4, 2026
a355124
chore(v28): Using `undici` 8 (#3294)
RobinTail Apr 4, 2026
5b11b09
br(v28): `wrongMethodBehavior` —> `hintAllowedMethods` (#3299)
RobinTail Apr 5, 2026
94a210a
br(v28): `methodLikeRouteBehavior` —> `recognizeMethodDependentRoutes…
RobinTail Apr 6, 2026
c4603d4
fix(v28): simpler call for descriptors (#3301)
RobinTail Apr 6, 2026
f1ee242
br(v28): `hasSummaryFromDescription` —> `hasSummary` (#3302)
RobinTail Apr 6, 2026
a25887b
br(v28): mv `noContent` —> `noBodySchema` (#3303)
RobinTail Apr 6, 2026
30a91e4
Merge branch 'master' into make-v28
RobinTail Apr 7, 2026
99c94c0
Merge branch 'master' into make-v28
RobinTail Apr 7, 2026
13fcd0f
Dedication: v28 is for Koko Da Doll.
RobinTail Apr 8, 2026
2d7a095
fix: correct Node.js version in zod-plugin changelog to ^22.19.0
pullfrog[bot] Apr 8, 2026
5d8af02
Merge branch 'master' into make-v28
RobinTail Apr 8, 2026
c7a46da
Merge branch 'master' into make-v28
RobinTail Apr 8, 2026
10553c6
Merge branch 'master' into make-v28
RobinTail Apr 8, 2026
bd5152a
Merge branch 'master' into make-v28
RobinTail Apr 10, 2026
4cfd7c8
br(v28): `shortDescription` —> `summary`, `hasSummary` —> `summarizer…
RobinTail Apr 10, 2026
1e88e5c
Changelog: combining to single diff.
RobinTail Apr 10, 2026
d25ab9b
feat(migration): supporting named props and string literals.
RobinTail Apr 10, 2026
786235d
fix(migration): add helpers to eslint config.
RobinTail Apr 10, 2026
ebb59da
ref(migration): extracting getPropName helper.
RobinTail Apr 10, 2026
43deaaf
ref(migration): extracting renameProp helper.
RobinTail Apr 10, 2026
15bbe5c
feat(migration): supporting value reassignment by renameProp.
RobinTail Apr 10, 2026
f1813f5
mv: changeProp.
RobinTail Apr 10, 2026
7c402a2
Merge branch 'master' into make-v28
RobinTail Apr 11, 2026
2a47cd4
zod-plugin version 5.0.0-beta.2
github-actions[bot] Apr 11, 2026
bf42a25
migration version 28.0.0-beta.1
github-actions[bot] Apr 11, 2026
a38351c
Merge branch 'master' into make-v28
RobinTail Apr 11, 2026
f09ff93
express-zod-api version 28.0.0-beta.2
github-actions[bot] Apr 11, 2026
3f8b431
br(v28): Making zod plugin an optional peer dependency. (#3313)
RobinTail Apr 11, 2026
6f1355f
zod-plugin version 5.0.0-beta.3
github-actions[bot] Apr 12, 2026
6771142
express-zod-api version 28.0.0-beta.3
github-actions[bot] Apr 12, 2026
c55d4bb
fix(migration): ensure queryNamedProp always refers to a property.
RobinTail Apr 12, 2026
90a2c30
fix(test): add negative cases to the metadata helpers.
RobinTail Apr 12, 2026
e72b8ec
migration version 28.0.0-beta.2
github-actions[bot] Apr 12, 2026
f7e0946
fix(cfg): reducing diff
RobinTail Apr 13, 2026
58c648a
Revert "fix(cfg): reducing diff"
RobinTail Apr 13, 2026
ca38a61
fix(docs): rm zod 3 mention
RobinTail Apr 13, 2026
5111f35
Merge branch 'master' into make-v28
RobinTail Apr 13, 2026
0592f22
Merge branch 'master' into make-v28
RobinTail Apr 13, 2026
34158a2
Merge branch 'master' into make-v28
RobinTail Apr 13, 2026
b3c6499
Upgrading linters.
RobinTail Apr 14, 2026
80f9fab
Merge branch 'master' into make-v28
RobinTail Apr 14, 2026
5d9c291
Merge branch 'master' into make-v28
RobinTail Apr 15, 2026
97a32e0
Merge branch 'master' into make-v28
RobinTail Apr 19, 2026
3f3296e
Merge branch 'master' into make-v28
RobinTail Apr 20, 2026
bfa68fd
Upgrading typescript-eslint to 8.59.
RobinTail Apr 21, 2026
c04d26f
Merge branch 'master' into make-v28
RobinTail Apr 22, 2026
55c94bf
Merge branch 'master' into make-v28
RobinTail Apr 22, 2026
7b217ea
Merge branch 'master' into make-v28
RobinTail Apr 23, 2026
5e1a249
fix(agents): Updating import convention for v28 (#3334)
RobinTail Apr 23, 2026
0e372e7
fix(lint): rm compatibility concerns on using plugin methods in sources.
RobinTail Apr 23, 2026
8a1afcc
Merge branch 'master' into make-v28
RobinTail Apr 23, 2026
9afb519
Merge branch 'master' into make-v28
RobinTail Apr 23, 2026
7cbc2f0
Merge branch 'master' into make-v28
RobinTail Apr 23, 2026
44b77e2
Merge branch 'master' into make-v28
RobinTail Apr 23, 2026
7935b92
fix(test): rm symbols test (#3340)
RobinTail Apr 23, 2026
bf9e63d
Merge branch 'master' into make-v28
RobinTail Apr 23, 2026
c926a80
Merge branch 'master' into make-v28
RobinTail Apr 24, 2026
a367cfd
fix(test): type only import.
RobinTail Apr 24, 2026
e4697d0
Merge branch 'master' into make-v28
RobinTail Apr 24, 2026
11c4af1
Merge branch 'master' into make-v28
RobinTail Apr 25, 2026
87afa56
Merge branch 'master' into make-v28
RobinTail Apr 26, 2026
c3e128e
Replanning for May.
RobinTail Apr 27, 2026
6bb6c37
Merge branch 'master' into make-v28
RobinTail Apr 29, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ name: "CodeQL"

on:
push:
branches: [ master, v23, v24, v25, v26 ]
branches: [ master, v24, v25, v26, v27, make-v28 ]
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • make v27 branch
Suggested change
branches: [ master, v24, v25, v26, v27, make-v28 ]
branches: [ master, v24, v25, v26, v27, v28 ]

pull_request:
# The branches below must be a subset of the branches above
branches: [ master, v23, v24, v25, v26 ]
branches: [ master, v24, v25, v26, v27, make-v28 ]
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
branches: [ master, v24, v25, v26, v27, make-v28 ]
branches: [ master, v24, v25, v26, v27, v28 ]

schedule:
- cron: '26 8 * * 1'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/headers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- cron: "0 0 * * 0" # Runs every Sunday at midnight UTC

permissions:
contents: write # Grants write access to push changes
contents: write # Grants write access to push changes
pull-requests: write # and create PRs

jobs:
Expand All @@ -31,7 +31,7 @@ jobs:
run: pnpm install

- name: Check for new headers on IANA.ORG
run: pnpm unrun tools/headers.ts
run: pnpm node tools/headers.ts

- name: Check for changes
id: git-state
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/node.js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ name: Node.js CI

on:
push:
branches: [ master, v23, v24, v25, v26 ]
branches: [ master, v24, v25, v26, v27, make-v28 ]
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
branches: [ master, v24, v25, v26, v27, make-v28 ]
branches: [ master, v24, v25, v26, v27, v28 ]

pull_request:
branches: [ master, v23, v24, v25, v26 ]
branches: [ master, v24, v25, v26, v27, make-v28 ]
Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
branches: [ master, v24, v25, v26, v27, make-v28 ]
branches: [ master, v24, v25, v26, v27, v28 ]


jobs:
build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
node-version: [20.19.0, 20.x, 22.12.0, 22.x, 24.0.0, 24.x]
node-version: [22.19.0, 22.x, 24.0.0, 24.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Checkout
Expand Down
37 changes: 37 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,42 @@
# Changelog

## Version 28

### v28.0.0

- Supported Node.js versions: `^22.19.0 || ^24.0.0`;
- Breaking changes to the `createConfig()` argument (object):
- property `wrongMethodBehavior` (number) changed to `hintAllowedMethods` (boolean);
- property `methodLikeRouteBehavior` (string literal) changed to `recognizeMethodDependentRoutes` (boolean);
- Breaking change to the `Documentation` constructor argument (object):
- property `hasSummaryFromDescription` renamed to `hasSummary`;
- Breaking change to the `Integration` constructor argument (object):
- property `noContent` renamed to `noBodySchema`;
- Consider using [the automated migration](https://www.npmjs.com/package/@express-zod-api/migration).

```diff
createConfig({
- wrongMethodBehavior: 404,
+ hintAllowedMethods: false,
- methodLikeRouteBehavior: "path",
+ recognizeMethodDependentRoutes: false,
});
```

```diff
new Documentation({
- hasSummaryFromDescription: false,
+ hasSummary: false,
});
```

```diff
new Integration({
- noContent: z.undefined(),
+ noBodySchema: z.undefined(),
});
```

## Version 27

### v27.2.0
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ const helloWorldEndpoint = defaultEndpointsFactory.build({
Connect your endpoint to the `/v1/hello` route:

```ts
import { Routing } from "express-zod-api";
import type { Routing } from "express-zod-api";

const routing: Routing = {
v1: {
Expand Down Expand Up @@ -920,7 +920,7 @@ it normalizes errors into consistent HTTP responses with sensible status codes.
- Routing, parsing and upload issues:
- Handled by `ResultHandler` configured as `errorHandler` (the defaults is `defaultResultHandler`);
- Parsing errors: passed through as-is (typically `HttpError` with `4XX` code used for response by default);
- Routing errors: `404` or `405`, based on `wrongMethodBehavior` configuration;
- Routing errors: `404` or `405`, based on `hintAllowedMethods` configuration;
- Upload issues: thrown only if `upload.limitError` is configured (`HttpError::statusCode` can be used for response);
- For other errors the default status code is `500`;
- `ResultHandler` failures:
Expand Down Expand Up @@ -1218,7 +1218,7 @@ purpose, the `.deprecated()` method is available on each schema and `Endpoint`,
You can also deprecate all routes the `Endpoint` assigned to by setting `EndpointsFactory::build({ deprecated: true })`.

```ts
import { Routing } from "express-zod-api";
import type { Routing } from "express-zod-api";
import { z } from "zod";

const someEndpoint = factory.build({
Expand Down
1 change: 1 addition & 0 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

| Version | Code name | Release | Supported |
| ------: | :------------ | :------ | :----------------: |
| 28.x.x | Koko | 04.2026 | :white_check_mark: |
| 27.x.x | Nikki | 02.2026 | :white_check_mark: |
| 26.x.x | Lia | 12.2025 | :white_check_mark: |
| 25.x.x | Sara | 08.2025 | :white_check_mark: |
Expand Down
2 changes: 1 addition & 1 deletion cjs-test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"extends": "@tsconfig/node20/tsconfig.json",
"extends": "@tsconfig/node22/tsconfig.json",
"include": ["quick-start.ts"]
}
2 changes: 1 addition & 1 deletion compat-test/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@ import migration from "@express-zod-api/migration";

export default [
{ languageOptions: { parser }, plugins: { migration } },
{ files: ["**/*.ts"], rules: { "migration/v27": "error" } },
{ files: ["**/*.ts"], rules: { "migration/v28": "error" } },
];
6 changes: 2 additions & 4 deletions compat-test/migration.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import { readFile } from "node:fs/promises";
import { describe, test, expect } from "vitest";

describe("Migration", () => {
test("should fix the import", async () => {
test("should migrate", async () => {
const fixed = await readFile("./sample.ts", "utf-8");
expect(fixed).toBe(
`import typescript from "typescript";\n\nnew Integration({ typescript, routing });\n`,
);
expect(fixed.split("\n")[0]).toBe(`createConfig({ hintAllowedMethods: false });`);
});
});
6 changes: 3 additions & 3 deletions compat-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,18 @@
"type": "module",
"private": true,
"scripts": {
"pretest": "echo 'new Integration({ routing });' > sample.ts",
"pretest": "echo 'createConfig({ wrongMethodBehavior: 404 });' > sample.ts",
"test": "eslint --fix && vitest --run",
"posttest": "rm sample.ts"
},
"devDependencies": {
"@express-zod-api/migration": "workspace:*",
"eslint": "npm:eslint@9.0.0",
"eslint": "npm:eslint@10.0.0",
"express": "npm:express@5.1.0",
"express-zod-api": "workspace:*",
"http-errors": "npm:http-errors@2.0.1",
"typescript": "npm:typescript@5.1.3",
"typescript-eslint": "npm:typescript-eslint@8.0.0",
"typescript-eslint": "npm:typescript-eslint@8.58.0",
"zod": "npm:zod@4.1.13"
}
}
4 changes: 2 additions & 2 deletions compat-test/quick-start.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ import {
expect,
test,
} from "vitest";
import { givePort } from "../tools/ports";
import { givePort } from "../tools/ports.ts";

describe("ESM Test", async () => {
let out = "";
const listener = (chunk: Buffer) => {
out += chunk.toString();
};
const quickStart = spawn("unrun", ["quick-start.ts"]);
const quickStart = spawn("node", ["quick-start.ts"]);
Comment thread
coderabbitai[bot] marked this conversation as resolved.
quickStart.stdout.on("data", listener);
quickStart.stderr.on("data", listener);
await vi.waitFor(() => assert(out.includes(`Listening`)), { timeout: 1e4 });
Expand Down
4 changes: 3 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ export default tsPlugin.config(
prettierRules,
{
name: "globally/ignored",
ignores: ["**/dist/", "**/coverage/", "compat-test/sample.ts"],
ignores: ["**/dist/", "**/coverage/", "compat-test"],
},
{
name: "globally/disabled",
Expand All @@ -210,6 +210,7 @@ export default tsPlugin.config(
curly: ["warn", "multi-or-nest", "consistent"],
"@typescript-eslint/no-shadow": "warn",
"no-restricted-syntax": ["warn", ...importConcerns],
"no-duplicate-imports": "warn",
},
},
{
Expand Down Expand Up @@ -274,6 +275,7 @@ export default tsPlugin.config(
files: ["*-test/quick-start.ts", "example/example.client.ts"],
rules: {
"prettier/prettier": "off",
"no-duplicate-imports": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-empty-object-type": [
"error",
Expand Down
4 changes: 2 additions & 2 deletions esm-test/quick-start.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { spawn } from "node:child_process";
import { givePort } from "../tools/ports";
import { givePort } from "../tools/ports.ts";

describe("ESM Test", async () => {
let out = "";
const listener = (chunk: Buffer) => {
out += chunk.toString();
};
const quickStart = spawn("unrun", ["quick-start.ts"]);
const quickStart = spawn("node", ["quick-start.ts"]);
quickStart.stdout.on("data", listener);
quickStart.stderr.on("data", listener);
const port = givePort("esm");
Expand Down
2 changes: 1 addition & 1 deletion example/config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BuiltinLogger, createConfig } from "express-zod-api";
import ui from "swagger-ui-express";
import createHttpError from "http-errors";
import { givePort } from "../tools/ports";
import { givePort } from "../tools/ports.ts";
import qs from "qs";

export const config = createConfig({
Expand Down
2 changes: 1 addition & 1 deletion example/endpoints/create-user.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import createHttpError from "http-errors";
import assert from "node:assert/strict";
import { z } from "zod";
import { statusDependingFactory } from "../factories";
import { statusDependingFactory } from "../factories.ts";

const namePart = z.string().regex(/^\w+$/);

Expand Down
2 changes: 1 addition & 1 deletion example/endpoints/delete-user.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import createHttpError from "http-errors";
import assert from "node:assert/strict";
import { z } from "zod";
import { noContentFactory } from "../factories";
import { noContentFactory } from "../factories.ts";

/** @desc The endpoint demonstrates no content response established by its factory */
export const deleteUserEndpoint = noContentFactory.buildVoid({
Expand Down
2 changes: 1 addition & 1 deletion example/endpoints/list-users.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { z } from "zod";
import { arrayRespondingFactory } from "../factories";
import { arrayRespondingFactory } from "../factories.ts";

const roleSchema = z.enum(["manager", "operator", "admin"]);

Expand Down
2 changes: 1 addition & 1 deletion example/endpoints/retrieve-user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import createHttpError from "http-errors";
import assert from "node:assert/strict";
import { z } from "zod";
import { defaultEndpointsFactory } from "express-zod-api";
import { methodProviderMiddleware } from "../middlewares";
import { methodProviderMiddleware } from "../middlewares.ts";

// Demonstrating circular schemas using z.object()
const feature = z
Expand Down
2 changes: 1 addition & 1 deletion example/endpoints/send-avatar.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { z } from "zod";
import { fileSendingEndpointsFactory } from "../factories";
import { fileSendingEndpointsFactory } from "../factories.ts";
import { readFile } from "node:fs/promises";

export const sendAvatarEndpoint = fileSendingEndpointsFactory.build({
Expand Down
2 changes: 1 addition & 1 deletion example/endpoints/stream-avatar.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { z } from "zod";
import { fileStreamingEndpointsFactory } from "../factories";
import { fileStreamingEndpointsFactory } from "../factories.ts";

export const streamAvatarEndpoint = fileStreamingEndpointsFactory.build({
shortDescription: "Streams a file content.",
Expand Down
2 changes: 1 addition & 1 deletion example/endpoints/time-subscription.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { z } from "zod";
import { setTimeout } from "node:timers/promises";
import { eventsFactory } from "../factories";
import { eventsFactory } from "../factories.ts";

/** @desc The endpoint demonstrates emitting server-sent events (SSE) */
export const subscriptionEndpoint = eventsFactory.buildVoid({
Expand Down
2 changes: 1 addition & 1 deletion example/endpoints/update-user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import createHttpError from "http-errors";
import assert from "node:assert/strict";
import { z } from "zod";
import { ez } from "express-zod-api";
import { keyAndTokenAuthenticatedEndpointsFactory } from "../factories";
import { keyAndTokenAuthenticatedEndpointsFactory } from "../factories.ts";

export const updateUserEndpoint =
keyAndTokenAuthenticatedEndpointsFactory.build({
Expand Down
2 changes: 1 addition & 1 deletion example/factories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
EventStreamFactory,
defaultEndpointsFactory,
} from "express-zod-api";
import { authMiddleware } from "./middlewares";
import { authMiddleware } from "./middlewares.ts";
import { createReadStream } from "node:fs";
import { z } from "zod";
import { stat } from "node:fs/promises";
Expand Down
4 changes: 2 additions & 2 deletions example/generate-client.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { writeFile } from "node:fs/promises";
import { Integration } from "express-zod-api";
import { routing } from "./routing";
import { config } from "./config";
import { routing } from "./routing.ts";
import { config } from "./config.ts";
import typescript from "typescript";

await writeFile(
Expand Down
6 changes: 3 additions & 3 deletions example/generate-documentation.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { writeFile } from "node:fs/promises";
import { Documentation } from "express-zod-api";
import { config } from "./config";
import { routing } from "./routing";
import manifest from "./package.json";
import { config } from "./config.ts";
import { routing } from "./routing.ts";
import manifest from "./package.json" with { type: "json" };

await writeFile(
"example.documentation.yaml",
Expand Down
9 changes: 4 additions & 5 deletions example/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import assert from "node:assert/strict";
import assert, { fail } from "node:assert/strict";
import { spawn } from "node:child_process";
import { createReadStream, readFileSync } from "node:fs";
import { Client, Subscription } from "./example.client";
import { givePort } from "../tools/ports";
import { Client, Subscription } from "./example.client.ts";
import { givePort } from "../tools/ports.ts";
import { createHash } from "node:crypto";
import { readFile } from "node:fs/promises";
import { fail } from "node:assert";

describe("Example", async () => {
let out = "";
const listener = (chunk: Buffer) => {
out += chunk.toString();
};
const matchOut = (regExp: RegExp) => regExp.test(out);
const example = spawn("unrun", ["index.ts"]);
const example = spawn("node", ["index.ts"]);
example.stdout.on("data", listener);
const port = givePort("example");
await vi.waitFor(() => assert(out.includes(`Listening`)), { timeout: 1e4 });
Expand Down
4 changes: 2 additions & 2 deletions example/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { createServer } from "express-zod-api";
import { config } from "./config";
import { routing } from "./routing";
import { config } from "./config.ts";
import { routing } from "./routing.ts";

/**
* "await" is only needed for using entities returned from this method.
Expand Down
2 changes: 1 addition & 1 deletion example/middlewares.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import createHttpError from "http-errors";
import assert from "node:assert/strict";
import { z } from "zod";
import { Method, Middleware } from "express-zod-api";
import { Middleware, type Method } from "express-zod-api";

export const authMiddleware = new Middleware({
security: {
Expand Down
6 changes: 3 additions & 3 deletions example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
"version": "0.0.0",
"type": "module",
"scripts": {
"start": "unrun index.ts",
"start": "node index.ts",
"build": "pnpm build:docs && pnpm build:client",
"build:docs": "unrun generate-documentation.ts",
"build:client": "unrun generate-client.ts",
"build:docs": "node generate-documentation.ts",
"build:client": "node generate-client.ts",
"pretest": "tsc",
"test": "vitest run index.spec.ts"
},
Expand Down
Loading
Loading