Skip to content

Commit 246f1cd

Browse files
Detaching migration (#2736)
This is the first step I towards the idea of code splitting into several smaller packages that could be pluggable and reusable, e.g. by Zod Sockets. Decisions to make: - ~~unified tagging with canonical version:~~ - ~~`pnpm dlx bumpp -r preminor --preid beta`~~ - independent versioning and individual tagging - `pnpm -F [workspace] exec pnpm dlx bumpp preminor --preid beta --tag=[package]-%s` - for keeping some dependencies in sync: - ~~pnpm catalogs~~ - renovate groups <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Introduced a dedicated migration package, now available as a separate npm module with its own documentation and configuration. - Added compatibility testing to the CI workflow. - **Improvements** - Enhanced documentation with direct links to migration resources and updated changelog entries. - Modularized and clarified ESLint configuration for better rule management and migration support. - Expanded workspace and package management to support the new migration and compatibility test packages. - Updated GitHub workflows to support dynamic workspace selection for version bumping and publishing. - **Bug Fixes** - Updated test suite to ensure OpenAPI documentation is validated consistently. - **Chores** - Refined build scripts, removed obsolete scripts and dependencies, and improved package publishing workflows. - Updated .gitignore to include the migration directory. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent e56d0c7 commit 246f1cd

29 files changed

Lines changed: 652 additions & 218 deletions

.github/workflows/beta.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ name: Beta
33
on:
44
workflow_dispatch:
55
inputs:
6+
workspace:
7+
description: 'Workspace'
8+
required: true
9+
default: 'express-zod-api'
10+
type: choice
11+
options:
12+
- express-zod-api
13+
- migration
614
kind:
715
description: 'Making pre- what?'
816
required: true
@@ -31,6 +39,7 @@ jobs:
3139
- run: |
3240
pnpm install
3341
pnpm install_hooks
34-
- run: |
35-
pnpm -F express-zod-api exec \
36-
pnpm dlx bumpp pre${{ inputs.kind }} --preid beta -y
42+
- name: Bumpp ${{inputs.workspace}}
43+
run: |
44+
pnpm -F ${{inputs.workspace}} exec \
45+
pnpm dlx bumpp pre${{ inputs.kind }} --preid beta --tag=${{inputs.workspace}}-v%s -y

.github/workflows/minor.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
name: Minor
22

3-
on: workflow_dispatch
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
workspace:
7+
description: 'Workspace'
8+
required: true
9+
default: 'express-zod-api'
10+
type: choice
11+
options:
12+
- express-zod-api
13+
- migration
414

515
permissions:
616
contents: write
@@ -19,6 +29,7 @@ jobs:
1929
- run: |
2030
pnpm install
2131
pnpm install_hooks
22-
- run: |
23-
pnpm -F express-zod-api exec \
24-
pnpm dlx bumpp minor -y
32+
- name: Bumpp ${{inputs.workspace}}
33+
run: |
34+
pnpm -F ${{inputs.workspace}} exec \
35+
pnpm dlx bumpp minor --tag=${{inputs.workspace}}-v%s -y

.github/workflows/node.js.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ jobs:
4747
run: pnpm test:cjs
4848
- name: ESM test
4949
run: pnpm test:esm
50+
- name: Compatibility test
51+
run: pnpm test:compat
5052
- name: Issue 952 # see https://github.com/RobinTail/express-zod-api/issues/952
5153
run: pnpm test:952
5254
report:

.github/workflows/npm-publish.yml

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,14 @@ name: Publish to NPM
55
on:
66
workflow_dispatch:
77
inputs:
8+
workspace:
9+
description: 'Workspace'
10+
required: true
11+
default: 'express-zod-api'
12+
type: choice
13+
options:
14+
- express-zod-api
15+
- migration
816
tag:
917
description: 'Release channel'
1018
required: true
@@ -29,9 +37,9 @@ jobs:
2937
registry-url: https://registry.npmjs.org/
3038
- name: Install dependencies
3139
run: pnpm install
32-
- name: Publish with ${{ inputs.tag }}
40+
- name: Publish ${{inputs.workspace}} with ${{ inputs.tag }}
3341
env:
3442
NODE_AUTH_TOKEN: ${{secrets.NPM_KEY}}
3543
run: |
36-
pnpm -F express-zod-api exec \
44+
pnpm -F ${{inputs.workspace}} exec \
3745
pnpm publish --provenance --tag ${{ inputs.tag }}

.github/workflows/patch.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
name: Patch
22

3-
on: workflow_dispatch
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
workspace:
7+
description: 'Workspace'
8+
required: true
9+
default: 'express-zod-api'
10+
type: choice
11+
options:
12+
- express-zod-api
13+
- migration
414

515
permissions:
616
contents: write
@@ -19,6 +29,7 @@ jobs:
1929
- run: |
2030
pnpm install
2131
pnpm install_hooks
22-
- run: |
23-
pnpm -F express-zod-api exec \
24-
pnpm dlx bumpp patch -y
32+
- name: Bumpp ${{inputs.workspace}}
33+
run: |
34+
pnpm -F ${{inputs.workspace}} exec \
35+
pnpm dlx bumpp patch --tag=${{inputs.workspace}}-v%s -y

.github/workflows/validations.yml

Lines changed: 0 additions & 61 deletions
This file was deleted.

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
node_modules
22
dist
33
*.tgz
4-
migration
54
.idea
65
.npmrc
76
coverage

CHANGELOG.md

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Version 24
44

5+
### v24.4.0
6+
7+
- Automated migration moved to the [dedicated package](https://www.npmjs.com/package/@express-zod-api/migration).
8+
59
### v24.3.2
610

711
- Removed previously deprecated plural properties from `ApiResponse` interface: `statusCodes`, `mimeTypes`.
@@ -83,18 +87,7 @@ type Type1 = `start${number}mid${boolean}end`;
8387
- The `getExamples()` public helper removed — ~~use `.meta()?.examples` instead~~, restored in v24.1.0;
8488
- Added the new proprietary schema `ez.buffer()`;
8589
- The `ez.file()` schema removed: use `z.string()`, `z.base64()`, `ez.buffer()` or their union;
86-
- Consider the automated migration using the built-in ESLint rule.
87-
88-
```js
89-
// eslint.config.mjs — minimal ESLint 9 config to apply migrations automatically using "eslint --fix"
90-
import parser from "@typescript-eslint/parser";
91-
import migration from "express-zod-api/migration";
92-
93-
export default [
94-
{ languageOptions: { parser }, plugins: { migration } },
95-
{ files: ["**/*.ts"], rules: { "migration/v24": "error" } },
96-
];
97-
```
90+
- Consider [the automated migration](https://www.npmjs.com/package/@express-zod-api/migration).
9891

9992
```diff
10093
- import { z } from "zod";

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Start your API server with I/O schema validation and custom middlewares in minut
6161
1. [Excessive properties in endpoint output](#excessive-properties-in-endpoint-output)
6262
9. [Your input to my output](#your-input-to-my-output)
6363

64-
You can find the release notes and migration guides in [Changelog](CHANGELOG.md).
64+
See also [Changelog](CHANGELOG.md) and [automated migration](https://www.npmjs.com/package/@express-zod-api/migration).
6565

6666
# Overview
6767

compat-test/eslint.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import parser from "@typescript-eslint/parser";
2-
import migration from "express-zod-api/migration";
2+
import migration from "@express-zod-api/migration";
33

44
export default [
55
{ languageOptions: { parser }, plugins: { migration } },

0 commit comments

Comments
 (0)