This commit introduces a new `/core:sync` command that syncs changes across dependent modules.
The command reads a `repos.yaml` file to determine the dependency graph. When a base module is changed, the command will:
- Update the `composer.json` file of each dependent module to the latest version of the base module.
- Run `composer update` to install the new dependency version.
- Run tests in each dependent module to ensure that the changes have not introduced any regressions.
The command also includes a `--dry-run` option that allows users to see what changes would be made without actually modifying any files.
Implements a new `/core:migrate` command to provide a set of helpers for working with Laravel migrations in a monorepo environment.
The new command includes the following subcommands:
- `/core:migrate create <name>`: Creates a new migration file.
- `/core:migrate run`: Runs all pending migrations.
- `/core:migrate rollback`: Rolls back the last migration.
- `/core:migrate fresh`: Drops all tables and re-runs all migrations.
- `/core:migrate status`: Shows the status of all migrations.
- `/core:migrate from-model <ModelName>`: Generates a new migration by analyzing an existing Laravel model.
Key Features:
- **Smart Migration Generation**: The `from-model` command uses a robust PHP script with Reflection to accurately parse model properties and relationships, generating a complete schema definition.
- **Multi-Tenant Awareness**: New migrations automatically include a `workspace_id` foreign key to support multi-tenant architectures.
- **Module Support**: The `create` and `from-model` commands accept `--path` and `--model-path` arguments, allowing them to be used with different modules in a monorepo.
- **Automatic Indexing**: The `from-model` command automatically adds database indexes to foreign key columns.
Adds a new `/core:release` command to streamline the release process for modules.
This command automates the following workflow:
- Bumps the version in `package.json` (and `gemini-extension.json` if it exists).
- Generates a `CHANGELOG.md` entry from conventional commit messages.
- Commits the changes with a `chore(release): vX.Y.Z` message.
- Creates and pushes a new git tag to trigger the CI release.
A `--preview` flag is included to allow for a dry run of the release process without making any changes.
This commit introduces a new /core:clean command to clean up generated files, caches, and build artifacts.
The command provides the following options:
- /core:clean: Cleans all caches and build artifacts.
- /core:clean --cache: Cleans caches only.
- /core:clean --deps: Performs a dry-run for dependency cleanup.
- /core:clean --deps --force: Deletes dependency directories after a confirmation prompt.
- /core:clean --dry-run: Shows what would be deleted without performing any actions.
The implementation includes safety features such as a "dry-run by default" for dependency cleaning and a confirmation prompt for destructive operations.