Compare commits

..

5 Commits

Author SHA1 Message Date
Trek Glowacki
30ada9855e Add dynamic port assignment and FD 3 communication 2023-09-18 12:56:30 -05:00
Trek Glowacki
bfe60ec497 . 2023-09-15 12:26:59 -05:00
Trek Glowacki
3247bee5f4 WIP 2023-09-15 10:51:34 -05:00
Trek Glowacki
b0743a166a . 2023-09-14 12:48:38 -05:00
Trek Glowacki
a27b41e841 . 2023-09-14 12:48:17 -05:00
508 changed files with 45723 additions and 109913 deletions

View File

@@ -0,0 +1,2 @@
---
---

View File

@@ -0,0 +1,5 @@
---
"@vercel/next": patch
---
provide `experimentalBypassFor` to Prerender from manifest

View File

@@ -0,0 +1,5 @@
---
"@vercel/next": patch
---
next.js: move app route handlers in their own lambda grouping, add flag to use bundled runtime

View File

@@ -0,0 +1,5 @@
---
'@vercel/remix-builder': patch
---
Fix usage with `bun install`

View File

@@ -0,0 +1,5 @@
---
"@vercel/frameworks": patch
---
Add `bun install` placeholder

2
.github/CODEOWNERS vendored
View File

@@ -10,7 +10,7 @@
/packages/edge @vercel/compute
/examples @leerob
/examples/create-react-app @Timer
/examples/nextjs @timneutkens @ijjk @styfle @ztanner @huozhi
/examples/nextjs @timneutkens @ijjk @styfle @ztanner
/examples/hugo @styfle
/examples/jekyll @styfle
/examples/zola @styfle

View File

@@ -83,7 +83,7 @@ jobs:
env:
FORCE_COLOR: '1'
- name: Test ${{matrix.packageName}}
run: node utils/gen.js && node_modules/.bin/turbo run test --summarize --cache-dir=".turbo" --log-order=stream --scope=${{matrix.packageName}} --no-deps -- ${{ join(matrix.testPaths, ' ') }}
run: node utils/gen.js && node_modules/.bin/turbo run test --cache-dir=".turbo" --log-order=stream --scope=${{matrix.packageName}} --no-deps -- ${{ join(matrix.testPaths, ' ') }}
shell: bash
env:
JEST_JUNIT_OUTPUT_FILE: ${{github.workspace}}/.junit-reports/${{matrix.scriptName}}-${{matrix.packageName}}-${{matrix.chunkNumber}}-${{ matrix.runner }}.xml
@@ -91,19 +91,13 @@ jobs:
VERCEL_TEST_TOKEN: ${{ secrets.VERCEL_TEST_TOKEN }}
VERCEL_TEST_REGISTRATION_URL: ${{ secrets.VERCEL_TEST_REGISTRATION_URL }}
FORCE_COLOR: '1'
- name: 'Determine Turbo HIT or MISS'
if: ${{ !cancelled() }}
id: turbo-summary
shell: bash
run: |
TURBO_MISS_COUNT=`node utils/determine-turbo-hit-or-miss.js`
echo "MISS COUNT: $TURBO_MISS_COUNT"
echo "misses=$TURBO_MISS_COUNT" >> $GITHUB_OUTPUT
- name: fetch ssl certificate after tests (linux, os x)
if: matrix.runner != 'windows-latest'
run: echo | openssl s_client -showcerts -servername 'api.vercel.com' -connect 76.76.21.21:443
- name: 'Upload Test Report to Datadog'
if: ${{ steps['turbo-summary'].outputs.misses != '0' && !cancelled() }}
if: always()
run: 'npx @datadog/datadog-ci@2.18.1 junit upload --service vercel-cli .junit-reports'
env:
DATADOG_API_KEY: ${{secrets.DATADOG_API_KEY_CLI}}

View File

@@ -10,8 +10,6 @@ npm run dev
yarn dev
# or
pnpm dev
# or
bun dev
```
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

File diff suppressed because it is too large Load Diff

View File

@@ -9,19 +9,17 @@
"lint": "next lint"
},
"dependencies": {
"react": "latest",
"react-dom": "latest",
"next": "latest"
},
"devDependencies": {
"typescript": "latest",
"@types/react": "latest",
"@types/node": "latest",
"@types/react-dom": "latest",
"autoprefixer": "latest",
"postcss": "latest",
"tailwindcss": "latest",
"eslint": "latest",
"eslint-config-next": "latest"
"@types/node": "20.5.1",
"@types/react": "18.2.20",
"@types/react-dom": "18.2.7",
"autoprefixer": "10.4.15",
"eslint": "8.47.0",
"eslint-config-next": "13.4.19",
"next": "13.4.19",
"postcss": "8.4.28",
"react": "18.2.0",
"react-dom": "18.2.0",
"tailwindcss": "3.3.3",
"typescript": "5.1.6"
}
}

View File

@@ -9,7 +9,7 @@
},
"devDependencies": {
"@types/jest": "27.4.1",
"@vercel/frameworks": "2.0.2"
"@vercel/frameworks": "2.0.1"
},
"version": null
}

View File

@@ -4,4 +4,9 @@ node_modules
/build
/public/build
.env
.vercel
.output
/api/index.js
/api/index.js.map

View File

@@ -19,7 +19,7 @@ export default function App() {
<html lang="en">
<head>
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<Meta />
<Links />
</head>

View File

@@ -1,15 +1,10 @@
import type { MetaFunction } from "@vercel/remix";
import type { V2_MetaFunction } from "@vercel/remix";
export const meta: MetaFunction = () => {
return [
{ title: "New Remix App" },
{ name: "description", content: "Welcome to Remix!" },
];
};
export const meta: V2_MetaFunction = () => [{ title: "New Remix App" }];
export default function Index() {
return (
<div style={{ fontFamily: "system-ui, sans-serif", lineHeight: "1.8" }}>
<div style={{ fontFamily: "system-ui, sans-serif", lineHeight: "1.4" }}>
<h1>Welcome to Remix</h1>
<ul>
<li>

View File

@@ -1,8 +1,8 @@
import type { MetaFunction } from "@vercel/remix";
import type { V2_MetaFunction } from "@vercel/remix";
export const config = { runtime: "edge" };
export const meta: MetaFunction = () => [{ title: "Remix@Edge | New Remix App" }];
export const meta: V2_MetaFunction = () => [{ title: "Remix@Edge | New Remix App" }];
export default function Edge() {
return (

View File

@@ -1,34 +1,32 @@
{
"name": "my-remix-app",
"private": true,
"sideEffects": false,
"type": "module",
"scripts": {
"build": "remix build",
"dev": "remix dev --manual",
"start": "remix-serve ./build/index.js",
"dev": "remix dev",
"start": "remix-serve build",
"typecheck": "tsc"
},
"dependencies": {
"@remix-run/css-bundle": "^2.0.0",
"@remix-run/node": "^2.0.0",
"@remix-run/react": "^2.0.0",
"@remix-run/serve": "^2.0.0",
"@vercel/analytics": "^1.0.2",
"@vercel/remix": "^2.0.0",
"@remix-run/css-bundle": "^1.18.0",
"@remix-run/node": "^1.18.0",
"@remix-run/react": "^1.18.0",
"@remix-run/serve": "^1.18.0",
"@vercel/analytics": "^0.1.11",
"@vercel/remix": "^1.18.0",
"isbot": "^3.6.8",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@remix-run/dev": "^2.0.0",
"@remix-run/eslint-config": "^2.0.0",
"@types/react": "^18.2.20",
"@types/react-dom": "^18.2.7",
"eslint": "^8.38.0",
"typescript": "^5.1.6"
"@remix-run/dev": "^1.18.0",
"@remix-run/eslint-config": "^1.18.0",
"@types/react": "^18.0.25",
"@types/react-dom": "^18.0.11",
"eslint": "^8.28.0",
"typescript": "^5.1.3"
},
"engines": {
"node": ">=18.0.0"
"node": ">=16"
}
}

View File

@@ -1,8 +1,17 @@
/** @type {import('@remix-run/dev').AppConfig} */
export default {
module.exports = {
future: {
v2_dev: true,
v2_errorBoundary: true,
v2_headers: true,
v2_meta: true,
v2_normalizeFormMethod: true,
v2_routeConvention: true,
},
ignoredRouteFiles: ["**/.*"],
serverModuleFormat: "cjs",
// appDirectory: "app",
// assetsBuildDirectory: "public/build",
// publicPath: "/build/",
// serverBuildPath: "build/index.js",
// publicPath: "/build/",
};

View File

@@ -1,13 +1,13 @@
{
"include": ["remix.env.d.ts", "**/*.ts", "**/*.tsx"],
"compilerOptions": {
"lib": ["DOM", "DOM.Iterable", "ES2022"],
"lib": ["DOM", "DOM.Iterable", "ES2019"],
"isolatedModules": true,
"esModuleInterop": true,
"jsx": "react-jsx",
"moduleResolution": "Bundler",
"moduleResolution": "node",
"resolveJsonModule": true,
"target": "ES2022",
"target": "ES2019",
"strict": true,
"allowJs": true,
"forceConsistentCasingInFileNames": true,

View File

@@ -1,19 +1,5 @@
# @vercel-internals/types
## 1.0.12
### Patch Changes
- Updated dependencies [[`2f5b0aeeb`](https://github.com/vercel/vercel/commit/2f5b0aeeb183ed3ea8cbc68cb3bc3c949c486ada)]:
- @vercel/build-utils@7.2.2
## 1.0.11
### Patch Changes
- Updated dependencies [[`decdf27fb`](https://github.com/vercel/vercel/commit/decdf27fb5ca914fe50a9320c4fd50ef79d2fbb3)]:
- @vercel/build-utils@7.2.1
## 1.0.10
### Patch Changes

View File

@@ -65,8 +65,6 @@ export type User = {
billing: Billing;
name?: string;
limited?: boolean;
version?: 'northstar';
defaultTeamId?: string;
};
export interface Team {

View File

@@ -1,7 +1,7 @@
{
"private": true,
"name": "@vercel-internals/types",
"version": "1.0.12",
"version": "1.0.10",
"types": "index.d.ts",
"main": "index.d.ts",
"files": [
@@ -10,7 +10,7 @@
"dependencies": {
"@types/node": "14.14.31",
"@vercel-internals/constants": "1.0.4",
"@vercel/build-utils": "7.2.2",
"@vercel/build-utils": "7.2.0",
"@vercel/routing-utils": "3.0.0"
},
"devDependencies": {

View File

@@ -11,6 +11,7 @@
"@typescript-eslint/eslint-plugin": "5.21.0",
"@typescript-eslint/parser": "5.21.0",
"@vercel/build-utils": "*",
"@vercel/ncc": "0.24.0",
"async-retry": "1.2.3",
"buffer-replace": "1.0.0",
"create-svelte": "2.0.1",
@@ -32,7 +33,7 @@
"source-map-support": "0.5.12",
"ts-eager": "2.0.2",
"ts-jest": "29.1.0",
"turbo": "1.10.14",
"turbo": "1.10.13",
"typescript": "4.9.5"
},
"scripts": {

View File

@@ -1,17 +1,5 @@
# @vercel/build-utils
## 7.2.2
### Patch Changes
- [cli] Update bun detection and add tests for projects with both bunlock binary and yarn.lock text files ([#10583](https://github.com/vercel/vercel/pull/10583))
## 7.2.1
### Patch Changes
- Internal variants ([#10549](https://github.com/vercel/vercel/pull/10549))
## 7.2.0
### Minor Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/build-utils",
"version": "7.2.2",
"version": "7.2.0",
"license": "Apache-2.0",
"main": "./dist/index.js",
"types": "./dist/index.d.js",
@@ -33,6 +33,7 @@
"@types/semver": "6.0.0",
"@types/yazl": "2.4.2",
"@vercel/error-utils": "2.0.1",
"@vercel/ncc": "0.24.0",
"aggregate-error": "3.0.1",
"async-retry": "1.2.3",
"async-sema": "2.1.4",

View File

@@ -311,13 +311,8 @@ export async function scanParentDirs(
bunLockPath ? fs.readFile(bunLockPath, 'utf8') : null,
]);
// Priority order is bun with yarn lock > yarn > pnpm > npm > bun
if (bunLockBin && hasYarnLock) {
cliType = 'bun';
lockfilePath = bunLockPath;
// TODO: read "bun-lockfile-format-v0"
lockfileVersion = 0;
} else if (hasYarnLock) {
// Priority order is Yarn > pnpm > npm > bun
if (hasYarnLock) {
cliType = 'yarn';
lockfilePath = yarnLockPath;
} else if (pnpmLockYaml) {

View File

@@ -434,13 +434,6 @@ export interface Cron {
schedule: string;
}
// TODO: Proper description once complete
export interface Flag {
key: string;
defaultValue?: unknown;
metadata: Record<string, unknown>;
}
/** The framework which created the function */
export interface FunctionFramework {
slug: string;
@@ -465,7 +458,6 @@ export interface BuildResultV2Typical {
framework?: {
version: string;
};
flags?: Flag[];
}
export type BuildResultV2 = BuildResultV2Typical | BuildResultBuildOutput;

View File

@@ -1,2 +0,0 @@
.vercel
public

View File

@@ -1,8 +0,0 @@
import { mkdir, rm, writeFile } from 'node:fs/promises'
import { say } from 'cowsay'
const text = say({ text: `bun version: ${process.versions.bun}` })
const content = say({ text })
await rm('./public', { recursive: true, force: true })
await mkdir('./public', { recursive: true })
await writeFile('./public/index.txt', content)

View File

@@ -1,9 +0,0 @@
{
"private": true,
"scripts": {
"build": "bun build.js"
},
"dependencies": {
"cowsay": "1.5.0"
}
}

View File

@@ -1,8 +0,0 @@
{
"probes": [
{
"path": "/",
"mustContain": "bun version: 1"
}
]
}

View File

@@ -1,221 +0,0 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
# bun ./bun.lockb --hash: CD5862D9DB80873E-24483eaa80ed0cc4-641E4430BAAAECB3-abebd38edad3b1b9
ansi-regex@^3.0.0:
version "3.0.1"
resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz"
integrity sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==
ansi-regex@^5.0.1:
version "5.0.1"
resolved "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz"
integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==
ansi-styles@^4.0.0:
version "4.3.0"
resolved "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz"
integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
dependencies:
color-convert "^2.0.1"
camelcase@^5.0.0:
version "5.3.1"
resolved "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz"
integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==
cliui@^6.0.0:
version "6.0.0"
resolved "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz"
integrity sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==
dependencies:
string-width "^4.2.0"
strip-ansi "^6.0.0"
wrap-ansi "^6.2.0"
color-convert@^2.0.1:
version "2.0.1"
resolved "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz"
integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==
dependencies:
color-name "~1.1.4"
color-name@~1.1.4:
version "1.1.4"
resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz"
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
cowsay@1.5.0:
version "1.5.0"
resolved "https://registry.npmjs.org/cowsay/-/cowsay-1.5.0.tgz"
integrity sha512-8Ipzr54Z8zROr/62C8f0PdhQcDusS05gKTS87xxdji8VbWefWly0k8BwGK7+VqamOrkv3eGsCkPtvlHzrhWsCA==
dependencies:
get-stdin "8.0.0"
string-width "~2.1.1"
strip-final-newline "2.0.0"
yargs "15.4.1"
decamelize@^1.2.0:
version "1.2.0"
resolved "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz"
integrity sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==
emoji-regex@^8.0.0:
version "8.0.0"
resolved "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz"
integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==
find-up@^4.1.0:
version "4.1.0"
resolved "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz"
integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==
dependencies:
locate-path "^5.0.0"
path-exists "^4.0.0"
get-caller-file@^2.0.1:
version "2.0.5"
resolved "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz"
integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==
get-stdin@8.0.0:
version "8.0.0"
resolved "https://registry.npmjs.org/get-stdin/-/get-stdin-8.0.0.tgz"
integrity sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg==
is-fullwidth-code-point@^2.0.0:
version "2.0.0"
resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz"
integrity sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w==
is-fullwidth-code-point@^3.0.0:
version "3.0.0"
resolved "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz"
integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==
locate-path@^5.0.0:
version "5.0.0"
resolved "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz"
integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==
dependencies:
p-locate "^4.1.0"
p-limit@^2.2.0:
version "2.3.0"
resolved "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz"
integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==
dependencies:
p-try "^2.0.0"
p-locate@^4.1.0:
version "4.1.0"
resolved "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz"
integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==
dependencies:
p-limit "^2.2.0"
p-try@^2.0.0:
version "2.2.0"
resolved "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz"
integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==
path-exists@^4.0.0:
version "4.0.0"
resolved "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz"
integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==
require-directory@^2.1.1:
version "2.1.1"
resolved "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz"
integrity sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==
require-main-filename@^2.0.0:
version "2.0.0"
resolved "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz"
integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==
set-blocking@^2.0.0:
version "2.0.0"
resolved "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz"
integrity sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==
string-width@~2.1.1:
version "2.1.1"
resolved "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz"
integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==
dependencies:
is-fullwidth-code-point "^2.0.0"
strip-ansi "^4.0.0"
string-width@^4.1.0, string-width@^4.2.0:
version "4.2.3"
resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz"
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
dependencies:
emoji-regex "^8.0.0"
is-fullwidth-code-point "^3.0.0"
strip-ansi "^6.0.1"
strip-ansi@^4.0.0:
version "4.0.0"
resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz"
integrity sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow==
dependencies:
ansi-regex "^3.0.0"
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
version "6.0.1"
resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz"
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
dependencies:
ansi-regex "^5.0.1"
strip-final-newline@2.0.0:
version "2.0.0"
resolved "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz"
integrity sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==
which-module@^2.0.0:
version "2.0.1"
resolved "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz"
integrity sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==
wrap-ansi@^6.2.0:
version "6.2.0"
resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz"
integrity sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==
dependencies:
ansi-styles "^4.0.0"
string-width "^4.1.0"
strip-ansi "^6.0.0"
y18n@^4.0.0:
version "4.0.3"
resolved "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz"
integrity sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==
yargs@15.4.1:
version "15.4.1"
resolved "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz"
integrity sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==
dependencies:
cliui "^6.0.0"
decamelize "^1.2.0"
find-up "^4.1.0"
get-caller-file "^2.0.1"
require-directory "^2.1.1"
require-main-filename "^2.0.0"
set-blocking "^2.0.0"
string-width "^4.2.0"
which-module "^2.0.0"
y18n "^4.0.0"
yargs-parser "^18.1.2"
yargs-parser@^18.1.2:
version "18.1.3"
resolved "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz"
integrity sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==
dependencies:
camelcase "^5.0.0"
decamelize "^1.2.0"

View File

@@ -541,15 +541,6 @@ it(
);
it('should return cliType bun and correct lock file for bun v1', async () => {
const fixture = path.join(__dirname, 'fixtures', '31-bun-v1-with-yarn-lock');
const result = await scanParentDirs(fixture);
expect(result.cliType).toEqual('bun');
expect(result.lockfileVersion).toEqual(0);
expect(result.lockfilePath).toEqual(path.join(fixture, 'bun.lockb'));
expect(result.packageJsonPath).toEqual(path.join(fixture, 'package.json'));
});
it('should return cliType bun and correct lock file for bun v1 with yarn.lock file', async () => {
const fixture = path.join(__dirname, 'fixtures', '30-bun-v1');
const result = await scanParentDirs(fixture);
expect(result.cliType).toEqual('bun');

View File

@@ -1,92 +1,5 @@
# vercel
## 32.4.0
### Minor Changes
- Restore unsetting teamId for non-team accounts ([#10612](https://github.com/vercel/vercel/pull/10612))
### Patch Changes
- remove unused source map pkg ([#10577](https://github.com/vercel/vercel/pull/10577))
- disable source map for prod build ([#10575](https://github.com/vercel/vercel/pull/10575))
- Better rendering upon authentication error in `vc cert ls` ([#10551](https://github.com/vercel/vercel/pull/10551))
- Updated dependencies [[`e9026c7a6`](https://github.com/vercel/vercel/commit/e9026c7a692937122e60e73b91100cf7009e022d), [`ea5bc8806`](https://github.com/vercel/vercel/commit/ea5bc8806276abf5ba14bdb4a966267497e5d14d), [`a4996e1c5`](https://github.com/vercel/vercel/commit/a4996e1c5a7e6986d5410b662014dc584c0f7c54), [`a18ed98f2`](https://github.com/vercel/vercel/commit/a18ed98f2df78fe1256410ea8676686564ed9b35), [`2f5b0aeeb`](https://github.com/vercel/vercel/commit/2f5b0aeeb183ed3ea8cbc68cb3bc3c949c486ada), [`09f1bbfa4`](https://github.com/vercel/vercel/commit/09f1bbfa41a87cf0063a3fb3022b7531d03862b5), [`ce7e82fa7`](https://github.com/vercel/vercel/commit/ce7e82fa7aa6cec5f5d7b4953353b297b7ad1694)]:
- @vercel/next@4.0.9
- @vercel/go@3.0.3
- @vercel/build-utils@7.2.2
- @vercel/node@3.0.7
- @vercel/redwood@2.0.4
- @vercel/remix-builder@2.0.9
- @vercel/static-build@2.0.8
## 32.3.1
### Patch Changes
- Use "esbuild" to build CLI ([#10555](https://github.com/vercel/vercel/pull/10555))
- Updated dependencies [[`9f63ca60a`](https://github.com/vercel/vercel/commit/9f63ca60ad914af0f7ba18c9bbe1656eeea68a0a), [`e3f9faf51`](https://github.com/vercel/vercel/commit/e3f9faf513bd97900d8966f2f1116fc3ca07221b)]:
- @vercel/next@4.0.8
- @vercel/remix-builder@2.0.8
## 32.3.0
### Minor Changes
- [cli] Support northstar users ([#10535](https://github.com/vercel/vercel/pull/10535))
### Patch Changes
- Internal variants ([#10549](https://github.com/vercel/vercel/pull/10549))
- [speed insights] Prepare for migration to new speed insights package ([#10500](https://github.com/vercel/vercel/pull/10500))
- Updated dependencies [[`b0898a665`](https://github.com/vercel/vercel/commit/b0898a66591d5296dc38ffcf0e8345c9338b72f3), [`10d4e51ac`](https://github.com/vercel/vercel/commit/10d4e51ac57b76f05ddc0bf3adf220e2490244fc), [`decdf27fb`](https://github.com/vercel/vercel/commit/decdf27fb5ca914fe50a9320c4fd50ef79d2fbb3), [`f5ca497b7`](https://github.com/vercel/vercel/commit/f5ca497b7522a2dad637cef238da9716ac133057), [`ab329f0fe`](https://github.com/vercel/vercel/commit/ab329f0fe88e9cb72607d0cba41f5e168d77e077), [`d0d052011`](https://github.com/vercel/vercel/commit/d0d0520111264434d57d5920de0f622f6a2588dc), [`9bb3067de`](https://github.com/vercel/vercel/commit/9bb3067de28be77f3ce268a31a7aa6184836dfb1)]:
- @vercel/static-build@2.0.7
- @vercel/node@3.0.6
- @vercel/build-utils@7.2.1
- @vercel/next@4.0.7
- @vercel/python@4.0.2
- @vercel/redwood@2.0.3
- @vercel/remix-builder@2.0.7
- @vercel/go@3.0.2
## 32.2.5
### Patch Changes
- Updated dependencies [[`849eedf0f`](https://github.com/vercel/vercel/commit/849eedf0f2841211e4175d374f1cf01330bf9611), [`f6f16b034`](https://github.com/vercel/vercel/commit/f6f16b0347bac9f5c33c79ccb1fb9fd9d254cae5), [`3035e18fb`](https://github.com/vercel/vercel/commit/3035e18fb67dfe7031e235a74136a41948f86d5a), [`cb784aeb9`](https://github.com/vercel/vercel/commit/cb784aeb9c9e4eddf1c65b61849a87edb1117af1)]:
- @vercel/next@4.0.6
- @vercel/remix-builder@2.0.6
## 32.2.4
### Patch Changes
- Add support for bun detection in monorepo ([#10511](https://github.com/vercel/vercel/pull/10511))
- Updated dependencies [[`1b6f3a0f6`](https://github.com/vercel/vercel/commit/1b6f3a0f6534f71c7486a4e33ac199f1da330626)]:
- @vercel/static-build@2.0.6
## 32.2.3
### Patch Changes
- Updated dependencies [[`083aad448`](https://github.com/vercel/vercel/commit/083aad448e45edae296da3201eec9f890a01d22d)]:
- @vercel/next@4.0.5
## 32.2.2
### Patch Changes
- Updated dependencies [[`7a0fed970`](https://github.com/vercel/vercel/commit/7a0fed970c39cb8f4df70544ded3284d3538b06a), [`2f461a8b0`](https://github.com/vercel/vercel/commit/2f461a8b0bcbdd05da0516395c2905c2d0242682), [`1bab21026`](https://github.com/vercel/vercel/commit/1bab21026ec0bb8a4a8fbeac3d6e4a197f1030fd)]:
- @vercel/next@4.0.4
- @vercel/remix-builder@2.0.5
## 32.2.1
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "vercel",
"version": "32.4.0",
"version": "32.2.1",
"preferGlobal": true,
"license": "Apache-2.0",
"description": "The command-line interface for Vercel",
@@ -16,7 +16,7 @@
"test-e2e": "rimraf test/fixtures/integration && pnpm test test/integration-1.test.ts test/integration-2.test.ts test/integration-3.test.ts",
"test-dev": "pnpm test test/dev/",
"coverage": "codecov",
"build": "node scripts/build.mjs",
"build": "ts-node ./scripts/build.ts",
"dev": "ts-node ./src/index.ts"
},
"bin": {
@@ -24,24 +24,23 @@
"vercel": "./dist/index.js"
},
"files": [
"dist"
"dist",
"scripts/preinstall.js"
],
"engines": {
"node": ">= 16"
},
"dependencies": {
"@vercel/build-utils": "7.2.2",
"@vercel/fun": "1.1.0",
"@vercel/go": "3.0.3",
"@vercel/build-utils": "7.2.0",
"@vercel/go": "3.0.1",
"@vercel/hydrogen": "1.0.1",
"@vercel/next": "4.0.9",
"@vercel/node": "3.0.7",
"@vercel/python": "4.0.2",
"@vercel/redwood": "2.0.4",
"@vercel/remix-builder": "2.0.9",
"@vercel/next": "4.0.3",
"@vercel/node": "3.0.5",
"@vercel/python": "4.0.1",
"@vercel/redwood": "2.0.2",
"@vercel/remix-builder": "2.0.4",
"@vercel/ruby": "2.0.2",
"@vercel/static-build": "2.0.8",
"chokidar": "3.3.1"
"@vercel/static-build": "2.0.5"
},
"devDependencies": {
"@alex_neo/jest-expect-message": "1.0.5",
@@ -87,12 +86,15 @@
"@types/yauzl-promise": "2.1.0",
"@vercel-internals/constants": "1.0.4",
"@vercel-internals/get-package-json": "1.0.0",
"@vercel-internals/types": "1.0.12",
"@vercel/client": "13.0.5",
"@vercel-internals/types": "1.0.10",
"@vercel/client": "13.0.3",
"@vercel/error-utils": "2.0.1",
"@vercel/frameworks": "2.0.2",
"@vercel/fs-detectors": "5.1.1",
"@vercel/frameworks": "2.0.1",
"@vercel/fs-detectors": "5.0.2",
"@vercel/fun": "1.1.0",
"@vercel/ncc": "0.24.0",
"@vercel/routing-utils": "3.0.0",
"@zeit/source-map-support": "0.6.2",
"ajv": "6.12.2",
"alpha-sort": "2.0.1",
"ansi-escapes": "4.3.2",
@@ -104,8 +106,10 @@
"bytes": "3.0.0",
"chalk": "4.1.0",
"chance": "1.1.7",
"chokidar": "3.3.1",
"cli-table3": "0.6.3",
"codecov": "3.8.2",
"cpy": "7.2.0",
"date-fns": "1.29.0",
"debug": "3.1.0",
"dot": "1.1.3",

View File

@@ -1,54 +0,0 @@
import { join } from 'node:path';
import { copyFileSync, readFileSync, writeFileSync } from 'node:fs';
import { esbuild } from '../../../utils/build.mjs';
import { compileDevTemplates } from './compile-templates.mjs';
const repoRoot = new URL('../', import.meta.url);
function createConstants() {
const filename = new URL('src/util/constants.ts', repoRoot);
const contents = `// This file is auto-generated
export const GA_TRACKING_ID: string | undefined = ${envToString(
'GA_TRACKING_ID'
)};
export const SENTRY_DSN: string | undefined = ${envToString('SENTRY_DSN')};
`;
writeFileSync(filename, contents, 'utf8');
}
function envToString(key) {
const value = process.env[key];
if (value) {
return JSON.stringify(value);
}
}
// Read the secrets from GitHub Actions and generate a file.
// During local development, these secrets will be empty.
createConstants();
// Compile the `doT.js` template files for `vercel dev`
await compileDevTemplates();
const pkgPath = join(process.cwd(), 'package.json');
const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
const externals = Object.keys(pkg.dependencies || {});
await esbuild({
bundle: true,
external: externals,
});
// Copy a few static files into `dist`
const distRoot = new URL('dist/', repoRoot);
copyFileSync(
new URL('src/util/projects/VERCEL_DIR_README.txt', repoRoot),
new URL('VERCEL_DIR_README.txt', distRoot)
);
copyFileSync(
new URL('src/util/dev/builder-worker.js', repoRoot),
new URL('builder-worker.js', distRoot)
);
copyFileSync(
new URL('src/util/get-latest-version/get-latest-worker.js', repoRoot),
new URL('get-latest-worker.js', distRoot)
);

View File

@@ -0,0 +1,100 @@
import cpy from 'cpy';
import execa from 'execa';
import { join } from 'path';
import { remove, readJSON, writeFile } from 'fs-extra';
const dirRoot = join(__dirname, '..');
const distRoot = join(dirRoot, 'dist');
async function createConstants() {
console.log('Creating constants.ts');
const filename = join(dirRoot, 'src/util/constants.ts');
const contents = `// This file is auto-generated
export const GA_TRACKING_ID: string | undefined = ${envToString(
'GA_TRACKING_ID'
)};
export const SENTRY_DSN: string | undefined = ${envToString('SENTRY_DSN')};
`;
await writeFile(filename, contents, 'utf8');
}
function envToString(key: string) {
const value = process.env[key];
if (!value) {
console.log(`- Constant ${key} is not assigned`);
}
return JSON.stringify(value);
}
async function main() {
// Read the secrets from GitHub Actions and generate a file.
// During local development, these secrets will be empty.
await createConstants();
// `vercel dev` uses chokidar to watch the filesystem, but opts-out of the
// `fsevents` feature using `useFsEvents: false`, so delete the module here so
// that it is not compiled by ncc, which makes the npm package size larger
// than necessary.
await remove(join(dirRoot, '../../node_modules/fsevents'));
// Compile the `doT.js` template files for `vercel dev`
console.log();
await execa(process.execPath, [join(__dirname, 'compile-templates.js')], {
stdio: 'inherit',
});
const pkg = await readJSON(join(dirRoot, 'package.json'));
const dependencies = Object.keys(pkg?.dependencies ?? {});
// Do the initial `ncc` build
console.log('Dependencies:', dependencies);
const externs: Array<string> = [];
for (const dep of dependencies) {
externs.push('--external', dep);
}
const args = ['ncc', 'build', 'src/index.ts', ...externs];
await execa('pnpm', args, { stdio: 'inherit', cwd: dirRoot });
// `ncc` has some issues with `@vercel/fun`'s runtime files:
// - Executable bits on the `bootstrap` files appear to be lost:
// https://github.com/vercel/ncc/pull/182
// - The `bootstrap.js` asset does not get copied into the output dir:
// https://github.com/vercel/ncc/issues/278
//
// Aside from those issues, all the same files from the `runtimes` directory
// should be copied into the output runtimes dir, specifically the `index.js`
// files (correctly) do not get copied into the output bundle because they
// get compiled into the final ncc bundle file, however, we want them to be
// present in the npm package because the contents of those files are involved
// with `fun`'s cache invalidation mechanism and they need to be shasum'd.
const runtimes = join(dirRoot, 'node_modules/@vercel/fun/dist/src/runtimes');
await cpy('**/*', join(distRoot, 'runtimes'), {
parents: true,
cwd: runtimes,
});
// Band-aid to bundle stuff that `ncc` neglects to bundle
await cpy(join(dirRoot, 'src/util/projects/VERCEL_DIR_README.txt'), distRoot);
await cpy(join(dirRoot, 'src/util/dev/builder-worker.js'), distRoot);
await cpy(
join(dirRoot, 'src/util/get-latest-version/get-latest-worker.js'),
distRoot
);
console.log('Finished building Vercel CLI');
}
process.on('unhandledRejection', (reason: any, promise: Promise<any>) => {
console.error('Unhandled Rejection at:', promise, 'reason:', reason);
process.exit(1);
});
process.on('uncaughtException', err => {
console.error('Uncaught Exception:');
console.error(err);
process.exit(1);
});
main().catch(err => {
console.error(err);
process.exit(1);
});

View File

@@ -0,0 +1,88 @@
const execa = require('execa');
const { join } = require('path');
const { readFile, writeFile, readdir, remove } = require('fs-extra');
async function main() {
const dirRoot = join(__dirname, '..');
// Compile the `doT.js` template files for `vercel dev`
const templatesDir = join(dirRoot, 'src/util/dev/templates');
const dotPacker = join(dirRoot, '../../node_modules/dot/bin/dot-packer');
await execa(process.execPath, [dotPacker], {
cwd: templatesDir,
stdio: 'inherit',
});
const files = await readdir(templatesDir);
const compiledFiles = files.filter(f => f.endsWith('.js'));
// Prettier
console.log('\nMaking the compiled template functions prettier...');
const prettier = join(dirRoot, '../../node_modules/prettier/bin-prettier.js');
await execa(
process.execPath,
[prettier, '--write', '--single-quote', ...compiledFiles],
{
cwd: templatesDir,
stdio: 'inherit',
}
);
console.log('\nConverting template functions to TypeScript');
for (const file of compiledFiles) {
const start = Date.now();
const fnPath = join(templatesDir, file);
const tsPath = fnPath.replace(/\.js$/, '.ts');
const def = await readFile(fnPath.replace(/\.js$/, '.tsdef'), 'utf8');
const interfaceName = def.match(/interface (\w+)/)[1];
const lines = require(fnPath).toString().split('\n');
let errorHtmlStart = -1;
let errorHtmlEnd = -1;
for (let i = 0; i < lines.length; i++) {
const line = lines[i];
if (errorHtmlStart === -1 && line.includes('encodeHTML')) {
errorHtmlStart = i;
} else if (errorHtmlEnd === -1 && line.includes(')();')) {
errorHtmlEnd = i;
}
if (/\bvar\b/.test(line)) {
lines[i] = line.replace(/\bvar\b/g, 'let');
}
}
lines.splice(errorHtmlStart, errorHtmlEnd);
lines[0] = `export default ${lines[0].replace(
'(it)',
`(it: ${interfaceName}): string`
)}`;
lines.unshift(
"import encodeHTML from 'escape-html';",
'',
...def.split('\n')
);
await Promise.all([writeFile(tsPath, lines.join('\n')), remove(fnPath)]);
console.log(
`${file} -> ${file.replace(/\.js$/, '.ts')} (${Date.now() - start}ms)`
);
}
}
process.on('unhandledRejection', err => {
console.error('Unhandled Rejection:');
console.error(err);
process.exit(1);
});
process.on('uncaughtException', err => {
console.error('Uncaught Exception:');
console.error(err);
process.exit(1);
});
main().catch(err => {
console.error(err);
process.exit(1);
});

View File

@@ -1,63 +0,0 @@
import execa from 'execa';
import { fileURLToPath } from 'node:url';
import { readFile, writeFile, readdir, unlink } from 'node:fs/promises';
export async function compileDevTemplates() {
const dirRoot = new URL('../', import.meta.url);
// Compile the `doT.js` template files for `vercel dev`
const templatesDir = new URL('src/util/dev/templates/', dirRoot);
const dotPacker = fileURLToPath(
new URL('../../node_modules/dot/bin/dot-packer', dirRoot)
);
await execa(process.execPath, [dotPacker], {
cwd: templatesDir,
stdio: ['ignore', 'ignore', 'inherit'],
});
const files = await readdir(templatesDir);
const compiledFiles = files.filter(f => f.endsWith('.js'));
for (const file of compiledFiles) {
const fnPath = new URL(file, templatesDir);
const tsPath = fnPath.href.replace(/\.js$/, '.ts');
const def = await readFile(
new URL(fnPath.href.replace(/\.js$/, '.tsdef')),
'utf8'
);
const interfaceName = def.match(/interface (\w+)/)[1];
const { default: fn } = await import(fnPath);
const lines = fn.toString().split('\n');
let errorHtmlStart = -1;
let errorHtmlEnd = -1;
for (let i = 0; i < lines.length; i++) {
const line = lines[i];
if (errorHtmlStart === -1 && line.includes('encodeHTML')) {
errorHtmlStart = i;
} else if (errorHtmlEnd === -1 && line.includes(')();')) {
errorHtmlEnd = i;
}
if (/\bvar\b/.test(line)) {
lines[i] = line.replace(/\bvar\b/g, 'let');
}
}
lines.splice(errorHtmlStart, errorHtmlEnd);
lines[0] = `export default ${lines[0].replace(
'(it)',
`(it: ${interfaceName}): string`
)}`;
lines.unshift(
"import encodeHTML from 'escape-html';",
'',
...def.split('\n')
);
await Promise.all([
writeFile(new URL(tsPath), lines.join('\n')),
unlink(fnPath),
]);
}
}

View File

@@ -27,7 +27,7 @@ export const help = () => `
pull [path] Pull your Project Settings from the cloud
redeploy [url|id] Rebuild and deploy a previous deployment.
rollback [url|id] Quickly revert back to a previous deployment
switch [scope] Switches between different scopes
switch [scope] Switches between teams and your personal account
${chalk.dim('Advanced')}

