vovk 0.2.3-beta.71 → 0.2.3-beta.73
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/cli/generateClient.js +4 -1
- package/cli/getVars.js +1 -1
- package/cli/lib/getReturnPath.js +5 -3
- package/package.json +1 -1
package/cli/generateClient.js
CHANGED
|
@@ -67,7 +67,10 @@ const { default: validateOnClient = null } = ${
|
|
|
67
67
|
};
|
|
68
68
|
|
|
69
69
|
`;
|
|
70
|
-
const metadataJson = await fs.readFile(
|
|
70
|
+
const metadataJson = await fs.readFile(localJsonPath, 'utf-8').catch(() => null);
|
|
71
|
+
|
|
72
|
+
if(!metadataJson) console.warn(` 🐺 No .vovk.json file found in ${localJsonPath}`);
|
|
73
|
+
|
|
71
74
|
const metadata = JSON.parse(metadataJson || '{}');
|
|
72
75
|
|
|
73
76
|
for (const key of Object.keys(metadata)) {
|
package/cli/getVars.js
CHANGED
package/cli/lib/getReturnPath.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// @ts-check
|
|
2
2
|
function getReturnPath(fromPath, toPath) {
|
|
3
3
|
// Split the paths into components
|
|
4
|
-
const fromParts = fromPath.split('/');
|
|
5
|
-
const toParts = toPath.split('/');
|
|
4
|
+
const fromParts = fromPath.replace(/^\.?\/|\/$/g, '').split('/');
|
|
5
|
+
const toParts = toPath.replace(/^\.?\/|\/$/g, '').split('/');
|
|
6
6
|
|
|
7
7
|
// Find the common base path length
|
|
8
8
|
const length = Math.min(fromParts.length, toParts.length);
|
|
@@ -19,7 +19,9 @@ function getReturnPath(fromPath, toPath) {
|
|
|
19
19
|
const stepsDown = toParts.slice(commonBaseLength).join('/');
|
|
20
20
|
|
|
21
21
|
// Combine steps up and steps down
|
|
22
|
-
|
|
22
|
+
const result = stepsUp + stepsDown;
|
|
23
|
+
|
|
24
|
+
return result;
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
module.exports = getReturnPath;
|