@hkdigital/lib-core 0.5.79 → 0.5.80

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hkdigital/lib-core",
3
- "version": "0.5.79",
3
+ "version": "0.5.80",
4
4
  "author": {
5
5
  "name": "HKdigital",
6
6
  "url": "https://hkdigital.nl"
@@ -86,29 +86,28 @@ function detectUnsafeAliases() {
86
86
  const resolvedPath = isAbsolute(target) ?
87
87
  target : join(PROJECT_ROOT, target);
88
88
 
89
- // Normalize both paths for comparison (resolve symlinks, etc.)
90
- const normalizedResolved = resolve(resolvedPath);
91
- const normalizedRoot = resolve(PROJECT_ROOT);
92
-
93
- // Check if resolved path is inside the project folder
94
- const isInsideProject = normalizedResolved.startsWith(normalizedRoot);
95
-
96
- if (!isInsideProject) {
97
- // Path is outside project - check if it's in node_modules
98
- if (resolvedPath.includes('/node_modules/')) {
99
- const packageName = extractPackageNameFromPath(resolvedPath);
100
- if (packageName) {
101
- suggestion = packageName;
102
- }
103
- } else {
104
- // Outside project but not node_modules
105
- suggestion = '(path outside project - use direct imports)';
89
+ // Check if path points to node_modules (breaks in libraries)
90
+ if (resolvedPath.includes('/node_modules/')) {
91
+ const packageName = extractPackageNameFromPath(resolvedPath);
92
+ if (packageName) {
93
+ suggestion = packageName;
106
94
  }
95
+ } else {
96
+ // Not node_modules - check if it's outside the project
97
+ const normalizedResolved = resolve(resolvedPath);
98
+ const normalizedRoot = resolve(PROJECT_ROOT);
107
99
 
108
- if (suggestion) {
109
- UNSAFE_ALIASES.set(alias, suggestion);
100
+ const isInsideProject = normalizedResolved.startsWith(normalizedRoot);
101
+
102
+ if (!isInsideProject) {
103
+ // Outside project and not node_modules
104
+ suggestion = '(path outside project - use direct imports)';
110
105
  }
111
106
  }
107
+
108
+ if (suggestion) {
109
+ UNSAFE_ALIASES.set(alias, suggestion);
110
+ }
112
111
  }
113
112
  }
114
113