@pageai/ralph-loop 1.14.0 → 1.15.0

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/bin/lib/shadcn.js +26 -1
  2. package/package.json +1 -1
package/bin/lib/shadcn.js CHANGED
@@ -57,7 +57,8 @@ function isShadcnProject(dir) {
57
57
  }
58
58
 
59
59
  /**
60
- * Initializes shadcn in the given directory with default settings.
60
+ * Initializes shadcn in the given directory with default settings,
61
+ * then strips the "#/" alias prefix from components.json.
61
62
  * @param {string} dir - Directory path to run the init in
62
63
  */
63
64
  function initShadcn(dir) {
@@ -65,6 +66,30 @@ function initShadcn(dir) {
65
66
  cwd: dir,
66
67
  stdio: 'pipe',
67
68
  });
69
+
70
+ stripAliasPrefix(dir);
71
+ }
72
+
73
+ /**
74
+ * Removes the "#/" prefix from all alias values in components.json.
75
+ * @param {string} dir - Directory containing components.json
76
+ */
77
+ function stripAliasPrefix(dir) {
78
+ const configPath = path.join(dir, 'components.json');
79
+ if (!exists(configPath)) return;
80
+
81
+ try {
82
+ const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
83
+ if (!config.aliases) return;
84
+
85
+ for (const key of Object.keys(config.aliases)) {
86
+ config.aliases[key] = config.aliases[key].replace(/^#\//, '');
87
+ }
88
+
89
+ fs.writeFileSync(configPath, JSON.stringify(config, null, 2) + '\n', 'utf8');
90
+ } catch {
91
+ // Non-critical — continue even if patching fails
92
+ }
68
93
  }
69
94
 
70
95
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pageai/ralph-loop",
3
- "version": "1.14.0",
3
+ "version": "1.15.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },