tova 0.11.12 → 0.11.21

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tova",
3
- "version": "0.11.12",
3
+ "version": "0.11.21",
4
4
  "description": "Tova — a modern programming language that transpiles to JavaScript, unifying frontend and backend",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
@@ -168,9 +168,11 @@ export class Analyzer {
168
168
  // Async
169
169
  'sleep',
170
170
  // String functions
171
- 'upper', 'lower', 'contains', 'starts_with', 'ends_with',
172
- 'chars', 'words', 'lines', 'capitalize', 'title_case',
173
- 'snake_case', 'camel_case',
171
+ 'upper', 'lower', 'contains', 'startsWith', 'endsWith',
172
+ 'starts_with', 'ends_with',
173
+ 'chars', 'words', 'lines', 'capitalize', 'titleCase',
174
+ 'snakeCase', 'camelCase',
175
+ 'title_case', 'snake_case', 'camel_case',
174
176
  // Math extras
175
177
  'min', 'max',
176
178
  // Table operations
package/src/cli/doctor.js CHANGED
@@ -28,12 +28,12 @@ export async function doctorCommand() {
28
28
 
29
29
  // 2. Bun availability
30
30
  try {
31
- const bunProc = _compatSpawnSync('bun', ['--version'], { stdout: 'pipe', stderr: 'pipe' });
31
+ const bunProc = _compatSpawnSync('bun', ['--version'], { stdout: 'pipe', stderr: 'pipe', timeout: 10000 });
32
32
  const bunVer = (bunProc.stdout || '').toString().trim();
33
33
  if ((bunProc.exitCode ?? bunProc.status) === 0 && bunVer) {
34
34
  const major = parseInt(bunVer.split('.')[0], 10);
35
35
  if (major >= 1) {
36
- const whichProc = _compatSpawnSync('which', ['bun'], { stdout: 'pipe', stderr: 'pipe' });
36
+ const whichProc = _compatSpawnSync('which', ['bun'], { stdout: 'pipe', stderr: 'pipe', timeout: 5000 });
37
37
  pass(`Bun v${bunVer}`, (whichProc.stdout || '').toString().trim());
38
38
  } else {
39
39
  warn(`Bun v${bunVer}`, 'Bun >= 1.0 recommended');
@@ -82,7 +82,7 @@ export async function doctorCommand() {
82
82
 
83
83
  // 5. git
84
84
  try {
85
- const gitProc = _compatSpawnSync('git', ['--version'], { stdout: 'pipe', stderr: 'pipe' });
85
+ const gitProc = _compatSpawnSync('git', ['--version'], { stdout: 'pipe', stderr: 'pipe', timeout: 10000 });
86
86
  if ((gitProc.exitCode ?? gitProc.status) === 0) {
87
87
  const gitVer = (gitProc.stdout || '').toString().trim();
88
88
  pass('git available', gitVer);
package/src/lsp/server.js CHANGED
@@ -872,18 +872,26 @@ class TovaLanguageServer {
872
872
  'upper': '`fn upper(s) -> String` — Convert to uppercase',
873
873
  'lower': '`fn lower(s) -> String` — Convert to lowercase',
874
874
  'contains': '`fn contains(s, sub) -> Bool` — Check if string contains substring',
875
- 'starts_with': '`fn starts_with(s, prefix) -> Bool` — Check if string starts with prefix',
876
- 'ends_with': '`fn ends_with(s, suffix) -> Bool` — Check if string ends with suffix',
875
+ 'startsWith': '`fn startsWith(s, prefix) -> Bool` — Check if string starts with prefix',
876
+ 'starts_with': '`fn startsWith(s, prefix) -> Bool` — Check if string starts with prefix',
877
+ 'endsWith': '`fn endsWith(s, suffix) -> Bool` — Check if string ends with suffix',
878
+ 'ends_with': '`fn endsWith(s, suffix) -> Bool` — Check if string ends with suffix',
877
879
  'chars': '`fn chars(s) -> [String]` — Split string into individual characters',
878
880
  'words': '`fn words(s) -> [String]` — Split by whitespace',
879
881
  'lines': '`fn lines(s) -> [String]` — Split by newlines',
880
882
  'capitalize': '`fn capitalize(s) -> String` — Capitalize first letter',
881
- 'title_case': '`fn title_case(s) -> String` — Capitalize each word',
882
- 'snake_case': '`fn snake_case(s) -> String` — Convert to snake_case',
883
- 'camel_case': '`fn camel_case(s) -> String` — Convert to camelCase',
884
- 'kebab_case': '`fn kebab_case(s) -> String` — Convert to kebab-case',
885
- 'pad_start': '`fn pad_start(s, n, fill?) -> String` — Pad start to length n',
886
- 'pad_end': '`fn pad_end(s, n, fill?) -> String` — Pad end to length n',
883
+ 'titleCase': '`fn titleCase(s) -> String` — Capitalize each word',
884
+ 'title_case': '`fn titleCase(s) -> String` — Capitalize each word',
885
+ 'snakeCase': '`fn snakeCase(s) -> String` — Convert to snake_case',
886
+ 'snake_case': '`fn snakeCase(s) -> String` — Convert to snake_case',
887
+ 'camelCase': '`fn camelCase(s) -> String` — Convert to camelCase',
888
+ 'camel_case': '`fn camelCase(s) -> String` — Convert to camelCase',
889
+ 'kebabCase': '`fn kebabCase(s) -> String` — Convert to kebab-case',
890
+ 'kebab_case': '`fn kebabCase(s) -> String` — Convert to kebab-case',
891
+ 'padStart': '`fn padStart(s, n, fill?) -> String` — Pad start to length n',
892
+ 'pad_start': '`fn padStart(s, n, fill?) -> String` — Pad start to length n',
893
+ 'padEnd': '`fn padEnd(s, n, fill?) -> String` — Pad end to length n',
894
+ 'pad_end': '`fn padEnd(s, n, fill?) -> String` — Pad end to length n',
887
895
  'char_at': '`fn char_at(s, i) -> String?` — Character at index (nil if out of bounds)',
888
896
  'index_of': '`fn index_of(s, sub) -> Int?` — Index of first occurrence (nil if not found)',
889
897
  'last_index_of': '`fn last_index_of(s, sub) -> Int?` — Index of last occurrence',
@@ -11,8 +11,11 @@ const methods = {
11
11
  words() { return this.split(/\s+/).filter(Boolean); },
12
12
  lines() { return this.split('\n'); },
13
13
  capitalize() { return this.length ? this.charAt(0).toUpperCase() + this.slice(1) : this; },
14
+ titleCase() { return this.replace(/\b\w/g, c => c.toUpperCase()); },
14
15
  title_case() { return this.replace(/\b\w/g, c => c.toUpperCase()); },
16
+ snakeCase() { return this.replace(/[-\s]+/g, '_').replace(/([a-z0-9])([A-Z])/g, '$1_$2').toLowerCase().replace(/^_/, ''); },
15
17
  snake_case() { return this.replace(/[-\s]+/g, '_').replace(/([a-z0-9])([A-Z])/g, '$1_$2').toLowerCase().replace(/^_/, ''); },
18
+ camelCase() { return this.replace(/[-_\s]+(.)?/g, (_, c) => c ? c.toUpperCase() : '').replace(/^[A-Z]/, c => c.toLowerCase()); },
16
19
  camel_case() { return this.replace(/[-_\s]+(.)?/g, (_, c) => c ? c.toUpperCase() : '').replace(/^[A-Z]/, c => c.toLowerCase()); },
17
20
  };
18
21
 
package/src/version.js CHANGED
@@ -1,2 +1,2 @@
1
1
  // Auto-generated by scripts/embed-runtime.js — do not edit
2
- export const VERSION = "0.11.12";
2
+ export const VERSION = "0.11.21";