ui-thing 0.0.12 → 0.0.13

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ui-thing",
3
- "version": "0.0.12",
3
+ "version": "0.0.13",
4
4
  "description": "CLI used to add Nuxt 3 components to a project",
5
5
  "type": "module",
6
6
  "types": "./dist/index.d.ts",
@@ -1,23 +1,19 @@
1
- import ora from "ora";
2
- import prompts from "prompts";
3
-
4
- import { Component } from "../types";
5
- import { fetchComponents } from "./fetchComponents";
6
-
7
- export const promptUserForComponents = async (): Promise<string[]> => {
8
- // get comps from API
9
- const compsSpinner = ora("Fetching components...").start();
10
- const allComponents = await fetchComponents();
11
- compsSpinner.succeed("Fetched components");
12
- const { components } = await prompts({
13
- type: "autocompleteMultiselect",
14
- name: "components",
15
- message: "Select the components you want to add",
16
- choices: allComponents.map((c: Component) => ({ title: c.name, value: c.value })),
17
- onRender(kleur) {
18
- // @ts-ignore
19
- this.msg = kleur.bgCyan(" Choose components ") + " Select the components you want to add";
20
- },
21
- });
22
- return components;
23
- };
1
+ import ora from "ora";
2
+ import prompts from "prompts";
3
+
4
+ import allComponents from "../comps";
5
+ import { Component } from "../types";
6
+
7
+ export const promptUserForComponents = async (): Promise<string[]> => {
8
+ const { components } = await prompts({
9
+ type: "autocompleteMultiselect",
10
+ name: "components",
11
+ message: "Select the components you want to add",
12
+ choices: allComponents.map((c: Component) => ({ title: c.name, value: c.value })),
13
+ onRender(kleur) {
14
+ // @ts-ignore
15
+ this.msg = kleur.bgCyan(" Choose components ") + " Select the components you want to add";
16
+ },
17
+ });
18
+ return components;
19
+ };