@contember/cli 1.3.0-alpha.7 → 1.3.0-beta.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.
Files changed (110) hide show
  1. package/Dockerfile +1 -1
  2. package/build.sh +1 -0
  3. package/contember-docker.sh +0 -0
  4. package/dist/src/commands/deploy/DeployCommand.d.ts +2 -2
  5. package/dist/src/commands/deploy/DeployCommand.d.ts.map +1 -1
  6. package/dist/src/commands/migrations/MigrationAmendCommand.d.ts +2 -2
  7. package/dist/src/commands/migrations/MigrationAmendCommand.d.ts.map +1 -1
  8. package/dist/src/commands/migrations/MigrationAmendCommand.js +1 -1
  9. package/dist/src/commands/migrations/MigrationAmendCommand.js.map +1 -1
  10. package/dist/src/commands/migrations/MigrationCreateHelper.d.ts +2 -2
  11. package/dist/src/commands/migrations/MigrationCreateHelper.d.ts.map +1 -1
  12. package/dist/src/commands/migrations/MigrationDescribeCommand.d.ts +3 -4
  13. package/dist/src/commands/migrations/MigrationDescribeCommand.d.ts.map +1 -1
  14. package/dist/src/commands/migrations/MigrationDescribeCommand.js +1 -31
  15. package/dist/src/commands/migrations/MigrationDescribeCommand.js.map +1 -1
  16. package/dist/src/commands/migrations/MigrationDiffCommand.d.ts +2 -2
  17. package/dist/src/commands/migrations/MigrationDiffCommand.d.ts.map +1 -1
  18. package/dist/src/commands/migrations/MigrationExecuteCommand.d.ts +3 -3
  19. package/dist/src/commands/migrations/MigrationExecuteCommand.d.ts.map +1 -1
  20. package/dist/src/commands/migrations/MigrationExecuteCommand.js +7 -26
  21. package/dist/src/commands/migrations/MigrationExecuteCommand.js.map +1 -1
  22. package/dist/src/commands/migrations/MigrationExecuteHelper.d.ts +1 -1
  23. package/dist/src/commands/migrations/MigrationExecuteHelper.d.ts.map +1 -1
  24. package/dist/src/commands/migrations/MigrationRebaseCommand.d.ts +2 -2
  25. package/dist/src/commands/migrations/MigrationRebaseCommand.d.ts.map +1 -1
  26. package/dist/src/commands/migrations/MigrationStatusCommand.d.ts +2 -2
  27. package/dist/src/commands/migrations/MigrationStatusCommand.d.ts.map +1 -1
  28. package/dist/src/commands/migrations/MigrationValidationHelper.d.ts.map +1 -1
  29. package/dist/src/commands/migrations/MigrationValidationHelper.js +8 -2
  30. package/dist/src/commands/migrations/MigrationValidationHelper.js.map +1 -1
  31. package/dist/src/commands/project/ProjectCreateCommand.d.ts +2 -2
  32. package/dist/src/commands/project/ProjectCreateCommand.d.ts.map +1 -1
  33. package/dist/src/commands/project/ProjectGenerateDocumentation.d.ts +2 -2
  34. package/dist/src/commands/project/ProjectGenerateDocumentation.d.ts.map +1 -1
  35. package/dist/src/commands/project/ProjectPrintSchemaCommand.d.ts +3 -2
  36. package/dist/src/commands/project/ProjectPrintSchemaCommand.d.ts.map +1 -1
  37. package/dist/src/commands/project/ProjectPrintSchemaCommand.js +8 -5
  38. package/dist/src/commands/project/ProjectPrintSchemaCommand.js.map +1 -1
  39. package/dist/src/commands/project/ProjectValidateCommand.d.ts +2 -2
  40. package/dist/src/commands/project/ProjectValidateCommand.d.ts.map +1 -1
  41. package/dist/src/commands/tenant/CreateApiKeyCommand.d.ts +2 -2
  42. package/dist/src/commands/tenant/CreateApiKeyCommand.d.ts.map +1 -1
  43. package/dist/src/commands/tenant/InviteCommand.d.ts +2 -2
  44. package/dist/src/commands/tenant/InviteCommand.d.ts.map +1 -1
  45. package/dist/src/commands/tenant/ResetPasswordCommand.d.ts +2 -2
  46. package/dist/src/commands/tenant/ResetPasswordCommand.d.ts.map +1 -1
  47. package/dist/src/commands/tenant/SignInCommand.d.ts +2 -2
  48. package/dist/src/commands/tenant/SignInCommand.d.ts.map +1 -1
  49. package/dist/src/commands/transfer/ExportCommand.d.ts +2 -2
  50. package/dist/src/commands/transfer/ExportCommand.d.ts.map +1 -1
  51. package/dist/src/commands/transfer/ImportCommand.d.ts +2 -2
  52. package/dist/src/commands/transfer/ImportCommand.d.ts.map +1 -1
  53. package/dist/src/commands/transfer/TransferCommand.d.ts +2 -2
  54. package/dist/src/commands/transfer/TransferCommand.d.ts.map +1 -1
  55. package/dist/src/commands/transfer/utils.d.ts +1 -1
  56. package/dist/src/commands/transfer/utils.d.ts.map +1 -1
  57. package/dist/src/commands/workspace/WorkspaceUpdateApiCommand.d.ts +2 -2
  58. package/dist/src/commands/workspace/WorkspaceUpdateApiCommand.d.ts.map +1 -1
  59. package/dist/src/commands/workspace/WorkspaceUpdateApiCommand.js +9 -7
  60. package/dist/src/commands/workspace/WorkspaceUpdateApiCommand.js.map +1 -1
  61. package/dist/src/run.js +4 -0
  62. package/dist/src/run.js.map +1 -1
  63. package/dist/src/tsconfig.tsbuildinfo +1 -1
  64. package/dist/src/utils/admin.d.ts +1 -1
  65. package/dist/src/utils/admin.d.ts.map +1 -1
  66. package/dist/src/utils/checkVersions.d.ts +3 -0
  67. package/dist/src/utils/checkVersions.d.ts.map +1 -0
  68. package/dist/src/utils/checkVersions.js +83 -0
  69. package/dist/src/utils/checkVersions.js.map +1 -0
  70. package/dist/src/utils/dockerCompose.d.ts +3 -0
  71. package/dist/src/utils/dockerCompose.d.ts.map +1 -1
  72. package/dist/src/utils/dockerCompose.js +45 -4
  73. package/dist/src/utils/dockerCompose.js.map +1 -1
  74. package/dist/src/utils/instance/environment.d.ts +1 -1
  75. package/dist/src/utils/instance/environment.d.ts.map +1 -1
  76. package/dist/src/utils/migrations.d.ts +3 -3
  77. package/dist/src/utils/migrations.d.ts.map +1 -1
  78. package/dist/src/utils/migrations.js +13 -5
  79. package/dist/src/utils/migrations.js.map +1 -1
  80. package/dist/src/utils/schema/collectReferences.d.ts +2 -2
  81. package/dist/src/utils/schema/collectReferences.d.ts.map +1 -1
  82. package/dist/src/utils/system/index.d.ts +2 -2
  83. package/dist/src/utils/system/index.d.ts.map +1 -1
  84. package/dist/src/utils/system/index.js +1 -1
  85. package/dist/src/utils/system/index.js.map +1 -1
  86. package/dist/src/utils/tenant.d.ts +2 -2
  87. package/dist/src/utils/tenant.d.ts.map +1 -1
  88. package/dist/src/utils/yaml.d.ts +1 -1
  89. package/dist/src/utils/yaml.d.ts.map +1 -1
  90. package/package.json +13 -11
  91. package/src/commands/migrations/MigrationAmendCommand.ts +1 -1
  92. package/src/commands/migrations/MigrationDescribeCommand.ts +3 -37
  93. package/src/commands/migrations/MigrationExecuteCommand.ts +11 -29
  94. package/src/commands/migrations/MigrationValidationHelper.ts +9 -3
  95. package/src/commands/project/ProjectPrintSchemaCommand.ts +10 -6
  96. package/src/commands/workspace/WorkspaceUpdateApiCommand.ts +10 -8
  97. package/src/run.ts +7 -1
  98. package/src/utils/checkVersions.ts +58 -0
  99. package/src/utils/dockerCompose.ts +20 -3
  100. package/src/utils/migrations.ts +12 -4
  101. package/dist/src/utils/commands.d.ts +0 -21
  102. package/dist/src/utils/commands.d.ts.map +0 -1
  103. package/dist/src/utils/commands.js +0 -57
  104. package/dist/src/utils/commands.js.map +0 -1
  105. package/dist/src/utils/npm.d.ts +0 -6
  106. package/dist/src/utils/npm.d.ts.map +0 -1
  107. package/dist/src/utils/npm.js +0 -62
  108. package/dist/src/utils/npm.js.map +0 -1
  109. package/src/utils/commands.ts +0 -65
  110. package/src/utils/npm.ts +0 -63
