feat: improvements (#335)
* fix: improve code * v0.7.0-alpha.18 * chore(versions): 😊 publish v0.7.0-alpha.19 * fix: tips for app.install * chore(versions): 😊 publish v0.7.0-alpha.19 * fix: chalk module * chore(versions): 😊 publish v0.7.0-alpha.21 * fix: clean && force * chore(versions): 😊 publish v0.7.0-alpha.22 * feat: silent option * chore: storage folder * feat: storage folder * chore(versions): 😊 publish v0.7.0-alpha.23 * docs: update readme.md
This commit is contained in:
parent
f5cc368cef
commit
a77f71e32f
21
.env.example
21
.env.example
@ -1,5 +1,13 @@
|
|||||||
|
################# DOCKER #################
|
||||||
|
|
||||||
|
ADMINER_PORT=10101
|
||||||
|
DB_MYSQL_PORT=10102
|
||||||
|
DB_POSTGRES_PORT=10103
|
||||||
|
VERDACCIO_PORT=10104
|
||||||
|
|
||||||
|
################# NOCOBASE APPLICATION #################
|
||||||
|
|
||||||
NOCOBASE_ENV=development
|
NOCOBASE_ENV=development
|
||||||
JWT_SECRET=09f26e402586e2faa8da4c98a35f1b20d6b033c60
|
|
||||||
|
|
||||||
SERVER_PORT=3000
|
SERVER_PORT=3000
|
||||||
|
|
||||||
@ -9,9 +17,12 @@ SERVER_BASE_PATH=/api/
|
|||||||
# api server access point for app(web when build)
|
# api server access point for app(web when build)
|
||||||
SERVER_BASE_URL=
|
SERVER_BASE_URL=
|
||||||
|
|
||||||
DB_DIALECT=sqlite
|
JWT_SECRET=09f26e402586e2faa8da4c98a35f1b20d6b033c60
|
||||||
DB_STORAGE=db.sqlite
|
|
||||||
|
|
||||||
|
################# DATABASE #################
|
||||||
|
|
||||||
|
DB_DIALECT=sqlite
|
||||||
|
DB_STORAGE=storage/db/nocobase.sqlite
|
||||||
# DB_HOST=localhost
|
# DB_HOST=localhost
|
||||||
# DB_PORT=5432
|
# DB_PORT=5432
|
||||||
# DB_DATABASE=postgres
|
# DB_DATABASE=postgres
|
||||||
@ -19,15 +30,15 @@ DB_STORAGE=db.sqlite
|
|||||||
# DB_PASSWORD=nocobase
|
# DB_PASSWORD=nocobase
|
||||||
# DB_LOG_SQL=on
|
# DB_LOG_SQL=on
|
||||||
|
|
||||||
# STORAGE (Initialization only)
|
################# STORAGE (Initialization only) #################
|
||||||
|
|
||||||
# local or ali-oss
|
# local or ali-oss
|
||||||
DEFAULT_STORAGE_TYPE=local
|
DEFAULT_STORAGE_TYPE=local
|
||||||
STORAGE_TYPE=local
|
|
||||||
|
|
||||||
# LOCAL STORAGE
|
# LOCAL STORAGE
|
||||||
LOCAL_STORAGE_USE_STATIC_SERVER=true
|
LOCAL_STORAGE_USE_STATIC_SERVER=true
|
||||||
LOCAL_STORAGE_BASE_URL=
|
LOCAL_STORAGE_BASE_URL=
|
||||||
|
LOCAL_STORAGE_DEST=storage/uploads
|
||||||
|
|
||||||
# ALI OSS STORAGE
|
# ALI OSS STORAGE
|
||||||
ALI_OSS_STORAGE_BASE_URL=
|
ALI_OSS_STORAGE_BASE_URL=
|
||||||
|
132
README.md
132
README.md
@ -62,6 +62,138 @@ Database:
|
|||||||
Installation
|
Installation
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
## Create a project with [Docker](https://docs.docker.com/get-docker/) (Recommended)
|
||||||
|
|
||||||
|
### 1. Create an empty project directory
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mkdir my-nocobase-app && cd my-nocobase-app/
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. Create a docker-compose.yml file
|
||||||
|
|
||||||
|
#### SQLite
|
||||||
|
|
||||||
|
```yml
|
||||||
|
version: "3"
|
||||||
|
networks:
|
||||||
|
nocobase:
|
||||||
|
driver: bridge
|
||||||
|
services:
|
||||||
|
app:
|
||||||
|
image: nocobase/nocobase:latest
|
||||||
|
networks:
|
||||||
|
- nocobase
|
||||||
|
environment:
|
||||||
|
- LOCAL_STORAGE_BASE_URL=http://localhost:13000/storage/uploads
|
||||||
|
volumes:
|
||||||
|
- ./storage:/app/nocobase/storage
|
||||||
|
ports:
|
||||||
|
- "13000:80"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### MySQL
|
||||||
|
|
||||||
|
```yml
|
||||||
|
version: "3"
|
||||||
|
networks:
|
||||||
|
nocobase:
|
||||||
|
driver: bridge
|
||||||
|
services:
|
||||||
|
app:
|
||||||
|
image: nocobase/nocobase:latest
|
||||||
|
networks:
|
||||||
|
- nocobase
|
||||||
|
environment:
|
||||||
|
- DB_DIALECT=mysql
|
||||||
|
- DB_HOST=mysql
|
||||||
|
- DB_DATABASE=nocobase
|
||||||
|
- DB_USER=nocobase
|
||||||
|
- DB_PASSWORD=nocobase
|
||||||
|
- LOCAL_STORAGE_BASE_URL=http://localhost:13000/storage/uploads
|
||||||
|
volumes:
|
||||||
|
- ./storage:/app/nocobase/storage
|
||||||
|
ports:
|
||||||
|
- "13000:80"
|
||||||
|
mysql:
|
||||||
|
image: mysql:8
|
||||||
|
environment:
|
||||||
|
MYSQL_DATABASE: nocobase
|
||||||
|
MYSQL_USER: nocobase
|
||||||
|
MYSQL_PASSWORD: nocobase
|
||||||
|
MYSQL_ROOT_PASSWORD: nocobase
|
||||||
|
restart: always
|
||||||
|
networks:
|
||||||
|
- nocobase
|
||||||
|
```
|
||||||
|
|
||||||
|
#### PostgreSQL
|
||||||
|
|
||||||
|
```yml
|
||||||
|
version: "3"
|
||||||
|
networks:
|
||||||
|
nocobase:
|
||||||
|
driver: bridge
|
||||||
|
services:
|
||||||
|
app:
|
||||||
|
image: nocobase/nocobase:latest
|
||||||
|
networks:
|
||||||
|
- nocobase
|
||||||
|
environment:
|
||||||
|
- DB_DIALECT=postgres
|
||||||
|
- DB_HOST=postgres
|
||||||
|
- DB_DATABASE=nocobase
|
||||||
|
- DB_USER=nocobase
|
||||||
|
- DB_PASSWORD=nocobase
|
||||||
|
- LOCAL_STORAGE_BASE_URL=http://localhost:13000/storage/uploads
|
||||||
|
volumes:
|
||||||
|
- ./storage:/app/nocobase/storage
|
||||||
|
ports:
|
||||||
|
- "13000:80"
|
||||||
|
postgres:
|
||||||
|
image: postgres:10
|
||||||
|
restart: always
|
||||||
|
networks:
|
||||||
|
- nocobase
|
||||||
|
command: postgres -c wal_level=logical
|
||||||
|
environment:
|
||||||
|
POSTGRES_USER: nocobase
|
||||||
|
POSTGRES_DB: nocobase
|
||||||
|
POSTGRES_PASSWORD: nocobase
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. Install and start NocoBase
|
||||||
|
|
||||||
|
安装过程可能需要等待几十秒钟
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ docker-compose up
|
||||||
|
|
||||||
|
app-sqlite-app-1 | nginx started
|
||||||
|
app-sqlite-app-1 | yarn run v1.22.15
|
||||||
|
app-sqlite-app-1 | $ cross-env DOTENV_CONFIG_PATH=.env node -r dotenv/config packages/app/server/lib/index.js install -s
|
||||||
|
app-sqlite-app-1 | Done in 2.72s.
|
||||||
|
app-sqlite-app-1 | yarn run v1.22.15
|
||||||
|
app-sqlite-app-1 | $ pm2-runtime start --node-args="-r dotenv/config" packages/app/server/lib/index.js -- start
|
||||||
|
app-sqlite-app-1 | 2022-04-28T15:45:38: PM2 log: Launching in no daemon mode
|
||||||
|
app-sqlite-app-1 | 2022-04-28T15:45:38: PM2 log: App [index:0] starting in -fork mode-
|
||||||
|
app-sqlite-app-1 | 2022-04-28T15:45:38: PM2 log: App [index:0] online
|
||||||
|
app-sqlite-app-1 | 🚀 NocoBase server running at: http://localhost:13000/
|
||||||
|
```
|
||||||
|
|
||||||
|
你也可以使用 `docker-compose up -d` 在后台运行,如:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 在后台运行
|
||||||
|
$ docker-compose up -d
|
||||||
|
# 查看 app 进程的情况
|
||||||
|
$ docker-compose logs app
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4. Log in to NocoBase
|
||||||
|
|
||||||
|
使用浏览器打开 http://localhost:13000/ 初始化账号和密码是 `admin@nocobase.com` 和 `admin123`。
|
||||||
|
|
||||||
## Create a project with `create-nocobase-app`
|
## Create a project with `create-nocobase-app`
|
||||||
|
|
||||||
~~~shell
|
~~~shell
|
||||||
|
134
README.zh-CN.md
134
README.zh-CN.md
@ -60,6 +60,138 @@ Database:
|
|||||||
安装 & 运行
|
安装 & 运行
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
## 使用 [Docker](https://docs.docker.com/get-docker/) 创建项目(推荐)
|
||||||
|
|
||||||
|
### 1. 创建项目文件夹
|
||||||
|
|
||||||
|
```bash
|
||||||
|
mkdir my-nocobase-app && cd my-nocobase-app/
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. 创建 `docker-compose.yml` 文件
|
||||||
|
|
||||||
|
#### SQLite
|
||||||
|
|
||||||
|
```yml
|
||||||
|
version: "3"
|
||||||
|
networks:
|
||||||
|
nocobase:
|
||||||
|
driver: bridge
|
||||||
|
services:
|
||||||
|
app:
|
||||||
|
image: nocobase/nocobase:latest
|
||||||
|
networks:
|
||||||
|
- nocobase
|
||||||
|
environment:
|
||||||
|
- LOCAL_STORAGE_BASE_URL=http://localhost:13000/storage/uploads
|
||||||
|
volumes:
|
||||||
|
- ./storage:/app/nocobase/storage
|
||||||
|
ports:
|
||||||
|
- "13000:80"
|
||||||
|
```
|
||||||
|
|
||||||
|
#### MySQL
|
||||||
|
|
||||||
|
```yml
|
||||||
|
version: "3"
|
||||||
|
networks:
|
||||||
|
nocobase:
|
||||||
|
driver: bridge
|
||||||
|
services:
|
||||||
|
app:
|
||||||
|
image: nocobase/nocobase:latest
|
||||||
|
networks:
|
||||||
|
- nocobase
|
||||||
|
environment:
|
||||||
|
- DB_DIALECT=mysql
|
||||||
|
- DB_HOST=mysql
|
||||||
|
- DB_DATABASE=nocobase
|
||||||
|
- DB_USER=nocobase
|
||||||
|
- DB_PASSWORD=nocobase
|
||||||
|
- LOCAL_STORAGE_BASE_URL=http://localhost:13000/storage/uploads
|
||||||
|
volumes:
|
||||||
|
- ./storage:/app/nocobase/storage
|
||||||
|
ports:
|
||||||
|
- "13000:80"
|
||||||
|
mysql:
|
||||||
|
image: mysql:8
|
||||||
|
environment:
|
||||||
|
MYSQL_DATABASE: nocobase
|
||||||
|
MYSQL_USER: nocobase
|
||||||
|
MYSQL_PASSWORD: nocobase
|
||||||
|
MYSQL_ROOT_PASSWORD: nocobase
|
||||||
|
restart: always
|
||||||
|
networks:
|
||||||
|
- nocobase
|
||||||
|
```
|
||||||
|
|
||||||
|
#### PostgreSQL
|
||||||
|
|
||||||
|
```yml
|
||||||
|
version: "3"
|
||||||
|
networks:
|
||||||
|
nocobase:
|
||||||
|
driver: bridge
|
||||||
|
services:
|
||||||
|
app:
|
||||||
|
image: nocobase/nocobase:latest
|
||||||
|
networks:
|
||||||
|
- nocobase
|
||||||
|
environment:
|
||||||
|
- DB_DIALECT=postgres
|
||||||
|
- DB_HOST=postgres
|
||||||
|
- DB_DATABASE=nocobase
|
||||||
|
- DB_USER=nocobase
|
||||||
|
- DB_PASSWORD=nocobase
|
||||||
|
- LOCAL_STORAGE_BASE_URL=http://localhost:13000/storage/uploads
|
||||||
|
volumes:
|
||||||
|
- ./storage:/app/nocobase/storage
|
||||||
|
ports:
|
||||||
|
- "13000:80"
|
||||||
|
postgres:
|
||||||
|
image: postgres:10
|
||||||
|
restart: always
|
||||||
|
networks:
|
||||||
|
- nocobase
|
||||||
|
command: postgres -c wal_level=logical
|
||||||
|
environment:
|
||||||
|
POSTGRES_USER: nocobase
|
||||||
|
POSTGRES_DB: nocobase
|
||||||
|
POSTGRES_PASSWORD: nocobase
|
||||||
|
```
|
||||||
|
|
||||||
|
### 3. 安装并启动 NocoBase
|
||||||
|
|
||||||
|
安装过程可能需要等待几十秒钟
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ docker-compose up
|
||||||
|
|
||||||
|
app-sqlite-app-1 | nginx started
|
||||||
|
app-sqlite-app-1 | yarn run v1.22.15
|
||||||
|
app-sqlite-app-1 | $ cross-env DOTENV_CONFIG_PATH=.env node -r dotenv/config packages/app/server/lib/index.js install -s
|
||||||
|
app-sqlite-app-1 | Done in 2.72s.
|
||||||
|
app-sqlite-app-1 | yarn run v1.22.15
|
||||||
|
app-sqlite-app-1 | $ pm2-runtime start --node-args="-r dotenv/config" packages/app/server/lib/index.js -- start
|
||||||
|
app-sqlite-app-1 | 2022-04-28T15:45:38: PM2 log: Launching in no daemon mode
|
||||||
|
app-sqlite-app-1 | 2022-04-28T15:45:38: PM2 log: App [index:0] starting in -fork mode-
|
||||||
|
app-sqlite-app-1 | 2022-04-28T15:45:38: PM2 log: App [index:0] online
|
||||||
|
app-sqlite-app-1 | 🚀 NocoBase server running at: http://localhost:13000/
|
||||||
|
```
|
||||||
|
|
||||||
|
你也可以使用 `docker-compose up -d` 在后台运行,如:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# 在后台运行
|
||||||
|
$ docker-compose up -d
|
||||||
|
# 查看 app 进程的情况
|
||||||
|
$ docker-compose logs app
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4. 登录 NocoBase
|
||||||
|
|
||||||
|
使用浏览器打开 http://localhost:13000/ 初始化账号和密码是 `admin@nocobase.com` 和 `admin123`。
|
||||||
|
|
||||||
## 通过 `create-nocobase-app` 创建项目
|
## 通过 `create-nocobase-app` 创建项目
|
||||||
|
|
||||||
~~~shell
|
~~~shell
|
||||||
@ -98,7 +230,7 @@ yarn nocobase install --lang=zh-CN
|
|||||||
yarn start
|
yarn start
|
||||||
~~~
|
~~~
|
||||||
|
|
||||||
使用浏览器打开 http://localhost:8000,初始化账号和密码是 `admin@nocobase.com` 和 `admin123`。
|
使用浏览器打开 http://localhost:8000/ 初始化账号和密码是 `admin@nocobase.com` 和 `admin123`。
|
||||||
|
|
||||||
## 参与贡献
|
## 参与贡献
|
||||||
|
|
||||||
|
@ -12,30 +12,39 @@ services:
|
|||||||
restart: always
|
restart: always
|
||||||
ports:
|
ports:
|
||||||
- "${VERDACCIO_PORT}:${VERDACCIO_PORT}"
|
- "${VERDACCIO_PORT}:${VERDACCIO_PORT}"
|
||||||
|
mysql:
|
||||||
|
image: mysql:8
|
||||||
|
environment:
|
||||||
|
MYSQL_DATABASE: ${DB_DATABASE}
|
||||||
|
MYSQL_USER: ${DB_USER}
|
||||||
|
MYSQL_PASSWORD: ${DB_PASSWORD}
|
||||||
|
MYSQL_ROOT_PASSWORD: ${DB_PASSWORD}
|
||||||
|
restart: always
|
||||||
|
ports:
|
||||||
|
- "${DB_MYSQL_PORT}:3306"
|
||||||
|
networks:
|
||||||
|
- nocobase
|
||||||
|
postgres:
|
||||||
|
image: postgres:10
|
||||||
|
restart: always
|
||||||
|
networks:
|
||||||
|
- nocobase
|
||||||
|
command: postgres -c wal_level=logical
|
||||||
|
ports:
|
||||||
|
- "${DB_POSTGRES_PORT}:5432"
|
||||||
|
environment:
|
||||||
|
POSTGRES_USER: ${DB_USER}
|
||||||
|
POSTGRES_DB: ${DB_DATABASE}
|
||||||
|
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
||||||
adminer:
|
adminer:
|
||||||
build:
|
image: nocobase/adminer
|
||||||
context: .
|
|
||||||
dockerfile: ./docker/adminer/Dockerfile
|
|
||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
- nocobase
|
- nocobase
|
||||||
ports:
|
ports:
|
||||||
- ${ADMINER_PORT}:8080
|
- ${ADMINER_PORT}:8080
|
||||||
volumes:
|
volumes:
|
||||||
- ./docker/adminer/login-sqlite-plugin.php:/var/www/html/plugins-enabled/login-sqlite-plugin.php
|
|
||||||
- ./:/var/www/app
|
- ./:/var/www/app
|
||||||
postgres:
|
|
||||||
image: postgres:10
|
|
||||||
restart: always
|
|
||||||
ports:
|
|
||||||
- "${DB_POSTGRES_PORT}:5432"
|
|
||||||
networks:
|
|
||||||
- nocobase
|
|
||||||
command: postgres -c wal_level=logical
|
|
||||||
environment:
|
|
||||||
POSTGRES_USER: ${DB_USER}
|
|
||||||
POSTGRES_DB: ${DB_DATABASE}
|
|
||||||
POSTGRES_PASSWORD: ${DB_PASSWORD}
|
|
||||||
nocobase:
|
nocobase:
|
||||||
build:
|
build:
|
||||||
context: .
|
context: .
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
FROM adminer
|
|
||||||
|
|
||||||
USER root
|
|
||||||
CMD [ "php", "-S", "[::]:8080", "-t", "/var/www/html" ]
|
|
||||||
|
|
||||||
EXPOSE 8080
|
|
@ -1,31 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
/** Enable auto-login for SQLite
|
|
||||||
* @link https://www.adminer.org/plugins/#use
|
|
||||||
* @author Jakub Vrana, https://www.vrana.cz/
|
|
||||||
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License, Version 2.0
|
|
||||||
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU General Public License, version 2 (one or other)
|
|
||||||
*/
|
|
||||||
class AdminerLoginSqlite
|
|
||||||
{
|
|
||||||
|
|
||||||
function login($login, $password)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
function loginForm()
|
|
||||||
{
|
|
||||||
?>
|
|
||||||
<script<?php echo nonce(); ?>>
|
|
||||||
addEventListener('load', function () {
|
|
||||||
var driver = document.getElementsByName('auth[driver]')[0];
|
|
||||||
if (isTag(driver, 'select')) {
|
|
||||||
driver.onchange = function () {
|
|
||||||
var trs = parentTag(driver, 'table').rows;
|
|
||||||
for (var i=1; i < trs.length - 1; i++) { var disabled=/sqlite/.test(driver.value); alterClass(trs[i], 'hidden' , disabled); trs[i].getElementsByTagName('input')[0].disabled=disabled; } }; } driver.onchange(); }); </script>
|
|
||||||
<?php
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return new AdminerLoginSqlite();
|
|
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"version": "0.7.0-alpha.16",
|
"version": "0.7.0-alpha.23",
|
||||||
"npmClient": "yarn",
|
"npmClient": "yarn",
|
||||||
"useWorkspaces": true,
|
"useWorkspaces": true,
|
||||||
"npmClientArgs": [
|
"npmClientArgs": [
|
||||||
|
@ -14,14 +14,14 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "concurrently --kill-others \"npm run start-server\" \"npm run start-client\"",
|
"start": "concurrently --kill-others \"yarn start-server -s\" \"yarn start-client\"",
|
||||||
"start-pm2": "pm2-runtime start --node-args=\"-r dotenv/config\" packages/app/server/lib/index.js -- start",
|
"start-pm2": "pm2-runtime start --node-args=\"-r dotenv/config\" packages/app/server/lib/index.js -- start",
|
||||||
"start-docs": "dumi dev",
|
"start-docs": "dumi dev",
|
||||||
"bootstrap": "lerna bootstrap",
|
"bootstrap": "lerna bootstrap",
|
||||||
"clean": "rimraf -rf packages/{app,core,plugins}/*/{lib,esm,dist} && lerna clean",
|
"clean": "rimraf -rf packages/{app,core,plugins}/*/{lib,esm,dist} && lerna clean",
|
||||||
"nocobase": "cross-env DOTENV_CONFIG_PATH=.env ts-node-dev -r dotenv/config -r tsconfig-paths/register ./packages/app/server/src/index.ts",
|
"nocobase": "cross-env DOTENV_CONFIG_PATH=.env ts-node-dev -r dotenv/config -r tsconfig-paths/register ./packages/app/server/src/index.ts",
|
||||||
"start-client": "cd packages/app/client && npm run start",
|
"start-client": "cd packages/app/client && yarn start",
|
||||||
"start-server": "npm run nocobase start",
|
"start-server": "yarn nocobase start",
|
||||||
"build": "lerna run build",
|
"build": "lerna run build",
|
||||||
"build-docs": "dumi build",
|
"build-docs": "dumi build",
|
||||||
"test": "node ./jest.cli.js -i",
|
"test": "node ./jest.cli.js -i",
|
||||||
|
5
packages/app/client/.npmignore
Normal file
5
packages/app/client/.npmignore
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
node_modules
|
||||||
|
*.log
|
||||||
|
src/.umi
|
||||||
|
src/.umi-production
|
||||||
|
src/.umi-test
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nocobase/app-client",
|
"name": "@nocobase/app-client",
|
||||||
"version": "0.7.0-alpha.16",
|
"version": "0.7.0-alpha.23",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "umi dev",
|
"start": "umi dev",
|
||||||
@ -10,7 +10,7 @@
|
|||||||
"test:coverage": "umi-test --coverage"
|
"test:coverage": "umi-test --coverage"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nocobase/client": "0.7.0-alpha.16",
|
"@nocobase/client": "0.7.0-alpha.23",
|
||||||
"@types/react": "^17.0.0",
|
"@types/react": "^17.0.0",
|
||||||
"@types/react-dom": "^17.0.0",
|
"@types/react-dom": "^17.0.0",
|
||||||
"@umijs/test": "^3.5.20",
|
"@umijs/test": "^3.5.20",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nocobase/app-server",
|
"name": "@nocobase/app-server",
|
||||||
"version": "0.7.0-alpha.16",
|
"version": "0.7.0-alpha.23",
|
||||||
"description": "",
|
"description": "",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "./lib/index.js",
|
"main": "./lib/index.js",
|
||||||
@ -11,19 +11,19 @@
|
|||||||
"build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm"
|
"build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nocobase/database": "0.7.0-alpha.16",
|
"@nocobase/database": "0.7.0-alpha.23",
|
||||||
"@nocobase/plugin-acl": "0.7.0-alpha.16",
|
"@nocobase/plugin-acl": "0.7.0-alpha.23",
|
||||||
"@nocobase/plugin-china-region": "0.7.0-alpha.16",
|
"@nocobase/plugin-china-region": "0.7.0-alpha.23",
|
||||||
"@nocobase/plugin-client": "0.7.0-alpha.16",
|
"@nocobase/plugin-client": "0.7.0-alpha.23",
|
||||||
"@nocobase/plugin-collection-manager": "0.7.0-alpha.16",
|
"@nocobase/plugin-collection-manager": "0.7.0-alpha.23",
|
||||||
"@nocobase/plugin-error-handler": "0.7.0-alpha.16",
|
"@nocobase/plugin-error-handler": "0.7.0-alpha.23",
|
||||||
"@nocobase/plugin-file-manager": "0.7.0-alpha.16",
|
"@nocobase/plugin-file-manager": "0.7.0-alpha.23",
|
||||||
"@nocobase/plugin-system-settings": "0.7.0-alpha.16",
|
"@nocobase/plugin-system-settings": "0.7.0-alpha.23",
|
||||||
"@nocobase/plugin-ui-routes-storage": "0.7.0-alpha.16",
|
"@nocobase/plugin-ui-routes-storage": "0.7.0-alpha.23",
|
||||||
"@nocobase/plugin-ui-schema-storage": "0.7.0-alpha.16",
|
"@nocobase/plugin-ui-schema-storage": "0.7.0-alpha.23",
|
||||||
"@nocobase/plugin-users": "0.7.0-alpha.16",
|
"@nocobase/plugin-users": "0.7.0-alpha.23",
|
||||||
"@nocobase/plugin-workflow": "0.7.0-alpha.16",
|
"@nocobase/plugin-workflow": "0.7.0-alpha.23",
|
||||||
"@nocobase/server": "0.7.0-alpha.16"
|
"@nocobase/server": "0.7.0-alpha.23"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nocobase/acl",
|
"name": "@nocobase/acl",
|
||||||
"version": "0.7.0-alpha.16",
|
"version": "0.7.0-alpha.23",
|
||||||
"description": "",
|
"description": "",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"licenses": [
|
"licenses": [
|
||||||
@ -17,7 +17,7 @@
|
|||||||
"build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm"
|
"build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nocobase/resourcer": "0.7.0-alpha.16",
|
"@nocobase/resourcer": "0.7.0-alpha.23",
|
||||||
"json-templates": "^4.2.0"
|
"json-templates": "^4.2.0"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nocobase/actions",
|
"name": "@nocobase/actions",
|
||||||
"version": "0.7.0-alpha.16",
|
"version": "0.7.0-alpha.23",
|
||||||
"description": "",
|
"description": "",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"licenses": [
|
"licenses": [
|
||||||
@ -17,8 +17,8 @@
|
|||||||
"build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm"
|
"build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nocobase/database": "0.7.0-alpha.16",
|
"@nocobase/database": "0.7.0-alpha.23",
|
||||||
"@nocobase/resourcer": "0.7.0-alpha.16"
|
"@nocobase/resourcer": "0.7.0-alpha.23"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nocobase/client",
|
"name": "@nocobase/client",
|
||||||
"version": "0.7.0-alpha.16",
|
"version": "0.7.0-alpha.23",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"licenses": [
|
"licenses": [
|
||||||
{
|
{
|
||||||
@ -29,7 +29,7 @@
|
|||||||
"@formily/antd": "^2.0.15",
|
"@formily/antd": "^2.0.15",
|
||||||
"@formily/core": "^2.0.15",
|
"@formily/core": "^2.0.15",
|
||||||
"@formily/react": "^2.0.15",
|
"@formily/react": "^2.0.15",
|
||||||
"@nocobase/utils": "0.7.0-alpha.16",
|
"@nocobase/utils": "0.7.0-alpha.23",
|
||||||
"ahooks": "^3.0.5",
|
"ahooks": "^3.0.5",
|
||||||
"antd": "~4.19.5",
|
"antd": "~4.19.5",
|
||||||
"axios": "^0.24.0",
|
"axios": "^0.24.0",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "create-nocobase-app",
|
"name": "create-nocobase-app",
|
||||||
"version": "0.7.0-alpha.16",
|
"version": "0.7.0-alpha.23",
|
||||||
"main": "src/index.js",
|
"main": "src/index.js",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"licenses": [
|
"licenses": [
|
||||||
|
@ -54,7 +54,7 @@ const getDatabaseOptionsFromCommandOptions = (commandOptions) => {
|
|||||||
if (!commandOptions.dbDialect || commandOptions.dbDialect === 'sqlite' || envs['DB_STORAGE']) {
|
if (!commandOptions.dbDialect || commandOptions.dbDialect === 'sqlite' || envs['DB_STORAGE']) {
|
||||||
return {
|
return {
|
||||||
dialect: 'sqlite',
|
dialect: 'sqlite',
|
||||||
storage: envs['DB_STORAGE'] || 'db.sqlite',
|
storage: envs['DB_STORAGE'] || 'storage/db/nocobase.sqlite',
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
0
packages/core/create-nocobase-app/src/resources/files/storage/.gitignore
vendored
Normal file
0
packages/core/create-nocobase-app/src/resources/files/storage/.gitignore
vendored
Normal file
2
packages/core/create-nocobase-app/src/resources/files/storage/db/.gitignore
vendored
Normal file
2
packages/core/create-nocobase-app/src/resources/files/storage/db/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
*
|
||||||
|
!.gitignore
|
2
packages/core/create-nocobase-app/src/resources/files/storage/uploads/.gitignore
vendored
Normal file
2
packages/core/create-nocobase-app/src/resources/files/storage/uploads/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
*
|
||||||
|
!.gitignore
|
@ -1,26 +1,31 @@
|
|||||||
|
################# NOCOBASE APPLICATION #################
|
||||||
|
|
||||||
NOCOBASE_ENV=development
|
NOCOBASE_ENV=development
|
||||||
|
JWT_SECRET=<%= jwtSecret %>
|
||||||
|
|
||||||
SERVER_HOST=0.0.0.0
|
SERVER_HOST=0.0.0.0
|
||||||
SERVER_PORT=3000
|
SERVER_PORT=3000
|
||||||
|
|
||||||
JWT_SECRET=<%= jwtSecret %>
|
|
||||||
|
|
||||||
# api base path endpoint for app(web)
|
# api base path endpoint for app(web)
|
||||||
SERVER_BASE_PATH=/api/
|
SERVER_BASE_PATH=/api/
|
||||||
|
|
||||||
# api server access point for app(web when build)
|
# api server access point for app(web when build)
|
||||||
SERVER_BASE_URL=
|
SERVER_BASE_URL=
|
||||||
|
|
||||||
|
################# DATABASE #################
|
||||||
|
|
||||||
DB_LOG_SQL=off
|
DB_LOG_SQL=off
|
||||||
<%= dbEnvs %>
|
<%= dbEnvs %>
|
||||||
|
|
||||||
|
################# STORAGE (Initialization only) #################
|
||||||
|
|
||||||
# local or ali-oss
|
# local or ali-oss
|
||||||
DEFAULT_STORAGE_TYPE=local
|
DEFAULT_STORAGE_TYPE=local
|
||||||
STORAGE_TYPE=local
|
|
||||||
|
|
||||||
# LOCAL STORAGE
|
# LOCAL STORAGE
|
||||||
LOCAL_STORAGE_USE_STATIC_SERVER=true
|
LOCAL_STORAGE_USE_STATIC_SERVER=true
|
||||||
LOCAL_STORAGE_BASE_URL=
|
LOCAL_STORAGE_BASE_URL=
|
||||||
|
LOCAL_STORAGE_DEST=storage/uploads
|
||||||
|
|
||||||
# ALI OSS STORAGE
|
# ALI OSS STORAGE
|
||||||
ALI_OSS_STORAGE_BASE_URL=
|
ALI_OSS_STORAGE_BASE_URL=
|
||||||
|
@ -7,14 +7,14 @@ module.exports = (opts) => {
|
|||||||
workspaces: ['packages/app/*', 'packages/plugins/*'],
|
workspaces: ['packages/app/*', 'packages/plugins/*'],
|
||||||
license: 'MIT',
|
license: 'MIT',
|
||||||
scripts: {
|
scripts: {
|
||||||
start: 'concurrently --kill-others "npm run start-server" "npm run start-client"',
|
start: 'concurrently --kill-others "yarn start-server -s" "yarn start-client"',
|
||||||
bootstrap: 'lerna bootstrap',
|
bootstrap: 'lerna bootstrap',
|
||||||
clean: 'rimraf -rf packages/{app,plugins}/*/{lib,esm,dist} && lerna clean',
|
clean: 'rimraf -rf packages/{app,plugins}/*/{lib,esm,dist} && lerna clean',
|
||||||
nocobase:
|
nocobase:
|
||||||
'cross-env DOTENV_CONFIG_PATH=.env ts-node-dev -r dotenv/config -r tsconfig-paths/register ./packages/app/server/src/index.ts',
|
'cross-env DOTENV_CONFIG_PATH=.env ts-node-dev -r dotenv/config -r tsconfig-paths/register ./packages/app/server/src/index.ts',
|
||||||
'nocobase-prod': 'cross-env DOTENV_CONFIG_PATH=.env node -r dotenv/config packages/app/server/lib/index.js',
|
'nocobase-prod': 'cross-env DOTENV_CONFIG_PATH=.env node -r dotenv/config packages/app/server/lib/index.js',
|
||||||
'start-client': 'cd packages/app/client && npm run start',
|
'start-client': 'cd packages/app/client && yarn start',
|
||||||
'start-server': 'npm run nocobase start',
|
'start-server': 'yarn nocobase start',
|
||||||
'start-pm2': 'pm2-runtime start --node-args="-r dotenv/config" packages/app/server/lib/index.js -- start',
|
'start-pm2': 'pm2-runtime start --node-args="-r dotenv/config" packages/app/server/lib/index.js -- start',
|
||||||
build: 'lerna run build',
|
build: 'lerna run build',
|
||||||
'build-docs': 'dumi build',
|
'build-docs': 'dumi build',
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nocobase/database",
|
"name": "@nocobase/database",
|
||||||
"version": "0.7.0-alpha.16",
|
"version": "0.7.0-alpha.23",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "./lib/index.js",
|
"main": "./lib/index.js",
|
||||||
"types": "./lib/index.d.ts",
|
"types": "./lib/index.d.ts",
|
||||||
@ -17,7 +17,7 @@
|
|||||||
"build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm"
|
"build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nocobase/utils": "0.7.0-alpha.16",
|
"@nocobase/utils": "0.7.0-alpha.23",
|
||||||
"async-mutex": "^0.3.2",
|
"async-mutex": "^0.3.2",
|
||||||
"deepmerge": "^4.2.2",
|
"deepmerge": "^4.2.2",
|
||||||
"flat": "^5.0.2",
|
"flat": "^5.0.2",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nocobase/resourcer",
|
"name": "@nocobase/resourcer",
|
||||||
"version": "0.7.0-alpha.16",
|
"version": "0.7.0-alpha.23",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "./lib/index.js",
|
"main": "./lib/index.js",
|
||||||
"types": "./lib/index.d.ts",
|
"types": "./lib/index.d.ts",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nocobase/server",
|
"name": "@nocobase/server",
|
||||||
"version": "0.7.0-alpha.16",
|
"version": "0.7.0-alpha.23",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"types": "./lib/index.d.ts",
|
"types": "./lib/index.d.ts",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
@ -18,10 +18,11 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@koa/cors": "^3.1.0",
|
"@koa/cors": "^3.1.0",
|
||||||
"@koa/router": "^9.4.0",
|
"@koa/router": "^9.4.0",
|
||||||
"@nocobase/acl": "0.7.0-alpha.16",
|
"@nocobase/acl": "0.7.0-alpha.23",
|
||||||
"@nocobase/actions": "0.7.0-alpha.16",
|
"@nocobase/actions": "0.7.0-alpha.23",
|
||||||
"@nocobase/database": "0.7.0-alpha.16",
|
"@nocobase/database": "0.7.0-alpha.23",
|
||||||
"@nocobase/resourcer": "0.7.0-alpha.16",
|
"@nocobase/resourcer": "0.7.0-alpha.23",
|
||||||
|
"chalk": "^4.1.1",
|
||||||
"commander": "^8.1.0",
|
"commander": "^8.1.0",
|
||||||
"dotenv": "^8.2.0",
|
"dotenv": "^8.2.0",
|
||||||
"find-package-json": "^1.2.0",
|
"find-package-json": "^1.2.0",
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import Application, { ApplicationOptions } from './application';
|
|
||||||
import http, { IncomingMessage } from 'http';
|
|
||||||
import EventEmitter from 'events';
|
|
||||||
import { applyMixins, AsyncEmitter } from '@nocobase/utils';
|
import { applyMixins, AsyncEmitter } from '@nocobase/utils';
|
||||||
|
import EventEmitter from 'events';
|
||||||
|
import http, { IncomingMessage } from 'http';
|
||||||
|
import Application, { ApplicationOptions } from './application';
|
||||||
|
|
||||||
type AppSelector = (req: IncomingMessage) => Application | string | undefined | null;
|
type AppSelector = (req: IncomingMessage) => Application | string | undefined | null;
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import Application from '../application';
|
|
||||||
import { Command } from 'commander';
|
import { Command } from 'commander';
|
||||||
|
import Application from '../application';
|
||||||
|
|
||||||
export function createCli(app: Application) {
|
export function createCli(app: Application) {
|
||||||
const program = new Command();
|
const program = new Command();
|
||||||
@ -19,8 +19,8 @@ export function createCli(app: Application) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
program.command('start').description('start NocoBase application').action(runSubCommand('start'));
|
program.command('start').description('start NocoBase application').option('-s, --silent').action(runSubCommand('start'));
|
||||||
program.command('install').option('-f, --force').option('-c, --clean').action(runSubCommand('install'));
|
program.command('install').option('-f, --force').option('-c, --clean').option('-s, --silent').action(runSubCommand('install'));
|
||||||
program.command('db:sync').option('-f, --force').action(runSubCommand('db-sync'));
|
program.command('db:sync').option('-f, --force').action(runSubCommand('db-sync'));
|
||||||
program.command('console').action(runSubCommand('console'));
|
program.command('console').action(runSubCommand('console'));
|
||||||
|
|
||||||
|
@ -1,5 +1,29 @@
|
|||||||
|
import chalk from 'chalk';
|
||||||
|
|
||||||
export default async ({ app, cliArgs }) => {
|
export default async ({ app, cliArgs }) => {
|
||||||
const [opts] = cliArgs;
|
const [opts] = cliArgs;
|
||||||
|
|
||||||
|
if (!opts?.clean && !opts?.force) {
|
||||||
|
const tables = await app.db.sequelize.getQueryInterface().showAllTables();
|
||||||
|
if (tables.includes('collections')) {
|
||||||
|
if (!opts.silent) {
|
||||||
|
console.log();
|
||||||
|
console.log();
|
||||||
|
console.log(chalk.yellow('NocoBase is already installed. To reinstall, please execute:'));
|
||||||
|
console.log();
|
||||||
|
let command = 'yarn nocobase install -f';
|
||||||
|
console.log(chalk.yellow(command));
|
||||||
|
console.log();
|
||||||
|
console.log();
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!opts.silent) {
|
||||||
|
console.log(`NocoBase installing`);
|
||||||
|
}
|
||||||
|
|
||||||
await app.install({
|
await app.install({
|
||||||
cliArgs,
|
cliArgs,
|
||||||
clean: opts.clean,
|
clean: opts.clean,
|
||||||
@ -7,7 +31,12 @@ export default async ({ app, cliArgs }) => {
|
|||||||
force: opts.force,
|
force: opts.force,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
await app.stop({
|
await app.stop({
|
||||||
cliArgs,
|
cliArgs,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (!opts.silent) {
|
||||||
|
console.log(`NocoBase installed`);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
@ -11,5 +11,7 @@ export default async ({ app, cliArgs }) => {
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(`🚀 nocobase server had started at http://${host}:${port}`);
|
if (!opts.silent) {
|
||||||
|
console.log(`🚀 NocoBase server running at: http://${host === '0.0.0.0' ? 'localhost' : host}:${port}/`);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nocobase/test",
|
"name": "@nocobase/test",
|
||||||
"version": "0.7.0-alpha.16",
|
"version": "0.7.0-alpha.23",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"types": "./lib/index.d.ts",
|
"types": "./lib/index.d.ts",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
@ -16,7 +16,7 @@
|
|||||||
"build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm"
|
"build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nocobase/server": "0.7.0-alpha.16",
|
"@nocobase/server": "0.7.0-alpha.23",
|
||||||
"@types/supertest": "^2.0.11",
|
"@types/supertest": "^2.0.11",
|
||||||
"mockjs": "^1.1.0",
|
"mockjs": "^1.1.0",
|
||||||
"mysql2": "^2.1.0",
|
"mysql2": "^2.1.0",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nocobase/utils",
|
"name": "@nocobase/utils",
|
||||||
"version": "0.7.0-alpha.16",
|
"version": "0.7.0-alpha.23",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"types": "./lib/index.d.ts",
|
"types": "./lib/index.d.ts",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nocobase/plugin-acl",
|
"name": "@nocobase/plugin-acl",
|
||||||
"version": "0.7.0-alpha.16",
|
"version": "0.7.0-alpha.23",
|
||||||
"description": "",
|
"description": "",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"licenses": [
|
"licenses": [
|
||||||
@ -17,9 +17,9 @@
|
|||||||
"build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm"
|
"build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nocobase/acl": "0.7.0-alpha.16",
|
"@nocobase/acl": "0.7.0-alpha.23",
|
||||||
"@nocobase/database": "0.7.0-alpha.16",
|
"@nocobase/database": "0.7.0-alpha.23",
|
||||||
"@nocobase/server": "0.7.0-alpha.16"
|
"@nocobase/server": "0.7.0-alpha.23"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nocobase/plugin-action-logs",
|
"name": "@nocobase/plugin-action-logs",
|
||||||
"version": "0.7.0-alpha.16",
|
"version": "0.7.0-alpha.23",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"licenses": [
|
"licenses": [
|
||||||
@ -15,7 +15,7 @@
|
|||||||
"build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm"
|
"build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nocobase/test": "0.7.0-alpha.16"
|
"@nocobase/test": "0.7.0-alpha.23"
|
||||||
},
|
},
|
||||||
"gitHead": "a00b45a2686695c5f4824d074ac5e1aff210793a"
|
"gitHead": "a00b45a2686695c5f4824d074ac5e1aff210793a"
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nocobase/plugin-china-region",
|
"name": "@nocobase/plugin-china-region",
|
||||||
"version": "0.7.0-alpha.16",
|
"version": "0.7.0-alpha.23",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"licenses": [
|
"licenses": [
|
||||||
@ -18,7 +18,7 @@
|
|||||||
"china-division": "^2.4.0"
|
"china-division": "^2.4.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nocobase/test": "0.7.0-alpha.16"
|
"@nocobase/test": "0.7.0-alpha.23"
|
||||||
},
|
},
|
||||||
"gitHead": "a00b45a2686695c5f4824d074ac5e1aff210793a"
|
"gitHead": "a00b45a2686695c5f4824d074ac5e1aff210793a"
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Database } from '@nocobase/database';
|
|
||||||
import { Plugin } from '@nocobase/server';
|
import { Plugin } from '@nocobase/server';
|
||||||
|
import { areas, cities, provinces } from 'china-division';
|
||||||
import { resolve } from 'path';
|
import { resolve } from 'path';
|
||||||
|
|
||||||
export class ChinaRegionPlugin extends Plugin {
|
export class ChinaRegionPlugin extends Plugin {
|
||||||
@ -18,15 +18,6 @@ export class ChinaRegionPlugin extends Plugin {
|
|||||||
const timer = Date.now();
|
const timer = Date.now();
|
||||||
const ChinaRegion = this.db.getModel('chinaRegions');
|
const ChinaRegion = this.db.getModel('chinaRegions');
|
||||||
|
|
||||||
const db = new Database({
|
|
||||||
dialect: 'sqlite',
|
|
||||||
storage: resolve(process.cwd(), 'node_modules/china-division/dist/data.sqlite'),
|
|
||||||
});
|
|
||||||
|
|
||||||
const [provinces] = await db.sequelize.query('SELECT `code`, `name` FROM `province`') as any;
|
|
||||||
const [cities] = await db.sequelize.query('SELECT `code`, `name`, `provinceCode` FROM `city`') as any;
|
|
||||||
const [areas] = await db.sequelize.query('SELECT `code`, `name`, `cityCode` FROM `area`') as any;
|
|
||||||
|
|
||||||
await ChinaRegion.bulkCreate(
|
await ChinaRegion.bulkCreate(
|
||||||
provinces.map((item) => ({
|
provinces.map((item) => ({
|
||||||
code: item.code,
|
code: item.code,
|
||||||
@ -70,7 +61,7 @@ export class ChinaRegionPlugin extends Plugin {
|
|||||||
// })));
|
// })));
|
||||||
|
|
||||||
const count = await ChinaRegion.count();
|
const count = await ChinaRegion.count();
|
||||||
console.log(`${count} rows of region data imported in ${(Date.now() - timer) / 1000}s`);
|
// console.log(`${count} rows of region data imported in ${(Date.now() - timer) / 1000}s`);
|
||||||
}
|
}
|
||||||
|
|
||||||
getName(): string {
|
getName(): string {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nocobase/plugin-client",
|
"name": "@nocobase/plugin-client",
|
||||||
"version": "0.7.0-alpha.16",
|
"version": "0.7.0-alpha.23",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"licenses": [
|
"licenses": [
|
||||||
@ -15,10 +15,10 @@
|
|||||||
"build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm"
|
"build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nocobase/server": "0.7.0-alpha.16"
|
"@nocobase/server": "0.7.0-alpha.23"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nocobase/test": "0.7.0-alpha.16"
|
"@nocobase/test": "0.7.0-alpha.23"
|
||||||
},
|
},
|
||||||
"gitHead": "a00b45a2686695c5f4824d074ac5e1aff210793a"
|
"gitHead": "a00b45a2686695c5f4824d074ac5e1aff210793a"
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nocobase/plugin-collection-manager",
|
"name": "@nocobase/plugin-collection-manager",
|
||||||
"version": "0.7.0-alpha.16",
|
"version": "0.7.0-alpha.23",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"licenses": [
|
"licenses": [
|
||||||
@ -15,7 +15,7 @@
|
|||||||
"build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm"
|
"build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nocobase/test": "0.7.0-alpha.16"
|
"@nocobase/test": "0.7.0-alpha.23"
|
||||||
},
|
},
|
||||||
"gitHead": "a00b45a2686695c5f4824d074ac5e1aff210793a"
|
"gitHead": "a00b45a2686695c5f4824d074ac5e1aff210793a"
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nocobase/plugin-error-handler",
|
"name": "@nocobase/plugin-error-handler",
|
||||||
"version": "0.7.0-alpha.16",
|
"version": "0.7.0-alpha.23",
|
||||||
"description": "",
|
"description": "",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"licenses": [
|
"licenses": [
|
||||||
@ -18,7 +18,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@formily/json-schema": "^2.0.15",
|
"@formily/json-schema": "^2.0.15",
|
||||||
"@nocobase/server": "0.7.0-alpha.16"
|
"@nocobase/server": "0.7.0-alpha.23"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nocobase/plugin-file-manager",
|
"name": "@nocobase/plugin-file-manager",
|
||||||
"version": "0.7.0-alpha.16",
|
"version": "0.7.0-alpha.23",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"licenses": [
|
"licenses": [
|
||||||
@ -16,7 +16,7 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@koa/multer": "^3.0.0",
|
"@koa/multer": "^3.0.0",
|
||||||
"@nocobase/server": "0.7.0-alpha.16",
|
"@nocobase/server": "0.7.0-alpha.23",
|
||||||
"aws-sdk": "^2.2.32",
|
"aws-sdk": "^2.2.32",
|
||||||
"koa-static": "^5.0.0",
|
"koa-static": "^5.0.0",
|
||||||
"mime-match": "^1.0.2",
|
"mime-match": "^1.0.2",
|
||||||
@ -26,7 +26,7 @@
|
|||||||
"multer-s3": "^2.10.0"
|
"multer-s3": "^2.10.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nocobase/test": "0.7.0-alpha.16",
|
"@nocobase/test": "0.7.0-alpha.23",
|
||||||
"@types/koa-multer": "^1.0.1",
|
"@types/koa-multer": "^1.0.1",
|
||||||
"@types/multer": "^1.4.5"
|
"@types/multer": "^1.4.5"
|
||||||
},
|
},
|
||||||
|
@ -119,11 +119,16 @@ export default {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
defaults() {
|
defaults() {
|
||||||
|
const { LOCAL_STORAGE_DEST, LOCAL_STORAGE_BASE_URL, SERVER_PORT } = process.env;
|
||||||
|
const documentRoot = LOCAL_STORAGE_DEST || 'uploads';
|
||||||
return {
|
return {
|
||||||
title: '本地存储',
|
title: '本地存储',
|
||||||
type: STORAGE_TYPE_LOCAL,
|
type: STORAGE_TYPE_LOCAL,
|
||||||
name: `local`,
|
name: `local`,
|
||||||
baseUrl: process.env.LOCAL_STORAGE_BASE_URL || `http://localhost:${process.env.SERVER_PORT || '13002'}/uploads`,
|
baseUrl: LOCAL_STORAGE_BASE_URL || `http://localhost:${SERVER_PORT || '13002'}/${documentRoot}`,
|
||||||
|
options: {
|
||||||
|
documentRoot,
|
||||||
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nocobase/plugin-multi-app-manager",
|
"name": "@nocobase/plugin-multi-app-manager",
|
||||||
"version": "0.7.0-alpha.16",
|
"version": "0.7.0-alpha.23",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"licenses": [
|
"licenses": [
|
||||||
@ -15,7 +15,7 @@
|
|||||||
"build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm"
|
"build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nocobase/server": "0.7.0-alpha.16"
|
"@nocobase/server": "0.7.0-alpha.23"
|
||||||
},
|
},
|
||||||
"gitHead": "a00b45a2686695c5f4824d074ac5e1aff210793a"
|
"gitHead": "a00b45a2686695c5f4824d074ac5e1aff210793a"
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nocobase/plugin-notifications",
|
"name": "@nocobase/plugin-notifications",
|
||||||
"version": "0.7.0-alpha.16",
|
"version": "0.7.0-alpha.23",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"licenses": [
|
"licenses": [
|
||||||
@ -18,7 +18,7 @@
|
|||||||
"nodemailer": "^6.6.1"
|
"nodemailer": "^6.6.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nocobase/test": "0.7.0-alpha.16",
|
"@nocobase/test": "0.7.0-alpha.23",
|
||||||
"@types/nodemailer": "6.4.4",
|
"@types/nodemailer": "6.4.4",
|
||||||
"nodemailer-mock": "^1.5.11"
|
"nodemailer-mock": "^1.5.11"
|
||||||
},
|
},
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nocobase/plugin-system-settings",
|
"name": "@nocobase/plugin-system-settings",
|
||||||
"version": "0.7.0-alpha.16",
|
"version": "0.7.0-alpha.23",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"licenses": [
|
"licenses": [
|
||||||
@ -15,7 +15,7 @@
|
|||||||
"build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm"
|
"build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nocobase/test": "0.7.0-alpha.16"
|
"@nocobase/test": "0.7.0-alpha.23"
|
||||||
},
|
},
|
||||||
"gitHead": "a00b45a2686695c5f4824d074ac5e1aff210793a"
|
"gitHead": "a00b45a2686695c5f4824d074ac5e1aff210793a"
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nocobase/plugin-ui-routes-storage",
|
"name": "@nocobase/plugin-ui-routes-storage",
|
||||||
"version": "0.7.0-alpha.16",
|
"version": "0.7.0-alpha.23",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"licenses": [
|
"licenses": [
|
||||||
@ -18,7 +18,7 @@
|
|||||||
"flat-to-nested": "^1.1.1"
|
"flat-to-nested": "^1.1.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nocobase/test": "0.7.0-alpha.16"
|
"@nocobase/test": "0.7.0-alpha.23"
|
||||||
},
|
},
|
||||||
"gitHead": "a00b45a2686695c5f4824d074ac5e1aff210793a"
|
"gitHead": "a00b45a2686695c5f4824d074ac5e1aff210793a"
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nocobase/plugin-ui-schema-storage",
|
"name": "@nocobase/plugin-ui-schema-storage",
|
||||||
"version": "0.7.0-alpha.16",
|
"version": "0.7.0-alpha.23",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"licenses": [
|
"licenses": [
|
||||||
@ -16,7 +16,7 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@formily/json-schema": "^2.0.15",
|
"@formily/json-schema": "^2.0.15",
|
||||||
"@nocobase/test": "0.7.0-alpha.16"
|
"@nocobase/test": "0.7.0-alpha.23"
|
||||||
},
|
},
|
||||||
"gitHead": "a00b45a2686695c5f4824d074ac5e1aff210793a"
|
"gitHead": "a00b45a2686695c5f4824d074ac5e1aff210793a"
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nocobase/plugin-users",
|
"name": "@nocobase/plugin-users",
|
||||||
"version": "0.7.0-alpha.16",
|
"version": "0.7.0-alpha.23",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"licenses": [
|
"licenses": [
|
||||||
@ -18,7 +18,7 @@
|
|||||||
"jsonwebtoken": "^8.5.1"
|
"jsonwebtoken": "^8.5.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nocobase/test": "0.7.0-alpha.16",
|
"@nocobase/test": "0.7.0-alpha.23",
|
||||||
"@types/jsonwebtoken": "^8.5.8"
|
"@types/jsonwebtoken": "^8.5.8"
|
||||||
},
|
},
|
||||||
"gitHead": "a00b45a2686695c5f4824d074ac5e1aff210793a"
|
"gitHead": "a00b45a2686695c5f4824d074ac5e1aff210793a"
|
||||||
|
@ -52,6 +52,6 @@ async function findUserByToken(ctx: Context, plugin: UsersPlugin) {
|
|||||||
appends: ['roles'],
|
appends: ['roles'],
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.warn(error);
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nocobase/plugin-workflow",
|
"name": "@nocobase/plugin-workflow",
|
||||||
"version": "0.7.0-alpha.16",
|
"version": "0.7.0-alpha.23",
|
||||||
"main": "lib/index.js",
|
"main": "lib/index.js",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"licenses": [
|
"licenses": [
|
||||||
@ -15,14 +15,14 @@
|
|||||||
"build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm"
|
"build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nocobase/actions": "0.7.0-alpha.16",
|
"@nocobase/actions": "0.7.0-alpha.23",
|
||||||
"@nocobase/database": "0.7.0-alpha.16",
|
"@nocobase/database": "0.7.0-alpha.23",
|
||||||
"@nocobase/server": "0.7.0-alpha.16",
|
"@nocobase/server": "0.7.0-alpha.23",
|
||||||
"@nocobase/utils": "0.7.0-alpha.16",
|
"@nocobase/utils": "0.7.0-alpha.23",
|
||||||
"json-templates": "^4.2.0"
|
"json-templates": "^4.2.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@nocobase/test": "0.7.0-alpha.16"
|
"@nocobase/test": "0.7.0-alpha.23"
|
||||||
},
|
},
|
||||||
"gitHead": "a00b45a2686695c5f4824d074ac5e1aff210793a"
|
"gitHead": "a00b45a2686695c5f4824d074ac5e1aff210793a"
|
||||||
}
|
}
|
||||||
|
0
storage/.gitignore
vendored
Normal file
0
storage/.gitignore
vendored
Normal file
2
storage/db/.gitignore
vendored
Normal file
2
storage/db/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
*
|
||||||
|
!.gitignore
|
2
storage/uploads/.gitignore
vendored
Normal file
2
storage/uploads/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
*
|
||||||
|
!.gitignore
|
Loading…
Reference in New Issue
Block a user