vercel 28.2.3 → 28.2.4
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.js +80 -25
- package/package.json +5 -5
package/dist/index.js
CHANGED
@@ -210995,10 +210995,16 @@ exports.frameworks = [
|
|
210995
210995
|
website: 'https://www.sanity.io',
|
210996
210996
|
envPrefix: 'SANITY_STUDIO_',
|
210997
210997
|
detectors: {
|
210998
|
-
|
210998
|
+
some: [
|
210999
210999
|
{
|
211000
211000
|
path: 'sanity.json',
|
211001
211001
|
},
|
211002
|
+
{
|
211003
|
+
path: 'sanity.config.js',
|
211004
|
+
},
|
211005
|
+
{
|
211006
|
+
path: 'sanity.config.ts',
|
211007
|
+
},
|
211002
211008
|
],
|
211003
211009
|
},
|
211004
211010
|
settings: {
|
@@ -216484,6 +216490,16 @@ class DetectorFilesystem {
|
|
216484
216490
|
this.chdir = (name) => {
|
216485
216491
|
return this._chdir(name);
|
216486
216492
|
};
|
216493
|
+
/**
|
216494
|
+
* Writes a file to the filesystem cache.
|
216495
|
+
* @param name the name of the file to write
|
216496
|
+
* @param content The content of the file
|
216497
|
+
*/
|
216498
|
+
this.writeFile = async (name, content) => {
|
216499
|
+
this.readFileCache.set(name, Promise.resolve(Buffer.from(content)));
|
216500
|
+
this.fileCache.set(name, Promise.resolve(true));
|
216501
|
+
this.pathCache.set(name, Promise.resolve(true));
|
216502
|
+
};
|
216487
216503
|
this.pathCache = new Map();
|
216488
216504
|
this.fileCache = new Map();
|
216489
216505
|
this.readFileCache = new Map();
|
@@ -238865,6 +238881,7 @@ const tree_kill_1 = __webpack_require__(21780);
|
|
238865
238881
|
const headers_1 = __webpack_require__(17929);
|
238866
238882
|
const parse_query_string_1 = __webpack_require__(40165);
|
238867
238883
|
const is_error_1 = __webpack_require__(11026);
|
238884
|
+
const is_url_1 = __importDefault(__webpack_require__(4567));
|
238868
238885
|
const project_settings_1 = __webpack_require__(42697);
|
238869
238886
|
const frontendRuntimeSet = new Set(frameworks_1.default.map(f => f.useRuntime?.use || '@vercel/static-build'));
|
238870
238887
|
function sortBuilders(buildA, buildB) {
|
@@ -239082,14 +239099,33 @@ class DevServer {
|
|
239082
239099
|
return;
|
239083
239100
|
}
|
239084
239101
|
if (rewritePath) {
|
239085
|
-
// TODO: add validation?
|
239086
239102
|
debug(`Detected rewrite path from middleware: "${rewritePath}"`);
|
239087
239103
|
prevUrl = rewritePath;
|
239088
|
-
// Retain orginal pathname, but override query parameters from the rewrite
|
239089
239104
|
const beforeRewriteUrl = req.url || '/';
|
239090
|
-
|
239091
|
-
|
239092
|
-
|
239105
|
+
if ((0, is_url_1.default)(rewritePath)) {
|
239106
|
+
const rewriteUrlParsed = new url_1.URL(rewritePath);
|
239107
|
+
// `this.address` already has localhost normalized from ip4 and ip6 values
|
239108
|
+
const devServerParsed = new url_1.URL(this.address);
|
239109
|
+
if (devServerParsed.origin === rewriteUrlParsed.origin) {
|
239110
|
+
// remove origin, leaving the path
|
239111
|
+
req.url =
|
239112
|
+
rewritePath.slice(rewriteUrlParsed.origin.length) || '/';
|
239113
|
+
prevUrl = req.url;
|
239114
|
+
}
|
239115
|
+
else {
|
239116
|
+
// Proxy to absolute URL with different origin
|
239117
|
+
debug(`ProxyPass: ${rewritePath}`);
|
239118
|
+
this.setResponseHeaders(res, requestId);
|
239119
|
+
proxyPass(req, res, rewritePath, this, requestId);
|
239120
|
+
return;
|
239121
|
+
}
|
239122
|
+
}
|
239123
|
+
else {
|
239124
|
+
// Retain orginal pathname, but override query parameters from the rewrite
|
239125
|
+
const rewriteUrlParsed = url_1.default.parse(beforeRewriteUrl);
|
239126
|
+
rewriteUrlParsed.search = url_1.default.parse(rewritePath).search;
|
239127
|
+
req.url = url_1.default.format(rewriteUrlParsed);
|
239128
|
+
}
|
239093
239129
|
debug(`Rewrote incoming HTTP URL from "${beforeRewriteUrl}" to "${req.url}"`);
|
239094
239130
|
}
|
239095
239131
|
}
|
@@ -239116,12 +239152,14 @@ class DevServer {
|
|
239116
239152
|
statusCode = undefined;
|
239117
239153
|
const phaseRoutes = handleMap.get(phase) || [];
|
239118
239154
|
routeResult = await (0, router_1.devRouter)(prevUrl, req.method, phaseRoutes, this, vercelConfig, prevHeaders, missRoutes, phase);
|
239119
|
-
|
239120
|
-
|
239121
|
-
|
239122
|
-
|
239123
|
-
|
239124
|
-
|
239155
|
+
if (routeResult.continue) {
|
239156
|
+
if (routeResult.dest) {
|
239157
|
+
prevUrl = getReqUrl(routeResult);
|
239158
|
+
}
|
239159
|
+
if (routeResult.headers) {
|
239160
|
+
prevHeaders = routeResult.headers;
|
239161
|
+
}
|
239162
|
+
}
|
239125
239163
|
if (routeResult.isDestUrl) {
|
239126
239164
|
// Mix the `routes` result dest query params into the req path
|
239127
239165
|
const destParsed = url_1.default.parse(routeResult.dest);
|
@@ -239204,8 +239242,8 @@ class DevServer {
|
|
239204
239242
|
const requestPath = dest.replace(/^\//, '');
|
239205
239243
|
if (!match) {
|
239206
239244
|
// If the dev command is started, then proxy to it
|
239207
|
-
if (this.
|
239208
|
-
const upstream =
|
239245
|
+
if (this.devProcessOrigin) {
|
239246
|
+
const upstream = this.devProcessOrigin;
|
239209
239247
|
debug(`Proxying to frontend dev server: ${upstream}`);
|
239210
239248
|
// Add the Vercel platform proxy request headers
|
239211
239249
|
const headers = this.getProxyHeaders(req, requestId, false);
|
@@ -239330,7 +239368,7 @@ class DevServer {
|
|
239330
239368
|
// Proxy to the dev server:
|
239331
239369
|
// - when there is no asset
|
239332
239370
|
// - when the asset is not a Lambda (the dev server must take care of all static files)
|
239333
|
-
if (this.
|
239371
|
+
if (this.devProcessOrigin &&
|
239334
239372
|
(!foundAsset || (foundAsset && foundAsset.asset.type !== 'Lambda'))) {
|
239335
239373
|
debug('Proxying to frontend dev server');
|
239336
239374
|
// Add the Vercel platform proxy request headers
|
@@ -239339,7 +239377,7 @@ class DevServer {
|
|
239339
239377
|
req.headers[name] = value;
|
239340
239378
|
}
|
239341
239379
|
this.setResponseHeaders(res, requestId);
|
239342
|
-
return proxyPass(req, res,
|
239380
|
+
return proxyPass(req, res, this.devProcessOrigin, this, requestId, false);
|
239343
239381
|
}
|
239344
239382
|
if (!foundAsset) {
|
239345
239383
|
await this.send404(req, res, requestId);
|
@@ -239452,6 +239490,10 @@ class DevServer {
|
|
239452
239490
|
ws: true,
|
239453
239491
|
xfwd: true,
|
239454
239492
|
});
|
239493
|
+
this.proxy.on('proxyRes', proxyRes => {
|
239494
|
+
// override "server" header, like production
|
239495
|
+
proxyRes.headers['server'] = 'Vercel';
|
239496
|
+
});
|
239455
239497
|
this.server = http_1.default.createServer(this.devServerHandler);
|
239456
239498
|
this.server.timeout = 0; // Disable timeout
|
239457
239499
|
this.stopping = false;
|
@@ -240071,12 +240113,12 @@ class DevServer {
|
|
240071
240113
|
// Configure the server to forward WebSocket "upgrade" events to the proxy.
|
240072
240114
|
this.server.on('upgrade', async (req, socket, head) => {
|
240073
240115
|
await this.startPromise;
|
240074
|
-
if (!this.
|
240116
|
+
if (!this.devProcessOrigin) {
|
240075
240117
|
this.output.debug(`Detected "upgrade" event, but closing socket because no frontend dev server is running`);
|
240076
240118
|
socket.destroy();
|
240077
240119
|
return;
|
240078
240120
|
}
|
240079
|
-
const target =
|
240121
|
+
const target = this.devProcessOrigin;
|
240080
240122
|
this.output.debug(`Detected "upgrade" event, proxying to ${target}`);
|
240081
240123
|
this.proxy.ws(req, socket, head, { target });
|
240082
240124
|
});
|
@@ -240463,10 +240505,10 @@ class DevServer {
|
|
240463
240505
|
});
|
240464
240506
|
p.on('exit', (code, signal) => {
|
240465
240507
|
this.output.debug(`Dev command exited with "${signal || code}"`);
|
240466
|
-
this.
|
240508
|
+
this.devProcessOrigin = undefined;
|
240467
240509
|
});
|
240468
|
-
await checkForPort(port, 1000 * 60 * 5);
|
240469
|
-
this.
|
240510
|
+
const devProcessHost = await checkForPort(port, 1000 * 60 * 5);
|
240511
|
+
this.devProcessOrigin = `http://${devProcessHost}:${port}`;
|
240470
240512
|
}
|
240471
240513
|
}
|
240472
240514
|
exports.default = DevServer;
|
@@ -240660,14 +240702,27 @@ function needsBlockingBuild(buildMatch) {
|
|
240660
240702
|
return typeof builder.shouldServe !== 'function';
|
240661
240703
|
}
|
240662
240704
|
async function checkForPort(port, timeout) {
|
240663
|
-
|
240705
|
+
let host;
|
240664
240706
|
const start = Date.now();
|
240665
|
-
while (!(await (
|
240707
|
+
while (!(host = await getReachableHostOnPort(port))) {
|
240666
240708
|
if (Date.now() - start > timeout) {
|
240667
|
-
|
240709
|
+
break;
|
240668
240710
|
}
|
240669
240711
|
await (0, sleep_1.default)(100);
|
240670
240712
|
}
|
240713
|
+
if (!host) {
|
240714
|
+
throw new Error(`Detecting port ${port} timed out after ${timeout}ms`);
|
240715
|
+
}
|
240716
|
+
return host;
|
240717
|
+
}
|
240718
|
+
async function getReachableHostOnPort(port) {
|
240719
|
+
const optsIpv4 = { host: '127.0.0.1' };
|
240720
|
+
const optsIpv6 = { host: '::1' };
|
240721
|
+
const results = await Promise.all([
|
240722
|
+
(0, is_port_reachable_1.default)(port, optsIpv6).then(r => r && `[${optsIpv6.host}]`),
|
240723
|
+
(0, is_port_reachable_1.default)(port, optsIpv4).then(r => r && optsIpv4.host),
|
240724
|
+
]);
|
240725
|
+
return results.find(Boolean) || false;
|
240671
240726
|
}
|
240672
240727
|
function filterFrontendBuilds(build) {
|
240673
240728
|
const { name } = (0, npm_package_arg_1.default)(build.use);
|
@@ -249445,7 +249500,7 @@ module.exports = JSON.parse("{\"application/1d-interleaved-parityfec\":{\"source
|
|
249445
249500
|
/***/ ((module) => {
|
249446
249501
|
|
249447
249502
|
"use strict";
|
249448
|
-
module.exports = JSON.parse("{\"name\":\"vercel\",\"version\":\"28.2.
|
249503
|
+
module.exports = JSON.parse("{\"name\":\"vercel\",\"version\":\"28.2.4\",\"preferGlobal\":true,\"license\":\"Apache-2.0\",\"description\":\"The command-line interface for Vercel\",\"homepage\":\"https://vercel.com\",\"repository\":{\"type\":\"git\",\"url\":\"https://github.com/vercel/vercel.git\",\"directory\":\"packages/cli\"},\"scripts\":{\"preinstall\":\"node ./scripts/preinstall.js\",\"test\":\"jest --env node --verbose --runInBand --bail --forceExit\",\"test-unit\":\"yarn test test/unit/\",\"test-integration-cli\":\"rimraf test/fixtures/integration && ava test/integration.js --serial --fail-fast --verbose\",\"test-integration-dev\":\"yarn test test/dev/\",\"coverage\":\"codecov\",\"build\":\"ts-node ./scripts/build.ts\",\"dev\":\"ts-node ./src/index.ts\"},\"bin\":{\"vc\":\"./dist/index.js\",\"vercel\":\"./dist/index.js\"},\"files\":[\"dist\",\"scripts/preinstall.js\"],\"ava\":{\"extensions\":[\"ts\"],\"require\":[\"ts-node/register/transpile-only\",\"esm\"]},\"engines\":{\"node\":\">= 14\"},\"dependencies\":{\"@vercel/build-utils\":\"5.4.2\",\"@vercel/go\":\"2.2.5\",\"@vercel/hydrogen\":\"0.0.18\",\"@vercel/next\":\"3.1.25\",\"@vercel/node\":\"2.5.14\",\"@vercel/python\":\"3.1.14\",\"@vercel/redwood\":\"1.0.23\",\"@vercel/remix\":\"1.0.24\",\"@vercel/ruby\":\"1.3.31\",\"@vercel/static-build\":\"1.0.23\",\"update-notifier\":\"5.1.0\"},\"devDependencies\":{\"@alex_neo/jest-expect-message\":\"1.0.5\",\"@next/env\":\"11.1.2\",\"@sentry/node\":\"5.5.0\",\"@sindresorhus/slugify\":\"0.11.0\",\"@swc/core\":\"1.2.218\",\"@tootallnate/once\":\"1.1.2\",\"@types/ansi-escapes\":\"3.0.0\",\"@types/ansi-regex\":\"4.0.0\",\"@types/async-retry\":\"1.2.1\",\"@types/bytes\":\"3.0.0\",\"@types/chance\":\"1.1.3\",\"@types/debug\":\"0.0.31\",\"@types/dotenv\":\"6.1.1\",\"@types/escape-html\":\"0.0.20\",\"@types/express\":\"4.17.13\",\"@types/fs-extra\":\"9.0.13\",\"@types/glob\":\"7.1.1\",\"@types/http-proxy\":\"1.16.2\",\"@types/ini\":\"1.3.31\",\"@types/inquirer\":\"7.3.1\",\"@types/jest\":\"27.4.1\",\"@types/jest-expect-message\":\"1.0.3\",\"@types/load-json-file\":\"2.0.7\",\"@types/mime-types\":\"2.1.0\",\"@types/minimatch\":\"3.0.3\",\"@types/mri\":\"1.1.0\",\"@types/ms\":\"0.7.30\",\"@types/node\":\"11.11.0\",\"@types/node-fetch\":\"2.5.10\",\"@types/npm-package-arg\":\"6.1.0\",\"@types/pluralize\":\"0.0.29\",\"@types/psl\":\"1.1.0\",\"@types/semver\":\"6.0.1\",\"@types/tar-fs\":\"1.16.1\",\"@types/text-table\":\"0.2.0\",\"@types/title\":\"3.4.1\",\"@types/universal-analytics\":\"0.4.2\",\"@types/update-notifier\":\"5.1.0\",\"@types/which\":\"1.3.2\",\"@types/write-json-file\":\"2.2.1\",\"@types/yauzl-promise\":\"2.1.0\",\"@vercel/client\":\"12.2.4\",\"@vercel/frameworks\":\"1.1.5\",\"@vercel/fs-detectors\":\"3.1.0\",\"@vercel/fun\":\"1.0.4\",\"@vercel/ncc\":\"0.24.0\",\"@zeit/source-map-support\":\"0.6.2\",\"ajv\":\"6.12.2\",\"alpha-sort\":\"2.0.1\",\"ansi-escapes\":\"3.0.0\",\"ansi-regex\":\"3.0.0\",\"arg\":\"5.0.0\",\"async-listen\":\"1.2.0\",\"async-retry\":\"1.1.3\",\"async-sema\":\"2.1.4\",\"ava\":\"2.2.0\",\"boxen\":\"4.2.0\",\"bytes\":\"3.0.0\",\"chalk\":\"4.1.0\",\"chance\":\"1.1.7\",\"chokidar\":\"3.3.1\",\"codecov\":\"3.8.2\",\"cpy\":\"7.2.0\",\"date-fns\":\"1.29.0\",\"debug\":\"3.1.0\",\"dot\":\"1.1.3\",\"dotenv\":\"4.0.0\",\"email-prompt\":\"0.3.2\",\"email-validator\":\"1.1.1\",\"epipebomb\":\"1.0.0\",\"escape-html\":\"1.0.3\",\"esm\":\"3.1.4\",\"execa\":\"3.2.0\",\"express\":\"4.17.1\",\"fast-deep-equal\":\"3.1.3\",\"fs-extra\":\"10.0.0\",\"get-port\":\"5.1.1\",\"git-last-commit\":\"1.0.1\",\"glob\":\"7.1.2\",\"http-proxy\":\"1.18.1\",\"ini\":\"3.0.0\",\"inquirer\":\"7.0.4\",\"is-docker\":\"2.2.1\",\"is-port-reachable\":\"3.1.0\",\"is-url\":\"1.2.2\",\"jaro-winkler\":\"0.2.8\",\"jsonlines\":\"0.1.1\",\"load-json-file\":\"3.0.0\",\"mime-types\":\"2.1.24\",\"minimatch\":\"3.0.4\",\"mri\":\"1.1.5\",\"ms\":\"2.1.2\",\"node-fetch\":\"2.6.7\",\"npm-package-arg\":\"6.1.0\",\"open\":\"8.4.0\",\"ora\":\"3.4.0\",\"pcre-to-regexp\":\"1.0.0\",\"pluralize\":\"7.0.0\",\"promisepipe\":\"3.0.0\",\"psl\":\"1.1.31\",\"qr-image\":\"3.2.0\",\"raw-body\":\"2.4.1\",\"rimraf\":\"3.0.2\",\"semver\":\"5.5.0\",\"serve-handler\":\"6.1.1\",\"strip-ansi\":\"5.2.0\",\"stripe\":\"5.1.0\",\"tar-fs\":\"1.16.3\",\"test-listen\":\"1.1.0\",\"text-table\":\"0.2.0\",\"title\":\"3.4.1\",\"tmp-promise\":\"1.0.3\",\"tree-kill\":\"1.2.2\",\"ts-node\":\"10.9.1\",\"typescript\":\"4.7.4\",\"universal-analytics\":\"0.4.20\",\"utility-types\":\"2.1.0\",\"which\":\"2.0.2\",\"write-json-file\":\"2.2.0\",\"xdg-app-paths\":\"5.1.0\",\"yauzl-promise\":\"2.1.3\"},\"jest\":{\"preset\":\"ts-jest\",\"globals\":{\"ts-jest\":{\"diagnostics\":false,\"isolatedModules\":true}},\"setupFilesAfterEnv\":[\"@alex_neo/jest-expect-message\"],\"verbose\":false,\"testEnvironment\":\"node\",\"testMatch\":[\"<rootDir>/test/**/*.test.ts\"]}}");
|
249449
249504
|
|
249450
249505
|
/***/ }),
|
249451
249506
|
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "vercel",
|
3
|
-
"version": "28.2.
|
3
|
+
"version": "28.2.4",
|
4
4
|
"preferGlobal": true,
|
5
5
|
"license": "Apache-2.0",
|
6
6
|
"description": "The command-line interface for Vercel",
|
@@ -50,7 +50,7 @@
|
|
50
50
|
"@vercel/redwood": "1.0.23",
|
51
51
|
"@vercel/remix": "1.0.24",
|
52
52
|
"@vercel/ruby": "1.3.31",
|
53
|
-
"@vercel/static-build": "1.0.
|
53
|
+
"@vercel/static-build": "1.0.23",
|
54
54
|
"update-notifier": "5.1.0"
|
55
55
|
},
|
56
56
|
"devDependencies": {
|
@@ -96,8 +96,8 @@
|
|
96
96
|
"@types/write-json-file": "2.2.1",
|
97
97
|
"@types/yauzl-promise": "2.1.0",
|
98
98
|
"@vercel/client": "12.2.4",
|
99
|
-
"@vercel/frameworks": "1.1.
|
100
|
-
"@vercel/fs-detectors": "3.
|
99
|
+
"@vercel/frameworks": "1.1.5",
|
100
|
+
"@vercel/fs-detectors": "3.1.0",
|
101
101
|
"@vercel/fun": "1.0.4",
|
102
102
|
"@vercel/ncc": "0.24.0",
|
103
103
|
"@zeit/source-map-support": "0.6.2",
|
@@ -193,5 +193,5 @@
|
|
193
193
|
"<rootDir>/test/**/*.test.ts"
|
194
194
|
]
|
195
195
|
},
|
196
|
-
"gitHead": "
|
196
|
+
"gitHead": "8b3c52b9e8cbf7de7fc51f76975374c4bb2fad56"
|
197
197
|
}
|