@nocobase/cli 1.3.0-beta → 1.3.2-beta

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nocobase/cli",
3
- "version": "1.3.0-beta",
3
+ "version": "1.3.2-beta",
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.3.0-beta",
11
+ "@nocobase/app": "1.3.2-beta",
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": "1.3.0-beta"
28
+ "@nocobase/devtools": "1.3.2-beta"
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": "175a86dcc41577bff4f94ae614ebe778fd532f3f"
35
+ "gitHead": "7a411e2dec764d9d7800dc4eaae26b5ce0b1c751"
36
36
  }
@@ -23,6 +23,7 @@ module.exports = (cli) => {
23
23
  .command('upgrade')
24
24
  .allowUnknownOption()
25
25
  .option('--raw')
26
+ .option('--next')
26
27
  .option('-S|--skip-code-update')
27
28
  .action(async (options) => {
28
29
  if (hasTsNode()) promptForTs();
@@ -40,26 +41,32 @@ module.exports = (cli) => {
40
41
  await runAppCommand('upgrade');
41
42
  return;
42
43
  }
43
- // If ts-node is not installed, do not do the following
44
- const appDevDir = resolve(process.cwd(), './storage/.app-dev');
45
- if (existsSync(appDevDir)) {
46
- rmSync(appDevDir, { recursive: true, force: true });
47
- }
44
+ const rmAppDir = () => {
45
+ // If ts-node is not installed, do not do the following
46
+ const appDevDir = resolve(process.cwd(), './storage/.app-dev');
47
+ if (existsSync(appDevDir)) {
48
+ rmSync(appDevDir, { recursive: true, force: true });
49
+ }
50
+ };
48
51
  const pkg = require('../../package.json');
49
52
  // get latest version
50
- const { stdout } = await run('npm', ['info', '@nocobase/cli', 'version'], { stdio: 'pipe' });
53
+ const { stdout } = await run('npm', ['info', options.next ? '@nocobase/cli@next' : '@nocobase/cli', 'version'], {
54
+ stdio: 'pipe',
55
+ });
51
56
  if (pkg.version === stdout) {
52
57
  await runAppCommand('upgrade');
58
+ rmAppDir();
53
59
  return;
54
60
  }
55
61
  const currentY = 1 * pkg.version.split('.')[1];
56
62
  const latestY = 1 * stdout.split('.')[1];
57
- if (currentY > latestY) {
63
+ if (options.next || currentY > latestY) {
58
64
  await run('yarn', ['add', '@nocobase/cli@next', '@nocobase/devtools@next', '-W']);
59
65
  } else {
60
66
  await run('yarn', ['add', '@nocobase/cli', '@nocobase/devtools', '-W']);
61
67
  }
62
68
  await run('yarn', ['install']);
63
69
  await runAppCommand('upgrade');
70
+ rmAppDir();
64
71
  });
65
72
  };