vovk-cli 0.0.1-draft.34 → 0.0.1-draft.35
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/generateClient.mjs
CHANGED
|
@@ -3,11 +3,9 @@ import fs from 'node:fs/promises';
|
|
|
3
3
|
import formatLoggedSegmentName from './utils/formatLoggedSegmentName.mjs';
|
|
4
4
|
import prettify from './utils/prettify.mjs';
|
|
5
5
|
export default async function generateClient(projectInfo, segments, segmentsSchema) {
|
|
6
|
-
console.log('generateClient');
|
|
7
6
|
const { config, cwd, log, validateOnClientImportPath, apiEntryPoint, fetcherClientImportPath, schemaOutImportPath } = projectInfo;
|
|
8
7
|
const now = Date.now();
|
|
9
8
|
const clientoOutDirAbsolutePath = path.join(cwd, config.clientOutDir);
|
|
10
|
-
console.log('schemaOutImportPath', schemaOutImportPath);
|
|
11
9
|
let dts = `// auto-generated
|
|
12
10
|
/* eslint-disable */
|
|
13
11
|
import type { clientizeController } from 'vovk/client';
|
|
@@ -8,7 +8,6 @@ export default async function getProjectInfo({ port: givenPort, clientOutDir, cw
|
|
|
8
8
|
const { config, srcRoot, configAbsolutePaths, userConfig, error } = await getConfig({ clientOutDir, cwd });
|
|
9
9
|
const apiEntryPoint = `${config.origin ?? ''}/${config.rootEntry}`;
|
|
10
10
|
const apiDir = path.join(srcRoot, 'app', config.rootEntry);
|
|
11
|
-
console.log('config', config);
|
|
12
11
|
const schemaOutImportPath = path.relative(config.clientOutDir, config.schemaOutDir).replace(/\\/g, '/'); // windows fix
|
|
13
12
|
const fetcherClientImportPath = config.fetcher.startsWith('.')
|
|
14
13
|
? path.relative(config.clientOutDir, config.fetcher)
|
package/dist/index.mjs
CHANGED
|
@@ -66,14 +66,10 @@ program
|
|
|
66
66
|
.description('Generate client')
|
|
67
67
|
.option('--client-out <path>', 'Path to output directory')
|
|
68
68
|
.action(async (options) => {
|
|
69
|
-
console.log('GENERATE');
|
|
70
69
|
const projectInfo = await getProjectInfo({ clientOutDir: options.clientOut });
|
|
71
|
-
console.log('projectInfo', projectInfo);
|
|
72
70
|
const { cwd, config, apiDir } = projectInfo;
|
|
73
71
|
const segments = await locateSegments(apiDir);
|
|
74
|
-
console.log('segments', segments);
|
|
75
72
|
const schemaOutAbsolutePath = path.join(cwd, config.schemaOutDir);
|
|
76
|
-
console.log('schemaOutAbsolutePath', schemaOutAbsolutePath);
|
|
77
73
|
const schemaImportUrl = pathToFileURL(path.join(schemaOutAbsolutePath, 'index.js')).href;
|
|
78
74
|
const schema = await import(schemaImportUrl);
|
|
79
75
|
await generateClient(projectInfo, segments, schema.default);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vovk-cli",
|
|
3
|
-
"version": "0.0.1-draft.
|
|
3
|
+
"version": "0.0.1-draft.35",
|
|
4
4
|
"bin": {
|
|
5
5
|
"vovk": "./dist/index.mjs"
|
|
6
6
|
},
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
},
|
|
37
37
|
"homepage": "https://vovk.dev",
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"vovk": "^3.0.0-draft.
|
|
39
|
+
"vovk": "^3.0.0-draft.31"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@inquirer/prompts": "^7.1.0",
|