diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index afbb0a3..294adda 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -16,7 +16,6 @@ jobs: strategy: matrix: - # node-version: [18.x, 20.x, 22.x] node-version: [latest] # See supported Node.js release schedule at https://nodejs.org/en/about/releases/ diff --git a/package-lock.json b/package-lock.json index ce2dba9..ac5a82e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "platformdirs", - "version": "4.3.8-rc2", + "version": "4.3.8-rc3", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "platformdirs", - "version": "4.3.8-rc2", + "version": "4.3.8-rc3", "license": "MIT", "bin": { "platformdirs": "dist/main.js" diff --git a/package.json b/package.json index 0eb3cb9..af66a9e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "platformdirs", - "version": "4.3.8-rc2", + "version": "4.3.8-rc3", "description": "📂 Unified interface to get platform-specific directories", "keywords": [ "nodejs", @@ -29,17 +29,18 @@ "./unix": "./dist/unix.js", "./version": "./dist/version.js" }, + "types": "dist/index.d.ts", "bin": { "platformdirs": "dist/main.js" }, "files": ["dist"], "scripts": { + "build": "tsc --noCheck", "format": "biome format --write .", "lint": "biome check --write . && tsc --noEmit", - "run": "node --experimental-transform-types src/main.ts", - "test": "node --experimental-transform-types --test", - "build": "tsc --noCheck", - "prepack": "npm run build" + "prepack": "npm run build", + "platformdirs": "node --experimental-transform-types src/main.ts", + "test": "node --experimental-transform-types --test" }, "devDependencies": { "@biomejs/biome": "1.9.4", diff --git a/src/version.ts b/src/version.ts index f414120..2539af4 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1,7 +1,9 @@ import { readFile } from "node:fs/promises"; // https://github.com/nodejs/node/issues/51347 -const packageJSON = JSON.parse(await readFile(new URL(import.meta.resolve("../package.json")), "utf8")) as { version: string; }; +const packageJSON = JSON.parse( + await readFile(new URL(import.meta.resolve("../package.json")), "utf8"), +) as { version: string }; function throwExpression(error: unknown): never { throw error; @@ -11,4 +13,8 @@ export const version: string = packageJSON.version; const match = packageJSON.version.match(/^(\d+)\.(\d+)\.(\d+)/) ?? throwExpression(new Error("unreachable")); -export const versionTuple: [number, number, number] = [+match[1], +match[2], +match[3]]; +export const versionTuple: [number, number, number] = [ + +match[1], + +match[2], + +match[3], +]; diff --git a/src/windows.ts b/src/windows.ts index 21f3604..25063f0 100644 --- a/src/windows.ts +++ b/src/windows.ts @@ -26,7 +26,10 @@ export class Windows extends PlatformDirsABC { return this._appendParts(path2); } - protected _appendParts(path2: string, { opinionValue }: { opinionValue?: string | undefined; } = {}): string { + protected _appendParts( + path2: string, + { opinionValue }: { opinionValue?: string | undefined } = {}, + ): string { const params = []; if (this.appname) { if (this.appauthor !== false) { @@ -196,7 +199,9 @@ function getWinFolderFromEnvVars(csidlName: string): string { /** * Get a folder for a CSIDL name that does not exist as an environment variable. */ -function getWinFolderIfCSIDLNameNotEnvVar(csidlName: string): string | undefined { +function getWinFolderIfCSIDLNameNotEnvVar( + csidlName: string, +): string | undefined { if (csidlName === "CSIDL_PERSONAL") { const p = process.env.USERPROFILE; if (p === undefined) { diff --git a/test/main.test.js b/test/main.test.js index 26ccccc..d550636 100644 --- a/test/main.test.js +++ b/test/main.test.js @@ -14,6 +14,8 @@ test("matches python platformdirs", async (t) => { const expected = ( await $`uv run --with platformdirs python -m platformdirs` ).stdout.replace(/^.*\n/, ""); - const actual = (await $`node --experimental-transform-types src/main.ts`).stdout.replace(/^.*\n/, ""); + const actual = ( + await $`node --experimental-transform-types src/main.ts` + ).stdout.replace(/^.*\n/, ""); assert.equal(actual, expected); }); diff --git a/tsconfig.json b/tsconfig.json index e4dda5f..ed4ef2a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -14,5 +14,5 @@ "outDir": "dist", "declaration": true }, - "include": ["src"], + "include": ["src"] }