Skip to content

Commit e567c6c

Browse files
authored
Merge pull request #545 from solidjs/infra/module-resolution
Update `moduleResolution`
2 parents e30f46f + 4a543bd commit e567c6c

File tree

12 files changed

+55
-18
lines changed

12 files changed

+55
-18
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@solidjs/router": minor
3+
---
4+
5+
Update `moduleResolution`
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Type Check Distribution
2+
3+
on:
4+
pull_request: ~
5+
push:
6+
branches:
7+
- main
8+
9+
jobs:
10+
typecheck-dist:
11+
name: Check dist types
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Use Node.js from nvmrc
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version-file: ".nvmrc"
20+
registry-url: "https://registry.npmjs.org"
21+
22+
- name: Install pnpm
23+
uses: pnpm/action-setup@v4
24+
25+
- name: Install dependencies
26+
run: pnpm install
27+
28+
- name: Build package and dependencies
29+
run: pnpm build
30+
31+
- name: Check types
32+
run: pnpx @arethetypeswrong/cli --pack . --profile esm-only

.github/workflows/test.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,11 @@ jobs:
1717
- name: Use Node.js from nvmrc
1818
uses: actions/setup-node@v4
1919
with:
20-
node-version-file: '.nvmrc'
21-
registry-url: 'https://registry.npmjs.org'
20+
node-version-file: ".nvmrc"
21+
registry-url: "https://registry.npmjs.org"
2222

2323
- name: Install pnpm
2424
uses: pnpm/action-setup@v4
25-
with:
26-
version: 9
2725

2826
- name: Install dependencies
2927
run: pnpm install

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,5 +58,6 @@
5858
},
5959
"peerDependencies": {
6060
"solid-js": "^1.8.6"
61-
}
61+
},
62+
"packageManager": "pnpm@10.19.0+sha512.c9fc7236e92adf5c8af42fd5bf1612df99c2ceb62f27047032f4720b33f8eacdde311865e91c411f2774f618d82f320808ecb51718bfa82c060c4ba7c76a32b8"
6263
}

src/data/response.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { RouterResponseInit, CustomResponse } from "../types";
1+
import type { RouterResponseInit, CustomResponse } from "../types.js";
22

33
export function redirect(url: string, init: number | RouterResponseInit = 302) {
44
let responseInit: ResponseInit;

src/routers/HashRouter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { JSX } from "solid-js";
22
import { setupNativeEvents } from "../data/events.js";
3-
import type { BaseRouterProps } from "./components.js";
3+
import type { BaseRouterProps } from "./components.jsx";
44
import { createRouter, scrollToHash, bindEvent } from "./createRouter.js";
55
import { createBeforeLeave, keepDepth, notifyIfNotBlocked, saveCurrentDepth } from "../lifecycle.js";
66

src/routers/createRouter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { type Signal, createSignal, onCleanup, sharedConfig } from "solid-js";
2-
import type { LocationChange, RouterContext, RouterUtils } from "../types.ts";
2+
import type { LocationChange, RouterContext, RouterUtils } from "../types.js";
33
import { createRouterComponent } from "./components.jsx";
44

55
function intercept<T>(

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import type {
88
SearchParams,
99
SetParams,
1010
SetSearchParams
11-
} from "./types.ts";
11+
} from "./types.js";
1212

1313
const hasSchemeRegex = /^(?:[a-z0-9]+:)?\/\//i;
1414
const trimPathRegex = /^\/+|(\/)\/+$/g;

test/data.spec.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import {
77
createSignal
88
} from "solid-js";
99
import { render } from "solid-js/web";
10-
import { createAsync, createAsyncStore } from "../src/data";
11-
import { awaitPromise, waitFor } from "./helpers";
10+
import { createAsync } from "../src/data/createAsync.js";
11+
import { awaitPromise } from "./helpers.js";
1212

1313
function Parent(props: ParentProps) {
1414
return <ErrorBoundary fallback={<div id="parentError" />}>{props.children}</ErrorBoundary>;

test/types.spec.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { RouteProps } from "../src/routers/components";
2-
import { useMatch } from "../src/routing";
3-
import { MatchFilters } from "../src/types";
4-
import { createMatcher } from "../src/utils";
1+
import { RouteProps } from "../src/routers/components.jsx";
2+
import { useMatch } from "../src/routing.js";
3+
import { MatchFilters } from "../src/types.js";
4+
import { createMatcher } from "../src/utils.js";
55

66
// mock route type
77
const Route = <S extends string>(props: RouteProps<S>) => {};

0 commit comments

Comments
 (0)