Skip to content

Add code generation project import#14

Open
haphantran wants to merge 1 commit into
mainfrom
feature/codegen-import-project
Open

Add code generation project import#14
haphantran wants to merge 1 commit into
mainfrom
feature/codegen-import-project

Conversation

@haphantran

Copy link
Copy Markdown
Collaborator

Summary

Adds an Import Project action to the code generation Projects tab that loads projects from a JSON file. Accepts a single project object, a top-level array, or a { projects: [...] } wrapper.

Details

  • Imported projects are normalized and validated in the project CRUD service: required fields checked, project/template IDs regenerated on collision, imports forced to non-example.
  • Model generation now also resolves templates owned by projects (not just standalone templates).
  • Example projects load locally again.

Tests

  • 16 service tests (codegen-project-import.test.ts): import success, project/template ID de-duplication, field defaults, validation errors.
  • 5 hook tests (useProjectManagement-import.test.ts): single/array/{projects} parsing branches, invalid-JSON and rejected-payload alert paths.
  • Full frontend suite + typecheck green.

Add an "Import Project" action to the code generation Projects tab that
loads projects from a JSON file. Supports a single project object, a
top-level array, or a { projects: [...] } wrapper.

Imported projects are normalized and validated in the project CRUD
service: required fields are checked, project/template IDs are
regenerated on collision, and imports are forced to non-example. Model
generation now also resolves templates owned by projects, and example
projects load locally again.

Add service- and hook-level tests covering import success paths, ID
de-duplication, field defaults, parsing branches, and validation errors.
Copilot AI review requested due to automatic review settings June 25, 2026 13:43

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

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