@contember/cli-common 1.0.0-alpha.8 → 1.0.0-rc.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.
- package/package.json +2 -2
- 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 +1 -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.yaml +1 -0
- 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 +37 -30
- package/resources/templates/template-workspace/package.json +6 -7
- package/resources/templates/template-project/admin/vite.config.ts +0 -20
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.0",
|
|
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.0",
|
|
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
|
|
@@ -2,8 +2,8 @@ version: '2.4'
|
|
|
2
2
|
|
|
3
3
|
services:
|
|
4
4
|
admin:
|
|
5
|
-
image: node:
|
|
6
|
-
command: npm run start-admin
|
|
5
|
+
image: node:16-alpine
|
|
6
|
+
command: 'npm run start-admin'
|
|
7
7
|
user: '1000:1000'
|
|
8
8
|
|
|
9
9
|
environment:
|
|
@@ -19,17 +19,18 @@ services:
|
|
|
19
19
|
volumes:
|
|
20
20
|
- ./:/src:cached
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
engine:
|
|
23
23
|
image: contember/engine:{version}
|
|
24
|
-
restart: on-failure
|
|
25
24
|
|
|
26
25
|
environment:
|
|
27
26
|
NODE_ENV: 'development'
|
|
28
27
|
|
|
28
|
+
CONTEMBER_PORT: '4000'
|
|
29
29
|
CONTEMBER_ROOT_EMAIL: 'contember@localhost'
|
|
30
30
|
CONTEMBER_ROOT_PASSWORD: 'contember'
|
|
31
|
-
CONTEMBER_ROOT_TOKEN: '0000000000000000000000000000000000000000'
|
|
32
|
-
CONTEMBER_LOGIN_TOKEN: '1111111111111111111111111111111111111111'
|
|
31
|
+
CONTEMBER_ROOT_TOKEN: '0000000000000000000000000000000000000000' # openssl rand -hex 20
|
|
32
|
+
CONTEMBER_LOGIN_TOKEN: '1111111111111111111111111111111111111111' # openssl rand -hex 20
|
|
33
|
+
|
|
33
34
|
CONTEMBER_CONFIG_YAML: |
|
|
34
35
|
projectDefaults:
|
|
35
36
|
s3:
|
|
@@ -55,6 +56,12 @@ services:
|
|
|
55
56
|
ports:
|
|
56
57
|
- '1481:4000'
|
|
57
58
|
|
|
59
|
+
healthcheck:
|
|
60
|
+
test: ['CMD-SHELL', 'curl --fail http://localhost:4000']
|
|
61
|
+
interval: 5s
|
|
62
|
+
timeout: 5s
|
|
63
|
+
retries: 10
|
|
64
|
+
|
|
58
65
|
depends_on:
|
|
59
66
|
postgres:
|
|
60
67
|
condition: service_healthy
|
|
@@ -64,7 +71,7 @@ services:
|
|
|
64
71
|
user: '1000:1000'
|
|
65
72
|
|
|
66
73
|
environment:
|
|
67
|
-
CONTEMBER_API_URL: 'http://
|
|
74
|
+
CONTEMBER_API_URL: 'http://engine:4000/'
|
|
68
75
|
CONTEMBER_API_TOKEN: '0000000000000000000000000000000000000000'
|
|
69
76
|
CONTEMBER_PROJECT_NAME: '{projectName}'
|
|
70
77
|
|
|
@@ -73,8 +80,8 @@ services:
|
|
|
73
80
|
- ./:/src:cached
|
|
74
81
|
|
|
75
82
|
depends_on:
|
|
76
|
-
|
|
77
|
-
condition:
|
|
83
|
+
engine:
|
|
84
|
+
condition: service_healthy
|
|
78
85
|
|
|
79
86
|
contember-migrations:
|
|
80
87
|
image: contember/cli:{version}
|
|
@@ -82,7 +89,7 @@ services:
|
|
|
82
89
|
user: '1000:1000'
|
|
83
90
|
|
|
84
91
|
environment:
|
|
85
|
-
CONTEMBER_API_URL: 'http://
|
|
92
|
+
CONTEMBER_API_URL: 'http://engine:4000/'
|
|
86
93
|
CONTEMBER_API_TOKEN: '0000000000000000000000000000000000000000'
|
|
87
94
|
CONTEMBER_PROJECT_NAME: '{projectName}'
|
|
88
95
|
|
|
@@ -91,22 +98,22 @@ services:
|
|
|
91
98
|
- ./:/src:cached
|
|
92
99
|
|
|
93
100
|
depends_on:
|
|
94
|
-
|
|
95
|
-
condition:
|
|
101
|
+
engine:
|
|
102
|
+
condition: service_healthy
|
|
96
103
|
|
|
97
104
|
postgres:
|
|
98
|
-
image: postgres:
|
|
105
|
+
image: postgres:14-alpine
|
|
99
106
|
|
|
100
107
|
environment:
|
|
101
|
-
POSTGRES_PASSWORD: contember
|
|
102
|
-
POSTGRES_USER: contember
|
|
103
|
-
POSTGRES_DB: contember
|
|
108
|
+
POSTGRES_PASSWORD: 'contember'
|
|
109
|
+
POSTGRES_USER: 'contember'
|
|
110
|
+
POSTGRES_DB: 'contember'
|
|
104
111
|
|
|
105
112
|
ports:
|
|
106
113
|
- '1482:5432'
|
|
107
114
|
|
|
108
115
|
volumes:
|
|
109
|
-
- pgsql-data:/var/lib/
|
|
116
|
+
- pgsql-data:/var/lib/postgresql/data
|
|
110
117
|
|
|
111
118
|
healthcheck:
|
|
112
119
|
test: ['CMD-SHELL', 'pg_isready -U contember']
|
|
@@ -116,20 +123,19 @@ services:
|
|
|
116
123
|
|
|
117
124
|
s3:
|
|
118
125
|
image: minio/minio
|
|
119
|
-
entrypoint: /minio-entrypoint.sh
|
|
126
|
+
entrypoint: /minio/s3-entrypoint.sh
|
|
120
127
|
command: 'server --address :1483 /data'
|
|
121
128
|
|
|
122
129
|
environment:
|
|
123
|
-
MINIO_ROOT_USER: contember
|
|
124
|
-
MINIO_ROOT_PASSWORD: contember
|
|
130
|
+
MINIO_ROOT_USER: 'contember'
|
|
131
|
+
MINIO_ROOT_PASSWORD: 'contember'
|
|
125
132
|
|
|
126
133
|
ports:
|
|
127
134
|
- '1483:1483' # ports must match
|
|
128
135
|
|
|
129
136
|
volumes:
|
|
130
137
|
- s3-data:/data
|
|
131
|
-
- ./
|
|
132
|
-
- ./scripts/minio/s3-entrypoint.sh:/minio-entrypoint.sh
|
|
138
|
+
- ./docker/minio/:/minio
|
|
133
139
|
|
|
134
140
|
mailhog:
|
|
135
141
|
image: mailhog/mailhog
|
|
@@ -140,19 +146,20 @@ services:
|
|
|
140
146
|
image: michalhosna/adminer:4.8.0-en_v1
|
|
141
147
|
|
|
142
148
|
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
|
|
149
|
+
ADMINER_DRIVER: 'pgsql'
|
|
150
|
+
ADMINER_SERVER: 'postgres'
|
|
151
|
+
ADMINER_DB: 'contember'
|
|
152
|
+
ADMINER_USERNAME: 'contember'
|
|
153
|
+
ADMINER_PASSWORD: 'contember'
|
|
154
|
+
ADMINER_AUTOLOGIN: '1'
|
|
155
|
+
ADMINER_NAME: 'Contember'
|
|
150
156
|
|
|
151
157
|
ports:
|
|
152
158
|
- '1485:8080'
|
|
153
159
|
|
|
154
160
|
depends_on:
|
|
155
|
-
|
|
161
|
+
postgres:
|
|
162
|
+
condition: service_healthy
|
|
156
163
|
|
|
157
164
|
volumes:
|
|
158
165
|
pgsql-data: ~
|
|
@@ -7,12 +7,11 @@
|
|
|
7
7
|
"devDependencies": {
|
|
8
8
|
"@contember/schema": "{version}",
|
|
9
9
|
"@contember/schema-definition": "{version}",
|
|
10
|
-
"@contember/admin": "0.
|
|
11
|
-
"@
|
|
12
|
-
"
|
|
13
|
-
"
|
|
14
|
-
"
|
|
15
|
-
"
|
|
16
|
-
"vite": "^2.5.2"
|
|
10
|
+
"@contember/admin": "^1.0.0-alpha.6",
|
|
11
|
+
"@types/react": "^17",
|
|
12
|
+
"react": "^17",
|
|
13
|
+
"react-dom": "^17",
|
|
14
|
+
"typescript": "^4.5",
|
|
15
|
+
"vite": "^2.7"
|
|
17
16
|
}
|
|
18
17
|
}
|
|
@@ -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
|
-
})
|