-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: Replace localeCompare with stable string comparison #694
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
refactor: Replace localeCompare with stable string comparison #694
Conversation
Replace String.prototype.localeCompare() with a new compareStrings() utility from @baseplate-dev/utils. This ensures stable, deterministic sorting across different operating systems and locale settings. Changes: - Add compareStrings() and compareStringsCaseInsensitive() utilities - Replace all production code usages of localeCompare with compareStrings - Add documentation in AGENTS.md about when to use each approach - Add comprehensive unit tests for string comparison utilities The localeCompare() method produces different results based on the user's locale and OS configuration, which can lead to inconsistent code generation and merge conflicts. The new compareStrings() function uses simple lexicographic ordering that is stable across all platforms. Test files continue to use localeCompare() where appropriate for testing purposes.
🦋 Changeset detectedLatest commit: 860e647 The changes in this PR will be included in the next version bump. This PR includes changesets to release 18 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 (1)
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 PR introduces a new Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Possibly related PRs
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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: 4
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
packages/code-morph/src/morphers/utils/imports.ts (1)
81-81: Inconsistent sorting: UsecompareStringsinstead of bare.sort().Line 81 uses the default
.sort()method without a comparator, which will produce locale-dependent sorting. This is inconsistent with the change on line 70 and defeats the purpose of this PR.Apply this diff to use
compareStringsconsistently:- insertImportDeclarationAtTop(sourceFile, { - moduleSpecifier, - namedImports: namedImports.sort().map((name) => ({ name })), - isTypeOnly: typeOnly, - }); + insertImportDeclarationAtTop(sourceFile, { + moduleSpecifier, + namedImports: namedImports + .sort((a, b) => compareStrings(a, b)) + .map((name) => ({ name })), + isTypeOnly: typeOnly, + });packages/project-builder-web/src/routes/data/models/-hooks/use-model-form.ts (1)
171-177: Refactor sortBy to use compareStrings for consistency with codebase pattern.es-toolkit's sortBy uses default JavaScript comparison (Unicode code-unit order) for strings, which is deterministic but not locale-aware. While this makes the current code stable, the codebase standardizes on
compareStringsfor all string sorting operations. The file usessortByinstead of the pattern consistently applied elsewhere (e.g.,react-icon-combobox.tsx,new-admin-section-dialog.tsx). Update lines 171-177 to importcompareStringsfrom'@baseplate-dev/utils'and refactor the sorting to use.sort((a, b) => compareStrings(a.name, b.name)).
🧹 Nitpick comments (1)
plugins/plugin-queue/src/queue/core/components/queue-definition-editor.tsx (1)
94-97: Behavior-preserving simplification; consider tightening formatting for clarityThe new use of optional chaining on
pluginMetadata?.configmakes the comparison safer without relying on a type assertion, and the logic ofhasSelectedImplementationChangedremains the same (comparing the current implementation key against the original config value).You could slightly simplify the expression to improve readability:
- const hasSelectedImplementationChanged = - implementationPluginKey !== - (pluginMetadata?.config) - ?.implementationPluginKey; + const hasSelectedImplementationChanged = + implementationPluginKey !== + pluginMetadata?.config?.implementationPluginKey;This keeps the semantics identical while avoiding the extra parentheses and split
?.chain.
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Disabled knowledge base sources:
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
⛔ Files ignored due to path filters (1)
pnpm-lock.yamlis excluded by!**/pnpm-lock.yaml
📒 Files selected for processing (40)
.changeset/stable-string-comparison.md(1 hunks)AGENTS.md(1 hunks)packages/code-morph/package.json(1 hunks)packages/code-morph/src/morphers/utils/imports.ts(2 hunks)packages/core-generators/src/generators/node/node-git-ignore/node-git-ignore.generator.ts(2 hunks)packages/core-generators/src/renderers/extractor/plugins/template-paths/paths-file.ts(2 hunks)packages/core-generators/src/renderers/extractor/plugins/typed-templates-file.ts(2 hunks)packages/core-generators/src/renderers/text/render-text-typed-templates.ts(2 hunks)packages/core-generators/src/renderers/typescript/extractor/parse-simple-replacements.ts(2 hunks)packages/core-generators/src/renderers/typescript/extractor/render-ts-typed-templates.ts(2 hunks)packages/core-generators/src/renderers/typescript/fragments/utils.ts(2 hunks)packages/core-generators/src/renderers/typescript/imports/merge-ts-import-declarations.ts(2 hunks)packages/core-generators/src/renderers/typescript/renderers/file.ts(2 hunks)packages/core-generators/src/renderers/typescript/utils/ts-code-utils.ts(3 hunks)packages/core-generators/src/test-helpers/utils.ts(3 hunks)packages/fastify-generators/src/generators/core/service-file/service-file.generator.ts(2 hunks)packages/fastify-generators/src/generators/prisma/prisma-data-service/prisma-data-service.generator.ts(2 hunks)packages/fastify-generators/src/writers/prisma-schema/model-writer.ts(2 hunks)packages/project-builder-server/src/compiler/compile-packages.ts(1 hunks)packages/project-builder-server/src/diff/snapshot/snapshot-manifest.ts(2 hunks)packages/project-builder-server/src/sync/file-id-map.ts(2 hunks)packages/project-builder-server/src/template-extractor/discover-generators.ts(2 hunks)packages/project-builder-server/src/templates/list/list-templates.ts(2 hunks)packages/project-builder-web/src/routes/admin-sections.$appKey/-components/new-admin-section-dialog.tsx(2 hunks)packages/project-builder-web/src/routes/admin-sections.$appKey/-components/react-icon-combobox.tsx(2 hunks)packages/project-builder-web/src/routes/data/enums/-hooks/use-enum-form.tsx(1 hunks)packages/project-builder-web/src/routes/data/models/-hooks/use-model-form.ts(1 hunks)packages/react-generators/src/generators/core/react-router/react-router.generator.ts(2 hunks)packages/sync/src/templates/metadata/write-template-info-files.ts(2 hunks)packages/utils/src/objects/sort-keys-recursive.ts(2 hunks)packages/utils/src/objects/sort-object-keys.ts(2 hunks)packages/utils/src/string/compare-strings.ts(1 hunks)packages/utils/src/string/compare-strings.unit.test.ts(1 hunks)packages/utils/src/string/index.ts(1 hunks)packages/utils/src/toposort/toposort-local.ts(2 hunks)packages/utils/src/toposort/toposort.ts(2 hunks)plugins/plugin-auth/src/auth/core/components/auth-definition-editor.tsx(1 hunks)plugins/plugin-auth/src/common/components/auth-config-tabs.tsx(1 hunks)plugins/plugin-queue/src/common/components/queue-config-tabs.tsx(1 hunks)plugins/plugin-queue/src/queue/core/components/queue-definition-editor.tsx(1 hunks)
🧰 Additional context used
📓 Path-based instructions (13)
**/*.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/code-style.mdc)
**/*.{ts,tsx}: TypeScript with strict type checking
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/)
If a particular interface or type is not exported, change the file so it is exportedIf a particular interface or type is not exported, update the TypeScript file so it is exported
Files:
packages/project-builder-web/src/routes/admin-sections.$appKey/-components/react-icon-combobox.tsxpackages/core-generators/src/renderers/typescript/imports/merge-ts-import-declarations.tspackages/core-generators/src/renderers/typescript/extractor/render-ts-typed-templates.tsplugins/plugin-auth/src/auth/core/components/auth-definition-editor.tsxpackages/react-generators/src/generators/core/react-router/react-router.generator.tspackages/utils/src/string/index.tspackages/project-builder-web/src/routes/data/enums/-hooks/use-enum-form.tsxpackages/project-builder-server/src/compiler/compile-packages.tspackages/project-builder-web/src/routes/data/models/-hooks/use-model-form.tspackages/fastify-generators/src/generators/core/service-file/service-file.generator.tsplugins/plugin-queue/src/common/components/queue-config-tabs.tsxpackages/project-builder-web/src/routes/admin-sections.$appKey/-components/new-admin-section-dialog.tsxpackages/utils/src/toposort/toposort.tspackages/core-generators/src/test-helpers/utils.tspackages/core-generators/src/generators/node/node-git-ignore/node-git-ignore.generator.tspackages/core-generators/src/renderers/typescript/fragments/utils.tspackages/core-generators/src/renderers/text/render-text-typed-templates.tspackages/project-builder-server/src/templates/list/list-templates.tspackages/sync/src/templates/metadata/write-template-info-files.tspackages/utils/src/objects/sort-object-keys.tspackages/core-generators/src/renderers/extractor/plugins/template-paths/paths-file.tspackages/utils/src/objects/sort-keys-recursive.tspackages/core-generators/src/renderers/typescript/extractor/parse-simple-replacements.tspackages/utils/src/string/compare-strings.tspackages/utils/src/toposort/toposort-local.tspackages/fastify-generators/src/writers/prisma-schema/model-writer.tspackages/fastify-generators/src/generators/prisma/prisma-data-service/prisma-data-service.generator.tsplugins/plugin-queue/src/queue/core/components/queue-definition-editor.tsxpackages/code-morph/src/morphers/utils/imports.tspackages/utils/src/string/compare-strings.unit.test.tspackages/core-generators/src/renderers/extractor/plugins/typed-templates-file.tspackages/project-builder-server/src/diff/snapshot/snapshot-manifest.tspackages/project-builder-server/src/sync/file-id-map.tspackages/core-generators/src/renderers/typescript/utils/ts-code-utils.tspackages/core-generators/src/renderers/typescript/renderers/file.tspackages/project-builder-server/src/template-extractor/discover-generators.tsplugins/plugin-auth/src/common/components/auth-config-tabs.tsx
**/*.{js,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/code-style.mdc)
Node 16 module resolution - include file extensions in imports (
.js)
Files:
packages/project-builder-web/src/routes/admin-sections.$appKey/-components/react-icon-combobox.tsxpackages/core-generators/src/renderers/typescript/imports/merge-ts-import-declarations.tspackages/core-generators/src/renderers/typescript/extractor/render-ts-typed-templates.tsplugins/plugin-auth/src/auth/core/components/auth-definition-editor.tsxpackages/react-generators/src/generators/core/react-router/react-router.generator.tspackages/utils/src/string/index.tspackages/project-builder-web/src/routes/data/enums/-hooks/use-enum-form.tsxpackages/project-builder-server/src/compiler/compile-packages.tspackages/project-builder-web/src/routes/data/models/-hooks/use-model-form.tspackages/fastify-generators/src/generators/core/service-file/service-file.generator.tsplugins/plugin-queue/src/common/components/queue-config-tabs.tsxpackages/project-builder-web/src/routes/admin-sections.$appKey/-components/new-admin-section-dialog.tsxpackages/utils/src/toposort/toposort.tspackages/core-generators/src/test-helpers/utils.tspackages/core-generators/src/generators/node/node-git-ignore/node-git-ignore.generator.tspackages/core-generators/src/renderers/typescript/fragments/utils.tspackages/core-generators/src/renderers/text/render-text-typed-templates.tspackages/project-builder-server/src/templates/list/list-templates.tspackages/sync/src/templates/metadata/write-template-info-files.tspackages/utils/src/objects/sort-object-keys.tspackages/core-generators/src/renderers/extractor/plugins/template-paths/paths-file.tspackages/utils/src/objects/sort-keys-recursive.tspackages/core-generators/src/renderers/typescript/extractor/parse-simple-replacements.tspackages/utils/src/string/compare-strings.tspackages/utils/src/toposort/toposort-local.tspackages/fastify-generators/src/writers/prisma-schema/model-writer.tspackages/fastify-generators/src/generators/prisma/prisma-data-service/prisma-data-service.generator.tsplugins/plugin-queue/src/queue/core/components/queue-definition-editor.tsxpackages/code-morph/src/morphers/utils/imports.tspackages/utils/src/string/compare-strings.unit.test.tspackages/core-generators/src/renderers/extractor/plugins/typed-templates-file.tspackages/project-builder-server/src/diff/snapshot/snapshot-manifest.tspackages/project-builder-server/src/sync/file-id-map.tspackages/core-generators/src/renderers/typescript/utils/ts-code-utils.tspackages/core-generators/src/renderers/typescript/renderers/file.tspackages/project-builder-server/src/template-extractor/discover-generators.tsplugins/plugin-auth/src/common/components/auth-config-tabs.tsx
**/*.{ts,tsx,js}
📄 CodeRabbit inference engine (.cursor/rules/code-style.mdc)
**/*.{ts,tsx,js}: Sort imports by group: external libs first, then local imports
Use camelCase for variables/functions, PascalCase for types/classes
Order functions such that functions are placed below the variables/functions they use
We use the prefer using nullish coalescing operator (??) ESLint rule instead of a logical or (||), as it is a safer operator
Use console.info/warn/error instead of console.log
Files:
packages/project-builder-web/src/routes/admin-sections.$appKey/-components/react-icon-combobox.tsxpackages/core-generators/src/renderers/typescript/imports/merge-ts-import-declarations.tspackages/core-generators/src/renderers/typescript/extractor/render-ts-typed-templates.tsplugins/plugin-auth/src/auth/core/components/auth-definition-editor.tsxpackages/react-generators/src/generators/core/react-router/react-router.generator.tspackages/utils/src/string/index.tspackages/project-builder-web/src/routes/data/enums/-hooks/use-enum-form.tsxpackages/project-builder-server/src/compiler/compile-packages.tspackages/project-builder-web/src/routes/data/models/-hooks/use-model-form.tspackages/fastify-generators/src/generators/core/service-file/service-file.generator.tsplugins/plugin-queue/src/common/components/queue-config-tabs.tsxpackages/project-builder-web/src/routes/admin-sections.$appKey/-components/new-admin-section-dialog.tsxpackages/utils/src/toposort/toposort.tspackages/core-generators/src/test-helpers/utils.tspackages/core-generators/src/generators/node/node-git-ignore/node-git-ignore.generator.tspackages/core-generators/src/renderers/typescript/fragments/utils.tspackages/core-generators/src/renderers/text/render-text-typed-templates.tspackages/project-builder-server/src/templates/list/list-templates.tspackages/sync/src/templates/metadata/write-template-info-files.tspackages/utils/src/objects/sort-object-keys.tspackages/core-generators/src/renderers/extractor/plugins/template-paths/paths-file.tspackages/utils/src/objects/sort-keys-recursive.tspackages/core-generators/src/renderers/typescript/extractor/parse-simple-replacements.tspackages/utils/src/string/compare-strings.tspackages/utils/src/toposort/toposort-local.tspackages/fastify-generators/src/writers/prisma-schema/model-writer.tspackages/fastify-generators/src/generators/prisma/prisma-data-service/prisma-data-service.generator.tsplugins/plugin-queue/src/queue/core/components/queue-definition-editor.tsxpackages/code-morph/src/morphers/utils/imports.tspackages/utils/src/string/compare-strings.unit.test.tspackages/core-generators/src/renderers/extractor/plugins/typed-templates-file.tspackages/project-builder-server/src/diff/snapshot/snapshot-manifest.tspackages/project-builder-server/src/sync/file-id-map.tspackages/core-generators/src/renderers/typescript/utils/ts-code-utils.tspackages/core-generators/src/renderers/typescript/renderers/file.tspackages/project-builder-server/src/template-extractor/discover-generators.tsplugins/plugin-auth/src/common/components/auth-config-tabs.tsx
**/*
📄 CodeRabbit inference engine (.cursor/rules/code-style.mdc)
Use kebab-case for file names
Files:
packages/project-builder-web/src/routes/admin-sections.$appKey/-components/react-icon-combobox.tsxpackages/core-generators/src/renderers/typescript/imports/merge-ts-import-declarations.tspackages/core-generators/src/renderers/typescript/extractor/render-ts-typed-templates.tsplugins/plugin-auth/src/auth/core/components/auth-definition-editor.tsxpackages/react-generators/src/generators/core/react-router/react-router.generator.tspackages/utils/src/string/index.tspackages/project-builder-web/src/routes/data/enums/-hooks/use-enum-form.tsxpackages/project-builder-server/src/compiler/compile-packages.tspackages/project-builder-web/src/routes/data/models/-hooks/use-model-form.tspackages/fastify-generators/src/generators/core/service-file/service-file.generator.tsplugins/plugin-queue/src/common/components/queue-config-tabs.tsxpackages/project-builder-web/src/routes/admin-sections.$appKey/-components/new-admin-section-dialog.tsxpackages/utils/src/toposort/toposort.tspackages/core-generators/src/test-helpers/utils.tspackages/core-generators/src/generators/node/node-git-ignore/node-git-ignore.generator.tspackages/core-generators/src/renderers/typescript/fragments/utils.tspackages/code-morph/package.jsonpackages/core-generators/src/renderers/text/render-text-typed-templates.tspackages/project-builder-server/src/templates/list/list-templates.tspackages/sync/src/templates/metadata/write-template-info-files.tspackages/utils/src/objects/sort-object-keys.tspackages/core-generators/src/renderers/extractor/plugins/template-paths/paths-file.tspackages/utils/src/objects/sort-keys-recursive.tspackages/core-generators/src/renderers/typescript/extractor/parse-simple-replacements.tspackages/utils/src/string/compare-strings.tspackages/utils/src/toposort/toposort-local.tspackages/fastify-generators/src/writers/prisma-schema/model-writer.tspackages/fastify-generators/src/generators/prisma/prisma-data-service/prisma-data-service.generator.tsplugins/plugin-queue/src/queue/core/components/queue-definition-editor.tsxpackages/code-morph/src/morphers/utils/imports.tspackages/utils/src/string/compare-strings.unit.test.tspackages/core-generators/src/renderers/extractor/plugins/typed-templates-file.tsAGENTS.mdpackages/project-builder-server/src/diff/snapshot/snapshot-manifest.tspackages/project-builder-server/src/sync/file-id-map.tspackages/core-generators/src/renderers/typescript/utils/ts-code-utils.tspackages/core-generators/src/renderers/typescript/renderers/file.tspackages/project-builder-server/src/template-extractor/discover-generators.tsplugins/plugin-auth/src/common/components/auth-config-tabs.tsx
{packages/project-builder-web/**,packages/ui-components/**}/*.tsx
📄 CodeRabbit inference engine (.cursor/rules/ui-rules.mdc)
{packages/project-builder-web/**,packages/ui-components/**}/*.tsx: Use ShadCN-based components from@baseplate-dev/ui-componentsand always prefer these components over creating custom ones
Use Tailwind CSS utilities exclusively for styling; avoid writing custom CSS classes and use Tailwind's utility classes for all styling needs
In plugins, prefix all Tailwind classes with the plugin name (e.g.,auth-,storage-)
Use icons fromreact-icons/md(Material Design icons) and import them likeimport { MdAdd, MdDelete } from 'react-icons/md'; avoid using other icon libraries
Files:
packages/project-builder-web/src/routes/admin-sections.$appKey/-components/react-icon-combobox.tsxpackages/project-builder-web/src/routes/data/enums/-hooks/use-enum-form.tsxpackages/project-builder-web/src/routes/admin-sections.$appKey/-components/new-admin-section-dialog.tsx
plugins/plugin-*/**/*.tsx
📄 CodeRabbit inference engine (plugins/CLAUDE.md)
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 must also be prefixed with the plugin name.
Files:
plugins/plugin-auth/src/auth/core/components/auth-definition-editor.tsxplugins/plugin-queue/src/common/components/queue-config-tabs.tsxplugins/plugin-queue/src/queue/core/components/queue-definition-editor.tsxplugins/plugin-auth/src/common/components/auth-config-tabs.tsx
**/index.{ts,tsx,js}
📄 CodeRabbit inference engine (.cursor/rules/code-style.mdc)
Prefer barrel exports e.g. export * from './foo.js' instead of individual named exports
Files:
packages/utils/src/string/index.ts
.changeset/**/*.md
📄 CodeRabbit inference engine (AGENTS.md)
.changeset/**/*.md: When adding a new feature or changing an existing feature, add a new Changeset in the .changeset/ directory
Changeset files must follow the specified frontmatter format with a package entry set to patch and a description body
Files:
.changeset/stable-string-comparison.md
**/*.{unit,int}.test.ts
📄 CodeRabbit inference engine (.cursor/rules/code-style.mdc)
Unit tests use
.unit.test.tssuffix, integration tests use.int.test.ts
Files:
packages/utils/src/string/compare-strings.unit.test.ts
**/*.test.ts
📄 CodeRabbit inference engine (.cursor/rules/code-style.mdc)
Always import vitest globals explicitly (describe, it, expect)
Files:
packages/utils/src/string/compare-strings.unit.test.ts
**/*.test.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/testing.mdc)
**/*.test.{ts,tsx}: Use descriptive test names that explain what is being tested
Structure tests with clear setup, execution, and verification phases (Arrange-Act-Assert)
Always mock external API calls and file system operations in tests
Each test should be independent and not rely on others
Leverage TypeScript for type-safe mocking in tests
Focus on testing public methods and behaviors, not implementation details
Each test should verify one specific behavior to keep tests simple
For file system operations in tests, use memfs and mock 'node:fs' and 'node:fs/promises'
When using globby in tests, pass the mocked fs adapter
Files:
packages/utils/src/string/compare-strings.unit.test.ts
**/*.{test,test-helper}.{ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/testing.mdc)
Extract repeated logic into reusable helper functions
Files:
packages/utils/src/string/compare-strings.unit.test.ts
**/*.unit.test.ts
📄 CodeRabbit inference engine (.cursor/rules/testing.mdc)
Unit tests are colocated with source files using
.unit.test.tssuffix
Files:
packages/utils/src/string/compare-strings.unit.test.ts
🧠 Learnings (47)
📚 Learning: 2025-07-22T09:11:29.223Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/ui-rules.mdc:0-0
Timestamp: 2025-07-22T09:11:29.223Z
Learning: Applies to {packages/project-builder-web/**,packages/ui-components/**}/*.tsx : Use ShadCN-based components from `baseplate-dev/ui-components` and always prefer these components over creating custom ones
Applied to files:
packages/project-builder-web/src/routes/admin-sections.$appKey/-components/react-icon-combobox.tsxpackages/core-generators/src/renderers/typescript/imports/merge-ts-import-declarations.tspackages/core-generators/src/renderers/typescript/extractor/render-ts-typed-templates.tspackages/react-generators/src/generators/core/react-router/react-router.generator.tspackages/project-builder-server/src/compiler/compile-packages.tspackages/project-builder-web/src/routes/admin-sections.$appKey/-components/new-admin-section-dialog.tsxpackages/core-generators/src/test-helpers/utils.tspackages/core-generators/src/generators/node/node-git-ignore/node-git-ignore.generator.tspackages/core-generators/src/renderers/typescript/fragments/utils.tspackages/code-morph/package.jsonpackages/core-generators/src/renderers/text/render-text-typed-templates.tspackages/project-builder-server/src/templates/list/list-templates.tspackages/core-generators/src/renderers/extractor/plugins/template-paths/paths-file.tspackages/core-generators/src/renderers/typescript/extractor/parse-simple-replacements.tspackages/fastify-generators/src/generators/prisma/prisma-data-service/prisma-data-service.generator.tspackages/core-generators/src/renderers/extractor/plugins/typed-templates-file.tsAGENTS.mdpackages/project-builder-server/src/diff/snapshot/snapshot-manifest.tspackages/project-builder-server/src/sync/file-id-map.tspackages/core-generators/src/renderers/typescript/utils/ts-code-utils.ts
📚 Learning: 2025-07-22T09:11:29.223Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/ui-rules.mdc:0-0
Timestamp: 2025-07-22T09:11:29.223Z
Learning: Applies to {packages/project-builder-web/**,packages/ui-components/**}/*.tsx : Use icons from `react-icons/md` (Material Design icons) and import them like `import { MdAdd, MdDelete } from 'react-icons/md'`; avoid using other icon libraries
Applied to files:
packages/project-builder-web/src/routes/admin-sections.$appKey/-components/react-icon-combobox.tsx
📚 Learning: 2025-07-22T09:11:29.223Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/ui-rules.mdc:0-0
Timestamp: 2025-07-22T09:11:29.223Z
Learning: Applies to {packages/project-builder-web/**,packages/ui-components/**}/*.tsx : Use Tailwind CSS utilities exclusively for styling; avoid writing custom CSS classes and use Tailwind's utility classes for all styling needs
Applied to files:
packages/project-builder-web/src/routes/admin-sections.$appKey/-components/react-icon-combobox.tsx
📚 Learning: 2025-07-22T09:11:29.223Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/ui-rules.mdc:0-0
Timestamp: 2025-07-22T09:11:29.223Z
Learning: Applies to {packages/project-builder-web/**,packages/ui-components/**}/*.tsx : In plugins, prefix all Tailwind classes with the plugin name (e.g., `auth-`, `storage-`)
Applied to files:
packages/project-builder-web/src/routes/admin-sections.$appKey/-components/react-icon-combobox.tsxplugins/plugin-auth/src/auth/core/components/auth-definition-editor.tsxpackages/project-builder-web/src/routes/admin-sections.$appKey/-components/new-admin-section-dialog.tsxplugins/plugin-auth/src/common/components/auth-config-tabs.tsx
📚 Learning: 2025-07-22T09:10:31.413Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-07-22T09:10:31.413Z
Learning: Applies to **/*.{ts,tsx,js} : Sort imports by group: external libs first, then local imports
Applied to files:
packages/core-generators/src/renderers/typescript/imports/merge-ts-import-declarations.tspackages/core-generators/src/renderers/typescript/extractor/render-ts-typed-templates.tspackages/core-generators/src/test-helpers/utils.tspackages/core-generators/src/renderers/typescript/fragments/utils.tspackages/utils/src/objects/sort-object-keys.tspackages/core-generators/src/renderers/typescript/extractor/parse-simple-replacements.tspackages/utils/src/toposort/toposort-local.tspackages/code-morph/src/morphers/utils/imports.tspackages/core-generators/src/renderers/extractor/plugins/typed-templates-file.tspackages/core-generators/src/renderers/typescript/utils/ts-code-utils.ts
📚 Learning: 2025-10-23T21:01:15.331Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-10-23T21:01:15.331Z
Learning: Applies to examples/todo-with-auth0/{apps/admin/src,apps/backend/src}/**/*.{ts,tsx} : Use `import type` for type-only imports
Applied to files:
packages/core-generators/src/renderers/typescript/imports/merge-ts-import-declarations.tspackages/core-generators/src/renderers/typescript/extractor/render-ts-typed-templates.tsplugins/plugin-auth/src/auth/core/components/auth-definition-editor.tsxpackages/project-builder-server/src/compiler/compile-packages.tspackages/project-builder-web/src/routes/data/models/-hooks/use-model-form.tspackages/core-generators/src/renderers/typescript/fragments/utils.tspackages/code-morph/src/morphers/utils/imports.tsplugins/plugin-auth/src/common/components/auth-config-tabs.tsx
📚 Learning: 2025-10-14T08:07:58.492Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: AGENTS.md:0-0
Timestamp: 2025-10-14T08:07:58.492Z
Learning: Applies to **/*.{ts,tsx} : If a particular interface or type is not exported, update the TypeScript file so it is exported
Applied to files:
packages/core-generators/src/renderers/typescript/imports/merge-ts-import-declarations.tspackages/core-generators/src/renderers/typescript/extractor/render-ts-typed-templates.tspackages/code-morph/src/morphers/utils/imports.tspackages/core-generators/src/renderers/extractor/plugins/typed-templates-file.tspackages/core-generators/src/renderers/typescript/utils/ts-code-utils.ts
📚 Learning: 2025-05-05T06:36:50.687Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 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`.
Applied to files:
packages/core-generators/src/renderers/typescript/imports/merge-ts-import-declarations.tspackages/core-generators/src/test-helpers/utils.tspackages/core-generators/src/renderers/typescript/fragments/utils.tspackages/code-morph/src/morphers/utils/imports.tspackages/core-generators/src/renderers/typescript/utils/ts-code-utils.tspackages/core-generators/src/renderers/typescript/renderers/file.ts
📚 Learning: 2025-10-23T21:00:29.010Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-10-23T21:00:29.010Z
Learning: Applies to examples/blog-with-auth/apps/**/src/**/*.{ts,tsx} : Use `import type` for type-only imports
Applied to files:
packages/core-generators/src/renderers/typescript/imports/merge-ts-import-declarations.tspackages/code-morph/src/morphers/utils/imports.tsplugins/plugin-auth/src/common/components/auth-config-tabs.tsx
📚 Learning: 2025-08-17T01:30:00.344Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 633
File: packages/core-generators/src/renderers/typescript/extractor/apply-simple-replacements.ts:47-48
Timestamp: 2025-08-17T01:30:00.344Z
Learning: In template extraction systems like apply-simple-replacements.ts, it's intentional to skip processing import declarations to allow unused imports to be removed properly after template variable replacements are applied.
Applied to files:
packages/core-generators/src/renderers/typescript/imports/merge-ts-import-declarations.tspackages/core-generators/src/renderers/typescript/extractor/render-ts-typed-templates.tspackages/core-generators/src/renderers/typescript/fragments/utils.tspackages/core-generators/src/renderers/extractor/plugins/template-paths/paths-file.tspackages/core-generators/src/renderers/typescript/extractor/parse-simple-replacements.tspackages/code-morph/src/morphers/utils/imports.tspackages/core-generators/src/renderers/extractor/plugins/typed-templates-file.ts
📚 Learning: 2025-07-22T09:11:16.930Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-22T09:11:16.930Z
Learning: Applies to **/*.{test,test-helper}.{ts,tsx} : Extract repeated logic into reusable helper functions
Applied to files:
packages/core-generators/src/renderers/typescript/imports/merge-ts-import-declarations.tspackages/core-generators/src/test-helpers/utils.ts
📚 Learning: 2025-07-22T09:10:31.413Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-07-22T09:10:31.413Z
Learning: Applies to **/*.{js,ts,tsx} : Node 16 module resolution - include file extensions in imports (`.js`)
Applied to files:
packages/core-generators/src/renderers/typescript/imports/merge-ts-import-declarations.tspackages/utils/src/string/index.tspackages/code-morph/src/morphers/utils/imports.ts
📚 Learning: 2025-07-30T13:27:20.000Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 623
File: plugins/plugin-auth/src/local-auth/core/generators/react-session/templates/src/app/user-session-provider.tsx:6-12
Timestamp: 2025-07-30T13:27:20.000Z
Learning: Ignore ESLint import ordering rules for files in templates/** directories as these are code generation templates, not direct source code.
Applied to files:
packages/core-generators/src/renderers/typescript/imports/merge-ts-import-declarations.tspackages/core-generators/src/renderers/typescript/extractor/render-ts-typed-templates.tspackages/core-generators/src/renderers/typescript/fragments/utils.tspackages/sync/src/templates/metadata/write-template-info-files.tspackages/core-generators/src/renderers/extractor/plugins/template-paths/paths-file.tspackages/core-generators/src/renderers/extractor/plugins/typed-templates-file.ts
📚 Learning: 2025-06-11T18:31:22.247Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 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.
Applied to files:
packages/core-generators/src/renderers/typescript/extractor/render-ts-typed-templates.tspackages/core-generators/src/renderers/extractor/plugins/template-paths/paths-file.tspackages/core-generators/src/renderers/extractor/plugins/typed-templates-file.ts
📚 Learning: 2025-07-22T09:10:31.413Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-07-22T09:10:31.413Z
Learning: Applies to **/*.{ts,tsx} : If a particular interface or type is not exported, change the file so it is exported
Applied to files:
packages/core-generators/src/renderers/typescript/extractor/render-ts-typed-templates.tspackages/core-generators/src/renderers/extractor/plugins/typed-templates-file.ts
📚 Learning: 2025-07-22T09:10:31.413Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-07-22T09:10:31.413Z
Learning: Applies to **/*.{ts,tsx} : TypeScript with strict type checking
Applied to files:
packages/core-generators/src/renderers/typescript/extractor/render-ts-typed-templates.tspackages/project-builder-server/src/compiler/compile-packages.tspackages/code-morph/src/morphers/utils/imports.tspackages/core-generators/src/renderers/typescript/renderers/file.ts
📚 Learning: 2025-07-07T18:24:17.522Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 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.522Z
Learning: Files under templates/** directories can use `// ts-nocheck` because they are templates meant for code generation, not direct type checking.
Applied to files:
packages/core-generators/src/renderers/typescript/extractor/render-ts-typed-templates.tspackages/sync/src/templates/metadata/write-template-info-files.tspackages/core-generators/src/renderers/extractor/plugins/typed-templates-file.ts
📚 Learning: 2025-07-22T09:10:31.413Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-07-22T09:10:31.413Z
Learning: Applies to **/index.{ts,tsx,js} : Prefer barrel exports e.g. export * from './foo.js' instead of individual named exports
Applied to files:
packages/utils/src/string/index.ts
📚 Learning: 2025-01-23T09:12:46.178Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 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.
Applied to files:
packages/utils/src/string/index.tspackages/code-morph/src/morphers/utils/imports.ts
📚 Learning: 2025-07-16T17:15:56.714Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 613
File: packages/react-generators/src/generators/core/react-components/templates/components/ui/circular-progress/circular-progress.tsx:0-0
Timestamp: 2025-07-16T17:15:56.714Z
Learning: For imports starting with `$` (template aliases), do not require `.js` extensions as these are resolved differently during the generation process, unlike regular file imports which require explicit `.js` extensions under Node 16 module resolution.
Applied to files:
packages/utils/src/string/index.tspackages/core-generators/src/renderers/extractor/plugins/template-paths/paths-file.tspackages/code-morph/src/morphers/utils/imports.tspackages/core-generators/src/renderers/extractor/plugins/typed-templates-file.ts
📚 Learning: 2025-10-23T21:01:15.331Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-10-23T21:01:15.331Z
Learning: Applies to examples/todo-with-auth0/{apps/admin/src,apps/backend/src}/**/*.{unit,int}.test.ts : Vitest tests must not use globals; import describe/it/expect from 'vitest'
Applied to files:
packages/utils/src/string/index.tspackages/core-generators/src/test-helpers/utils.tspackages/utils/src/string/compare-strings.unit.test.ts
📚 Learning: 2025-05-08T12:56:59.222Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 539
File: scripts/check-changesets.ts:10-13
Timestamp: 2025-05-08T12:56:59.222Z
Learning: Node.js 22.0.0 and later versions include both `glob` and `globSync` functionality in the core `node:fs` module, making `import { promises as fs, globSync } from 'node:fs';` valid syntax.
Applied to files:
packages/utils/src/string/index.tspackages/sync/src/templates/metadata/write-template-info-files.ts
📚 Learning: 2025-07-22T09:10:31.413Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-07-22T09:10:31.413Z
Learning: Applies to **/*.test.ts : Always import vitest globals explicitly (describe, it, expect)
Applied to files:
packages/utils/src/string/index.tspackages/utils/src/string/compare-strings.unit.test.ts
📚 Learning: 2025-06-03T09:11:29.651Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 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.
Applied to files:
packages/project-builder-server/src/compiler/compile-packages.ts
📚 Learning: 2025-06-30T11:52:28.745Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 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
Applied to files:
packages/core-generators/src/test-helpers/utils.ts
📚 Learning: 2025-07-12T19:56:08.559Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 606
File: plugins/plugin-auth/src/auth/core/generators/auth-apollo/auth-apollo.generator.ts:24-32
Timestamp: 2025-07-12T19:56:08.559Z
Learning: For generator functions and configuration object methods like those in createGeneratorTask, inferred return types are acceptable when the structure is clear from the implementation. ESLint rules handle enforcement of explicit return types where truly needed, so manual review for this is not necessary.
Applied to files:
packages/core-generators/src/generators/node/node-git-ignore/node-git-ignore.generator.ts
📚 Learning: 2025-05-08T12:56:59.222Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 539
File: scripts/check-changesets.ts:10-13
Timestamp: 2025-05-08T12:56:59.222Z
Learning: Node.js 20.12.0 and above include `globSync` in the core `node:fs` module, so `import { promises as fs, globSync } from 'node:fs';` is valid syntax in projects using these Node.js versions.
Applied to files:
packages/sync/src/templates/metadata/write-template-info-files.ts
📚 Learning: 2025-05-08T12:56:23.394Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 539
File: scripts/check-changesets.ts:111-124
Timestamp: 2025-05-08T12:56:23.394Z
Learning: Node.js 22.0.0 and later versions provide native glob functionality via `fs.glob` method in the `node:fs/promises` module, allowing pattern matching without requiring external dependencies.
Applied to files:
packages/sync/src/templates/metadata/write-template-info-files.ts
📚 Learning: 2025-05-08T12:56:23.394Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 539
File: scripts/check-changesets.ts:111-124
Timestamp: 2025-05-08T12:56:23.394Z
Learning: Node.js 22.0.0 and later versions provide native glob functionality via `fs.glob` and `fs.globSync` methods in the `node:fs` module, allowing pattern matching without external dependencies.
Applied to files:
packages/sync/src/templates/metadata/write-template-info-files.ts
📚 Learning: 2025-04-23T06:44:30.952Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 510
File: packages/project-builder-server/src/sync/conflict-file-monitor.test.ts:19-24
Timestamp: 2025-04-23T06:44:30.952Z
Learning: When testing file operations in this codebase, the pattern is to use Vitest automocks for 'node:fs' and 'node:fs/promises' (without explicit implementation replacement) while populating a virtual filesystem with vol.fromJSON() from memfs. File operations in tests are performed directly via vol.promises methods.
Applied to files:
packages/sync/src/templates/metadata/write-template-info-files.ts
📚 Learning: 2025-07-22T09:11:16.930Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-22T09:11:16.930Z
Learning: Applies to **/*.test.{ts,tsx} : For file system operations in tests, use memfs and mock 'node:fs' and 'node:fs/promises'
Applied to files:
packages/sync/src/templates/metadata/write-template-info-files.ts
📚 Learning: 2025-06-30T11:52:28.745Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-06-30T11:52:28.745Z
Learning: Applies to **/*.test.{ts,tsx} : For file system operations in tests, use memfs and mock 'node:fs' and 'node:fs/promises' with vi.mock
Applied to files:
packages/sync/src/templates/metadata/write-template-info-files.ts
📚 Learning: 2025-05-05T06:37:43.106Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 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.
Applied to files:
packages/core-generators/src/renderers/extractor/plugins/template-paths/paths-file.tspackages/core-generators/src/renderers/extractor/plugins/typed-templates-file.ts
📚 Learning: 2025-05-05T06:37:51.001Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 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.
Applied to files:
packages/core-generators/src/renderers/extractor/plugins/template-paths/paths-file.ts
📚 Learning: 2025-07-22T09:10:31.413Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-07-22T09:10:31.413Z
Learning: Applies to **/*.{ts,tsx} : Include absolute paths in import statements via tsconfig paths (`src/` is the alias for `src/`)
Applied to files:
packages/core-generators/src/renderers/extractor/plugins/template-paths/paths-file.tspackages/code-morph/src/morphers/utils/imports.ts
📚 Learning: 2025-04-21T06:32:22.476Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 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.
Applied to files:
packages/core-generators/src/renderers/extractor/plugins/template-paths/paths-file.ts
📚 Learning: 2025-04-21T06:32:22.476Z
Learnt from: kingston
Repo: halfdomelabs/baseplate PR: 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.
Applied to files:
packages/core-generators/src/renderers/extractor/plugins/template-paths/paths-file.ts
📚 Learning: 2025-10-23T21:00:29.010Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-10-23T21:00:29.010Z
Learning: Applies to examples/blog-with-auth/apps/**/src/**/*.@(unit|int).test.ts : Do not use global test APIs; explicitly import test functions from vitest (e.g., describe, it, expect)
Applied to files:
packages/utils/src/string/compare-strings.unit.test.ts
📚 Learning: 2025-07-22T09:10:31.413Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/code-style.mdc:0-0
Timestamp: 2025-07-22T09:10:31.413Z
Learning: Applies to **/*.{unit,int}.test.ts : Unit tests use `.unit.test.ts` suffix, integration tests use `.int.test.ts`
Applied to files:
packages/utils/src/string/compare-strings.unit.test.ts
📚 Learning: 2025-10-23T21:01:15.331Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-10-23T21:01:15.331Z
Learning: Applies to examples/todo-with-auth0/{apps/admin/src,apps/backend/src}/**/*.{unit,int}.test.ts : Name test files with .unit.test.ts or .int.test.ts suffixes
Applied to files:
packages/utils/src/string/compare-strings.unit.test.ts
📚 Learning: 2025-07-22T09:11:16.930Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-22T09:11:16.930Z
Learning: Applies to **/*.unit.test.ts : Unit tests are colocated with source files using `.unit.test.ts` suffix
Applied to files:
packages/utils/src/string/compare-strings.unit.test.ts
📚 Learning: 2025-07-22T09:11:16.930Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/testing.mdc:0-0
Timestamp: 2025-07-22T09:11:16.930Z
Learning: Applies to **/*.int.test.ts : Integration tests use `.int.test.ts` suffix
Applied to files:
packages/utils/src/string/compare-strings.unit.test.ts
📚 Learning: 2025-06-30T11:52:28.745Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-06-30T11:52:28.745Z
Learning: Applies to **/*.unit.test.{ts,tsx} : Unit tests are colocated with source files using `.unit.test.ts` suffix
Applied to files:
packages/utils/src/string/compare-strings.unit.test.ts
📚 Learning: 2025-06-30T11:52:28.745Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: .cursor/rules/tests.mdc:0-0
Timestamp: 2025-06-30T11:52:28.745Z
Learning: Applies to **/*.int.test.{ts,tsx} : Integration tests use `.int.test.ts` suffix
Applied to files:
packages/utils/src/string/compare-strings.unit.test.ts
📚 Learning: 2025-10-23T21:01:15.331Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-10-23T21:01:15.331Z
Learning: Applies to examples/todo-with-auth0/{apps/admin/src,apps/backend/src}/**/*.{unit,int}.test.ts : Collocate tests with source files (tests live under the src tree)
Applied to files:
packages/utils/src/string/compare-strings.unit.test.ts
📚 Learning: 2025-10-23T21:01:15.331Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/todo-with-auth0/CLAUDE.md:0-0
Timestamp: 2025-10-23T21:01:15.331Z
Learning: Applies to examples/todo-with-auth0/{tsconfig*.json,apps/{admin,backend}/tsconfig*.json} : Use TypeScript NodeNext module resolution and module ("moduleResolution": "NodeNext", "module": "NodeNext")
Applied to files:
plugins/plugin-auth/src/common/components/auth-config-tabs.tsx
📚 Learning: 2025-10-23T21:00:29.010Z
Learnt from: CR
Repo: halfdomelabs/baseplate PR: 0
File: examples/blog-with-auth/CLAUDE.md:0-0
Timestamp: 2025-10-23T21:00:29.010Z
Learning: Applies to examples/blog-with-auth/**/tsconfig*.json : Use TypeScript module resolution NodeNext (and matching ESM settings)
Applied to files:
plugins/plugin-auth/src/common/components/auth-config-tabs.tsx
🧬 Code graph analysis (28)
packages/project-builder-web/src/routes/admin-sections.$appKey/-components/react-icon-combobox.tsx (1)
packages/utils/src/string/compare-strings.ts (1)
compareStrings(18-22)
packages/core-generators/src/renderers/typescript/imports/merge-ts-import-declarations.ts (1)
packages/utils/src/string/compare-strings.ts (1)
compareStrings(18-22)
packages/core-generators/src/renderers/typescript/extractor/render-ts-typed-templates.ts (1)
packages/utils/src/string/compare-strings.ts (1)
compareStrings(18-22)
packages/react-generators/src/generators/core/react-router/react-router.generator.ts (1)
packages/utils/src/string/compare-strings.ts (1)
compareStrings(18-22)
packages/fastify-generators/src/generators/core/service-file/service-file.generator.ts (1)
packages/utils/src/string/compare-strings.ts (1)
compareStrings(18-22)
packages/project-builder-web/src/routes/admin-sections.$appKey/-components/new-admin-section-dialog.tsx (1)
packages/utils/src/string/compare-strings.ts (1)
compareStrings(18-22)
packages/utils/src/toposort/toposort.ts (1)
packages/utils/src/string/compare-strings.ts (1)
compareStrings(18-22)
packages/core-generators/src/test-helpers/utils.ts (1)
packages/utils/src/string/compare-strings.ts (1)
compareStrings(18-22)
packages/core-generators/src/generators/node/node-git-ignore/node-git-ignore.generator.ts (1)
packages/utils/src/string/compare-strings.ts (1)
compareStrings(18-22)
packages/core-generators/src/renderers/typescript/fragments/utils.ts (1)
packages/utils/src/string/compare-strings.ts (1)
compareStrings(18-22)
packages/core-generators/src/renderers/text/render-text-typed-templates.ts (1)
packages/utils/src/string/compare-strings.ts (1)
compareStrings(18-22)
packages/project-builder-server/src/templates/list/list-templates.ts (1)
packages/utils/src/string/compare-strings.ts (1)
compareStrings(18-22)
packages/sync/src/templates/metadata/write-template-info-files.ts (1)
packages/utils/src/string/compare-strings.ts (1)
compareStrings(18-22)
packages/utils/src/objects/sort-object-keys.ts (1)
packages/utils/src/string/compare-strings.ts (1)
compareStrings(18-22)
packages/core-generators/src/renderers/extractor/plugins/template-paths/paths-file.ts (1)
packages/utils/src/string/compare-strings.ts (1)
compareStrings(18-22)
packages/utils/src/objects/sort-keys-recursive.ts (1)
packages/utils/src/string/compare-strings.ts (1)
compareStrings(18-22)
packages/core-generators/src/renderers/typescript/extractor/parse-simple-replacements.ts (1)
packages/utils/src/string/compare-strings.ts (1)
compareStrings(18-22)
packages/utils/src/toposort/toposort-local.ts (1)
packages/utils/src/string/compare-strings.ts (1)
compareStrings(18-22)
packages/fastify-generators/src/writers/prisma-schema/model-writer.ts (1)
packages/utils/src/string/compare-strings.ts (1)
compareStrings(18-22)
packages/fastify-generators/src/generators/prisma/prisma-data-service/prisma-data-service.generator.ts (1)
packages/utils/src/string/compare-strings.ts (1)
compareStrings(18-22)
packages/code-morph/src/morphers/utils/imports.ts (1)
packages/utils/src/string/compare-strings.ts (1)
compareStrings(18-22)
packages/utils/src/string/compare-strings.unit.test.ts (1)
packages/utils/src/string/compare-strings.ts (1)
compareStrings(18-22)
packages/core-generators/src/renderers/extractor/plugins/typed-templates-file.ts (1)
packages/utils/src/string/compare-strings.ts (1)
compareStrings(18-22)
packages/project-builder-server/src/diff/snapshot/snapshot-manifest.ts (1)
packages/utils/src/string/compare-strings.ts (1)
compareStrings(18-22)
packages/project-builder-server/src/sync/file-id-map.ts (1)
packages/utils/src/string/compare-strings.ts (1)
compareStrings(18-22)
packages/core-generators/src/renderers/typescript/utils/ts-code-utils.ts (1)
packages/utils/src/string/compare-strings.ts (1)
compareStrings(18-22)
packages/core-generators/src/renderers/typescript/renderers/file.ts (1)
packages/utils/src/string/compare-strings.ts (1)
compareStrings(18-22)
packages/project-builder-server/src/template-extractor/discover-generators.ts (1)
packages/utils/src/string/compare-strings.ts (1)
compareStrings(18-22)
🪛 GitHub Actions: Test
packages/project-builder-server/src/compiler/compile-packages.ts
[error] 38-38: Failed command: tsc -p tsconfig.build.json. TypeScript error: Property 'type' does not exist on type 'never' at src/compiler/compile-packages.ts(38,48).
🪛 GitHub Actions: Verify Examples Sync
packages/project-builder-server/src/compiler/compile-packages.ts
[error] 38-38: tsc -p tsconfig.build.json failed: TS2339: Property 'type' does not exist on type 'never'.
plugins/plugin-queue/src/common/components/queue-config-tabs.tsx
[error] 28-28: TS2339: Property 'implementationPluginKey' does not exist on type '{}'.
⏰ 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). (2)
- GitHub Check: Lint
- GitHub Check: Test E2E
packages/project-builder-server/src/compiler/compile-packages.ts
Outdated
Show resolved
Hide resolved
plugins/plugin-queue/src/common/components/queue-config-tabs.tsx
Outdated
Show resolved
Hide resolved
|
Warning Review the following alerts detected in dependencies. According to your organization's Security Policy, it is recommended to resolve "Warn" alerts. Learn more about Socket for GitHub.
|
Replace String.prototype.localeCompare() with a new compareStrings() utility from @baseplate-dev/utils. This ensures stable, deterministic sorting across different operating systems and locale settings.
Changes:
The localeCompare() method produces different results based on the user's locale and OS configuration, which can lead to inconsistent code generation and merge conflicts. The new compareStrings() function uses simple lexicographic ordering that is stable across all platforms.
Test files continue to use localeCompare() where appropriate for testing purposes.
Summary by CodeRabbit
Release Notes
New Features
test:affectedscript to streamline testing of only affected packagesDocumentation
✏️ Tip: You can customize this high-level summary in your review settings.