Compare commits

..

3 Commits

Author SHA1 Message Date
chloetedder
59f51a1bb6 Update 2023-02-14 14:41:04 -07:00
chloetedder
494164a3a4 test 2023-02-14 14:18:11 -07:00
chloetedder
b45052adda Change tests 2023-02-14 13:27:47 -07:00
414 changed files with 55820 additions and 74273 deletions

View File

@@ -1,31 +0,0 @@
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 })

View File

@@ -16,16 +16,12 @@ jobs:
# 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-next.js')
await script({ github, context })

View File

@@ -16,16 +16,14 @@ jobs:
# 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: install pnpm@7.26.0
run: npm i -g pnpm@7.26.0
- 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-turbo.js')
await script({ github, context })

View File

@@ -16,9 +16,6 @@ jobs:
publish:
name: Publish
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
steps:
- name: Checkout
uses: actions/checkout@v3
@@ -44,8 +41,6 @@ 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

View File

@@ -1,28 +0,0 @@
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
View File

@@ -1,4 +1,3 @@
provenance=true
save-exact=true
hoist-pattern[]=!"**/@types/**"
hoist-pattern[]=!"**/typedoc"

View File

@@ -14,9 +14,7 @@ In order to create the smallest possible lambdas Next.js has to be configured to
npm install next --save
```
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]
2. Add the `now-build` script to your `package.json`
```json
{
@@ -26,7 +24,7 @@ npm install next --save
}
```
4. Add `target: 'serverless'` to `next.config.js` [deprecated]
3. Add `target: 'serverless'` to `next.config.js` [deprecated]
```js
module.exports = {
@@ -35,9 +33,9 @@ module.exports = {
};
```
5. Remove `distDir` from `next.config.js` as `@vercel/next` can't parse this file and expects your build output at `/.next`
4. Remove `distDir` from `next.config.js` as `@vercel/next` can't parse this file and expects your build output at `/.next`
6. Optionally make sure the `"src"` in `"builds"` points to your application `package.json`
5. Optionally make sure the `"src"` in `"builds"` points to your application `package.json`
```js
{

View File

@@ -2,15 +2,15 @@
#### Why This Error Occurred
This error is often caused by a misconfigured "Build Command" or "Output Directory" for your Next.js project.
This could be caused by a misconfigured "Build Command" or "Output Directory" for your Next.js project.
#### Possible Ways to Fix It
In the Vercel dashboard, open your "Project Settings" and draw attention to "Build & Development Settings":
1. Ensure that the "Build Command" setting is not overridden, or that it calls `next build`. If this command is not overridden but you are seeing this error, double check that your `build` script in `package.json` calls `next build`. If `buildCommand` exists in `vercel.json`, make sure it calls `next build`.
2. Ensure that the "Output Directory" setting is not overridden. This value almost never needs to be configured, and is only necessary if you override `distDir` in `next.config.js`. If `outputDirectory` exists in `vercel.json`, remove that property.
3. For `next export` users: **do not override the "Output Directory"**, even if you customized the `next export` output directory. It will automatically detects the correct output.
1. Ensure that the "Build Command" setting is not changed, or that it calls `next build`. If this command is not changed but you are seeing this error, double check that your `build` script in `package.json` calls `next build`.
2. Ensure that the "Output Directory" setting is not changed. This value almost never needs to be configured, and is only necessary if you override `distDir` in `next.config.js`.
3. For `next export` users: **do not override the "Output Directory"**. Next.js automatically detects what folder you outputted `next export` to.
In rare scenarios, this error message can also be caused by a Next.js build failure (if your "Build Command" accidentally returns an exit code that is not 0).
Double check for any error messages above the Routes Manifest error, which may provide additional details.

View File

@@ -1,5 +1,6 @@
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./*"]
}

File diff suppressed because it is too large Load Diff

View File

@@ -9,9 +9,10 @@
"lint": "next lint"
},
"dependencies": {
"eslint": "8.35.0",
"eslint-config-next": "13.2.3",
"next": "13.2.3",
"@next/font": "13.1.6",
"eslint": "8.32.0",
"eslint-config-next": "13.1.6",
"next": "13.1.6",
"react": "18.2.0",
"react-dom": "18.2.0"
}

View File

@@ -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'] })

View File

@@ -13,10 +13,10 @@ function hydrate() {
});
}
if (typeof requestIdleCallback === "function") {
requestIdleCallback(hydrate);
if (window.requestIdleCallback) {
window.requestIdleCallback(hydrate);
} else {
// Safari doesn't support requestIdleCallback
// https://caniuse.com/requestidlecallback
setTimeout(hydrate, 1);
window.setTimeout(hydrate, 1);
}

View File

@@ -1,18 +1,21 @@
import handleRequest from "@vercel/remix-entry-server";
import type { EntryContext } from "@remix-run/node";
import { RemixServer } from "@remix-run/react";
import type { EntryContext } from "@remix-run/server-runtime";
import { renderToString } from "react-dom/server";
export default function (
export default function handleRequest(
request: Request,
responseStatusCode: number,
responseHeaders: Headers,
remixContext: EntryContext
) {
const remixServer = <RemixServer context={remixContext} url={request.url} />;
return handleRequest(
request,
responseStatusCode,
responseHeaders,
remixServer
const markup = renderToString(
<RemixServer context={remixContext} url={request.url} />
);
responseHeaders.set("Content-Type", "text/html");
return new Response("<!DOCTYPE html>" + markup, {
headers: responseHeaders,
status: responseStatusCode,
});
}

View File

@@ -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",

View File

@@ -1,9 +0,0 @@
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>
);
}

View File

@@ -6,20 +6,20 @@
"dev": "remix dev"
},
"dependencies": {
"@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",
"@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",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@remix-run/dev": "^1.13.0",
"@remix-run/eslint-config": "^1.13.0",
"@remix-run/dev": "^1.7.6",
"@remix-run/eslint-config": "^1.7.6",
"@remix-run/serve": "^1.7.6",
"@types/react": "^18.0.25",
"@types/react-dom": "^18.0.11",
"@types/react-dom": "^18.0.9",
"eslint": "^8.28.0",
"typescript": "^4.9.3"
},

File diff suppressed because it is too large Load Diff

View File

@@ -1,10 +1,13 @@
/**
* @type {import('@remix-run/dev').AppConfig}
*/
/** @type {import('@remix-run/dev').AppConfig} */
module.exports = {
ignoredRouteFiles: ['**/.*'],
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: ["**/.*"],
// appDirectory: "app",
// assetsBuildDirectory: "public/build",
// serverBuildPath: "build/index.js",
// serverBuildPath: "api/index.js",
// publicPath: "/build/",
};

4
examples/remix/server.js Normal file
View File

@@ -0,0 +1,4 @@
import { createRequestHandler } from "@remix-run/vercel";
import * as build from "@remix-run/dev/server-build";
export default createRequestHandler({ build, mode: process.env.NODE_ENV });

View File

@@ -1,17 +0,0 @@
{
"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"
}
}

View File

@@ -1,8 +0,0 @@
{
"extends": "@vercel/style-guide/typescript",
"compilerOptions": {
"outDir": "dist",
"declaration": true
},
"include": ["index.ts"]
}

View File

@@ -32,7 +32,7 @@
"source-map-support": "0.5.12",
"ts-eager": "2.0.2",
"ts-jest": "28.0.5",
"turbo": "1.8.3"
"turbo": "1.7.4"
},
"scripts": {
"lerna": "lerna",

View File

@@ -1,6 +1,6 @@
{
"name": "@vercel/build-utils",
"version": "6.3.3",
"version": "6.2.2",
"license": "MIT",
"main": "./dist/index.js",
"types": "./dist/index.d.js",

View File

@@ -1,4 +1,4 @@
import type { Files, FunctionFramework } from './types';
import type { Cron, Files } from './types';
/**
* An Edge Functions output
@@ -41,8 +41,8 @@ export class EdgeFunction {
/** The regions where the edge function will be executed on */
regions?: string | string[];
/** The framework */
framework?: FunctionFramework;
/** Cronjob definition for the edge function */
cron?: Cron;
constructor(params: Omit<EdgeFunction, 'type'>) {
this.type = 'EdgeFunction';
@@ -53,6 +53,6 @@ export class EdgeFunction {
this.envVarsInUse = params.envVarsInUse;
this.assets = params.assets;
this.regions = params.regions;
this.framework = params.framework;
this.cron = params.cron;
}
}

View File

@@ -25,16 +25,12 @@ export async function readConfigFile<T>(
if (data) {
const str = data.toString('utf8');
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}"`);
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;
}
}
}

