Skip to content

Conversation

@kingston
Copy link
Collaborator

@kingston kingston commented Jun 23, 2025

Use the schema creator pattern more broadly in preparation for transition zRef

Summary by CodeRabbit

  • New Features

    • Introduced a React hook for dynamic schema creation based on project context.
    • Added a Git post-checkout hook to automate copying environment files for new worktrees.
    • Added a new npm "Watch Build" task with improved TypeScript error reporting in VSCode.
  • Refactor

    • Migrated all schema definitions to context-aware factory functions for dynamic and modular schema creation.
    • Updated type inference utilities and schema-related types for improved type safety and consistency.
    • Replaced static schema imports/usages in forms and components with dynamic hook-based schema retrieval.
  • Bug Fixes

    • Corrected type references and optionality in several schema definitions.
  • Chores

    • Updated TypeScript and Turbo configuration files for better build and typecheck management.
  • Tests

    • Added and updated unit tests for new schema morphers and improved CI compatibility.

@vercel
Copy link

vercel bot commented Jun 23, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
baseplate-project-builder-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 23, 2025 8:26pm

@changeset-bot
Copy link

changeset-bot bot commented Jun 23, 2025

⚠️ No Changeset found

Latest commit: 7c8cc46

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai
Copy link

coderabbitai bot commented Jun 23, 2025

Walkthrough

This update introduces a major refactor of schema definitions and type inference across the codebase. Static Zod schemas are replaced with context-aware factory functions wrapped by definitionSchema, and type inference shifts to a unified def namespace. The changes propagate through project builder libraries, plugins, and web UI, including new hooks for dynamic schema retrieval, updated type signatures, and migration of tests and configuration files to support the new schema creation paradigm.

Changes

File(s) / Group Change Summary
.husky/post-checkout Added a Git post-checkout hook to copy .env files to new worktrees automatically.
.vscode/tasks.json Added a "Watch Build" npm task with a custom problem matcher for TypeScript watch output.
packages/code-morph/src/morphers/definition-schema-wrapper.morpher.ts Added a morpher to wrap exported Zod schemas with a definitionSchema factory and update type inference.
packages/code-morph/src/morphers/definition-schema-wrapper.morpher.unit.test.ts Added unit tests for the new morpher using a shared test helper.
packages/code-morph/src/morphers/tests/definition-schema-wrapper/complex/input.ts
.../output.ts
.../simple/input.ts
.../simple/output.ts
.../with-ctx/input.ts
.../with-ctx/output.ts
Added input/output test cases for the morpher covering complex, simple, and context-aware schemas.
packages/code-morph/src/morphers/tests/morpher.test-helper.ts Test suite now skips in CI environments using describe.skipIf(process.env.CI).
packages/project-builder-lib/src/definition/project-definition-container.ts Updated method type signature to use new type inference utility.
packages/project-builder-lib/src/plugins/spec/config-spec.ts Renamed parameter pluginId to pluginKey throughout interface and implementation.
packages/project-builder-lib/src/schema/apps/admin/app.ts
.../crud-form/admin-crud-input.ts
.../crud-form/admin-input-spec.ts
.../crud-form/built-in-input.ts
.../crud-form/types.ts
.../crud.ts
Refactored all admin app and CRUD schemas from static Zod objects to definitionSchema factory functions; updated type inference and imports accordingly.
packages/project-builder-lib/src/schema/apps/backend/index.ts
.../web/index.ts
Refactored backend and web app schemas to use definitionSchema factories and updated type inference.
packages/project-builder-lib/src/schema/creator/index.ts
.../infer-types.ts
.../types.ts
Added and updated exports for new type inference utilities; removed legacy type inference aliases; set default generic for DefinitionSchemaCreator.
packages/project-builder-lib/src/schema/features/feature.ts
.../theme.ts
Refactored feature and theme schemas to use definitionSchema factories; updated type inference.
packages/project-builder-lib/src/schema/models/enums.ts Refactored enum schemas to factory functions with context; updated types for input/output inference.
packages/project-builder-lib/src/schema/models/graphql.ts Refactored GraphQL model schema to use a factory function and updated type inference.
packages/project-builder-lib/src/schema/models/index.ts Converted all model-related schemas to context-aware factory functions; updated all type aliases and imports.
packages/project-builder-lib/src/schema/models/transformers/built-in-transformers.ts
.../model-transformer-spec.ts
.../transformers.ts
.../types.ts
Refactored transformer schemas and types to use definitionSchema factories and updated type constraints and type inference.
packages/project-builder-lib/src/schema/plugins/definition.ts Refactored plugin schemas to use factory functions and definitionSchema; added new schema for plugins array.
packages/project-builder-lib/src/schema/project-definition.ts Refactored project definition schemas and types to use context-aware schema factories and new type inference utilities.
packages/project-builder-lib/src/schema/settings.ts Updated settings schema to use factory functions for nested schemas and accept context.
packages/project-builder-lib/src/schema/template-extractor/index.ts Refactored template extractor schema to a factory function and updated type inference.
packages/project-builder-lib/src/web/hooks/use-project-definition.ts Added definitionSchemaCreatorOptions property to hook result interface.
packages/project-builder-web/src/app/project-definition-provider/project-definition-provider.tsx Added definitionSchemaCreatorOptions with plugin store to the provided context.
packages/project-builder-web/src/hooks/use-definition-schema.ts Added a new hook to retrieve a memoized schema from a factory using project context.
packages/project-builder-web/src/pages/apps/edit/admin/admin-edit-section-form.tsx
.../admin-general-form.tsx
.../crud/admin-crud-embedded-form.tsx
.../backend-app-form.tsx
.../web-app-form.tsx
Updated forms to use useDefinitionSchema hook with schema factories instead of static schemas.
packages/project-builder-web/src/pages/data/enums/edit/edit.page.tsx
.../hooks/use-enum-form.tsx
Updated enum forms to use dynamic schema via useDefinitionSchema hook.
packages/project-builder-web/src/pages/data/models/_hooks/use-model-form.ts
.../edit/[id]/_components/fields/relations/model-relation-form.tsx
.../edit/[id]/_components/service/service-transformer-form.tsx
.../edit/[id]/graphql.page.ts
.../edit/[id]/index.page.ts
.../edit/[id]/service.page.ts
Updated model forms and related components to use dynamic schema retrieval with useDefinitionSchema.
packages/project-builder-web/src/pages/settings/template-extractor.tsx
.../theme-builder.tsx
Updated settings forms to use schema factories and the useDefinitionSchema hook.
packages/project-builder-web/tsconfig.app.json Changed location of TypeScript incremental build info file.
plugins/plugin-storage/src/storage/admin-crud/types.ts
.../transformers/common.ts
.../transformers/types.ts
Refactored plugin storage schemas to use factory functions and updated type inference.
turbo.json Updated "typecheck" task to specify default inputs.
packages/ui-components/src/stories/typography.mdx Changed import from a TypeScript to a JavaScript stories file.

Sequence Diagram(s)

sequenceDiagram
    participant Component
    participant useDefinitionSchema
    participant ProjectContext
    participant SchemaFactory

    Component->>useDefinitionSchema: Call with SchemaFactory
    useDefinitionSchema->>ProjectContext: Get definitionSchemaCreatorOptions
    useDefinitionSchema->>SchemaFactory: Call with options/context
    SchemaFactory-->>useDefinitionSchema: Returns Zod schema
    useDefinitionSchema-->>Component: Returns memoized schema
    Component->>Component: Use schema for validation, forms, etc.
Loading
sequenceDiagram
    participant Morpher
    participant SourceFile

    Morpher->>SourceFile: Parse for exported Zod schemas
    Morpher->>SourceFile: Rename schema variables to createXSchema
    Morpher->>SourceFile: Wrap schemas with definitionSchema
    Morpher->>SourceFile: Update type inference to def.InferOutput/Input
    Morpher->>SourceFile: Update imports for definitionSchema and def
    Morpher-->>SourceFile: Output transformed source
Loading
✨ Finishing Touches
  • 📝 Generate Docstrings

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

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: 10

🧹 Nitpick comments (7)
.husky/post-checkout (2)

10-10: Remove debug echo statement.

The echo statement appears to be leftover from debugging and should be removed for cleaner output.

-  echo $gitDir

9-11: Consider more robust path resolution.

The current path resolution logic assumes a specific Git worktree directory structure that might be fragile. Consider using a more direct approach to find the main repository.

-  gitDir="$(git rev-parse --git-dir)"                     # e.g., ../.git/worktrees/my-worktree
-  echo $gitDir
-  baseRepoPath="$(cd "$gitDir/../../.." && git rev-parse --show-toplevel)"  # main repo root
+  # More robust way to find the main repo root
+  baseRepoPath="$(git rev-parse --git-common-dir | xargs dirname)"

This approach uses --git-common-dir which directly points to the shared Git directory, making it more reliable across different worktree configurations.

packages/project-builder-web/src/hooks/use-definition-schema.ts (1)

9-17: Consider removing unnecessary type assertion.

The hook implementation is well-structured with proper memoization, but the type assertion as def.InferSchema<T> on line 16 appears unnecessary since useMemo should already infer the correct return type from the schema creator function.

Consider this refactor:

  return useMemo(
    () => schemaCreator(definitionSchemaCreatorOptions),
    [definitionSchemaCreatorOptions, schemaCreator],
-  ) as def.InferSchema<T>;
+  );
packages/code-morph/src/morphers/tests/definition-schema-wrapper/complex/output.ts (1)

3-5: Fix import sorting order.

The imports should be sorted according to the coding guidelines: external libraries first, then local imports. Also ensure proper spacing between import groups.

-import type { def } from '#src/schema/creator/index.js';
-import { definitionSchema } from '#src/schema/creator/schema-creator.js';
-import { z } from 'zod';
+import { z } from 'zod';
+
+import type { def } from '#src/schema/creator/index.js';
+import { definitionSchema } from '#src/schema/creator/schema-creator.js';
packages/code-morph/src/morphers/tests/definition-schema-wrapper/simple/output.ts (1)

3-5: Fix import sorting order.

The imports should follow the coding guidelines: external libraries first, then local imports with proper spacing.

-import type { def } from '#src/schema/creator/index.js';
-import { definitionSchema } from '#src/schema/creator/schema-creator.js';
-import { z } from 'zod';
+import { z } from 'zod';
+
+import type { def } from '#src/schema/creator/index.js';
+import { definitionSchema } from '#src/schema/creator/schema-creator.js';
packages/code-morph/src/morphers/definition-schema-wrapper.morpher.ts (1)

26-26: Consider preserving the original casing pattern.

The current transformation always capitalizes only the first character after "create", which could lead to inconsistent naming. For example:

  • APISchemacreateAPISchema (loses the casing)
  • apiSchemacreateApiSchema

Consider using:

-const newName = `create${name.charAt(0).toUpperCase()}${name.slice(1)}`;
+const newName = `create${name.charAt(0).toUpperCase()}${name.slice(1, -6)}Schema`;

This preserves the original casing pattern of the schema name.

packages/project-builder-lib/src/schema/apps/admin/sections/crud-form/built-in-input.ts (1)

20-31: Consider adding context parameter for consistency.

All schema factory functions in this file are created without the context parameter (ctx), while other files in the PR consistently use definitionSchema((ctx) => ...). Even though these schemas don't currently need context, consider adding it for consistency and future compatibility.

Update all factory functions to include the context parameter:

