vite-shadcn-ui-cli 1.0.4 → 1.0.5
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/{index.cjs → index.js} +12 -8
- package/package.json +4 -3
package/{index.cjs → index.js}
RENAMED
@@ -1,14 +1,18 @@
|
|
1
1
|
#!/usr/bin/env node
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
2
|
+
import { execSync } from 'child_process';
|
3
|
+
import simpleGit from 'simple-git';
|
4
|
+
import { Command } from 'commander';
|
5
|
+
import chalk from 'chalk';
|
6
|
+
import ora from 'ora';
|
7
|
+
import path from 'path';
|
8
|
+
import fs from 'fs';
|
9
|
+
import { createRequire } from 'module';
|
10
|
+
|
11
|
+
// 因为 ES 模块中无法直接使用 require,使用 createRequire 读取 package.json
|
12
|
+
const require = createRequire(import.meta.url);
|
10
13
|
const { version } = require('./package.json');
|
11
14
|
|
15
|
+
// 初始化 Commander
|
12
16
|
const program = new Command();
|
13
17
|
const git = simpleGit();
|
14
18
|
|
package/package.json
CHANGED
@@ -1,11 +1,12 @@
|
|
1
1
|
{
|
2
2
|
"name": "vite-shadcn-ui-cli",
|
3
|
-
"version": "1.0.
|
3
|
+
"version": "1.0.5",
|
4
4
|
"description": "A CLI tool to bootstrap Vite projects with shadcn UI components",
|
5
|
-
"main": "index.
|
5
|
+
"main": "index.js",
|
6
6
|
"bin": {
|
7
|
-
"create-vite-shadcn-ui": "./index.
|
7
|
+
"create-vite-shadcn-ui": "./index.js"
|
8
8
|
},
|
9
|
+
"type":"module",
|
9
10
|
"scripts": {
|
10
11
|
"dev": "vite",
|
11
12
|
"build": "tsc -b && vite build",
|