trekoon 0.2.7 → 0.2.8

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.
@@ -4,6 +4,9 @@ import { resolve } from "node:path";
4
4
 
5
5
  export const TREKOON_STORAGE_DIRNAME = ".trekoon";
6
6
  export const TREKOON_DATABASE_FILENAME = "trekoon.db";
7
+ export const TREKOON_BOARD_DIRNAME = "board";
8
+ export const TREKOON_BOARD_ENTRY_FILENAME = "index.html";
9
+ export const TREKOON_BOARD_MANIFEST_FILENAME = "manifest.json";
7
10
 
8
11
  export function resolveLegacyWorktreeStorageDir(worktreeRoot: string): string {
9
12
  return resolve(worktreeRoot, TREKOON_STORAGE_DIRNAME);
@@ -15,6 +18,18 @@ export function resolveLegacyWorktreeDatabaseFile(worktreeRoot: string): string
15
18
 
16
19
  export type StorageMode = "cwd" | "git_common_dir";
17
20
 
21
+ export function resolveBoardStorageDir(storageDir: string): string {
22
+ return resolve(storageDir, TREKOON_BOARD_DIRNAME);
23
+ }
24
+
25
+ export function resolveBoardEntryFile(storageDir: string): string {
26
+ return resolve(resolveBoardStorageDir(storageDir), TREKOON_BOARD_ENTRY_FILENAME);
27
+ }
28
+
29
+ export function resolveBoardManifestFile(storageDir: string): string {
30
+ return resolve(resolveBoardStorageDir(storageDir), TREKOON_BOARD_MANIFEST_FILENAME);
31
+ }
32
+
18
33
  export interface StoragePaths {
19
34
  readonly invocationCwd: string;
20
35
  readonly storageMode: StorageMode;
@@ -23,6 +38,9 @@ export interface StoragePaths {
23
38
  readonly sharedStorageRoot: string;
24
39
  readonly storageDir: string;
25
40
  readonly databaseFile: string;
41
+ readonly boardDir: string;
42
+ readonly boardEntryFile: string;
43
+ readonly boardManifestFile: string;
26
44
  readonly diagnostics: StoragePathDiagnostics;
27
45
  }
28
46
 
@@ -35,6 +53,9 @@ export interface StoragePathIssue {
35
53
  readonly worktreeRoot: string;
36
54
  readonly sharedStorageRoot: string;
37
55
  readonly databaseFile: string;
56
+ readonly boardDir: string;
57
+ readonly boardEntryFile: string;
58
+ readonly boardManifestFile: string;
38
59
  }
39
60
 
40
61
  export interface StoragePathDiagnostics {
@@ -44,6 +65,9 @@ export interface StoragePathDiagnostics {
44
65
  readonly worktreeRoot: string;
45
66
  readonly sharedStorageRoot: string;
46
67
  readonly databaseFile: string;
68
+ readonly boardDir: string;
69
+ readonly boardEntryFile: string;
70
+ readonly boardManifestFile: string;
47
71
  readonly warnings: readonly StoragePathIssue[];
48
72
  readonly errors: readonly StoragePathIssue[];
49
73
  }
@@ -76,6 +100,9 @@ export function resolveStoragePaths(workingDirectory: string = process.cwd()): S
76
100
  const sharedStorageRoot: string = repoCommonDir ? realpathSync(resolve(repoCommonDir, "..")) : invocationCwd;
77
101
  const storageDir: string = resolve(sharedStorageRoot, TREKOON_STORAGE_DIRNAME);
78
102
  const databaseFile: string = resolve(storageDir, TREKOON_DATABASE_FILENAME);
103
+ const boardDir: string = resolveBoardStorageDir(storageDir);
104
+ const boardEntryFile: string = resolveBoardEntryFile(storageDir);
105
+ const boardManifestFile: string = resolveBoardManifestFile(storageDir);
79
106
  const warnings: StoragePathIssue[] = [];
80
107
 
81
108
  const createIssue = (code: string, message: string): StoragePathIssue => ({
@@ -87,6 +114,9 @@ export function resolveStoragePaths(workingDirectory: string = process.cwd()): S
87
114
  worktreeRoot,
88
115
  sharedStorageRoot,
89
116
  databaseFile,
117
+ boardDir,
118
+ boardEntryFile,
119
+ boardManifestFile,
90
120
  });
91
121
 
92
122
  if (invocationCwd !== worktreeRoot) {
@@ -111,6 +141,9 @@ export function resolveStoragePaths(workingDirectory: string = process.cwd()): S
111
141
  worktreeRoot,
112
142
  sharedStorageRoot,
113
143
  databaseFile,
144
+ boardDir,
145
+ boardEntryFile,
146
+ boardManifestFile,
114
147
  warnings,
115
148
  errors: [],
116
149
  };
@@ -123,6 +156,9 @@ export function resolveStoragePaths(workingDirectory: string = process.cwd()): S
123
156
  sharedStorageRoot,
124
157
  storageDir,
125
158
  databaseFile,
159
+ boardDir,
160
+ boardEntryFile,
161
+ boardManifestFile,
126
162
  diagnostics,
127
163
  };
128
164
  }