-
-
Notifications
You must be signed in to change notification settings - Fork 122
merge dev to main (v2.18.1) #2225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: Yiming <[email protected]> Co-authored-by: Claude <[email protected]> Co-authored-by: ymc9 <[email protected]>
📝 WalkthroughWalkthroughVersion bump and changelog updates for JetBrains IDE package. OpenAPI plugin adds AST TypeDef/enum support, conditional inclusion of @@openapi.ignore, and extended tests. TanStack Query plugin adjusts Angular generator typings/imports and runtime to support function-based args resolution. Integration tests update Prisma versions. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant OpenAPIGeneratorBase
participant AST
participant RPCGenerator
participant OpenAPI
User->>OpenAPIGeneratorBase: generate(spec, options{ includeOpenApiIgnored })
OpenAPIGeneratorBase->>AST: load models/enums/typedefs
OpenAPIGeneratorBase->>OpenAPIGeneratorBase: filter models by @@openapi.ignore (if false)
OpenAPIGeneratorBase->>RPCGenerator: generateComponents(models, enums, typedefs)
RPCGenerator->>OpenAPI: add model schemas
RPCGenerator->>OpenAPI: add TypeDef schemas
RPCGenerator->>OpenAPI: add missing AST enums
RPCGenerator->>OpenAPI: map fields (JSON→TypeDef ref if applicable)
OpenAPI-->>User: OpenAPI document
sequenceDiagram
participant Component
participant useModelQuery
participant Helpers as isFn/makeUrl
participant TanStack as injectQuery
Component->>useModelQuery: args (value or () => value), options
useModelQuery->>Helpers: isFn(args)
Helpers-->>useModelQuery: resolvedArgs
useModelQuery->>Helpers: makeUrl(resolvedArgs)
useModelQuery->>TanStack: injectQuery({ queryKey(resolvedArgs), queryFn(url) })
TanStack-->>Component: Query object
sequenceDiagram
participant Component
participant useInfiniteModelQuery
participant Helpers as isFn/makeUrl
participant TanStack as injectInfiniteQuery
Component->>useInfiniteModelQuery: args (value or () => value), options
useInfiniteModelQuery->>Helpers: isFn(args)
Helpers-->>useInfiniteModelQuery: resolvedArgs
useInfiniteModelQuery->>TanStack: injectInfiniteQuery({ initialPageParam: resolvedArgs, queryKey(resolvedArgs), queryFn(pageParam) -> makeUrl(pageParam ?? resolvedArgs) })
TanStack-->>Component: Infinite Query object
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Tip 🔌 Remote MCP (Model Context Protocol) integration is now available!Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats. ✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this 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
🔭 Outside diff range comments (1)
packages/plugins/tanstack-query/src/generator.ts (1)
679-683
: Add peerDependencies for @tanstack/angular-query-experimentalWe verified imports of
@tanstack/angular-query-experimental
in
packages/plugins/tanstack-query/src/generator.ts
packages/plugins/tanstack-query/scripts/postbuild.js
packages/plugins/tanstack-query/tests/plugin.test.ts
—but found no declaration of this package in any
peerDependencies
ordevDependencies
underpackages
. Without it, downstream consumers will be missing the types at build time.Please update your plugin manifest:
• packages/plugins/tanstack-query/package.json
--- a/packages/plugins/tanstack-query/package.json +++ b/packages/plugins/tanstack-query/package.json @@ "peerDependencies": { - // existing dependencies + "@tanstack/angular-query-experimental": "^5.84.0", }If your local build or tests also require it, add the same entry under
devDependencies
.
🧹 Nitpick comments (5)
packages/ide/jetbrains/CHANGELOG.md (1)
7-8
: Changelog entry added under UnreleasedThe fix note is clear and scoped. If you cut a 2.18.1 release, consider moving this from Unreleased into the 2.18.1 section for a permanent record.
packages/plugins/openapi/src/generator-base.ts (1)
18-21
: New includeOpenApiIgnored option: behavior and defaults make sense
- Default remains backward compatible (models with @@openapi.ignore are excluded).
- Opt-in flag includes them while still honoring @@ignore via getDataModels()’s default filter.
Consider adding a short doc comment in the option list (README or plugin docs) to surface this knob.
If you want, I can draft the docs snippet for this option.
packages/plugins/tanstack-query/src/generator.ts (1)
120-124
: Angular: allow function-based args type — aligns with runtime resolutionUnioning
args
to also accept() => args
matches the new runtime that resolves function-based inputs. This should unblock reactive/computed args patterns.Minor: consider documenting this in the generator README (Angular section) so users know they can pass a thunk for args.
packages/plugins/openapi/src/rpc-generator.ts (2)
913-919
: Dead check for TypeDef on JSON path; simplify or route through callersIn prismaTypeToOpenAPIType, type is literally 'JSON' or 'Json', so the isTypeDefType probe will never succeed. Returning {} for JSON here is sufficient; TypeDef-aware JSON mapping is already handled by generateField and generateTypeDefField.
Apply this diff:
- .with(P.union('JSON', 'Json'), () => { - // For Json fields, check if there's a specific TypeDef reference - // Otherwise, return empty schema for arbitrary JSON - const isTypeDefType = this.model.declarations.some(d => isTypeDef(d) && d.name === type); - return isTypeDefType ? this.ref(type, false) : {}; - }) + .with(P.union('JSON', 'Json'), () => ({} as OAPI.SchemaObject))
797-825
: Optional: mirror TypeDef-aware JSON mapping in inputsCurrently, inputs render JSON as {} even when the corresponding model field is @JSON TypeDef. If you want parity for create/update payloads, consider detecting the owning model from the input type’s name (e.g., /^(\w+)(Create|Update)(Many)?Input$/), finding the ZModel field by name, and emitting a $ref to the TypeDef in generateInputComponent for those JSON fields.
Happy to draft a targeted refactor if you want to tackle this in this PR or a follow-up.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (22)
package.json
is excluded by!**/*.json
packages/ide/jetbrains/package.json
is excluded by!**/*.json
packages/language/package.json
is excluded by!**/*.json
packages/misc/redwood/package.json
is excluded by!**/*.json
packages/plugins/openapi/package.json
is excluded by!**/*.json
packages/plugins/openapi/tests/baseline/rpc-type-coverage-3.0.0.baseline.yaml
is excluded by!**/*.yaml
packages/plugins/openapi/tests/baseline/rpc-type-coverage-3.1.0.baseline.yaml
is excluded by!**/*.yaml
packages/plugins/swr/package.json
is excluded by!**/*.json
packages/plugins/tanstack-query/package.json
is excluded by!**/*.json
packages/plugins/trpc/package.json
is excluded by!**/*.json
packages/plugins/trpc/tests/projects/nuxt-trpc-v10/package.json
is excluded by!**/*.json
packages/plugins/trpc/tests/projects/nuxt-trpc-v11/package.json
is excluded by!**/*.json
packages/plugins/trpc/tests/projects/t3-trpc-v11/package.json
is excluded by!**/*.json
packages/runtime/package.json
is excluded by!**/*.json
packages/schema/package.json
is excluded by!**/*.json
packages/sdk/package.json
is excluded by!**/*.json
packages/server/package.json
is excluded by!**/*.json
packages/testtools/package.json
is excluded by!**/*.json
pnpm-lock.yaml
is excluded by!**/pnpm-lock.yaml
,!**/*.yaml
tests/integration/test-run/package.json
is excluded by!**/*.json
tests/integration/tests/frameworks/nextjs/test-project/package.json
is excluded by!**/*.json
tests/integration/tests/frameworks/trpc/test-project/package.json
is excluded by!**/*.json
📒 Files selected for processing (8)
packages/ide/jetbrains/CHANGELOG.md
(1 hunks)packages/ide/jetbrains/build.gradle.kts
(1 hunks)packages/plugins/openapi/src/generator-base.ts
(1 hunks)packages/plugins/openapi/src/rpc-generator.ts
(6 hunks)packages/plugins/openapi/tests/openapi-rpc.test.ts
(3 hunks)packages/plugins/tanstack-query/src/generator.ts
(2 hunks)packages/plugins/tanstack-query/src/runtime-v5/angular.ts
(3 hunks)tests/integration/tests/cli/plugins.test.ts
(2 hunks)
🧰 Additional context used
🧬 Code Graph Analysis (3)
packages/plugins/openapi/src/generator-base.ts (1)
packages/sdk/src/utils.ts (2)
getDataModels
(46-53)hasAttribute
(134-139)
packages/plugins/openapi/tests/openapi-rpc.test.ts (2)
packages/testtools/src/schema.ts (2)
loadZModelAndDmmf
(396-428)normalizePath
(72-74)packages/plugins/openapi/src/rpc-generator.ts (1)
generate
(46-106)
packages/plugins/openapi/src/rpc-generator.ts (1)
packages/language/src/ast.ts (1)
DataModel
(56-66)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: build-test (20.x)
- GitHub Check: dependency-review
- GitHub Check: build-test (20.x)
- GitHub Check: OSSAR-Scan
- GitHub Check: build-test (20.x)
🔇 Additional comments (11)
packages/ide/jetbrains/build.gradle.kts (1)
12-12
: Version bump looks goodBumped to 2.18.1 without functional changes. Matches the PR scope.
If you rely on JetBrains Changelog plugin to render Unreleased as notes, you’re set. Otherwise, confirm the CHANGELOG has a 2.18.1 section before publishing.
tests/integration/tests/cli/plugins.test.ts (1)
78-79
: Prisma 6.14.x bump: confirm CI Node version & engines constraintsI don’t see any Node version setup in
.github/workflows
nor anyengines
fields in yourpackage.json
. Please ensure:
- Your CI pipeline is running a Node version supported by Prisma 6.14.x.
- Any
engines
entry inpackage.json
(if added) does not conflict with that Node version.This applies to the bump at tests/integration/tests/cli/plugins.test.ts (lines 78–79 and 85–89).
packages/ide/jetbrains/CHANGELOG.md (1)
9-12
: Historical section addition is fineAdding the 2.17.0 entry improves history clarity.
packages/plugins/tanstack-query/src/runtime-v5/angular.ts (2)
30-32
: Nice addition: simple, explicit dynamic-args detectionAdding AnyFn and isFn cleanly enables function-based args resolution without polluting call sites.
79-86
: Arg resolution timing looks correctResolving args inside the injectQuery/injectInfiniteQuery factory ensures the key and URL are computed at injection time. Good alignment with function-based args design.
packages/plugins/openapi/src/rpc-generator.ts (4)
652-661
: Good coverage for AST-only enumsIncluding enums from the AST (when absent in DMMF) prevents missing component refs for TypeDefs that use them.
668-672
: Emitting TypeDefs as first-class components is the right callGenerating TypeDef schemas (and doing so before inputs) enables stable cross-referencing from models and other TypeDefs.
753-756
: Passing modelName into generateField enables TypeDef-aware JSON mappingThis provides the necessary context to correctly map Json fields that are actually @JSON TypeDefs on the corresponding ZModel field.
768-783
: Correctly mapping Json fields referencing TypeDefsThe lookup against the ZModel to detect @JSON TypeDef references, and returning a $ref wrapped with optional/array semantics, is the correct behavior.
packages/plugins/openapi/tests/openapi-rpc.test.ts (2)
380-383
: Solid extension of type coverageAdding a simple TypeDef (Meta) and testing @JSON mapping plus plain Json helps validate both specialized and generic JSON paths.
420-519
: Excellent end-to-end validation of complex TypeDef graphsThe assertions cover nested refs, enum inclusion, array relationships, and spec-version-specific nullable JSON representation. This gives strong confidence in the new generator behavior.
No description provided.