View File

@@ -21,7 +21,6 @@ import {
NowBuildError,
Cron,
validateNpmrc,
Flag,
} from '@vercel/build-utils';
import {
detectBuilders,
@@ -94,7 +93,6 @@ interface BuildOutputConfig {
version: string;
};
crons?: Cron[];
flags?: Flag[];
}
/**
@@ -428,23 +426,6 @@ async function doBuild(
const ops: Promise<Error | void>[] = [];
const dependencies = [
...Object.keys(pkg?.dependencies ?? {}),
...Object.keys(pkg?.devDependencies ?? {}),
];
const isUsingSpeedInsights = dependencies.some(
d => d === '@vercel/speed-insights'
);
if (isUsingSpeedInsights && process.env.VERCEL_ANALYTICS_ID) {
output.warn(
`The \`VERCEL_ANALYTICS_ID\` environment variable is deprecated and will be removed in a future release. Please remove it from your environment variables`
);
delete process.env.VERCEL_ANALYTICS_ID;
}
// Write the `detectedBuilders` result to output dir
const buildsJsonBuilds = new Map<Builder, SerializedBuilder>(
builds.map(build => {
@@ -646,7 +627,6 @@ async function doBuild(
const mergedWildcard = mergeWildcard(buildResults.values());
const mergedOverrides: Record<string, PathOverride> =
overrides.length > 0 ? Object.assign({}, ...overrides) : undefined;
const mergedFlags = mergeFlags(buildResults.values());
const framework = await getFramework(cwd, buildResults);
@@ -660,7 +640,6 @@ async function doBuild(
overrides: mergedOverrides,
framework,
crons: mergedCrons,
flags: mergedFlags,
};
await fs.writeJSON(join(outputDir, 'config.json'), config, { spaces: 2 });
@@ -795,15 +774,3 @@ function mergeWildcard(
}
return wildcard;
}
function mergeFlags(
buildResults: Iterable<BuildResult | BuildOutputConfig>
): BuildResultV2Typical['flags'] {
return Array.from(buildResults).flatMap(result => {
if ('flags' in result) {
return result.flags ?? [];
}
return [];
});
}

View File

@@ -43,7 +43,10 @@ async function ls(
}
// Get the list of certificates
const { certs, pagination } = await getCerts(client, ...paginationOptions);
const { certs, pagination } = await getCerts(
client,
...paginationOptions
).catch(err => err);
output.log(
`${

View File

@@ -72,7 +72,7 @@ export const domainsCommand: Command = {
},
{
name: 'move',
description: 'Move a domain to another scope',
description: 'Move a domain to another user or team',
arguments: [
{
name: 'name',

View File

@@ -53,12 +53,6 @@ export default async function move(
const teams = await getTeams(client);
const matchId = await findDestinationMatch(destination, user, teams);
if (matchId && matchId === user.id && user.version === 'northstar') {
output.error(`You may not move your domain to your user account.`);
return 1;
}
if (!matchId && !opts['--yes']) {
output.warn(
`You're not a member of ${param(destination)}. ` +

View File

@@ -55,12 +55,6 @@ function tryReadHeadSync(path: string, length: number) {
}
}
const VARIABLES_TO_IGNORE = [
'VERCEL_ANALYTICS_ID',
'VERCEL_SPEED_INSIGHTS_ID',
'VERCEL_WEB_ANALYTICS_ID',
];
export default async function pull(
client: Client,
link: ProjectLinked,
@@ -137,7 +131,6 @@ export default async function pull(
CONTENTS_PREFIX +
Object.keys(records)
.sort()
.filter(key => !VARIABLES_TO_IGNORE.includes(key))
.map(key => `${key}="${escapeValue(records[key])}"`)
.join('\n') +
'\n';

View File

@@ -19,14 +19,10 @@ import Client from '../../util/client';
import { LoginResult } from '../../util/login/types';
import { help } from '../help';
import { loginCommand } from './command';
import { updateCurrentTeamAfterLogin } from '../../util/login/update-current-team-after-login';
export default async function login(client: Client): Promise<number> {
const { output } = client;
// user is not currently authenticated on this machine
const isInitialLogin = !client.authConfig.token;
const argv = getArgs(client.argv.slice(2), {
'--oob': Boolean,
'--github': Boolean,
@@ -71,24 +67,20 @@ export default async function login(client: Client): Promise<number> {
return result;
}
// If the token was upgraded (not a new login), then don't modify
// the current scope.
if (!client.authConfig.token) {
if (result.teamId) {
// SSO login, so set the current scope to the appropriate Team
client.config.currentTeam = result.teamId;
} else {
delete client.config.currentTeam;
}
}
// Save the user's authentication token to the configuration file.
client.authConfig.token = result.token;
if (result.teamId) {
client.config.currentTeam = result.teamId;
} else {
delete client.config.currentTeam;
}
// If we have a brand new login, update `currentTeam`
if (isInitialLogin) {
await updateCurrentTeamAfterLogin(
client,
output,
client.config.currentTeam
);
}
writeToAuthConfigFile(client.authConfig);
writeToConfigFile(client.config);

View File

@@ -3,7 +3,7 @@ import { packageName } from '../../util/pkg-name';
export const logoutCommand: Command = {
name: 'logout',
description: 'Logout the current authenticated user.',
description: 'Logout the current authenticated user or team.',
arguments: [],
options: [],
examples: [

View File

@@ -13,7 +13,7 @@ export const projectCommand: Command = {
subcommands: [
{
name: 'ls',
description: 'Show all projects in the selected scope',
description: 'Show all projects in the selected team/user',
arguments: [],
options: [],
examples: [],

View File

@@ -39,12 +39,11 @@ export default async function list(client: Client): Promise<number> {
apiVersion: 2,
});
let { currentTeam } = config;
const accountIsCurrent = !currentTeam;
output.spinner('Fetching user information');
const user = await getUser(client);
const accountIsCurrent = !currentTeam && user.version !== 'northstar';
if (accountIsCurrent) {
currentTeam = user.id;
}
@@ -56,14 +55,12 @@ export default async function list(client: Client): Promise<number> {
current: id === currentTeam ? chars.tick : '',
}));
if (user.version !== 'northstar') {
teamList.unshift({
id: user.id,
name: user.email,
value: user.username || user.email,
current: accountIsCurrent ? chars.tick : '',
});
}
teamList.unshift({
id: user.id,
name: user.email,
value: user.username || user.email,
current: accountIsCurrent ? chars.tick : '',
});
// Bring the current Team to the beginning of the list
if (!accountIsCurrent) {
@@ -74,21 +71,18 @@ export default async function list(client: Client): Promise<number> {
// Printing
output.stopSpinner();
client.stdout.write('\n'); // empty line
console.log(); // empty line
table(
['', 'id', 'email / name'],
teamList.map(team => [team.current, team.value, team.name]),
[1, 5],
(str: string) => {
client.stdout.write(str);
}
[1, 5]
);
if (pagination?.count === 20) {
const flags = getCommandFlags(argv, ['_', '--next', '-N', '-d']);
const nextCmd = `${packageName} teams ls${flags} --next ${pagination.next}`;
client.stdout.write('\n'); // empty line
console.log(); // empty line
output.log(`To display the next page run ${cmd(nextCmd)}`);
}

View File

@@ -70,21 +70,14 @@ export default async function main(client: Client, desiredSlug?: string) {
suffix += ` ${emoji('locked')}`;
}
const personalAccountChoice =
user.version === 'northstar'
? []
: [
{ separator: 'Personal Account' },
{
name: `${user.name || user.email} (${user.username})${suffix}`,
value: user.username,
short: user.username,
selected: personalScopeSelected,
},
];
const choices = [
...personalAccountChoice,
{ separator: 'Personal Account' },
{
name: `${user.name || user.email} (${user.username})${suffix}`,
value: user.username,
short: user.username,
selected: personalScopeSelected,
},
{ separator: 'Teams' },
...teamChoices,
];
@@ -104,11 +97,6 @@ export default async function main(client: Client, desiredSlug?: string) {
}
if (desiredSlug === user.username || desiredSlug === user.email) {
if (user.version === 'northstar') {
output.error('You cannot set your Personal Account as the scope.');
return 1;
}
// Switch to user's personal account
if (personalScopeSelected) {
output.log('No changes made');

View File

@@ -14,6 +14,7 @@ try {
import { join } from 'path';
import { existsSync } from 'fs';
import sourceMap from '@zeit/source-map-support';
import { mkdirp } from 'fs-extra';
import chalk from 'chalk';
import epipebomb from 'epipebomb';
@@ -55,7 +56,6 @@ import { ProxyAgent } from 'proxy-agent';
import box from './util/output/box';
import { execExtension } from './util/extension/exec';
import { help } from './args';
import { updateCurrentTeamAfterLogin } from './util/login/update-current-team-after-login';
const VERCEL_DIR = getGlobalPathConfig();
const VERCEL_CONFIG_PATH = configFiles.getConfigFilePath();
@@ -65,6 +65,8 @@ const GLOBAL_COMMANDS = new Set(['help']);
epipebomb();
sourceMap.install();
// Configure the error reporting system
Sentry.init({
dsn: SENTRY_DSN,
@@ -335,12 +337,17 @@ const main = async () => {
return result;
}
if (result.teamId) {
// SSO login, so set the current scope to the appropriate Team
client.config.currentTeam = result.teamId;
} else {
delete client.config.currentTeam;
}
// When `result` is a string it's the user's authentication token.
// It needs to be saved to the configuration file.
client.authConfig.token = result.token;
await updateCurrentTeamAfterLogin(client, output, result.teamId);
configFiles.writeToAuthConfigFile(client.authConfig);
configFiles.writeToConfigFile(client.config);
@@ -440,11 +447,6 @@ const main = async () => {
}
if (user.id === scope || user.email === scope || user.username === scope) {
if (user.version === 'northstar') {
output.error('You cannot set your Personal Account as the scope.');
return 1;
}
delete client.config.currentTeam;
} else {
let teams = [];

View File

@@ -41,7 +41,7 @@ export async function initCorepack({
const pkgManagerName = pkg.packageManager.split('@')[0];
// We must explicitly call `corepack enable npm` since `corepack enable`
// doesn't work with npm. See https://github.com/nodejs/corepack/pull/24
// Also, `corepack enable` is too broad and will change the version of
// Also, `corepack enable` is too broad and will change the verison of
// yarn & pnpm even though those versions are not specified by the user.
// See https://github.com/nodejs/corepack#known-good-releases
// Finally, we use `--install-directory` so we can cache the result to

View File

@@ -3,7 +3,6 @@ import plural from 'pluralize';
import npa from 'npm-package-arg';
import { satisfies } from 'semver';
import { dirname, join } from 'path';
import { createRequire } from 'module';
import { mkdirp, outputJSON, readJSON, symlink } from 'fs-extra';
import { isStaticRuntime } from '@vercel/fs-detectors';
import { BuilderV2, BuilderV3, PackageJson } from '@vercel/build-utils';
@@ -29,9 +28,6 @@ type ResolveBuildersResult =
| { buildersToAdd: Set<string> }
| { builders: Map<string, BuilderWithPkg> };
// Get a real `require()` reference that esbuild won't mutate
const require_ = createRequire(__filename);
/**
* Imports the specified Vercel Builders, installing any missing ones
* into `.vercel/builders` if necessary.
@@ -119,9 +115,10 @@ export async function resolveBuilders(
// If `pkgPath` wasn't found in `.vercel/builders` then try as a CLI local
// dependency. `require.resolve()` will throw if the Builder is not a CLI
// dep, in which case we'll install it into `.vercel/builders`.
pkgPath = require_.resolve(`${name}/package.json`, {
// NOTE: `eval('require')` is necessary to avoid bad transpilation to `__webpack_require__`
pkgPath = eval('require').resolve(`${name}/package.json`, {
paths: [__dirname],
});
}) as string;
builderPkg = await readJSON(pkgPath);
}
@@ -162,7 +159,8 @@ export async function resolveBuilders(
const path = join(dirname(pkgPath), builderPkg.main || 'index.js');
const builder = require_(path);
// NOTE: `eval('require')` is necessary to avoid bad transpilation to `__webpack_require__`
const builder = eval('require')(path);
builders.set(spec, {
builder,

View File

@@ -978,6 +978,7 @@ export default class DevServer {
// log address without trailing slash to maintain backwards compatibility
addressFormatted = addressFormatted.replace(/\/$/, '');
}
this.output.ready(`Available at ${link(addressFormatted)}`);
}
@@ -1450,7 +1451,7 @@ export default class DevServer {
);
const middlewareBody = await middlewareRes.buffer();
console.error('Here?');
if (middlewareRes.status === 500 && middlewareBody.byteLength === 0) {
await this.sendError(
req,

View File

@@ -59,7 +59,7 @@ export class TeamDeleted extends NowError<'TEAM_DELETED', {}> {
constructor() {
super({
code: 'TEAM_DELETED',
message: `Your team was deleted or you were removed from the team. You can switch to a different one using ${getCommandName(
message: `Your team was deleted. You can switch to a different one using ${getCommandName(
`switch`
)}.`,
meta: {},

View File

@@ -10,8 +10,8 @@
* the world, but something to be aware of.
*
* IMPORTANT! This file must NOT depend on any 3rd party dependencies. This
* file is NOT bundled by `esbuild` and thus any 3rd party dependencies will
* never be available.
* file is NOT bundled by `ncc` and thus any 3rd party dependencies will never
* be available.
*/
const https = require('https');

