vona-cli 1.0.251 → 1.0.253

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.
Files changed (2) hide show
  1. package/dist/bin/vona.js +32 -9
  2. package/package.json +5 -4
package/dist/bin/vona.js CHANGED
@@ -2,14 +2,37 @@
2
2
  import path from 'node:path';
3
3
  import { ProcessHelper } from '@cabloy/process-helper';
4
4
  import fse from 'fs-extra';
5
+ import semver from 'semver';
6
+ const pnpm_version = '10.19.0';
5
7
  const processHelper = new ProcessHelper(process.cwd());
6
- let args = [];
7
- // bootstrapFile
8
- let bootstrapFile = path.join(import.meta.dirname, '../bootstrap.ts');
9
- if (!fse.existsSync(bootstrapFile)) {
10
- bootstrapFile = path.join(import.meta.dirname, '../bootstrap.js');
8
+ checkPnpm().then(() => {
9
+ main();
10
+ });
11
+ async function checkPnpm() {
12
+ const res = await processHelper.spawnCmd({
13
+ cmd: 'pnpm',
14
+ args: ['--version'],
15
+ options: {
16
+ stdio: 'pipe',
17
+ shell: true,
18
+ silent: true,
19
+ },
20
+ });
21
+ const version = res.trimEnd();
22
+ const lt = semver.lt(version, pnpm_version);
23
+ if (lt) {
24
+ throw new Error(`pnpm should >= ${pnpm_version}, current: ${version}`);
25
+ }
26
+ }
27
+ function main() {
28
+ let args = [];
29
+ // bootstrapFile
30
+ let bootstrapFile = path.join(import.meta.dirname, '../bootstrap.ts');
31
+ if (!fse.existsSync(bootstrapFile)) {
32
+ bootstrapFile = path.join(import.meta.dirname, '../bootstrap.js');
33
+ }
34
+ args.push(bootstrapFile);
35
+ const rawArgv = process.argv.slice(2);
36
+ args = args.concat(rawArgv);
37
+ processHelper.spawnCmd({ cmd: 'tsx', args });
11
38
  }
12
- args.push(bootstrapFile);
13
- const rawArgv = process.argv.slice(2);
14
- args = args.concat(rawArgv);
15
- processHelper.spawnCmd({ cmd: 'tsx', args });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "vona-cli",
3
3
  "type": "module",
4
- "version": "1.0.251",
4
+ "version": "1.0.253",
5
5
  "description": "vona cli",
6
6
  "publishConfig": {
7
7
  "access": "public"
@@ -29,10 +29,11 @@
29
29
  "dist"
30
30
  ],
31
31
  "dependencies": {
32
- "@cabloy/cli": "^3.0.48",
33
- "@cabloy/process-helper": "^2.0.19",
32
+ "@cabloy/cli": "^3.0.49",
33
+ "@cabloy/process-helper": "^2.0.20",
34
34
  "fs-extra": "^11.2.0",
35
- "vona-cli-set-api": "^1.0.253"
35
+ "semver": "^7.6.2",
36
+ "vona-cli-set-api": "^1.0.254"
36
37
  },
37
38
  "gitHead": "0eab9dc4a5622caffe89e7b1b3f02c08ccbc4c4b",
38
39
  "scripts": {