@dalexto/lexsys-cli 0.0.4 → 0.0.5
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 +17 -2
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -169,16 +169,31 @@ var saveConfig = async (config) => {
|
|
|
169
169
|
const configPath = getConfigPath();
|
|
170
170
|
await writeFile(configPath, JSON.stringify(config, null, 2) + "\n", "utf-8");
|
|
171
171
|
};
|
|
172
|
-
var
|
|
172
|
+
var monorepoCrossLayerPatterns = [
|
|
173
173
|
/\.\.\/\.\.\/primitives\//g,
|
|
174
174
|
/\.\.\/\.\.\/blocks\//g,
|
|
175
175
|
/\.\.\/\.\.\/templates\//g
|
|
176
176
|
];
|
|
177
|
+
var registryTemplateLayers = ["primitives", "blocks", "templates"];
|
|
178
|
+
var toFlatSiblingImportPath = (importPath) => {
|
|
179
|
+
const segments = importPath.split("/").filter(Boolean);
|
|
180
|
+
if (segments.length >= 2) {
|
|
181
|
+
return `../${segments.join("/")}`;
|
|
182
|
+
}
|
|
183
|
+
const name = segments[0] ?? importPath;
|
|
184
|
+
return `../${name}/${name}`;
|
|
185
|
+
};
|
|
177
186
|
var rewriteCrossLayerImports = (content) => {
|
|
178
187
|
let rewritten = content;
|
|
179
|
-
for (const pattern of
|
|
188
|
+
for (const pattern of monorepoCrossLayerPatterns) {
|
|
180
189
|
rewritten = rewritten.replace(pattern, "../");
|
|
181
190
|
}
|
|
191
|
+
for (const layer of registryTemplateLayers) {
|
|
192
|
+
const pattern = new RegExp(`from "@/components/${layer}/([^"]+)"`, "g");
|
|
193
|
+
rewritten = rewritten.replace(pattern, (_, importPath) => {
|
|
194
|
+
return `from "${toFlatSiblingImportPath(importPath)}"`;
|
|
195
|
+
});
|
|
196
|
+
}
|
|
182
197
|
return rewritten;
|
|
183
198
|
};
|
|
184
199
|
var prepareInstalledFileContent = (content, item) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dalexto/lexsys-cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Registry-first CLI that installs Lexsys React UI components into your project",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"prompts": "^2.4.2",
|
|
35
|
-
"@dalexto/lexsys-registry": "0.0.
|
|
35
|
+
"@dalexto/lexsys-registry": "0.0.5"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"@types/node": "^25.9.1",
|