@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.
- package/dist/index.js +11 -8
- 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
|
-
|
|
25
|
-
|
|
26
|
-
|
|
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
|
-
|
|
98
|
+
p.cancel("Installation aborted due to failed dependency resolution.");
|
|
99
|
+
process.exit(1);
|
|
98
100
|
}
|
|
99
101
|
}
|
|
100
|
-
spinner2.message(`Creating component
|
|
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
|
-
|
|
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");
|