ui-thing 0.2.9 → 0.3.0
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/.claude/settings.local.json +5 -0
- package/.prettierrc +1 -1
- package/CHANGELOG.md +32 -0
- package/bun.lock +171 -134
- package/package.json +15 -14
- package/src/commands/add.ts +9 -5
- package/src/commands/block.ts +5 -3
- package/src/commands/list.ts +48 -0
- package/src/commands/prose.ts +7 -3
- package/src/commands/remove.ts +109 -0
- package/src/commands/theme.ts +5 -14
- package/src/commands/update.ts +81 -0
- package/src/index.ts +6 -0
- package/src/utils/config.ts +9 -16
- package/src/utils/constants.ts +1 -0
- package/src/utils/fetchBlockCategories.ts +13 -11
- package/src/utils/fetchBlocks.ts +13 -11
- package/src/utils/fetchComponents.ts +13 -11
- package/src/utils/fetchProseComponents.ts +13 -11
- package/src/utils/installPackages.ts +30 -4
- package/src/utils/installValidator.ts +3 -3
- package/src/utils/logger.ts +9 -0
- package/src/utils/uiConfigPrompt.ts +3 -6
- package/tests/commands/list.test.ts +111 -0
- package/tests/commands/remove.test.ts +151 -0
- package/tests/commands/update.test.ts +127 -0
- package/tests/utils/fetchBlockCategories.test.ts +14 -2
- package/tests/utils/fetchBlocks.test.ts +14 -2
- package/tests/utils/fetchComponents.test.ts +10 -4
- package/tests/utils/fetchProseComponents.test.ts +14 -2
- package/tests/utils/installPackages.test.ts +36 -3
- package/dist/index.d.ts +0 -1
- package/dist/index.js +0 -1348
- package/dist/index.js.map +0 -1
|
@@ -79,15 +79,48 @@ describe("utils/installPackages", () => {
|
|
|
79
79
|
expect(mockExeca).toHaveBeenCalledWith("npm", ["install", "-D", "typescript"]);
|
|
80
80
|
});
|
|
81
81
|
|
|
82
|
-
it("should
|
|
82
|
+
it("should use pnpm add instead of install", async () => {
|
|
83
83
|
const { execa } = await import("execa");
|
|
84
84
|
const mockExeca = vi.mocked(execa);
|
|
85
85
|
mockExeca.mockResolvedValue({} as any);
|
|
86
86
|
|
|
87
87
|
await installPackages("pnpm", ["vue"], ["typescript"]);
|
|
88
88
|
|
|
89
|
-
expect(mockExeca).toHaveBeenCalledWith("pnpm", ["
|
|
90
|
-
expect(mockExeca).toHaveBeenCalledWith("pnpm", ["
|
|
89
|
+
expect(mockExeca).toHaveBeenCalledWith("pnpm", ["add", "vue"]);
|
|
90
|
+
expect(mockExeca).toHaveBeenCalledWith("pnpm", ["add", "-D", "typescript"]);
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
it("should use bun add instead of install", async () => {
|
|
94
|
+
const { execa } = await import("execa");
|
|
95
|
+
const mockExeca = vi.mocked(execa);
|
|
96
|
+
mockExeca.mockResolvedValue({} as any);
|
|
97
|
+
|
|
98
|
+
await installPackages("bun", ["vue"], ["typescript"]);
|
|
99
|
+
|
|
100
|
+
expect(mockExeca).toHaveBeenCalledWith("bun", ["add", "vue"]);
|
|
101
|
+
expect(mockExeca).toHaveBeenCalledWith("bun", ["add", "-D", "typescript"]);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it("should use deno add with npm: prefix", async () => {
|
|
105
|
+
const { execa } = await import("execa");
|
|
106
|
+
const mockExeca = vi.mocked(execa);
|
|
107
|
+
mockExeca.mockResolvedValue({} as any);
|
|
108
|
+
|
|
109
|
+
await installPackages("deno", ["vue"], ["typescript"]);
|
|
110
|
+
|
|
111
|
+
expect(mockExeca).toHaveBeenCalledWith("deno", ["add", "npm:vue"]);
|
|
112
|
+
expect(mockExeca).toHaveBeenCalledWith("deno", ["add", "--dev", "npm:typescript"]);
|
|
113
|
+
expect(mockExeca).toHaveBeenCalledWith("deno", ["run", "-A", "npm:nuxt", "prepare"]);
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
it("should not double-prefix packages already starting with npm:", async () => {
|
|
117
|
+
const { execa } = await import("execa");
|
|
118
|
+
const mockExeca = vi.mocked(execa);
|
|
119
|
+
mockExeca.mockResolvedValue({} as any);
|
|
120
|
+
|
|
121
|
+
await installPackages("deno", ["npm:vue"]);
|
|
122
|
+
|
|
123
|
+
expect(mockExeca).toHaveBeenCalledWith("deno", ["add", "npm:vue"]);
|
|
91
124
|
});
|
|
92
125
|
|
|
93
126
|
it("should run nuxt prepare after installation", async () => {
|
package/dist/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|