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.
@@ -67,7 +67,10 @@ const { default: validateOnClient = null } = ${
67
67
  };
68
68
 
69
69
  `;
70
- const metadataJson = await fs.readFile(path.join(__dirname, localJsonPath), 'utf-8').catch(() => null);
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
@@ -24,7 +24,7 @@ function getVars(rcPath, options = {}) {
24
24
 
25
25
  vars = {
26
26
  VOVK_CLIENT_OUT:
27
- process.env.VOVK_OUT ||
27
+ process.env.VOVK_CLIENT_OUT ||
28
28
  (options.VOVK_CLIENT_OUT?.startsWith('/')
29
29
  ? options.VOVK_CLIENT_OUT
30
30
  : options.VOVK_CLIENT_OUT
@@ -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
- return stepsUp + stepsDown;
22
+ const result = stepsUp + stepsDown;
23
+
24
+ return result;
23
25
  }
24
26
 
25
27
  module.exports = getReturnPath;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vovk",
3
- "version": "0.2.3-beta.71",
3
+ "version": "0.2.3-beta.73",
4
4
  "description": "Structural add-on for Next.js",
5
5
  "bin": "./cli/index.js",
6
6
  "scripts": {