@contember/cli 1.2.0-alpha.4 → 1.2.0-alpha.5
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/dist/src/commands/deploy/DeployCommand.d.ts +3 -1
- package/dist/src/commands/deploy/DeployCommand.d.ts.map +1 -1
- package/dist/src/commands/deploy/DeployCommand.js +15 -15
- package/dist/src/commands/deploy/DeployCommand.js.map +1 -1
- package/dist/src/commands/migrations/MigrationAmendCommand.d.ts +4 -2
- package/dist/src/commands/migrations/MigrationAmendCommand.d.ts.map +1 -1
- package/dist/src/commands/migrations/MigrationAmendCommand.js +8 -2
- package/dist/src/commands/migrations/MigrationAmendCommand.js.map +1 -1
- package/dist/src/commands/migrations/MigrationCreateHelper.d.ts +5 -4
- package/dist/src/commands/migrations/MigrationCreateHelper.d.ts.map +1 -1
- package/dist/src/commands/migrations/MigrationCreateHelper.js +2 -9
- package/dist/src/commands/migrations/MigrationCreateHelper.js.map +1 -1
- package/dist/src/commands/migrations/MigrationDescribeCommand.d.ts +4 -1
- package/dist/src/commands/migrations/MigrationDescribeCommand.d.ts.map +1 -1
- package/dist/src/commands/migrations/MigrationDescribeCommand.js +8 -3
- package/dist/src/commands/migrations/MigrationDescribeCommand.js.map +1 -1
- package/dist/src/commands/migrations/MigrationDiffCommand.d.ts +4 -2
- package/dist/src/commands/migrations/MigrationDiffCommand.d.ts.map +1 -1
- package/dist/src/commands/migrations/MigrationDiffCommand.js +9 -2
- package/dist/src/commands/migrations/MigrationDiffCommand.js.map +1 -1
- package/dist/src/commands/migrations/MigrationExecuteCommand.d.ts +4 -2
- package/dist/src/commands/migrations/MigrationExecuteCommand.d.ts.map +1 -1
- package/dist/src/commands/migrations/MigrationExecuteCommand.js +8 -5
- package/dist/src/commands/migrations/MigrationExecuteCommand.js.map +1 -1
- package/dist/src/commands/migrations/MigrationRebaseCommand.d.ts +4 -2
- package/dist/src/commands/migrations/MigrationRebaseCommand.d.ts.map +1 -1
- package/dist/src/commands/migrations/MigrationRebaseCommand.js +8 -2
- package/dist/src/commands/migrations/MigrationRebaseCommand.js.map +1 -1
- package/dist/src/commands/migrations/MigrationStatusCommand.d.ts +4 -1
- package/dist/src/commands/migrations/MigrationStatusCommand.d.ts.map +1 -1
- package/dist/src/commands/migrations/MigrationStatusCommand.js +8 -3
- package/dist/src/commands/migrations/MigrationStatusCommand.js.map +1 -1
- package/dist/src/commands/project/ProjectCreateCommand.d.ts +3 -0
- package/dist/src/commands/project/ProjectCreateCommand.d.ts.map +1 -1
- package/dist/src/commands/project/ProjectCreateCommand.js +5 -1
- package/dist/src/commands/project/ProjectCreateCommand.js.map +1 -1
- package/dist/src/commands/project/ProjectGenerateDocumentation.d.ts +4 -2
- package/dist/src/commands/project/ProjectGenerateDocumentation.d.ts.map +1 -1
- package/dist/src/commands/project/ProjectGenerateDocumentation.js +8 -4
- package/dist/src/commands/project/ProjectGenerateDocumentation.js.map +1 -1
- package/dist/src/commands/project/ProjectPrintSchemaCommand.d.ts +4 -1
- package/dist/src/commands/project/ProjectPrintSchemaCommand.d.ts.map +1 -1
- package/dist/src/commands/project/ProjectPrintSchemaCommand.js +8 -4
- package/dist/src/commands/project/ProjectPrintSchemaCommand.js.map +1 -1
- package/dist/src/commands/project/ProjectValidateCommand.d.ts +4 -2
- package/dist/src/commands/project/ProjectValidateCommand.d.ts.map +1 -1
- package/dist/src/commands/project/ProjectValidateCommand.js +8 -5
- package/dist/src/commands/project/ProjectValidateCommand.js.map +1 -1
- package/dist/src/commands/tenant/CreateApiKeyCommand.d.ts +3 -0
- package/dist/src/commands/tenant/CreateApiKeyCommand.d.ts.map +1 -1
- package/dist/src/commands/tenant/CreateApiKeyCommand.js +5 -2
- package/dist/src/commands/tenant/CreateApiKeyCommand.js.map +1 -1
- package/dist/src/commands/tenant/InviteCommand.d.ts +3 -0
- package/dist/src/commands/tenant/InviteCommand.d.ts.map +1 -1
- package/dist/src/commands/tenant/InviteCommand.js +5 -2
- package/dist/src/commands/tenant/InviteCommand.js.map +1 -1
- package/dist/src/commands/tenant/ResetPasswordCommand.d.ts +3 -0
- package/dist/src/commands/tenant/ResetPasswordCommand.d.ts.map +1 -1
- package/dist/src/commands/tenant/ResetPasswordCommand.js +5 -2
- package/dist/src/commands/tenant/ResetPasswordCommand.js.map +1 -1
- package/dist/src/commands/tenant/SignInCommand.d.ts +3 -0
- package/dist/src/commands/tenant/SignInCommand.d.ts.map +1 -1
- package/dist/src/commands/tenant/SignInCommand.js +5 -2
- package/dist/src/commands/tenant/SignInCommand.js.map +1 -1
- package/dist/src/commands/workspace/WorkspaceUpdateApiCommand.d.ts +3 -1
- package/dist/src/commands/workspace/WorkspaceUpdateApiCommand.d.ts.map +1 -1
- package/dist/src/commands/workspace/WorkspaceUpdateApiCommand.js +5 -1
- package/dist/src/commands/workspace/WorkspaceUpdateApiCommand.js.map +1 -1
- package/dist/src/run.js +22 -23
- package/dist/src/run.js.map +1 -1
- package/dist/src/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -10
- package/src/commands/deploy/DeployCommand.ts +20 -15
- package/src/commands/migrations/MigrationAmendCommand.ts +12 -3
- package/src/commands/migrations/MigrationCreateHelper.ts +2 -7
- package/src/commands/migrations/MigrationDescribeCommand.ts +11 -3
- package/src/commands/migrations/MigrationDiffCommand.ts +14 -4
- package/src/commands/migrations/MigrationExecuteCommand.ts +11 -6
- package/src/commands/migrations/MigrationRebaseCommand.ts +13 -3
- package/src/commands/migrations/MigrationStatusCommand.ts +11 -3
- package/src/commands/project/ProjectCreateCommand.ts +7 -1
- package/src/commands/project/ProjectGenerateDocumentation.ts +12 -7
- package/src/commands/project/ProjectPrintSchemaCommand.ts +11 -4
- package/src/commands/project/ProjectValidateCommand.ts +11 -6
- package/src/commands/tenant/CreateApiKeyCommand.ts +7 -1
- package/src/commands/tenant/InviteCommand.ts +7 -1
- package/src/commands/tenant/ResetPasswordCommand.ts +7 -1
- package/src/commands/tenant/SignInCommand.ts +7 -1
- package/src/commands/workspace/WorkspaceUpdateApiCommand.ts +7 -1
- package/src/run.ts +24 -26
package/src/run.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { Application, CommandManager, getPackageVersion } from '@contember/cli-common'
|
|
2
|
+
import { Application, CommandFactoryList, CommandManager, getPackageVersion, Workspace } from '@contember/cli-common'
|
|
3
3
|
import {
|
|
4
4
|
CreateApiKeyCommand,
|
|
5
5
|
DeployCommand,
|
|
@@ -18,34 +18,32 @@ import {
|
|
|
18
18
|
SignInCommand,
|
|
19
19
|
VersionCommand,
|
|
20
20
|
WorkspaceUpdateApiCommand,
|
|
21
|
-
} from './commands'
|
|
21
|
+
} from './commands'
|
|
22
22
|
|
|
23
23
|
(async () => {
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
['deploy']: () => new DeployCommand(),
|
|
24
|
+
const workspace = await Workspace.get(process.cwd())
|
|
25
|
+
const commands: CommandFactoryList = {
|
|
26
|
+
['deploy']: () => new DeployCommand(workspace),
|
|
28
27
|
['version']: () => new VersionCommand(),
|
|
29
|
-
['migrations:diff']:
|
|
30
|
-
['migrations:amend']: () => new MigrationAmendCommand(),
|
|
31
|
-
['migrations:describe']:
|
|
32
|
-
['migrations:execute']: () => new MigrationExecuteCommand(),
|
|
33
|
-
['migrations:rebase']: () => new MigrationRebaseCommand(),
|
|
34
|
-
['migrations:status']: () => new MigrationStatusCommand(),
|
|
35
|
-
['workspace:update:api']: () => new WorkspaceUpdateApiCommand(),
|
|
36
|
-
['project:
|
|
37
|
-
['project:
|
|
38
|
-
['project:
|
|
39
|
-
['
|
|
40
|
-
['tenant:
|
|
41
|
-
['tenant:
|
|
42
|
-
['tenant:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
})
|
|
28
|
+
['migrations:diff']: () => new MigrationDiffCommand(workspace),
|
|
29
|
+
['migrations:amend']: () => new MigrationAmendCommand(workspace),
|
|
30
|
+
['migrations:describe']: () => new MigrationDescribeCommand(workspace),
|
|
31
|
+
['migrations:execute']: () => new MigrationExecuteCommand(workspace),
|
|
32
|
+
['migrations:rebase']: () => new MigrationRebaseCommand(workspace),
|
|
33
|
+
['migrations:status']: () => new MigrationStatusCommand(workspace),
|
|
34
|
+
['workspace:update:api']: () => new WorkspaceUpdateApiCommand(workspace),
|
|
35
|
+
['project:validate']: () => new ProjectValidateCommand(workspace),
|
|
36
|
+
['project:print-schema']: () => new ProjectPrintSchemaCommand(workspace),
|
|
37
|
+
['project:generate-doc']: () => new ProjectGenerateDocumentation(workspace),
|
|
38
|
+
['tenant:sign-in']: () => new SignInCommand(workspace),
|
|
39
|
+
['tenant:create-api-key']: () => new CreateApiKeyCommand(workspace),
|
|
40
|
+
['tenant:invite']: () => new InviteCommand(workspace),
|
|
41
|
+
['tenant:reset-password']: () => new ResetPasswordCommand(workspace),
|
|
42
|
+
}
|
|
43
|
+
if (!workspace.isSingleProjectMode()) {
|
|
44
|
+
commands['project:create'] = () => new ProjectCreateCommand(workspace)
|
|
45
|
+
}
|
|
46
|
+
const commandManager = new CommandManager(commands)
|
|
49
47
|
|
|
50
48
|
const nodeVersion = process.version.match(/^v?(\d+)\..+$/)
|
|
51
49
|
if (nodeVersion && Number(nodeVersion[1]) < 12) {
|