vovk-cli 0.0.1-draft.300 → 0.0.1-draft.301

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.
@@ -5,7 +5,7 @@ const { schema } = require('./schema.cjs');
5
5
  const { validateOnClient = null } = <%- t.imports.validateOnClient ? `require('${t.imports.validateOnClient}')` : '{}'%>;
6
6
  <% Object.values(t.schema.segments).filter((segment) => segment.emitSchema).forEach((segment) => { %>
7
7
  <% Object.entries(t.segmentMeta[segment.segmentName].reExports).forEach(([reExportWhatCommaDivisible, reExportFrom]) => {
8
- reExportWhatCommaDivisible.split(',').forEach((reExportWhat) => { %>
8
+ reExportWhatCommaDivisible.split(/\s*,\s*/).forEach((reExportWhat) => { %>
9
9
  exports['<%= reExportWhat.split(/\s+as\s+/)[1] ?? reExportWhat %>'] = require('<%= reExportFrom %>')['<%= reExportWhat.split(/\s+as\s+/)[0] %>'];
10
10
  <% })
11
11
  }) %>
@@ -1 +1 @@
1
- <%- JSON.stringify(t._.pickBy(t.schema.segments, (segment) => segment.segmentType === 'mixin'), null, 2) %>
1
+ <%- JSON.stringify(t._.pickBy(t.schema.segments, (segment) => segment.segmentType === 'mixin'), null, 2) %>
@@ -13,11 +13,10 @@ export async function bundle({ projectInfo, fullSchema, cliBundleOptions, }) {
13
13
  const tsFullClientOutAbsoluteDirInput = path.join(cwd, bundleConfig.tsClientOutDir);
14
14
  const tsClientOutDir = cliBundleOptions?.tsClientOutDir ?? bundleConfig.tsClientOutDir;
15
15
  const dontDeleteTsClientOutDirAfter = cliBundleOptions?.dontDeleteTsClientOutDirAfter ?? bundleConfig?.dontDeleteTsClientOutDirAfter ?? false;
16
- const sourcemap = cliBundleOptions?.sourcemap ?? bundleConfig?.sourcemap;
17
16
  if (!tsClientOutDir) {
18
17
  throw new Error('No output directory specified for composed client');
19
18
  }
20
- const outDir = cliBundleOptions?.outDir ?? bundleConfig.outDir;
19
+ const outDir = cliBundleOptions?.outDir ?? bundleConfig.tsdownBuildOptions.outDir;
21
20
  if (!outDir) {
22
21
  throw new Error('No output directory specified for bundling');
23
22
  }
@@ -39,7 +38,6 @@ export async function bundle({ projectInfo, fullSchema, cliBundleOptions, }) {
39
38
  composedOnly: true,
40
39
  composedIncludeSegments: cliBundleOptions.includeSegments ?? bundleConfig.includeSegments,
41
40
  composedExcludeSegments: cliBundleOptions.excludeSegments ?? bundleConfig.excludeSegments,
42
- forceTsStandalone: cliBundleOptions.forceTsStandalone,
43
41
  },
44
42
  });
45
43
  await build({
@@ -48,7 +46,7 @@ export async function bundle({ projectInfo, fullSchema, cliBundleOptions, }) {
48
46
  format: ['cjs', 'esm'],
49
47
  fixedExtension: true,
50
48
  outDir,
51
- sourcemap: bundleConfig.sourcemap,
49
+ ...bundleConfig.tsdownBuildOptions,
52
50
  });
53
51
  const outDirAbsolute = path.resolve(cwd, outDir);
54
52
  log.debug(`Bundled index.ts to ${chalkHighlightThing(outDirAbsolute)}`);
@@ -59,7 +57,6 @@ export async function bundle({ projectInfo, fullSchema, cliBundleOptions, }) {
59
57
  fixedExtension: true,
60
58
  outDir,
61
59
  clean: false,
62
- sourcemap,
63
60
  });
64
61
  log.debug(`Bundled schema.ts to ${chalkHighlightThing(outDirAbsolute)}`);
65
62
  const requiresGroup = groupBy(Object.entries(bundleConfig.requires), ([, relativePath]) => relativePath);
@@ -45,10 +45,6 @@ export default function getTemplateDefs(userTemplateDefs = {}) {
45
45
  [BuiltInTemplateName.schemaJson]: {
46
46
  templatePath: `vovk-cli/client-templates/${BuiltInTemplateName.schemaJson}/`,
47
47
  },
48
- [BuiltInTemplateName.standaloneTypesTs]: {
49
- templatePath: `vovk-cli/client-templates/${BuiltInTemplateName.standaloneTypesTs}/`,
50
- requires: { [BuiltInTemplateName.schemaJson]: '.' },
51
- },
52
48
  [BuiltInTemplateName.readme]: {
53
49
  templatePath: `vovk-cli/client-templates/${BuiltInTemplateName.readme}/`,
54
50
  },
@@ -7,9 +7,19 @@ export default function getConfig({ configPath, cwd }: {
7
7
  srcRoot: string | null;
8
8
  configAbsolutePaths: string[];
9
9
  userConfig: {
10
- $schema?: typeof VovkSchemaIdEnum.CONFIG | string;
11
- emitConfig?: boolean | (keyof VovkStrictConfig | string)[];
10
+ $schema?: typeof VovkSchemaIdEnum.CONFIG | (string & {});
11
+ emitConfig?: boolean | (keyof VovkStrictConfig | (string & {}))[];
12
12
  schemaOutDir?: string;
13
+ modulesDir?: string;
14
+ rootEntry?: string;
15
+ origin?: string;
16
+ logLevel?: "error" | "trace" | "debug" | "info" | "warn";
17
+ prettifyClient?: boolean;
18
+ libs?: {
19
+ ajv: import("vovk").KnownAny;
20
+ [key: string]: import("vovk").KnownAny;
21
+ };
22
+ devHttps?: boolean;
13
23
  composedClient?: ({
14
24
  enabled?: boolean;
15
25
  outDir?: string;
@@ -43,15 +53,14 @@ export default function getConfig({ configPath, cwd }: {
43
53
  }>;
44
54
  };
45
55
  bundle?: {
46
- outDir?: string;
47
56
  requires?: Record<string, string>;
48
57
  tsClientOutDir?: string;
49
58
  dontDeleteTsClientOutDirAfter?: boolean;
50
- sourcemap?: boolean;
51
59
  package?: import("type-fest").PackageJson;
52
60
  readme?: {
53
61
  banner?: string;
54
62
  };
63
+ tsdownBuildOptions?: Parameters<typeof import("tsdown/config-9hj-APNF.mjs").build>[0];
55
64
  } & ({
56
65
  excludeSegments?: never;
57
66
  includeSegments?: string[];
@@ -59,28 +68,18 @@ export default function getConfig({ configPath, cwd }: {
59
68
  excludeSegments?: string[];
60
69
  includeSegments?: never;
61
70
  });
71
+ clientTemplateDefs?: Record<string, import("vovk/mjs/types").ClientTemplateDef>;
62
72
  imports?: {
63
73
  fetcher?: string | [string, string] | [string];
64
74
  validateOnClient?: string | [string, string] | [string];
65
75
  createRPC?: string | [string, string] | [string];
66
76
  };
67
- modulesDir?: string;
68
- rootEntry?: string;
69
- origin?: string;
70
77
  rootSegmentModulesDirName?: string;
71
- logLevel?: "error" | "trace" | "debug" | "info" | "warn";
72
- prettifyClient?: boolean;
73
- devHttps?: boolean;
74
- clientTemplateDefs?: Record<string, import("vovk/mjs/types").ClientTemplateDef>;
75
78
  moduleTemplates?: {
76
79
  service?: string;
77
80
  controller?: string;
78
81
  [key: string]: string | undefined;
79
82
  };
80
- libs?: {
81
- ajv: import("vovk").KnownAny;
82
- [key: string]: import("vovk").KnownAny;
83
- };
84
83
  segmentConfig?: false | {
85
84
  [x: string]: {
86
85
  origin?: string;
@@ -43,10 +43,8 @@ export default async function getConfig({ configPath, cwd }) {
43
43
  outDir: conf.segmentedClient?.outDir ?? path.join(srcRoot ?? '.', 'client'),
44
44
  },
45
45
  bundle: {
46
- outDir: conf.bundle?.outDir ?? 'dist',
47
46
  tsClientOutDir: conf.bundle?.tsClientOutDir ?? 'tmp_ts_rpc',
48
47
  dontDeleteTsClientOutDirAfter: conf.bundle?.dontDeleteTsClientOutDirAfter ?? false,
49
- sourcemap: conf.bundle?.sourcemap ?? false,
50
48
  requires: {
51
49
  [BuiltInTemplateName.readme]: '.',
52
50
  [BuiltInTemplateName.packageJson]: '.',
@@ -54,6 +52,10 @@ export default async function getConfig({ configPath, cwd }) {
54
52
  package: {},
55
53
  readme: {},
56
54
  ...conf.bundle,
55
+ tsdownBuildOptions: {
56
+ outDir: conf.bundle?.tsdownBuildOptions?.outDir ?? 'dist',
57
+ ...conf.bundle?.tsdownBuildOptions,
58
+ },
57
59
  },
58
60
  modulesDir: conf.modulesDir ?? path.join(srcRoot ?? '.', 'modules'),
59
61
  schemaOutDir: env.VOVK_SCHEMA_OUT_DIR ?? conf.schemaOutDir ?? './.vovk-schema',
package/dist/index.mjs CHANGED
@@ -113,8 +113,6 @@ program
113
113
  .option('--dont-delete-ts-client-out-dir-after', 'do not delete TypeScript client output directory after bundling')
114
114
  .option('--config <config>', 'path to config file')
115
115
  .option('--schema <path>', 'path to schema folder (default: .vovk-schema)')
116
- .option('--sourcemap', 'generate sourcemaps')
117
- .option('--force-ts-standalone', 'force TypeScript standalone mode (Next.js environment will be ignored, by default it\'s "true" for non-Next.js directories)')
118
116
  .option('--openapi, --openapi-spec <openapi_path_or_urls...>', 'use OpenAPI schema instead of Vovk schema')
119
117
  .option('--openapi-get-module-name <names...>', 'module names corresponding to the index of --openapi option')
120
118
  .option('--openapi-get-method-name <names...>', 'method names corresponding to the index of --openapi option')
package/dist/types.d.mts CHANGED
@@ -22,7 +22,6 @@ export interface GenerateOptions {
22
22
  openapiRootUrl?: string[];
23
23
  openapiMixinName?: string[];
24
24
  watch?: boolean | string;
25
- forceTsStandalone?: boolean;
26
25
  composedFrom?: string[];
27
26
  composedOut?: string;
28
27
  composedOnly?: boolean;
@@ -34,15 +33,15 @@ export interface GenerateOptions {
34
33
  segmentedIncludeSegments?: string[];
35
34
  segmentedExcludeSegments?: string[];
36
35
  }
37
- export interface BundleOptions extends Partial<Omit<VovkStrictConfig['bundle'], 'requires'>> {
36
+ export interface BundleOptions extends Partial<Pick<VovkStrictConfig['bundle'], 'tsClientOutDir' | 'dontDeleteTsClientOutDirAfter' | 'includeSegments' | 'excludeSegments'>> {
38
37
  config?: string;
39
38
  schema?: string;
39
+ outDir?: string;
40
40
  openapiSpec?: string[];
41
41
  openapiGetModuleName?: string[];
42
42
  openapiGetMethodName?: string[];
43
43
  openapiRootUrl?: string[];
44
44
  openapiMixinName?: string[];
45
- forceTsStandalone?: boolean;
46
45
  }
47
46
  export interface InitOptions {
48
47
  yes?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vovk-cli",
3
- "version": "0.0.1-draft.300",
3
+ "version": "0.0.1-draft.301",
4
4
  "bin": {
5
5
  "vovk": "./dist/index.mjs"
6
6
  },
@@ -35,26 +35,22 @@
35
35
  },
36
36
  "homepage": "https://vovk.dev",
37
37
  "peerDependencies": {
38
- "vovk": "^3.0.0-draft.339"
38
+ "vovk": "^3.0.0-draft.340"
39
39
  },
40
40
  "optionalDependencies": {
41
41
  "vovk-python": "^0.0.1-draft.54"
42
42
  },
43
43
  "dependencies": {
44
44
  "@iarna/toml": "^2.2.5",
45
- "@inquirer/prompts": "^7.6.0",
45
+ "@inquirer/prompts": "^7.7.1",
46
46
  "@npmcli/package-json": "^6.2.0",
47
- "@rollup/plugin-commonjs": "^28.0.6",
48
- "@rollup/plugin-json": "^6.1.0",
49
- "@rollup/plugin-node-resolve": "^16.0.1",
50
- "@rollup/plugin-typescript": "^12.1.4",
51
47
  "@types/json-schema": "^7.0.15",
52
48
  "chalk": "^5.4.1",
53
49
  "chokidar": "^4.0.3",
54
50
  "clone-deep": "^4.0.1",
55
51
  "commander": "^13.1.0",
56
52
  "concurrently": "^9.2.0",
57
- "dotenv": "^17.2.0",
53
+ "dotenv": "^17.2.1",
58
54
  "ejs": "^3.1.10",
59
55
  "get-tsconfig": "^4.10.1",
60
56
  "glob": "^11.0.3",
@@ -66,12 +62,11 @@
66
62
  "openapi3-ts": "^4.5.0",
67
63
  "pluralize": "^8.0.0",
68
64
  "prettier": "^3.6.2",
69
- "rollup": "^4.44.2",
70
65
  "tar-stream": "^3.1.7",
71
66
  "ts-morph": "^26.0.0",
72
- "tsdown": "^0.12.9",
67
+ "tsdown": "^0.13.0",
73
68
  "type-fest": "^4.41.0",
74
- "undici": "^7.11.0",
69
+ "undici": "^7.12.0",
75
70
  "vovk-openapi": "^0.0.1-draft.112",
76
71
  "yaml": "^2.8.0"
77
72
  },
@@ -83,8 +78,8 @@
83
78
  "@types/pluralize": "^0.0.33",
84
79
  "@types/tar-stream": "^3.1.4",
85
80
  "concat-stream": "^2.0.0",
86
- "create-next-app": "^15.3.5",
81
+ "create-next-app": "^15.4.4",
87
82
  "node-pty": "^1.0.0",
88
- "zod": "^4.0.5"
83
+ "zod": "^4.0.10"
89
84
  }
90
85
  }