@contember/cli 2.0.0-alpha.9 → 2.0.0-beta.2
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/contember-docker.sh +0 -0
- package/dist/development/run.cjs.map +1 -1
- package/dist/development/run.js.map +1 -1
- package/dist/development/src/commands/deploy/DeployCommand.cjs +5 -5
- package/dist/development/src/commands/deploy/DeployCommand.cjs.map +1 -1
- package/dist/development/src/commands/deploy/DeployCommand.js +5 -5
- package/dist/development/src/commands/deploy/DeployCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationAmendCommand.cjs +15 -3
- package/dist/development/src/commands/migrations/MigrationAmendCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationAmendCommand.js +15 -3
- package/dist/development/src/commands/migrations/MigrationAmendCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationBlankCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationBlankCommand.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 +1 -1
- package/dist/development/src/commands/migrations/MigrationDiffCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationDiffCommand.js +1 -1
- package/dist/development/src/commands/migrations/MigrationDiffCommand.js.map +1 -1
- package/dist/development/src/commands/migrations/MigrationExecuteCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationExecuteCommand.js.map +1 -1
- 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/MigrationStatusCommand.cjs.map +1 -1
- package/dist/development/src/commands/migrations/MigrationStatusCommand.js.map +1 -1
- package/dist/development/src/commands/misc/VersionCommand.cjs.map +1 -1
- package/dist/development/src/commands/misc/VersionCommand.js.map +1 -1
- 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 +13 -2
- package/dist/development/src/commands/project/ProjectPrintSchemaCommand.cjs.map +1 -1
- package/dist/development/src/commands/project/ProjectPrintSchemaCommand.js +14 -3
- 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/transfer/ExportCommand.cjs +2 -0
- package/dist/development/src/commands/transfer/ExportCommand.cjs.map +1 -1
- package/dist/development/src/commands/transfer/ExportCommand.js +2 -0
- 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 +2 -0
- package/dist/development/src/commands/transfer/TransferCommand.cjs.map +1 -1
- package/dist/development/src/commands/transfer/TransferCommand.js +2 -0
- package/dist/development/src/commands/transfer/TransferCommand.js.map +1 -1
- package/dist/development/src/commands/transfer/utils.cjs.map +1 -1
- package/dist/development/src/commands/transfer/utils.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 +3 -1
- package/dist/development/src/consts.cjs.map +1 -1
- package/dist/development/src/consts.js +4 -2
- package/dist/development/src/consts.js.map +1 -1
- package/dist/development/src/dic.cjs +3 -1
- package/dist/development/src/dic.cjs.map +1 -1
- package/dist/development/src/dic.js +3 -1
- 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.map +1 -1
- package/dist/development/src/lib/VersionChecker.js.map +1 -1
- package/dist/development/src/lib/admin/AdminClient.cjs +1 -1
- package/dist/development/src/lib/admin/AdminClient.cjs.map +1 -1
- package/dist/development/src/lib/admin/AdminClient.js +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/dsn.cjs.map +1 -1
- package/dist/development/src/lib/dsn.js.map +1 -1
- package/dist/development/src/lib/env.cjs +4 -1
- package/dist/development/src/lib/env.cjs.map +1 -1
- package/dist/development/src/lib/env.js +4 -1
- package/dist/development/src/lib/env.js.map +1 -1
- 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/FileSystem.cjs.map +1 -1
- package/dist/development/src/lib/fs/FileSystem.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 +24 -19
- package/dist/development/src/lib/js/EsBuildBuilder.cjs.map +1 -1
- package/dist/development/src/lib/js/EsBuildBuilder.js +1 -1
- package/dist/development/src/lib/js/EsBuildBuilder.js.map +1 -1
- package/dist/development/src/lib/js/EvalExecutor.cjs +2 -2
- package/dist/development/src/lib/js/EvalExecutor.cjs.map +1 -1
- package/dist/development/src/lib/js/EvalExecutor.js +2 -2
- 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 +1 -1
- package/dist/development/src/lib/migrations/MigrationExecutionFacade.cjs.map +1 -1
- package/dist/development/src/lib/migrations/MigrationExecutionFacade.js +1 -1
- 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.map +1 -1
- package/dist/development/src/lib/migrations/MigrationRebaseFacade.js.map +1 -1
- 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/migrations/migrations.cjs.map +1 -1
- package/dist/development/src/lib/migrations/migrations.js.map +1 -1
- package/dist/development/src/lib/project/RemoteProject.cjs.map +1 -1
- package/dist/development/src/lib/project/RemoteProject.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 +9 -2
- package/dist/development/src/lib/project/RemoteProjectResolver.cjs.map +1 -1
- package/dist/development/src/lib/project/RemoteProjectResolver.js +9 -2
- 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/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/components/SinglePermission.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/components/SinglePermission.js.map +1 -1
- package/dist/development/src/lib/project/docs/projectDescribe.cjs +3 -5
- package/dist/development/src/lib/project/docs/projectDescribe.cjs.map +1 -1
- package/dist/development/src/lib/project/docs/projectDescribe.js +3 -4
- package/dist/development/src/lib/project/docs/projectDescribe.js.map +1 -1
- 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/SchemaValidationPrinter.cjs.map +1 -1
- package/dist/development/src/lib/schema/SchemaValidationPrinter.js.map +1 -1
- package/dist/development/src/lib/schema/collectReferences.cjs.map +1 -1
- package/dist/development/src/lib/schema/collectReferences.js.map +1 -1
- package/dist/development/src/lib/stream.cjs.map +1 -1
- package/dist/development/src/lib/stream.js.map +1 -1
- package/dist/development/src/lib/tenant/TenantClient.cjs +4 -8
- package/dist/development/src/lib/tenant/TenantClient.cjs.map +1 -1
- package/dist/development/src/lib/tenant/TenantClient.js +3 -7
- package/dist/development/src/lib/tenant/TenantClient.js.map +1 -1
- package/dist/development/src/lib/transfer/DataTransferClient.cjs +2 -2
- package/dist/development/src/lib/transfer/DataTransferClient.cjs.map +1 -1
- package/dist/development/src/lib/transfer/DataTransferClient.js +2 -2
- package/dist/development/src/lib/transfer/DataTransferClient.js.map +1 -1
- package/dist/development/src/lib/transfer/stdio.cjs.map +1 -1
- package/dist/development/src/lib/transfer/stdio.js.map +1 -1
- 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/run.cjs.map +1 -1
- package/dist/production/run.js +0 -0
- package/dist/production/run.js.map +1 -1
- package/dist/production/src/commands/deploy/DeployCommand.cjs +5 -5
- package/dist/production/src/commands/deploy/DeployCommand.cjs.map +1 -1
- package/dist/production/src/commands/deploy/DeployCommand.js +5 -5
- package/dist/production/src/commands/deploy/DeployCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationAmendCommand.cjs +15 -3
- package/dist/production/src/commands/migrations/MigrationAmendCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationAmendCommand.js +15 -3
- package/dist/production/src/commands/migrations/MigrationAmendCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationBlankCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationBlankCommand.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 +1 -1
- package/dist/production/src/commands/migrations/MigrationDiffCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationDiffCommand.js +1 -1
- package/dist/production/src/commands/migrations/MigrationDiffCommand.js.map +1 -1
- package/dist/production/src/commands/migrations/MigrationExecuteCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationExecuteCommand.js.map +1 -1
- 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/MigrationStatusCommand.cjs.map +1 -1
- package/dist/production/src/commands/migrations/MigrationStatusCommand.js.map +1 -1
- package/dist/production/src/commands/misc/VersionCommand.cjs.map +1 -1
- package/dist/production/src/commands/misc/VersionCommand.js.map +1 -1
- 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 +13 -2
- package/dist/production/src/commands/project/ProjectPrintSchemaCommand.cjs.map +1 -1
- package/dist/production/src/commands/project/ProjectPrintSchemaCommand.js +14 -3
- 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/transfer/ExportCommand.cjs +2 -0
- package/dist/production/src/commands/transfer/ExportCommand.cjs.map +1 -1
- package/dist/production/src/commands/transfer/ExportCommand.js +2 -0
- 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 +2 -0
- package/dist/production/src/commands/transfer/TransferCommand.cjs.map +1 -1
- package/dist/production/src/commands/transfer/TransferCommand.js +2 -0
- package/dist/production/src/commands/transfer/TransferCommand.js.map +1 -1
- package/dist/production/src/commands/transfer/utils.cjs.map +1 -1
- package/dist/production/src/commands/transfer/utils.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 +3 -1
- package/dist/production/src/consts.cjs.map +1 -1
- package/dist/production/src/consts.js +4 -2
- package/dist/production/src/consts.js.map +1 -1
- package/dist/production/src/dic.cjs +3 -1
- package/dist/production/src/dic.cjs.map +1 -1
- package/dist/production/src/dic.js +3 -1
- 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.map +1 -1
- package/dist/production/src/lib/VersionChecker.js.map +1 -1
- package/dist/production/src/lib/admin/AdminClient.cjs +1 -1
- package/dist/production/src/lib/admin/AdminClient.cjs.map +1 -1
- package/dist/production/src/lib/admin/AdminClient.js +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/dsn.cjs.map +1 -1
- package/dist/production/src/lib/dsn.js.map +1 -1
- package/dist/production/src/lib/env.cjs +4 -1
- package/dist/production/src/lib/env.cjs.map +1 -1
- package/dist/production/src/lib/env.js +4 -1
- package/dist/production/src/lib/env.js.map +1 -1
- 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/FileSystem.cjs.map +1 -1
- package/dist/production/src/lib/fs/FileSystem.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 +24 -19
- package/dist/production/src/lib/js/EsBuildBuilder.cjs.map +1 -1
- package/dist/production/src/lib/js/EsBuildBuilder.js +1 -1
- package/dist/production/src/lib/js/EsBuildBuilder.js.map +1 -1
- package/dist/production/src/lib/js/EvalExecutor.cjs +2 -2
- package/dist/production/src/lib/js/EvalExecutor.cjs.map +1 -1
- package/dist/production/src/lib/js/EvalExecutor.js +2 -2
- 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 +1 -1
- package/dist/production/src/lib/migrations/MigrationExecutionFacade.cjs.map +1 -1
- package/dist/production/src/lib/migrations/MigrationExecutionFacade.js +1 -1
- 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.map +1 -1
- package/dist/production/src/lib/migrations/MigrationRebaseFacade.js.map +1 -1
- 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/migrations/migrations.cjs.map +1 -1
- package/dist/production/src/lib/migrations/migrations.js.map +1 -1
- package/dist/production/src/lib/project/RemoteProject.cjs.map +1 -1
- package/dist/production/src/lib/project/RemoteProject.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 +9 -2
- package/dist/production/src/lib/project/RemoteProjectResolver.cjs.map +1 -1
- package/dist/production/src/lib/project/RemoteProjectResolver.js +9 -2
- 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/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/components/SinglePermission.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/components/SinglePermission.js.map +1 -1
- package/dist/production/src/lib/project/docs/projectDescribe.cjs +2 -4
- package/dist/production/src/lib/project/docs/projectDescribe.cjs.map +1 -1
- package/dist/production/src/lib/project/docs/projectDescribe.js +2 -3
- package/dist/production/src/lib/project/docs/projectDescribe.js.map +1 -1
- 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/SchemaValidationPrinter.cjs.map +1 -1
- package/dist/production/src/lib/schema/SchemaValidationPrinter.js.map +1 -1
- package/dist/production/src/lib/schema/collectReferences.cjs.map +1 -1
- package/dist/production/src/lib/schema/collectReferences.js.map +1 -1
- package/dist/production/src/lib/stream.cjs.map +1 -1
- package/dist/production/src/lib/stream.js.map +1 -1
- package/dist/production/src/lib/tenant/TenantClient.cjs +4 -8
- package/dist/production/src/lib/tenant/TenantClient.cjs.map +1 -1
- package/dist/production/src/lib/tenant/TenantClient.js +3 -7
- package/dist/production/src/lib/tenant/TenantClient.js.map +1 -1
- package/dist/production/src/lib/transfer/DataTransferClient.cjs +2 -2
- package/dist/production/src/lib/transfer/DataTransferClient.cjs.map +1 -1
- package/dist/production/src/lib/transfer/DataTransferClient.js +2 -2
- package/dist/production/src/lib/transfer/DataTransferClient.js.map +1 -1
- package/dist/production/src/lib/transfer/stdio.cjs.map +1 -1
- package/dist/production/src/lib/transfer/stdio.js.map +1 -1
- 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/deploy/DeployCommand.d.ts.map +1 -1
- package/dist/types/commands/migrations/MigrationAmendCommand.d.ts +1 -0
- package/dist/types/commands/migrations/MigrationAmendCommand.d.ts.map +1 -1
- package/dist/types/commands/project/ProjectPrintSchemaCommand.d.ts +4 -0
- package/dist/types/commands/project/ProjectPrintSchemaCommand.d.ts.map +1 -1
- package/dist/types/commands/transfer/ExportCommand.d.ts +1 -0
- package/dist/types/commands/transfer/ExportCommand.d.ts.map +1 -1
- package/dist/types/commands/transfer/TransferCommand.d.ts +1 -0
- package/dist/types/commands/transfer/TransferCommand.d.ts.map +1 -1
- package/dist/types/consts.d.ts.map +1 -1
- package/dist/types/dic.d.ts.map +1 -1
- package/dist/types/lib/env.d.ts +3 -0
- package/dist/types/lib/env.d.ts.map +1 -1
- package/dist/types/lib/js/EsBuildBuilder.d.ts.map +1 -1
- package/dist/types/lib/migrations/MigrationExecutionFacade.d.ts +2 -2
- package/dist/types/lib/migrations/MigrationExecutionFacade.d.ts.map +1 -1
- package/dist/types/lib/migrations/MigrationPrinter.d.ts.map +1 -1
- package/dist/types/lib/project/RemoteProjectResolver.d.ts +1 -1
- package/dist/types/lib/project/RemoteProjectResolver.d.ts.map +1 -1
- package/dist/types/lib/project/docs/projectDescribe.d.ts.map +1 -1
- package/dist/types/lib/tenant/TenantClient.d.ts +2 -2
- package/dist/types/lib/tenant/TenantClient.d.ts.map +1 -1
- package/dist/types/lib/transfer/DataTransferClient.d.ts +2 -1
- package/dist/types/lib/transfer/DataTransferClient.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +34 -31
- package/src/commands/deploy/DeployCommand.ts +6 -5
- package/src/commands/migrations/MigrationAmendCommand.ts +16 -3
- package/src/commands/migrations/MigrationDiffCommand.ts +1 -1
- package/src/commands/project/ProjectPrintSchemaCommand.ts +19 -3
- package/src/commands/transfer/ExportCommand.ts +3 -0
- package/src/commands/transfer/TransferCommand.ts +3 -0
- package/src/consts.ts +4 -2
- package/src/dic.ts +3 -1
- package/src/lib/admin/AdminClient.ts +1 -1
- package/src/lib/env.ts +6 -0
- package/src/lib/js/EsBuildBuilder.ts +1 -1
- package/src/lib/js/EvalExecutor.ts +2 -2
- package/src/lib/migrations/MigrationExecutionFacade.ts +3 -3
- package/src/lib/migrations/MigrationPrinter.ts +3 -0
- package/src/lib/project/RemoteProjectResolver.ts +10 -2
- package/src/lib/project/docs/projectDescribe.tsx +2 -3
- package/src/lib/tenant/TenantClient.ts +5 -9
- package/src/lib/transfer/DataTransferClient.ts +3 -2
- package/src/tsconfig.json +1 -0
- package/tsconfig.settings.json +0 -1
- package/Dockerfile +0 -20
- package/build.sh +0 -11
- package/esbuild.cjs +0 -27
package/package.json
CHANGED
|
@@ -1,49 +1,52 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contember/cli",
|
|
3
|
-
"version": "2.0.0-
|
|
3
|
+
"version": "2.0.0-beta.2",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"bin": {
|
|
6
|
-
"contember": "./dist/
|
|
6
|
+
"contember": "./dist/production/run.js"
|
|
7
7
|
},
|
|
8
|
+
"type": "module",
|
|
8
9
|
"scripts": {
|
|
9
|
-
"build": "tailwindcss -i src/lib/project/docs/resources/style.css -o ./dist/
|
|
10
|
+
"build": "tailwindcss -i src/lib/project/docs/resources/style.css -o ./dist/resources/out.css"
|
|
10
11
|
},
|
|
11
12
|
"devDependencies": {
|
|
12
13
|
"@types/fs-extra": "^11.0.4",
|
|
13
14
|
"@types/js-yaml": "^4.0.9",
|
|
14
|
-
"@types/node": "^20.
|
|
15
|
-
"@types/prompts": "^2.4.
|
|
16
|
-
"@types/semver": "^7.5.
|
|
17
|
-
"autoprefixer": "^10.4.
|
|
18
|
-
"postcss": "^8.4.
|
|
19
|
-
"tailwindcss": "^3.
|
|
15
|
+
"@types/node": "^20.16.11",
|
|
16
|
+
"@types/prompts": "^2.4.9",
|
|
17
|
+
"@types/semver": "^7.5.8",
|
|
18
|
+
"autoprefixer": "^10.4.20",
|
|
19
|
+
"postcss": "^8.4.47",
|
|
20
|
+
"tailwindcss": "^3.4.14"
|
|
20
21
|
},
|
|
21
22
|
"dependencies": {
|
|
22
|
-
"@contember/cli-common": "2.0.0-
|
|
23
|
-
"@contember/config-loader": "2.0.0-
|
|
24
|
-
"@contember/database": "2.0.0-
|
|
25
|
-
"@contember/dic": "2.0.0-
|
|
26
|
-
"@contember/engine-common": "2.0.0-
|
|
27
|
-
"@contember/engine-content-api": "2.0.0-
|
|
28
|
-
"@contember/
|
|
29
|
-
"@contember/
|
|
30
|
-
"@contember/schema
|
|
31
|
-
"@contember/schema-
|
|
32
|
-
"@contember/
|
|
33
|
-
"@
|
|
34
|
-
"
|
|
23
|
+
"@contember/cli-common": "2.0.0-beta.2",
|
|
24
|
+
"@contember/config-loader": "2.0.0-beta.2",
|
|
25
|
+
"@contember/database": "2.0.0-beta.2",
|
|
26
|
+
"@contember/dic": "2.0.0-beta.2",
|
|
27
|
+
"@contember/engine-common": "2.0.0-beta.2",
|
|
28
|
+
"@contember/engine-content-api": "2.0.0-beta.2",
|
|
29
|
+
"@contember/graphql-client": "2.0.0-beta.2",
|
|
30
|
+
"@contember/migrations-client": "2.0.0-beta.2",
|
|
31
|
+
"@contember/schema": "2.0.0-beta.2",
|
|
32
|
+
"@contember/schema-migrations": "2.0.0-beta.2",
|
|
33
|
+
"@contember/schema-utils": "2.0.0-beta.2",
|
|
34
|
+
"@contember/typesafe": "2.0.0-beta.2",
|
|
35
|
+
"@graphql-tools/schema": "^10.0.7",
|
|
36
|
+
"chalk": "^5.3.0",
|
|
35
37
|
"chalk-table": "^1.0.2",
|
|
36
|
-
"esbuild": "^0.18.20",
|
|
37
38
|
"fast-glob": "^3.3.2",
|
|
38
|
-
"graphql": "^16.
|
|
39
|
-
"graphql-request": "^6.1.0",
|
|
39
|
+
"graphql": "^16.9.0",
|
|
40
40
|
"js-yaml": "^4.1.0",
|
|
41
41
|
"lodash-es": "^4.17.21",
|
|
42
|
-
"pg": "^8.
|
|
43
|
-
"preact": "^10.
|
|
44
|
-
"preact-render-to-string": "^6.
|
|
42
|
+
"pg": "^8.12.0",
|
|
43
|
+
"preact": "^10.23.2",
|
|
44
|
+
"preact-render-to-string": "^6.5.11",
|
|
45
45
|
"prompts": "^2.4.2",
|
|
46
|
-
"semver": "^7.
|
|
47
|
-
"yawn-yaml": "^2.
|
|
46
|
+
"semver": "^7.6.3",
|
|
47
|
+
"yawn-yaml": "^2.3.0"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"esbuild": "*"
|
|
48
51
|
}
|
|
49
|
-
}
|
|
52
|
+
}
|
|
@@ -50,24 +50,25 @@ export class DeployCommand extends Command<Args, Options> {
|
|
|
50
50
|
protected async execute(input: Input<Args, Options>): Promise<void | number> {
|
|
51
51
|
|
|
52
52
|
const dsn = input.getArgument('dsn')
|
|
53
|
-
const
|
|
53
|
+
const adminEndpoint = input.getOption('admin')
|
|
54
|
+
const remoteProject = this.remoteProjectResolver.resolve(dsn, adminEndpoint)
|
|
54
55
|
if (!remoteProject) {
|
|
55
56
|
throw `Project not defined. Please provide DSN or environment variables CONTEMBER_*`
|
|
56
57
|
}
|
|
57
58
|
this.remoteProjectProvider.setRemoteProject(remoteProject)
|
|
58
59
|
|
|
59
|
-
let adminEndpoint = input.getOption('admin')
|
|
60
60
|
const deployMigration = input.getOption('no-migrations') !== true
|
|
61
61
|
const yes = input.getOption('yes') === true
|
|
62
62
|
const projectAdminDistDir = this.workspace.adminDistDir
|
|
63
|
-
|
|
63
|
+
|
|
64
|
+
const deployAdmin = input.getOption('no-admin') !== true && !!remoteProject.adminEndpoint && !!projectAdminDistDir
|
|
64
65
|
|
|
65
66
|
|
|
66
67
|
console.log('')
|
|
67
68
|
console.log('Contember project deployment configuration:')
|
|
68
69
|
console.log(`Target project name: ${remoteProject.name}`)
|
|
69
70
|
console.log(`API URL: ${remoteProject.endpoint}`)
|
|
70
|
-
console.log(`Admin URL: ${adminEndpoint ?? 'none'}`)
|
|
71
|
+
console.log(`Admin URL: ${remoteProject.adminEndpoint ?? 'none'}`)
|
|
71
72
|
console.log(`Deploy token: ${maskToken(remoteProject.token)}`)
|
|
72
73
|
console.log('')
|
|
73
74
|
|
|
@@ -113,7 +114,7 @@ export class DeployCommand extends Command<Args, Options> {
|
|
|
113
114
|
console.log('')
|
|
114
115
|
console.log('Deployment successful')
|
|
115
116
|
console.log(`API URL: ${remoteProject.endpoint}`)
|
|
116
|
-
console.log(`Admin URL: ${adminEndpoint ?? 'none'}`)
|
|
117
|
+
console.log(`Admin URL: ${remoteProject.adminEndpoint ?? 'none'}`)
|
|
117
118
|
|
|
118
119
|
return 0
|
|
119
120
|
}
|
|
@@ -106,7 +106,7 @@ export class MigrationAmendCommand extends Command<Args, Options> {
|
|
|
106
106
|
await systemClient.migrate([intermediateResult.migration], force)
|
|
107
107
|
await systemClient.migrationDelete(intermediateResult.migration.version)
|
|
108
108
|
|
|
109
|
-
if (!newMigrationResult) {
|
|
109
|
+
if (!newMigrationResult && await this.shouldRemove()) {
|
|
110
110
|
await this.migrationCreator.removeMigration(amendMigration.name)
|
|
111
111
|
await systemClient.migrationDelete(amendMigration.version)
|
|
112
112
|
console.log('Latest migration was removed')
|
|
@@ -115,8 +115,8 @@ export class MigrationAmendCommand extends Command<Args, Options> {
|
|
|
115
115
|
const newMigration = {
|
|
116
116
|
name: amendMigration.name,
|
|
117
117
|
version: amendMigration.version,
|
|
118
|
-
formatVersion: newMigrationResult
|
|
119
|
-
modifications: newMigrationResult
|
|
118
|
+
formatVersion: newMigrationResult?.migration.formatVersion ?? amendMigration.formatVersion,
|
|
119
|
+
modifications: newMigrationResult?.migration.modifications ?? [],
|
|
120
120
|
}
|
|
121
121
|
await this.migrationCreator.saveMigration(newMigration)
|
|
122
122
|
await systemClient.migrationModify(amendMigration.version, newMigration)
|
|
@@ -147,4 +147,17 @@ export class MigrationAmendCommand extends Command<Args, Options> {
|
|
|
147
147
|
})
|
|
148
148
|
return action === 'yes'
|
|
149
149
|
}
|
|
150
|
+
|
|
151
|
+
private async shouldRemove(): Promise<boolean> {
|
|
152
|
+
const { action } = await prompts({
|
|
153
|
+
type: 'select',
|
|
154
|
+
name: 'action',
|
|
155
|
+
message: 'The amendment results in a no-op migration because the changes introduced by the latest migration were reverted.\nYou can choose to remove the latest migration or to modify it so it is empty.',
|
|
156
|
+
choices: [
|
|
157
|
+
{ value: 'remove', title: 'Remove latest migration' },
|
|
158
|
+
{ value: 'keep', title: 'Keep latest migration and make it empty' },
|
|
159
|
+
],
|
|
160
|
+
})
|
|
161
|
+
return action === 'remove'
|
|
162
|
+
}
|
|
150
163
|
}
|
|
@@ -95,7 +95,7 @@ export class MigrationDiffCommand extends Command<Args, Options> {
|
|
|
95
95
|
if (shouldExecute) {
|
|
96
96
|
await this.migrationExecutorFacade.execute({
|
|
97
97
|
force: false,
|
|
98
|
-
requireConfirmation: !yes,
|
|
98
|
+
requireConfirmation: migrations => migrations.length !== 1 && !yes,
|
|
99
99
|
})
|
|
100
100
|
}
|
|
101
101
|
}
|
|
@@ -9,7 +9,7 @@ import {
|
|
|
9
9
|
} from '@contember/engine-content-api'
|
|
10
10
|
import { printSchema } from 'graphql'
|
|
11
11
|
import { mergeSchemas } from '@graphql-tools/schema'
|
|
12
|
-
import { normalizeSchema } from '@contember/schema-utils'
|
|
12
|
+
import { emptySchema, normalizeSchema } from '@contember/schema-utils'
|
|
13
13
|
import { SchemaLoader } from '../../lib/schema/SchemaLoader'
|
|
14
14
|
import { SchemaVersionBuilder } from '@contember/migrations-client'
|
|
15
15
|
import { validateSchemaAndPrintErrors } from '../../lib/schema/SchemaValidationHelper'
|
|
@@ -22,6 +22,10 @@ type Options = {
|
|
|
22
22
|
normalize?: boolean
|
|
23
23
|
format?: 'graphql' | 'introspection' | 'schema'
|
|
24
24
|
source?: 'migrations' | 'definition'
|
|
25
|
+
['omit-acl']?: boolean
|
|
26
|
+
['omit-validation']?: boolean
|
|
27
|
+
['omit-actions']?: boolean
|
|
28
|
+
['omit-settings']?: boolean
|
|
25
29
|
}
|
|
26
30
|
|
|
27
31
|
export class ProjectPrintSchemaCommand extends Command<Args, Options> {
|
|
@@ -38,6 +42,10 @@ export class ProjectPrintSchemaCommand extends Command<Args, Options> {
|
|
|
38
42
|
configuration.option('source').valueRequired().description('migrations|definition')
|
|
39
43
|
configuration.option('role').valueArray()
|
|
40
44
|
configuration.option('normalize').valueNone()
|
|
45
|
+
configuration.option('omit-acl').valueNone()
|
|
46
|
+
configuration.option('omit-validation').valueNone()
|
|
47
|
+
configuration.option('omit-actions').valueNone()
|
|
48
|
+
configuration.option('omit-settings').valueNone()
|
|
41
49
|
}
|
|
42
50
|
|
|
43
51
|
protected async execute(input: Input<Args, Options>): Promise<number> {
|
|
@@ -48,13 +56,21 @@ export class ProjectPrintSchemaCommand extends Command<Args, Options> {
|
|
|
48
56
|
? await this.schemaVersionBuilder.buildSchema()
|
|
49
57
|
: await this.schemaLoader.loadSchema()
|
|
50
58
|
|
|
51
|
-
|
|
59
|
+
const filteredSchema = {
|
|
60
|
+
model: schema.model,
|
|
61
|
+
acl: input.getOption('omit-acl') ? emptySchema.acl : schema.acl,
|
|
62
|
+
validation: input.getOption('omit-validation') ? emptySchema.validation : schema.validation,
|
|
63
|
+
actions: input.getOption('omit-actions') ? emptySchema.actions : schema.actions,
|
|
64
|
+
settings: input.getOption('omit-settings') ? emptySchema.settings : schema.settings,
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (!validateSchemaAndPrintErrors(filteredSchema, 'Defined schema is invalid:')) {
|
|
52
68
|
return 1
|
|
53
69
|
}
|
|
54
70
|
|
|
55
71
|
const permissionFactory = new PermissionFactory()
|
|
56
72
|
const inputRoles = input.getOption('role')
|
|
57
|
-
const schemaNormalized = input.getOption('normalize') ? normalizeSchema(
|
|
73
|
+
const schemaNormalized = input.getOption('normalize') ? normalizeSchema(filteredSchema) : filteredSchema
|
|
58
74
|
const permissions = permissionFactory.create(schemaNormalized, inputRoles || ['admin'])
|
|
59
75
|
const schemaBuilderFactory = new GraphQlSchemaBuilderFactory()
|
|
60
76
|
const authorizator = new Authorizator(permissions, schemaNormalized.acl.customPrimary ?? false)
|
|
@@ -17,6 +17,7 @@ type Options = {
|
|
|
17
17
|
'no-gzip-output'?: boolean
|
|
18
18
|
'no-gzip-transfer'?: boolean
|
|
19
19
|
output?: string
|
|
20
|
+
'exclude-table'?: string[]
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
export class ExportCommand extends Command<Args, Options> {
|
|
@@ -35,6 +36,7 @@ export class ExportCommand extends Command<Args, Options> {
|
|
|
35
36
|
configuration.option('no-gzip-transfer').valueNone()
|
|
36
37
|
configuration.option('no-gzip-output').valueNone()
|
|
37
38
|
configuration.option('output').valueRequired()
|
|
39
|
+
configuration.option('exclude-table').valueArray()
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
protected async execute(input: Input<Args, Options>): Promise<void | number> {
|
|
@@ -58,6 +60,7 @@ export class ExportCommand extends Command<Args, Options> {
|
|
|
58
60
|
|
|
59
61
|
const response = await this.dataTransferClient.dataExport({
|
|
60
62
|
project,
|
|
63
|
+
excludeTables: input.getOption('exclude-table') ?? [],
|
|
61
64
|
includeSystem,
|
|
62
65
|
gzip: gzipTransfer,
|
|
63
66
|
})
|
|
@@ -15,6 +15,7 @@ type Options = {
|
|
|
15
15
|
'include-system'?: boolean
|
|
16
16
|
'no-gzip-transfer'?: boolean
|
|
17
17
|
yes: boolean
|
|
18
|
+
'exclude-table'?: string[]
|
|
18
19
|
}
|
|
19
20
|
|
|
20
21
|
export class TransferCommand extends Command<Args, Options> {
|
|
@@ -32,6 +33,7 @@ export class TransferCommand extends Command<Args, Options> {
|
|
|
32
33
|
configuration.option('include-system').valueNone()
|
|
33
34
|
configuration.option('no-gzip-transfer').valueNone()
|
|
34
35
|
configuration.option('yes').valueNone()
|
|
36
|
+
configuration.option('exclude-table').valueArray()
|
|
35
37
|
}
|
|
36
38
|
|
|
37
39
|
protected async execute(input: Input<Args, Options>): Promise<void | number> {
|
|
@@ -68,6 +70,7 @@ export class TransferCommand extends Command<Args, Options> {
|
|
|
68
70
|
const exportResponse = (await this.dataTransferClient.dataExport({
|
|
69
71
|
project: sourceProject,
|
|
70
72
|
includeSystem,
|
|
73
|
+
excludeTables: input.getOption('exclude-table') ?? [],
|
|
71
74
|
gzip: gzipTransfer,
|
|
72
75
|
}))
|
|
73
76
|
const ungzipedResponse = gzipTransfer ? exportResponse.pipe(createGunzip()) : exportResponse
|
package/src/consts.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { findPackageRoot } from '@contember/cli-common'
|
|
2
2
|
import { dirname } from 'node:path'
|
|
3
3
|
import { fileURLToPath } from 'node:url'
|
|
4
|
-
|
|
4
|
+
|
|
5
|
+
const currentFilePath = dirname(fileURLToPath(import.meta.url))
|
|
6
|
+
export const packageRoot = process.env.CONTEMBER_CLI_PACKAGE_ROOT || findPackageRoot(currentFilePath)
|
|
5
7
|
export const contemberDockerImages = ['contember/engine', 'contember/engine-ee', 'contember/cli']
|
package/src/dic.ts
CHANGED
|
@@ -150,7 +150,9 @@ export const createContainer = ({ env, version, runtime, workspace }: {
|
|
|
150
150
|
.addService('schemaVersionBuilder', ({ migrationsResolver, schemaMigrator }) =>
|
|
151
151
|
new SchemaVersionBuilder(migrationsResolver, schemaMigrator))
|
|
152
152
|
.addService('schemaDiffer', ({ schemaMigrator }) =>
|
|
153
|
-
new SchemaDiffer(schemaMigrator
|
|
153
|
+
new SchemaDiffer(schemaMigrator, {
|
|
154
|
+
maxPatchSize: env.migrationsOptions?.maxPatchSize,
|
|
155
|
+
}))
|
|
154
156
|
.addService('migrationCreator', ({ migrationFilesManager, schemaDiffer }) =>
|
|
155
157
|
new MigrationCreator(migrationFilesManager, schemaDiffer, {
|
|
156
158
|
json: JSON.stringify({ formatVersion: VERSION_LATEST, modifications: [] }, undefined, '\t') + '\n',
|
|
@@ -14,7 +14,7 @@ export class AdminClient {
|
|
|
14
14
|
if (!response.ok) {
|
|
15
15
|
const project = this.remoteProjectProvider.get()
|
|
16
16
|
const maskedToken = maskToken(project.token)
|
|
17
|
-
throw `Failed to deploy admin, POST request to ${project.
|
|
17
|
+
throw `Failed to deploy admin, POST request to ${project.adminEndpoint}/_deploy with token ${maskedToken} returned status ${response.status} ${response.statusText}\n${await response.text()}`
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
package/src/lib/env.ts
CHANGED
|
@@ -6,6 +6,9 @@ export interface CliEnv {
|
|
|
6
6
|
dockerComposeFile?: string
|
|
7
7
|
dsn?: string
|
|
8
8
|
dir?: string
|
|
9
|
+
migrationsOptions?: {
|
|
10
|
+
maxPatchSize?: number
|
|
11
|
+
}
|
|
9
12
|
}
|
|
10
13
|
|
|
11
14
|
export const readCliEnv = (): CliEnv => {
|
|
@@ -17,5 +20,8 @@ export const readCliEnv = (): CliEnv => {
|
|
|
17
20
|
projectName: process.env.CONTEMBER_PROJECT_NAME,
|
|
18
21
|
dockerComposeFile: process.env.COMPOSE_FILE,
|
|
19
22
|
dsn: process.env.CONTEMBER_DSN,
|
|
23
|
+
migrationsOptions: {
|
|
24
|
+
maxPatchSize: process.env.CONTEMBER_MIGRATIONS_MAX_PATCH_SIZE ? parseInt(process.env.CONTEMBER_MIGRATIONS_MAX_PATCH_SIZE) : undefined,
|
|
25
|
+
},
|
|
20
26
|
}
|
|
21
27
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { JsBuilder } from './JsBuilder'
|
|
2
|
-
import * as esbuild from 'esbuild'
|
|
3
2
|
|
|
4
3
|
export class EsBuildBuilder implements JsBuilder {
|
|
5
4
|
async build(path: string): Promise<string> {
|
|
5
|
+
const esbuild = await import('esbuild')
|
|
6
6
|
const response = await esbuild.build({
|
|
7
7
|
entryPoints: [path],
|
|
8
8
|
platform: 'node',
|
|
@@ -2,7 +2,7 @@ import { JsExecutor } from './JsExecutor'
|
|
|
2
2
|
|
|
3
3
|
export class EvalExecutor implements JsExecutor {
|
|
4
4
|
public async execute(code: string): Promise<unknown> {
|
|
5
|
-
const fn = new Function(`var module = {}; ((module) => { ${code} })(module); return module`)
|
|
6
|
-
return fn().exports
|
|
5
|
+
const fn = new Function('require', `var module = {}; ((module) => { ${code} })(module); return module`)
|
|
6
|
+
return fn(require).exports
|
|
7
7
|
}
|
|
8
8
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import prompts from 'prompts'
|
|
2
2
|
import { MigrationPrinter } from './MigrationPrinter'
|
|
3
|
-
import { isSchemaMigration, MigrationExecutor, SchemaVersionBuilder } from '@contember/migrations-client'
|
|
3
|
+
import { isSchemaMigration, MigrationExecutor, MigrationToExecuteOkStatus, SchemaVersionBuilder } from '@contember/migrations-client'
|
|
4
4
|
import { MigrationsStatusFacade } from './MigrationsStatusFacade'
|
|
5
5
|
import { MigrationVersionHelper } from '@contember/engine-common'
|
|
6
6
|
import { RemoteProject } from '../project/RemoteProject'
|
|
@@ -26,7 +26,7 @@ export class MigrationExecutionFacade {
|
|
|
26
26
|
until,
|
|
27
27
|
additionalMessage,
|
|
28
28
|
}: {
|
|
29
|
-
requireConfirmation: boolean
|
|
29
|
+
requireConfirmation: boolean | ((migrations: MigrationToExecuteOkStatus[]) => boolean)
|
|
30
30
|
force?: boolean
|
|
31
31
|
until?: string
|
|
32
32
|
additionalMessage?: string
|
|
@@ -46,7 +46,7 @@ export class MigrationExecutionFacade {
|
|
|
46
46
|
migrations.forEach(it => console.log(it.name))
|
|
47
47
|
additionalMessage && console.log(additionalMessage)
|
|
48
48
|
|
|
49
|
-
if (requireConfirmation) {
|
|
49
|
+
if (typeof requireConfirmation === 'function' ? requireConfirmation(migrations) : requireConfirmation) {
|
|
50
50
|
if (!process.stdin.isTTY) {
|
|
51
51
|
throw 'TTY not available. Pass --yes option to confirm execution.'
|
|
52
52
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/triple-slash-reference
|
|
2
|
+
/// <reference path="../../../types/chalk-table/index.d.ts" />
|
|
3
|
+
|
|
1
4
|
import { Schema } from '@contember/schema'
|
|
2
5
|
import chalk from 'chalk'
|
|
3
6
|
import { AnyMigrationStatus, Migration, MigrationDescriber, MigrationState } from '@contember/migrations-client'
|
|
@@ -8,7 +8,7 @@ export class RemoteProjectResolver {
|
|
|
8
8
|
) {
|
|
9
9
|
}
|
|
10
10
|
|
|
11
|
-
resolve(identifier?: string): RemoteProject | undefined {
|
|
11
|
+
resolve(identifier?: string, adminEndpoint?: string): RemoteProject | undefined {
|
|
12
12
|
let endpoint: string | undefined
|
|
13
13
|
let token: string | undefined
|
|
14
14
|
let project: string | undefined
|
|
@@ -24,7 +24,15 @@ export class RemoteProjectResolver {
|
|
|
24
24
|
if (!project || !endpoint || !token) {
|
|
25
25
|
return undefined
|
|
26
26
|
}
|
|
27
|
+
if (endpoint.endsWith('/')) {
|
|
28
|
+
endpoint = endpoint.slice(0, -1)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
if (!adminEndpoint && endpoint.endsWith('.contember.cloud') && !endpoint.includes('://api-')) {
|
|
32
|
+
adminEndpoint = endpoint
|
|
33
|
+
endpoint += '/_api'
|
|
34
|
+
}
|
|
27
35
|
|
|
28
|
-
return new RemoteProject(project, endpoint, token)
|
|
36
|
+
return new RemoteProject(project, endpoint, token, adminEndpoint)
|
|
29
37
|
}
|
|
30
38
|
}
|
|
@@ -3,13 +3,12 @@ import { h } from 'preact'
|
|
|
3
3
|
import render from 'preact-render-to-string'
|
|
4
4
|
import { ProjectInfo } from './components/ProjectInfo'
|
|
5
5
|
import { readFile } from 'node:fs/promises'
|
|
6
|
-
import {
|
|
7
|
-
import { fileURLToPath } from 'node:url'
|
|
6
|
+
import { packageRoot } from '../../../consts'
|
|
8
7
|
|
|
9
8
|
export const renderProjectInfoHtml = async (schema: Schema, projectName: string) => {
|
|
10
9
|
const html = render(<ProjectInfo schema={schema} projectName={projectName} />)
|
|
11
10
|
|
|
12
|
-
const css = await readFile(
|
|
11
|
+
const css = await readFile(packageRoot + '/dist/resources/out.css')
|
|
13
12
|
return `<!DOCTYPE html>
|
|
14
13
|
<html lang="en">
|
|
15
14
|
<head>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { GraphQlClient } from '@contember/graphql-client'
|
|
2
2
|
|
|
3
3
|
export const createTenantApiUrl = (url: string) => {
|
|
4
4
|
if (url.endsWith('/')) {
|
|
@@ -12,14 +12,10 @@ export const createTenantApiUrl = (url: string) => {
|
|
|
12
12
|
|
|
13
13
|
|
|
14
14
|
export class TenantClient {
|
|
15
|
-
constructor(private readonly apiClient:
|
|
15
|
+
constructor(private readonly apiClient: GraphQlClient) {}
|
|
16
16
|
|
|
17
17
|
public static create(url: string, apiToken: string): TenantClient {
|
|
18
|
-
const graphqlClient = new
|
|
19
|
-
headers: {
|
|
20
|
-
Authorization: `Bearer ${apiToken}`,
|
|
21
|
-
},
|
|
22
|
-
})
|
|
18
|
+
const graphqlClient = new GraphQlClient({ url: createTenantApiUrl(url), apiToken })
|
|
23
19
|
return new TenantClient(graphqlClient)
|
|
24
20
|
}
|
|
25
21
|
|
|
@@ -32,9 +28,9 @@ export class TenantClient {
|
|
|
32
28
|
}
|
|
33
29
|
}
|
|
34
30
|
}`
|
|
35
|
-
const result = await this.apiClient.
|
|
31
|
+
const result = await this.apiClient.execute<{
|
|
36
32
|
createProject: { ok: boolean; error: { code: string } }
|
|
37
|
-
}>(query, { slug })
|
|
33
|
+
}>(query, { variables: { slug } })
|
|
38
34
|
if (!result.createProject.ok) {
|
|
39
35
|
if (ignoreExisting && result.createProject.error.code === 'ALREADY_EXISTS') {
|
|
40
36
|
return
|
|
@@ -60,8 +60,9 @@ export class DataTransferClient {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
|
|
63
|
-
dataExport = async ({ project: { name: project, token, endpoint: baseUrl }, gzip, includeSystem }: {
|
|
63
|
+
dataExport = async ({ project: { name: project, token, endpoint: baseUrl }, gzip, includeSystem, excludeTables }: {
|
|
64
64
|
project: RemoteProject
|
|
65
|
+
excludeTables?: string[]
|
|
65
66
|
includeSystem: boolean
|
|
66
67
|
gzip: boolean
|
|
67
68
|
}) => {
|
|
@@ -73,7 +74,7 @@ export class DataTransferClient {
|
|
|
73
74
|
'Content-type': 'application/json',
|
|
74
75
|
},
|
|
75
76
|
body: JSON.stringify({
|
|
76
|
-
projects: [{ slug: project, system: includeSystem }],
|
|
77
|
+
projects: [{ slug: project, system: includeSystem, excludeTables }],
|
|
77
78
|
}),
|
|
78
79
|
})
|
|
79
80
|
}
|
package/src/tsconfig.json
CHANGED
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
{ "path": "../../config-loader/src" },
|
|
13
13
|
{ "path": "../../database/src" },
|
|
14
14
|
{ "path": "../../dic/src" },
|
|
15
|
+
{ "path": "../../graphql-client/src" },
|
|
15
16
|
{ "path": "../../engine-content-api/src" },
|
|
16
17
|
{ "path": "../../engine-common/src" },
|
|
17
18
|
{ "path": "../../schema/src" },
|
package/tsconfig.settings.json
CHANGED
package/Dockerfile
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
FROM node:20-alpine as builder
|
|
2
|
-
|
|
3
|
-
WORKDIR /src
|
|
4
|
-
RUN apk --no-cache add bash
|
|
5
|
-
RUN apk --no-cache add build-base python3
|
|
6
|
-
COPY ./ ./
|
|
7
|
-
RUN test ! -f yarn.tar.gz || tar xf yarn.tar.gz -C "./.yarn/cache" .
|
|
8
|
-
RUN /src/packages/cli/build.sh
|
|
9
|
-
|
|
10
|
-
FROM node:20-alpine
|
|
11
|
-
|
|
12
|
-
WORKDIR /src
|
|
13
|
-
ENV NODE_ENV "production"
|
|
14
|
-
|
|
15
|
-
COPY --from=builder /src/dist/ /opt/contember/
|
|
16
|
-
COPY --from=builder /src/packages/cli/dist/src/utils/project/resources/out.css /opt/contember/resources/out.css
|
|
17
|
-
COPY --from=builder /src/packages/cli/package.json /opt/contember/package.json
|
|
18
|
-
RUN ln -s /opt/contember/run.js /usr/bin/contember
|
|
19
|
-
ENV CONTEMBER_CLI_PACKAGE_ROOT /opt/contember
|
|
20
|
-
ENTRYPOINT ["node", "/opt/contember/run.js"]
|
package/build.sh
DELETED
package/esbuild.cjs
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
const esbuild = require('esbuild')
|
|
2
|
-
const path = require('path')
|
|
3
|
-
|
|
4
|
-
const root = path.dirname(path.dirname(__dirname))
|
|
5
|
-
|
|
6
|
-
esbuild.build({
|
|
7
|
-
entryPoints: ['./packages/cli/src/run.ts'],
|
|
8
|
-
bundle: true,
|
|
9
|
-
platform: 'node',
|
|
10
|
-
sourcemap: 'external',
|
|
11
|
-
outfile: './dist/run.js',
|
|
12
|
-
plugins: [
|
|
13
|
-
{
|
|
14
|
-
name: 'resolve contember',
|
|
15
|
-
setup(build) {
|
|
16
|
-
build.onResolve({filter: /^@contember\/.+$/}, args => {
|
|
17
|
-
const pkg = args.path.match(/@contember\/(.+)/)[1]
|
|
18
|
-
return {path: path.join(root, 'packages', pkg, pkg.includes('/') ? 'index.ts' : 'src/index.ts')}
|
|
19
|
-
})
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
],
|
|
23
|
-
external: ['pg-native', 'electron', 'esbuild', 'vm2'],
|
|
24
|
-
}).catch(e => {
|
|
25
|
-
console.error(e)
|
|
26
|
-
process.exit(1)
|
|
27
|
-
})
|