v-uixy 1.1.0 → 1.1.2
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/bin/v-uixy.js +10 -1
- package/commands/add.js +0 -1
- package/package.json +1 -1
package/bin/v-uixy.js
CHANGED
|
@@ -1,17 +1,26 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
+
import { createRequire } from "module";
|
|
3
4
|
import { Command } from "commander";
|
|
4
5
|
import add from "../commands/add.js";
|
|
5
6
|
import remove from "../commands/remove.js";
|
|
6
7
|
import list from "../commands/list.js";
|
|
7
8
|
import init from "../commands/init.js";
|
|
8
9
|
|
|
10
|
+
const require = createRequire(import.meta.url);
|
|
11
|
+
|
|
12
|
+
let pkgVersion = "0.0.0";
|
|
13
|
+
try {
|
|
14
|
+
const pkg = require("../package.json");
|
|
15
|
+
pkgVersion = pkg.version || pkgVersion;
|
|
16
|
+
} catch {}
|
|
17
|
+
|
|
9
18
|
const program = new Command();
|
|
10
19
|
|
|
11
20
|
program
|
|
12
21
|
.name("v-uixy")
|
|
13
22
|
.description("A UI components CLI for Nuxt + Tailwind")
|
|
14
|
-
.version(
|
|
23
|
+
.version(pkgVersion);
|
|
15
24
|
|
|
16
25
|
program.command("add <component>").description("Add a component").action(add);
|
|
17
26
|
|
package/commands/add.js
CHANGED
|
@@ -97,7 +97,6 @@ async function updateIndex(newComponents) {
|
|
|
97
97
|
const existing = await getExistingIndexComponents();
|
|
98
98
|
const existingSet = new Set(existing);
|
|
99
99
|
|
|
100
|
-
// Preserve existing order; append new components in the order provided
|
|
101
100
|
const merged = [...existing];
|
|
102
101
|
for (const name of newComponents) {
|
|
103
102
|
if (!existingSet.has(name)) {
|