Skip to main content

Applying Revisions to Your Project

Once you have created a revision draft (typically in a revisions.json file) that outlines the desired architectural changes, the next step is to apply these changes to your project's codebase using the Architect CLI.

Applying a revision tells Architect to read the ComponentOperation objects defined in the draft and execute the specified actions (CREATE, UPDATE, DELETE) on the corresponding components, generating or modifying code files as needed.

Before applying a revision, it's highly recommended to preview the changes Architect will make. This allows you to verify that the operations will result in the expected file creations, modifications, or deletions without actually touching your code.

To preview the changes a revision file will make without actually modifying any files, use the --dry-run option with the apply-revision-file command:

architect revision apply-revision-file --dry-run path/to/your/revisions.json

Explanation:

  • path/to/your/revisions.json: Specifies the path to the revision draft file you want to dry-run.

The command will output a summary of the planned operations and list the files that will be affected. Review this output carefully to ensure it aligns with your intentions.

Applying Changes

Once you are confident that the revision draft is correct and the preview shows the desired changes, you can apply the revision using the architect revision apply command.

architect revision apply-revision-file path/to/your/revisions.json

Explanation:

  • --file path/to/your/revisions.json: Specifies the path to the revision draft file to apply.

Architect will process each ComponentOperation in the specified file:

  • For CREATE operations, it will generate new code files based on the component definition and context.
  • For UPDATE operations, it will attempt to modify existing files, often preserving user-defined code within designated markers.
  • For DELETE operations, it will remove the specified component files.

The command will provide feedback on the success or failure of each operation.

Next Steps

  • Understanding the details of various Component Operations (Link to be created).
  • Managing your revision history (Link to be created).