View File

@@ -5,7 +5,7 @@ import minimatch from 'minimatch';
import { readlink } from 'fs-extra';
import { isSymbolicLink, isDirectory } from './fs/download';
import streamToBuffer from './fs/stream-to-buffer';
import type { Files, Config, FunctionFramework } from './types';
import type { Files, Config, Cron } from './types';
interface Environment {
[key: string]: string;
@@ -25,7 +25,7 @@ export interface LambdaOptionsBase {
supportsWrapper?: boolean;
experimentalResponseStreaming?: boolean;
operationType?: string;
framework?: FunctionFramework;
cron?: Cron;
}
export interface LambdaOptionsWithFiles extends LambdaOptionsBase {
@@ -63,6 +63,7 @@ export class Lambda {
environment: Environment;
allowQuery?: string[];
regions?: string[];
cron?: Cron;
/**
* @deprecated Use `await lambda.createZip()` instead.
*/
@@ -70,7 +71,6 @@ export class Lambda {
supportsMultiPayloads?: boolean;
supportsWrapper?: boolean;
experimentalResponseStreaming?: boolean;
framework?: FunctionFramework;
constructor(opts: LambdaOptions) {
const {
@@ -81,11 +81,11 @@ export class Lambda {
environment = {},
allowQuery,
regions,
cron,
supportsMultiPayloads,
supportsWrapper,
experimentalResponseStreaming,
operationType,
framework,
} = opts;
if ('files' in opts) {
assert(typeof opts.files === 'object', '"files" must be an object');
@@ -135,18 +135,8 @@ export class Lambda {
);
}
if (framework !== undefined) {
assert(typeof framework === 'object', '"framework" is not an object');
assert(
typeof framework.slug === 'string',
'"framework.slug" is not a string'
);
if (framework.version !== undefined) {
assert(
typeof framework.version === 'string',
'"framework.version" is not a string'
);
}
if (cron !== undefined) {
assert(typeof cron === 'string', '"cron" is not a string');
}
this.type = 'Lambda';
@@ -159,11 +149,11 @@ export class Lambda {
this.environment = environment;
this.allowQuery = allowQuery;
this.regions = regions;
this.cron = cron;
this.zipBuffer = 'zipBuffer' in opts ? opts.zipBuffer : undefined;
this.supportsMultiPayloads = supportsMultiPayloads;
this.supportsWrapper = supportsWrapper;
this.experimentalResponseStreaming = experimentalResponseStreaming;
this.framework = framework;
}
async createZip(): Promise<Buffer> {
@@ -238,7 +228,7 @@ export async function getLambdaOptionsFromFunction({
sourceFile,
config,
}: GetLambdaOptionsFromFunctionOptions): Promise<
Pick<LambdaOptions, 'memory' | 'maxDuration'>
Pick<LambdaOptions, 'memory' | 'maxDuration' | 'cron'>
> {
if (config?.functions) {
for (const [pattern, fn] of Object.entries(config.functions)) {
@@ -246,6 +236,7 @@ export async function getLambdaOptionsFromFunction({
return {
memory: fn.memory,
maxDuration: fn.maxDuration,
cron: fn.cron,
};
}
}

View File

@@ -29,6 +29,11 @@ export const functionsSchema = {
type: 'string',
maxLength: 256,
},
cron: {
type: 'string',
minLength: 9,
maxLength: 256,
},
},
},
},

View File

@@ -319,6 +319,7 @@ export interface BuilderFunctions {
runtime?: string;
includeFiles?: string;
excludeFiles?: string;
cron?: Cron;
};
}
@@ -355,8 +356,6 @@ export interface BuilderV3 {
type ImageFormat = 'image/avif' | 'image/webp';
type ImageContentDispositionType = 'inline' | 'attachment';
export type RemotePattern = {
/**
* Must be `http` or `https`.
@@ -392,7 +391,6 @@ export interface Images {
formats?: ImageFormat[];
dangerouslyAllowSVG?: boolean;
contentSecurityPolicy?: string;
contentDispositionType?: ImageContentDispositionType;
}
/**
@@ -413,16 +411,7 @@ export interface BuildResultBuildOutput {
buildOutputPath: string;
}
export interface Cron {
path: string;
schedule: string;
}
/** The framework which created the function */
export interface FunctionFramework {
slug: string;
version?: string;
}
export type Cron = string;
/**
* When a Builder implements `version: 2`, the `build()` function is expected

View File

@@ -1,77 +0,0 @@
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/
);
});
});

View File

@@ -506,11 +506,6 @@ 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);

View File

@@ -1,6 +1,6 @@
{
"name": "vercel",
"version": "28.16.14",
"version": "28.15.4",
"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.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"
"@vercel/build-utils": "6.2.2",
"@vercel/go": "2.3.4",
"@vercel/hydrogen": "0.0.50",
"@vercel/next": "3.4.3",
"@vercel/node": "2.9.3",
"@vercel/python": "3.1.46",
"@vercel/redwood": "1.1.2",
"@vercel/remix": "1.2.13",
"@vercel/ruby": "1.3.62",
"@vercel/static-build": "1.3.6"
},
"devDependencies": {
"@alex_neo/jest-expect-message": "1.0.5",
@@ -93,14 +93,13 @@
"@types/which": "1.3.2",
"@types/write-json-file": "2.2.1",
"@types/yauzl-promise": "2.1.0",
"@vercel-internals/types": "*",
"@vercel/client": "12.4.3",
"@vercel/client": "12.3.8",
"@vercel/error-utils": "1.0.8",
"@vercel/frameworks": "1.3.2",
"@vercel/fs-detectors": "3.8.3",
"@vercel/frameworks": "1.3.0",
"@vercel/fs-detectors": "3.7.11",
"@vercel/fun": "1.0.4",
"@vercel/ncc": "0.24.0",
"@vercel/routing-utils": "2.1.10",
"@vercel/routing-utils": "2.1.8",
"@zeit/source-map-support": "0.6.2",
"ajv": "6.12.2",
"alpha-sort": "2.0.1",
@@ -141,6 +140,7 @@
"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",

View File

@@ -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 '@vercel-internals/types';
import { Alias } from '../../types';
export default async function ls(
client: Client,

View File

@@ -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 '@vercel-internals/types';
import { Alias } from '../../types';
import { isValidName } from '../../util/is-valid-name';
import { getCommandName } from '../../util/pkg-name';

View File

@@ -1,7 +1,7 @@
import chalk from 'chalk';
import { SetDifference } from 'utility-types';
import { AliasRecord } from '../../util/alias/create-alias';
import { Domain } from '@vercel-internals/types';
import { Domain } from '../../types';
import { Output } from '../../util/output';
import * as ERRORS from '../../util/errors-ts';
import assignAlias from '../../util/alias/assign-alias';

View File

@@ -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 '@vercel-internals/types';
import { Deployment, PaginationOptions } from '../../types';
import { normalizeURL } from '../../util/bisect/normalize-url';
import getScope from '../../util/get-scope';
import getDeployment from '../../util/get-deployment';

View File

@@ -16,7 +16,6 @@ import {
BuildResultV2Typical,
BuildResultV3,
NowBuildError,
Cron,
} from '@vercel/build-utils';
import {
detectBuilders,
@@ -89,7 +88,6 @@ interface BuildOutputConfig {
framework?: {
version: string;
};
crons?: Cron[];
}
/**
@@ -625,7 +623,6 @@ async function doBuild(
});
const mergedImages = mergeImages(localConfig.images, buildResults.values());
const mergedCrons = mergeCrons(localConfig.crons, buildResults.values());
const mergedWildcard = mergeWildcard(buildResults.values());
const mergedOverrides: Record<string, PathOverride> =
overrides.length > 0 ? Object.assign({}, ...overrides) : undefined;
@@ -641,7 +638,6 @@ async function doBuild(
wildcard: mergedWildcard,
overrides: mergedOverrides,
framework,
crons: mergedCrons,
};
await fs.writeJSON(join(outputDir, 'config.json'), config, { spaces: 2 });
@@ -750,18 +746,6 @@ function mergeImages(
return images;
}
function mergeCrons(
crons: BuildOutputConfig['crons'] = [],
buildResults: Iterable<BuildResult | BuildOutputConfig>
): BuildOutputConfig['crons'] {
for (const result of buildResults) {
if ('crons' in result && result.crons) {
crons = crons.concat(result.crons);
}
}
return crons;
}
function mergeWildcard(
buildResults: Iterable<BuildResult | BuildOutputConfig>
): BuildResultV2Typical['wildcard'] {

View File

@@ -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 '@vercel-internals/types';
import { Cert } from '../../types';
interface Options {
'--overwrite'?: boolean;

View File

@@ -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 '@vercel-internals/types';
import { Cert } from '../../types';
import getCommandFlags from '../../util/get-command-flags';
import { getCommandName } from '../../util/pkg-name';

View File

@@ -2,7 +2,7 @@ import chalk from 'chalk';
import ms from 'ms';
import plural from 'pluralize';
import table from 'text-table';
import { Cert } from '@vercel-internals/types';
import { Cert } from '../../types';
import * as ERRORS from '../../util/errors-ts';
import { Output } from '../../util/output';
import deleteCertById from '../../util/certs/delete-cert-by-id';

View File

@@ -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 '@vercel-internals/types';
import { ProjectSettings } from '../../types';
import setupAndLink from '../../util/link/setup-and-link';
import { getCommandName } from '../../util/pkg-name';
import param from '../../util/output/param';

View File

@@ -1,7 +1,7 @@
import chalk from 'chalk';
import ms from 'ms';
import { DomainNotFound } from '../../util/errors-ts';
import { DNSRecord } from '@vercel-internals/types';
import { DNSRecord } from '../../types';
import Client from '../../util/client';
import formatTable from '../../util/format-table';
import getDNSRecords, {

View File

@@ -1,7 +1,7 @@
import chalk from 'chalk';
import ms from 'ms';
import table from 'text-table';
import { DNSRecord } from '@vercel-internals/types';
import { DNSRecord } from '../../types';
import { Output } from '../../util/output';
import Client from '../../util/client';
import deleteDNSRecordById from '../../util/dns/delete-dns-record-by-id';

View File

@@ -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 '@vercel-internals/types';
import { Domain } from '../../types';
import getCommandFlags from '../../util/get-command-flags';
import {
PaginationOptions,

View File

@@ -1,7 +1,7 @@
import chalk from 'chalk';
import plural from 'pluralize';
import { User, Team } from '@vercel-internals/types';
import { User, Team } from '../../types';
import * as ERRORS from '../../util/errors-ts';
import Client from '../../util/client';
import getScope from '../../util/get-scope';

View File

@@ -2,7 +2,7 @@ import chalk from 'chalk';
import plural from 'pluralize';
import { DomainNotFound, DomainPermissionDenied } from '../../util/errors-ts';
import { Domain } from '@vercel-internals/types';
import { Domain } from '../../types';
import { Output } from '../../util/output';
import Client from '../../util/client';
import deleteCertById from '../../util/certs/delete-cert-by-id';

View File

@@ -1,5 +1,5 @@
import chalk from 'chalk';
import { ProjectEnvTarget, Project, ProjectEnvType } from '@vercel-internals/types';
import { ProjectEnvTarget, Project, ProjectEnvType } from '../../types';
import { Output } from '../../util/output';
import Client from '../../util/client';
import stamp from '../../util/output/stamp';

View File

@@ -1,7 +1,7 @@
import chalk from 'chalk';
import ms from 'ms';
import { Output } from '../../util/output';
import { Project, ProjectEnvVariable, ProjectEnvType } from '@vercel-internals/types';
import { Project, ProjectEnvVariable, ProjectEnvType } from '../../types';
import Client from '../../util/client';
import formatTable from '../../util/format-table';
import getEnvRecords from '../../util/env/get-env-records';

View File

@@ -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 '@vercel-internals/types';
import { Project, ProjectEnvTarget } from '../../types';
import Client from '../../util/client';
import { emoji, prependEmoji } from '../../util/emoji';
import confirm from '../../util/input/confirm';

View File

@@ -1,5 +1,5 @@
import chalk from 'chalk';
import { Project } from '@vercel-internals/types';
import { Project } from '../../types';
import { Output } from '../../util/output';
import confirm from '../../util/input/confirm';
import removeEnvRecord from '../../util/env/remove-env-record';

View File

@@ -1,7 +1,7 @@
import { Dictionary } from '@vercel/client';
import chalk from 'chalk';
import { join } from 'path';
import { Org, Project, ProjectLinkData } from '@vercel-internals/types';
import { Org, Project, ProjectLinkData } from '../../types';
import Client from '../../util/client';
import { parseGitConfig, pluckRemoteUrls } from '../../util/create-git-meta';
import confirm from '../../util/input/confirm';

View File

@@ -1,5 +1,5 @@
import chalk from 'chalk';
import { Org, Project } from '@vercel-internals/types';
import { Org, Project } from '../../types';
import Client from '../../util/client';
import confirm from '../../util/input/confirm';
import { getCommandName } from '../../util/pkg-name';

View File

@@ -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 '@vercel-internals/types';
import { Build, Deployment } from '../types';
import title from 'title';
import { isErrnoException } from '@vercel/error-utils';
import { URL } from 'url';

View File

@@ -1,7 +1,7 @@
import chalk from 'chalk';
import ms from 'ms';
import table from 'text-table';
import { Project } from '@vercel-internals/types';
import { Project } from '../../types';
import Client from '../../util/client';
import getCommandFlags from '../../util/get-command-flags';
import { getCommandName } from '../../util/pkg-name';

View File

@@ -1,7 +1,7 @@
import chalk from 'chalk';
import { join } from 'path';
import Client from '../util/client';
import type { Project, ProjectEnvTarget } from '@vercel-internals/types';
import { ProjectEnvTarget } from '../types';
import { emoji, prependEmoji } from '../util/emoji';
import getArgs from '../util/get-args';
import logo from '../util/output/logo';
@@ -10,6 +10,7 @@ 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,

View File

@@ -12,19 +12,17 @@ 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 from '../util/deploy/get-deployments-by-project-id';
import getDeploymentsByProjectId, {
DeploymentPartial,
} 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, Deployment, Project } from '@vercel-internals/types';
import { Alias, Project } from '../types';
import { NowError } from '../util/now-error';
type DeploymentWithAliases = Deployment & {
aliases: Alias[];
};
const help = () => {
console.log(`
${chalk.bold(
@@ -127,11 +125,11 @@ export default async function main(client: Client) {
let aliases: Alias[][];
let projects: Project[];
let deployments: DeploymentWithAliases[];
let deployments: DeploymentPartial[];
const findStart = Date.now();
try {
const searchFilter = (d: Deployment) =>
const searchFilter = (d: DeploymentPartial) =>
ids.some(
id =>
d &&
@@ -169,15 +167,9 @@ export default async function main(client: Client) {
})
);
// 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);
}
}
projectDeployments
.slice(0, 201)
.map(pDeployments => deployments.push(...pDeployments));
projects = [];
} else {
@@ -268,7 +260,7 @@ export default async function main(client: Client) {
}
function readConfirmation(
deployments: DeploymentWithAliases[],
deployments: DeploymentPartial[],
projects: Project[],
output: Output
): Promise<string> {
@@ -333,7 +325,7 @@ function readConfirmation(
}
function deploymentsAndProjects(
deployments: DeploymentWithAliases[],
deployments: DeploymentPartial[],
projects: Project[],
conjunction = 'and'
) {

View File

@@ -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 '@vercel-internals/types';
import { Team, GlobalConfig } from '../../types';
import { writeToConfigFile } from '../../util/config/files';
const updateCurrentTeam = (config: GlobalConfig, team?: Team) => {

View File

@@ -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 '@vercel-internals/types';
import { AuthConfig, GlobalConfig } from './types';
import { VercelConfig } from '@vercel/client';
import box from './util/output/box';

View File

@@ -300,7 +300,6 @@ export interface Secret {
createdAt: number;
}
// TODO (Ethan-Arrowood) - Replace enums
export enum ProjectEnvTarget {
Production = 'production',
Preview = 'preview',

View File

@@ -1,4 +1,4 @@
import type { Deployment } from '@vercel-internals/types';
import type { Deployment } from '../../types';
import { Output } from '../output';
import Client from '../client';
import createAlias from './create-alias';

View File

@@ -1,4 +1,4 @@
import type { Deployment } from '@vercel-internals/types';
import type { Deployment } from '../../types';
import { Output } from '../output';
import * as ERRORS from '../errors-ts';
import Client from '../client';

View File

@@ -1,5 +1,5 @@
import { Output } from '../output';
import { Alias } from '@vercel-internals/types';
import { Alias } from '../../types';
import Client from '../client';

View File

@@ -1,4 +1,4 @@
import { Alias, PaginationOptions } from '@vercel-internals/types';
import { Alias, PaginationOptions } from '../../types';
import Client from '../client';
type Response = {

View File

@@ -2,7 +2,7 @@ import path from 'path';
import chalk from 'chalk';
import Client from '../client';
import { Output } from '../output';
import { User } from '@vercel-internals/types';
import { User } from '../../types';
import { VercelConfig } from '../dev/types';
import getDeploymentsByAppName from '../deploy/get-deployments-by-appname';
import getDeployment from '../get-deployment';

View File

@@ -1,6 +1,6 @@
import Client from '../client';
import getAliases from './get-aliases';
import { Alias } from '@vercel-internals/types';
import { Alias } from '../../types';
export default async function getDomainAliases(client: Client, domain: string) {
const { aliases } = await getAliases(client);

View File

@@ -1,4 +1,4 @@
import { Build } from '@vercel-internals/types';
import { Build } from '../types';
export const isReady = ({ readyState }: Pick<Build, 'readyState'>) =>
readyState === 'READY';

View File

@@ -9,7 +9,6 @@ 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,
@@ -27,8 +26,8 @@ export async function setMonorepoDefaultSettings(
value: string
) => {
if (projectSettings[command]) {
debug(
`Skipping auto-assignment of ${command} as it is already set via project settings or configuration overrides.`
output.warn(
`Cannot automatically assign ${command} as it is already set via project settings or configuration overrides.`
);
} else {
projectSettings[command] = value;

View File

@@ -13,6 +13,7 @@ import {
Builder,
BuildResultV2,
BuildResultV3,
Cron,
File,
FileFsRef,
BuilderV2,
@@ -40,6 +41,7 @@ export const OUTPUT_DIR = join(VERCEL_DIR, 'output');
* An entry in the "functions" object in `vercel.json`.
*/
interface FunctionConfiguration {
cron?: Cron;
memory?: number;
maxDuration?: number;
}
@@ -370,12 +372,14 @@ async function writeLambda(
throw new Error('Malformed `Lambda` - no "files" present');
}
const cron = functionConfiguration?.cron ?? lambda.cron;
const memory = functionConfiguration?.memory ?? lambda.memory;
const maxDuration = functionConfiguration?.maxDuration ?? lambda.maxDuration;
const config = {
...lambda,
handler: normalizePath(lambda.handler),
cron,
memory,
maxDuration,
type: undefined,

View File

@@ -1,7 +1,7 @@
import { readFileSync } from 'fs';
import { resolve } from 'path';
import Client from '../client';
import { Cert } from '@vercel-internals/types';
import { Cert } from '../../types';
import { isErrnoException } from '@vercel/error-utils';
import { isAPIError } from '../errors-ts';

View File

@@ -1,6 +1,6 @@
import chalk from 'chalk';
import { Cert } from '@vercel-internals/types';
import { Cert } from '../../types';
import * as ERRORS from '../errors-ts';
import Client from '../client';
import mapCertError from './map-cert-error';

View File

@@ -1,4 +1,4 @@
import { Cert } from '@vercel-internals/types';
import { Cert } from '../../types';
import Client from '../client';
import * as ERRORS from '../errors-ts';

View File

@@ -1,5 +1,5 @@
import { stringify } from 'querystring';
import { Cert } from '@vercel-internals/types';
import { Cert } from '../../types';
import Client from '../client';
/**

View File

@@ -1,5 +1,5 @@
import Client from '../client';
import { Cert, PaginationOptions } from '@vercel-internals/types';
import { Cert, PaginationOptions } from '../../types';
type Response = {
certs: Cert[];

View File

@@ -1,5 +1,5 @@
import { stringify } from 'querystring';
import { Cert } from '@vercel-internals/types';
import { Cert } from '../../types';
import * as ERRORS from '../errors-ts';
import Client from '../client';

View File

@@ -1,5 +1,5 @@
import retry from 'async-retry';
import { Cert } from '@vercel-internals/types';
import { Cert } from '../../types';
import Client from '../client';
import { isAPIError } from '../errors-ts';
import { isError } from '@vercel/error-utils';

View File

@@ -19,7 +19,7 @@ import type {
Stdio,
ReadableTTY,
WritableTTY,
} from '@vercel-internals/types';
} from '../types';
import { sharedPromise } from './promise';
import { APIError } from './errors-ts';
import { normalizeError } from '@vercel/error-utils';

View File

@@ -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 '@vercel-internals/types';
import { AuthConfig, GlobalConfig } from '../../types';
import { isErrnoException, isError } from '@vercel/error-utils';
const VERCEL_DIR = getGlobalPathConfig();

View File

@@ -1,4 +1,4 @@
import { AuthConfig, GlobalConfig } from '@vercel-internals/types';
import { AuthConfig, GlobalConfig } from '../../types';
export const defaultGlobalConfig: GlobalConfig = {
'// Note':

View File

@@ -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 '@vercel-internals/types';
import { GitMetadata, Project } from '../types';
import { Output } from './output';
import { errorToString, normalizeError } from '@vercel/error-utils';

View File

@@ -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 '@vercel-internals/types';
import { Org } from '../../types';
import Now, { CreateOptions } from '..';
import Client from '../client';
import { ArchiveFormat, DeploymentError } from '@vercel/client';

View File

@@ -1,31 +1,17 @@
import { URLSearchParams } from 'url';
import { Deployment } from '@vercel-internals/types';
import { Alias } from '../../types';
import Client from '../client';
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;
creator: {
uid: string;
email?: string;
username?: string;
githubLogin?: string;
gitlabLogin?: string;
};
inspectorUrl: string | null;
isRollbackCandidate?: boolean | null;
meta?: { [key: string]: string | undefined };
type Response = {
deployments: DeploymentPartial[];
};
export interface DeploymentPartial {
id: string;
name: string;
ready?: number;
source?: 'cli' | 'git' | 'import' | 'import/repo' | 'clone/repo';
url: string;
created: number;
createdAt: number;
aliases: Alias[];
state:
| 'BUILDING'
| 'ERROR'
@@ -33,15 +19,8 @@ type LegacyDeployment = {
| 'QUEUED'
| 'READY'
| 'CANCELED';
target?: 'production' | 'staging' | null;
type: 'LAMBDAS';
uid: string;
url: string;
};
type Response = {
deployments: LegacyDeployment[];
};
creator: { uid: string };
}
interface Options {
from?: number | null;
@@ -55,7 +34,7 @@ export default async function getDeploymentsByProjectId(
projectId: string,
options: Options = { from: null, limit: 100, continue: false },
total: number = 0
): Promise<Deployment[]> {
): Promise<DeploymentPartial[]> {
const limit = options.limit || 100;
const query = new URLSearchParams();
@@ -66,40 +45,9 @@ export default async function getDeploymentsByProjectId(
query.set('from', options.from.toString());
}
const { deployments: legacyDeployments } = await client.fetch<Response>(
`/v6/deployments?${query}`
const { deployments } = await client.fetch<Response>(
`/v4/now/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) {
@@ -107,7 +55,7 @@ export default async function getDeploymentsByProjectId(
}
if (options.continue && deployments.length === limit) {
const nextFrom = deployments[deployments.length - 1].createdAt;
const nextFrom = deployments[deployments.length - 1].created;
const nextOptions = Object.assign({}, options, { from: nextFrom });
deployments.push(
...(await getDeploymentsByProjectId(

View File

@@ -9,7 +9,7 @@ import {
import { Output } from '../output';
import { progress } from '../output/progress';
import Now from '../../util';
import { Org } from '@vercel-internals/types';
import { Org } from '../../types';
import ua from '../ua';
import { linkFolderToProject } from '../projects/link';
import { prependEmoji, emoji } from '../emoji';

View File

@@ -1,7 +1,5 @@
import { contentType } from 'mime-types';
import path from 'path';
export default function getMimeType(fileName: string) {
const extension = path.extname(fileName);
return contentType(extension) || 'application/octet-stream';
return contentType(fileName) || 'application/octet-stream';
}

View File

@@ -85,7 +85,7 @@ import {
HttpHeadersConfig,
EnvConfigs,
} from './types';
import { ProjectSettings } from '@vercel-internals/types';
import { ProjectSettings } from '../../types';
import { treeKill } from '../tree-kill';
import { applyOverriddenHeaders, nodeHeadersToFetchHeaders } from './headers';
import { formatQueryString, parseQueryString } from './parse-query-string';

View File

@@ -6,4 +6,6 @@
{{?}}
<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>

View File

@@ -16,7 +16,7 @@ import {
import { VercelConfig } from '@vercel/client';
import { HandleValue, Route } from '@vercel/routing-utils';
import { Output } from '../output';
import { ProjectSettings } from '@vercel-internals/types';
import { ProjectSettings } from '../../types';
import { BuilderWithPkg } from '../build/import-builders';
export { VercelConfig };

View File

@@ -7,7 +7,7 @@ import {
DNSConflictingRecord,
isAPIError,
} from '../errors-ts';
import { DNSRecordData } from '@vercel-internals/types';
import { DNSRecordData } from '../../types';
type Response = {
uid: string;

View File

@@ -1,5 +1,5 @@
import chalk from 'chalk';
import { DNSRecordData } from '@vercel-internals/types';
import { DNSRecordData } from '../../types';
import textInput from '../input/text';
import promptBool from '../input/prompt-bool';
import Client from '../client';

View File

@@ -1,4 +1,4 @@
import { DNSRecord } from '@vercel-internals/types';
import { DNSRecord } from '../../types';
import Client from '../client';
export default async function getDNSRecordById(

View File

@@ -1,4 +1,4 @@
import { DNSRecord } from '@vercel-internals/types';
import { DNSRecord } from '../../types';
import { DomainNotFound } from '../errors-ts';
import { Output } from '../output';
import Client from '../client';

View File

@@ -1,4 +1,4 @@
import { DNSRecord, PaginationOptions } from '@vercel-internals/types';
import { DNSRecord, PaginationOptions } from '../../types';
import { DomainNotFound, isAPIError } from '../errors-ts';
import { Output } from '../output';
import Client from '../client';

View File

@@ -1,4 +1,4 @@
import { DNSRecordData } from '@vercel-internals/types';
import { DNSRecordData } from '../../types';
export default function parseAddArgs(
args: string[]

View File

@@ -1,7 +1,7 @@
import chalk from 'chalk';
import retry from 'async-retry';
import { DomainAlreadyExists, InvalidDomain, isAPIError } from '../errors-ts';
import { Domain } from '@vercel-internals/types';
import { Domain } from '../../types';
import Client from '../client';
type Response = {

View File

@@ -1,6 +1,6 @@
import chalk from 'chalk';
import Client from '../client';
import { Domain } from '@vercel-internals/types';
import { Domain } from '../../types';
import {
DomainPermissionDenied,
DomainNotFound,

View File

@@ -1,5 +1,5 @@
import Client from '../client';
import { DomainConfig } from '@vercel-internals/types';
import { DomainConfig } from '../../types';
import { isAPIError } from '../errors-ts';
export async function getDomainConfig(client: Client, domainName: string) {

View File

@@ -1,4 +1,4 @@
import { Domain } from '@vercel-internals/types';
import { Domain } from '../../types';
export type DomainRegistrar = 'Vercel' | 'Purchase in Process' | 'Third Party';

View File

@@ -1,6 +1,6 @@
import chalk from 'chalk';
import Client from '../client';
import { Domain } from '@vercel-internals/types';
import { Domain } from '../../types';
import { isAPIError } from '../errors-ts';
type Response = {

View File

@@ -1,4 +1,4 @@
import { Domain, PaginationOptions } from '@vercel-internals/types';
import { Domain, PaginationOptions } from '../../types';
import Client from '../client';
type Response = {

View File

@@ -1,4 +1,4 @@
import { Domain } from '@vercel-internals/types';
import { Domain } from '../../types';
export default function isDomainExternal(domain: Domain) {
return domain.serviceType !== 'zeit.world';

View File

@@ -1,6 +1,6 @@
import psl from 'psl';
import { NowError } from '../now-error';
import { Domain } from '@vercel-internals/types';
import { Domain } from '../../types';
import { Output } from '../output';
import * as ERRORS from '../errors-ts';
import addDomain from './add-domain';

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