View File

@@ -15,12 +15,9 @@ export default async function getScope(
const user = await getUser(client);
let contextName = user.username || user.email;
let team: Team | null = null;
const defaultTeamId =
user.version === 'northstar' ? user.defaultTeamId : undefined;
const currentTeamOrDefaultTeamId = client.config.currentTeam || defaultTeamId;
if (currentTeamOrDefaultTeamId && opts.getTeam !== false) {
team = await getTeamById(client, currentTeamOrDefaultTeamId);
if (client.config.currentTeam && opts.getTeam !== false) {
team = await getTeamById(client, client.config.currentTeam);
if (!team) {
throw new TeamDeleted();

View File

@@ -25,18 +25,11 @@ export default async function selectOrg(
output.stopSpinner();
}
const personalAccountChoice =
user.version === 'northstar'
? []
: [
{
name: user.name || user.username,
value: { type: 'user', id: user.id, slug: user.username },
} as const,
];
const choices: Choice[] = [
...personalAccountChoice,
{
name: user.name || user.username,
value: { type: 'user', id: user.id, slug: user.username },
},
...teams.map<Choice>(team => ({
name: team.name || team.slug,
value: { type: 'team', id: team.id, slug: team.slug },

View File

@@ -1,29 +0,0 @@
import type Client from '../client';
import type { Output } from '../output';
import getUser from '../get-user';
// NOTE: `client.authConfig.token` must be set before calling this
export async function updateCurrentTeamAfterLogin(
client: Client,
output: Output,
ssoTeamId?: string
) {
if (ssoTeamId) {
client.config.currentTeam = ssoTeamId;
} else {
let user = null;
try {
user = await getUser(client);
} catch (err: unknown) {
// Shouldn't happen since we just logged in
output.error('Failed to fetch the logged in user. Please try again.');
return 1;
}
if (user.version === 'northstar' && user.defaultTeamId) {
client.config.currentTeam = user.defaultTeamId;
} else {
delete client.config.currentTeam;
}
}
}

View File

@@ -9,8 +9,7 @@ const printLine = (data: string[], sizes: number[]) =>
export default function table(
fieldNames: string[] = [],
data: string[][] = [],
margins: number[] = [],
print: (str: string) => void
margins: number[] = []
) {
// Compute size of each column
const sizes = data
@@ -27,12 +26,10 @@ export default function table(
.map((size, i) => (i < margins.length && size + margins[i]) || size);
// Print header
print(chalk.grey(printLine(fieldNames, sizes)));
print('\n');
console.log(chalk.grey(printLine(fieldNames, sizes)));
// Print content
for (const row of data) {
print(printLine(row, sizes));
print('\n');
console.log(printLine(row, sizes));
}
}

View File

@@ -415,24 +415,6 @@ module.exports = async function prepare(session, binaryPath, tmpFixturesDir) {
projectId: 'QmRoBYhejkkmssotLZr8tWgewPdPcjYucYUNERFbhJrRNi',
}),
},
'vc-build-speed-insights': {
'.vercel/project.json': JSON.stringify({
orgId: '.',
projectId: '.',
settings: {
framework: null,
installCommand: 'echo "skipping install"',
},
}),
'package.json': JSON.stringify({
scripts: {
build: 'mkdir -p public && echo hi > public/index.txt',
},
dependencies: {
'@vercel/speed-insights': '0.0.1',
},
}),
},
'vc-build-static-build': {
'.vercel/project.json': JSON.stringify({
orgId: '.',

View File

@@ -16,6 +16,7 @@ import {
import formatOutput from './helpers/format-output';
import type http from 'http';
import type { CLIProcess } from './helpers/types';
import type {} from './helpers/types';
const TEST_TIMEOUT = 3 * 60 * 1000;
jest.setTimeout(TEST_TIMEOUT);
@@ -104,8 +105,6 @@ function mockLoginApi(req: http.IncomingMessage, res: http.ServerResponse) {
query.email === email
) {
res.end(JSON.stringify({ token }));
} else if (method === 'GET' && pathname === '/v2/user') {
res.end(JSON.stringify({ user: { email } }));
} else {
res.statusCode = 405;
res.end(JSON.stringify({ code: 'method_not_allowed' }));

View File

@@ -79,8 +79,6 @@ function mockLoginApi(req: http.IncomingMessage, res: http.ServerResponse) {
query.email === email
) {
res.end(JSON.stringify({ token }));
} else if (method === 'GET' && pathname === '/v2/user') {
res.end(JSON.stringify({ user: { email } }));
} else {
res.statusCode = 405;
res.end(JSON.stringify({ code: 'method_not_allowed' }));
@@ -1154,22 +1152,6 @@ test('[vc build] should build project with `@vercel/static-build`', async () =>
expect(builds.builds[0].use).toBe('@vercel/static-build');
});
test('[vc build] should build project with `@vercel/speed-insights`', async () => {
try {
process.env.VERCEL_ANALYTICS_ID = '123';
const directory = await setupE2EFixture('vc-build-speed-insights');
const output = await execCli(binaryPath, ['build'], { cwd: directory });
expect(output.exitCode, formatOutput(output)).toBe(0);
expect(output.stderr).toContain('Build Completed in .vercel/output');
expect(output.stderr).toContain(
'The `VERCEL_ANALYTICS_ID` environment variable is deprecated and will be removed in a future release. Please remove it from your environment variables'
);
} finally {
delete process.env.VERCEL_ANALYTICS_ID;
}
});
test('[vc build] should not include .vercel when distDir is "."', async () => {
const directory = await setupE2EFixture('static-build-dist-dir');
const output = await execCli(binaryPath, ['build'], { cwd: directory });

View File

@@ -89,8 +89,6 @@ function mockLoginApi(req: http.IncomingMessage, res: http.ServerResponse) {
query.email === email
) {
res.end(JSON.stringify({ token }));
} else if (method === 'GET' && pathname === '/v2/user') {
res.end(JSON.stringify({ user: { email } }));
} else {
res.statusCode = 405;
res.end(JSON.stringify({ code: 'method_not_allowed' }));

View File

@@ -40,15 +40,3 @@ export function useDomains() {
});
});
}
export function useDomain(postfix: string) {
client.scenario.get(
`/v4/domains/${encodeURIComponent(`example-${postfix}.com`)}`,
(req, res) => {
const domain = createDomain(postfix);
res.json({
domain,
});
}
);
}

View File

@@ -7,12 +7,10 @@ export function useTeams(
failMissingToken?: boolean;
failInvalidToken?: boolean;
failNoAccess?: boolean;
apiVersion?: number;
} = {
failMissingToken: false,
failInvalidToken: false,
failNoAccess: false,
apiVersion: 1,
}
) {
const id = teamId || chance().guid();
@@ -61,11 +59,11 @@ export function useTeams(
});
}
client.scenario.get(`/v${options.apiVersion}/teams`, (_req, res) => {
client.scenario.get('/v1/teams', (_req, res) => {
res.json({
teams,
});
});
return options.apiVersion === 2 ? { teams } : teams;
return teams;
}

View File

@@ -1,14 +1,12 @@
import chance from 'chance';
import { client } from './client';
import type { User } from '@vercel-internals/types';
export function useUser(additionalAttrs: Partial<User> = {}) {
export function useUser() {
const user = {
id: chance().guid(),
email: chance().email(),
name: chance().name(),
username: chance().first().toLowerCase(),
...additionalAttrs,
};
client.scenario.get('/v2/user', (_req, res) => {
res.json({

View File

@@ -1,173 +0,0 @@
import type http from 'http';
import fs from 'fs-extra';
import path from 'path';
import { parse as parseUrl } from 'url';
import { execCli } from './helpers/exec';
import waitForPrompt from './helpers/wait-for-prompt';
import getGlobalDir from './helpers/get-global-dir';
import { listTmpDirs } from './helpers/get-tmp-dir';
import formatOutput from './helpers/format-output';
import { User } from '@vercel-internals/types';
const binaryPath = path.resolve(__dirname, `../scripts/start.js`);
function getGlobalConfigPath() {
return path.join(getGlobalDir(), 'config.json');
}
function getConfigAuthPath() {
return path.join(getGlobalDir(), 'auth.json');
}
beforeEach(async () => {
try {
await fs.remove(getGlobalConfigPath());
await fs.remove(getConfigAuthPath());
} catch (err) {
process.exit(1);
}
});
afterEach(() => {
if (localApiServer) {
localApiServer.close();
}
const allTmpDirs = listTmpDirs();
for (const tmpDir of allTmpDirs) {
tmpDir.removeCallback();
}
});
function mockApi(user: Partial<User>) {
return function (req: http.IncomingMessage, res: http.ServerResponse) {
const { url = '/', method } = req;
let { pathname = '/', query = {} } = parseUrl(url, true);
const securityCode = 'Bears Beets Battlestar Galactica';
res.setHeader('content-type', 'application/json');
if (
method === 'POST' &&
pathname === '/registration' &&
query.mode === 'login'
) {
res.end(JSON.stringify({ token: 'test', securityCode }));
} else if (
method === 'GET' &&
pathname === '/registration/verify' &&
query.email === user.email
) {
res.end(JSON.stringify({ token: 'test' }));
} else if (method === 'GET' && pathname === '/v2/user') {
res.end(JSON.stringify({ user }));
} else {
res.statusCode = 405;
res.end(JSON.stringify({ code: 'method_not_allowed' }));
}
};
}
let localApiServer: any;
function setupLocalApiServer(user: Partial<User>) {
return new Promise<string>(resolve => {
localApiServer = require('http')
.createServer(mockApi(user))
.listen(0, () => {
const { port } = localApiServer.address();
const loginApiUrl = `http://localhost:${port}`;
resolve(loginApiUrl);
});
});
}
async function loginSteps(
vercel: ReturnType<typeof execCli>,
user: Partial<User>
) {
await waitForPrompt(vercel, 'Continue with Email');
vercel.stdin?.write('\x1B[B'); // Down arrow
vercel.stdin?.write('\x1B[B'); // Down arrow
vercel.stdin?.write('\x1B[B'); // Down arrow
vercel.stdin?.write('\r'); // Return key
await waitForPrompt(vercel, 'Enter your email address');
vercel.stdin?.write(user.email);
vercel.stdin?.write('\r');
await waitForPrompt(
vercel,
`Email authentication complete for ${user.email}`
);
return vercel;
}
describe('CLI initialization', () => {
describe('login required before running a command', () => {
describe('non-northstar', () => {
const user = {
id: 'test-id',
username: 'test-username',
email: 'test@example.com',
};
it('should not set currentTeam to defaultTeamId', async () => {
const loginApiUrl = await setupLocalApiServer(user);
const vercel = execCli(
binaryPath,
['domains', 'invalidSubCommand', '--api', loginApiUrl],
{ env: { FORCE_TTY: '1' } }
);
const steps = loginSteps(vercel, user);
await waitForPrompt(vercel, 'Please specify a valid subcommand');
const output = await steps;
expect(output.exitCode, formatOutput(output)).toBe(2);
const config = await fs.readJSON(getGlobalConfigPath());
expect(config.currentTeam).toBeUndefined();
});
});
describe('northstar', () => {
const user = {
id: 'test-id',
username: 'test-username',
email: 'test@example.com',
version: 'northstar',
defaultTeamId: 'test-default-team-id',
};
it('should set currentTeam to defaultTeamId', async () => {
const loginApiUrl = await setupLocalApiServer(user);
const vercel = execCli(
binaryPath,
['domains', 'invalidSubCommand', '--api', loginApiUrl],
{ env: { FORCE_TTY: '1' } }
);
const steps = loginSteps(vercel, user);
await waitForPrompt(vercel, 'Please specify a valid subcommand');
const output = await steps;
expect(output.exitCode, formatOutput(output)).toBe(2);
const config = await fs.readJSON(getGlobalConfigPath());
expect(config.currentTeam).toEqual(user.defaultTeamId);
});
it('should not allow setting user as scope', async () => {
const loginApiUrl = await setupLocalApiServer(user);
const vercel = execCli(
binaryPath,
[
'domains',
'invalidSubCommand',
'--api',
loginApiUrl,
'--scope',
user.username,
],
{ env: { FORCE_TTY: '1' } }
);
const steps = loginSteps(vercel, user);
await waitForPrompt(
vercel,
'You cannot set your Personal Account as the scope.'
);
const output = await steps;
expect(output.exitCode, formatOutput(output)).toBe(1);
});
});
});
});

View File

@@ -21,24 +21,4 @@ describe('certs', () => {
await expect(client.stdout).toOutput('dummy-1.cert');
await expect(exitCodePromise).resolves.toEqual(0);
});
it('should show permission error if user does not have permission', async () => {
useUser();
client.scenario.get('/v4/now/certs', (_req, res) => {
res.status(403).json({
error: {
code: 'forbidden',
message: "You don't have permission to list the domain certificate.",
},
});
});
client.setArgv('certs', 'ls');
const exec = certs(client);
await expect(exec).rejects.toThrow(
"You don't have permission to list the domain certificate."
);
});
});

View File

@@ -1,8 +1,7 @@
import { client } from '../../mocks/client';
import domains from '../../../src/commands/domains';
import { useUser } from '../../mocks/user';
import { useTeams } from '../../mocks/team';
import { useDomain, useDomains } from '../../mocks/domains';
import { useDomains } from '../../mocks/domains';
describe('domains', () => {
it('should list up to 20 domains by default', async () => {
@@ -22,19 +21,4 @@ describe('domains', () => {
await expect(client.stderr).toOutput('example-1.com');
await expect(exitCodePromise).resolves.toEqual(0);
});
describe('northstar', () => {
it('should prevent moving a domain to a user account', async () => {
const { username } = useUser({ version: 'northstar' });
useTeams();
useDomain('northstar');
client.setArgv('domains', 'move', 'example-northstar.com', username);
const exitCodePromise = domains(client);
await expect(client.stderr).toOutput(
`Fetching domain example-northstar.com under ${username}
Error: You may not move your domain to your user account.`
);
await expect(exitCodePromise).resolves.toEqual(1);
});
});
});

View File

@@ -426,46 +426,5 @@ describe('env', () => {
);
expect(gitignoreAfter).toBe(gitignoreBefore);
});
it('should not pull VERCEL_ANALYTICS_ID', async () => {
useUser();
useTeams('team_dummy');
useProject(
{
...defaultProject,
id: 'vercel-env-pull',
name: 'vercel-env-pull',
analytics: {
id: 'VC-ANALYTICS-ID',
enabledAt: Date.now(),
},
},
[
{
type: 'encrypted',
id: '781dt89g8r2h789g',
key: 'VERCEL_ANALYTICS_ID',
value: 'VC-ANALYTICS-ID',
target: ['development'],
configurationId: null,
updatedAt: 1557241361455,
createdAt: 1557241361455,
},
]
);
const cwd = setupUnitFixture('vercel-env-pull');
client.cwd = cwd;
client.setArgv('env', 'pull', '--yes');
const exitCodePromise = env(client);
await expect(client.stderr).toOutput(
'Downloading `development` Environment Variables for Project '
);
await expect(client.stderr).toOutput('Created .env.local file');
await expect(exitCodePromise).resolves.toEqual(0);
const rawDevEnv = await fs.readFile(path.join(cwd, '.env.local'));
expect(rawDevEnv.toString().includes('VERCEL_ANALYTICS_ID')).toBeFalsy();
});
});
});

View File

@@ -13,8 +13,8 @@ import { setupTmpDir } from '../../helpers/setup-unit-fixture';
describe('link', () => {
it('should prompt for link', async () => {
const user = useUser();
const cwd = setupTmpDir();
const user = useUser();
useTeams('team_dummy');
const { project } = useProject({
...defaultProject,

View File

@@ -25,22 +25,6 @@ describe('login', () => {
await expect(exitCodePromise).resolves.toEqual(0);
});
describe('northstar', () => {
it('should set currentTeam to defaultTeamId', async () => {
const user = useUser({
version: 'northstar',
defaultTeamId: 'northstar-defaultTeamId',
});
client.authConfig.token = undefined;
client.setArgv('login', user.email);
const exitCodePromise = login(client);
await expect(exitCodePromise).resolves.toEqual(0);
await expect(client.config.currentTeam).toEqual(
'northstar-defaultTeamId'
);
});
});
describe('interactive', () => {
it('should allow login via email', async () => {
const user = useUser();

View File

@@ -1,81 +0,0 @@
import { client } from '../../mocks/client';
import teamsSwitch from '../../../src/commands/teams/switch';
import { useUser } from '../../mocks/user';
import { useTeams } from '../../mocks/team';
describe('switch', () => {
describe('non-northstar', () => {
it('should let you switch to team and back', async () => {
const user = useUser();
const team = useTeams()[0];
// ? Switch to:
// ── Personal Account ──────────────
// ● Name (username) (current)
// ── Teams ─────────────────────────
// ○ Team (slug)
// ──────────────────────────────────
// ○ Cancel
let exitCodePromise = teamsSwitch(client);
await expect(client.stderr).toOutput('Switch to:');
client.stdin.write('\x1B[B'); // Down arrow
client.stdin.write('\r'); // Return key
await expect(exitCodePromise).resolves.toEqual(0);
await expect(client.stderr).toOutput(
`Success! The team ${team.name} (${team.slug}) is now active!`
);
// ? Switch to:
// ── Personal Account ──────────────
// ○ Name (username)
// ── Teams ─────────────────────────
// ● Team (slug) (current)
// ──────────────────────────────────
// ○ Cancel
exitCodePromise = teamsSwitch(client);
await expect(client.stderr).toOutput('Switch to:');
client.stdin.write('\x1B[A'); // Up arrow
client.stdin.write('\r'); // Return key
await expect(exitCodePromise).resolves.toEqual(0);
await expect(client.stderr).toOutput(
`Your account (${user.username}) is now active!`
);
});
});
describe('northstar', () => {
it('should not let you switch to personal account', async () => {
const user = useUser({
version: 'northstar',
});
const team = useTeams()[0];
client.config.currentTeam = team.id;
// ? Switch to:
// ── Teams ─────────────────────────
// ● Team (slug) (current)
// ──────────────────────────────────
// ○ Cancel
const exitCodePromise = teamsSwitch(client);
// Test that personal account is not displayed in scope switcher
await expect(client.stderr).not.toOutput(user.username);
client.stdin.write('\r'); // Return key
await expect(exitCodePromise).resolves.toEqual(0);
await expect(client.stderr).toOutput('No changes made');
});
it('should not let you switch to personal account if desiredSlug is set as personal account', async () => {
const user = useUser({
version: 'northstar',
});
useTeams();
const exitCodePromise = teamsSwitch(client, user.username);
// Personal account should be hidden
await expect(client.stderr).toOutput(
'You cannot set your Personal Account as the scope.'
);
await expect(exitCodePromise).resolves.toEqual(1);
});
});
});

View File

@@ -1,30 +0,0 @@
import { client } from '../../mocks/client';
import teamsList from '../../../src/commands/teams/list';
import { useUser } from '../../mocks/user';
import { useTeams } from '../../mocks/team';
describe('teams', () => {
describe('ls', () => {
describe('non-northstar', () => {
it('should display your personal account', async () => {
const user = useUser();
useTeams(undefined, { apiVersion: 2 });
const exitCodePromise = teamsList(client);
await expect(client.stdout).toOutput(user.username);
await expect(exitCodePromise).resolves.toEqual(0);
});
});
describe('northstar', () => {
it('should not display your personal account', async () => {
const user = useUser({
version: 'northstar',
});
useTeams(undefined, { apiVersion: 2 });
const exitCodePromise = teamsList(client);
await expect(client.stdout).not.toOutput(user.username);
await expect(exitCodePromise).resolves.toEqual(0);
});
});
});
});

View File

@@ -1,68 +0,0 @@
import { client } from '../../mocks/client';
import { useUser } from '../../mocks/user';
import { useTeams } from '../../mocks/team';
import getScope from '../../../src/util/get-scope';
describe('getScope', () => {
let mockTeam: ReturnType<typeof useTeams>[0];
let mockUser: ReturnType<typeof useUser>;
beforeEach(() => {
mockTeam = useTeams()[0];
});
describe('non-northstar', () => {
beforeEach(() => {
mockUser = useUser();
});
it('should return user if team is unspecified', async () => {
const { contextName, team, user } = await getScope(client);
await expect(user.id).toEqual(mockUser.id);
await expect(team).toBeNull();
await expect(contextName).toEqual(mockUser.username);
});
it('should return team if team is specified', async () => {
client.config.currentTeam = mockTeam.id;
const { contextName, team, user } = await getScope(client);
await expect(user.id).toEqual(mockUser.id);
await expect(team?.id).toEqual(mockTeam.id);
await expect(contextName).toEqual(mockTeam.slug);
});
it('should not return team if team is specified but getTeam is false', async () => {
client.config.currentTeam = mockTeam.id;
const { contextName, team, user } = await getScope(client, {
getTeam: false,
});
await expect(user.id).toEqual(mockUser.id);
await expect(team).toBeNull();
await expect(contextName).toEqual(mockUser.username);
});
});
describe('northstar', () => {
beforeEach(() => {
mockUser = useUser({
version: 'northstar',
defaultTeamId: mockTeam.id,
});
});
it('should return default team', async () => {
const { contextName, team, user } = await getScope(client);
await expect(user.id).toEqual(mockUser.id);
await expect(team?.id).toEqual(mockTeam.id);
await expect(contextName).toEqual(mockTeam.slug);
});
it('should not return default team if getTeam is false', async () => {
const { contextName, team, user } = await getScope(client, {
getTeam: false,
});
await expect(user.id).toEqual(mockUser.id);
await expect(team).toBeNull();
await expect(contextName).toEqual(mockUser.username);
});
});
});

View File

@@ -1,40 +0,0 @@
import { client } from '../../../mocks/client';
import selectOrg from '../../../../src/util/input/select-org';
import { useTeams } from '../../../mocks/team';
import { useUser } from '../../../mocks/user';
describe('selectOrg', () => {
describe('non-northstar', () => {
it('should allow selecting user', async () => {
const user = useUser();
useTeams();
const selectOrgPromise = selectOrg(client, 'Select the scope');
await expect(client.stderr).toOutput(user.name);
client.stdin.write('\r'); // Return key
await expect(selectOrgPromise).resolves.toHaveProperty('id', user.id);
});
it('should allow selecting team', async () => {
useUser();
const team = useTeams()[0];
const selectOrgPromise = selectOrg(client, 'Select the scope');
await expect(client.stderr).toOutput('Select the scope');
client.stdin.write('\x1B[B'); // Down arrow
client.stdin.write('\r'); // Return key
await expect(selectOrgPromise).resolves.toHaveProperty('id', team.id);
});
});
describe('northstar', () => {
it('should not allow selecting user', async () => {
const user = useUser({
version: 'northstar',
});
const team = useTeams()[0];
const selectOrgPromise = selectOrg(client, 'Select the scope');
await expect(client.stderr).not.toOutput(user.name);
client.stdin.write('\r'); // Return key
await expect(selectOrgPromise).resolves.toHaveProperty('id', team.id);
});
});
});

View File

@@ -1,33 +0,0 @@
import { client } from '../../../mocks/client';
import { useUser } from '../../../mocks/user';
import { updateCurrentTeamAfterLogin } from '../../../../src/util/login/update-current-team-after-login';
describe('updateCurrentTeamAfterLogin', () => {
describe('SSO Login', () => {
it('should set currentTeam to SSO team ID', async () => {
useUser();
await updateCurrentTeamAfterLogin(client, client.output, 'ssoTeamId');
await expect(client.config.currentTeam).toEqual('ssoTeamId');
});
});
describe('northstar', () => {
it('should set currentTeam to defaultTeamId', async () => {
useUser({
version: 'northstar',
defaultTeamId: 'defaultTeamId',
});
await updateCurrentTeamAfterLogin(client, client.output);
await expect(client.config.currentTeam).toEqual('defaultTeamId');
});
});
describe('non-northstar', () => {
it('should reset currentTeam', async () => {
client.config.currentTeam = 'previousTeamId';
useUser();
await updateCurrentTeamAfterLogin(client, client.output);
await expect(client.config.currentTeam).toBeUndefined();
});
});
});

View File

@@ -10,7 +10,7 @@
"allowJs": true,
"lib": ["ES2021"],
"resolveJsonModule": true,
"sourceMap": false,
"sourceMap": true,
"outDir": "./dist",
"typeRoots": ["./types", "./node_modules/@types"]
},

View File

@@ -0,0 +1,3 @@
declare module '@zeit/source-map-support' {
function install(): void;
}

View File

@@ -1,19 +1,5 @@
# @vercel/client
## 13.0.5
### Patch Changes
- Updated dependencies [[`2f5b0aeeb`](https://github.com/vercel/vercel/commit/2f5b0aeeb183ed3ea8cbc68cb3bc3c949c486ada)]:
- @vercel/build-utils@7.2.2
## 13.0.4
### Patch Changes
- Updated dependencies [[`decdf27fb`](https://github.com/vercel/vercel/commit/decdf27fb5ca914fe50a9320c4fd50ef79d2fbb3)]:
- @vercel/build-utils@7.2.1
## 13.0.3
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/client",
"version": "13.0.5",
"version": "13.0.3",
"main": "dist/index.js",
"typings": "dist/index.d.ts",
"homepage": "https://vercel.com",
@@ -36,7 +36,7 @@
"typescript": "4.9.5"
},
"dependencies": {
"@vercel/build-utils": "7.2.2",
"@vercel/build-utils": "7.2.0",
"@vercel/routing-utils": "3.0.0",
"@zeit/fetch": "5.2.0",
"async-retry": "1.2.3",

View File

@@ -1,17 +1,5 @@
# @vercel/edge
## 1.1.0
### Minor Changes
- Add flag to geolocation ([#10443](https://github.com/vercel/vercel/pull/10443))
Usage
```
const { flag } = geolocation(req)
```
## 1.0.2
### Patch Changes

View File

@@ -13,7 +13,6 @@
- [CITY_HEADER_NAME](README.md#city_header_name)
- [COUNTRY_HEADER_NAME](README.md#country_header_name)
- [EMOJI_FLAG_UNICODE_STARTING_POSITION](README.md#emoji_flag_unicode_starting_position)
- [IP_HEADER_NAME](README.md#ip_header_name)
- [LATITUDE_HEADER_NAME](README.md#latitude_header_name)
- [LONGITUDE_HEADER_NAME](README.md#longitude_header_name)
@@ -54,18 +53,6 @@ Country of the original client IP as calculated by Vercel Proxy.
---
### EMOJI_FLAG_UNICODE_STARTING_POSITION
`Const` **EMOJI_FLAG_UNICODE_STARTING_POSITION**: `127397`
Unicode characters for emoji flags start at this number, and run up to 127469.
#### Defined in
[packages/edge/src/edge-headers.ts:34](https://github.com/vercel/vercel/blob/main/packages/edge/src/edge-headers.ts#L34)
---
### IP_HEADER_NAME
`Const` **IP_HEADER_NAME**: `"x-real-ip"`
@@ -154,7 +141,7 @@ Returns the location information for the incoming request.
#### Defined in
[packages/edge/src/edge-headers.ts:128](https://github.com/vercel/vercel/blob/main/packages/edge/src/edge-headers.ts#L128)
[packages/edge/src/edge-headers.ts:106](https://github.com/vercel/vercel/blob/main/packages/edge/src/edge-headers.ts#L106)
---
@@ -180,7 +167,7 @@ Returns the IP address of the request from the headers.
#### Defined in
[packages/edge/src/edge-headers.ts:99](https://github.com/vercel/vercel/blob/main/packages/edge/src/edge-headers.ts#L99)
[packages/edge/src/edge-headers.ts:77](https://github.com/vercel/vercel/blob/main/packages/edge/src/edge-headers.ts#L77)
---

View File

@@ -9,7 +9,6 @@ The location information of a given request.
- [city](Geo.md#city)
- [country](Geo.md#country)
- [countryRegion](Geo.md#countryregion)
- [flag](Geo.md#flag)
- [latitude](Geo.md#latitude)
- [longitude](Geo.md#longitude)
- [region](Geo.md#region)
@@ -24,7 +23,7 @@ The city that the request originated from.
#### Defined in
[packages/edge/src/edge-headers.ts:50](https://github.com/vercel/vercel/blob/main/packages/edge/src/edge-headers.ts#L50)
[packages/edge/src/edge-headers.ts:47](https://github.com/vercel/vercel/blob/main/packages/edge/src/edge-headers.ts#L47)
---
@@ -36,7 +35,7 @@ The country that the request originated from.
#### Defined in
[packages/edge/src/edge-headers.ts:53](https://github.com/vercel/vercel/blob/main/packages/edge/src/edge-headers.ts#L53)
[packages/edge/src/edge-headers.ts:50](https://github.com/vercel/vercel/blob/main/packages/edge/src/edge-headers.ts#L50)
---
@@ -49,19 +48,7 @@ See [docs](https://vercel.com/docs/concepts/edge-network/headers#x-vercel-ip-cou
#### Defined in
[packages/edge/src/edge-headers.ts:64](https://github.com/vercel/vercel/blob/main/packages/edge/src/edge-headers.ts#L64)
---
### flag
`Optional` **flag**: `string`
The flag emoji for the country the request originated from.
#### Defined in
[packages/edge/src/edge-headers.ts:56](https://github.com/vercel/vercel/blob/main/packages/edge/src/edge-headers.ts#L56)
[packages/edge/src/edge-headers.ts:58](https://github.com/vercel/vercel/blob/main/packages/edge/src/edge-headers.ts#L58)
---
@@ -73,7 +60,7 @@ The latitude of the client.
#### Defined in
[packages/edge/src/edge-headers.ts:67](https://github.com/vercel/vercel/blob/main/packages/edge/src/edge-headers.ts#L67)
[packages/edge/src/edge-headers.ts:61](https://github.com/vercel/vercel/blob/main/packages/edge/src/edge-headers.ts#L61)
---
@@ -85,7 +72,7 @@ The longitude of the client.
#### Defined in
[packages/edge/src/edge-headers.ts:70](https://github.com/vercel/vercel/blob/main/packages/edge/src/edge-headers.ts#L70)
[packages/edge/src/edge-headers.ts:64](https://github.com/vercel/vercel/blob/main/packages/edge/src/edge-headers.ts#L64)
---
@@ -97,4 +84,4 @@ The [Vercel Edge Network region](https://vercel.com/docs/concepts/edge-network/r
#### Defined in
[packages/edge/src/edge-headers.ts:59](https://github.com/vercel/vercel/blob/main/packages/edge/src/edge-headers.ts#L59)
[packages/edge/src/edge-headers.ts:53](https://github.com/vercel/vercel/blob/main/packages/edge/src/edge-headers.ts#L53)

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/edge",
"version": "1.1.0",
"version": "1.0.2",
"license": "Apache-2.0",
"main": "dist/index.js",
"module": "dist/index.mjs",

View File

@@ -28,10 +28,7 @@ export const REGION_HEADER_NAME = 'x-vercel-ip-country-region';
* The request ID for each request generated by Vercel Proxy.
*/
export const REQUEST_ID_HEADER_NAME = 'x-vercel-id';
/**
* Unicode characters for emoji flags start at this number, and run up to 127469.
*/
export const EMOJI_FLAG_UNICODE_STARTING_POSITION = 127397;
/**
* We define a new type so this function can be reused with
* the global `Request`, `node-fetch` and other types.
@@ -52,9 +49,6 @@ export interface Geo {
/** The country that the request originated from. */
country?: string;
/** The flag emoji for the country the request originated from. */
flag?: string;
/** The [Vercel Edge Network region](https://vercel.com/docs/concepts/edge-network/regions) that received the request. */
region?: string;
@@ -74,22 +68,6 @@ function getHeader(request: Request, key: string): string | undefined {
return request.headers.get(key) ?? undefined;
}
/**
* Converts the 2 digit countryCode into a flag emoji by adding the current character value to the emoji flag unicode starting position. See [Country Code to Flag Emoji](https://dev.to/jorik/country-code-to-flag-emoji-a21) by Jorik Tangelder.
*
* @param countryCode The country code returned by: `getHeader(request, COUNTRY_HEADER_NAME)`.
* @returns A flag emoji or undefined.
*/
function getFlag(countryCode: string | undefined): string | undefined {
const regex = new RegExp('^[A-Z]{2}$').test(countryCode!);
if (!countryCode || !regex) return undefined;
return String.fromCodePoint(
...countryCode
.split('')
.map(char => EMOJI_FLAG_UNICODE_STARTING_POSITION + char.charCodeAt(0))
);
}
/**
* Returns the IP address of the request from the headers.
*
@@ -129,7 +107,6 @@ export function geolocation(request: Request): Geo {
return {
city: getHeader(request, CITY_HEADER_NAME),
country: getHeader(request, COUNTRY_HEADER_NAME),
flag: getFlag(getHeader(request, COUNTRY_HEADER_NAME)),
countryRegion: getHeader(request, REGION_HEADER_NAME),
region: getRegionFromRequestId(getHeader(request, REQUEST_ID_HEADER_NAME)),
latitude: getHeader(request, LATITUDE_HEADER_NAME),

View File

@@ -29,7 +29,6 @@ describe('`geolocation`', () => {
const req = new Request('https://example.vercel.sh');
expect(geolocation(req)).toEqual({
city: undefined,
flag: undefined,
country: undefined,
countryRegion: undefined,
latitude: undefined,
@@ -42,7 +41,7 @@ describe('`geolocation`', () => {
const req = new Request('https://example.vercel.sh', {
headers: {
[CITY_HEADER_NAME]: 'Tel Aviv',
[COUNTRY_HEADER_NAME]: 'IL',
[COUNTRY_HEADER_NAME]: 'Israel',
[LATITUDE_HEADER_NAME]: '32.109333',
[LONGITUDE_HEADER_NAME]: '34.855499',
[REGION_HEADER_NAME]: 'TA', // https://en.wikipedia.org/wiki/ISO_3166-2:IL
@@ -51,8 +50,7 @@ describe('`geolocation`', () => {
});
expect(geolocation(req)).toEqual<Geo>({
city: 'Tel Aviv',
flag: '🇮🇱',
country: 'IL',
country: 'Israel',
latitude: '32.109333',
longitude: '34.855499',
region: 'fra1',
@@ -64,7 +62,7 @@ describe('`geolocation`', () => {
const req = new Request('https://example.vercel.sh', {
headers: {
[CITY_HEADER_NAME]: 'Tokyo',
[COUNTRY_HEADER_NAME]: 'JP',
[COUNTRY_HEADER_NAME]: 'Japan',
[LATITUDE_HEADER_NAME]: '37.1233',
[LONGITUDE_HEADER_NAME]: '30.733399',
[REGION_HEADER_NAME]: '13',
@@ -73,8 +71,7 @@ describe('`geolocation`', () => {
});
expect(geolocation(req)).toEqual<Geo>({
city: 'Tokyo',
flag: '🇯🇵',
country: 'JP',
country: 'Japan',
latitude: '37.1233',
longitude: '30.733399',
region: 'hnd1',
@@ -86,7 +83,7 @@ describe('`geolocation`', () => {
const req = new Request('https://example.vercel.sh', {
headers: {
[CITY_HEADER_NAME]: 'Tokyo',
[COUNTRY_HEADER_NAME]: 'JP',
[COUNTRY_HEADER_NAME]: 'Japan',
[LATITUDE_HEADER_NAME]: '37.1233',
[LONGITUDE_HEADER_NAME]: '30.733399',
[REGION_HEADER_NAME]: '13',
@@ -94,29 +91,7 @@ describe('`geolocation`', () => {
});
expect(geolocation(req)).toEqual<Geo>({
city: 'Tokyo',
flag: '🇯🇵',
country: 'JP',
latitude: '37.1233',
longitude: '30.733399',
region: 'dev1',
countryRegion: '13',
});
});
test('returns undefined if countryCode is invalid', () => {
const req = new Request('https://example.vercel.sh', {
headers: {
[CITY_HEADER_NAME]: 'Tokyo',
[COUNTRY_HEADER_NAME]: 'AAA',
[LATITUDE_HEADER_NAME]: '37.1233',
[LONGITUDE_HEADER_NAME]: '30.733399',
[REGION_HEADER_NAME]: '13',
},
});
expect(geolocation(req)).toEqual<Geo>({
city: 'Tokyo',
flag: undefined,
country: 'AAA',
country: 'Japan',
latitude: '37.1233',
longitude: '30.733399',
region: 'dev1',

View File

@@ -1,11 +1,5 @@
# @vercel/frameworks
## 2.0.2
### Patch Changes
- Add `bun install` placeholder ([#10492](https://github.com/vercel/vercel/pull/10492))
## 2.0.1
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/frameworks",
"version": "2.0.2",
"version": "2.0.1",
"main": "./dist/frameworks.js",
"types": "./dist/frameworks.d.ts",
"files": [

View File

@@ -1,24 +1,5 @@
# @vercel/fs-detectors
## 5.1.1
### Patch Changes
- [cli] Update bun detection and add tests for projects with both bunlock binary and yarn.lock text files ([#10583](https://github.com/vercel/vercel/pull/10583))
## 5.1.0
### Minor Changes
- Add support for bun detection in monorepo ([#10511](https://github.com/vercel/vercel/pull/10511))
## 5.0.3
### Patch Changes
- Updated dependencies [[`ec894bdf7`](https://github.com/vercel/vercel/commit/ec894bdf7f167debded37183f11360756f577f14)]:
- @vercel/frameworks@2.0.2
## 5.0.2
### Patch Changes

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/fs-detectors",
"version": "5.1.1",
"version": "5.0.2",
"description": "Vercel filesystem detectors",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
@@ -21,7 +21,7 @@
},
"dependencies": {
"@vercel/error-utils": "2.0.1",
"@vercel/frameworks": "2.0.2",
"@vercel/frameworks": "2.0.1",
"@vercel/routing-utils": "3.0.0",
"glob": "8.0.3",
"js-yaml": "4.1.0",
@@ -36,7 +36,7 @@
"@types/minimatch": "3.0.5",
"@types/node": "14.18.33",
"@types/semver": "7.3.10",
"@vercel/build-utils": "7.2.2",
"@vercel/build-utils": "7.2.0",
"jest-junit": "16.0.0",
"typescript": "4.9.5"
}

View File

@@ -37,24 +37,6 @@ export const packageManagers: Array<
],
},
},
{
name: 'bun',
slug: 'bun',
logo: '',
darkModeLogo: '',
detectors: {
some: [
{
path: 'bun.lockb',
},
{
path: 'package.json',
// Depends on https://github.com/nodejs/corepack/pull/307
matchContent: '"packageManager":\\s*"bun@.*"',
},
],
},
},
{
name: 'yarn',
slug: 'yarn',

View File

@@ -1,3 +0,0 @@
{
"packageManager": "bun@1.0.1"
}

View File

@@ -14,9 +14,6 @@ describe('package-managers', () => {
['54-yarn-with-corepack', 'yarn'],
['55-pnpm-with-lockfile', 'pnpm'],
['56-pnpm-with-corepack', 'pnpm'],
['57-bun-with-lockfile', 'bun'],
['58-bun-with-corepack', 'bun'],
['59-bun-with-binary-and-readable-lockfile', 'bun'],
])('with detectFramework', (fixturePath, frameworkSlug) => {
const testName = `should detect package manager '${frameworkSlug}' for ${fixturePath}`;

Some files were not shown because too many files have changed in this diff Show More