Skip to content

Commit

Permalink
Merge branch 'main' into trek/zero-1655-update-parcel-package-in-fixt…
Browse files Browse the repository at this point in the history
…ures
  • Loading branch information
kodiakhq[bot] committed Apr 30, 2024
2 parents 666a0cf + aef56ed commit 2d5f434
Show file tree
Hide file tree
Showing 69 changed files with 4,163 additions and 4,525 deletions.
5 changes: 5 additions & 0 deletions .changeset/friendly-badgers-protect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@vercel/ruby': minor
---

Add support for Ruby 3.3
4 changes: 4 additions & 0 deletions .changeset/nervous-rice-tie.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
---

[framework-fixtures]: Bump astro from 4.6.2 to 4.7.0 in /packages/static-build/test/fixtures/astro-v4 in the core group
5 changes: 5 additions & 0 deletions .changeset/new-fireants-burn.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---

---

[tests] Upgrade Turbo to version 1.13.3
3 changes: 0 additions & 3 deletions .changeset/next-14-2-3.md

This file was deleted.

5 changes: 5 additions & 0 deletions .changeset/short-bears-sit.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@vercel/build-utils": patch
---

[build-utils] Add `VERCEL_PROJECT_PRODUCTION_URL` framework env var prefix
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ updates:
update-types:
- 'minor'

