sigma-ui 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.
@@ -5,7 +5,7 @@
5
5
  "files": [
6
6
  {
7
7
  "name": "Infusion.vue",
8
- "content": "<script setup lang=\"ts\">\nimport { computed, type CSSProperties } from 'vue';\n\ninterface Props {\n src: string;\n opacity?: number;\n opacityDark?: number;\n zIndex?: number;\n blur?: number;\n noiseIntensity?: number;\n noiseScale?: number;\n noiseOpacity?: number;\n blendMode?: CSSProperties['mixBlendMode'];\n relative?: boolean;\n type?: 'image' | 'video';\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n src: '',\n opacity: 0.2,\n opacityDark: 0.3,\n zIndex: 100,\n blur: 64,\n noiseIntensity: 0.5,\n noiseScale: 1,\n noiseOpacity: 0.05,\n blendMode: 'normal',\n relative: false,\n type: 'image',\n});\n\nconst imageStyle = computed(() => ({\n '--infusion-opacity': props.opacity,\n '--infusion-opacity-dark': props.opacityDark,\n '--infusion-z-index': props.zIndex,\n '--infusion-blur': `${props.blur}px`,\n '--infusion-noise-intensity': props.noiseIntensity,\n '--infusion-noise-scale': props.noiseScale,\n '--infusion-noise-opacity': props.noiseOpacity,\n 'mixBlendMode': props.blendMode,\n}));\n\nconst noiseDataUrl = computed(() => {\n if (props.noiseIntensity === 0) {\n return '';\n }\n\n const canvas = document.createElement('canvas');\n canvas.width = 256;\n canvas.height = 256;\n const context = canvas.getContext('2d');\n\n if (!context) {\n return '';\n }\n\n const imageData = context.createImageData(canvas.width, canvas.height);\n const data = imageData.data;\n\n for (let index = 0; index < data.length; index += 4) {\n const value = Math.random() * 255;\n data[index] = value;\n data[index + 1] = value;\n data[index + 2] = value;\n data[index + 3] = props.noiseIntensity * 255;\n }\n\n context.putImageData(imageData, 0, 0);\n return canvas.toDataURL();\n});\n\nconst containerClass = computed(() => [\n 'infusion-container',\n {\n 'infusion-container--relative': props.relative,\n },\n]);\n</script>\n\n<template>\n <div\n :class=\"containerClass\"\n :style=\"imageStyle\"\n >\n <img\n v-if=\"props.type === 'image'\"\n class=\"infusion-image\"\n :src=\"props.src\"\n alt=\"\"\n >\n <video\n v-if=\"props.type === 'video'\"\n class=\"infusion-video\"\n :src=\"props.src\"\n autoplay\n loop\n muted\n playsinline\n alt=\"\"\n />\n <div\n v-if=\"noiseIntensity > 0\"\n class=\"infusion-noise\"\n :style=\"{ backgroundImage: `url(${noiseDataUrl})` }\"\n />\n </div>\n</template>\n\n<style scoped>\n.infusion-container {\n position: fixed;\n z-index: var(--infusion-z-index);\n top: 0;\n left: 0;\n overflow: hidden;\n width: 100vw;\n height: 100vh;\n pointer-events: none;\n}\n\n.infusion-container--relative {\n position: absolute;\n z-index: var(--infusion-z-index);\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n}\n\n.infusion-image {\n width: 100%;\n height: 100%;\n filter: blur(var(--infusion-blur));\n object-fit: cover;\n opacity: var(--infusion-opacity);\n transform: scale(1.1)\n}\n\n.dark .infusion-image {\n opacity: var(--infusion-opacity-dark);\n}\n\n.infusion-video {\n width: 100%;\n height: 100%;\n filter: blur(var(--infusion-blur));\n object-fit: cover;\n opacity: var(--infusion-opacity);\n transform: scale(1.1)\n}\n\n.dark .infusion-video {\n opacity: var(--infusion-opacity-dark);\n}\n\n.infusion-noise {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-repeat: repeat;\n background-size: calc(256px * var(--infusion-noise-scale));\n mix-blend-mode: overlay;\n opacity: var(--infusion-noise-opacity);\n}\n</style>\n"
8
+ "content": "<script setup lang=\"ts\">\nimport { computed, type CSSProperties } from 'vue';\n\ninterface Props {\n src: string;\n opacity?: number;\n opacityDark?: number;\n zIndex?: number;\n blur?: number;\n noiseIntensity?: number;\n noiseScale?: number;\n noiseOpacity?: number;\n blendMode?: CSSProperties['mixBlendMode'];\n relative?: boolean;\n type?: 'image' | 'video';\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n src: '',\n opacity: 0.2,\n opacityDark: 0.3,\n zIndex: 100,\n blur: 64,\n noiseIntensity: 0.5,\n noiseScale: 1,\n noiseOpacity: 0.05,\n blendMode: 'normal',\n relative: false,\n type: 'image',\n});\n\nconst imageStyle = computed(() => ({\n '--infusion-opacity': props.opacity,\n '--infusion-opacity-dark': props.opacityDark,\n '--infusion-z-index': props.zIndex,\n '--infusion-blur': `${props.blur}px`,\n '--infusion-noise-intensity': props.noiseIntensity,\n '--infusion-noise-scale': props.noiseScale,\n '--infusion-noise-opacity': props.noiseOpacity,\n 'mixBlendMode': props.blendMode,\n}));\n\nconst noiseDataUrl = computed(() => {\n if (props.noiseIntensity === 0) {\n return '';\n }\n\n if (typeof document === 'undefined') {\n return '';\n }\n\n const canvas = document.createElement('canvas');\n canvas.width = 256;\n canvas.height = 256;\n const context = canvas.getContext('2d');\n\n if (!context) {\n return '';\n }\n\n const imageData = context.createImageData(canvas.width, canvas.height);\n const data = imageData.data;\n\n for (let index = 0; index < data.length; index += 4) {\n const value = Math.random() * 255;\n data[index] = value;\n data[index + 1] = value;\n data[index + 2] = value;\n data[index + 3] = props.noiseIntensity * 255;\n }\n\n context.putImageData(imageData, 0, 0);\n return canvas.toDataURL();\n});\n\nconst containerClass = computed(() => [\n 'infusion-container',\n {\n 'infusion-container--relative': props.relative,\n },\n]);\n</script>\n\n<template>\n <div\n :class=\"containerClass\"\n :style=\"imageStyle\"\n >\n <img\n v-if=\"props.type === 'image'\"\n class=\"infusion-image\"\n :src=\"props.src\"\n alt=\"\"\n >\n <video\n v-if=\"props.type === 'video'\"\n class=\"infusion-video\"\n :src=\"props.src\"\n autoplay\n loop\n muted\n playsinline\n alt=\"\"\n />\n <div\n v-if=\"noiseIntensity > 0\"\n class=\"infusion-noise\"\n :style=\"{ backgroundImage: `url(${noiseDataUrl})` }\"\n />\n </div>\n</template>\n\n<style scoped>\n.infusion-container {\n position: fixed;\n z-index: var(--infusion-z-index);\n top: 0;\n left: 0;\n overflow: hidden;\n width: 100vw;\n height: 100vh;\n pointer-events: none;\n}\n\n.infusion-container--relative {\n position: absolute;\n z-index: var(--infusion-z-index);\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n}\n\n.infusion-image {\n width: 100%;\n height: 100%;\n filter: blur(var(--infusion-blur));\n object-fit: cover;\n opacity: var(--infusion-opacity);\n transform: scale(1.1)\n}\n\n.dark .infusion-image {\n opacity: var(--infusion-opacity-dark);\n}\n\n.infusion-video {\n width: 100%;\n height: 100%;\n filter: blur(var(--infusion-blur));\n object-fit: cover;\n opacity: var(--infusion-opacity);\n transform: scale(1.1)\n}\n\n.dark .infusion-video {\n opacity: var(--infusion-opacity-dark);\n}\n\n.infusion-noise {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n background-repeat: repeat;\n background-size: calc(256px * var(--infusion-noise-scale));\n mix-blend-mode: overlay;\n opacity: var(--infusion-noise-opacity);\n}\n</style>\n"
9
9
  },
10
10
  {
11
11
  "name": "index.ts",
@@ -5,7 +5,7 @@
5
5
  "files": [
6
6
  {
7
7
  "name": "Infusion.vue",
8
- "content": "<script setup lang=\"ts\">\nimport { computed, type CSSProperties } from 'vue';\n\ninterface Props {\n src: string;\n opacity?: number;\n opacityDark?: number;\n zIndex?: number;\n blur?: number;\n noiseIntensity?: number;\n noiseScale?: number;\n noiseOpacity?: number;\n blendMode?: CSSProperties['mixBlendMode'];\n relative?: boolean;\n type?: 'image' | 'video';\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n src: '',\n opacity: 0.2,\n opacityDark: 0.3,\n zIndex: 100,\n blur: 64,\n noiseIntensity: 0.5,\n noiseScale: 1,\n noiseOpacity: 0.05,\n blendMode: 'normal',\n relative: false,\n type: 'image',\n});\n\nconst imageStyle = computed(() => ({\n '--infusion-opacity': props.opacity,\n '--infusion-opacity-dark': props.opacityDark,\n '--infusion-z-index': props.zIndex,\n '--infusion-blur': `${props.blur}px`,\n '--infusion-noise-intensity': props.noiseIntensity,\n '--infusion-noise-scale': props.noiseScale,\n '--infusion-noise-opacity': props.noiseOpacity,\n 'mixBlendMode': props.blendMode,\n}));\n\nconst noiseDataUrl = computed(() => {\n if (props.noiseIntensity === 0) {\n return '';\n }\n\n const canvas = document.createElement('canvas');\n canvas.width = 256;\n canvas.height = 256;\n const context = canvas.getContext('2d');\n\n if (!context) {\n return '';\n }\n\n const imageData = context.createImageData(canvas.width, canvas.height);\n const data = imageData.data;\n\n for (let index = 0; index < data.length; index += 4) {\n const value = Math.random() * 255;\n data[index] = value;\n data[index + 1] = value;\n data[index + 2] = value;\n data[index + 3] = props.noiseIntensity * 255;\n }\n\n context.putImageData(imageData, 0, 0);\n return canvas.toDataURL();\n});\n\nconst containerClass = computed(() => [\n 'top-0 left-0 overflow-hidden pointer-events-none z-(--infusion-z-index)',\n props.relative\n ? 'absolute w-full h-full'\n : 'fixed w-screen h-screen',\n]);\n\nconst mediaClass = 'w-full h-full object-cover scale-110 opacity-(--infusion-opacity) dark:opacity-(--infusion-opacity-dark)';\nconst noiseClass = 'absolute top-0 left-0 w-full h-full bg-repeat mix-blend-overlay';\n</script>\n\n<template>\n <div\n :class=\"containerClass\"\n :style=\"imageStyle\"\n >\n <img\n v-if=\"props.type === 'image'\"\n :class=\"mediaClass\"\n :src=\"props.src\"\n :style=\"{\n filter: `blur(var(--infusion-blur))`,\n }\"\n alt=\"\"\n >\n <video\n v-if=\"props.type === 'video'\"\n :class=\"mediaClass\"\n :src=\"props.src\"\n :style=\"{\n filter: `blur(var(--infusion-blur))`,\n }\"\n autoplay\n loop\n muted\n playsinline\n alt=\"\"\n />\n <div\n v-if=\"noiseIntensity > 0\"\n :class=\"noiseClass\"\n :style=\"{\n backgroundImage: `url(${noiseDataUrl})`,\n backgroundSize: 'calc(256px * var(--infusion-noise-scale))',\n opacity: 'var(--infusion-noise-opacity)',\n }\"\n />\n </div>\n</template>\n"
8
+ "content": "<script setup lang=\"ts\">\nimport { computed, type CSSProperties } from 'vue';\n\ninterface Props {\n src: string;\n opacity?: number;\n opacityDark?: number;\n zIndex?: number;\n blur?: number;\n noiseIntensity?: number;\n noiseScale?: number;\n noiseOpacity?: number;\n blendMode?: CSSProperties['mixBlendMode'];\n relative?: boolean;\n type?: 'image' | 'video';\n}\n\nconst props = withDefaults(defineProps<Props>(), {\n src: '',\n opacity: 0.2,\n opacityDark: 0.3,\n zIndex: 100,\n blur: 64,\n noiseIntensity: 0.5,\n noiseScale: 1,\n noiseOpacity: 0.05,\n blendMode: 'normal',\n relative: false,\n type: 'image',\n});\n\nconst imageStyle = computed(() => ({\n '--infusion-opacity': props.opacity,\n '--infusion-opacity-dark': props.opacityDark,\n '--infusion-z-index': props.zIndex,\n '--infusion-blur': `${props.blur}px`,\n '--infusion-noise-intensity': props.noiseIntensity,\n '--infusion-noise-scale': props.noiseScale,\n '--infusion-noise-opacity': props.noiseOpacity,\n 'mixBlendMode': props.blendMode,\n}));\n\nconst noiseDataUrl = computed(() => {\n if (props.noiseIntensity === 0) {\n return '';\n }\n\n if (typeof document === 'undefined') {\n return '';\n }\n\n const canvas = document.createElement('canvas');\n canvas.width = 256;\n canvas.height = 256;\n const context = canvas.getContext('2d');\n\n if (!context) {\n return '';\n }\n\n const imageData = context.createImageData(canvas.width, canvas.height);\n const data = imageData.data;\n\n for (let index = 0; index < data.length; index += 4) {\n const value = Math.random() * 255;\n data[index] = value;\n data[index + 1] = value;\n data[index + 2] = value;\n data[index + 3] = props.noiseIntensity * 255;\n }\n\n context.putImageData(imageData, 0, 0);\n return canvas.toDataURL();\n});\n\nconst containerClass = computed(() => [\n 'top-0 left-0 overflow-hidden pointer-events-none z-(--infusion-z-index)',\n props.relative\n ? 'absolute w-full h-full'\n : 'fixed w-screen h-screen',\n]);\n\nconst mediaClass = 'w-full h-full object-cover scale-110 opacity-(--infusion-opacity) dark:opacity-(--infusion-opacity-dark)';\nconst noiseClass = 'absolute top-0 left-0 w-full h-full bg-repeat mix-blend-overlay';\n</script>\n\n<template>\n <div\n :class=\"containerClass\"\n :style=\"imageStyle\"\n >\n <img\n v-if=\"props.type === 'image'\"\n :class=\"mediaClass\"\n :src=\"props.src\"\n :style=\"{\n filter: `blur(var(--infusion-blur))`,\n }\"\n alt=\"\"\n >\n <video\n v-if=\"props.type === 'video'\"\n :class=\"mediaClass\"\n :src=\"props.src\"\n :style=\"{\n filter: `blur(var(--infusion-blur))`,\n }\"\n autoplay\n loop\n muted\n playsinline\n alt=\"\"\n />\n <div\n v-if=\"noiseIntensity > 0\"\n :class=\"noiseClass\"\n :style=\"{\n backgroundImage: `url(${noiseDataUrl})`,\n backgroundSize: 'calc(256px * var(--infusion-noise-scale))',\n opacity: 'var(--infusion-noise-opacity)',\n }\"\n />\n </div>\n</template>\n"
9
9
  },
10
10
  {
11
11
  "name": "index.ts",
package/dist/index.js CHANGED
@@ -8,22 +8,80 @@ import process6 from "node:process";
8
8
  import { Command as Command4 } from "commander";
9
9
 
10
10
  // src/commands/add.ts
11
- import { execSync } from "node:child_process";
12
- import { existsSync as existsSync2, promises as fs3 } from "node:fs";
11
+ import { existsSync as existsSync3, promises as fs3 } from "node:fs";
13
12
  import process3 from "node:process";
14
- import path4 from "pathe";
13
+ import path5 from "pathe";
15
14
  import { consola as consola3 } from "consola";
16
15
  import { colors as colors2 } from "consola/utils";
17
16
  import { Command } from "commander";
18
17
  import ora from "ora";
19
18
  import prompts from "prompts";
20
19
  import { z as z2 } from "zod";
21
- import { addDependency, addDevDependency, detectPackageManager } from "nypm";
20
+
21
+ // src/utils/package-manager.ts
22
+ import { execSync } from "node:child_process";
23
+ import { existsSync, readFileSync } from "node:fs";
24
+ import path from "pathe";
25
+ async function detectPackageManager(cwd) {
26
+ const lockFiles = [
27
+ { name: "pnpm", files: ["pnpm-lock.yaml", "pnpm-workspace.yaml"] },
28
+ { name: "yarn", files: ["yarn.lock"] },
29
+ { name: "bun", files: ["bun.lockb"] },
30
+ { name: "npm", files: ["package-lock.json"] }
31
+ ];
32
+ for (const pm of lockFiles) {
33
+ for (const file of pm.files) {
34
+ if (existsSync(path.join(cwd, file))) {
35
+ return { name: pm.name };
36
+ }
37
+ }
38
+ }
39
+ try {
40
+ const packageJsonPath = path.join(cwd, "package.json");
41
+ if (existsSync(packageJsonPath)) {
42
+ const packageJson = JSON.parse(readFileSync(packageJsonPath, "utf8"));
43
+ if (packageJson.packageManager) {
44
+ const [name, version] = packageJson.packageManager.split("@");
45
+ return { name, version };
46
+ }
47
+ }
48
+ } catch {
49
+ }
50
+ return { name: "pnpm" };
51
+ }
52
+ async function addDependency(dependencies, options8 = { cwd: process.cwd() }) {
53
+ await installPackages(dependencies, "dependencies", options8);
54
+ }
55
+ async function addDevDependency(dependencies, options8 = { cwd: process.cwd() }) {
56
+ await installPackages(dependencies, "devDependencies", options8);
57
+ }
58
+ async function installPackages(dependencies, type2, options8 = { cwd: process.cwd() }) {
59
+ const pm = await detectPackageManager(options8.cwd);
60
+ const devFlag = type2 === "devDependencies" ? "-D " : "";
61
+ let command = "";
62
+ switch (pm?.name) {
63
+ case "npm":
64
+ command = `npm install ${devFlag}${dependencies.join(" ")}`;
65
+ break;
66
+ case "yarn":
67
+ command = `yarn add ${devFlag}${dependencies.join(" ")}`;
68
+ break;
69
+ case "bun":
70
+ command = `bun add ${devFlag}${dependencies.join(" ")}`;
71
+ break;
72
+ case "pnpm":
73
+ default:
74
+ command = `pnpm add ${devFlag}${dependencies.join(" ")}`;
75
+ break;
76
+ }
77
+ const stdio = options8.silent ? "pipe" : "inherit";
78
+ execSync(command, { cwd: options8.cwd, stdio });
79
+ }
22
80
 
23
81
  // src/utils/transformers/index.ts
24
82
  import { promises as fs } from "node:fs";
25
83
  import { tmpdir } from "node:os";
26
- import path from "pathe";
84
+ import path2 from "pathe";
27
85
  import { Project, ScriptKind } from "ts-morph";
28
86
 
29
87
  // src/utils/transformers/transform-import.ts
@@ -67,8 +125,8 @@ var project = new Project({
67
125
  compilerOptions: {}
68
126
  });
69
127
  async function createTempSourceFile(filename) {
70
- const dir = await fs.mkdtemp(path.join(tmpdir(), "sigma-ui-"));
71
- return path.join(dir, filename);
128
+ const dir = await fs.mkdtemp(path2.join(tmpdir(), "sigma-ui-"));
129
+ return path2.join(dir, filename);
72
130
  }
73
131
  async function transform(opts) {
74
132
  const tempFile = await createTempSourceFile(opts.filename);
@@ -82,9 +140,9 @@ async function transform(opts) {
82
140
  }
83
141
 
84
142
  // src/utils/get-config.ts
85
- import { existsSync } from "node:fs";
143
+ import { existsSync as existsSync2 } from "node:fs";
86
144
  import process2 from "node:process";
87
- import path2 from "pathe";
145
+ import path3 from "pathe";
88
146
  import { loadConfig as c12LoadConfig } from "c12";
89
147
  import { loadConfig } from "tsconfig-paths";
90
148
  import consola from "consola";
@@ -238,14 +296,14 @@ async function handleConfigIsMissing() {
238
296
  }
239
297
  async function resolveConfigPaths(cwd, config) {
240
298
  let tsConfig;
241
- let tsConfigPath = path2.resolve(
299
+ let tsConfigPath = path3.resolve(
242
300
  cwd,
243
301
  config.tsConfigPath
244
302
  );
245
303
  tsConfig = loadConfig(tsConfigPath);
246
304
  if ("paths" in tsConfig && Object.keys(tsConfig.paths).length === 0) {
247
- tsConfigPath = path2.resolve(cwd, "./tsconfig.app.json");
248
- if (existsSync(tsConfigPath)) {
305
+ tsConfigPath = path3.resolve(cwd, "./tsconfig.app.json");
306
+ if (existsSync2(tsConfigPath)) {
249
307
  tsConfig = loadConfig(tsConfigPath);
250
308
  }
251
309
  }
@@ -257,8 +315,8 @@ async function resolveConfigPaths(cwd, config) {
257
315
  return configSchema.parse({
258
316
  ...config,
259
317
  resolvedPaths: {
260
- tailwindConfig: path2.resolve(cwd, config.tailwind.config),
261
- tailwindCss: path2.resolve(cwd, config.cssPath),
318
+ tailwindConfig: path3.resolve(cwd, config.tailwind.config),
319
+ tailwindCss: path3.resolve(cwd, config.cssPath),
262
320
  utils: resolveImport(config.aliases.utils, tsConfig),
263
321
  components: resolveImport(config.aliases.components, tsConfig)
264
322
  }
@@ -297,7 +355,7 @@ function handleError(error) {
297
355
 
298
356
  // src/utils/registry/index.ts
299
357
  import fs2 from "node:fs";
300
- import path3 from "pathe";
358
+ import path4 from "pathe";
301
359
 
302
360
  // ../../apps/docs/src/lib/registry/themes.ts
303
361
  var themes = [
@@ -756,7 +814,7 @@ function getItemTargetPath(config, item, override) {
756
814
  if (!(parent in config.resolvedPaths)) {
757
815
  return null;
758
816
  }
759
- return path3.join(
817
+ return path4.join(
760
818
  config.resolvedPaths[parent] ?? "",
761
819
  type2
762
820
  );
@@ -818,8 +876,8 @@ function parseOptions(components, opts) {
818
876
  });
819
877
  }
820
878
  function validateAndResolveCwd(cwd) {
821
- const resolvedCwd = path4.resolve(cwd);
822
- if (!existsSync2(resolvedCwd)) {
879
+ const resolvedCwd = path5.resolve(cwd);
880
+ if (!existsSync3(resolvedCwd)) {
823
881
  consola3.error(`The path ${resolvedCwd} does not exist. Try again.`);
824
882
  process3.exit(1);
825
883
  }
@@ -880,7 +938,7 @@ async function processPayload(payload, options8, config, baseColor, cwd, selecte
880
938
  const targetDir = getItemTargetPath(
881
939
  config,
882
940
  item,
883
- options8.path ? path4.resolve(cwd, options8.path) : void 0
941
+ options8.path ? path5.resolve(cwd, options8.path) : void 0
884
942
  );
885
943
  if (!targetDir) {
886
944
  continue;
@@ -891,12 +949,12 @@ async function processPayload(payload, options8, config, baseColor, cwd, selecte
891
949
  }
892
950
  async function processItem(item, targetDir, options8, config, baseColor, cwd, selectedComponents, spinner) {
893
951
  try {
894
- if (!existsSync2(targetDir)) {
952
+ if (!existsSync3(targetDir)) {
895
953
  await fs3.mkdir(targetDir, { recursive: true });
896
954
  }
897
- const componentPath = path4.resolve(targetDir, item.name);
955
+ const componentPath = path5.resolve(targetDir, item.name);
898
956
  const existingComponent = item.files.filter(
899
- (file) => existsSync2(path4.resolve(componentPath, file.name))
957
+ (file) => existsSync3(path5.resolve(componentPath, file.name))
900
958
  );
901
959
  if (existingComponent.length && !options8.overwrite) {
902
960
  if (selectedComponents.includes(item.name)) {
@@ -936,62 +994,25 @@ async function installDependencies(item, cwd) {
936
994
  ].filter(Boolean);
937
995
  for (const task of installTasks) {
938
996
  try {
939
- consola3.info(`Attempting to install ${task.type} using nypm: ${task.deps.join(", ")}`);
997
+ consola3.info(`Installing ${task.type}: ${task.deps.join(", ")}`);
940
998
  await task.installer(task.deps, { cwd });
941
- consola3.success(`Successfully installed ${task.type} using nypm.`);
999
+ consola3.success(`Successfully installed ${task.type}.`);
942
1000
  } catch (error) {
943
- consola3.warn(`nypm failed to install ${task.type}:`, error);
944
- const isCorepackError = error instanceof Error && error.message?.includes("corepack");
945
- if (isCorepackError) {
946
- consola3.info(`Falling back to direct pnpm execution for ${task.type}...`);
947
- const pm = await detectPackageManager(cwd);
948
- let command = "";
949
- const depsString = task.deps.join(" ");
950
- const devFlag = task.type === "devDependencies" ? "-D " : "";
951
- switch (pm?.name) {
952
- case "npm":
953
- command = `npm install ${devFlag}${depsString}`;
954
- break;
955
- case "yarn":
956
- command = `yarn add ${devFlag}${depsString}`;
957
- break;
958
- case "bun":
959
- command = `bun add ${devFlag}${depsString}`;
960
- break;
961
- case "pnpm":
962
- default:
963
- command = `pnpm add ${devFlag}${depsString}`;
964
- break;
965
- }
966
- try {
967
- consola3.info(`Running: ${command}`);
968
- execSync(command, { cwd, stdio: "inherit" });
969
- consola3.success(`Successfully installed ${task.type} using direct pnpm execution.`);
970
- } catch (fallbackError) {
971
- const errorMessage = fallbackError instanceof Error ? fallbackError.message : "Unknown error";
972
- consola3.error(`Fallback pnpm execution failed for ${task.type}:`, errorMessage);
973
- throw new ComponentInstallError(
974
- `Failed to install ${task.type} (nypm and fallback failed): ${errorMessage}`,
975
- item.name
976
- );
977
- }
978
- } else {
979
- const errorMessage = error instanceof Error ? error.message : "Unknown error";
980
- throw new ComponentInstallError(
981
- `Failed to install ${task.type} using nypm: ${errorMessage}`,
982
- item.name
983
- );
984
- }
1001
+ const errorMessage = error instanceof Error ? error.message : "Unknown error";
1002
+ throw new ComponentInstallError(
1003
+ `Failed to install ${task.type}: ${errorMessage}`,
1004
+ item.name
1005
+ );
985
1006
  }
986
1007
  }
987
1008
  }
988
1009
  async function writeComponentFiles(item, componentDir, config, baseColor) {
989
- if (!existsSync2(componentDir)) {
1010
+ if (!existsSync3(componentDir)) {
990
1011
  await fs3.mkdir(componentDir, { recursive: true });
991
1012
  }
992
1013
  const files = item.files.map((file) => ({
993
1014
  ...file,
994
- path: path4.resolve(componentDir, file.name)
1015
+ path: path5.resolve(componentDir, file.name)
995
1016
  }));
996
1017
  for (const file of files) {
997
1018
  const content = await transform({
@@ -1006,9 +1027,9 @@ async function writeComponentFiles(item, componentDir, config, baseColor) {
1006
1027
  }
1007
1028
 
1008
1029
  // src/commands/diff.ts
1009
- import { existsSync as existsSync3, promises as fs4 } from "node:fs";
1030
+ import { existsSync as existsSync4, promises as fs4 } from "node:fs";
1010
1031
  import process4 from "node:process";
1011
- import path5 from "pathe";
1032
+ import path6 from "pathe";
1012
1033
  import { consola as consola4 } from "consola";
1013
1034
  import { colors as colors3 } from "consola/utils";
1014
1035
  import { Command as Command2 } from "commander";
@@ -1039,8 +1060,8 @@ function parseOptions2(name, opts) {
1039
1060
  });
1040
1061
  }
1041
1062
  function validateAndResolveCwd2(cwd) {
1042
- const resolvedCwd = path5.resolve(cwd);
1043
- if (!existsSync3(resolvedCwd)) {
1063
+ const resolvedCwd = path6.resolve(cwd);
1064
+ if (!existsSync4(resolvedCwd)) {
1044
1065
  consola4.error(`The path ${resolvedCwd} does not exist. Try again.`);
1045
1066
  process4.exit(1);
1046
1067
  }
@@ -1068,8 +1089,8 @@ async function handleAllComponentsDiff(config, registryIndex) {
1068
1089
  function findProjectComponents(registryIndex, targetDir) {
1069
1090
  return registryIndex.filter((item) => {
1070
1091
  return item.files.some((file) => {
1071
- const fullPath = path5.resolve(targetDir, item.name, file);
1072
- return existsSync3(fullPath);
1092
+ const fullPath = path6.resolve(targetDir, item.name, file);
1093
+ return existsSync4(fullPath);
1073
1094
  });
1074
1095
  });
1075
1096
  }
@@ -1132,8 +1153,8 @@ async function diffComponent(component, config) {
1132
1153
  }
1133
1154
  async function processItemFiles(item, targetDir, config, baseColor, changes) {
1134
1155
  for (const file of item.files) {
1135
- const filePath = path5.resolve(targetDir, item.name, file.name);
1136
- if (!existsSync3(filePath)) {
1156
+ const filePath = path6.resolve(targetDir, item.name, file.name);
1157
+ if (!existsSync4(filePath)) {
1137
1158
  continue;
1138
1159
  }
1139
1160
  const fileContent = await fs4.readFile(filePath, "utf8");
@@ -1170,17 +1191,15 @@ function printDiff(diff3) {
1170
1191
  }
1171
1192
 
1172
1193
  // src/commands/init.ts
1173
- import { existsSync as existsSync5, promises as fs8 } from "node:fs";
1194
+ import { existsSync as existsSync6, promises as fs8 } from "node:fs";
1174
1195
  import process5 from "node:process";
1175
1196
  import path14 from "pathe";
1176
1197
  import { Command as Command3 } from "commander";
1177
1198
  import { template } from "lodash-es";
1178
1199
  import ora2 from "ora";
1179
1200
  import prompts2 from "prompts";
1180
- import { addDependency as addDependency2, addDevDependency as addDevDependency2, detectPackageManager as detectPackageManager2 } from "nypm";
1181
1201
  import { consola as consola5 } from "consola";
1182
1202
  import { colors as colors4 } from "consola/utils";
1183
- import { execSync as execSync2 } from "node:child_process";
1184
1203
 
1185
1204
  // ../../node_modules/.pnpm/prettier@3.5.0/node_modules/prettier/index.mjs
1186
1205
  import { createRequire as __prettierCreateRequire } from "module";
@@ -1195,13 +1214,13 @@ import path42 from "path";
1195
1214
  import * as path32 from "path";
1196
1215
  import fs5 from "fs/promises";
1197
1216
  import path22 from "path";
1198
- import * as path6 from "path";
1217
+ import * as path7 from "path";
1199
1218
  import path8 from "path";
1200
1219
  import fs22 from "fs/promises";
1201
1220
  import fs32 from "fs/promises";
1202
1221
  import { pathToFileURL as pathToFileURL2 } from "url";
1203
1222
  import fs42 from "fs/promises";
1204
- import path7 from "path";
1223
+ import path72 from "path";
1205
1224
  import { pathToFileURL as pathToFileURL4 } from "url";
1206
1225
  import assert3 from "assert";
1207
1226
  import { statSync, realpathSync } from "fs";
@@ -13700,15 +13719,15 @@ async function isDirectory(directory, options8) {
13700
13719
  return stats.isDirectory();
13701
13720
  }
13702
13721
  var is_directory_default = isDirectory;
13703
- var toAbsolutePath = (value) => path6.resolve(toPath(value));
13722
+ var toAbsolutePath = (value) => path7.resolve(toPath(value));
13704
13723
  function* iterateDirectoryUp(from, to) {
13705
13724
  from = toAbsolutePath(from);
13706
- const { root: root2 } = path6.parse(from);
13725
+ const { root: root2 } = path7.parse(from);
13707
13726
  to = to ? toAbsolutePath(to) : root2;
13708
13727
  if (from !== to && !from.startsWith(to)) {
13709
13728
  return;
13710
13729
  }
13711
- for (let directory = from; directory !== to; directory = path6.dirname(directory)) {
13730
+ for (let directory = from; directory !== to; directory = path7.dirname(directory)) {
13712
13731
  yield directory;
13713
13732
  }
13714
13733
  yield to;
@@ -19062,7 +19081,7 @@ async function loadExternalConfig(externalConfig, configFile) {
19062
19081
  }
19063
19082
  var load_external_config_default = loadExternalConfig;
19064
19083
  async function loadConfig2(configFile) {
19065
- const { base: fileName, ext: extension } = path7.parse(configFile);
19084
+ const { base: fileName, ext: extension } = path72.parse(configFile);
19066
19085
  const load2 = fileName === "package.json" ? loadConfigFromPackageJson : fileName === "package.yaml" ? loadConfigFromPackageYaml : loaders_default[extension];
19067
19086
  if (!load2) {
19068
19087
  throw new Error(
@@ -24085,7 +24104,7 @@ var src_default = index_exports;
24085
24104
  import { Project as Project2, SyntaxKind as SyntaxKind2 } from "ts-morph";
24086
24105
 
24087
24106
  // src/utils/get-project-info.ts
24088
- import { existsSync as existsSync4 } from "node:fs";
24107
+ import { existsSync as existsSync5 } from "node:fs";
24089
24108
  import path13 from "pathe";
24090
24109
  import fs7 from "fs-extra";
24091
24110
  import { readPackageJSON } from "pkg-types";
@@ -24101,16 +24120,16 @@ async function getProjectInfo() {
24101
24120
  };
24102
24121
  try {
24103
24122
  const tsconfig = await getTsConfig();
24104
- const isNuxt = existsSync4(path13.resolve("./nuxt.config.js")) || existsSync4(path13.resolve("./nuxt.config.ts"));
24123
+ const isNuxt = existsSync5(path13.resolve("./nuxt.config.js")) || existsSync5(path13.resolve("./nuxt.config.ts"));
24105
24124
  const sigmaUiNuxtModuleInfo = isNuxt ? await getSigmaUiNuxtInfo() : void 0;
24106
24125
  return {
24107
24126
  tsconfig,
24108
24127
  isNuxt,
24109
24128
  sigmaUiNuxtModuleInfo,
24110
- isVueVite: existsSync4(path13.resolve("./vite.config.js")) || existsSync4(path13.resolve("./vite.config.ts")),
24111
- srcDir: existsSync4(path13.resolve("./src")),
24112
- srcComponentsUiDir: existsSync4(path13.resolve("./src/components/ui")),
24113
- componentsUiDir: existsSync4(path13.resolve("./components/ui"))
24129
+ isVueVite: existsSync5(path13.resolve("./vite.config.js")) || existsSync5(path13.resolve("./vite.config.ts")),
24130
+ srcDir: existsSync5(path13.resolve("./src")),
24131
+ srcComponentsUiDir: existsSync5(path13.resolve("./src/components/ui")),
24132
+ componentsUiDir: existsSync5(path13.resolve("./components/ui"))
24114
24133
  };
24115
24134
  } catch (error) {
24116
24135
  console.log(error);
@@ -24743,7 +24762,7 @@ var init = new Command3().name("init").description("initialize your project and
24743
24762
  const spinner = ora2("Fetching data...").start();
24744
24763
  const options8 = initOptionsSchema.parse(opts);
24745
24764
  const cwd = path14.resolve(options8.cwd);
24746
- if (!existsSync5(cwd)) {
24765
+ if (!existsSync6(cwd)) {
24747
24766
  consola5.error(`The path ${cwd} does not exist. Please try again.`);
24748
24767
  process5.exit(1);
24749
24768
  }
@@ -24899,7 +24918,11 @@ async function handleNuxtProject() {
24899
24918
  const { isNuxt, sigmaUiNuxtModuleInfo } = await getProjectInfo();
24900
24919
  if (isNuxt) {
24901
24920
  consola5.log("");
24902
- sigmaUiNuxtModuleInfo ? consola5.info(`Detected a Nuxt project with 'sigma-ui-nuxt' v${sigmaUiNuxtModuleInfo.version}`) : consola5.warn(`Detected a Nuxt project without 'sigma-ui-nuxt' module. It's recommended to install it.`);
24921
+ if (sigmaUiNuxtModuleInfo) {
24922
+ consola5.info(`Detected a Nuxt project with 'sigma-ui-nuxt' v${sigmaUiNuxtModuleInfo.version}`);
24923
+ } else {
24924
+ consola5.warn(`Detected a Nuxt project without 'sigma-ui-nuxt' module. It's recommended to install it.`);
24925
+ }
24903
24926
  }
24904
24927
  }
24905
24928
  async function runInit(cwd, config) {
@@ -25000,50 +25023,17 @@ async function installDependencies2(config, cwd) {
25000
25023
  const deps = [...baseDeps, ...PROJECT_DEPENDENCIES.sharedBase].filter(Boolean);
25001
25024
  const devDeps = baseDevDeps.filter(Boolean);
25002
25025
  const installTasks = [
25003
- config.framework === "nuxt" && PROJECT_DEPENDENCIES.nuxt.length && { type: "devDependencies", deps: PROJECT_DEPENDENCIES.nuxt, installer: addDevDependency2 },
25004
- deps.length && { type: "dependencies", deps, installer: addDependency2 },
25005
- devDeps.length && { type: "devDependencies", deps: devDeps, installer: addDevDependency2 }
25026
+ config.framework === "nuxt" && PROJECT_DEPENDENCIES.nuxt.length && { type: "devDependencies", deps: PROJECT_DEPENDENCIES.nuxt, installer: addDevDependency },
25027
+ deps.length && { type: "dependencies", deps, installer: addDependency },
25028
+ devDeps.length && { type: "devDependencies", deps: devDeps, installer: addDevDependency }
25006
25029
  ].filter(Boolean);
25007
25030
  for (const task of installTasks) {
25008
25031
  try {
25009
25032
  dependenciesSpinner.text = `Installing ${task.type}...`;
25010
25033
  await task.installer(task.deps, { cwd, silent: true });
25011
25034
  } catch (error) {
25012
- consola5.warn(`nypm failed to install ${task.type}:`, error);
25013
- const isCorepackError = error instanceof Error && error.message?.includes("corepack");
25014
- if (isCorepackError) {
25015
- consola5.info(`Falling back to direct package manager execution for ${task.type}...`);
25016
- const pm = await detectPackageManager2(cwd);
25017
- let command = "";
25018
- const depsString = task.deps.join(" ");
25019
- const devFlag = task.type === "devDependencies" ? "-D " : "";
25020
- switch (pm?.name) {
25021
- case "npm":
25022
- command = `npm install ${devFlag}${depsString}`;
25023
- break;
25024
- case "yarn":
25025
- command = `yarn add ${devFlag}${depsString}`;
25026
- break;
25027
- case "bun":
25028
- command = `bun add ${devFlag}${depsString}`;
25029
- break;
25030
- case "pnpm":
25031
- default:
25032
- command = `pnpm add ${devFlag}${depsString}`;
25033
- break;
25034
- }
25035
- try {
25036
- consola5.info(`Running: ${command}`);
25037
- execSync2(command, { cwd, stdio: "inherit" });
25038
- consola5.success(`Successfully installed ${task.type} using direct package manager execution.`);
25039
- } catch (fallbackError) {
25040
- const errorMessage = fallbackError instanceof Error ? fallbackError.message : "Unknown error";
25041
- consola5.error(`Fallback package manager execution failed for ${task.type}:`, errorMessage);
25042
- }
25043
- } else {
25044
- const errorMessage = error instanceof Error ? error.message : "Unknown error";
25045
- consola5.error(`Failed to install ${task.type} using nypm: ${errorMessage}`);
25046
- }
25035
+ const errorMessage = error instanceof Error ? error.message : "Unknown error";
25036
+ consola5.error(`Failed to install ${task.type}: ${errorMessage}`);
25047
25037
  }
25048
25038
  }
25049
25039
  dependenciesSpinner?.succeed();
@@ -25075,7 +25065,7 @@ async function getDirectoryPath(key2, resolvedPath) {
25075
25065
  }
25076
25066
  async function updateViteConfig() {
25077
25067
  const viteConfigPath = path14.join(process5.cwd(), "vite.config.ts");
25078
- if (!existsSync5(viteConfigPath)) {
25068
+ if (!existsSync6(viteConfigPath)) {
25079
25069
  consola5.warn(`Vite config file not found at ${viteConfigPath}`);
25080
25070
  return;
25081
25071
  }