vovk-cli 0.0.1-draft.248 → 0.0.1-draft.249

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.
@@ -62,8 +62,8 @@ export default async function getConfig({ configPath, cwd }) {
62
62
  prettifyClient: (env.VOVK_PRETTIFY_CLIENT ? !!env.VOVK_PRETTIFY_CLIENT : null) ?? conf.prettifyClient ?? false,
63
63
  devHttps: (env.VOVK_DEV_HTTPS ? !!env.VOVK_DEV_HTTPS : null) ?? conf.devHttps ?? false,
64
64
  moduleTemplates: {
65
- service: 'vovk-cli/module-templates/Service.ts.ejs',
66
- controller: 'vovk-cli/module-templates/Controller.ts.ejs',
65
+ service: 'vovk-cli/module-templates/service.ts.ejs',
66
+ controller: 'vovk-cli/module-templates/controller.ts.ejs',
67
67
  ...conf.moduleTemplates,
68
68
  },
69
69
  libs: conf.libs ?? {},
@@ -12,8 +12,8 @@ export default async function createConfig({ root, log, options: { validationLib
12
12
  .then((content) => JSON.parse(content).type === 'module');
13
13
  const configAbsolutePath = path.join(dir, isModule ? 'vovk.config.mjs' : 'vovk.config.js');
14
14
  const moduleTemplates = {
15
- controller: 'vovk-cli/module-templates/Controller.ts.ejs',
16
- service: 'vovk-cli/module-templates/Service.ts.ejs',
15
+ controller: 'vovk-cli/module-templates/controller.ts.ejs',
16
+ service: 'vovk-cli/module-templates/service.ts.ejs',
17
17
  };
18
18
  if (validationLibrary) {
19
19
  config.imports ??= {};
@@ -75,7 +75,7 @@ export function convertJSONSchemaToTypeScriptDef(schema, defsPrefix) {
75
75
  const getRefTypeName = (ref) => {
76
76
  if (ref.startsWith('#/definitions/') || ref.startsWith('#/$defs/')) {
77
77
  const path = ref.split('/');
78
- return `${defsPrefix}__${path[path.length - 1]}`;
78
+ return `${defsPrefix}__${path[path.length - 1].replace(/[^a-zA-Z0-9_$]/g, '_')}`;
79
79
  }
80
80
  return 'KnownAny'; // Fallback for external references
81
81
  };
@@ -243,7 +243,9 @@ export function convertJSONSchemaToTypeScriptDef(schema, defsPrefix) {
243
243
  if (defSchema) {
244
244
  const jsDoc = getJSDoc(defSchema);
245
245
  const defType = schemaToType(defSchema);
246
- return [jsDoc, `type ${defsPrefix}__${defName} = ${defType};`].filter(Boolean).join('\n');
246
+ return [jsDoc, `type ${defsPrefix}__${defName.replace(/[^a-zA-Z0-9_$]/g, '_')} = ${defType};`]
247
+ .filter(Boolean)
248
+ .join('\n');
247
249
  }
248
250
  return '';
249
251
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vovk-cli",
3
- "version": "0.0.1-draft.248",
3
+ "version": "0.0.1-draft.249",
4
4
  "bin": {
5
5
  "vovk": "./dist/index.mjs"
6
6
  },
@@ -38,7 +38,7 @@
38
38
  "vovk": "^3.0.0-draft.241"
39
39
  },
40
40
  "optionalDependencies": {
41
- "vovk-python": "^0.0.1-draft.40"
41
+ "vovk-python": "^0.0.1-draft.41"
42
42
  },
43
43
  "dependencies": {
44
44
  "@iarna/toml": "^2.2.5",