Skip to content

chore: regenerate stale lite schemas after lite-mode generator change - #2813

Merged
ymc9 merged 1 commit into
devfrom
fix/regenerate-lite-schemas
Aug 23, 2026
Merged

chore: regenerate stale lite schemas after lite-mode generator change#2813
ymc9 merged 1 commit into
devfrom
fix/regenerate-lite-schemas

Conversation

@ymc9

@ymc9 ymc9 commented Aug 23, 2026

Copy link
Copy Markdown
Member

Summary

The v3.9.2 publish run failed with ERR_PNPM_GIT_UNCLEAN (failed run).

Root cause: #2794 changed what zen generate --lite emits (lite schemas now retain lite attributes such as @default/@updatedAt instead of stripping all attributes), but the generated schema-lite.ts files tracked in git were not regenerated. Several samples run zen generate as part of their build script, so CI's build step rewrote these tracked files and left the working tree dirty, causing pnpm publish to refuse to publish.

This PR commits the regenerated files. Verified locally that re-running generation on top of this commit produces no diff.

After this lands on dev, it needs to be merged to main and the publish workflow re-run to release v3.9.2 (no packages were published by the failed run).

Possible follow-up

Consider adding a git diff --exit-code check after the build in the build-test workflow so stale generated files fail PR CI instead of the release.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Schema metadata now accurately exposes generated defaults for IDs, timestamps, and unpublished posts.
    • Automatic timestamp updates are now represented consistently across sample applications.
    • Profile schema metadata now retains strict mode without an obsolete strict attribute.
    • Default ID generation is consistently represented for supported models in TanStack Query schema tests.

PR #2794 changed what `zen generate --lite` emits (lite schemas now
retain lite attributes instead of stripping all attributes), but the
tracked generated schema-lite.ts files were not regenerated. This left
the CI working tree dirty after the build step, causing the v3.9.2
publish to fail with ERR_PNPM_GIT_UNCLEAN.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 0b45e6d6-c442-46f6-85a4-5ce07856a26c

📥 Commits

Reviewing files that changed from the base of the PR and between ca354fe and 7bc12df.

📒 Files selected for processing (4)
  • packages/clients/tanstack-query/test/schemas/basic/schema-lite.ts
  • samples/next.js/zenstack/schema-lite.ts
  • samples/nuxt/zenstack/schema-lite.ts
  • samples/sveltekit/src/zenstack/schema-lite.ts

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

Changes

The schema-lite metadata now records @default and @updatedAt applications for model fields across test and sample schemas. The basic schema adds cuid() defaults to IDs and removes serialized @@strict metadata from Profile.

Schema metadata

Layer / File(s) Summary
Basic schema metadata
packages/clients/tanstack-query/test/schemas/basic/schema-lite.ts
Model ID fields now expose @default(cuid()). Profile retains strict: true without serialized @@strict metadata.
Sample schema metadata
samples/next.js/zenstack/schema-lite.ts, samples/nuxt/zenstack/schema-lite.ts, samples/sveltekit/src/zenstack/schema-lite.ts
Sample schemas now import AttributeApplication and expose typed default and updatedAt attributes for IDs, timestamps, and Post.published. Existing default and update metadata remains.

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to 7bc12

This change refreshes tracked lite schema outputs so generation no longer dirties the working tree; no actionable merge-blocking risk remains after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly states that stale lite schemas were regenerated after a lite-mode generator change.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 4 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/regenerate-lite-schemas

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

packages/clients/tanstack-query/test/schemas/basic/schema-lite.ts

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.

samples/next.js/zenstack/schema-lite.ts

ESLint skipped: missing config or dependency (missing-dependency). The ESLint configuration references a package that is not available in the sandbox.


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

Comment @coderabbitai help to get the list of available commands.

@ymc9
ymc9 merged commit 314d248 into dev Aug 23, 2026
8 checks passed
@ymc9
ymc9 deleted the fix/regenerate-lite-schemas branch August 23, 2026 11:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant