@vercel/node 2.3.2 → 2.4.1-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,9 +1,33 @@
1
- import { shouldServe } from '@vercel/build-utils';
2
- import type { BuildV3, PrepareCache, StartDevServer } from '@vercel/build-utils';
3
- export { shouldServe };
4
- export type { NowRequest, NowResponse, VercelRequest, VercelResponse, } from './types';
5
- export * from './types';
6
- export declare const version = 3;
7
- export declare const build: BuildV3;
8
- export declare const prepareCache: PrepareCache;
9
- export declare const startDevServer: StartDevServer;
1
+ /// <reference types="node" />
2
+ import { ServerResponse, IncomingMessage } from 'http';
3
+ export declare type VercelRequestCookies = {
4
+ [key: string]: string;
5
+ };
6
+ export declare type VercelRequestQuery = {
7
+ [key: string]: string | string[];
8
+ };
9
+ export declare type VercelRequestBody = any;
10
+ export declare type VercelRequest = IncomingMessage & {
11
+ query: VercelRequestQuery;
12
+ cookies: VercelRequestCookies;
13
+ body: VercelRequestBody;
14
+ };
15
+ export declare type VercelResponse = ServerResponse & {
16
+ send: (body: any) => VercelResponse;
17
+ json: (jsonBody: any) => VercelResponse;
18
+ status: (statusCode: number) => VercelResponse;
19
+ redirect: (statusOrUrl: string | number, url?: string) => VercelResponse;
20
+ };
21
+ export declare type VercelApiHandler = (req: VercelRequest, res: VercelResponse) => void;
22
+ /** @deprecated Use VercelRequestCookies instead. */
23
+ export declare type NowRequestCookies = VercelRequestCookies;
24
+ /** @deprecated Use VercelRequestQuery instead. */
25
+ export declare type NowRequestQuery = VercelRequestQuery;
26
+ /** @deprecated Use VercelRequestBody instead. */
27
+ export declare type NowRequestBody = any;
28
+ /** @deprecated Use VercelRequest instead. */
29
+ export declare type NowRequest = VercelRequest;
30
+ /** @deprecated Use VercelResponse instead. */
31
+ export declare type NowResponse = VercelResponse;
32
+ /** @deprecated Use VercelApiHandler instead. */
33
+ export declare type NowApiHandler = VercelApiHandler;
package/dist/index.js CHANGED
@@ -304511,6 +304511,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
304511
304511
  };
304512
304512
  Object.defineProperty(exports, "__esModule", ({ value: true }));
304513
304513
  exports.startDevServer = exports.prepareCache = exports.build = exports.version = exports.shouldServe = void 0;
304514
+ const url_1 = __importDefault(__webpack_require__(78835));
304514
304515
  const child_process_1 = __webpack_require__(63129);
304515
304516
  const fs_1 = __webpack_require__(35747);
304516
304517
  const path_1 = __webpack_require__(85622);
