@nocobase/cli 1.9.0-beta.8 → 1.9.0
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 +4 -4
- package/src/commands/perf.js +2 -2
- package/src/commands/pkg.js +17 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nocobase/cli",
|
|
3
|
-
"version": "1.9.0
|
|
3
|
+
"version": "1.9.0",
|
|
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.9.0
|
|
11
|
+
"@nocobase/app": "1.9.0",
|
|
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": "1.9.0
|
|
30
|
+
"@nocobase/devtools": "1.9.0"
|
|
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": "
|
|
37
|
+
"gitHead": "d92ce9096c2b3b5a8f205ecc0e1dedd64d7ee48b"
|
|
38
38
|
}
|
package/src/commands/perf.js
CHANGED
|
@@ -53,8 +53,8 @@ module.exports = (cli) => {
|
|
|
53
53
|
dotenv.config({ path: envFilePath, override: true });
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
if (!process.env.
|
|
57
|
-
throw new Error('Please set
|
|
56
|
+
if (!process.env.TARGET_ORIGIN) {
|
|
57
|
+
throw new Error('Please set TARGET_ORIGIN in environment variables or in .env.perf file');
|
|
58
58
|
}
|
|
59
59
|
const args = command.args.filter((arg) => arg !== file);
|
|
60
60
|
await run(`k6`, ['run', f, ...(args.length ? ['--', ...args] : [])]);
|
package/src/commands/pkg.js
CHANGED
|
@@ -96,6 +96,19 @@ class Package {
|
|
|
96
96
|
return false;
|
|
97
97
|
}
|
|
98
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
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
|
|
99
112
|
async isDownloaded(version) {
|
|
100
113
|
const packageFile = path.resolve(process.env.PLUGIN_STORAGE_PATH, this.packageName, 'package.json');
|
|
101
114
|
if (await fs.exists(packageFile)) {
|
|
@@ -112,6 +125,10 @@ class Package {
|
|
|
112
125
|
console.log(chalk.yellowBright(`Skipped: ${this.packageName} is dev package`));
|
|
113
126
|
return;
|
|
114
127
|
}
|
|
128
|
+
if (await this.isDepPackage()) {
|
|
129
|
+
console.log(chalk.yellowBright(`Skipped: ${this.packageName} is dependency package`));
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
115
132
|
if (await this.isDownloaded(options.version)) {
|
|
116
133
|
return;
|
|
117
134
|
}
|