vona-cli 1.0.373 → 1.0.375

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 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
- checkPnpm().then(() => {
9
- main();
10
- });
9
+ main();
11
10
  async function checkPnpm() {
12
11
  const res = await processHelper.spawnCmd({
13
12
  cmd: 'pnpm',
@@ -24,20 +23,23 @@ async function checkPnpm() {
24
23
  throw new Error(`pnpm should >= ${pnpm_version}, current: ${version}`);
25
24
  }
26
25
  }
27
- function main() {
26
+ async function main() {
28
27
  let args = [];
29
28
  // bootstrapFile
30
29
  let bootstrapFile = path.join(import.meta.dirname, '../bootstrap.ts');
31
30
  if (!fse.existsSync(bootstrapFile)) {
32
31
  bootstrapFile = path.join(import.meta.dirname, '../bootstrap.js');
33
32
  }
34
- args.push(bootstrapFile);
35
33
  const rawArgv = process.argv.slice(2);
36
- if (rawArgv[0] === 'play') {
34
+ const isPlay = rawArgv[0] === 'play';
35
+ if (isPlay) {
37
36
  args = args.concat([':bin:play']).concat(rawArgv.slice(1)).concat(['--dummy']);
37
+ const command = new VonaCommand(args, true);
38
+ await command.start();
39
+ return;
38
40
  }
39
- else {
40
- args = args.concat(rawArgv);
41
- }
41
+ args.push(bootstrapFile);
42
+ args = args.concat(rawArgv);
43
+ await checkPnpm();
42
44
  processHelper.spawnCmd({ cmd: 'tsx', args });
43
45
  }
package/dist/start.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { CabloyCommand } from '@cabloy/cli';
2
2
  export declare class VonaCommand extends CabloyCommand {
3
- constructor(rawArgv?: any);
3
+ constructor(rawArgv?: any[], disableVersion?: boolean);
4
4
  private _extractPackageVersion;
5
5
  }
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
- this.version = this._extractPackageVersion();
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.373",
4
+ "version": "1.0.375",
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.60",
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.373"
36
+ "vona-cli-set-api": "^1.0.375"
37
37
  },
38
38
  "gitHead": "0eab9dc4a5622caffe89e7b1b3f02c08ccbc4c4b",
39
39
  "scripts": {