shadcn-extras 0.2.0 → 0.2.1

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 +3 -2
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -109,8 +109,8 @@ commander_1.program
109
109
  for (const file of componentEntry.files) {
110
110
  const content = file.content ||
111
111
  (await fetchFile(`${MOTION_PRIMITIVES_BASE_URL}${file.path}`));
112
- const fileName = file.path.split('/').pop();
113
- allFiles.push({ path: fileName, content });
112
+ const relPath = (0, path_1.normalize)(file.path);
113
+ allFiles.push({ path: relPath, content });
114
114
  }
115
115
  // Create target directory if it doesn't exist
116
116
  if (!(0, fs_1.existsSync)(TARGET_DIR)) {
@@ -119,6 +119,7 @@ commander_1.program
119
119
  // Write all files to components/shadcn-extras/
120
120
  for (const { path, content } of allFiles) {
121
121
  const filePath = (0, path_1.join)(TARGET_DIR, path);
122
+ (0, fs_1.mkdirSync)((0, path_1.dirname)(filePath), { recursive: true });
122
123
  (0, fs_1.writeFileSync)(filePath, content);
123
124
  console.log(`✓ Added ${path} to ${filePath}`);
124
125
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shadcn-extras",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "CLI to add shadcn-extras components to your app",
5
5
  "bin": {
6
6
  "shadcn-extras": "./dist/index.js"