Skip to content

Commit 323d7d0

Browse files
committed
fix: πŸ› Fixed typescript declarations bundling
1 parent 3c7da7d commit 323d7d0

File tree

25 files changed

+378
-53
lines changed

25 files changed

+378
-53
lines changed

β€Ž.eslintignoreβ€Ž

Lines changed: 0 additions & 10 deletions
This file was deleted.

β€Ž.eslintrc.jsonβ€Ž

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,18 @@
3131
"airbnb-typescript",
3232
"plugin:prettier/recommended"
3333
],
34+
"ignorePatterns": [
35+
"dist",
36+
"node_modules",
37+
"jest.config.ts",
38+
"babel.config.js",
39+
"rollup.config.js",
40+
"jest.config.js",
41+
"tsconfig.json",
42+
"coverage",
43+
"temp",
44+
"release.config.js"
45+
],
3446
"rules": {
3547
"react-hooks/rules-of-hooks": "error",
3648
"react-hooks/exhaustive-deps": "warn",

β€Žexamples/nextjs/api/files/files.api.tsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { client } from "api/client";
1+
import { client } from "api/builder";
22

33
export const postFile = client
44
.createRequest<{ response: string }, { file: File }>()({

β€Žexamples/nextjs/api/index.tsβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { setupWorker } from "msw";
22
import { setupServer } from "msw/lib/node";
33
import { handlers } from "./mocks";
44

5-
export * from "./client";
5+
export * from "./builder";
66

77
export * from "./files/files.api";
88
export * from "./users/users.api";

β€Žexamples/nextjs/api/mocks.tsβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { rest } from "msw";
22
import { RequestInstance, DateInterval } from "@hyper-fetch/core";
33

4-
import { getRandomUser, getRandomUsers } from "utils";
5-
import { client } from "./client";
4+
import { getRandomUser, getRandomUsers } from "../utils";
5+
import { client } from "./builder";
66
import { deleteUser, getUser, getUsers, patchUser, postUser } from "./users/users.api";
77
import { postFile } from "./files/files.api";
88

β€Žexamples/nextjs/api/users/users.api.tsβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { DateInterval } from "@hyper-fetch/core";
22

3-
import { PostUserModel, UserModel } from "models";
4-
import { client } from "../client";
3+
import { PostUserModel, UserModel } from "../../models";
4+
import { client } from "../builder";
55

66
export const getUser = client.createRequest<UserModel>()({
77
endpoint: "/api/user/:userId",

β€Žexamples/nextjs/pages/details/details.page.tsxβ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export const DetailsPage: React.FC = () => {
1818
const [dep, setDep] = useState(initialDate);
1919
const [disabled, setDisabled] = useState(true);
2020

21-
const result = useFetch(getUser.setQueryParams({ date: dep } as any), {
21+
const result = useFetch(getUser.setQueryParams({ date: dep }), {
2222
disabled,
2323
dependencies: [dep],
2424
refresh: true,

β€Žexamples/nextjs/pages/form/form.page.tsxβ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ export const FormPage: React.FC = () => {
1111
// Post
1212
const result = useSubmit(postUser.setData({ email: "test", age: 12, name: "name" }));
1313

14+
const { data } = result;
15+
1416
// Patch
1517
const resultPatch = useSubmit(patchUser.setData({ email: "test", age: 12, name: "name" }));
1618

β€Žexamples/nextjs/tsconfig.jsonβ€Ž

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
"target": "es5",
1717
"lib": ["dom", "dom.iterable", "esnext"],
1818
"skipLibCheck": true,
19-
"module": "esnext"
19+
"module": "esnext",
20+
"baseUrl": "."
2021
},
2122
"include": ["**/*.ts", "**/*.tsx", "**/*.js", "**/*.jsx", "next-env.d.ts"],
2223
"exclude": ["node_modules", "jest.config.ts"]

0 commit comments

Comments
Β (0)