Skip to content

feat: add gen commands#68

Merged
angeloashmore merged 1 commit intomainfrom
aa/gen-commands
Mar 25, 2026
Merged

feat: add gen commands#68
angeloashmore merged 1 commit intomainfrom
aa/gen-commands

Conversation

@angeloashmore
Copy link
Member

@angeloashmore angeloashmore commented Mar 25, 2026

Resolves: #19

Description

Re-enables codegen as the prismic gen types command. This generates TypeScript types from local custom type and slice models using prismic-ts-codegen.

Also refactors generateAndWriteTypes to accept an output URL instead of projectRoot, letting callers control the output path directly.

prismic gen types is used over something like prismic codegen since we may want to add other gen commands, like:

  • prismic gen routes
  • prismic gen page-file blog-post
  • prismic gen simulator

Checklist

  • A comprehensive Linear ticket, providing sufficient context and details to facilitate the review of the PR, is linked to the PR.
  • If my changes require tests, I added them.
  • If my changes affect backward compatibility, it has been discussed.
  • If my changes require an update to the CONTRIBUTING.md guide, I updated it.

Preview

How to QA 1


Note

Medium Risk
Moderate risk: introduces new CLI command wiring and changes the generateAndWriteTypes API, which could affect all call sites that generate prismicio-types.d.ts if output paths or URLs are incorrect.

Overview
Adds a new prismic gen command group with prismic gen types to generate prismicio-types.d.ts from local customtypes/ and slices/ models, printing the generated file’s relative path.

Refactors generateAndWriteTypes to accept an explicit output URL (instead of projectRoot) and updates init and sync to pass the output file URL. Adds relativePathname URL utility, new Vitest coverage for the gen/gen types help output and type generation, and adjusts vitest.config.ts to set testTimeout per project.

Written by Cursor Bugbot for commit 4349f81. This will update automatically on new commits. Configure here.

Footnotes

  1. Please use these labels when submitting a review:
    ❓ #ask: Ask a question.
    💡 #idea: Suggest an idea.
    ⚠️ #issue: Strongly suggest a change.
    🎉 #nice: Share a compliment.

Resolves #19

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

@angeloashmore angeloashmore merged commit 3077302 into main Mar 25, 2026
12 checks passed
@angeloashmore angeloashmore deleted the aa/gen-commands branch March 25, 2026 02:20
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.

Re-enable codegen command

1 participant