Skip to content

Commit bad3f96

Browse files
authored
Merge pull request #13 from Eliav2:dev
Dev
2 parents 8b90108 + d29e791 commit bad3f96

File tree

8 files changed

+917
-31
lines changed

8 files changed

+917
-31
lines changed

examples/express-typed-prisma/src/app.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import express from "express";
22
import logger from "morgan";
3-
import typedRouter from "./routes/typed.routes";
4-
import notTypedRouter from "./routes/not-typed.routes";
3+
import typedRouter from "./routes/typed.routes.js";
4+
import notTypedRouter from "./routes/not-typed.routes.js";
55

66
// Create Express server
77
export const app = express();

packages/express-typed/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from "./src/express-typed"

packages/express-typed/package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "express-typed",
3-
"version": "0.3.1",
3+
"version": "0.3.2",
44
"description": "end-to-end typesafe TypeScript wrapper for Express.js",
55
"repository": {
66
"type": "git",
@@ -9,12 +9,12 @@
99
"homepage": "https://github.com/Eliav2/express-typed",
1010
"bugs": "https://github.com/Eliav2/express-typed/issues",
1111
"type": "module",
12-
"main": "dist/express-typed.js",
13-
"module": "dist/express-typed.js",
14-
"types": "dist/express-typed.d.ts",
12+
"main": "dist/index.cjs",
13+
"module": "dist/index.js",
14+
"types": "dist/index.d.ts",
1515
"scripts": {
16-
"build": "tsc",
17-
"dev": "tsc -w",
16+
"build": "tsup",
17+
"dev": "tsup --watch",
1818
"prepublishOnly": "pnpm build",
1919
"test": "vitest",
2020
"version": "auto-changelog -p && git add CHANGELOG.md"
@@ -30,6 +30,7 @@
3030
"@vitest/coverage-v8": "^1.5.2",
3131
"express": "^4.19.2",
3232
"supertest": "^7.0.0",
33+
"tsup": "^8.1.0",
3334
"typescript": "^5.4.2"
3435
},
3536
"peerDependencies": {

packages/express-typed/tests/demo.test-d.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,7 @@ test("TypedRouter", () => {
5353
},
5454
}),
5555
});
56-
57-
56+
5857
type AppRoutes = ParseRoutes<typeof typedRouter>;
5958

6059
type HomeGetResponse = GetRouteResponseInfo<AppRoutes, "/", "get">;

packages/express-typed/tests/express-typed.test-d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export type AppRoutes = ParseRoutes<typeof typedRouter>;
5858
export type RouteResResolver<
5959
Path extends keyof AppRoutes,
6060
Method extends keyof AppRoutes[Path],
61-
Info extends keyof GetRouteResponseInfoHelper<AppRoutes, Path, Method> | "body" = "body",
61+
Info extends keyof GetRouteResponseInfoHelper<AppRoutes, Path, Method> | "body" = "body"
6262
> = GetRouteResponseInfo<AppRoutes, Path, Method, Info>;
6363

6464
// example usage

packages/express-typed/tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33
"esModuleInterop": true,
44
"target": "esnext",
55
"noImplicitAny": true,
6-
"moduleResolution": "node",
6+
"moduleResolution": "Node",
77
"sourceMap": true,
88
"outDir": "dist",
99
"baseUrl": ".",
1010
"skipLibCheck": true,
1111
"strict": true,
1212
"declaration": true,
13+
// "emitDeclarationOnly": true
1314
},
1415
"include": ["src/**/*.ts"],
1516
"exclude": ["node_modules"]

packages/express-typed/tsup.config.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import { defineConfig } from "tsup";
2+
3+
export default defineConfig({
4+
entry: ["index.ts"],
5+
dts: true,
6+
splitting: false,
7+
sourcemap: true,
8+
clean: true,
9+
format: ["cjs", "esm"],
10+
});

0 commit comments

Comments
 (0)