@akanjs/devkit 2.3.6 → 2.3.7

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.
@@ -0,0 +1,19 @@
1
+ import { describe, expect, test } from "bun:test";
2
+ import path from "node:path";
3
+ import { getDirname } from "./getDirname";
4
+
5
+ describe("getDirname", () => {
6
+ test("converts file URLs to filesystem paths", () => {
7
+ const dirname = getDirname("file:///tmp/akan%20workspace/index.ts");
8
+
9
+ expect(dirname).toBe(path.join("/tmp", "akan workspace"));
10
+ });
11
+
12
+ test("keeps Windows drive paths valid when running on Windows", () => {
13
+ if (process.platform !== "win32") return;
14
+
15
+ const dirname = getDirname("file:///C:/Users/ken78/.bun/install/global/node_modules/@akanjs/devkit/index.ts");
16
+
17
+ expect(dirname).toBe("C:\\Users\\ken78\\.bun\\install\\global\\node_modules\\@akanjs\\devkit");
18
+ });
19
+ });
package/getDirname.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  import path from "node:path";
2
+ import { fileURLToPath } from "node:url";
2
3
 
3
- export const getDirname = (url: string) => path.dirname(new URL(url).pathname);
4
+ export const getDirname = (url: string) => path.dirname(fileURLToPath(url));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akanjs/devkit",
3
- "version": "2.3.6",
3
+ "version": "2.3.7",
4
4
  "sourceType": "module",
5
5
  "type": "module",
6
6
  "publishConfig": {
@@ -32,7 +32,7 @@
32
32
  "@langchain/openai": "^1.4.6",
33
33
  "@tailwindcss/node": "^4.3.0",
34
34
  "@trapezedev/project": "^7.1.4",
35
- "akanjs": "2.3.6",
35
+ "akanjs": "2.3.7",
36
36
  "chalk": "^5.6.2",
37
37
  "commander": "^14.0.3",
38
38
  "daisyui": "5.5.23",