Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/eighty-bottles-repair.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@solidjs/router": minor
---

Update `moduleResolution`
32 changes: 32 additions & 0 deletions .github/workflows/dist-typecheck.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 2 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,6 @@
},
"peerDependencies": {
"solid-js": "^1.8.6"
}
},
"packageManager": "pnpm@10.19.0+sha512.c9fc7236e92adf5c8af42fd5bf1612df99c2ceb62f27047032f4720b33f8eacdde311865e91c411f2774f618d82f320808ecb51718bfa82c060c4ba7c76a32b8"
}
2 changes: 1 addition & 1 deletion src/data/response.ts
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/routers/HashRouter.ts
Original file line number Diff line number Diff line change
@@ -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";

Expand Down
2 changes: 1 addition & 1 deletion src/routers/createRouter.ts
Original file line number Diff line number Diff line change
@@ -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<T>(
Expand Down
2 changes: 1 addition & 1 deletion src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import type {
SearchParams,
SetParams,
SetSearchParams
} from "./types.ts";
} from "./types.js";

const hasSchemeRegex = /^(?:[a-z0-9]+:)?\/\//i;
const trimPathRegex = /^\/+|(\/)\/+$/g;
Expand Down
4 changes: 2 additions & 2 deletions test/data.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 <ErrorBoundary fallback={<div id="parentError" />}>{props.children}</ErrorBoundary>;
Expand Down
8 changes: 4 additions & 4 deletions test/types.spec.ts
Original file line number Diff line number Diff line change
@@ -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 = <S extends string>(props: RouteProps<S>) => {};
Expand Down
2 changes: 1 addition & 1 deletion test/utils.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
expandOptionals,
mergeSearchString,
extractSearchParams
} from "../src/utils";
} from "../src/utils.js";

describe("resolvePath should", () => {
test("normalize the base arg", () => {
Expand Down
5 changes: 3 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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/"]
Expand Down