package/src/utils/npm.ts DELETED
@@ -1,63 +0,0 @@
1
- import { pathExists } from '@contember/cli-common'
2
- import { join } from 'node:path'
3
- import { runCommand } from './commands'
4
- import { listDirectories } from '@contember/cli-common'
5
-
6
- export interface NpmPackageUpdate {
7
- name: string
8
- version: string
9
- }
10
-
11
- const install = async (hasYarn: boolean, packages: string[], isDev: boolean, dir: string) => {
12
- const [cmd, ...args] = hasYarn
13
- ? ['yarn', 'add', isDev ? '--dev' : undefined, '--ignore-workspace-root-check']
14
- : ['npm', 'install', isDev ? '--save-dev' : '--save']
15
- const label = isDev ? 'devDependencies' : 'dependencies'
16
- if (packages.length === 0) {
17
- console.log(`No npm ${label} to update.`)
18
- return
19
- }
20
- console.log(`Updating npm ${label}: ${packages.join(', ')}`)
21
- const { output } = runCommand(cmd, [...args, ...packages], {
22
- cwd: dir,
23
- stderr: process.stderr,
24
- stdout: process.stdout,
25
- })
26
- await output
27
- console.log('npm update done')
28
- }
29
-
30
- export const updateNpmPackages = async (packages: NpmPackageUpdate[], workspaceDirectory: string) => {
31
- const hasYarn = await pathExists(join(workspaceDirectory, 'yarn.lock'))
32
- const processPackageFile = async (dir: string) => {
33
- const packageJsonFile = join(dir, 'package.json')
34
- if (!(await pathExists(packageJsonFile))) {
35
- return
36
- }
37
- // eslint-disable-next-line @typescript-eslint/no-var-requires
38
- const packageJson = require(packageJsonFile) as any
39
- const isRoot = workspaceDirectory === dir
40
- const upgradeDeps = async (type: 'dependencies' | 'devDependencies') => {
41
- const deps = packageJson[type] || {}
42
- const packagesToUpdate = packages.filter(it => !!deps[it.name]).map(it => `${it.name}@${it.version}`)
43
- await install(hasYarn, packagesToUpdate, type === 'devDependencies', dir)
44
- }
45
- await upgradeDeps('dependencies')
46
- await upgradeDeps('devDependencies')
47
- if (hasYarn && isRoot && packageJson.workspaces) {
48
- const dirsPromise = (packageJson.workspaces as string[]).map(async (it): Promise<string[]> => {
49
- if (it.substr(-1) === '*') {
50
- const baseDir = it.substring(0, it.length - 1)
51
- return await listDirectories(baseDir)
52
- } else {
53
- return [join(dir, it)]
54
- }
55
- })
56
- const workspaceDirs = (await Promise.all(dirsPromise)).flatMap(it => it)
57
- for (const dir of workspaceDirs) {
58
- await processPackageFile(dir)
59
- }
60
- }
61
- }
62
- await processPackageFile(workspaceDirectory)
63
- }