-
Notifications
You must be signed in to change notification settings - Fork 0
feat: Add Template Renderers plugin for auto-generated simplified template rendering APIs #589
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: Add Template Renderers plugin for auto-generated simplified template rendering APIs #589
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
🦋 Changeset detectedLatest commit: a61ba02 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 |
WalkthroughA new Template Renderers plugin and supporting infrastructure were introduced to the code generation system, automating the creation of type-safe template rendering APIs and reducing manual boilerplate. The plugin integrates with the TypeScript extractor, generates renderers for templates and groups, and updates the Prisma generator to use the new API. Documentation and configuration updates accompany the changes. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant PrismaGenerator
participant Renderers
participant TemplateRenderersPlugin
participant TypeScriptExtractor
User->>PrismaGenerator: Run generator
PrismaGenerator->>Renderers: renderers.service.render(vars)
Renderers->>TemplateRenderersPlugin: (auto-generated render function)
TemplateRenderersPlugin->>TypeScriptExtractor: (integrated via plugin)
TypeScriptExtractor->>Renderers: (render logic executes)
Renderers-->>PrismaGenerator: Rendered file(s)
PrismaGenerator-->>User: Generated service and seed files
sequenceDiagram
participant TypeScriptExtractor
participant TemplateRenderersPlugin
participant RenderTsTemplateRenderers
TypeScriptExtractor->>RenderTsTemplateRenderers: Generate renderer entries for templates
RenderTsTemplateRenderers-->>TypeScriptExtractor: Renderer entries
TypeScriptExtractor->>TemplateRenderersPlugin: addTemplateRenderer(generatorName, entry)
TemplateRenderersPlugin->>TypeScriptExtractor: (afterWrite hook)
TemplateRenderersPlugin->>FileSystem: writeRenderersFile(generatorName, entries, context)
FileSystem-->>TemplateRenderersPlugin: template-renderers.ts written
✨ Finishing Touches
🪧 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
🧹 Nitpick comments (5)
packages/core-generators/src/renderers/extractor/plugins/template-renderers/types.ts (1)
6-23: Fix minor typo in JSDoc comment.The interface structure is well-designed and follows TypeScript best practices.
/** - * The name of the dependency task (will be de-duplicated).. + * The name of the dependency task (will be de-duplicated). */packages/core-generators/src/renderers/extractor/plugins/template-renderers/README.md (3)
116-116: Simplify wording for clarity.-This plugin follows the exact same pattern as the typed templates system: +This plugin follows the same pattern as the typed templates system:
177-177: Add language specification to code block.-``` +```text
221-226: Fix grammar in numbered list.-Follow the established pattern: - -1. Create a renderer function (e.g., `renderTextTemplateRenderers`) -2. Define task dependencies and render functions for your template type -3. Use the existing generic plugin - no changes needed -4. Follow the same integration pattern in your template extractor +Follow the established pattern: + +1. Create a renderer function (e.g., `renderTextTemplateRenderers`) +2. Define task dependencies and render functions for your template type +3. Use the existing generic plugin - no changes needed +4. Use the same integration pattern in your template extractorpackages/core-generators/src/renderers/typescript/extractor/render-ts-template-renderers.ts (1)
31-35: Export the interface to follow project conventions.According to the coding guidelines, all interfaces and types should be exported.
-interface RenderTsTemplateRenderersContext { +export interface RenderTsTemplateRenderersContext { generatorPackageName: string; generatorName: string; }
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (70)
packages/core-generators/src/generators/node/eslint/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/core-generators/src/generators/node/eslint/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/core-generators/src/generators/node/ts-utils/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/core-generators/src/generators/node/ts-utils/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/core-generators/src/generators/node/vitest/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/core-generators/src/generators/node/vitest/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/auth/auth-context/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/auth/auth-context/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/auth/auth-plugin/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/auth/auth-plugin/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/auth/auth-roles/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/auth/auth-roles/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/auth/user-session-types/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/auth/user-session-types/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/bull/bull-mq/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/bull/bull-mq/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/bull/fastify-bull-board/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/bull/fastify-bull-board/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/core/app-module-setup/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/core/app-module-setup/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/core/app-module/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/core/app-module/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/core/axios/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/core/axios/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/core/config-service/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/core/config-service/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/core/error-handler-service/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/core/error-handler-service/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/core/fastify-graceful-shutdown/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/core/fastify-graceful-shutdown/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/core/fastify-health-check/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/core/fastify-health-check/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/core/fastify-redis/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/core/fastify-redis/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/core/fastify-sentry/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/core/fastify-sentry/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/core/fastify-server/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/core/fastify-server/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/core/logger-service/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/core/logger-service/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/core/request-context/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/core/request-context/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/core/request-service-context/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/core/request-service-context/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/core/service-context/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/core/service-context/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/email/fastify-postmark/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/email/fastify-postmark/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/pothos/pothos-auth/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/pothos/pothos-auth/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/pothos/pothos-scalar/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/pothos/pothos-scalar/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/pothos/pothos-sentry/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/pothos/pothos-sentry/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/pothos/pothos/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/pothos/pothos/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/prisma/prisma-utils/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/prisma/prisma-utils/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/prisma/prisma/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/prisma/prisma/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/stripe/fastify-stripe/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/stripe/fastify-stripe/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/vitest/prisma-vitest/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/vitest/prisma-vitest/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/yoga/yoga-plugin/generated/index.tsis excluded by!**/generated/**,!**/generated/**packages/fastify-generators/src/generators/yoga/yoga-plugin/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**plugins/plugin-auth/src/auth0/generators/fastify/auth0-module/generated/index.tsis excluded by!**/generated/**,!**/generated/**plugins/plugin-auth/src/auth0/generators/fastify/auth0-module/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**plugins/plugin-storage/src/generators/fastify/storage-module/generated/index.tsis excluded by!**/generated/**,!**/generated/**plugins/plugin-storage/src/generators/fastify/storage-module/generated/template-renderers.tsis excluded by!**/generated/**,!**/generated/**
📒 Files selected for processing (12)
.changeset/template-renderers-plugin.md(1 hunks).coderabbit.yaml(1 hunks)packages/core-generators/src/renderers/extractor/plugins/index.ts(1 hunks)packages/core-generators/src/renderers/extractor/plugins/template-renderers/README.md(1 hunks)packages/core-generators/src/renderers/extractor/plugins/template-renderers/index.ts(1 hunks)packages/core-generators/src/renderers/extractor/plugins/template-renderers/renderers-file.ts(1 hunks)packages/core-generators/src/renderers/extractor/plugins/template-renderers/template-renderers.plugin.ts(1 hunks)packages/core-generators/src/renderers/extractor/plugins/template-renderers/types.ts(1 hunks)packages/core-generators/src/renderers/extractor/plugins/typed-templates-file.ts(4 hunks)packages/core-generators/src/renderers/typescript/extractor/render-ts-template-renderers.ts(1 hunks)packages/core-generators/src/renderers/typescript/extractor/ts-template-file-extractor.ts(5 hunks)packages/fastify-generators/src/generators/prisma/prisma/prisma.generator.ts(2 hunks)
🧰 Additional context used
📓 Path-based instructions (6)
`**/*.{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/core-generators/src/renderers/extractor/plugins/index.tspackages/core-generators/src/renderers/extractor/plugins/template-renderers/index.tspackages/core-generators/src/renderers/extractor/plugins/template-renderers/types.tspackages/core-generators/src/renderers/extractor/plugins/typed-templates-file.tspackages/fastify-generators/src/generators/prisma/prisma/prisma.generator.tspackages/core-generators/src/renderers/typescript/extractor/ts-template-file-extractor.tspackages/core-generators/src/renderers/extractor/plugins/template-renderers/renderers-file.tspackages/core-generators/src/renderers/extractor/plugins/template-renderers/template-renderers.plugin.tspackages/core-generators/src/renderers/typescript/extractor/render-ts-template-renderers.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/core-generators/src/renderers/extractor/plugins/index.tspackages/core-generators/src/renderers/extractor/plugins/template-renderers/index.tspackages/core-generators/src/renderers/extractor/plugins/template-renderers/types.tspackages/core-generators/src/renderers/extractor/plugins/typed-templates-file.tspackages/fastify-generators/src/generators/prisma/prisma/prisma.generator.tspackages/core-generators/src/renderers/typescript/extractor/ts-template-file-extractor.tspackages/core-generators/src/renderers/extractor/plugins/template-renderers/renderers-file.tspackages/core-generators/src/renderers/extractor/plugins/template-renderers/README.mdpackages/core-generators/src/renderers/extractor/plugins/template-renderers/template-renderers.plugin.tspackages/core-generators/src/renderers/typescript/extractor/render-ts-template-renderers.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/core-generators/src/renderers/extractor/plugins/index.tspackages/core-generators/src/renderers/extractor/plugins/template-renderers/index.ts
`{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/core-generators/src/renderers/extractor/plugins/index.tspackages/core-generators/src/renderers/extractor/plugins/template-renderers/index.tspackages/core-generators/src/renderers/extractor/plugins/template-renderers/types.tspackages/core-generators/src/renderers/extractor/plugins/typed-templates-file.tspackages/fastify-generators/src/generators/prisma/prisma/prisma.generator.tspackages/core-generators/src/renderers/typescript/extractor/ts-template-file-extractor.tspackages/core-generators/src/renderers/extractor/plugins/template-renderers/renderers-file.tspackages/core-generators/src/renderers/extractor/plugins/template-renderers/template-renderers.plugin.tspackages/core-generators/src/renderers/typescript/extractor/render-ts-template-renderers.ts
`.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/template-renderers-plugin.md
`**/*.md`: Please use Mermaid documents instead of ASCII art diagrams
**/*.md: Please use Mermaid documents instead of ASCII art diagrams
📄 Source: CodeRabbit Inference Engine (CLAUDE.md)
List of files the instruction was applied to:
packages/core-generators/src/renderers/extractor/plugins/template-renderers/README.md
🧠 Learnings (12)
📓 Common learnings
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: 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.
packages/core-generators/src/renderers/extractor/plugins/index.ts (10)
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} : 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} : Extract repeated components into distinct functions or components where applicable
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 **/index.{ts,tsx} : Prefer barrel exports e.g. `export * from './foo.js'` instead of individual named exports
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: 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#428
File: packages/project-builder-server/src/sync/index.ts:5-5
Timestamp: 2025-01-23T09:12:46.178Z
Learning: Avoid importing directly from 'dist' directories. Instead, expose functionality through the package's public API and import from the main package entry point.
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 plugins/*/**/*.tsx : In plugins, prefix all Tailwind classes with the plugin name (e.g., `auth-`, `storage-`)
packages/core-generators/src/renderers/extractor/plugins/template-renderers/index.ts (12)
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 **/index.{ts,tsx} : Prefer barrel exports e.g. `export * from './foo.js'` instead of individual named exports
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} : 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: 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#428
File: packages/project-builder-server/src/sync/index.ts:5-5
Timestamp: 2025-01-23T09:12:46.178Z
Learning: Avoid importing directly from 'dist' directories. Instead, expose functionality through the package's public API and import from the main package entry point.
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: .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}/**/*.{unit,int}.test.ts : Always import vitest globals explicitly (describe, it, expect)
packages/core-generators/src/renderers/extractor/plugins/template-renderers/types.ts (10)
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} : 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} : Extract repeated components into distinct functions or components where applicable
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: .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: 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: 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} : 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-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: 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.
packages/core-generators/src/renderers/extractor/plugins/typed-templates-file.ts (15)
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} : 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} : 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 **/index.{ts,tsx} : Prefer barrel exports e.g. `export * from './foo.js'` instead of individual named exports
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} : Use camelCase for variables/functions, PascalCase for types/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}/**/*.unit.test.ts : Unit tests use `.unit.test.ts` suffix
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#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} : 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 plugins/*/**/*.tsx : In plugins, prefix all Tailwind classes with the plugin name (e.g., `auth-`, `storage-`)
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
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: 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.
packages/fastify-generators/src/generators/prisma/prisma/prisma.generator.ts (16)
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/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#505
File: packages/create-project/tsconfig.json:6-6
Timestamp: 2025-04-21T06:32:22.476Z
Learning: Since TypeScript 4.1, baseUrl is not required for paths mapping when using explicit relative paths (with "./"). Removing baseUrl from tsconfig.json while updating paths to use relative paths (e.g., changing "@src/*": ["src/*"] to "@src/*": ["./src/*"]) prevents bare path imports from node_modules while maintaining path alias functionality.
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#505
File: packages/create-project/tsconfig.json:6-6
Timestamp: 2025-04-21T06:32:22.476Z
Learning: Since TypeScript 4.1, baseUrl is not required for paths mapping in tsconfig.json. Removing baseUrl and using explicit relative paths with "./" prefix (e.g., changing "@src/*": ["src/*"] to "@src/*": ["./src/*"]) prevents bare path imports from node_modules while maintaining path alias functionality.
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: 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-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 **/*.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} : 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
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
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#521
File: packages/react-generators/src/generators/admin/admin-components/admin-components.generator.ts:55-61
Timestamp: 2025-05-05T06:35:13.300Z
Learning: In generators, paths should be merged with forward slashes (/) only since JavaScript generated files use POSIX style separators. The system handles conversion to Windows style separators at later stages when writing out files.
packages/core-generators/src/renderers/typescript/extractor/ts-template-file-extractor.ts (19)
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: 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: .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: 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: 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} : If a particular interface or type is not exported, change the file so it is exported
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 plugins/*/**/*.tsx : In plugins, prefix all Tailwind classes with the plugin name (e.g., `auth-`, `storage-`)
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} : 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
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: 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
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/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 **/*.test.ts : Import test functions from 'vitest' (no globals)
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: .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#521
File: packages/react-generators/src/generators/admin/admin-components/admin-components.generator.ts:55-61
Timestamp: 2025-05-05T06:35:13.300Z
Learning: In generators, paths should be merged with forward slashes (/) only since JavaScript generated files use POSIX style separators. The system handles conversion to Windows style separators at later stages when writing out files.
.changeset/template-renderers-plugin.md (6)
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: 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/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: 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: .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
packages/core-generators/src/renderers/extractor/plugins/template-renderers/renderers-file.ts (7)
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: 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: 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: 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} : Node 16 module resolution - include file extensions in imports (`.js`)
packages/core-generators/src/renderers/extractor/plugins/template-renderers/README.md (5)
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: 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: 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 plugins/*/**/*.tsx : In plugins, prefix all Tailwind classes with the plugin name (e.g., `auth-`, `storage-`)
packages/core-generators/src/renderers/extractor/plugins/template-renderers/template-renderers.plugin.ts (4)
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: 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: CR
PR: halfdomelabs/baseplate#0
File: CLAUDE.md:0-0
Timestamp: 2025-06-30T11:51:48.395Z
Learning: Applies to **/index.{ts,tsx} : Prefer barrel exports e.g. `export * from './foo.js'` instead of individual named exports
packages/core-generators/src/renderers/typescript/extractor/render-ts-template-renderers.ts (11)
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: 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: 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} : All functions (excluding one-liner arrow functions) require explicit return types
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: 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} : Always include return types on top-level functions including React components (`React.ReactElement`)
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} : Prefer functional programming patterns
🧬 Code Graph Analysis (4)
packages/core-generators/src/renderers/extractor/plugins/template-renderers/types.ts (1)
packages/core-generators/src/renderers/typescript/fragments/types.ts (1)
TsCodeFragment(55-72)
packages/core-generators/src/renderers/extractor/plugins/typed-templates-file.ts (3)
packages/utils/src/paths/posix-join.ts (1)
posixJoin(10-12)packages/core-generators/src/renderers/extractor/utils/generated-template-file-names.ts (1)
getGeneratedTemplateConstantName(11-16)packages/core-generators/src/utils/ts-paths.ts (1)
normalizeTsPathToJsPath(8-10)
packages/core-generators/src/renderers/typescript/extractor/ts-template-file-extractor.ts (3)
packages/core-generators/src/renderers/extractor/plugins/index.ts (1)
templateRenderersPlugin(6-6)packages/core-generators/src/renderers/extractor/plugins/template-renderers/template-renderers.plugin.ts (1)
templateRenderersPlugin(25-75)packages/core-generators/src/renderers/typescript/extractor/render-ts-template-renderers.ts (1)
renderTsTemplateRenderers(206-230)
packages/core-generators/src/renderers/extractor/plugins/template-renderers/renderers-file.ts (7)
packages/utils/src/paths/posix-join.ts (1)
posixJoin(10-12)packages/core-generators/src/renderers/extractor/utils/generated-template-file-names.ts (4)
getGeneratedTemplateInterfaceName(41-46)getGeneratedTemplateExportName(26-31)getGeneratedTemplateConstantName(11-16)getGeneratedTemplateProviderName(48-53)packages/core-generators/src/renderers/extractor/plugins/template-renderers/types.ts (2)
TemplateRendererEntry(29-46)TemplateRendererTaskDependency(6-23)packages/core-generators/src/renderers/typescript/utils/ts-code-utils.ts (2)
TsCodeUtils(85-580)tsTemplate(583-583)packages/core-generators/src/renderers/typescript/fragments/creators.ts (1)
tsCodeFragment(73-83)packages/core-generators/src/renderers/typescript/imports/builder.ts (1)
tsImportBuilder(74-82)packages/core-generators/src/renderers/typescript/renderers/file.ts (1)
renderTsCodeFileTemplate(150-190)
🪛 LanguageTool
packages/core-generators/src/renderers/extractor/plugins/template-renderers/README.md
[style] ~116-~116: ‘exact same’ might be wordy. Consider a shorter alternative.
Context: ...lates` Pattern This plugin follows the exact same pattern as the typed templates system: ...
(EN_WORDINESS_PREMIUM_EXACT_SAME)
[grammar] ~225-~225: The verb “Follow” needs to be in the to-infinitive form.
Context: ...he existing generic plugin - no changes needed 4. Follow the same integration pattern in your te...
(MISSING_TO_BEFORE_A_VERB)
🪛 markdownlint-cli2 (0.17.2)
packages/core-generators/src/renderers/extractor/plugins/template-renderers/README.md
177-177: Fenced code blocks should have a language specified
(MD040, fenced-code-language)
⏰ Context from checks skipped due to timeout of 90000ms (2)
- GitHub Check: Lint
- GitHub Check: Test E2E
🔇 Additional comments (24)
.coderabbit.yaml (1)
8-8: Exclusion pattern LGTM
'!**/generated/**'correctly excludes generated artifacts at any depth and is valid per schema. No further concerns.packages/core-generators/src/renderers/extractor/plugins/index.ts (1)
6-6: LGTM! Clean addition to the plugin exports.The export follows the established pattern and correctly uses the
.jsextension for Node 16 module resolution.packages/core-generators/src/renderers/extractor/plugins/template-renderers/index.ts (1)
1-2: LGTM! Proper barrel export pattern.The file correctly follows the coding guideline for index files to use
export *syntax and includes proper.jsextensions.packages/core-generators/src/renderers/extractor/plugins/template-renderers/types.ts (2)
1-1: LGTM! Proper import structure.The import correctly uses the
#src/path alias and.jsextension following the coding guidelines.
29-46: LGTM! Well-structured interface design.The
TemplateRendererEntryinterface is properly documented and uses appropriate types includingTsCodeFragmentfor code representation.packages/core-generators/src/renderers/extractor/plugins/typed-templates-file.ts (4)
17-17: LGTM! Good refactoring to export the constant.Making the file name constant exportable enables reuse by other modules in the Template Renderers plugin.
35-37: LGTM! Excellent extraction of reusable logic.The new function centralizes the export name generation logic with proper typing and follows the coding guideline for explicit return types.
74-74: LGTM! Consistent use of the new helper function.Using the extracted
getTypedTemplatesFileExportNamefunction improves code maintainability and consistency.
102-102: LGTM! Proper use of the exported constant.Using the
GENERATED_TYPED_TEMPLATES_FILE_NAMEconstant ensures consistency across the codebase.packages/fastify-generators/src/generators/prisma/prisma/prisma.generator.ts (4)
79-79: LGTM! Addition of renderers task dependency.Adding the
rendererstask to the build tasks properly integrates with the new Template Renderers plugin architecture.
122-124: LGTM! Clean migration to the new renderers API.The task dependencies have been simplified to use the new
renderersprovider, which encapsulates the previous complexity of managing separatetypescriptFileandpathsdependencies.
127-127: LGTM! Simplified template rendering call.The migration from
typescriptFile.renderTemplateFiletorenderers.service.renderdemonstrates the improved API simplicity provided by the Template Renderers plugin.
130-135: LGTM! Proper use of render options.The seed renderer call correctly includes the
writeOptionswithshouldNeverOverwrite: true, maintaining the intended behavior while using the new API.packages/core-generators/src/renderers/typescript/extractor/ts-template-file-extractor.ts (1)
17-184: LGTM! Clean integration of the Template Renderers plugin.The integration follows the established plugin pattern correctly, mirroring how other plugins like
typedTemplatesFilePluginare integrated. The implementation properly:
- Adds the plugin to dependencies
- Retrieves the plugin instance
- Generates renderer entries using the TypeScript-specific function
- Registers entries with the plugin
.changeset/template-renderers-plugin.md (1)
1-41: Excellent changeset documentation!The changeset clearly explains the benefits of the new Template Renderers plugin with compelling before/after examples that demonstrate the 70-80% reduction in boilerplate code. The feature list is comprehensive and highlights all the key benefits.
packages/core-generators/src/renderers/extractor/plugins/template-renderers/template-renderers.plugin.ts (1)
1-75: Well-structured plugin implementation!The plugin correctly:
- Follows the established
createTemplateExtractorPluginpattern- Manages renderer entries per generator using a Map
- Properly integrates with the barrel export plugin using the correct relative path (as per the learnings about
generated/index.ts)- Includes appropriate configuration schema with skip option
packages/core-generators/src/renderers/extractor/plugins/template-renderers/renderers-file.ts (2)
82-110: Excellent error handling for duplicate dependencies!The duplicate dependency detection using
isEqualfor deep comparison is well implemented. The error message provides clear context about the conflict, making debugging easier.
28-225: Solid implementation of renderer file generation!The code properly:
- Uses consistent naming conventions via the utility functions
- Follows the template-based approach for file generation
- Correctly builds TypeScript code fragments with proper imports
- Handles the full lifecycle from task creation to file writing
packages/core-generators/src/renderers/extractor/plugins/template-renderers/README.md (1)
1-242: Comprehensive and well-structured documentation!The README effectively explains the plugin's purpose, architecture, benefits, and migration path. The examples clearly demonstrate the significant reduction in boilerplate code, and the architectural explanation helps future contributors understand the extensibility model.
packages/core-generators/src/renderers/typescript/extractor/render-ts-template-renderers.ts (5)
1-30: Imports are well-organized and follow conventions.The imports are properly structured with type imports first, external libraries before local imports, and all local imports using the required
.jsextensions and#src/alias.
36-53: Clean implementation of import map providers extraction.The function correctly handles both single and multiple template configurations, properly deduplicates providers, and returns a well-formatted expression.
54-82: Well-structured task dependencies creation.The function properly creates TypeScript task dependencies with conditional paths inclusion and clean filtering of undefined values.
206-231: Main renderer function is well-implemented.The function properly separates grouped and ungrouped templates, uses appropriate utility functions, and returns a comprehensive array of renderer entries.
183-192: Confirm thatpathsis emitted as an identifier, not a string literalThe call to
TsCodeUtils.mergeFragmentsAsObjectPresorted({ group: templatesExpression, paths: `paths`, importMapProviders: …, '...': 'options', })relies on a
pathsvariable in the generated code matchinginterface RenderTsTemplateGroupActionInputBase<T> { group: T; paths: { [K in keyof T]: string }; … }Please verify that:
- A
pathsvariable of the correct shape is declared or imported in the scope where this render function runs.TsCodeUtils.mergeFragmentsAsObjectPresortedtreats backtick-wrapped fragments as raw code (producingpaths), not as a quoted string ("paths").If either assumption is invalid, update
• packages/core-generators/src/renderers/typescript/extractor/render-ts-template-renderers.ts (lines 183–192)
to pass the actualpathsobject or adjust the fragment so it isn’t emitted as a literal.
Summary by CodeRabbit
New Features
Documentation
Chores