-export const createAdminCrudTextInputSchema = definitionSchema(() =>
+export const createAdminCrudTextInputSchema = definitionSchema((ctx) =>
   z.object({

Apply similar changes to all other schema factory functions in this file.

Also applies to: 42-56, 67-77, 88-103, 114-129, 140-145

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fd63554 and fc1f361.

📒 Files selected for processing (62)
  • .husky/post-checkout (1 hunks)
  • .vscode/tasks.json (1 hunks)
  • packages/code-morph/src/morphers/definition-schema-wrapper.morpher.ts (1 hunks)
  • packages/code-morph/src/morphers/definition-schema-wrapper.morpher.unit.test.ts (1 hunks)
  • packages/code-morph/src/morphers/tests/definition-schema-wrapper/complex/input.ts (1 hunks)
  • packages/code-morph/src/morphers/tests/definition-schema-wrapper/complex/output.ts (1 hunks)
  • packages/code-morph/src/morphers/tests/definition-schema-wrapper/simple/input.ts (1 hunks)
  • packages/code-morph/src/morphers/tests/definition-schema-wrapper/simple/output.ts (1 hunks)
  • packages/code-morph/src/morphers/tests/definition-schema-wrapper/with-ctx/input.ts (1 hunks)
  • packages/code-morph/src/morphers/tests/definition-schema-wrapper/with-ctx/output.ts (1 hunks)
  • packages/project-builder-lib/src/definition/project-definition-container.ts (2 hunks)
  • packages/project-builder-lib/src/plugins/spec/config-spec.ts (2 hunks)
  • packages/project-builder-lib/src/schema/apps/admin/app.ts (1 hunks)
  • packages/project-builder-lib/src/schema/apps/admin/sections/crud-form/admin-crud-input.ts (1 hunks)
  • packages/project-builder-lib/src/schema/apps/admin/sections/crud-form/admin-input-spec.ts (2 hunks)
  • packages/project-builder-lib/src/schema/apps/admin/sections/crud-form/built-in-input.ts (2 hunks)
  • packages/project-builder-lib/src/schema/apps/admin/sections/crud-form/types.ts (2 hunks)
  • packages/project-builder-lib/src/schema/apps/admin/sections/crud.ts (1 hunks)
  • packages/project-builder-lib/src/schema/apps/backend/index.ts (1 hunks)
  • packages/project-builder-lib/src/schema/apps/web/index.ts (1 hunks)
  • packages/project-builder-lib/src/schema/creator/index.ts (1 hunks)
  • packages/project-builder-lib/src/schema/creator/infer-types.ts (1 hunks)
  • packages/project-builder-lib/src/schema/creator/types.ts (1 hunks)
  • packages/project-builder-lib/src/schema/features/feature.ts (1 hunks)
  • packages/project-builder-lib/src/schema/features/theme.ts (2 hunks)
  • packages/project-builder-lib/src/schema/models/enums.ts (1 hunks)
  • packages/project-builder-lib/src/schema/models/graphql.ts (2 hunks)
  • packages/project-builder-lib/src/schema/models/index.ts (3 hunks)
  • packages/project-builder-lib/src/schema/models/transformers/built-in-transformers.ts (2 hunks)
  • packages/project-builder-lib/src/schema/models/transformers/model-transformer-spec.ts (2 hunks)
  • packages/project-builder-lib/src/schema/models/transformers/transformers.ts (1 hunks)
  • packages/project-builder-lib/src/schema/models/transformers/types.ts (2 hunks)
  • packages/project-builder-lib/src/schema/plugins/definition.ts (1 hunks)
  • packages/project-builder-lib/src/schema/project-definition.ts (1 hunks)
  • packages/project-builder-lib/src/schema/settings.ts (1 hunks)
  • packages/project-builder-lib/src/schema/template-extractor/index.ts (1 hunks)
  • packages/project-builder-lib/src/web/hooks/use-project-definition.ts (2 hunks)
  • packages/project-builder-web/src/app/project-definition-provider/new-project-card.tsx (3 hunks)
  • packages/project-builder-web/src/app/project-definition-provider/project-definition-provider.tsx (2 hunks)
  • packages/project-builder-web/src/hooks/use-definition-schema.ts (1 hunks)
  • packages/project-builder-web/src/pages/apps/edit/admin/admin-edit-section-form.tsx (3 hunks)
  • packages/project-builder-web/src/pages/apps/edit/admin/admin-general-form.tsx (3 hunks)
  • packages/project-builder-web/src/pages/apps/edit/admin/crud/admin-crud-embedded-form.tsx (3 hunks)
  • packages/project-builder-web/src/pages/apps/edit/backend-app-form.tsx (3 hunks)
  • packages/project-builder-web/src/pages/apps/edit/web-app-form.tsx (3 hunks)
  • packages/project-builder-web/src/pages/data/enums/edit/edit.page.tsx (1 hunks)
  • packages/project-builder-web/src/pages/data/enums/hooks/use-enum-form.tsx (3 hunks)
  • packages/project-builder-web/src/pages/data/models/_hooks/use-model-form.ts (3 hunks)
  • packages/project-builder-web/src/pages/data/models/edit/[id]/_components/fields/relations/model-relation-form.tsx (3 hunks)
  • packages/project-builder-web/src/pages/data/models/edit/[id]/_components/service/service-transformer-form.tsx (3 hunks)
  • packages/project-builder-web/src/pages/data/models/edit/[id]/graphql.page.tsx (1 hunks)
  • packages/project-builder-web/src/pages/data/models/edit/[id]/index.page.tsx (3 hunks)
  • packages/project-builder-web/src/pages/data/models/edit/[id]/service.page.tsx (3 hunks)
  • packages/project-builder-web/src/pages/settings/project-settings.tsx (2 hunks)
  • packages/project-builder-web/src/pages/settings/template-extractor.tsx (3 hunks)
  • packages/project-builder-web/src/pages/settings/theme-builder.tsx (2 hunks)
  • packages/project-builder-web/tsconfig.app.json (1 hunks)
  • packages/ui-components/src/stories/Typography.mdx (1 hunks)
  • plugins/plugin-storage/src/storage/admin-crud/types.ts (1 hunks)
  • plugins/plugin-storage/src/storage/transformers/common.ts (2 hunks)
  • plugins/plugin-storage/src/storage/transformers/types.ts (1 hunks)
  • turbo.json (1 hunks)
🧰 Additional context used
📓 Path-based instructions (10)
`**/*.unit.test.ts`: Unit tests must use the '.unit.test.ts' suffix and be colocated with their implementation files.

**/*.unit.test.ts: Unit tests must use the '.unit.test.ts' suffix and be colocated with their implementation files.

  • packages/code-morph/src/morphers/definition-schema-wrapper.morpher.unit.test.ts
`**/*.{ts,tsx,js,jsx}`: Always use kebab-case for file names. Always use '.js' extensions in import statements, even for TypeScript files. Order functions such that functions are p...

**/*.{ts,tsx,js,jsx}: Always use kebab-case for file names.
Always use '.js' extensions in import statements, even for TypeScript files.
Order functions such that functions are placed below the variables/functions they use.
Sort imports by group: external libraries first, then local imports.
Use camelCase for variables and functions, PascalCase for types and classes.
Prefer barrel exports (e.g., export * from './foo.js') instead of individual named exports.
Colocate tests with implementation files.
Include absolute paths in import statements via tsconfig paths (use '@src/' as the alias for 'src/').
Node 16 module resolution: always include file extensions in imports ('.js').

  • packages/code-morph/src/morphers/definition-schema-wrapper.morpher.unit.test.ts
  • packages/project-builder-web/src/pages/apps/edit/admin/admin-edit-section-form.tsx
  • packages/project-builder-lib/src/web/hooks/use-project-definition.ts
  • packages/project-builder-web/src/app/project-definition-provider/project-definition-provider.tsx
  • packages/project-builder-web/src/app/project-definition-provider/new-project-card.tsx
  • packages/project-builder-web/src/pages/data/models/_hooks/use-model-form.ts
  • packages/project-builder-web/src/hooks/use-definition-schema.ts
  • packages/project-builder-web/src/pages/apps/edit/admin/crud/admin-crud-embedded-form.tsx
  • packages/project-builder-web/src/pages/data/models/edit/[id]/_components/service/service-transformer-form.tsx
  • packages/project-builder-web/src/pages/data/enums/hooks/use-enum-form.tsx
  • packages/project-builder-lib/src/schema/apps/admin/sections/crud-form/admin-input-spec.ts
  • plugins/plugin-storage/src/storage/transformers/common.ts
  • packages/project-builder-lib/src/schema/models/transformers/transformers.ts
  • plugins/plugin-storage/src/storage/admin-crud/types.ts
  • packages/project-builder-web/src/pages/data/models/edit/[id]/index.page.tsx
  • packages/project-builder-web/src/pages/data/enums/edit/edit.page.tsx
  • packages/project-builder-web/src/pages/settings/theme-builder.tsx
  • packages/project-builder-web/src/pages/apps/edit/admin/admin-general-form.tsx
  • packages/project-builder-web/src/pages/apps/edit/backend-app-form.tsx
  • packages/project-builder-web/src/pages/data/models/edit/[id]/_components/fields/relations/model-relation-form.tsx
  • packages/project-builder-web/src/pages/settings/template-extractor.tsx
  • packages/code-morph/src/morphers/tests/definition-schema-wrapper/with-ctx/input.ts
  • packages/project-builder-web/src/pages/apps/edit/web-app-form.tsx
  • packages/project-builder-lib/src/schema/apps/admin/sections/crud-form/admin-crud-input.ts
  • plugins/plugin-storage/src/storage/transformers/types.ts
  • packages/project-builder-lib/src/schema/models/transformers/model-transformer-spec.ts
  • packages/project-builder-lib/src/definition/project-definition-container.ts
  • packages/project-builder-lib/src/schema/apps/admin/sections/crud-form/types.ts
  • packages/project-builder-web/src/pages/settings/project-settings.tsx
  • packages/project-builder-lib/src/schema/creator/infer-types.ts
  • packages/project-builder-lib/src/schema/creator/index.ts
  • packages/project-builder-web/src/pages/data/models/edit/[id]/graphql.page.tsx
  • packages/project-builder-web/src/pages/data/models/edit/[id]/service.page.tsx
  • packages/code-morph/src/morphers/tests/definition-schema-wrapper/complex/output.ts
  • packages/project-builder-lib/src/schema/creator/types.ts
  • packages/project-builder-lib/src/schema/template-extractor/index.ts
  • packages/project-builder-lib/src/schema/features/theme.ts
  • packages/project-builder-lib/src/schema/models/transformers/types.ts
  • packages/project-builder-lib/src/schema/apps/backend/index.ts
  • packages/project-builder-lib/src/schema/features/feature.ts
  • packages/code-morph/src/morphers/tests/definition-schema-wrapper/with-ctx/output.ts
  • packages/code-morph/src/morphers/definition-schema-wrapper.morpher.ts
  • packages/code-morph/src/morphers/tests/definition-schema-wrapper/simple/input.ts
  • packages/project-builder-lib/src/schema/apps/web/index.ts
  • packages/project-builder-lib/src/schema/plugins/definition.ts
  • packages/project-builder-lib/src/schema/settings.ts
  • packages/code-morph/src/morphers/tests/definition-schema-wrapper/simple/output.ts
  • packages/project-builder-lib/src/plugins/spec/config-spec.ts
  • packages/project-builder-lib/src/schema/apps/admin/app.ts
  • packages/project-builder-lib/src/schema/models/transformers/built-in-transformers.ts
  • packages/project-builder-lib/src/schema/models/enums.ts
  • packages/project-builder-lib/src/schema/project-definition.ts
  • packages/code-morph/src/morphers/tests/definition-schema-wrapper/complex/input.ts
  • packages/project-builder-lib/src/schema/apps/admin/sections/crud-form/built-in-input.ts
  • packages/project-builder-lib/src/schema/models/graphql.ts
  • packages/project-builder-lib/src/schema/models/index.ts
  • packages/project-builder-lib/src/schema/apps/admin/sections/crud.ts
`**/*.{ts,tsx}`: Always include explicit return types on all top-level functions, including React components. If a particular interface or type is not exported, change the file so ...

**/*.{ts,tsx}: Always include explicit return types on all top-level functions, including React components.
If a particular interface or type is not exported, change the file so it is exported.

  • packages/code-morph/src/morphers/definition-schema-wrapper.morpher.unit.test.ts
  • packages/project-builder-web/src/pages/apps/edit/admin/admin-edit-section-form.tsx
  • packages/project-builder-lib/src/web/hooks/use-project-definition.ts
  • packages/project-builder-web/src/app/project-definition-provider/project-definition-provider.tsx
  • packages/project-builder-web/src/app/project-definition-provider/new-project-card.tsx
  • packages/project-builder-web/src/pages/data/models/_hooks/use-model-form.ts
  • packages/project-builder-web/src/hooks/use-definition-schema.ts
  • packages/project-builder-web/src/pages/apps/edit/admin/crud/admin-crud-embedded-form.tsx
  • packages/project-builder-web/src/pages/data/models/edit/[id]/_components/service/service-transformer-form.tsx
  • packages/project-builder-web/src/pages/data/enums/hooks/use-enum-form.tsx
  • packages/project-builder-lib/src/schema/apps/admin/sections/crud-form/admin-input-spec.ts
  • plugins/plugin-storage/src/storage/transformers/common.ts
  • packages/project-builder-lib/src/schema/models/transformers/transformers.ts
  • plugins/plugin-storage/src/storage/admin-crud/types.ts
  • packages/project-builder-web/src/pages/data/models/edit/[id]/index.page.tsx
  • packages/project-builder-web/src/pages/data/enums/edit/edit.page.tsx
  • packages/project-builder-web/src/pages/settings/theme-builder.tsx
  • packages/project-builder-web/src/pages/apps/edit/admin/admin-general-form.tsx
  • packages/project-builder-web/src/pages/apps/edit/backend-app-form.tsx
  • packages/project-builder-web/src/pages/data/models/edit/[id]/_components/fields/relations/model-relation-form.tsx
  • packages/project-builder-web/src/pages/settings/template-extractor.tsx
  • packages/code-morph/src/morphers/tests/definition-schema-wrapper/with-ctx/input.ts
  • packages/project-builder-web/src/pages/apps/edit/web-app-form.tsx
  • packages/project-builder-lib/src/schema/apps/admin/sections/crud-form/admin-crud-input.ts
  • plugins/plugin-storage/src/storage/transformers/types.ts
  • packages/project-builder-lib/src/schema/models/transformers/model-transformer-spec.ts
  • packages/project-builder-lib/src/definition/project-definition-container.ts
  • packages/project-builder-lib/src/schema/apps/admin/sections/crud-form/types.ts
  • packages/project-builder-web/src/pages/settings/project-settings.tsx
  • packages/project-builder-lib/src/schema/creator/infer-types.ts
  • packages/project-builder-lib/src/schema/creator/index.ts
  • packages/project-builder-web/src/pages/data/models/edit/[id]/graphql.page.tsx
  • packages/project-builder-web/src/pages/data/models/edit/[id]/service.page.tsx
  • packages/code-morph/src/morphers/tests/definition-schema-wrapper/complex/output.ts
  • packages/project-builder-lib/src/schema/creator/types.ts
  • packages/project-builder-lib/src/schema/template-extractor/index.ts
  • packages/project-builder-lib/src/schema/features/theme.ts
  • packages/project-builder-lib/src/schema/models/transformers/types.ts
  • packages/project-builder-lib/src/schema/apps/backend/index.ts
  • packages/project-builder-lib/src/schema/features/feature.ts
  • packages/code-morph/src/morphers/tests/definition-schema-wrapper/with-ctx/output.ts
  • packages/code-morph/src/morphers/definition-schema-wrapper.morpher.ts
  • packages/code-morph/src/morphers/tests/definition-schema-wrapper/simple/input.ts
  • packages/project-builder-lib/src/schema/apps/web/index.ts
  • packages/project-builder-lib/src/schema/plugins/definition.ts
  • packages/project-builder-lib/src/schema/settings.ts
  • packages/code-morph/src/morphers/tests/definition-schema-wrapper/simple/output.ts
  • packages/project-builder-lib/src/plugins/spec/config-spec.ts
  • packages/project-builder-lib/src/schema/apps/admin/app.ts
  • packages/project-builder-lib/src/schema/models/transformers/built-in-transformers.ts
  • packages/project-builder-lib/src/schema/models/enums.ts
  • packages/project-builder-lib/src/schema/project-definition.ts
  • packages/code-morph/src/morphers/tests/definition-schema-wrapper/complex/input.ts
  • packages/project-builder-lib/src/schema/apps/admin/sections/crud-form/built-in-input.ts
  • packages/project-builder-lib/src/schema/models/graphql.ts
  • packages/project-builder-lib/src/schema/models/index.ts
  • packages/project-builder-lib/src/schema/apps/admin/sections/crud.ts
`**/*.test.{ts,tsx,js,jsx}`: Always import vitest globals explicitly (describe, it, expect); do not rely on global availability.

**/*.test.{ts,tsx,js,jsx}: Always import vitest globals explicitly (describe, it, expect); do not rely on global availability.

  • packages/code-morph/src/morphers/definition-schema-wrapper.morpher.unit.test.ts
`**/*.unit.test.ts`: Unit tests must use the `.unit.test.ts` suffix.

**/*.unit.test.ts: Unit tests must use the .unit.test.ts suffix.

  • packages/code-morph/src/morphers/definition-schema-wrapper.morpher.unit.test.ts
`**/*.test.ts`: Always import vitest globals (describe, it, expect) explicitly in test files.

**/*.test.ts: Always import vitest globals (describe, it, expect) explicitly in test files.

  • packages/code-morph/src/morphers/definition-schema-wrapper.morpher.unit.test.ts
`**/*.unit.test.ts`: Unit tests should be colocated with source files and use the `.unit.test.ts` suffix.

**/*.unit.test.ts: Unit tests should be colocated with source files and use the .unit.test.ts suffix.

  • packages/code-morph/src/morphers/definition-schema-wrapper.morpher.unit.test.ts
`plugins/*/**/*.{js,jsx,ts,tsx}`: All CSS classes used in className attributes within plugin components must be prefixed with the plugin name to avoid style conflicts.

plugins/*/**/*.{js,jsx,ts,tsx}: All CSS classes used in className attributes within plugin components must be prefixed with the plugin name to avoid style conflicts.

  • plugins/plugin-storage/src/storage/transformers/common.ts
  • plugins/plugin-storage/src/storage/admin-crud/types.ts
  • plugins/plugin-storage/src/storage/transformers/types.ts
`packages/ui-components/**`: Use ShadCN-based components from '@baseplate-dev/ui-components' for UI development; always prefer these over custom components.

packages/ui-components/**: Use ShadCN-based components from '@baseplate-dev/ui-components' for UI development; always prefer these over custom components.

  • packages/ui-components/src/stories/Typography.mdx
`packages/ui-components/**`: UI components should be implemented as rough analogs of ShadCN components and can be imported from @baseplate-dev/ui-components.

packages/ui-components/**: UI components should be implemented as rough analogs of ShadCN components and can be imported from @baseplate-dev/ui-components.

  • packages/ui-components/src/stories/Typography.mdx
🧬 Code Graph Analysis (40)
packages/code-morph/src/morphers/definition-schema-wrapper.morpher.unit.test.ts (1)
packages/code-morph/src/morphers/tests/morpher.test-helper.ts (1)
  • runMorpherTests (55-112)
packages/project-builder-lib/src/web/hooks/use-project-definition.ts (1)
packages/project-builder-lib/src/schema/creator/types.ts (1)
  • DefinitionSchemaCreatorOptions (5-7)
packages/project-builder-web/src/app/project-definition-provider/project-definition-provider.tsx (1)
packages/project-builder-lib/src/parser/parser.ts (1)
  • createPluginImplementationStore (40-86)
packages/project-builder-web/src/app/project-definition-provider/new-project-card.tsx (2)
packages/project-builder-web/src/hooks/use-definition-schema.ts (1)
  • useDefinitionSchema (9-17)
packages/project-builder-lib/src/schema/settings.ts (1)
  • createGeneralSettingsSchema (11-36)
packages/project-builder-web/src/pages/data/models/_hooks/use-model-form.ts (2)
packages/project-builder-web/src/hooks/use-definition-schema.ts (1)
  • useDefinitionSchema (9-17)
packages/project-builder-lib/src/schema/models/index.ts (1)
  • createModelSchema (310-315)
packages/project-builder-web/src/hooks/use-definition-schema.ts (3)
packages/project-builder-lib/src/schema/creator/types.ts (1)
  • DefinitionSchemaCreator (13-15)
packages/project-builder-lib/src/schema/creator/infer-types.ts (1)
  • InferSchema (5-5)
packages/project-builder-lib/src/web/hooks/use-project-definition.ts (1)
  • useProjectDefinition (80-88)
packages/project-builder-web/src/pages/apps/edit/admin/crud/admin-crud-embedded-form.tsx (2)
packages/project-builder-web/src/hooks/use-definition-schema.ts (1)
  • useDefinitionSchema (9-17)
packages/project-builder-lib/src/schema/apps/admin/sections/crud.ts (1)
  • createAdminCrudEmbeddedFormSchema (109-123)
packages/project-builder-web/src/pages/data/models/edit/[id]/_components/service/service-transformer-form.tsx (2)
packages/project-builder-web/src/hooks/use-definition-schema.ts (1)
  • useDefinitionSchema (9-17)
packages/project-builder-lib/src/schema/models/transformers/transformers.ts (1)
  • createTransformerSchema (7-17)
packages/project-builder-web/src/pages/data/enums/hooks/use-enum-form.tsx (3)
packages/code-morph/src/morphers/tests/definition-schema-wrapper/simple/input.ts (1)
  • enumSchema (12-16)
packages/project-builder-web/src/hooks/use-definition-schema.ts (1)
  • useDefinitionSchema (9-17)
packages/project-builder-lib/src/schema/models/enums.ts (1)
  • createEnumBaseSchema (26-36)
packages/project-builder-lib/src/schema/apps/admin/sections/crud-form/admin-input-spec.ts (1)
packages/project-builder-lib/src/schema/creator/types.ts (1)
  • DefinitionSchemaCreator (13-15)
plugins/plugin-storage/src/storage/transformers/common.ts (1)
plugins/plugin-storage/src/storage/transformers/types.ts (1)
  • createFileTransformerSchema (14-35)
plugins/plugin-storage/src/storage/admin-crud/types.ts (4)
packages/project-builder-lib/src/schema/creator/schema-creator.ts (1)
  • definitionSchema (8-12)
packages/project-builder-lib/src/references/ref-builder.ts (1)
  • zRef (709-719)
packages/project-builder-lib/src/schema/models/types.ts (1)
  • modelTransformerEntityType (27-30)
packages/project-builder-lib/src/schema/creator/infer-types.ts (1)
  • InferInput (7-9)
packages/project-builder-web/src/pages/data/enums/edit/edit.page.tsx (2)
packages/project-builder-web/src/hooks/use-definition-schema.ts (1)
  • useDefinitionSchema (9-17)
packages/project-builder-lib/src/schema/models/enums.ts (1)
  • createEnumBaseSchema (26-36)
packages/project-builder-web/src/pages/settings/theme-builder.tsx (3)
packages/project-builder-lib/src/web/hooks/use-project-definition.ts (1)
  • useProjectDefinition (80-88)
packages/project-builder-web/src/hooks/use-definition-schema.ts (1)
  • useDefinitionSchema (9-17)
packages/project-builder-lib/src/schema/features/theme.ts (1)
  • createThemeSchema (48-59)
packages/project-builder-web/src/pages/apps/edit/admin/admin-general-form.tsx (3)
packages/project-builder-web/src/hooks/use-definition-schema.ts (1)
  • useDefinitionSchema (9-17)
packages/project-builder-lib/src/schema/apps/admin/app.ts (1)
  • createAdminAppSchema (32-46)
packages/project-builder-lib/src/plugins/schema/parser.ts (1)
  • zPluginWrapper (67-72)
packages/project-builder-web/src/pages/data/models/edit/[id]/_components/fields/relations/model-relation-form.tsx (2)
packages/project-builder-web/src/hooks/use-definition-schema.ts (1)
  • useDefinitionSchema (9-17)
packages/project-builder-lib/src/schema/models/index.ts (1)
  • createModelRelationFieldSchema (123-169)
packages/project-builder-web/src/pages/settings/template-extractor.tsx (2)
packages/project-builder-web/src/hooks/use-definition-schema.ts (1)
  • useDefinitionSchema (9-17)
packages/project-builder-lib/src/schema/template-extractor/index.ts (1)
  • createTemplateExtractorSchema (7-24)
packages/project-builder-web/src/pages/apps/edit/web-app-form.tsx (2)
packages/project-builder-web/src/hooks/use-definition-schema.ts (1)
  • useDefinitionSchema (9-17)
packages/project-builder-lib/src/schema/apps/web/index.ts (1)
  • createWebAppSchema (12-30)
packages/project-builder-lib/src/schema/apps/admin/sections/crud-form/admin-crud-input.ts (3)
packages/project-builder-lib/src/schema/creator/schema-creator.ts (1)
  • definitionSchema (8-12)
packages/project-builder-lib/src/schema/apps/admin/sections/crud-form/types.ts (1)
  • baseAdminCrudInputSchema (9-12)
packages/project-builder-lib/src/schema/apps/admin/sections/crud-form/admin-input-spec.ts (1)
  • adminCrudInputSpec (51-53)
plugins/plugin-storage/src/storage/transformers/types.ts (5)
packages/project-builder-lib/src/schema/creator/schema-creator.ts (1)
  • definitionSchema (8-12)
packages/project-builder-lib/src/references/ref-builder.ts (3)
  • zEnt (732-755)
  • zRef (709-719)
  • createDefinitionEntityNameResolver (74-80)
packages/project-builder-lib/src/schema/models/transformers/types.ts (1)
  • baseTransformerFields (7-9)
packages/project-builder-lib/src/schema/models/types.ts (2)
  • modelLocalRelationEntityType (12-15)
  • modelTransformerEntityType (27-30)
packages/project-builder-lib/src/schema/creator/infer-types.ts (1)
  • InferInput (7-9)
packages/project-builder-lib/src/schema/models/transformers/model-transformer-spec.ts (1)
packages/project-builder-lib/src/schema/creator/types.ts (1)
  • DefinitionSchemaCreator (13-15)
packages/project-builder-lib/src/definition/project-definition-container.ts (2)
packages/project-builder-lib/src/references/fix-ref-deletions.ts (1)
  • FixRefDeletionResult (30-32)
packages/project-builder-lib/src/schema/project-definition.ts (1)
  • ProjectDefinitionSchema (58-60)
packages/project-builder-lib/src/schema/apps/admin/sections/crud-form/types.ts (1)
packages/project-builder-lib/src/schema/creator/types.ts (1)
  • DefinitionSchemaCreator (13-15)
packages/project-builder-lib/src/schema/creator/infer-types.ts (1)
packages/project-builder-lib/src/schema/creator/types.ts (1)
  • DefinitionSchemaCreator (13-15)
packages/code-morph/src/morphers/tests/definition-schema-wrapper/complex/output.ts (3)
packages/project-builder-lib/src/schema/creator/schema-creator.ts (1)
  • definitionSchema (8-12)
packages/code-morph/src/morphers/tests/definition-schema-wrapper/complex/input.ts (5)
  • UserRole (19-19)
  • UserConfig (20-20)
  • UserConfigInput (21-21)
  • ProjectConfig (22-22)
  • ProjectConfigInput (23-23)
packages/project-builder-lib/src/schema/creator/infer-types.ts (2)
  • InferOutput (11-13)
  • InferInput (7-9)
packages/project-builder-lib/src/schema/template-extractor/index.ts (2)
packages/project-builder-lib/src/schema/creator/schema-creator.ts (1)
  • definitionSchema (8-12)
packages/project-builder-lib/src/schema/creator/infer-types.ts (1)
  • InferOutput (11-13)
packages/project-builder-lib/src/schema/features/theme.ts (2)
packages/project-builder-lib/src/schema/creator/schema-creator.ts (1)
  • definitionSchema (8-12)
packages/project-builder-lib/src/schema/creator/infer-types.ts (1)
  • InferOutput (11-13)
packages/project-builder-lib/src/schema/apps/backend/index.ts (3)
packages/project-builder-lib/src/schema/creator/schema-creator.ts (1)
  • definitionSchema (8-12)
packages/project-builder-lib/src/schema/apps/base.ts (1)
  • baseAppValidators (6-19)
packages/project-builder-lib/src/schema/creator/infer-types.ts (1)
  • InferOutput (11-13)
packages/project-builder-lib/src/schema/features/feature.ts (4)
packages/utils/src/validators/case-validators.ts (1)
  • CASE_VALIDATORS (23-48)
packages/project-builder-lib/src/schema/creator/schema-creator.ts (1)
  • definitionSchema (8-12)
packages/project-builder-lib/src/references/ref-builder.ts (2)
  • zEnt (732-755)
  • zRef (709-719)
packages/project-builder-lib/src/schema/creator/infer-types.ts (1)
  • InferOutput (11-13)
packages/code-morph/src/morphers/tests/definition-schema-wrapper/with-ctx/output.ts (2)
packages/project-builder-lib/src/schema/creator/schema-creator.ts (1)
  • definitionSchema (8-12)
packages/project-builder-lib/src/schema/creator/infer-types.ts (1)
  • InferOutput (11-13)
packages/project-builder-lib/src/schema/apps/web/index.ts (5)
packages/project-builder-lib/src/schema/creator/schema-creator.ts (1)
  • definitionSchema (8-12)
packages/project-builder-lib/src/schema/apps/base.ts (1)
  • baseAppValidators (6-19)
packages/project-builder-lib/src/references/ref-builder.ts (1)
  • zRef (709-719)
packages/project-builder-lib/src/schema/auth/index.ts (1)
  • authRoleEntityType (3-3)
packages/project-builder-lib/src/schema/creator/infer-types.ts (1)
  • InferOutput (11-13)
packages/project-builder-lib/src/schema/plugins/definition.ts (4)
packages/project-builder-lib/src/schema/creator/schema-creator.ts (1)
  • definitionSchema (8-12)
packages/project-builder-lib/src/schema/plugins/entity-types.ts (1)
  • pluginEntityType (3-3)
packages/project-builder-lib/src/plugins/spec/config-spec.ts (1)
  • pluginConfigSpec (89-91)
packages/project-builder-lib/src/references/ref-builder.ts (1)
  • zEnt (732-755)
packages/project-builder-lib/src/schema/settings.ts (5)
packages/project-builder-lib/src/schema/creator/schema-creator.ts (1)
  • definitionSchema (8-12)
packages/utils/src/validators/case-validators.ts (1)
  • CASE_VALIDATORS (23-48)
packages/project-builder-lib/src/schema/creator/infer-types.ts (2)
  • InferInput (7-9)
  • InferOutput (11-13)
packages/project-builder-lib/src/schema/template-extractor/index.ts (1)
  • createTemplateExtractorSchema (7-24)
packages/project-builder-lib/src/schema/features/theme.ts (1)
  • createThemeSchema (48-59)
packages/project-builder-lib/src/schema/models/transformers/built-in-transformers.ts (5)
packages/project-builder-lib/src/schema/creator/schema-creator.ts (1)
  • definitionSchema (8-12)
packages/project-builder-lib/src/references/ref-builder.ts (3)
  • zEnt (732-755)
  • zRef (709-719)
  • createDefinitionEntityNameResolver (74-80)
packages/project-builder-lib/src/schema/models/transformers/types.ts (2)
  • baseTransformerFields (7-9)
  • createModelTransformerType (27-31)
packages/project-builder-lib/src/schema/models/types.ts (4)
  • modelTransformerEntityType (27-30)
  • modelForeignRelationEntityType (17-20)
  • modelScalarFieldEntityType (5-10)
  • modelEntityType (3-3)
packages/project-builder-lib/src/schema/creator/infer-types.ts (1)
  • InferOutput (11-13)
packages/project-builder-lib/src/schema/project-definition.ts (12)
packages/project-builder-lib/src/schema/creator/schema-creator.ts (1)
  • definitionSchema (8-12)
packages/project-builder-lib/src/references/ref-builder.ts (1)
  • zRefBuilder (696-701)
packages/project-builder-lib/src/schema/apps/backend/index.ts (1)
  • createBackendAppSchema (10-21)
packages/project-builder-lib/src/schema/apps/web/index.ts (1)
  • createWebAppSchema (12-30)
packages/project-builder-lib/src/schema/apps/admin/app.ts (1)
  • createAdminAppSchema (32-46)
packages/project-builder-lib/src/schema/apps/types.ts (1)
  • appEntityType (3-3)
packages/project-builder-lib/src/schema/creator/infer-types.ts (3)
  • InferOutput (11-13)
  • InferInput (7-9)
  • InferSchema (5-5)
packages/project-builder-lib/src/schema/features/feature.ts (1)
  • createFeaturesSchema (40-42)
packages/project-builder-lib/src/schema/models/index.ts (1)
  • createModelSchema (310-315)
packages/project-builder-lib/src/schema/models/enums.ts (1)
  • createEnumSchema (38-43)
packages/project-builder-lib/src/schema/plugins/definition.ts (1)
  • createPluginsSchema (46-48)
packages/project-builder-lib/src/schema/settings.ts (1)
  • createSettingsSchema (46-52)
packages/code-morph/src/morphers/tests/definition-schema-wrapper/complex/input.ts (1)
packages/code-morph/src/morphers/tests/definition-schema-wrapper/complex/output.ts (5)
  • UserRole (27-27)
  • UserConfig (28-28)
  • UserConfigInput (29-29)
  • ProjectConfig (30-30)
  • ProjectConfigInput (31-31)
packages/project-builder-lib/src/schema/apps/admin/sections/crud-form/built-in-input.ts (5)
packages/project-builder-lib/src/schema/creator/schema-creator.ts (1)
  • definitionSchema (8-12)
packages/project-builder-lib/src/references/ref-builder.ts (1)
  • zRef (709-719)
packages/project-builder-lib/src/schema/models/types.ts (3)
  • modelScalarFieldEntityType (5-10)
  • modelLocalRelationEntityType (12-15)
  • modelForeignRelationEntityType (17-20)
packages/project-builder-lib/src/schema/creator/infer-types.ts (1)
  • InferOutput (11-13)
packages/project-builder-lib/src/schema/apps/admin/sections/crud-form/types.ts (2)
  • createAdminCrudInputType (23-27)
  • adminCrudEmbeddedFormEntityType (29-34)
packages/project-builder-lib/src/schema/models/graphql.ts (4)
packages/project-builder-lib/src/schema/creator/schema-creator.ts (1)
  • definitionSchema (8-12)
packages/project-builder-lib/src/references/ref-builder.ts (1)
  • zRef (709-719)
packages/project-builder-lib/src/schema/models/types.ts (3)
  • modelScalarFieldEntityType (5-10)
  • modelLocalRelationEntityType (12-15)
  • modelForeignRelationEntityType (17-20)
packages/project-builder-lib/src/schema/creator/infer-types.ts (2)
  • InferInput (7-9)
  • InferOutput (11-13)
packages/project-builder-lib/src/schema/models/index.ts (8)
packages/project-builder-lib/src/schema/creator/schema-creator.ts (1)
  • definitionSchema (8-12)
packages/project-builder-lib/src/references/ref-builder.ts (5)
  • zEnt (732-755)
  • zRefBuilder (696-701)
  • zRef (709-719)
  • zRefId (26-26)
  • createDefinitionEntityNameResolver (74-80)
packages/project-builder-lib/src/schema/utils/validation.ts (1)
  • VALIDATORS (3-18)
packages/project-builder-lib/src/schema/models/types.ts (8)
  • modelEnumEntityType (32-32)
  • modelEnumValueEntityType (34-36)
  • modelScalarFieldEntityType (5-10)
  • modelForeignRelationEntityType (17-20)
  • modelEntityType (3-3)
  • modelLocalRelationEntityType (12-15)
  • modelUniqueConstraintEntityType (22-25)
  • modelTransformerEntityType (27-30)
packages/project-builder-lib/src/schema/creator/infer-types.ts (2)
  • InferOutput (11-13)
  • InferInput (7-9)
packages/project-builder-lib/src/schema/models/transformers/transformers.ts (1)
  • createTransformerSchema (7-17)
packages/project-builder-lib/src/schema/features/feature.ts (1)
  • featureEntityType (9-9)
packages/project-builder-lib/src/schema/models/graphql.ts (1)
  • createModelGraphqlSchema (24-116)
packages/project-builder-lib/src/schema/apps/admin/sections/crud.ts (7)
packages/project-builder-lib/src/schema/creator/schema-creator.ts (1)
  • definitionSchema (8-12)
packages/project-builder-lib/src/references/ref-builder.ts (2)
  • zRef (709-719)
  • zRefBuilder (696-701)
packages/project-builder-lib/src/schema/models/types.ts (3)
  • modelLocalRelationEntityType (12-15)
  • modelScalarFieldEntityType (5-10)
  • modelEntityType (3-3)
packages/project-builder-lib/src/schema/creator/infer-types.ts (2)
  • InferOutput (11-13)
  • InferInput (7-9)
packages/project-builder-lib/src/schema/apps/admin/sections/crud-form/admin-crud-input.ts (1)
  • createAdminCrudInputSchema (7-17)
packages/project-builder-lib/src/schema/apps/admin/sections/crud-form/types.ts (1)
  • adminCrudEmbeddedFormEntityType (29-34)
packages/project-builder-lib/src/schema/apps/admin/sections/base.ts (1)
  • baseAdminSectionValidators (8-17)
🪛 ESLint
packages/code-morph/src/morphers/tests/definition-schema-wrapper/with-ctx/input.ts

[error] 1-1: Do not use "@ts-nocheck" because it alters compilation errors.

(@typescript-eslint/ban-ts-comment)

packages/code-morph/src/morphers/tests/definition-schema-wrapper/complex/output.ts

[error] 1-1: Do not use "@ts-nocheck" because it alters compilation errors.

(@typescript-eslint/ban-ts-comment)


[error] 4-4: Missed spacing between "#src/schema/creator/index.js" and "#src/schema/creator/schema-creator.js".

(perfectionist/sort-imports)


[error] 5-5: Expected "zod" (value-external) to come before "#src/schema/creator/schema-creator.js" (value-internal).

(perfectionist/sort-imports)

packages/code-morph/src/morphers/tests/definition-schema-wrapper/with-ctx/output.ts

[error] 1-1: Do not use "@ts-nocheck" because it alters compilation errors.

(@typescript-eslint/ban-ts-comment)


[error] 4-4: Missed spacing between "#src/schema/creator/index.js" and "#src/schema/creator/schema-creator.js".

(perfectionist/sort-imports)


[error] 5-5: Expected "zod" (value-external) to come before "#src/schema/creator/schema-creator.js" (value-internal).

(perfectionist/sort-imports)

packages/code-morph/src/morphers/tests/definition-schema-wrapper/simple/input.ts

[error] 1-1: Do not use "@ts-nocheck" because it alters compilation errors.

(@typescript-eslint/ban-ts-comment)

packages/code-morph/src/morphers/tests/definition-schema-wrapper/simple/output.ts

[error] 1-1: Do not use "@ts-nocheck" because it alters compilation errors.

(@typescript-eslint/ban-ts-comment)


[error] 4-4: Missed spacing between "#src/schema/creator/index.js" and "#src/schema/creator/schema-creator.js".

(perfectionist/sort-imports)


[error] 5-5: Expected "zod" (value-external) to come before "#src/schema/creator/schema-creator.js" (value-internal).

(perfectionist/sort-imports)

packages/code-morph/src/morphers/tests/definition-schema-wrapper/complex/input.ts

[error] 1-1: Do not use "@ts-nocheck" because it alters compilation errors.

(@typescript-eslint/ban-ts-comment)

⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: test
  • GitHub Check: Test E2E
  • GitHub Check: Lint
🔇 Additional comments (122)
turbo.json (1)

37-39: Explicit inputs for the typecheck task
Good addition—explicitly specifying ["$TURBO_DEFAULT$"] ensures Turborepo will correctly track dependencies and cache type‐checking, aligning this task with the other cacheable pipelines.

packages/ui-components/src/stories/Typography.mdx (1)

3-3: Switch story import to JavaScript file
The MDX story now imports typography.stories.js instead of the TSX version. Ensure the .js file exists alongside this MDX file and that Storybook picks up the new extension correctly.

.vscode/tasks.json (1)

35-52: LGTM! Well-configured VSCode task for watch mode.

The new "Watch Build" task is properly configured with appropriate problem matching for TypeScript compiler output. The custom regex pattern correctly parses the expected "//:watch:tsc:root:" prefixed output format, capturing all necessary error details for inline IDE reporting.

packages/project-builder-web/tsconfig.app.json (1)

4-4: LGTM! Improved build artifact organization.

Moving the TypeScript build info file to the dist directory aligns with the outDir configuration and consolidates build artifacts in a single location.

plugins/plugin-storage/src/storage/transformers/common.ts (2)

6-6: LGTM! Correct implementation of schema creator pattern.

The import change from static schema to factory function aligns with the broader refactoring goals.


16-16: LGTM! Proper usage of schema factory function.

Using the factory function directly as the schema property is the correct approach for the new pattern.

packages/code-morph/src/morphers/definition-schema-wrapper.morpher.unit.test.ts (1)

1-5: LGTM! Follows established testing patterns.

The test file correctly uses the standard morpher test helper and follows the coding guidelines:

  • Proper .unit.test.ts suffix
  • .js extensions in imports
  • Delegates to the established runMorpherTests helper
packages/project-builder-web/src/pages/apps/edit/admin/admin-edit-section-form.tsx (3)

6-6: LGTM! Correct schema factory import.

Import change from static schema to factory function aligns with the schema creator pattern migration.


27-27: LGTM! Proper hook import.

Import of useDefinitionSchema hook follows the established pattern for dynamic schema usage in React components.


61-61: LGTM! Correct usage of schema hook.

Using useDefinitionSchema with the factory function provides the proper context-aware schema retrieval and memoization.

packages/project-builder-web/src/pages/settings/template-extractor.tsx (3)

3-3: LGTM! Correct factory function import.

Import change from static schema to factory function follows the established schema creator pattern.


24-24: LGTM! Proper hook import.

Import of useDefinitionSchema enables dynamic schema retrieval in React components.


35-37: LGTM! Correct hook usage pattern.

Using useDefinitionSchema with the factory function provides proper memoization and context-aware schema creation.

packages/project-builder-web/src/pages/data/enums/hooks/use-enum-form.tsx (1)

9-9: LGTM: Schema creator pattern implementation is correct.

The refactoring successfully replaces the static enumSchema import with the dynamic createEnumBaseSchema factory function and useDefinitionSchema hook. This change enables context-aware schema creation while maintaining the same functionality.

Also applies to: 25-25, 73-73

packages/project-builder-web/src/pages/apps/edit/admin/admin-general-form.tsx (2)

6-6: LGTM: Schema creator pattern implementation is correct.

The refactoring successfully implements the dynamic schema creation pattern using createAdminAppSchema and useDefinitionSchema hook.

Also applies to: 23-23, 37-37


40-40: Good catch: Dependency array correctly updated.

The useMemo dependency array has been properly updated to include adminAppSchema since it's now dynamically created and used within the memo. This ensures the memo updates when the schema changes.

packages/project-builder-lib/src/web/hooks/use-project-definition.ts (1)

6-6: LGTM: Foundational property added for schema creator pattern.

The addition of definitionSchemaCreatorOptions to the UseProjectDefinitionResult interface provides the necessary foundation for context-aware schema creation. The property is properly typed and well-documented.

Also applies to: 71-74

packages/project-builder-web/src/app/project-definition-provider/new-project-card.tsx (1)

7-7: LGTM: Consistent schema creator pattern implementation.

The refactoring correctly replaces the static generalSettingsSchema with the dynamic createGeneralSettingsSchema factory function and useDefinitionSchema hook, maintaining consistency with the broader refactoring effort.

Also applies to: 18-18, 30-32

packages/project-builder-web/src/pages/apps/edit/admin/crud/admin-crud-embedded-form.tsx (1)

6-6: LGTM: Schema creator pattern implementation is consistent.

The refactoring correctly implements the dynamic schema creation pattern using createAdminCrudEmbeddedFormSchema and useDefinitionSchema hook, maintaining consistency with the broader refactoring effort across the codebase.

Also applies to: 32-32, 108-110

packages/project-builder-web/src/pages/apps/edit/backend-app-form.tsx (1)

4-4: LGTM! Schema creator pattern implemented correctly.

The refactor successfully transitions from static schema import to the new schema creator pattern:

  • Proper import of createBackendAppSchema factory function
  • Correct usage of useDefinitionSchema hook with appropriate imports following coding guidelines
  • Maintains existing form functionality while enabling context-aware schema creation

Also applies to: 18-18, 29-29

packages/project-builder-web/src/pages/apps/edit/web-app-form.tsx (1)

6-6: LGTM! Consistent schema creator pattern implementation.

The refactor correctly transitions the web app form to use the new schema creator pattern:

  • Proper import of createWebAppSchema factory function
  • Correct useDefinitionSchema hook usage with proper import paths
  • Maintains existing form validation logic while enabling dynamic schema creation

Also applies to: 22-22, 33-33

packages/project-builder-web/src/pages/data/enums/edit/edit.page.tsx (1)

3-3: LGTM! Schema creator pattern properly implemented with schema manipulation.

The enum edit page correctly adopts the new schema creator pattern:

  • Proper import of createEnumBaseSchema factory function
  • Correct useDefinitionSchema hook usage following coding guidelines
  • Schema manipulation with .omit() method works seamlessly with the new pattern

Also applies to: 8-8, 15-17

packages/project-builder-web/src/pages/data/models/_hooks/use-model-form.ts (1)

9-9: LGTM! Schema creator pattern integrated with plugin enhancement.

The model form hook successfully transitions to the schema creator pattern:

  • Proper import of createModelSchema factory function
  • Correct useDefinitionSchema hook usage with appropriate imports
  • Seamless integration with existing usePluginEnhancedSchema for plugin-based schema enhancement
  • Maintains complex model form logic while enabling dynamic schema creation

Also applies to: 26-26, 95-96

packages/project-builder-web/src/pages/settings/theme-builder.tsx (1)

5-5: LGTM! Schema creator pattern correctly implemented for theme validation.

The theme builder page successfully adopts the new schema creator pattern:

  • Proper import of createThemeSchema factory function
  • Correct useDefinitionSchema hook usage with proper import paths following coding guidelines
  • Schema integrates seamlessly with existing form validation and theme generation logic
  • Maintains complex theme building functionality while enabling context-aware schema creation

Also applies to: 35-35, 44-44

packages/project-builder-lib/src/schema/creator/index.ts (2)

1-1: LGTM! Clean namespace export for type inference utilities.

The def namespace export provides a clean way to access type inference utilities (InferInput, InferOutput, InferSchema) used throughout the refactored codebase.


5-5: LGTM! Proper type export addition.

Adding the type export from types.js appropriately extends the module's public API.

packages/project-builder-web/src/app/project-definition-provider/project-definition-provider.tsx (2)

9-9: LGTM! Proper import addition for plugin store creation.

The import of createPluginImplementationStore aligns with the schema creator pattern refactoring.


155-160: LGTM! Proper implementation of schema creator options.

The definitionSchemaCreatorOptions correctly provides plugin context to schema creators throughout the application. The implementation properly uses the existing schemaParserContext.pluginStore and definition parameters as expected by createPluginImplementationStore.

packages/project-builder-web/src/pages/data/models/edit/[id]/_components/service/service-transformer-form.tsx (3)

6-6: LGTM! Correct migration to schema creator function.

The import change from static transformerSchema to createTransformerSchema aligns with the schema creator pattern refactoring.


21-21: LGTM! Proper hook import for dynamic schema.

The useDefinitionSchema hook import is necessary for the schema creator pattern implementation.


41-41: LGTM! Correct implementation of dynamic schema creation.

The change from static schema to useDefinitionSchema(createTransformerSchema) properly implements the schema creator pattern with context-aware schema generation.

packages/project-builder-web/src/pages/data/models/edit/[id]/_components/fields/relations/model-relation-form.tsx (3)

11-11: LGTM! Correct migration to schema creator function.

The import change from static modelRelationFieldSchema to createModelRelationFieldSchema aligns with the schema creator pattern refactoring.


35-35: LGTM! Proper hook import for dynamic schema.

The useDefinitionSchema hook import is necessary for the schema creator pattern implementation.


208-210: LGTM! Clean implementation of dynamic schema creation.

The multi-line implementation of useDefinitionSchema(createModelRelationFieldSchema) is clean and properly implements the schema creator pattern with context-aware schema generation.

packages/project-builder-web/src/pages/settings/project-settings.tsx (4)

3-3: LGTM! Correct migration to schema creator function.

The import change from static generalSettingsSchema to createGeneralSettingsSchema aligns with the schema creator pattern refactoring.


20-20: LGTM! Proper hook import for dynamic schema.

The useDefinitionSchema hook import is necessary for the schema creator pattern implementation.


25-27: LGTM! Clean implementation of dynamic schema creation.

The multi-line implementation of useDefinitionSchema(createGeneralSettingsSchema) properly implements the schema creator pattern with context-aware schema generation.


22-22: Add explicit return type annotation.

According to the coding guidelines, all top-level functions including React components should have explicit return types.

Apply this diff to add the explicit return type:

-function ProjectSettingsPage(): React.JSX.Element {
+function ProjectSettingsPage(): React.JSX.Element {

Wait, that's already correct. Let me check again... Actually, the function already has the explicit return type React.JSX.Element. The coding guideline is satisfied.

packages/project-builder-lib/src/schema/apps/admin/sections/crud-form/admin-input-spec.ts (2)

2-2: LGTM! Import aligns with schema creator pattern.

The import of DefinitionSchemaCreator correctly uses the path alias and supports the new schema creation pattern.


14-14: Generic constraint update is consistent with refactoring.

The change from z.ZodTypeAny to DefinitionSchemaCreator properly aligns with the schema creator pattern and maintains type safety.

packages/project-builder-lib/src/schema/apps/admin/sections/crud-form/admin-crud-input.ts (1)

7-17: Schema factory conversion implemented correctly.

The transformation from static schema export to context-aware factory function using definitionSchema is well-implemented. The function properly uses the context parameter and maintains the plugin-based schema retrieval logic.

packages/project-builder-lib/src/schema/models/transformers/model-transformer-spec.ts (2)

2-2: Import change supports the schema creator pattern.

The import of DefinitionSchemaCreator is consistent with the refactoring approach used across the codebase.


14-14: Type constraint updated consistently.

The generic constraint change from z.ZodTypeAny to DefinitionSchemaCreator maintains consistency with the schema creator pattern implementation.

packages/project-builder-web/src/pages/data/models/edit/[id]/index.page.tsx (2)

4-4: Import changes align with schema creator pattern.

The import updates correctly transition from static schema (modelBaseSchema) to factory function (createModelBaseSchema) and include the new useDefinitionSchema hook for dynamic schema usage.

Also applies to: 13-13


33-35: Dynamic schema usage implemented correctly.

The component now properly uses the useDefinitionSchema hook to obtain the schema dynamically, maintaining the same functionality with .omit() while supporting the context-aware schema creation pattern.

packages/project-builder-web/src/pages/data/models/edit/[id]/graphql.page.tsx (1)

3-3: LGTM! Schema creator pattern implemented correctly.

The refactoring successfully transitions from static schema import to dynamic schema creation using the useDefinitionSchema hook. The import changes and hook usage align with the schema creator pattern described in the PR objectives.

Also applies to: 7-7, 16-21

plugins/plugin-storage/src/storage/admin-crud/types.ts (3)

1-1: LGTM! Proper imports for schema creator pattern.

The addition of def type utilities and definitionSchema import correctly supports the new factory-based schema creation approach.

Also applies to: 4-4


10-20: LGTM! Schema successfully converted to factory function.

The schema is properly wrapped with definitionSchema to create a context-aware factory function while preserving the original schema logic and structure.


22-24: LGTM! Type inference updated correctly.

The type alias now uses def.InferInput which is the appropriate utility for inferring input types from schema creator functions.

packages/project-builder-lib/src/schema/models/transformers/transformers.ts (2)

2-2: LGTM! Proper import for schema creator pattern.

The definitionSchema import supports the new factory-based schema creation approach.


7-17: LGTM! Schema converted to context-aware factory function.

The refactoring correctly:

  • Wraps the schema creation in definitionSchema with context parameter
  • Passes context through to transformer.schema(ctx) for dynamic schema creation
  • Maintains the existing zWithPlugins structure and logic
  • Follows the createXSchema naming convention

This enables context-sensitive schema creation in preparation for zRef transition.

packages/project-builder-web/src/pages/data/models/edit/[id]/service.page.tsx (1)

4-4: LGTM! Schema creator pattern implemented correctly.

The refactoring successfully transitions from static schema import to dynamic schema creation using the useDefinitionSchema hook. The changes are consistent with the pattern applied across other components and maintain the existing schema manipulation logic.

Also applies to: 19-19, 33-35

packages/code-morph/src/morphers/tests/definition-schema-wrapper/with-ctx/input.ts (2)

1-1: Verify if @ts-nocheck is necessary for this test case.

The ESLint rule flags the use of @ts-nocheck as it can mask compilation errors. Since this is a test input file for the morpher, please confirm if this directive is required for the test scenario or if it can be removed.

If the directive is not needed for the test case, apply this diff:

-// @ts-nocheck
-

5-15: LGTM! Test schemas are well-structured.

The test input schemas correctly demonstrate:

  • Basic schema definition with baseSchema
  • Schema composition with dependentSchema referencing baseSchema
  • Type inference using z.infer

This provides a good foundation for testing the morpher's ability to transform static schemas into factory functions.

packages/project-builder-lib/src/schema/apps/backend/index.ts (3)

3-5: LGTM! Imports follow coding guidelines.

The new imports for the schema creator pattern are correctly added with proper .js extensions as required by the coding guidelines.


10-21: Schema creator pattern correctly implemented.

The static schema has been successfully converted to a factory function using definitionSchema. The schema logic is preserved exactly with all backend-specific configuration options maintained.


23-23: Type inference correctly updated.

The type inference has been properly updated from z.infer to def.InferOutput, which is appropriate for extracting the output type from the schema creator function.

packages/project-builder-lib/src/schema/features/theme.ts (3)

5-5: LGTM! Imports correctly added.

The new imports for the schema creator pattern follow the coding guidelines with proper .js extensions.

Also applies to: 9-9


48-59: Complex schema correctly refactored to factory pattern.

The theme schema with its nested palettes and colors structure has been successfully wrapped in definitionSchema. The complex object structure including base/primary palettes and light/dark color themes is preserved exactly.


61-61: Type inference appropriately updated.

The ThemeConfig type now correctly uses def.InferOutput to extract the type from the schema creator function.

packages/project-builder-lib/src/schema/creator/types.ts (1)

13-15: Excellent ergonomic improvement with default generic parameter.

Adding the default generic parameter T = z.ZodTypeAny makes the DefinitionSchemaCreator type more convenient to use without requiring explicit type arguments in most cases, while maintaining full backward compatibility.

plugins/plugin-storage/src/storage/transformers/types.ts (3)

1-2: LGTM! Imports correctly added for plugin context.

The imports follow the coding guidelines and correctly reference the external package @baseplate-dev/project-builder-lib.

Also applies to: 6-6


14-35: Complex entity schema correctly refactored.

The file transformer schema with its entity relationships (zEnt, zRef) and cascade delete configuration has been successfully wrapped in the definitionSchema factory function. The schema logic including the file relation reference and entity metadata is preserved exactly.


37-39: ```shell
#!/bin/bash
sed -n '1,200p' plugins/plugin-storage/src/storage/core/schema/plugin-definition.js


</details>
<details>
<summary>packages/project-builder-lib/src/schema/creator/infer-types.ts (1)</summary>

`1-13`: **Excellent utility types for schema creator pattern.**

This module provides clean, well-designed utility types that enable type-safe inference from schema creator functions:

- `InferSchema<T>` extracts the actual Zod schema returned by the creator
- `InferInput<T>` and `InferOutput<T>` properly apply Zod's type inference to handle input/output type differences
- All types are appropriately constrained to `DefinitionSchemaCreator`
- Import follows coding guidelines with `.js` extension

These utilities form the foundation for type-safe usage of the schema creator pattern across the codebase.

</details>
<details>
<summary>packages/project-builder-lib/src/schema/apps/admin/sections/crud-form/types.ts (3)</summary>

`3-3`: **LGTM: Import aligns with schema creator pattern.**

The import of `DefinitionSchemaCreator` type supports the refactoring to the schema creator pattern.

---

`16-21`: **LGTM: Generic constraint updated correctly.**

The constraint change from `z.ZodTypeAny` to `DefinitionSchemaCreator` properly narrows the type to align with the new schema creator pattern, ensuring type safety.

---

`23-27`: **LGTM: Function signature updated consistently.**

The generic constraint change maintains consistency with the interface definition and supports the schema creator pattern refactoring.

</details>
<details>
<summary>packages/project-builder-lib/src/definition/project-definition-container.ts (2)</summary>

`14-14`: **LGTM: Import simplified appropriately.**

The direct import of `ProjectDefinitionSchema` type simplifies the code while maintaining the same semantic meaning as the previous complex type inference.

---

`92-92`: **LGTM: Return type simplified correctly.**

The simplified return type `FixRefDeletionResult<ProjectDefinitionSchema>` is cleaner and equivalent to the previous complex inference pattern.

</details>
<details>
<summary>packages/project-builder-lib/src/schema/template-extractor/index.ts (3)</summary>

`3-5`: **LGTM: Imports added for schema creator pattern.**

The imports correctly support the new schema creator pattern with `definitionSchema` function and `def` type utilities.

---

`7-24`: **LGTM: Schema converted to factory function pattern.**

The conversion from static schema to `definitionSchema`-wrapped factory function follows the established pattern correctly while preserving all validation logic and defaults.

---

`26-28`: **LGTM: Type inference updated appropriately.**

The type definition correctly uses `def.InferOutput` instead of `z.infer`, aligning with the new schema creator pattern.

</details>
<details>
<summary>packages/project-builder-lib/src/schema/apps/web/index.ts (3)</summary>

`3-7`: **LGTM: Imports properly ordered and support schema creator pattern.**

The imports correctly support the new pattern, though consider adjusting the import order to match coding guidelines (external libraries first, then local imports).

---

`12-30`: **LGTM: Web app schema converted correctly.**

The conversion to `definitionSchema`-wrapped factory function preserves all validation logic including the `zRef` usage for role references and maintains all optional fields and their semantics.

---

`32-32`: **LGTM: Type inference updated consistently.**

The type definition correctly uses `def.InferOutput<typeof createWebAppSchema>` following the established pattern.

</details>
<details>
<summary>packages/code-morph/src/morphers/tests/definition-schema-wrapper/with-ctx/output.ts (1)</summary>

`7-21`: **LGTM: Schema creator pattern implemented correctly.**

The examples correctly demonstrate both simple and context-dependent schema creation using `definitionSchema`, with proper context parameter usage and type inference.

</details>
<details>
<summary>packages/code-morph/src/morphers/tests/definition-schema-wrapper/complex/output.ts (2)</summary>

`7-25`: **LGTM! Correct implementation of schema creator pattern.**

The schema creators correctly use the `definitionSchema` wrapper and properly pass context between dependent schemas (e.g., `createUserRoleSchema(ctx)` in `createUserSchema`). This follows the new pattern consistently.

---

`27-31`: **LGTM! Correct type inference using new pattern.**

The type exports correctly use `def.InferOutput` and `def.InferInput` instead of the old `z.infer` and `z.input` pattern, which aligns with the schema creator refactoring.

</details>
<details>
<summary>packages/project-builder-lib/src/schema/models/transformers/types.ts (2)</summary>

`4-5`: **LGTM! Correct imports for new schema creator pattern.**

The new imports properly bring in the `def` namespace for type inference and `DefinitionSchemaCreator` type for generic constraints.

---

`16-18`: **LGTM! Proper transition to schema creator pattern.**

The changes correctly:
- Update generic constraint from `z.ZodTypeAny` to `DefinitionSchemaCreator` for more specific typing
- Change type inference from `z.infer<T>` to `def.InferOutput<T>` to work with schema creators
- Maintain consistency across both interface and function definitions

This aligns perfectly with the schema creator refactoring objectives.




Also applies to: 23-23, 27-27

</details>
<details>
<summary>packages/code-morph/src/morphers/tests/definition-schema-wrapper/simple/input.ts (1)</summary>

`5-20`: **LGTM! Correct test input schemas.**

The static Zod schemas and type definitions correctly represent the "before" state for testing the schema wrapper transformation. The enum schemas are well-structured with appropriate validations.

</details>
<details>
<summary>packages/project-builder-lib/src/schema/plugins/definition.ts (4)</summary>

`5-5`: **LGTM! Correct import for schema creator.**

The new import properly brings in `definitionSchema` for the schema creator pattern.

---

`9-16`: **LGTM! Simplified base schema structure.**

The `basePluginDefinitionSchema` is correctly simplified to a plain `z.object` with the required fields, removing the previous `zEnt` wrapping which is now handled in the schema creator function.

---

`20-44`: **LGTM! Well-implemented schema creator with plugin integration.**

The `createPluginWithConfigSchema` correctly implements the schema creator pattern with sophisticated plugin system integration:

1. Parses base plugin data to extract the ID
2. Derives plugin key using the entity type's `keyFromId` method
3. Dynamically retrieves config schema from the plugin system
4. Applies `zEnt` wrapping for entity associations
5. Conditionally extends with config schema when available

This maintains the dynamic behavior while transitioning to the new pattern.

---

`46-48`: **LGTM! Consistent array schema creator.**

The `createPluginsSchema` correctly implements an array of plugins using the context-aware pattern, properly passing the context to the nested schema creator.

</details>
<details>
<summary>packages/code-morph/src/morphers/tests/definition-schema-wrapper/simple/output.ts (2)</summary>

`7-22`: **LGTM! Correct schema creator implementation.**

The enum schema creators properly implement the new pattern:
- `createEnumValueSchema` uses `definitionSchema` without context (no dependencies)
- `createEnumSchema` correctly passes context to the nested `createEnumValueSchema(ctx)` call
- Schema validation logic is preserved from the input version

---

`14-14`: **LGTM! Proper type inference with new pattern.**

The type exports correctly use `def.InferOutput` and `def.InferInput` instead of the legacy `z.infer` and `z.input`, aligning with the schema creator refactoring.




Also applies to: 24-24, 26-26

</details>
<details>
<summary>packages/project-builder-lib/src/schema/features/feature.ts (4)</summary>

`4-7`: **Import statements follow the correct pattern.**

The imports are properly organized with external libraries (zod) first, followed by local imports. The '.js' extension is correctly included in the import paths as per the coding guidelines.

---

`13-36`: **Schema transformation correctly implements the factory pattern.**

The schema has been properly wrapped with `definitionSchema` while preserving all validation logic and entity references. The function doesn't use the context parameter, which is correct since this schema doesn't reference other schemas.

---

`38-38`: **Type inference correctly updated to use the factory pattern.**

The type now properly uses `def.InferOutput` with the factory function, maintaining type safety while following the new schema pattern.

---

`40-42`: **Context parameter correctly propagated.**

The `createFeaturesSchema` properly accepts and passes the context parameter to `createFeatureSchema`, following the established pattern for schema composition.

</details>
<details>
<summary>packages/project-builder-lib/src/schema/models/graphql.ts (3)</summary>

`3-6`: **Imports correctly follow the established pattern.**

The imports are properly organized and include the required '.js' extensions as per the coding guidelines.

---

`24-116`: **Schema transformation correctly implements the factory pattern with improved type safety.**

The refactoring properly wraps the schema with `definitionSchema` and includes important corrections:
- Fixed the entity type reference for fields to `modelScalarFieldEntityType`
- Explicitly marked `localRelations` and `foreignRelations` as optional
- Preserved all default values and structure

These changes improve type safety and correctness.

---

`118-122`: **Type exports correctly updated for the factory pattern.**

Both input and output types now properly use the `def` inference utilities with the factory function.

</details>
<details>
<summary>packages/code-morph/src/morphers/definition-schema-wrapper.morpher.ts (1)</summary>

`147-161`: **Import management correctly handles conditional imports.**

The logic properly adds imports only when needed. Note that the import paths are project-specific and would need adjustment if the project structure changes.

</details>
<details>
<summary>packages/project-builder-lib/src/schema/apps/admin/app.ts (3)</summary>

`16-24`: **Admin section schema correctly implements the factory pattern.**

The schema properly accepts and passes the context parameter to `createAdminCrudSectionSchema`, maintaining the reference builder configuration.

---

`32-46`: **Admin app schema properly propagates context.**

The schema correctly passes the context parameter to nested schema factories while preserving all validation logic and references.

---

`28-30`: **Type inference correctly updated.**

Both input and output types properly use the `def` inference utilities with the respective factory functions.



Also applies to: 48-48

</details>
<details>
<summary>packages/project-builder-lib/src/plugins/spec/config-spec.ts (1)</summary>

`50-74`: **Implementation correctly uses consistent naming.**

The implementation properly uses `pluginKey` throughout all methods, error messages, and map operations.

</details>
<details>
<summary>packages/project-builder-lib/src/schema/settings.ts (4)</summary>

`4-6`: **LGTM! Clean import additions for the schema creator pattern.**

The imports follow the coding guidelines with proper absolute paths using '#src/' alias and '.js' extensions.

---

`11-36`: **LGTM! Proper conversion to schema factory pattern.**

The `generalSettingsSchema` has been correctly converted to `createGeneralSettingsSchema` factory function wrapped with `definitionSchema`. The schema logic remains unchanged while enabling context-aware creation.

---

`38-44`: **LGTM! Correct type inference updates.**

The type aliases properly use `def.InferInput` and `def.InferOutput` with the factory function, maintaining type safety while adapting to the new pattern.

---

`46-52`: **LGTM! Consistent factory function usage.**

The `createSettingsSchema` properly passes the context parameter to all nested factory functions, ensuring consistent behavior across the schema hierarchy.

</details>
<details>
<summary>packages/project-builder-lib/src/schema/models/transformers/built-in-transformers.ts (5)</summary>

`3-3`: **LGTM! Proper imports for schema creator pattern.**

The imports correctly add the `def` types and `definitionSchema` utility with proper file extensions.



Also applies to: 10-10

---

`20-32`: **LGTM! Clean conversion of password transformer schema.**

The `passwordTransformerSchema` is properly converted to a factory function with `definitionSchema` wrapper. The schema structure with `zEnt` and entity metadata is preserved correctly.

---

`38-81`: **LGTM! Proper handling of complex embedded relation schema.**

The conversion correctly moves the complex schema logic including the `getNameResolver` function inside the factory function. The reference builder and entity relationships are maintained properly.

---

`34-36`: **LGTM! Correct type inference updates.**

Type aliases properly use `def.InferOutput` with the new factory functions.



Also applies to: 83-85

---

`90-90`: **LGTM! Consistent factory function references.**

The `BUILT_IN_TRANSFORMERS` array correctly references the new factory functions instead of static schemas.



Also applies to: 95-95

</details>
<details>
<summary>packages/code-morph/src/morphers/tests/definition-schema-wrapper/complex/input.ts (1)</summary>

`3-23`: **LGTM! Appropriate test input structure.**

The test input correctly demonstrates the "before" state with static Zod schemas and traditional type inference patterns that the morpher should transform.

</details>
<details>
<summary>packages/project-builder-lib/src/schema/models/enums.ts (4)</summary>

`3-3`: **LGTM! Proper imports for schema creator pattern.**

Imports correctly add necessary types and utilities with proper file extensions.



Also applies to: 6-6

---

`11-22`: **LGTM! Proper enum value schema factory.**

The `createEnumValueSchema` factory correctly wraps the enum value schema with proper entity metadata.

---

`26-36`: **LGTM! Proper enum schema factories.**

Both `createEnumBaseSchema` and `createEnumSchema` are correctly implemented with proper context passing and entity metadata.



Also applies to: 38-43

---

`45-47`: **LGTM! Correct type inference for enum config.**

The final enum configuration types properly use `def.InferOutput` and `def.InferInput` with the full enum schema.

</details>
<details>
<summary>packages/project-builder-lib/src/schema/project-definition.ts (6)</summary>

`5-5`: **LGTM! Proper type import addition.**

The `def` types import uses correct absolute path and file extension.

---

`7-9`: **LGTM! Consistent factory function imports.**

All schema imports have been correctly updated to reference the new factory functions with proper file paths and extensions.



Also applies to: 12-15

---

`18-32`: **LGTM! Proper app schema factory with discriminated union.**

The `createAppSchema` factory correctly maintains the discriminated union structure while passing context to all constituent app schemas. The `zRefBuilder` usage with entity metadata is properly preserved.

---

`34-34`: **LGTM! Correct app config type inference.**

The `AppConfig` type properly uses `def.InferOutput` with the factory function.

---

`39-46`: **LGTM! Consistent factory function usage in project schema.**

The project definition schema correctly passes context to all nested factory functions, maintaining the schema composition hierarchy.

---

`50-60`: **LGTM! Complete type inference migration.**

All exported types properly use the new `def.InferInput`, `def.InferOutput`, and `def.InferSchema` utilities, maintaining consistency with the schema creator pattern.

</details>
<details>
<summary>packages/project-builder-lib/src/schema/apps/admin/sections/crud.ts (1)</summary>

`1-166`: **Schema creator pattern properly implemented.**

The refactoring correctly implements the schema creator pattern with proper context parameter usage throughout. Complex schemas appropriately use `zRefBuilder` for entity management, and discriminated unions correctly pass context to child schemas.

</details>
<details>
<summary>packages/project-builder-lib/src/schema/models/index.ts (1)</summary>

`1-320`: **Excellent implementation of the schema creator pattern.**

The refactoring demonstrates proper use of:
- Context parameter consistently passed to all nested schemas
- Complex validation logic and transformations preserved
- Advanced features like custom entity name resolvers
- Proper entity and reference management with `zEnt` and `zRefBuilder`

The code maintains all existing functionality while enabling dynamic schema creation.

</details>

</blockquote></details>

</details>

<!-- This is an auto-generated comment by CodeRabbit for review status -->

Comment on lines +19 to +21
if [[ -f "$src" ]]; then
cp "$src" "$dest"
echo "Copied $src$dest"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Add error handling for copy operations.

The script should handle potential copy failures more gracefully and provide better feedback.

    if [[ -f "$src" ]]; then
-      cp "$src" "$dest"
-      echo "Copied $src → $dest"
+      if cp "$src" "$dest" 2>/dev/null; then
+        echo "Copied $src → $dest"
+      else
+        echo "Failed to copy $src to $dest" >&2
+      fi
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
if [[ -f "$src" ]]; then
cp "$src" "$dest"
echo "Copied $src → $dest"
if [[ -f "$src" ]]; then
if cp "$src" "$dest" 2>/dev/null; then
echo "Copied $src → $dest"
else
echo "Failed to copy $src to $dest" >&2
fi
🤖 Prompt for AI Agents
In .husky/post-checkout around lines 19 to 21, the copy operation lacks error
handling, which can cause silent failures. Modify the script to check the exit
status of the cp command immediately after it runs, and if it fails, output an
error message indicating the failure and optionally exit with a non-zero status
to signal the error. This will provide clearer feedback and improve robustness.

@@ -0,0 +1,21 @@
// @ts-nocheck
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove @ts-nocheck directive.

The @ts-nocheck directive should be removed as it suppresses TypeScript compilation errors that should be addressed.

-// @ts-nocheck
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// @ts-nocheck
🧰 Tools
🪛 ESLint

[error] 1-1: Do not use "@ts-nocheck" because it alters compilation errors.

(@typescript-eslint/ban-ts-comment)

🤖 Prompt for AI Agents
In
packages/code-morph/src/morphers/tests/definition-schema-wrapper/with-ctx/output.ts
at line 1, remove the @ts-nocheck directive to allow TypeScript to report
compilation errors. After removing it, fix any TypeScript errors that appear to
ensure the code type-checks correctly.

Comment on lines +3 to +5
import type { def } from '#src/schema/creator/index.js';
import { definitionSchema } from '#src/schema/creator/schema-creator.js';
import { z } from 'zod';
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Fix import ordering to follow coding guidelines.

The imports should be reordered according to the coding guidelines: external libraries first, then local imports with proper spacing.

-import type { def } from '#src/schema/creator/index.js';
-import { definitionSchema } from '#src/schema/creator/schema-creator.js';
-import { z } from 'zod';
+import { z } from 'zod';
+
+import type { def } from '#src/schema/creator/index.js';
+import { definitionSchema } from '#src/schema/creator/schema-creator.js';
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
import type { def } from '#src/schema/creator/index.js';
import { definitionSchema } from '#src/schema/creator/schema-creator.js';
import { z } from 'zod';
import { z } from 'zod';
import type { def } from '#src/schema/creator/index.js';
import { definitionSchema } from '#src/schema/creator/schema-creator.js';
🧰 Tools
🪛 ESLint

[error] 4-4: Missed spacing between "#src/schema/creator/index.js" and "#src/schema/creator/schema-creator.js".

(perfectionist/sort-imports)


[error] 5-5: Expected "zod" (value-external) to come before "#src/schema/creator/schema-creator.js" (value-internal).

(perfectionist/sort-imports)

🤖 Prompt for AI Agents
In
packages/code-morph/src/morphers/tests/definition-schema-wrapper/with-ctx/output.ts
around lines 3 to 5, the import statements are not ordered correctly. Reorder
the imports to place external libraries like 'zod' first, followed by local
imports such as '#src/schema/creator/index.js' and
'#src/schema/creator/schema-creator.js', ensuring proper spacing between these
groups according to the coding guidelines.

@@ -0,0 +1,31 @@
// @ts-nocheck
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove @ts-nocheck directive.

The @ts-nocheck directive disables TypeScript compilation errors entirely, which can hide real issues. If there are specific TypeScript errors that need to be suppressed, use more targeted directives like @ts-expect-error with explanatory comments.

-// @ts-nocheck
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// @ts-nocheck
🧰 Tools
🪛 ESLint

[error] 1-1: Do not use "@ts-nocheck" because it alters compilation errors.

(@typescript-eslint/ban-ts-comment)

🤖 Prompt for AI Agents
In
packages/code-morph/src/morphers/tests/definition-schema-wrapper/complex/output.ts
at line 1, remove the @ts-nocheck directive to enable TypeScript error checking.
If there are specific errors that need to be suppressed, replace @ts-nocheck
with targeted directives like @ts-expect-error and add comments explaining why
the suppression is necessary.

@@ -0,0 +1,20 @@
// @ts-nocheck
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove @ts-nocheck directive.

The @ts-nocheck directive disables TypeScript compilation errors entirely. Even in test files, this can hide real issues. Consider removing it or using more targeted directives if specific suppressions are needed.

-// @ts-nocheck
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// @ts-nocheck
🧰 Tools
🪛 ESLint

[error] 1-1: Do not use "@ts-nocheck" because it alters compilation errors.

(@typescript-eslint/ban-ts-comment)

🤖 Prompt for AI Agents
In
packages/code-morph/src/morphers/tests/definition-schema-wrapper/simple/input.ts
at line 1, remove the @ts-nocheck directive to enable TypeScript to report
compilation errors. If there are specific errors you want to suppress, replace
it with more targeted directives instead of disabling all checks.

@@ -0,0 +1,26 @@
// @ts-nocheck
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove @ts-nocheck directive.

The @ts-nocheck directive disables TypeScript compilation errors entirely, which can hide real issues. Remove this directive to ensure proper type checking.

-// @ts-nocheck
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// @ts-nocheck
🧰 Tools
🪛 ESLint

[error] 1-1: Do not use "@ts-nocheck" because it alters compilation errors.

(@typescript-eslint/ban-ts-comment)

🤖 Prompt for AI Agents
In
packages/code-morph/src/morphers/tests/definition-schema-wrapper/simple/output.ts
at line 1, remove the @ts-nocheck directive to enable TypeScript to perform
proper type checking and catch potential errors.

Comment on lines +70 to +77
const regex = new RegExp(`\\b${newSchemaName}\\b`, 'g');
if (regex.test(schemaText)) {
needsCtx = true;

// Replace references with new name + (ctx)
schemaText = schemaText.replace(regex, `${newSchemaName}(ctx)`);
}
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Schema reference replacement could match unintended occurrences.

The regex replacement might match schema names in strings, comments, or as parts of other identifiers. Consider using TypeScript's AST manipulation instead of text replacement for more reliable transformations.

Example of potential issues:

  • Comments: // Using createUserSchema here
  • Strings: "The createUserSchema function"
  • Partial matches in longer names: createUserSchemaValidator
🤖 Prompt for AI Agents
In packages/code-morph/src/morphers/definition-schema-wrapper.morpher.ts around
lines 70 to 77, the current regex-based schema name replacement risks matching
unintended text like comments, strings, or partial identifiers. To fix this,
replace the regex text replacement with TypeScript AST manipulation: parse the
schemaText into an AST, traverse it to find exact identifier nodes matching
newSchemaName, and update those nodes to include (ctx). This ensures only valid
schema references are transformed without affecting comments or strings.

Comment on lines 23 to 24
getMigrations(pluginId: string): PluginConfigMigration[] | undefined;
getLastMigrationVersion(pluginId: string): number | undefined;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Fix inconsistent parameter naming.

The getMigrations and getLastMigrationVersion methods still use pluginId as the parameter name while all other methods and their implementations use pluginKey. This inconsistency should be fixed.

-  getMigrations(pluginId: string): PluginConfigMigration[] | undefined;
-  getLastMigrationVersion(pluginId: string): number | undefined;
+  getMigrations(pluginKey: string): PluginConfigMigration[] | undefined;
+  getLastMigrationVersion(pluginKey: string): number | undefined;
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
getMigrations(pluginId: string): PluginConfigMigration[] | undefined;
getLastMigrationVersion(pluginId: string): number | undefined;
getMigrations(pluginKey: string): PluginConfigMigration[] | undefined;
getLastMigrationVersion(pluginKey: string): number | undefined;
🤖 Prompt for AI Agents
In packages/project-builder-lib/src/plugins/spec/config-spec.ts at lines 23 to
24, the parameter name for the methods getMigrations and getLastMigrationVersion
is inconsistent with other methods; it uses pluginId instead of pluginKey.
Rename the parameter from pluginId to pluginKey in both method signatures to
maintain consistency across the codebase.

@@ -0,0 +1,23 @@
// @ts-nocheck
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

Remove @ts-nocheck directive.

The ESLint rule correctly flags this directive as problematic since it suppresses TypeScript compilation errors. For test files, prefer targeted suppressions or fix the underlying TypeScript issues.

-// @ts-nocheck
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
// @ts-nocheck
🧰 Tools
🪛 ESLint

[error] 1-1: Do not use "@ts-nocheck" because it alters compilation errors.

(@typescript-eslint/ban-ts-comment)

🤖 Prompt for AI Agents
In
packages/code-morph/src/morphers/tests/definition-schema-wrapper/complex/input.ts
at line 1, remove the @ts-nocheck directive to avoid suppressing all TypeScript
errors. Instead, address the specific TypeScript issues in the file or use
targeted suppression comments only where necessary.

kingston added 2 commits June 23, 2025 22:21
+ They are often lagging behind (probably because CI is substantially slower)
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: 1

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 010095f and 7c8cc46.

📒 Files selected for processing (3)
  • packages/code-morph/src/morphers/tests/morpher.test-helper.ts (1 hunks)
  • packages/project-builder-lib/src/schema/models/enums.ts (1 hunks)
  • packages/ui-components/src/stories/typography.mdx (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • packages/ui-components/src/stories/typography.mdx
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/project-builder-lib/src/schema/models/enums.ts
🧰 Additional context used
📓 Path-based instructions (2)
`**/*.{ts,tsx,js,jsx}`: Always use kebab-case for file names. Always use '.js' extensions in import statements, even for TypeScript files. Order functions such that functions are p...

**/*.{ts,tsx,js,jsx}: Always use kebab-case for file names.
Always use '.js' extensions in import statements, even for TypeScript files.
Order functions such that functions are placed below the variables/functions they use.
Sort imports by group: external libraries first, then local imports.
Use camelCase for variables and functions, PascalCase for types and classes.
Prefer barrel exports (e.g., export * from './foo.js') instead of individual named exports.
Colocate tests with implementation files.
Include absolute paths in import statements via tsconfig paths (use '@src/' as the alias for 'src/').
Node 16 module resolution: always include file extensions in imports ('.js').

  • packages/code-morph/src/morphers/tests/morpher.test-helper.ts
`**/*.{ts,tsx}`: Always include explicit return types on all top-level functions, including React components. If a particular interface or type is not exported, change the file so ...

**/*.{ts,tsx}: Always include explicit return types on all top-level functions, including React components.
If a particular interface or type is not exported, change the file so it is exported.

  • packages/code-morph/src/morphers/tests/morpher.test-helper.ts
⏰ Context from checks skipped due to timeout of 90000ms (2)
  • GitHub Check: Test E2E
  • GitHub Check: Lint
🔇 Additional comments (1)
packages/code-morph/src/morphers/tests/morpher.test-helper.ts (1)

55-55: LGTM: Function signature follows TypeScript guidelines.

The explicit return type void and the eslint disable comment with proper justification are both appropriate here.

let prettierConfig: prettier.Options | null;

describe(`Test morpher ${morpher.name}`, () => {
describe.skipIf(process.env.CI)(`Test morpher ${morpher.name}`, () => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue

🧩 Verification correct

Reconsider skipping all morpher tests in CI environments.

Conditionally skipping the entire test suite in CI could significantly reduce test coverage and hide potential regressions. This means these transformation tests won't provide any feedback during continuous integration, which defeats the purpose of having CI validation.

Consider these alternatives:

  • Make the tests more reliable/faster instead of skipping them
  • Skip only specific problematic test cases rather than the entire suite
  • Use timeouts or retry mechanisms for flaky tests
  • Run a subset of critical tests in CI while skipping others

If this change is intentional due to test reliability issues, please document the reasoning and consider implementing a more targeted approach:

- describe.skipIf(process.env.CI)(`Test morpher ${morpher.name}`, () => {
+ describe(`Test morpher ${morpher.name}`, () => {

Please verify if there are specific issues with these tests in CI that necessitate skipping them entirely:


🏁 Script executed:

#!/bin/bash
# Check for any CI-specific configuration or known issues with morpher tests
echo "Searching for CI-related configurations and test issues..."

# Look for CI configuration files
fd -t f "\.github|\.circleci|\.travis|ci\." --exec echo "Found CI config: {}"

# Search for any documentation about test skipping or CI issues
rg -i "skip.*ci|ci.*skip|flaky.*test|timeout.*test" --type md --type txt

# Look for other instances of conditional test skipping
rg "skipIf.*CI|describe\.skip" --type ts --type js

# Check if there are any performance or timing issues mentioned
rg -i "slow.*test|performance.*test|timeout" --type ts --type js -A 3

Length of output: 27896


Reconsider skipping all morpher tests in CI environments.

Conditionally skipping the entire test suite in CI could significantly reduce test coverage and hide potential regressions. This means these transformation tests won't provide any feedback during continuous integration, which defeats the purpose of having CI validation.

Consider these alternatives:

  • Make the tests more reliable/faster instead of skipping them
  • Skip only specific problematic test cases rather than the entire suite
  • Use timeouts or retry mechanisms for flaky tests
  • Run a subset of critical tests in CI while skipping others

If this change is intentional due to test reliability issues, please document the reasoning and consider implementing a more targeted approach:

- describe.skipIf(process.env.CI)(`Test morpher ${morpher.name}`, () => {
+ describe(`Test morpher ${morpher.name}`, () => {

Please verify if there are specific issues with these tests in CI that necessitate skipping them entirely:

#!/bin/bash
# Check for any CI-specific configuration or known issues with morpher tests
echo "Searching for CI-related configurations and test issues..."

# Look for CI configuration files
fd -t f "\.github|\.circleci|\.travis|ci\." --exec echo "Found CI config: {}"

# Search for any documentation about test skipping or CI issues
rg -i "skip.*ci|ci.*skip|flaky.*test|timeout.*test" --type md --type txt

# Look for other instances of conditional test skipping
rg "skipIf.*CI|describe\.skip" --type ts --type js

# Check if there are any performance or timing issues mentioned
rg -i "slow.*test|performance.*test|timeout" --type ts --type js -A 3
🤖 Prompt for AI Agents
In packages/code-morph/src/morphers/tests/morpher.test-helper.ts at line 64, the
entire morpher test suite is conditionally skipped in CI environments, which
reduces test coverage and may hide regressions. Instead of skipping all tests,
identify and isolate specific flaky or slow tests to skip or add
retries/timeouts for them. Alternatively, improve test reliability or run a
critical subset in CI. Remove the global skipIf condition and implement targeted
handling for problematic tests, documenting any CI-related issues if skipping
remains necessary.

@kingston kingston merged commit ef3353f into main Jun 23, 2025
10 checks passed
@kingston kingston deleted the kingston/eng-748-switch-to-schema-creator-pattern branch June 23, 2025 21:41
@coderabbitai coderabbitai bot mentioned this pull request Nov 28, 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.

2 participants