Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
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/async-api-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: AsyncAPI Validation

on:
push:
branches: [ main, make-v4 ]
branches: [ main, make-v6 ]
pull_request:
branches: [ main, make-v4 ]
branches: [ main, make-v6 ]

jobs:
validate:
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,16 +5,16 @@ name: Node.js CI

on:
push:
branches: [ main, make-v5 ]
branches: [ main, make-v6 ]
pull_request:
branches: [ main, make-v5 ]
branches: [ main, make-v6 ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
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
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Changelog

## Version 6

### v6.0.0

- Supported Node.js versions: `^22.19.0 || ^24.0.0`;
- Supported Zod version: `^4.3.4`;
- The `typescript` dependency is now optional and only required for making `Integration`:
- Either import and assign the `typescript` property to its constructor argument;
- Or use the new static async method `create()` to delegate the import;
- This change addresses the potential memory consumption issue.

## Version 5

### v5.2.0
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ schemas, it can be exported to frontend side, thus ensuring that the established
Install the package and its peer dependencies.

```shell
pnpm add zod-sockets zod socket.io typescript
pnpm add zod-sockets zod socket.io
```

## Set up config
Expand Down Expand Up @@ -577,8 +577,9 @@ In order to establish constraints for events on the client side you can generate

```typescript
import { Integration } from "zod-sockets";
import typescript from "typescript";

const integration = new Integration({ config, actions });
const integration = new Integration({ typescript, config, actions });
const typescriptCode = integration.print(); // write this to a file
```

Expand Down
2 changes: 1 addition & 1 deletion compat-test/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"devDependencies": {
"express": "^5.1.0",
"express-zod-api": "^27.2.0",
"express-zod-api": "^28.0.0-beta.3",
"http-errors": "^2.0.0",
"socket.io": "catalog:dev",
"typescript": "catalog:dev",
Expand Down
3 changes: 2 additions & 1 deletion example/generate-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ import { writeFile } from "node:fs/promises";
import { Integration } from "zod-sockets";
import { actions } from "./actions";
import { config } from "./config";
import typescript from "typescript";

await writeFile(
"example-client.ts",
new Integration({ config, actions }).print(),
new Integration({ typescript, config, actions }).print(),
"utf-8",
);
10 changes: 6 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,21 @@
},
"devDependencies": {
"@arethetypeswrong/core": "^0.18.1",
"@tsconfig/node20": "^20.1.5",
"@eslint/js": "^10.0.1",
"@tsconfig/node22": "^22.0.5",
"@types/node": "^25.0.2",
"@vitest/coverage-v8": "^4.1.2",
"eslint": "^9.39.4",
"eslint": "^10.0.3",
"eslint-config-prettier": "^10.1.8",
"eslint-plugin-allowed-dependencies": "^2.1.0",
"eslint-plugin-prettier": "^5.5.5",
"globals": "^17.4.0",
"husky": "^9.0.10",
"prettier": "3.8.3",
"tsdown": "^0.21.4",
"unrun": "^0.2.32",
"typescript": "catalog:dev",
"typescript-eslint": "~8.55.0",
"typescript-eslint": "^8.58.0",
"unrun": "^0.2.32",
"vitest": "^4.1.2"
},
"packageManager": "pnpm@10.33.0+sha512.10568bb4a6afb58c9eb3630da90cc9516417abebd3fabbe6739f0ae795728da1491e9db5a544c76ad8eb7570f5c4bb3d6c637b2cb41bfdcdb47fa823c8649319"
Expand Down
Loading
Loading