Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
91642fa
feat: async types for express 5 and its express-serve-static-core.
RobinTail Sep 14, 2024
3841cdd
Fixing tests for architect__functions.
RobinTail Sep 14, 2024
c7fcb05
Fixing tests for forest-express-sequelize.
RobinTail Sep 14, 2024
a08e9c6
Fixing tests for mock-req-res.
RobinTail Sep 14, 2024
c4380b1
Fixing tests for create-test-server.
RobinTail Sep 14, 2024
0be241f
Fixing dependency discrepancy for absolute-url.
RobinTail Sep 14, 2024
8f63f0f
Correcting the type for express-brute.
RobinTail Sep 14, 2024
93ef618
Correcting types for express-ua-middleware.
RobinTail Sep 14, 2024
bafc7aa
Fixing tests for feathersjs__express.
RobinTail Sep 14, 2024
3197341
Fixing tests for logfmt.
RobinTail Sep 14, 2024
b4f19a8
Fixing types and tests for express-oauth-server.
RobinTail Sep 14, 2024
58a6fb2
Fixing tests for mongoose-aggregate-paginate-v2.
RobinTail Sep 14, 2024
e4ed240
Fixing tests for forest-express-mongoose.
RobinTail Sep 14, 2024
43c6655
Fixing tests for fusebit__oauth-connector.
RobinTail Sep 14, 2024
42fce1c
Fixing tests for swaggerize-express.
RobinTail Sep 14, 2024
5654908
Ref: using void for tests in architect__functions to avoid changing f…
RobinTail Sep 14, 2024
635727b
Additional tests for express - async handler assignment.
RobinTail Sep 14, 2024
740dedf
create-test-server: correcting types instead of the test.
RobinTail Sep 23, 2024
581cab2
CR accepted: fn block instead of void in two tests.
RobinTail Sep 23, 2024
44fe415
CR accepted: fn block instead of void in test of architect__functions.
RobinTail Sep 23, 2024
b8ce672
Applying pnpm dprint fmt.
RobinTail Sep 23, 2024
f1d98c6
CR: using res.send() in test of forest-express-mongoose and forest-ex…
RobinTail Sep 23, 2024
dc3621e
Minor: correcting return type of RequestHandler in jsdoc of express-b…
RobinTail Sep 23, 2024
1cd042a
CR: Preserving the state of v4 for express and express-serve-static-c…
RobinTail Sep 24, 2024
f996fd0
Fix: adding express-serve-static-core/v4 to attw.json.
RobinTail Sep 24, 2024
3dbabb9
Fix: ading nonNpm:conflict to the package of express-serve-static-cor…
RobinTail Sep 24, 2024
70b034c
Fix: add nonNpmDescription as well.
RobinTail Sep 24, 2024
0294b12
CR: setting `express-serve-static-core` dependency to `^4` in `expres…
RobinTail Sep 24, 2024
8f3a52d
Revert "CR: setting `express-serve-static-core` dependency to `^4` in…
RobinTail Sep 25, 2024
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
1 change: 1 addition & 0 deletions attw.json
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@
"express-async-wrap",
"express-brute-memcached",
"express-serve-static-core",
"express-serve-static-core/v4",
"express-socket.io-session",
"express-status-monitor",
"express-wechat-access",
Expand Down
2 changes: 1 addition & 1 deletion types/absolute-url/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
],
"dependencies": {
"@types/express": "*",
"@types/express-serve-static-core": "^4.17.33"
"@types/express-serve-static-core": "*"
},
"devDependencies": {
"@types/absolute-url": "workspace:."
Expand Down
8 changes: 6 additions & 2 deletions types/architect__functions/test/http-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,12 @@ import express = require("express");

const app = express();

app.get("/", (req, res) => res.send("Hello World!"));
app.get("/cool", (req, res) => res.send("very cool"));
app.get("/", (req, res) => {
res.send("Hello World!");
});
app.get("/cool", (req, res) => {
res.send("very cool");
});

////////////////////
// tests for arc.http.helpers: https://github.com/architect/functions/blob/master/src/http/index.js#L21-L26
Expand Down
4 changes: 3 additions & 1 deletion types/create-test-server/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import { Express } from "express";
import * as http from "http";
import * as https from "https";

type Server = createTestServer.TestServer & Omit<Express, "listen"> & { get: (url: string, response: string) => void };
type Server = createTestServer.TestServer & Omit<Express, "listen"> & {
get: (url: string, response: string | (() => string)) => void;
};

/**
* Returns a Promise which resolves to an (already listening) server.
Expand Down
4 changes: 2 additions & 2 deletions types/express-brute/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ declare class ExpressBrute {
* @param {Request} request The HTTP request.
* @param {Response} response The HTTP response.
* @param {Function} next The next middleware.
* @return {RequestHandler} The Request handler.
* @return {void}
*/
prevent(request: express.Request, response: express.Response, next: express.NextFunction): express.RequestHandler;
prevent: express.RequestHandler;

/**
* @summary Resets the wait time between requests back to its initial value.
Expand Down
4 changes: 2 additions & 2 deletions types/express-oauth-server/express-oauth-server-tests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ let resultingTokenMiddleware: (
request: express.Request,
response: express.Response,
next: express.NextFunction,
) => Promise<OAuth2Server.Token>;
) => Promise<void>;
let resultingAuthorizationCodeMiddleware: (
request: express.Request,
response: express.Response,
next: express.NextFunction,
) => Promise<OAuth2Server.AuthorizationCode>;
) => Promise<void>;

oAuthServer = expressOAuthServer.server;
resultingTokenMiddleware = expressOAuthServer.authenticate();
Expand Down
6 changes: 3 additions & 3 deletions types/express-oauth-server/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,19 @@ declare class ExpressOAuthServer {
request: express.Request,
response: express.Response,
next: express.NextFunction,
) => Promise<OAuth2Server.Token>;
) => Promise<void>;

authorize(options?: OAuth2Server.AuthorizeOptions): (
request: express.Request,
response: express.Response,
next: express.NextFunction,
) => Promise<OAuth2Server.AuthorizationCode>;
) => Promise<void>;

token(options?: OAuth2Server.TokenOptions): (
request: express.Request,
response: express.Response,
next: express.NextFunction,
) => Promise<OAuth2Server.Token>;
) => Promise<void>;
}

export = ExpressOAuthServer;
1 change: 1 addition & 0 deletions types/express-serve-static-core/.npmignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
!**/*.d.cts
!**/*.d.mts
!**/*.d.*.ts
/v4/
Original file line number Diff line number Diff line change
Expand Up @@ -323,3 +323,6 @@ app.get("/:readonly", req => {
// @ts-expect-error
req.xhr = true;
});

// Starting with Express 5 RequestHandler can be async
app.get("/async", Promise.resolve);
4 changes: 2 additions & 2 deletions types/express-serve-static-core/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ export interface RequestHandler<
req: Request<P, ResBody, ReqBody, ReqQuery, LocalsObj>,
res: Response<ResBody, LocalsObj>,
next: NextFunction,
): void;
): void | Promise<void>;
}

export type ErrorRequestHandler<
Expand All @@ -75,7 +75,7 @@ export type ErrorRequestHandler<
req: Request<P, ResBody, ReqBody, ReqQuery, LocalsObj>,
res: Response<ResBody, LocalsObj>,
next: NextFunction,
) => void;
) => void | Promise<void>;

export type PathParams = string | RegExp | Array<string | RegExp>;

Expand Down
2 changes: 1 addition & 1 deletion types/express-serve-static-core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"name": "@types/express-serve-static-core",
"version": "4.19.9999",
"version": "5.0.9999",
"projects": [
"http://expressjs.com"
],
Expand Down
7 changes: 7 additions & 0 deletions types/express-serve-static-core/v4/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"rules": {
"@definitelytyped/no-type-only-packages": "off",
"@typescript-eslint/naming-convention": "off",
"@typescript-eslint/no-empty-interface": "off"
}
}
5 changes: 5 additions & 0 deletions types/express-serve-static-core/v4/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
*
!**/*.d.ts
!**/*.d.cts
!**/*.d.mts
!**/*.d.*.ts
Loading