depth-first-thinking 2.1.0 → 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 -27
- 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.1.
|
|
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,22 +1,5 @@
|
|
|
1
1
|
import { ExitCodes } from "../data/types";
|
|
2
|
-
|
|
3
|
-
async function getCurrentVersion(): Promise<string> {
|
|
4
|
-
try {
|
|
5
|
-
// Resolve the package.json that belongs to this installed package,
|
|
6
|
-
// regardless of the current working directory.
|
|
7
|
-
const packageUrl = new URL("../../package.json", import.meta.url);
|
|
8
|
-
const packageJsonFile = Bun.file(packageUrl);
|
|
9
|
-
|
|
10
|
-
if (await packageJsonFile.exists()) {
|
|
11
|
-
const packageJson = (await packageJsonFile.json()) as { version?: string };
|
|
12
|
-
return packageJson.version ?? "unknown";
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
return "unknown";
|
|
16
|
-
} catch {
|
|
17
|
-
return "unknown";
|
|
18
|
-
}
|
|
19
|
-
}
|
|
2
|
+
import { VERSION } from "../version";
|
|
20
3
|
|
|
21
4
|
async function fetchLatestVersion(): Promise<string | null> {
|
|
22
5
|
try {
|
|
@@ -47,17 +30,9 @@ function compareVersions(current: string, latest: string): number {
|
|
|
47
30
|
}
|
|
48
31
|
|
|
49
32
|
export async function updateCommand(): Promise<void> {
|
|
50
|
-
const currentVersion =
|
|
33
|
+
const currentVersion = VERSION;
|
|
51
34
|
console.log(`Current version: ${currentVersion}`);
|
|
52
35
|
|
|
53
|
-
if (currentVersion === "unknown") {
|
|
54
|
-
console.log(
|
|
55
|
-
"Could not determine the current version. Please make sure dft is installed correctly.",
|
|
56
|
-
);
|
|
57
|
-
process.exit(ExitCodes.FILESYSTEM_ERROR);
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
|
|
61
36
|
const latestVersion = await fetchLatestVersion();
|
|
62
37
|
|
|
63
38
|
if (!latestVersion) {
|
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";
|