@contember/cli-common 1.0.0-alpha.8 → 1.0.0-rc.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 +2 -2
- package/resources/templates/template-project/admin/.env +3 -0
- package/resources/templates/template-project/admin/components/Layout.tsx +3 -3
- package/resources/templates/template-project/admin/components/{SideMenu.tsx → Navigation.tsx} +2 -2
- package/resources/templates/template-project/admin/index.tsx +7 -5
- package/resources/templates/template-project/admin/pages/{Dashboard.tsx → index.tsx} +2 -2
- package/resources/templates/template-project/contember.template.yaml +2 -1
- package/resources/templates/template-project/tsconfig.json +1 -1
- package/resources/templates/template-workspace/.gitignore.dist +1 -1
- package/resources/templates/template-workspace/contember.template.yaml +0 -1
- package/resources/templates/template-workspace/{scripts → docker}/minio/s3-entrypoint.sh +1 -1
- package/resources/templates/template-workspace/{scripts → docker}/minio/s3-policy.json +0 -0
- package/resources/templates/template-workspace/docker-compose.yaml +33 -61
- package/resources/templates/template-workspace/package.json +9 -8
- package/resources/templates/template-project/admin/vite.config.ts +0 -20
- package/resources/templates/template-workspace/contember.yaml +0 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contember/cli-common",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-rc.3",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "dist/src/index.js",
|
|
6
6
|
"typings": "dist/src/index.d.ts",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"@types/npm-package-arg": "^6.1.0"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@contember/config-loader": "^1.0.0-
|
|
16
|
+
"@contember/config-loader": "^1.0.0-rc.3",
|
|
17
17
|
"chalk": "^4.1.0",
|
|
18
18
|
"download-tarball": "^2.0.0",
|
|
19
19
|
"fs-extra": "^10.0.0",
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { ReactNode } from 'react'
|
|
3
3
|
import { Layout as ContemberLayout } from '@contember/admin'
|
|
4
|
-
import {
|
|
4
|
+
import { Navigation } from './Navigation'
|
|
5
5
|
|
|
6
6
|
export const Layout = (props: { children?: ReactNode }) => (
|
|
7
7
|
<ContemberLayout
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
sidebarHeader="{projectName}"
|
|
9
|
+
navigation={<Navigation />}
|
|
10
10
|
children={props.children}
|
|
11
11
|
/>
|
|
12
12
|
)
|
package/resources/templates/template-project/admin/components/{SideMenu.tsx → Navigation.tsx}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { Menu } from '@contember/admin'
|
|
3
3
|
|
|
4
|
-
export const
|
|
4
|
+
export const Navigation = () => (
|
|
5
5
|
<Menu>
|
|
6
6
|
<Menu.Item>
|
|
7
|
-
<Menu.Item title="Dashboard" to="
|
|
7
|
+
<Menu.Item title="Dashboard" to="index" />
|
|
8
8
|
</Menu.Item>
|
|
9
9
|
</Menu>
|
|
10
10
|
)
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import * as React from 'react'
|
|
2
2
|
import { ApplicationEntrypoint, Pages, runReactApp } from '@contember/admin'
|
|
3
|
-
import { Layout } from './components/Layout'
|
|
4
3
|
import '@contember/admin/style.css'
|
|
5
|
-
|
|
6
|
-
const pages = Object.values(import.meta.globEager('./pages/*.tsx')).flatMap(Object.values)
|
|
4
|
+
import { Layout } from './components/Layout'
|
|
7
5
|
|
|
8
6
|
runReactApp(
|
|
9
7
|
<ApplicationEntrypoint
|
|
@@ -12,7 +10,11 @@ runReactApp(
|
|
|
12
10
|
sessionToken={import.meta.env.VITE_CONTEMBER_ADMIN_SESSION_TOKEN}
|
|
13
11
|
project={import.meta.env.VITE_CONTEMBER_ADMIN_PROJECT_NAME}
|
|
14
12
|
stage="live"
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
children={
|
|
14
|
+
<Pages
|
|
15
|
+
layout={Layout}
|
|
16
|
+
children={Object.assign({}, ...Object.values(import.meta.globEager('./pages/*.tsx')))}
|
|
17
|
+
/>
|
|
18
|
+
}
|
|
17
19
|
/>,
|
|
18
20
|
)
|
|
File without changes
|
|
@@ -1,35 +1,18 @@
|
|
|
1
1
|
version: '2.4'
|
|
2
2
|
|
|
3
3
|
services:
|
|
4
|
-
|
|
5
|
-
image: node:14-alpine
|
|
6
|
-
command: npm run start-admin
|
|
7
|
-
user: '1000:1000'
|
|
8
|
-
|
|
9
|
-
environment:
|
|
10
|
-
VITE_PORT: '1480'
|
|
11
|
-
VITE_CONTEMBER_ADMIN_API_BASE_URL: 'http://localhost:1481'
|
|
12
|
-
VITE_CONTEMBER_ADMIN_SESSION_TOKEN: '0000000000000000000000000000000000000000'
|
|
13
|
-
VITE_CONTEMBER_ADMIN_PROJECT_NAME: '{projectName}'
|
|
14
|
-
|
|
15
|
-
ports:
|
|
16
|
-
- '1480:1480' # ports must match
|
|
17
|
-
|
|
18
|
-
working_dir: /src
|
|
19
|
-
volumes:
|
|
20
|
-
- ./:/src:cached
|
|
21
|
-
|
|
22
|
-
contember:
|
|
4
|
+
contember-engine:
|
|
23
5
|
image: contember/engine:{version}
|
|
24
|
-
restart: on-failure
|
|
25
6
|
|
|
26
7
|
environment:
|
|
27
8
|
NODE_ENV: 'development'
|
|
28
9
|
|
|
10
|
+
CONTEMBER_PORT: '4000'
|
|
29
11
|
CONTEMBER_ROOT_EMAIL: 'contember@localhost'
|
|
30
12
|
CONTEMBER_ROOT_PASSWORD: 'contember'
|
|
31
|
-
CONTEMBER_ROOT_TOKEN: '0000000000000000000000000000000000000000'
|
|
32
|
-
CONTEMBER_LOGIN_TOKEN: '1111111111111111111111111111111111111111'
|
|
13
|
+
CONTEMBER_ROOT_TOKEN: '0000000000000000000000000000000000000000' # openssl rand -hex 20
|
|
14
|
+
CONTEMBER_LOGIN_TOKEN: '1111111111111111111111111111111111111111' # openssl rand -hex 20
|
|
15
|
+
|
|
33
16
|
CONTEMBER_CONFIG_YAML: |
|
|
34
17
|
projectDefaults:
|
|
35
18
|
s3:
|
|
@@ -55,6 +38,12 @@ services:
|
|
|
55
38
|
ports:
|
|
56
39
|
- '1481:4000'
|
|
57
40
|
|
|
41
|
+
healthcheck:
|
|
42
|
+
test: ['CMD-SHELL', 'curl --fail http://localhost:4000']
|
|
43
|
+
interval: 5s
|
|
44
|
+
timeout: 5s
|
|
45
|
+
retries: 10
|
|
46
|
+
|
|
58
47
|
depends_on:
|
|
59
48
|
postgres:
|
|
60
49
|
condition: service_healthy
|
|
@@ -62,9 +51,10 @@ services:
|
|
|
62
51
|
contember-cli:
|
|
63
52
|
image: contember/cli:{version}
|
|
64
53
|
user: '1000:1000'
|
|
54
|
+
scale: 0
|
|
65
55
|
|
|
66
56
|
environment:
|
|
67
|
-
CONTEMBER_API_URL: 'http://contember:4000/'
|
|
57
|
+
CONTEMBER_API_URL: 'http://contember-engine:4000/'
|
|
68
58
|
CONTEMBER_API_TOKEN: '0000000000000000000000000000000000000000'
|
|
69
59
|
CONTEMBER_PROJECT_NAME: '{projectName}'
|
|
70
60
|
|
|
@@ -73,40 +63,22 @@ services:
|
|
|
73
63
|
- ./:/src:cached
|
|
74
64
|
|
|
75
65
|
depends_on:
|
|
76
|
-
contember:
|
|
77
|
-
condition:
|
|
78
|
-
|
|
79
|
-
contember-migrations:
|
|
80
|
-
image: contember/cli:{version}
|
|
81
|
-
command: 'migrations:execute . --yes'
|
|
82
|
-
user: '1000:1000'
|
|
83
|
-
|
|
84
|
-
environment:
|
|
85
|
-
CONTEMBER_API_URL: 'http://contember:4000/'
|
|
86
|
-
CONTEMBER_API_TOKEN: '0000000000000000000000000000000000000000'
|
|
87
|
-
CONTEMBER_PROJECT_NAME: '{projectName}'
|
|
88
|
-
|
|
89
|
-
working_dir: /src
|
|
90
|
-
volumes:
|
|
91
|
-
- ./:/src:cached
|
|
92
|
-
|
|
93
|
-
depends_on:
|
|
94
|
-
contember:
|
|
95
|
-
condition: service_started
|
|
66
|
+
contember-engine:
|
|
67
|
+
condition: service_healthy
|
|
96
68
|
|
|
97
69
|
postgres:
|
|
98
|
-
image: postgres:
|
|
70
|
+
image: postgres:14-alpine
|
|
99
71
|
|
|
100
72
|
environment:
|
|
101
|
-
POSTGRES_PASSWORD: contember
|
|
102
|
-
POSTGRES_USER: contember
|
|
103
|
-
POSTGRES_DB: contember
|
|
73
|
+
POSTGRES_PASSWORD: 'contember'
|
|
74
|
+
POSTGRES_USER: 'contember'
|
|
75
|
+
POSTGRES_DB: 'contember'
|
|
104
76
|
|
|
105
77
|
ports:
|
|
106
78
|
- '1482:5432'
|
|
107
79
|
|
|
108
80
|
volumes:
|
|
109
|
-
- pgsql-data:/var/lib/
|
|
81
|
+
- pgsql-data:/var/lib/postgresql/data
|
|
110
82
|
|
|
111
83
|
healthcheck:
|
|
112
84
|
test: ['CMD-SHELL', 'pg_isready -U contember']
|
|
@@ -116,20 +88,19 @@ services:
|
|
|
116
88
|
|
|
117
89
|
s3:
|
|
118
90
|
image: minio/minio
|
|
119
|
-
entrypoint: /minio-entrypoint.sh
|
|
91
|
+
entrypoint: /minio/s3-entrypoint.sh
|
|
120
92
|
command: 'server --address :1483 /data'
|
|
121
93
|
|
|
122
94
|
environment:
|
|
123
|
-
MINIO_ROOT_USER: contember
|
|
124
|
-
MINIO_ROOT_PASSWORD: contember
|
|
95
|
+
MINIO_ROOT_USER: 'contember'
|
|
96
|
+
MINIO_ROOT_PASSWORD: 'contember'
|
|
125
97
|
|
|
126
98
|
ports:
|
|
127
99
|
- '1483:1483' # ports must match
|
|
128
100
|
|
|
129
101
|
volumes:
|
|
130
102
|
- s3-data:/data
|
|
131
|
-
- ./
|
|
132
|
-
- ./scripts/minio/s3-entrypoint.sh:/minio-entrypoint.sh
|
|
103
|
+
- ./docker/minio/:/minio
|
|
133
104
|
|
|
134
105
|
mailhog:
|
|
135
106
|
image: mailhog/mailhog
|
|
@@ -140,19 +111,20 @@ services:
|
|
|
140
111
|
image: michalhosna/adminer:4.8.0-en_v1
|
|
141
112
|
|
|
142
113
|
environment:
|
|
143
|
-
ADMINER_DRIVER: pgsql
|
|
144
|
-
ADMINER_SERVER: postgres
|
|
145
|
-
ADMINER_DB: contember
|
|
146
|
-
ADMINER_USERNAME: contember
|
|
147
|
-
ADMINER_PASSWORD: contember
|
|
148
|
-
ADMINER_AUTOLOGIN: 1
|
|
149
|
-
ADMINER_NAME: Contember
|
|
114
|
+
ADMINER_DRIVER: 'pgsql'
|
|
115
|
+
ADMINER_SERVER: 'postgres'
|
|
116
|
+
ADMINER_DB: 'contember'
|
|
117
|
+
ADMINER_USERNAME: 'contember'
|
|
118
|
+
ADMINER_PASSWORD: 'contember'
|
|
119
|
+
ADMINER_AUTOLOGIN: '1'
|
|
120
|
+
ADMINER_NAME: 'Contember'
|
|
150
121
|
|
|
151
122
|
ports:
|
|
152
123
|
- '1485:8080'
|
|
153
124
|
|
|
154
125
|
depends_on:
|
|
155
|
-
|
|
126
|
+
postgres:
|
|
127
|
+
condition: service_healthy
|
|
156
128
|
|
|
157
129
|
volumes:
|
|
158
130
|
pgsql-data: ~
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
{
|
|
2
2
|
"scripts-template": {
|
|
3
3
|
"contember": "docker-compose run contember-cli",
|
|
4
|
-
"start
|
|
4
|
+
"start": "npm run start-engine && npm run start-admin",
|
|
5
|
+
"start-engine": "docker-compose up --detach && npm run contember migrations:execute . --yes",
|
|
6
|
+
"start-admin": "vite admin --port 1480 --host 0.0.0.0",
|
|
5
7
|
"build-admin": "tsc && vite build admin"
|
|
6
8
|
},
|
|
7
9
|
"devDependencies": {
|
|
8
10
|
"@contember/schema": "{version}",
|
|
9
11
|
"@contember/schema-definition": "{version}",
|
|
10
|
-
"@contember/admin": "0.
|
|
11
|
-
"@
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"vite": "^2.5.2"
|
|
12
|
+
"@contember/admin": "^1.0.0-alpha.6",
|
|
13
|
+
"@types/react": "^17",
|
|
14
|
+
"react": "^17",
|
|
15
|
+
"react-dom": "^17",
|
|
16
|
+
"typescript": "^4.5",
|
|
17
|
+
"vite": "^2.7"
|
|
17
18
|
}
|
|
18
19
|
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { defineConfig } from 'vite'
|
|
2
|
-
import reactRefresh from '@vitejs/plugin-react-refresh'
|
|
3
|
-
|
|
4
|
-
export default defineConfig({
|
|
5
|
-
root: 'projects',
|
|
6
|
-
esbuild: {
|
|
7
|
-
jsxFactory: '_jsx',
|
|
8
|
-
jsxFragment: '_jsxFragment',
|
|
9
|
-
jsxInject: `import { createElement as _jsx, Fragment as _jsxFragment } from 'react'`,
|
|
10
|
-
},
|
|
11
|
-
build: {
|
|
12
|
-
brotliSize: false,
|
|
13
|
-
chunkSizeWarningLimit: undefined,
|
|
14
|
-
},
|
|
15
|
-
plugins: [reactRefresh()],
|
|
16
|
-
server: {
|
|
17
|
-
host: '0.0.0.0',
|
|
18
|
-
port: 1480,
|
|
19
|
-
},
|
|
20
|
-
})
|