depth-first-thinking 2.0.9 → 2.1.1
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 +2 -1
- package/src/commands/update.ts +2 -20
- package/src/index.ts +2 -1
- package/src/version.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "depth-first-thinking",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.1.1",
|
|
4
4
|
"description": "A terminal-based task manager with depth-first navigation. Break down tasks into subtasks, navigate recursively, and track progress.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"check:fix": "bunx biome check --write src",
|
|
47
47
|
"check-types": "bunx tsc --noEmit",
|
|
48
48
|
"test": "bun test",
|
|
49
|
+
"sync-version": "bun run scripts/sync-version.ts",
|
|
49
50
|
"prepublishOnly": "bun run check && bun run check-types",
|
|
50
51
|
"prepare": "husky",
|
|
51
52
|
"ci": "bun run format && bun run lint && bun run check-types"
|
package/src/commands/update.ts
CHANGED
|
@@ -1,23 +1,5 @@
|
|
|
1
1
|
import { ExitCodes } from "../data/types";
|
|
2
|
-
|
|
3
|
-
async function getCurrentVersion(): Promise<string> {
|
|
4
|
-
try {
|
|
5
|
-
const packageJsonFile = Bun.file("package.json");
|
|
6
|
-
if (await packageJsonFile.exists()) {
|
|
7
|
-
const packageJson = (await packageJsonFile.json()) as { version: string };
|
|
8
|
-
return packageJson.version;
|
|
9
|
-
}
|
|
10
|
-
// Fallback: try relative to src/commands
|
|
11
|
-
const fallbackFile = Bun.file("../../package.json");
|
|
12
|
-
if (await fallbackFile.exists()) {
|
|
13
|
-
const packageJson = (await fallbackFile.json()) as { version: string };
|
|
14
|
-
return packageJson.version;
|
|
15
|
-
}
|
|
16
|
-
return "unknown";
|
|
17
|
-
} catch {
|
|
18
|
-
return "unknown";
|
|
19
|
-
}
|
|
20
|
-
}
|
|
2
|
+
import { VERSION } from "../version";
|
|
21
3
|
|
|
22
4
|
async function fetchLatestVersion(): Promise<string | null> {
|
|
23
5
|
try {
|
|
@@ -48,7 +30,7 @@ function compareVersions(current: string, latest: string): number {
|
|
|
48
30
|
}
|
|
49
31
|
|
|
50
32
|
export async function updateCommand(): Promise<void> {
|
|
51
|
-
const currentVersion =
|
|
33
|
+
const currentVersion = VERSION;
|
|
52
34
|
console.log(`Current version: ${currentVersion}`);
|
|
53
35
|
|
|
54
36
|
const latestVersion = await fetchLatestVersion();
|
package/src/index.ts
CHANGED
|
@@ -9,13 +9,14 @@ import { treeCommand } from "./commands/tree";
|
|
|
9
9
|
import { updateCommand } from "./commands/update";
|
|
10
10
|
import { getMostOpenedProject } from "./data/storage";
|
|
11
11
|
import { isValidProjectName } from "./utils/validation";
|
|
12
|
+
import { VERSION } from "./version";
|
|
12
13
|
|
|
13
14
|
const program = new Command();
|
|
14
15
|
|
|
15
16
|
program
|
|
16
17
|
.name("dft")
|
|
17
18
|
.description("Depth-First Thinking - Solve problems the depth-first way")
|
|
18
|
-
.version(
|
|
19
|
+
.version(VERSION);
|
|
19
20
|
|
|
20
21
|
program
|
|
21
22
|
.command("new <project_name>")
|
package/src/version.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const VERSION = "2.1.1";
|