Adds pkg.pr.new to publish PR preview versions - #3668
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds workflow concurrency, a ChangesCI Preview Publishing
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR introduces a new Zod output “variant” option (classic vs Zod Mini) across the generator/writers/docs/tests, and adds a GitHub Actions job to publish per-PR preview packages using pkg-pr-new.
Changes:
- Add
override.zod.variant: 'classic' | 'mini', including Zod Mini generation paths, import selection (zodvszod/mini), and target validation (Mini requires Zod v4). - Update schema writers, reusable schema rewriting, and test contexts/snapshots to account for the new variant and Zod Mini output shape.
- Add
pkg-pr-newand a newpublish-previewworkflow job to publish PR preview versions.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/zod/src/zod.test.ts | Adds coverage for Zod Mini rendering and dependency selection. |
| packages/zod/src/index.ts | Implements Zod Mini rendering, variant plumbing, dependency import source selection, and array bound checks. |
| packages/zod/src/compatible-v4.ts | Adds Zod target validation and helpers for import source/type name based on variant. |
| packages/zod/src/compatible-v4.test.ts | Tests new target helper functions (variant import/type and Mini/v4 validation). |
| packages/solid-start/src/index.test.ts | Updates test output context to include zod.variant. |
| packages/orval/src/write-zod-specs.ts | Adds variant-aware Zod import emission and variant-aware schema type annotation. |
| packages/orval/src/write-zod-specs.test.ts | Adds regression test for Zod Mini schema file imports/output. |
| packages/orval/src/utils/options.ts | Normalizes override.zod.variant (defaulting to classic) and disallows it at per-operation/tag scope. |
| packages/orval/src/utils/options.test.ts | Tests variant defaulting and operation/tag override filtering. |
| packages/orval/src/reusable-schemas.ts | Threads variant through reusable schema generation; adds PURE annotations for Mini lazy edges. |
| packages/orval/src/reusable-schemas.test.ts | Tests PURE annotation behavior for Mini lazy self-loops. |
| packages/mock/src/faker/getters/combine.test.ts | Updates test context to include zod.variant. |
| packages/mcp/src/index.ts | Emits variant-aware Zod import for generated MCP zod files. |
| packages/hono/src/index.ts | Emits variant-aware Zod import for generated hono zod files. |
| packages/core/src/types.ts | Introduces ZodVariantOption and documents the new variant option in types. |
| packages/core/src/test-utils/context.ts | Updates shared test context defaults to include zod.variant. |
| packages/angular/src/http-resource.test.ts | Updates test output context to include zod.variant. |
| packages/angular/src/http-client.test.ts | Updates test output context to include zod.variant. |
| package.json | Adds pkg-pr-new dependency. |
| docs/content/docs/reference/configuration/output.mdx | Documents new override.zod.variant option. |
| docs/content/docs/guides/zod.mdx | Adds Zod Mini guidance and example config/snippets (including type inference section). |
| bun.lock | Locks pkg-pr-new dependency. |
| .github/workflows/pr-checks.yaml | Adds publish-preview job to publish PR preview packages. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In @.github/workflows/pr-checks.yaml:
- Around line 61-64: The Checkout repository step in the PR workflow is leaving
the default GitHub token persisted in the workspace, which can be reused by
PR-controlled code later in the job. Update the actions/checkout usage in the
PR-checks workflow to disable credential persistence by setting
persist-credentials to false alongside the existing ref configuration so the
checked-out code cannot access the checkout token.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: b3495edd-4f4c-402f-bd71-a6841aab113c
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (2)
.github/workflows/pr-checks.yamlpackage.json
|
@anymaniax we have to add this pkg.pr.new github app permissons to this repo? |
This PR adds a new step on
pr-checkworkflow that uses https://pkg.pr.new/ to publish a preview version of orval on each PR opened.You still need to connect pkg.pr.new github app to this repo before merging this :)
Hopefully this helps trying out new changes without disrupting orval's release scheduled or complex beta release publish flows.
Summary by CodeRabbit