@contember/cli 2.1.0-beta.1 → 2.2.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CLAUDE.md +14 -1
- package/dist/development/index.cjs +5 -0
- package/dist/development/index.cjs.map +1 -0
- package/dist/development/index.js +5 -0
- package/dist/development/index.js.map +1 -0
- package/dist/development/run.cjs +3 -3
- package/dist/development/run.cjs.map +1 -1
- package/dist/development/run.js.map +1 -1
- package/dist/development/src/commands/actions/ActionsGetEventCommand.cjs.map +1 -1
- package/dist/development/src/commands/actions/ActionsGetEventCommand.js.map +1 -1
- package/dist/development/src/commands/actions/ActionsListFailedEventsCommand.cjs.map +1 -1
- package/dist/development/src/commands/actions/ActionsListFailedEventsCommand.js.map +1 -1
- package/dist/development/src/commands/actions/ActionsListVariablesCommand.cjs.map +1 -1
- package/dist/development/src/commands/actions/ActionsListVariablesCommand.js.map +1 -1
- package/dist/development/src/commands/actions/ActionsRetryEventCommand.cjs.map +1 -1
- package/dist/development/src/commands/actions/ActionsRetryEventCommand.js.map +1 -1
- package/dist/development/src/commands/actions/ActionsSetVariablesCommand.cjs.map +1 -1
- package/dist/development/src/commands/actions/ActionsSetVariablesCommand.js.map +1 -1
- package/dist/development/src/commands/actions/ActionsStopEventCommand.cjs.map +1 -1
- package/dist/development/src/commands/actions/ActionsStopEventCommand.js.map +1 -1
- package/dist/development/src/commands/deploy/DeployCommand.cjs +3 -1
- package/dist/development/src/commands/deploy/DeployCommand.cjs.map +1 -1
- package/dist/development/src/commands/deploy/DeployCommand.js +3 -1
- package/dist/development/src/commands/deploy/DeployCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationAmendCommand.cjs +26 -4
- package/dist/development/src/commands/migrations/MigrationAmendCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationAmendCommand.js +26 -4
- package/dist/development/src/commands/migrations/MigrationAmendCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationDescribeCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationDescribeCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationDiffCommand.cjs +39 -3
- package/dist/development/src/commands/migrations/MigrationDiffCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationDiffCommand.js +39 -3
- package/dist/development/src/commands/migrations/MigrationDiffCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationExecuteCommand.cjs +3 -1
- package/dist/development/src/commands/migrations/MigrationExecuteCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationExecuteCommand.js +3 -1
- package/dist/development/src/commands/migrations/MigrationExecuteCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationInitStateCommand.cjs +26 -0
- package/dist/development/src/commands/migrations/MigrationInitStateCommand.cjs.map +1 -0
- package/dist/development/src/commands/migrations/MigrationInitStateCommand.js +26 -0
- package/dist/development/src/commands/migrations/MigrationInitStateCommand.js.map +1 -0
- package/dist/development/src/commands/migrations/MigrationRebaseCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationRebaseCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationSnapshotCommand.cjs +28 -0
- package/dist/development/src/commands/migrations/MigrationSnapshotCommand.cjs.map +1 -0
- package/dist/development/src/commands/migrations/MigrationSnapshotCommand.js +28 -0
- package/dist/development/src/commands/migrations/MigrationSnapshotCommand.js.map +1 -0
- package/dist/development/src/commands/migrations/MigrationStatusCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationStatusCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationVerifySnapshotCommand.cjs +23 -0
- package/dist/development/src/commands/migrations/MigrationVerifySnapshotCommand.cjs.map +1 -0
- package/dist/development/src/commands/migrations/MigrationVerifySnapshotCommand.js +23 -0
- package/dist/development/src/commands/migrations/MigrationVerifySnapshotCommand.js.map +1 -0
- package/dist/development/src/commands/project/ProjectGenerateDocumentationCommand.cjs +2 -2
- package/dist/development/src/commands/project/ProjectGenerateDocumentationCommand.cjs.map +1 -1
- package/dist/development/src/commands/project/ProjectGenerateDocumentationCommand.js.map +1 -1
- package/dist/development/src/commands/project/ProjectPrintSchemaCommand.cjs.map +1 -1
- package/dist/development/src/commands/project/ProjectPrintSchemaCommand.js.map +1 -1
- package/dist/development/src/commands/project/ProjectValidateCommand.cjs.map +1 -1
- package/dist/development/src/commands/project/ProjectValidateCommand.js.map +1 -1
- package/dist/development/src/commands/tenant/TenantApplyCommand.cjs +39 -0
- package/dist/development/src/commands/tenant/TenantApplyCommand.cjs.map +1 -0
- package/dist/development/src/commands/tenant/TenantApplyCommand.js +39 -0
- package/dist/development/src/commands/tenant/TenantApplyCommand.js.map +1 -0
- package/dist/development/src/commands/transfer/ExportCommand.cjs.map +1 -1
- package/dist/development/src/commands/transfer/ExportCommand.js.map +1 -1
- package/dist/development/src/commands/transfer/ImportCommand.cjs.map +1 -1
- package/dist/development/src/commands/transfer/ImportCommand.js.map +1 -1
- package/dist/development/src/commands/transfer/TransferCommand.cjs.map +1 -1
- package/dist/development/src/commands/transfer/TransferCommand.js.map +1 -1
- package/dist/development/src/commands/workspace/WorkspaceUpdateApiCommand.cjs.map +1 -1
- package/dist/development/src/commands/workspace/WorkspaceUpdateApiCommand.js.map +1 -1
- package/dist/development/src/consts.cjs +2 -2
- package/dist/development/src/consts.cjs.map +1 -1
- package/dist/development/src/dic.cjs +60 -10
- package/dist/development/src/dic.cjs.map +1 -1
- package/dist/development/src/dic.js +61 -11
- package/dist/development/src/dic.js.map +1 -1
- package/dist/development/src/lib/SystemClientProvider.cjs.map +1 -1
- package/dist/development/src/lib/SystemClientProvider.js.map +1 -1
- package/dist/development/src/lib/TenantClientProvider.cjs.map +1 -1
- package/dist/development/src/lib/TenantClientProvider.js.map +1 -1
- package/dist/development/src/lib/VersionChecker.cjs +2 -2
- package/dist/development/src/lib/VersionChecker.cjs.map +1 -1
- package/dist/development/src/lib/VersionChecker.js.map +1 -1
- package/dist/development/src/lib/admin/AdminClient.cjs.map +1 -1
- package/dist/development/src/lib/admin/AdminClient.js.map +1 -1
- package/dist/development/src/lib/admin/AdminDeployer.cjs.map +1 -1
- package/dist/development/src/lib/admin/AdminDeployer.js.map +1 -1
- package/dist/development/src/lib/fs/DockerComposeManager.cjs +10 -10
- package/dist/development/src/lib/fs/DockerComposeManager.cjs.map +1 -1
- package/dist/development/src/lib/fs/DockerComposeManager.js.map +1 -1
- package/dist/development/src/lib/fs/YamlHandler.cjs.map +1 -1
- package/dist/development/src/lib/fs/YamlHandler.js.map +1 -1
- package/dist/development/src/lib/js/EsBuildBuilder.cjs.map +1 -1
- package/dist/development/src/lib/js/EsBuildBuilder.js.map +1 -1
- package/dist/development/src/lib/js/EvalExecutor.cjs.map +1 -1
- package/dist/development/src/lib/js/EvalExecutor.js.map +1 -1
- package/dist/development/src/lib/js/JsCodeRunner.cjs.map +1 -1
- package/dist/development/src/lib/js/JsCodeRunner.js.map +1 -1
- package/dist/development/src/lib/migrations/MigrationExecutionFacade.cjs +78 -18
- package/dist/development/src/lib/migrations/MigrationExecutionFacade.cjs.map +1 -1
- package/dist/development/src/lib/migrations/MigrationExecutionFacade.js +79 -19
- package/dist/development/src/lib/migrations/MigrationExecutionFacade.js.map +1 -1
- package/dist/development/src/lib/migrations/MigrationPrinter.cjs.map +1 -1
- package/dist/development/src/lib/migrations/MigrationPrinter.js.map +1 -1
- package/dist/development/src/lib/migrations/MigrationRebaseFacade.cjs +5 -1
- package/dist/development/src/lib/migrations/MigrationRebaseFacade.cjs.map +1 -1
- package/dist/development/src/lib/migrations/MigrationRebaseFacade.js +5 -1
- package/dist/development/src/lib/migrations/MigrationRebaseFacade.js.map +1 -1
- package/dist/development/src/lib/migrations/MigrationSnapshotFacade.cjs +171 -0
- package/dist/development/src/lib/migrations/MigrationSnapshotFacade.cjs.map +1 -0
- package/dist/development/src/lib/migrations/MigrationSnapshotFacade.js +171 -0
- package/dist/development/src/lib/migrations/MigrationSnapshotFacade.js.map +1 -0
- package/dist/development/src/lib/migrations/MigrationsStatusFacade.cjs.map +1 -1
- package/dist/development/src/lib/migrations/MigrationsStatusFacade.js.map +1 -1
- package/dist/development/src/lib/migrations/MigrationsValidator.cjs.map +1 -1
- package/dist/development/src/lib/migrations/MigrationsValidator.js.map +1 -1
- package/dist/development/src/lib/project/RemoteProjectProvider.cjs.map +1 -1
- package/dist/development/src/lib/project/RemoteProjectProvider.js.map +1 -1
- package/dist/development/src/lib/project/RemoteProjectResolver.cjs.map +1 -1
- package/dist/development/src/lib/project/RemoteProjectResolver.js.map +1 -1
- package/dist/development/src/lib/project/docs/components/EntityInfo.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/components/EntityInfo.js.map +1 -1
- package/dist/development/src/lib/project/docs/components/EntityLink.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/components/EntityLink.js.map +1 -1
- package/dist/development/src/lib/project/docs/components/FieldLink.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/components/FieldLink.js.map +1 -1
- package/dist/development/src/lib/project/docs/components/FieldPermissions.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/components/FieldPermissions.js.map +1 -1
- package/dist/development/src/lib/project/docs/components/FieldType.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/components/FieldType.js.map +1 -1
- package/dist/development/src/lib/project/docs/components/OnDelete.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/components/OnDelete.js.map +1 -1
- package/dist/development/src/lib/project/docs/components/ProjectInfo.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/components/ProjectInfo.js.map +1 -1
- package/dist/development/src/lib/project/docs/projectDescribe.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/projectDescribe.js.map +1 -1
- package/dist/development/src/lib/schema/SchemaLoader.cjs +5 -5
- package/dist/development/src/lib/schema/SchemaLoader.cjs.map +1 -1
- package/dist/development/src/lib/schema/SchemaLoader.js.map +1 -1
- package/dist/development/src/lib/schema/SchemaValidationHelper.cjs.map +1 -1
- package/dist/development/src/lib/schema/SchemaValidationHelper.js.map +1 -1
- package/dist/development/src/lib/tenant/TenantClient.cjs +75 -12
- package/dist/development/src/lib/tenant/TenantClient.cjs.map +1 -1
- package/dist/development/src/lib/tenant/TenantClient.js +75 -12
- package/dist/development/src/lib/tenant/TenantClient.js.map +1 -1
- package/dist/development/src/lib/tenant/TenantConfigApplier.cjs +55 -0
- package/dist/development/src/lib/tenant/TenantConfigApplier.cjs.map +1 -0
- package/dist/development/src/lib/tenant/TenantConfigApplier.js +55 -0
- package/dist/development/src/lib/tenant/TenantConfigApplier.js.map +1 -0
- package/dist/development/src/lib/tenant/TenantConfigLoader.cjs +32 -0
- package/dist/development/src/lib/tenant/TenantConfigLoader.cjs.map +1 -0
- package/dist/development/src/lib/tenant/TenantConfigLoader.js +32 -0
- package/dist/development/src/lib/tenant/TenantConfigLoader.js.map +1 -0
- package/dist/development/src/lib/tenant/tenantConfig.cjs +5 -0
- package/dist/development/src/lib/tenant/tenantConfig.cjs.map +1 -0
- package/dist/development/src/lib/tenant/tenantConfig.js +5 -0
- package/dist/development/src/lib/tenant/tenantConfig.js.map +1 -0
- package/dist/development/src/lib/transfer/DataTransferClient.cjs.map +1 -1
- package/dist/development/src/lib/transfer/DataTransferClient.js.map +1 -1
- package/dist/development/src/lib/workspace/WorkspaceResolver.cjs +6 -6
- package/dist/development/src/lib/workspace/WorkspaceResolver.cjs.map +1 -1
- package/dist/development/src/lib/workspace/WorkspaceResolver.js.map +1 -1
- package/dist/production/index.cjs +5 -0
- package/dist/production/index.cjs.map +1 -0
- package/dist/production/index.js +5 -0
- package/dist/production/index.js.map +1 -0
- package/dist/production/run.cjs +3 -3
- package/dist/production/run.cjs.map +1 -1
- package/dist/production/run.js.map +1 -1
- package/dist/production/src/commands/actions/ActionsGetEventCommand.cjs.map +1 -1
- package/dist/production/src/commands/actions/ActionsGetEventCommand.js.map +1 -1
- package/dist/production/src/commands/actions/ActionsListFailedEventsCommand.cjs.map +1 -1
- package/dist/production/src/commands/actions/ActionsListFailedEventsCommand.js.map +1 -1
- package/dist/production/src/commands/actions/ActionsListVariablesCommand.cjs.map +1 -1
- package/dist/production/src/commands/actions/ActionsListVariablesCommand.js.map +1 -1
- package/dist/production/src/commands/actions/ActionsRetryEventCommand.cjs.map +1 -1
- package/dist/production/src/commands/actions/ActionsRetryEventCommand.js.map +1 -1
- package/dist/production/src/commands/actions/ActionsSetVariablesCommand.cjs.map +1 -1
- package/dist/production/src/commands/actions/ActionsSetVariablesCommand.js.map +1 -1
- package/dist/production/src/commands/actions/ActionsStopEventCommand.cjs.map +1 -1
- package/dist/production/src/commands/actions/ActionsStopEventCommand.js.map +1 -1
- package/dist/production/src/commands/deploy/DeployCommand.cjs +3 -1
- package/dist/production/src/commands/deploy/DeployCommand.cjs.map +1 -1
- package/dist/production/src/commands/deploy/DeployCommand.js +3 -1
- package/dist/production/src/commands/deploy/DeployCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationAmendCommand.cjs +26 -4
- package/dist/production/src/commands/migrations/MigrationAmendCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationAmendCommand.js +26 -4
- package/dist/production/src/commands/migrations/MigrationAmendCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationDescribeCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationDescribeCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationDiffCommand.cjs +39 -3
- package/dist/production/src/commands/migrations/MigrationDiffCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationDiffCommand.js +39 -3
- package/dist/production/src/commands/migrations/MigrationDiffCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationExecuteCommand.cjs +3 -1
- package/dist/production/src/commands/migrations/MigrationExecuteCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationExecuteCommand.js +3 -1
- package/dist/production/src/commands/migrations/MigrationExecuteCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationInitStateCommand.cjs +26 -0
- package/dist/production/src/commands/migrations/MigrationInitStateCommand.cjs.map +1 -0
- package/dist/production/src/commands/migrations/MigrationInitStateCommand.js +26 -0
- package/dist/production/src/commands/migrations/MigrationInitStateCommand.js.map +1 -0
- package/dist/production/src/commands/migrations/MigrationRebaseCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationRebaseCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationSnapshotCommand.cjs +28 -0
- package/dist/production/src/commands/migrations/MigrationSnapshotCommand.cjs.map +1 -0
- package/dist/production/src/commands/migrations/MigrationSnapshotCommand.js +28 -0
- package/dist/production/src/commands/migrations/MigrationSnapshotCommand.js.map +1 -0
- package/dist/production/src/commands/migrations/MigrationStatusCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationStatusCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationVerifySnapshotCommand.cjs +23 -0
- package/dist/production/src/commands/migrations/MigrationVerifySnapshotCommand.cjs.map +1 -0
- package/dist/production/src/commands/migrations/MigrationVerifySnapshotCommand.js +23 -0
- package/dist/production/src/commands/migrations/MigrationVerifySnapshotCommand.js.map +1 -0
- package/dist/production/src/commands/project/ProjectGenerateDocumentationCommand.cjs +2 -2
- package/dist/production/src/commands/project/ProjectGenerateDocumentationCommand.cjs.map +1 -1
- package/dist/production/src/commands/project/ProjectGenerateDocumentationCommand.js.map +1 -1
- package/dist/production/src/commands/project/ProjectPrintSchemaCommand.cjs.map +1 -1
- package/dist/production/src/commands/project/ProjectPrintSchemaCommand.js.map +1 -1
- package/dist/production/src/commands/project/ProjectValidateCommand.cjs.map +1 -1
- package/dist/production/src/commands/project/ProjectValidateCommand.js.map +1 -1
- package/dist/production/src/commands/tenant/TenantApplyCommand.cjs +39 -0
- package/dist/production/src/commands/tenant/TenantApplyCommand.cjs.map +1 -0
- package/dist/production/src/commands/tenant/TenantApplyCommand.js +39 -0
- package/dist/production/src/commands/tenant/TenantApplyCommand.js.map +1 -0
- package/dist/production/src/commands/transfer/ExportCommand.cjs.map +1 -1
- package/dist/production/src/commands/transfer/ExportCommand.js.map +1 -1
- package/dist/production/src/commands/transfer/ImportCommand.cjs.map +1 -1
- package/dist/production/src/commands/transfer/ImportCommand.js.map +1 -1
- package/dist/production/src/commands/transfer/TransferCommand.cjs.map +1 -1
- package/dist/production/src/commands/transfer/TransferCommand.js.map +1 -1
- package/dist/production/src/commands/workspace/WorkspaceUpdateApiCommand.cjs.map +1 -1
- package/dist/production/src/commands/workspace/WorkspaceUpdateApiCommand.js.map +1 -1
- package/dist/production/src/consts.cjs +2 -2
- package/dist/production/src/consts.cjs.map +1 -1
- package/dist/production/src/dic.cjs +60 -10
- package/dist/production/src/dic.cjs.map +1 -1
- package/dist/production/src/dic.js +61 -11
- package/dist/production/src/dic.js.map +1 -1
- package/dist/production/src/lib/SystemClientProvider.cjs.map +1 -1
- package/dist/production/src/lib/SystemClientProvider.js.map +1 -1
- package/dist/production/src/lib/TenantClientProvider.cjs.map +1 -1
- package/dist/production/src/lib/TenantClientProvider.js.map +1 -1
- package/dist/production/src/lib/VersionChecker.cjs +2 -2
- package/dist/production/src/lib/VersionChecker.cjs.map +1 -1
- package/dist/production/src/lib/VersionChecker.js.map +1 -1
- package/dist/production/src/lib/admin/AdminClient.cjs.map +1 -1
- package/dist/production/src/lib/admin/AdminClient.js.map +1 -1
- package/dist/production/src/lib/admin/AdminDeployer.cjs.map +1 -1
- package/dist/production/src/lib/admin/AdminDeployer.js.map +1 -1
- package/dist/production/src/lib/fs/DockerComposeManager.cjs +10 -10
- package/dist/production/src/lib/fs/DockerComposeManager.cjs.map +1 -1
- package/dist/production/src/lib/fs/DockerComposeManager.js.map +1 -1
- package/dist/production/src/lib/fs/YamlHandler.cjs.map +1 -1
- package/dist/production/src/lib/fs/YamlHandler.js.map +1 -1
- package/dist/production/src/lib/js/EsBuildBuilder.cjs.map +1 -1
- package/dist/production/src/lib/js/EsBuildBuilder.js.map +1 -1
- package/dist/production/src/lib/js/EvalExecutor.cjs.map +1 -1
- package/dist/production/src/lib/js/EvalExecutor.js.map +1 -1
- package/dist/production/src/lib/js/JsCodeRunner.cjs.map +1 -1
- package/dist/production/src/lib/js/JsCodeRunner.js.map +1 -1
- package/dist/production/src/lib/migrations/MigrationExecutionFacade.cjs +78 -18
- package/dist/production/src/lib/migrations/MigrationExecutionFacade.cjs.map +1 -1
- package/dist/production/src/lib/migrations/MigrationExecutionFacade.js +79 -19
- package/dist/production/src/lib/migrations/MigrationExecutionFacade.js.map +1 -1
- package/dist/production/src/lib/migrations/MigrationPrinter.cjs.map +1 -1
- package/dist/production/src/lib/migrations/MigrationPrinter.js.map +1 -1
- package/dist/production/src/lib/migrations/MigrationRebaseFacade.cjs +5 -1
- package/dist/production/src/lib/migrations/MigrationRebaseFacade.cjs.map +1 -1
- package/dist/production/src/lib/migrations/MigrationRebaseFacade.js +5 -1
- package/dist/production/src/lib/migrations/MigrationRebaseFacade.js.map +1 -1
- package/dist/production/src/lib/migrations/MigrationSnapshotFacade.cjs +171 -0
- package/dist/production/src/lib/migrations/MigrationSnapshotFacade.cjs.map +1 -0
- package/dist/production/src/lib/migrations/MigrationSnapshotFacade.js +171 -0
- package/dist/production/src/lib/migrations/MigrationSnapshotFacade.js.map +1 -0
- package/dist/production/src/lib/migrations/MigrationsStatusFacade.cjs.map +1 -1
- package/dist/production/src/lib/migrations/MigrationsStatusFacade.js.map +1 -1
- package/dist/production/src/lib/migrations/MigrationsValidator.cjs.map +1 -1
- package/dist/production/src/lib/migrations/MigrationsValidator.js.map +1 -1
- package/dist/production/src/lib/project/RemoteProjectProvider.cjs.map +1 -1
- package/dist/production/src/lib/project/RemoteProjectProvider.js.map +1 -1
- package/dist/production/src/lib/project/RemoteProjectResolver.cjs.map +1 -1
- package/dist/production/src/lib/project/RemoteProjectResolver.js.map +1 -1
- package/dist/production/src/lib/project/docs/components/EntityInfo.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/components/EntityInfo.js.map +1 -1
- package/dist/production/src/lib/project/docs/components/EntityLink.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/components/EntityLink.js.map +1 -1
- package/dist/production/src/lib/project/docs/components/FieldLink.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/components/FieldLink.js.map +1 -1
- package/dist/production/src/lib/project/docs/components/FieldPermissions.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/components/FieldPermissions.js.map +1 -1
- package/dist/production/src/lib/project/docs/components/FieldType.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/components/FieldType.js.map +1 -1
- package/dist/production/src/lib/project/docs/components/OnDelete.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/components/OnDelete.js.map +1 -1
- package/dist/production/src/lib/project/docs/components/ProjectInfo.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/components/ProjectInfo.js.map +1 -1
- package/dist/production/src/lib/project/docs/projectDescribe.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/projectDescribe.js.map +1 -1
- package/dist/production/src/lib/schema/SchemaLoader.cjs +5 -5
- package/dist/production/src/lib/schema/SchemaLoader.cjs.map +1 -1
- package/dist/production/src/lib/schema/SchemaLoader.js.map +1 -1
- package/dist/production/src/lib/schema/SchemaValidationHelper.cjs.map +1 -1
- package/dist/production/src/lib/schema/SchemaValidationHelper.js.map +1 -1
- package/dist/production/src/lib/tenant/TenantClient.cjs +75 -12
- package/dist/production/src/lib/tenant/TenantClient.cjs.map +1 -1
- package/dist/production/src/lib/tenant/TenantClient.js +75 -12
- package/dist/production/src/lib/tenant/TenantClient.js.map +1 -1
- package/dist/production/src/lib/tenant/TenantConfigApplier.cjs +55 -0
- package/dist/production/src/lib/tenant/TenantConfigApplier.cjs.map +1 -0
- package/dist/production/src/lib/tenant/TenantConfigApplier.js +55 -0
- package/dist/production/src/lib/tenant/TenantConfigApplier.js.map +1 -0
- package/dist/production/src/lib/tenant/TenantConfigLoader.cjs +32 -0
- package/dist/production/src/lib/tenant/TenantConfigLoader.cjs.map +1 -0
- package/dist/production/src/lib/tenant/TenantConfigLoader.js +32 -0
- package/dist/production/src/lib/tenant/TenantConfigLoader.js.map +1 -0
- package/dist/production/src/lib/tenant/tenantConfig.cjs +5 -0
- package/dist/production/src/lib/tenant/tenantConfig.cjs.map +1 -0
- package/dist/production/src/lib/tenant/tenantConfig.js +5 -0
- package/dist/production/src/lib/tenant/tenantConfig.js.map +1 -0
- package/dist/production/src/lib/transfer/DataTransferClient.cjs.map +1 -1
- package/dist/production/src/lib/transfer/DataTransferClient.js.map +1 -1
- package/dist/production/src/lib/workspace/WorkspaceResolver.cjs +6 -6
- package/dist/production/src/lib/workspace/WorkspaceResolver.cjs.map +1 -1
- package/dist/production/src/lib/workspace/WorkspaceResolver.js.map +1 -1
- package/dist/types/commands/actions/ActionsGetEventCommand.d.ts +1 -1
- package/dist/types/commands/actions/ActionsGetEventCommand.d.ts.map +1 -1
- package/dist/types/commands/actions/ActionsListFailedEventsCommand.d.ts +1 -1
- package/dist/types/commands/actions/ActionsListFailedEventsCommand.d.ts.map +1 -1
- package/dist/types/commands/actions/ActionsListVariablesCommand.d.ts +1 -1
- package/dist/types/commands/actions/ActionsListVariablesCommand.d.ts.map +1 -1
- package/dist/types/commands/actions/ActionsRetryEventCommand.d.ts +1 -1
- package/dist/types/commands/actions/ActionsRetryEventCommand.d.ts.map +1 -1
- package/dist/types/commands/actions/ActionsSetVariablesCommand.d.ts +1 -1
- package/dist/types/commands/actions/ActionsSetVariablesCommand.d.ts.map +1 -1
- package/dist/types/commands/actions/ActionsStopEventCommand.d.ts +1 -1
- package/dist/types/commands/actions/ActionsStopEventCommand.d.ts.map +1 -1
- package/dist/types/commands/deploy/DeployCommand.d.ts +7 -6
- package/dist/types/commands/deploy/DeployCommand.d.ts.map +1 -1
- package/dist/types/commands/deploy/index.d.ts +1 -1
- package/dist/types/commands/deploy/index.d.ts.map +1 -1
- package/dist/types/commands/index.d.ts +6 -5
- package/dist/types/commands/index.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationAmendCommand.d.ts +8 -7
- package/dist/types/commands/migrations/MigrationAmendCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationDescribeCommand.d.ts +1 -1
- package/dist/types/commands/migrations/MigrationDescribeCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationDiffCommand.d.ts +8 -5
- package/dist/types/commands/migrations/MigrationDiffCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationExecuteCommand.d.ts +2 -1
- package/dist/types/commands/migrations/MigrationExecuteCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationInitStateCommand.d.ts +14 -0
- package/dist/types/commands/migrations/MigrationInitStateCommand.d.ts.map +1 -0
- package/dist/types/commands/migrations/MigrationRebaseCommand.d.ts +1 -1
- package/dist/types/commands/migrations/MigrationRebaseCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationSnapshotCommand.d.ts +12 -0
- package/dist/types/commands/migrations/MigrationSnapshotCommand.d.ts.map +1 -0
- package/dist/types/commands/migrations/MigrationStatusCommand.d.ts +3 -3
- package/dist/types/commands/migrations/MigrationStatusCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationVerifySnapshotCommand.d.ts +12 -0
- package/dist/types/commands/migrations/MigrationVerifySnapshotCommand.d.ts.map +1 -0
- package/dist/types/commands/migrations/index.d.ts +10 -7
- package/dist/types/commands/migrations/index.d.ts.map +1 -1
- package/dist/types/commands/misc/index.d.ts +1 -1
- package/dist/types/commands/misc/index.d.ts.map +1 -1
- package/dist/types/commands/project/ProjectGenerateDocumentationCommand.d.ts +1 -1
- package/dist/types/commands/project/ProjectGenerateDocumentationCommand.d.ts.map +1 -1
- package/dist/types/commands/project/ProjectPrintSchemaCommand.d.ts +1 -1
- package/dist/types/commands/project/ProjectPrintSchemaCommand.d.ts.map +1 -1
- package/dist/types/commands/project/ProjectValidateCommand.d.ts +2 -2
- package/dist/types/commands/project/ProjectValidateCommand.d.ts.map +1 -1
- package/dist/types/commands/project/index.d.ts +3 -3
- package/dist/types/commands/project/index.d.ts.map +1 -1
- package/dist/types/commands/tenant/TenantApplyCommand.d.ts +21 -0
- package/dist/types/commands/tenant/TenantApplyCommand.d.ts.map +1 -0
- package/dist/types/commands/tenant/index.d.ts +2 -0
- package/dist/types/commands/tenant/index.d.ts.map +1 -0
- package/dist/types/commands/transfer/ExportCommand.d.ts +2 -2
- package/dist/types/commands/transfer/ExportCommand.d.ts.map +1 -1
- package/dist/types/commands/transfer/ImportCommand.d.ts +2 -2
- package/dist/types/commands/transfer/ImportCommand.d.ts.map +1 -1
- package/dist/types/commands/transfer/TransferCommand.d.ts +2 -2
- package/dist/types/commands/transfer/TransferCommand.d.ts.map +1 -1
- package/dist/types/commands/transfer/index.d.ts +3 -3
- package/dist/types/commands/transfer/index.d.ts.map +1 -1
- package/dist/types/commands/workspace/WorkspaceUpdateApiCommand.d.ts +1 -1
- package/dist/types/commands/workspace/WorkspaceUpdateApiCommand.d.ts.map +1 -1
- package/dist/types/commands/workspace/index.d.ts +1 -1
- package/dist/types/commands/workspace/index.d.ts.map +1 -1
- package/dist/types/dic.d.ts +54 -32
- package/dist/types/dic.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/lib/SystemClientProvider.d.ts +1 -1
- package/dist/types/lib/SystemClientProvider.d.ts.map +1 -1
- package/dist/types/lib/TenantClientProvider.d.ts +2 -2
- package/dist/types/lib/TenantClientProvider.d.ts.map +1 -1
- package/dist/types/lib/VersionChecker.d.ts +1 -1
- package/dist/types/lib/VersionChecker.d.ts.map +1 -1
- package/dist/types/lib/admin/AdminClient.d.ts +1 -1
- package/dist/types/lib/admin/AdminClient.d.ts.map +1 -1
- package/dist/types/lib/admin/AdminDeployer.d.ts +3 -3
- package/dist/types/lib/admin/AdminDeployer.d.ts.map +1 -1
- package/dist/types/lib/fs/DockerComposeManager.d.ts +2 -2
- package/dist/types/lib/fs/DockerComposeManager.d.ts.map +1 -1
- package/dist/types/lib/fs/YamlHandler.d.ts +2 -2
- package/dist/types/lib/fs/YamlHandler.d.ts.map +1 -1
- package/dist/types/lib/js/EsBuildBuilder.d.ts +1 -1
- package/dist/types/lib/js/EsBuildBuilder.d.ts.map +1 -1
- package/dist/types/lib/js/EvalExecutor.d.ts +1 -1
- package/dist/types/lib/js/EvalExecutor.d.ts.map +1 -1
- package/dist/types/lib/js/JsCodeRunner.d.ts +2 -2
- package/dist/types/lib/js/JsCodeRunner.d.ts.map +1 -1
- package/dist/types/lib/migrations/MigrationExecutionFacade.d.ts +13 -8
- package/dist/types/lib/migrations/MigrationExecutionFacade.d.ts.map +1 -1
- package/dist/types/lib/migrations/MigrationRebaseFacade.d.ts +5 -4
- package/dist/types/lib/migrations/MigrationRebaseFacade.d.ts.map +1 -1
- package/dist/types/lib/migrations/MigrationSnapshotFacade.d.ts +28 -0
- package/dist/types/lib/migrations/MigrationSnapshotFacade.d.ts.map +1 -0
- package/dist/types/lib/migrations/MigrationsStatusFacade.d.ts +2 -2
- package/dist/types/lib/migrations/MigrationsStatusFacade.d.ts.map +1 -1
- package/dist/types/lib/project/RemoteProjectProvider.d.ts +1 -1
- package/dist/types/lib/project/RemoteProjectProvider.d.ts.map +1 -1
- package/dist/types/lib/project/RemoteProjectResolver.d.ts +2 -2
- package/dist/types/lib/project/RemoteProjectResolver.d.ts.map +1 -1
- package/dist/types/lib/project/docs/components/EntityInfo.d.ts +1 -1
- package/dist/types/lib/project/docs/components/EntityInfo.d.ts.map +1 -1
- package/dist/types/lib/project/docs/components/OnDelete.d.ts +1 -1
- package/dist/types/lib/project/docs/components/OnDelete.d.ts.map +1 -1
- package/dist/types/lib/schema/SchemaLoader.d.ts +2 -2
- package/dist/types/lib/schema/SchemaLoader.d.ts.map +1 -1
- package/dist/types/lib/tenant/TenantClient.d.ts +15 -0
- package/dist/types/lib/tenant/TenantClient.d.ts.map +1 -1
- package/dist/types/lib/tenant/TenantConfigApplier.d.ts +18 -0
- package/dist/types/lib/tenant/TenantConfigApplier.d.ts.map +1 -0
- package/dist/types/lib/tenant/TenantConfigLoader.d.ts +16 -0
- package/dist/types/lib/tenant/TenantConfigLoader.d.ts.map +1 -0
- package/dist/types/lib/tenant/tenantConfig.d.ts +74 -0
- package/dist/types/lib/tenant/tenantConfig.d.ts.map +1 -0
- package/dist/types/lib/transfer/DataTransferClient.d.ts +1 -1
- package/dist/types/lib/transfer/DataTransferClient.d.ts.map +1 -1
- package/dist/types/lib/workspace/WorkspaceResolver.d.ts +2 -2
- package/dist/types/lib/workspace/WorkspaceResolver.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +33 -15
- package/src/commands/actions/ActionsGetEventCommand.ts +2 -2
- package/src/commands/actions/ActionsListFailedEventsCommand.ts +2 -2
- package/src/commands/actions/ActionsListVariablesCommand.ts +2 -2
- package/src/commands/actions/ActionsRetryEventCommand.ts +2 -2
- package/src/commands/actions/ActionsSetVariablesCommand.ts +2 -2
- package/src/commands/actions/ActionsStopEventCommand.ts +2 -2
- package/src/commands/deploy/DeployCommand.ts +13 -8
- package/src/commands/deploy/index.ts +1 -1
- package/src/commands/index.ts +6 -5
- package/src/commands/migrations/MigrationAmendCommand.ts +38 -10
- package/src/commands/migrations/MigrationDescribeCommand.ts +1 -1
- package/src/commands/migrations/MigrationDiffCommand.ts +50 -6
- package/src/commands/migrations/MigrationExecuteCommand.ts +6 -1
- package/src/commands/migrations/MigrationInitStateCommand.ts +34 -0
- package/src/commands/migrations/MigrationRebaseCommand.ts +1 -1
- package/src/commands/migrations/MigrationSnapshotCommand.ts +34 -0
- package/src/commands/migrations/MigrationStatusCommand.ts +3 -3
- package/src/commands/migrations/MigrationVerifySnapshotCommand.ts +28 -0
- package/src/commands/migrations/index.ts +10 -7
- package/src/commands/misc/index.ts +1 -1
- package/src/commands/project/ProjectGenerateDocumentationCommand.ts +3 -3
- package/src/commands/project/ProjectPrintSchemaCommand.ts +2 -2
- package/src/commands/project/ProjectValidateCommand.ts +3 -3
- package/src/commands/project/index.ts +3 -3
- package/src/commands/tenant/TenantApplyCommand.ts +57 -0
- package/src/commands/tenant/index.ts +1 -0
- package/src/commands/transfer/ExportCommand.ts +4 -4
- package/src/commands/transfer/ImportCommand.ts +6 -6
- package/src/commands/transfer/TransferCommand.ts +6 -6
- package/src/commands/transfer/index.ts +3 -3
- package/src/commands/workspace/WorkspaceUpdateApiCommand.ts +2 -2
- package/src/commands/workspace/index.ts +1 -1
- package/src/dic.ts +103 -37
- package/src/index.ts +1 -0
- package/src/lib/SystemClientProvider.ts +1 -1
- package/src/lib/TenantClientProvider.ts +2 -2
- package/src/lib/VersionChecker.ts +2 -2
- package/src/lib/admin/AdminClient.ts +2 -2
- package/src/lib/admin/AdminDeployer.ts +3 -3
- package/src/lib/fs/DockerComposeManager.ts +2 -2
- package/src/lib/fs/YamlHandler.ts +2 -2
- package/src/lib/js/EsBuildBuilder.ts +1 -1
- package/src/lib/js/EvalExecutor.ts +1 -1
- package/src/lib/js/JsCodeRunner.ts +2 -2
- package/src/lib/migrations/MigrationExecutionFacade.ts +117 -23
- package/src/lib/migrations/MigrationPrinter.ts +1 -1
- package/src/lib/migrations/MigrationRebaseFacade.ts +10 -3
- package/src/lib/migrations/MigrationSnapshotFacade.ts +218 -0
- package/src/lib/migrations/MigrationsStatusFacade.ts +2 -2
- package/src/lib/migrations/MigrationsValidator.ts +1 -1
- package/src/lib/project/RemoteProjectProvider.ts +1 -1
- package/src/lib/project/RemoteProjectResolver.ts +3 -3
- package/src/lib/project/docs/components/EntityInfo.tsx +6 -6
- package/src/lib/project/docs/components/EntityLink.tsx +1 -1
- package/src/lib/project/docs/components/FieldLink.tsx +2 -2
- package/src/lib/project/docs/components/FieldPermissions.tsx +1 -1
- package/src/lib/project/docs/components/FieldType.tsx +2 -2
- package/src/lib/project/docs/components/OnDelete.tsx +3 -3
- package/src/lib/project/docs/components/ProjectInfo.tsx +3 -3
- package/src/lib/project/docs/projectDescribe.tsx +2 -2
- package/src/lib/schema/SchemaLoader.ts +2 -2
- package/src/lib/schema/SchemaValidationHelper.ts +1 -1
- package/src/lib/tenant/TenantClient.ts +123 -14
- package/src/lib/tenant/TenantConfigApplier.ts +72 -0
- package/src/lib/tenant/TenantConfigLoader.ts +41 -0
- package/src/lib/tenant/tenantConfig.ts +101 -0
- package/src/lib/transfer/DataTransferClient.ts +2 -2
- package/src/lib/workspace/WorkspaceResolver.ts +2 -2
- package/src/run.ts +6 -6
- package/src/tsconfig.json +1 -0
- package/tenant.config.example.ts +64 -0
- package/tests/cases/unit/MigrationAmendCommand.test.ts +156 -0
- package/tests/cases/unit/MigrationExecutionFacade.test.ts +81 -0
- package/tests/cases/unit/MigrationRebaseFacade.test.ts +87 -0
- package/tests/cases/unit/MigrationSnapshotFacade.test.ts +243 -0
- package/tests/tenantConfigApplier.test.ts +87 -0
package/package.json
CHANGED
|
@@ -1,17 +1,34 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contember/cli",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.2.0-alpha.1",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"bin": {
|
|
6
6
|
"contember": "./dist/production/run.js"
|
|
7
7
|
},
|
|
8
8
|
"type": "module",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"import": {
|
|
12
|
+
"types": "./dist/types/index.d.ts",
|
|
13
|
+
"development": "./dist/development/index.js",
|
|
14
|
+
"production": "./dist/production/index.js",
|
|
15
|
+
"typescript": "./src/index.ts",
|
|
16
|
+
"default": "./dist/production/index.js"
|
|
17
|
+
},
|
|
18
|
+
"require": {
|
|
19
|
+
"types": "./dist/types/index.d.ts",
|
|
20
|
+
"development": "./dist/development/index.cjs",
|
|
21
|
+
"production": "./dist/production/index.cjs",
|
|
22
|
+
"typescript": "./src/index.ts",
|
|
23
|
+
"default": "./dist/production/index.cjs"
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
},
|
|
9
27
|
"scripts": {
|
|
10
28
|
"build": "tailwindcss -i src/lib/project/docs/resources/style.css -o ./dist/resources/out.css"
|
|
11
29
|
},
|
|
12
30
|
"devDependencies": {
|
|
13
31
|
"@tailwindcss/cli": "^4.2.1",
|
|
14
|
-
"@types/fs-extra": "^11.0.4",
|
|
15
32
|
"@types/js-yaml": "^4.0.9",
|
|
16
33
|
"@types/node": "^24.12.0",
|
|
17
34
|
"@types/prompts": "^2.4.9",
|
|
@@ -19,25 +36,26 @@
|
|
|
19
36
|
"tailwindcss": "^4.2.1"
|
|
20
37
|
},
|
|
21
38
|
"dependencies": {
|
|
22
|
-
"@contember/cli-common": "2.1.0-beta.
|
|
23
|
-
"@contember/config-loader": "2.1.0-beta.
|
|
24
|
-
"@contember/database": "2.1.0-beta.
|
|
25
|
-
"@contember/dic": "2.1.0-beta.
|
|
26
|
-
"@contember/engine-common": "2.1.0-beta.
|
|
27
|
-
"@contember/engine-content-api": "2.1.0-beta.
|
|
28
|
-
"@contember/graphql-client": "2.1.0-beta.
|
|
29
|
-
"@contember/
|
|
30
|
-
"@contember/
|
|
31
|
-
"@contember/schema
|
|
32
|
-
"@contember/schema-
|
|
33
|
-
"@contember/
|
|
39
|
+
"@contember/cli-common": "2.1.0-beta.2",
|
|
40
|
+
"@contember/config-loader": "2.1.0-beta.2",
|
|
41
|
+
"@contember/database": "2.1.0-beta.2",
|
|
42
|
+
"@contember/dic": "2.1.0-beta.2",
|
|
43
|
+
"@contember/engine-common": "2.1.0-beta.2",
|
|
44
|
+
"@contember/engine-content-api": "2.1.0-beta.2",
|
|
45
|
+
"@contember/graphql-client": "2.1.0-beta.2",
|
|
46
|
+
"@contember/graphql-client-tenant": "2.1.0-beta.2",
|
|
47
|
+
"@contember/migrations-client": "2.1.0-beta.2",
|
|
48
|
+
"@contember/schema": "2.1.0-beta.2",
|
|
49
|
+
"@contember/schema-migrations": "2.1.0-beta.2",
|
|
50
|
+
"@contember/schema-utils": "2.1.0-beta.2",
|
|
51
|
+
"@contember/typesafe": "2.1.0-beta.2",
|
|
34
52
|
"@graphql-tools/schema": "^10.0.31",
|
|
35
53
|
"chalk": "^5.6.2",
|
|
36
54
|
"chalk-table": "^1.0.2",
|
|
37
55
|
"fast-glob": "^3.3.3",
|
|
38
56
|
"graphql": "^16.13.1",
|
|
57
|
+
"graphql-ts-client-api": "^3.1.17",
|
|
39
58
|
"js-yaml": "^4.1.1",
|
|
40
|
-
"lodash-es": "^4.17.23",
|
|
41
59
|
"pg": "^8.20.0",
|
|
42
60
|
"preact": "^10.28.4",
|
|
43
61
|
"preact-render-to-string": "^6.6.6",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command, CommandConfiguration, Input } from '@contember/cli-common'
|
|
2
|
-
import { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver'
|
|
3
|
-
import { ActionsClient } from '../../lib/actions/ActionsClient'
|
|
2
|
+
import { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver.js'
|
|
3
|
+
import { ActionsClient } from '../../lib/actions/ActionsClient.js'
|
|
4
4
|
|
|
5
5
|
type Args = {
|
|
6
6
|
eventId: string
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command, CommandConfiguration, Input } from '@contember/cli-common'
|
|
2
|
-
import { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver'
|
|
3
|
-
import { ActionsClient } from '../../lib/actions/ActionsClient'
|
|
2
|
+
import { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver.js'
|
|
3
|
+
import { ActionsClient } from '../../lib/actions/ActionsClient.js'
|
|
4
4
|
import chalkTable from 'chalk-table'
|
|
5
5
|
type Args = {}
|
|
6
6
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command, CommandConfiguration, Input } from '@contember/cli-common'
|
|
2
|
-
import { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver'
|
|
3
|
-
import { ActionsClient } from '../../lib/actions/ActionsClient'
|
|
2
|
+
import { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver.js'
|
|
3
|
+
import { ActionsClient } from '../../lib/actions/ActionsClient.js'
|
|
4
4
|
import chalkTable from 'chalk-table'
|
|
5
5
|
|
|
6
6
|
type Args = {}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command, CommandConfiguration, Input } from '@contember/cli-common'
|
|
2
|
-
import { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver'
|
|
3
|
-
import { ActionsClient } from '../../lib/actions/ActionsClient'
|
|
2
|
+
import { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver.js'
|
|
3
|
+
import { ActionsClient } from '../../lib/actions/ActionsClient.js'
|
|
4
4
|
import chalkTable from 'chalk-table'
|
|
5
5
|
type Args = {
|
|
6
6
|
eventId: string
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command, CommandConfiguration, Input } from '@contember/cli-common'
|
|
2
|
-
import { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver'
|
|
3
|
-
import { ActionsClient } from '../../lib/actions/ActionsClient'
|
|
2
|
+
import { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver.js'
|
|
3
|
+
import { ActionsClient } from '../../lib/actions/ActionsClient.js'
|
|
4
4
|
|
|
5
5
|
type Args = {
|
|
6
6
|
variables: string[]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command, CommandConfiguration, Input } from '@contember/cli-common'
|
|
2
|
-
import { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver'
|
|
3
|
-
import { ActionsClient } from '../../lib/actions/ActionsClient'
|
|
2
|
+
import { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver.js'
|
|
3
|
+
import { ActionsClient } from '../../lib/actions/ActionsClient.js'
|
|
4
4
|
import chalkTable from 'chalk-table'
|
|
5
5
|
type Args = {
|
|
6
6
|
eventId: string
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { Command, CommandConfiguration, Input } from '@contember/cli-common'
|
|
2
2
|
import prompts from 'prompts'
|
|
3
|
-
import { maskToken } from '../../lib/maskToken'
|
|
4
|
-
import { MigrationExecutionFacade } from '../../lib/migrations/MigrationExecutionFacade'
|
|
5
|
-
import { AdminDeployer } from '../../lib/admin/AdminDeployer'
|
|
6
|
-
import { FileSystem } from '../../lib/fs/FileSystem'
|
|
7
|
-
import { RemoteProject } from '../../lib/project/RemoteProject'
|
|
8
|
-
import { Workspace } from '../../lib/workspace/Workspace'
|
|
9
|
-
import { RemoteProjectProvider } from '../../lib/project/RemoteProjectProvider'
|
|
10
|
-
import { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver'
|
|
3
|
+
import { maskToken } from '../../lib/maskToken.js'
|
|
4
|
+
import { MigrationExecutionFacade } from '../../lib/migrations/MigrationExecutionFacade.js'
|
|
5
|
+
import { AdminDeployer } from '../../lib/admin/AdminDeployer.js'
|
|
6
|
+
import { FileSystem } from '../../lib/fs/FileSystem.js'
|
|
7
|
+
import { RemoteProject } from '../../lib/project/RemoteProject.js'
|
|
8
|
+
import { Workspace } from '../../lib/workspace/Workspace.js'
|
|
9
|
+
import { RemoteProjectProvider } from '../../lib/project/RemoteProjectProvider.js'
|
|
10
|
+
import { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver.js'
|
|
11
11
|
|
|
12
12
|
type Args = {
|
|
13
13
|
dsn?: string
|
|
@@ -19,6 +19,7 @@ type Options = {
|
|
|
19
19
|
['no-migrations']?: boolean
|
|
20
20
|
root?: boolean
|
|
21
21
|
yes?: boolean
|
|
22
|
+
snapshot?: boolean
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
export class DeployCommand extends Command<Args, Options> {
|
|
@@ -41,6 +42,9 @@ export class DeployCommand extends Command<Args, Options> {
|
|
|
41
42
|
configuration.option('root').valueNone()
|
|
42
43
|
configuration.option('no-admin').valueNone()
|
|
43
44
|
configuration.option('no-migrations').valueNone()
|
|
45
|
+
configuration.option('snapshot')
|
|
46
|
+
.valueNone()
|
|
47
|
+
.description('Bootstrap an empty target database from snapshot.json instead of replaying every migration')
|
|
44
48
|
configuration //
|
|
45
49
|
.option('yes')
|
|
46
50
|
.valueNone()
|
|
@@ -79,6 +83,7 @@ export class DeployCommand extends Command<Args, Options> {
|
|
|
79
83
|
force: false,
|
|
80
84
|
requireConfirmation: !yes,
|
|
81
85
|
additionalMessage: deployAdmin ? 'Admin will be deployed.' : 'Admin will NOT be deployed.',
|
|
86
|
+
useSnapshot: input.getOption('snapshot') === true,
|
|
82
87
|
})
|
|
83
88
|
if (!result) {
|
|
84
89
|
return
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './DeployCommand'
|
|
1
|
+
export * from './DeployCommand.js'
|
package/src/commands/index.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export * from './deploy'
|
|
2
|
-
export * from './migrations'
|
|
3
|
-
export * from './misc'
|
|
4
|
-
export * from './project'
|
|
5
|
-
export * from './
|
|
1
|
+
export * from './deploy/index.js'
|
|
2
|
+
export * from './migrations/index.js'
|
|
3
|
+
export * from './misc/index.js'
|
|
4
|
+
export * from './project/index.js'
|
|
5
|
+
export * from './tenant/index.js'
|
|
6
|
+
export * from './workspace/index.js'
|
|
@@ -2,13 +2,13 @@ import { Command, CommandConfiguration, Input } from '@contember/cli-common'
|
|
|
2
2
|
import { InvalidSchemaException, SchemaMigrator } from '@contember/schema-migrations'
|
|
3
3
|
import prompts from 'prompts'
|
|
4
4
|
import { emptySchema } from '@contember/schema-utils'
|
|
5
|
-
import { MigrationCreator, MigrationsResolver,
|
|
6
|
-
import { MigrationsStatusFacade } from '../../lib/migrations/MigrationsStatusFacade'
|
|
7
|
-
import { SchemaLoader } from '../../lib/schema/SchemaLoader'
|
|
8
|
-
import { MigrationsValidator } from '../../lib/migrations/MigrationsValidator'
|
|
9
|
-
import { MigrationPrinter } from '../../lib/migrations/MigrationPrinter'
|
|
10
|
-
import { printValidationErrors } from '../../lib/schema/SchemaValidationPrinter'
|
|
11
|
-
import { SystemClientProvider } from '../../lib/SystemClientProvider'
|
|
5
|
+
import { MigrationCreator, MigrationsResolver, SchemaStateManager, SchemaVersionBuilder } from '@contember/migrations-client'
|
|
6
|
+
import { MigrationsStatusFacade } from '../../lib/migrations/MigrationsStatusFacade.js'
|
|
7
|
+
import { SchemaLoader } from '../../lib/schema/SchemaLoader.js'
|
|
8
|
+
import { MigrationsValidator } from '../../lib/migrations/MigrationsValidator.js'
|
|
9
|
+
import { MigrationPrinter } from '../../lib/migrations/MigrationPrinter.js'
|
|
10
|
+
import { printValidationErrors } from '../../lib/schema/SchemaValidationPrinter.js'
|
|
11
|
+
import { SystemClientProvider } from '../../lib/SystemClientProvider.js'
|
|
12
12
|
|
|
13
13
|
type Args = {
|
|
14
14
|
migration?: string
|
|
@@ -30,6 +30,7 @@ export class MigrationAmendCommand extends Command<Args, Options> {
|
|
|
30
30
|
private readonly migrationsValidator: MigrationsValidator,
|
|
31
31
|
private readonly migrationPrinter: MigrationPrinter,
|
|
32
32
|
private readonly schemaMigrator: SchemaMigrator,
|
|
33
|
+
private readonly schemaStateManager: SchemaStateManager,
|
|
33
34
|
) {
|
|
34
35
|
super()
|
|
35
36
|
}
|
|
@@ -59,11 +60,23 @@ export class MigrationAmendCommand extends Command<Args, Options> {
|
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
const schema = await this.schemaLoader.loadSchema()
|
|
63
|
+
const stateMode = await this.schemaStateManager.isStateMode()
|
|
62
64
|
try {
|
|
63
65
|
const initialSchema = await this.schemaVersionBuilder.buildSchema()
|
|
64
|
-
const intermediateResult = await this.migrationCreator.prepareMigration(initialSchema, schema, ''
|
|
66
|
+
const intermediateResult = await this.migrationCreator.prepareMigration(initialSchema, schema, '', {
|
|
67
|
+
skipNonModelDiffers: stateMode,
|
|
68
|
+
})
|
|
69
|
+
|
|
70
|
+
const schemaState = stateMode ? SchemaStateManager.schemaStateFromSchema(schema) : undefined
|
|
71
|
+
const stateChanged = schemaState ? await this.schemaStateManager.writeState(schemaState, { dryRun: true }) : false
|
|
72
|
+
|
|
65
73
|
if (intermediateResult === null) {
|
|
66
|
-
|
|
74
|
+
if (stateChanged) {
|
|
75
|
+
await this.schemaStateManager.writeState(schemaState!)
|
|
76
|
+
console.log('Schema state updated (no model changes)')
|
|
77
|
+
} else {
|
|
78
|
+
console.log('Nothing to do')
|
|
79
|
+
}
|
|
67
80
|
return 0
|
|
68
81
|
}
|
|
69
82
|
if (amendMigration.formatVersion !== intermediateResult.migration.formatVersion) {
|
|
@@ -78,7 +91,9 @@ export class MigrationAmendCommand extends Command<Args, Options> {
|
|
|
78
91
|
[...amendMigration.modifications, ...intermediateResult.migration.modifications],
|
|
79
92
|
amendMigration.formatVersion,
|
|
80
93
|
)
|
|
81
|
-
const newMigrationResult = await this.migrationCreator.prepareMigration(prevSchema, newSchema, ''
|
|
94
|
+
const newMigrationResult = await this.migrationCreator.prepareMigration(prevSchema, newSchema, '', {
|
|
95
|
+
skipNonModelDiffers: stateMode,
|
|
96
|
+
})
|
|
82
97
|
const followingMigrations = (await this.migrationsResolver.getSchemaMigrations()).filter(
|
|
83
98
|
it => it.version > amendMigration.version,
|
|
84
99
|
)
|
|
@@ -108,6 +123,12 @@ export class MigrationAmendCommand extends Command<Args, Options> {
|
|
|
108
123
|
if (!newMigrationResult && await this.shouldRemove()) {
|
|
109
124
|
await this.migrationCreator.removeMigration(amendMigration.name)
|
|
110
125
|
await systemClient.migrationDelete(amendMigration.version)
|
|
126
|
+
if (schemaState) {
|
|
127
|
+
await this.schemaStateManager.writeState(schemaState)
|
|
128
|
+
// migrationDelete rebuilds the server schema from migrations, dropping the
|
|
129
|
+
// non-model state; re-apply it so the server stays in sync with the state files.
|
|
130
|
+
await systemClient.migrate([], force, schemaState)
|
|
131
|
+
}
|
|
111
132
|
console.log('Latest migration was removed')
|
|
112
133
|
return 0
|
|
113
134
|
}
|
|
@@ -120,6 +141,13 @@ export class MigrationAmendCommand extends Command<Args, Options> {
|
|
|
120
141
|
await this.migrationCreator.saveMigration(newMigration)
|
|
121
142
|
await systemClient.migrationModify(amendMigration.version, newMigration)
|
|
122
143
|
|
|
144
|
+
if (schemaState) {
|
|
145
|
+
await this.schemaStateManager.writeState(schemaState)
|
|
146
|
+
// migrationModify rebuilds the server schema from migrations, dropping the
|
|
147
|
+
// non-model state; re-apply it so the server stays in sync with the state files.
|
|
148
|
+
await systemClient.migrate([], force, schemaState)
|
|
149
|
+
}
|
|
150
|
+
|
|
123
151
|
return 0
|
|
124
152
|
} catch (e) {
|
|
125
153
|
if (e instanceof InvalidSchemaException) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command, CommandConfiguration, Input } from '@contember/cli-common'
|
|
2
|
-
import { MigrationPrinter } from '../../lib/migrations/MigrationPrinter'
|
|
2
|
+
import { MigrationPrinter } from '../../lib/migrations/MigrationPrinter.js'
|
|
3
3
|
import { MigrationsResolver, SchemaVersionBuilder } from '@contember/migrations-client'
|
|
4
4
|
|
|
5
5
|
type Args = {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { Command, CommandConfiguration, Input } from '@contember/cli-common'
|
|
2
2
|
import { InvalidSchemaException } from '@contember/schema-migrations'
|
|
3
3
|
import prompts from 'prompts'
|
|
4
|
-
import { MigrationCreator, SchemaVersionBuilder } from '@contember/migrations-client'
|
|
5
|
-
import { SchemaLoader } from '../../lib/schema/SchemaLoader'
|
|
6
|
-
import { MigrationPrinter } from '../../lib/migrations/MigrationPrinter'
|
|
7
|
-
import { MigrationExecutionFacade } from '../../lib/migrations/MigrationExecutionFacade'
|
|
8
|
-
import { printValidationErrors } from '../../lib/schema/SchemaValidationPrinter'
|
|
4
|
+
import { MigrationCreator, MigrationsResolver, SchemaStateManager, SchemaVersionBuilder } from '@contember/migrations-client'
|
|
5
|
+
import { SchemaLoader } from '../../lib/schema/SchemaLoader.js'
|
|
6
|
+
import { MigrationPrinter } from '../../lib/migrations/MigrationPrinter.js'
|
|
7
|
+
import { MigrationExecutionFacade } from '../../lib/migrations/MigrationExecutionFacade.js'
|
|
8
|
+
import { printValidationErrors } from '../../lib/schema/SchemaValidationPrinter.js'
|
|
9
9
|
|
|
10
10
|
type Args = {
|
|
11
11
|
migrationName: string
|
|
@@ -15,6 +15,7 @@ type Options = {
|
|
|
15
15
|
execute?: true
|
|
16
16
|
yes?: true
|
|
17
17
|
'skip-initial-schema-validation'?: true
|
|
18
|
+
'recreate-views'?: true
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
export class MigrationDiffCommand extends Command<Args, Options> {
|
|
@@ -24,6 +25,8 @@ export class MigrationDiffCommand extends Command<Args, Options> {
|
|
|
24
25
|
private readonly migrationCreator: MigrationCreator,
|
|
25
26
|
private readonly migrationPrinter: MigrationPrinter,
|
|
26
27
|
private readonly migrationExecutorFacade: MigrationExecutionFacade,
|
|
28
|
+
private readonly schemaStateManager: SchemaStateManager,
|
|
29
|
+
private readonly migrationsResolver: MigrationsResolver,
|
|
27
30
|
) {
|
|
28
31
|
super()
|
|
29
32
|
}
|
|
@@ -38,6 +41,12 @@ export class MigrationDiffCommand extends Command<Args, Options> {
|
|
|
38
41
|
.description('Do not ask for confirmation.')
|
|
39
42
|
|
|
40
43
|
configuration.option('skip-initial-schema-validation')
|
|
44
|
+
configuration //
|
|
45
|
+
.option('recreate-views')
|
|
46
|
+
.valueNone()
|
|
47
|
+
.description(
|
|
48
|
+
'Drop & recreate changed views instead of updating them in-place (CREATE OR REPLACE VIEW). Use when an in-place view update fails with SQLSTATE 42P16.',
|
|
49
|
+
)
|
|
41
50
|
}
|
|
42
51
|
|
|
43
52
|
protected async execute(input: Input<Args, Options>): Promise<void> {
|
|
@@ -45,15 +54,44 @@ export class MigrationDiffCommand extends Command<Args, Options> {
|
|
|
45
54
|
let shouldExecute = input.getOption('execute')
|
|
46
55
|
const yes = input.getOption('yes')
|
|
47
56
|
const skipInitialSchemaValidation = input.getOption('skip-initial-schema-validation') === true
|
|
57
|
+
const recreateViews = input.getOption('recreate-views') === true
|
|
48
58
|
|
|
49
59
|
const schema = await this.schemaLoader.loadSchema()
|
|
60
|
+
let stateMode = await this.schemaStateManager.isStateMode()
|
|
61
|
+
|
|
62
|
+
// New project (no migrations yet) defaults to schema state mode. To opt out, create a migration first (e.g. `migrations:blank`).
|
|
63
|
+
if (!stateMode && (await this.migrationsResolver.getSchemaMigrations()).length === 0) {
|
|
64
|
+
console.log('No migrations found — enabling schema state mode for this project.')
|
|
65
|
+
console.log('ACL, validation, actions and settings will be managed in the state/ directory instead of migrations.')
|
|
66
|
+
await this.schemaStateManager.extractState(schema)
|
|
67
|
+
stateMode = true
|
|
68
|
+
}
|
|
69
|
+
|
|
50
70
|
try {
|
|
51
71
|
const initialSchema = await this.schemaVersionBuilder.buildSchema()
|
|
52
72
|
const result = await this.migrationCreator.prepareMigration(initialSchema, schema, migrationName, {
|
|
53
73
|
skipInitialSchemaValidation: skipInitialSchemaValidation,
|
|
74
|
+
skipNonModelDiffers: stateMode,
|
|
75
|
+
recreateViews,
|
|
54
76
|
})
|
|
77
|
+
|
|
78
|
+
const schemaState = stateMode ? SchemaStateManager.schemaStateFromSchema(schema) : undefined
|
|
79
|
+
const stateChanged = schemaState ? await this.schemaStateManager.writeState(schemaState, { dryRun: true }) : false
|
|
80
|
+
|
|
55
81
|
if (result === null) {
|
|
56
|
-
|
|
82
|
+
if (stateChanged) {
|
|
83
|
+
console.log('Schema state updated (no model changes)')
|
|
84
|
+
await this.schemaStateManager.writeState(schemaState!)
|
|
85
|
+
} else {
|
|
86
|
+
console.log('Nothing to do')
|
|
87
|
+
}
|
|
88
|
+
if (stateChanged && shouldExecute) {
|
|
89
|
+
console.log('Syncing schema state to server...')
|
|
90
|
+
await this.migrationExecutorFacade.execute({
|
|
91
|
+
force: false,
|
|
92
|
+
requireConfirmation: false,
|
|
93
|
+
})
|
|
94
|
+
}
|
|
57
95
|
return
|
|
58
96
|
}
|
|
59
97
|
this.migrationPrinter.printMigrationDescription(result.initialSchema, result.migration, { noSql: true })
|
|
@@ -79,8 +117,14 @@ export class MigrationDiffCommand extends Command<Args, Options> {
|
|
|
79
117
|
}
|
|
80
118
|
|
|
81
119
|
const filename = await this.migrationCreator.saveMigration(result.migration)
|
|
120
|
+
if (stateChanged) {
|
|
121
|
+
await this.schemaStateManager.writeState(schemaState!)
|
|
122
|
+
}
|
|
82
123
|
|
|
83
124
|
console.log(`${filename} created`)
|
|
125
|
+
if (stateChanged) {
|
|
126
|
+
console.log('Schema state files updated')
|
|
127
|
+
}
|
|
84
128
|
} catch (e) {
|
|
85
129
|
if (e instanceof InvalidSchemaException) {
|
|
86
130
|
printValidationErrors(e.validationErrors, e.message)
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command, CommandConfiguration, Input } from '@contember/cli-common'
|
|
2
|
-
import { MigrationExecutionFacade } from '../../lib/migrations/MigrationExecutionFacade'
|
|
2
|
+
import { MigrationExecutionFacade } from '../../lib/migrations/MigrationExecutionFacade.js'
|
|
3
3
|
|
|
4
4
|
type Args = {}
|
|
5
5
|
|
|
@@ -7,6 +7,7 @@ type Options = {
|
|
|
7
7
|
until?: string
|
|
8
8
|
force: boolean
|
|
9
9
|
yes?: boolean
|
|
10
|
+
['no-snapshot']?: boolean
|
|
10
11
|
}
|
|
11
12
|
|
|
12
13
|
export class MigrationExecuteCommand extends Command<Args, Options> {
|
|
@@ -23,6 +24,9 @@ export class MigrationExecuteCommand extends Command<Args, Options> {
|
|
|
23
24
|
configuration.option('until')
|
|
24
25
|
.valueRequired()
|
|
25
26
|
.description('Execute all migrations leading up to, and inclusive of, a specified migration')
|
|
27
|
+
configuration.option('no-snapshot')
|
|
28
|
+
.valueNone()
|
|
29
|
+
.description('Do not bootstrap a fresh database from snapshot.json; replay every migration instead')
|
|
26
30
|
configuration //
|
|
27
31
|
.option('yes')
|
|
28
32
|
.valueNone()
|
|
@@ -37,6 +41,7 @@ export class MigrationExecuteCommand extends Command<Args, Options> {
|
|
|
37
41
|
force,
|
|
38
42
|
until,
|
|
39
43
|
requireConfirmation: !input.getOption('yes'),
|
|
44
|
+
useSnapshot: input.getOption('no-snapshot') !== true,
|
|
40
45
|
})
|
|
41
46
|
}
|
|
42
47
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Command, CommandConfiguration, Input } from '@contember/cli-common'
|
|
2
|
+
import { SchemaStateManager } from '@contember/migrations-client'
|
|
3
|
+
import { SchemaLoader } from '../../lib/schema/SchemaLoader.js'
|
|
4
|
+
|
|
5
|
+
type Args = {}
|
|
6
|
+
|
|
7
|
+
type Options = {}
|
|
8
|
+
|
|
9
|
+
export class MigrationInitStateCommand extends Command<Args, Options> {
|
|
10
|
+
constructor(
|
|
11
|
+
private readonly schemaLoader: SchemaLoader,
|
|
12
|
+
private readonly schemaStateManager: SchemaStateManager,
|
|
13
|
+
) {
|
|
14
|
+
super()
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
protected configure(configuration: CommandConfiguration<Args, Options>): void {
|
|
18
|
+
configuration.description('Enables schema state mode by extracting ACL, validation, actions and settings into the state/ directory')
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
protected async execute(): Promise<number> {
|
|
22
|
+
if (await this.schemaStateManager.isStateMode()) {
|
|
23
|
+
console.log('Schema state mode is already enabled')
|
|
24
|
+
return 0
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const schema = await this.schemaLoader.loadSchema()
|
|
28
|
+
await this.schemaStateManager.extractState(schema)
|
|
29
|
+
|
|
30
|
+
console.log('Schema state mode enabled. ACL, validation, actions and settings are now managed in the state/ directory.')
|
|
31
|
+
console.log('These parts of the schema will no longer be written into migrations.')
|
|
32
|
+
return 0
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Command, CommandConfiguration, Input } from '@contember/cli-common'
|
|
2
2
|
import { Migration, MigrationsResolver } from '@contember/migrations-client'
|
|
3
|
-
import { MigrationRebaseFacade } from '../../lib/migrations/MigrationRebaseFacade'
|
|
3
|
+
import { MigrationRebaseFacade } from '../../lib/migrations/MigrationRebaseFacade.js'
|
|
4
4
|
|
|
5
5
|
type Args = {
|
|
6
6
|
migration: string[]
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Command, CommandConfiguration, Input } from '@contember/cli-common'
|
|
2
|
+
import { MigrationSnapshotFacade } from '../../lib/migrations/MigrationSnapshotFacade.js'
|
|
3
|
+
|
|
4
|
+
type Args = {}
|
|
5
|
+
|
|
6
|
+
type Options = {}
|
|
7
|
+
|
|
8
|
+
export class MigrationSnapshotCommand extends Command<Args, Options> {
|
|
9
|
+
constructor(
|
|
10
|
+
private readonly migrationSnapshotFacade: MigrationSnapshotFacade,
|
|
11
|
+
) {
|
|
12
|
+
super()
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
protected configure(configuration: CommandConfiguration<Args, Options>): void {
|
|
16
|
+
configuration.description(
|
|
17
|
+
'Creates a schema snapshot (snapshot.json) that bootstraps a fresh database in one step instead of replaying every migration',
|
|
18
|
+
)
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
protected async execute(input: Input<Args, Options>): Promise<number> {
|
|
22
|
+
const snapshot = await this.migrationSnapshotFacade.create()
|
|
23
|
+
console.log(`Snapshot created: ${snapshot.covers.length} migrations collapsed up to ${snapshot.version}.`)
|
|
24
|
+
|
|
25
|
+
if (snapshot.contentMigrations.length > 0) {
|
|
26
|
+
console.warn('')
|
|
27
|
+
console.warn(`Warning: ${snapshot.contentMigrations.length} content (data) migration(s) are covered by this snapshot:`)
|
|
28
|
+
snapshot.contentMigrations.forEach(version => console.warn(` - ${version}`))
|
|
29
|
+
console.warn('Their data effects are NOT reproduced when bootstrapping from the snapshot.')
|
|
30
|
+
console.warn('Seed any required data manually for local development.')
|
|
31
|
+
}
|
|
32
|
+
return 0
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Command, CommandConfiguration, Input } from '@contember/cli-common'
|
|
2
2
|
import { MigrationFilesManager, MigrationState, sortMigrations, SystemClient } from '@contember/migrations-client'
|
|
3
3
|
import chalk from 'chalk'
|
|
4
|
-
import { MigrationsStatusFacade } from '../../lib/migrations/MigrationsStatusFacade'
|
|
5
|
-
import { MigrationPrinter } from '../../lib/migrations/MigrationPrinter'
|
|
6
|
-
import { SystemClientProvider } from '../../lib/SystemClientProvider'
|
|
4
|
+
import { MigrationsStatusFacade } from '../../lib/migrations/MigrationsStatusFacade.js'
|
|
5
|
+
import { MigrationPrinter } from '../../lib/migrations/MigrationPrinter.js'
|
|
6
|
+
import { SystemClientProvider } from '../../lib/SystemClientProvider.js'
|
|
7
7
|
|
|
8
8
|
type Args = {}
|
|
9
9
|
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Command, CommandConfiguration, Input } from '@contember/cli-common'
|
|
2
|
+
import { MigrationSnapshotFacade } from '../../lib/migrations/MigrationSnapshotFacade.js'
|
|
3
|
+
|
|
4
|
+
type Args = {}
|
|
5
|
+
|
|
6
|
+
type Options = {}
|
|
7
|
+
|
|
8
|
+
export class MigrationVerifySnapshotCommand extends Command<Args, Options> {
|
|
9
|
+
constructor(
|
|
10
|
+
private readonly migrationSnapshotFacade: MigrationSnapshotFacade,
|
|
11
|
+
) {
|
|
12
|
+
super()
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
protected configure(configuration: CommandConfiguration<Args, Options>): void {
|
|
16
|
+
configuration.description('Verifies that snapshot.json still matches a full replay of all migrations')
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
protected async execute(input: Input<Args, Options>): Promise<number> {
|
|
20
|
+
const result = await this.migrationSnapshotFacade.verify()
|
|
21
|
+
if (result.ok) {
|
|
22
|
+
console.log(result.message)
|
|
23
|
+
return 0
|
|
24
|
+
}
|
|
25
|
+
console.error(result.message)
|
|
26
|
+
return 1
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
export * from './MigrationAmendCommand'
|
|
2
|
-
export * from './MigrationBlankCommand'
|
|
3
|
-
export * from './MigrationDescribeCommand'
|
|
4
|
-
export * from './MigrationDiffCommand'
|
|
5
|
-
export * from './MigrationExecuteCommand'
|
|
6
|
-
export * from './
|
|
7
|
-
export * from './
|
|
1
|
+
export * from './MigrationAmendCommand.js'
|
|
2
|
+
export * from './MigrationBlankCommand.js'
|
|
3
|
+
export * from './MigrationDescribeCommand.js'
|
|
4
|
+
export * from './MigrationDiffCommand.js'
|
|
5
|
+
export * from './MigrationExecuteCommand.js'
|
|
6
|
+
export * from './MigrationInitStateCommand.js'
|
|
7
|
+
export * from './MigrationStatusCommand.js'
|
|
8
|
+
export * from './MigrationRebaseCommand.js'
|
|
9
|
+
export * from './MigrationSnapshotCommand.js'
|
|
10
|
+
export * from './MigrationVerifySnapshotCommand.js'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './VersionCommand'
|
|
1
|
+
export * from './VersionCommand.js'
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Command, CommandConfiguration, Input } from '@contember/cli-common'
|
|
2
|
-
import { renderProjectInfoHtml } from '../../lib/project/docs/projectDescribe'
|
|
2
|
+
import { renderProjectInfoHtml } from '../../lib/project/docs/projectDescribe.js'
|
|
3
3
|
import { writeFile } from 'node:fs/promises'
|
|
4
4
|
import { join } from 'node:path'
|
|
5
|
-
import { SchemaLoader } from '../../lib/schema/SchemaLoader'
|
|
6
|
-
import { validateSchemaAndPrintErrors } from '../../lib/schema/SchemaValidationHelper'
|
|
5
|
+
import { SchemaLoader } from '../../lib/schema/SchemaLoader.js'
|
|
6
|
+
import { validateSchemaAndPrintErrors } from '../../lib/schema/SchemaValidationHelper.js'
|
|
7
7
|
import { SchemaVersionBuilder } from '@contember/migrations-client'
|
|
8
8
|
|
|
9
9
|
type Args = {}
|
|
@@ -10,9 +10,9 @@ import {
|
|
|
10
10
|
import { printSchema } from 'graphql'
|
|
11
11
|
import { mergeSchemas } from '@graphql-tools/schema'
|
|
12
12
|
import { emptySchema, normalizeSchema } from '@contember/schema-utils'
|
|
13
|
-
import { SchemaLoader } from '../../lib/schema/SchemaLoader'
|
|
13
|
+
import { SchemaLoader } from '../../lib/schema/SchemaLoader.js'
|
|
14
14
|
import { SchemaVersionBuilder } from '@contember/migrations-client'
|
|
15
|
-
import { validateSchemaAndPrintErrors } from '../../lib/schema/SchemaValidationHelper'
|
|
15
|
+
import { validateSchemaAndPrintErrors } from '../../lib/schema/SchemaValidationHelper.js'
|
|
16
16
|
|
|
17
17
|
type Args = {}
|
|
18
18
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Command, CommandConfiguration } from '@contember/cli-common'
|
|
2
2
|
import { emptySchema } from '@contember/schema-utils'
|
|
3
|
-
import { SchemaLoader } from '../../lib/schema/SchemaLoader'
|
|
4
|
-
import { validateSchemaAndPrintErrors } from '../../lib/schema/SchemaValidationHelper'
|
|
5
|
-
import { MigrationsValidator } from '../../lib/migrations/MigrationsValidator'
|
|
3
|
+
import { SchemaLoader } from '../../lib/schema/SchemaLoader.js'
|
|
4
|
+
import { validateSchemaAndPrintErrors } from '../../lib/schema/SchemaValidationHelper.js'
|
|
5
|
+
import { MigrationsValidator } from '../../lib/migrations/MigrationsValidator.js'
|
|
6
6
|
import { MigrationsResolver, SchemaVersionBuilder } from '@contember/migrations-client'
|
|
7
7
|
import { SchemaDiffer } from '@contember/schema-migrations'
|
|
8
8
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './ProjectGenerateDocumentationCommand'
|
|
2
|
-
export * from './ProjectPrintSchemaCommand'
|
|
3
|
-
export * from './ProjectValidateCommand'
|
|
1
|
+
export * from './ProjectGenerateDocumentationCommand.js'
|
|
2
|
+
export * from './ProjectPrintSchemaCommand.js'
|
|
3
|
+
export * from './ProjectValidateCommand.js'
|