[cli] Remove v1 messages and docs (#5183)

We removed v1 support in [20.0.0](https://github.com/vercel/vercel/releases/tag/vercel%4020.0.0) so this PR removes the unused documentation, warning messages, etc.
This commit is contained in:
Steven
2020-09-11 18:46:32 -04:00
committed by GitHub
parent 5c3cd17074
commit eb8db25845
18 changed files with 21 additions and 194 deletions

View File

@@ -2,8 +2,8 @@
#### Why This Error Occurred
When supplying `regions` or `scale` settings, you
used an unknown or invalid dc identifier.
When supplying `regions` configuration, you
used an unknown or invalid DC identifier.
#### Possible Ways to Fix It
@@ -19,7 +19,7 @@ and DCs have to be in _lowercase_.
- `gru`
- `iad`
In `now-cli`, they currently are transformed to
In Vercel CLI, they currently are transformed to
DC identifiers before being sent to our APIs.
**Valid DC identifiers**:

View File

@@ -1,9 +0,0 @@
# Missing `--dotenv` Target
#### Why This Error Occurred
You specified a path as the value for the `--dotenv` flag, but the target of the path doesn't exist.
#### Possible Ways to Fix It
Make sure the target file you've specified exists and is readable by Vercel CLI. In addition, please ensure that the filename starts with a dot (example: `.env`) - then it should work.

View File

@@ -1,32 +0,0 @@
# Can't Set `regions` and `scale` Options Simultaneously
#### Why This Error Occurred
Your deployment's configuration contains a `regions` and `scale`
configuration simultaneously.
#### Possible Ways to Fix It
The `regions` setting is intended to be used to scale the
deployment to the supplied regions or datacenters identifiers
with default scale settings.
```json
{
"regions": ["sfo", "bru", "gru", "iad"]
}
```
The `scale` object allows you to be more granular: you can decide a
`min` and `max` number of instances per region:
```json
{
"scale": {
"sfo": { "min": 0, "max": 10 }
}
}
```
To solve this problem, use only one of the two ways of deciding
where to scale your deployment to.

View File

@@ -1,36 +0,0 @@
# Invalid Region or DC Identifier
#### Why This Error Occurred
When supplying a region or DC identifier in `vercel scale`,
we weren't able to recognize the value as valid.
#### Possible Ways to Fix It
Check your `vercel scale` command make sure you are using a
valid string after the URL. Regions
and DCs have to be in _lowercase_.
**Valid region identifiers**:
- `all` (special, used to scale to all DCs, can only appear once)
- `sfo`
- `bru`
- `gru`
- `iad`
In Vercel CLI, they currently are transformed to
DC identifiers before being sent to our APIs.
**Valid DC identifiers**:
- `sfo1`
- `bru1`
- `gru1`
- `iad1`
To pass multiple ones, use a comma:
```
vercel scale my-url-123.now.sh sfo,bru,gru 1 5
```

View File

@@ -1,30 +0,0 @@
# `vercel scale ls` is deprecated
#### Why This Error Occurred
We have stopped supporting this command, in favor of
better alternatives.
`vercel scale ls` used to list all the scaling rules
for all your deployments. The output would be too long,
and it would often be hard to find the information
you needed in a long list of items.
#### Possible Ways to Fix It
Instead of using `vercel scale ls` to list all your deployments
and their scaling rules, first use `vercel ls` to find
your deployment:
```console
vercel ls
```
Then, select the URL of your deployment, which uniquely identifies it, and run:
```console
vercel inspect my-deployment-12345.now.sh
```
The `inspect` subcommand will give you your deployment's scale information, including what datacenters it's enabled on, the
current number of instances and minimums/maximums.

View File

@@ -1,12 +0,0 @@
# Scaling path alias
#### Why This Error Occurred
You tried to use `vercel scale` on a path alias (`vercel alias -r rules.json`).
#### Possible Ways to Fix It
Path aliases are routes to instances. Instances can be scaled independent from each other.
You can view path aliases by running `vercel alias ls <id>`.
Documentation for Path Aliases can be found [here](https://vercel.com/docs/features/path-aliases).

View File

@@ -1,16 +0,0 @@
# No minimum scale settings on Cloud v2 deployments
#### Why This Error Occurred
An attempt was made at scaling a Cloud v2 deployment with a `min` scale
setting. This isn't supported yet.
#### Possible Ways to Fix It
Ensure your scale settings (in `vercel.json`, the command you're running
or from a previous deployment who's alias you're trying to overwrite) has
the `min` scale setting set to `0`. You can do this by running
```
vercel scale <deployment> 0 10
```

View File

@@ -1,29 +0,0 @@
# Verification Timeout
#### Why This Error Occurred
After the deployment build completed and the deployment state was set to `READY`,
instances failed to initialize properly.
The CLI attempted to verify that the scale settings of your instances matched,
but it couldn't do so within the allotted time (defaults to 2 minutes).
#### Possible Ways to Fix It
Instance verification is the process of ensuring that after
your deployment is ready, we can actually run (instantiate) your code.
If you configured [regions or scale](https://vercel.com/docs/features/scaling),
we ensure the minimums and maximums are met for the regions you enabled.
If you think your code is taking too long to instantiate, this can be due
to slow boot up times. You can supply `--no-verify` to skip verification
if you are confident your code runs properly.
If your application is not listening on a HTTP port, we might be failing to
instantiate your deployment as well. It might not be showing any errors,
but the deployment instance is effectively not routable and cannot be
verified.
If your instances are crashing before an HTTP port is exposed, verification
will fail as well. Double check your logs (e.g.: by running `vercel logs <url>`)

View File

@@ -96,7 +96,7 @@ export default async function set(
return 1;
}
// For `now alias set <argument>`
// For `vercel alias set <argument>`
if (args.length === 1) {
const deployment = handleCertError(
output,
@@ -261,7 +261,7 @@ function handleSetupDomainError<T>(
{ extraSpace: ' ' }
)}\n\n`
);
output.print(' Read more: https://err.sh/now/domain-verification\n');
output.print(' Read more: https://err.sh/vercel/domain-verification\n');
return 1;
}

View File

@@ -75,7 +75,7 @@ export default async function issue(
}
if (crtPath || keyPath || caPath) {
if (args.length !== 0 || (!crtPath || !keyPath || !caPath)) {
if (args.length !== 0 || !crtPath || !keyPath || !caPath) {
output.error(
`Invalid number of arguments to create a custom certificate entry. Usage:`
);
@@ -230,6 +230,8 @@ async function runStartOrder(
output.print(
` ${chalk.cyan(getCommandName(`certs issue ${cns.join(' ')}`))}\n`
);
output.print(' Read more: https://err.sh/now/solve-challenges-manually\n');
output.print(
' Read more: https://err.sh/vercel/solve-challenges-manually\n'
);
return 0;
}

View File

@@ -1,7 +1,5 @@
import chalk from 'chalk';
import logo from '../../util/output/logo';
import code from '../../util/output/code';
import note from '../../util/output/note';
import { getPkgName } from '../../util/pkg-name.ts';
export const help = () => `
@@ -70,12 +68,6 @@ export const help = () => `
--prod Create a production deployment
-c, --confirm Confirm default options and skip questions
${note(
`To view the usage information for Now 1.0, run ${code(
`${getPkgName()} help deploy-v1`
)}`
)}
${chalk.dim('Examples:')}
${chalk.gray('')} Deploy the current directory

View File

@@ -104,7 +104,7 @@ const printDeploymentStatus = async (
if (readyState !== 'READY') {
output.error(
`Your deployment failed. Please retry later. More: https://err.sh/now/deployment-error`
`Your deployment failed. Please retry later. More: https://err.sh/vercel/deployment-error`
);
return 1;
}
@@ -247,11 +247,6 @@ export default async function main(
const { isFile, path } = pathValidation;
const autoConfirm = argv['--confirm'] || isFile;
// --no-scale
if (argv['--no-scale']) {
warn(`The option --no-scale is only supported on Now 1.0 deployments`);
}
// deprecate --name
if (argv['--name']) {
output.print(

View File

@@ -99,7 +99,7 @@ export default async function main(ctx: NowContext) {
'package.json'
)} must not contain ${cmd('now dev')}`
);
output.error(`Learn More: http://err.sh/now/now-dev-as-dev-script`);
output.error(`Learn More: http://err.sh/vercel/now-dev-as-dev-script`);
return 1;
}
if (scripts && scripts.dev && /\bvercel\b\W+\bdev\b/.test(scripts.dev)) {
@@ -108,7 +108,7 @@ export default async function main(ctx: NowContext) {
'package.json'
)} must not contain ${cmd('vercel dev')}`
);
output.error(`Learn More: http://err.sh/now/now-dev-as-dev-script`);
output.error(`Learn More: http://err.sh/vercel/now-dev-as-dev-script`);
return 1;
}
}

View File

@@ -67,13 +67,15 @@ export default function handleCertError<T>(
output.print(
` ${getCommandName(`certs issue --challenge-only <cns>`)}\n`
);
output.print(' Read more: https://err.sh/now/dns-configuration-error\n');
output.print(
' Read more: https://err.sh/vercel/dns-configuration-error\n'
);
} else {
output.print(
` We configured them for you, but the propagation may take a few minutes. Please try again later.\n`
);
output.print(
' Read more: https://err.sh/now/dns-configuration-error\n\n'
' Read more: https://err.sh/vercel/dns-configuration-error\n\n'
);
}
return 1;

View File

@@ -999,7 +999,7 @@ export class MissingDotenvVarsError extends NowError<
].join('\n');
}
message += '\nRead more: https://err.sh/now/missing-env-file';
message += '\nRead more: https://err.sh/vercel/missing-env-file';
super({
code: 'MISSING_DOTENV_VARS',

View File

@@ -186,7 +186,7 @@ export default class Now extends EventEmitter {
const { key } = error;
err.message =
`The env key ${key} has an invalid type: ${typeof env[key]}. ` +
'Please supply a String or a Number (https://err.sh/now-cli/env-value-invalid-type)';
'Please supply a String or a Number (https://err.sh/vercel-cli/env-value-invalid-type)';
} else if (code === 'unreferenced_build_specifications') {
const count = unreferencedBuildSpecs.length;
const prefix = count === 1 ? 'build' : 'builds';

View File

@@ -33,7 +33,7 @@ export default function createOutput({ debug: debugEnabled = false } = {}) {
boxen?: boxen.Options;
}
) {
const details = slug ? `https://err.sh/now/${slug}` : link;
const details = slug ? `https://err.sh/vercel/${slug}` : link;
print(
boxen(
@@ -66,7 +66,7 @@ export default function createOutput({ debug: debugEnabled = false } = {}) {
action = 'Learn More'
) {
print(`${chalk.red(`Error!`)} ${str}\n`);
const details = slug ? `https://err.sh/now/${slug}` : link;
const details = slug ? `https://err.sh/vercel/${slug}` : link;
if (details) {
print(`${chalk.bold(action)}: ${renderLink(details)}\n`);
}

View File

@@ -10,7 +10,7 @@ export default function error(...input: string[] | [APIError]) {
if (typeof input[0] === 'object') {
const { slug, message, link, action = 'Learn More' } = input[0];
messages = [message];
const details = slug ? `https://err.sh/now/${slug}` : link;
const details = slug ? `https://err.sh/vercel/${slug}` : link;
if (details) {
messages.push(`${chalk.bold(action)}: ${renderLink(details)}`);
}