@nocobase/cli 0.21.0-alpha.9 → 1.0.0-alpha.10

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
@@ -30,6 +30,26 @@ server {
30
30
  autoindex off;
31
31
  }
32
32
 
33
+ location {{publicPath}}static/plugins/ {
34
+ alias {{cwd}}/node_modules/;
35
+ expires 365d;
36
+ add_header Cache-Control "public";
37
+ access_log off;
38
+ autoindex off;
39
+
40
+ location ~ ^/static/plugins/@([^/]+)/([^/]+)/dist/client/(.*)$ {
41
+ allow all;
42
+ }
43
+
44
+ location ~ ^/static/plugins/([^/]+)/dist/client/(.*)$ {
45
+ allow all;
46
+ }
47
+
48
+ location ~ ^/static/plugins/(.*)$ {
49
+ deny all;
50
+ }
51
+ }
52
+
33
53
  location {{publicPath}} {
34
54
  alias {{cwd}}/node_modules/@nocobase/app/dist/client/;
35
55
  try_files $uri $uri/ /index.html;
@@ -45,24 +65,12 @@ server {
45
65
  }
46
66
 
47
67
  location ^~ {{publicPath}}api/ {
48
- proxy_pass http://127.0.0.1:{{apiPort}}{{publicPath}}api/;
49
- proxy_http_version 1.1;
50
- proxy_set_header Upgrade $http_upgrade;
51
- proxy_set_header Connection 'upgrade';
52
- proxy_set_header Host $host;
53
- proxy_cache_bypass $http_upgrade;
54
- proxy_connect_timeout 600;
55
- proxy_send_timeout 600;
56
- proxy_read_timeout 600;
57
- send_timeout 600;
58
- }
59
-
60
- location ^~ {{publicPath}}static/plugins/ {
61
- proxy_pass http://127.0.0.1:{{apiPort}}{{publicPath}}static/plugins/;
68
+ proxy_pass http://127.0.0.1:{{apiPort}};
62
69
  proxy_http_version 1.1;
63
70
  proxy_set_header Upgrade $http_upgrade;
64
71
  proxy_set_header Connection 'upgrade';
65
72
  proxy_set_header Host $host;
73
+ add_header Cache-Control 'no-cache, no-store';
66
74
  proxy_cache_bypass $http_upgrade;
67
75
  proxy_connect_timeout 600;
68
76
  proxy_send_timeout 600;
package/package.json CHANGED
@@ -1,14 +1,14 @@
1
1
  {
2
2
  "name": "@nocobase/cli",
3
- "version": "0.21.0-alpha.9",
3
+ "version": "1.0.0-alpha.10",
4
4
  "description": "",
5
- "license": "Apache-2.0",
5
+ "license": "AGPL-3.0",
6
6
  "main": "./src/index.js",
7
7
  "bin": {
8
8
  "nocobase": "./bin/index.js"
9
9
  },
10
10
  "dependencies": {
11
- "@nocobase/app": "0.21.0-alpha.9",
11
+ "@nocobase/app": "1.0.0-alpha.10",
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.6.2"
26
26
  },
27
27
  "devDependencies": {
28
- "@nocobase/devtools": "0.21.0-alpha.9"
28
+ "@nocobase/devtools": "1.0.0-alpha.10"
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": "a6fe6c4ee532c04e5a50ec777bf76436ca624cbd"
35
+ "gitHead": "39c634c88f835f8eadedf72ca11a9fb3323a50f8"
36
36
  }
package/src/cli.js CHANGED
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  const { Command } = require('commander');
2
11
  const commands = require('./commands');
3
12
 
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  const { resolve } = require('path');
2
11
  const { Command } = require('commander');
3
12
  const { run, nodeCheck, isPackageValid, buildIndexHtml } = require('../util');
@@ -26,6 +35,7 @@ module.exports = (cli) => {
26
35
  if (options.watch) return;
27
36
  }
28
37
  process.env['VITE_CJS_IGNORE_WARNING'] = 'true';
38
+ process.env.APP_ENV = 'production';
29
39
 
30
40
  await run('nocobase-build', [
31
41
  ...pkgs,
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  const chalk = require('chalk');
2
11
  const { Command } = require('commander');
3
12
  const { run, isDev } = require('../util');
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  const { resolve } = require('path');
2
11
  const { Command } = require('commander');
3
12
  const { readFileSync, writeFileSync } = require('fs');
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  const { resolve } = require('path');
2
11
  const { Command } = require('commander');
3
12
  const { PluginGenerator } = require('../plugin-generator');
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  const chalk = require('chalk');
2
11
  const { Command } = require('commander');
3
12
  const { runAppCommand, runInstall, run, postCheck, nodeCheck, promptForTs } = require('../util');
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  const { Command } = require('commander');
2
11
  const { resolve, isAbsolute } = require('path');
3
12
  const { run, isDev } = require('../util');
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  const { Command } = require('commander');
2
11
  const { run, isPortReachable } = require('../util');
3
12
  const { execSync } = require('node:child_process');
@@ -139,9 +148,6 @@ const filterArgv = () => {
139
148
  if (element.startsWith('--url=')) {
140
149
  continue;
141
150
  }
142
- if (element === '--skip-reporter') {
143
- continue;
144
- }
145
151
  if (element === '--build') {
146
152
  continue;
147
153
  }
@@ -169,7 +175,6 @@ module.exports = (cli) => {
169
175
  .command('test')
170
176
  .allowUnknownOption()
171
177
  .option('--url [url]')
172
- .option('--skip-reporter')
173
178
  .option('--build')
174
179
  .option('--production')
175
180
  .action(async (options) => {
@@ -181,9 +186,6 @@ module.exports = (cli) => {
181
186
  process.env.APP_ENV = 'production';
182
187
  await run('yarn', ['build']);
183
188
  }
184
- if (options.skipReporter) {
185
- process.env.PLAYWRIGHT_SKIP_REPORTER = true;
186
- }
187
189
  if (options.url) {
188
190
  process.env.APP_BASE_URL = options.url.replace('localhost', '127.0.0.1');
189
191
  } else {
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  const { Command } = require('commander');
2
11
  const { run, isDev, isProd, promptForTs } = require('../util');
3
12
 
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  const { Command } = require('commander');
2
11
  const { isPackageValid, generateAppDir } = require('../util');
3
12
 
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  const execa = require('execa');
2
11
  const { resolve } = require('path');
3
12
  const pAll = require('p-all');
@@ -34,7 +43,7 @@ async function runApp(dir, index = 0) {
34
43
  await client.query(`DROP DATABASE IF EXISTS "${database}"`);
35
44
  await client.query(`CREATE DATABASE "${database}";`);
36
45
  await client.end();
37
- return execa('yarn', ['nocobase', 'e2e', 'test', dir, '--skip-reporter'], {
46
+ return execa('yarn', ['nocobase', 'e2e', 'test', dir], {
38
47
  shell: true,
39
48
  stdio: 'inherit',
40
49
  env: {
@@ -49,6 +58,7 @@ async function runApp(dir, index = 0) {
49
58
  SOCKET_PATH: `storage/e2e/gateway-e2e-${index}.sock`,
50
59
  PM2_HOME: resolve(process.cwd(), `storage/e2e/.pm2-${index}`),
51
60
  PLAYWRIGHT_AUTH_FILE: resolve(process.cwd(), `storage/playwright/.auth/admin-${index}.json`),
61
+ E2E_JOB_ID: index,
52
62
  },
53
63
  });
54
64
  }
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  const chalk = require('chalk');
2
11
  const { Command } = require('commander');
3
12
  const { run, isDev } = require('../util');
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  const { Command } = require('commander');
2
11
  const { run, isDev, isPackageValid, generatePlaywrightPath } = require('../util');
3
12
  const { resolve } = require('path');
@@ -1,9 +1,28 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  const { Command } = require('commander');
2
11
  const { isDev, run, postCheck, runInstall, promptForTs } = require('../util');
3
- const { existsSync, unlink } = require('fs');
12
+ const { existsSync, rmSync } = require('fs');
4
13
  const { resolve } = require('path');
5
14
  const chalk = require('chalk');
6
15
 
16
+ function deleteSockFiles() {
17
+ const { SOCKET_PATH, PM2_HOME } = process.env;
18
+ if (existsSync(PM2_HOME)) {
19
+ rmSync(PM2_HOME, { recursive: true });
20
+ }
21
+ if (existsSync(SOCKET_PATH)) {
22
+ rmSync(SOCKET_PATH);
23
+ }
24
+ }
25
+
7
26
  /**
8
27
  *
9
28
  * @param {Command} cli
@@ -41,6 +60,7 @@ module.exports = (cli) => {
41
60
  return;
42
61
  }
43
62
  await postCheck(opts);
63
+ deleteSockFiles();
44
64
  if (opts.daemon) {
45
65
  run('pm2', ['start', `${APP_PACKAGE_ROOT}/lib/index.js`, '--', ...process.argv.slice(2)]);
46
66
  } else {
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  const { resolve } = require('path');
2
11
  const { Command } = require('commander');
3
12
  const { run, nodeCheck, isPackageValid } = require('../util');
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  const { run } = require('../util');
2
11
  const fg = require('fast-glob');
3
12
 
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  const { Command } = require('commander');
2
11
  const { run } = require('../util');
3
12
  const path = require('path');
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  const chalk = require('chalk');
2
11
  const { Command } = require('commander');
3
12
  const { run, isDev } = require('../util');
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  const chalk = require('chalk');
2
11
  const { Command } = require('commander');
3
12
  const { resolve } = require('path');
package/src/index.js CHANGED
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  const util = require('./util');
2
11
 
3
12
  module.exports = {
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  const chalk = require('chalk');
2
11
  const { existsSync } = require('fs');
3
12
  const { join, resolve } = require('path');
package/src/util.js CHANGED
@@ -1,3 +1,12 @@
1
+ /**
2
+ * This file is part of the NocoBase (R) project.
3
+ * Copyright (c) 2020-2024 NocoBase Co., Ltd.
4
+ * Authors: NocoBase Team.
5
+ *
6
+ * This project is dual-licensed under AGPL-3.0 and NocoBase Commercial License.
7
+ * For more information, please refer to: https://www.nocobase.com/agreement.
8
+ */
9
+
1
10
  const net = require('net');
2
11
  const chalk = require('chalk');
3
12
  const execa = require('execa');
@@ -217,6 +226,10 @@ exports.genTsConfigPaths = function genTsConfigPaths() {
217
226
  if (packageJsonName === '@nocobase/test') {
218
227
  paths[`${packageJsonName}/server`] = [`${relativePath}/src/server`];
219
228
  paths[`${packageJsonName}/e2e`] = [`${relativePath}/src/e2e`];
229
+ paths[`${packageJsonName}/web`] = [`${relativePath}/src/web`];
230
+ }
231
+ if (packageJsonName === '@nocobase/client') {
232
+ paths[`${packageJsonName}/demo-utils`] = [`${relativePath}/src/demo-utils`];
220
233
  }
221
234
  if (packageJsonName === '@nocobase/plugin-workflow-test') {
222
235
  paths[`${packageJsonName}/e2e`] = [`${relativePath}/src/e2e`];
@@ -4,8 +4,8 @@
4
4
  "main": "dist/server/index.js",
5
5
  "dependencies": {},
6
6
  "peerDependencies": {
7
- "@nocobase/client": "0.x",
8
- "@nocobase/server": "0.x",
9
- "@nocobase/test": "0.x"
7
+ "@nocobase/client": "1.x",
8
+ "@nocobase/server": "1.x",
9
+ "@nocobase/test": "1.x"
10
10
  }
11
11
  }