- directory: /packages/static-build/test/fixtures/ionic-angular-v7
- directory: /packages/static-build/test/fixtures/ionic-angular-v8
schedule:
interval: 'daily'
open-pull-requests-limit: 1
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"source-map-support": "0.5.12",
"ts-eager": "2.0.2",
"ts-jest": "29.1.0",
"turbo": "1.13.2",
"turbo": "1.13.3",
"typescript": "4.9.5"
},
"scripts": {
Expand Down
1 change: 1 addition & 0 deletions packages/build-utils/src/get-prefixed-env-vars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export function getPrefixedEnvVars({
'VERCEL_ENV',
'VERCEL_REGION',
'VERCEL_BRANCH_URL',
'VERCEL_PROJECT_PRODUCTION_URL',
];
const newEnvs: Envs = {};
if (envPrefix && envs.VERCEL_URL) {
Expand Down
2 changes: 2 additions & 0 deletions packages/build-utils/test/unit.get-prefixed-env-vars.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ describe('Test `getPrefixedEnvVars()`', () => {
VERCEL_URL: 'example.vercel.sh',
VERCEL_ENV: 'production',
VERCEL_BRANCH_URL: 'example-git-main-acme.vercel.app',
VERCEL_PROJECT_PRODUCTION_URL: 'example.com',
USER_ENV_VAR_NOT_VERCEL: 'example.com',
VERCEL_ARTIFACTS_TOKEN: 'abc123',
FOO: 'bar',
Expand All @@ -24,6 +25,7 @@ describe('Test `getPrefixedEnvVars()`', () => {
NEXT_PUBLIC_VERCEL_URL: 'example.vercel.sh',
NEXT_PUBLIC_VERCEL_ENV: 'production',
NEXT_PUBLIC_VERCEL_BRANCH_URL: 'example-git-main-acme.vercel.app',
NEXT_PUBLIC_VERCEL_PROJECT_PRODUCTION_URL: 'example.com',
TURBO_CI_VENDOR_ENV_KEY: 'NEXT_PUBLIC_VERCEL_',
},
},
Expand Down
7 changes: 7 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# vercel

## 34.1.4

### Patch Changes

- Updated dependencies [[`5b7960337`](https://github.com/vercel/vercel/commit/5b79603378a50fd04d5be1c3a3e5cd605b61478f)]:
- @vercel/next@4.2.4

## 34.1.3

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vercel",
"version": "34.1.3",
"version": "34.1.4",
"preferGlobal": true,
"license": "Apache-2.0",
"description": "The command-line interface for Vercel",
Expand Down Expand Up @@ -36,7 +36,7 @@
"@vercel/fun": "1.1.0",
"@vercel/go": "3.1.1",
"@vercel/hydrogen": "1.0.2",
"@vercel/next": "4.2.3",
"@vercel/next": "4.2.4",
"@vercel/node": "3.0.27",
"@vercel/python": "4.2.0",
"@vercel/redwood": "2.0.8",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/bisect/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const bisectCommand: Command = {
description: 'Automatically open each URL in the browser',
argument: 'URL',
shorthand: 'o',
type: String,
type: Boolean,
deprecated: false,
},
{
Expand Down
40 changes: 20 additions & 20 deletions packages/cli/src/commands/bisect/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ import { URLSearchParams, parse } from 'url';
import box from '../../util/output/box';
import formatDate from '../../util/format-date';
import link from '../../util/output/link';
import getArgs from '../../util/get-args';
import { parseArguments } from '../../util/get-args';
import Client from '../../util/client';
import { Deployment } from '@vercel-internals/types';
import { normalizeURL } from '../../util/bisect/normalize-url';
import getScope from '../../util/get-scope';
import getDeployment from '../../util/get-deployment';
import { help } from '../help';
import { bisectCommand } from './command';
import { getFlagsSpecification } from '../../util/get-flags-specification';
import handleError from '../../util/handle-error';

interface Deployments {
deployments: Deployment[];
Expand All @@ -25,39 +27,37 @@ export default async function bisect(client: Client): Promise<number> {
const scope = await getScope(client);
const { contextName } = scope;

const argv = getArgs(client.argv.slice(2), {
'--bad': String,
'-b': '--bad',
'--good': String,
'-g': '--good',
'--open': Boolean,
'-o': '--open',
'--path': String,
'-p': '--path',
'--run': String,
'-r': '--run',
});

if (argv['--help']) {
let parsedArgs = null;

const flagsSpecification = getFlagsSpecification(bisectCommand.options);

try {
parsedArgs = parseArguments(client.argv.slice(2), flagsSpecification);
} catch (error) {
handleError(error);
return 1;
}

if (parsedArgs.flags['--help']) {
output.print(help(bisectCommand, { columns: client.stderr.columns }));
return 2;
}

let bad =
argv['--bad'] ||
parsedArgs.flags['--bad'] ||
(await client.input.text({
message: `Specify a URL where the bug occurs:`,
validate: val => (val ? true : 'A URL must be provided'),
}));
let good =
argv['--good'] ||
parsedArgs.flags['--good'] ||
(await client.input.text({
message: `Specify a URL where the bug does not occur:`,
validate: val => (val ? true : 'A URL must be provided'),
}));
let subpath = argv['--path'] || '';
let run = argv['--run'] || '';
const openEnabled = argv['--open'] || false;
let subpath = parsedArgs.flags['--path'] || '';
let run = parsedArgs.flags['--run'] || '';
const openEnabled = parsedArgs.flags['--open'] || false;

if (run) {
run = resolve(run);
Expand Down
6 changes: 6 additions & 0 deletions packages/next/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @vercel/next

## 4.2.4

### Patch Changes

- [next]: Revert .action handling for dynamic routes ([#11509](https://github.com/vercel/vercel/pull/11509))

## 4.2.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/next/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vercel/next",
"version": "4.2.3",
"version": "4.2.4",
"license": "Apache-2.0",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
Expand Down
2 changes: 0 additions & 2 deletions packages/next/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1928,7 +1928,6 @@ export const build: BuildV2 = async ({
bypassToken: prerenderManifest.bypassToken || '',
isServerMode,
experimentalPPRRoutes,
hasActionOutputSupport: false,
}).then(arr =>
localizeDynamicRoutes(
arr,
Expand Down Expand Up @@ -1959,7 +1958,6 @@ export const build: BuildV2 = async ({
bypassToken: prerenderManifest.bypassToken || '',
isServerMode,
experimentalPPRRoutes,
hasActionOutputSupport: false,
}).then(arr =>
arr.map(route => {
route.src = route.src.replace('^', `^${dynamicPrefix}`);
Expand Down
99 changes: 1 addition & 98 deletions packages/next/src/server-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ import {
normalizePrefetches,
CreateLambdaFromPseudoLayersOptions,
getPostponeResumePathname,
LambdaGroup,
MAX_UNCOMPRESSED_LAMBDA_SIZE,
} from './utils';
import {
Expand All @@ -69,7 +68,6 @@ const CORRECT_NOT_FOUND_ROUTES_VERSION = 'v12.0.1';
const CORRECT_MIDDLEWARE_ORDER_VERSION = 'v12.1.7-canary.29';
const NEXT_DATA_MIDDLEWARE_RESOLVING_VERSION = 'v12.1.7-canary.33';
const EMPTY_ALLOW_QUERY_FOR_PRERENDERED_VERSION = 'v12.2.0';
const ACTION_OUTPUT_SUPPORT_VERSION = 'v14.2.2';
const CORRECTED_MANIFESTS_VERSION = 'v12.2.0';

// Ideally this should be in a Next.js manifest so we can change it in
Expand Down Expand Up @@ -201,10 +199,6 @@ export async function serverBuild({
nextVersion,
EMPTY_ALLOW_QUERY_FOR_PRERENDERED_VERSION
);
const hasActionOutputSupport = semver.gte(
nextVersion,
ACTION_OUTPUT_SUPPORT_VERSION
);
const projectDir = requiredServerFilesManifest.relativeAppDir
? path.join(baseDir, requiredServerFilesManifest.relativeAppDir)
: requiredServerFilesManifest.appDir || entryPath;
Expand Down Expand Up @@ -932,23 +926,11 @@ export async function serverBuild({
inversedAppPathManifest,
});

const appRouterStreamingActionLambdaGroups: LambdaGroup[] = [];

for (const group of appRouterLambdaGroups) {
if (!group.isPrerenders || group.isExperimentalPPR) {
group.isStreaming = true;
}
group.isAppRouter = true;

// We create a streaming variant of the Prerender lambda group
// to support actions that are part of a Prerender
if (hasActionOutputSupport) {
appRouterStreamingActionLambdaGroups.push({
...group,
isActionLambda: true,
isStreaming: true,
});
}
}

for (const group of appRouteHandlersLambdaGroups) {
Expand Down Expand Up @@ -1000,13 +982,6 @@ export async function serverBuild({
pseudoLayerBytes: group.pseudoLayerBytes,
uncompressedLayerBytes: group.pseudoLayerUncompressedBytes,
})),
appRouterStreamingPrerenderLambdaGroups:
appRouterStreamingActionLambdaGroups.map(group => ({
pages: group.pages,
isPrerender: group.isPrerenders,
pseudoLayerBytes: group.pseudoLayerBytes,
uncompressedLayerBytes: group.pseudoLayerUncompressedBytes,
})),
appRouteHandlersLambdaGroups: appRouteHandlersLambdaGroups.map(
group => ({
pages: group.pages,
Expand All @@ -1024,7 +999,6 @@ export async function serverBuild({
const combinedGroups = [
...pageLambdaGroups,
...appRouterLambdaGroups,
...appRouterStreamingActionLambdaGroups,
...apiLambdaGroups,
...appRouteHandlersLambdaGroups,
];
Expand Down Expand Up @@ -1234,11 +1208,6 @@ export async function serverBuild({

let outputName = path.posix.join(entryDirectory, pageName);

if (group.isActionLambda) {
// give the streaming prerenders a .action suffix
outputName = `${outputName}.action`;
}

// If this is a PPR page, then we should prefix the output name.
if (isPPR) {
if (!revalidate) {
Expand Down Expand Up @@ -1409,7 +1378,6 @@ export async function serverBuild({
isServerMode: true,
dynamicMiddlewareRouteMap: middleware.dynamicRouteMap,
experimentalPPRRoutes,
hasActionOutputSupport,
}).then(arr =>
localizeDynamicRoutes(
arr,
Expand Down Expand Up @@ -1937,72 +1905,7 @@ export async function serverBuild({
},
]
: []),
...(hasActionOutputSupport
? [
// Create rewrites for streaming prerenders (.action routes)
// This contains separate rewrites for each possible "has" (action header, or content-type)
// Also includes separate handling for index routes which should match to /index.action.
// This follows the same pattern as the rewrites for .rsc files.
{
src: `^${path.posix.join('/', entryDirectory, '/')}`,
dest: path.posix.join('/', entryDirectory, '/index.action'),
has: [
{
type: 'header',
key: 'next-action',
},
],
continue: true,
override: true,
},
{
src: `^${path.posix.join('/', entryDirectory, '/')}`,
dest: path.posix.join('/', entryDirectory, '/index.action'),
has: [
{
type: 'header',
key: 'content-type',
value: 'multipart/form-data;.*',
},
],
continue: true,
override: true,
},
{
src: `^${path.posix.join(
'/',
entryDirectory,
'/((?!.+\\.action).+?)(?:/)?$'
)}`,
dest: path.posix.join('/', entryDirectory, '/$1.action'),
has: [
{
type: 'header',
key: 'next-action',
},
],
continue: true,
override: true,
},
{
src: `^${path.posix.join(
'/',
entryDirectory,
'/((?!.+\\.action).+?)(?:/)?$'
)}`,
dest: path.posix.join('/', entryDirectory, '/$1.action'),
has: [
{
type: 'header',
key: 'content-type',
value: 'multipart/form-data;.*',
},
],
continue: true,
override: true,
},
]
: []),

{
src: `^${path.posix.join('/', entryDirectory, '/')}`,
has: [
Expand Down
Loading

0 comments on commit 2d5f434

Please sign in to comment.