-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Switch to typed GraphQL documents instead of older Apollo generator #594
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
feat: Switch to typed GraphQL documents instead of older Apollo generator #594
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: aa2a8ed The changes in this PR will be included in the next version bump. This PR includes changesets to release 17 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Important Review skippedReview was skipped due to path filters ⛔ Files ignored due to path filters (12)
CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including You can disable this status message by setting the WalkthroughThis change updates several packages and code generation workflows to switch from using Apollo-generated React hooks to a typed GraphQL documents approach. It replaces YAML-based GraphQL codegen configuration with TypeScript, updates dependencies, and modifies React code to use generic Apollo Client hooks ( Changes
Sequence Diagram(s)sequenceDiagram
participant ReactComponent
participant ApolloClient
participant GraphQLServer
ReactComponent->>ApolloClient: useQuery(DocumentNode, variables)
ApolloClient->>GraphQLServer: Send GraphQL query
GraphQLServer-->>ApolloClient: Respond with data
ApolloClient-->>ReactComponent: Provide data/error via hook
ReactComponent->>ApolloClient: useMutation(DocumentNode, variables)
ApolloClient->>GraphQLServer: Send GraphQL mutation
GraphQLServer-->>ApolloClient: Respond with mutation result
ApolloClient-->>ReactComponent: Provide result/error via hook
sequenceDiagram
participant Dev
participant Codegen
participant TypeScriptConfig
Dev->>Codegen: Run codegen with codegen.ts config
Codegen->>TypeScriptConfig: Read schema, documents, plugins from codegen.ts
Codegen->>Dev: Output generated TypeScript types and documents
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed 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)
Other keywords and placeholders
Documentation and Community
|
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: 0
🔭 Outside diff range comments (1)
plugins/plugin-storage/src/generators/react/upload-components/templates/src/components/file-input/file-input.tsx (1)
132-263: Add CSS class prefixing for plugin components.According to the coding guidelines, plugin components must prefix all CSS classes with the plugin name (
storage-) to avoid style conflicts. The current implementation uses unprefixed classes likemax-w-md,flex,h-12, etc.Consider implementing a utility function to automatically prefix classes:
+const storageClass = (className: string) => className.split(' ').map(c => `storage-${c}`).join(' '); // Then use it throughout the component: - <div className={cn('max-w-md', className)}> + <div className={cn(storageClass('max-w-md'), className)}>Or use the
cn()utility with prefixed classes:- className={cn('max-w-md', className)} + className={cn('storage-max-w-md', className)}
🧹 Nitpick comments (1)
packages/react-generators/src/generators/apollo/react-apollo/extractor.json (1)
15-17: Drop redundantimportMapProvidersto keep the template definition minimal
importMapProvidersis left as an empty object. The template extractor already auto-infers providers when none are required, so the empty entry only adds noise.- "importMapProviders": {},
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (4)
packages/react-generators/src/generators/apollo/react-apollo/generated/template-paths.tsis excluded by!**/generated/**,!**/generated/**packages/react-generators/src/generators/apollo/react-apollo/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/react-generators/src/generators/apollo/react-apollo/generated/ts-import-providers.tsis excluded by!**/generated/**,!**/generated/**packages/react-generators/src/generators/apollo/react-apollo/generated/typed-templates.tsis excluded by!**/generated/**,!**/generated/**
📒 Files selected for processing (17)
.changeset/bright-parrots-watch.md(1 hunks)packages/react-generators/src/constants/react-packages.ts(1 hunks)packages/react-generators/src/generators/admin/_utils/foreign-data-dependency.ts(1 hunks)packages/react-generators/src/generators/admin/admin-bull-board/templates/routes/bull-board/index.tsx(2 hunks)packages/react-generators/src/generators/admin/admin-crud-edit/admin-crud-edit.generator.ts(4 hunks)packages/react-generators/src/generators/admin/admin-crud-edit/templates/create.tsx(2 hunks)packages/react-generators/src/generators/admin/admin-crud-edit/templates/edit.tsx(2 hunks)packages/react-generators/src/generators/admin/admin-crud-list/admin-crud-list.generator.ts(2 hunks)packages/react-generators/src/generators/admin/admin-crud-list/templates/index.tsx(2 hunks)packages/react-generators/src/generators/admin/admin-crud-queries/admin-crud-queries.generator.ts(3 hunks)packages/react-generators/src/generators/apollo/react-apollo/extractor.json(1 hunks)packages/react-generators/src/generators/apollo/react-apollo/react-apollo.generator.ts(5 hunks)packages/react-generators/src/generators/apollo/react-apollo/templates/package/codegen.ts(1 hunks)packages/react-generators/src/generators/apollo/react-apollo/templates/package/codegen.yml(0 hunks)packages/react-generators/src/generators/core/react-typescript/react-typescript.generator.ts(4 hunks)plugins/plugin-auth/src/auth0/generators/react/auth0-hooks/templates/src/hooks/use-current-user.ts(2 hunks)plugins/plugin-storage/src/generators/react/upload-components/templates/src/components/file-input/file-input.tsx(2 hunks)
💤 Files with no reviewable changes (1)
- packages/react-generators/src/generators/apollo/react-apollo/templates/package/codegen.yml
🧰 Additional context used
📓 Path-based instructions (8)
`**/*.{ts,tsx}`: TypeScript with strict type checking Node 16 module resolution ...
**/*.{ts,tsx}: TypeScript with strict type checking
Node 16 module resolution - include file extensions in imports (.js)
Sort imports by group: external libs first, then local imports
Use camelCase for variables/functions, PascalCase for types/classes
Always include return types on top-level functions including React components (React.ReactElement)
Include absolute paths in import statements via tsconfig paths (@src/is the alias forsrc/)
Order functions such that functions are placed below the variables/functions they use
If a particular interface or type is not exported, change the file so it is exported
Prefer using nullish coalescing operator (??) instead of logical or (||)
Use console.info/warn/error instead of console.log
Always use.jsextensions in imports, even for TypeScript files
Specify explicit return types on all functions
📄 Source: CodeRabbit Inference Engine (CLAUDE.md)
List of files the instruction was applied to:
packages/react-generators/src/generators/admin/admin-crud-edit/templates/edit.tsxpackages/react-generators/src/generators/admin/admin-crud-edit/templates/create.tsxpackages/react-generators/src/generators/admin/admin-crud-list/templates/index.tsxplugins/plugin-auth/src/auth0/generators/react/auth0-hooks/templates/src/hooks/use-current-user.tspackages/react-generators/src/generators/admin/admin-bull-board/templates/routes/bull-board/index.tsxplugins/plugin-storage/src/generators/react/upload-components/templates/src/components/file-input/file-input.tsxpackages/react-generators/src/generators/admin/_utils/foreign-data-dependency.tspackages/react-generators/src/generators/apollo/react-apollo/templates/package/codegen.tspackages/react-generators/src/generators/admin/admin-crud-list/admin-crud-list.generator.tspackages/react-generators/src/generators/admin/admin-crud-edit/admin-crud-edit.generator.tspackages/react-generators/src/generators/admin/admin-crud-queries/admin-crud-queries.generator.tspackages/react-generators/src/generators/apollo/react-apollo/react-apollo.generator.tspackages/react-generators/src/generators/core/react-typescript/react-typescript.generator.tspackages/react-generators/src/constants/react-packages.ts
`**/*`: Use kebab-case for file names
**/*: Use kebab-case for file names
📄 Source: CodeRabbit Inference Engine (CLAUDE.md)
List of files the instruction was applied to:
packages/react-generators/src/generators/admin/admin-crud-edit/templates/edit.tsxpackages/react-generators/src/generators/admin/admin-crud-edit/templates/create.tsxpackages/react-generators/src/generators/admin/admin-crud-list/templates/index.tsxplugins/plugin-auth/src/auth0/generators/react/auth0-hooks/templates/src/hooks/use-current-user.tspackages/react-generators/src/generators/admin/admin-bull-board/templates/routes/bull-board/index.tsxplugins/plugin-storage/src/generators/react/upload-components/templates/src/components/file-input/file-input.tsxpackages/react-generators/src/generators/admin/_utils/foreign-data-dependency.tspackages/react-generators/src/generators/apollo/react-apollo/templates/package/codegen.tspackages/react-generators/src/generators/admin/admin-crud-list/admin-crud-list.generator.tspackages/react-generators/src/generators/admin/admin-crud-edit/admin-crud-edit.generator.tspackages/react-generators/src/generators/admin/admin-crud-queries/admin-crud-queries.generator.tspackages/react-generators/src/generators/apollo/react-apollo/react-apollo.generator.tspackages/react-generators/src/generators/core/react-typescript/react-typescript.generator.tspackages/react-generators/src/generators/apollo/react-apollo/extractor.jsonpackages/react-generators/src/constants/react-packages.ts
`**/*.tsx`: Use ShadCN-based components from `@baseplate-dev/ui-components` inst...
**/*.tsx: Use ShadCN-based components from@baseplate-dev/ui-componentsinstead of creating custom ones
Use Tailwind CSS utilities exclusively for styling; avoid writing custom CSS classes
Use icons fromreact-icons/md(Material Design icons); avoid using other icon libraries
📄 Source: CodeRabbit Inference Engine (CLAUDE.md)
List of files the instruction was applied to:
packages/react-generators/src/generators/admin/admin-crud-edit/templates/edit.tsxpackages/react-generators/src/generators/admin/admin-crud-edit/templates/create.tsxpackages/react-generators/src/generators/admin/admin-crud-list/templates/index.tsxpackages/react-generators/src/generators/admin/admin-bull-board/templates/routes/bull-board/index.tsxplugins/plugin-storage/src/generators/react/upload-components/templates/src/components/file-input/file-input.tsx
`{packages,plugins}/**/*.{ts,tsx}`: Use TypeScript with strict type checking ena...
{packages,plugins}/**/*.{ts,tsx}: Use TypeScript with strict type checking enabled
All functions (excluding one-liner arrow functions) require explicit return types
Use camelCase for variables and functions
Use PascalCase for types and classes
Prefer functional programming patterns
Extract repeated components into distinct functions or components where applicable
📄 Source: CodeRabbit Inference Engine (.cursor/rules/code-style.mdc)
List of files the instruction was applied to:
packages/react-generators/src/generators/admin/admin-crud-edit/templates/edit.tsxpackages/react-generators/src/generators/admin/admin-crud-edit/templates/create.tsxpackages/react-generators/src/generators/admin/admin-crud-list/templates/index.tsxplugins/plugin-auth/src/auth0/generators/react/auth0-hooks/templates/src/hooks/use-current-user.tspackages/react-generators/src/generators/admin/admin-bull-board/templates/routes/bull-board/index.tsxplugins/plugin-storage/src/generators/react/upload-components/templates/src/components/file-input/file-input.tsxpackages/react-generators/src/generators/admin/_utils/foreign-data-dependency.tspackages/react-generators/src/generators/apollo/react-apollo/templates/package/codegen.tspackages/react-generators/src/generators/admin/admin-crud-list/admin-crud-list.generator.tspackages/react-generators/src/generators/admin/admin-crud-edit/admin-crud-edit.generator.tspackages/react-generators/src/generators/admin/admin-crud-queries/admin-crud-queries.generator.tspackages/react-generators/src/generators/apollo/react-apollo/react-apollo.generator.tspackages/react-generators/src/generators/core/react-typescript/react-typescript.generator.tspackages/react-generators/src/constants/react-packages.ts
`**/index.{ts,tsx}`: Prefer barrel exports e.g. `export * from './foo.js'` instead of individual named exports
**/index.{ts,tsx}: Prefer barrel exports e.g.export * from './foo.js'instead of individual named exports
📄 Source: CodeRabbit Inference Engine (CLAUDE.md)
List of files the instruction was applied to:
packages/react-generators/src/generators/admin/admin-crud-list/templates/index.tsxpackages/react-generators/src/generators/admin/admin-bull-board/templates/routes/bull-board/index.tsx
`plugins/*/**/*.tsx`: In plugins, prefix all Tailwind classes with the plugin name (e.g., `auth-`, `storage-`)
plugins/*/**/*.tsx: In plugins, prefix all Tailwind classes with the plugin name (e.g.,auth-,storage-)
📄 Source: CodeRabbit Inference Engine (CLAUDE.md)
List of files the instruction was applied to:
plugins/plugin-storage/src/generators/react/upload-components/templates/src/components/file-input/file-input.tsx
`plugins/plugin-*/**/*.tsx`: All CSS classes used in `className` attributes with...
plugins/plugin-*/**/*.tsx: All CSS classes used inclassNameattributes within plugin components MUST be prefixed with the plugin name to avoid style conflicts.
When using utility functions likecn(), all CSS classes passed tocn()in plugin components MUST be prefixed with the plugin name.
📄 Source: CodeRabbit Inference Engine (plugins/CLAUDE.md)
List of files the instruction was applied to:
plugins/plugin-storage/src/generators/react/upload-components/templates/src/components/file-input/file-input.tsx
`.changeset/*.md`: If you are adding a new feature or changing an existing feature, add a new Changeset in the `.changeset/` directory
.changeset/*.md: If you are adding a new feature or changing an existing feature, add a new Changeset in the.changeset/directory
📄 Source: CodeRabbit Inference Engine (CLAUDE.md)
List of files the instruction was applied to:
.changeset/bright-parrots-watch.md
🧠 Learnings (16)
📓 Common learnings
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Prefer functional programming patterns
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Use camelCase for variables and functions
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Use TypeScript with strict type checking enabled
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Use PascalCase for types and classes
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.tsx : Use ShadCN-based components from `@baseplate-dev/ui-components` instead of creating custom ones
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.{ts,tsx} : Always include return types on top-level functions including React components (`React.ReactElement`)
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Extract repeated components into distinct functions or components where applicable
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.{ts,tsx} : TypeScript with strict type checking
packages/react-generators/src/generators/admin/admin-crud-edit/templates/edit.tsx (4)
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Prefer functional programming patterns
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.tsx : Use ShadCN-based components from `@baseplate-dev/ui-components` instead of creating custom ones
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Use camelCase for variables and functions
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.{ts,tsx} : Always include return types on top-level functions including React components (`React.ReactElement`)
packages/react-generators/src/generators/admin/admin-crud-edit/templates/create.tsx (4)
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.tsx : Use ShadCN-based components from `@baseplate-dev/ui-components` instead of creating custom ones
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Prefer functional programming patterns
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.{ts,tsx} : Always include return types on top-level functions including React components (`React.ReactElement`)
Learnt from: kingston
PR: halfdomelabs/baseplate#544
File: packages/ui-components/src/components/Command/Command.tsx:16-31
Timestamp: 2025-05-12T08:29:52.819Z
Learning: In React 19, function components automatically receive refs as regular props, eliminating the need for React.forwardRef. This allows components to directly destructure and use the ref prop, simplifying component definitions while maintaining the same ref forwarding functionality.
packages/react-generators/src/generators/admin/admin-crud-list/templates/index.tsx (3)
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Prefer functional programming patterns
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.{ts,tsx} : If a particular interface or type is not exported, change the file so it is exported
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.tsx : Use ShadCN-based components from `@baseplate-dev/ui-components` instead of creating custom ones
packages/react-generators/src/generators/admin/admin-bull-board/templates/routes/bull-board/index.tsx (1)
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.tsx : Use ShadCN-based components from `@baseplate-dev/ui-components` instead of creating custom ones
plugins/plugin-storage/src/generators/react/upload-components/templates/src/components/file-input/file-input.tsx (2)
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.tsx : Use ShadCN-based components from `@baseplate-dev/ui-components` instead of creating custom ones
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Prefer functional programming patterns
packages/react-generators/src/generators/admin/_utils/foreign-data-dependency.ts (5)
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Prefer functional programming patterns
Learnt from: kingston
PR: halfdomelabs/baseplate#521
File: packages/react-generators/src/generators/admin/admin-crud-edit/admin-crud-edit.generator.ts:90-94
Timestamp: 2025-05-05T06:36:50.687Z
Learning: In this codebase, import paths can include `.ts` extensions, and the `resolveModuleSpecifier` function will handle them appropriately. There's no need to strip file extensions before passing paths to functions like `TsCodeUtils.importFragment`.
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.{ts,tsx} : Node 16 module resolution - include file extensions in imports (`.js`)
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.{ts,tsx} : Include absolute paths in import statements via tsconfig paths (`@src/` is the alias for `src/`)
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Use camelCase for variables and functions
.changeset/bright-parrots-watch.md (7)
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/ui-rules.mdc:0-0
Timestamp: 2025-06-30T11:52:33.318Z
Learning: Applies to *.{tsx},packages/project-builder-web/**,packages/ui-components/** : We use a rough analog of ShadCN components that can be imported from @baseplate-dev/ui-components
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.tsx : Use ShadCN-based components from `@baseplate-dev/ui-components` instead of creating custom ones
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Prefer functional programming patterns
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Use PascalCase for types and classes
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Use TypeScript with strict type checking enabled
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Use camelCase for variables and functions
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.{ts,tsx} : TypeScript with strict type checking
packages/react-generators/src/generators/apollo/react-apollo/templates/package/codegen.ts (12)
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.{ts,tsx} : If a particular interface or type is not exported, change the file so it is exported
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Use TypeScript with strict type checking enabled
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.{ts,tsx} : Always include return types on top-level functions including React components (`React.ReactElement`)
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.{ts,tsx} : TypeScript with strict type checking
Learnt from: kingston
PR: halfdomelabs/baseplate#592
File: plugins/plugin-auth/src/auth0/generators/react/auth0-hooks/templates/src/hooks/use-required-user-id.ts:1-2
Timestamp: 2025-07-07T18:24:17.476Z
Learning: Files under templates/** directories can use `// @ts-nocheck` because they are templates meant for code generation, not direct type checking.
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Use PascalCase for types and classes
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.{ts,tsx} : Include absolute paths in import statements via tsconfig paths (`@src/` is the alias for `src/`)
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Use camelCase for variables and functions
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.{ts,tsx} : Specify explicit return types on all functions
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Extract repeated components into distinct functions or components where applicable
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.test.ts : Leverage TypeScript for type-safe mocking in tests
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Prefer functional programming patterns
packages/react-generators/src/generators/admin/admin-crud-list/admin-crud-list.generator.ts (2)
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Prefer functional programming patterns
Learnt from: kingston
PR: halfdomelabs/baseplate#521
File: packages/react-generators/src/generators/admin/admin-crud-edit/admin-crud-edit.generator.ts:90-94
Timestamp: 2025-05-05T06:36:50.687Z
Learning: In this codebase, import paths can include `.ts` extensions, and the `resolveModuleSpecifier` function will handle them appropriately. There's no need to strip file extensions before passing paths to functions like `TsCodeUtils.importFragment`.
packages/react-generators/src/generators/admin/admin-crud-edit/admin-crud-edit.generator.ts (2)
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Use camelCase for variables and functions
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Prefer functional programming patterns
packages/react-generators/src/generators/admin/admin-crud-queries/admin-crud-queries.generator.ts (4)
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Use camelCase for variables and functions
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.{ts,tsx} : If a particular interface or type is not exported, change the file so it is exported
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Use PascalCase for types and classes
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Prefer functional programming patterns
packages/react-generators/src/generators/apollo/react-apollo/react-apollo.generator.ts (21)
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/ui-rules.mdc:0-0
Timestamp: 2025-06-30T11:52:33.318Z
Learning: Applies to *.{tsx},packages/project-builder-web/**,packages/ui-components/** : We use a rough analog of ShadCN components that can be imported from @baseplate-dev/ui-components
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.tsx : Use ShadCN-based components from `@baseplate-dev/ui-components` instead of creating custom ones
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.{ts,tsx} : Always include return types on top-level functions including React components (`React.ReactElement`)
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Extract repeated components into distinct functions or components where applicable
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.{ts,tsx} : Node 16 module resolution - include file extensions in imports (`.js`)
Learnt from: kingston
PR: halfdomelabs/baseplate#521
File: packages/react-generators/src/generators/admin/admin-crud-list/admin-crud-list.generator.ts:163-166
Timestamp: 2025-05-05T06:37:51.001Z
Learning: For certain templates in the codebase, the `importMapProviders` property is not explicitly required as the template extractor will automatically determine and infer the necessary import map providers.
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.{ts,tsx} : Include absolute paths in import statements via tsconfig paths (`@src/` is the alias for `src/`)
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.{ts,tsx} : If a particular interface or type is not exported, change the file so it is exported
Learnt from: kingston
PR: halfdomelabs/baseplate#521
File: plugins/baseplate-plugin-storage/src/generators/react/upload-components/upload-components.generator.ts:108-112
Timestamp: 2025-05-05T06:37:43.106Z
Learning: The template extractor in the baseplate codebase can automatically infer and determine the necessary import map providers for certain templates, making explicit specification of importMapProviders unnecessary in those cases.
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Prefer functional programming patterns
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Use camelCase for variables and functions
Learnt from: kingston
PR: halfdomelabs/baseplate#521
File: packages/react-generators/src/generators/admin/admin-crud-edit/admin-crud-edit.generator.ts:90-94
Timestamp: 2025-05-05T06:36:50.687Z
Learning: In this codebase, import paths can include `.ts` extensions, and the `resolveModuleSpecifier` function will handle them appropriately. There's no need to strip file extensions before passing paths to functions like `TsCodeUtils.importFragment`.
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Use PascalCase for types and classes
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Use TypeScript with strict type checking enabled
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.{ts,tsx} : TypeScript with strict type checking
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : All functions (excluding one-liner arrow functions) require explicit return types
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{unit,int}.test.ts : Always import vitest globals explicitly (describe, it, expect)
Learnt from: kingston
PR: halfdomelabs/baseplate#562
File: plugins/plugin-auth/package.json:32-36
Timestamp: 2025-06-03T09:11:29.651Z
Learning: With TypeScript project references, TypeScript compilation is watched from the root level using "watch:tsc:root" script, so individual packages no longer need to include their "tsc:watch" scripts in their local "watch" commands. The local "tsc:watch" scripts are renamed from "watch:tsc" but are not meant to be run as part of the package's watch command since TypeScript watching is handled centrally at the workspace root.
Learnt from: kingston
PR: halfdomelabs/baseplate#592
File: plugins/plugin-auth/src/auth0/generators/react/auth0-hooks/templates/src/hooks/use-required-user-id.ts:1-2
Timestamp: 2025-07-07T18:24:17.476Z
Learning: Files under templates/** directories can use `// @ts-nocheck` because they are templates meant for code generation, not direct type checking.
Learnt from: kingston
PR: halfdomelabs/baseplate#571
File: packages/core-generators/src/renderers/extractor/plugins/typed-templates-file.ts:102-106
Timestamp: 2025-06-11T18:31:22.247Z
Learning: For `templateExtractorBarrelExportPlugin.addGeneratedBarrelExport`, the generated barrel exports are written into `generated/index.ts`, therefore the `moduleSpecifier` must be specified relative to that file (e.g., `./typed-templates.js`), not the project root.
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.{ts,tsx} : Use camelCase for variables/functions, PascalCase for types/classes
packages/react-generators/src/generators/core/react-typescript/react-typescript.generator.ts (23)
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.{ts,tsx} : Always include return types on top-level functions including React components (`React.ReactElement`)
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.{ts,tsx} : If a particular interface or type is not exported, change the file so it is exported
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.{ts,tsx} : Node 16 module resolution - include file extensions in imports (`.js`)
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.{ts,tsx} : Include absolute paths in import statements via tsconfig paths (`@src/` is the alias for `src/`)
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.{ts,tsx} : TypeScript with strict type checking
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Use TypeScript with strict type checking enabled
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Extract repeated components into distinct functions or components where applicable
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.{ts,tsx} : Specify explicit return types on all functions
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/ui-rules.mdc:0-0
Timestamp: 2025-06-30T11:52:33.318Z
Learning: Applies to *.{tsx},packages/project-builder-web/**,packages/ui-components/** : We use a rough analog of ShadCN components that can be imported from @baseplate-dev/ui-components
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Prefer functional programming patterns
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.tsx : Use ShadCN-based components from `@baseplate-dev/ui-components` instead of creating custom ones
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Use PascalCase for types and classes
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : All functions (excluding one-liner arrow functions) require explicit return types
Learnt from: kingston
PR: halfdomelabs/baseplate#592
File: plugins/plugin-auth/src/auth0/generators/react/auth0-hooks/templates/src/hooks/use-required-user-id.ts:1-2
Timestamp: 2025-07-07T18:24:17.476Z
Learning: Files under templates/** directories can use `// @ts-nocheck` because they are templates meant for code generation, not direct type checking.
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{unit,int}.test.ts : Always import vitest globals explicitly (describe, it, expect)
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.test.ts : Import test functions from 'vitest' (no globals)
Learnt from: kingston
PR: halfdomelabs/baseplate#562
File: plugins/plugin-auth/package.json:32-36
Timestamp: 2025-06-03T09:11:29.651Z
Learning: With TypeScript project references, TypeScript compilation is watched from the root level using "watch:tsc:root" script, so individual packages no longer need to include their "tsc:watch" scripts in their local "watch" commands. The local "tsc:watch" scripts are renamed from "watch:tsc" but are not meant to be run as part of the package's watch command since TypeScript watching is handled centrally at the workspace root.
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-06-30T11:52:28.745Z
Learning: Applies to src/tests/**/*.{ts,tsx} : Test helpers are located in `src/tests/` directory
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to src/tests/**/*.{ts,tsx} : Test helpers are located in `src/tests/` directory
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.test.ts : Extract common setup code into test helpers
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.{ts,tsx} : Sort imports by group: external libs first, then local imports
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.test.ts : Always import vitest globals explicitly (describe, it, expect)
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.{ts,tsx} : Always use `.js` extensions in imports, even for TypeScript files
packages/react-generators/src/generators/apollo/react-apollo/extractor.json (12)
Learnt from: kingston
PR: halfdomelabs/baseplate#521
File: packages/react-generators/src/generators/admin/admin-crud-list/admin-crud-list.generator.ts:163-166
Timestamp: 2025-05-05T06:37:51.001Z
Learning: For certain templates in the codebase, the `importMapProviders` property is not explicitly required as the template extractor will automatically determine and infer the necessary import map providers.
Learnt from: kingston
PR: halfdomelabs/baseplate#521
File: plugins/baseplate-plugin-storage/src/generators/react/upload-components/upload-components.generator.ts:108-112
Timestamp: 2025-05-05T06:37:43.106Z
Learning: The template extractor in the baseplate codebase can automatically infer and determine the necessary import map providers for certain templates, making explicit specification of importMapProviders unnecessary in those cases.
Learnt from: kingston
PR: halfdomelabs/baseplate#571
File: packages/core-generators/src/renderers/extractor/plugins/typed-templates-file.ts:102-106
Timestamp: 2025-06-11T18:31:22.247Z
Learning: For `templateExtractorBarrelExportPlugin.addGeneratedBarrelExport`, the generated barrel exports are written into `generated/index.ts`, therefore the `moduleSpecifier` must be specified relative to that file (e.g., `./typed-templates.js`), not the project root.
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Extract repeated components into distinct functions or components where applicable
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/ui-rules.mdc:0-0
Timestamp: 2025-06-30T11:52:33.318Z
Learning: Applies to *.{tsx},packages/project-builder-web/**,packages/ui-components/** : We use a rough analog of ShadCN components that can be imported from @baseplate-dev/ui-components
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.{ts,tsx} : If a particular interface or type is not exported, change the file so it is exported
Learnt from: kingston
PR: halfdomelabs/baseplate#592
File: plugins/plugin-auth/src/auth0/generators/react/auth0-hooks/templates/src/hooks/use-required-user-id.ts:1-2
Timestamp: 2025-07-07T18:24:17.476Z
Learning: Files under templates/** directories can use `// @ts-nocheck` because they are templates meant for code generation, not direct type checking.
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Use camelCase for variables and functions
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Use PascalCase for types and classes
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Use TypeScript with strict type checking enabled
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Prefer functional programming patterns
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/*.tsx : Use ShadCN-based components from `@baseplate-dev/ui-components` instead of creating custom ones
packages/react-generators/src/constants/react-packages.ts (8)
Learnt from: kingston
PR: halfdomelabs/baseplate#539
File: scripts/check-changesets.ts:70-79
Timestamp: 2025-05-08T12:56:11.723Z
Learning: In the check-changesets.ts script for monorepo validation, `npm pack ${pkg.name}@latest` is intentionally used to pack the most recently published version (not local changes) for comparison purposes to determine if changes require new changesets.
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Use camelCase for variables and functions
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Extract repeated components into distinct functions or components where applicable
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Use PascalCase for types and classes
Learnt from: kingston
PR: halfdomelabs/baseplate#562
File: plugins/plugin-auth/package.json:32-36
Timestamp: 2025-06-03T09:11:29.651Z
Learning: With TypeScript project references, TypeScript compilation is watched from the root level using "watch:tsc:root" script, so individual packages no longer need to include their "tsc:watch" scripts in their local "watch" commands. The local "tsc:watch" scripts are renamed from "watch:tsc" but are not meant to be run as part of the package's watch command since TypeScript watching is handled centrally at the workspace root.
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/ui-rules.mdc:0-0
Timestamp: 2025-06-30T11:52:33.318Z
Learning: Applies to *.{tsx},packages/project-builder-web/**,packages/ui-components/** : We use a rough analog of ShadCN components that can be imported from @baseplate-dev/ui-components
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Prefer functional programming patterns
Learnt from: CR
PR: halfdomelabs/baseplate#0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-06-30T11:52:11.055Z
Learning: Applies to {packages,plugins}/**/*.{ts,tsx} : Use TypeScript with strict type checking enabled
🧬 Code Graph Analysis (3)
packages/react-generators/src/generators/admin/_utils/foreign-data-dependency.ts (1)
packages/core-generators/src/renderers/typescript/imports/builder.ts (1)
tsImportBuilder(74-82)
packages/react-generators/src/generators/admin/admin-crud-edit/admin-crud-edit.generator.ts (1)
packages/core-generators/src/renderers/typescript/imports/builder.ts (1)
tsImportBuilder(74-82)
packages/react-generators/src/generators/core/react-typescript/react-typescript.generator.ts (2)
packages/sync/src/providers/providers.ts (1)
createProviderType(151-210)packages/core-generators/src/providers/scopes.ts (1)
packageScope(3-6)
⏰ 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). (3)
- GitHub Check: test
- GitHub Check: Lint
- GitHub Check: Test E2E
🔇 Additional comments (38)
packages/react-generators/src/generators/admin/admin-crud-edit/templates/edit.tsx (2)
6-6: LGTM: Correct Apollo Client import addedThe import of
useMutationfrom@apollo/clientis properly added to support the typed GraphQL documents approach.
19-19: LGTM: Proper mutation hook usageThe change from
TPL_UPDATE_MUTATION()touseMutation(TPL_UPDATE_MUTATION)correctly follows Apollo Client's hook pattern with typed document nodes.packages/react-generators/src/generators/admin/admin-crud-edit/templates/create.tsx (2)
6-6: LGTM: Correct Apollo Client import addedThe import of
useMutationfrom@apollo/clientis properly added to support the typed GraphQL documents approach.
17-23: LGTM: Excellent mutation hook usage with cache managementThe change to
useMutation(TPL_CREATE_MUTATION, { refetchQueries: ... })is well-implemented, properly including cache invalidation through refetchQueries to ensure the list updates after creation..changeset/bright-parrots-watch.md (1)
1-8: LGTM: Properly documented changesetThe changeset correctly documents the migration to typed GraphQL documents across the affected packages with appropriate patch-level versioning.
packages/react-generators/src/generators/admin/admin-bull-board/templates/routes/bull-board/index.tsx (3)
5-5: LGTM: Correct GraphQL document importThe import of
CreateBullBoardAuthCodeDocumentis properly added to support the typed GraphQL documents approach.
9-9: LGTM: Correct Apollo Client import addedThe import of
useMutationfrom@apollo/clientis properly added to support the migration to generic hooks.
18-20: LGTM: Proper mutation hook usageThe change to
useMutation(CreateBullBoardAuthCodeDocument)correctly follows Apollo Client's hook pattern with typed document nodes.packages/react-generators/src/generators/admin/admin-crud-list/templates/index.tsx (2)
6-6: LGTM: Correct Apollo Client import addedThe import of
useMutationfrom@apollo/clientis properly added to support the typed GraphQL documents approach.
15-21: LGTM: Excellent mutation hook usage with cache managementThe change to
useMutation(TPL_DELETE_MUTATION, { refetchQueries: ... })is well-implemented, properly including cache invalidation through refetchQueries to ensure the list updates after deletion.plugins/plugin-auth/src/auth0/generators/react/auth0-hooks/templates/src/hooks/use-current-user.ts (2)
5-6: LGTM! Clean migration to typed GraphQL documents.The import changes correctly switch from the generated Apollo hook to the explicit document and generic
useQueryhook, aligning with the PR's migration strategy.
18-21: LGTM! Consistent usage pattern with typed documents.The query invocation correctly uses the generic
useQueryhook with the explicit document reference. The destructuring and variable handling remain unchanged, maintaining compatibility.plugins/plugin-storage/src/generators/react/upload-components/templates/src/components/file-input/file-input.tsx (3)
5-5: LGTM! Correct import of GraphQL document.The import correctly switches to the explicit document reference for the mutation.
13-13: LGTM! Correct import of generic Apollo hook.The import correctly adds the generic
useMutationhook from Apollo Client.
60-60: LGTM! Consistent usage pattern with typed documents.The mutation invocation correctly uses the generic
useMutationhook with the explicit document reference, maintaining the same destructuring pattern.packages/react-generators/src/generators/apollo/react-apollo/templates/package/codegen.ts (1)
1-24: LGTM! Well-structured TypeScript codegen configuration.The configuration correctly implements the new typed document node approach:
- Proper schema and document source configuration
- Correct plugin setup with
typed-document-nodeinstead oftypescript-react-apollo- Appropriate scalar mappings for custom types
- Valid TypeScript imports configuration
The
@ts-nocheckdirective is acceptable for template files as per established patterns.packages/react-generators/src/generators/admin/_utils/foreign-data-dependency.ts (1)
82-88: LGTM! Correct migration to typed GraphQL documents in code generation.The generated code correctly switches from using generated hooks to the generic
useQueryhook with explicit document references. The import configuration properly includes both the Apollo Client hook and the generated document, maintaining the same destructuring pattern.packages/react-generators/src/generators/admin/admin-crud-edit/admin-crud-edit.generator.ts (3)
244-244: LGTM! Correct migration to document expression for create mutation.The template variable correctly uses
documentExpressioninstead ofhookExpression, aligning with the typed GraphQL documents approach.
260-277: LGTM! Correct migration to generic Apollo hooks in generated code.The generated code correctly:
- Uses
useQuerywith explicit document reference- Includes proper imports for both React (
useMemo) and Apollo Client (useQuery)- Maintains the same destructuring and logic patterns
- Uses
documentExpressionfor the query referenceThis aligns perfectly with the migration strategy.
300-300: LGTM! Correct migration to document expression for update mutation.The template variable correctly uses
documentExpressioninstead ofhookExpressionfor the update mutation, maintaining consistency with the migration strategy.packages/react-generators/src/generators/admin/admin-crud-list/admin-crud-list.generator.ts (3)
100-103: LGTM! Correct Apollo Client import for the migration.The import of
useQueryfrom@apollo/clientaligns with the migration to using generic Apollo Client hooks instead of generated hooks.
106-106: LGTM! Proper use of genericuseQueryhook.The change from using a generated hook to the generic
useQueryhook with explicit document expression is correct and follows Apollo Client best practices.
141-141: LGTM! Consistent template variable naming.The rename from
TPL_DELETE_FUNCTIONtoTPL_DELETE_MUTATIONand usingdocumentExpressionis consistent with the migration to typed document nodes.packages/react-generators/src/constants/react-packages.ts (1)
45-50: Package version verification passedAll updated GraphQL Codegen (
@graphql-codegen/cli5.0.7,@graphql-codegen/typescript4.1.6,@graphql-codegen/typescript-operations4.6.1), Typed Document Node (@graphql-codegen/typed-document-node5.1.2,@graphql-typed-document-node/core3.2.0) and@parcel/watcher2.5.1 packages were confirmed as the latest on npm. These updates correctly support the migration away from generated React Apollo hooks.packages/react-generators/src/generators/admin/admin-crud-queries/admin-crud-queries.generator.ts (3)
44-47: LGTM! Interface updated for document-based approach.The rename from
hookExpressiontodocumentExpressionin theApolloHookInfointerface correctly reflects the migration to typed document nodes.
120-128: LGTM! Function signature and implementation updated consistently.The parameter rename from
hookNametodocumentNameand the corresponding update to returndocumentExpressionis consistent with the migration pattern.
184-206: LGTM! All hook info calls updated consistently.All the
getHookInfocalls have been updated to pass document names (e.g.,${listQueryName}Document) instead of hook names, maintaining consistency throughout the migration.packages/react-generators/src/generators/apollo/react-apollo/react-apollo.generator.ts (6)
31-31: LGTM! Added required import for schema location quoting.The
quotimport is properly added to support wrapping the schema location in the TypeScript config template.
35-35: LGTM! Added import for TypeScript provider integration.The
reactTypescriptProviderimport enables dynamic registration of the TypeScript codegen config file.
196-198: LGTM! Dependencies updated for typed document node support.The addition of
@graphql-codegen/typed-document-nodeand@graphql-typed-document-node/corecorrectly supports the migration to typed document nodes.
210-215: LGTM! Provider task correctly registers TypeScript config file.The
reactTypescriptprovider task properly registerscodegen.tsas a Node TypeScript file, enabling it to be included in the TypeScript configuration.
529-538: LGTM! Migration to TypeScript-based codegen configuration.The switch from YAML to TypeScript config generation is correctly implemented, using the new template and properly quoting the schema location.
589-589: LGTM! Post-write command updated for TypeScript config.The file watching is correctly updated to monitor
codegen.tsinstead of the previous YAML configuration file.packages/react-generators/src/generators/core/react-typescript/react-typescript.generator.ts (4)
15-20: LGTM! Well-defined provider interface.The
ReactTypescriptProviderinterface follows the established pattern and correctly defines the method for dynamically adding Node TypeScript files.
31-33: LGTM! Provider properly exported with correct scope.The provider is correctly exported using the
packageScope, following the established pattern for project-wide providers.
35-35: LGTM! Dynamic file registration implementation.The change from a const array to a mutable array and the provider implementation correctly enables dynamic registration of TypeScript files that will be included in the Node TypeScript configuration.
Also applies to: 69-75
113-113: LGTM! Dynamic include array for TypeScript config.Using the sorted
nodeTsFilesarray in the tsconfig include ensures all dynamically registered TypeScript files are properly included in the Node TypeScript configuration.packages/react-generators/src/generators/apollo/react-apollo/extractor.json (1)
18-19: Double-check thatcodegen.tsactually exports a symbol namedconfig
projectExportsmaps"config"for re-export.
If the renderedcodegen.tsuses a different identifier (e.g.const codegenConfigordefault export = config), the barrel export will break.
Please verify the template outputsexport const config(or adjust this mapping accordingly).
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
Summary by CodeRabbit
Refactor
Chores