vona-cli 1.0.373 → 1.0.376
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/dist/bin/vona.js +23 -8
- package/dist/start.d.ts +1 -1
- package/dist/start.js +4 -2
- package/package.json +3 -3
package/dist/bin/vona.js
CHANGED
|
@@ -3,11 +3,10 @@ import path from 'node:path';
|
|
|
3
3
|
import { ProcessHelper } from '@cabloy/process-helper';
|
|
4
4
|
import fse from 'fs-extra';
|
|
5
5
|
import semver from 'semver';
|
|
6
|
+
import { VonaCommand } from "../start.js";
|
|
6
7
|
const pnpm_version = '10.19.0';
|
|
7
8
|
const processHelper = new ProcessHelper(process.cwd());
|
|
8
|
-
|
|
9
|
-
main();
|
|
10
|
-
});
|
|
9
|
+
main();
|
|
11
10
|
async function checkPnpm() {
|
|
12
11
|
const res = await processHelper.spawnCmd({
|
|
13
12
|
cmd: 'pnpm',
|
|
@@ -24,20 +23,36 @@ async function checkPnpm() {
|
|
|
24
23
|
throw new Error(`pnpm should >= ${pnpm_version}, current: ${version}`);
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
|
-
function main() {
|
|
28
|
-
let args = [];
|
|
26
|
+
async function main() {
|
|
29
27
|
// bootstrapFile
|
|
30
28
|
let bootstrapFile = path.join(import.meta.dirname, '../bootstrap.ts');
|
|
31
29
|
if (!fse.existsSync(bootstrapFile)) {
|
|
32
30
|
bootstrapFile = path.join(import.meta.dirname, '../bootstrap.js');
|
|
33
31
|
}
|
|
34
|
-
args
|
|
32
|
+
// args
|
|
33
|
+
let args = [];
|
|
35
34
|
const rawArgv = process.argv.slice(2);
|
|
36
|
-
|
|
35
|
+
const isPlay = rawArgv[0] === 'play';
|
|
36
|
+
const isPlayAttach = isPlay && (rawArgv.includes('-a') || rawArgv.includes('--attach'));
|
|
37
|
+
if (isPlay) {
|
|
38
|
+
if (!isPlayAttach) {
|
|
39
|
+
args.push(bootstrapFile);
|
|
40
|
+
}
|
|
37
41
|
args = args.concat([':bin:play']).concat(rawArgv.slice(1)).concat(['--dummy']);
|
|
38
42
|
}
|
|
39
43
|
else {
|
|
44
|
+
args.push(bootstrapFile);
|
|
40
45
|
args = args.concat(rawArgv);
|
|
41
46
|
}
|
|
42
|
-
|
|
47
|
+
// run
|
|
48
|
+
if (isPlayAttach) {
|
|
49
|
+
const command = new VonaCommand(args, true);
|
|
50
|
+
await command.start();
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
if (!isPlay) {
|
|
54
|
+
await checkPnpm();
|
|
55
|
+
}
|
|
56
|
+
processHelper.spawnCmd({ cmd: 'tsx', args });
|
|
57
|
+
}
|
|
43
58
|
}
|
package/dist/start.d.ts
CHANGED
package/dist/start.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';
|
|
2
2
|
import { CabloyCommand } from '@cabloy/cli';
|
|
3
3
|
export class VonaCommand extends CabloyCommand {
|
|
4
|
-
constructor(rawArgv) {
|
|
4
|
+
constructor(rawArgv, disableVersion) {
|
|
5
5
|
super('vona', rawArgv);
|
|
6
|
-
|
|
6
|
+
if (!disableVersion) {
|
|
7
|
+
this.version = this._extractPackageVersion();
|
|
8
|
+
}
|
|
7
9
|
}
|
|
8
10
|
_extractPackageVersion() {
|
|
9
11
|
const require = createRequire(import.meta.url);
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vona-cli",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.376",
|
|
5
5
|
"description": "vona cli",
|
|
6
6
|
"publishConfig": {
|
|
7
7
|
"access": "public"
|
|
@@ -29,11 +29,11 @@
|
|
|
29
29
|
"dist"
|
|
30
30
|
],
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@cabloy/cli": "^3.0.
|
|
32
|
+
"@cabloy/cli": "^3.0.61",
|
|
33
33
|
"@cabloy/process-helper": "^2.0.21",
|
|
34
34
|
"fs-extra": "^11.2.0",
|
|
35
35
|
"semver": "^7.6.2",
|
|
36
|
-
"vona-cli-set-api": "^1.0.
|
|
36
|
+
"vona-cli-set-api": "^1.0.375"
|
|
37
37
|
},
|
|
38
38
|
"gitHead": "0eab9dc4a5622caffe89e7b1b3f02c08ccbc4c4b",
|
|
39
39
|
"scripts": {
|