vovk 0.2.3-beta.119 → 0.2.3-beta.120

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.
@@ -6,7 +6,13 @@ import getReturnPath from './lib/getReturnPath.mjs';
6
6
  /** @type {(moduleName: string) => Promise<boolean>} */
7
7
  async function canImport(moduleName) {
8
8
  try {
9
- await import(moduleName);
9
+ if (moduleName.endsWith('.json')) {
10
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
11
+ // @ts-ignore Ignore dynamic imports errors
12
+ await import(moduleName, { assert: { type: 'json' } });
13
+ } else {
14
+ await import(moduleName);
15
+ }
10
16
  return true; // The module exists and can be imported
11
17
  } catch (e) {
12
18
  return false; // The module does not exist or cannot be imported
@@ -42,7 +48,9 @@ export default async function generateClient({ ...env }) {
42
48
  }
43
49
 
44
50
  if (!(await canImport(localJsonPath))) {
45
- throw new Error(`Unble to generate Vovk Client: cannot find ".vovk.json" file '${localJsonPath}'.`);
51
+ throw new Error(
52
+ `Unble to generate Vovk Client: cannot find ".vovk.json" file '${localJsonPath}' (original value '${jsonPath}').`
53
+ );
46
54
  }
47
55
 
48
56
  const controllersPath = path.join(returnDir, env.VOVK_ROUTE).replace(/\.ts$/, '');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vovk",
3
- "version": "0.2.3-beta.119",
3
+ "version": "0.2.3-beta.120",
4
4
  "description": "Structural add-on for Next.js",
5
5
  "bin": "./cli/index.mjs",
6
6
  "scripts": {