mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-12 12:57:47 +00:00
Compare commits
102 Commits
@vercel/py
...
@vercel/py
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
21a440b832 | ||
|
|
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 | ||
|
|
db65728fc4 | ||
|
|
a788d06f85 |
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 }}
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
|
||||||
# See https://github.com/actions/github-script#run-a-separate-file-with-an-async-function
|
# See https://github.com/actions/github-script#run-a-separate-file-with-an-async-function
|
||||||
with:
|
with:
|
||||||
|
github-token: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
|
||||||
script: |
|
script: |
|
||||||
const script = require('./utils/update-next.js')
|
const script = require('./utils/update-next.js')
|
||||||
await script({ github, context })
|
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 }}
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
|
||||||
# See https://github.com/actions/github-script#run-a-separate-file-with-an-async-function
|
# See https://github.com/actions/github-script#run-a-separate-file-with-an-async-function
|
||||||
with:
|
with:
|
||||||
|
github-token: ${{ secrets.GH_TOKEN_PULL_REQUESTS }}
|
||||||
script: |
|
script: |
|
||||||
const script = require('./utils/update-turbo.js')
|
const script = require('./utils/update-turbo.js')
|
||||||
await script({ github, context })
|
await script({ github, context })
|
||||||
|
|||||||
5
.github/workflows/publish.yml
vendored
5
.github/workflows/publish.yml
vendored
@@ -16,6 +16,9 @@ jobs:
|
|||||||
publish:
|
publish:
|
||||||
name: Publish
|
name: Publish
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
id-token: write
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3
|
||||||
@@ -41,6 +44,8 @@ jobs:
|
|||||||
uses: actions/setup-node@v3
|
uses: actions/setup-node@v3
|
||||||
with:
|
with:
|
||||||
node-version: 16
|
node-version: 16
|
||||||
|
- name: install npm@9
|
||||||
|
run: npm i -g npm@9
|
||||||
- name: install pnpm@7.24.2
|
- name: install pnpm@7.24.2
|
||||||
run: npm i -g pnpm@7.24.2
|
run: npm i -g pnpm@7.24.2
|
||||||
- name: Install
|
- 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
|
save-exact=true
|
||||||
hoist-pattern[]=!"**/@types/**"
|
hoist-pattern[]=!"**/@types/**"
|
||||||
hoist-pattern[]=!"**/typedoc"
|
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
|
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
|
```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
|
```js
|
||||||
module.exports = {
|
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
|
```js
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"baseUrl": ".",
|
|
||||||
"paths": {
|
"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"
|
"lint": "next lint"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@next/font": "13.1.6",
|
"eslint": "8.35.0",
|
||||||
"eslint": "8.32.0",
|
"eslint-config-next": "13.2.3",
|
||||||
"eslint-config-next": "13.1.6",
|
"next": "13.2.3",
|
||||||
"next": "13.1.6",
|
|
||||||
"react": "18.2.0",
|
"react": "18.2.0",
|
||||||
"react-dom": "18.2.0"
|
"react-dom": "18.2.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import Head from 'next/head'
|
import Head from 'next/head'
|
||||||
import Image from 'next/image'
|
import Image from 'next/image'
|
||||||
import { Inter } from '@next/font/google'
|
import { Inter } from 'next/font/google'
|
||||||
import styles from '@/styles/Home.module.css'
|
import styles from '@/styles/Home.module.css'
|
||||||
|
|
||||||
const inter = Inter({ subsets: ['latin'] })
|
const inter = Inter({ subsets: ['latin'] })
|
||||||
|
|||||||
@@ -13,10 +13,10 @@ function hydrate() {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
if (window.requestIdleCallback) {
|
if (typeof requestIdleCallback === "function") {
|
||||||
window.requestIdleCallback(hydrate);
|
requestIdleCallback(hydrate);
|
||||||
} else {
|
} else {
|
||||||
// Safari doesn't support requestIdleCallback
|
// Safari doesn't support requestIdleCallback
|
||||||
// https://caniuse.com/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 { 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,
|
request: Request,
|
||||||
responseStatusCode: number,
|
responseStatusCode: number,
|
||||||
responseHeaders: Headers,
|
responseHeaders: Headers,
|
||||||
remixContext: EntryContext
|
remixContext: EntryContext
|
||||||
) {
|
) {
|
||||||
const markup = renderToString(
|
const remixServer = <RemixServer context={remixContext} url={request.url} />;
|
||||||
<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,
|
Scripts,
|
||||||
ScrollRestoration,
|
ScrollRestoration,
|
||||||
} from "@remix-run/react";
|
} from "@remix-run/react";
|
||||||
import { Analytics } from '@vercel/analytics/react';
|
import { Analytics } from "@vercel/analytics/react";
|
||||||
|
|
||||||
export const meta: MetaFunction = () => ({
|
export const meta: MetaFunction = () => ({
|
||||||
charset: "utf-8",
|
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"
|
"dev": "remix dev"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@remix-run/node": "^1.7.6",
|
"@remix-run/node": "^1.13.0",
|
||||||
"@remix-run/react": "^1.7.6",
|
"@remix-run/react": "^1.13.0",
|
||||||
"@remix-run/vercel": "^1.7.6",
|
"@remix-run/serve": "^1.13.0",
|
||||||
"@vercel/analytics": "^0.1.5",
|
"@remix-run/server-runtime": "^1.13.0",
|
||||||
"@vercel/node": "^2.7.0",
|
"@vercel/analytics": "^0.1.10",
|
||||||
|
"@vercel/remix-entry-server": "^0.1.0",
|
||||||
"react": "^18.2.0",
|
"react": "^18.2.0",
|
||||||
"react-dom": "^18.2.0"
|
"react-dom": "^18.2.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@remix-run/dev": "^1.7.6",
|
"@remix-run/dev": "^1.13.0",
|
||||||
"@remix-run/eslint-config": "^1.7.6",
|
"@remix-run/eslint-config": "^1.13.0",
|
||||||
"@remix-run/serve": "^1.7.6",
|
|
||||||
"@types/react": "^18.0.25",
|
"@types/react": "^18.0.25",
|
||||||
"@types/react-dom": "^18.0.9",
|
"@types/react-dom": "^18.0.11",
|
||||||
"eslint": "^8.28.0",
|
"eslint": "^8.28.0",
|
||||||
"typescript": "^4.9.3"
|
"typescript": "^4.9.3"
|
||||||
},
|
},
|
||||||
|
|||||||
3548
examples/remix/pnpm-lock.yaml
generated
3548
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 = {
|
module.exports = {
|
||||||
serverBuildTarget: "vercel",
|
ignoredRouteFiles: ['**/.*'],
|
||||||
// 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: ["**/.*"],
|
|
||||||
// appDirectory: "app",
|
// appDirectory: "app",
|
||||||
// assetsBuildDirectory: "public/build",
|
// assetsBuildDirectory: "public/build",
|
||||||
// serverBuildPath: "api/index.js",
|
// serverBuildPath: "build/index.js",
|
||||||
// publicPath: "/build/",
|
// 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;
|
createdAt: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO (Ethan-Arrowood) - Replace enums
|
||||||
export enum ProjectEnvTarget {
|
export enum ProjectEnvTarget {
|
||||||
Production = 'production',
|
Production = 'production',
|
||||||
Preview = 'preview',
|
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",
|
"source-map-support": "0.5.12",
|
||||||
"ts-eager": "2.0.2",
|
"ts-eager": "2.0.2",
|
||||||
"ts-jest": "28.0.5",
|
"ts-jest": "28.0.5",
|
||||||
"turbo": "1.7.4"
|
"turbo": "1.8.3"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"lerna": "lerna",
|
"lerna": "lerna",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@vercel/build-utils",
|
"name": "@vercel/build-utils",
|
||||||
"version": "6.3.0",
|
"version": "6.3.4",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"main": "./dist/index.js",
|
"main": "./dist/index.js",
|
||||||
"types": "./dist/index.d.js",
|
"types": "./dist/index.d.js",
|
||||||
|
|||||||
@@ -25,13 +25,17 @@ export async function readConfigFile<T>(
|
|||||||
|
|
||||||
if (data) {
|
if (data) {
|
||||||
const str = data.toString('utf8');
|
const str = data.toString('utf8');
|
||||||
|
try {
|
||||||
if (name.endsWith('.json')) {
|
if (name.endsWith('.json')) {
|
||||||
return JSON.parse(str) as T;
|
return JSON.parse(str) as T;
|
||||||
} else if (name.endsWith('.toml')) {
|
} else if (name.endsWith('.toml')) {
|
||||||
return (toml.parse(str) as unknown) as T;
|
return toml.parse(str) as unknown as T;
|
||||||
} else if (name.endsWith('.yaml') || name.endsWith('.yml')) {
|
} else if (name.endsWith('.yaml') || name.endsWith('.yml')) {
|
||||||
return yaml.safeLoad(str, { filename: name }) as T;
|
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 ImageFormat = 'image/avif' | 'image/webp';
|
||||||
|
|
||||||
|
type ImageContentDispositionType = 'inline' | 'attachment';
|
||||||
|
|
||||||
export type RemotePattern = {
|
export type RemotePattern = {
|
||||||
/**
|
/**
|
||||||
* Must be `http` or `https`.
|
* Must be `http` or `https`.
|
||||||
@@ -390,6 +392,7 @@ export interface Images {
|
|||||||
formats?: ImageFormat[];
|
formats?: ImageFormat[];
|
||||||
dangerouslyAllowSVG?: boolean;
|
dangerouslyAllowSVG?: boolean;
|
||||||
contentSecurityPolicy?: string;
|
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');
|
console.log('Skipping test on windows');
|
||||||
return;
|
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 fixture = path.join(__dirname, 'fixtures', '15-npm-8-legacy-peer-deps');
|
||||||
const nodeVersion = { major: nodeMajor } as any;
|
const nodeVersion = { major: nodeMajor } as any;
|
||||||
await runNpmInstall(fixture, [], {}, {}, nodeVersion);
|
await runNpmInstall(fixture, [], {}, {}, nodeVersion);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "vercel",
|
"name": "vercel",
|
||||||
"version": "28.16.0",
|
"version": "28.16.15",
|
||||||
"preferGlobal": true,
|
"preferGlobal": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"description": "The command-line interface for Vercel",
|
"description": "The command-line interface for Vercel",
|
||||||
@@ -41,16 +41,16 @@
|
|||||||
"node": ">= 14"
|
"node": ">= 14"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vercel/build-utils": "6.3.0",
|
"@vercel/build-utils": "6.3.4",
|
||||||
"@vercel/go": "2.3.7",
|
"@vercel/go": "2.3.11",
|
||||||
"@vercel/hydrogen": "0.0.53",
|
"@vercel/hydrogen": "0.0.57",
|
||||||
"@vercel/next": "3.4.7",
|
"@vercel/next": "3.6.6",
|
||||||
"@vercel/node": "2.9.6",
|
"@vercel/node": "2.9.12",
|
||||||
"@vercel/python": "3.1.49",
|
"@vercel/python": "3.1.53",
|
||||||
"@vercel/redwood": "1.1.5",
|
"@vercel/redwood": "1.1.9",
|
||||||
"@vercel/remix": "1.3.3",
|
"@vercel/remix": "1.6.2",
|
||||||
"@vercel/ruby": "1.3.65",
|
"@vercel/ruby": "1.3.70",
|
||||||
"@vercel/static-build": "1.3.9"
|
"@vercel/static-build": "1.3.16"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@alex_neo/jest-expect-message": "1.0.5",
|
"@alex_neo/jest-expect-message": "1.0.5",
|
||||||
@@ -93,13 +93,14 @@
|
|||||||
"@types/which": "1.3.2",
|
"@types/which": "1.3.2",
|
||||||
"@types/write-json-file": "2.2.1",
|
"@types/write-json-file": "2.2.1",
|
||||||
"@types/yauzl-promise": "2.1.0",
|
"@types/yauzl-promise": "2.1.0",
|
||||||
"@vercel/client": "12.4.0",
|
"@vercel-internals/types": "*",
|
||||||
|
"@vercel/client": "12.4.4",
|
||||||
"@vercel/error-utils": "1.0.8",
|
"@vercel/error-utils": "1.0.8",
|
||||||
"@vercel/frameworks": "1.3.1",
|
"@vercel/frameworks": "1.3.2",
|
||||||
"@vercel/fs-detectors": "3.7.14",
|
"@vercel/fs-detectors": "3.8.4",
|
||||||
"@vercel/fun": "1.0.4",
|
"@vercel/fun": "1.0.4",
|
||||||
"@vercel/ncc": "0.24.0",
|
"@vercel/ncc": "0.24.0",
|
||||||
"@vercel/routing-utils": "2.1.9",
|
"@vercel/routing-utils": "2.1.10",
|
||||||
"@zeit/source-map-support": "0.6.2",
|
"@zeit/source-map-support": "0.6.2",
|
||||||
"ajv": "6.12.2",
|
"ajv": "6.12.2",
|
||||||
"alpha-sort": "2.0.1",
|
"alpha-sort": "2.0.1",
|
||||||
@@ -140,7 +141,6 @@
|
|||||||
"is-url": "1.2.2",
|
"is-url": "1.2.2",
|
||||||
"jaro-winkler": "0.2.8",
|
"jaro-winkler": "0.2.8",
|
||||||
"jest-matcher-utils": "29.3.1",
|
"jest-matcher-utils": "29.3.1",
|
||||||
"json5": "2.2.1",
|
|
||||||
"jsonlines": "0.1.1",
|
"jsonlines": "0.1.1",
|
||||||
"line-async-iterator": "3.0.0",
|
"line-async-iterator": "3.0.0",
|
||||||
"load-json-file": "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 strlen from '../../util/strlen';
|
||||||
import getCommandFlags from '../../util/get-command-flags';
|
import getCommandFlags from '../../util/get-command-flags';
|
||||||
import { getCommandName } from '../../util/pkg-name';
|
import { getCommandName } from '../../util/pkg-name';
|
||||||
import { Alias } from '../../types';
|
import { Alias } from '@vercel-internals/types';
|
||||||
|
|
||||||
export default async function ls(
|
export default async function ls(
|
||||||
client: Client,
|
client: Client,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import strlen from '../../util/strlen';
|
|||||||
import confirm from '../../util/input/confirm';
|
import confirm from '../../util/input/confirm';
|
||||||
import findAliasByAliasOrId from '../../util/alias/find-alias-by-alias-or-id';
|
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 { isValidName } from '../../util/is-valid-name';
|
||||||
import { getCommandName } from '../../util/pkg-name';
|
import { getCommandName } from '../../util/pkg-name';
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import chalk from 'chalk';
|
import chalk from 'chalk';
|
||||||
import { SetDifference } from 'utility-types';
|
import { SetDifference } from 'utility-types';
|
||||||
import { AliasRecord } from '../../util/alias/create-alias';
|
import { AliasRecord } from '../../util/alias/create-alias';
|
||||||
import { Domain } from '../../types';
|
import { Domain } from '@vercel-internals/types';
|
||||||
import { Output } from '../../util/output';
|
import { Output } from '../../util/output';
|
||||||
import * as ERRORS from '../../util/errors-ts';
|
import * as ERRORS from '../../util/errors-ts';
|
||||||
import assignAlias from '../../util/alias/assign-alias';
|
import assignAlias from '../../util/alias/assign-alias';
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import logo from '../../util/output/logo';
|
|||||||
import getArgs from '../../util/get-args';
|
import getArgs from '../../util/get-args';
|
||||||
import Client from '../../util/client';
|
import Client from '../../util/client';
|
||||||
import { getPkgName } from '../../util/pkg-name';
|
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 { normalizeURL } from '../../util/bisect/normalize-url';
|
||||||
import getScope from '../../util/get-scope';
|
import getScope from '../../util/get-scope';
|
||||||
import getDeployment from '../../util/get-deployment';
|
import getDeployment from '../../util/get-deployment';
|
||||||
|
|||||||
@@ -751,12 +751,12 @@ function mergeImages(
|
|||||||
}
|
}
|
||||||
|
|
||||||
function mergeCrons(
|
function mergeCrons(
|
||||||
crons: BuildOutputConfig['crons'],
|
crons: BuildOutputConfig['crons'] = [],
|
||||||
buildResults: Iterable<BuildResult | BuildOutputConfig>
|
buildResults: Iterable<BuildResult | BuildOutputConfig>
|
||||||
): BuildOutputConfig['crons'] {
|
): BuildOutputConfig['crons'] {
|
||||||
for (const result of buildResults) {
|
for (const result of buildResults) {
|
||||||
if ('crons' in result && result.crons) {
|
if ('crons' in result && result.crons) {
|
||||||
crons = Object.assign({}, crons, result.crons);
|
crons = crons.concat(result.crons);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return crons;
|
return crons;
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import stamp from '../../util/output/stamp';
|
|||||||
import createCertFromFile from '../../util/certs/create-cert-from-file';
|
import createCertFromFile from '../../util/certs/create-cert-from-file';
|
||||||
import createCertForCns from '../../util/certs/create-cert-for-cns';
|
import createCertForCns from '../../util/certs/create-cert-for-cns';
|
||||||
import { getCommandName } from '../../util/pkg-name';
|
import { getCommandName } from '../../util/pkg-name';
|
||||||
import { Cert } from '../../types';
|
import { Cert } from '@vercel-internals/types';
|
||||||
|
|
||||||
interface Options {
|
interface Options {
|
||||||
'--overwrite'?: boolean;
|
'--overwrite'?: boolean;
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import {
|
|||||||
import stamp from '../../util/output/stamp';
|
import stamp from '../../util/output/stamp';
|
||||||
import getCerts from '../../util/certs/get-certs';
|
import getCerts from '../../util/certs/get-certs';
|
||||||
import strlen from '../../util/strlen';
|
import strlen from '../../util/strlen';
|
||||||
import { Cert } from '../../types';
|
import { Cert } from '@vercel-internals/types';
|
||||||
import getCommandFlags from '../../util/get-command-flags';
|
import getCommandFlags from '../../util/get-command-flags';
|
||||||
import { getCommandName } from '../../util/pkg-name';
|
import { getCommandName } from '../../util/pkg-name';
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import chalk from 'chalk';
|
|||||||
import ms from 'ms';
|
import ms from 'ms';
|
||||||
import plural from 'pluralize';
|
import plural from 'pluralize';
|
||||||
import table from 'text-table';
|
import table from 'text-table';
|
||||||
import { Cert } from '../../types';
|
import { Cert } from '@vercel-internals/types';
|
||||||
import * as ERRORS from '../../util/errors-ts';
|
import * as ERRORS from '../../util/errors-ts';
|
||||||
import { Output } from '../../util/output';
|
import { Output } from '../../util/output';
|
||||||
import deleteCertById from '../../util/certs/delete-cert-by-id';
|
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 { parseListen } from '../../util/dev/parse-listen';
|
||||||
import Client from '../../util/client';
|
import Client from '../../util/client';
|
||||||
import { getLinkedProject } from '../../util/projects/link';
|
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 setupAndLink from '../../util/link/setup-and-link';
|
||||||
import { getCommandName } from '../../util/pkg-name';
|
import { getCommandName } from '../../util/pkg-name';
|
||||||
import param from '../../util/output/param';
|
import param from '../../util/output/param';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import chalk from 'chalk';
|
import chalk from 'chalk';
|
||||||
import ms from 'ms';
|
import ms from 'ms';
|
||||||
import { DomainNotFound } from '../../util/errors-ts';
|
import { DomainNotFound } from '../../util/errors-ts';
|
||||||
import { DNSRecord } from '../../types';
|
import { DNSRecord } from '@vercel-internals/types';
|
||||||
import Client from '../../util/client';
|
import Client from '../../util/client';
|
||||||
import formatTable from '../../util/format-table';
|
import formatTable from '../../util/format-table';
|
||||||
import getDNSRecords, {
|
import getDNSRecords, {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import chalk from 'chalk';
|
import chalk from 'chalk';
|
||||||
import ms from 'ms';
|
import ms from 'ms';
|
||||||
import table from 'text-table';
|
import table from 'text-table';
|
||||||
import { DNSRecord } from '../../types';
|
import { DNSRecord } from '@vercel-internals/types';
|
||||||
import { Output } from '../../util/output';
|
import { Output } from '../../util/output';
|
||||||
import Client from '../../util/client';
|
import Client from '../../util/client';
|
||||||
import deleteDNSRecordById from '../../util/dns/delete-dns-record-by-id';
|
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 stamp from '../../util/output/stamp';
|
||||||
import formatTable from '../../util/format-table';
|
import formatTable from '../../util/format-table';
|
||||||
import { formatDateWithoutTime } from '../../util/format-date';
|
import { formatDateWithoutTime } from '../../util/format-date';
|
||||||
import { Domain } from '../../types';
|
import { Domain } from '@vercel-internals/types';
|
||||||
import getCommandFlags from '../../util/get-command-flags';
|
import getCommandFlags from '../../util/get-command-flags';
|
||||||
import {
|
import {
|
||||||
PaginationOptions,
|
PaginationOptions,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import chalk from 'chalk';
|
import chalk from 'chalk';
|
||||||
import plural from 'pluralize';
|
import plural from 'pluralize';
|
||||||
|
|
||||||
import { User, Team } from '../../types';
|
import { User, Team } from '@vercel-internals/types';
|
||||||
import * as ERRORS from '../../util/errors-ts';
|
import * as ERRORS from '../../util/errors-ts';
|
||||||
import Client from '../../util/client';
|
import Client from '../../util/client';
|
||||||
import getScope from '../../util/get-scope';
|
import getScope from '../../util/get-scope';
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import chalk from 'chalk';
|
|||||||
import plural from 'pluralize';
|
import plural from 'pluralize';
|
||||||
|
|
||||||
import { DomainNotFound, DomainPermissionDenied } from '../../util/errors-ts';
|
import { DomainNotFound, DomainPermissionDenied } from '../../util/errors-ts';
|
||||||
import { Domain } from '../../types';
|
import { Domain } from '@vercel-internals/types';
|
||||||
import { Output } from '../../util/output';
|
import { Output } from '../../util/output';
|
||||||
import Client from '../../util/client';
|
import Client from '../../util/client';
|
||||||
import deleteCertById from '../../util/certs/delete-cert-by-id';
|
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 chalk from 'chalk';
|
||||||
import { ProjectEnvTarget, Project, ProjectEnvType } from '../../types';
|
import { ProjectEnvTarget, Project, ProjectEnvType } from '@vercel-internals/types';
|
||||||
import { Output } from '../../util/output';
|
import { Output } from '../../util/output';
|
||||||
import Client from '../../util/client';
|
import Client from '../../util/client';
|
||||||
import stamp from '../../util/output/stamp';
|
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 chalk from 'chalk';
|
||||||
import ms from 'ms';
|
import ms from 'ms';
|
||||||
import { Output } from '../../util/output';
|
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 Client from '../../util/client';
|
||||||
import formatTable from '../../util/format-table';
|
import formatTable from '../../util/format-table';
|
||||||
import getEnvRecords from '../../util/env/get-env-records';
|
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 { outputFile } from 'fs-extra';
|
||||||
import { closeSync, openSync, readSync } from 'fs';
|
import { closeSync, openSync, readSync } from 'fs';
|
||||||
import { resolve } from 'path';
|
import { resolve } from 'path';
|
||||||
import { Project, ProjectEnvTarget } from '../../types';
|
import { Project, ProjectEnvTarget } from '@vercel-internals/types';
|
||||||
import Client from '../../util/client';
|
import Client from '../../util/client';
|
||||||
import { emoji, prependEmoji } from '../../util/emoji';
|
import { emoji, prependEmoji } from '../../util/emoji';
|
||||||
import confirm from '../../util/input/confirm';
|
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 chalk from 'chalk';
|
||||||
import { Project } from '../../types';
|
import { Project } from '@vercel-internals/types';
|
||||||
import { Output } from '../../util/output';
|
import { Output } from '../../util/output';
|
||||||
import confirm from '../../util/input/confirm';
|
import confirm from '../../util/input/confirm';
|
||||||
import removeEnvRecord from '../../util/env/remove-env-record';
|
import removeEnvRecord from '../../util/env/remove-env-record';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { Dictionary } from '@vercel/client';
|
import { Dictionary } from '@vercel/client';
|
||||||
import chalk from 'chalk';
|
import chalk from 'chalk';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
import { Org, Project, ProjectLinkData } from '../../types';
|
import { Org, Project, ProjectLinkData } from '@vercel-internals/types';
|
||||||
import Client from '../../util/client';
|
import Client from '../../util/client';
|
||||||
import { parseGitConfig, pluckRemoteUrls } from '../../util/create-git-meta';
|
import { parseGitConfig, pluckRemoteUrls } from '../../util/create-git-meta';
|
||||||
import confirm from '../../util/input/confirm';
|
import confirm from '../../util/input/confirm';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import chalk from 'chalk';
|
import chalk from 'chalk';
|
||||||
import { Org, Project } from '../../types';
|
import { Org, Project } from '@vercel-internals/types';
|
||||||
import Client from '../../util/client';
|
import Client from '../../util/client';
|
||||||
import confirm from '../../util/input/confirm';
|
import confirm from '../../util/input/confirm';
|
||||||
import { getCommandName } from '../../util/pkg-name';
|
import { getCommandName } from '../../util/pkg-name';
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ import getScope from '../util/get-scope';
|
|||||||
import { getPkgName, getCommandName } from '../util/pkg-name';
|
import { getPkgName, getCommandName } from '../util/pkg-name';
|
||||||
import Client from '../util/client';
|
import Client from '../util/client';
|
||||||
import getDeployment from '../util/get-deployment';
|
import getDeployment from '../util/get-deployment';
|
||||||
import { Build, Deployment } from '../types';
|
import { Build, Deployment } from '@vercel-internals/types';
|
||||||
import title from 'title';
|
import title from 'title';
|
||||||
import { isErrnoException } from '@vercel/error-utils';
|
import { isErrnoException } from '@vercel/error-utils';
|
||||||
import { URL } from 'url';
|
import { URL } from 'url';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import chalk from 'chalk';
|
import chalk from 'chalk';
|
||||||
import ms from 'ms';
|
import ms from 'ms';
|
||||||
import table from 'text-table';
|
import table from 'text-table';
|
||||||
import { Project } from '../../types';
|
import { Project } from '@vercel-internals/types';
|
||||||
import Client from '../../util/client';
|
import Client from '../../util/client';
|
||||||
import getCommandFlags from '../../util/get-command-flags';
|
import getCommandFlags from '../../util/get-command-flags';
|
||||||
import { getCommandName } from '../../util/pkg-name';
|
import { getCommandName } from '../../util/pkg-name';
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import chalk from 'chalk';
|
import chalk from 'chalk';
|
||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
import Client from '../util/client';
|
import Client from '../util/client';
|
||||||
import { ProjectEnvTarget } from '../types';
|
import type { Project, ProjectEnvTarget } from '@vercel-internals/types';
|
||||||
import { emoji, prependEmoji } from '../util/emoji';
|
import { emoji, prependEmoji } from '../util/emoji';
|
||||||
import getArgs from '../util/get-args';
|
import getArgs from '../util/get-args';
|
||||||
import logo from '../util/output/logo';
|
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 { VERCEL_DIR, VERCEL_DIR_PROJECT } from '../util/projects/link';
|
||||||
import { writeProjectSettings } from '../util/projects/project-settings';
|
import { writeProjectSettings } from '../util/projects/project-settings';
|
||||||
import envPull from './env/pull';
|
import envPull from './env/pull';
|
||||||
import type { Project } from '../types';
|
|
||||||
import {
|
import {
|
||||||
isValidEnvTarget,
|
isValidEnvTarget,
|
||||||
getEnvTargetPlaceholder,
|
getEnvTargetPlaceholder,
|
||||||
|
|||||||
@@ -12,17 +12,19 @@ import { isValidName } from '../util/is-valid-name';
|
|||||||
import removeProject from '../util/projects/remove-project';
|
import removeProject from '../util/projects/remove-project';
|
||||||
import getProjectByIdOrName from '../util/projects/get-project-by-id-or-name';
|
import getProjectByIdOrName from '../util/projects/get-project-by-id-or-name';
|
||||||
import getDeployment from '../util/get-deployment';
|
import getDeployment from '../util/get-deployment';
|
||||||
import getDeploymentsByProjectId, {
|
import getDeploymentsByProjectId from '../util/deploy/get-deployments-by-project-id';
|
||||||
DeploymentPartial,
|
|
||||||
} from '../util/deploy/get-deployments-by-project-id';
|
|
||||||
import { getPkgName, getCommandName } from '../util/pkg-name';
|
import { getPkgName, getCommandName } from '../util/pkg-name';
|
||||||
import getArgs from '../util/get-args';
|
import getArgs from '../util/get-args';
|
||||||
import handleError from '../util/handle-error';
|
import handleError from '../util/handle-error';
|
||||||
import type Client from '../util/client';
|
import type Client from '../util/client';
|
||||||
import { Output } from '../util/output';
|
import { Output } from '../util/output';
|
||||||
import { Alias, Project } from '../types';
|
import { Alias, Deployment, Project } from '@vercel-internals/types';
|
||||||
import { NowError } from '../util/now-error';
|
import { NowError } from '../util/now-error';
|
||||||
|
|
||||||
|
type DeploymentWithAliases = Deployment & {
|
||||||
|
aliases: Alias[];
|
||||||
|
};
|
||||||
|
|
||||||
const help = () => {
|
const help = () => {
|
||||||
console.log(`
|
console.log(`
|
||||||
${chalk.bold(
|
${chalk.bold(
|
||||||
@@ -125,11 +127,11 @@ export default async function main(client: Client) {
|
|||||||
|
|
||||||
let aliases: Alias[][];
|
let aliases: Alias[][];
|
||||||
let projects: Project[];
|
let projects: Project[];
|
||||||
let deployments: DeploymentPartial[];
|
let deployments: DeploymentWithAliases[];
|
||||||
const findStart = Date.now();
|
const findStart = Date.now();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const searchFilter = (d: DeploymentPartial) =>
|
const searchFilter = (d: Deployment) =>
|
||||||
ids.some(
|
ids.some(
|
||||||
id =>
|
id =>
|
||||||
d &&
|
d &&
|
||||||
@@ -167,9 +169,15 @@ export default async function main(client: Client) {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
projectDeployments
|
// only process the first 201 projects
|
||||||
.slice(0, 201)
|
const to = Math.min(projectDeployments.length, 201);
|
||||||
.map(pDeployments => deployments.push(...pDeployments));
|
for (let i = 0; i < to; i++) {
|
||||||
|
for (const pDepl of projectDeployments[i]) {
|
||||||
|
const depl = pDepl as DeploymentWithAliases;
|
||||||
|
depl.aliases = [];
|
||||||
|
deployments.push(depl);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
projects = [];
|
projects = [];
|
||||||
} else {
|
} else {
|
||||||
@@ -260,7 +268,7 @@ export default async function main(client: Client) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function readConfirmation(
|
function readConfirmation(
|
||||||
deployments: DeploymentPartial[],
|
deployments: DeploymentWithAliases[],
|
||||||
projects: Project[],
|
projects: Project[],
|
||||||
output: Output
|
output: Output
|
||||||
): Promise<string> {
|
): Promise<string> {
|
||||||
@@ -325,7 +333,7 @@ function readConfirmation(
|
|||||||
}
|
}
|
||||||
|
|
||||||
function deploymentsAndProjects(
|
function deploymentsAndProjects(
|
||||||
deployments: DeploymentPartial[],
|
deployments: DeploymentWithAliases[],
|
||||||
projects: Project[],
|
projects: Project[],
|
||||||
conjunction = 'and'
|
conjunction = 'and'
|
||||||
) {
|
) {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { emoji } from '../../util/emoji';
|
|||||||
import getUser from '../../util/get-user';
|
import getUser from '../../util/get-user';
|
||||||
import getTeams from '../../util/teams/get-teams';
|
import getTeams from '../../util/teams/get-teams';
|
||||||
import listInput from '../../util/input/list';
|
import listInput from '../../util/input/list';
|
||||||
import { Team, GlobalConfig } from '../../types';
|
import { Team, GlobalConfig } from '@vercel-internals/types';
|
||||||
import { writeToConfigFile } from '../../util/config/files';
|
import { writeToConfigFile } from '../../util/config/files';
|
||||||
|
|
||||||
const updateCurrentTeam = (config: GlobalConfig, team?: Team) => {
|
const updateCurrentTeam = (config: GlobalConfig, team?: Team) => {
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ import getUpdateCommand from './util/get-update-command';
|
|||||||
import { metrics, shouldCollectMetrics } from './util/metrics';
|
import { metrics, shouldCollectMetrics } from './util/metrics';
|
||||||
import { getCommandName, getTitleName } from './util/pkg-name';
|
import { getCommandName, getTitleName } from './util/pkg-name';
|
||||||
import doLoginPrompt from './util/login/prompt';
|
import doLoginPrompt from './util/login/prompt';
|
||||||
import { AuthConfig, GlobalConfig } from './types';
|
import { AuthConfig, GlobalConfig } from '@vercel-internals/types';
|
||||||
import { VercelConfig } from '@vercel/client';
|
import { VercelConfig } from '@vercel/client';
|
||||||
import box from './util/output/box';
|
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 { Output } from '../output';
|
||||||
import Client from '../client';
|
import Client from '../client';
|
||||||
import createAlias from './create-alias';
|
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 { Output } from '../output';
|
||||||
import * as ERRORS from '../errors-ts';
|
import * as ERRORS from '../errors-ts';
|
||||||
import Client from '../client';
|
import Client from '../client';
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { Output } from '../output';
|
import { Output } from '../output';
|
||||||
import { Alias } from '../../types';
|
import { Alias } from '@vercel-internals/types';
|
||||||
|
|
||||||
import Client from '../client';
|
import Client from '../client';
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Alias, PaginationOptions } from '../../types';
|
import { Alias, PaginationOptions } from '@vercel-internals/types';
|
||||||
import Client from '../client';
|
import Client from '../client';
|
||||||
|
|
||||||
type Response = {
|
type Response = {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import path from 'path';
|
|||||||
import chalk from 'chalk';
|
import chalk from 'chalk';
|
||||||
import Client from '../client';
|
import Client from '../client';
|
||||||
import { Output } from '../output';
|
import { Output } from '../output';
|
||||||
import { User } from '../../types';
|
import { User } from '@vercel-internals/types';
|
||||||
import { VercelConfig } from '../dev/types';
|
import { VercelConfig } from '../dev/types';
|
||||||
import getDeploymentsByAppName from '../deploy/get-deployments-by-appname';
|
import getDeploymentsByAppName from '../deploy/get-deployments-by-appname';
|
||||||
import getDeployment from '../get-deployment';
|
import getDeployment from '../get-deployment';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import Client from '../client';
|
import Client from '../client';
|
||||||
import getAliases from './get-aliases';
|
import getAliases from './get-aliases';
|
||||||
import { Alias } from '../../types';
|
import { Alias } from '@vercel-internals/types';
|
||||||
|
|
||||||
export default async function getDomainAliases(client: Client, domain: string) {
|
export default async function getDomainAliases(client: Client, domain: string) {
|
||||||
const { aliases } = await getAliases(client);
|
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'>) =>
|
export const isReady = ({ readyState }: Pick<Build, 'readyState'>) =>
|
||||||
readyState === 'READY';
|
readyState === 'READY';
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import { ProjectLinkAndSettings } from '../projects/project-settings';
|
|||||||
import { Output } from '../output';
|
import { Output } from '../output';
|
||||||
import title from 'title';
|
import title from 'title';
|
||||||
import { PartialProjectSettings } from '../input/edit-project-settings';
|
import { PartialProjectSettings } from '../input/edit-project-settings';
|
||||||
|
import { debug } from '@vercel/build-utils';
|
||||||
|
|
||||||
export async function setMonorepoDefaultSettings(
|
export async function setMonorepoDefaultSettings(
|
||||||
cwd: string,
|
cwd: string,
|
||||||
@@ -26,8 +27,8 @@ export async function setMonorepoDefaultSettings(
|
|||||||
value: string
|
value: string
|
||||||
) => {
|
) => {
|
||||||
if (projectSettings[command]) {
|
if (projectSettings[command]) {
|
||||||
output.warn(
|
debug(
|
||||||
`Cannot automatically assign ${command} as it is already set via project settings or configuration overrides.`
|
`Skipping auto-assignment of ${command} as it is already set via project settings or configuration overrides.`
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
projectSettings[command] = value;
|
projectSettings[command] = value;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { readFileSync } from 'fs';
|
import { readFileSync } from 'fs';
|
||||||
import { resolve } from 'path';
|
import { resolve } from 'path';
|
||||||
import Client from '../client';
|
import Client from '../client';
|
||||||
import { Cert } from '../../types';
|
import { Cert } from '@vercel-internals/types';
|
||||||
import { isErrnoException } from '@vercel/error-utils';
|
import { isErrnoException } from '@vercel/error-utils';
|
||||||
import { isAPIError } from '../errors-ts';
|
import { isAPIError } from '../errors-ts';
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import chalk from 'chalk';
|
import chalk from 'chalk';
|
||||||
|
|
||||||
import { Cert } from '../../types';
|
import { Cert } from '@vercel-internals/types';
|
||||||
import * as ERRORS from '../errors-ts';
|
import * as ERRORS from '../errors-ts';
|
||||||
import Client from '../client';
|
import Client from '../client';
|
||||||
import mapCertError from './map-cert-error';
|
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 Client from '../client';
|
||||||
import * as ERRORS from '../errors-ts';
|
import * as ERRORS from '../errors-ts';
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { stringify } from 'querystring';
|
import { stringify } from 'querystring';
|
||||||
import { Cert } from '../../types';
|
import { Cert } from '@vercel-internals/types';
|
||||||
import Client from '../client';
|
import Client from '../client';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import Client from '../client';
|
import Client from '../client';
|
||||||
import { Cert, PaginationOptions } from '../../types';
|
import { Cert, PaginationOptions } from '@vercel-internals/types';
|
||||||
|
|
||||||
type Response = {
|
type Response = {
|
||||||
certs: Cert[];
|
certs: Cert[];
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { stringify } from 'querystring';
|
import { stringify } from 'querystring';
|
||||||
import { Cert } from '../../types';
|
import { Cert } from '@vercel-internals/types';
|
||||||
import * as ERRORS from '../errors-ts';
|
import * as ERRORS from '../errors-ts';
|
||||||
import Client from '../client';
|
import Client from '../client';
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import retry from 'async-retry';
|
import retry from 'async-retry';
|
||||||
import { Cert } from '../../types';
|
import { Cert } from '@vercel-internals/types';
|
||||||
import Client from '../client';
|
import Client from '../client';
|
||||||
import { isAPIError } from '../errors-ts';
|
import { isAPIError } from '../errors-ts';
|
||||||
import { isError } from '@vercel/error-utils';
|
import { isError } from '@vercel/error-utils';
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ import type {
|
|||||||
Stdio,
|
Stdio,
|
||||||
ReadableTTY,
|
ReadableTTY,
|
||||||
WritableTTY,
|
WritableTTY,
|
||||||
} from '../types';
|
} from '@vercel-internals/types';
|
||||||
import { sharedPromise } from './promise';
|
import { sharedPromise } from './promise';
|
||||||
import { APIError } from './errors-ts';
|
import { APIError } from './errors-ts';
|
||||||
import { normalizeError } from '@vercel/error-utils';
|
import { normalizeError } from '@vercel/error-utils';
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { NowError } from '../now-error';
|
|||||||
import error from '../output/error';
|
import error from '../output/error';
|
||||||
import highlight from '../output/highlight';
|
import highlight from '../output/highlight';
|
||||||
import { VercelConfig } from '../dev/types';
|
import { VercelConfig } from '../dev/types';
|
||||||
import { AuthConfig, GlobalConfig } from '../../types';
|
import { AuthConfig, GlobalConfig } from '@vercel-internals/types';
|
||||||
import { isErrnoException, isError } from '@vercel/error-utils';
|
import { isErrnoException, isError } from '@vercel/error-utils';
|
||||||
|
|
||||||
const VERCEL_DIR = getGlobalPathConfig();
|
const VERCEL_DIR = getGlobalPathConfig();
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { AuthConfig, GlobalConfig } from '../../types';
|
import { AuthConfig, GlobalConfig } from '@vercel-internals/types';
|
||||||
|
|
||||||
export const defaultGlobalConfig: GlobalConfig = {
|
export const defaultGlobalConfig: GlobalConfig = {
|
||||||
'// Note':
|
'// Note':
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { join } from 'path';
|
|||||||
import ini from 'ini';
|
import ini from 'ini';
|
||||||
import git from 'git-last-commit';
|
import git from 'git-last-commit';
|
||||||
import { exec } from 'child_process';
|
import { exec } from 'child_process';
|
||||||
import { GitMetadata, Project } from '../types';
|
import { GitMetadata, Project } from '@vercel-internals/types';
|
||||||
import { Output } from './output';
|
import { Output } from './output';
|
||||||
import { errorToString, normalizeError } from '@vercel/error-utils';
|
import { errorToString, normalizeError } from '@vercel/error-utils';
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import * as ERRORS_TS from '../errors-ts';
|
|||||||
import * as ERRORS from '../errors';
|
import * as ERRORS from '../errors';
|
||||||
import { NowError } from '../now-error';
|
import { NowError } from '../now-error';
|
||||||
import mapCertError from '../certs/map-cert-error';
|
import mapCertError from '../certs/map-cert-error';
|
||||||
import { Org } from '../../types';
|
import { Org } from '@vercel-internals/types';
|
||||||
import Now, { CreateOptions } from '..';
|
import Now, { CreateOptions } from '..';
|
||||||
import Client from '../client';
|
import Client from '../client';
|
||||||
import { ArchiveFormat, DeploymentError } from '@vercel/client';
|
import { ArchiveFormat, DeploymentError } from '@vercel/client';
|
||||||
|
|||||||
@@ -1,17 +1,31 @@
|
|||||||
import { URLSearchParams } from 'url';
|
import { URLSearchParams } from 'url';
|
||||||
import { Alias } from '../../types';
|
import { Deployment } from '@vercel-internals/types';
|
||||||
import Client from '../client';
|
import Client from '../client';
|
||||||
|
|
||||||
type Response = {
|
type LegacyDeployment = {
|
||||||
deployments: DeploymentPartial[];
|
aliasAssigned?: number | boolean | null;
|
||||||
};
|
aliasError?: {
|
||||||
export interface DeploymentPartial {
|
code: string;
|
||||||
id: string;
|
message: string;
|
||||||
name: string;
|
} | null;
|
||||||
url: string;
|
buildingAt: number;
|
||||||
|
checksConclusion?: 'succeeded' | 'failed' | 'skipped' | 'canceled';
|
||||||
|
checksState?: 'registered' | 'running' | 'completed';
|
||||||
created: number;
|
created: number;
|
||||||
createdAt: number;
|
createdAt?: number;
|
||||||
aliases: Alias[];
|
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:
|
state:
|
||||||
| 'BUILDING'
|
| 'BUILDING'
|
||||||
| 'ERROR'
|
| 'ERROR'
|
||||||
@@ -19,8 +33,15 @@ export interface DeploymentPartial {
|
|||||||
| 'QUEUED'
|
| 'QUEUED'
|
||||||
| 'READY'
|
| 'READY'
|
||||||
| 'CANCELED';
|
| 'CANCELED';
|
||||||
creator: { uid: string };
|
target?: 'production' | 'staging' | null;
|
||||||
}
|
type: 'LAMBDAS';
|
||||||
|
uid: string;
|
||||||
|
url: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
type Response = {
|
||||||
|
deployments: LegacyDeployment[];
|
||||||
|
};
|
||||||
|
|
||||||
interface Options {
|
interface Options {
|
||||||
from?: number | null;
|
from?: number | null;
|
||||||
@@ -34,7 +55,7 @@ export default async function getDeploymentsByProjectId(
|
|||||||
projectId: string,
|
projectId: string,
|
||||||
options: Options = { from: null, limit: 100, continue: false },
|
options: Options = { from: null, limit: 100, continue: false },
|
||||||
total: number = 0
|
total: number = 0
|
||||||
): Promise<DeploymentPartial[]> {
|
): Promise<Deployment[]> {
|
||||||
const limit = options.limit || 100;
|
const limit = options.limit || 100;
|
||||||
|
|
||||||
const query = new URLSearchParams();
|
const query = new URLSearchParams();
|
||||||
@@ -45,9 +66,40 @@ export default async function getDeploymentsByProjectId(
|
|||||||
query.set('from', options.from.toString());
|
query.set('from', options.from.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
const { deployments } = await client.fetch<Response>(
|
const { deployments: legacyDeployments } = await client.fetch<Response>(
|
||||||
`/v4/now/deployments?${query}`
|
`/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;
|
total += deployments.length;
|
||||||
|
|
||||||
if (options.max && total >= options.max) {
|
if (options.max && total >= options.max) {
|
||||||
@@ -55,7 +107,7 @@ export default async function getDeploymentsByProjectId(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (options.continue && deployments.length === limit) {
|
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 });
|
const nextOptions = Object.assign({}, options, { from: nextFrom });
|
||||||
deployments.push(
|
deployments.push(
|
||||||
...(await getDeploymentsByProjectId(
|
...(await getDeploymentsByProjectId(
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import {
|
|||||||
import { Output } from '../output';
|
import { Output } from '../output';
|
||||||
import { progress } from '../output/progress';
|
import { progress } from '../output/progress';
|
||||||
import Now from '../../util';
|
import Now from '../../util';
|
||||||
import { Org } from '../../types';
|
import { Org } from '@vercel-internals/types';
|
||||||
import ua from '../ua';
|
import ua from '../ua';
|
||||||
import { linkFolderToProject } from '../projects/link';
|
import { linkFolderToProject } from '../projects/link';
|
||||||
import { prependEmoji, emoji } from '../emoji';
|
import { prependEmoji, emoji } from '../emoji';
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
import { contentType } from 'mime-types';
|
import { contentType } from 'mime-types';
|
||||||
|
import path from 'path';
|
||||||
|
|
||||||
export default function getMimeType(fileName: string) {
|
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,
|
HttpHeadersConfig,
|
||||||
EnvConfigs,
|
EnvConfigs,
|
||||||
} from './types';
|
} from './types';
|
||||||
import { ProjectSettings } from '../../types';
|
import { ProjectSettings } from '@vercel-internals/types';
|
||||||
import { treeKill } from '../tree-kill';
|
import { treeKill } from '../tree-kill';
|
||||||
import { applyOverriddenHeaders, nodeHeadersToFetchHeaders } from './headers';
|
import { applyOverriddenHeaders, nodeHeadersToFetchHeaders } from './headers';
|
||||||
import { formatQueryString, parseQueryString } from './parse-query-string';
|
import { formatQueryString, parseQueryString } from './parse-query-string';
|
||||||
|
|||||||
@@ -6,6 +6,4 @@
|
|||||||
{{?}}
|
{{?}}
|
||||||
<span class="devinfo-line">ID: <code>{{! it.request_id }}</code>
|
<span class="devinfo-line">ID: <code>{{! it.request_id }}</code>
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<a href="https://vercel.link/404"><div class="note">Click here to learn more about this error.</div></a>
|
|
||||||
</main>
|
</main>
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import {
|
|||||||
import { VercelConfig } from '@vercel/client';
|
import { VercelConfig } from '@vercel/client';
|
||||||
import { HandleValue, Route } from '@vercel/routing-utils';
|
import { HandleValue, Route } from '@vercel/routing-utils';
|
||||||
import { Output } from '../output';
|
import { Output } from '../output';
|
||||||
import { ProjectSettings } from '../../types';
|
import { ProjectSettings } from '@vercel-internals/types';
|
||||||
import { BuilderWithPkg } from '../build/import-builders';
|
import { BuilderWithPkg } from '../build/import-builders';
|
||||||
|
|
||||||
export { VercelConfig };
|
export { VercelConfig };
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import {
|
|||||||
DNSConflictingRecord,
|
DNSConflictingRecord,
|
||||||
isAPIError,
|
isAPIError,
|
||||||
} from '../errors-ts';
|
} from '../errors-ts';
|
||||||
import { DNSRecordData } from '../../types';
|
import { DNSRecordData } from '@vercel-internals/types';
|
||||||
|
|
||||||
type Response = {
|
type Response = {
|
||||||
uid: string;
|
uid: string;
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import chalk from 'chalk';
|
import chalk from 'chalk';
|
||||||
import { DNSRecordData } from '../../types';
|
import { DNSRecordData } from '@vercel-internals/types';
|
||||||
import textInput from '../input/text';
|
import textInput from '../input/text';
|
||||||
import promptBool from '../input/prompt-bool';
|
import promptBool from '../input/prompt-bool';
|
||||||
import Client from '../client';
|
import Client from '../client';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { DNSRecord } from '../../types';
|
import { DNSRecord } from '@vercel-internals/types';
|
||||||
import Client from '../client';
|
import Client from '../client';
|
||||||
|
|
||||||
export default async function getDNSRecordById(
|
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 { DomainNotFound } from '../errors-ts';
|
||||||
import { Output } from '../output';
|
import { Output } from '../output';
|
||||||
import Client from '../client';
|
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 { DomainNotFound, isAPIError } from '../errors-ts';
|
||||||
import { Output } from '../output';
|
import { Output } from '../output';
|
||||||
import Client from '../client';
|
import Client from '../client';
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { DNSRecordData } from '../../types';
|
import { DNSRecordData } from '@vercel-internals/types';
|
||||||
|
|
||||||
export default function parseAddArgs(
|
export default function parseAddArgs(
|
||||||
args: string[]
|
args: string[]
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import chalk from 'chalk';
|
import chalk from 'chalk';
|
||||||
import retry from 'async-retry';
|
import retry from 'async-retry';
|
||||||
import { DomainAlreadyExists, InvalidDomain, isAPIError } from '../errors-ts';
|
import { DomainAlreadyExists, InvalidDomain, isAPIError } from '../errors-ts';
|
||||||
import { Domain } from '../../types';
|
import { Domain } from '@vercel-internals/types';
|
||||||
import Client from '../client';
|
import Client from '../client';
|
||||||
|
|
||||||
type Response = {
|
type Response = {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import chalk from 'chalk';
|
import chalk from 'chalk';
|
||||||
import Client from '../client';
|
import Client from '../client';
|
||||||
import { Domain } from '../../types';
|
import { Domain } from '@vercel-internals/types';
|
||||||
import {
|
import {
|
||||||
DomainPermissionDenied,
|
DomainPermissionDenied,
|
||||||
DomainNotFound,
|
DomainNotFound,
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import Client from '../client';
|
import Client from '../client';
|
||||||
import { DomainConfig } from '../../types';
|
import { DomainConfig } from '@vercel-internals/types';
|
||||||
import { isAPIError } from '../errors-ts';
|
import { isAPIError } from '../errors-ts';
|
||||||
|
|
||||||
export async function getDomainConfig(client: Client, domainName: string) {
|
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';
|
export type DomainRegistrar = 'Vercel' | 'Purchase in Process' | 'Third Party';
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import chalk from 'chalk';
|
import chalk from 'chalk';
|
||||||
import Client from '../client';
|
import Client from '../client';
|
||||||
import { Domain } from '../../types';
|
import { Domain } from '@vercel-internals/types';
|
||||||
import { isAPIError } from '../errors-ts';
|
import { isAPIError } from '../errors-ts';
|
||||||
|
|
||||||
type Response = {
|
type Response = {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Domain, PaginationOptions } from '../../types';
|
import { Domain, PaginationOptions } from '@vercel-internals/types';
|
||||||
import Client from '../client';
|
import Client from '../client';
|
||||||
|
|
||||||
type Response = {
|
type Response = {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import { Domain } from '../../types';
|
import { Domain } from '@vercel-internals/types';
|
||||||
|
|
||||||
export default function isDomainExternal(domain: Domain) {
|
export default function isDomainExternal(domain: Domain) {
|
||||||
return domain.serviceType !== 'zeit.world';
|
return domain.serviceType !== 'zeit.world';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import psl from 'psl';
|
import psl from 'psl';
|
||||||
import { NowError } from '../now-error';
|
import { NowError } from '../now-error';
|
||||||
import { Domain } from '../../types';
|
import { Domain } from '@vercel-internals/types';
|
||||||
import { Output } from '../output';
|
import { Output } from '../output';
|
||||||
import * as ERRORS from '../errors-ts';
|
import * as ERRORS from '../errors-ts';
|
||||||
import addDomain from './add-domain';
|
import addDomain from './add-domain';
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import * as ERRORS from '../errors-ts';
|
import * as ERRORS from '../errors-ts';
|
||||||
import Client from '../client';
|
import Client from '../client';
|
||||||
import { Domain } from '../../types';
|
import { Domain } from '@vercel-internals/types';
|
||||||
|
|
||||||
type Response = {
|
type Response = {
|
||||||
domain: Domain;
|
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,
|
ProjectEnvTarget,
|
||||||
ProjectEnvVariable,
|
ProjectEnvVariable,
|
||||||
ProjectEnvType,
|
ProjectEnvType,
|
||||||
} from '../../types';
|
} from '@vercel-internals/types';
|
||||||
|
|
||||||
export default async function addEnvRecord(
|
export default async function addEnvRecord(
|
||||||
output: Output,
|
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[] {
|
function envTargets(): string[] {
|
||||||
return Object.values(ProjectEnvTarget);
|
return Object.values(ProjectEnvTarget);
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import title from 'title';
|
import title from 'title';
|
||||||
import { ProjectEnvVariable } from '../../types';
|
import { ProjectEnvVariable } from '@vercel-internals/types';
|
||||||
|
|
||||||
export default function formatEnvTarget(env: ProjectEnvVariable): string {
|
export default function formatEnvTarget(env: ProjectEnvVariable): string {
|
||||||
const target = (Array.isArray(env.target) ? env.target : [env.target || ''])
|
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 { Output } from '../output';
|
||||||
import Client from '../client';
|
import Client from '../client';
|
||||||
import { ProjectEnvVariable, ProjectEnvTarget } from '../../types';
|
import { ProjectEnvVariable, ProjectEnvTarget } from '@vercel-internals/types';
|
||||||
import { URLSearchParams } from 'url';
|
import { URLSearchParams } from 'url';
|
||||||
|
|
||||||
/** The CLI command that was used that needs the environment variables. */
|
/** The CLI command that was used that needs the environment variables. */
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user