@contember/cli 2.0.1 → 2.0.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contember/cli",
3
- "version": "2.0.1",
3
+ "version": "2.0.3",
4
4
  "license": "Apache-2.0",
5
5
  "bin": {
6
6
  "contember": "./dist/production/run.js"
@@ -20,18 +20,18 @@
20
20
  "tailwindcss": "^3.4.14"
21
21
  },
22
22
  "dependencies": {
23
- "@contember/cli-common": "2.0.1",
24
- "@contember/config-loader": "2.0.1",
25
- "@contember/database": "2.0.1",
26
- "@contember/dic": "2.0.1",
27
- "@contember/engine-common": "2.0.1",
28
- "@contember/engine-content-api": "2.0.1",
29
- "@contember/graphql-client": "2.0.1",
30
- "@contember/migrations-client": "2.0.1",
31
- "@contember/schema": "2.0.1",
32
- "@contember/schema-migrations": "2.0.1",
33
- "@contember/schema-utils": "2.0.1",
34
- "@contember/typesafe": "2.0.1",
23
+ "@contember/cli-common": "2.0.3",
24
+ "@contember/config-loader": "2.0.3",
25
+ "@contember/database": "2.0.3",
26
+ "@contember/dic": "2.0.3",
27
+ "@contember/engine-common": "2.0.3",
28
+ "@contember/engine-content-api": "2.0.3",
29
+ "@contember/graphql-client": "2.0.3",
30
+ "@contember/migrations-client": "2.0.3",
31
+ "@contember/schema": "2.0.3",
32
+ "@contember/schema-migrations": "2.0.3",
33
+ "@contember/schema-utils": "2.0.3",
34
+ "@contember/typesafe": "2.0.3",
35
35
  "@graphql-tools/schema": "^10.0.7",
36
36
  "chalk": "^5.3.0",
37
37
  "chalk-table": "^1.0.2",
@@ -10,7 +10,7 @@ import { RemoteProjectProvider } from '../../lib/project/RemoteProjectProvider'
10
10
  import { RemoteProjectResolver } from '../../lib/project/RemoteProjectResolver'
11
11
 
12
12
  type Args = {
13
- dsn: string
13
+ dsn?: string
14
14
  }
15
15
 
16
16
  type Options = {
@@ -35,7 +35,7 @@ export class DeployCommand extends Command<Args, Options> {
35
35
 
36
36
  protected configure(configuration: CommandConfiguration<Args, Options>): void {
37
37
  configuration.description('Deploy Contember project')
38
- configuration.argument('dsn')
38
+ configuration.argument('dsn').optional()
39
39
 
40
40
  configuration.option('admin').valueRequired()
41
41
  configuration.option('root').valueNone()
@@ -46,17 +46,13 @@ export class VersionChecker {
46
46
  if (!def.image) {
47
47
  continue
48
48
  }
49
- const [image, version] = def.image.split(':')
50
- if (!version || !contemberDockerImages.includes(image)) {
49
+ const [image, tag] = def.image.split(':')
50
+ if (!tag || !contemberDockerImages.includes(image)) {
51
51
  continue
52
52
  }
53
- const versionParts = version.split(/[.-]/)
54
- if (versionParts[versionParts.length - 1] === 'debian') {
55
- versionParts.pop()
56
- }
57
- const cliVersionParts = cliVersion.split(/[.-]/).slice(0, versionParts.length)
58
- if (versionParts.join('.') !== cliVersionParts.join('.')) {
59
- errors.push(`Docker service ${name} with image ${image}:${version} does not match version of CLI ${cliVersion}.`)
53
+
54
+ if (extractVersion(tag) !== cliVersion) {
55
+ errors.push(`Docker service ${name} with image ${image}:${tag} does not match version of CLI ${cliVersion}.`)
60
56
  }
61
57
  }
62
58
  }
@@ -69,3 +65,11 @@ Please make sure all dependencies are up to date.\nIf you are really certain abo
69
65
  }
70
66
 
71
67
  }
68
+
69
+
70
+ const extractVersion = (tag: string) => {
71
+ // e.g.
72
+ // 2.1.0-alpha.15-foo-bar => 2.1.0-alpha.15
73
+ // 2.1.0-debian => 2.1.0
74
+ return tag.match(/^\d+\.\d+\.\d+(-\w+\.\d+)?/)?.[0] ?? tag
75
+ }