@@ -304820,7 +304821,9 @@ const startDevServer = async (opts) => {
304820
304821
  const staticConfig = static_config_1.getConfig(project, entrypointPath);
304821
304822
  // Middleware is a catch-all for all paths unless a `matcher` property is defined
304822
304823
  const matchers = new RegExp(utils_1.getRegExpFromMatchers(staticConfig?.matcher));
304823
- if (!matchers.test(meta.requestUrl)) {
304824
+ const parsed = url_1.default.parse(meta.requestUrl, true);
304825
+ if (typeof parsed.pathname !== 'string' ||
304826
+ !matchers.test(parsed.pathname)) {
304824
304827
  // If the "matchers" doesn't say to handle this
304825
304828
  // path then skip middleware invocation
304826
304829
  return null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vercel/node",
3
- "version": "2.3.2",
3
+ "version": "2.4.1-canary.0",
4
4
  "license": "MIT",
5
5
  "main": "./dist/index",
6
6
  "homepage": "https://vercel.com/docs/runtimes#official-runtimes/node-js",
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "dependencies": {
33
33
  "@types/node": "*",
34
- "@vercel/build-utils": "4.2.0",
34
+ "@vercel/build-utils": "5.0.1-canary.0",
35
35
  "@vercel/node-bridge": "3.0.0",
36
36
  "@vercel/static-config": "2.0.1",
37
37
  "edge-runtime": "1.0.1",
@@ -61,5 +61,5 @@
61
61
  "source-map-support": "0.5.12",
62
62
  "test-listen": "1.1.0"
63
63
  },
64
- "gitHead": "9a3739bebdbd45ad17e949236893b2b58777012a"
64
+ "gitHead": "3c48b40b43e3357c4c06bfe05e1192b1434b691f"
65
65
  }
package/dist/babel.d.ts DELETED
@@ -1,4 +0,0 @@
1
- export declare function compile(filename: string, source: string): {
2
- code: string;
3
- map: any;
4
- };
@@ -1,8 +0,0 @@
1
- /// <reference types="node" />
2
- import { IncomingMessage, ServerResponse } from 'http';
3
- import { Readable } from 'stream';
4
- export declare function rawBody(readable: Readable): Promise<Buffer>;
5
- export declare function onDevRequest(req: IncomingMessage, res: ServerResponse): Promise<void>;
6
- export declare function fixConfigDev(config: {
7
- compilerOptions: any;
8
- }): void;
package/dist/types.d.ts DELETED
@@ -1,33 +0,0 @@
1
- /// <reference types="node" />
2
- import { ServerResponse, IncomingMessage } from 'http';
3
- export declare type VercelRequestCookies = {
4
- [key: string]: string;
5
- };
6
- export declare type VercelRequestQuery = {
7
- [key: string]: string | string[];
8
- };
9
- export declare type VercelRequestBody = any;
10
- export declare type VercelRequest = IncomingMessage & {
11
- query: VercelRequestQuery;
12
- cookies: VercelRequestCookies;
13
- body: VercelRequestBody;
14
- };
15
- export declare type VercelResponse = ServerResponse & {
16
- send: (body: any) => VercelResponse;
17
- json: (jsonBody: any) => VercelResponse;
18
- status: (statusCode: number) => VercelResponse;
19
- redirect: (statusOrUrl: string | number, url?: string) => VercelResponse;
20
- };
21
- export declare type VercelApiHandler = (req: VercelRequest, res: VercelResponse) => void;
22
- /** @deprecated Use VercelRequestCookies instead. */
23
- export declare type NowRequestCookies = VercelRequestCookies;
24
- /** @deprecated Use VercelRequestQuery instead. */
25
- export declare type NowRequestQuery = VercelRequestQuery;
26
- /** @deprecated Use VercelRequestBody instead. */
27
- export declare type NowRequestBody = any;
28
- /** @deprecated Use VercelRequest instead. */
29
- export declare type NowRequest = VercelRequest;
30
- /** @deprecated Use VercelResponse instead. */
31
- export declare type NowResponse = VercelResponse;
32
- /** @deprecated Use VercelApiHandler instead. */
33
- export declare type NowApiHandler = VercelApiHandler;
@@ -1,43 +0,0 @@
1
- import _ts from 'typescript';
2
- /**
3
- * Registration options.
4
- */
5
- interface Options {
6
- basePath?: string;
7
- pretty?: boolean | null;
8
- logError?: boolean | null;
9
- files?: boolean | null;
10
- compiler?: string;
11
- ignore?: string[];
12
- project?: string;
13
- compilerOptions?: _ts.CompilerOptions;
14
- ignoreDiagnostics?: Array<number | string>;
15
- readFile?: (path: string) => string | undefined;
16
- fileExists?: (path: string) => boolean;
17
- transformers?: _ts.CustomTransformers;
18
- nodeVersionMajor?: number;
19
- }
20
- /**
21
- * Return type for registering `ts-node`.
22
- */
23
- export declare type Register = (code: string, fileName: string, skipTypeCheck?: boolean) => SourceOutput;
24
- /**
25
- * Register TypeScript compiler.
26
- */
27
- export declare function register(opts?: Options): Register;
28
- /**
29
- * Do post-processing on config options to support `ts-node`.
30
- */
31
- export declare function fixConfig(config: {
32
- compilerOptions: any;
33
- }, nodeVersionMajor?: number): {
34
- compilerOptions: any;
35
- };
36
- /**
37
- * Internal source output.
38
- */
39
- declare type SourceOutput = {
40
- code: string;
41
- map: string;
42
- };
43
- export {};
package/dist/utils.d.ts DELETED
@@ -1 +0,0 @@
1
- export declare function getRegExpFromMatchers(matcherOrMatchers: unknown): string;