vovk-cli 0.0.1-draft.191 → 0.0.1-draft.193

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.
@@ -7,7 +7,7 @@ const { validateOnClient = null } = <%- t.imports.validateOnClient ? `require('$
7
7
  Object.keys(segment.controllers).forEach((rpcModuleName) => { %>
8
8
  exports.<%= rpcModuleName %> = createRPC(
9
9
  schema, '<%= segment.segmentName %>', '<%= rpcModuleName %>',
10
- { fetcher, validateOnClient, defaultOptions: { apiRoot: '<%= segment.segmentApiRoot ?? t.apiRoot %>' } }
10
+ { fetcher, validateOnClient,<%= t.segmentMeta[segment.segmentName].segmentNameOverride ? `segmentNameOverride: '${t.segmentMeta[segment.segmentName].segmentNameOverride}'', ` : '' %> defaultOptions: { apiRoot: '<%= segment.segmentApiRoot ?? t.apiRoot %>' } }
11
11
  );
12
12
  <% })
13
13
  }) %>
@@ -11,7 +11,7 @@ const validateOnClient = undefined;
11
11
  Object.keys(segment.controllers).forEach((rpcModuleName) => { %>
12
12
  export const <%= rpcModuleName %> = createRPC(
13
13
  schema, '<%= segment.segmentName %>', '<%= rpcModuleName %>',
14
- { fetcher, validateOnClient, defaultOptions: { apiRoot: '<%= segment.segmentApiRoot ?? t.apiRoot %>' } }
14
+ { fetcher, validateOnClient,<%= t.segmentMeta[segment.segmentName].segmentNameOverride ? `segmentNameOverride: '${t.segmentMeta[segment.segmentName].segmentNameOverride}'', ` : '' %> defaultOptions: { apiRoot: '<%= segment.segmentApiRoot ?? t.apiRoot %>' } }
15
15
  );
16
16
  <%
17
17
  });
@@ -15,7 +15,7 @@ type Options = typeof fetcher extends VovkClientFetcher<infer U> ? U : never;
15
15
  Object.keys(segment.controllers).forEach((rpcModuleName) => { %>
16
16
  export const <%= rpcModuleName %> = createRPC<Controllers<%= i %>["<%= rpcModuleName %>"], Options>(
17
17
  schema, '<%= segment.segmentName %>', '<%= rpcModuleName %>',
18
- { fetcher, validateOnClient, defaultOptions: { apiRoot: '<%= segment.segmentApiRoot ?? t.apiRoot %>' } }
18
+ { fetcher, validateOnClient,<%= t.segmentMeta[segment.segmentName].segmentNameOverride ? `segmentNameOverride: '${t.segmentMeta[segment.segmentName].segmentNameOverride}', ` : '' %> defaultOptions: { apiRoot: '<%= segment.segmentApiRoot ?? t.apiRoot %>' } }
19
19
  );
20
20
  <% })
21
21
  }) %>
@@ -44,7 +44,7 @@ export default async function bundle({ projectInfo, fullSchema, cliBundleOptions
44
44
  sourcemap: bundleConfig.sourcemap,
45
45
  });
46
46
  const outDirAbsolute = path.resolve(cwd, outDir);
47
- log.info(`Bundled index.ts to ${chalkHighlightThing(outDirAbsolute)}`);
47
+ log.debug(`Bundled index.ts to ${chalkHighlightThing(outDirAbsolute)}`);
48
48
  await build({
49
49
  entry: path.join(tsFullClientOutAbsoluteDirInput, './schema.ts'),
50
50
  dts: true,
@@ -54,7 +54,7 @@ export default async function bundle({ projectInfo, fullSchema, cliBundleOptions
54
54
  clean: false,
55
55
  sourcemap,
56
56
  });
57
- log.info(`Bundled schema.ts to ${chalkHighlightThing(outDirAbsolute)}`);
57
+ log.debug(`Bundled schema.ts to ${chalkHighlightThing(outDirAbsolute)}`);
58
58
  const requiresGroup = groupBy(Object.entries(bundleConfig.requires), ([, relativePath]) => relativePath);
59
59
  for (const [relativePath, group] of Object.entries(requiresGroup)) {
60
60
  await generate({
@@ -38,18 +38,19 @@ export default async function writeOneClientFile({ cwd, projectInfo, clientTempl
38
38
  const segmentImportPath = routeFilePath
39
39
  ? path.relative(path.resolve(cwd, outCwdRelativeDir, typeof segmentName === 'string' ? segmentName || ROOT_SEGMENT_SCHEMA_NAME : '.'), path.resolve(cwd, routeFilePath))
40
40
  : null;
41
- const { origin: configOrigin, rootEntry: configRootEntry } = {
41
+ const { origin: segmentConfigOrigin, rootEntry: segmentConfigRootEntry, segmentNameOverride, } = {
42
42
  ...(config.segmentConfig ? config.segmentConfig[sName] : {}),
43
43
  ...(templateDef.segmentConfig ? templateDef.segmentConfig[sName] : {}),
44
44
  };
45
45
  return [
46
46
  sName,
47
47
  {
48
- segmentApiRoot: configOrigin || configRootEntry
49
- ? `${configOrigin ?? origin}/${configRootEntry ?? config.rootEntry}`
48
+ segmentApiRoot: segmentConfigOrigin || segmentConfigRootEntry
49
+ ? `${segmentConfigOrigin ?? origin}/${segmentConfigRootEntry ?? config.rootEntry}`
50
50
  : null,
51
51
  routeFilePath,
52
52
  segmentImportPath,
53
+ segmentNameOverride,
53
54
  },
54
55
  ];
55
56
  })),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vovk-cli",
3
- "version": "0.0.1-draft.191",
3
+ "version": "0.0.1-draft.193",
4
4
  "bin": {
5
5
  "vovk": "./dist/index.mjs"
6
6
  },
@@ -35,10 +35,10 @@
35
35
  },
36
36
  "homepage": "https://vovk.dev",
37
37
  "peerDependencies": {
38
- "vovk": "^3.0.0-draft.143"
38
+ "vovk": "^3.0.0-draft.154"
39
39
  },
40
40
  "optionalDependencies": {
41
- "vovk-python-client": "^0.0.1-draft.34"
41
+ "vovk-python-client": "^0.0.1-draft.36"
42
42
  },
43
43
  "dependencies": {
44
44
  "@inquirer/prompts": "^7.5.1",
@@ -68,7 +68,7 @@
68
68
  "tsdown": "^0.11.7",
69
69
  "type-fest": "^4.41.0",
70
70
  "undici": "^7.9.0",
71
- "vovk-openapi": "^0.0.1-draft.110"
71
+ "vovk-openapi": "^0.0.1-draft.112"
72
72
  },
73
73
  "devDependencies": {
74
74
  "@types/concat-stream": "^2.0.3",