ricokahler / sanity-codegen

Generate TypeScript types from your Sanity.io schemas
sanity-codegen-dev.vercel.app
MIT License
270 stars 19 forks source link

feat(v1): generate identifiers #299

Open ochicf opened 1 year ago

ochicf commented 1 year ago

Broken generation of identifiers in 2 function that can be provided in config:

Some notes on the idea behind the implementation:

Actual signatures:

function generateTypeName(
  typeName: string,
  context: {
    normalizedSchema: Sanity.SchemaDef.Schema;
    node: Sanity.SchemaDef.DocumentNode | Sanity.SchemaDef.RegisteredSchemaNode;
    nodes: (Sanity.SchemaDef.DocumentNode | Sanity.SchemaDef.RegisteredSchemaNode)[];
  },
): string;

function generateWorkspaceName(
  typeName: string,
  context: {
    normalizedSchemas: Sanity.SchemaDef.Schema[];
    normalizedSchema: Sanity.SchemaDef.Schema;
  },
): string;

Questions:

vercel[bot] commented 1 year ago

@ochicf is attempting to deploy a commit to the Rico Kahler Team on Vercel.

A member of the Team first needs to authorize it.