@contember/cli-common 1.1.0-alpha.7 → 1.1.0-beta.1
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.production +1 -1
- package/resources/templates/template-project/admin/index.html +1 -1
- package/resources/templates/template-project/admin/vite.config.ts +3 -5
- package/resources/templates/template-project/api/index.ts +3 -13
- package/resources/templates/template-workspace/package.json +2 -2
- package/resources/templates/template-project/api/acl.ts +0 -14
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contember/cli-common",
|
|
3
|
-
"version": "1.1.0-
|
|
3
|
+
"version": "1.1.0-beta.1",
|
|
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.1.0-
|
|
16
|
+
"@contember/config-loader": "^1.1.0-beta.1",
|
|
17
17
|
"chalk": "^4.1.0",
|
|
18
18
|
"download-tarball": "^2.0.0",
|
|
19
19
|
"fs-extra": "^10.0.0",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<html>
|
|
3
3
|
<head>
|
|
4
4
|
<meta charset="utf-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, viewport-fit=cover">
|
|
5
|
+
<meta name="viewport" content="width=device-width, viewport-fit=cover, initial-scale=1">
|
|
6
6
|
<title>Admin {projectName}</title>
|
|
7
7
|
<script type="module" src="./index.tsx"></script>
|
|
8
8
|
</head>
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { defineConfig
|
|
1
|
+
import { defineConfig } from 'vite'
|
|
2
2
|
|
|
3
|
-
export default defineConfig(({ command
|
|
4
|
-
base: command === 'build'
|
|
5
|
-
? `/${loadEnv(mode, __dirname).VITE_CONTEMBER_ADMIN_PROJECT_NAME}/`
|
|
6
|
-
: '/',
|
|
3
|
+
export default defineConfig(({ command }) => ({
|
|
4
|
+
base: command === 'build' ? `./` : '/',
|
|
7
5
|
}))
|
|
@@ -1,14 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import * as modelDefinition from './model'
|
|
4
|
-
import aclFactory from './acl'
|
|
1
|
+
import { createSchema } from '@contember/schema-definition'
|
|
2
|
+
import * as model from './model'
|
|
5
3
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
const schema: Schema = {
|
|
9
|
-
model: model,
|
|
10
|
-
acl: aclFactory(model),
|
|
11
|
-
validation: InputValidation.parseDefinition(modelDefinition),
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export default schema
|
|
4
|
+
export default createSchema(model)
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
"build": "npm run build-admin && npm run build-api",
|
|
8
8
|
"build-admin": "tsc --project admin && vite build admin",
|
|
9
9
|
"build-api": "tsc --project api",
|
|
10
|
-
"deploy": "docker-compose run
|
|
10
|
+
"deploy": "npm run build && docker-compose run contember-cli deploy"
|
|
11
11
|
},
|
|
12
12
|
"devDependencies": {
|
|
13
13
|
"@contember/schema": "{version}",
|
|
14
14
|
"@contember/schema-definition": "{version}",
|
|
15
|
-
"@contember/admin": "^1.0.0
|
|
15
|
+
"@contember/admin": "^1.0.0",
|
|
16
16
|
"@types/node": "^16",
|
|
17
17
|
"@types/react": "^17",
|
|
18
18
|
"react": "^17",
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { PermissionsBuilder } from '@contember/schema-definition'
|
|
2
|
-
import { Acl, Model } from '@contember/schema'
|
|
3
|
-
|
|
4
|
-
const aclFactory = (model: Model.Schema): Acl.Schema => ({
|
|
5
|
-
roles: {
|
|
6
|
-
admin: {
|
|
7
|
-
variables: {},
|
|
8
|
-
stages: '*',
|
|
9
|
-
entities: PermissionsBuilder.create(model).allowAll().permissions,
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
export default aclFactory
|