vovk 0.2.3-beta.121 → 0.2.3-beta.122
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.mjs +1 -10
- package/cli/getVars.mjs +2 -1
- package/cli/lib/fileExists.mjs +11 -0
- package/package.json +1 -1
package/cli/generateClient.mjs
CHANGED
|
@@ -2,16 +2,7 @@
|
|
|
2
2
|
import fs from 'fs/promises';
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import getReturnPath from './lib/getReturnPath.mjs';
|
|
5
|
-
|
|
6
|
-
/** @type {(moduleName: string) => Promise<boolean>} */
|
|
7
|
-
async function fileExists(filePath) {
|
|
8
|
-
try {
|
|
9
|
-
await fs.stat(filePath);
|
|
10
|
-
return true; // The file exists
|
|
11
|
-
} catch (e) {
|
|
12
|
-
return false; // The file does not exist
|
|
13
|
-
}
|
|
14
|
-
}
|
|
5
|
+
import fileExists from './lib/fileExists.mjs';
|
|
15
6
|
|
|
16
7
|
/**
|
|
17
8
|
* Generates client code with string concatenation so it should be much faster than using AST
|
package/cli/getVars.mjs
CHANGED
|
@@ -20,8 +20,9 @@ export default async function getVars(configPath, options = {}) {
|
|
|
20
20
|
// make PORT available to the config file
|
|
21
21
|
process.env.PORT = options.PORT || process.env.PORT || '3000';
|
|
22
22
|
Object.assign(vovkConfig, await import(configPath));
|
|
23
|
+
console.info('🐺 Vovk config loaded from', configPath);
|
|
23
24
|
} catch {
|
|
24
|
-
|
|
25
|
+
console.info(`🐺 No vovk.config.js found at path '${configPath}', using defaults`);
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
vars = {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import fs from 'fs/promises';
|
|
2
|
+
|
|
3
|
+
/** @type {(moduleName: string) => Promise<boolean>} */
|
|
4
|
+
export default async function fileExists(filePath) {
|
|
5
|
+
try {
|
|
6
|
+
await fs.stat(filePath);
|
|
7
|
+
return true; // The file exists
|
|
8
|
+
} catch (e) {
|
|
9
|
+
return false; // The file does not exist
|
|
10
|
+
}
|
|
11
|
+
}
|