vovk-cli 0.1.3 → 0.3.0-beta.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/CHANGELOG.md +38 -0
- package/client-templates/{schemaTs → schema-ts}/schema.ts.ejs +1 -1
- package/client-templates/{tsBase → ts-base}/index.ts.ejs +1 -1
- package/dist/bundle/index.d.mts +1 -1
- package/dist/bundle/index.mjs +67 -45
- package/dist/dev/{diffSegmentSchema.d.mts → diff-segment-schema.d.mts} +0 -17
- package/dist/dev/{diffSegmentSchema.mjs → diff-segment-schema.mjs} +1 -17
- package/dist/dev/{ensureSchemaFiles.d.mts → ensure-schema-files.d.mts} +1 -1
- package/dist/dev/{ensureSchemaFiles.mjs → ensure-schema-files.mjs} +30 -12
- package/dist/dev/index.mjs +23 -17
- 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} +8 -3
- 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 +41 -28
- package/dist/generate/{getClientTemplateFiles.d.mts → get-client-template-files.d.mts} +1 -1
- package/dist/generate/{getClientTemplateFiles.mjs → get-client-template-files.mjs} +8 -4
- package/dist/generate/{getProjectFullSchema.d.mts → get-project-full-schema.d.mts} +1 -1
- package/dist/generate/{getProjectFullSchema.mjs → get-project-full-schema.mjs} +3 -3
- package/dist/generate/{getTemplateClientImports.mjs → get-template-client-imports.mjs} +2 -2
- package/dist/generate/index.d.mts +2 -2
- package/dist/generate/index.mjs +46 -34
- package/dist/generate/{writeOneClientFile.d.mts → write-one-client-file.d.mts} +5 -5
- package/dist/generate/{writeOneClientFile.mjs → write-one-client-file.mjs} +10 -8
- package/dist/{getProjectInfo/getConfig/getRelativeSrcRoot.mjs → get-project-info/get-config/get-relative-src-root.mjs} +1 -1
- package/dist/get-project-info/get-config/get-template-defs.d.mts +22 -0
- package/dist/{getProjectInfo/getConfig/getTemplateDefs.mjs → get-project-info/get-config/get-template-defs.mjs} +35 -61
- package/dist/{getProjectInfo/getConfig/getUserConfig.mjs → get-project-info/get-config/get-user-config.mjs} +2 -2
- package/dist/{getProjectInfo/getConfig → get-project-info/get-config}/index.d.mts +2 -2
- package/dist/{getProjectInfo/getConfig → get-project-info/get-config}/index.mjs +17 -12
- package/dist/{getProjectInfo/getMetaSchema.d.mts → get-project-info/get-meta-schema.d.mts} +1 -1
- package/dist/{getProjectInfo → get-project-info}/index.mjs +3 -3
- package/dist/index.mjs +25 -16
- package/dist/init/{createConfig.d.mts → create-config.d.mts} +1 -1
- package/dist/init/{createConfig.mjs → create-config.mjs} +6 -6
- package/dist/init/index.d.mts +1 -1
- package/dist/init/index.mjs +54 -22
- package/dist/init/{installDependencies.d.mts → install-dependencies.d.mts} +2 -1
- package/dist/init/{installDependencies.mjs → install-dependencies.mjs} +11 -3
- 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 -2
- package/dist/init/update-gitignore.d.mts +2 -0
- package/dist/init/update-gitignore.mjs +20 -0
- 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} +15 -9
- package/dist/new/{newSegment.d.mts → new-segment.d.mts} +1 -1
- package/dist/new/{newSegment.mjs → new-segment.mjs} +11 -6
- package/dist/new/render.mjs +3 -3
- package/dist/types.d.mts +1 -1
- 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/{generateFnName.d.mts → generate-fn-name.d.mts} +0 -9
- package/dist/utils/{generateFnName.mjs → generate-fn-name.mjs} +2 -9
- package/dist/utils/generated-banner.d.mts +1 -0
- package/dist/utils/generated-banner.mjs +3 -0
- package/dist/utils/get-available-port.d.mts +1 -0
- package/dist/utils/{getAvailablePort.mjs → get-available-port.mjs} +2 -14
- package/dist/utils/get-file-system-entry-type.d.mts +6 -0
- package/dist/utils/{getFileSystemEntryType.mjs → get-file-system-entry-type.mjs} +5 -5
- 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} +2 -2
- package/dist/utils/{normalizeOpenAPIMixin.mjs → normalize-openapi-mixin.mjs} +20 -5
- package/dist/utils/prettify.d.mts +4 -0
- package/dist/utils/prettify.mjs +39 -3
- package/dist/utils/remove-unlisted-directories.d.mts +1 -0
- package/dist/utils/remove-unlisted-directories.mjs +99 -0
- package/dist/utils/{resolveAbsoluteModulePath.mjs → resolve-absolute-module-path.mjs} +2 -3
- package/dist/utils/{updateConfigProperty.mjs → update-config-property.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 +23 -30
- package/client-templates/jsBase/index.d.ts.ejs +0 -21
- package/client-templates/jsBase/index.js.ejs +0 -18
- package/client-templates/openapiJs/openapi.d.ts.ejs +0 -4
- package/client-templates/openapiJs/openapi.js.ejs +0 -4
- package/client-templates/schemaJs/schema.d.ts.ejs +0 -10
- package/client-templates/schemaJs/schema.js.ejs +0 -29
- package/dist/dev/logDiffResult.d.mts +0 -3
- package/dist/generate/ensureClient.d.mts +0 -3
- package/dist/getProjectInfo/getConfig/getTemplateDefs.d.mts +0 -25
- package/dist/utils/getAvailablePort.d.mts +0 -9
- package/dist/utils/getFileSystemEntryType.d.mts +0 -5
- package/dist/utils/removeUnlistedDirectories.d.mts +0 -9
- package/dist/utils/removeUnlistedDirectories.mjs +0 -60
- 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/{schemaJson → schema-json}/schema.json.ejs +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/getUserConfig.d.mts → get-project-info/get-config/get-user-config.d.mts} +0 -0
- package/dist/{getProjectInfo/getMetaSchema.mjs → get-project-info/get-meta-schema.mjs} +1 -1
- 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} +1 -1
- 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.d.mts → update-typescript-config.d.mts} +0 -0
- package/dist/init/{updateTypeScriptConfig.mjs → update-typescript-config.mjs} +1 -1
- 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} +1 -1
- package/dist/utils/{compileTs.d.mts → compile-ts.d.mts} +0 -0
- package/dist/utils/{compileTs.mjs → compile-ts.mjs} +1 -1
- /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/{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/{resolveAbsoluteModulePath.d.mts → resolve-absolute-module-path.d.mts} +0 -0
- /package/dist/utils/{updateConfigProperty.d.mts → update-config-property.d.mts} +0 -0
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { VovkStrictConfig } from 'vovk/internal';
|
|
2
|
-
export declare enum BuiltInTemplateName {
|
|
3
|
-
tsBase = "tsBase",
|
|
4
|
-
jsBase = "jsBase",
|
|
5
|
-
ts = "ts",
|
|
6
|
-
js = "js",
|
|
7
|
-
schemaTs = "schemaTs",
|
|
8
|
-
schemaJs = "schemaJs",
|
|
9
|
-
schemaJson = "schemaJson",
|
|
10
|
-
openapiTs = "openapiTs",
|
|
11
|
-
openapiJs = "openapiJs",
|
|
12
|
-
openapiJson = "openapiJson",
|
|
13
|
-
readme = "readme",
|
|
14
|
-
packageJson = "packageJson",
|
|
15
|
-
mixins = "mixins",
|
|
16
|
-
rsSrc = "rsSrc",
|
|
17
|
-
rsPkg = "rsPkg",
|
|
18
|
-
rsReadme = "rsReadme",
|
|
19
|
-
rs = "rs",
|
|
20
|
-
pySrc = "pySrc",
|
|
21
|
-
pyPkg = "pyPkg",
|
|
22
|
-
pyReadme = "pyReadme",
|
|
23
|
-
py = "py"
|
|
24
|
-
}
|
|
25
|
-
export declare function getTemplateDefs(userTemplateDefs?: VovkStrictConfig['clientTemplateDefs']): VovkStrictConfig['clientTemplateDefs'];
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Finds an available port starting from a given port.
|
|
3
|
-
* @param {number} startPort - The port to start checking from.
|
|
4
|
-
* @param {number} maxAttempts - The maximum number of attempts to find an available port.
|
|
5
|
-
* @param {number} attempt - The current attempt number.
|
|
6
|
-
* @param {(failedPort: number, tryingPort: number) => void} onWarning - The callback function for warnings.
|
|
7
|
-
* @returns {Promise<string>}
|
|
8
|
-
*/
|
|
9
|
-
export declare function getAvailablePort(startPort: number, maxAttempts: number, attempt: number, onWarning: (failedPort: number, tryingPort: number) => void): Promise<string>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Removes all directories in a folder that aren't in the provided allowlist
|
|
3
|
-
* Supports nested directory paths like 'foo/bar/baz'
|
|
4
|
-
*
|
|
5
|
-
* @param folderPath - The path to the folder to process
|
|
6
|
-
* @param allowedDirs - Array of relative directory paths to keep
|
|
7
|
-
* @returns Promise that resolves when all operations are complete
|
|
8
|
-
*/
|
|
9
|
-
export declare function removeUnlistedDirectories(folderPath: string, allowedDirs: string[]): Promise<void>;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import fs from 'node:fs/promises';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import { getFileSystemEntryType, FileSystemEntryType } from './getFileSystemEntryType.mjs';
|
|
4
|
-
/**
|
|
5
|
-
* Removes all directories in a folder that aren't in the provided allowlist
|
|
6
|
-
* Supports nested directory paths like 'foo/bar/baz'
|
|
7
|
-
*
|
|
8
|
-
* @param folderPath - The path to the folder to process
|
|
9
|
-
* @param allowedDirs - Array of relative directory paths to keep
|
|
10
|
-
* @returns Promise that resolves when all operations are complete
|
|
11
|
-
*/
|
|
12
|
-
export async function removeUnlistedDirectories(folderPath, allowedDirs) {
|
|
13
|
-
// Normalize all allowed paths to use the system-specific separator
|
|
14
|
-
const normalizedAllowedDirs = allowedDirs.map((dir) => dir.split('/').join(path.sep));
|
|
15
|
-
// Process the directory tree recursively
|
|
16
|
-
await processDirectory(folderPath, '', normalizedAllowedDirs);
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Recursively processes directories to determine which should be kept or removed
|
|
20
|
-
*
|
|
21
|
-
* @param basePath - The absolute base path being processed
|
|
22
|
-
* @param relativePath - The current relative path from the base
|
|
23
|
-
* @param allowedDirs - Normalized list of allowed directory paths
|
|
24
|
-
*/
|
|
25
|
-
async function processDirectory(basePath, relativePath, allowedDirs) {
|
|
26
|
-
const currentDirPath = path.join(basePath, relativePath);
|
|
27
|
-
// check if the current path is a directory
|
|
28
|
-
const type = await getFileSystemEntryType(currentDirPath);
|
|
29
|
-
if (type !== FileSystemEntryType.DIRECTORY) {
|
|
30
|
-
// If it's not a directory, return early
|
|
31
|
-
return;
|
|
32
|
-
}
|
|
33
|
-
// Read all entries in the current directory
|
|
34
|
-
const entries = await fs.readdir(currentDirPath, { withFileTypes: true });
|
|
35
|
-
// Process only directories
|
|
36
|
-
const dirEntries = entries.filter((entry) => entry.isDirectory());
|
|
37
|
-
// Check each directory
|
|
38
|
-
for (const dir of dirEntries) {
|
|
39
|
-
// Calculate the new relative path
|
|
40
|
-
const newRelativePath = relativePath ? path.join(relativePath, dir.name) : dir.name;
|
|
41
|
-
// Check if this directory or any of its subdirectories should be kept
|
|
42
|
-
const shouldKeep = allowedDirs.some((allowedDir) => {
|
|
43
|
-
// Direct match
|
|
44
|
-
if (allowedDir === newRelativePath)
|
|
45
|
-
return true;
|
|
46
|
-
// Check if it's a parent path of an allowed directory
|
|
47
|
-
// e.g. "foo" is a parent of "foo/bar/baz"
|
|
48
|
-
return allowedDir.startsWith(newRelativePath + path.sep);
|
|
49
|
-
});
|
|
50
|
-
if (shouldKeep) {
|
|
51
|
-
// Recursively process this directory's contents
|
|
52
|
-
await processDirectory(basePath, newRelativePath, allowedDirs);
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
// Remove this directory since it's not in the allowed list
|
|
56
|
-
const fullPath = path.join(basePath, newRelativePath);
|
|
57
|
-
await fs.rm(fullPath, { recursive: true, force: true });
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import path from 'node:path';
|
|
2
1
|
import fs from 'node:fs/promises';
|
|
2
|
+
import path from 'node:path';
|
|
3
3
|
import * as jsonc from 'jsonc-parser';
|
|
4
4
|
export async function checkTSConfigForExperimentalDecorators(root) {
|
|
5
5
|
const tsconfigPath = path.resolve(root, 'tsconfig.json');
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { OpenAPIObject } from 'openapi3-ts/oas31';
|
|
2
1
|
import type { JSONSchema7 } from 'json-schema';
|
|
2
|
+
import type { OpenAPIObject } from 'openapi3-ts/oas31';
|
|
3
3
|
export declare function compileJSONSchemaToTypeScriptType(schema: JSONSchema7, typeName: string, components?: NonNullable<OpenAPIObject['components']>, options?: {
|
|
4
4
|
dontCreateRefTypes?: boolean;
|
|
5
5
|
}): string;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/utils/{getPublicModuleNameFromPath.d.mts → get-public-module-name-from-path.d.mts}
RENAMED
|
File without changes
|
/package/dist/utils/{getPublicModuleNameFromPath.mjs → get-public-module-name-from-path.mjs}
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|