@contember/cli-common 0.12.0-alpha.9 → 1.0.0-alpha.0

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 (85) hide show
  1. package/dist/src/application/Application.d.ts +2 -0
  2. package/dist/src/application/Application.d.ts.map +1 -1
  3. package/dist/src/application/Application.js +13 -6
  4. package/dist/src/application/Application.js.map +1 -1
  5. package/dist/src/application/UsageFormatter.js +1 -1
  6. package/dist/src/application/UsageFormatter.js.map +1 -1
  7. package/dist/src/pathUtils.js +2 -2
  8. package/dist/src/pathUtils.js.map +1 -1
  9. package/dist/src/tsconfig.tsbuildinfo +1 -1
  10. package/dist/src/utils/PathMapping.js +7 -6
  11. package/dist/src/utils/PathMapping.js.map +1 -1
  12. package/dist/src/utils/Project.d.ts +0 -1
  13. package/dist/src/utils/Project.d.ts.map +1 -1
  14. package/dist/src/utils/Project.js +0 -37
  15. package/dist/src/utils/Project.js.map +1 -1
  16. package/dist/src/utils/ProjectManager.js +8 -8
  17. package/dist/src/utils/ProjectManager.js.map +1 -1
  18. package/dist/src/utils/Workspace.d.ts +7 -7
  19. package/dist/src/utils/Workspace.d.ts.map +1 -1
  20. package/dist/src/utils/Workspace.js +21 -60
  21. package/dist/src/utils/Workspace.js.map +1 -1
  22. package/dist/src/utils/fs.js +4 -4
  23. package/dist/src/utils/fs.js.map +1 -1
  24. package/dist/src/utils/index.d.ts +0 -1
  25. package/dist/src/utils/index.d.ts.map +1 -1
  26. package/dist/src/utils/index.js +0 -1
  27. package/dist/src/utils/index.js.map +1 -1
  28. package/dist/src/utils/npm.d.ts +1 -1
  29. package/dist/src/utils/npm.d.ts.map +1 -1
  30. package/dist/src/utils/npm.js +8 -9
  31. package/dist/src/utils/npm.js.map +1 -1
  32. package/dist/src/utils/template.d.ts.map +1 -1
  33. package/dist/src/utils/template.js +33 -30
  34. package/dist/src/utils/template.js.map +1 -1
  35. package/dist/src/utils/version.js +1 -1
  36. package/dist/src/utils/version.js.map +1 -1
  37. package/dist/src/utils/yaml.d.ts +0 -6
  38. package/dist/src/utils/yaml.d.ts.map +1 -1
  39. package/dist/src/utils/yaml.js +3 -27
  40. package/dist/src/utils/yaml.js.map +1 -1
  41. package/package.json +5 -6
  42. package/resources/templates/template-project/admin/components/Layout.tsx +12 -0
  43. package/resources/templates/template-project/admin/components/SideMenu.tsx +10 -0
  44. package/resources/templates/template-project/admin/index.html +9 -0
  45. package/resources/templates/template-project/admin/index.tsx +18 -0
  46. package/resources/templates/template-project/admin/pages/Dashboard.tsx +8 -0
  47. package/resources/templates/template-project/admin/vite-env.d.ts +7 -0
  48. package/resources/templates/template-project/api/{acl/index.ts → acl.ts} +0 -0
  49. package/resources/templates/template-project/api/model/index.ts +3 -2
  50. package/resources/templates/template-project/contember.template.yaml +3 -4
  51. package/resources/templates/template-project/tsconfig.json +16 -9
  52. package/resources/templates/template-workspace/.gitignore.dist +3 -0
  53. package/resources/templates/{template-workspace-single-instance → template-workspace}/contember.template.yaml +5 -1
  54. package/resources/templates/template-workspace/contember.yaml +4 -0
  55. package/resources/templates/template-workspace/docker-compose.yaml +159 -0
  56. package/resources/templates/template-workspace/package.json +17 -0
  57. package/resources/templates/{template-workspace-single-instance/api → template-workspace/scripts/minio}/s3-entrypoint.sh +0 -0
  58. package/resources/templates/{template-workspace-single-instance/api → template-workspace/scripts/minio}/s3-policy.json +0 -0
  59. package/resources/templates/template-workspace/tsconfig.json +16 -0
  60. package/src/application/Application.ts +14 -7
  61. package/src/utils/PathMapping.ts +1 -1
  62. package/src/utils/Project.ts +0 -40
  63. package/src/utils/Workspace.ts +21 -42
  64. package/src/utils/fs.ts +2 -2
  65. package/src/utils/index.ts +0 -1
  66. package/src/utils/npm.ts +3 -4
  67. package/src/utils/template.ts +28 -24
  68. package/src/utils/yaml.ts +3 -35
  69. package/dist/src/utils/dockerCompose.d.ts +0 -15
  70. package/dist/src/utils/dockerCompose.d.ts.map +0 -1
  71. package/dist/src/utils/dockerCompose.js +0 -22
  72. package/dist/src/utils/dockerCompose.js.map +0 -1
  73. package/resources/templates/template-project/api/migrations/2019-12-13-110355-init.json +0 -146
  74. package/resources/templates/template-project/api/model/Image.ts +0 -5
  75. package/resources/templates/template-project/api/model/Post.ts +0 -8
  76. package/resources/templates/template-project/package.json +0 -13
  77. package/resources/templates/template-workspace-single-instance/.dockerignore +0 -1
  78. package/resources/templates/template-workspace-single-instance/api/config.yaml +0 -0
  79. package/resources/templates/template-workspace-single-instance/contember.workspace.yaml +0 -2
  80. package/resources/templates/template-workspace-single-instance/docker-compose.override.dist.yaml +0 -26
  81. package/resources/templates/template-workspace-single-instance/docker-compose.yaml +0 -88
  82. package/resources/templates/template-workspace-single-instance/package.json +0 -12
  83. package/resources/templates/template-workspace-single-instance/projects/.gitkeep +0 -0
  84. package/resources/templates/template-workspace-single-instance/tsconfig.json +0 -22
  85. package/src/utils/dockerCompose.ts +0 -38
