mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-11 12:57:46 +00:00
Compare commits
99 Commits
vercel@28.
...
@vercel/py
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
48d925f105 | ||
|
|
011f6ff150 | ||
|
|
cd09a38c19 | ||
|
|
af239b5fa5 | ||
|
|
38244c8ed6 | ||
|
|
57e8ec13cf | ||
|
|
2e8423e24e | ||
|
|
a92c68e0ff | ||
|
|
84f3a5bc1b | ||
|
|
186bd9bb51 | ||
|
|
9ae84ba05f | ||
|
|
a638755e95 | ||
|
|
15eb018f84 | ||
|
|
7f89aca52c | ||
|
|
dc9ec1bc6d | ||
|
|
df93b01248 | ||
|
|
fb37ad22ab | ||
|
|
684f69bc5b | ||
|
|
ddae78458d | ||
|
|
fc614a7a92 | ||
|
|
6e4ea0774e | ||
|
|
cfc1c9e818 | ||
|
|
62a872fc0e | ||
|
|
03b5bfbaa2 | ||
|
|
aa305e5c66 | ||
|
|
2309c43fce | ||
|
|
0bbb06daa7 | ||
|
|
61de63d285 | ||
|
|
1ca3704297 | ||
|
|
ae4180b287 | ||
|
|
40081cb319 | ||
|
|
9200be61d2 | ||
|
|
1390f6d2ee | ||
|
|
b78cfc9ba5 | ||
|
|
803a9363f9 | ||
|
|
4a0a3b64a2 | ||
|
|
347c2de3a2 | ||
|
|
a05cc11719 | ||
|
|
55b999ea9b | ||
|
|
8babc3694f | ||
|
|
6dc0321216 | ||
|
|
3df8c05792 | ||
|
|
e0f8bc9820 | ||
|
|
ebd2e1822c | ||
|
|
31bc2581f3 | ||
|
|
96759a9fda | ||
|
|
ad2864bca5 | ||
|
|
40fbc993d7 | ||
|
|
1f30e56a6d | ||
|
|
58d6268899 | ||
|
|
4e6659ace7 | ||
|
|
769234b6a6 | ||
|
|
53cab61e88 | ||
|
|
3a65acfb32 | ||
|
|
48eed7532a | ||
|
|
f09d6fce85 | ||
|
|
cc82c499db | ||
|
|
f0bc207717 | ||
|
|
151c7f99ee | ||
|
|
61c2c494bf | ||
|
|
7f49816129 | ||
|
|
7845bef826 | ||
|
|
7acb2e4b07 | ||
|
|
abea002e93 | ||
|
|
2db9678bd4 | ||
|
|
05f942c53f | ||
|
|
6c5f0b7aa0 | ||
|
|
fea05383b9 | ||
|
|
247f49f765 | ||
|
|
231714c71b | ||
|
|
73d6f0d0fa | ||
|
|
34d199bd49 | ||
|
|
1dd421e1f6 | ||
|
|
a91690fb8a | ||
|
|
264437c751 | ||
|
|
b8cce66eff | ||
|
|
cbad57d14f | ||
|
|
4da176d26f | ||
|
|
1f51e04387 | ||
|
|
756174714f | ||
|
|
6e32832f94 | ||
|
|
e682e9cd7d | ||
|
|
b30f000d2a | ||
|
|
f78051ada9 | ||
|
|
10bc74904c | ||
|
|
c8f7a9a874 | ||
|
|
2fd3315221 | ||
|
|
54ef027cbe | ||
|
|
6620c7f600 | ||
|
|
38f40f1c15 | ||
|
|
63211b8b89 | ||
|
|
83ee5ea2b8 | ||
|
|
f063645646 | ||
|
|
4f8c5e344d | ||
|
|
70a53515bd | ||
|
|
4d4f0fa672 | ||
|
|
46c0fd153a | ||
|
|
1c8b4717e3 | ||
|
|
d52d26eaac |
31
.github/workflows/cron-update-gatsby-fixtures.yml
vendored
Normal file
31
.github/workflows/cron-update-gatsby-fixtures.yml
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
name: Cron Update Gatsby Fixtures
|
||||
|
||||
on:
|
||||
# Allow manual runs
|
||||
workflow_dispatch:
|
||||
# Run once a week https://crontab.guru/once-a-week
|
||||
schedule:
|
||||
- cron: '0 0 * * 0'
|
||||
|
||||
jobs:
|
||||
create-pull-request:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
# 0 means fetch all commits so we can commit and push in the script below
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Enable corepack
|
||||
run: corepack enable pnpm
|
||||
- name: Create Pull Request
|
||||
uses: actions/github-script@v6
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
|
||||
# See https://github.com/actions/github-script#run-a-separate-file-with-an-async-function
|
||||
with:
|
||||
github-token: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
|
||||
script: |
|
||||
const script = require('./utils/update-gatsby-fixtures.js')
|
||||
await script({ github, context })
|
||||
1
.github/workflows/cron-update-next.yml
vendored
1
.github/workflows/cron-update-next.yml
vendored
@@ -25,6 +25,7 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
|
||||
# See https://github.com/actions/github-script#run-a-separate-file-with-an-async-function
|
||||
with:
|
||||
github-token: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
|
||||
script: |
|
||||
const script = require('./utils/update-next.js')
|
||||
await script({ github, context })
|
||||
|
||||
1
.github/workflows/cron-update-turbo.yml
vendored
1
.github/workflows/cron-update-turbo.yml
vendored
@@ -25,6 +25,7 @@ jobs:
|
||||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
|
||||
# See https://github.com/actions/github-script#run-a-separate-file-with-an-async-function
|
||||
with:
|
||||
github-token: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
|
||||
script: |
|
||||
const script = require('./utils/update-turbo.js')
|
||||
await script({ github, context })
|
||||
|
||||
5
.github/workflows/publish.yml
vendored
5
.github/workflows/publish.yml
vendored
@@ -16,6 +16,9 @@ jobs:
|
||||
publish:
|
||||
name: Publish
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
id-token: write
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
@@ -41,6 +44,8 @@ jobs:
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: 16
|
||||
- name: install npm@9
|
||||
run: npm i -g npm@9
|
||||
- name: install pnpm@7.24.2
|
||||
run: npm i -g pnpm@7.24.2
|
||||
- name: Install
|
||||
|
||||
28
.github/workflows/update-remix-run-dev.yml
vendored
Normal file
28
.github/workflows/update-remix-run-dev.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
||||
name: Update @remix-run/dev
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
new-version:
|
||||
type: string
|
||||
description: "Optional version to update @remix-run/dev to inside of @vercel/remix"
|
||||
|
||||
jobs:
|
||||
update-remix-run-dev:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v3
|
||||
- name: Enable corepack
|
||||
run: corepack enable pnpm
|
||||
- name: Update @remix-run/dev
|
||||
uses: actions/github-script@v6
|
||||
with:
|
||||
github-token: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
|
||||
script: |
|
||||
const script = require('./utils/update-remix-run-dev.js')
|
||||
await script({ github, context }, "${{ inputs.new-version }}")
|
||||
1
.npmrc
1
.npmrc
@@ -1,3 +1,4 @@
|
||||
provenance=true
|
||||
save-exact=true
|
||||
hoist-pattern[]=!"**/@types/**"
|
||||
hoist-pattern[]=!"**/typedoc"
|
||||
|
||||
@@ -14,7 +14,9 @@ In order to create the smallest possible lambdas Next.js has to be configured to
|
||||
npm install next --save
|
||||
```
|
||||
|
||||
2. Add the `now-build` script to your `package.json`
|
||||
2. Check [Node.js Version](https://vercel.link/node-version) in your Project Settings. Using an old or incompatible version of Node.js can cause the Build Step to fail with this error message.
|
||||
|
||||
3. Add the `now-build` script to your `package.json` [deprecated]
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -24,7 +26,7 @@ npm install next --save
|
||||
}
|
||||
```
|
||||
|
||||
3. Add `target: 'serverless'` to `next.config.js` [deprecated]
|
||||
4. Add `target: 'serverless'` to `next.config.js` [deprecated]
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
@@ -33,9 +35,9 @@ module.exports = {
|
||||
};
|
||||
```
|
||||
|
||||
4. Remove `distDir` from `next.config.js` as `@vercel/next` can't parse this file and expects your build output at `/.next`
|
||||
5. Remove `distDir` from `next.config.js` as `@vercel/next` can't parse this file and expects your build output at `/.next`
|
||||
|
||||
5. Optionally make sure the `"src"` in `"builds"` points to your application `package.json`
|
||||
6. Optionally make sure the `"src"` in `"builds"` points to your application `package.json`
|
||||
|
||||
```js
|
||||
{
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"baseUrl": ".",
|
||||
"paths": {
|
||||
"@/*": ["./*"]
|
||||
}
|
||||
|
||||
2515
examples/nextjs/package-lock.json
generated
2515
examples/nextjs/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -9,10 +9,9 @@
|
||||
"lint": "next lint"
|
||||
},
|
||||
"dependencies": {
|
||||
"@next/font": "13.1.6",
|
||||
"eslint": "8.32.0",
|
||||
"eslint-config-next": "13.1.6",
|
||||
"next": "13.1.6",
|
||||
"eslint": "8.35.0",
|
||||
"eslint-config-next": "13.2.3",
|
||||
"next": "13.2.3",
|
||||
"react": "18.2.0",
|
||||
"react-dom": "18.2.0"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Head from 'next/head'
|
||||
import Image from 'next/image'
|
||||
import { Inter } from '@next/font/google'
|
||||
import { Inter } from 'next/font/google'
|
||||
import styles from '@/styles/Home.module.css'
|
||||
|
||||
const inter = Inter({ subsets: ['latin'] })
|
||||
|
||||
@@ -13,10 +13,10 @@ function hydrate() {
|
||||
});
|
||||
}
|
||||
|
||||
if (window.requestIdleCallback) {
|
||||
window.requestIdleCallback(hydrate);
|
||||
if (typeof requestIdleCallback === "function") {
|
||||
requestIdleCallback(hydrate);
|
||||
} else {
|
||||
// Safari doesn't support requestIdleCallback
|
||||
// https://caniuse.com/requestidlecallback
|
||||
window.setTimeout(hydrate, 1);
|
||||
setTimeout(hydrate, 1);
|
||||
}
|
||||
|
||||
@@ -1,21 +1,18 @@
|
||||
import type { EntryContext } from "@remix-run/node";
|
||||
import handleRequest from "@vercel/remix-entry-server";
|
||||
import { RemixServer } from "@remix-run/react";
|
||||
import { renderToString } from "react-dom/server";
|
||||
import type { EntryContext } from "@remix-run/server-runtime";
|
||||
|
||||
export default function handleRequest(
|
||||
export default function (
|
||||
request: Request,
|
||||
responseStatusCode: number,
|
||||
responseHeaders: Headers,
|
||||
remixContext: EntryContext
|
||||
) {
|
||||
const markup = renderToString(
|
||||
<RemixServer context={remixContext} url={request.url} />
|
||||
const remixServer = <RemixServer context={remixContext} url={request.url} />;
|
||||
return handleRequest(
|
||||
request,
|
||||
responseStatusCode,
|
||||
responseHeaders,
|
||||
remixServer
|
||||
);
|
||||
|
||||
responseHeaders.set("Content-Type", "text/html");
|
||||
|
||||
return new Response("<!DOCTYPE html>" + markup, {
|
||||
headers: responseHeaders,
|
||||
status: responseStatusCode,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
Scripts,
|
||||
ScrollRestoration,
|
||||
} from "@remix-run/react";
|
||||
import { Analytics } from '@vercel/analytics/react';
|
||||
import { Analytics } from "@vercel/analytics/react";
|
||||
|
||||
export const meta: MetaFunction = () => ({
|
||||
charset: "utf-8",
|
||||
|
||||
9
examples/remix/app/routes/edge.tsx
Normal file
9
examples/remix/app/routes/edge.tsx
Normal file
@@ -0,0 +1,9 @@
|
||||
export const config = { runtime: "edge" };
|
||||
|
||||
export default function Edge() {
|
||||
return (
|
||||
<div style={{ fontFamily: "system-ui, sans-serif", lineHeight: "1.4" }}>
|
||||
<h1>Welcome to Remix@Edge</h1>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -6,20 +6,20 @@
|
||||
"dev": "remix dev"
|
||||
},
|
||||
"dependencies": {
|
||||
"@remix-run/node": "^1.7.6",
|
||||
"@remix-run/react": "^1.7.6",
|
||||
"@remix-run/vercel": "^1.7.6",
|
||||
"@vercel/analytics": "^0.1.5",
|
||||
"@vercel/node": "^2.7.0",
|
||||
"@remix-run/node": "^1.13.0",
|
||||
"@remix-run/react": "^1.13.0",
|
||||
"@remix-run/serve": "^1.13.0",
|
||||
"@remix-run/server-runtime": "^1.13.0",
|
||||
"@vercel/analytics": "^0.1.10",
|
||||
"@vercel/remix-entry-server": "^0.1.0",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@remix-run/dev": "^1.7.6",
|
||||
"@remix-run/eslint-config": "^1.7.6",
|
||||
"@remix-run/serve": "^1.7.6",
|
||||
"@remix-run/dev": "^1.13.0",
|
||||
"@remix-run/eslint-config": "^1.13.0",
|
||||
"@types/react": "^18.0.25",
|
||||
"@types/react-dom": "^18.0.9",
|
||||
"@types/react-dom": "^18.0.11",
|
||||
"eslint": "^8.28.0",
|
||||
"typescript": "^4.9.3"
|
||||
},
|
||||
|
||||
3566
examples/remix/pnpm-lock.yaml
generated
3566
examples/remix/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load Diff
@@ -1,13 +1,10 @@
|
||||
/** @type {import('@remix-run/dev').AppConfig} */
|
||||
/**
|
||||
* @type {import('@remix-run/dev').AppConfig}
|
||||
*/
|
||||
module.exports = {
|
||||
serverBuildTarget: "vercel",
|
||||
// When running locally in development mode, we use the built in remix
|
||||
// server. This does not understand the vercel lambda module format,
|
||||
// so we default back to the standard build output.
|
||||
server: process.env.NODE_ENV === "development" ? undefined : "./server.js",
|
||||
ignoredRouteFiles: ["**/.*"],
|
||||
ignoredRouteFiles: ['**/.*'],
|
||||
// appDirectory: "app",
|
||||
// assetsBuildDirectory: "public/build",
|
||||
// serverBuildPath: "api/index.js",
|
||||
// serverBuildPath: "build/index.js",
|
||||
// publicPath: "/build/",
|
||||
};
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
import { createRequestHandler } from "@remix-run/vercel";
|
||||
import * as build from "@remix-run/dev/server-build";
|
||||
|
||||
export default createRequestHandler({ build, mode: process.env.NODE_ENV });
|
||||
@@ -300,6 +300,7 @@ export interface Secret {
|
||||
createdAt: number;
|
||||
}
|
||||
|
||||
// TODO (Ethan-Arrowood) - Replace enums
|
||||
export enum ProjectEnvTarget {
|
||||
Production = 'production',
|
||||
Preview = 'preview',
|
||||
17
internals/types/package.json
Normal file
17
internals/types/package.json
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"private": true,
|
||||
"name": "@vercel-internals/types",
|
||||
"types": "dist/index.d.ts",
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
"build": "tsc -p tsconfig.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/build-utils": "6.3.2",
|
||||
"@vercel/routing-utils": "2.1.10"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vercel/style-guide": "4.0.2",
|
||||
"typescript": "4.9.4"
|
||||
}
|
||||
}
|
||||
8
internals/types/tsconfig.json
Normal file
8
internals/types/tsconfig.json
Normal file
@@ -0,0 +1,8 @@
|
||||
{
|
||||
"extends": "@vercel/style-guide/typescript",
|
||||
"compilerOptions": {
|
||||
"outDir": "dist",
|
||||
"declaration": true
|
||||
},
|
||||
"include": ["index.ts"]
|
||||
}
|
||||
@@ -32,7 +32,7 @@
|
||||
"source-map-support": "0.5.12",
|
||||
"ts-eager": "2.0.2",
|
||||
"ts-jest": "28.0.5",
|
||||
"turbo": "1.7.4"
|
||||
"turbo": "1.8.3"
|
||||
},
|
||||
"scripts": {
|
||||
"lerna": "lerna",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@vercel/build-utils",
|
||||
"version": "6.3.0",
|
||||
"version": "6.3.3",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.js",
|
||||
|
||||
@@ -25,12 +25,16 @@ export async function readConfigFile<T>(
|
||||
|
||||
if (data) {
|
||||
const str = data.toString('utf8');
|
||||
if (name.endsWith('.json')) {
|
||||
return JSON.parse(str) as T;
|
||||
} else if (name.endsWith('.toml')) {
|
||||
return (toml.parse(str) as unknown) as T;
|
||||
} else if (name.endsWith('.yaml') || name.endsWith('.yml')) {
|
||||
return yaml.safeLoad(str, { filename: name }) as T;
|
||||
try {
|
||||
if (name.endsWith('.json')) {
|
||||
return JSON.parse(str) as T;
|
||||
} else if (name.endsWith('.toml')) {
|
||||
return toml.parse(str) as unknown as T;
|
||||
} else if (name.endsWith('.yaml') || name.endsWith('.yml')) {
|
||||
return yaml.safeLoad(str, { filename: name }) as T;
|
||||
}
|
||||
} catch (error: unknown) {
|
||||
console.log(`Error while parsing config file: "${name}"`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -355,6 +355,8 @@ export interface BuilderV3 {
|
||||
|
||||
type ImageFormat = 'image/avif' | 'image/webp';
|
||||
|
||||
type ImageContentDispositionType = 'inline' | 'attachment';
|
||||
|
||||
export type RemotePattern = {
|
||||
/**
|
||||
* Must be `http` or `https`.
|
||||
@@ -390,6 +392,7 @@ export interface Images {
|
||||
formats?: ImageFormat[];
|
||||
dangerouslyAllowSVG?: boolean;
|
||||
contentSecurityPolicy?: string;
|
||||
contentDispositionType?: ImageContentDispositionType;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
77
packages/build-utils/test/unit.read-config-file.test.ts
vendored
Normal file
77
packages/build-utils/test/unit.read-config-file.test.ts
vendored
Normal file
@@ -0,0 +1,77 @@
|
||||
import { join } from 'path';
|
||||
import { writeFile, rm } from 'fs/promises';
|
||||
import { readConfigFile } from '../src';
|
||||
|
||||
describe('Test `readConfigFile()`', () => {
|
||||
let logMessages: string[];
|
||||
const originalConsoleLog = console.log;
|
||||
|
||||
beforeEach(() => {
|
||||
logMessages = [];
|
||||
console.log = m => {
|
||||
logMessages.push(m);
|
||||
};
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
console.log = originalConsoleLog;
|
||||
});
|
||||
|
||||
const doesnotexist = join(__dirname, 'does-not-exist.json');
|
||||
const tsconfig = join(__dirname, '../tsconfig.json');
|
||||
const invalid = join(__dirname, 'invalid.json');
|
||||
|
||||
it('should return null when file does not exist', async () => {
|
||||
expect(await readConfigFile(doesnotexist)).toBeNull();
|
||||
expect(logMessages).toEqual([]);
|
||||
});
|
||||
|
||||
it('should return parsed object when file exists', async () => {
|
||||
expect(await readConfigFile(tsconfig)).toMatchObject({
|
||||
compilerOptions: {
|
||||
strict: true,
|
||||
},
|
||||
});
|
||||
expect(logMessages).toEqual([]);
|
||||
});
|
||||
|
||||
it('should return parsed object when at least one file exists', async () => {
|
||||
const files = [doesnotexist, tsconfig];
|
||||
expect(await readConfigFile(files)).toMatchObject({
|
||||
compilerOptions: {
|
||||
strict: true,
|
||||
},
|
||||
});
|
||||
expect(logMessages).toEqual([]);
|
||||
});
|
||||
|
||||
it('should return null when parse fails', async () => {
|
||||
try {
|
||||
await writeFile(invalid, 'borked');
|
||||
expect(await readConfigFile(invalid)).toBeNull();
|
||||
} finally {
|
||||
await rm(invalid);
|
||||
}
|
||||
expect(logMessages.length).toBe(1);
|
||||
expect(logMessages[0]).toMatch(
|
||||
/^Error while parsing config file.+invalid.json/
|
||||
);
|
||||
});
|
||||
|
||||
it('should return parsed object when at least one file is valid', async () => {
|
||||
try {
|
||||
await writeFile(invalid, 'borked');
|
||||
expect(await readConfigFile([invalid, tsconfig])).toMatchObject({
|
||||
compilerOptions: {
|
||||
strict: true,
|
||||
},
|
||||
});
|
||||
} finally {
|
||||
await rm(invalid);
|
||||
}
|
||||
expect(logMessages.length).toBe(1);
|
||||
expect(logMessages[0]).toMatch(
|
||||
/^Error while parsing config file.+invalid.json/
|
||||
);
|
||||
});
|
||||
});
|
||||
5
packages/build-utils/test/unit.test.ts
vendored
5
packages/build-utils/test/unit.test.ts
vendored
@@ -506,6 +506,11 @@ it('should retry npm install when peer deps invalid and npm@8 on node@16', async
|
||||
console.log('Skipping test on windows');
|
||||
return;
|
||||
}
|
||||
if (process.platform === 'darwin') {
|
||||
console.log('Skipping test on mac');
|
||||
return;
|
||||
}
|
||||
|
||||
const fixture = path.join(__dirname, 'fixtures', '15-npm-8-legacy-peer-deps');
|
||||
const nodeVersion = { major: nodeMajor } as any;
|
||||
await runNpmInstall(fixture, [], {}, {}, nodeVersion);
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "vercel",
|
||||
"version": "28.16.1",
|
||||
"version": "28.16.14",
|
||||
"preferGlobal": true,
|
||||
"license": "Apache-2.0",
|
||||
"description": "The command-line interface for Vercel",
|
||||
@@ -41,16 +41,16 @@
|
||||
"node": ">= 14"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/build-utils": "6.3.0",
|
||||
"@vercel/go": "2.3.7",
|
||||
"@vercel/hydrogen": "0.0.53",
|
||||
"@vercel/next": "3.4.7",
|
||||
"@vercel/node": "2.9.6",
|
||||
"@vercel/python": "3.1.49",
|
||||
"@vercel/redwood": "1.1.5",
|
||||
"@vercel/remix": "1.3.3",
|
||||
"@vercel/ruby": "1.3.65",
|
||||
"@vercel/static-build": "1.3.9"
|
||||
"@vercel/build-utils": "6.3.3",
|
||||
"@vercel/go": "2.3.10",
|
||||
"@vercel/hydrogen": "0.0.56",
|
||||
"@vercel/next": "3.6.5",
|
||||
"@vercel/node": "2.9.11",
|
||||
"@vercel/python": "3.1.52",
|
||||
"@vercel/redwood": "1.1.8",
|
||||
"@vercel/remix": "1.6.1",
|
||||
"@vercel/ruby": "1.3.69",
|
||||
"@vercel/static-build": "1.3.15"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@alex_neo/jest-expect-message": "1.0.5",
|
||||
@@ -93,13 +93,14 @@
|
||||
"@types/which": "1.3.2",
|
||||
"@types/write-json-file": "2.2.1",
|
||||
"@types/yauzl-promise": "2.1.0",
|
||||
"@vercel/client": "12.4.0",
|
||||
"@vercel-internals/types": "*",
|
||||
"@vercel/client": "12.4.3",
|
||||
"@vercel/error-utils": "1.0.8",
|
||||
"@vercel/frameworks": "1.3.1",
|
||||
"@vercel/fs-detectors": "3.7.14",
|
||||
"@vercel/frameworks": "1.3.2",
|
||||
"@vercel/fs-detectors": "3.8.3",
|
||||
"@vercel/fun": "1.0.4",
|
||||
"@vercel/ncc": "0.24.0",
|
||||
"@vercel/routing-utils": "2.1.9",
|
||||
"@vercel/routing-utils": "2.1.10",
|
||||
"@zeit/source-map-support": "0.6.2",
|
||||
"ajv": "6.12.2",
|
||||
"alpha-sort": "2.0.1",
|
||||
@@ -140,7 +141,6 @@
|
||||
"is-url": "1.2.2",
|
||||
"jaro-winkler": "0.2.8",
|
||||
"jest-matcher-utils": "29.3.1",
|
||||
"json5": "2.2.1",
|
||||
"jsonlines": "0.1.1",
|
||||
"line-async-iterator": "3.0.0",
|
||||
"load-json-file": "3.0.0",
|
||||
|
||||
@@ -12,7 +12,7 @@ import stamp from '../../util/output/stamp';
|
||||
import strlen from '../../util/strlen';
|
||||
import getCommandFlags from '../../util/get-command-flags';
|
||||
import { getCommandName } from '../../util/pkg-name';
|
||||
import { Alias } from '../../types';
|
||||
import { Alias } from '@vercel-internals/types';
|
||||
|
||||
export default async function ls(
|
||||
client: Client,
|
||||
|
||||
@@ -9,7 +9,7 @@ import strlen from '../../util/strlen';
|
||||
import confirm from '../../util/input/confirm';
|
||||
import findAliasByAliasOrId from '../../util/alias/find-alias-by-alias-or-id';
|
||||
|
||||
import { Alias } from '../../types';
|
||||
import { Alias } from '@vercel-internals/types';
|
||||
import { isValidName } from '../../util/is-valid-name';
|
||||
import { getCommandName } from '../../util/pkg-name';
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import chalk from 'chalk';
|
||||
import { SetDifference } from 'utility-types';
|
||||
import { AliasRecord } from '../../util/alias/create-alias';
|
||||
import { Domain } from '../../types';
|
||||
import { Domain } from '@vercel-internals/types';
|
||||
import { Output } from '../../util/output';
|
||||
import * as ERRORS from '../../util/errors-ts';
|
||||
import assignAlias from '../../util/alias/assign-alias';
|
||||
|
||||
@@ -13,7 +13,7 @@ import logo from '../../util/output/logo';
|
||||
import getArgs from '../../util/get-args';
|
||||
import Client from '../../util/client';
|
||||
import { getPkgName } from '../../util/pkg-name';
|
||||
import { Deployment, PaginationOptions } from '../../types';
|
||||
import { Deployment, PaginationOptions } from '@vercel-internals/types';
|
||||
import { normalizeURL } from '../../util/bisect/normalize-url';
|
||||
import getScope from '../../util/get-scope';
|
||||
import getDeployment from '../../util/get-deployment';
|
||||
|
||||
@@ -5,7 +5,7 @@ import stamp from '../../util/output/stamp';
|
||||
import createCertFromFile from '../../util/certs/create-cert-from-file';
|
||||
import createCertForCns from '../../util/certs/create-cert-for-cns';
|
||||
import { getCommandName } from '../../util/pkg-name';
|
||||
import { Cert } from '../../types';
|
||||
import { Cert } from '@vercel-internals/types';
|
||||
|
||||
interface Options {
|
||||
'--overwrite'?: boolean;
|
||||
|
||||
@@ -10,7 +10,7 @@ import {
|
||||
import stamp from '../../util/output/stamp';
|
||||
import getCerts from '../../util/certs/get-certs';
|
||||
import strlen from '../../util/strlen';
|
||||
import { Cert } from '../../types';
|
||||
import { Cert } from '@vercel-internals/types';
|
||||
import getCommandFlags from '../../util/get-command-flags';
|
||||
import { getCommandName } from '../../util/pkg-name';
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import chalk from 'chalk';
|
||||
import ms from 'ms';
|
||||
import plural from 'pluralize';
|
||||
import table from 'text-table';
|
||||
import { Cert } from '../../types';
|
||||
import { Cert } from '@vercel-internals/types';
|
||||
import * as ERRORS from '../../util/errors-ts';
|
||||
import { Output } from '../../util/output';
|
||||
import deleteCertById from '../../util/certs/delete-cert-by-id';
|
||||
|
||||
@@ -5,7 +5,7 @@ import DevServer from '../../util/dev/server';
|
||||
import { parseListen } from '../../util/dev/parse-listen';
|
||||
import Client from '../../util/client';
|
||||
import { getLinkedProject } from '../../util/projects/link';
|
||||
import { ProjectSettings } from '../../types';
|
||||
import { ProjectSettings } from '@vercel-internals/types';
|
||||
import setupAndLink from '../../util/link/setup-and-link';
|
||||
import { getCommandName } from '../../util/pkg-name';
|
||||
import param from '../../util/output/param';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import chalk from 'chalk';
|
||||
import ms from 'ms';
|
||||
import { DomainNotFound } from '../../util/errors-ts';
|
||||
import { DNSRecord } from '../../types';
|
||||
import { DNSRecord } from '@vercel-internals/types';
|
||||
import Client from '../../util/client';
|
||||
import formatTable from '../../util/format-table';
|
||||
import getDNSRecords, {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import chalk from 'chalk';
|
||||
import ms from 'ms';
|
||||
import table from 'text-table';
|
||||
import { DNSRecord } from '../../types';
|
||||
import { DNSRecord } from '@vercel-internals/types';
|
||||
import { Output } from '../../util/output';
|
||||
import Client from '../../util/client';
|
||||
import deleteDNSRecordById from '../../util/dns/delete-dns-record-by-id';
|
||||
|
||||
@@ -8,7 +8,7 @@ import getScope from '../../util/get-scope';
|
||||
import stamp from '../../util/output/stamp';
|
||||
import formatTable from '../../util/format-table';
|
||||
import { formatDateWithoutTime } from '../../util/format-date';
|
||||
import { Domain } from '../../types';
|
||||
import { Domain } from '@vercel-internals/types';
|
||||
import getCommandFlags from '../../util/get-command-flags';
|
||||
import {
|
||||
PaginationOptions,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import chalk from 'chalk';
|
||||
import plural from 'pluralize';
|
||||
|
||||
import { User, Team } from '../../types';
|
||||
import { User, Team } from '@vercel-internals/types';
|
||||
import * as ERRORS from '../../util/errors-ts';
|
||||
import Client from '../../util/client';
|
||||
import getScope from '../../util/get-scope';
|
||||
|
||||
@@ -2,7 +2,7 @@ import chalk from 'chalk';
|
||||
import plural from 'pluralize';
|
||||
|
||||
import { DomainNotFound, DomainPermissionDenied } from '../../util/errors-ts';
|
||||
import { Domain } from '../../types';
|
||||
import { Domain } from '@vercel-internals/types';
|
||||
import { Output } from '../../util/output';
|
||||
import Client from '../../util/client';
|
||||
import deleteCertById from '../../util/certs/delete-cert-by-id';
|
||||
|
||||
2
packages/cli/src/commands/env/add.ts
vendored
2
packages/cli/src/commands/env/add.ts
vendored
@@ -1,5 +1,5 @@
|
||||
import chalk from 'chalk';
|
||||
import { ProjectEnvTarget, Project, ProjectEnvType } from '../../types';
|
||||
import { ProjectEnvTarget, Project, ProjectEnvType } from '@vercel-internals/types';
|
||||
import { Output } from '../../util/output';
|
||||
import Client from '../../util/client';
|
||||
import stamp from '../../util/output/stamp';
|
||||
|
||||
2
packages/cli/src/commands/env/ls.ts
vendored
2
packages/cli/src/commands/env/ls.ts
vendored
@@ -1,7 +1,7 @@
|
||||
import chalk from 'chalk';
|
||||
import ms from 'ms';
|
||||
import { Output } from '../../util/output';
|
||||
import { Project, ProjectEnvVariable, ProjectEnvType } from '../../types';
|
||||
import { Project, ProjectEnvVariable, ProjectEnvType } from '@vercel-internals/types';
|
||||
import Client from '../../util/client';
|
||||
import formatTable from '../../util/format-table';
|
||||
import getEnvRecords from '../../util/env/get-env-records';
|
||||
|
||||
2
packages/cli/src/commands/env/pull.ts
vendored
2
packages/cli/src/commands/env/pull.ts
vendored
@@ -2,7 +2,7 @@ import chalk from 'chalk';
|
||||
import { outputFile } from 'fs-extra';
|
||||
import { closeSync, openSync, readSync } from 'fs';
|
||||
import { resolve } from 'path';
|
||||
import { Project, ProjectEnvTarget } from '../../types';
|
||||
import { Project, ProjectEnvTarget } from '@vercel-internals/types';
|
||||
import Client from '../../util/client';
|
||||
import { emoji, prependEmoji } from '../../util/emoji';
|
||||
import confirm from '../../util/input/confirm';
|
||||
|
||||
2
packages/cli/src/commands/env/rm.ts
vendored
2
packages/cli/src/commands/env/rm.ts
vendored
@@ -1,5 +1,5 @@
|
||||
import chalk from 'chalk';
|
||||
import { Project } from '../../types';
|
||||
import { Project } from '@vercel-internals/types';
|
||||
import { Output } from '../../util/output';
|
||||
import confirm from '../../util/input/confirm';
|
||||
import removeEnvRecord from '../../util/env/remove-env-record';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { Dictionary } from '@vercel/client';
|
||||
import chalk from 'chalk';
|
||||
import { join } from 'path';
|
||||
import { Org, Project, ProjectLinkData } from '../../types';
|
||||
import { Org, Project, ProjectLinkData } from '@vercel-internals/types';
|
||||
import Client from '../../util/client';
|
||||
import { parseGitConfig, pluckRemoteUrls } from '../../util/create-git-meta';
|
||||
import confirm from '../../util/input/confirm';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import chalk from 'chalk';
|
||||
import { Org, Project } from '../../types';
|
||||
import { Org, Project } from '@vercel-internals/types';
|
||||
import Client from '../../util/client';
|
||||
import confirm from '../../util/input/confirm';
|
||||
import { getCommandName } from '../../util/pkg-name';
|
||||
|
||||
@@ -10,7 +10,7 @@ import getScope from '../util/get-scope';
|
||||
import { getPkgName, getCommandName } from '../util/pkg-name';
|
||||
import Client from '../util/client';
|
||||
import getDeployment from '../util/get-deployment';
|
||||
import { Build, Deployment } from '../types';
|
||||
import { Build, Deployment } from '@vercel-internals/types';
|
||||
import title from 'title';
|
||||
import { isErrnoException } from '@vercel/error-utils';
|
||||
import { URL } from 'url';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import chalk from 'chalk';
|
||||
import ms from 'ms';
|
||||
import table from 'text-table';
|
||||
import { Project } from '../../types';
|
||||
import { Project } from '@vercel-internals/types';
|
||||
import Client from '../../util/client';
|
||||
import getCommandFlags from '../../util/get-command-flags';
|
||||
import { getCommandName } from '../../util/pkg-name';
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import chalk from 'chalk';
|
||||
import { join } from 'path';
|
||||
import Client from '../util/client';
|
||||
import { ProjectEnvTarget } from '../types';
|
||||
import type { Project, ProjectEnvTarget } from '@vercel-internals/types';
|
||||
import { emoji, prependEmoji } from '../util/emoji';
|
||||
import getArgs from '../util/get-args';
|
||||
import logo from '../util/output/logo';
|
||||
@@ -10,7 +10,6 @@ import { getPkgName } from '../util/pkg-name';
|
||||
import { VERCEL_DIR, VERCEL_DIR_PROJECT } from '../util/projects/link';
|
||||
import { writeProjectSettings } from '../util/projects/project-settings';
|
||||
import envPull from './env/pull';
|
||||
import type { Project } from '../types';
|
||||
import {
|
||||
isValidEnvTarget,
|
||||
getEnvTargetPlaceholder,
|
||||
|
||||
@@ -12,17 +12,19 @@ import { isValidName } from '../util/is-valid-name';
|
||||
import removeProject from '../util/projects/remove-project';
|
||||
import getProjectByIdOrName from '../util/projects/get-project-by-id-or-name';
|
||||
import getDeployment from '../util/get-deployment';
|
||||
import getDeploymentsByProjectId, {
|
||||
DeploymentPartial,
|
||||
} from '../util/deploy/get-deployments-by-project-id';
|
||||
import getDeploymentsByProjectId from '../util/deploy/get-deployments-by-project-id';
|
||||
import { getPkgName, getCommandName } from '../util/pkg-name';
|
||||
import getArgs from '../util/get-args';
|
||||
import handleError from '../util/handle-error';
|
||||
import type Client from '../util/client';
|
||||
import { Output } from '../util/output';
|
||||
import { Alias, Project } from '../types';
|
||||
import { Alias, Deployment, Project } from '@vercel-internals/types';
|
||||
import { NowError } from '../util/now-error';
|
||||
|
||||
type DeploymentWithAliases = Deployment & {
|
||||
aliases: Alias[];
|
||||
};
|
||||
|
||||
const help = () => {
|
||||
console.log(`
|
||||
${chalk.bold(
|
||||
@@ -125,11 +127,11 @@ export default async function main(client: Client) {
|
||||
|
||||
let aliases: Alias[][];
|
||||
let projects: Project[];
|
||||
let deployments: DeploymentPartial[];
|
||||
let deployments: DeploymentWithAliases[];
|
||||
const findStart = Date.now();
|
||||
|
||||
try {
|
||||
const searchFilter = (d: DeploymentPartial) =>
|
||||
const searchFilter = (d: Deployment) =>
|
||||
ids.some(
|
||||
id =>
|
||||
d &&
|
||||
@@ -167,9 +169,15 @@ export default async function main(client: Client) {
|
||||
})
|
||||
);
|
||||
|
||||
projectDeployments
|
||||
.slice(0, 201)
|
||||
.map(pDeployments => deployments.push(...pDeployments));
|
||||
// only process the first 201 projects
|
||||
const to = Math.min(projectDeployments.length, 201);
|
||||
for (let i = 0; i < to; i++) {
|
||||
for (const pDepl of projectDeployments[i]) {
|
||||
const depl = pDepl as DeploymentWithAliases;
|
||||
depl.aliases = [];
|
||||
deployments.push(depl);
|
||||
}
|
||||
}
|
||||
|
||||
projects = [];
|
||||
} else {
|
||||
@@ -260,7 +268,7 @@ export default async function main(client: Client) {
|
||||
}
|
||||
|
||||
function readConfirmation(
|
||||
deployments: DeploymentPartial[],
|
||||
deployments: DeploymentWithAliases[],
|
||||
projects: Project[],
|
||||
output: Output
|
||||
): Promise<string> {
|
||||
@@ -325,7 +333,7 @@ function readConfirmation(
|
||||
}
|
||||
|
||||
function deploymentsAndProjects(
|
||||
deployments: DeploymentPartial[],
|
||||
deployments: DeploymentWithAliases[],
|
||||
projects: Project[],
|
||||
conjunction = 'and'
|
||||
) {
|
||||
|
||||
@@ -7,7 +7,7 @@ import { emoji } from '../../util/emoji';
|
||||
import getUser from '../../util/get-user';
|
||||
import getTeams from '../../util/teams/get-teams';
|
||||
import listInput from '../../util/input/list';
|
||||
import { Team, GlobalConfig } from '../../types';
|
||||
import { Team, GlobalConfig } from '@vercel-internals/types';
|
||||
import { writeToConfigFile } from '../../util/config/files';
|
||||
|
||||
const updateCurrentTeam = (config: GlobalConfig, team?: Team) => {
|
||||
|
||||
@@ -50,7 +50,7 @@ import getUpdateCommand from './util/get-update-command';
|
||||
import { metrics, shouldCollectMetrics } from './util/metrics';
|
||||
import { getCommandName, getTitleName } from './util/pkg-name';
|
||||
import doLoginPrompt from './util/login/prompt';
|
||||
import { AuthConfig, GlobalConfig } from './types';
|
||||
import { AuthConfig, GlobalConfig } from '@vercel-internals/types';
|
||||
import { VercelConfig } from '@vercel/client';
|
||||
import box from './util/output/box';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Deployment } from '../../types';
|
||||
import type { Deployment } from '@vercel-internals/types';
|
||||
import { Output } from '../output';
|
||||
import Client from '../client';
|
||||
import createAlias from './create-alias';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Deployment } from '../../types';
|
||||
import type { Deployment } from '@vercel-internals/types';
|
||||
import { Output } from '../output';
|
||||
import * as ERRORS from '../errors-ts';
|
||||
import Client from '../client';
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Output } from '../output';
|
||||
import { Alias } from '../../types';
|
||||
import { Alias } from '@vercel-internals/types';
|
||||
|
||||
import Client from '../client';
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Alias, PaginationOptions } from '../../types';
|
||||
import { Alias, PaginationOptions } from '@vercel-internals/types';
|
||||
import Client from '../client';
|
||||
|
||||
type Response = {
|
||||
|
||||
@@ -2,7 +2,7 @@ import path from 'path';
|
||||
import chalk from 'chalk';
|
||||
import Client from '../client';
|
||||
import { Output } from '../output';
|
||||
import { User } from '../../types';
|
||||
import { User } from '@vercel-internals/types';
|
||||
import { VercelConfig } from '../dev/types';
|
||||
import getDeploymentsByAppName from '../deploy/get-deployments-by-appname';
|
||||
import getDeployment from '../get-deployment';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import Client from '../client';
|
||||
import getAliases from './get-aliases';
|
||||
import { Alias } from '../../types';
|
||||
import { Alias } from '@vercel-internals/types';
|
||||
|
||||
export default async function getDomainAliases(client: Client, domain: string) {
|
||||
const { aliases } = await getAliases(client);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Build } from '../types';
|
||||
import { Build } from '@vercel-internals/types';
|
||||
|
||||
export const isReady = ({ readyState }: Pick<Build, 'readyState'>) =>
|
||||
readyState === 'READY';
|
||||
|
||||
@@ -9,6 +9,7 @@ import { ProjectLinkAndSettings } from '../projects/project-settings';
|
||||
import { Output } from '../output';
|
||||
import title from 'title';
|
||||
import { PartialProjectSettings } from '../input/edit-project-settings';
|
||||
import { debug } from '@vercel/build-utils';
|
||||
|
||||
export async function setMonorepoDefaultSettings(
|
||||
cwd: string,
|
||||
@@ -26,8 +27,8 @@ export async function setMonorepoDefaultSettings(
|
||||
value: string
|
||||
) => {
|
||||
if (projectSettings[command]) {
|
||||
output.warn(
|
||||
`Cannot automatically assign ${command} as it is already set via project settings or configuration overrides.`
|
||||
debug(
|
||||
`Skipping auto-assignment of ${command} as it is already set via project settings or configuration overrides.`
|
||||
);
|
||||
} else {
|
||||
projectSettings[command] = value;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { readFileSync } from 'fs';
|
||||
import { resolve } from 'path';
|
||||
import Client from '../client';
|
||||
import { Cert } from '../../types';
|
||||
import { Cert } from '@vercel-internals/types';
|
||||
import { isErrnoException } from '@vercel/error-utils';
|
||||
import { isAPIError } from '../errors-ts';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import chalk from 'chalk';
|
||||
|
||||
import { Cert } from '../../types';
|
||||
import { Cert } from '@vercel-internals/types';
|
||||
import * as ERRORS from '../errors-ts';
|
||||
import Client from '../client';
|
||||
import mapCertError from './map-cert-error';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Cert } from '../../types';
|
||||
import { Cert } from '@vercel-internals/types';
|
||||
import Client from '../client';
|
||||
import * as ERRORS from '../errors-ts';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { stringify } from 'querystring';
|
||||
import { Cert } from '../../types';
|
||||
import { Cert } from '@vercel-internals/types';
|
||||
import Client from '../client';
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Client from '../client';
|
||||
import { Cert, PaginationOptions } from '../../types';
|
||||
import { Cert, PaginationOptions } from '@vercel-internals/types';
|
||||
|
||||
type Response = {
|
||||
certs: Cert[];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { stringify } from 'querystring';
|
||||
import { Cert } from '../../types';
|
||||
import { Cert } from '@vercel-internals/types';
|
||||
import * as ERRORS from '../errors-ts';
|
||||
import Client from '../client';
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import retry from 'async-retry';
|
||||
import { Cert } from '../../types';
|
||||
import { Cert } from '@vercel-internals/types';
|
||||
import Client from '../client';
|
||||
import { isAPIError } from '../errors-ts';
|
||||
import { isError } from '@vercel/error-utils';
|
||||
|
||||
@@ -19,7 +19,7 @@ import type {
|
||||
Stdio,
|
||||
ReadableTTY,
|
||||
WritableTTY,
|
||||
} from '../types';
|
||||
} from '@vercel-internals/types';
|
||||
import { sharedPromise } from './promise';
|
||||
import { APIError } from './errors-ts';
|
||||
import { normalizeError } from '@vercel/error-utils';
|
||||
|
||||
@@ -9,7 +9,7 @@ import { NowError } from '../now-error';
|
||||
import error from '../output/error';
|
||||
import highlight from '../output/highlight';
|
||||
import { VercelConfig } from '../dev/types';
|
||||
import { AuthConfig, GlobalConfig } from '../../types';
|
||||
import { AuthConfig, GlobalConfig } from '@vercel-internals/types';
|
||||
import { isErrnoException, isError } from '@vercel/error-utils';
|
||||
|
||||
const VERCEL_DIR = getGlobalPathConfig();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { AuthConfig, GlobalConfig } from '../../types';
|
||||
import { AuthConfig, GlobalConfig } from '@vercel-internals/types';
|
||||
|
||||
export const defaultGlobalConfig: GlobalConfig = {
|
||||
'// Note':
|
||||
|
||||
@@ -3,7 +3,7 @@ import { join } from 'path';
|
||||
import ini from 'ini';
|
||||
import git from 'git-last-commit';
|
||||
import { exec } from 'child_process';
|
||||
import { GitMetadata, Project } from '../types';
|
||||
import { GitMetadata, Project } from '@vercel-internals/types';
|
||||
import { Output } from './output';
|
||||
import { errorToString, normalizeError } from '@vercel/error-utils';
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ import * as ERRORS_TS from '../errors-ts';
|
||||
import * as ERRORS from '../errors';
|
||||
import { NowError } from '../now-error';
|
||||
import mapCertError from '../certs/map-cert-error';
|
||||
import { Org } from '../../types';
|
||||
import { Org } from '@vercel-internals/types';
|
||||
import Now, { CreateOptions } from '..';
|
||||
import Client from '../client';
|
||||
import { ArchiveFormat, DeploymentError } from '@vercel/client';
|
||||
|
||||
@@ -1,17 +1,31 @@
|
||||
import { URLSearchParams } from 'url';
|
||||
import { Alias } from '../../types';
|
||||
import { Deployment } from '@vercel-internals/types';
|
||||
import Client from '../client';
|
||||
|
||||
type Response = {
|
||||
deployments: DeploymentPartial[];
|
||||
};
|
||||
export interface DeploymentPartial {
|
||||
id: string;
|
||||
name: string;
|
||||
url: string;
|
||||
type LegacyDeployment = {
|
||||
aliasAssigned?: number | boolean | null;
|
||||
aliasError?: {
|
||||
code: string;
|
||||
message: string;
|
||||
} | null;
|
||||
buildingAt: number;
|
||||
checksConclusion?: 'succeeded' | 'failed' | 'skipped' | 'canceled';
|
||||
checksState?: 'registered' | 'running' | 'completed';
|
||||
created: number;
|
||||
createdAt: number;
|
||||
aliases: Alias[];
|
||||
createdAt?: number;
|
||||
creator: {
|
||||
uid: string;
|
||||
email?: string;
|
||||
username?: string;
|
||||
githubLogin?: string;
|
||||
gitlabLogin?: string;
|
||||
};
|
||||
inspectorUrl: string | null;
|
||||
isRollbackCandidate?: boolean | null;
|
||||
meta?: { [key: string]: string | undefined };
|
||||
name: string;
|
||||
ready?: number;
|
||||
source?: 'cli' | 'git' | 'import' | 'import/repo' | 'clone/repo';
|
||||
state:
|
||||
| 'BUILDING'
|
||||
| 'ERROR'
|
||||
@@ -19,8 +33,15 @@ export interface DeploymentPartial {
|
||||
| 'QUEUED'
|
||||
| 'READY'
|
||||
| 'CANCELED';
|
||||
creator: { uid: string };
|
||||
}
|
||||
target?: 'production' | 'staging' | null;
|
||||
type: 'LAMBDAS';
|
||||
uid: string;
|
||||
url: string;
|
||||
};
|
||||
|
||||
type Response = {
|
||||
deployments: LegacyDeployment[];
|
||||
};
|
||||
|
||||
interface Options {
|
||||
from?: number | null;
|
||||
@@ -34,7 +55,7 @@ export default async function getDeploymentsByProjectId(
|
||||
projectId: string,
|
||||
options: Options = { from: null, limit: 100, continue: false },
|
||||
total: number = 0
|
||||
): Promise<DeploymentPartial[]> {
|
||||
): Promise<Deployment[]> {
|
||||
const limit = options.limit || 100;
|
||||
|
||||
const query = new URLSearchParams();
|
||||
@@ -45,9 +66,40 @@ export default async function getDeploymentsByProjectId(
|
||||
query.set('from', options.from.toString());
|
||||
}
|
||||
|
||||
const { deployments } = await client.fetch<Response>(
|
||||
`/v4/now/deployments?${query}`
|
||||
const { deployments: legacyDeployments } = await client.fetch<Response>(
|
||||
`/v6/deployments?${query}`
|
||||
);
|
||||
|
||||
// we need to transform the old deployment shape to the new shape
|
||||
const deployments: Deployment[] = legacyDeployments.map(depl => {
|
||||
return {
|
||||
aliasAssigned: depl.aliasAssigned,
|
||||
aliasError: depl.aliasError,
|
||||
buildingAt: depl.buildingAt,
|
||||
checksConclusion: depl.checksConclusion,
|
||||
checksState: depl.checksState,
|
||||
createdAt: depl.created,
|
||||
creator: {
|
||||
uid: depl.creator.uid,
|
||||
username: depl.creator.username,
|
||||
},
|
||||
id: depl.uid,
|
||||
inspectorUrl: depl.inspectorUrl,
|
||||
meta: depl.meta,
|
||||
name: depl.name,
|
||||
public: true,
|
||||
ready: depl.ready,
|
||||
readyState: depl.state,
|
||||
regions: [],
|
||||
source: depl.source,
|
||||
status: depl.state,
|
||||
target: depl.target,
|
||||
type: depl.type,
|
||||
url: depl.url,
|
||||
version: 2,
|
||||
};
|
||||
});
|
||||
|
||||
total += deployments.length;
|
||||
|
||||
if (options.max && total >= options.max) {
|
||||
@@ -55,7 +107,7 @@ export default async function getDeploymentsByProjectId(
|
||||
}
|
||||
|
||||
if (options.continue && deployments.length === limit) {
|
||||
const nextFrom = deployments[deployments.length - 1].created;
|
||||
const nextFrom = deployments[deployments.length - 1].createdAt;
|
||||
const nextOptions = Object.assign({}, options, { from: nextFrom });
|
||||
deployments.push(
|
||||
...(await getDeploymentsByProjectId(
|
||||
|
||||
@@ -9,7 +9,7 @@ import {
|
||||
import { Output } from '../output';
|
||||
import { progress } from '../output/progress';
|
||||
import Now from '../../util';
|
||||
import { Org } from '../../types';
|
||||
import { Org } from '@vercel-internals/types';
|
||||
import ua from '../ua';
|
||||
import { linkFolderToProject } from '../projects/link';
|
||||
import { prependEmoji, emoji } from '../emoji';
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import { contentType } from 'mime-types';
|
||||
import path from 'path';
|
||||
|
||||
export default function getMimeType(fileName: string) {
|
||||
return contentType(fileName) || 'application/octet-stream';
|
||||
const extension = path.extname(fileName);
|
||||
return contentType(extension) || 'application/octet-stream';
|
||||
}
|
||||
|
||||
@@ -85,7 +85,7 @@ import {
|
||||
HttpHeadersConfig,
|
||||
EnvConfigs,
|
||||
} from './types';
|
||||
import { ProjectSettings } from '../../types';
|
||||
import { ProjectSettings } from '@vercel-internals/types';
|
||||
import { treeKill } from '../tree-kill';
|
||||
import { applyOverriddenHeaders, nodeHeadersToFetchHeaders } from './headers';
|
||||
import { formatQueryString, parseQueryString } from './parse-query-string';
|
||||
|
||||
@@ -6,6 +6,4 @@
|
||||
{{?}}
|
||||
<span class="devinfo-line">ID: <code>{{! it.request_id }}</code>
|
||||
</p>
|
||||
|
||||
<a href="https://vercel.link/404"><div class="note">Click here to learn more about this error.</div></a>
|
||||
</main>
|
||||
|
||||
@@ -16,7 +16,7 @@ import {
|
||||
import { VercelConfig } from '@vercel/client';
|
||||
import { HandleValue, Route } from '@vercel/routing-utils';
|
||||
import { Output } from '../output';
|
||||
import { ProjectSettings } from '../../types';
|
||||
import { ProjectSettings } from '@vercel-internals/types';
|
||||
import { BuilderWithPkg } from '../build/import-builders';
|
||||
|
||||
export { VercelConfig };
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
DNSConflictingRecord,
|
||||
isAPIError,
|
||||
} from '../errors-ts';
|
||||
import { DNSRecordData } from '../../types';
|
||||
import { DNSRecordData } from '@vercel-internals/types';
|
||||
|
||||
type Response = {
|
||||
uid: string;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import chalk from 'chalk';
|
||||
import { DNSRecordData } from '../../types';
|
||||
import { DNSRecordData } from '@vercel-internals/types';
|
||||
import textInput from '../input/text';
|
||||
import promptBool from '../input/prompt-bool';
|
||||
import Client from '../client';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DNSRecord } from '../../types';
|
||||
import { DNSRecord } from '@vercel-internals/types';
|
||||
import Client from '../client';
|
||||
|
||||
export default async function getDNSRecordById(
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DNSRecord } from '../../types';
|
||||
import { DNSRecord } from '@vercel-internals/types';
|
||||
import { DomainNotFound } from '../errors-ts';
|
||||
import { Output } from '../output';
|
||||
import Client from '../client';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DNSRecord, PaginationOptions } from '../../types';
|
||||
import { DNSRecord, PaginationOptions } from '@vercel-internals/types';
|
||||
import { DomainNotFound, isAPIError } from '../errors-ts';
|
||||
import { Output } from '../output';
|
||||
import Client from '../client';
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { DNSRecordData } from '../../types';
|
||||
import { DNSRecordData } from '@vercel-internals/types';
|
||||
|
||||
export default function parseAddArgs(
|
||||
args: string[]
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import chalk from 'chalk';
|
||||
import retry from 'async-retry';
|
||||
import { DomainAlreadyExists, InvalidDomain, isAPIError } from '../errors-ts';
|
||||
import { Domain } from '../../types';
|
||||
import { Domain } from '@vercel-internals/types';
|
||||
import Client from '../client';
|
||||
|
||||
type Response = {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import chalk from 'chalk';
|
||||
import Client from '../client';
|
||||
import { Domain } from '../../types';
|
||||
import { Domain } from '@vercel-internals/types';
|
||||
import {
|
||||
DomainPermissionDenied,
|
||||
DomainNotFound,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Client from '../client';
|
||||
import { DomainConfig } from '../../types';
|
||||
import { DomainConfig } from '@vercel-internals/types';
|
||||
import { isAPIError } from '../errors-ts';
|
||||
|
||||
export async function getDomainConfig(client: Client, domainName: string) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Domain } from '../../types';
|
||||
import { Domain } from '@vercel-internals/types';
|
||||
|
||||
export type DomainRegistrar = 'Vercel' | 'Purchase in Process' | 'Third Party';
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import chalk from 'chalk';
|
||||
import Client from '../client';
|
||||
import { Domain } from '../../types';
|
||||
import { Domain } from '@vercel-internals/types';
|
||||
import { isAPIError } from '../errors-ts';
|
||||
|
||||
type Response = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Domain, PaginationOptions } from '../../types';
|
||||
import { Domain, PaginationOptions } from '@vercel-internals/types';
|
||||
import Client from '../client';
|
||||
|
||||
type Response = {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Domain } from '../../types';
|
||||
import { Domain } from '@vercel-internals/types';
|
||||
|
||||
export default function isDomainExternal(domain: Domain) {
|
||||
return domain.serviceType !== 'zeit.world';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import psl from 'psl';
|
||||
import { NowError } from '../now-error';
|
||||
import { Domain } from '../../types';
|
||||
import { Domain } from '@vercel-internals/types';
|
||||
import { Output } from '../output';
|
||||
import * as ERRORS from '../errors-ts';
|
||||
import addDomain from './add-domain';
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import * as ERRORS from '../errors-ts';
|
||||
import Client from '../client';
|
||||
import { Domain } from '../../types';
|
||||
import { Domain } from '@vercel-internals/types';
|
||||
|
||||
type Response = {
|
||||
domain: Domain;
|
||||
|
||||
2
packages/cli/src/util/env/add-env-record.ts
vendored
2
packages/cli/src/util/env/add-env-record.ts
vendored
@@ -4,7 +4,7 @@ import {
|
||||
ProjectEnvTarget,
|
||||
ProjectEnvVariable,
|
||||
ProjectEnvType,
|
||||
} from '../../types';
|
||||
} from '@vercel-internals/types';
|
||||
|
||||
export default async function addEnvRecord(
|
||||
output: Output,
|
||||
|
||||
2
packages/cli/src/util/env/env-target.ts
vendored
2
packages/cli/src/util/env/env-target.ts
vendored
@@ -1,4 +1,4 @@
|
||||
import { ProjectEnvTarget } from '../../types';
|
||||
import { ProjectEnvTarget } from '@vercel-internals/types';
|
||||
|
||||
function envTargets(): string[] {
|
||||
return Object.values(ProjectEnvTarget);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import title from 'title';
|
||||
import { ProjectEnvVariable } from '../../types';
|
||||
import { ProjectEnvVariable } from '@vercel-internals/types';
|
||||
|
||||
export default function formatEnvTarget(env: ProjectEnvVariable): string {
|
||||
const target = (Array.isArray(env.target) ? env.target : [env.target || ''])
|
||||
|
||||
2
packages/cli/src/util/env/get-env-records.ts
vendored
2
packages/cli/src/util/env/get-env-records.ts
vendored
@@ -1,6 +1,6 @@
|
||||
import { Output } from '../output';
|
||||
import Client from '../client';
|
||||
import { ProjectEnvVariable, ProjectEnvTarget } from '../../types';
|
||||
import { ProjectEnvVariable, ProjectEnvTarget } from '@vercel-internals/types';
|
||||
import { URLSearchParams } from 'url';
|
||||
|
||||
/** The CLI command that was used that needs the environment variables. */
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { Output } from '../output';
|
||||
import Client from '../client';
|
||||
import { ProjectEnvVariable } from '../../types';
|
||||
import { ProjectEnvVariable } from '@vercel-internals/types';
|
||||
|
||||
export default async function removeEnvRecord(
|
||||
output: Output,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user