@contember/cli 2.0.0-beta.2 → 2.0.0-beta.4
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/development/src/commands/project/ProjectGenerateDocumentationCommand.cjs +4 -2
- package/dist/development/src/commands/project/ProjectGenerateDocumentationCommand.cjs.map +1 -1
- package/dist/development/src/commands/project/ProjectGenerateDocumentationCommand.js +4 -2
- package/dist/development/src/commands/project/ProjectGenerateDocumentationCommand.js.map +1 -1
- package/dist/development/src/dic.cjs +1 -1
- package/dist/development/src/dic.cjs.map +1 -1
- package/dist/development/src/dic.js +1 -1
- package/dist/development/src/dic.js.map +1 -1
- package/dist/production/src/commands/project/ProjectGenerateDocumentationCommand.cjs +4 -2
- package/dist/production/src/commands/project/ProjectGenerateDocumentationCommand.cjs.map +1 -1
- package/dist/production/src/commands/project/ProjectGenerateDocumentationCommand.js +4 -2
- package/dist/production/src/commands/project/ProjectGenerateDocumentationCommand.js.map +1 -1
- package/dist/production/src/dic.cjs +1 -1
- package/dist/production/src/dic.cjs.map +1 -1
- package/dist/production/src/dic.js +1 -1
- package/dist/production/src/dic.js.map +1 -1
- package/dist/types/commands/project/ProjectGenerateDocumentationCommand.d.ts +4 -1
- package/dist/types/commands/project/ProjectGenerateDocumentationCommand.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +13 -13
- package/src/commands/project/ProjectGenerateDocumentationCommand.ts +7 -1
- package/src/dic.ts +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contember/cli",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.4",
|
|
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.0-beta.
|
|
24
|
-
"@contember/config-loader": "2.0.0-beta.
|
|
25
|
-
"@contember/database": "2.0.0-beta.
|
|
26
|
-
"@contember/dic": "2.0.0-beta.
|
|
27
|
-
"@contember/engine-common": "2.0.0-beta.
|
|
28
|
-
"@contember/engine-content-api": "2.0.0-beta.
|
|
29
|
-
"@contember/graphql-client": "2.0.0-beta.
|
|
30
|
-
"@contember/migrations-client": "2.0.0-beta.
|
|
31
|
-
"@contember/schema": "2.0.0-beta.
|
|
32
|
-
"@contember/schema-migrations": "2.0.0-beta.
|
|
33
|
-
"@contember/schema-utils": "2.0.0-beta.
|
|
34
|
-
"@contember/typesafe": "2.0.0-beta.
|
|
23
|
+
"@contember/cli-common": "2.0.0-beta.4",
|
|
24
|
+
"@contember/config-loader": "2.0.0-beta.4",
|
|
25
|
+
"@contember/database": "2.0.0-beta.4",
|
|
26
|
+
"@contember/dic": "2.0.0-beta.4",
|
|
27
|
+
"@contember/engine-common": "2.0.0-beta.4",
|
|
28
|
+
"@contember/engine-content-api": "2.0.0-beta.4",
|
|
29
|
+
"@contember/graphql-client": "2.0.0-beta.4",
|
|
30
|
+
"@contember/migrations-client": "2.0.0-beta.4",
|
|
31
|
+
"@contember/schema": "2.0.0-beta.4",
|
|
32
|
+
"@contember/schema-migrations": "2.0.0-beta.4",
|
|
33
|
+
"@contember/schema-utils": "2.0.0-beta.4",
|
|
34
|
+
"@contember/typesafe": "2.0.0-beta.4",
|
|
35
35
|
"@graphql-tools/schema": "^10.0.7",
|
|
36
36
|
"chalk": "^5.3.0",
|
|
37
37
|
"chalk-table": "^1.0.2",
|
|
@@ -4,11 +4,13 @@ import { writeFile } from 'node:fs/promises'
|
|
|
4
4
|
import { join } from 'node:path'
|
|
5
5
|
import { SchemaLoader } from '../../lib/schema/SchemaLoader'
|
|
6
6
|
import { validateSchemaAndPrintErrors } from '../../lib/schema/SchemaValidationHelper'
|
|
7
|
+
import { SchemaVersionBuilder } from '@contember/migrations-client'
|
|
7
8
|
|
|
8
9
|
type Args = {
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
type Options = {
|
|
13
|
+
source?: 'migrations' | 'definition'
|
|
12
14
|
name?: string
|
|
13
15
|
output?: string
|
|
14
16
|
}
|
|
@@ -16,18 +18,22 @@ type Options = {
|
|
|
16
18
|
export class ProjectGenerateDocumentationCommand extends Command<Args, Options> {
|
|
17
19
|
constructor(
|
|
18
20
|
private readonly schemaLoader: SchemaLoader,
|
|
21
|
+
private readonly schemaVersionBuilder: SchemaVersionBuilder,
|
|
19
22
|
) {
|
|
20
23
|
super()
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
protected configure(configuration: CommandConfiguration<Args, Options>): void {
|
|
24
27
|
configuration.description('Generates HTML documentation from project schema')
|
|
28
|
+
configuration.option('source').valueRequired().description('migrations|definition')
|
|
25
29
|
configuration.option('output').valueRequired().description('file name or "-" for stdout')
|
|
26
30
|
configuration.option('name').valueRequired().description('project name (for the title)')
|
|
27
31
|
}
|
|
28
32
|
|
|
29
33
|
protected async execute(input: Input<Args, Options>): Promise<number> {
|
|
30
|
-
const schema =
|
|
34
|
+
const schema = input.getOption('source') === 'migrations'
|
|
35
|
+
? await this.schemaVersionBuilder.buildSchema()
|
|
36
|
+
: await this.schemaLoader.loadSchema()
|
|
31
37
|
if (!validateSchemaAndPrintErrors(schema, 'Defined schema is invalid:')) {
|
|
32
38
|
return 1
|
|
33
39
|
}
|
package/src/dic.ts
CHANGED
|
@@ -202,8 +202,8 @@ export const createContainer = ({ env, version, runtime, workspace }: {
|
|
|
202
202
|
new MigrationStatusCommand(migrationsStatusFacade, migrationFilesManager, systemClientProvider, migrationPrinter))
|
|
203
203
|
.addService('versionCommand', ({ version }) =>
|
|
204
204
|
new VersionCommand(version))
|
|
205
|
-
.addService('projectGenerateDocumentationCommand', ({ schemaLoader }) =>
|
|
206
|
-
new ProjectGenerateDocumentationCommand(schemaLoader))
|
|
205
|
+
.addService('projectGenerateDocumentationCommand', ({ schemaLoader, schemaVersionBuilder }) =>
|
|
206
|
+
new ProjectGenerateDocumentationCommand(schemaLoader, schemaVersionBuilder))
|
|
207
207
|
.addService('projectPrintSchemaCommand', ({ schemaLoader, schemaVersionBuilder }) =>
|
|
208
208
|
new ProjectPrintSchemaCommand(schemaLoader, schemaVersionBuilder))
|
|
209
209
|
.addService('projectValidateCommand', ({ schemaLoader, migrationsValidator, migrationsResolver, schemaDiffer, schemaVersionBuilder }) =>
|