Comfy-Org / Comfy-Org/ComfyUI_frontend

[RFC] Consolidate schema locations — 4 separate directories

Open
#11,085 0 comments 0 reactions 0 assignees View on GitHub
area:auth area:settings developer experience refactor
Dominant language
TypeScript
Stars
2k
Forks
699
Avg merge
1d 7h
Merged PRs (30d)
490

Description

## Problem

Zod schemas are scattered across 4 locations:

1. `src/schemas/` — `apiSchema.ts` (519L, 79 consumers), `nodeDefSchema.ts` (381L), `colorPaletteSchema.ts`, `signInSchema.ts`
2. `src/core/schemas/` — `promotionSchema.ts`
3. `src/platform/*/schemas/` — domain-specific (workflow, assets, templates, sharing)
4. `src/composables/maskeditor/gpu/` — `gpuSchema.ts`

The foundational `apiSchema.ts` is the most-imported schema but sits in a top-level `schemas/` directory that is outside the layer hierarchy.

## Proposed Fix

1. Move `apiSchema.ts` to `base/schemas/` (it is foundational infrastructure)
2. Move `nodeDefSchema.ts` to `platform/nodeCatalog/schemas/` (per Issue #11020)
3. Move `signInSchema.ts` to `platform/auth/schemas/` (per Issue #11065)
4. Move `colorPaletteSchema.ts` to `platform/settings/schemas/`
5. Domain schemas in `platform/*/schemas/` already follow the pattern — leave them
6. Delete `src/schemas/` once empty

## Migration Plan

- Move one schema per PR
- Update imports

## Testing Strategy

- `pnpm typecheck` passes after each move

┆Issue is synchronized with this [Notion page](https://www.notion.so/Issue-11085-RFC-Consolidate-schema-locations-4-separate-directories-33e6d73d365081ad896bd17d0cb00c92) by [Unito](https://www.unito.io)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.