@marv3l/canopy-ui 1.2.1 → 1.2.3
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 -9
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
#!/usr/bin/env node
|
|
3
2
|
|
|
4
3
|
// src/index.ts
|
|
5
4
|
import { Command } from "commander";
|
|
@@ -16,15 +15,16 @@ import pc from "picocolors";
|
|
|
16
15
|
var REGISTRY = {
|
|
17
16
|
toast: {
|
|
18
17
|
name: "Toast",
|
|
19
|
-
packageName: "@canopy-ui/toast",
|
|
20
|
-
// Your published npm package name
|
|
21
18
|
dependencies: ["lucide-react"],
|
|
19
|
+
// Peer dependencies to install in consumer app
|
|
22
20
|
files: [
|
|
23
21
|
{
|
|
24
22
|
targetName: "toast.tsx",
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
templatePath: "toast/toast.tsx"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
targetName: "use-toast.tsx",
|
|
27
|
+
templatePath: "toast/use-toast.tsx"
|
|
28
28
|
}
|
|
29
29
|
]
|
|
30
30
|
}
|
|
@@ -95,10 +95,11 @@ async function add(componentKeys) {
|
|
|
95
95
|
} catch (err) {
|
|
96
96
|
spinner2.stop(pc.red(`Failed to install dependencies for ${meta.name}`));
|
|
97
97
|
p.log.error(String(err));
|
|
98
|
-
|
|
98
|
+
p.cancel("Installation aborted due to failed dependency resolution.");
|
|
99
|
+
process.exit(1);
|
|
99
100
|
}
|
|
100
101
|
}
|
|
101
|
-
spinner2.message(`Creating component
|
|
102
|
+
spinner2.message(`Creating component files for ${meta.name}...`);
|
|
102
103
|
for (const file of meta.files) {
|
|
103
104
|
const destPath = path.join(targetDir, file.targetName);
|
|
104
105
|
if (file.templatePath) {
|
|
@@ -108,7 +109,8 @@ async function add(componentKeys) {
|
|
|
108
109
|
} else {
|
|
109
110
|
spinner2.stop(pc.red(`Template file missing: ${file.templatePath}`));
|
|
110
111
|
p.log.warn(pc.dim(`Looked at path: ${srcPath}`));
|
|
111
|
-
|
|
112
|
+
p.cancel("Component generation aborted.");
|
|
113
|
+
process.exit(1);
|
|
112
114
|
}
|
|
113
115
|
} else if (file.content) {
|
|
114
116
|
await fs.writeFile(destPath, file.content.trim() + "\n", "utf-8");
|