vovk-cli 0.0.1-draft.341 → 0.0.1-draft.346
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/client-templates/cjs/index.cjs.ejs +5 -5
- package/client-templates/cjs/index.d.cts.ejs +3 -4
- package/client-templates/mjs/index.d.mts.ejs +3 -4
- package/client-templates/mjs/index.mjs.ejs +3 -3
- package/client-templates/ts/index.ts.ejs +3 -3
- package/dist/dev/index.mjs +0 -1
- package/dist/dev/writeMetaJson.mjs +0 -1
- package/dist/generate/ensureClient.mjs +1 -1
- package/dist/generate/generate.mjs +9 -5
- package/dist/generate/getProjectFullSchema.d.mts +1 -3
- package/dist/generate/getProjectFullSchema.mjs +1 -2
- package/dist/generate/index.mjs +1 -2
- package/dist/generate/writeOneClientFile.d.mts +2 -1
- package/dist/generate/writeOneClientFile.mjs +6 -12
- package/dist/getProjectInfo/getMetaSchema.d.mts +1 -30
- package/dist/getProjectInfo/getMetaSchema.mjs +1 -24
- package/dist/index.mjs +1 -2
- package/package.json +2 -2
|
@@ -3,12 +3,12 @@ const { createRPC } = require('<%= t.commonImports.createRPC %>');
|
|
|
3
3
|
const { schema } = require('./schema.cjs');
|
|
4
4
|
const { openapi } = require('./openapi.cjs');
|
|
5
5
|
const { validateOnClient = null } = <%- t.imports.validateOnClient ? `require('${t.imports.validateOnClient}')` : '{}'%>;
|
|
6
|
-
<% Object.
|
|
7
|
-
|
|
8
|
-
reExportWhatCommaDivisible.split(/\s*,\s*/).forEach((reExportWhat) => { %>
|
|
6
|
+
<% Object.entries(t.reExports).forEach(([reExportWhatCommaDivisible, reExportFrom]) => {
|
|
7
|
+
reExportWhatCommaDivisible.split(/\s*,\s*/).forEach((reExportWhat) => { %>
|
|
9
8
|
exports['<%= reExportWhat.split(/\s+as\s+/)[1] ?? reExportWhat %>'] = require('<%= reExportFrom %>')['<%= reExportWhat.split(/\s+as\s+/)[0] %>'];
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
<% })
|
|
10
|
+
}) %>
|
|
11
|
+
<% Object.values(t.schema.segments).filter((segment) => segment.emitSchema).forEach((segment) => { %>
|
|
12
12
|
<% Object.keys(segment.controllers).forEach((rpcModuleName) => { %>
|
|
13
13
|
exports.<%= rpcModuleName %> = createRPC(
|
|
14
14
|
schema, '<%= segment.segmentName %>', '<%= rpcModuleName %>', require('<%= t.segmentImports[segment.segmentName].fetcher %>').fetcher,
|
|
@@ -7,11 +7,10 @@ import type { Controllers as Controllers<%= i %> } from "<%= t.segmentMeta[segme
|
|
|
7
7
|
<% if (t.hasMixins) { %>
|
|
8
8
|
import type { Controllers as MixinControllers, Mixins } from "./mixins";
|
|
9
9
|
<% } %>
|
|
10
|
-
|
|
11
|
-
<% Object.values(t.schema.segments).filter((segment) => segment.emitSchema).forEach((segment, i) => { %>
|
|
12
|
-
<% Object.entries(t.segmentMeta[segment.segmentName].reExports).forEach(([reExportWhat, reExportFrom]) => { %>
|
|
10
|
+
<% Object.entries(t.reExports).forEach(([reExportWhat, reExportFrom]) => { %>
|
|
13
11
|
export { <%= reExportWhat %> } from '<%= reExportFrom %>';
|
|
14
|
-
|
|
12
|
+
<% }) %>
|
|
13
|
+
<% Object.values(t.schema.segments).filter((segment) => segment.emitSchema).forEach((segment, i) => { %>
|
|
15
14
|
<% Object.keys(segment.controllers).forEach((rpcModuleName) => { %>
|
|
16
15
|
export const <%= rpcModuleName %>: ReturnType<typeof createRPC<<%= segment.segmentType === 'mixin' ? `MixinControllers` : `Controllers${i}` %>["<%= rpcModuleName %>"], typeof import('<%- t.segmentImports[segment.segmentName].module.fetcher %>').fetcher extends VovkClientFetcher<infer U> ? U : never>>;
|
|
17
16
|
<% })
|
|
@@ -7,11 +7,10 @@ import type { Controllers as Controllers<%= i %> } from "<%= t.segmentMeta[segme
|
|
|
7
7
|
<% if (t.hasMixins) { %>
|
|
8
8
|
import type { Controllers as MixinControllers, Mixins } from "./mixins";
|
|
9
9
|
<% } %>
|
|
10
|
-
|
|
11
|
-
<% Object.values(t.schema.segments).filter((segment) => segment.emitSchema).forEach((segment, i) => { %>
|
|
12
|
-
<% Object.entries(t.segmentMeta[segment.segmentName].reExports).forEach(([reExportWhat, reExportFrom]) => { %>
|
|
10
|
+
<% Object.entries(t.reExports).forEach(([reExportWhat, reExportFrom]) => { %>
|
|
13
11
|
export { <%= reExportWhat %> } from '<%= reExportFrom %>';
|
|
14
|
-
|
|
12
|
+
<% }) %>
|
|
13
|
+
<% Object.values(t.schema.segments).filter((segment) => segment.emitSchema).forEach((segment, i) => { %>
|
|
15
14
|
<% Object.keys(segment.controllers).forEach((rpcModuleName) => { %>
|
|
16
15
|
export const <%= rpcModuleName %>: ReturnType<typeof createRPC<<%= segment.segmentType === 'mixin' ? `MixinControllers` : `Controllers${i}` %>["<%= rpcModuleName %>"], typeof import('<%- t.segmentImports[segment.segmentName].module.fetcher %>').fetcher extends VovkClientFetcher<infer U> ? U : never>>;
|
|
17
16
|
<% })
|
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
import { createRPC } from '<%= t.commonImports.module.createRPC %>';
|
|
3
3
|
import { schema } from './schema.cjs';
|
|
4
4
|
import { openapi } from './openapi.cjs';
|
|
5
|
-
<% Object.
|
|
6
|
-
<% Object.entries(t.segmentMeta[segment.segmentName].reExports).forEach(([reExportWhat, reExportFrom]) => { %>
|
|
5
|
+
<% Object.entries(t.reExports).forEach(([reExportWhat, reExportFrom]) => { %>
|
|
7
6
|
export { <%= reExportWhat %> } from '<%= reExportFrom %>';
|
|
8
|
-
|
|
7
|
+
<% }) %>
|
|
8
|
+
<% Object.values(t.schema.segments).filter((segment) => segment.emitSchema).forEach((segment, i) => { %>
|
|
9
9
|
<% Object.keys(segment.controllers).forEach((rpcModuleName) => { %>
|
|
10
10
|
export const <%= rpcModuleName %> = createRPC(
|
|
11
11
|
schema, '<%= segment.segmentName %>', '<%= rpcModuleName %>', import('<%- t.segmentImports[segment.segmentName].module.fetcher %>'),
|
|
@@ -10,10 +10,10 @@ import type { Controllers as Controllers<%= i %> } from "<%= t.segmentMeta[segme
|
|
|
10
10
|
if (t.hasMixins) { %>
|
|
11
11
|
import type { Controllers as MixinControllers, Mixins } from "./mixins.d.ts";
|
|
12
12
|
<% } %>
|
|
13
|
-
<% Object.
|
|
14
|
-
<% Object.entries(t.segmentMeta[segment.segmentName].reExports).forEach(([reExportWhat, reExportFrom]) => { %>
|
|
13
|
+
<% Object.entries(t.reExports).forEach(([reExportWhat, reExportFrom]) => { %>
|
|
15
14
|
export { <%= reExportWhat %> } from '<%= reExportFrom %>';
|
|
16
|
-
|
|
15
|
+
<% }) %>
|
|
16
|
+
<% Object.values(t.schema.segments).filter((segment) => segment.emitSchema).forEach((segment, i) => { %>
|
|
17
17
|
<% Object.keys(segment.controllers).forEach((rpcModuleName) => { %>
|
|
18
18
|
export const <%= rpcModuleName %> = createRPC<<%= segment.segmentType === 'mixin' ? `MixinControllers` : `Controllers${i}` %>["<%= rpcModuleName %>"], typeof import('<%- t.segmentImports[segment.segmentName].module.fetcher %>').fetcher extends VovkClientFetcher<infer U> ? U : never>(
|
|
19
19
|
schema, '<%= segment.segmentName %>', '<%= rpcModuleName %>', import('<%- t.segmentImports[segment.segmentName].module.fetcher %>'),
|
package/dist/dev/index.mjs
CHANGED
|
@@ -7,7 +7,6 @@ export default async function writeMetaJson(schemaOutAbsolutePath, projectInfo)
|
|
|
7
7
|
const metaJsonPath = path.join(schemaOutAbsolutePath, META_FILE_NAME + '.json');
|
|
8
8
|
const metaStr = JSON.stringify(getMetaSchema({
|
|
9
9
|
config: projectInfo.config,
|
|
10
|
-
package: projectInfo.packageJson,
|
|
11
10
|
}), null, 2);
|
|
12
11
|
const existingStr = await fs.readFile(metaJsonPath, 'utf-8').catch(() => null);
|
|
13
12
|
if (existingStr !== metaStr) {
|
|
@@ -21,7 +21,7 @@ export default async function ensureClient(projectInfo, locatedSegments) {
|
|
|
21
21
|
fullSchema: {
|
|
22
22
|
$schema: VovkSchemaIdEnum.SCHEMA,
|
|
23
23
|
segments: getEmptySegmentRecordSchema(locatedSegments.map(({ segmentName }) => segmentName)),
|
|
24
|
-
meta: getMetaSchema({ config: projectInfo.config
|
|
24
|
+
meta: getMetaSchema({ config: projectInfo.config }),
|
|
25
25
|
},
|
|
26
26
|
locatedSegments,
|
|
27
27
|
});
|
|
@@ -93,7 +93,7 @@ export async function generate({ isEnsuringClient = false, isBundle = false, pro
|
|
|
93
93
|
// preserve original object, so segments can be extended
|
|
94
94
|
.map((segment) => ({ ...segment }))),
|
|
95
95
|
};
|
|
96
|
-
const { config, cwd, log, srcRoot, vovkCliPackage } = projectInfo;
|
|
96
|
+
const { config, cwd, log, srcRoot, vovkCliPackage, packageJson: projectPackageJson } = projectInfo;
|
|
97
97
|
Object.entries(config.generatorConfig.segments ?? {})
|
|
98
98
|
.filter(([, segmentConfig]) => segmentConfig.openAPIMixin)
|
|
99
99
|
.forEach(([segmentName, segmentConfig]) => {
|
|
@@ -135,9 +135,10 @@ export async function generate({ isEnsuringClient = false, isBundle = false, pro
|
|
|
135
135
|
const matterResult = templateFilePath.endsWith('.ejs')
|
|
136
136
|
? matter(templateContent)
|
|
137
137
|
: { data: { imports: [] }, content: templateContent };
|
|
138
|
-
const { package: packageJson, readme, origin, snippets, } = getGeneratorConfig({
|
|
138
|
+
const { package: packageJson, readme, origin, snippets, reExports, } = getGeneratorConfig({
|
|
139
139
|
schema: fullSchema,
|
|
140
|
-
|
|
140
|
+
configs: [templateDef.generatorConfig ?? {}],
|
|
141
|
+
projectPackageJson,
|
|
141
142
|
isBundle,
|
|
142
143
|
segmentName: null,
|
|
143
144
|
});
|
|
@@ -163,6 +164,7 @@ export async function generate({ isEnsuringClient = false, isBundle = false, pro
|
|
|
163
164
|
package: packageJson,
|
|
164
165
|
readme,
|
|
165
166
|
snippets,
|
|
167
|
+
reExports,
|
|
166
168
|
isEnsuringClient,
|
|
167
169
|
outCwdRelativeDir,
|
|
168
170
|
templateDef,
|
|
@@ -216,9 +218,10 @@ export async function generate({ isEnsuringClient = false, isBundle = false, pro
|
|
|
216
218
|
? matter(templateContent)
|
|
217
219
|
: { data: { imports: [] }, content: templateContent };
|
|
218
220
|
const results = await Promise.all(segmentNames.map(async (segmentName) => {
|
|
219
|
-
const { package: packageJson, readme, origin, snippets, } = getGeneratorConfig({
|
|
221
|
+
const { package: packageJson, readme, origin, snippets, reExports, } = getGeneratorConfig({
|
|
220
222
|
schema: fullSchema,
|
|
221
|
-
|
|
223
|
+
configs: [templateDef.generatorConfig ?? {}],
|
|
224
|
+
projectPackageJson,
|
|
222
225
|
segmentName,
|
|
223
226
|
isBundle,
|
|
224
227
|
});
|
|
@@ -245,6 +248,7 @@ export async function generate({ isEnsuringClient = false, isBundle = false, pro
|
|
|
245
248
|
package: packageJson,
|
|
246
249
|
readme,
|
|
247
250
|
snippets,
|
|
251
|
+
reExports,
|
|
248
252
|
isEnsuringClient,
|
|
249
253
|
outCwdRelativeDir,
|
|
250
254
|
templateDef,
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { VovkStrictConfig, type VovkSchema } from 'vovk';
|
|
2
2
|
import type { ProjectInfo } from '../getProjectInfo/index.mjs';
|
|
3
|
-
|
|
4
|
-
export declare function getProjectFullSchema({ schemaOutAbsolutePath, isNextInstalled, log, package: packageJson, config, }: {
|
|
3
|
+
export declare function getProjectFullSchema({ schemaOutAbsolutePath, isNextInstalled, log, config, }: {
|
|
5
4
|
schemaOutAbsolutePath: string;
|
|
6
5
|
isNextInstalled: boolean;
|
|
7
6
|
log: ProjectInfo['log'];
|
|
8
|
-
package: PackageJson;
|
|
9
7
|
config: VovkStrictConfig;
|
|
10
8
|
}): Promise<VovkSchema>;
|
|
@@ -4,13 +4,12 @@ import { glob } from 'glob';
|
|
|
4
4
|
import { VovkSchemaIdEnum } from 'vovk';
|
|
5
5
|
import { META_FILE_NAME, ROOT_SEGMENT_FILE_NAME } from '../dev/writeOneSegmentSchemaFile.mjs';
|
|
6
6
|
import getMetaSchema from '../getProjectInfo/getMetaSchema.mjs';
|
|
7
|
-
export async function getProjectFullSchema({ schemaOutAbsolutePath, isNextInstalled, log,
|
|
7
|
+
export async function getProjectFullSchema({ schemaOutAbsolutePath, isNextInstalled, log, config, }) {
|
|
8
8
|
const result = {
|
|
9
9
|
$schema: VovkSchemaIdEnum.SCHEMA,
|
|
10
10
|
segments: {},
|
|
11
11
|
meta: getMetaSchema({
|
|
12
12
|
config,
|
|
13
|
-
package: packageJson,
|
|
14
13
|
}),
|
|
15
14
|
};
|
|
16
15
|
const isEmptyLogOrWarn = isNextInstalled ? log.warn : log.debug;
|
package/dist/generate/index.mjs
CHANGED
|
@@ -37,13 +37,12 @@ export class VovkGenerate {
|
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
async getFullSchema() {
|
|
40
|
-
const { log, config, cwd, isNextInstalled
|
|
40
|
+
const { log, config, cwd, isNextInstalled } = this.#projectInfo;
|
|
41
41
|
const { schemaPath } = this.#cliGenerateOptions;
|
|
42
42
|
const fullSchema = await getProjectFullSchema({
|
|
43
43
|
schemaOutAbsolutePath: path.resolve(cwd, schemaPath ?? config.schemaOutDir),
|
|
44
44
|
isNextInstalled,
|
|
45
45
|
log,
|
|
46
|
-
package: packageJson,
|
|
47
46
|
config,
|
|
48
47
|
});
|
|
49
48
|
return fullSchema;
|
|
@@ -5,7 +5,7 @@ import type { ClientTemplateFile } from './getClientTemplateFiles.mjs';
|
|
|
5
5
|
import type { Segment } from '../locateSegments.mjs';
|
|
6
6
|
import { OpenAPIObject } from 'openapi3-ts/oas31';
|
|
7
7
|
export declare function normalizeOutTemplatePath(out: string, packageJson: PackageJson): string;
|
|
8
|
-
export default function writeOneClientFile({ cwd, projectInfo, clientTemplateFile, fullSchema, prettifyClient, segmentName, templateContent, matterResult: { data, content }, openapi, package: packageJson, readme, snippets, isEnsuringClient, outCwdRelativeDir, locatedSegments, isNodeNextResolution, hasMixins, isVovkProject, vovkCliPackage, isBundle, origin, configKey, cliSchemaPath, }: {
|
|
8
|
+
export default function writeOneClientFile({ cwd, projectInfo, clientTemplateFile, fullSchema, prettifyClient, segmentName, templateContent, matterResult: { data, content }, openapi, package: packageJson, readme, snippets, reExports, isEnsuringClient, outCwdRelativeDir, locatedSegments, isNodeNextResolution, hasMixins, isVovkProject, vovkCliPackage, isBundle, origin, configKey, cliSchemaPath, }: {
|
|
9
9
|
cwd: string;
|
|
10
10
|
projectInfo: ProjectInfo;
|
|
11
11
|
clientTemplateFile: ClientTemplateFile;
|
|
@@ -23,6 +23,7 @@ export default function writeOneClientFile({ cwd, projectInfo, clientTemplateFil
|
|
|
23
23
|
package: PackageJson;
|
|
24
24
|
readme: VovkReadmeConfig;
|
|
25
25
|
snippets: VovkSnippetsConfig;
|
|
26
|
+
reExports: VovkStrictConfig['generatorConfig']['reExports'];
|
|
26
27
|
isEnsuringClient: boolean;
|
|
27
28
|
outCwdRelativeDir: string;
|
|
28
29
|
templateDef: VovkStrictConfig['clientTemplateDefs'][string];
|
|
@@ -14,18 +14,18 @@ export function normalizeOutTemplatePath(out, packageJson) {
|
|
|
14
14
|
}
|
|
15
15
|
export default async function writeOneClientFile({ cwd, projectInfo, clientTemplateFile, fullSchema, prettifyClient, segmentName,
|
|
16
16
|
// imports,
|
|
17
|
-
templateContent, matterResult: { data, content }, openapi, package: packageJson, readme, snippets, isEnsuringClient, outCwdRelativeDir,
|
|
17
|
+
templateContent, matterResult: { data, content }, openapi, package: packageJson, readme, snippets, reExports, isEnsuringClient, outCwdRelativeDir,
|
|
18
18
|
// templateDef,
|
|
19
19
|
locatedSegments, isNodeNextResolution, hasMixins, isVovkProject, vovkCliPackage, isBundle, origin, configKey, cliSchemaPath, }) {
|
|
20
20
|
const { config, apiRoot } = projectInfo;
|
|
21
21
|
const { templateFilePath, relativeDir } = clientTemplateFile;
|
|
22
22
|
const locatedSegmentsByName = _.keyBy(locatedSegments, 'segmentName');
|
|
23
23
|
const outPath = normalizeOutTemplatePath(path.resolve(cwd, outCwdRelativeDir, typeof segmentName === 'string' ? segmentName || ROOT_SEGMENT_FILE_NAME : '', relativeDir, path.basename(templateFilePath).replace('.ejs', '')), packageJson);
|
|
24
|
-
let placeholder =
|
|
25
|
-
?
|
|
24
|
+
let placeholder = templateFilePath.endsWith('.json.ejs')
|
|
25
|
+
? ''
|
|
26
|
+
: `// This is a temporary placeholder to avoid compilation errors if client is imported before it's generated.
|
|
26
27
|
// If you still see this text, the client is not generated yet because of an unknown problem.
|
|
27
|
-
// Feel free to report an issue at https://github.com/finom/vovk/issues
|
|
28
|
-
: '{}';
|
|
28
|
+
// Feel free to report an issue at https://github.com/finom/vovk/issues`;
|
|
29
29
|
placeholder = outPath.endsWith('.py') ? placeholder.replace(/\/\//g, '#') : placeholder;
|
|
30
30
|
const getFirstLineBanner = (type = 'c') => {
|
|
31
31
|
const text = `auto-generated by vovk-cli v${vovkCliPackage.version} at ${new Date().toISOString()}`;
|
|
@@ -46,6 +46,7 @@ locatedSegments, isNodeNextResolution, hasMixins, isVovkProject, vovkCliPackage,
|
|
|
46
46
|
package: packageJson,
|
|
47
47
|
readme,
|
|
48
48
|
snippets,
|
|
49
|
+
reExports,
|
|
49
50
|
openapi,
|
|
50
51
|
ROOT_SEGMENT_FILE_NAME,
|
|
51
52
|
apiRoot: origin ? `${origin}/${config.rootEntry}` : apiRoot,
|
|
@@ -82,10 +83,6 @@ locatedSegments, isNodeNextResolution, hasMixins, isVovkProject, vovkCliPackage,
|
|
|
82
83
|
// ...templateDef.generatorConfig?.segments?.[sName],
|
|
83
84
|
};
|
|
84
85
|
const { origin: segmentConfigOrigin, rootEntry: segmentConfigRootEntry, segmentNameOverride } = segmentConfig;
|
|
85
|
-
const reExports = {
|
|
86
|
-
...segmentConfig.reExports,
|
|
87
|
-
...(isBundle ? projectInfo.config.bundle.generatorConfig?.reExports : {}),
|
|
88
|
-
};
|
|
89
86
|
return [
|
|
90
87
|
sName,
|
|
91
88
|
{
|
|
@@ -96,9 +93,6 @@ locatedSegments, isNodeNextResolution, hasMixins, isVovkProject, vovkCliPackage,
|
|
|
96
93
|
routeFilePath,
|
|
97
94
|
segmentImportPath,
|
|
98
95
|
segmentNameOverride,
|
|
99
|
-
reExports: _.mapValues(reExports ?? {}, (p) => p.startsWith('.')
|
|
100
|
-
? path.relative(path.join(outCwdRelativeDir, typeof segmentName === 'string' ? segmentName || ROOT_SEGMENT_FILE_NAME : '.'), path.resolve(cwd, p))
|
|
101
|
-
: p),
|
|
102
96
|
},
|
|
103
97
|
];
|
|
104
98
|
})),
|
|
@@ -1,36 +1,7 @@
|
|
|
1
1
|
import { VovkSchemaIdEnum, VovkStrictConfig } from 'vovk';
|
|
2
|
-
|
|
3
|
-
export default function getMetaSchema({ config, package: packageJson, }: {
|
|
2
|
+
export default function getMetaSchema({ config }: {
|
|
4
3
|
config: VovkStrictConfig;
|
|
5
|
-
package: PackageJson;
|
|
6
4
|
}): {
|
|
7
5
|
config: VovkStrictConfig;
|
|
8
6
|
$schema: VovkSchemaIdEnum;
|
|
9
|
-
package: {
|
|
10
|
-
main: string;
|
|
11
|
-
module: string;
|
|
12
|
-
types: string;
|
|
13
|
-
exports: {
|
|
14
|
-
'.': {
|
|
15
|
-
import: string;
|
|
16
|
-
require: string;
|
|
17
|
-
types: string;
|
|
18
|
-
};
|
|
19
|
-
'./schema': {
|
|
20
|
-
import: string;
|
|
21
|
-
require: string;
|
|
22
|
-
types: string;
|
|
23
|
-
};
|
|
24
|
-
'./openapi': {
|
|
25
|
-
import: string;
|
|
26
|
-
require: string;
|
|
27
|
-
types: string;
|
|
28
|
-
};
|
|
29
|
-
};
|
|
30
|
-
name?: string | undefined;
|
|
31
|
-
version?: string | undefined;
|
|
32
|
-
description?: string | undefined;
|
|
33
|
-
author?: PackageJson.Person | undefined;
|
|
34
|
-
license?: string | undefined;
|
|
35
|
-
};
|
|
36
7
|
};
|
|
@@ -1,31 +1,8 @@
|
|
|
1
1
|
import { VovkSchemaIdEnum } from 'vovk';
|
|
2
2
|
import pick from 'lodash/pick.js';
|
|
3
|
-
export default function getMetaSchema({ config
|
|
3
|
+
export default function getMetaSchema({ config }) {
|
|
4
4
|
return {
|
|
5
5
|
$schema: VovkSchemaIdEnum.META,
|
|
6
|
-
package: {
|
|
7
|
-
...pick(packageJson, ['name', 'version', 'description', 'author', 'license']),
|
|
8
|
-
main: './index.cjs',
|
|
9
|
-
module: './index.mjs',
|
|
10
|
-
types: './index.d.mts',
|
|
11
|
-
exports: {
|
|
12
|
-
'.': {
|
|
13
|
-
import: './index.mjs',
|
|
14
|
-
require: './index.cjs',
|
|
15
|
-
types: './index.d.mts',
|
|
16
|
-
},
|
|
17
|
-
'./schema': {
|
|
18
|
-
import: './schema.cjs',
|
|
19
|
-
require: './schema.cjs',
|
|
20
|
-
types: './schema.d.cts',
|
|
21
|
-
},
|
|
22
|
-
'./openapi': {
|
|
23
|
-
import: './openapi.cjs',
|
|
24
|
-
require: './openapi.cjs',
|
|
25
|
-
types: './openapi.d.cts',
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
6
|
...{
|
|
30
7
|
config: (config
|
|
31
8
|
? pick(config, [...config.emitConfig, '$schema'])
|
package/dist/index.mjs
CHANGED
|
@@ -138,12 +138,11 @@ program
|
|
|
138
138
|
srcRootRequired: false,
|
|
139
139
|
logLevel: cliBundleOptions.logLevel,
|
|
140
140
|
});
|
|
141
|
-
const { cwd, config, log, isNextInstalled
|
|
141
|
+
const { cwd, config, log, isNextInstalled } = projectInfo;
|
|
142
142
|
const fullSchema = await getProjectFullSchema({
|
|
143
143
|
schemaOutAbsolutePath: path.resolve(cwd, cliBundleOptions?.schema ?? config.schemaOutDir),
|
|
144
144
|
log,
|
|
145
145
|
isNextInstalled,
|
|
146
|
-
package: packageJson,
|
|
147
146
|
config,
|
|
148
147
|
});
|
|
149
148
|
await bundle({
|
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.346",
|
|
4
4
|
"bin": {
|
|
5
5
|
"vovk": "./dist/index.mjs"
|
|
6
6
|
},
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
},
|
|
36
36
|
"homepage": "https://vovk.dev",
|
|
37
37
|
"peerDependencies": {
|
|
38
|
-
"vovk": "^3.0.0-draft.
|
|
38
|
+
"vovk": "^3.0.0-draft.407"
|
|
39
39
|
},
|
|
40
40
|
"optionalDependencies": {
|
|
41
41
|
"@rolldown/binding-linux-x64-gnu": "1.0.0-beta.31"
|