From 2234bcab3fdad32fa03228504319e48794c9e7a9 Mon Sep 17 00:00:00 2001 From: Christopher Hiller Date: Wed, 4 Sep 2024 12:00:09 -0700 Subject: [PATCH] fix: windows compat --- package.json | 2 +- src/paths-cjs.cts | 2 +- src/paths.ts | 9 +++------ 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/package.json b/package.json index 397819b..cea720d 100644 --- a/package.json +++ b/package.json @@ -64,7 +64,7 @@ "lint:staged": "lint-staged", "prepare": "husky", "prepublishOnly": "npm run build", - "test": "node --import tsx ./test/impvol.spec.ts", + "test": "node --test --import tsx ./test/impvol.spec.ts", "tsc": "tsc -p tsconfig.tsc.json" }, "peerDependencies": { diff --git a/src/paths-cjs.cts b/src/paths-cjs.cts index 2fddce5..5643956 100644 --- a/src/paths-cjs.cts +++ b/src/paths-cjs.cts @@ -1,5 +1,5 @@ import {pathToFileURL} from 'url'; -export const HOOKS_PATH = require.resolve('./impvol-hooks.js'); +export const HOOKS_PATH = pathToFileURL(require.resolve('./impvol-hooks.js')); export const IMPVOL_URL = pathToFileURL(require.resolve('./impvol.js')); diff --git a/src/paths.ts b/src/paths.ts index 87441a2..b361eed 100644 --- a/src/paths.ts +++ b/src/paths.ts @@ -1,10 +1,7 @@ /* eslint-disable @typescript-eslint/ban-ts-comment */ -import {fileURLToPath} from 'url'; - -export const HOOKS_PATH = fileURLToPath( +export const HOOKS_PATH = // @ts-ignore - new URL('./impvol-hooks.js', import.meta.url), -); + new URL('./impvol-hooks.js', import.meta.url); // @ts-ignore -export const IMPVOL_URL = new URL('./impvol.js', import.meta.url).href; +export const IMPVOL_URL = new URL('./impvol.js', import.meta.url);