vovk-cli 0.0.1-draft.166 → 0.0.1-draft.167
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.
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import fs from 'fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import ejs from 'ejs';
|
|
4
|
-
import _
|
|
4
|
+
import _ from 'lodash';
|
|
5
5
|
import { VovkSchemaIdEnum } from 'vovk';
|
|
6
6
|
import prettify from '../utils/prettify.mjs';
|
|
7
7
|
import { ROOT_SEGMENT_SCHEMA_NAME, SEGMENTS_SCHEMA_DIR_NAME } from '../dev/writeOneSegmentSchemaFile.mjs';
|
|
8
8
|
export default async function writeOneClientFile({ cwd, projectInfo, clientTemplateFile, fullSchema, prettifyClient, segmentName, imports, templateContent, matterResult: { data, content }, package: packageJson, isEnsuringClient, outCwdRelativeDir, origin, templateDef, locatedSegments, }) {
|
|
9
9
|
const { config, apiRoot } = projectInfo;
|
|
10
10
|
const { templateFilePath, relativeDir } = clientTemplateFile;
|
|
11
|
-
const locatedSegmentsByName = keyBy(locatedSegments, 'segmentName');
|
|
11
|
+
const locatedSegmentsByName = _.keyBy(locatedSegments, 'segmentName');
|
|
12
12
|
const outPath = path.resolve(cwd, outCwdRelativeDir, typeof segmentName === 'string' ? segmentName || ROOT_SEGMENT_SCHEMA_NAME : '', relativeDir.replace('[package_name]', packageJson.name ?? 'my-package-name'), path.basename(templateFilePath).replace('.ejs', ''));
|
|
13
13
|
let placeholder = `// This is a temporary placeholder to avoid compilation errors if client is imported before it's generated.
|
|
14
14
|
// If you still see this text, the client is not generated yet because of an unknown problem.
|