@supacloud/compiler 0.14.0 → 0.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.
- package/dist/cli.js +4 -3
- package/dist/index.js +4 -3
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -26,10 +26,11 @@ function camelName(token) {
|
|
|
26
26
|
return token.charAt(0).toLowerCase() + token.slice(1);
|
|
27
27
|
}
|
|
28
28
|
function relativeImportPath(fromDir, toFile) {
|
|
29
|
-
const fromParts = fromDir.split(
|
|
30
|
-
const toParts = toFile.split(
|
|
29
|
+
const fromParts = fromDir.split(/[\\/]/).filter(Boolean);
|
|
30
|
+
const toParts = toFile.split(/[\\/]/).filter(Boolean);
|
|
31
|
+
const isWindows = process.platform === "win32" || /^[a-zA-Z]:/.test(fromParts[0] ?? "") || /^[a-zA-Z]:/.test(toParts[0] ?? "");
|
|
31
32
|
let common = 0;
|
|
32
|
-
while (common < fromParts.length && common < toParts.length && fromParts[common] === toParts[common]) {
|
|
33
|
+
while (common < fromParts.length && common < toParts.length && (fromParts[common] === toParts[common] || isWindows && fromParts[common].toLowerCase() === toParts[common].toLowerCase())) {
|
|
33
34
|
common += 1;
|
|
34
35
|
}
|
|
35
36
|
const ups = fromParts.length - common;
|
package/dist/index.js
CHANGED
|
@@ -25,10 +25,11 @@ function camelName(token) {
|
|
|
25
25
|
return token.charAt(0).toLowerCase() + token.slice(1);
|
|
26
26
|
}
|
|
27
27
|
function relativeImportPath(fromDir, toFile) {
|
|
28
|
-
const fromParts = fromDir.split(
|
|
29
|
-
const toParts = toFile.split(
|
|
28
|
+
const fromParts = fromDir.split(/[\\/]/).filter(Boolean);
|
|
29
|
+
const toParts = toFile.split(/[\\/]/).filter(Boolean);
|
|
30
|
+
const isWindows = process.platform === "win32" || /^[a-zA-Z]:/.test(fromParts[0] ?? "") || /^[a-zA-Z]:/.test(toParts[0] ?? "");
|
|
30
31
|
let common = 0;
|
|
31
|
-
while (common < fromParts.length && common < toParts.length && fromParts[common] === toParts[common]) {
|
|
32
|
+
while (common < fromParts.length && common < toParts.length && (fromParts[common] === toParts[common] || isWindows && fromParts[common].toLowerCase() === toParts[common].toLowerCase())) {
|
|
32
33
|
common += 1;
|
|
33
34
|
}
|
|
34
35
|
const ups = fromParts.length - common;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@supacloud/compiler",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.15.0",
|
|
4
4
|
"description": "Static compiler for @supacloud/app metadata: builds the application graph from AST, validates it, and generates reflection-free factory code",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|