@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contember/cli-common",
3
- "version": "1.0.0-alpha.8",
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-alpha.8",
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 { SideMenu } from './SideMenu'
4
+ import { Navigation } from './Navigation'
5
5
 
6
6
  export const Layout = (props: { children?: ReactNode }) => (
7
7
  <ContemberLayout
8
- topStart="{projectName}"
9
- sideBar={<SideMenu />}
8
+ sidebarHeader="{projectName}"
9
+ navigation={<Navigation />}
10
10
  children={props.children}
11
11
  />
12
12
  )
@@ -1,10 +1,10 @@
1
1
  import * as React from 'react'
2
2
  import { Menu } from '@contember/admin'
3
3
 
4
- export const SideMenu = () => (
4
+ export const Navigation = () => (
5
5
  <Menu>
6
6
  <Menu.Item>
7
- <Menu.Item title="Dashboard" to="dashboard" />
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
- routes={{ dashboard: { path: '/' } }}
16
- children={<Pages layout={Layout} children={pages} />}
13
+ children={
14
+ <Pages
15
+ layout={Layout}
16
+ children={Object.assign({}, ...Object.values(import.meta.globEager('./pages/*.tsx')))}
17
+ />
18
+ }
17
19
  />,
18
20
  )
@@ -1,8 +1,8 @@
1
1
  import * as React from 'react'
2
2
  import { GenericPage } from '@contember/admin'
3
3
 
4
- export const DashboardPage = (
5
- <GenericPage pageName="dashboard">
4
+ export const index = (
5
+ <GenericPage pageName="index">
6
6
  Welcome to Contember Admin!
7
7
  </GenericPage>
8
8
  )
@@ -1,4 +1,4 @@
1
1
  type: project
2
2
  replaceVariables:
3
3
  - admin/index.tsx
4
- - admin/index.html
4
+ - admin/components/Layout.tsx
@@ -3,7 +3,7 @@
3
3
  "allowSyntheticDefaultImports": true,
4
4
  "experimentalDecorators": true,
5
5
  "isolatedModules": true,
6
- "jsx": "react-jsx",
6
+ "jsx": "react",
7
7
  "lib": [
8
8
  "esnext",
9
9
  "dom"
@@ -1,3 +1,3 @@
1
- /dist
1
+ /admin/dist
2
2
  /node_modules
3
3
  /docker-compose.override.yaml
@@ -1,4 +1,5 @@
1
1
  api:
2
2
  version: {version}
3
+
3
4
  projects:
4
5
  {projectName}: .
@@ -3,6 +3,6 @@ set -ex
3
3
 
4
4
  mkdir -p /data/contember
5
5
  mkdir -p /data/.minio.sys/buckets/contember/
6
- cp /bucket-policy.json /data/.minio.sys/buckets/contember/policy.json
6
+ cp /minio/s3-policy.json /data/.minio.sys/buckets/contember/policy.json
7
7
 
8
8
  minio "$@"
@@ -2,8 +2,8 @@ version: '2.4'
2
2
 
3
3
  services:
4
4
  admin:
5
- image: node:14-alpine
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
- contember:
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://contember:4000/'
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
- contember:
77
- condition: service_started
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://contember:4000/'
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
- contember:
95
- condition: service_started
101
+ engine:
102
+ condition: service_healthy
96
103
 
97
104
  postgres:
98
- image: postgres:13-alpine
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/postgres/data
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
- - ./scripts/minio/s3-policy.json:/bucket-policy.json
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
- - postgres
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.7.0-beta.1",
11
- "@contember/admin-i18n": "0.7.0-beta.1",
12
- "@types/react": "17.0.5",
13
- "@vitejs/plugin-react-refresh": "^1.3.6",
14
- "react": "17.0.1",
15
- "react-dom": "17.0.1",
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
- })