kontexted 0.1.8 → 0.1.9

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.
@@ -1,4 +1,4 @@
1
- import { configExists, getDefaultConfig, saveConfig, getMigrationsDir, getPublicDir, runMigration, } from '../../lib/server/index.js';
1
+ import { configExists, getDefaultConfig, saveConfig, getMigrationsDir, getPublicDir, runMigration, validateNamingConvention, } from '../../lib/server/index.js';
2
2
  import { CONFIG_FILE, DATA_DIR } from '../../lib/server/constants.js';
3
3
  import * as readline from 'readline';
4
4
  // ============ Helper Functions ============
@@ -39,6 +39,8 @@ async function runInit(interactive) {
39
39
  const host = hostAnswer.trim() || 'localhost';
40
40
  const levelAnswer = await promptQuestion(rl, 'Log level (debug/info/warn/error) [info]: ');
41
41
  const level = (levelAnswer.trim().toLowerCase() || 'info');
42
+ const namingAnswer = await promptQuestion(rl, 'Default naming convention (kebab-case/camelCase/snake_case/PascalCase) [kebab-case]: ');
43
+ const namingConvention = validateNamingConvention(namingAnswer.trim() || 'kebab-case');
42
44
  const migrationsDir = getMigrationsDir();
43
45
  const publicDir = getPublicDir();
44
46
  const defaultConfig = getDefaultConfig();
@@ -56,6 +58,9 @@ async function runInit(interactive) {
56
58
  inviteCode: defaultConfig.auth.inviteCode,
57
59
  method: defaultConfig.auth.method,
58
60
  },
61
+ naming: {
62
+ defaultConvention: namingConvention,
63
+ },
59
64
  paths: {
60
65
  migrationsDir: migrationsDir || undefined,
61
66
  publicDir: publicDir || undefined,
@@ -1,3 +1,11 @@
1
+ /**
2
+ * Supported naming conventions for auto-generated names
3
+ */
4
+ export type NamingConvention = 'kebab-case' | 'camelCase' | 'snake_case' | 'PascalCase';
5
+ /**
6
+ * Validates a naming convention value
7
+ */
8
+ export declare function validateNamingConvention(value: unknown): NamingConvention;
1
9
  /**
2
10
  * Server configuration interface
3
11
  */
@@ -28,6 +36,9 @@ export interface ServerConfig {
28
36
  issuer: string;
29
37
  };
30
38
  };
39
+ naming: {
40
+ defaultConvention: NamingConvention;
41
+ };
31
42
  paths?: {
32
43
  publicDir?: string;
33
44
  migrationsDir?: string;
@@ -3,6 +3,16 @@ import { dirname } from 'path';
3
3
  import { randomBytes } from 'crypto';
4
4
  import { CONFIG_FILE, DATA_DIR, } from './constants.js';
5
5
  import { getMigrationsDir, getPublicDir } from './binary.js';
6
+ const VALID_NAMING_CONVENTIONS = ['kebab-case', 'camelCase', 'snake_case', 'PascalCase'];
7
+ /**
8
+ * Validates a naming convention value
9
+ */
10
+ export function validateNamingConvention(value) {
11
+ if (typeof value === 'string' && VALID_NAMING_CONVENTIONS.includes(value)) {
12
+ return value;
13
+ }
14
+ return 'kebab-case';
15
+ }
6
16
  /**
7
17
  * Generates a secure random token secret (32 bytes as hex string)
8
18
  */
@@ -54,6 +64,9 @@ export function getDefaultConfig() {
54
64
  inviteCode: generateInviteCode(),
55
65
  method: 'email-password',
56
66
  },
67
+ naming: {
68
+ defaultConvention: 'kebab-case',
69
+ },
57
70
  };
58
71
  // Add paths if platform package is available
59
72
  if (migrationsDir || publicDir) {
@@ -120,6 +133,9 @@ export function loadConfig() {
120
133
  },
121
134
  } : {}),
122
135
  },
136
+ naming: {
137
+ defaultConvention: validateNamingConvention(parsed.naming?.defaultConvention),
138
+ },
123
139
  paths: {
124
140
  publicDir: parsed.paths?.publicDir,
125
141
  migrationsDir: parsed.paths?.migrationsDir,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kontexted",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "CLI tool for Kontexted - MCP proxy, workspaces management, and local server",
5
5
  "type": "module",
6
6
  "bin": {
@@ -43,8 +43,8 @@
43
43
  "typescript": "^5.6.0"
44
44
  },
45
45
  "optionalDependencies": {
46
- "@kontexted/darwin-arm64": "0.1.8",
47
- "@kontexted/linux-x64": "0.1.8",
48
- "@kontexted/windows-x64": "0.1.8"
46
+ "@kontexted/darwin-arm64": "0.1.9",
47
+ "@kontexted/linux-x64": "0.1.9",
48
+ "@kontexted/windows-x64": "0.1.9"
49
49
  }
50
50
  }