@@ -1,26 +0,0 @@
1
- version: '2.4'
2
-
3
- services:
4
- contember:
5
- ports:
6
- - '1481:4000'
7
- environment:
8
- DEFAULT_S3_ENDPOINT: 'http://localhost:1483'
9
- contember-cli:
10
- user: '1000:1000'
11
- volumes:
12
- - /etc/passwd:/etc/passwd:ro
13
- - /etc/group:/etc/group:ro
14
- postgresql:
15
- ports:
16
- - '1482:5432'
17
- s3:
18
- ports:
19
- - '1483:1484'
20
- command: 'server --address :1483 /data'
21
- mailhog:
22
- ports:
23
- - '1484:8025'
24
- # adminer:
25
- # ports:
26
- # - '1485:8080'
@@ -1,88 +0,0 @@
1
- version: '2.4'
2
- services:
3
- contember:
4
- image: contember/contember:{version}
5
- environment:
6
- NODE_ENV: 'development'
7
- CONTEMBER_S3_SERVER: minio
8
-
9
- CONTEMBER_ROOT_EMAIL: 'contember@localhost'
10
- CONTEMBER_ROOT_PASSWORD: 'contember'
11
- CONTEMBER_ROOT_TOKEN: '0000000000000000000000000000000000000000'
12
- CONTEMBER_LOGIN_TOKEN: '1111111111111111111111111111111111111111'
13
-
14
- DEFAULT_DB_HOST: 'postgresql'
15
- DEFAULT_DB_PORT: '5432'
16
- DEFAULT_DB_USER: 'contember'
17
- DEFAULT_DB_PASSWORD: 'contember'
18
- DEFAULT_S3_BUCKET: 'contember'
19
- DEFAULT_S3_REGION: ''
20
- DEFAULT_S3_KEY: 'contember'
21
- DEFAULT_S3_SECRET: 'contember'
22
- DEFAULT_S3_PROVIDER: 'minio'
23
-
24
- TENANT_DB_NAME: 'tenant'
25
- TENANT_MAILER_HOST: 'mailhog'
26
- TENANT_MAILER_PORT: '1025'
27
- TENANT_MAILER_FROM: 'contember@localhost'
28
-
29
- depends_on:
30
- postgresql:
31
- condition: service_healthy
32
-
33
- contember-cli:
34
- image: contember/cli:{version}
35
- volumes:
36
- - ./:/src:cached
37
- working_dir: /src
38
- command: version
39
- environment:
40
- CONTEMBER_API_URL: "http://contember:4000/"
41
- CONTEMBER_API_TOKEN: "0000000000000000000000000000000000000000"
42
-
43
-
44
- postgresql:
45
- image: postgres:10-alpine
46
- restart: unless-stopped
47
- environment:
48
- POSTGRES_PASSWORD: contember
49
- POSTGRES_USER: contember
50
- POSTGRES_DB: contember
51
- volumes:
52
- - pgsql-data:/var/lib/postgresql/data
53
- healthcheck:
54
- test: [ "CMD-SHELL", "pg_isready -U contember" ]
55
- interval: 5s
56
- timeout: 5s
57
- retries: 5
58
-
59
- s3:
60
- image: minio/minio
61
- command: 'server /data'
62
- volumes:
63
- - s3-data:/data
64
- - ./api/s3-policy.json:/bucket-policy.json
65
- - ./api/s3-entrypoint.sh:/minio-entrypoint.sh
66
- entrypoint: /minio-entrypoint.sh
67
- environment:
68
- MINIO_ACCESS_KEY: contember
69
- MINIO_SECRET_KEY: contember
70
- mailhog:
71
- image: mailhog/mailhog
72
-
73
- # # optional: database management tool
74
- # adminer:
75
- # image: michalhosna/adminer:4.8.0-en_v1
76
- # depends_on:
77
- # - postgresql
78
- # environment:
79
- # ADMINER_DRIVER: pgsql
80
- # ADMINER_SERVER: postgresql
81
- # ADMINER_DB: contember
82
- # ADMINER_USERNAME: contember
83
- # ADMINER_PASSWORD: contember
84
- # ADMINER_AUTOLOGIN: 1
85
- # ADMINER_NAME: Contember
86
- volumes:
87
- pgsql-data: ~
88
- s3-data: ~
@@ -1,12 +0,0 @@
1
- {
2
- "name": "@contember/template-workspace-single-instance",
3
- "version": "0.12.0-alpha.9",
4
- "license": "Apache-2.0",
5
- "scripts": {
6
- "test": "echo 'No tests'"
7
- },
8
- "dependencies": {
9
- "@contember/schema": "^0.12.0-alpha.9",
10
- "@contember/schema-definition": "^0.12.0-alpha.9"
11
- }
12
- }
@@ -1,22 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- "declaration": true,
4
- "declarationMap": true,
5
- "esModuleInterop": true,
6
- "sourceMap": true,
7
- "composite": true,
8
- "noEmitOnError": true,
9
- "experimentalDecorators": true,
10
- "target": "es6",
11
- "moduleResolution": "node",
12
- "module": "commonjs",
13
- "outDir": "dist",
14
- "strict": true,
15
- "jsx": "react",
16
- "incremental": true,
17
- "lib": [
18
- "esnext",
19
- "dom"
20
- ]
21
- }
22
- }
@@ -1,38 +0,0 @@
1
- import { join } from 'path'
2
- import { pathExists } from 'fs-extra'
3
- import { JsonUpdateCallback, updateYaml } from './yaml'
4
-
5
- const MAIN_CONFIGS = ['docker-compose.yaml', 'docker-compose.yml']
6
-
7
- export interface DockerComposeServiceConfig {
8
- image?: string
9
- command?: string
10
- user?: string
11
- environment?: Record<string, string>
12
- ports?: (string | {})[] // todo long syntax
13
- }
14
-
15
- export interface DockerComposeConfig {
16
- [key: string]: unknown
17
-
18
- version?: string
19
- services?: Record<string, DockerComposeServiceConfig>
20
- }
21
-
22
- const resolvePath = async (dir: string, possibleFileNames: string[], fallbackFileName: string): Promise<string> => {
23
- for (const file of possibleFileNames) {
24
- const path = join(dir, file)
25
- if (await pathExists(path)) {
26
- return path
27
- }
28
- }
29
- return join(dir, fallbackFileName)
30
- }
31
-
32
- export const updateMainDockerComposeConfig = async (
33
- dir: string,
34
- updater: JsonUpdateCallback<DockerComposeConfig>,
35
- ): Promise<void> => {
36
- const path = process.env.COMPOSE_FILE || (await resolvePath(dir, MAIN_CONFIGS, MAIN_CONFIGS[0]))
37
- return updateYaml(path, updater, { createMissing: true })
38
- }