diff --git a/.changeset/eighty-bottles-repair.md b/.changeset/eighty-bottles-repair.md new file mode 100644 index 00000000..2032eb1e --- /dev/null +++ b/.changeset/eighty-bottles-repair.md @@ -0,0 +1,5 @@ +--- +"@solidjs/router": minor +--- + +Update `moduleResolution` diff --git a/.github/workflows/dist-typecheck.yml b/.github/workflows/dist-typecheck.yml new file mode 100644 index 00000000..8cdbef56 --- /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 ca2bf1ff..816f288e 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 137c35e3..983f9506 100644 --- a/package.json +++ b/package.json @@ -58,5 +58,6 @@ }, "peerDependencies": { "solid-js": "^1.8.6" - } + }, + "packageManager": "pnpm@10.19.0+sha512.c9fc7236e92adf5c8af42fd5bf1612df99c2ceb62f27047032f4720b33f8eacdde311865e91c411f2774f618d82f320808ecb51718bfa82c060c4ba7c76a32b8" } diff --git a/src/data/response.ts b/src/data/response.ts index 190974bf..a90fcd00 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 9d5f28e5..13b94d83 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 e3703680..6cb0b862 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 d347fb2f..0d3311e8 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/data.spec.tsx b/test/data.spec.tsx index 9869f4e6..9f0f6790 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}; diff --git a/test/types.spec.ts b/test/types.spec.ts index fd15575c..2033aa3c 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 730dbd9b..187fb7e3 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 022a057f..1d350889 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,12 +3,13 @@ "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"], "exclude": ["node_modules/"]