ui-thing 0.2.5 → 0.2.6

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.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "CLI used to add Nuxt components to a project",
5
5
  "keywords": [
6
6
  "cli",
@@ -50,42 +50,42 @@
50
50
  ]
51
51
  },
52
52
  "dependencies": {
53
- "axios": "^1.11.0",
53
+ "axios": "^1.13.1",
54
54
  "boxen": "^8.0.1",
55
- "c12": "^3.2.0",
56
- "commander": "^14.0.0",
55
+ "c12": "^3.3.1",
56
+ "commander": "^14.0.2",
57
57
  "consola": "^3.4.2",
58
- "dotenv": "^17.2.2",
59
- "es-toolkit": "^1.39.10",
58
+ "dotenv": "^17.2.3",
59
+ "es-toolkit": "^1.41.0",
60
60
  "execa": "^9.6.0",
61
- "figlet": "^1.8.2",
62
- "fs-extra": "^11.3.1",
61
+ "figlet": "^1.9.3",
62
+ "fs-extra": "^11.3.2",
63
63
  "kleur": "^4.1.5",
64
64
  "lodash": "^4.17.21",
65
65
  "magicast": "^0.3.5",
66
- "ora": "^8.2.0",
66
+ "ora": "^9.0.0",
67
67
  "prompts": "^2.4.2"
68
68
  },
69
69
  "devDependencies": {
70
- "@eslint/js": "^9.35.0",
70
+ "@eslint/js": "^9.38.0",
71
71
  "@ianvs/prettier-plugin-sort-imports": "^4.7.0",
72
72
  "@types/figlet": "^1.7.0",
73
73
  "@types/fs-extra": "^11.0.4",
74
74
  "@types/lodash": "^4.17.20",
75
- "@types/node": "^24.3.1",
75
+ "@types/node": "^24.9.2",
76
76
  "@types/prompts": "^2.4.9",
77
- "@vitest/coverage-v8": "^3.2.4",
78
- "eslint": "^9.35.0",
79
- "globals": "^16.3.0",
77
+ "@vitest/coverage-v8": "^4.0.5",
78
+ "eslint": "^9.38.0",
79
+ "globals": "^16.4.0",
80
80
  "husky": "^9.1.7",
81
- "jiti": "^2.5.1",
82
- "knip": "^5.63.1",
83
- "lint-staged": "^16.1.6",
81
+ "jiti": "^2.6.1",
82
+ "knip": "^5.66.4",
83
+ "lint-staged": "^16.2.6",
84
84
  "prettier": "^3.6.2",
85
85
  "tsup": "^8.5.0",
86
- "typescript": "^5.9.2",
87
- "typescript-eslint": "^8.42.0",
88
- "vitest": "^3.2.4"
86
+ "typescript": "^5.9.3",
87
+ "typescript-eslint": "^8.46.2",
88
+ "vitest": "^4.0.5"
89
89
  },
90
90
  "publishConfig": {
91
91
  "access": "public"
@@ -8,11 +8,11 @@ import ora from "ora";
8
8
  import { createCSS } from "../templates/css";
9
9
  import { TW_HELPER } from "../templates/tw-helper";
10
10
  import { InitOptions, UIConfig } from "../types";
11
- import { addPrettierConfig } from "../utils/addPrettierConfig";
11
+ import { addPrettierConfig, askPrettierConfig } from "../utils/addPrettierConfig";
12
12
  import { addTailwindVitePlugin } from "../utils/addTailwindVitePlugin";
13
13
  import { addVSCodeFiles } from "../utils/addVSCodeFiles";
14
14
  import { getUIConfig } from "../utils/config";
15
- import { INIT_DEPS, INIT_DEV_DEPS, INIT_MODULES } from "../utils/constants";
15
+ import { INIT_DEPS, INIT_DEV_DEPS, INIT_DEV_DEPS_PRETTIER, INIT_MODULES } from "../utils/constants";
16
16
  import { installPackages } from "../utils/installPackages";
17
17
  import { printFancyBoxMessage } from "../utils/printFancyBoxMessage";
18
18
 
@@ -103,8 +103,12 @@ const runInitCommand = async (options: InitOptions) => {
103
103
  spinner.succeed("Merged VS Code settings!");
104
104
  // Install deps
105
105
  await installPackages(uiConfig.packageManager, INIT_DEPS, INIT_DEV_DEPS);
106
- // Add prettier config
107
- await addPrettierConfig();
106
+ // Add prettier config if user agrees
107
+ const addPrettier = await askPrettierConfig();
108
+ if (addPrettier) {
109
+ await installPackages(uiConfig.packageManager, [], INIT_DEV_DEPS_PRETTIER);
110
+ await addPrettierConfig();
111
+ }
108
112
  printFancyBoxMessage(
109
113
  "Initialized",
110
114
  `Feel free to start adding components with the ${kleur.bgWhite(" add ")} command.`,
@@ -2,7 +2,7 @@ import { Command } from "commander";
2
2
  import prompts from "prompts";
3
3
 
4
4
  import { addPrettierConfig } from "../utils/addPrettierConfig";
5
- import { PACKAGE_MANAGER_CHOICES } from "../utils/constants";
5
+ import { INIT_DEV_DEPS_PRETTIER, PACKAGE_MANAGER_CHOICES } from "../utils/constants";
6
6
  import { installPackages } from "../utils/installPackages";
7
7
  import { printFancyBoxMessage } from "../utils/printFancyBoxMessage";
8
8
 
@@ -28,11 +28,7 @@ export const addPrettier = new Command()
28
28
  if (!pkgManager) return process.exit(0);
29
29
 
30
30
  // install prettier dep
31
- await installPackages(pkgManager, undefined, [
32
- "prettier",
33
- "prettier-plugin-tailwindcss",
34
- "@ianvs/prettier-plugin-sort-imports",
35
- ]);
31
+ await installPackages(pkgManager, undefined, INIT_DEV_DEPS_PRETTIER);
36
32
  printFancyBoxMessage(
37
33
  "All Done!",
38
34
  `A .prettierrc file has been added to your project and the code formatted. Enjoy!`,
@@ -67,3 +67,16 @@ export const addPrettierConfig = async (cwd = process.cwd(), format: boolean = t
67
67
 
68
68
  return true;
69
69
  };
70
+
71
+ /**
72
+ * Asks the user if they want to add a Prettier configuration.
73
+ */
74
+ export const askPrettierConfig = async (): Promise<boolean> => {
75
+ const { addPrettier } = await prompts({
76
+ name: "addPrettier",
77
+ type: "confirm",
78
+ message: "Would you like to add a Prettier configuration to your project?",
79
+ initial: true,
80
+ });
81
+ return addPrettier;
82
+ };
@@ -58,12 +58,14 @@ export const INIT_DEPS = [
58
58
  /**
59
59
  * The initial development dependencies
60
60
  */
61
- export const INIT_DEV_DEPS = [
62
- "typescript",
61
+ export const INIT_DEV_DEPS = ["typescript", "tw-animate-css"];
62
+ /**
63
+ * The initial development dependencies for prettier stuff
64
+ */
65
+ export const INIT_DEV_DEPS_PRETTIER = [
63
66
  "prettier-plugin-tailwindcss",
64
67
  "prettier",
65
68
  "@ianvs/prettier-plugin-sort-imports",
66
- "tw-animate-css",
67
69
  ];
68
70
 
69
71
  /**