@itbox/cli 0.0.2 → 0.0.3

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/bin/index.js +4 -1
  2. package/package.json +1 -1
package/bin/index.js CHANGED
@@ -6,8 +6,11 @@ import path from 'path';
6
6
  import ora from 'ora';
7
7
  import { execSync } from 'child_process';
8
8
  import os from 'os';
9
+ import { fileURLToPath } from 'url';
9
10
 
10
11
  const { prompt } = inquirer;
12
+ const __filename = fileURLToPath(import.meta.url);
13
+ const __dirname = path.dirname(__filename);
11
14
 
12
15
  // 配置文件相关
13
16
  const CONFIG_DIR = path.join(os.homedir(), '.fe-cli');
@@ -117,7 +120,7 @@ function checkTemplateRepoConfig() {
117
120
  }
118
121
 
119
122
  // 从package.json获取项目信息
120
- const packagePath = path.resolve(path.dirname(new URL(import.meta.url).pathname), '../package.json');
123
+ const packagePath = path.resolve(__dirname, '../package.json');
121
124
  const packageInfo = fs.readJSONSync(packagePath);
122
125
 
123
126
  // 命令行配置
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itbox/cli",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
4
4
  "description": "前端项目模板生成工具,支持Vue、Vue+TypeScript、Nuxt、Nest等模板",
5
5
  "type": "module",
6
6
  "main": "bin/index.js",