@lobb-js/studio 0.1.33 → 0.1.34
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/package.json
CHANGED
|
@@ -9,7 +9,8 @@ const __dirname = path.dirname(__filename);
|
|
|
9
9
|
* Vite plugin that resolves $lib imports contextually based on the importing file location.
|
|
10
10
|
*
|
|
11
11
|
* - Files inside the consuming project -> resolve to local ./src/lib
|
|
12
|
-
* - Files
|
|
12
|
+
* - Files from Studio package in monorepo -> resolve to Studio's src/lib
|
|
13
|
+
* - Files from Studio package in node_modules -> resolve to node_modules/@lobb-js/studio/src/lib
|
|
13
14
|
*
|
|
14
15
|
* This allows shadcn components to work in both the Studio package and consuming projects
|
|
15
16
|
* without conflicts.
|
|
@@ -42,8 +43,12 @@ export function contextualLibAlias() {
|
|
|
42
43
|
if (isLocalImport && fs.existsSync(localLibPath)) {
|
|
43
44
|
// Local file importing $lib -> resolve to local src/lib
|
|
44
45
|
targetPath = localLibPath;
|
|
46
|
+
} else if (importer.includes("node_modules/@lobb-js/studio")) {
|
|
47
|
+
// Import from Studio package in node_modules -> resolve to node_modules/@lobb-js/studio/src/lib
|
|
48
|
+
const nodeModulesStudioPath = importer.substring(0, importer.indexOf("node_modules/@lobb-js/studio") + "node_modules/@lobb-js/studio".length);
|
|
49
|
+
targetPath = path.join(nodeModulesStudioPath, "src/lib");
|
|
45
50
|
} else if (fs.existsSync(studioLibPath)) {
|
|
46
|
-
// External file (e.g., Studio) importing $lib -> resolve to Studio's src/lib
|
|
51
|
+
// External file (e.g., Studio in monorepo) importing $lib -> resolve to Studio's src/lib
|
|
47
52
|
targetPath = studioLibPath;
|
|
48
53
|
} else {
|
|
49
54
|
// Neither path exists, let default resolution handle it
|