Skip to content

Commit

Permalink
Merge branch 'main' into update/proxy-agent-6.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
TooTallNate committed Jul 18, 2023
2 parents f12767b + 56178e6 commit 742cd03
Show file tree
Hide file tree
Showing 41 changed files with 1,936 additions and 138 deletions.
5 changes: 0 additions & 5 deletions .changeset/chilled-rabbits-walk.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/khaki-ties-taste.md

This file was deleted.

2 changes: 0 additions & 2 deletions .changeset/light-glasses-join.md

This file was deleted.

3 changes: 0 additions & 3 deletions .changeset/next-13-4-10.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/rich-days-deliver.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/weak-days-yawn.md

This file was deleted.

12 changes: 12 additions & 0 deletions packages/cli/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# vercel

## 31.0.4

### Patch Changes

- Detect multiple frameworks within the same root directory during `vc link --repo` ([#10203](https://github.com/vercel/vercel/pull/10203))

- Updated dependencies [[`b56639b62`](https://github.com/vercel/vercel/commit/b56639b624e9ad1df048a4c85083e26888696060), [`cae60155f`](https://github.com/vercel/vercel/commit/cae60155f34883f08a5e4f51b547e2a1a5fee694), [`c670e5171`](https://github.com/vercel/vercel/commit/c670e51712022193e078bd68b055f7e61013015d), [`5439d7c0c`](https://github.com/vercel/vercel/commit/5439d7c0c9b79e7161bf4fa84ffdb357365f9e7e)]:
- @vercel/node@2.15.6
- @vercel/next@3.9.0
- @vercel/remix-builder@1.8.18
- @vercel/static-build@1.3.41

## 31.0.3

### Patch Changes
Expand Down
10 changes: 5 additions & 5 deletions packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vercel",
"version": "31.0.3",
"version": "31.0.4",
"preferGlobal": true,
"license": "Apache-2.0",
"description": "The command-line interface for Vercel",
Expand Down Expand Up @@ -34,13 +34,13 @@
"@vercel/build-utils": "6.8.2",
"@vercel/go": "2.5.1",
"@vercel/hydrogen": "0.0.64",
"@vercel/next": "3.8.8",
"@vercel/node": "2.15.5",
"@vercel/next": "3.9.0",
"@vercel/node": "2.15.6",
"@vercel/python": "3.1.60",
"@vercel/redwood": "1.1.15",
"@vercel/remix-builder": "1.8.17",
"@vercel/remix-builder": "1.8.18",
"@vercel/ruby": "1.3.76",
"@vercel/static-build": "1.3.40"
"@vercel/static-build": "1.3.41"
},
"devDependencies": {
"@alex_neo/jest-expect-message": "1.0.5",
Expand Down
7 changes: 7 additions & 0 deletions packages/gatsby-plugin-vercel-builder/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @vercel/gatsby-plugin-vercel-builder

## 1.3.14

### Patch Changes

- Updated dependencies [[`b56639b62`](https://github.com/vercel/vercel/commit/b56639b624e9ad1df048a4c85083e26888696060)]:
- @vercel/node@2.15.6

## 1.3.13

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions packages/gatsby-plugin-vercel-builder/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vercel/gatsby-plugin-vercel-builder",
"version": "1.3.13",
"version": "1.3.14",
"main": "dist/index.js",
"files": [
"dist",
Expand All @@ -21,7 +21,7 @@
"dependencies": {
"@sinclair/typebox": "0.25.24",
"@vercel/build-utils": "6.8.2",
"@vercel/node": "2.15.5",
"@vercel/node": "2.15.6",
"@vercel/routing-utils": "2.2.1",
"esbuild": "0.14.47",
"etag": "1.8.1",
Expand Down
10 changes: 10 additions & 0 deletions packages/next/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# @vercel/next

## 3.9.0

### Minor Changes

- Support maxDuration in Next.js deployments ([#10069](https://github.com/vercel/vercel/pull/10069))

### Patch Changes

- Fix 404 page in edge runtime ([#10223](https://github.com/vercel/vercel/pull/10223))

## 3.8.8

### 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": "3.8.8",
"version": "3.9.0",
"license": "Apache-2.0",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/next-js",
Expand Down
6 changes: 6 additions & 0 deletions packages/node/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @vercel/node

## 2.15.6

### Patch Changes

- [node] fix: runs edge user code inside IIFE ([#10220](https://github.com/vercel/vercel/pull/10220))

## 2.15.5

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/node/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vercel/node",
"version": "2.15.5",
"version": "2.15.6",
"license": "Apache-2.0",
"main": "./dist/index",
"homepage": "https://vercel.com/docs/runtimes#official-runtimes/node-js",
Expand Down
6 changes: 6 additions & 0 deletions packages/remix/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @vercel/remix-builder

## 1.8.18

### Patch Changes

- Create ensured dependency symlink at the `start` directory, instead of root of repo ([#10224](https://github.com/vercel/vercel/pull/10224))

## 1.8.17

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/remix/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@vercel/remix-builder",
"version": "1.8.17",
"version": "1.8.18",
"license": "Apache-2.0",
"main": "./dist/index.js",
"homepage": "https://vercel.com/docs",
Expand Down
95 changes: 1 addition & 94 deletions packages/remix/src/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import {
runNpmInstall,
runPackageJsonScript,
scanParentDirs,
walkParentDirs,
} from '@vercel/build-utils';
import { getConfig } from '@vercel/static-config';
import { nodeFileTrace } from '@vercel/nft';
Expand All @@ -43,6 +42,7 @@ import {
findEntry,
chdirAndReadConfig,
addDependency,
ensureResolvable,
} from './utils';
import semver from 'semver';

Expand Down Expand Up @@ -659,99 +659,6 @@ async function createRenderEdgeFunction(
return fn;
}

async function ensureResolvable(
start: string,
base: string,
pkgName: string
): Promise<string> {
try {
const resolvedPkgPath = _require.resolve(`${pkgName}/package.json`, {
paths: [start],
});
const resolvedPath = dirname(resolvedPkgPath);
if (!relative(base, resolvedPath).startsWith(`..${sep}`)) {
// Resolved path is within the root of the project, so all good
debug(`"${pkgName}" resolved to '${resolvedPath}'`);
return resolvedPath;
}
} catch (err: any) {
if (err.code !== 'MODULE_NOT_FOUND') {
throw err;
}
}

// If we got to here then `pkgName` was not resolvable up to the root
// of the project. Try a couple symlink tricks, otherwise we'll bail.

// Attempt to find the package in `node_modules/.pnpm` (pnpm)
const pnpmDir = await walkParentDirs({
base,
start,
filename: 'node_modules/.pnpm',
});
if (pnpmDir) {
const prefix = `${pkgName.replace('/', '+')}@`;
const packages = await fs.readdir(pnpmDir);
const match = packages.find(p => p.startsWith(prefix));
if (match) {
const pkgDir = join(pnpmDir, match, 'node_modules', pkgName);
await ensureSymlink(pkgDir, join(pnpmDir, '..'), pkgName);
return pkgDir;
}
}

// Attempt to find the package in `node_modules/.store` (npm 9+ linked mode)
const npmDir = await walkParentDirs({
base,
start,
filename: 'node_modules/.store',
});
if (npmDir) {
const prefix = `${basename(pkgName)}@`;
const prefixDir = join(npmDir, dirname(pkgName));
const packages = await fs.readdir(prefixDir);
const match = packages.find(p => p.startsWith(prefix));
if (match) {
const pkgDir = join(prefixDir, match, 'node_modules', pkgName);
await ensureSymlink(pkgDir, join(npmDir, '..'), pkgName);
return pkgDir;
}
}

throw new Error(
`Failed to resolve "${pkgName}". To fix this error, add "${pkgName}" to "dependencies" in your \`package.json\` file.`
);
}

async function ensureSymlink(
target: string,
nodeModulesDir: string,
pkgName: string
) {
const symlinkPath = join(nodeModulesDir, pkgName);
const symlinkDir = dirname(symlinkPath);
const relativeTarget = relative(symlinkDir, target);

try {
const existingTarget = await fs.readlink(symlinkPath);
if (existingTarget === relativeTarget) {
// Symlink is already the expected value, so do nothing
return;
} else {
// If a symlink already exists then delete it if the target doesn't match
await fs.unlink(symlinkPath);
}
} catch (err: any) {
// Ignore when path does not exist or is not a symlink
if (err.code !== 'ENOENT' && err.code !== 'EINVAL') {
throw err;
}
}

await fs.symlink(relativeTarget, symlinkPath);
debug(`Created symlink for "${pkgName}"`);
}

async function writeEntrypointFile(
path: string,
data: string,
Expand Down

0 comments on commit 742cd03

Please sign in to comment.