Skip to content

Conversation

@kingston
Copy link
Collaborator

@kingston kingston commented Nov 20, 2025

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.

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced a stable string comparison utility providing consistent, locale-independent sorting across all environments
    • Added test:affected script to streamline testing of only affected packages
  • Documentation

    • Added guidance on using stable string comparison for deterministic results

✏️ Tip: You can customize this high-level summary in your review settings.

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-bot
Copy link

changeset-bot bot commented Nov 20, 2025

🦋 Changeset detected

Latest commit: 860e647

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 18 packages
Name Type
@baseplate-dev/core-generators Patch
@baseplate-dev/utils Patch
@baseplate-dev/fastify-generators Patch
@baseplate-dev/project-builder-server Patch
@baseplate-dev/react-generators Patch
@baseplate-dev/plugin-auth Patch
@baseplate-dev/plugin-queue Patch
@baseplate-dev/plugin-storage Patch
@baseplate-dev/code-morph Patch
@baseplate-dev/create-project Patch
@baseplate-dev/project-builder-cli Patch
@baseplate-dev/project-builder-lib Patch
@baseplate-dev/project-builder-test Patch
@baseplate-dev/project-builder-web Patch
@baseplate-dev/sync Patch
@baseplate-dev/ui-components Patch
@baseplate-dev/project-builder-common Patch
@baseplate-dev/tools Patch

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

@kingston kingston changed the title Replace localeCompare with stable string comparison refactor: Replace localeCompare with stable string comparison Nov 20, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 20, 2025

Important

Review skipped

Review was skipped due to path filters

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml

