chore: update config location

pull/59/head
fantasticit 2022-05-21 14:56:50 +08:00
parent fe60c43fba
commit fa8cf77ab4
6 changed files with 38 additions and 21 deletions

4
.gitignore vendored
View File

@ -16,6 +16,6 @@ tsconfig.tsbuildinfo
*debug.log
*.conf
packages/config/yaml/dev.yaml
packages/config/yaml/prod.yaml
**/prod.yaml
scripts/update.sh

View File

@ -59,7 +59,7 @@ CREATE DATABASE `think` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_c
#### 可选Redis
如果需要文档版本服务,请在 `@think/config` `yaml` 配置中进行 `db.redis` 的配置。
如果需要文档版本服务,请在根目录 `yaml` 配置中进行 `db.redis` 的配置。
```
docker pull redis:latest
@ -98,18 +98,19 @@ pnpm run dev
```yaml
# 开发环境配置
# 开发环境配置
client:
port: 5001
assetPrefix: '/'
apiUrl: 'http://localhost:5002/api'
collaborationUrl: 'ws://localhost:5003'
server:
prefix: '/api'
port: 5001
port: 5002
collaborationPort: 5003
maxDocumentVersion: 20 # 最大版本记录数
client:
port: 5002
assetPrefix: '/'
apiUrl: 'http://localhost:5001/api'
collaborationUrl: 'ws://localhost:5003'
drawioUrl: 'https://embed.diagrams.net'
logRetainDays: 3 # 日志保留天数,比如只保留近三天日志
# 数据库配置
db:

View File

@ -1,17 +1,17 @@
# 开发环境配置
client:
port: 5001
assetPrefix: '/'
apiUrl: 'http://localhost:5002/api'
collaborationUrl: 'ws://localhost:5003'
server:
prefix: '/api'
port: 5001
port: 5002
collaborationPort: 5003
maxDocumentVersion: 20 # 最大版本记录数
logRetainDays: 3 # 日志保留天数,比如只保留近三天日志
client:
port: 5002
assetPrefix: '/'
apiUrl: 'http://localhost:5001/api'
collaborationUrl: 'ws://localhost:5003'
# 数据库配置
db:
mysql:

View File

@ -11,7 +11,7 @@ var FILE_ENV_NAME = {
};
var env = process.env.NODE_ENV || 'development';
function getConfig() {
var filePath = path.join(__dirname, '../yaml/', "".concat(FILE_ENV_NAME[env], ".yaml"));
var filePath = path.join(__dirname, '../../../', "".concat(FILE_ENV_NAME[env], ".yaml"));
if (!fs.existsSync(filePath)) {
throw new Error("Can not find config file: ".concat(filePath));
}

View File

@ -11,7 +11,7 @@ const FILE_ENV_NAME = {
const env = process.env.NODE_ENV || 'development';
export function getConfig() {
const filePath = path.join(__dirname, '../yaml/', `${FILE_ENV_NAME[env]}.yaml`);
const filePath = path.join(__dirname, '../../../', `${FILE_ENV_NAME[env]}.yaml`);
if (!fs.existsSync(filePath)) {
throw new Error(`Can not find config file: ${filePath}`);

View File

@ -236,7 +236,7 @@ importers:
eslint: 8.14.0
eslint-config-prettier: 8.5.0_eslint@8.14.0
eslint-plugin-import: 2.26.0_eslint@8.14.0
eslint-plugin-prettier: 4.0.0_740be41c8168d0cc214a306089357ad0
eslint-plugin-prettier: 4.0.0_74ebb802163a9b4fa8f89d76ed02f62a
eslint-plugin-react: 7.29.4_eslint@8.14.0
eslint-plugin-react-hooks: 4.5.0_eslint@8.14.0
eslint-plugin-simple-import-sort: 7.0.0_eslint@8.14.0
@ -5370,6 +5370,22 @@ packages:
prettier-linter-helpers: 1.0.0
dev: true
/eslint-plugin-prettier/4.0.0_74ebb802163a9b4fa8f89d76ed02f62a:
resolution: {integrity: sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==}
engines: {node: '>=6.0.0'}
peerDependencies:
eslint: '>=7.28.0'
eslint-config-prettier: '*'
prettier: '>=2.0.0'
peerDependenciesMeta:
eslint-config-prettier:
optional: true
dependencies:
eslint: 8.14.0
eslint-config-prettier: 8.5.0_eslint@8.14.0
prettier-linter-helpers: 1.0.0
dev: true
/eslint-plugin-react-hooks/4.5.0_eslint@8.14.0:
resolution: {integrity: sha512-8k1gRt7D7h03kd+SAAlzXkQwWK22BnK6GKZG+FJA6BAGy22CFvl8kCIXKpVux0cCxMWDQUPqSok0LKaZ0aOcCw==}
engines: {node: '>=10'}