@marv3l/canopy-ui 1.2.2 → 1.2.4

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.
Files changed (2) hide show
  1. package/dist/index.js +11 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -15,15 +15,16 @@ import pc from "picocolors";
15
15
  var REGISTRY = {
16
16
  toast: {
17
17
  name: "Toast",
18
- packageName: "@canopy-ui/toast",
19
- // Your published npm package name
20
18
  dependencies: ["lucide-react"],
19
+ // Peer dependencies to install in consumer app
21
20
  files: [
22
21
  {
23
22
  targetName: "toast.tsx",
24
- content: `"use client";
25
-
26
- export * from "@canopy-ui/toast";`
23
+ templatePath: "toast/toast.tsx"
24
+ },
25
+ {
26
+ targetName: "use-toast.tsx",
27
+ templatePath: "toast/use-toast.ts"
27
28
  }
28
29
  ]
29
30
  }
@@ -94,10 +95,11 @@ async function add(componentKeys) {
94
95
  } catch (err) {
95
96
  spinner2.stop(pc.red(`Failed to install dependencies for ${meta.name}`));
96
97
  p.log.error(String(err));
97
- continue;
98
+ p.cancel("Installation aborted due to failed dependency resolution.");
99
+ process.exit(1);
98
100
  }
99
101
  }
100
- spinner2.message(`Creating component stub for ${meta.name}...`);
102
+ spinner2.message(`Creating component files for ${meta.name}...`);
101
103
  for (const file of meta.files) {
102
104
  const destPath = path.join(targetDir, file.targetName);
103
105
  if (file.templatePath) {
@@ -107,7 +109,8 @@ async function add(componentKeys) {
107
109
  } else {
108
110
  spinner2.stop(pc.red(`Template file missing: ${file.templatePath}`));
109
111
  p.log.warn(pc.dim(`Looked at path: ${srcPath}`));
110
- return;
112
+ p.cancel("Component generation aborted.");
113
+ process.exit(1);
111
114
  }
112
115
  } else if (file.content) {
113
116
  await fs.writeFile(destPath, file.content.trim() + "\n", "utf-8");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@marv3l/canopy-ui",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "An accessible, themable React UI component library built for fast-moving web applications.",
5
5
  "main": "./dist/index.js",
6
6
  "bin": {