@nocobase/cli 1.5.0-beta.26 → 1.5.0-beta.28

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/nocobase.conf.tpl CHANGED
@@ -65,6 +65,8 @@ server {
65
65
  }
66
66
  }
67
67
 
68
+ {{otherLocation}}
69
+
68
70
  location ^~ {{publicPath}}api/ {
69
71
  proxy_pass http://127.0.0.1:{{apiPort}};
70
72
  proxy_http_version 1.1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/cli",
3
- "version": "1.5.0-beta.26",
3
+ "version": "1.5.0-beta.28",
4
4
  "description": "",
5
5
  "license": "AGPL-3.0",
6
6
  "main": "./src/index.js",
@@ -8,7 +8,7 @@
8
8
  "nocobase": "./bin/index.js"
9
9
  },
10
10
  "dependencies": {
11
- "@nocobase/app": "1.5.0-beta.26",
11
+ "@nocobase/app": "1.5.0-beta.28",
12
12
  "@types/fs-extra": "^11.0.1",
13
13
  "@umijs/utils": "3.5.20",
14
14
  "chalk": "^4.1.1",
@@ -25,12 +25,12 @@
25
25
  "tsx": "^4.19.0"
26
26
  },
27
27
  "devDependencies": {
28
- "@nocobase/devtools": "1.5.0-beta.26"
28
+ "@nocobase/devtools": "1.5.0-beta.28"
29
29
  },
30
30
  "repository": {
31
31
  "type": "git",
32
32
  "url": "git+https://github.com/nocobase/nocobase.git",
33
33
  "directory": "packages/core/cli"
34
34
  },
35
- "gitHead": "186f13be005aed5af414a9df4e0eb48d06297f32"
35
+ "gitHead": "51948b3d451eabe1ca31e8f56bce32e84eba57ec"
36
36
  }
@@ -7,7 +7,7 @@
7
7
  * For more information, please refer to: https://www.nocobase.com/agreement.
8
8
  */
9
9
 
10
- const { resolve } = require('path');
10
+ const { resolve, posix } = require('path');
11
11
  const { Command } = require('commander');
12
12
  const { readFileSync, writeFileSync } = require('fs');
13
13
 
@@ -19,11 +19,18 @@ module.exports = (cli) => {
19
19
  cli.command('create-nginx-conf').action(async (name, options) => {
20
20
  const file = resolve(__dirname, '../../nocobase.conf.tpl');
21
21
  const data = readFileSync(file, 'utf-8');
22
+ let otherLocation = '';
23
+ if (process.env.APP_PUBLIC_PATH !== '/') {
24
+ otherLocation = `location / {
25
+ alias ${posix.resolve(process.cwd())}/node_modules/@nocobase/app/dist/client/;
26
+ try_files $uri $uri/ /index.html;
27
+ }`;
28
+ }
22
29
  const replaced = data
23
- .replace(/\{\{cwd\}\}/g, '/app/nocobase')
30
+ .replace(/\{\{cwd\}\}/g, posix.resolve(process.cwd()))
24
31
  .replace(/\{\{publicPath\}\}/g, process.env.APP_PUBLIC_PATH)
25
- .replace(/\{\{apiPort\}\}/g, process.env.APP_PORT);
26
-
32
+ .replace(/\{\{apiPort\}\}/g, process.env.APP_PORT)
33
+ .replace(/\{\{otherLocation\}\}/g, otherLocation);
27
34
  const targetFile = resolve(process.cwd(), 'storage', 'nocobase.conf');
28
35
  writeFileSync(targetFile, replaced);
29
36
  });