@nocobase/cli 2.0.0-alpha.2 → 2.0.0-alpha.21

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": "2.0.0-alpha.2",
3
+ "version": "2.0.0-alpha.21",
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": "2.0.0-alpha.2",
11
+ "@nocobase/app": "2.0.0-alpha.21",
12
12
  "@nocobase/license-kit": "^0.2.17",
13
13
  "@types/fs-extra": "^11.0.1",
14
14
  "@umijs/utils": "3.5.20",
@@ -27,12 +27,12 @@
27
27
  "tsx": "^4.19.0"
28
28
  },
29
29
  "devDependencies": {
30
- "@nocobase/devtools": "2.0.0-alpha.2"
30
+ "@nocobase/devtools": "2.0.0-alpha.21"
31
31
  },
32
32
  "repository": {
33
33
  "type": "git",
34
34
  "url": "git+https://github.com/nocobase/nocobase.git",
35
35
  "directory": "packages/core/cli"
36
36
  },
37
- "gitHead": "1322f486b248bef53ed8c8f42f0a39dfd02125fd"
37
+ "gitHead": "0398c85e979d09e834952e71c5c1a1ccf1a3a8e1"
38
38
  }
@@ -93,10 +93,18 @@ class Package {
93
93
  if (await fs.exists(file)) {
94
94
  return true;
95
95
  }
96
- file = path.resolve(process.cwd(), 'node_modules', this.packageName, 'package.json');
97
- if (await fs.exists(file)) {
98
- console.log(chalk.yellowBright(`Skipped: ${this.packageName} is in node_modules`));
99
- return true;
96
+ return false;
97
+ }
98
+
99
+ async isDepPackage() {
100
+ const pkg1 = path.resolve(process.cwd(), 'node_modules', this.packageName, 'package.json');
101
+ const pkg2 = path.resolve(process.cwd(), process.env.PLUGIN_STORAGE_PATH, this.packageName, 'package.json');
102
+ if ((await fs.exists(pkg1)) && (await fs.exists(pkg2))) {
103
+ const readPath1 = fs.realpathSync(pkg1);
104
+ const readPath2 = fs.realpathSync(pkg2);
105
+ if (readPath1 !== readPath2) {
106
+ return true;
107
+ }
100
108
  }
101
109
  return false;
102
110
  }
@@ -117,6 +125,10 @@ class Package {
117
125
  console.log(chalk.yellowBright(`Skipped: ${this.packageName} is dev package`));
118
126
  return;
119
127
  }
128
+ if (await this.isDepPackage()) {
129
+ console.log(chalk.yellowBright(`Skipped: ${this.packageName} is dependency package`));
130
+ return;
131
+ }
120
132
  if (await this.isDownloaded(options.version)) {
121
133
  return;
122
134
  }
@@ -54,7 +54,7 @@ function addTestCommand(name, cli) {
54
54
  const first = paths?.[0];
55
55
  if (!process.env.TEST_ENV && first) {
56
56
  const key = first.split(path.sep).join('/');
57
- if (key.includes('/client/') || key.includes('/flow-engine/')) {
57
+ if (key.includes('/client/') || key.includes('/client-v2/') || key.includes('/flow-engine/')) {
58
58
  process.env.TEST_ENV = 'client-side';
59
59
  } else {
60
60
  process.env.TEST_ENV = 'server-side';