CodeRabbit blocks several paths by default. You can override this behavior by explicitly including those paths in the path filters. For example, including **/dist/** will override the default block on the dist directory, by removing the pattern from both the lists.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This PR introduces a new compareStrings utility function providing locale-independent, deterministic string comparison, and replaces all usages of String.prototype.localeCompare() throughout the codebase with this utility. It also adds a test:affected npm script to support running tests only for affected packages.

Changes

Cohort / File(s) Change Summary
New compareStrings utility
packages/utils/src/string/compare-strings.ts, packages/utils/src/string/compare-strings.unit.test.ts, packages/utils/src/string/index.ts
Adds new compareStrings(a: string, b: string): number function with case-insensitive primary comparison and case-sensitive tiebreaker; includes comprehensive unit tests and re-exports through string index.
Utility package integration
packages/utils/src/objects/sort-object-keys.ts, packages/utils/src/objects/sort-keys-recursive.ts, packages/utils/src/toposort/toposort.ts, packages/utils/src/toposort/toposort-local.ts
Replaces localeCompare with compareStrings in sorting comparators for object keys and topological sort operations.
Code-morph package
packages/code-morph/package.json, packages/code-morph/src/morphers/utils/imports.ts
Adds @baseplate-dev/utils dependency and replaces localeCompare with compareStrings in import name sorting.
Core-generators renderers
packages/core-generators/src/renderers/extractor/plugins/template-paths/paths-file.ts, packages/core-generators/src/renderers/extractor/plugins/typed-templates-file.ts, packages/core-generators/src/renderers/text/render-text-typed-templates.ts, packages/core-generators/src/renderers/typescript/extractor/parse-simple-replacements.ts, packages/core-generators/src/renderers/typescript/extractor/render-ts-typed-templates.ts, packages/core-generators/src/renderers/typescript/fragments/utils.ts, packages/core-generators/src/renderers/typescript/imports/merge-ts-import-declarations.ts, packages/core-generators/src/renderers/typescript/renderers/file.ts, packages/core-generators/src/renderers/typescript/utils/ts-code-utils.ts, packages/core-generators/src/generators/node/node-git-ignore/node-git-ignore.generator.ts, packages/core-generators/src/test-helpers/utils.ts
Replaces localeCompare with compareStrings across multiple renderer and generator files for consistent sorting.
Fastify-generators
packages/fastify-generators/src/generators/core/service-file/service-file.generator.ts, packages/fastify-generators/src/generators/prisma/prisma-data-service/prisma-data-service.generator.ts, packages/fastify-generators/src/writers/prisma-schema/model-writer.ts
Replaces localeCompare with compareStrings for header and field sorting.
Project-builder-server
packages/project-builder-server/src/diff/snapshot/snapshot-manifest.ts, packages/project-builder-server/src/sync/file-id-map.ts, packages/project-builder-server/src/template-extractor/discover-generators.ts, packages/project-builder-server/src/templates/list/list-templates.ts, packages/project-builder-server/src/compiler/root/root-package-compiler.ts
Replaces localeCompare with compareStrings in manifest and template sorting; adds test:affected script.
Project-builder-web
packages/project-builder-web/src/routes/admin-sections.$appKey/-components/new-admin-section-dialog.tsx, packages/project-builder-web/src/routes/admin-sections.$appKey/-components/react-icon-combobox.tsx
Replaces localeCompare with compareStrings in admin section and icon option sorting.
Other generators
packages/react-generators/src/generators/core/react-router/react-router.generator.ts, packages/sync/src/templates/metadata/write-template-info-files.ts
Replaces localeCompare with compareStrings in context field and template info sorting.
Documentation and changesets
.changeset/stable-string-comparison.md, .changeset/quiet-regions-wink.md, AGENTS.md
Adds changeset entry for stable string comparison utility and documentation guidance on using compareStrings instead of localeCompare.
Test script additions
examples/blog-with-auth/package.json, examples/todo-with-auth0/package.json
Adds test:affected npm script mapped to turbo run test --affected.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Note: While the change affects 35+ files, the pattern is highly homogeneous (consistent localeComparecompareStrings replacement across all instances). The new utility function is straightforward and well-tested. Review complexity stems primarily from verifying the repeated replacements are applied correctly throughout the codebase and that all sorting contexts remain correct.
  • Areas requiring extra attention:
    • Verify the compareStrings implementation handles all edge cases correctly (empty strings, case sensitivity expectations, unicode handling)
    • Confirm sorting behavior is deterministic and consistent with prior localeCompare semantics where functionally equivalent
    • Validate that the monorepo scripts and test infrastructure additions work as intended

Possibly related PRs

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly and concisely summarizes the main change: replacing localeCompare with a stable string comparison utility across the codebase.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@vercel
Copy link

vercel bot commented Nov 20, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
baseplate-project-builder-web Ready Ready Preview Comment Nov 25, 2025 10:39pm

Copy link

@coderabbitai coderabbitai bot left a 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: Use compareStrings instead 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 compareStrings consistently:

-    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 compareStrings for all string sorting operations. The file uses sortBy instead of the pattern consistently applied elsewhere (e.g., react-icon-combobox.tsx, new-admin-section-dialog.tsx). Update lines 171-177 to import compareStrings from '@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 clarity

The new use of optional chaining on pluginMetadata?.config makes the comparison safer without relying on a type assertion, and the logic of hasSelectedImplementationChanged remains 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.

📥 Commits

Reviewing files that changed from the base of the PR and between b2b45a3 and 8498217.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is 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 for src/)
If a particular interface or type is not exported, change the file so it is exported

If 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.tsx
  • packages/core-generators/src/renderers/typescript/imports/merge-ts-import-declarations.ts
  • packages/core-generators/src/renderers/typescript/extractor/render-ts-typed-templates.ts
  • plugins/plugin-auth/src/auth/core/components/auth-definition-editor.tsx
  • packages/react-generators/src/generators/core/react-router/react-router.generator.ts
  • packages/utils/src/string/index.ts
  • packages/project-builder-web/src/routes/data/enums/-hooks/use-enum-form.tsx
  • packages/project-builder-server/src/compiler/compile-packages.ts
  • packages/project-builder-web/src/routes/data/models/-hooks/use-model-form.ts
  • packages/fastify-generators/src/generators/core/service-file/service-file.generator.ts
  • plugins/plugin-queue/src/common/components/queue-config-tabs.tsx
  • packages/project-builder-web/src/routes/admin-sections.$appKey/-components/new-admin-section-dialog.tsx
  • packages/utils/src/toposort/toposort.ts
  • packages/core-generators/src/test-helpers/utils.ts
  • packages/core-generators/src/generators/node/node-git-ignore/node-git-ignore.generator.ts
  • packages/core-generators/src/renderers/typescript/fragments/utils.ts
  • packages/core-generators/src/renderers/text/render-text-typed-templates.ts
  • packages/project-builder-server/src/templates/list/list-templates.ts
  • packages/sync/src/templates/metadata/write-template-info-files.ts
  • packages/utils/src/objects/sort-object-keys.ts
  • packages/core-generators/src/renderers/extractor/plugins/template-paths/paths-file.ts
  • packages/utils/src/objects/sort-keys-recursive.ts
  • packages/core-generators/src/renderers/typescript/extractor/parse-simple-replacements.ts
  • packages/utils/src/string/compare-strings.ts
  • packages/utils/src/toposort/toposort-local.ts
  • packages/fastify-generators/src/writers/prisma-schema/model-writer.ts
  • packages/fastify-generators/src/generators/prisma/prisma-data-service/prisma-data-service.generator.ts
  • plugins/plugin-queue/src/queue/core/components/queue-definition-editor.tsx
  • packages/code-morph/src/morphers/utils/imports.ts
  • packages/utils/src/string/compare-strings.unit.test.ts
  • packages/core-generators/src/renderers/extractor/plugins/typed-templates-file.ts
  • packages/project-builder-server/src/diff/snapshot/snapshot-manifest.ts
  • packages/project-builder-server/src/sync/file-id-map.ts
  • packages/core-generators/src/renderers/typescript/utils/ts-code-utils.ts
  • packages/core-generators/src/renderers/typescript/renderers/file.ts
  • packages/project-builder-server/src/template-extractor/discover-generators.ts
  • plugins/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.tsx
  • packages/core-generators/src/renderers/typescript/imports/merge-ts-import-declarations.ts
  • packages/core-generators/src/renderers/typescript/extractor/render-ts-typed-templates.ts
  • plugins/plugin-auth/src/auth/core/components/auth-definition-editor.tsx
  • packages/react-generators/src/generators/core/react-router/react-router.generator.ts
  • packages/utils/src/string/index.ts
  • packages/project-builder-web/src/routes/data/enums/-hooks/use-enum-form.tsx
  • packages/project-builder-server/src/compiler/compile-packages.ts
  • packages/project-builder-web/src/routes/data/models/-hooks/use-model-form.ts
  • packages/fastify-generators/src/generators/core/service-file/service-file.generator.ts
  • plugins/plugin-queue/src/common/components/queue-config-tabs.tsx
  • packages/project-builder-web/src/routes/admin-sections.$appKey/-components/new-admin-section-dialog.tsx
  • packages/utils/src/toposort/toposort.ts
  • packages/core-generators/src/test-helpers/utils.ts
  • packages/core-generators/src/generators/node/node-git-ignore/node-git-ignore.generator.ts
  • packages/core-generators/src/renderers/typescript/fragments/utils.ts
  • packages/core-generators/src/renderers/text/render-text-typed-templates.ts
  • packages/project-builder-server/src/templates/list/list-templates.ts
  • packages/sync/src/templates/metadata/write-template-info-files.ts
  • packages/utils/src/objects/sort-object-keys.ts
  • packages/core-generators/src/renderers/extractor/plugins/template-paths/paths-file.ts
  • packages/utils/src/objects/sort-keys-recursive.ts
  • packages/core-generators/src/renderers/typescript/extractor/parse-simple-replacements.ts
  • packages/utils/src/string/compare-strings.ts
  • packages/utils/src/toposort/toposort-local.ts
  • packages/fastify-generators/src/writers/prisma-schema/model-writer.ts
  • packages/fastify-generators/src/generators/prisma/prisma-data-service/prisma-data-service.generator.ts
  • plugins/plugin-queue/src/queue/core/components/queue-definition-editor.tsx
  • packages/code-morph/src/morphers/utils/imports.ts
  • packages/utils/src/string/compare-strings.unit.test.ts
  • packages/core-generators/src/renderers/extractor/plugins/typed-templates-file.ts
  • packages/project-builder-server/src/diff/snapshot/snapshot-manifest.ts
  • packages/project-builder-server/src/sync/file-id-map.ts
  • packages/core-generators/src/renderers/typescript/utils/ts-code-utils.ts
  • packages/core-generators/src/renderers/typescript/renderers/file.ts
  • packages/project-builder-server/src/template-extractor/discover-generators.ts
  • plugins/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.tsx
  • packages/core-generators/src/renderers/typescript/imports/merge-ts-import-declarations.ts
  • packages/core-generators/src/renderers/typescript/extractor/render-ts-typed-templates.ts
  • plugins/plugin-auth/src/auth/core/components/auth-definition-editor.tsx
  • packages/react-generators/src/generators/core/react-router/react-router.generator.ts
  • packages/utils/src/string/index.ts
  • packages/project-builder-web/src/routes/data/enums/-hooks/use-enum-form.tsx
  • packages/project-builder-server/src/compiler/compile-packages.ts
  • packages/project-builder-web/src/routes/data/models/-hooks/use-model-form.ts
  • packages/fastify-generators/src/generators/core/service-file/service-file.generator.ts
  • plugins/plugin-queue/src/common/components/queue-config-tabs.tsx
  • packages/project-builder-web/src/routes/admin-sections.$appKey/-components/new-admin-section-dialog.tsx
  • packages/utils/src/toposort/toposort.ts
  • packages/core-generators/src/test-helpers/utils.ts
  • packages/core-generators/src/generators/node/node-git-ignore/node-git-ignore.generator.ts
  • packages/core-generators/src/renderers/typescript/fragments/utils.ts
  • packages/core-generators/src/renderers/text/render-text-typed-templates.ts
  • packages/project-builder-server/src/templates/list/list-templates.ts
  • packages/sync/src/templates/metadata/write-template-info-files.ts
  • packages/utils/src/objects/sort-object-keys.ts
  • packages/core-generators/src/renderers/extractor/plugins/template-paths/paths-file.ts
  • packages/utils/src/objects/sort-keys-recursive.ts
  • packages/core-generators/src/renderers/typescript/extractor/parse-simple-replacements.ts
  • packages/utils/src/string/compare-strings.ts
  • packages/utils/src/toposort/toposort-local.ts
  • packages/fastify-generators/src/writers/prisma-schema/model-writer.ts
  • packages/fastify-generators/src/generators/prisma/prisma-data-service/prisma-data-service.generator.ts
  • plugins/plugin-queue/src/queue/core/components/queue-definition-editor.tsx
  • packages/code-morph/src/morphers/utils/imports.ts
  • packages/utils/src/string/compare-strings.unit.test.ts
  • packages/core-generators/src/renderers/extractor/plugins/typed-templates-file.ts
  • packages/project-builder-server/src/diff/snapshot/snapshot-manifest.ts
  • packages/project-builder-server/src/sync/file-id-map.ts
  • packages/core-generators/src/renderers/typescript/utils/ts-code-utils.ts
  • packages/core-generators/src/renderers/typescript/renderers/file.ts
  • packages/project-builder-server/src/template-extractor/discover-generators.ts
  • plugins/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.tsx
  • packages/core-generators/src/renderers/typescript/imports/merge-ts-import-declarations.ts
  • packages/core-generators/src/renderers/typescript/extractor/render-ts-typed-templates.ts
  • plugins/plugin-auth/src/auth/core/components/auth-definition-editor.tsx
  • packages/react-generators/src/generators/core/react-router/react-router.generator.ts
  • packages/utils/src/string/index.ts
  • packages/project-builder-web/src/routes/data/enums/-hooks/use-enum-form.tsx
  • packages/project-builder-server/src/compiler/compile-packages.ts
  • packages/project-builder-web/src/routes/data/models/-hooks/use-model-form.ts
  • packages/fastify-generators/src/generators/core/service-file/service-file.generator.ts
  • plugins/plugin-queue/src/common/components/queue-config-tabs.tsx
  • packages/project-builder-web/src/routes/admin-sections.$appKey/-components/new-admin-section-dialog.tsx
  • packages/utils/src/toposort/toposort.ts
  • packages/core-generators/src/test-helpers/utils.ts
  • packages/core-generators/src/generators/node/node-git-ignore/node-git-ignore.generator.ts
  • packages/core-generators/src/renderers/typescript/fragments/utils.ts
  • packages/code-morph/package.json
  • packages/core-generators/src/renderers/text/render-text-typed-templates.ts
  • packages/project-builder-server/src/templates/list/list-templates.ts
  • packages/sync/src/templates/metadata/write-template-info-files.ts
  • packages/utils/src/objects/sort-object-keys.ts
  • packages/core-generators/src/renderers/extractor/plugins/template-paths/paths-file.ts
  • packages/utils/src/objects/sort-keys-recursive.ts
  • packages/core-generators/src/renderers/typescript/extractor/parse-simple-replacements.ts
  • packages/utils/src/string/compare-strings.ts
  • packages/utils/src/toposort/toposort-local.ts
  • packages/fastify-generators/src/writers/prisma-schema/model-writer.ts
  • packages/fastify-generators/src/generators/prisma/prisma-data-service/prisma-data-service.generator.ts
  • plugins/plugin-queue/src/queue/core/components/queue-definition-editor.tsx
  • packages/code-morph/src/morphers/utils/imports.ts
  • packages/utils/src/string/compare-strings.unit.test.ts
  • packages/core-generators/src/renderers/extractor/plugins/typed-templates-file.ts
  • AGENTS.md
  • packages/project-builder-server/src/diff/snapshot/snapshot-manifest.ts
  • packages/project-builder-server/src/sync/file-id-map.ts
  • packages/core-generators/src/renderers/typescript/utils/ts-code-utils.ts
  • packages/core-generators/src/renderers/typescript/renderers/file.ts
  • packages/project-builder-server/src/template-extractor/discover-generators.ts
  • plugins/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-components and 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 from react-icons/md (Material Design icons) and import them like import { 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.tsx
  • packages/project-builder-web/src/routes/data/enums/-hooks/use-enum-form.tsx
  • packages/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 in className attributes within plugin components MUST be prefixed with the plugin name to avoid style conflicts.
When using utility functions like cn(), all CSS classes passed must also be prefixed with the plugin name.

Files:

  • plugins/plugin-auth/src/auth/core/components/auth-definition-editor.tsx
  • plugins/plugin-queue/src/common/components/queue-config-tabs.tsx
  • plugins/plugin-queue/src/queue/core/components/queue-definition-editor.tsx
  • plugins/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.ts suffix, 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.ts suffix

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.tsx
  • packages/core-generators/src/renderers/typescript/imports/merge-ts-import-declarations.ts
  • packages/core-generators/src/renderers/typescript/extractor/render-ts-typed-templates.ts
  • packages/react-generators/src/generators/core/react-router/react-router.generator.ts
  • packages/project-builder-server/src/compiler/compile-packages.ts
  • packages/project-builder-web/src/routes/admin-sections.$appKey/-components/new-admin-section-dialog.tsx
  • packages/core-generators/src/test-helpers/utils.ts
  • packages/core-generators/src/generators/node/node-git-ignore/node-git-ignore.generator.ts
  • packages/core-generators/src/renderers/typescript/fragments/utils.ts
  • packages/code-morph/package.json
  • packages/core-generators/src/renderers/text/render-text-typed-templates.ts
  • packages/project-builder-server/src/templates/list/list-templates.ts
  • packages/core-generators/src/renderers/extractor/plugins/template-paths/paths-file.ts
  • packages/core-generators/src/renderers/typescript/extractor/parse-simple-replacements.ts
  • packages/fastify-generators/src/generators/prisma/prisma-data-service/prisma-data-service.generator.ts
  • packages/core-generators/src/renderers/extractor/plugins/typed-templates-file.ts
  • AGENTS.md
  • packages/project-builder-server/src/diff/snapshot/snapshot-manifest.ts
  • packages/project-builder-server/src/sync/file-id-map.ts
  • packages/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.tsx
  • plugins/plugin-auth/src/auth/core/components/auth-definition-editor.tsx
  • packages/project-builder-web/src/routes/admin-sections.$appKey/-components/new-admin-section-dialog.tsx
  • plugins/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.ts
  • packages/core-generators/src/renderers/typescript/extractor/render-ts-typed-templates.ts
  • packages/core-generators/src/test-helpers/utils.ts
  • packages/core-generators/src/renderers/typescript/fragments/utils.ts
  • packages/utils/src/objects/sort-object-keys.ts
  • packages/core-generators/src/renderers/typescript/extractor/parse-simple-replacements.ts
  • packages/utils/src/toposort/toposort-local.ts
  • packages/code-morph/src/morphers/utils/imports.ts
  • packages/core-generators/src/renderers/extractor/plugins/typed-templates-file.ts
  • packages/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.ts
  • packages/core-generators/src/renderers/typescript/extractor/render-ts-typed-templates.ts
  • plugins/plugin-auth/src/auth/core/components/auth-definition-editor.tsx
  • packages/project-builder-server/src/compiler/compile-packages.ts
  • packages/project-builder-web/src/routes/data/models/-hooks/use-model-form.ts
  • packages/core-generators/src/renderers/typescript/fragments/utils.ts
  • packages/code-morph/src/morphers/utils/imports.ts
  • plugins/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.ts
  • packages/core-generators/src/renderers/typescript/extractor/render-ts-typed-templates.ts
  • packages/code-morph/src/morphers/utils/imports.ts
  • packages/core-generators/src/renderers/extractor/plugins/typed-templates-file.ts
  • packages/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.ts
  • packages/core-generators/src/test-helpers/utils.ts
  • packages/core-generators/src/renderers/typescript/fragments/utils.ts
  • packages/code-morph/src/morphers/utils/imports.ts
  • packages/core-generators/src/renderers/typescript/utils/ts-code-utils.ts
  • packages/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.ts
  • packages/code-morph/src/morphers/utils/imports.ts
  • plugins/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.ts
  • packages/core-generators/src/renderers/typescript/extractor/render-ts-typed-templates.ts
  • packages/core-generators/src/renderers/typescript/fragments/utils.ts
  • packages/core-generators/src/renderers/extractor/plugins/template-paths/paths-file.ts
  • packages/core-generators/src/renderers/typescript/extractor/parse-simple-replacements.ts
  • packages/code-morph/src/morphers/utils/imports.ts
  • packages/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.ts
  • packages/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.ts
  • packages/utils/src/string/index.ts
  • packages/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.ts
  • packages/core-generators/src/renderers/typescript/extractor/render-ts-typed-templates.ts
  • packages/core-generators/src/renderers/typescript/fragments/utils.ts
  • packages/sync/src/templates/metadata/write-template-info-files.ts
  • packages/core-generators/src/renderers/extractor/plugins/template-paths/paths-file.ts
  • packages/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.ts
  • packages/core-generators/src/renderers/extractor/plugins/template-paths/paths-file.ts
  • packages/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.ts
  • packages/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.ts
  • packages/project-builder-server/src/compiler/compile-packages.ts
  • packages/code-morph/src/morphers/utils/imports.ts
  • packages/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.ts
  • packages/sync/src/templates/metadata/write-template-info-files.ts
  • packages/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.ts
  • packages/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.ts
  • packages/core-generators/src/renderers/extractor/plugins/template-paths/paths-file.ts
  • packages/code-morph/src/morphers/utils/imports.ts
  • packages/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.ts
  • packages/core-generators/src/test-helpers/utils.ts
  • packages/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.ts
  • packages/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.ts
  • packages/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.ts
  • packages/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.ts
  • packages/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

@socket-security
Copy link

socket-security bot commented Nov 25, 2025

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.

Action Severity Alert  (click "▶" to expand/collapse)
Warn High
Publisher changed: npm http-errors is now published by ulisesgascon

Author: ulisesgascon

From: pnpm-lock.yamlnpm/@fastify/[email protected]npm/@modelcontextprotocol/[email protected]npm/[email protected]

ℹ Read more on: This package | This alert | What is unstable ownership?

Next steps: Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at [email protected].

Suggestion: Try to reduce the number of authors you depend on to reduce the risk to malicious actors gaining access to your supply chain. Packages should remove inactive collaborators with publishing rights from packages on npm.

Mark the package as acceptable risk. To ignore this alert only in this pull request, reply with the comment @SocketSecurity ignore npm/[email protected]. You can also ignore all packages with @SocketSecurity ignore-all. To ignore an alert for all future pull requests, use Socket's Dashboard to change the triage state of this alert.

View full report

@kingston kingston merged commit 4be6c7d into main Nov 25, 2025
15 checks passed
@kingston kingston deleted the claude/replace-localecompare-01LKnYaiuuFcGphwweEd1QWF branch November 25, 2025 22:45
@github-actions github-actions bot mentioned this pull request Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants