From c6bbbead880d64e7528becf432679992ed03fad9 Mon Sep 17 00:00:00 2001 From: Atila Fassina Date: Sun, 9 Nov 2025 12:05:41 +0100 Subject: [PATCH 1/5] update `moduleResolution` from `node` to `NodeNext` --- src/data/response.ts | 2 +- src/routers/HashRouter.ts | 2 +- src/routers/createRouter.ts | 2 +- src/utils.ts | 2 +- test/types.spec.ts | 8 ++++---- test/utils.spec.ts | 2 +- tsconfig.json | 4 ++-- 7 files changed, 11 insertions(+), 11 deletions(-) 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 d347fb2fb..0d3311e81 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 022a057fa..009ca9480 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,12 +3,12 @@ "declaration": true, "target": "esnext", "newLine": "LF", - "moduleResolution": "node", + "moduleResolution": "NodeNext", "strict": true, "jsx": "preserve", "jsxImportSource": "solid-js", "outDir": "./dist", - "module": "esnext" + "module": "NodeNext" }, "include": ["./src"], "exclude": ["node_modules/"] From 10d4dc0847fdd723d65adfc6352f074f3c06c3d9 Mon Sep 17 00:00:00 2001 From: Atila Fassina Date: Sun, 9 Nov 2025 12:46:06 +0100 Subject: [PATCH 2/5] add `skipLibCheck` --- tsconfig.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tsconfig.json b/tsconfig.json index 009ca9480..1d3508892 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -8,7 +8,8 @@ "jsx": "preserve", "jsxImportSource": "solid-js", "outDir": "./dist", - "module": "NodeNext" + "module": "NodeNext", + "skipLibCheck": true }, "include": ["./src"], "exclude": ["node_modules/"] From 9e85fe28d9d90c604ae101bad91239ada109d724 Mon Sep 17 00:00:00 2001 From: Ryan Carniato Date: Mon, 10 Nov 2025 10:57:03 -0800 Subject: [PATCH 3/5] add changeset --- .changeset/eighty-bottles-repair.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/eighty-bottles-repair.md 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` From 2ba0b4f43e6b4611b623fe1e3a54eb5529930e0d Mon Sep 17 00:00:00 2001 From: Atila Fassina Date: Sat, 22 Nov 2025 20:38:27 +0100 Subject: [PATCH 4/5] rerun --- test/data.spec.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/data.spec.tsx b/test/data.spec.tsx index 9869f4e6b..9f0f6790a 100644 --- a/test/data.spec.tsx +++ b/test/data.spec.tsx @@ -7,8 +7,8 @@ import { createSignal } from "solid-js"; import { render } from "solid-js/web"; -import { createAsync, createAsyncStore } from "../src/data"; -import { awaitPromise, waitFor } from "./helpers"; +import { createAsync } from "../src/data/createAsync.js"; +import { awaitPromise } from "./helpers.js"; function Parent(props: ParentProps) { return }>{props.children}; From 4a543bda0f4848ecc56303d84b4f10d261abd20c Mon Sep 17 00:00:00 2001 From: Atila Fassina Date: Sat, 22 Nov 2025 20:45:44 +0100 Subject: [PATCH 5/5] add dist-types check --- .github/workflows/dist-typecheck.yml | 32 ++++++++++++++++++++++++++++ .github/workflows/test.yml | 6 ++---- package.json | 3 ++- 3 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/dist-typecheck.yml diff --git a/.github/workflows/dist-typecheck.yml b/.github/workflows/dist-typecheck.yml new file mode 100644 index 000000000..8cdbef566 --- /dev/null +++ b/.github/workflows/dist-typecheck.yml @@ -0,0 +1,32 @@ +name: Type Check Distribution + +on: + pull_request: ~ + push: + branches: + - main + +jobs: + typecheck-dist: + name: Check dist types + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Use Node.js from nvmrc + uses: actions/setup-node@v4 + with: + node-version-file: ".nvmrc" + registry-url: "https://registry.npmjs.org" + + - name: Install pnpm + uses: pnpm/action-setup@v4 + + - name: Install dependencies + run: pnpm install + + - name: Build package and dependencies + run: pnpm build + + - name: Check types + run: pnpx @arethetypeswrong/cli --pack . --profile esm-only diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ca2bf1ff3..816f288e1 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,13 +17,11 @@ jobs: - name: Use Node.js from nvmrc uses: actions/setup-node@v4 with: - node-version-file: '.nvmrc' - registry-url: 'https://registry.npmjs.org' + node-version-file: ".nvmrc" + registry-url: "https://registry.npmjs.org" - name: Install pnpm uses: pnpm/action-setup@v4 - with: - version: 9 - name: Install dependencies run: pnpm install diff --git a/package.json b/package.json index 137c35e33..983f95066 100644 --- a/package.json +++ b/package.json @@ -58,5 +58,6 @@ }, "peerDependencies": { "solid-js": "^1.8.6" - } + }, + "packageManager": "pnpm@10.19.0+sha512.c9fc7236e92adf5c8af42fd5bf1612df99c2ceb62f27047032f4720b33f8eacdde311865e91c411f2774f618d82f320808ecb51718bfa82c060c4ba7c76a32b8" }