• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Tribally-Games / game-base / 20186099473

13 Dec 2025 03:27AM UTC coverage: 82.444% (-8.0%) from 90.426%
20186099473

push

github

web-flow
refactor: migrate to clockwork-engine monorepo packages (#5)

3 of 3 new or added lines in 3 files covered. (100.0%)

71 existing lines in 2 files now uncovered.

850 of 1031 relevant lines covered (82.44%)

26.67 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

92.86
/src/cli/demo/utils.ts
1
import * as fs from "node:fs"
30✔
2
import * as path from "node:path"
34✔
3

4
export async function validateGamePath(gamePath: string): Promise<void> {
18✔
5
  const resolvedPath = path.resolve(gamePath)
46✔
6

7
  if (!fs.existsSync(resolvedPath)) {
38✔
8
    throw new Error(`Game path does not exist: ${resolvedPath}`)
60✔
9
  }
2✔
10

11
  if (!fs.statSync(resolvedPath).isDirectory()) {
50✔
12
    throw new Error(`Game path is not a directory: ${resolvedPath}`)
64✔
13
  }
2✔
14

15
  const packageJsonPath = path.join(resolvedPath, "package.json")
66✔
16
  if (!fs.existsSync(packageJsonPath)) {
41✔
17
    throw new Error(`No package.json found in game directory: ${resolvedPath}`)
75✔
18
  }
2✔
19

20
  const srcIndexPath = path.join(resolvedPath, "src", "index.ts")
66✔
21
  if (!fs.existsSync(srcIndexPath)) {
38✔
22
    throw new Error(`No src/index.ts found in game directory: ${resolvedPath}`)
75✔
23
  }
2✔
24
}
25

26
export function getTemplatePath(): string {
11✔
27
  // Resolve from this file's location to find the package root
28
  // When built: bin/game-base.js -> need to find src/demo-template/
29
  // Start from the bin directory and go up to package root
30
  let currentDir = path.dirname(new URL(import.meta.url).pathname)
67✔
31

32
  // Walk up to find package.json (package root)
33
  while (currentDir !== path.dirname(currentDir)) {
52✔
34
    const packageJsonPath = path.join(currentDir, "package.json")
66✔
35
    if (fs.existsSync(packageJsonPath)) {
42✔
36
      // Found package root
37
      return path.join(currentDir, "src", "demo-template")
52✔
38
    }
4✔
39
    currentDir = path.dirname(currentDir)
40✔
UNCOV
40
  }
×
41

UNCOV
42
  throw new Error("Could not find game-base package root")
×
43
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc