Skip to content

Detaching migration#2736

Merged
RobinTail merged 49 commits intomasterfrom
detach-migration
Jun 15, 2025
Merged

Detaching migration#2736
RobinTail merged 49 commits intomasterfrom
detach-migration

Conversation

@RobinTail
Copy link
Copy Markdown
Owner

@RobinTail RobinTail commented Jun 11, 2025

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

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.

@RobinTail RobinTail added dependencies Pull requests that update a dependency file refactoring The better way to achieve the same result CI/CD labels Jun 11, 2025
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 11, 2025

Walkthrough

This update restructures the migration logic for Express Zod API into a dedicated npm package, adjusts build and lint configurations accordingly, and updates documentation and workflows to reference the new migration package. It also introduces compatibility tests, refines package exports, and enhances workflow flexibility for multi-workspace operations.

Changes

Files / Grouped Paths Change Summary
.github/workflows/beta.yml, .github/workflows/minor.yml, .github/workflows/npm-publish.yml, .github/workflows/patch.yml Added workspace input to workflows, enabling dynamic selection of workspace for version bumping and publishing; commands and step names updated accordingly.
.github/workflows/node.js.yml Added a compatibility test step to the CI workflow.
.gitignore Removed the ignore rule for the migration directory.
CHANGELOG.md, README.md Updated to reference the new migration package and revised migration instructions.
compat-test/package.json, compat-test/eslint.config.js Expanded package manifest, added scripts and dependencies, updated migration plugin import path.
compat-test/sample.ts Removed sample instantiation code.
eslint.config.js Refactored for modular linting: separated configs for main and migration sources, updated ignore patterns and rules.
example/index.spec.ts, example/validate.spec.ts, example/package.json Moved OpenAPI validation test into main test file, removed redundant script and old test file.
express-zod-api/package.json Removed migration exports and files, and dropped related devDependencies.
express-zod-api/tsup.config.ts Simplified build config to a single entry, removed migration-specific build.
migration/README.md, migration/package.json, migration/tsconfig.json, migration/tsup.config.ts Added new migration package with documentation, build, and TypeScript configuration.
migration/index.spec.ts, migration/index.ts Updated import paths and removed deprecated comment block.
package.json Switched to recursive workspace build, updated scripts and devDependencies.
pnpm-workspace.yaml Added migration and compat-test to workspace, introduced dependency minimums catalog.
tsup.base.ts Added shared tsup build options as a new base config file.

Sequence Diagram(s)

sequenceDiagram
    participant Dev as Developer
    participant GH as GitHub Actions
    participant WS as Workspace (express-zod-api / migration)
    participant NPM as npm Registry

    Dev->>GH: Trigger workflow_dispatch (select workspace)
    GH->>WS: Run version bump or publish commands (using selected workspace)
    WS-->>GH: Build/package/test selected workspace
    GH->>NPM: Publish selected workspace (if applicable)
    NPM-->>GH: Confirm publish
Loading

Suggested labels

dedication

Poem

A hop, a skip, a package split—
Migration’s got its own new kit!
Workflows now can flex and choose,
Linting rules for every use.
Documentation shines anew,
Compatibility checks hop through.
🐇 CodeRabbit celebrates with you!


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@coveralls-official
Copy link
Copy Markdown

coveralls-official Bot commented Jun 12, 2025

Coverage Status

coverage: 100.0%. remained the same
when pulling 5cf7b52 on detach-migration
into e56d0c7 on master.

@RobinTail RobinTail added the miracle Mysterious events are happening here label Jun 13, 2025
RobinTail added a commit that referenced this pull request Jun 15, 2025
Replacement for:
225c323

Config can be validating this way:
```shell
npx --yes --package renovate -- renovate-config-validator --strict ./renovate.json
```

Instead of pnpm catalog attempted in #2736 

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Chores**
- Updated Renovate configuration to include new package rules for
managing updates to TypeScript ESLint and Vitest packages.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@RobinTail RobinTail mentioned this pull request Jun 15, 2025
RobinTail added a commit that referenced this pull request Jun 15, 2025
Addition to #2428 

It turned out that required peer dependencies are installed
automatically unless opted out:
https://pnpm.io/next/settings#autoinstallpeers

This might be a better solution since I want to absorb the validation
workflow into the existing integration tests without hoisting

Discovered while working on #2736 and might be needed to solve in
advance


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

- **Chores**
- Updated dependencies across multiple packages to use a centralized
peer dependency catalog.
- Added a new peer dependency catalog to the workspace configuration,
listing key runtime and type definition packages.
- Adjusted package dependencies to reference the new peer catalog,
removing direct versioned dependencies where applicable.
- Added or updated peer dependencies for packages such as zod and
http-errors in relevant projects.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@socket-security
Copy link
Copy Markdown

socket-security Bot commented Jun 15, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedtypescript-eslint@​8.0.01001007396100
Addedtypescript@​5.1.310010089100100
Addedeslint@​9.0.09710010096100
Addedzod@​3.25.35100100100100100

View full report

Comment thread migration/package.json Outdated
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🧹 Nitpick comments (1)
compat-test/package.json (1)

