mirror of
https://github.com/LukeHagar/vercel.git
synced 2025-12-11 21:07:47 +00:00
Compare commits
67 Commits
@vercel/py
...
@vercel/py
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
63cc9009c8 | ||
|
|
ccf6e3c432 | ||
|
|
8d015e3138 | ||
|
|
42f2fa1a20 | ||
|
|
8397aac0e3 | ||
|
|
7bcdc144eb | ||
|
|
624da9170d | ||
|
|
fb5b013a03 | ||
|
|
0a4bb53a58 | ||
|
|
2fbd9c78e3 | ||
|
|
1ed2b7a57d | ||
|
|
88cd9ca3c3 | ||
|
|
ecea2ca4a3 | ||
|
|
3f132bc15b | ||
|
|
61d95094c0 | ||
|
|
f7c47975e3 | ||
|
|
7c96f9f9a5 | ||
|
|
a5c805b6eb | ||
|
|
ff2a22023d | ||
|
|
c6efc028aa | ||
|
|
96565da1cf | ||
|
|
afb5e7fc85 | ||
|
|
34cc987be8 | ||
|
|
55c60d30e6 | ||
|
|
eb993d47ac | ||
|
|
d2184628d1 | ||
|
|
65f0cc6797 | ||
|
|
c628c7b58e | ||
|
|
4e005274f9 | ||
|
|
482373f711 | ||
|
|
c80bb37e8d | ||
|
|
a7acd92ffd | ||
|
|
035720ca82 | ||
|
|
a6ae923a7a | ||
|
|
83c0711d6e | ||
|
|
231f18d56b | ||
|
|
9d73091d8c | ||
|
|
0ca3189f79 | ||
|
|
9ff5bb9cb3 | ||
|
|
45d05a603b | ||
|
|
6ef3b12fde | ||
|
|
b16f94098a | ||
|
|
be315bebcf | ||
|
|
5608a4c42c | ||
|
|
66458fe3e0 | ||
|
|
081b3fd3db | ||
|
|
56c8af51b2 | ||
|
|
e844a38286 | ||
|
|
cfb84b5328 | ||
|
|
4c61779d1b | ||
|
|
ee9b3710ec | ||
|
|
719d1ffba9 | ||
|
|
6849e3aec0 | ||
|
|
dd2399f361 | ||
|
|
684c229984 | ||
|
|
e6c50e2efb | ||
|
|
0b5d38e862 | ||
|
|
775e6b4856 | ||
|
|
3a9cf083cb | ||
|
|
6b58b56c49 | ||
|
|
212cee19b4 | ||
|
|
c9d3ec21c2 | ||
|
|
5fa8ed56a9 | ||
|
|
ff80043acf | ||
|
|
1f0ebcef24 | ||
|
|
c35d0e8408 | ||
|
|
65446b73da |
28
.github/CODEOWNERS
vendored
28
.github/CODEOWNERS
vendored
@@ -1,27 +1,27 @@
|
||||
# Documentation
|
||||
# https://help.github.com/en/articles/about-code-owners
|
||||
|
||||
* @tootallnate
|
||||
* @TooTallNate
|
||||
/.github/workflows @AndyBitz @styfle
|
||||
/packages/frameworks @AndyBitz
|
||||
/packages/now-cli/src/commands/dev/ @tootallnate @styfle @AndyBitz
|
||||
/packages/now-cli/src/util/dev/ @tootallnate @styfle @AndyBitz
|
||||
/packages/now-cli/src/commands/domains/ @javivelasco @mglagola @anatrajkovska
|
||||
/packages/now-cli/src/commands/certs/ @javivelasco @mglagola @anatrajkovska
|
||||
/packages/now-cli/src/commands/dev @TooTallNate @styfle @AndyBitz
|
||||
/packages/now-cli/src/util/dev @TooTallNate @styfle @AndyBitz
|
||||
/packages/now-cli/src/commands/domains @javivelasco @mglagola @anatrajkovska
|
||||
/packages/now-cli/src/commands/certs @javivelasco @mglagola @anatrajkovska
|
||||
/packages/now-cli/src/commands/env @styfle @lucleray
|
||||
/packages/now-client @rdev
|
||||
/packages/now-build-utils @styfle @AndyBitz
|
||||
/packages/now-node @styfle @tootallnate @lucleray
|
||||
/packages/now-node-bridge @styfle @tootallnate @lucleray
|
||||
/packages/now-client @rdev @styfle @TooTallNate
|
||||
/packages/now-build-utils @styfle @AndyBitz @TooTallNate
|
||||
/packages/now-node @styfle @TooTallNate @lucleray
|
||||
/packages/now-node-bridge @styfle @TooTallNate @lucleray
|
||||
/packages/now-next @Timer @ijjk
|
||||
/packages/now-go @styfle @sophearak
|
||||
/packages/now-python @styfle @sophearak
|
||||
/packages/now-ruby @styfle @coetry @nathancahill
|
||||
/packages/now-go @styfle @TooTallNate
|
||||
/packages/now-python @styfle @TooTallNate
|
||||
/packages/now-ruby @styfle @coetry @TooTallNate
|
||||
/packages/now-static-build @styfle @AndyBitz
|
||||
/packages/now-routing-utils @styfle @dav-is @ijjk
|
||||
/examples @mcsdevv @timothyis
|
||||
/examples/create-react-app @Timer
|
||||
/examples/nextjs @timneutkens
|
||||
/examples/nextjs @timneutkens @Timer
|
||||
/examples/hugo @mcsdevv @timothyis @styfle
|
||||
/examples/jekyll @mcsdevv @timothyis @sarupbanskota
|
||||
/examples/jekyll @mcsdevv @timothyis @styfle
|
||||
/examples/zola @mcsdevv @timothyis @styfle
|
||||
|
||||
18
.github/CONTRIBUTING.md
vendored
18
.github/CONTRIBUTING.md
vendored
@@ -1,6 +1,6 @@
|
||||
# Contributing
|
||||
|
||||
When contributing to this repository, please first discuss the change you wish to make via [GitHub Discussions](https://github.com/zeit/now/discussions/new) with the owners of this repository before submitting a Pull Request.
|
||||
When contributing to this repository, please first discuss the change you wish to make via [GitHub Discussions](https://github.com/vercel/vercel/discussions/new) with the owners of this repository before submitting a Pull Request.
|
||||
|
||||
Please read our [code of conduct](CODE_OF_CONDUCT.md) and follow it in all your interactions with the project.
|
||||
|
||||
@@ -11,7 +11,7 @@ This project is configured in a monorepo pattern where one repo contains multipl
|
||||
To get started, execute the following:
|
||||
|
||||
```
|
||||
git clone https://github.com/zeit/now
|
||||
git clone https://github.com/vercel/vercel
|
||||
yarn install
|
||||
yarn bootstrap
|
||||
yarn build
|
||||
@@ -82,24 +82,24 @@ trace(['path/to/entrypoint.js'], {
|
||||
.then(e => console.error(e));
|
||||
```
|
||||
|
||||
When you run this script, you'll see all imported files. If anything file is missing, the bug is in [@zeit/node-file-trace](https://github.com/zeit/node-file-trace) and not the Builder.
|
||||
When you run this script, you'll see all imported files. If anything file is missing, the bug is in [@zeit/node-file-trace](https://github.com/vercel/node-file-trace) and not the Builder.
|
||||
|
||||
## Deploy a Builder with existing project
|
||||
|
||||
Sometimes you want to test changes to a Builder against an existing project, maybe with `now dev` or an actual deployment. You can avoid publishing every Builder change to npm by uploading the Builder as a tarball.
|
||||
Sometimes you want to test changes to a Builder against an existing project, maybe with `vercel dev` or an actual deployment. You can avoid publishing every Builder change to npm by uploading the Builder as a tarball.
|
||||
|
||||
1. Change directory to the desired Builder `cd ./packages/now-node`
|
||||
2. Run `yarn build` to compile typescript and other build steps
|
||||
3. Run `npm pack` to create a tarball file
|
||||
4. Run `now *.tgz` to upload the tarball file and get a URL
|
||||
4. Run `vercel *.tgz` to upload the tarball file and get a URL
|
||||
5. Edit any existing `vercel.json` project and replace `use` with the URL
|
||||
6. Run `now` or `now dev` to deploy with the experimental Builder
|
||||
6. Run `vercel` or `vercel dev` to deploy with the experimental Builder
|
||||
|
||||
## Add a New Framework
|
||||
|
||||
You can add support for a new Framework by creating a Pull Request for this repository and following the steps below:
|
||||
|
||||
1. Add the Framework to the `@now/frameworks` package: The file is located in `packages/frameworks/frameworks.json`. You can copy the structure of an existing one and adjust the required fields. Note that the `settings` property either contains a `value` or a `placeholder`. The `value` property is used when something is not configurable, the `placeholder` is used when something is configurable and can be changed with configuration. An example would be the Output Directory for Hugo, it's `public` by default but can be changed through its config file, so we use `placeholder` with an explanation of what can be used.
|
||||
2. Add an example to the `examples/` directory: The name of the directory should equal the slug of the framework used in `@now/frameworks`. The `.github/EXAMPLE_README_TEMPLATE.md` file can be used to create a `README.md` file for the example.
|
||||
3. Update the `@now/static-build` package: The file `packages/now-static-build/src/frameworks.ts` has to be extended. You can add default routes that will always be applied to projects that use this Framework or specify some paths that will be cached to speed up the build process.
|
||||
1. Add the Framework to the `@vercel/frameworks` package: The file is located in `./packages/frameworks/frameworks.json`. You can copy the structure of an existing one and adjust the required fields. Note that the `settings` property either contains a `value` or a `placeholder`. The `value` property is used when something is not configurable, the `placeholder` is used when something is configurable and can be changed with configuration. An example would be the Output Directory for Hugo, it's `public` by default but can be changed through its config file, so we use `placeholder` with an explanation of what can be used.
|
||||
2. Add an example to the `./examples` directory: The name of the directory should equal the slug of the framework used in `@vercel/frameworks`. The `.github/EXAMPLE_README_TEMPLATE.md` file can be used to create a `README.md` file for the example.
|
||||
3. Update the `@vercel/static-build` package: The file `./packages/now-static-build/src/frameworks.ts` has to be extended. You can add default routes that will always be applied to projects that use this Framework or specify some paths that will be cached to speed up the build process.
|
||||
4. After your Pull Request has been merged and released, other users can select the example on the Vercel dashboard and deploy it.
|
||||
|
||||
6
.github/EXAMPLE_README_TEMPLATE.md
vendored
6
.github/EXAMPLE_README_TEMPLATE.md
vendored
@@ -6,14 +6,14 @@ This directory is a brief example of a [Name](site-link) site that can be deploy
|
||||
|
||||
Deploy your own [Name] project with Vercel.
|
||||
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now-examples/tree/master/example-directory)
|
||||
[](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/example-directory)
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with [Name] on Vercel, you can use the [CLI Tool Used](CLI-link) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ now init charge
|
||||
$ vercel init [Name]]
|
||||
```
|
||||
|
||||
### Deploying From Your Terminal
|
||||
@@ -21,5 +21,5 @@ $ now init charge
|
||||
Once initialized, you can deploy the [Name] example with just a single command:
|
||||
|
||||
```shell
|
||||
$ now
|
||||
$ vercel
|
||||
```
|
||||
|
||||
4
.github/ISSUE_TEMPLATE/config.yml
vendored
4
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -4,8 +4,8 @@ contact_links:
|
||||
url: https://vercel.com/support/request
|
||||
about: Report a bug using the Vercel support form
|
||||
- name: Feature Request
|
||||
url: https://github.com/zeit/now/discussions/new?category_id=66161
|
||||
url: https://github.com/vercel/vercel/discussions/new?category_id=66161
|
||||
about: Share ideas for new features
|
||||
- name: Ask a Question
|
||||
url: https://github.com/zeit/now/discussions/new?category_id=66160
|
||||
url: https://github.com/vercel/vercel/discussions/new?category_id=66160
|
||||
about: Ask the community for help
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -27,3 +27,4 @@ test/lib/deployment/failed-page.txt
|
||||
/.env
|
||||
/public
|
||||
__pycache__
|
||||
.vercel
|
||||
|
||||
@@ -32,7 +32,7 @@ export analyze({
|
||||
If you are using TypeScript, you should use the following types:
|
||||
|
||||
```ts
|
||||
import { AnalyzeOptions } from '@now/build-utils'
|
||||
import { AnalyzeOptions } from '@vercel/build-utils'
|
||||
|
||||
export analyze(options: AnalyzeOptions) {
|
||||
return 'fingerprint goes here'
|
||||
@@ -67,7 +67,7 @@ build({
|
||||
If you are using TypeScript, you should use the following types:
|
||||
|
||||
```ts
|
||||
import { BuildOptions } from '@now/build-utils'
|
||||
import { BuildOptions } from '@vercel/build-utils'
|
||||
|
||||
export build(options: BuildOptions) {
|
||||
// Build the code here
|
||||
@@ -100,7 +100,7 @@ prepareCache({
|
||||
If you are using TypeScript, you can import the types for each of these functions by using the following:
|
||||
|
||||
```ts
|
||||
import { PrepareCacheOptions } from '@now/build-utils'
|
||||
import { PrepareCacheOptions } from '@vercel/build-utils'
|
||||
|
||||
export prepareCache(options: PrepareCacheOptions) {
|
||||
return { 'path-to-file': File }
|
||||
@@ -109,7 +109,7 @@ export prepareCache(options: PrepareCacheOptions) {
|
||||
|
||||
### `shouldServe`
|
||||
|
||||
An **optional** exported function that is only used by `now dev` in [Now CLI](https:///download) and indicates whether a [Runtime](https://vercel.com/docs/runtimes) wants to be responsible for building a certain request path.
|
||||
An **optional** exported function that is only used by `vercel dev` in [Vercel CLI](https:///download) and indicates whether a [Runtime](https://vercel.com/docs/runtimes) wants to be responsible for building a certain request path.
|
||||
|
||||
```js
|
||||
shouldServe({
|
||||
@@ -124,14 +124,14 @@ shouldServe({
|
||||
If you are using TypeScript, you can import the types for each of these functions by using the following:
|
||||
|
||||
```ts
|
||||
import { ShouldServeOptions } from '@now/build-utils'
|
||||
import { ShouldServeOptions } from '@vercel/build-utils'
|
||||
|
||||
export shouldServe(options: ShouldServeOptions) {
|
||||
return Boolean
|
||||
}
|
||||
```
|
||||
|
||||
If this method is not defined, Now CLI will default to [this function](https://github.com/zeit/now/blob/52994bfe26c5f4f179bdb49783ee57ce19334631/packages/now-build-utils/src/should-serve.ts).
|
||||
If this method is not defined, Vercel CLI will default to [this function](https://github.com/vercel/vercel/blob/52994bfe26c5f4f179bdb49783ee57ce19334631/packages/now-build-utils/src/should-serve.ts).
|
||||
|
||||
### Runtime Options
|
||||
|
||||
@@ -147,7 +147,7 @@ The exported functions [`analyze`](#analyze), [`build`](#build), and [`prepareCa
|
||||
|
||||
## Examples
|
||||
|
||||
Check out our [Node.js Runtime](https://github.com/zeit/now/tree/master/packages/now-node), [Go Runtime](https://github.com/zeit/now/tree/master/packages/now-go), [Python Runtime](https://github.com/zeit/now/tree/master/packages/now-python) or [Ruby Runtime](https://github.com/zeit/now/tree/master/packages/now-ruby) for examples of how to build one.
|
||||
Check out our [Node.js Runtime](https://github.com/vercel/vercel/tree/master/packages/now-node), [Go Runtime](https://github.com/vercel/vercel/tree/master/packages/now-go), [Python Runtime](https://github.com/vercel/vercel/tree/master/packages/now-python) or [Ruby Runtime](https://github.com/vercel/vercel/tree/master/packages/now-ruby) for examples of how to build one.
|
||||
|
||||
## Technical Details
|
||||
|
||||
@@ -171,14 +171,14 @@ The env and secrets specified by the user as `build.env` are passed to the Runti
|
||||
|
||||
### Utilities as peerDependencies
|
||||
|
||||
When you publish your Runtime to npm, make sure to not specify `@now/build-utils` (as seen below in the API definitions) as a dependency, but rather as part of `peerDependencies`.
|
||||
When you publish your Runtime to npm, make sure to not specify `@vercel/build-utils` (as seen below in the API definitions) as a dependency, but rather as part of `peerDependencies`.
|
||||
|
||||
## Types
|
||||
|
||||
### `Files`
|
||||
|
||||
```ts
|
||||
import { File } from '@now/build-utils';
|
||||
import { File } from '@vercel/build-utils';
|
||||
type Files = { [filePath: string]: File };
|
||||
```
|
||||
|
||||
@@ -200,7 +200,7 @@ An example of a valid output `Files` object is:
|
||||
This is an abstract type that can be imported if you are using TypeScript.
|
||||
|
||||
```ts
|
||||
import { File } from '@now/build-utils';
|
||||
import { File } from '@vercel/build-utils';
|
||||
```
|
||||
|
||||
Valid `File` types include:
|
||||
@@ -212,7 +212,7 @@ Valid `File` types include:
|
||||
### `FileRef`
|
||||
|
||||
```ts
|
||||
import { FileRef } from '@now/build-utils';
|
||||
import { FileRef } from '@vercel/build-utils';
|
||||
```
|
||||
|
||||
This is a [JavaScript class](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes) that represents an abstract file instance stored in our platform, based on the file identifier string (its checksum). When a `Files` object is passed as an input to `analyze` or `build`, all its values will be instances of `FileRef`.
|
||||
@@ -229,7 +229,7 @@ This is a [JavaScript class](https://developer.mozilla.org/en-US/docs/Web/JavaSc
|
||||
### `FileFsRef`
|
||||
|
||||
```ts
|
||||
import { FileFsRef } from '@now/build-utils';
|
||||
import { FileFsRef } from '@vercel/build-utils';
|
||||
```
|
||||
|
||||
This is a [JavaScript class](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes) that represents an abstract instance of a file present in the filesystem that the build process is executing in.
|
||||
@@ -247,7 +247,7 @@ This is a [JavaScript class](https://developer.mozilla.org/en-US/docs/Web/JavaSc
|
||||
### `FileBlob`
|
||||
|
||||
```ts
|
||||
import { FileBlob } from '@now/build-utils';
|
||||
import { FileBlob } from '@vercel/build-utils';
|
||||
```
|
||||
|
||||
This is a [JavaScript class](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes) that represents an abstract instance of a file present in memory.
|
||||
@@ -265,7 +265,7 @@ This is a [JavaScript class](https://developer.mozilla.org/en-US/docs/Web/JavaSc
|
||||
### `Lambda`
|
||||
|
||||
```ts
|
||||
import { Lambda } from '@now/build-utils';
|
||||
import { Lambda } from '@vercel/build-utils';
|
||||
```
|
||||
|
||||
This is a [JavaScript class](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), called a Serverless Function, that can be created by supplying `files`, `handler`, `runtime`, and `environment` as an object to the [`createLambda`](#createlambda) helper. The instances of this class should not be created directly. Instead, invoke the [`createLambda`](#createlambda) helper function.
|
||||
@@ -293,20 +293,20 @@ This is an abstract enumeration type that is implemented by one of the following
|
||||
|
||||
## JavaScript API
|
||||
|
||||
The following is exposed by `@now/build-utils` to simplify the process of writing Runtimes, manipulating the file system, using the above types, etc.
|
||||
The following is exposed by `@vercel/build-utils` to simplify the process of writing Runtimes, manipulating the file system, using the above types, etc.
|
||||
|
||||
### `createLambda`
|
||||
|
||||
Signature: `createLambda(Object spec) : Lambda`
|
||||
|
||||
```ts
|
||||
import { createLambda } from '@now/build-utils';
|
||||
import { createLambda } from '@vercel/build-utils';
|
||||
```
|
||||
|
||||
Constructor for the [`Lambda`](#lambda) type.
|
||||
|
||||
```js
|
||||
const { createLambda, FileBlob } = require('@now/build-utils');
|
||||
const { createLambda, FileBlob } = require('@vercel/build-utils');
|
||||
await createLambda({
|
||||
runtime: 'nodejs8.10',
|
||||
handler: 'index.main',
|
||||
@@ -321,7 +321,7 @@ await createLambda({
|
||||
Signature: `download() : Files`
|
||||
|
||||
```ts
|
||||
import { download } from '@now/build-utils';
|
||||
import { download } from '@vercel/build-utils';
|
||||
```
|
||||
|
||||
This utility allows you to download the contents of a [`Files`](#files) data structure, therefore creating the filesystem represented in it.
|
||||
@@ -339,7 +339,7 @@ await download(files, workPath, meta);
|
||||
Signature: `glob() : Files`
|
||||
|
||||
```ts
|
||||
import { glob } from '@now/build-utils';
|
||||
import { glob } from '@vercel/build-utils';
|
||||
```
|
||||
|
||||
This utility allows you to _scan_ the filesystem and return a [`Files`](#files) representation of the matched glob search string. It can be thought of as the reverse of [`download`](#download).
|
||||
@@ -347,7 +347,7 @@ This utility allows you to _scan_ the filesystem and return a [`Files`](#files)
|
||||
The following trivial example downloads everything to the filesystem, only to return it back (therefore just re-creating the passed-in [`Files`](#files)):
|
||||
|
||||
```js
|
||||
const { glob, download } = require('@now/build-utils')
|
||||
const { glob, download } = require('@vercel/build-utils')
|
||||
|
||||
exports.build = ({ files, workPath }) => {
|
||||
await download(files, workPath)
|
||||
@@ -360,7 +360,7 @@ exports.build = ({ files, workPath }) => {
|
||||
Signature: `getWriteableDirectory() : String`
|
||||
|
||||
```ts
|
||||
import { getWriteableDirectory } from '@now/build-utils';
|
||||
import { getWriteableDirectory } from '@vercel/build-utils';
|
||||
```
|
||||
|
||||
In some occasions, you might want to write to a temporary directory.
|
||||
@@ -370,13 +370,13 @@ In some occasions, you might want to write to a temporary directory.
|
||||
Signature: `rename(Files) : Files`
|
||||
|
||||
```ts
|
||||
import { rename } from '@now/build-utils';
|
||||
import { rename } from '@vercel/build-utils';
|
||||
```
|
||||
|
||||
Renames the keys of the [`Files`](#files) object, which represent the paths. For example, to remove the `*.go` suffix you can use:
|
||||
|
||||
```js
|
||||
const rename = require('@now/build-utils')
|
||||
const rename = require('@vercel/build-utils')
|
||||
const originalFiles = { 'one.go': fileFsRef1, 'two.go': fileFsRef2 }
|
||||
const renamedFiles = rename(originalFiles, path => path.replace(/\.go$/, '')
|
||||
```
|
||||
|
||||
2
LICENSE
2
LICENSE
@@ -175,7 +175,7 @@ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
Copyright 2017 ZEIT, Inc.
|
||||
Copyright 2017 Vercel, Inc.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<p align="center">Develop. Preview. Ship.</p>
|
||||
</p>
|
||||
|
||||
[](https://github.com/zeit/now/actions?workflow=CI)
|
||||
[](https://github.com/zeit/now/discussions)
|
||||
[](https://github.com/vercel/vercel/actions?workflow=CI)
|
||||
[](https://github.com/vercel/vercel/discussions)
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -31,4 +31,4 @@ As always, you should use `yarn test-unit` to run the tests and see if your chan
|
||||
|
||||
## How to Create a Release
|
||||
|
||||
If you have write access to this repository, you can read more about how to publish a release [here](https://github.com/zeit/now/wiki/Creating-a-Release).
|
||||
If you have write access to this repository, you can read more about how to publish a release [here](https://github.com/vercel/vercel/wiki/Creating-a-Release).
|
||||
|
||||
@@ -51,7 +51,8 @@ export async function getGitHubRepoInfo(repo: Repo) {
|
||||
data.subdir = repo.path.slice(subdirPath.length).split('/');
|
||||
}
|
||||
|
||||
if (data.id === 'zeit/now' && data.subdir && data.subdir[0] === 'examples') {
|
||||
if (data.id === 'vercel/vercel' && data.subdir && data.subdir[0] === 'examples') {
|
||||
|
||||
// from our examples, add `homepage` and `description` fields
|
||||
const example = data.subdir[1];
|
||||
const exampleList = await getExampleList();
|
||||
|
||||
@@ -45,8 +45,8 @@ export default withApiHandler(async function(req: NowRequest, res: NowResponse)
|
||||
|
||||
const example = segment.slice(0, -ext.length);
|
||||
|
||||
await extract('https://github.com/zeit/now/archive/master.zip', TMP_DIR);
|
||||
const directory = `${TMP_DIR}/now-master/examples/${example}`;
|
||||
await extract('https://github.com/vercel/vercel/archive/master.zip', TMP_DIR);
|
||||
const directory = `${TMP_DIR}/vercel-master/examples/${example}`;
|
||||
|
||||
if (!isDirectory(directory)) {
|
||||
return notFound(res, `Example '${example}' was not found.`);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// A proxy to get the basic info of an existing github/gitlab repo:
|
||||
// GET /info?repo=zeit/micro
|
||||
// GET /info?repo=vercel/micro
|
||||
|
||||
// @ts-ignore
|
||||
import parseGitUrl from 'parse-github-url';
|
||||
|
||||
@@ -8,8 +8,8 @@ export default withApiHandler(async function(
|
||||
req: NowRequest,
|
||||
res: NowResponse
|
||||
) {
|
||||
await extract('https://github.com/zeit/now/archive/master.zip', '/tmp');
|
||||
const exampleList = summary('/tmp/now-master/examples');
|
||||
await extract('https://github.com/vercel/vercel/archive/master.zip', '/tmp');
|
||||
const exampleList = summary('/tmp/vercel-master/examples');
|
||||
|
||||
const existingExamples = Array.from(exampleList).map(key => ({
|
||||
name: key,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "api",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"description": "API for the zeit/now repo",
|
||||
"description": "API for the vercel/vercel repo",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
"build": "yarn --cwd .. && node ../utils/run.js build all"
|
||||
|
||||
@@ -33,5 +33,5 @@ When passing multiple `--regions` as a CLI parameter,
|
||||
make sure they're separated by a comma (`,`). For example:
|
||||
|
||||
```console
|
||||
now --regions sfo,bru,gru
|
||||
vercel --regions sfo,bru,gru
|
||||
```
|
||||
|
||||
@@ -8,13 +8,13 @@ The domain you supplied cannot be verified using either the intended set of name
|
||||
|
||||
Apply the intended set of nameservers to your domain or add the given TXT verification record through your domain provider.
|
||||
|
||||
You can retrieve both the intended nameservers and TXT verification record for the domain you wish to verify by running `now domains inspect <domain>`.
|
||||
You can retrieve both the intended nameservers and TXT verification record for the domain you wish to verify by running `vercel domains inspect <domain>`.
|
||||
|
||||
When you have added either verification method to your domain, you can run `now domains verify <domain>` again to complete verification for your domain.
|
||||
When you have added either verification method to your domain, you can run `vercel domains verify <domain>` again to complete verification for your domain.
|
||||
|
||||
Vercel will also automatically check periodically that your domain has been verified and automatically mark it as such if we detect either verification method on the domain.
|
||||
|
||||
If you would not like to verify your domain, you can remove it from your account using `now domains rm <domain>`.
|
||||
If you would not like to verify your domain, you can remove it from your account using `vercel domains rm <domain>`.
|
||||
|
||||
#### Resources
|
||||
|
||||
|
||||
@@ -9,9 +9,9 @@ You specified the `--env` or `-e` flag with the value of a secret. However, the
|
||||
Make sure to specify the environment variable and secret like that:
|
||||
|
||||
```bash
|
||||
now -e VARIABLE_NAME=@secret-name
|
||||
vercel -e VARIABLE_NAME=@secret-name
|
||||
```
|
||||
|
||||
In addition, ensure that the secret (`@secret-name` in the example above) exists in the current scope (the team or user account that you're using).
|
||||
|
||||
You can run `now switch` or `--scope` to switch to a different team or user.
|
||||
You can run `vercel switch` or `--scope` to switch to a different team or user.
|
||||
|
||||
@@ -6,4 +6,4 @@ You specified a path as the value for the `--dotenv` flag, but the target of the
|
||||
|
||||
#### Possible Ways to Fix It
|
||||
|
||||
Make sure the target file you've specified exists and is readable by Now CLI. In addition, please ensure that the filename starts with a dot (example: `.env`) - then it should work.
|
||||
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.
|
||||
|
||||
@@ -2,17 +2,17 @@
|
||||
|
||||
#### Why This Error Occurred
|
||||
|
||||
You ran `now dev` inside a project that contains a `vercel.json` file with `env` or `build.env` properties that use [Now Secrets](https://vercel.com/docs/v2/build-step#environment-variables).
|
||||
You ran `vercel dev` inside a project that contains a `vercel.json` file with `env` or `build.env` properties that use [Vercel Secrets](https://vercel.com/docs/v2/build-step#environment-variables).
|
||||
|
||||
In order to use environment variables in your project locally that have values defined using the Now Secrets format (e.g. `@my-secret-value`), you will need to provide the value as an environment variable using a `.env` or `.env.build` file.
|
||||
In order to use environment variables in your project locally that have values defined using the Vercel Secrets format (e.g. `@my-secret-value`), you will need to provide the value as an environment variable using a `.env`.
|
||||
|
||||
We require this to ensure your app works as you intend it to, in the Now Dev environment, and to provide you with a way to mirror or separate private environment variables within your applications, for example when connecting to a database.
|
||||
We require this to ensure your app works as you intend it to, in the development environment, and to provide you with a way to mirror or separate private environment variables within your applications, for example when connecting to a database.
|
||||
|
||||
Read below for how to address this error.
|
||||
|
||||
#### Possible Ways to Fix It
|
||||
|
||||
The error message will list environment variables that are required and which file they are required to be included in (either `.env` or `.env.build`).
|
||||
The error message will list environment variables that are required and which file they are required to be included in `.env`.
|
||||
|
||||
If the file does not exist yet, please create the file that the error message mentions and insert the missing environment variable into it.
|
||||
|
||||
|
||||
@@ -9,11 +9,11 @@ You specified the `--env` or `-e` flag and didn't add a name and value for the e
|
||||
Make sure to set the name and value of the variable like this:
|
||||
|
||||
```bash
|
||||
now -e VARIABLE_NAME="VALUE"
|
||||
vercel -e VARIABLE_NAME="VALUE"
|
||||
```
|
||||
|
||||
You can also specify a environment variable that contains a secret:
|
||||
|
||||
```bash
|
||||
now -e VARIABLE_NAME=@secret-name
|
||||
vercel -e VARIABLE_NAME=@secret-name
|
||||
```
|
||||
|
||||
@@ -8,4 +8,4 @@ The `--scope` flag was specified, but there's no value for it available.
|
||||
|
||||
In order to make it work, you need to specify a value for the `--scope` flag. This needs to be the slug or ID of the team as which you'd like to act or the username or ID of a user you'd like to act as.
|
||||
|
||||
As an example, if your team URL is `https://vercel.com/teams/zeit`, you would set `--scope` to `zeit`.
|
||||
As an example, if your team URL is `https://vercel.com/my-team`, you would set `--scope` to `my-team`.
|
||||
|
||||
14
errors/next-functions-config-optimized-lambdas.md
Normal file
14
errors/next-functions-config-optimized-lambdas.md
Normal file
@@ -0,0 +1,14 @@
|
||||
# `@vercel/next` Functions Config Optimized Lambdas Opt-out
|
||||
|
||||
#### Why This Warning Occurred
|
||||
|
||||
`@vercel/next` by default now bundles pages into optimized functions, minimizing bootup time and increasing overall application throughput.
|
||||
When the `functions` config is added in `now.json` or `vercel.json`, it causes conflicts with this optimization, so it is opted-out.
|
||||
|
||||
#### Possible Ways to Fix It
|
||||
|
||||
Remove the `functions` config from your `now.json` or `vercel.json` to take advantage of this optimization.
|
||||
|
||||
### Useful Links
|
||||
|
||||
- [Functions Config Documentation](https://vercel.com/docs/configuration?query=functions#project/functions)
|
||||
16
errors/next-legacy-routes-optimized-lambdas.md
Normal file
16
errors/next-legacy-routes-optimized-lambdas.md
Normal file
@@ -0,0 +1,16 @@
|
||||
# `@vercel/next` Legacy Routes Optimized Lambdas Opt-out
|
||||
|
||||
#### Why This Warning Occurred
|
||||
|
||||
`@vercel/next` by default now bundles pages into optimized functions, minimizing bootup time and increasing overall application throughput.
|
||||
When legacy `routes` are added in `now.json` or `vercel.json`, they cause conflicts with this optimization, so it is opted-out.
|
||||
|
||||
#### Possible Ways to Fix It
|
||||
|
||||
Migrate from using legacy `routes` to the new `rewrites`, `redirects`, and `headers` configurations in your `now.json` or `vercel.json` file or leverage them directly in your `next.config.js` with the built-in [custom routes support](https://github.com/zeit/next.js/issues/9081)
|
||||
|
||||
### Useful Links
|
||||
|
||||
- [Rewrites Documentation](https://vercel.com/docs/configuration?query=rewrites#project/rewrites)
|
||||
- [Redirects Documentation](https://vercel.com/docs/configuration?query=rewrites#project/redirects)
|
||||
- [Headers Documentation](https://vercel.com/docs/configuration?query=rewrites#project/headers)
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#### Why This Error Occurred
|
||||
|
||||
You're running Now CLI in a non-terminal context and there are no credentials available. This means that Now CLI is not able to authenticate against our service.
|
||||
You're running Vercel CLI in a non-terminal context and there are no credentials available. This means that Vercel CLI is not able to authenticate against our service.
|
||||
|
||||
#### Possible Ways to Fix It
|
||||
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
#### Why This Error Occurred
|
||||
|
||||
You tried to run a command that doesn't allow the `--token` flag (like `now switch`). This is not allowed because commands like these are influencing the configuration files.
|
||||
You tried to run a command that doesn't allow the `--token` flag (like `vercel switch`). This is not allowed because commands like these are influencing the configuration files.
|
||||
|
||||
In turn, they would have to take the value of the `--token` flag into consideration (which is not a good idea, because flags in Now CLI should never change the configuration).
|
||||
In turn, they would have to take the value of the `--token` flag into consideration (which is not a good idea, because flags in Vercel CLI should never change the configuration).
|
||||
|
||||
#### Possible Ways to Fix It
|
||||
|
||||
Specify a value for the `--scope` flag. This needs to be the slug or ID of the team as which you'd like to act (as an example, if your team URL is `https://vercel.com/teams/zeit`, the value can be `zeit`) or the username or ID of a user you'd like to act as.
|
||||
Specify a value for the `--scope` flag. This needs to be the slug or ID of the team as which you'd like to act (as an example, if your team URL is `https://vercel.com/my-team`, the value can be `my-team`) or the username or ID of a user you'd like to act as.
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
# `now dev` as `dev` script
|
||||
# `vercel dev` as `dev` script
|
||||
|
||||
#### Why This Error Occurred
|
||||
|
||||
The `package.json` file of the used project invokes `now dev` as `dev` script. This would cause `now dev` to recursively invoke itself.
|
||||
The `package.json` file of the used project invokes `vercel dev` as `dev` script. This would cause `vercel dev` to recursively invoke itself.
|
||||
|
||||
#### Possible Ways to Fix It
|
||||
|
||||
|
||||
@@ -20,9 +20,9 @@ Legacy:
|
||||
Serverless:
|
||||
|
||||
- Minimal lambda size of `49Kb` (approximately)
|
||||
- Uses Next.js build targets (`target: 'serverless'`) in `next.config.js`. [documentation](https://github.com/zeit/next.js#summary)
|
||||
- Uses Next.js build targets (`target: 'serverless'`) in `next.config.js`. [documentation](https://github.com/vercel/next.js#summary)
|
||||
- Does not make changes to your application dependencies
|
||||
- Does not load `next.config.js` ([as per the serverless target documentation](https://github.com/zeit/next.js#summary))
|
||||
- Does not load `next.config.js` ([as per the serverless target documentation](https://github.com/vercel/next.js#summary))
|
||||
- Runs `npm install`
|
||||
- Runs `npm run now-build`
|
||||
- Does not run `npm install --production` as the output from the build is all that's needed to bundle lambdas.
|
||||
@@ -69,4 +69,4 @@ module.exports = {
|
||||
|
||||
### Useful Links
|
||||
|
||||
- [Serverless target implementation](https://github.com/zeit/now-builders/pull/150)
|
||||
- [Serverless target implementation](https://github.com/vercel/now-builders/pull/150)
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
# `@now/static-build` Failed to detect a server running
|
||||
# `@vercel/static-build` Failed to detect a server running
|
||||
|
||||
#### Why This Warning Occurred
|
||||
|
||||
When running `now dev`, the `@now/static-build` builder proxies relevant HTTP
|
||||
requests to the server that is created by the `now-dev` script in the
|
||||
When running `vercel dev`, the `@vercel/static-build` builder proxies relevant HTTP
|
||||
requests to the server that is created by the `dev` script in the
|
||||
`package.json` file.
|
||||
|
||||
In order for `now dev` to know which port the server is running on, the builder
|
||||
In order for `vercel dev` to know which port the server is running on, the builder
|
||||
is provided a `$PORT` environment variable that the server _must_ bind to. The
|
||||
error "Failed to detect a server running on port" is printed if the builder fails
|
||||
to detect a server listening on that specific port within five minutes.
|
||||
|
||||
#### Possible Ways to Fix It
|
||||
|
||||
Please ensure that your `now-dev` script binds the spawned development server on
|
||||
Please ensure that your `dev` script binds the spawned development server on
|
||||
the provided `$PORT` that the builder expects the server to bind to.
|
||||
|
||||
For example, if you are using Gatsby, your `now-dev` script must use the `-p`
|
||||
For example, if you are using Gatsby, your `dev` script must use the `-p`
|
||||
(port) option to bind to the `$PORT` specified from the builder:
|
||||
|
||||
> _In Windows environments, reference the `PORT` environment variable with `%PORT%`_
|
||||
@@ -26,7 +26,7 @@ For example, if you are using Gatsby, your `now-dev` script must use the `-p`
|
||||
...
|
||||
"scripts": {
|
||||
...
|
||||
"now-dev": "gatsby develop -p $PORT"
|
||||
"dev": "gatsby develop -p $PORT"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#### Why This Error Occurred
|
||||
|
||||
You either tried to run Now CLI inside a directory that should never be deployed, or you specified a directory that should never be deployed like this: `now <directory>`.
|
||||
You either tried to run Vercel CLI inside a directory that should never be deployed, or you specified a directory that should never be deployed like this: `vercel <directory>`.
|
||||
|
||||
#### Possible Ways to Fix It
|
||||
|
||||
|
||||
@@ -2,14 +2,14 @@
|
||||
|
||||
#### Why This Error Occurred
|
||||
|
||||
When supplying a region or DC identifier in `now scale`,
|
||||
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 `now scale` command make sure you are using a
|
||||
Check your `vercel scale` command make sure you are using a
|
||||
valid string after the URL. Regions
|
||||
and DCs have to be in *lowercase*.
|
||||
and DCs have to be in _lowercase_.
|
||||
|
||||
**Valid region identifiers**:
|
||||
|
||||
@@ -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**:
|
||||
@@ -32,5 +32,5 @@ DC identifiers before being sent to our APIs.
|
||||
To pass multiple ones, use a comma:
|
||||
|
||||
```
|
||||
now scale my-url-123.now.sh sfo,bru,gru 1 5
|
||||
vercel scale my-url-123.now.sh sfo,bru,gru 1 5
|
||||
```
|
||||
|
||||
@@ -1,31 +1,30 @@
|
||||
# `now scale ls` is deprecated
|
||||
# `vercel scale ls` is deprecated
|
||||
|
||||
#### Why This Error Occurred
|
||||
|
||||
We have stopped supporting this command, in favor of
|
||||
better alternatives.
|
||||
|
||||
`now scale ls` used to list all the scaling rules
|
||||
`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 `now scale ls` to list all your deployments
|
||||
and their scaling rules, first use `now ls` to find
|
||||
Instead of using `vercel scale ls` to list all your deployments
|
||||
and their scaling rules, first use `vercel ls` to find
|
||||
your deployment:
|
||||
|
||||
```console
|
||||
now ls
|
||||
vercel ls
|
||||
```
|
||||
|
||||
Then, select the URL of your deployment, which uniquely identifies it, and run:
|
||||
|
||||
```console
|
||||
now inspect my-deployment-12345.now.sh
|
||||
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.
|
||||
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
|
||||
#### Why This Error Occurred
|
||||
|
||||
You tried to use `now scale` on a path alias (`now alias -r rules.json`).
|
||||
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 `now alias ls <id>`.
|
||||
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).
|
||||
|
||||
@@ -6,5 +6,5 @@ You specified the `--scope` flag and specified the ID or slug of a team that you
|
||||
|
||||
#### Possible Ways to Fix It
|
||||
|
||||
- Make sure commands like `now ls` work just fine. This will ensure that your user credentials are valid. If it's not working correctly, please log in again using `now login`.
|
||||
- Ensure that the scope you specified using `--scope` shows up in the output of `now switch`. If it doesn't, you're either not part of the team (if you specified a team) or you logged into the wrong user account.
|
||||
- Make sure commands like `vercel ls` work just fine. This will ensure that your user credentials are valid. If it's not working correctly, please log in again using `vercel login`.
|
||||
- Ensure that the scope you specified using `--scope` shows up in the output of `vercel switch`. If it doesn't, you're either not part of the team (if you specified a team) or you logged into the wrong user account.
|
||||
|
||||
@@ -6,4 +6,4 @@ You tried to add or update a domain's configuration, but you don't have permissi
|
||||
|
||||
#### Possible Ways to Fix It
|
||||
|
||||
If you or your team owns the domain, then you are most likely in the wrong context. Use `now switch` to select the team or user that owns the domain.
|
||||
If you or your team owns the domain, then you are most likely in the wrong context. Use `vercel switch` to select the team or user that owns the domain.
|
||||
|
||||
@@ -12,5 +12,5 @@ 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
|
||||
|
||||
```
|
||||
now scale <deployment> 0 10
|
||||
vercel scale <deployment> 0 10
|
||||
```
|
||||
|
||||
@@ -20,10 +20,10 @@ 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
|
||||
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 `now logs <url>`)
|
||||
will fail as well. Double check your logs (e.g.: by running `vercel logs <url>`)
|
||||
|
||||
46
examples/README.md
vendored
46
examples/README.md
vendored
@@ -14,43 +14,43 @@ Vercel is a cloud platform for static frontends and serverless functions. It ena
|
||||
|
||||
This repository consists of multiple examples, created for use with the [Vercel](https://vercel.com) platform. In addition to this, it also contains:
|
||||
|
||||
- [Code of Conduct](https://github.com/zeit/now/blob/master/.github/CODE_OF_CONDUCT.md) - our Code of Conduct, adapted from the [Contributor Covenant](http://contributor-covenant.org)
|
||||
- [Contributing Guidelines](https://github.com/zeit/now/blob/master/.github/CONTRIBUTING.md) - a guide on how to contribute to the Now Examples repository
|
||||
- [License](https://github.com/zeit/now/blob/master/LICENSE) - the standard MIT license under which these examples are published
|
||||
- [Code of Conduct](https://github.com/vercel/vercel/blob/master/.github/CODE_OF_CONDUCT.md) - our Code of Conduct, adapted from the [Contributor Covenant](http://contributor-covenant.org)
|
||||
- [Contributing Guidelines](https://github.com/vercel/vercel/blob/master/.github/CONTRIBUTING.md) - a guide on how to contribute to the examples repository
|
||||
- [License](https://github.com/vercel/vercel/blob/master/LICENSE) - the standard MIT license under which these examples are published
|
||||
|
||||
We recommend familiarizing yourself with the above sections, particularly if you are looking to make a contribution.
|
||||
|
||||
## Deploying Examples
|
||||
|
||||
To get started using any of these examples as your own project, [install Now](https://vercel.com/download) and use either of the following commands in your terminal:
|
||||
To get started using any of these examples as your own project, [install Vercel](https://vercel.com/download) and use either of the following commands in your terminal:
|
||||
|
||||
```sh
|
||||
now init # Pick an example in the CLI
|
||||
now init <example> # Create a new project from a specific <example>
|
||||
now init <example> <name> # Create a new project from a specific <example> with a different folder <name>
|
||||
vercel init # Pick an example in the CLI
|
||||
vercel init <example> # Create a new project from a specific <example>
|
||||
vercel init <example> <name> # Create a new project from a specific <example> with a different folder <name>
|
||||
```
|
||||
|
||||
Deploying your project takes seconds and can be done with **just a single command**:
|
||||
|
||||
```sh
|
||||
now # Deploys the project with Now
|
||||
vercel # Deploy your project with the CLI
|
||||
```
|
||||
|
||||
With the `now` command, your project will be built and served by Now, providing you with a URL that can be shared immediately.
|
||||
With the `vercel` command, your project will be built and served by Vercel, providing you with a URL that can be shared immediately.
|
||||
|
||||
## New Examples
|
||||
|
||||
We are continuously improving our examples based on best practices and feedback from the community. As a result, it is possible that example names will change and on occasion deprecated in favor of an improved implementation.
|
||||
|
||||
For example, the previous `nodejs` example showed a static frontend with a Node.js API. This is illustrated now in the `svelte` example. Below is a table that lists some of the most popular previous examples and the equivalent replacement:
|
||||
For example, the previous `nodejs` example showed a static frontend with a Node.js API. This is illustrated in the `svelte` example. Below is a table that lists some of the most popular previous examples and the equivalent replacement:
|
||||
|
||||
| Previous Example | New Example |
|
||||
| ----------------- | ------------------------------------------------------------------------------------- |
|
||||
| **monorepo** | [gatsby-functions](https://github.com/zeit/now/tree/master/examples/gatsby) |
|
||||
| **nodejs** | [svelte-functions](https://github.com/zeit/now/tree/master/examples/svelte) |
|
||||
| **nextjs-static** | [nextjs](https://github.com/zeit/now/tree/master/examples/nextjs) |
|
||||
| **vanilla-go** | [create-react-app](https://github.com/zeit/now/tree/master/examples/create-react-app) |
|
||||
| **typescript** | [gatsby-functions](https://github.com/zeit/now/tree/master/examples/gatsby) |
|
||||
| Previous Example | New Example |
|
||||
| ----------------- | ------------------------------------------------------------------------------------------ |
|
||||
| **monorepo** | [gatsby-functions](https://github.com/vercel/vercel/tree/master/examples/gatsby) |
|
||||
| **nodejs** | [svelte-functions](https://github.com/vercel/vercel/tree/master/examples/svelte) |
|
||||
| **nextjs-static** | [nextjs](https://github.com/vercel/vercel/tree/master/examples/nextjs) |
|
||||
| **vanilla-go** | [create-react-app](https://github.com/vercel/vercel/tree/master/examples/create-react-app) |
|
||||
| **typescript** | [gatsby-functions](https://github.com/vercel/vercel/tree/master/examples/gatsby) |
|
||||
|
||||
## Migrating and Upgrading
|
||||
|
||||
@@ -60,15 +60,15 @@ If you would like to upgrade a project to take advantage of zero configuration,
|
||||
|
||||
## How to Contribute
|
||||
|
||||
Contributing to Now Examples should be an enjoyable experience, as such we have created a set of [contributing guidelines](https://github.com/zeit/docs/blob/master/CONTRIBUTING.md) to help you do so.
|
||||
Contributing examples should be an enjoyable experience, as such we have created a set of [contributing guidelines](https://github.com/vercel/vercel/blob/master/.github/CONTRIBUTING.md) to help you do so.
|
||||
|
||||
The guidelines cover important information such as the requirements for new examples and where to get help if you have any questions.
|
||||
|
||||
We have tried to make contributing to Now Examples as easy as possible, especially for those new to Open Source. If anything is unclear or you have any questions then please reach out to us on [GitHub Discussions](https://github.com/zeit/now/discussions) where we will do our best to help you.
|
||||
We have tried to make contributing to examples as easy as possible, especially for those new to Open Source. If anything is unclear or you have any questions then please reach out to us on [GitHub Discussions](https://github.com/vercel/vercel/discussions) where we will do our best to help you.
|
||||
|
||||
## Reporting Issues
|
||||
|
||||
We actively encourage our community to raise issues and provide feedback on areas of Now Examples that could be improved.
|
||||
We actively encourage our community to raise issues and provide feedback on areas of examples that could be improved.
|
||||
|
||||
An issue can be raised by clicking the 'Issues' tab at the top of the repository, followed by the Green 'New issue' button.
|
||||
|
||||
@@ -76,10 +76,10 @@ When submitting an issue, please thoroughly and concisely describe the problem y
|
||||
|
||||
## License
|
||||
|
||||
Now Examples is an open source project released under the [MIT License](https://github.com/zeit/docs/blob/master/LICENSE.md).
|
||||
This repository is an open source project. See the [License](https://github.com/vercel/vercel/blob/master/LICENSE).
|
||||
|
||||
## Get In Touch
|
||||
|
||||
If you have any questions that are not covered by raising an issue then please get in touch with us on [GitHub Discussions](https://github.com/zeit/now/discussions). There you will find both members of the community and staff who are happy to help answer questions on anything Vercel related.
|
||||
If you have any questions that are not covered by raising an issue then please get in touch with us on [GitHub Discussions](https://github.com/vercel/vercel/discussions). There you will find both members of the community and staff who are happy to help answer questions on anything Vercel related.
|
||||
|
||||
[](https://github.com/zeit/now/discussions)
|
||||
[](https://github.com/vercel/vercel/discussions)
|
||||
|
||||
@@ -6,7 +6,7 @@ This directory is a brief example of an [AMP](https://amp.dev/) site that can be
|
||||
|
||||
Deploy your own AMP project with Vercel.
|
||||
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/amp)
|
||||
[](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/amp)
|
||||
|
||||
_Live Example: https://amp.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
# Angular Example
|
||||
|
||||
@@ -8,7 +8,7 @@ This directory is a brief example of an [Angular](https://angular.io/) app that
|
||||
|
||||
Deploy your own Angular project with Vercel.
|
||||
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/angular)
|
||||
[](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/angular)
|
||||
|
||||
_Live Example: https://angular.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ This directory is a brief example of a [Brunch](https://brunch.io/) site that ca
|
||||
|
||||
Deploy your own Brunch project with Vercel.
|
||||
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/brunch)
|
||||
[](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/brunch)
|
||||
|
||||
_Live Example: https://brunch.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
# React Example
|
||||
|
||||
@@ -8,7 +8,7 @@ This directory is a brief example of a [React](https://reactjs.org/) app with [S
|
||||
|
||||
Deploy your own React project, along with Serverless Functions, with Vercel.
|
||||
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/create-react-app-functions)
|
||||
[](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/create-react-app-functions)
|
||||
|
||||
_Live Example: https://create-react-app.now-examples.now.sh/_
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ function App() {
|
||||
</h2>
|
||||
<p>
|
||||
<a
|
||||
href="https://github.com/zeit/now/tree/master/examples/create-react-app"
|
||||
href="https://github.com/vercel/vercel/tree/master/examples/create-react-app"
|
||||
target="_blank"
|
||||
rel="noreferrer noopener"
|
||||
>
|
||||
|
||||
@@ -6,7 +6,7 @@ This directory is a brief example of using a Custom Build script that can be dep
|
||||
|
||||
Deploy your own Custom Built project with Vercel.
|
||||
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/custom-build)
|
||||
[](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/custom-build)
|
||||
|
||||
_Live Example: https://custom-build.now-examples.now.sh_
|
||||
|
||||
@@ -15,7 +15,7 @@ _Live Example: https://custom-build.now-examples.now.sh_
|
||||
To get started deploying a Custom Built project with Vercel, you can use the [Vercel CLI](https://vercel.com/download) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ now init custom-build
|
||||
$ vercel init custom-build
|
||||
```
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
@@ -6,7 +6,7 @@ This directory is a brief example of a [Docusaurus](https://v2.docusaurus.io) si
|
||||
|
||||
Deploy your own Docusaurus project with Vercel.
|
||||
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now-examples/tree/master/docusaurus-2)
|
||||
[](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/docusaurus-2)
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
# Docusaurus Example
|
||||
|
||||
@@ -8,7 +8,7 @@ This directory is a brief example of a [Docusaurus](https://docusaurus.io/) site
|
||||
|
||||
Deploy your own Docusaurus project with Vercel.
|
||||
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/docusaurus)
|
||||
[](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/docusaurus)
|
||||
|
||||
_Live Example: https://docusaurus.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ This directory is a brief example of a [Dojo](https://dojo.io) site that can be
|
||||
|
||||
Deploy your own Dojo project with Vercel.
|
||||
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now-examples/tree/master/dojo)
|
||||
[](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/dojo)
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
# Eleventy Example
|
||||
|
||||
@@ -8,7 +8,7 @@ This directory is a brief example of a [Eleventy](https://www.11ty.io/) site tha
|
||||
|
||||
Deploy your own Eleventy project with Vercel.
|
||||
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/eleventy)
|
||||
[](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/eleventy)
|
||||
|
||||
_Live Example: https://eleventy.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
# Ember Example
|
||||
|
||||
@@ -8,7 +8,7 @@ This directory is a brief example of an [Ember](https://emberjs.com/) app that c
|
||||
|
||||
Deploy your own Ember project with Vercel.
|
||||
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/ember)
|
||||
[](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/ember)
|
||||
|
||||
_Live Example: https://ember.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
# Gatsby Example
|
||||
|
||||
@@ -8,7 +8,7 @@ This directory is a brief example of a [Gatsby](https://www.gatsbyjs.org/) app w
|
||||
|
||||
Deploy your own Gatsby project, along with Serverless Functions, with Vercel.
|
||||
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/gatsby)
|
||||
[](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/gatsby)
|
||||
|
||||
_Live Example: https://gatsby.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ function Index() {
|
||||
</h2>
|
||||
<p>
|
||||
<a
|
||||
href="https://github.com/zeit/now-examples/blob/master/gatsby-functions"
|
||||
href="https://github.com/vercel/vercel/blob/master/gatsby"
|
||||
target="_blank"
|
||||
rel="noreferrer noopener"
|
||||
>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
# Gridsome Example
|
||||
|
||||
@@ -8,7 +8,7 @@ This directory is a brief example of a [Gridsome](https://gridsome.org/) app tha
|
||||
|
||||
Deploy your own Gridsome project with Vercel.
|
||||
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/gridsome)
|
||||
[](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/gridsome)
|
||||
|
||||
_Live Example: https://gridsome.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
# Hexo Example
|
||||
|
||||
@@ -8,7 +8,7 @@ This directory is a brief example of a [Hexo](https://hexo.io/) site that can be
|
||||
|
||||
Deploy your own Hexo project with Vercel.
|
||||
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/hexo)
|
||||
[](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/hexo)
|
||||
|
||||
_Live Example: https://hexo.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ This directory is a brief example of a [Hugo](https://gohugo.io/) app that can b
|
||||
|
||||
Deploy your own Hugo project with Vercel.
|
||||
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/hugo)
|
||||
[](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/hugo)
|
||||
|
||||
_Live Example: https://hugo.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ This directory is a brief example of an [Ionic Angular](https://ionicframework.c
|
||||
|
||||
Deploy your own Ionic Angular project with Vercel.
|
||||
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/ionic-angular)
|
||||
[](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/ionic-angular)
|
||||
|
||||
_Live Example: https://ionic-angular.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ This directory is a brief example of an [Ionic React](https://ionicframework.com
|
||||
|
||||
Deploy your own Ionic React project with Vercel.
|
||||
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/ionic-react)
|
||||
[](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/ionic-react)
|
||||
|
||||
_Live Example: https://ionic-react.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ This directory is a brief example of a [Jekyll](https://jekyllrb.com/) site that
|
||||
|
||||
Deploy your own Jekyll project with Vercel.
|
||||
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/jekyll)
|
||||
[](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/jekyll)
|
||||
|
||||
_Live Example: https://jekyll.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ This directory is a brief example of a [Middleman](https://middlemanapp.com/) si
|
||||
|
||||
Deploy your own Middleman project with Vercel.
|
||||
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/middleman)
|
||||
[](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/middleman)
|
||||
|
||||
_Live Example: https://middleman.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ This directory is a brief example of a [Nuxt.js](https://nuxtjs.org) app that ca
|
||||
|
||||
Deploy your own Nuxt.js project with Vercel.
|
||||
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/nuxtjs)
|
||||
[](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/nuxtjs)
|
||||
|
||||
_Live Example: https://nuxtjs.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
# Polymer Example
|
||||
|
||||
@@ -8,7 +8,7 @@ This directory is a brief example of a [Polymer](https://www.polymer-project.org
|
||||
|
||||
Deploy your own Polymer project with Vercel.
|
||||
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/polymer)
|
||||
[](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/polymer)
|
||||
|
||||
_Live Example: https://polymer.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
# Preact Example
|
||||
|
||||
@@ -8,7 +8,7 @@ This directory is a brief example of a [Preact](https://preactjs.com/) app that
|
||||
|
||||
Deploy your own Preact project with Vercel.
|
||||
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/preact)
|
||||
[](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/preact)
|
||||
|
||||
_Live Example: https://preact.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
# Saber Example
|
||||
|
||||
@@ -8,7 +8,7 @@ This directory is a brief example of a [Saber](https://saber.land) site that can
|
||||
|
||||
Deploy your own Saber project with Vercel.
|
||||
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/saber)
|
||||
[](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/saber)
|
||||
|
||||
_Live Example: https://saber.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ This directory is a brief example of a [Sapper](https://sapper.svelte.dev/) app
|
||||
|
||||
Deploy your own Sapper project with Vercel.
|
||||
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/sapper)
|
||||
[](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/sapper)
|
||||
|
||||
_Live Example: https://sapper.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
# Scully Example
|
||||
|
||||
@@ -8,7 +8,7 @@ This directory is a brief example of a [Scully](https://scully.io) site that can
|
||||
|
||||
Deploy your own Scully project with Vercel.
|
||||
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/scully)
|
||||
[](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/scully)
|
||||
|
||||
_Live Example: https://scully.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ This directory is a brief example of a [Stencil](https://stenciljs.com/) app tha
|
||||
|
||||
Deploy your own Stencil project with Vercel.
|
||||
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/stencil)
|
||||
[](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/stencil)
|
||||
|
||||
_Live Example: https://stencil.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ This directory is a brief example of a [Svelte](https://svelte.dev/) app with [S
|
||||
|
||||
Deploy your own Svelte project, along with Serverless Functions, with Vercel.
|
||||
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/svelte)
|
||||
[](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/svelte)
|
||||
|
||||
_Live Example: https://svelte.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
</h2>
|
||||
<p>
|
||||
<a
|
||||
href="https://github.com/zeit/now/tree/master/examples/svelte"
|
||||
href="https://github.com/vercel/vercel/tree/master/examples/svelte"
|
||||
target="_blank"
|
||||
rel="noreferrer noopener">
|
||||
This project
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
# UmiJS Example
|
||||
|
||||
@@ -8,7 +8,7 @@ This directory is a brief example of a [UmiJS](https://umijs.org/) app that can
|
||||
|
||||
Deploy your own UmiJS project with Vercel.
|
||||
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/umijs)
|
||||
[](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/umijs)
|
||||
|
||||
_Live Example: https://umijs.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||

|
||||

|
||||
|
||||
# Vue.js Example
|
||||
|
||||
@@ -8,7 +8,7 @@ This directory is a brief example of a [Vue.js](https://vuejs.org/) app that can
|
||||
|
||||
Deploy your own Vue.js project with Vercel.
|
||||
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/vue)
|
||||
[](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/vue)
|
||||
|
||||
_Live Example: https://vue.now-examples.now.sh_
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
"name": "Next.js",
|
||||
"slug": "nextjs",
|
||||
"demo": "https://nextjs.now-examples.now.sh",
|
||||
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/next.svg",
|
||||
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/next.svg",
|
||||
"tagline": "Next.js makes you productive with React instantly — whether you want to build static or dynamic sites. ",
|
||||
"description": "A Next.js app and a Serverless Function API.",
|
||||
"website": "https://nextjs.org",
|
||||
@@ -31,7 +31,7 @@
|
||||
"name": "Gatsby",
|
||||
"slug": "gatsby",
|
||||
"demo": "https://gatsby.now-examples.now.sh",
|
||||
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/gatsby.svg",
|
||||
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/gatsby.svg",
|
||||
"tagline": "Gatsby helps developers build blazing fast websites and apps with React.",
|
||||
"description": "A Gatsby app, using the default starter theme and a Serverless Function API.",
|
||||
"website": "https://gatsbyjs.org",
|
||||
@@ -59,7 +59,7 @@
|
||||
"name": "Hexo",
|
||||
"slug": "hexo",
|
||||
"demo": "https://hexo.now-examples.now.sh",
|
||||
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/hexo.svg",
|
||||
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/hexo.svg",
|
||||
"tagline": "Hexo is a fast, simple & powerful blog framework powered by Node.js.",
|
||||
"description": "A Hexo site, created with the Hexo CLI.",
|
||||
"website": "https://hexo.io/",
|
||||
@@ -87,7 +87,7 @@
|
||||
"name": "Eleventy",
|
||||
"slug": "eleventy",
|
||||
"demo": "https://eleventy.now-examples.now.sh",
|
||||
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/eleventy.svg",
|
||||
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/eleventy.svg",
|
||||
"tagline": "11ty is a simpler static site generator written in JavaScript, created to be an alternative to Jekyll.",
|
||||
"description": "An Eleventy site, created with npm init.",
|
||||
"website": "https://www.11ty.dev/",
|
||||
@@ -115,7 +115,7 @@
|
||||
"name": "Docusaurus 2",
|
||||
"slug": "docusaurus-2",
|
||||
"demo": "https://docusaurus-2.now-examples.now.sh",
|
||||
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/docusaurus.svg",
|
||||
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/docusaurus.svg",
|
||||
"tagline": "Docusaurus makes it easy to maintain Open Source documentation websites.",
|
||||
"description": "A static Docusaurus site that makes it easy to maintain OSS documentation.",
|
||||
"website": "https://v2.docusaurus.io",
|
||||
@@ -143,7 +143,7 @@
|
||||
"name": "Docusaurus 1",
|
||||
"slug": "docusaurus",
|
||||
"demo": "https://docusaurus.now-examples.now.sh",
|
||||
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/docusaurus.svg",
|
||||
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/docusaurus.svg",
|
||||
"tagline": "Docusaurus makes it easy to maintain Open Source documentation websites.",
|
||||
"description": "A static Docusaurus site that makes it easy to maintain OSS documentation.",
|
||||
"website": "https://docusaurus.io/",
|
||||
@@ -171,7 +171,7 @@
|
||||
"name": "Preact",
|
||||
"slug": "preact",
|
||||
"demo": "https://preact.now-examples.now.sh",
|
||||
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/preact.svg",
|
||||
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/preact.svg",
|
||||
"tagline": "Preact is a fast 3kB alternative to React with the same modern API.",
|
||||
"description": "A Preact app, created with the Preact CLI.",
|
||||
"website": "https://preactjs.com",
|
||||
@@ -199,7 +199,7 @@
|
||||
"name": "Dojo",
|
||||
"slug": "dojo",
|
||||
"demo": "https://dojo.now-examples.now.sh",
|
||||
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/dojo.png",
|
||||
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/dojo.png",
|
||||
"tagline": "Dojo is a modern progressive, TypeScript first framework.",
|
||||
"description": "A Dojo app, created with the Dojo CLI's cli-create-app command.",
|
||||
"website": "https://dojo.io",
|
||||
@@ -230,7 +230,7 @@
|
||||
"name": "Ember",
|
||||
"slug": "ember",
|
||||
"demo": "https://ember.now-examples.now.sh",
|
||||
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/ember.svg",
|
||||
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/ember.svg",
|
||||
"tagline": "Ember.js helps webapp developers be more productive out of the box.",
|
||||
"description": "An Ember app, created with the Ember CLI.",
|
||||
"website": "https://emberjs.com/",
|
||||
@@ -258,7 +258,7 @@
|
||||
"name": "Vue.js",
|
||||
"slug": "vue",
|
||||
"demo": "https://vue.now-examples.now.sh",
|
||||
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/vue.svg",
|
||||
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/vue.svg",
|
||||
"tagline": "Vue.js is a versatile JavaScript framework that is as approachable as it is performant.",
|
||||
"description": "A Vue.js app, created with the Vue CLI.",
|
||||
"website": "https://vuejs.org",
|
||||
@@ -286,7 +286,7 @@
|
||||
"name": "Scully",
|
||||
"slug": "scully",
|
||||
"demo": "https://scully.now-examples.now.sh",
|
||||
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/scullyio-logo.png",
|
||||
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/scullyio-logo.png",
|
||||
"tagline": "Scully is a static site generator for Angular.",
|
||||
"description": "The Static Site Generator for Angular apps.",
|
||||
"website": "https://github.com/scullyio/scully",
|
||||
@@ -314,7 +314,7 @@
|
||||
"name": "Ionic Angular",
|
||||
"slug": "ionic-angular",
|
||||
"demo": "https://ionic-angular.now-examples.now.sh",
|
||||
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/ionic.svg",
|
||||
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/ionic.svg",
|
||||
"tagline": "Ionic Angular allows you to build mobile PWAs with Angular and the Ionic Framework.",
|
||||
"description": "An Ionic Angular site, created with the Ionic CLI.",
|
||||
"website": "https://ionicframework.com",
|
||||
@@ -342,7 +342,7 @@
|
||||
"name": "Angular",
|
||||
"slug": "angular",
|
||||
"demo": "https://angular.now-examples.now.sh",
|
||||
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/angular.svg",
|
||||
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/angular.svg",
|
||||
"tagline": "Angular is a TypeScript-based cross-platform framework from Google.",
|
||||
"description": "An Angular app, created with the Angular CLI.",
|
||||
"website": "https://angular.io",
|
||||
@@ -370,7 +370,7 @@
|
||||
"name": "Polymer",
|
||||
"slug": "polymer",
|
||||
"demo": "https://polymer.now-examples.now.sh",
|
||||
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/polymer.svg",
|
||||
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/polymer.svg",
|
||||
"tagline": "Polymer is an open-source webapps library from Google, for building using Web Components.",
|
||||
"description": "A Polymer app, created with the Polymer CLI.",
|
||||
"website": "https://www.polymer-project.org/",
|
||||
@@ -398,7 +398,7 @@
|
||||
"name": "Svelte",
|
||||
"slug": "svelte",
|
||||
"demo": "https://svelte.now-examples.now.sh",
|
||||
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/svelte.svg",
|
||||
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/svelte.svg",
|
||||
"tagline": "Svelte lets you write high performance reactive apps with significantly less boilerplate. ",
|
||||
"description": "A Svelte app, using the Svelte template, and a Serverless Function API.",
|
||||
"website": "https://svelte.dev",
|
||||
@@ -426,7 +426,7 @@
|
||||
"name": "Ionic React",
|
||||
"slug": "ionic-react",
|
||||
"demo": "https://ionic-react.now-examples.now.sh",
|
||||
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/ionic.svg",
|
||||
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/ionic.svg",
|
||||
"tagline": "Ionic React allows you to build mobile PWAs with React and the Ionic Framework.",
|
||||
"description": "An Ionic React site, created with the Ionic CLI.",
|
||||
"website": "https://ionicframework.com",
|
||||
@@ -454,7 +454,7 @@
|
||||
"name": "Create React App",
|
||||
"slug": "create-react-app",
|
||||
"demo": "https://react-functions.now-examples.now.sh",
|
||||
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/react.svg",
|
||||
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/react.svg",
|
||||
"tagline": "Create React App allows you to get going with React in no time.",
|
||||
"description": "A React app, bootstrapped with create-react-app, and a Serverless Function API.",
|
||||
"website": "https://create-react-app.dev",
|
||||
@@ -486,7 +486,7 @@
|
||||
"name": "Gridsome",
|
||||
"slug": "gridsome",
|
||||
"demo": "https://gridsome.now-examples.now.sh",
|
||||
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/gridsome.svg",
|
||||
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/gridsome.svg",
|
||||
"tagline": "Gridsome is a Vue.js-powered framework for building websites & apps that are fast by default.",
|
||||
"description": "A Gridsome app, created with the Gridsome CLI.",
|
||||
"website": "https://gridsome.org/",
|
||||
@@ -514,7 +514,7 @@
|
||||
"name": "UmiJS",
|
||||
"slug": "umijs",
|
||||
"demo": "https://umijs.now-examples.now.sh",
|
||||
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/umi.svg",
|
||||
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/umi.svg",
|
||||
"tagline": "UmiJS is an extensible enterprise-level React application framework.",
|
||||
"description": "An UmiJS app, created using the Umi CLI.",
|
||||
"website": "https://umijs.org",
|
||||
@@ -542,7 +542,7 @@
|
||||
"name": "Sapper",
|
||||
"slug": "sapper",
|
||||
"demo": "https://sapper.now-examples.now.sh",
|
||||
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/svelte.svg",
|
||||
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/svelte.svg",
|
||||
"tagline": "Sapper is a framework for building high-performance universal web apps with Svelte.",
|
||||
"description": "A Sapper app, using the Sapper template.",
|
||||
"website": "https://sapper.svelte.dev",
|
||||
@@ -570,7 +570,7 @@
|
||||
"name": "Saber",
|
||||
"slug": "saber",
|
||||
"demo": "https://saber.now-examples.now.sh",
|
||||
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/saber.svg",
|
||||
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/saber.svg",
|
||||
"tagline": "Saber is a framework for building static sites in Vue.js that supports data from any source.",
|
||||
"description": "A Saber site, created with npm init.",
|
||||
"website": "https://saber.land/",
|
||||
@@ -598,7 +598,7 @@
|
||||
"name": "Stencil",
|
||||
"slug": "stencil",
|
||||
"demo": "https://stencil.now-examples.now.sh",
|
||||
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/stencil.svg",
|
||||
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/stencil.svg",
|
||||
"tagline": "Stencil is a powerful toolchain for building Progressive Web Apps and Design Systems.",
|
||||
"description": "A Stencil site, created with the Stencil CLI.",
|
||||
"website": "https://stenciljs.com/",
|
||||
@@ -626,7 +626,7 @@
|
||||
"name": "Nuxt.js",
|
||||
"slug": "nuxtjs",
|
||||
"demo": "https://nuxtjs.now-examples.now.sh",
|
||||
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/nuxt.svg",
|
||||
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/nuxt.svg",
|
||||
"tagline": "Nuxt.js is the web comprehensive framework that lets you dream big with Vue.js.",
|
||||
"description": "A Nuxt.js app, bootstrapped with create-nuxt-app.",
|
||||
"website": "https://nuxtjs.org",
|
||||
@@ -654,7 +654,7 @@
|
||||
"name": "Hugo",
|
||||
"slug": "hugo",
|
||||
"demo": "https://hugo.now-examples.now.sh",
|
||||
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/hugo.svg",
|
||||
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/hugo.svg",
|
||||
"tagline": "Hugo is the world’s fastest framework for building websites, written in Go.",
|
||||
"description": "A Hugo site, created with the Hugo CLI.",
|
||||
"website": "https://gohugo.io",
|
||||
@@ -687,7 +687,7 @@
|
||||
"name": "Jekyll",
|
||||
"slug": "jekyll",
|
||||
"demo": "https://jekyll.now-examples.now.sh",
|
||||
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/jekyll.svg",
|
||||
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/jekyll.svg",
|
||||
"tagline": "Jekyll makes it super easy to transform your plain text into static websites and blogs.",
|
||||
"description": "A Jekyll site, created with the Jekyll CLI.",
|
||||
"website": "https://jekyllrb.com/",
|
||||
@@ -714,7 +714,7 @@
|
||||
"name": "Brunch",
|
||||
"slug": "brunch",
|
||||
"demo": "https://brunch.now-examples.now.sh",
|
||||
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/brunch.svg",
|
||||
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/brunch.svg",
|
||||
"tagline": "Brunch is a fast and simple webapp build tool with seamless incremental compilation for rapid development.",
|
||||
"description": "A Brunch app, created with the Brunch CLI.",
|
||||
"website": "https://brunch.io/",
|
||||
@@ -741,7 +741,7 @@
|
||||
"name": "Middleman",
|
||||
"slug": "middleman",
|
||||
"demo": "https://middleman.now-examples.now.sh",
|
||||
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/middleman.svg",
|
||||
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/middleman.svg",
|
||||
"tagline": "Middleman is a static site generator that uses all the shortcuts and tools in modern web development.",
|
||||
"description": "A Middleman app, created with the Middleman CLI.",
|
||||
"website": "https://middlemanapp.com/",
|
||||
@@ -767,7 +767,7 @@
|
||||
{
|
||||
"name": "Other",
|
||||
"slug": null,
|
||||
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/other.svg",
|
||||
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/other.svg",
|
||||
"description": "No framework or a unoptimized framework.",
|
||||
"settings": {
|
||||
"buildCommand": {
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
{
|
||||
"name": "@vercel/frameworks",
|
||||
"version": "0.0.15-canary.0",
|
||||
"version": "0.0.15",
|
||||
"main": "frameworks.json",
|
||||
"license": "UNLICENSED",
|
||||
"scripts": {
|
||||
"test-unit": "jest --env node --verbose --runInBand --bail test/*unit.*test.*"
|
||||
"test-unit": "jest --env node --verbose --runInBand --bail"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/jest": "24.0.22",
|
||||
"@types/node": "12.0.4",
|
||||
"ajv": "6.10.2",
|
||||
"ajv": "6.12.2",
|
||||
"jest": "24.9.0",
|
||||
"ts-jest": "24.1.0",
|
||||
"typescript": "3.5.2"
|
||||
"typescript": "3.9.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ describe('frameworks', () => {
|
||||
.map(f => f.logo)
|
||||
.filter(url => {
|
||||
const prefix =
|
||||
'https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/';
|
||||
'https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/';
|
||||
const name = url.replace(prefix, '');
|
||||
return existsSync(path.join(__dirname, '..', 'logos', name)) === false;
|
||||
});
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "@vercel/build-utils",
|
||||
"version": "2.3.2-canary.1",
|
||||
"version": "2.4.0",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.js",
|
||||
"homepage": "https://github.com/zeit/now/blob/master/DEVELOPING_A_RUNTIME.md",
|
||||
"homepage": "https://github.com/vercel/vercel/blob/master/DEVELOPING_A_RUNTIME.md",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/zeit/now.git",
|
||||
"url": "https://github.com/vercel/vercel.git",
|
||||
"directory": "packages/now-build-utils"
|
||||
},
|
||||
"scripts": {
|
||||
@@ -45,7 +45,7 @@
|
||||
"node-fetch": "2.2.0",
|
||||
"semver": "6.1.1",
|
||||
"ts-jest": "24.1.0",
|
||||
"typescript": "3.5.2",
|
||||
"typescript": "3.9.3",
|
||||
"yazl": "2.4.3"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -82,6 +82,7 @@ export async function detectBuilders(
|
||||
defaultRoutes: Route[] | null;
|
||||
redirectRoutes: Route[] | null;
|
||||
rewriteRoutes: Route[] | null;
|
||||
errorRoutes: Route[] | null;
|
||||
}> {
|
||||
const errors: ErrorResponse[] = [];
|
||||
const warnings: ErrorResponse[] = [];
|
||||
@@ -99,6 +100,7 @@ export async function detectBuilders(
|
||||
defaultRoutes: null,
|
||||
redirectRoutes: null,
|
||||
rewriteRoutes: null,
|
||||
errorRoutes: null,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -154,6 +156,7 @@ export async function detectBuilders(
|
||||
defaultRoutes: null,
|
||||
redirectRoutes: null,
|
||||
rewriteRoutes: null,
|
||||
errorRoutes: null,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -231,6 +234,7 @@ export async function detectBuilders(
|
||||
redirectRoutes: null,
|
||||
defaultRoutes: null,
|
||||
rewriteRoutes: null,
|
||||
errorRoutes: null,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -272,6 +276,7 @@ export async function detectBuilders(
|
||||
redirectRoutes: null,
|
||||
defaultRoutes: null,
|
||||
rewriteRoutes: null,
|
||||
errorRoutes: null,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -309,6 +314,7 @@ export async function detectBuilders(
|
||||
redirectRoutes: routesResult.redirectRoutes,
|
||||
defaultRoutes: routesResult.defaultRoutes,
|
||||
rewriteRoutes: routesResult.rewriteRoutes,
|
||||
errorRoutes: routesResult.errorRoutes,
|
||||
};
|
||||
}
|
||||
|
||||
@@ -898,10 +904,17 @@ function getRouteResult(
|
||||
defaultRoutes: Route[];
|
||||
redirectRoutes: Route[];
|
||||
rewriteRoutes: Route[];
|
||||
errorRoutes: Route[];
|
||||
} {
|
||||
const defaultRoutes: Route[] = [];
|
||||
const redirectRoutes: Route[] = [];
|
||||
const rewriteRoutes: Route[] = [];
|
||||
const errorRoutes: Route[] = [];
|
||||
const isNextjs =
|
||||
frontendBuilder &&
|
||||
((frontendBuilder.use && frontendBuilder.use.startsWith('@vercel/next')) ||
|
||||
(frontendBuilder.config &&
|
||||
frontendBuilder.config.framework === 'nextjs'));
|
||||
|
||||
if (apiRoutes && apiRoutes.length > 0) {
|
||||
if (options.featHandleMiss) {
|
||||
@@ -968,10 +981,21 @@ function getRouteResult(
|
||||
});
|
||||
}
|
||||
|
||||
if (options.featHandleMiss && !isNextjs) {
|
||||
// Exclude Next.js to avoid overriding custom error page
|
||||
// https://nextjs.org/docs/advanced-features/custom-error-page
|
||||
errorRoutes.push({
|
||||
status: 404,
|
||||
src: '^/(?!.*api).*$',
|
||||
dest: options.cleanUrls ? '/404' : '/404.html',
|
||||
});
|
||||
}
|
||||
|
||||
return {
|
||||
defaultRoutes,
|
||||
redirectRoutes,
|
||||
rewriteRoutes,
|
||||
errorRoutes,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -7,11 +7,13 @@ export class NowBuildError extends Error {
|
||||
public hideStackTrace = true;
|
||||
public code: string;
|
||||
public link?: string;
|
||||
public action?: string;
|
||||
|
||||
constructor({ message, code, link }: Props) {
|
||||
constructor({ message, code, link, action }: Props) {
|
||||
super(message);
|
||||
this.code = code;
|
||||
this.link = link;
|
||||
this.action = action;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,4 +33,8 @@ interface Props {
|
||||
* link to more information about this error.
|
||||
*/
|
||||
link?: string;
|
||||
/**
|
||||
* Optional "action" to display before the `link`, such as "More details".
|
||||
*/
|
||||
action?: string;
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ export default async function download(
|
||||
} = meta || {};
|
||||
|
||||
if (isDev || skipDownload) {
|
||||
// In `now dev`, the `download()` function is a no-op because
|
||||
// In `vercel dev`, the `download()` function is a no-op because
|
||||
// the `basePath` matches the `cwd` of the dev server, so the
|
||||
// source files are already available.
|
||||
return files as DownloadedFiles;
|
||||
|
||||
@@ -169,7 +169,7 @@ export async function getNodeVersion(
|
||||
meta?: Meta
|
||||
): Promise<NodeVersion> {
|
||||
if (meta && meta.isDev) {
|
||||
// Use the system-installed version of `node` in PATH for `now dev`
|
||||
// Use the system-installed version of `node` in PATH for `vercel dev`
|
||||
const latest = getLatestNodeVersion();
|
||||
return { ...latest, runtime: 'nodejs' };
|
||||
}
|
||||
@@ -291,7 +291,7 @@ export async function runNpmInstall(
|
||||
} else {
|
||||
opts.prettyCommand = 'yarn install';
|
||||
command = 'yarn';
|
||||
commandArgs = args.concat(['install', '--ignore-engines']);
|
||||
commandArgs = ['install', ...args];
|
||||
}
|
||||
|
||||
if (process.env.NPM_ONLY_PRODUCTION) {
|
||||
@@ -375,7 +375,7 @@ export async function runPackageJsonScript(
|
||||
} else {
|
||||
const prettyCommand = `yarn run ${scriptName}`;
|
||||
console.log(`Running "${prettyCommand}"`);
|
||||
await spawnAsync('yarn', ['--ignore-engines', 'run', scriptName], {
|
||||
await spawnAsync('yarn', ['run', scriptName], {
|
||||
...spawnOpts,
|
||||
cwd: destPath,
|
||||
prettyCommand,
|
||||
|
||||
@@ -27,6 +27,7 @@ import {
|
||||
getLatestNodeVersion,
|
||||
getDiscontinuedNodeVersions,
|
||||
} from './fs/node-version';
|
||||
import { NowBuildError } from './errors';
|
||||
import streamToBuffer from './fs/stream-to-buffer';
|
||||
import shouldServe from './should-serve';
|
||||
import debug from './debug';
|
||||
@@ -111,9 +112,11 @@ export const getPlatformEnv = (name: string): string | undefined => {
|
||||
const n = process.env[nName];
|
||||
if (typeof v === 'string') {
|
||||
if (typeof n === 'string') {
|
||||
throw new Error(
|
||||
`Both "${vName}" and "${nName}" env vars are defined. Please only define the "${vName}" env var`
|
||||
);
|
||||
throw new NowBuildError({
|
||||
code: 'CONFLICTING_ENV_VAR_NAMES',
|
||||
message: `Both "${vName}" and "${nName}" env vars are defined. Please only define the "${vName}" env var.`,
|
||||
link: 'https://vercel.link/combining-old-and-new-config',
|
||||
});
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ export interface BuildOptions {
|
||||
config: Config;
|
||||
|
||||
/**
|
||||
* Metadata related to the invoker of the builder, used by `now dev`.
|
||||
* Metadata related to the invoker of the builder, used by `vercel dev`.
|
||||
* Builders may use the properties on this object to change behavior based
|
||||
* on the build environment.
|
||||
*/
|
||||
@@ -201,7 +201,7 @@ export interface StartDevServerSuccess {
|
||||
port: number;
|
||||
|
||||
/**
|
||||
* Process ID number of the dev server. Useful for the `now dev` server to
|
||||
* Process ID number of the dev server. Useful for the `vercel dev` server to
|
||||
* shut down the dev server once an HTTP request has been fulfilled.
|
||||
*/
|
||||
pid: number;
|
||||
|
||||
11
packages/now-build-utils/test/fixtures/19-yarn-v2/.gitignore
vendored
Normal file
11
packages/now-build-utils/test/fixtures/19-yarn-v2/.gitignore
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
/node_modules/
|
||||
/public/build/
|
||||
|
||||
.DS_Store
|
||||
|
||||
# yarn v2
|
||||
.yarn/cache
|
||||
.yarn/unplugged
|
||||
.yarn/build-state.yml
|
||||
.yarn/install-state.gz
|
||||
.pnp.*
|
||||
56
packages/now-build-utils/test/fixtures/19-yarn-v2/.yarn/releases/yarn-berry.js
vendored
Normal file
56
packages/now-build-utils/test/fixtures/19-yarn-v2/.yarn/releases/yarn-berry.js
vendored
Normal file
File diff suppressed because one or more lines are too long
1
packages/now-build-utils/test/fixtures/19-yarn-v2/.yarnrc.yml
vendored
Normal file
1
packages/now-build-utils/test/fixtures/19-yarn-v2/.yarnrc.yml
vendored
Normal file
@@ -0,0 +1 @@
|
||||
yarnPath: ".yarn/releases/yarn-berry.js"
|
||||
55
packages/now-build-utils/test/fixtures/19-yarn-v2/README.md
vendored
Normal file
55
packages/now-build-utils/test/fixtures/19-yarn-v2/README.md
vendored
Normal file
@@ -0,0 +1,55 @@
|
||||
_Looking for a shareable component template? Go here --> [sveltejs/component-template](https://github.com/sveltejs/component-template)_
|
||||
|
||||
---
|
||||
|
||||
# svelte app
|
||||
|
||||
This is a project template for [Svelte](https://svelte.dev) apps. It lives at https://github.com/sveltejs/template.
|
||||
|
||||
To create a new project based on this template using [degit](https://github.com/Rich-Harris/degit):
|
||||
|
||||
```bash
|
||||
npx degit sveltejs/template svelte-app
|
||||
cd svelte-app
|
||||
```
|
||||
|
||||
_Note that you will need to have [Node.js](https://nodejs.org) installed._
|
||||
|
||||
## Get started
|
||||
|
||||
Install the dependencies...
|
||||
|
||||
```bash
|
||||
cd svelte-app
|
||||
npm install
|
||||
```
|
||||
|
||||
...then start [Rollup](https://rollupjs.org):
|
||||
|
||||
```bash
|
||||
npm run dev
|
||||
```
|
||||
|
||||
Navigate to [localhost:5000](http://localhost:5000). You should see your app running. Edit a component file in `src`, save it, and reload the page to see your changes.
|
||||
|
||||
By default, the server will only respond to requests from localhost. To allow connections from other computers, edit the `sirv` commands in package.json to include the option `--host 0.0.0.0`.
|
||||
|
||||
## Building and running in production mode
|
||||
|
||||
To create an optimised version of the app:
|
||||
|
||||
```bash
|
||||
npm run build
|
||||
```
|
||||
|
||||
You can run the newly built app with `npm run start`. This uses [sirv](https://github.com/lukeed/sirv), which is included in your package.json's `dependencies` so that the app will work when you deploy to platforms like [Heroku](https://heroku.com).
|
||||
|
||||
## Single-page app mode
|
||||
|
||||
By default, sirv will only respond to requests that match files in `public`. This is to maximise compatibility with static fileservers, allowing you to deploy your app anywhere.
|
||||
|
||||
If you're building a single-page app (SPA) with multiple routes, sirv needs to be able to respond to requests for _any_ path. You can make it so by editing the `"start"` command in package.json:
|
||||
|
||||
```js
|
||||
"start": "sirv public --single"
|
||||
```
|
||||
5
packages/now-build-utils/test/fixtures/19-yarn-v2/now.json
vendored
Normal file
5
packages/now-build-utils/test/fixtures/19-yarn-v2/now.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"version": 2,
|
||||
"builds": [{ "src": "package.json", "use": "@vercel/static-build" }],
|
||||
"probes": [{ "path": "/", "mustContain": "Svelte app" }]
|
||||
}
|
||||
21
packages/now-build-utils/test/fixtures/19-yarn-v2/package.json
vendored
Normal file
21
packages/now-build-utils/test/fixtures/19-yarn-v2/package.json
vendored
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"name": "svelte-app",
|
||||
"version": "1.0.0",
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"dev": "rollup -c -w",
|
||||
"start": "sirv public"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-commonjs": "^12.0.0",
|
||||
"@rollup/plugin-node-resolve": "^8.0.0",
|
||||
"rollup": "^2.3.4",
|
||||
"rollup-plugin-livereload": "^1.0.0",
|
||||
"rollup-plugin-svelte": "^5.0.3",
|
||||
"rollup-plugin-terser": "^5.1.2",
|
||||
"svelte": "^3.0.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"sirv-cli": "^0.4.4"
|
||||
}
|
||||
}
|
||||
BIN
packages/now-build-utils/test/fixtures/19-yarn-v2/public/favicon.png
vendored
Normal file
BIN
packages/now-build-utils/test/fixtures/19-yarn-v2/public/favicon.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
66
packages/now-build-utils/test/fixtures/19-yarn-v2/public/global.css
vendored
Normal file
66
packages/now-build-utils/test/fixtures/19-yarn-v2/public/global.css
vendored
Normal file
@@ -0,0 +1,66 @@
|
||||
html, body {
|
||||
position: relative;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
color: #333;
|
||||
margin: 0;
|
||||
padding: 8px;
|
||||
box-sizing: border-box;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
|
||||
}
|
||||
|
||||
a {
|
||||
color: rgb(0,100,200);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
a:visited {
|
||||
color: rgb(0,80,160);
|
||||
}
|
||||
|
||||
label {
|
||||
display: block;
|
||||
}
|
||||
|
||||
input, button, select, textarea {
|
||||
font-family: inherit;
|
||||
font-size: inherit;
|
||||
padding: 0.4em;
|
||||
margin: 0 0 0.5em 0;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 2px;
|
||||
}
|
||||
|
||||
input:disabled {
|
||||
color: #ccc;
|
||||
}
|
||||
|
||||
input[type="range"] {
|
||||
height: 0;
|
||||
}
|
||||
|
||||
button {
|
||||
color: #333;
|
||||
background-color: #f4f4f4;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
button:disabled {
|
||||
color: #999;
|
||||
}
|
||||
|
||||
button:not(:disabled):active {
|
||||
background-color: #ddd;
|
||||
}
|
||||
|
||||
button:focus {
|
||||
border-color: #666;
|
||||
}
|
||||
18
packages/now-build-utils/test/fixtures/19-yarn-v2/public/index.html
vendored
Normal file
18
packages/now-build-utils/test/fixtures/19-yarn-v2/public/index.html
vendored
Normal file
@@ -0,0 +1,18 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset='utf-8'>
|
||||
<meta name='viewport' content='width=device-width,initial-scale=1'>
|
||||
|
||||
<title>Svelte app</title>
|
||||
|
||||
<link rel='icon' type='image/png' href='/favicon.png'>
|
||||
<link rel='stylesheet' href='/global.css'>
|
||||
<link rel='stylesheet' href='/build/bundle.css'>
|
||||
|
||||
<script defer src='/build/bundle.js'></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
||||
71
packages/now-build-utils/test/fixtures/19-yarn-v2/rollup.config.js
vendored
Normal file
71
packages/now-build-utils/test/fixtures/19-yarn-v2/rollup.config.js
vendored
Normal file
@@ -0,0 +1,71 @@
|
||||
import svelte from 'rollup-plugin-svelte';
|
||||
import resolve from '@rollup/plugin-node-resolve';
|
||||
import commonjs from '@rollup/plugin-commonjs';
|
||||
import livereload from 'rollup-plugin-livereload';
|
||||
import { terser } from 'rollup-plugin-terser';
|
||||
|
||||
const production = !process.env.ROLLUP_WATCH;
|
||||
|
||||
export default {
|
||||
input: 'src/main.js',
|
||||
output: {
|
||||
sourcemap: true,
|
||||
format: 'iife',
|
||||
name: 'app',
|
||||
file: 'public/build/bundle.js'
|
||||
},
|
||||
plugins: [
|
||||
svelte({
|
||||
// enable run-time checks when not in production
|
||||
dev: !production,
|
||||
// we'll extract any component CSS out into
|
||||
// a separate file - better for performance
|
||||
css: css => {
|
||||
css.write('public/build/bundle.css');
|
||||
}
|
||||
}),
|
||||
|
||||
// If you have external dependencies installed from
|
||||
// npm, you'll most likely need these plugins. In
|
||||
// some cases you'll need additional configuration -
|
||||
// consult the documentation for details:
|
||||
// https://github.com/rollup/plugins/tree/master/packages/commonjs
|
||||
resolve({
|
||||
browser: true,
|
||||
dedupe: ['svelte']
|
||||
}),
|
||||
commonjs(),
|
||||
|
||||
// In dev mode, call `npm run start` once
|
||||
// the bundle has been generated
|
||||
!production && serve(),
|
||||
|
||||
// Watch the `public` directory and refresh the
|
||||
// browser on changes when not in production
|
||||
!production && livereload('public'),
|
||||
|
||||
// If we're building for production (npm run build
|
||||
// instead of npm run dev), minify
|
||||
production && terser()
|
||||
],
|
||||
watch: {
|
||||
clearScreen: false
|
||||
}
|
||||
};
|
||||
|
||||
function serve() {
|
||||
let started = false;
|
||||
|
||||
return {
|
||||
writeBundle() {
|
||||
if (!started) {
|
||||
started = true;
|
||||
|
||||
require('child_process').spawn('npm', ['run', 'start', '--', '--dev'], {
|
||||
stdio: ['ignore', 'inherit', 'inherit'],
|
||||
shell: true
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
30
packages/now-build-utils/test/fixtures/19-yarn-v2/src/App.svelte
vendored
Normal file
30
packages/now-build-utils/test/fixtures/19-yarn-v2/src/App.svelte
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
<script>
|
||||
export let name;
|
||||
</script>
|
||||
|
||||
<main>
|
||||
<h1>Hello {name}!</h1>
|
||||
<p>Visit the <a href="https://svelte.dev/tutorial">Svelte tutorial</a> to learn how to build Svelte apps.</p>
|
||||
</main>
|
||||
|
||||
<style>
|
||||
main {
|
||||
text-align: center;
|
||||
padding: 1em;
|
||||
max-width: 240px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #ff3e00;
|
||||
text-transform: uppercase;
|
||||
font-size: 4em;
|
||||
font-weight: 100;
|
||||
}
|
||||
|
||||
@media (min-width: 640px) {
|
||||
main {
|
||||
max-width: none;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
10
packages/now-build-utils/test/fixtures/19-yarn-v2/src/main.js
vendored
Normal file
10
packages/now-build-utils/test/fixtures/19-yarn-v2/src/main.js
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
import App from './App.svelte';
|
||||
|
||||
const app = new App({
|
||||
target: document.body,
|
||||
props: {
|
||||
name: 'world'
|
||||
}
|
||||
});
|
||||
|
||||
export default app;
|
||||
1613
packages/now-build-utils/test/fixtures/19-yarn-v2/yarn.lock
vendored
Normal file
1613
packages/now-build-utils/test/fixtures/19-yarn-v2/yarn.lock
vendored
Normal file
File diff suppressed because it is too large
Load Diff
@@ -531,6 +531,7 @@ describe('Test `detectBuilders`', () => {
|
||||
const files = ['api/user.php'];
|
||||
// @ts-ignore
|
||||
const { errors } = await detectBuilders(files, null, {
|
||||
// @ts-ignore
|
||||
functions,
|
||||
});
|
||||
|
||||
@@ -867,12 +868,14 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
defaultRoutes,
|
||||
redirectRoutes,
|
||||
rewriteRoutes,
|
||||
errorRoutes,
|
||||
} = await detectBuilders(files, pkg, { featHandleMiss });
|
||||
expect(builders![0].use).toBe('@vercel/next');
|
||||
expect(errors).toBe(null);
|
||||
expect(defaultRoutes).toStrictEqual([]);
|
||||
expect(redirectRoutes).toStrictEqual([]);
|
||||
expect(rewriteRoutes).toStrictEqual([]);
|
||||
expect(errorRoutes).toStrictEqual([]);
|
||||
});
|
||||
|
||||
it('package.json + no build + next', async () => {
|
||||
@@ -887,12 +890,14 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
defaultRoutes,
|
||||
redirectRoutes,
|
||||
rewriteRoutes,
|
||||
errorRoutes,
|
||||
} = await detectBuilders(files, pkg, { featHandleMiss });
|
||||
expect(builders![0].use).toBe('@vercel/next');
|
||||
expect(errors).toBe(null);
|
||||
expect(defaultRoutes).toStrictEqual([]);
|
||||
expect(redirectRoutes).toStrictEqual([]);
|
||||
expect(rewriteRoutes).toStrictEqual([]);
|
||||
expect(errorRoutes).toStrictEqual([]);
|
||||
});
|
||||
|
||||
it('package.json + no build', async () => {
|
||||
@@ -913,12 +918,15 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
defaultRoutes,
|
||||
redirectRoutes,
|
||||
rewriteRoutes,
|
||||
errorRoutes,
|
||||
} = await detectBuilders(files, null, { featHandleMiss });
|
||||
expect(builders).toBe(null);
|
||||
expect(errors).toBe(null);
|
||||
expect(defaultRoutes).toStrictEqual([]);
|
||||
expect(redirectRoutes).toStrictEqual([]);
|
||||
expect(rewriteRoutes).toStrictEqual([]);
|
||||
expect(errorRoutes!.length).toBe(1);
|
||||
expect((errorRoutes![0] as Source).status).toBe(404);
|
||||
});
|
||||
|
||||
it('no package.json + public', async () => {
|
||||
@@ -929,6 +937,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
defaultRoutes,
|
||||
redirectRoutes,
|
||||
rewriteRoutes,
|
||||
errorRoutes,
|
||||
} = await detectBuilders(files, null, { featHandleMiss });
|
||||
expect(builders![1].use).toBe('@vercel/static');
|
||||
expect(errors).toBe(null);
|
||||
@@ -939,6 +948,8 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
expect(redirectRoutes).toStrictEqual([]);
|
||||
expect(rewriteRoutes!.length).toBe(1);
|
||||
expect((rewriteRoutes![0] as Source).status).toBe(404);
|
||||
expect(errorRoutes!.length).toBe(1);
|
||||
expect((errorRoutes![0] as Source).status).toBe(404);
|
||||
});
|
||||
|
||||
it('no package.json + no build + raw static + api', async () => {
|
||||
@@ -949,6 +960,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
defaultRoutes,
|
||||
redirectRoutes,
|
||||
rewriteRoutes,
|
||||
errorRoutes,
|
||||
} = await detectBuilders(files, null, { featHandleMiss });
|
||||
expect(builders![0].use).toBe('@vercel/node');
|
||||
expect(builders![0].src).toBe('api/users.js');
|
||||
@@ -963,6 +975,8 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
expect(redirectRoutes).toStrictEqual([]);
|
||||
expect(rewriteRoutes!.length).toBe(1);
|
||||
expect((rewriteRoutes![0] as Source).status).toBe(404);
|
||||
expect(errorRoutes!.length).toBe(1);
|
||||
expect((errorRoutes![0] as Source).status).toBe(404);
|
||||
});
|
||||
|
||||
it('package.json + no build + root + api', async () => {
|
||||
@@ -990,6 +1004,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
defaultRoutes,
|
||||
redirectRoutes,
|
||||
rewriteRoutes,
|
||||
errorRoutes,
|
||||
} = await detectBuilders(files, undefined, { featHandleMiss });
|
||||
expect(builders![0].use).toBe('@vercel/node');
|
||||
expect(builders![0].src).toBe('api/[endpoint]/[id].js');
|
||||
@@ -1002,6 +1017,8 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
expect(rewriteRoutes!.length).toBe(2);
|
||||
expect((rewriteRoutes![0] as Source).src).toBe('^/api/([^/]+)/([^/]+)$');
|
||||
expect((rewriteRoutes![1] as Source).status).toBe(404);
|
||||
expect(errorRoutes!.length).toBe(1);
|
||||
expect((errorRoutes![0] as Source).status).toBe(404);
|
||||
});
|
||||
|
||||
it('api + next + public', async () => {
|
||||
@@ -1016,6 +1033,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
defaultRoutes,
|
||||
redirectRoutes,
|
||||
rewriteRoutes,
|
||||
errorRoutes,
|
||||
} = await detectBuilders(files, pkg, { featHandleMiss });
|
||||
expect(builders![0].use).toBe('@vercel/node');
|
||||
expect(builders![0].src).toBe('api/endpoint.js');
|
||||
@@ -1029,6 +1047,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
expect(redirectRoutes).toStrictEqual([]);
|
||||
expect(rewriteRoutes!.length).toBe(1);
|
||||
expect((rewriteRoutes![0] as Source).status).toBe(404);
|
||||
expect(errorRoutes).toStrictEqual([]);
|
||||
});
|
||||
|
||||
it('api + next + raw static', async () => {
|
||||
@@ -1043,6 +1062,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
defaultRoutes,
|
||||
redirectRoutes,
|
||||
rewriteRoutes,
|
||||
errorRoutes,
|
||||
} = await detectBuilders(files, pkg, { featHandleMiss });
|
||||
expect(builders![0].use).toBe('@vercel/node');
|
||||
expect(builders![0].src).toBe('api/endpoint.js');
|
||||
@@ -1056,6 +1076,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
expect(redirectRoutes).toStrictEqual([]);
|
||||
expect(rewriteRoutes!.length).toBe(1);
|
||||
expect((rewriteRoutes![0] as Source).status).toBe(404);
|
||||
expect(errorRoutes).toStrictEqual([]);
|
||||
});
|
||||
|
||||
it('api + raw static', async () => {
|
||||
@@ -1066,6 +1087,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
defaultRoutes,
|
||||
redirectRoutes,
|
||||
rewriteRoutes,
|
||||
errorRoutes,
|
||||
} = await detectBuilders(files, null, { featHandleMiss });
|
||||
expect(builders![0].use).toBe('@vercel/node');
|
||||
expect(builders![0].src).toBe('api/endpoint.js');
|
||||
@@ -1079,6 +1101,8 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
expect(redirectRoutes).toStrictEqual([]);
|
||||
expect(rewriteRoutes!.length).toBe(1);
|
||||
expect((rewriteRoutes![0] as Source).status).toBe(404);
|
||||
expect(errorRoutes!.length).toBe(1);
|
||||
expect((errorRoutes![0] as Source).status).toBe(404);
|
||||
});
|
||||
|
||||
it('api + raw static + package.json no build script', async () => {
|
||||
@@ -1093,6 +1117,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
defaultRoutes,
|
||||
redirectRoutes,
|
||||
rewriteRoutes,
|
||||
errorRoutes,
|
||||
} = await detectBuilders(files, pkg, { featHandleMiss });
|
||||
expect(builders![0].use).toBe('@vercel/node');
|
||||
expect(builders![0].src).toBe('api/version.js');
|
||||
@@ -1106,6 +1131,8 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
expect(redirectRoutes).toStrictEqual([]);
|
||||
expect(rewriteRoutes!.length).toBe(1);
|
||||
expect((rewriteRoutes![0] as Source).status).toBe(404);
|
||||
expect(errorRoutes!.length).toBe(1);
|
||||
expect((errorRoutes![0] as Source).status).toBe(404);
|
||||
});
|
||||
|
||||
it('api + public', async () => {
|
||||
@@ -1116,7 +1143,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
'README.md',
|
||||
];
|
||||
|
||||
const { builders } = await detectBuilders(files, undefined, {
|
||||
const { builders, errorRoutes } = await detectBuilders(files, undefined, {
|
||||
featHandleMiss,
|
||||
});
|
||||
expect(builders![0].use).toBe('@vercel/node');
|
||||
@@ -1124,6 +1151,8 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
expect(builders![1].use).toBe('@vercel/static');
|
||||
expect(builders![1].src).toBe('public/**/*');
|
||||
expect(builders!.length).toBe(2);
|
||||
expect(errorRoutes!.length).toBe(1);
|
||||
expect((errorRoutes![0] as Source).status).toBe(404);
|
||||
});
|
||||
|
||||
it('api go with test files', async () => {
|
||||
@@ -1142,21 +1171,26 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
'api/src/controllers/user.module_test.go',
|
||||
];
|
||||
|
||||
const { builders } = await detectBuilders(files, undefined, {
|
||||
const { builders, errorRoutes } = await detectBuilders(files, undefined, {
|
||||
featHandleMiss,
|
||||
});
|
||||
expect(builders!.length).toBe(7);
|
||||
expect(builders!.some(b => b.src.endsWith('_test.go'))).toBe(false);
|
||||
expect(errorRoutes!.length).toBe(1);
|
||||
expect((errorRoutes![0] as Source).status).toBe(404);
|
||||
});
|
||||
|
||||
it('just public', async () => {
|
||||
const files = ['public/index.html', 'public/favicon.ico', 'README.md'];
|
||||
|
||||
const { builders } = await detectBuilders(files, undefined, {
|
||||
const { builders, errorRoutes } = await detectBuilders(files, undefined, {
|
||||
featHandleMiss,
|
||||
});
|
||||
expect(builders![0].src).toBe('public/**/*');
|
||||
expect(builders![0].use).toBe('@vercel/static');
|
||||
expect(builders!.length).toBe(1);
|
||||
expect(errorRoutes!.length).toBe(1);
|
||||
expect((errorRoutes![0] as Source).status).toBe(404);
|
||||
});
|
||||
|
||||
it('next + public', async () => {
|
||||
@@ -1166,10 +1200,13 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
};
|
||||
const files = ['package.json', 'public/index.html', 'README.md'];
|
||||
|
||||
const { builders } = await detectBuilders(files, pkg, { featHandleMiss });
|
||||
const { builders, errorRoutes } = await detectBuilders(files, pkg, {
|
||||
featHandleMiss,
|
||||
});
|
||||
expect(builders![0].use).toBe('@vercel/next');
|
||||
expect(builders![0].src).toBe('package.json');
|
||||
expect(builders!.length).toBe(1);
|
||||
expect(errorRoutes!.length).toBe(0);
|
||||
});
|
||||
|
||||
it('nuxt', async () => {
|
||||
@@ -1179,10 +1216,14 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
};
|
||||
const files = ['package.json', 'pages/index.js'];
|
||||
|
||||
const { builders } = await detectBuilders(files, pkg, { featHandleMiss });
|
||||
const { builders, errorRoutes } = await detectBuilders(files, pkg, {
|
||||
featHandleMiss,
|
||||
});
|
||||
expect(builders![0].use).toBe('@vercel/static-build');
|
||||
expect(builders![0].src).toBe('package.json');
|
||||
expect(builders!.length).toBe(1);
|
||||
expect(errorRoutes!.length).toBe(1);
|
||||
expect((errorRoutes![0] as Source).status).toBe(404);
|
||||
});
|
||||
|
||||
it('nuxt + tag canary', async () => {
|
||||
@@ -1192,23 +1233,29 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
};
|
||||
const files = ['package.json', 'pages/index.js'];
|
||||
|
||||
const { builders } = await detectBuilders(files, pkg, {
|
||||
const { builders, errorRoutes } = await detectBuilders(files, pkg, {
|
||||
tag: 'canary',
|
||||
featHandleMiss,
|
||||
});
|
||||
expect(builders![0].use).toBe('@vercel/static-build@canary');
|
||||
expect(builders![0].src).toBe('package.json');
|
||||
expect(builders!.length).toBe(1);
|
||||
expect(errorRoutes!.length).toBe(1);
|
||||
expect((errorRoutes![0] as Source).status).toBe(404);
|
||||
});
|
||||
|
||||
it('package.json with no build + api', async () => {
|
||||
const pkg = { dependencies: { next: '9.0.0' } };
|
||||
const files = ['package.json', 'api/[endpoint].js'];
|
||||
|
||||
const { builders } = await detectBuilders(files, pkg, { featHandleMiss });
|
||||
const { builders, errorRoutes } = await detectBuilders(files, pkg, {
|
||||
featHandleMiss,
|
||||
});
|
||||
expect(builders![0].use).toBe('@vercel/node');
|
||||
expect(builders![0].src).toBe('api/[endpoint].js');
|
||||
expect(builders!.length).toBe(1);
|
||||
expect(errorRoutes!.length).toBe(1);
|
||||
expect((errorRoutes![0] as Source).status).toBe(404);
|
||||
});
|
||||
|
||||
it('package.json with no build + public directory', async () => {
|
||||
@@ -1327,7 +1374,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
it('many static files + one api file', async () => {
|
||||
const files = Array.from({ length: 5000 }).map((_, i) => `file${i}.html`);
|
||||
files.push('api/index.ts');
|
||||
const { builders } = await detectBuilders(files, undefined, {
|
||||
const { builders, errorRoutes } = await detectBuilders(files, undefined, {
|
||||
featHandleMiss,
|
||||
});
|
||||
|
||||
@@ -1336,6 +1383,8 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
expect(builders![0].src).toBe('api/index.ts');
|
||||
expect(builders![1].use).toBe('@vercel/static');
|
||||
expect(builders![1].src).toBe('!{api/**,package.json}');
|
||||
expect(errorRoutes!.length).toBe(1);
|
||||
expect((errorRoutes![0] as Source).status).toBe(404);
|
||||
});
|
||||
|
||||
it('functions with nextjs', async () => {
|
||||
@@ -1530,6 +1579,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
const files = ['api/user.php'];
|
||||
// @ts-ignore
|
||||
const { errors } = await detectBuilders(files, null, {
|
||||
// @ts-ignore
|
||||
functions,
|
||||
featHandleMiss,
|
||||
});
|
||||
@@ -1630,6 +1680,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
|
||||
// @ts-ignore
|
||||
const { errors } = await detectBuilders(files, null, {
|
||||
// @ts-ignore
|
||||
functions,
|
||||
featHandleMiss,
|
||||
});
|
||||
@@ -1646,6 +1697,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
|
||||
// @ts-ignore: Since we test an invalid type
|
||||
const { errors } = await detectBuilders(files, null, {
|
||||
// @ts-ignore
|
||||
functions,
|
||||
featHandleMiss,
|
||||
});
|
||||
@@ -1681,6 +1733,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
defaultRoutes,
|
||||
redirectRoutes,
|
||||
rewriteRoutes,
|
||||
errorRoutes,
|
||||
} = await detectBuilders(files, null, {
|
||||
projectSettings,
|
||||
featHandleMiss,
|
||||
@@ -1693,6 +1746,8 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
expect(defaultRoutes).toStrictEqual([]);
|
||||
expect(redirectRoutes).toStrictEqual([]);
|
||||
expect(rewriteRoutes).toStrictEqual([]);
|
||||
expect(errorRoutes!.length).toBe(1);
|
||||
expect((errorRoutes![0] as Source).status).toBe(404);
|
||||
});
|
||||
|
||||
it('Custom static output directory with api', async () => {
|
||||
@@ -1707,6 +1762,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
defaultRoutes,
|
||||
redirectRoutes,
|
||||
rewriteRoutes,
|
||||
errorRoutes,
|
||||
} = await detectBuilders(files, null, {
|
||||
projectSettings,
|
||||
featHandleMiss,
|
||||
@@ -1722,6 +1778,8 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
expect(redirectRoutes).toStrictEqual([]);
|
||||
expect(rewriteRoutes!.length).toBe(1);
|
||||
expect((rewriteRoutes![0] as Source).status).toBe(404);
|
||||
expect(errorRoutes!.length).toBe(1);
|
||||
expect((errorRoutes![0] as Source).status).toBe(404);
|
||||
});
|
||||
|
||||
it('Framework with non-package.json entrypoint', async () => {
|
||||
@@ -1730,7 +1788,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
framework: 'hugo',
|
||||
};
|
||||
|
||||
const { builders } = await detectBuilders(files, null, {
|
||||
const { builders, errorRoutes } = await detectBuilders(files, null, {
|
||||
projectSettings,
|
||||
featHandleMiss,
|
||||
});
|
||||
@@ -1745,6 +1803,8 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
},
|
||||
},
|
||||
]);
|
||||
expect(errorRoutes!.length).toBe(1);
|
||||
expect((errorRoutes![0] as Source).status).toBe(404);
|
||||
});
|
||||
|
||||
it('No framework, only package.json', async () => {
|
||||
@@ -1755,7 +1815,9 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
},
|
||||
};
|
||||
|
||||
const { builders } = await detectBuilders(files, pkg, { featHandleMiss });
|
||||
const { builders, errorRoutes } = await detectBuilders(files, pkg, {
|
||||
featHandleMiss,
|
||||
});
|
||||
|
||||
expect(builders).toEqual([
|
||||
{
|
||||
@@ -1766,13 +1828,15 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
},
|
||||
},
|
||||
]);
|
||||
expect(errorRoutes!.length).toBe(1);
|
||||
expect((errorRoutes![0] as Source).status).toBe(404);
|
||||
});
|
||||
|
||||
it('Framework with an API', async () => {
|
||||
const files = ['config.rb', 'api/date.rb'];
|
||||
const projectSettings = { framework: 'middleman' };
|
||||
|
||||
const { builders } = await detectBuilders(files, null, {
|
||||
const { builders, errorRoutes } = await detectBuilders(files, null, {
|
||||
projectSettings,
|
||||
featHandleMiss,
|
||||
});
|
||||
@@ -1794,6 +1858,8 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
},
|
||||
},
|
||||
]);
|
||||
expect(errorRoutes!.length).toBe(1);
|
||||
expect((errorRoutes![0] as Source).status).toBe(404);
|
||||
});
|
||||
|
||||
it('Error for non-api functions', async () => {
|
||||
@@ -1843,13 +1909,19 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
it('All static if `buildCommand` is an empty string with an `outputDirectory`', async () => {
|
||||
const files = ['out/index.html'];
|
||||
const projectSettings = { buildCommand: '', outputDirectory: 'out' };
|
||||
const { builders, errors } = await detectBuilders(files, null, {
|
||||
projectSettings,
|
||||
featHandleMiss,
|
||||
});
|
||||
const { builders, errors, errorRoutes } = await detectBuilders(
|
||||
files,
|
||||
null,
|
||||
{
|
||||
projectSettings,
|
||||
featHandleMiss,
|
||||
}
|
||||
);
|
||||
expect(errors).toBe(null);
|
||||
expect(builders![0]!.use).toBe('@vercel/static');
|
||||
expect(builders![0]!.src).toBe('out/**/*');
|
||||
expect(errorRoutes!.length).toBe(1);
|
||||
expect((errorRoutes![0] as Source).status).toBe(404);
|
||||
});
|
||||
|
||||
it('do not require build script when `buildCommand` is an empty string', async () => {
|
||||
@@ -2025,9 +2097,13 @@ it('Test `detectRoutes` with `featHandleMiss=true`', async () => {
|
||||
{
|
||||
const files = ['api/user.go', 'api/team.js', 'api/package.json'];
|
||||
|
||||
const { defaultRoutes, rewriteRoutes } = await detectBuilders(files, null, {
|
||||
featHandleMiss,
|
||||
});
|
||||
const { defaultRoutes, rewriteRoutes, errorRoutes } = await detectBuilders(
|
||||
files,
|
||||
null,
|
||||
{
|
||||
featHandleMiss,
|
||||
}
|
||||
);
|
||||
expect(defaultRoutes).toStrictEqual([
|
||||
{ handle: 'miss' },
|
||||
{
|
||||
@@ -2043,6 +2119,44 @@ it('Test `detectRoutes` with `featHandleMiss=true`', async () => {
|
||||
continue: true,
|
||||
},
|
||||
]);
|
||||
expect(errorRoutes).toStrictEqual([
|
||||
{
|
||||
status: 404,
|
||||
src: '^/(?!.*api).*$',
|
||||
dest: '/404.html',
|
||||
},
|
||||
]);
|
||||
|
||||
const pattern = new RegExp(errorRoutes![0].src!);
|
||||
|
||||
[
|
||||
'/',
|
||||
'/index.html',
|
||||
'/page.html',
|
||||
'/page',
|
||||
'/another/index.html',
|
||||
'/another/page.html',
|
||||
'/another/page',
|
||||
'/another/sub/index.html',
|
||||
'/another/sub/page.html',
|
||||
'/another/sub/page',
|
||||
].forEach(file => {
|
||||
expect(file).toMatch(pattern);
|
||||
});
|
||||
|
||||
[
|
||||
'/api',
|
||||
'/api/',
|
||||
'/api/index.html',
|
||||
'/api/page.html',
|
||||
'/api/page',
|
||||
'/api/sub',
|
||||
'/api/sub/index.html',
|
||||
'/api/sub/page.html',
|
||||
'/api/sub/page',
|
||||
].forEach(file => {
|
||||
expect(file).not.toMatch(pattern);
|
||||
});
|
||||
}
|
||||
|
||||
{
|
||||
@@ -2326,6 +2440,7 @@ it('Test `detectRoutes` with `featHandleMiss=true`, `cleanUrls=true`', async ()
|
||||
defaultRoutes,
|
||||
redirectRoutes,
|
||||
rewriteRoutes,
|
||||
errorRoutes,
|
||||
} = await detectBuilders(files, null, options);
|
||||
testHeaders(redirectRoutes);
|
||||
expect(defaultRoutes).toStrictEqual([]);
|
||||
@@ -2336,6 +2451,13 @@ it('Test `detectRoutes` with `featHandleMiss=true`, `cleanUrls=true`', async ()
|
||||
continue: true,
|
||||
},
|
||||
]);
|
||||
expect(errorRoutes).toStrictEqual([
|
||||
{
|
||||
status: 404,
|
||||
src: '^/(?!.*api).*$',
|
||||
dest: '/404',
|
||||
},
|
||||
]);
|
||||
|
||||
// expected redirect should match inputs
|
||||
const getLocation = createReplaceLocation(redirectRoutes);
|
||||
|
||||
@@ -39,7 +39,7 @@ describe('Test `getPlatformEnv()`', () => {
|
||||
assert(err);
|
||||
assert.equal(
|
||||
err!.message,
|
||||
'Both "VERCEL_FOO" and "NOW_FOO" env vars are defined. Please only define the "VERCEL_FOO" env var'
|
||||
'Both "VERCEL_FOO" and "NOW_FOO" env vars are defined. Please only define the "VERCEL_FOO" env var.'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
2
packages/now-build-utils/test/unit.test.js
vendored
2
packages/now-build-utils/test/unit.test.js
vendored
@@ -139,7 +139,7 @@ it('should match all semver ranges', async () => {
|
||||
expect(await getSupportedNodeVersion('^10.5.0')).toHaveProperty('major', 10);
|
||||
});
|
||||
|
||||
it('should ignore node version in now dev getNodeVersion()', async () => {
|
||||
it('should ignore node version in vercel dev getNodeVersion()', async () => {
|
||||
expect(
|
||||
await getNodeVersion(
|
||||
'/tmp',
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"name": "@vercel/cgi",
|
||||
"version": "1.0.5",
|
||||
"version": "1.0.6",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/zeit/now.git",
|
||||
"url": "https://github.com/vercel/vercel.git",
|
||||
"directory": "packages/now-cgi"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<p align="center">Develop. Preview. Ship.</p>
|
||||
</p>
|
||||
|
||||
[](https://github.com/zeit/now/discussions)
|
||||
[](https://github.com/vercel/vercel/discussions)
|
||||
|
||||
## Usage
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"name": "vercel",
|
||||
"version": "19.0.2-canary.6",
|
||||
"version": "19.1.0",
|
||||
"preferGlobal": true,
|
||||
"license": "Apache-2.0",
|
||||
"description": "The command-line interface for Now",
|
||||
"homepage": "https://vercel.com",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/zeit/now.git",
|
||||
"url": "https://github.com/vercel/vercel.git",
|
||||
"directory": "packages/now-cli"
|
||||
},
|
||||
"scripts": {
|
||||
@@ -62,13 +62,13 @@
|
||||
"node": ">= 10"
|
||||
},
|
||||
"dependencies": {
|
||||
"@vercel/build-utils": "2.3.2-canary.1",
|
||||
"@vercel/go": "1.1.1",
|
||||
"@vercel/next": "2.6.3-canary.2",
|
||||
"@vercel/node": "1.6.2-canary.2",
|
||||
"@vercel/python": "1.2.2-canary.0",
|
||||
"@vercel/ruby": "1.2.1",
|
||||
"@vercel/static-build": "0.17.1"
|
||||
"@vercel/build-utils": "2.4.0",
|
||||
"@vercel/go": "1.1.2",
|
||||
"@vercel/next": "2.6.6",
|
||||
"@vercel/node": "1.7.0",
|
||||
"@vercel/python": "1.2.2",
|
||||
"@vercel/ruby": "1.2.2",
|
||||
"@vercel/static-build": "0.17.2"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sentry/node": "5.5.0",
|
||||
@@ -106,7 +106,7 @@
|
||||
"@zeit/fun": "0.11.2",
|
||||
"@zeit/ncc": "0.18.5",
|
||||
"@zeit/source-map-support": "0.6.2",
|
||||
"ajv": "6.10.2",
|
||||
"ajv": "6.12.2",
|
||||
"alpha-sort": "2.0.1",
|
||||
"ansi-escapes": "3.0.0",
|
||||
"ansi-regex": "3.0.0",
|
||||
@@ -136,6 +136,7 @@
|
||||
"escape-html": "1.0.3",
|
||||
"esm": "3.1.4",
|
||||
"execa": "3.2.0",
|
||||
"fast-deep-equal": "3.1.3",
|
||||
"fs-extra": "7.0.1",
|
||||
"get-port": "5.1.1",
|
||||
"glob": "7.1.2",
|
||||
@@ -182,7 +183,7 @@
|
||||
"tmp-promise": "1.0.3",
|
||||
"tree-kill": "1.2.1",
|
||||
"ts-node": "8.3.0",
|
||||
"typescript": "3.6.4",
|
||||
"typescript": "3.9.3",
|
||||
"universal-analytics": "0.4.20",
|
||||
"update-check": "1.5.3",
|
||||
"utility-types": "2.1.0",
|
||||
|
||||
@@ -33,13 +33,13 @@ async function main() {
|
||||
// During local development, these secrets will be empty.
|
||||
await createConstants();
|
||||
|
||||
// `now dev` uses chokidar to watch the filesystem, but opts-out of the
|
||||
// `vercel dev` uses chokidar to watch the filesystem, but opts-out of the
|
||||
// `fsevents` feature using `useFsEvents: false`, so delete the module here so
|
||||
// that it is not compiled by ncc, which makes the npm package size larger
|
||||
// than necessary.
|
||||
await remove(join(dirRoot, '../../node_modules/fsevents'));
|
||||
|
||||
// Compile the `doT.js` template files for `now dev`
|
||||
// Compile the `doT.js` template files for `vercel dev`
|
||||
console.log();
|
||||
await execa(process.execPath, [join(__dirname, 'compile-templates.js')], {
|
||||
stdio: 'inherit',
|
||||
@@ -75,6 +75,17 @@ async function main() {
|
||||
const dest = join(dirRoot, 'dist/runtimes');
|
||||
await cpy('**/*', dest, { parents: true, cwd: runtimes });
|
||||
|
||||
// Band-aid to delete stuff that `ncc` bundles, but it shouldn't:
|
||||
|
||||
// TypeScript definition files from `@vercel/build-utils`
|
||||
await remove(join(dirRoot, 'dist', 'dist'));
|
||||
|
||||
// The Readme and `package.json` from "config-chain" module
|
||||
await remove(join(dirRoot, 'dist', 'config-chain'));
|
||||
|
||||
// A bunch of source `.ts` files from CLI's `util` directory
|
||||
await remove(join(dirRoot, 'dist', 'util'));
|
||||
|
||||
console.log('Finished building `now-cli`');
|
||||
}
|
||||
|
||||
|
||||
@@ -5,12 +5,12 @@ const { readFile, writeFile, readdir, remove } = require('fs-extra');
|
||||
async function main() {
|
||||
const dirRoot = join(__dirname, '..');
|
||||
|
||||
// Compile the `doT.js` template files for `now dev`
|
||||
// Compile the `doT.js` template files for `vercel dev`
|
||||
const templatesDir = join(dirRoot, 'src/util/dev/templates');
|
||||
const dotPacker = join(dirRoot, '../../node_modules/dot/bin/dot-packer');
|
||||
await execa(process.execPath, [dotPacker], {
|
||||
cwd: templatesDir,
|
||||
stdio: 'inherit'
|
||||
stdio: 'inherit',
|
||||
});
|
||||
|
||||
const files = await readdir(templatesDir);
|
||||
@@ -24,7 +24,7 @@ async function main() {
|
||||
[prettier, '--write', '--single-quote', ...compiledFiles],
|
||||
{
|
||||
cwd: templatesDir,
|
||||
stdio: 'inherit'
|
||||
stdio: 'inherit',
|
||||
}
|
||||
);
|
||||
|
||||
@@ -60,7 +60,7 @@ async function main() {
|
||||
)}`;
|
||||
|
||||
lines.unshift(
|
||||
'import encodeHTML from \'escape-html\';',
|
||||
"import encodeHTML from 'escape-html';",
|
||||
'',
|
||||
...def.split('\n')
|
||||
);
|
||||
|
||||
@@ -212,7 +212,7 @@ async function run({ token, config: { currentTeam } }) {
|
||||
}
|
||||
|
||||
// Check if the provided cardId (in case the user
|
||||
// typed `now billing set-default <some-id>`) is valid
|
||||
// typed `vercel billing set-default <some-id>`) is valid
|
||||
if (cardId) {
|
||||
const label = `Are you sure that you to set this card as the default?`;
|
||||
const confirmation = await promptBool(label, {
|
||||
@@ -287,7 +287,7 @@ async function run({ token, config: { currentTeam } }) {
|
||||
}
|
||||
|
||||
// Shoud check if the provided cardId (in case the user
|
||||
// typed `now billing rm <some-id>`) is valid
|
||||
// typed `vercel billing rm <some-id>`) is valid
|
||||
if (cardId) {
|
||||
const label = `Are you sure that you want to remove this card?`;
|
||||
const confirmation = await promptBool(label);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user