@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.
- package/Dockerfile +1 -1
- package/build.sh +1 -0
- package/contember-docker.sh +0 -0
- package/dist/src/commands/deploy/DeployCommand.d.ts +2 -2
- package/dist/src/commands/deploy/DeployCommand.d.ts.map +1 -1
- package/dist/src/commands/migrations/MigrationAmendCommand.d.ts +2 -2
- package/dist/src/commands/migrations/MigrationAmendCommand.d.ts.map +1 -1
- package/dist/src/commands/migrations/MigrationAmendCommand.js +1 -1
- package/dist/src/commands/migrations/MigrationAmendCommand.js.map +1 -1
- package/dist/src/commands/migrations/MigrationCreateHelper.d.ts +2 -2
- package/dist/src/commands/migrations/MigrationCreateHelper.d.ts.map +1 -1
- package/dist/src/commands/migrations/MigrationDescribeCommand.d.ts +3 -4
- package/dist/src/commands/migrations/MigrationDescribeCommand.d.ts.map +1 -1
- package/dist/src/commands/migrations/MigrationDescribeCommand.js +1 -31
- package/dist/src/commands/migrations/MigrationDescribeCommand.js.map +1 -1
- package/dist/src/commands/migrations/MigrationDiffCommand.d.ts +2 -2
- package/dist/src/commands/migrations/MigrationDiffCommand.d.ts.map +1 -1
- package/dist/src/commands/migrations/MigrationExecuteCommand.d.ts +3 -3
- package/dist/src/commands/migrations/MigrationExecuteCommand.d.ts.map +1 -1
- package/dist/src/commands/migrations/MigrationExecuteCommand.js +7 -26
- package/dist/src/commands/migrations/MigrationExecuteCommand.js.map +1 -1
- package/dist/src/commands/migrations/MigrationExecuteHelper.d.ts +1 -1
- package/dist/src/commands/migrations/MigrationExecuteHelper.d.ts.map +1 -1
- package/dist/src/commands/migrations/MigrationRebaseCommand.d.ts +2 -2
- package/dist/src/commands/migrations/MigrationRebaseCommand.d.ts.map +1 -1
- package/dist/src/commands/migrations/MigrationStatusCommand.d.ts +2 -2
- package/dist/src/commands/migrations/MigrationStatusCommand.d.ts.map +1 -1
- package/dist/src/commands/migrations/MigrationValidationHelper.d.ts.map +1 -1
- package/dist/src/commands/migrations/MigrationValidationHelper.js +8 -2
- package/dist/src/commands/migrations/MigrationValidationHelper.js.map +1 -1
- package/dist/src/commands/project/ProjectCreateCommand.d.ts +2 -2
- package/dist/src/commands/project/ProjectCreateCommand.d.ts.map +1 -1
- package/dist/src/commands/project/ProjectGenerateDocumentation.d.ts +2 -2
- package/dist/src/commands/project/ProjectGenerateDocumentation.d.ts.map +1 -1
- package/dist/src/commands/project/ProjectPrintSchemaCommand.d.ts +3 -2
- package/dist/src/commands/project/ProjectPrintSchemaCommand.d.ts.map +1 -1
- package/dist/src/commands/project/ProjectPrintSchemaCommand.js +8 -5
- package/dist/src/commands/project/ProjectPrintSchemaCommand.js.map +1 -1
- package/dist/src/commands/project/ProjectValidateCommand.d.ts +2 -2
- package/dist/src/commands/project/ProjectValidateCommand.d.ts.map +1 -1
- package/dist/src/commands/tenant/CreateApiKeyCommand.d.ts +2 -2
- package/dist/src/commands/tenant/CreateApiKeyCommand.d.ts.map +1 -1
- package/dist/src/commands/tenant/InviteCommand.d.ts +2 -2
- package/dist/src/commands/tenant/InviteCommand.d.ts.map +1 -1
- package/dist/src/commands/tenant/ResetPasswordCommand.d.ts +2 -2
- package/dist/src/commands/tenant/ResetPasswordCommand.d.ts.map +1 -1
- package/dist/src/commands/tenant/SignInCommand.d.ts +2 -2
- package/dist/src/commands/tenant/SignInCommand.d.ts.map +1 -1
- package/dist/src/commands/transfer/ExportCommand.d.ts +2 -2
- package/dist/src/commands/transfer/ExportCommand.d.ts.map +1 -1
- package/dist/src/commands/transfer/ImportCommand.d.ts +2 -2
- package/dist/src/commands/transfer/ImportCommand.d.ts.map +1 -1
- package/dist/src/commands/transfer/TransferCommand.d.ts +2 -2
- package/dist/src/commands/transfer/TransferCommand.d.ts.map +1 -1
- package/dist/src/commands/transfer/utils.d.ts +1 -1
- package/dist/src/commands/transfer/utils.d.ts.map +1 -1
- package/dist/src/commands/workspace/WorkspaceUpdateApiCommand.d.ts +2 -2
- package/dist/src/commands/workspace/WorkspaceUpdateApiCommand.d.ts.map +1 -1
- package/dist/src/commands/workspace/WorkspaceUpdateApiCommand.js +9 -7
- package/dist/src/commands/workspace/WorkspaceUpdateApiCommand.js.map +1 -1
- package/dist/src/run.js +4 -0
- package/dist/src/run.js.map +1 -1
- package/dist/src/tsconfig.tsbuildinfo +1 -1
- package/dist/src/utils/admin.d.ts +1 -1
- package/dist/src/utils/admin.d.ts.map +1 -1
- package/dist/src/utils/checkVersions.d.ts +3 -0
- package/dist/src/utils/checkVersions.d.ts.map +1 -0
- package/dist/src/utils/checkVersions.js +83 -0
- package/dist/src/utils/checkVersions.js.map +1 -0
- package/dist/src/utils/dockerCompose.d.ts +3 -0
- package/dist/src/utils/dockerCompose.d.ts.map +1 -1
- package/dist/src/utils/dockerCompose.js +45 -4
- package/dist/src/utils/dockerCompose.js.map +1 -1
- package/dist/src/utils/instance/environment.d.ts +1 -1
- package/dist/src/utils/instance/environment.d.ts.map +1 -1
- package/dist/src/utils/migrations.d.ts +3 -3
- package/dist/src/utils/migrations.d.ts.map +1 -1
- package/dist/src/utils/migrations.js +13 -5
- package/dist/src/utils/migrations.js.map +1 -1
- package/dist/src/utils/schema/collectReferences.d.ts +2 -2
- package/dist/src/utils/schema/collectReferences.d.ts.map +1 -1
- package/dist/src/utils/system/index.d.ts +2 -2
- package/dist/src/utils/system/index.d.ts.map +1 -1
- package/dist/src/utils/system/index.js +1 -1
- package/dist/src/utils/system/index.js.map +1 -1
- package/dist/src/utils/tenant.d.ts +2 -2
- package/dist/src/utils/tenant.d.ts.map +1 -1
- package/dist/src/utils/yaml.d.ts +1 -1
- package/dist/src/utils/yaml.d.ts.map +1 -1
- package/package.json +13 -11
- package/src/commands/migrations/MigrationAmendCommand.ts +1 -1
- package/src/commands/migrations/MigrationDescribeCommand.ts +3 -37
- package/src/commands/migrations/MigrationExecuteCommand.ts +11 -29
- package/src/commands/migrations/MigrationValidationHelper.ts +9 -3
- package/src/commands/project/ProjectPrintSchemaCommand.ts +10 -6
- package/src/commands/workspace/WorkspaceUpdateApiCommand.ts +10 -8
- package/src/run.ts +7 -1
- package/src/utils/checkVersions.ts +58 -0
- package/src/utils/dockerCompose.ts +20 -3
- package/src/utils/migrations.ts +12 -4
- package/dist/src/utils/commands.d.ts +0 -21
- package/dist/src/utils/commands.d.ts.map +0 -1
- package/dist/src/utils/commands.js +0 -57
- package/dist/src/utils/commands.js.map +0 -1
- package/dist/src/utils/npm.d.ts +0 -6
- package/dist/src/utils/npm.d.ts.map +0 -1
- package/dist/src/utils/npm.js +0 -62
- package/dist/src/utils/npm.js.map +0 -1
- package/src/utils/commands.ts +0 -65
- 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
|
-
}
|