diff --git a/.changeset/eighty-bottles-repair.md b/.changeset/eighty-bottles-repair.md new file mode 100644 index 000000000..2032eb1e1 --- /dev/null +++ b/.changeset/eighty-bottles-repair.md @@ -0,0 +1,5 @@ +--- +"@solidjs/router": minor +--- + +Update `moduleResolution` diff --git a/src/data/response.ts b/src/data/response.ts index 190974bf3..a90fcd000 100644 --- a/src/data/response.ts +++ b/src/data/response.ts @@ -1,4 +1,4 @@ -import type { RouterResponseInit, CustomResponse } from "../types"; +import type { RouterResponseInit, CustomResponse } from "../types.js"; export function redirect(url: string, init: number | RouterResponseInit = 302) { let responseInit: ResponseInit; diff --git a/src/routers/HashRouter.ts b/src/routers/HashRouter.ts index 9d5f28e51..13b94d833 100644 --- a/src/routers/HashRouter.ts +++ b/src/routers/HashRouter.ts @@ -1,6 +1,6 @@ import type { JSX } from "solid-js"; import { setupNativeEvents } from "../data/events.js"; -import type { BaseRouterProps } from "./components.js"; +import type { BaseRouterProps } from "./components.jsx"; import { createRouter, scrollToHash, bindEvent } from "./createRouter.js"; import { createBeforeLeave, keepDepth, notifyIfNotBlocked, saveCurrentDepth } from "../lifecycle.js"; diff --git a/src/routers/createRouter.ts b/src/routers/createRouter.ts index e37036806..6cb0b8626 100644 --- a/src/routers/createRouter.ts +++ b/src/routers/createRouter.ts @@ -1,5 +1,5 @@ import { type Signal, createSignal, onCleanup, sharedConfig } from "solid-js"; -import type { LocationChange, RouterContext, RouterUtils } from "../types.ts"; +import type { LocationChange, RouterContext, RouterUtils } from "../types.js"; import { createRouterComponent } from "./components.jsx"; function intercept( diff --git a/src/utils.ts b/src/utils.ts index eb0c0b1c8..34e09f994 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -8,7 +8,7 @@ import type { SearchParams, SetParams, SetSearchParams -} from "./types.ts"; +} from "./types.js"; const hasSchemeRegex = /^(?:[a-z0-9]+:)?\/\//i; const trimPathRegex = /^\/+|(\/)\/+$/g; diff --git a/test/types.spec.ts b/test/types.spec.ts index fd15575c2..2033aa3cd 100644 --- a/test/types.spec.ts +++ b/test/types.spec.ts @@ -1,7 +1,7 @@ -import { RouteProps } from "../src/routers/components"; -import { useMatch } from "../src/routing"; -import { MatchFilters } from "../src/types"; -import { createMatcher } from "../src/utils"; +import { RouteProps } from "../src/routers/components.jsx"; +import { useMatch } from "../src/routing.js"; +import { MatchFilters } from "../src/types.js"; +import { createMatcher } from "../src/utils.js"; // mock route type const Route = (props: RouteProps) => {}; diff --git a/test/utils.spec.ts b/test/utils.spec.ts index 730dbd9be..187fb7e30 100644 --- a/test/utils.spec.ts +++ b/test/utils.spec.ts @@ -6,7 +6,7 @@ import { expandOptionals, mergeSearchString, extractSearchParams -} from "../src/utils"; +} from "../src/utils.js"; describe("resolvePath should", () => { test("normalize the base arg", () => { diff --git a/tsconfig.json b/tsconfig.json index e6bd1866e..1d3508892 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,15 +3,14 @@ "declaration": true, "target": "esnext", "newLine": "LF", - "moduleResolution": "node", + "moduleResolution": "NodeNext", "strict": true, "jsx": "preserve", "jsxImportSource": "solid-js", "outDir": "./dist", - "module": "esnext" + "module": "NodeNext", + "skipLibCheck": true }, - "include": [ - "./src" - ], + "include": ["./src"], "exclude": ["node_modules/"] -} \ No newline at end of file +}