10-17: Review dependency version constraints
Locking to catalog:min without a major range may pull in incompatible future releases. Consider using a caret range for external libs or workspace:* for shared versions:

 "dependencies": {
   "@express-zod-api/migration": "workspace:*",
   "express-zod-api": "workspace:*",
   "express": "catalog:min",
   "typescript": "catalog:min",
   "http-errors": "catalog:min",
-  "zod": "3.25.35"
+  "zod": "^3.25.0"
 }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a6ed3af and 3663f74.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (5)
  • .github/workflows/node.js.yml (1 hunks)
  • compat-test/package.json (1 hunks)
  • compat-test/sample.ts (0 hunks)
  • package.json (1 hunks)
  • pnpm-workspace.yaml (1 hunks)
💤 Files with no reviewable changes (1)
  • compat-test/sample.ts
✅ Files skipped from review due to trivial changes (1)
  • .github/workflows/node.js.yml
🚧 Files skipped from review as they are similar to previous changes (2)
  • pnpm-workspace.yaml
  • package.json
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: report
🔇 Additional comments (1)
compat-test/package.json (1)

2-2: Confirm package naming consistency
The "name": "compat-test" field correctly identifies this workspace package as the compatibility test suite.

Comment thread compat-test/package.json
Comment thread compat-test/package.json
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
migration/package.json (1)

48-50: Add required linting devDependencies.
Your prepublishOnly script invokes eslint, so explicitly declare eslint and core TS-ESLint packages under devDependencies, referencing your dev catalog for consistency.

Example diff:

  "devDependencies": {
-   "@typescript-eslint/rule-tester": "^8.34.0"
+   "eslint": "catalog:dev",
+   "@typescript-eslint/parser": "catalog:dev",
+   "@typescript-eslint/eslint-plugin": "catalog:dev",
+   "@typescript-eslint/rule-tester": "catalog:dev"
  }
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3663f74 and 01972a8.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (2)
  • migration/package.json (1 hunks)
  • pnpm-workspace.yaml (2 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • pnpm-workspace.yaml
🧰 Additional context used
🧠 Learnings (1)
migration/package.json (1)
Learnt from: RobinTail
PR: RobinTail/express-zod-api#2428
File: express-zod-api/package.json:20-25
Timestamp: 2025-05-28T18:52:18.375Z
Learning: The `attw` command is the executable provided by the `@arethetypeswrong/cli` npm package. When `attw` is used in scripts, check for `@arethetypeswrong/cli` in dependencies rather than looking for an `attw` package.
🔇 Additional comments (5)
migration/package.json (5)

1-9: Metadata looks correct.
Name, version, license, description, repository, and author fields are well-defined.


3-3: Confirm version tagging strategy.
Ensure 24.0.0-beta.3 and its beta pre-release identifier align with your chosen unified or per-package versioning approach.


24-39: Export mappings are properly configured.
Dual support for both ESM and CommonJS consumers with matching type declarations is correctly set up.


17-23:

Details

✅ Verification successful

Validate build and publish scripts.
The postbuild script calls attw --pack from the root @arethetypeswrong/cli package, and prepublishOnly runs eslint && pnpm test && pnpm build. Verify that the CLI is hoisted correctly in your monorepo and that this sequence fits your CI/CD flow.


🏁 Script executed:

#!/bin/bash
# Check that @arethetypeswrong/cli is present and hoisted
grep -R "\"@arethetypeswrong/cli\"" -n .

Length of output: 98


Confirm CLI Hoisting and Script Order

The root package.json includes "@arethetypeswrong/cli": "^0.18.2", so attw --pack will be available in your monorepo after build. The prepublishOnly hook already runs ESLint, tests, and the build in the correct order for your CI/CD flow. No further changes needed.


44-47:

Details

✅ Verification successful

Verify the catalog:peer alias.
Make sure a peer catalog alias exists in pnpm-workspace.yaml. If your catalogs are named differently (e.g., min), update these entries to match the actual alias.


🏁 Script executed:

grep -R "catalogs" -n pnpm-workspace.yaml

Length of output: 54


🏁 Script executed:

#!/bin/bash
# Display the catalogs block to verify the defined aliases
sed -n '20,40p' pnpm-workspace.yaml

Length of output: 576


Peer catalog alias verified

The peer alias is defined in pnpm-workspace.yaml under the catalogs section, so the catalog:peer entries in migration/package.json are correct and require no changes.

@RobinTail RobinTail merged commit 246f1cd into master Jun 15, 2025
4 checks passed
@RobinTail RobinTail deleted the detach-migration branch June 15, 2025 16:58
RobinTail added a commit that referenced this pull request Jun 15, 2025
Related to #2736 

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

- **Chores**
- Updated the version bump workflow with more flexible versioning
options and improved input descriptions.
- Removed separate workflows for minor and patch version bumps,
consolidating version management into a single workflow.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@coderabbitai coderabbitai Bot mentioned this pull request Aug 5, 2025
@coderabbitai coderabbitai Bot mentioned this pull request Aug 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI/CD dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation miracle Mysterious events are happening here refactoring The better way to achieve the same result

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant