vovk-cli 0.1.2 → 0.2.0
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/bundle/index.d.mts +1 -1
- package/dist/bundle/index.mjs +3 -3
- package/dist/dev/{ensureSchemaFiles.d.mts → ensure-schema-files.d.mts} +1 -1
- package/dist/dev/{ensureSchemaFiles.mjs → ensure-schema-files.mjs} +3 -3
- package/dist/dev/index.mjs +11 -11
- package/dist/dev/log-diff-result.d.mts +3 -0
- package/dist/dev/{logDiffResult.mjs → log-diff-result.mjs} +2 -2
- package/dist/dev/{writeMetaJson.d.mts → write-meta-json.d.mts} +1 -1
- package/dist/dev/{writeMetaJson.mjs → write-meta-json.mjs} +3 -3
- package/dist/dev/{writeOneSegmentSchemaFile.d.mts → write-one-segment-schema-file.d.mts} +1 -1
- package/dist/dev/{writeOneSegmentSchemaFile.mjs → write-one-segment-schema-file.mjs} +2 -2
- package/dist/generate/ensure-client.d.mts +3 -0
- package/dist/generate/{ensureClient.mjs → ensure-client.mjs} +1 -1
- package/dist/generate/generate.d.mts +2 -2
- package/dist/generate/generate.mjs +8 -8
- package/dist/generate/{getClientTemplateFiles.d.mts → get-client-template-files.d.mts} +1 -1
- package/dist/generate/{getClientTemplateFiles.mjs → get-client-template-files.mjs} +3 -3
- package/dist/generate/{getProjectFullSchema.d.mts → get-project-full-schema.d.mts} +1 -1
- package/dist/generate/{getProjectFullSchema.mjs → get-project-full-schema.mjs} +2 -2
- package/dist/generate/{getTemplateClientImports.mjs → get-template-client-imports.mjs} +2 -2
- package/dist/generate/index.d.mts +1 -1
- package/dist/generate/index.mjs +3 -3
- package/dist/generate/{writeOneClientFile.d.mts → write-one-client-file.d.mts} +3 -3
- package/dist/generate/{writeOneClientFile.mjs → write-one-client-file.mjs} +6 -5
- package/dist/{getProjectInfo/getConfig/getRelativeSrcRoot.mjs → get-project-info/get-config/get-relative-src-root.mjs} +1 -1
- package/dist/{getProjectInfo/getConfig/getTemplateDefs.mjs → get-project-info/get-config/get-template-defs.mjs} +17 -17
- package/dist/{getProjectInfo/getConfig/getUserConfig.mjs → get-project-info/get-config/get-user-config.mjs} +1 -1
- package/dist/{getProjectInfo/getConfig → get-project-info/get-config}/index.d.mts +1 -1
- package/dist/{getProjectInfo/getConfig → get-project-info/get-config}/index.mjs +6 -6
- package/dist/{getProjectInfo → get-project-info}/index.mjs +2 -2
- package/dist/index.mjs +3 -3
- package/dist/init/{createConfig.d.mts → create-config.d.mts} +1 -1
- package/dist/init/{createConfig.mjs → create-config.mjs} +2 -2
- package/dist/init/index.d.mts +1 -1
- package/dist/init/index.mjs +11 -11
- package/dist/init/{installDependencies.d.mts → install-dependencies.d.mts} +1 -1
- package/dist/init/{installDependencies.mjs → install-dependencies.mjs} +1 -1
- package/dist/init/{logUpdateDependenciesError.d.mts → log-update-dependencies-error.d.mts} +2 -2
- package/dist/init/{logUpdateDependenciesError.mjs → log-update-dependencies-error.mjs} +1 -1
- package/dist/init/{updateDependenciesWithoutInstalling.d.mts → update-dependencies-without-installing.d.mts} +1 -1
- package/dist/init/{updateDependenciesWithoutInstalling.mjs → update-dependencies-without-installing.mjs} +1 -1
- package/dist/init/{updateTypeScriptConfig.d.mts → update-typescript-config.d.mts} +0 -1
- package/dist/new/index.d.mts +1 -1
- package/dist/new/index.mjs +2 -2
- package/dist/new/{newModule.d.mts → new-module.d.mts} +1 -1
- package/dist/new/{newModule.mjs → new-module.mjs} +17 -6
- package/dist/new/{newSegment.d.mts → new-segment.d.mts} +1 -1
- package/dist/new/{newSegment.mjs → new-segment.mjs} +3 -3
- package/dist/new/render.mjs +2 -2
- package/dist/utils/{compileJSONSchemaToTypeScriptType.mjs → compile-json-schema-to-typescript-type.mjs} +1 -1
- package/dist/utils/{formatLoggedSegmentName.mjs → format-logged-segment-name.mjs} +1 -1
- package/dist/utils/{getPackageJson.d.mts → get-package-json.d.mts} +1 -1
- package/dist/utils/{getPackageJson.mjs → get-package-json.mjs} +1 -1
- package/dist/utils/{locateSegments.d.mts → locate-segments.d.mts} +1 -1
- package/dist/utils/{locateSegments.mjs → locate-segments.mjs} +1 -1
- package/dist/utils/{normalizeOpenAPIMixin.d.mts → normalize-openapi-mixin.d.mts} +1 -1
- package/dist/utils/{normalizeOpenAPIMixin.mjs → normalize-openapi-mixin.mjs} +2 -2
- package/dist/utils/{removeUnlistedDirectories.mjs → remove-unlisted-directories.mjs} +1 -1
- package/dist/utils/{resolveAbsoluteModulePath.mjs → resolve-absolute-module-path.mjs} +1 -1
- package/module-templates/arktype/controller.ts.ejs +2 -2
- package/module-templates/type/controller.ts.ejs +2 -2
- package/module-templates/type/service.ts.ejs +2 -2
- package/module-templates/valibot/controller.ts.ejs +2 -2
- package/module-templates/zod/controller.ts.ejs +2 -2
- package/package.json +12 -12
- package/dist/dev/logDiffResult.d.mts +0 -3
- package/dist/generate/ensureClient.d.mts +0 -3
- /package/client-templates/{jsBase → js-base}/index.d.ts.ejs +0 -0
- /package/client-templates/{jsBase → js-base}/index.js.ejs +0 -0
- /package/client-templates/{openapiJs → openapi-js}/openapi.d.ts.ejs +0 -0
- /package/client-templates/{openapiJs → openapi-js}/openapi.js.ejs +0 -0
- /package/client-templates/{openapiJson → openapi-json}/openapi.json.ejs +0 -0
- /package/client-templates/{openapiTs → openapi-ts}/openapi.ts.ejs +0 -0
- /package/client-templates/{packageJson → package-json}/package.json.ejs +0 -0
- /package/client-templates/{schemaJs → schema-js}/schema.d.ts.ejs +0 -0
- /package/client-templates/{schemaJs → schema-js}/schema.js.ejs +0 -0
- /package/client-templates/{schemaJson → schema-json}/schema.json.ejs +0 -0
- /package/client-templates/{schemaTs → schema-ts}/schema.ts.ejs +0 -0
- /package/client-templates/{tsBase → ts-base}/index.ts.ejs +0 -0
- /package/dist/dev/{diffSegmentSchema.d.mts → diff-segment-schema.d.mts} +0 -0
- /package/dist/dev/{diffSegmentSchema.mjs → diff-segment-schema.mjs} +0 -0
- /package/dist/generate/{getTemplateClientImports.d.mts → get-template-client-imports.d.mts} +0 -0
- /package/dist/{getProjectInfo/getConfig/getConfigAbsolutePaths.d.mts → get-project-info/get-config/get-config-absolute-paths.d.mts} +0 -0
- /package/dist/{getProjectInfo/getConfig/getConfigAbsolutePaths.mjs → get-project-info/get-config/get-config-absolute-paths.mjs} +0 -0
- /package/dist/{getProjectInfo/getConfig/getRelativeSrcRoot.d.mts → get-project-info/get-config/get-relative-src-root.d.mts} +0 -0
- /package/dist/{getProjectInfo/getConfig/getTemplateDefs.d.mts → get-project-info/get-config/get-template-defs.d.mts} +0 -0
- /package/dist/{getProjectInfo/getConfig/getUserConfig.d.mts → get-project-info/get-config/get-user-config.d.mts} +0 -0
- /package/dist/{getProjectInfo/getMetaSchema.d.mts → get-project-info/get-meta-schema.d.mts} +0 -0
- /package/dist/{getProjectInfo/getMetaSchema.mjs → get-project-info/get-meta-schema.mjs} +0 -0
- /package/dist/{getProjectInfo → get-project-info}/index.d.mts +0 -0
- /package/dist/init/{checkTSConfigForExperimentalDecorators.d.mts → check-tsconfig-for-experimental-decorators.d.mts} +0 -0
- /package/dist/init/{checkTSConfigForExperimentalDecorators.mjs → check-tsconfig-for-experimental-decorators.mjs} +0 -0
- /package/dist/init/{updateNPMScripts.d.mts → update-npm-scripts.d.mts} +0 -0
- /package/dist/init/{updateNPMScripts.mjs → update-npm-scripts.mjs} +0 -0
- /package/dist/init/{updateTypeScriptConfig.mjs → update-typescript-config.mjs} +0 -0
- /package/dist/new/{addClassToSegmentCode.d.mts → add-class-to-segment-code.d.mts} +0 -0
- /package/dist/new/{addClassToSegmentCode.mjs → add-class-to-segment-code.mjs} +0 -0
- /package/dist/new/{addCommonTerms.d.mts → add-common-terms.d.mts} +0 -0
- /package/dist/new/{addCommonTerms.mjs → add-common-terms.mjs} +0 -0
- /package/dist/utils/{chalkHighlightThing.d.mts → chalk-highlight-thing.d.mts} +0 -0
- /package/dist/utils/{chalkHighlightThing.mjs → chalk-highlight-thing.mjs} +0 -0
- /package/dist/utils/{compileJSONSchemaToTypeScriptType.d.mts → compile-json-schema-to-typescript-type.d.mts} +0 -0
- /package/dist/utils/{compileTs.d.mts → compile-ts.d.mts} +0 -0
- /package/dist/utils/{compileTs.mjs → compile-ts.mjs} +0 -0
- /package/dist/utils/{debounceWithArgs.d.mts → debounce-with-args.d.mts} +0 -0
- /package/dist/utils/{debounceWithArgs.mjs → debounce-with-args.mjs} +0 -0
- /package/dist/utils/{formatLoggedSegmentName.d.mts → format-logged-segment-name.d.mts} +0 -0
- /package/dist/utils/{generateFnName.d.mts → generate-fn-name.d.mts} +0 -0
- /package/dist/utils/{generateFnName.mjs → generate-fn-name.mjs} +0 -0
- /package/dist/utils/{getAvailablePort.d.mts → get-available-port.d.mts} +0 -0
- /package/dist/utils/{getAvailablePort.mjs → get-available-port.mjs} +0 -0
- /package/dist/utils/{getFileSystemEntryType.d.mts → get-file-system-entry-type.d.mts} +0 -0
- /package/dist/utils/{getFileSystemEntryType.mjs → get-file-system-entry-type.mjs} +0 -0
- /package/dist/utils/{getLogger.d.mts → get-logger.d.mts} +0 -0
- /package/dist/utils/{getLogger.mjs → get-logger.mjs} +0 -0
- /package/dist/utils/{getNPMPackageMetadata.d.mts → get-npm-package-metadata.d.mts} +0 -0
- /package/dist/utils/{getNPMPackageMetadata.mjs → get-npm-package-metadata.mjs} +0 -0
- /package/dist/utils/{getPublicModuleNameFromPath.d.mts → get-public-module-name-from-path.d.mts} +0 -0
- /package/dist/utils/{getPublicModuleNameFromPath.mjs → get-public-module-name-from-path.mjs} +0 -0
- /package/dist/utils/{pickSegmentFullSchema.d.mts → pick-segment-full-schema.d.mts} +0 -0
- /package/dist/utils/{pickSegmentFullSchema.mjs → pick-segment-full-schema.mjs} +0 -0
- /package/dist/utils/{removeUnlistedDirectories.d.mts → remove-unlisted-directories.d.mts} +0 -0
- /package/dist/utils/{resolveAbsoluteModulePath.d.mts → resolve-absolute-module-path.d.mts} +0 -0
- /package/dist/utils/{updateConfigProperty.d.mts → update-config-property.d.mts} +0 -0
- /package/dist/utils/{updateConfigProperty.mjs → update-config-property.mjs} +0 -0
package/dist/bundle/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { VovkSchema } from 'vovk';
|
|
2
|
-
import type { ProjectInfo } from '../
|
|
2
|
+
import type { ProjectInfo } from '../get-project-info/index.mjs';
|
|
3
3
|
import type { BundleOptions } from '../types.mjs';
|
|
4
4
|
export declare function bundle({ projectInfo, fullSchema, cliBundleOptions, }: {
|
|
5
5
|
projectInfo: ProjectInfo;
|
package/dist/bundle/index.mjs
CHANGED
|
@@ -2,9 +2,9 @@ import path from 'node:path';
|
|
|
2
2
|
import fs from 'node:fs/promises';
|
|
3
3
|
import groupBy from 'lodash/groupBy.js';
|
|
4
4
|
import { generate } from '../generate/generate.mjs';
|
|
5
|
-
import { BuiltInTemplateName } from '../
|
|
6
|
-
import { chalkHighlightThing } from '../utils/
|
|
7
|
-
import { locateSegments } from '../utils/
|
|
5
|
+
import { BuiltInTemplateName } from '../get-project-info/get-config/get-template-defs.mjs';
|
|
6
|
+
import { chalkHighlightThing } from '../utils/chalk-highlight-thing.mjs';
|
|
7
|
+
import { locateSegments } from '../utils/locate-segments.mjs';
|
|
8
8
|
export async function bundle({ projectInfo, fullSchema, cliBundleOptions, }) {
|
|
9
9
|
const { config, log, cwd, apiDirAbsolutePath } = projectInfo;
|
|
10
10
|
const locatedSegments = await locateSegments({ dir: apiDirAbsolutePath, config, log });
|
|
@@ -2,9 +2,9 @@ import fs from 'node:fs/promises';
|
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import debounce from 'lodash/debounce.js';
|
|
4
4
|
import { VovkSchemaIdEnum } from 'vovk/internal';
|
|
5
|
-
import { writeOneSegmentSchemaFile, META_FILE_NAME, ROOT_SEGMENT_FILE_NAME } from './
|
|
6
|
-
import { formatLoggedSegmentName } from '../utils/
|
|
7
|
-
import { writeMetaJson } from './
|
|
5
|
+
import { writeOneSegmentSchemaFile, META_FILE_NAME, ROOT_SEGMENT_FILE_NAME } from './write-one-segment-schema-file.mjs';
|
|
6
|
+
import { formatLoggedSegmentName } from '../utils/format-logged-segment-name.mjs';
|
|
7
|
+
import { writeMetaJson } from './write-meta-json.mjs';
|
|
8
8
|
/**
|
|
9
9
|
* Ensure that the schema files are created to avoid any import errors.
|
|
10
10
|
*/
|
package/dist/dev/index.mjs
CHANGED
|
@@ -8,18 +8,18 @@ import capitalize from 'lodash/capitalize.js';
|
|
|
8
8
|
import debounce from 'lodash/debounce.js';
|
|
9
9
|
import once from 'lodash/once.js';
|
|
10
10
|
import isEmpty from 'lodash/isEmpty.js';
|
|
11
|
-
import { ensureSchemaFiles, debouncedEnsureSchemaFiles } from './
|
|
12
|
-
import { writeOneSegmentSchemaFile } from './
|
|
13
|
-
import { logDiffResult } from './
|
|
14
|
-
import { ensureClient } from '../generate/
|
|
15
|
-
import { getProjectInfo } from '../
|
|
11
|
+
import { ensureSchemaFiles, debouncedEnsureSchemaFiles } from './ensure-schema-files.mjs';
|
|
12
|
+
import { writeOneSegmentSchemaFile } from './write-one-segment-schema-file.mjs';
|
|
13
|
+
import { logDiffResult } from './log-diff-result.mjs';
|
|
14
|
+
import { ensureClient } from '../generate/ensure-client.mjs';
|
|
15
|
+
import { getProjectInfo } from '../get-project-info/index.mjs';
|
|
16
16
|
import { generate } from '../generate/generate.mjs';
|
|
17
|
-
import { locateSegments } from '../utils/
|
|
18
|
-
import { debounceWithArgs } from '../utils/
|
|
19
|
-
import { formatLoggedSegmentName } from '../utils/
|
|
20
|
-
import { writeMetaJson } from './
|
|
21
|
-
import { chalkHighlightThing } from '../utils/
|
|
22
|
-
import { getMetaSchema } from '../
|
|
17
|
+
import { locateSegments } from '../utils/locate-segments.mjs';
|
|
18
|
+
import { debounceWithArgs } from '../utils/debounce-with-args.mjs';
|
|
19
|
+
import { formatLoggedSegmentName } from '../utils/format-logged-segment-name.mjs';
|
|
20
|
+
import { writeMetaJson } from './write-meta-json.mjs';
|
|
21
|
+
import { chalkHighlightThing } from '../utils/chalk-highlight-thing.mjs';
|
|
22
|
+
import { getMetaSchema } from '../get-project-info/get-meta-schema.mjs';
|
|
23
23
|
export class VovkDev {
|
|
24
24
|
#projectInfo;
|
|
25
25
|
#segments = [];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import chalk from 'chalk';
|
|
2
|
-
import { formatLoggedSegmentName } from '../utils/
|
|
3
|
-
import { chalkHighlightThing } from '../utils/
|
|
2
|
+
import { formatLoggedSegmentName } from '../utils/format-logged-segment-name.mjs';
|
|
3
|
+
import { chalkHighlightThing } from '../utils/chalk-highlight-thing.mjs';
|
|
4
4
|
export function logDiffResult(segmentName, diffResult, projectInfo) {
|
|
5
5
|
const diffNormalized = [];
|
|
6
6
|
diffResult.controllers.added.forEach((name) => {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ProjectInfo } from '../
|
|
1
|
+
import type { ProjectInfo } from '../get-project-info/index.mjs';
|
|
2
2
|
export declare function writeMetaJson(schemaOutAbsolutePath: string, projectInfo: ProjectInfo): Promise<void>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
|
-
import { META_FILE_NAME } from './
|
|
4
|
-
import { chalkHighlightThing } from '../utils/
|
|
5
|
-
import { getMetaSchema } from '../
|
|
3
|
+
import { META_FILE_NAME } from './write-one-segment-schema-file.mjs';
|
|
4
|
+
import { chalkHighlightThing } from '../utils/chalk-highlight-thing.mjs';
|
|
5
|
+
import { getMetaSchema } from '../get-project-info/get-meta-schema.mjs';
|
|
6
6
|
export async function writeMetaJson(schemaOutAbsolutePath, projectInfo) {
|
|
7
7
|
const metaJsonPath = path.join(schemaOutAbsolutePath, `${META_FILE_NAME}.json`);
|
|
8
8
|
const metaStr = JSON.stringify(getMetaSchema({
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { VovkSegmentSchema } from 'vovk/internal';
|
|
2
|
-
import { type DiffResult } from './
|
|
2
|
+
import { type DiffResult } from './diff-segment-schema.mjs';
|
|
3
3
|
export declare const ROOT_SEGMENT_FILE_NAME = "root";
|
|
4
4
|
export declare const META_FILE_NAME = "_meta";
|
|
5
5
|
export declare function writeOneSegmentSchemaFile({ schemaOutAbsolutePath, segmentSchema, skipIfExists, }: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import fs from 'node:fs/promises';
|
|
3
|
-
import { diffSegmentSchema } from './
|
|
4
|
-
import { getFileSystemEntryType } from '../utils/
|
|
3
|
+
import { diffSegmentSchema } from './diff-segment-schema.mjs';
|
|
4
|
+
import { getFileSystemEntryType } from '../utils/get-file-system-entry-type.mjs';
|
|
5
5
|
export const ROOT_SEGMENT_FILE_NAME = 'root';
|
|
6
6
|
export const META_FILE_NAME = '_meta';
|
|
7
7
|
export async function writeOneSegmentSchemaFile({ schemaOutAbsolutePath, segmentSchema, skipIfExists = false, }) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VovkSchemaIdEnum } from 'vovk/internal';
|
|
2
2
|
import { generate } from './generate.mjs';
|
|
3
|
-
import { getMetaSchema } from '../
|
|
3
|
+
import { getMetaSchema } from '../get-project-info/get-meta-schema.mjs';
|
|
4
4
|
const getEmptySegmentRecordSchema = (segmentNames) => {
|
|
5
5
|
const result = {};
|
|
6
6
|
for (const segmentName of segmentNames) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { VovkSchema } from 'vovk';
|
|
2
|
-
import type { ProjectInfo } from '../
|
|
2
|
+
import type { ProjectInfo } from '../get-project-info/index.mjs';
|
|
3
3
|
import type { GenerateOptions } from '../types.mjs';
|
|
4
|
-
import type { Segment } from '../utils/
|
|
4
|
+
import type { Segment } from '../utils/locate-segments.mjs';
|
|
5
5
|
export declare function generate({ isEnsuringClient, isBundle, projectInfo, forceNothingWrittenLog, fullSchema, locatedSegments, cliGenerateOptions, }: {
|
|
6
6
|
isEnsuringClient?: boolean;
|
|
7
7
|
isBundle?: boolean;
|
|
@@ -3,15 +3,15 @@ import fs from 'node:fs/promises';
|
|
|
3
3
|
import matter from 'gray-matter';
|
|
4
4
|
import _ from 'lodash';
|
|
5
5
|
import { openAPIToVovkSchema, vovkSchemaToOpenAPI } from 'vovk/internal';
|
|
6
|
-
import { getClientTemplateFiles } from './
|
|
7
|
-
import { chalkHighlightThing } from '../utils/
|
|
8
|
-
import { pickSegmentFullSchema } from '../utils/
|
|
9
|
-
import { removeUnlistedDirectories } from '../utils/
|
|
10
|
-
import { writeOneClientFile, normalizeOutTemplatePath } from './
|
|
11
|
-
import { ROOT_SEGMENT_FILE_NAME } from '../dev/
|
|
6
|
+
import { getClientTemplateFiles } from './get-client-template-files.mjs';
|
|
7
|
+
import { chalkHighlightThing } from '../utils/chalk-highlight-thing.mjs';
|
|
8
|
+
import { pickSegmentFullSchema } from '../utils/pick-segment-full-schema.mjs';
|
|
9
|
+
import { removeUnlistedDirectories } from '../utils/remove-unlisted-directories.mjs';
|
|
10
|
+
import { writeOneClientFile, normalizeOutTemplatePath } from './write-one-client-file.mjs';
|
|
11
|
+
import { ROOT_SEGMENT_FILE_NAME } from '../dev/write-one-segment-schema-file.mjs';
|
|
12
12
|
import { getTsconfig } from 'get-tsconfig';
|
|
13
|
-
import { normalizeOpenAPIMixin } from '../utils/
|
|
14
|
-
import { BuiltInTemplateName } from '../
|
|
13
|
+
import { normalizeOpenAPIMixin } from '../utils/normalize-openapi-mixin.mjs';
|
|
14
|
+
import { BuiltInTemplateName } from '../get-project-info/get-config/get-template-defs.mjs';
|
|
15
15
|
const getIncludedSegmentNames = (config, fullSchema, configKey, cliGenerateOptions) => {
|
|
16
16
|
const segments = Object.values(fullSchema.segments);
|
|
17
17
|
const includeSegments = cliGenerateOptions?.[configKey === 'segmentedClient' ? 'segmentedIncludeSegments' : 'composedIncludeSegments'] ??
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { VovkStrictConfig } from 'vovk/internal';
|
|
2
|
-
import type { ProjectInfo } from '../
|
|
2
|
+
import type { ProjectInfo } from '../get-project-info/index.mjs';
|
|
3
3
|
import type { GenerateOptions } from '../types.mjs';
|
|
4
4
|
export interface ClientTemplateFile {
|
|
5
5
|
templateName: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { glob } from 'glob';
|
|
3
|
-
import { resolveAbsoluteModulePath } from '../utils/
|
|
4
|
-
import { getFileSystemEntryType, FileSystemEntryType } from '../utils/
|
|
5
|
-
import { getPublicModuleNameFromPath } from '../utils/
|
|
3
|
+
import { resolveAbsoluteModulePath } from '../utils/resolve-absolute-module-path.mjs';
|
|
4
|
+
import { getFileSystemEntryType, FileSystemEntryType } from '../utils/get-file-system-entry-type.mjs';
|
|
5
|
+
import { getPublicModuleNameFromPath } from '../utils/get-public-module-name-from-path.mjs';
|
|
6
6
|
import omit from 'lodash/omit.js';
|
|
7
7
|
import merge from 'lodash/merge.js';
|
|
8
8
|
export async function getClientTemplateFiles({ config, cwd, log, configKey, cliGenerateOptions, }) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { VovkSchema } from 'vovk';
|
|
2
|
-
import type { ProjectInfo } from '../
|
|
2
|
+
import type { ProjectInfo } from '../get-project-info/index.mjs';
|
|
3
3
|
import { type VovkStrictConfig } from 'vovk/internal';
|
|
4
4
|
export declare function getProjectFullSchema({ schemaOutAbsolutePath, isNextInstalled, log, config, }: {
|
|
5
5
|
schemaOutAbsolutePath: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { readFile, access } from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import { glob } from 'glob';
|
|
4
|
-
import { META_FILE_NAME, ROOT_SEGMENT_FILE_NAME } from '../dev/
|
|
5
|
-
import { getMetaSchema } from '../
|
|
4
|
+
import { META_FILE_NAME, ROOT_SEGMENT_FILE_NAME } from '../dev/write-one-segment-schema-file.mjs';
|
|
5
|
+
import { getMetaSchema } from '../get-project-info/get-meta-schema.mjs';
|
|
6
6
|
import { deepExtend, VovkSchemaIdEnum } from 'vovk/internal';
|
|
7
7
|
export async function getProjectFullSchema({ schemaOutAbsolutePath, isNextInstalled, log, config, }) {
|
|
8
8
|
const result = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { resolveGeneratorConfigValues } from 'vovk/internal';
|
|
3
|
-
import { ROOT_SEGMENT_FILE_NAME } from '../dev/
|
|
3
|
+
import { ROOT_SEGMENT_FILE_NAME } from '../dev/write-one-segment-schema-file.mjs';
|
|
4
4
|
export function getTemplateClientImports({ config, fullSchema, outCwdRelativeDir, segmentName, isBundle, outputConfigs, }) {
|
|
5
5
|
const { imports: configImports } = resolveGeneratorConfigValues({
|
|
6
6
|
config,
|
|
@@ -12,7 +12,7 @@ export function getTemplateClientImports({ config, fullSchema, outCwdRelativeDir
|
|
|
12
12
|
const imports = {
|
|
13
13
|
fetcher: configImports?.fetcher ?? 'vovk/fetcher',
|
|
14
14
|
validateOnClient: configImports?.validateOnClient ?? null,
|
|
15
|
-
createRPC: configImports?.createRPC ?? 'vovk/
|
|
15
|
+
createRPC: configImports?.createRPC ?? 'vovk/create-rpc',
|
|
16
16
|
};
|
|
17
17
|
const getImportPath = (p, s = '') => p.startsWith('.') ? path.relative(path.join(outCwdRelativeDir, s), p) : p;
|
|
18
18
|
const clientImports = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { VovkSchema } from 'vovk';
|
|
2
2
|
import type { GenerateOptions } from '../types.mjs';
|
|
3
|
-
import type { ProjectInfo } from '../
|
|
3
|
+
import type { ProjectInfo } from '../get-project-info/index.mjs';
|
|
4
4
|
export declare class VovkGenerate {
|
|
5
5
|
#private;
|
|
6
6
|
constructor({ cliGenerateOptions, projectInfo, forceNothingWrittenLog, }: {
|
package/dist/generate/index.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import * as chokidar from 'chokidar';
|
|
3
|
-
import { getProjectFullSchema } from './
|
|
3
|
+
import { getProjectFullSchema } from './get-project-full-schema.mjs';
|
|
4
4
|
import { generate } from './generate.mjs';
|
|
5
|
-
import { locateSegments } from '../utils/
|
|
6
|
-
import { chalkHighlightThing } from '../utils/
|
|
5
|
+
import { locateSegments } from '../utils/locate-segments.mjs';
|
|
6
|
+
import { chalkHighlightThing } from '../utils/chalk-highlight-thing.mjs';
|
|
7
7
|
const THROTTLE_DELAY = 5000;
|
|
8
8
|
export class VovkGenerate {
|
|
9
9
|
#cliGenerateOptions;
|
|
@@ -2,9 +2,9 @@ import type { VovkSchema } from 'vovk';
|
|
|
2
2
|
import { type VovkReadmeConfig, type VovkSamplesConfig, type VovkStrictConfig } from 'vovk/internal';
|
|
3
3
|
import type { PackageJson } from 'type-fest';
|
|
4
4
|
import type { OpenAPIObject } from 'openapi3-ts/oas31';
|
|
5
|
-
import type { ProjectInfo } from '../
|
|
6
|
-
import type { ClientTemplateFile } from './
|
|
7
|
-
import type { Segment } from '../utils/
|
|
5
|
+
import type { ProjectInfo } from '../get-project-info/index.mjs';
|
|
6
|
+
import type { ClientTemplateFile } from './get-client-template-files.mjs';
|
|
7
|
+
import type { Segment } from '../utils/locate-segments.mjs';
|
|
8
8
|
export declare function normalizeOutTemplatePath(out: string, packageJson: PackageJson): string;
|
|
9
9
|
export declare function writeOneClientFile({ cwd, projectInfo, clientTemplateFile, fullSchema, prettifyClient, segmentName, templateContent, matterResult: { data, content }, openAPIObject, package: packageJson, readme, samples, reExports, isEnsuringClient, outCwdRelativeDir, templateDef, locatedSegments, isNodeNextResolution, hasMixins, isVovkProject, vovkCliPackage, isBundle, origin, configKey, cliSchemaPath, projectConfig, }: {
|
|
10
10
|
cwd: string;
|
|
@@ -4,11 +4,11 @@ import ejs from 'ejs';
|
|
|
4
4
|
import _ from 'lodash';
|
|
5
5
|
import * as YAML from 'yaml';
|
|
6
6
|
import TOML from '@iarna/toml';
|
|
7
|
-
import { createCodeSamples, VovkSchemaIdEnum, } from 'vovk/internal';
|
|
8
|
-
import { compileJSONSchemaToTypeScriptType } from '../utils/
|
|
9
|
-
import { getTemplateClientImports } from './
|
|
10
|
-
import { chalkHighlightThing } from '../utils/
|
|
11
|
-
import { ROOT_SEGMENT_FILE_NAME } from '../dev/
|
|
7
|
+
import { createCodeSamples, reattachMixinDefs, VovkSchemaIdEnum, } from 'vovk/internal';
|
|
8
|
+
import { compileJSONSchemaToTypeScriptType } from '../utils/compile-json-schema-to-typescript-type.mjs';
|
|
9
|
+
import { getTemplateClientImports } from './get-template-client-imports.mjs';
|
|
10
|
+
import { chalkHighlightThing } from '../utils/chalk-highlight-thing.mjs';
|
|
11
|
+
import { ROOT_SEGMENT_FILE_NAME } from '../dev/write-one-segment-schema-file.mjs';
|
|
12
12
|
import { prettify } from '../utils/prettify.mjs';
|
|
13
13
|
export function normalizeOutTemplatePath(out, packageJson) {
|
|
14
14
|
return out.replace('[package_name]', packageJson.name?.replace(/-/g, '_') ?? 'my_package_name');
|
|
@@ -58,6 +58,7 @@ templateContent, matterResult: { data, content }, openAPIObject, package: packag
|
|
|
58
58
|
VovkSchemaIdEnum,
|
|
59
59
|
createCodeSamples,
|
|
60
60
|
compileJSONSchemaToTypeScriptType,
|
|
61
|
+
reattachMixinDefs,
|
|
61
62
|
YAML,
|
|
62
63
|
TOML,
|
|
63
64
|
getFirstLineBanner,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
-
import { getFileSystemEntryType, FileSystemEntryType } from '../../utils/
|
|
2
|
+
import { getFileSystemEntryType, FileSystemEntryType } from '../../utils/get-file-system-entry-type.mjs';
|
|
3
3
|
export async function getRelativeSrcRoot({ cwd }) {
|
|
4
4
|
// Next.js Docs: src/app or src/pages will be ignored if app or pages are present in the root directory.
|
|
5
5
|
if ((await getFileSystemEntryType(path.join(cwd, 'app'))) === FileSystemEntryType.DIRECTORY) {
|
|
@@ -31,29 +31,29 @@ export function getTemplateDefs(userTemplateDefs = {}) {
|
|
|
31
31
|
const defs = {};
|
|
32
32
|
const builtInDefs = {
|
|
33
33
|
[BuiltInTemplateName.openapiTs]: {
|
|
34
|
-
templatePath:
|
|
34
|
+
templatePath: 'vovk-cli/client-templates/openapi-ts/',
|
|
35
35
|
requires: {
|
|
36
36
|
[BuiltInTemplateName.openapiJson]: './',
|
|
37
37
|
},
|
|
38
38
|
},
|
|
39
39
|
[BuiltInTemplateName.openapiJs]: {
|
|
40
|
-
templatePath:
|
|
40
|
+
templatePath: 'vovk-cli/client-templates/openapi-js/',
|
|
41
41
|
requires: {
|
|
42
42
|
[BuiltInTemplateName.openapiJson]: './',
|
|
43
43
|
},
|
|
44
44
|
},
|
|
45
45
|
[BuiltInTemplateName.openapiJson]: {
|
|
46
|
-
templatePath:
|
|
46
|
+
templatePath: 'vovk-cli/client-templates/openapi-json/',
|
|
47
47
|
},
|
|
48
48
|
[BuiltInTemplateName.tsBase]: {
|
|
49
|
-
templatePath:
|
|
49
|
+
templatePath: 'vovk-cli/client-templates/ts-base/',
|
|
50
50
|
requires: {
|
|
51
51
|
[BuiltInTemplateName.schemaTs]: './',
|
|
52
52
|
[BuiltInTemplateName.mixins]: './', // used conditionally if OpenAPI mixins are used
|
|
53
53
|
},
|
|
54
54
|
},
|
|
55
55
|
[BuiltInTemplateName.jsBase]: {
|
|
56
|
-
templatePath:
|
|
56
|
+
templatePath: 'vovk-cli/client-templates/js-base/',
|
|
57
57
|
requires: {
|
|
58
58
|
[BuiltInTemplateName.schemaJs]: './',
|
|
59
59
|
[BuiltInTemplateName.mixins]: './', // used conditionally if OpenAPI mixins are used
|
|
@@ -72,34 +72,34 @@ export function getTemplateDefs(userTemplateDefs = {}) {
|
|
|
72
72
|
},
|
|
73
73
|
},
|
|
74
74
|
[BuiltInTemplateName.schemaTs]: {
|
|
75
|
-
templatePath:
|
|
75
|
+
templatePath: 'vovk-cli/client-templates/schema-ts/',
|
|
76
76
|
},
|
|
77
77
|
[BuiltInTemplateName.schemaJs]: {
|
|
78
|
-
templatePath:
|
|
78
|
+
templatePath: 'vovk-cli/client-templates/schema-js/',
|
|
79
79
|
},
|
|
80
80
|
[BuiltInTemplateName.schemaJson]: {
|
|
81
|
-
templatePath:
|
|
81
|
+
templatePath: 'vovk-cli/client-templates/schema-json/',
|
|
82
82
|
},
|
|
83
83
|
[BuiltInTemplateName.readme]: {
|
|
84
|
-
templatePath:
|
|
84
|
+
templatePath: 'vovk-cli/client-templates/readme/',
|
|
85
85
|
},
|
|
86
86
|
[BuiltInTemplateName.packageJson]: {
|
|
87
|
-
templatePath:
|
|
87
|
+
templatePath: 'vovk-cli/client-templates/package-json/',
|
|
88
88
|
},
|
|
89
89
|
[BuiltInTemplateName.mixins]: {
|
|
90
|
-
templatePath:
|
|
90
|
+
templatePath: 'vovk-cli/client-templates/mixins/',
|
|
91
91
|
},
|
|
92
92
|
[BuiltInTemplateName.rsSrc]: {
|
|
93
|
-
templatePath:
|
|
93
|
+
templatePath: 'vovk-rust/client-templates/rs-src/',
|
|
94
94
|
requires: {
|
|
95
95
|
[BuiltInTemplateName.schemaJson]: './',
|
|
96
96
|
},
|
|
97
97
|
},
|
|
98
98
|
[BuiltInTemplateName.rsPkg]: {
|
|
99
|
-
templatePath:
|
|
99
|
+
templatePath: 'vovk-rust/client-templates/rs-pkg/',
|
|
100
100
|
},
|
|
101
101
|
[BuiltInTemplateName.rsReadme]: {
|
|
102
|
-
templatePath:
|
|
102
|
+
templatePath: 'vovk-rust/client-templates/rs-readme/',
|
|
103
103
|
},
|
|
104
104
|
[BuiltInTemplateName.rs]: {
|
|
105
105
|
composedClient: {
|
|
@@ -112,16 +112,16 @@ export function getTemplateDefs(userTemplateDefs = {}) {
|
|
|
112
112
|
},
|
|
113
113
|
},
|
|
114
114
|
[BuiltInTemplateName.pySrc]: {
|
|
115
|
-
templatePath:
|
|
115
|
+
templatePath: 'vovk-python/client-templates/py-src/',
|
|
116
116
|
requires: {
|
|
117
117
|
[BuiltInTemplateName.schemaJson]: './',
|
|
118
118
|
},
|
|
119
119
|
},
|
|
120
120
|
[BuiltInTemplateName.pyPkg]: {
|
|
121
|
-
templatePath:
|
|
121
|
+
templatePath: 'vovk-python/client-templates/py-pkg/',
|
|
122
122
|
},
|
|
123
123
|
[BuiltInTemplateName.pyReadme]: {
|
|
124
|
-
templatePath:
|
|
124
|
+
templatePath: 'vovk-python/client-templates/py-readme/',
|
|
125
125
|
},
|
|
126
126
|
[BuiltInTemplateName.py]: {
|
|
127
127
|
composedClient: {
|
|
@@ -3,7 +3,7 @@ import { readFile } from 'node:fs/promises';
|
|
|
3
3
|
import { createRequire } from 'node:module';
|
|
4
4
|
import { dirname, extname } from 'node:path';
|
|
5
5
|
import vm from 'node:vm';
|
|
6
|
-
import { getConfigAbsolutePaths } from './
|
|
6
|
+
import { getConfigAbsolutePaths } from './get-config-absolute-paths.mjs';
|
|
7
7
|
const isVMModulesEnabled = typeof vm.SourceTextModule !== 'undefined';
|
|
8
8
|
export async function getUserConfig({ configPath: givenConfigPath, cwd, }) {
|
|
9
9
|
const configAbsolutePaths = await getConfigAbsolutePaths({ configPath: givenConfigPath, cwd });
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { VovkConfig } from 'vovk';
|
|
2
2
|
import { type VovkStrictConfig } from 'vovk/internal';
|
|
3
3
|
import type { LogLevelNames } from 'loglevel';
|
|
4
|
-
import { getLogger } from '../../utils/
|
|
4
|
+
import { getLogger } from '../../utils/get-logger.mjs';
|
|
5
5
|
export declare function getConfig({ configPath, cwd, logLevel, }: {
|
|
6
6
|
configPath?: string;
|
|
7
7
|
cwd: string;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import { VovkSchemaIdEnum } from 'vovk/internal';
|
|
3
|
-
import { getLogger } from '../../utils/
|
|
4
|
-
import { getUserConfig } from './
|
|
5
|
-
import { getRelativeSrcRoot } from './
|
|
6
|
-
import { getTemplateDefs, BuiltInTemplateName } from './
|
|
7
|
-
import { normalizeOpenAPIMixin } from '../../utils/
|
|
8
|
-
import { chalkHighlightThing } from '../../utils/
|
|
3
|
+
import { getLogger } from '../../utils/get-logger.mjs';
|
|
4
|
+
import { getUserConfig } from './get-user-config.mjs';
|
|
5
|
+
import { getRelativeSrcRoot } from './get-relative-src-root.mjs';
|
|
6
|
+
import { getTemplateDefs, BuiltInTemplateName } from './get-template-defs.mjs';
|
|
7
|
+
import { normalizeOpenAPIMixin } from '../../utils/normalize-openapi-mixin.mjs';
|
|
8
|
+
import { chalkHighlightThing } from '../../utils/chalk-highlight-thing.mjs';
|
|
9
9
|
export async function getConfig({ configPath, cwd, logLevel, }) {
|
|
10
10
|
const { configAbsolutePaths, error, userConfig } = await getUserConfig({
|
|
11
11
|
configPath,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
|
-
import { getConfig } from './
|
|
3
|
-
import { getPackageJson } from '../utils/
|
|
2
|
+
import { getConfig } from './get-config/index.mjs';
|
|
3
|
+
import { getPackageJson } from '../utils/get-package-json.mjs';
|
|
4
4
|
import { readFile } from 'node:fs/promises';
|
|
5
5
|
export async function getProjectInfo({ port: givenPort, cwd = process.cwd(), configPath, srcRootRequired = true, logLevel, } = {
|
|
6
6
|
logLevel: 'info',
|
package/dist/index.mjs
CHANGED
|
@@ -4,13 +4,13 @@ import { readFileSync } from 'node:fs';
|
|
|
4
4
|
import 'dotenv/config';
|
|
5
5
|
import { Command } from 'commander';
|
|
6
6
|
import concurrently from 'concurrently';
|
|
7
|
-
import { getAvailablePort } from './utils/
|
|
8
|
-
import { getProjectInfo } from './
|
|
7
|
+
import { getAvailablePort } from './utils/get-available-port.mjs';
|
|
8
|
+
import { getProjectInfo } from './get-project-info/index.mjs';
|
|
9
9
|
import { VovkGenerate } from './generate/index.mjs';
|
|
10
10
|
import { bundle } from './bundle/index.mjs';
|
|
11
11
|
import { VovkDev } from './dev/index.mjs';
|
|
12
12
|
import { newComponents } from './new/index.mjs';
|
|
13
|
-
import { getProjectFullSchema } from './generate/
|
|
13
|
+
import { getProjectFullSchema } from './generate/get-project-full-schema.mjs';
|
|
14
14
|
import { Init } from './init/index.mjs';
|
|
15
15
|
const program = new Command();
|
|
16
16
|
const vovkCliPackage = JSON.parse(readFileSync(path.join(import.meta.dirname, '../package.json'), 'utf-8'));
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { VovkStrictConfig } from 'vovk/internal';
|
|
2
|
-
import type { getLogger } from '../utils/
|
|
2
|
+
import type { getLogger } from '../utils/get-logger.mjs';
|
|
3
3
|
import type { InitOptions } from '../types.mjs';
|
|
4
4
|
export declare const BUNDLE_BUILD_TSDOWN: ({ entry, outDir }: Parameters<VovkStrictConfig["bundle"]["build"]>[0]) => Promise<void>;
|
|
5
5
|
export declare function createConfig({ root, options: { validationLibrary, bundle, lang, dryRun }, }: {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import path from 'node:path';
|
|
2
2
|
import fs from 'node:fs/promises';
|
|
3
3
|
import { prettify } from '../utils/prettify.mjs';
|
|
4
|
-
import { getFileSystemEntryType, FileSystemEntryType } from '../utils/
|
|
5
|
-
import { updateConfigProperty } from '../utils/
|
|
4
|
+
import { getFileSystemEntryType, FileSystemEntryType } from '../utils/get-file-system-entry-type.mjs';
|
|
5
|
+
import { updateConfigProperty } from '../utils/update-config-property.mjs';
|
|
6
6
|
export const BUNDLE_BUILD_TSDOWN = async ({ entry, outDir }) => {
|
|
7
7
|
const { build } = await import('tsdown');
|
|
8
8
|
await build({
|
package/dist/init/index.d.mts
CHANGED
package/dist/init/index.mjs
CHANGED
|
@@ -3,17 +3,17 @@ import path from 'node:path';
|
|
|
3
3
|
import fs from 'node:fs/promises';
|
|
4
4
|
import chalk from 'chalk';
|
|
5
5
|
import NPMCliPackageJson from '@npmcli/package-json';
|
|
6
|
-
import { getConfigAbsolutePaths } from '../
|
|
7
|
-
import { getFileSystemEntryType } from '../utils/
|
|
8
|
-
import { installDependencies, getPackageManager } from './
|
|
9
|
-
import { getLogger } from '../utils/
|
|
10
|
-
import { createConfig } from './
|
|
11
|
-
import { updateNPMScripts, getDevScript } from './
|
|
12
|
-
import { checkTSConfigForExperimentalDecorators } from './
|
|
13
|
-
import { updateTypeScriptConfig } from './
|
|
14
|
-
import { updateDependenciesWithoutInstalling } from './
|
|
15
|
-
import { logUpdateDependenciesError } from './
|
|
16
|
-
import { chalkHighlightThing } from '../utils/
|
|
6
|
+
import { getConfigAbsolutePaths } from '../get-project-info/get-config/get-config-absolute-paths.mjs';
|
|
7
|
+
import { getFileSystemEntryType } from '../utils/get-file-system-entry-type.mjs';
|
|
8
|
+
import { installDependencies, getPackageManager } from './install-dependencies.mjs';
|
|
9
|
+
import { getLogger } from '../utils/get-logger.mjs';
|
|
10
|
+
import { createConfig } from './create-config.mjs';
|
|
11
|
+
import { updateNPMScripts, getDevScript } from './update-npm-scripts.mjs';
|
|
12
|
+
import { checkTSConfigForExperimentalDecorators } from './check-tsconfig-for-experimental-decorators.mjs';
|
|
13
|
+
import { updateTypeScriptConfig } from './update-typescript-config.mjs';
|
|
14
|
+
import { updateDependenciesWithoutInstalling } from './update-dependencies-without-installing.mjs';
|
|
15
|
+
import { logUpdateDependenciesError } from './log-update-dependencies-error.mjs';
|
|
16
|
+
import { chalkHighlightThing } from '../utils/chalk-highlight-thing.mjs';
|
|
17
17
|
export class Init {
|
|
18
18
|
root;
|
|
19
19
|
log;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type NPMCliPackageJson from '@npmcli/package-json';
|
|
2
|
-
import type { getLogger } from '../utils/
|
|
2
|
+
import type { getLogger } from '../utils/get-logger.mjs';
|
|
3
3
|
import type { InitOptions } from '../types.mjs';
|
|
4
4
|
export type PackageManager = 'npm' | 'yarn' | 'pnpm' | 'bun';
|
|
5
5
|
export declare function getPackageManager(options: Pick<InitOptions, 'useNpm' | 'useYarn' | 'usePnpm' | 'useBun'> & {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { spawn } from 'node:child_process';
|
|
2
|
-
import { chalkHighlightThing } from '../utils/
|
|
2
|
+
import { chalkHighlightThing } from '../utils/chalk-highlight-thing.mjs';
|
|
3
3
|
export function getPackageManager(options) {
|
|
4
4
|
if (options.useNpm)
|
|
5
5
|
return 'npm';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { InitOptions } from '../types.mjs';
|
|
2
|
-
import type { getLogger } from '../utils/
|
|
3
|
-
import type { PackageManager } from './
|
|
2
|
+
import type { getLogger } from '../utils/get-logger.mjs';
|
|
3
|
+
import type { PackageManager } from './install-dependencies.mjs';
|
|
4
4
|
export declare function logUpdateDependenciesError({ packageManager, log, dependencies, devDependencies, error, channel, }: {
|
|
5
5
|
packageManager: PackageManager;
|
|
6
6
|
log: ReturnType<typeof getLogger>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { chalkHighlightThing } from '../utils/
|
|
1
|
+
import { chalkHighlightThing } from '../utils/chalk-highlight-thing.mjs';
|
|
2
2
|
export function logUpdateDependenciesError({ packageManager, log, dependencies, devDependencies, error, channel, }) {
|
|
3
3
|
const installCommands = [];
|
|
4
4
|
const addChannel = (packageName) => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { getLogger } from '../utils/
|
|
1
|
+
import type { getLogger } from '../utils/get-logger.mjs';
|
|
2
2
|
import type { InitOptions } from '../types.mjs';
|
|
3
3
|
export declare function updateDependenciesWithoutInstalling({ log, dir, dependencyNames, devDependencyNames, channel, }: {
|
|
4
4
|
log: ReturnType<typeof getLogger>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import fs from 'node:fs/promises';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import chalk from 'chalk';
|
|
4
|
-
import { getNPMPackageMetadata } from '../utils/
|
|
4
|
+
import { getNPMPackageMetadata } from '../utils/get-npm-package-metadata.mjs';
|
|
5
5
|
/** Root of the monorepo packages directory (…/packages) resolved from the compiled CLI location (dist/init/). */
|
|
6
6
|
const packagesRoot = path.resolve(import.meta.dirname, '../../..');
|
|
7
7
|
/** Vovk package names that have a matching local directory under packages/. */
|