Compare commits
87 Commits
@now/next@
...
@now/go@1.
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2a9e5798a8 | ||
|
|
5b369b385d | ||
|
|
28e01528c5 | ||
|
|
987ce6c26b | ||
|
|
21e4d644cf | ||
|
|
282127e3f9 | ||
|
|
7748f50ca9 | ||
|
|
224757581d | ||
|
|
40e99284c2 | ||
|
|
54bae977f0 | ||
|
|
867590a6ba | ||
|
|
c89cf6fd57 | ||
|
|
b7ad18425f | ||
|
|
5554b2d004 | ||
|
|
e4ce0d6802 | ||
|
|
f477ee6e3b | ||
|
|
59b4029a0c | ||
|
|
8411b53fa3 | ||
|
|
7651bcf4a4 | ||
|
|
6fd1b50924 | ||
|
|
a03b8689e9 | ||
|
|
22c8ed15c7 | ||
|
|
e1f7b859b6 | ||
|
|
c75cc99f1e | ||
|
|
30ddd29889 | ||
|
|
21337de7cd | ||
|
|
a6686f9ff5 | ||
|
|
65c621bd55 | ||
|
|
0827d3514d | ||
|
|
7bc5d9fb5b | ||
|
|
c53106ecee | ||
|
|
91e4d18ab8 | ||
|
|
33cd78b93a | ||
|
|
a765d27e5a | ||
|
|
e65ff4bfd5 | ||
|
|
30a4787390 | ||
|
|
36f6f1db77 | ||
|
|
8043e25d6d | ||
|
|
73b4e7aea4 | ||
|
|
de7e063c9b | ||
|
|
e7c30deee8 | ||
|
|
7464fac792 | ||
|
|
252363cce4 | ||
|
|
d7dceeb2a1 | ||
|
|
6b5b9e8b2f | ||
|
|
addd036149 | ||
|
|
7ca672a470 | ||
|
|
3af0e99689 | ||
|
|
b14068de8a | ||
|
|
c9437e714a | ||
|
|
c0aff5cf4a | ||
|
|
9110b14bb4 | ||
|
|
40e4b69267 | ||
|
|
6c4934dcc4 | ||
|
|
d64e54d61a | ||
|
|
0b75bf07f7 | ||
|
|
a861a8f3f7 | ||
|
|
6407b17b7f | ||
|
|
558463a988 | ||
|
|
1a133995b8 | ||
|
|
a83eecf674 | ||
|
|
a932ed65fa | ||
|
|
e2ae497762 | ||
|
|
89989719c2 | ||
|
|
8166b8e1e7 | ||
|
|
1ceeac498c | ||
|
|
1c47d1360d | ||
|
|
ddcd0918e9 | ||
|
|
573b6b8110 | ||
|
|
40039d7f9b | ||
|
|
dcb37e92f5 | ||
|
|
fe7f875549 | ||
|
|
a516ed6fb8 | ||
|
|
ca2c5f85ef | ||
|
|
adb5a01cc0 | ||
|
|
6b4d39ab4d | ||
|
|
07ce3d2e34 | ||
|
|
93ffcf487b | ||
|
|
3631f0f4cf | ||
|
|
b67b5be8a9 | ||
|
|
bf67b1a29e | ||
|
|
ed86473f74 | ||
|
|
399a3cd114 | ||
|
|
d0fd09810a | ||
|
|
f298f2e894 | ||
|
|
569200ae0e | ||
|
|
c91495338d |
3
.gitattributes
vendored
@@ -1,5 +1,8 @@
|
||||
# Ignore test fixtures in GitHub Languages
|
||||
# See https://github.com/github/linguist#vendored-code
|
||||
examples/* linguist-vendored
|
||||
utils/* linguist-vendored
|
||||
test/* linguist-vendored
|
||||
packages/*/test/* linguist-vendored
|
||||
|
||||
# Go build fails with Windows line endings.
|
||||
|
||||
1
.github/CODEOWNERS
vendored
@@ -8,6 +8,7 @@
|
||||
/packages/now-cli/src/util/dev/ @tootallnate @leo @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 @leo @rdev
|
||||
/packages/now-build-utils @styfle @AndyBitz
|
||||
/packages/now-node @styfle @tootallnate @lucleray
|
||||
|
||||
2
.github/CODE_OF_CONDUCT.md
vendored
@@ -55,7 +55,7 @@ further defined and clarified by project maintainers.
|
||||
### Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at [abuse@zeit.co](mailto:abuse@zeit.co). All
|
||||
reported by contacting the project team at [coc@vercel.com](mailto:coc@vercel.com). All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
|
||||
4
.github/CONTRIBUTING.md
vendored
@@ -47,7 +47,7 @@ Unit tests are run locally with `jest` and execute quickly because they are test
|
||||
|
||||
### Integration tests
|
||||
|
||||
Integration tests create deployments to your ZEIT account using the `test` project name. After each test is deployed, the `probes` key is used to check if the response is the expected value. If the value doesn't match, you'll see a message explaining the difference. If the deployment failed to build, you'll see a more generic message like the following:
|
||||
Integration tests create deployments to your Vercel account using the `test` project name. After each test is deployed, the `probes` key is used to check if the response is the expected value. If the value doesn't match, you'll see a message explaining the difference. If the deployment failed to build, you'll see a more generic message like the following:
|
||||
|
||||
```
|
||||
[Error: Fetched page https://test-8ashcdlew.now.sh/root.js does not contain hello Root!. Instead it contains An error occurred with this application.
|
||||
@@ -102,4 +102,4 @@ You can add support for a new Framework by creating a Pull Request for this repo
|
||||
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.
|
||||
4. After your Pull Request has been merged and released, other users can select the example on the ZEIT Now dashboard and deploy it.
|
||||
4. After your Pull Request has been merged and released, other users can select the example on the Vercel dashboard and deploy it.
|
||||
|
||||
8
.github/EXAMPLE_README_TEMPLATE.md
vendored
@@ -1,16 +1,16 @@
|
||||
# [Name] Example
|
||||
|
||||
This directory is a brief example of a [Name](site-link) site that can be deployed with ZEIT Now and zero configuration.
|
||||
This directory is a brief example of a [Name](site-link) site that can be deployed with Vercel and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own [Name] project with ZEIT Now.
|
||||
Deploy your own [Name] project with Vercel.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now-examples/tree/master/example-directory)
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now-examples/tree/master/example-directory)
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with [Name] on Now, you can use the [CLI Tool Used](CLI-link) to initialize the project:
|
||||
To get started with [Name] on Vercel, you can use the [CLI Tool Used](CLI-link) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ now init charge
|
||||
|
||||
4
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -1,8 +1,8 @@
|
||||
blank_issues_enabled: false
|
||||
contact_links:
|
||||
- name: Bug Report
|
||||
url: https://zeit.co/support/request
|
||||
about: Report a bug using the ZEIT Now support form
|
||||
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
|
||||
about: Request a feature to be added to the platform
|
||||
|
||||
5
.gitignore
vendored
@@ -23,5 +23,6 @@ packages/now-cli/test/fixtures/integration
|
||||
test/lib/deployment/failed-page.txt
|
||||
.DS_Store
|
||||
.next
|
||||
.env
|
||||
public
|
||||
/.env
|
||||
/public
|
||||
__pycache__
|
||||
|
||||
@@ -6,7 +6,7 @@ A Runtime is an npm module that exposes a `build` function and optionally an `an
|
||||
Official Runtimes are published to [npmjs.com](https://npmjs.com) as a package and referenced in the `use` property of the `now.json` configuration file.
|
||||
However, the `use` property will work with any [npm install argument](https://docs.npmjs.com/cli/install) such as a git repo url which is useful for testing your Runtime.
|
||||
|
||||
See the [Runtimes Documentation](https://zeit.co/docs/runtimes) to view example usage.
|
||||
See the [Runtimes Documentation](https://vercel.com/docs/runtimes) to view example usage.
|
||||
|
||||
## Runtime Exports
|
||||
|
||||
@@ -18,7 +18,7 @@ The latest and suggested version is `3`.
|
||||
|
||||
### `analyze`
|
||||
|
||||
An **optional** exported function that returns a unique fingerprint used for the purpose of [build de-duplication](https://zeit.co/docs/v2/advanced/concepts/immutability#deduplication-algorithm). If the `analyze` function is not supplied, a random fingerprint is assigned to each build.
|
||||
An **optional** exported function that returns a unique fingerprint used for the purpose of [build de-duplication](https://vercel.com/docs/v2/platform/deployments#deduplication). If the `analyze` function is not supplied, a random fingerprint is assigned to each build.
|
||||
|
||||
```js
|
||||
export analyze({
|
||||
@@ -43,7 +43,7 @@ export analyze(options: AnalyzeOptions) {
|
||||
|
||||
A **required** exported function that returns a [Serverless Function](#serverless-function).
|
||||
|
||||
What's a Serverless Function? Read about [Serverless Function concepts](https://zeit.co/docs/v2/deployments/concepts/lambdas) to learn more.
|
||||
What's a Serverless Function? Read about [Serverless Functions](https://vercel.com/docs/v2/serverless-functions/introduction) to learn more.
|
||||
|
||||
```js
|
||||
build({
|
||||
@@ -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://zeit.co/docs/v2/advanced/runtimes) wants to be responsible for building a certain request path.
|
||||
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.
|
||||
|
||||
```js
|
||||
shouldServe({
|
||||
@@ -153,7 +153,7 @@ Check out our [Node.js Runtime](https://github.com/zeit/now/tree/master/packages
|
||||
|
||||
### Execution Context
|
||||
|
||||
A [Serverless Function](https://zeit.co/docs/v2/advanced/concepts/lambdas) is created where the Runtime logic is executed. The lambda is run using the Node.js 8 runtime. A brand new sandbox is created for each deployment, for security reasons. The sandbox is cleaned up between executions to ensure no lingering temporary files are shared from build to build.
|
||||
A [Serverless Function](https://vercel.com/docs/v2/serverless-functions/introduction) is created where the Runtime logic is executed. The lambda is run using the Node.js 8 runtime. A brand new sandbox is created for each deployment, for security reasons. The sandbox is cleaned up between executions to ensure no lingering temporary files are shared from build to build.
|
||||
|
||||
All the APIs you export ([`analyze`](#analyze), [`build`](#build) and [`prepareCache`](#preparecache)) are not guaranteed to be run in the same process, but the filesystem we expose (e.g.: `workPath` and the results of calling [`getWriteableDirectory`](#getWriteableDirectory) ) is retained.
|
||||
|
||||
@@ -165,8 +165,6 @@ When a new build is created, we pre-populate the `workPath` supplied to `analyze
|
||||
|
||||
The `analyze` step can modify that directory, and it will not be re-created when it's supplied to `build` and `prepareCache`.
|
||||
|
||||
To learn how the cache key is computed and invalidated, refer to the [overview](https://zeit.co/docs/v2/advanced/runtimes#technical-details).
|
||||
|
||||
### Accessing Environment and Secrets
|
||||
|
||||
The env and secrets specified by the user as `build.env` are passed to the Runtime process. This means you can access user env via `process.env` in Node.js.
|
||||
|
||||
@@ -5,11 +5,11 @@
|
||||
|
||||
## Usage
|
||||
|
||||
Get started by [Importing a Git Project](https://zeit.co/import) and use `git push` to deploy. Alternatively, you can [install Now CLI](https://zeit.co/download).
|
||||
Get started by [Importing a Git Project](https://vercel.com/import) and use `git push` to deploy. Alternatively, you can [install Now CLI](https://vercel.com/download).
|
||||
|
||||
## Documentation
|
||||
|
||||
For details on how to use ZEIT Now, check out our [documentation](https://zeit.co/docs).
|
||||
For details on how to use Vercel, check out our [documentation](https://vercel.com/docs).
|
||||
|
||||
## Caught a Bug?
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ the provider couldn’t solve the requested challenges.
|
||||
|
||||
## How to Fix It
|
||||
|
||||
If your domain is pointing to ZEIT World DNS and you’re getting this error,
|
||||
If your domain is pointing to Vercel DNS and you’re getting this error,
|
||||
it could be that:
|
||||
|
||||
- The domain was acquired recently, and it might not be ready for use yet.
|
||||
@@ -17,11 +17,11 @@ it could be that:
|
||||
When running into this, ensure that your nameservers are configured correctly. Also, if you bought the domain recently or have made changes, please be patient,
|
||||
it might take a while for these to be ready.
|
||||
|
||||
If your domain is _not_ pointing to ZEIT World DNS and you’re getting this
|
||||
If your domain is _not_ pointing to Vercel DNS and you’re getting this
|
||||
error, the following methods could help:
|
||||
|
||||
- When solving challenges *manually*, ensure that the TXT
|
||||
records required to solve the challenges exist and are propagated. You can do so by querying the nameservers with `nslookup -q=TXT _acme-challenge.domain.com` depending on the Common Names you want for your certificate.
|
||||
- When solving challenges _manually_, ensure that the TXT
|
||||
records required to solve the challenges exist and are propagated. You can do so by querying the nameservers with `nslookup -q=TXT _acme-challenge.domain.com` depending on the Common Names you want for your certificate.
|
||||
|
||||
- If you are not solving the challenges manually you must ensure that you have an
|
||||
`ALIAS` and `CNAME` records in place. Ensure also that you have disabled automatic redirects to `https` and ensure all changes were propagated.
|
||||
`ALIAS` and `CNAME` records in place. Ensure also that you have disabled automatic redirects to `https` and ensure all changes were propagated.
|
||||
|
||||
@@ -4,12 +4,12 @@
|
||||
|
||||
When generating a certificate, we have to prove ownership over the domain
|
||||
for the Certificate Authority (CA) that issues it. We also run some pretests
|
||||
to make sure the DNS is properly configured before submitting the request to
|
||||
to make sure the DNS is properly configured before submitting the request to
|
||||
the CA. This error means that these pretests did not succeed.
|
||||
|
||||
## How to Fix It
|
||||
|
||||
If your domain is pointing to ZEIT World DNS and you’re getting this error,
|
||||
If your domain is pointing to Vercel DNS and you’re getting this error,
|
||||
it could be that:
|
||||
|
||||
- The domain was acquired recently, and it might not be ready for use yet.
|
||||
@@ -18,6 +18,6 @@ it could be that:
|
||||
When running into this, ensure that your nameservers have configuration is correct. Also, if you bought the domain recently or have made changes, please be patient,
|
||||
it might take a while for these to be ready.
|
||||
|
||||
If your domain is _not_ pointing to ZEIT World DNS and you’re getting this
|
||||
If your domain is _not_ pointing to Vercel DNS and you’re getting this
|
||||
error, you must ensure that you have an `ALIAS` and `CNAME` records in place.
|
||||
Ensure also that you have disabled automatic redirects to `https` and ensure all changes were propagated.
|
||||
|
||||
@@ -12,10 +12,10 @@ You can retrieve both the intended nameservers and TXT verification record for t
|
||||
|
||||
When you have added either verification method to your domain, you can run `now domains verify <domain>` again to complete verification for your domain.
|
||||
|
||||
ZEIT 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.
|
||||
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>`.
|
||||
|
||||
#### Resources
|
||||
- [ZEIT Domains Documentation](https://zeit.co/docs/v2/domains-and-aliases/adding-a-domain/)
|
||||
- [Zero-Downtime Domain Migration Guide](https://zeit.co/docs/v2/domains-and-aliases/zero-downtime-domain-migration/)
|
||||
|
||||
- [Vercel Custom Domains Documentation](https://vercel.com/docs/v2/custom-domains)
|
||||
|
||||
@@ -13,7 +13,7 @@ Wrap the `RegExp` part of your `source` as an un-named parameter.
|
||||
```js
|
||||
{
|
||||
source: '/feedback/(?!general)',
|
||||
destination: '/feedback/general'
|
||||
destination: '/api/feedback/general'
|
||||
}
|
||||
```
|
||||
|
||||
@@ -22,7 +22,27 @@ Wrap the `RegExp` part of your `source` as an un-named parameter.
|
||||
```js
|
||||
{
|
||||
source: '/feedback/((?!general).*)',
|
||||
destination: '/feedback/general'
|
||||
destination: '/api/feedback/general'
|
||||
}
|
||||
```
|
||||
|
||||
Ensure any segments used in the `destination` property are also used in the `source` property.
|
||||
|
||||
**Before**
|
||||
|
||||
```js
|
||||
{
|
||||
source: '/feedback/:type',
|
||||
destination: '/api/feedback/:id'
|
||||
}
|
||||
```
|
||||
|
||||
**After**
|
||||
|
||||
```js
|
||||
{
|
||||
source: '/feedback/:id',
|
||||
destination: '/api/feedback/:id'
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
@@ -8,4 +8,4 @@ The `--token` flag was specified, but its contents are invalid.
|
||||
|
||||
The `--token` flag must only contain numbers (0-9) and letters from the alphabet (a-z and A-Z). This needs to be the token of the user account as which you'd like to act.
|
||||
|
||||
You can either get the token from the `./now/auth.json` file located in your user directory or [from the dashboard](https://zeit.co/account/tokens).
|
||||
You can either get the token from the `./now/auth.json` file located in your user directory or [from the dashboard](https://vercel.com/account/tokens).
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
# Missing Environment Variables While Developing
|
||||
|
||||
#### Why This Error Occurred
|
||||
You ran `now dev` inside a project that contains a `now.json` file with `env` or `build.env` properties that use [Now Secrets](https://zeit.co/docs/v2/deployments/environment-variables-and-secrets).
|
||||
|
||||
You ran `now dev` inside a project that contains a `now.json` file with `env` or `build.env` properties that use [Now 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.
|
||||
|
||||
@@ -23,4 +24,4 @@ TEST=value
|
||||
|
||||
In the above example, `TEST` represents the name of the environment variable and `value` its value.
|
||||
|
||||
For more information on Environment Variables in development, [see the documentation](https://zeit.co/docs/v2/development/environment-variables/).
|
||||
For more information on Environment Variables in development, [see the documentation](https://vercel.com/docs/v2/build-step#environment-variables).
|
||||
|
||||
@@ -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://zeit.co/teams/zeit`, you would set `--scope` to `zeit`.
|
||||
As an example, if your team URL is `https://vercel.com/teams/zeit`, you would set `--scope` to `zeit`.
|
||||
|
||||
@@ -8,4 +8,4 @@ The `--token` 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 `--token` flag. This needs to be the token of the user account as which you'd like to act.
|
||||
|
||||
You can either get the token from the `./now/auth.json` file located in your user directory or [from the dashboard](https://zeit.co/account/tokens).
|
||||
You can either get the token from the `./now/auth.json` file located in your user directory or [from the dashboard](https://vercel.com/account/tokens).
|
||||
|
||||
@@ -6,5 +6,5 @@ You're running Now CLI in a non-terminal context and there are no credentials av
|
||||
|
||||
#### Possible Ways to Fix It
|
||||
|
||||
- Specify a value for the `--token` flag (this needs to be the token of the user account as which you'd like to act). You can either get the token from the `./now/auth.json` file located in your user directory or [from the dashboard](https://zeit.co/account/tokens).
|
||||
- Specify a value for the `--token` flag (this needs to be the token of the user account as which you'd like to act). You can either get the token from the `./now/auth.json` file located in your user directory or [from the dashboard](https://vercel.com/account/tokens).
|
||||
- Ensure that both `~/now/auth.json` and `~/now/config.json` exist
|
||||
|
||||
@@ -8,4 +8,4 @@ In turn, they would have to take the value of the `--token` flag into considerat
|
||||
|
||||
#### 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://zeit.co/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/teams/zeit`, the value can be `zeit`) or the username or ID of a user you'd like to act as.
|
||||
|
||||
@@ -27,7 +27,7 @@ Serverless:
|
||||
- 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.
|
||||
- No runtime dependencies, meaning smaller lambda functions
|
||||
- Optimized for fast [cold start](https://zeit.co/blog/serverless-ssr#cold-start)
|
||||
- Optimized for fast [cold start](https://vercel.com/blog/serverless-ssr#cold-start)
|
||||
|
||||
#### Possible Ways to Fix It
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ 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`
|
||||
(port) option to bind to the `$PORT` specified from the builder:
|
||||
|
||||
> *In Windows environments, reference the `PORT` environment variable with `%PORT%`*
|
||||
> _In Windows environments, reference the `PORT` environment variable with `%PORT%`_
|
||||
|
||||
```
|
||||
{
|
||||
@@ -34,7 +34,3 @@ For example, if you are using Gatsby, your `now-dev` script must use the `-p`
|
||||
Consult your static builder program's `--help` or documentation to figure out what
|
||||
the command line flag to bind to a specific port is (in many cases, it is one of:
|
||||
`-p` / `-P` / `--port`).
|
||||
|
||||
### Useful Links
|
||||
|
||||
- [`@now/static-build` Local Development Documentation](https://zeit.co/docs/v2/deployments/official-builders/static-build-now-static-build#local-development)
|
||||
|
||||
@@ -9,4 +9,4 @@ You tried to use `now scale` on a path alias (`now alias -r rules.json`).
|
||||
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>`.
|
||||
|
||||
Documentation for Path Aliases can be found [here](https://zeit.co/docs/features/path-aliases).
|
||||
Documentation for Path Aliases can be found [here](https://vercel.com/docs/features/path-aliases).
|
||||
|
||||
@@ -3,18 +3,18 @@
|
||||
## Why This Error Occurred
|
||||
|
||||
When generating a certificate, we have to prove ownership over the domain
|
||||
for the Certificate Authority (CA) that issues it. In the case of Wildcard Certificates,
|
||||
the requested challenge consists of adding TXT DNS records so, when the domain does not
|
||||
point to ZEIT World DNS, we cannot create the records to solve the challenge.
|
||||
for the Certificate Authority (CA) that issues it. In the case of Wildcard Certificates,
|
||||
the requested challenge consists of adding TXT DNS records so, when the domain does not
|
||||
point to Vercel DNS, we cannot create the records to solve the challenge.
|
||||
|
||||
## How to Fix It
|
||||
|
||||
To generate a certificate solving challenges manually, you must add the given `TXT` records with
|
||||
the appropriate name to your DNS. Then, after verifying that the CA can read the records,
|
||||
the appropriate name to your DNS. Then, after verifying that the CA can read the records,
|
||||
you can rerun the issuance command.
|
||||
|
||||
In case you want to start issuing a certificate to get the records you have to add or to
|
||||
In case you want to start issuing a certificate to get the records you have to add or to
|
||||
get those records again in the console, You can run the issuance command including the
|
||||
`--challenge-only` option. This way the CLI will output the challenges information and,
|
||||
after adding those records, you can rerun the command without `--challenge-only` to finish
|
||||
after adding those records, you can rerun the command without `--challenge-only` to finish
|
||||
issuance.
|
||||
|
||||
@@ -13,7 +13,7 @@ but it couldn't do so within the allotted time (defaults to 2 minutes).
|
||||
Instance verification is the process of ensuring that after
|
||||
your deployment is ready, we can actually run (instantiate) your code.
|
||||
|
||||
If you configured [regions or scale](https://zeit.co/docs/features/scaling),
|
||||
If you configured [regions or scale](https://vercel.com/docs/features/scaling),
|
||||
we ensure the minimums and maximums are met for the regions you enabled.
|
||||
|
||||
If you think your code is taking too long to instantiate, this can be due
|
||||
|
||||
18
examples/README.md
vendored
@@ -1,18 +1,18 @@
|
||||
# ZEIT Now Examples
|
||||
# Vercel Examples
|
||||
|
||||
This is the public list of examples for **ZEIT Now**.
|
||||
This is the public list of examples for **Vercel**.
|
||||
|
||||
All of these ready to deploy examples feature a frontend framework or static site, created with zero configuration using the CLI tools they provide.
|
||||
|
||||
The `+functions` examples feature an `/api` directory as well, highlighting how to use serverless functions on top of a framework, again with zero configuration required.
|
||||
|
||||
## What is ZEIT Now?
|
||||
## What is Vercel?
|
||||
|
||||
ZEIT Now is a cloud platform for static frontends and serverless functions. It enables developers to host websites and web applications that deploy instantly, scale automatically, and require no supervision.
|
||||
Vercel is a cloud platform for static frontends and serverless functions. It enables developers to host websites and web applications that deploy instantly, scale automatically, and require no supervision.
|
||||
|
||||
## What Does this Repository Contain?
|
||||
|
||||
This repository consists of multiple examples, created for use with the [ZEIT Now](https://zeit.co/now) platform. In addition to this, it also contains:
|
||||
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
|
||||
@@ -22,7 +22,7 @@ We recommend familiarizing yourself with the above sections, particularly if you
|
||||
|
||||
## Deploying Examples
|
||||
|
||||
To get started using any of these examples as your own project, [install Now](https://zeit.co/download) and use either of the following commands in your terminal:
|
||||
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:
|
||||
|
||||
```sh
|
||||
now init # Pick an example in the CLI
|
||||
@@ -54,9 +54,9 @@ For example, the previous `nodejs` example showed a static frontend with a Node.
|
||||
|
||||
## Migrating and Upgrading
|
||||
|
||||
If you have an existing project you would like to deploy with ZEIT Now, we recommend reading our guide on [migrating to Now and zero configuration](https://zeit.co/guides/migrate-to-zeit-now/). By combining the guide with this repository, you will quickly be able to understand how to deploy your application.
|
||||
If you have an existing project you would like to deploy with Vercel, we recommend reading our guide on [migrating to Vercel and zero configuration](https://vercel.com/guides/migrate-to-vercel). By combining the guide with this repository, you will quickly be able to understand how to deploy your application.
|
||||
|
||||
If you would like to upgrade a project to take advantage of zero configuration, you may find the [upgrade guide](https://zeit.co/guides/upgrade-to-zero-configuration/) useful. The upgrade guide covers how to remove configuration from existing projects along with how to use the `/api` directory.
|
||||
If you would like to upgrade a project to take advantage of zero configuration, you may find the [upgrade guide](https://vercel.com/guides/upgrade-to-zero-configuration) useful. The upgrade guide covers how to remove configuration from existing projects along with how to use the `/api` directory.
|
||||
|
||||
## How to Contribute
|
||||
|
||||
@@ -80,6 +80,6 @@ Now Examples is an open source project released under the [MIT License](https://
|
||||
|
||||
## 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 ZEIT 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/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.
|
||||
|
||||
[](https://github.com/zeit/now/discussions)
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
# AMP Example
|
||||
|
||||
This directory is a brief example of an [AMP](https://amp.dev/) site that can be deployed with ZEIT Now and zero configuration.
|
||||
This directory is a brief example of an [AMP](https://amp.dev/) site that can be deployed with Vercel and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own AMP project with ZEIT Now.
|
||||
Deploy your own AMP project with Vercel.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/amp)
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/amp)
|
||||
|
||||
_Live Example: https://amp.now-examples.now.sh_
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started deploying AMP with ZEIT Now, you can use the [Now CLI](https://zeit.co/download) to initialize the project:
|
||||
To get started deploying AMP with Vercel, you can use the [Now CLI](https://vercel.com/download) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ now init amp
|
||||
|
||||
@@ -2,13 +2,13 @@
|
||||
|
||||
# Angular Example
|
||||
|
||||
This directory is a brief example of an [Angular](https://angular.io/) app that can be deployed with ZEIT Now and zero configuration.
|
||||
This directory is a brief example of an [Angular](https://angular.io/) app that can be deployed with Vercel and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own Angular project with ZEIT Now.
|
||||
Deploy your own Angular project with Vercel.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/angular)
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/angular)
|
||||
|
||||
_Live Example: https://angular.now-examples.now.sh_
|
||||
|
||||
@@ -22,7 +22,7 @@ $ ng new
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
You can deploy your new Angular project with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
You can deploy your new Angular project with a single command from your terminal using [Now CLI](https://vercel.com/download):
|
||||
|
||||
```shell
|
||||
$ now
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
# Brunch Example
|
||||
|
||||
This directory is a brief example of a [Brunch](https://brunch.io/) site that can be deployed with ZEIT Now and zero configuration.
|
||||
This directory is a brief example of a [Brunch](https://brunch.io/) site that can be deployed with Vercel and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own Brunch project with ZEIT Now.
|
||||
Deploy your own Brunch project with Vercel.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/brunch)
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/brunch)
|
||||
|
||||
_Live Example: https://brunch.now-examples.now.sh_
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started deploying Brunch with ZEIT Now, you can use the [Brunch CLI](https://brunch.io/docs/commands) to initialize the project:
|
||||
To get started deploying Brunch with Vercel, you can use the [Brunch CLI](https://brunch.io/docs/commands) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ brunch new project-name -s es6
|
||||
@@ -20,7 +20,7 @@ $ brunch new project-name -s es6
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
You can deploy your new Brunch project with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
You can deploy your new Brunch project with a single command from your terminal using [Now CLI](https://vercel.com/download):
|
||||
|
||||
```shell
|
||||
$ now
|
||||
|
||||
@@ -12,6 +12,6 @@
|
||||
<div class="brunch">
|
||||
<img src="/brunch-napkin.svg" alt="Brunch">
|
||||
<h4>Bon Appétit.</h4>
|
||||
<h6>A <a href="http://brunch.io" target="_blank">Brunch</a> website deployed on <a href="https://zeit.co" target="_blank">ZEIT Now</a></h6>
|
||||
<h6>A <a href="http://brunch.io" target="_blank">Brunch</a> website deployed on <a href="https://vercel.com" target="_blank">Vercel</a></h6>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
|
||||
# React Example
|
||||
|
||||
This directory is a brief example of a [React](https://reactjs.org/) app with [Serverless Functions](https://zeit.co/docs/v2/serverless-functions/introduction) that can be deployed with ZEIT Now and zero configuration.
|
||||
This directory is a brief example of a [React](https://reactjs.org/) app with [Serverless Functions](https://vercel.com/docs/v2/serverless-functions/introduction) that can be deployed with Vercel and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own React project, along with Serverless Functions, with ZEIT Now.
|
||||
Deploy your own React project, along with Serverless Functions, with Vercel.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/create-react-app-functions)
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/create-react-app-functions)
|
||||
|
||||
_Live Example: https://create-react-app.now-examples.now.sh/_
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with React, along with [Serverless Functions](https://zeit.co/docs/v2/serverless-functions/introduction), with ZEIT Now, you can use the [Create-React-App CLI](https://reactjs.org/docs/create-a-new-react-app.html#create-react-app) to initialize the project:
|
||||
To get started with React, along with [Serverless Functions](https://vercel.com/docs/v2/serverless-functions/introduction), with Vercel, you can use the [Create-React-App CLI](https://reactjs.org/docs/create-a-new-react-app.html#create-react-app) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ npx create-react-app my-app
|
||||
@@ -22,7 +22,7 @@ $ npx create-react-app my-app
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
You can deploy your new React project, along with [Serverless Functions](https://zeit.co/docs/v2/serverless-functions/introduction), with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
You can deploy your new React project, along with [Serverless Functions](https://vercel.com/docs/v2/serverless-functions/introduction), with a single command from your terminal using [Now CLI](https://vercel.com/download):
|
||||
|
||||
```shell
|
||||
$ now
|
||||
|
||||
@@ -18,11 +18,11 @@ function App() {
|
||||
<h2>
|
||||
Deployed with{' '}
|
||||
<a
|
||||
href="https://zeit.co/docs"
|
||||
href="https://vercel.com/docs"
|
||||
target="_blank"
|
||||
rel="noreferrer noopener"
|
||||
>
|
||||
ZEIT Now
|
||||
Vercel
|
||||
</a>
|
||||
!
|
||||
</h2>
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
# Custom Build Example
|
||||
|
||||
This directory is a brief example of using a Custom Build script that can be deployed with ZEIT Now and zero configuration.
|
||||
This directory is a brief example of using a Custom Build script that can be deployed with Vercel and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own Custom Built project with ZEIT Now.
|
||||
Deploy your own Custom Built project with Vercel.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/custom-build)
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/custom-build)
|
||||
|
||||
_Live Example: https://custom-build.now-examples.now.sh_
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started deploying a Custom Built project with ZEIT Now, you can use the [Now CLI](https://zeit.co/download) to initialize the project:
|
||||
To get started deploying a Custom Built project with Vercel, you can use the [Now CLI](https://vercel.com/download) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ now init custom-build
|
||||
@@ -20,7 +20,7 @@ $ now init custom-build
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
You can deploy your new Custom Built project with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
You can deploy your new Custom Built project with a single command from your terminal using [Now CLI](https://vercel.com/download):
|
||||
|
||||
```shell
|
||||
$ now
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
|
||||
# Docusaurus Example
|
||||
|
||||
This directory is a brief example of a [Docusaurus](https://docusaurus.io/) site that can be deployed with ZEIT Now and zero configuration.
|
||||
This directory is a brief example of a [Docusaurus](https://docusaurus.io/) site that can be deployed with Vercel and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own Docusaurus project with ZEIT Now.
|
||||
Deploy your own Docusaurus project with Vercel.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/docusaurus)
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/docusaurus)
|
||||
|
||||
_Live Example: https://docusaurus.now-examples.now.sh_
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with Docusaurus for deployment with ZEIT Now, you can use the [Docusaurus CLI](https://docusaurus.io/docs/en/installation) to initialize the project:
|
||||
To get started with Docusaurus for deployment with Vercel, you can use the [Docusaurus CLI](https://docusaurus.io/docs/en/installation) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ docusaurus-init
|
||||
@@ -22,7 +22,7 @@ $ docusaurus-init
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
You can deploy your new Docusaurus project with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
You can deploy your new Docusaurus project with a single command from your terminal using [Now CLI](https://vercel.com/download):
|
||||
|
||||
```shell
|
||||
$ now
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
# Dojo Example
|
||||
|
||||
This directory is a brief example of a [Dojo](https://dojo.io) site that can be deployed with ZEIT Now and zero configuration.
|
||||
This directory is a brief example of a [Dojo](https://dojo.io) site that can be deployed with Vercel and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own Dojo project with ZEIT Now.
|
||||
Deploy your own Dojo project with Vercel.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now-examples/tree/master/dojo)
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now-examples/tree/master/dojo)
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with Dojo on Now, you can use the [Dojo CLI](https://github.com/dojo/cli) to initialize the project:
|
||||
To get started with Dojo on Vercel, you can use the [Dojo CLI](https://github.com/dojo/cli) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ now init dojo
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
|
||||
# Eleventy Example
|
||||
|
||||
This directory is a brief example of a [Eleventy](https://www.11ty.io/) site that can be deployed with ZEIT Now and zero configuration.
|
||||
This directory is a brief example of a [Eleventy](https://www.11ty.io/) site that can be deployed with Vercel and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own Eleventy project with ZEIT Now.
|
||||
Deploy your own Eleventy project with Vercel.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/eleventy)
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/eleventy)
|
||||
|
||||
_Live Example: https://eleventy.now-examples.now.sh_
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with Eleventy for deployment with ZEIT Now, you can use [npx](https://www.npmjs.com/package/npx) to initialize the project:
|
||||
To get started with Eleventy for deployment with Vercel, you can use [npx](https://www.npmjs.com/package/npx) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ npx degit 11ty/eleventy-base-blog my-11ty-project
|
||||
@@ -22,7 +22,7 @@ $ npx degit 11ty/eleventy-base-blog my-11ty-project
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
You can deploy your new Eleventy project with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
You can deploy your new Eleventy project with a single command from your terminal using [Now CLI](https://vercel.com/download):
|
||||
|
||||
```shell
|
||||
$ now
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
|
||||
# Ember Example
|
||||
|
||||
This directory is a brief example of an [Ember](https://emberjs.com/) app that can be deployed with ZEIT Now and zero configuration.
|
||||
This directory is a brief example of an [Ember](https://emberjs.com/) app that can be deployed with Vercel and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own Ember project with ZEIT Now.
|
||||
Deploy your own Ember project with Vercel.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/ember)
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/ember)
|
||||
|
||||
_Live Example: https://ember.now-examples.now.sh_
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with Ember for deployment with ZEIT Now, you can use the [Ember CLI](https://ember-cli.com/) to initialize the project:
|
||||
To get started with Ember for deployment with Vercel, you can use the [Ember CLI](https://ember-cli.com/) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ npx ember-cli new ember-project
|
||||
@@ -22,7 +22,7 @@ $ npx ember-cli new ember-project
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
You can deploy your new Ember project with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
You can deploy your new Ember project with a single command from your terminal using [Now CLI](https://vercel.com/download):
|
||||
|
||||
```shell
|
||||
$ now
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
|
||||
# Gatsby Example
|
||||
|
||||
This directory is a brief example of a [Gatsby](https://www.gatsbyjs.org/) app with [Serverless Functions](https://zeit.co/docs/v2/serverless-functions/introduction) that can be deployed with ZEIT Now and zero configuration.
|
||||
This directory is a brief example of a [Gatsby](https://www.gatsbyjs.org/) app with [Serverless Functions](https://vercel.com/docs/v2/serverless-functions/introduction) that can be deployed with Vercel and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own Gatsby project, along with Serverless Functions, with ZEIT Now.
|
||||
Deploy your own Gatsby project, along with Serverless Functions, with Vercel.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/gatsby)
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/gatsby)
|
||||
|
||||
_Live Example: https://gatsby.now-examples.now.sh_
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with Gatsby on Now, you can use the [Gatsby CLI](https://www.gatsbyjs.org/docs/gatsby-cli/) to initialize the project:
|
||||
To get started with Gatsby on Vercel, you can use the [Gatsby CLI](https://www.gatsbyjs.org/docs/gatsby-cli/) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ gatsby new gatsby-site
|
||||
@@ -22,7 +22,7 @@ $ gatsby new gatsby-site
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
You can deploy your new Gatsby project, along with [Serverless Functions](https://zeit.co/docs/v2/serverless-functions/introduction), with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
You can deploy your new Gatsby project, along with [Serverless Functions](https://vercel.com/docs/v2/serverless-functions/introduction), with a single command from your terminal using [Now CLI](https://vercel.com/download):
|
||||
|
||||
```shell
|
||||
$ now
|
||||
|
||||
@@ -8,7 +8,7 @@ module.exports = {
|
||||
resolve: `gatsby-plugin-manifest`,
|
||||
options: {
|
||||
name: 'Gatsby + Node.js (TypeScript) API',
|
||||
short_name: 'Gatbsy + Node.js (TypeScript)',
|
||||
short_name: 'Gatsby + Node.js (TypeScript)',
|
||||
start_url: '/',
|
||||
icon: 'src/images/gatsby-icon.png',
|
||||
},
|
||||
|
||||
@@ -21,11 +21,11 @@ function Index() {
|
||||
<h2>
|
||||
Deployed with{' '}
|
||||
<a
|
||||
href="https://zeit.co/docs"
|
||||
href="https://vercel.com/docs"
|
||||
target="_blank"
|
||||
rel="noreferrer noopener"
|
||||
>
|
||||
ZEIT Now
|
||||
Vercel
|
||||
</a>
|
||||
!
|
||||
</h2>
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
|
||||
# Gridsome Example
|
||||
|
||||
This directory is a brief example of a [Gridsome](https://gridsome.org/) app that can be deployed with ZEIT Now and zero configuration.
|
||||
This directory is a brief example of a [Gridsome](https://gridsome.org/) app that can be deployed with Vercel and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own Gridsome project with ZEIT Now.
|
||||
Deploy your own Gridsome project with Vercel.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/gridsome)
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/gridsome)
|
||||
|
||||
_Live Example: https://gridsome.now-examples.now.sh_
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with Gridsome for deployment with ZEIT Now, you can use the [Gridsome CLI](https://gridsome.org/docs/gridsome-cli/) to initialize the project:
|
||||
To get started with Gridsome for deployment with Vercel, you can use the [Gridsome CLI](https://gridsome.org/docs/gridsome-cli/) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ gridsome create my-website
|
||||
@@ -22,7 +22,7 @@ $ gridsome create my-website
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
You can deploy your new Gridsome project with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
You can deploy your new Gridsome project with a single command from your terminal using [Now CLI](https://vercel.com/download):
|
||||
|
||||
```shell
|
||||
$ now
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
|
||||
# Hexo Example
|
||||
|
||||
This directory is a brief example of a [Hexo](https://hexo.io/) site that can be deployed with ZEIT Now and zero configuration.
|
||||
This directory is a brief example of a [Hexo](https://hexo.io/) site that can be deployed with Vercel and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own Hexo project with ZEIT Now.
|
||||
Deploy your own Hexo project with Vercel.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/hexo)
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/hexo)
|
||||
|
||||
_Live Example: https://hexo.now-examples.now.sh_
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with Hexo for deployment with ZEIT Now, you can use the [Hexo CLI](https://hexo.io/docs/index.html#Installation) to initialize the project:
|
||||
To get started with Hexo for deployment with Vercel, you can use the [Hexo CLI](https://hexo.io/docs/index.html#Installation) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ hexo init project-name
|
||||
@@ -22,7 +22,7 @@ $ hexo init project-name
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
You can deploy your new Hexo project with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
You can deploy your new Hexo project with a single command from your terminal using [Now CLI](https://vercel.com/download):
|
||||
|
||||
```shell
|
||||
$ now
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
# Hugo Example
|
||||
|
||||
This directory is a brief example of a [Hugo](https://gohugo.io/) app that can be deployed with ZEIT Now and zero configuration.
|
||||
This directory is a brief example of a [Hugo](https://gohugo.io/) app that can be deployed with Vercel and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own Hugo project with ZEIT Now.
|
||||
Deploy your own Hugo project with Vercel.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/hugo)
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/hugo)
|
||||
|
||||
_Live Example: https://hugo.now-examples.now.sh_
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with Hugo for deployment with ZEIT Now, you can use the [Hugo CLI](https://gohugo.io/commands/) to initialize the project:
|
||||
To get started with Hugo for deployment with Vercel, you can use the [Hugo CLI](https://gohugo.io/commands/) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ hugo new site project-name
|
||||
@@ -20,7 +20,7 @@ $ hugo new site project-name
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
You can deploy your new Hugo project with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
You can deploy your new Hugo project with a single command from your terminal using [Now CLI](https://vercel.com/download):
|
||||
|
||||
```shell
|
||||
$ now
|
||||
|
||||
@@ -4,4 +4,4 @@ date: 2019-07-18T17:18:05+01:00
|
||||
draft: false
|
||||
---
|
||||
|
||||
# Hugo on ZEIT Now
|
||||
# Hugo on Vercel
|
||||
|
||||
BIN
examples/ionic-react/public/assets/icon/favicon.png
Normal file
|
After Width: | Height: | Size: 930 B |
BIN
examples/ionic-react/public/assets/icon/icon.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
1
examples/ionic-react/public/assets/shapes.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg width="350" height="140" xmlns="http://www.w3.org/2000/svg" style="background:#f6f7f9"><g fill="none" fill-rule="evenodd"><path fill="#F04141" style="mix-blend-mode:multiply" d="M61.905-34.23l96.194 54.51-66.982 54.512L22 34.887z"/><circle fill="#10DC60" style="mix-blend-mode:multiply" cx="155.5" cy="135.5" r="57.5"/><path fill="#3880FF" style="mix-blend-mode:multiply" d="M208.538 9.513l84.417 15.392L223.93 93.93z"/><path fill="#FFCE00" style="mix-blend-mode:multiply" d="M268.625 106.557l46.332-26.75 46.332 26.75v53.5l-46.332 26.75-46.332-26.75z"/><circle fill="#7044FF" style="mix-blend-mode:multiply" cx="299.5" cy="9.5" r="38.5"/><rect fill="#11D3EA" style="mix-blend-mode:multiply" transform="rotate(-60 148.47 37.886)" x="143.372" y="-7.056" width="10.196" height="89.884" rx="5.098"/><path d="M-25.389 74.253l84.86 8.107c5.498.525 9.53 5.407 9.004 10.905a10 10 0 0 1-.057.477l-12.36 85.671a10.002 10.002 0 0 1-11.634 8.42l-86.351-15.226c-5.44-.959-9.07-6.145-8.112-11.584l13.851-78.551a10 10 0 0 1 10.799-8.219z" fill="#7044FF" style="mix-blend-mode:multiply"/><circle fill="#0CD1E8" style="mix-blend-mode:multiply" cx="273.5" cy="106.5" r="20.5"/></g></svg>
|
||||
|
After Width: | Height: | Size: 1.1 KiB |
30
examples/ionic-react/public/index.html
Normal file
@@ -0,0 +1,30 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<title>Ionic App</title>
|
||||
|
||||
<base href="/" />
|
||||
|
||||
<meta
|
||||
name="viewport"
|
||||
content="viewport-fit=cover, width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no"
|
||||
/>
|
||||
<meta name="format-detection" content="telephone=no" />
|
||||
<meta name="msapplication-tap-highlight" content="no" />
|
||||
|
||||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
|
||||
|
||||
<link rel="shortcut icon" type="image/png" href="%PUBLIC_URL%/assets/icon/favicon.png" />
|
||||
|
||||
<!-- add to homescreen for ios -->
|
||||
<meta name="apple-mobile-web-app-capable" content="yes" />
|
||||
<meta name="apple-mobile-web-app-title" content="Ionic App" />
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
21
examples/ionic-react/public/manifest.json
Normal file
@@ -0,0 +1,21 @@
|
||||
{
|
||||
"short_name": "Ionic App",
|
||||
"name": "My Ionic App",
|
||||
"icons": [
|
||||
{
|
||||
"src": "assets/icon/favicon.png",
|
||||
"sizes": "64x64 32x32 24x24 16x16",
|
||||
"type": "image/x-icon"
|
||||
},
|
||||
{
|
||||
"src": "assets/icon/icon.png",
|
||||
"type": "image/png",
|
||||
"sizes": "512x512",
|
||||
"purpose": "maskable"
|
||||
}
|
||||
],
|
||||
"start_url": ".",
|
||||
"display": "standalone",
|
||||
"theme_color": "#ffffff",
|
||||
"background_color": "#ffffff"
|
||||
}
|
||||
@@ -1,18 +1,18 @@
|
||||
# Ionic React Example
|
||||
|
||||
This directory is a brief example of an [Ionic React](https://ionicframework.com/docs/react/overview) app that can be deployed with ZEIT Now and zero configuration
|
||||
This directory is a brief example of an [Ionic React](https://ionicframework.com/docs/react/overview) app that can be deployed with Vercel and zero configuration
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own Ionic React project with ZEIT Now.
|
||||
Deploy your own Ionic React project with Vercel.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/ionic-react)
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/ionic-react)
|
||||
|
||||
_Live Example: https://ionic-react.now-examples.now.sh_
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with Ionic React deployed with ZEIT Now, you can use the [Ionic CLI](https://ionicframework.com/docs/cli) to initialize the project:
|
||||
To get started with Ionic React deployed with Vercel, you can use the [Ionic CLI](https://ionicframework.com/docs/cli) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ npx ionic start [project-name] conference --type react && cd [project-name]
|
||||
@@ -20,7 +20,7 @@ $ npx ionic start [project-name] conference --type react && cd [project-name]
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
You can deploy your new Ionic React project with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
You can deploy your new Ionic React project with a single command from your terminal using [Now CLI](https://vercel.com/download):
|
||||
|
||||
```shell
|
||||
$ now
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
# Jekyll Example
|
||||
|
||||
This directory is a brief example of a [Jekyll](https://jekyllrb.com/) site that can be deployed with ZEIT Now and zero configuration.
|
||||
This directory is a brief example of a [Jekyll](https://jekyllrb.com/) site that can be deployed with Vercel and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own Jekyll project with ZEIT Now.
|
||||
Deploy your own Jekyll project with Vercel.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/jekyll)
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/jekyll)
|
||||
|
||||
_Live Example: https://jekyll.now-examples.now.sh_
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with Jekyll for deployment with ZEIT Now, you can use the [Jekyll CLI](https://jekyllrb.com/docs/usage/) to initialize the project:
|
||||
To get started with Jekyll for deployment with Vercel, you can use the [Jekyll CLI](https://jekyllrb.com/docs/usage/) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ jekyll new my-blog
|
||||
@@ -20,7 +20,7 @@ $ jekyll new my-blog
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
You can deploy your new Jekyll project with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
You can deploy your new Jekyll project with a single command from your terminal using [Now CLI](https://vercel.com/download):
|
||||
|
||||
```shell
|
||||
$ now
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
# Middleman Example
|
||||
|
||||
This directory is a brief example of a [Middleman](https://middlemanapp.com/) site that can be deployed with ZEIT Now and zero configuration.
|
||||
This directory is a brief example of a [Middleman](https://middlemanapp.com/) site that can be deployed with Vercel and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own Middleman project with ZEIT Now.
|
||||
Deploy your own Middleman project with Vercel.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/middleman)
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/middleman)
|
||||
|
||||
_Live Example: https://middleman.now-examples.now.sh_
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with Middleman for deployment with ZEIT Now, you can use the [Middleman CLI](https://middlemanapp.com/basics/start-new-site/) to initialize the project:
|
||||
To get started with Middleman for deployment with Vercel, you can use the [Middleman CLI](https://middlemanapp.com/basics/start-new-site/) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ middleman init project-name
|
||||
@@ -20,7 +20,7 @@ $ middleman init project-name
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
You can deploy your new Middleman project with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
You can deploy your new Middleman project with a single command from your terminal using [Now CLI](https://vercel.com/download):
|
||||
|
||||
```shell
|
||||
$ now
|
||||
|
||||
@@ -21,10 +21,10 @@ To learn more about Next.js, take a look at the following resources:
|
||||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
|
||||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
|
||||
|
||||
You can check out [the Next.js GitHub repository](https://github.com/zeit/next.js/) - your feedback and contributions are welcome!
|
||||
You can check out [the Next.js GitHub repository](https://github.com/zeit/next.js) - your feedback and contributions are welcome!
|
||||
|
||||
## Deploy on ZEIT Now
|
||||
## Deploy on Vercel
|
||||
|
||||
The easiest way to deploy your Next.js app is to use the [ZEIT Now Platform](https://zeit.co/import?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
|
||||
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/import?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
|
||||
|
||||
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
|
||||
|
||||
@@ -8,8 +8,8 @@
|
||||
"start": "next start"
|
||||
},
|
||||
"dependencies": {
|
||||
"next": "9.2.2",
|
||||
"react": "16.13.0",
|
||||
"react-dom": "16.13.0"
|
||||
"next": "^9.3.3",
|
||||
"react": "^16.13.0",
|
||||
"react-dom": "^16.13.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,12 +36,12 @@ const Home = () => (
|
||||
</a>
|
||||
|
||||
<a
|
||||
href="https://zeit.co/new?filter=next.js&utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
|
||||
href="https://vercel.com/new?filter=next.js&utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
|
||||
className="card"
|
||||
>
|
||||
<h3>Deploy →</h3>
|
||||
<p>
|
||||
Instantly deploy your Next.js site to a public URL with ZEIT Now.
|
||||
Instantly deploy your Next.js site to a public URL with Vercel.
|
||||
</p>
|
||||
</a>
|
||||
</div>
|
||||
@@ -49,11 +49,11 @@ const Home = () => (
|
||||
|
||||
<footer>
|
||||
<a
|
||||
href="https://zeit.co?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
|
||||
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
Powered by <img src="/zeit.svg" alt="ZEIT Logo" />
|
||||
Powered by <img src="/vercel.svg" alt="Vercel Logo" />
|
||||
</a>
|
||||
</footer>
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 794 B After Width: | Height: | Size: 794 B |
@@ -1,18 +1,18 @@
|
||||
# Nuxt.js Example
|
||||
|
||||
This directory is a brief example of a [Nuxt.js](https://nuxtjs.org) app that can be deployed with ZEIT Now and zero configuration.
|
||||
This directory is a brief example of a [Nuxt.js](https://nuxtjs.org) app that can be deployed with Vercel and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own Nuxt.js project with ZEIT Now.
|
||||
Deploy your own Nuxt.js project with Vercel.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/nuxtjs)
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/nuxtjs)
|
||||
|
||||
_Live Example: https://nuxtjs.now-examples.now.sh_
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with Nuxt.js deployed with ZEIT Now, you can use the [Create-Nuxt-App CLI](https://www.npmjs.com/package/create-nuxt-app) to initialize the project:
|
||||
To get started with Nuxt.js deployed with Vercel, you can use the [Create-Nuxt-App CLI](https://www.npmjs.com/package/create-nuxt-app) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ npx create-nuxt-app my-app
|
||||
@@ -22,7 +22,7 @@ $ npx create-nuxt-app my-app
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
You can deploy your new Nuxt.js project with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
You can deploy your new Nuxt.js project with a single command from your terminal using [Now CLI](https://vercel.com/download):
|
||||
|
||||
```shell
|
||||
$ now
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
|
||||
# Polymer Example
|
||||
|
||||
This directory is a brief example of a [Polymer](https://www.polymer-project.org/) app that can be deployed with ZEIT Now and zero configuration.
|
||||
This directory is a brief example of a [Polymer](https://www.polymer-project.org/) app that can be deployed with Vercel and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own Polymer project with ZEIT Now.
|
||||
Deploy your own Polymer project with Vercel.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/polymer)
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/polymer)
|
||||
|
||||
_Live Example: https://polymer.now-examples.now.sh_
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with Polymer deployed with ZEIT Now, you can use the [Polymer CLI](https://polymer-library.polymer-project.org/3.0/docs/tools/polymer-cli) to initialize the project:
|
||||
To get started with Polymer deployed with Vercel, you can use the [Polymer CLI](https://polymer-library.polymer-project.org/3.0/docs/tools/polymer-cli) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ polymer init
|
||||
@@ -22,7 +22,7 @@ $ polymer init
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
You can deploy your new Polymer project with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
You can deploy your new Polymer project with a single command from your terminal using [Now CLI](https://vercel.com/download):
|
||||
|
||||
```shell
|
||||
$ now
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
|
||||
# Preact Example
|
||||
|
||||
This directory is a brief example of a [Preact](https://preactjs.com/) app that can be deployed with ZEIT Now and zero configuration.
|
||||
This directory is a brief example of a [Preact](https://preactjs.com/) app that can be deployed with Vercel and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own Preact project with ZEIT Now.
|
||||
Deploy your own Preact project with Vercel.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/preact)
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/preact)
|
||||
|
||||
_Live Example: https://preact.now-examples.now.sh_
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with Preact for deployment with ZEIT Now, you can use the [Preact CLI](https://github.com/preactjs/preact-cli) to initialize the project:
|
||||
To get started with Preact for deployment with Vercel, you can use the [Preact CLI](https://github.com/preactjs/preact-cli) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ preact create default my-project
|
||||
@@ -22,7 +22,7 @@ $ preact create default my-project
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
You can deploy your new Preact project with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
You can deploy your new Preact project with a single command from your terminal using [Now CLI](https://vercel.com/download):
|
||||
|
||||
```shell
|
||||
$ now
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
|
||||
# Saber Example
|
||||
|
||||
This directory is a brief example of a [Saber](https://saber.land) site that can be deployed to ZEIT Now with zero configuration.
|
||||
This directory is a brief example of a [Saber](https://saber.land) site that can be deployed to Vercel with zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own Saber project with ZEIT Now.
|
||||
Deploy your own Saber project with Vercel.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/saber)
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/saber)
|
||||
|
||||
_Live Example: https://saber.now-examples.now.sh_
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with Saber on Now, you can use [`npm init`](https://docs.npmjs.com/cli/init) to initialize the project:
|
||||
To get started with Saber on Vercel, you can use [`npm init`](https://docs.npmjs.com/cli/init) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ npm init site my-saber-site
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
# Sapper Example
|
||||
|
||||
This directory is a brief example of a [Sapper](https://sapper.svelte.dev/) app that can be deployed with ZEIT Now and zero configuration.
|
||||
This directory is a brief example of a [Sapper](https://sapper.svelte.dev/) app that can be deployed with Vercel and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own Sapper project with ZEIT Now.
|
||||
Deploy your own Sapper project with Vercel.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/sapper)
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/sapper)
|
||||
|
||||
_Live Example: https://sapper.now-examples.now.sh_
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with Sapper deployed with ZEIT Now, you can use [degit](https://github.com/Rich-Harris/degit) to initialize the project:
|
||||
To get started with Sapper deployed with Vercel, you can use [degit](https://github.com/Rich-Harris/degit) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ npx degit "sveltejs/sapper-template#webpack" my-sapper-app
|
||||
@@ -22,7 +22,7 @@ $ npx degit "sveltejs/sapper-template#webpack" my-sapper-app
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
You can deploy your new Sapper project with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
You can deploy your new Sapper project with a single command from your terminal using [Now CLI](https://vercel.com/download):
|
||||
|
||||
```shell
|
||||
$ now
|
||||
|
||||
@@ -65,7 +65,7 @@ const posts = [
|
||||
title: 'How is Sapper different from Next.js?',
|
||||
slug: 'how-is-sapper-different-from-next',
|
||||
html: `
|
||||
<p><a href='https://github.com/zeit/next.js'>Next.js</a> is a React framework from <a href='https://zeit.co'>Zeit</a>, and is the inspiration for Sapper. There are a few notable differences, however:</p>
|
||||
<p><a href='https://github.com/zeit/next.js'>Next.js</a> is a React framework from <a href='https://vercel.com'>Zeit</a>, and is the inspiration for Sapper. There are a few notable differences, however:</p>
|
||||
|
||||
<ul>
|
||||
<li>It's powered by <a href='https://svelte.dev'>Svelte</a> instead of React, so it's faster and your apps are smaller</li>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Scully on ZEIT Now</title>
|
||||
<title>Scully on Vercel</title>
|
||||
<base href="/">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="icon" type="image/x-icon" href="favicon.ico">
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
# Stencil Example
|
||||
|
||||
This directory is a brief example of a [Stencil](https://stenciljs.com/) app that can be deployed with ZEIT Now and zero configuration
|
||||
This directory is a brief example of a [Stencil](https://stenciljs.com/) app that can be deployed with Vercel and zero configuration
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own Stencil project with ZEIT Now.
|
||||
Deploy your own Stencil project with Vercel.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/stencil)
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/stencil)
|
||||
|
||||
_Live Example: https://stencil.now-examples.now.sh_
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with Stencil deployed with ZEIT Now, you can use the [Stencil project initializer](https://stenciljs.com/docs/getting-started#starting-a-new-project) to initialize the project:
|
||||
To get started with Stencil deployed with Vercel, you can use the [Stencil project initializer](https://stenciljs.com/docs/getting-started#starting-a-new-project) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ npm init stencil
|
||||
@@ -20,7 +20,7 @@ $ npm init stencil
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
You can deploy your new Stencil project with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
You can deploy your new Stencil project with a single command from your terminal using [Now CLI](https://vercel.com/download):
|
||||
|
||||
```shell
|
||||
$ now
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
# Svelte Example
|
||||
|
||||
This directory is a brief example of a [Svelte](https://svelte.dev/) app with [Serverless Functions](https://zeit.co/docs/v2/serverless-functions/introduction) that can be deployed with ZEIT Now and zero configuration.
|
||||
This directory is a brief example of a [Svelte](https://svelte.dev/) app with [Serverless Functions](https://vercel.com/docs/v2/serverless-functions/introduction) that can be deployed with Vercel and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own Svelte project, along with Serverless Functions, with ZEIT Now.
|
||||
Deploy your own Svelte project, along with Serverless Functions, with Vercel.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/svelte)
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/svelte)
|
||||
|
||||
_Live Example: https://svelte.now-examples.now.sh_
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with Svelte, along with [Serverless Functions](https://zeit.co/docs/v2/serverless-functions/introduction), deployed with ZEIT Now, you can use [degit](https://github.com/Rich-Harris/degit) to initialize the project:
|
||||
To get started with Svelte, along with [Serverless Functions](https://vercel.com/docs/v2/serverless-functions/introduction), deployed with Vercel, you can use [degit](https://github.com/Rich-Harris/degit) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ npx degit sveltejs/template my-svelte-project
|
||||
@@ -20,7 +20,7 @@ $ npx degit sveltejs/template my-svelte-project
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
You can deploy your new Svelte project, along with [Serverless Functions](https://zeit.co/docs/v2/serverless-functions/introduction), with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
You can deploy your new Svelte project, along with [Serverless Functions](https://vercel.com/docs/v2/serverless-functions/introduction), with a single command from your terminal using [Now CLI](https://vercel.com/download):
|
||||
|
||||
```shell
|
||||
$ now
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
<h1>Svelte + Node.js API</h1>
|
||||
<h2>
|
||||
Deployed with
|
||||
<a href="https://zeit.co/docs" target="_blank" rel="noreferrer noopener">
|
||||
ZEIT Now
|
||||
<a href="https://vercel.com/docs" target="_blank" rel="noreferrer noopener">
|
||||
Vercel
|
||||
</a>
|
||||
!
|
||||
</h2>
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
|
||||
# UmiJS Example
|
||||
|
||||
This directory is a brief example of a [UmiJS](https://umijs.org/) app that can be deployed with ZEIT Now and zero configuration.
|
||||
This directory is a brief example of a [UmiJS](https://umijs.org/) app that can be deployed with Vercel and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own UmiJS project with ZEIT Now.
|
||||
Deploy your own UmiJS project with Vercel.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/umijs)
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/umijs)
|
||||
|
||||
_Live Example: https://umijs.now-examples.now.sh_
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with UmiJS deployed with ZEIT Now, you can use the [Umi CLI](https://github.com/umijs/create-umi) to initialize the project:
|
||||
To get started with UmiJS deployed with Vercel, you can use the [Umi CLI](https://github.com/umijs/create-umi) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ yarn create umi app-name
|
||||
@@ -22,7 +22,7 @@ $ yarn create umi app-name
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
You can deploy your new UmiJS project with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
You can deploy your new UmiJS project with a single command from your terminal using [Now CLI](https://vercel.com/download):
|
||||
|
||||
```shell
|
||||
$ now
|
||||
|
||||
@@ -4,7 +4,7 @@ This directory is a realtime serverless whiteboard powered by Pusher. The fronte
|
||||
|
||||
## Creating This Example
|
||||
|
||||
To get started with a realtime whiteboard on Now, you can use [Now CLI](https://zeit.co/download) to initialize the project:
|
||||
To get started with a realtime whiteboard on Vercel, you can use [Now CLI](https://vercel.com/download) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ now init vanilla-pusher-functions
|
||||
|
||||
@@ -2,19 +2,19 @@
|
||||
|
||||
# Vue.js Example
|
||||
|
||||
This directory is a brief example of a [Vue.js](https://vuejs.org/) app that can be deployed with ZEIT Now and zero configuration.
|
||||
This directory is a brief example of a [Vue.js](https://vuejs.org/) app that can be deployed with Vercel and zero configuration.
|
||||
|
||||
## Deploy Your Own
|
||||
|
||||
Deploy your own Vue.js project with ZEIT Now.
|
||||
Deploy your own Vue.js project with Vercel.
|
||||
|
||||
[](https://zeit.co/import/project?template=https://github.com/zeit/now/tree/master/examples/vue)
|
||||
[](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/vue)
|
||||
|
||||
_Live Example: https://vue.now-examples.now.sh_
|
||||
|
||||
### How We Created This Example
|
||||
|
||||
To get started with Vue.js deployed with ZEIT Now, you can use the [Vue CLI](https://cli.vuejs.org/guide/creating-a-project.html#vue-create) to initialize the project:
|
||||
To get started with Vue.js deployed with Vercel, you can use the [Vue CLI](https://cli.vuejs.org/guide/creating-a-project.html#vue-create) to initialize the project:
|
||||
|
||||
```shell
|
||||
$ vue create
|
||||
@@ -22,7 +22,7 @@ $ vue create
|
||||
|
||||
### Deploying From Your Terminal
|
||||
|
||||
You can deploy your new Vue.js project with a single command from your terminal using [Now CLI](https://zeit.co/download):
|
||||
You can deploy your new Vue.js project with a single command from your terminal using [Now CLI](https://vercel.com/download):
|
||||
|
||||
```shell
|
||||
$ now
|
||||
|
||||
4
now.json
@@ -9,10 +9,6 @@
|
||||
"destination": "/api/frameworks"
|
||||
}
|
||||
],
|
||||
"env": {
|
||||
"GITHUB_ACCESS_TOKEN": "@now-api-examples-github-token",
|
||||
"SENTRY_DSN": "@sentry-product-dsn"
|
||||
},
|
||||
"github": {
|
||||
"silent": true,
|
||||
"autoJobCancelation": true
|
||||
|
||||
@@ -59,9 +59,6 @@
|
||||
"pre-commit": "lint-staged"
|
||||
}
|
||||
},
|
||||
"resolutions": {
|
||||
"signal-exit": "TooTallNate/signal-exit#update/sighub-to-sigint-on-windows"
|
||||
},
|
||||
"prettier": {
|
||||
"trailingComma": "es5",
|
||||
"singleQuote": true
|
||||
|
||||
@@ -309,6 +309,34 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"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",
|
||||
"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",
|
||||
"detectors": {
|
||||
"every": [
|
||||
{
|
||||
"path": "package.json",
|
||||
"matchContent": "\"(dev)?(d|D)ependencies\":\\s*{[^}]*\"@ionic\\/angular\":\\s*\".+?\"[^}]*}"
|
||||
}
|
||||
]
|
||||
},
|
||||
"settings": {
|
||||
"buildCommand": {
|
||||
"placeholder": "`npm run build` or `ng build`"
|
||||
},
|
||||
"devCommand": {
|
||||
"value": "ng start"
|
||||
},
|
||||
"outputDirectory": {
|
||||
"value": "www"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "Angular",
|
||||
"slug": "angular",
|
||||
@@ -397,7 +425,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-react.svg",
|
||||
"logo": "https://raw.githubusercontent.com/zeit/now/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",
|
||||
@@ -411,13 +439,13 @@
|
||||
},
|
||||
"settings": {
|
||||
"buildCommand": {
|
||||
"placeholder": "npm run build"
|
||||
"placeholder": "`npm run build` or `react-scripts build`"
|
||||
},
|
||||
"devCommand": {
|
||||
"value": "stencil build --dev --watch --serve --port $PORT"
|
||||
"value": "react-scripts start"
|
||||
},
|
||||
"outputDirectory": {
|
||||
"value": "public"
|
||||
"value": "build"
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
|
Before Width: | Height: | Size: 1003 B After Width: | Height: | Size: 1003 B |
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@now/frameworks",
|
||||
"version": "0.0.13-canary.0",
|
||||
"version": "0.0.13",
|
||||
"main": "frameworks.json",
|
||||
"license": "UNLICENSED"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@now/build-utils",
|
||||
"version": "2.2.0",
|
||||
"version": "2.2.2-canary.2",
|
||||
"license": "MIT",
|
||||
"main": "./dist/index.js",
|
||||
"types": "./dist/index.d.js",
|
||||
|
||||
@@ -190,7 +190,12 @@ export async function detectBuilders(
|
||||
hasNextApiFiles = true;
|
||||
}
|
||||
|
||||
if (!fallbackEntrypoint && buildCommand && !fileName.includes('/')) {
|
||||
if (
|
||||
!fallbackEntrypoint &&
|
||||
buildCommand &&
|
||||
!fileName.includes('/') &&
|
||||
fileName !== 'now.json'
|
||||
) {
|
||||
fallbackEntrypoint = fileName;
|
||||
}
|
||||
}
|
||||
@@ -483,7 +488,7 @@ function getMissingBuildScriptError() {
|
||||
code: 'missing_build_script',
|
||||
message:
|
||||
'Your `package.json` file is missing a `build` property inside the `scripts` property.' +
|
||||
'\nMore details: https://zeit.co/docs/v2/platform/frequently-asked-questions#missing-build-script',
|
||||
'\nMore details: https://vercel.com/docs/v2/platform/frequently-asked-questions#missing-build-script',
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ interface Props {
|
||||
*/
|
||||
code: string;
|
||||
/**
|
||||
* Optional hyperlink starting with https://zeit.co to
|
||||
* Optional hyperlink starting with https://vercel.com to
|
||||
* link to more information about this error.
|
||||
*/
|
||||
link?: string;
|
||||
|
||||
@@ -56,7 +56,7 @@ export async function getSupportedNodeVersion(
|
||||
throw new NowBuildError({
|
||||
code: 'NOW_BUILD_UTILS_NODE_VERSION_INVALID',
|
||||
link:
|
||||
'https://zeit.co/docs/runtimes#official-runtimes/node-js/node-js-version',
|
||||
'https://vercel.com/docs/runtimes#official-runtimes/node-js/node-js-version',
|
||||
message: intro + '\n' + pleaseSet,
|
||||
});
|
||||
}
|
||||
@@ -74,7 +74,7 @@ export async function getSupportedNodeVersion(
|
||||
throw new NowBuildError({
|
||||
code: 'NOW_BUILD_UTILS_NODE_VERSION_DISCONTINUED',
|
||||
link:
|
||||
'https://zeit.co/docs/runtimes#official-runtimes/node-js/node-js-version',
|
||||
'https://vercel.com/docs/runtimes#official-runtimes/node-js/node-js-version',
|
||||
message: intro + '\n' + pleaseSet + '\n' + upstreamProvider,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -6,13 +6,18 @@ import spawn from 'cross-spawn';
|
||||
import { SpawnOptions } from 'child_process';
|
||||
import { deprecate } from 'util';
|
||||
import { cpus } from 'os';
|
||||
import { NowBuildError } from '../errors';
|
||||
import { Meta, PackageJson, NodeVersion, Config } from '../types';
|
||||
import { getSupportedNodeVersion, getLatestNodeVersion } from './node-version';
|
||||
|
||||
interface SpawnOptionsExtended extends SpawnOptions {
|
||||
prettyCommand?: string;
|
||||
}
|
||||
|
||||
export function spawnAsync(
|
||||
command: string,
|
||||
args: string[],
|
||||
opts: SpawnOptions = {}
|
||||
opts: SpawnOptionsExtended = {}
|
||||
) {
|
||||
return new Promise<void>((resolve, reject) => {
|
||||
const stderrLogs: Buffer[] = [];
|
||||
@@ -29,12 +34,18 @@ export function spawnAsync(
|
||||
return resolve();
|
||||
}
|
||||
|
||||
const errorLogs = stderrLogs.map(line => line.toString()).join('');
|
||||
if (opts.stdio !== 'inherit') {
|
||||
reject(new Error(`Exited with ${code || signal}\n${errorLogs}`));
|
||||
} else {
|
||||
reject(new Error(`Exited with ${code || signal}`));
|
||||
}
|
||||
const cmd = opts.prettyCommand
|
||||
? `Command "${opts.prettyCommand}"`
|
||||
: 'Command';
|
||||
reject(
|
||||
new NowBuildError({
|
||||
code: `NOW_BUILD_UTILS_SPAWN_${code || signal}`,
|
||||
message:
|
||||
opts.stdio === 'inherit'
|
||||
? `${cmd} exited with ${code || signal}`
|
||||
: stderrLogs.map(line => line.toString()).join(''),
|
||||
})
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
@@ -42,7 +53,7 @@ export function spawnAsync(
|
||||
export function execAsync(
|
||||
command: string,
|
||||
args: string[],
|
||||
opts: SpawnOptions = {}
|
||||
opts: SpawnOptionsExtended = {}
|
||||
) {
|
||||
return new Promise<{ stdout: string; stderr: string; code: number }>(
|
||||
(resolve, reject) => {
|
||||
@@ -64,10 +75,15 @@ export function execAsync(
|
||||
child.on('error', reject);
|
||||
child.on('close', (code, signal) => {
|
||||
if (code !== 0) {
|
||||
const cmd = opts.prettyCommand
|
||||
? `Command "${opts.prettyCommand}"`
|
||||
: 'Command';
|
||||
|
||||
return reject(
|
||||
new Error(
|
||||
`Program "${command}" exited with non-zero exit code ${code} ${signal}.`
|
||||
)
|
||||
new NowBuildError({
|
||||
code: `NOW_BUILD_UTILS_EXEC_${code || signal}`,
|
||||
message: `${cmd} exited with ${code || signal}`,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
@@ -82,18 +98,20 @@ export function execAsync(
|
||||
}
|
||||
|
||||
export function spawnCommand(command: string, options: SpawnOptions = {}) {
|
||||
const opts = { ...options, prettyCommand: command };
|
||||
if (process.platform === 'win32') {
|
||||
return spawn('cmd.exe', ['/C', command], options);
|
||||
return spawn('cmd.exe', ['/C', command], opts);
|
||||
}
|
||||
|
||||
return spawn('sh', ['-c', command], options);
|
||||
return spawn('sh', ['-c', command], opts);
|
||||
}
|
||||
|
||||
export async function execCommand(command: string, options: SpawnOptions = {}) {
|
||||
const opts = { ...options, prettyCommand: command };
|
||||
if (process.platform === 'win32') {
|
||||
await spawnAsync('cmd.exe', ['/C', command], options);
|
||||
await spawnAsync('cmd.exe', ['/C', command], opts);
|
||||
} else {
|
||||
await spawnAsync('sh', ['-c', command], options);
|
||||
await spawnAsync('sh', ['-c', command], opts);
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -120,9 +138,11 @@ export async function runShellScript(
|
||||
assert(path.isAbsolute(fsPath));
|
||||
const destPath = path.dirname(fsPath);
|
||||
await chmodPlusX(fsPath);
|
||||
await spawnAsync(`./${path.basename(fsPath)}`, args, {
|
||||
cwd: destPath,
|
||||
const command = `./${path.basename(fsPath)}`;
|
||||
await spawnAsync(command, args, {
|
||||
...spawnOpts,
|
||||
cwd: destPath,
|
||||
prettyCommand: command,
|
||||
});
|
||||
return true;
|
||||
}
|
||||
@@ -166,7 +186,8 @@ export async function getNodeVersion(
|
||||
async function scanParentDirs(destPath: string, readPackageJson = false) {
|
||||
assert(path.isAbsolute(destPath));
|
||||
|
||||
let hasPackageLockJson = false;
|
||||
type CliType = 'yarn' | 'npm';
|
||||
let cliType: CliType = 'yarn';
|
||||
let packageJson: PackageJson | undefined;
|
||||
let currentDestPath = destPath;
|
||||
|
||||
@@ -180,9 +201,13 @@ async function scanParentDirs(destPath: string, readPackageJson = false) {
|
||||
packageJson = JSON.parse(await fs.readFile(packageJsonPath, 'utf8'));
|
||||
}
|
||||
// eslint-disable-next-line no-await-in-loop
|
||||
hasPackageLockJson = await fs.pathExists(
|
||||
path.join(currentDestPath, 'package-lock.json')
|
||||
);
|
||||
const [hasPackageLockJson, hasYarnLock] = await Promise.all([
|
||||
fs.pathExists(path.join(currentDestPath, 'package-lock.json')),
|
||||
fs.pathExists(path.join(currentDestPath, 'yarn.lock')),
|
||||
]);
|
||||
if (hasPackageLockJson && !hasYarnLock) {
|
||||
cliType = 'npm';
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -191,7 +216,7 @@ async function scanParentDirs(destPath: string, readPackageJson = false) {
|
||||
currentDestPath = newDestPath;
|
||||
}
|
||||
|
||||
return { hasPackageLockJson, packageJson };
|
||||
return { cliType, packageJson };
|
||||
}
|
||||
|
||||
interface WalkParentDirsProps {
|
||||
@@ -248,8 +273,8 @@ export async function runNpmInstall(
|
||||
assert(path.isAbsolute(destPath));
|
||||
debug(`Installing to ${destPath}`);
|
||||
|
||||
const { hasPackageLockJson } = await scanParentDirs(destPath);
|
||||
const opts: SpawnOptions = { cwd: destPath, ...spawnOpts };
|
||||
const { cliType } = await scanParentDirs(destPath);
|
||||
const opts: SpawnOptionsExtended = { cwd: destPath, ...spawnOpts };
|
||||
const env = opts.env ? { ...opts.env } : { ...process.env };
|
||||
delete env.NODE_ENV;
|
||||
opts.env = env;
|
||||
@@ -257,12 +282,14 @@ export async function runNpmInstall(
|
||||
let command: 'npm' | 'yarn';
|
||||
let commandArgs: string[];
|
||||
|
||||
if (hasPackageLockJson) {
|
||||
if (cliType === 'npm') {
|
||||
opts.prettyCommand = 'npm install';
|
||||
command = 'npm';
|
||||
commandArgs = args
|
||||
.filter(a => a !== '--prefer-offline')
|
||||
.concat(['install', '--no-audit', '--unsafe-perm']);
|
||||
} else {
|
||||
opts.prettyCommand = 'yarn install';
|
||||
command = 'yarn';
|
||||
commandArgs = args.concat(['install', '--ignore-engines']);
|
||||
}
|
||||
@@ -285,7 +312,7 @@ export async function runBundleInstall(
|
||||
}
|
||||
|
||||
assert(path.isAbsolute(destPath));
|
||||
const opts = { cwd: destPath, ...spawnOpts };
|
||||
const opts = { ...spawnOpts, cwd: destPath, prettyCommand: 'bundle install' };
|
||||
|
||||
await spawnAsync(
|
||||
'bundle',
|
||||
@@ -313,7 +340,7 @@ export async function runPipInstall(
|
||||
}
|
||||
|
||||
assert(path.isAbsolute(destPath));
|
||||
const opts = { cwd: destPath, ...spawnOpts };
|
||||
const opts = { ...spawnOpts, cwd: destPath, prettyCommand: 'pip3 install' };
|
||||
|
||||
await spawnAsync(
|
||||
'pip3',
|
||||
@@ -328,10 +355,7 @@ export async function runPackageJsonScript(
|
||||
spawnOpts?: SpawnOptions
|
||||
) {
|
||||
assert(path.isAbsolute(destPath));
|
||||
const { packageJson, hasPackageLockJson } = await scanParentDirs(
|
||||
destPath,
|
||||
true
|
||||
);
|
||||
const { packageJson, cliType } = await scanParentDirs(destPath, true);
|
||||
const hasScript = Boolean(
|
||||
packageJson &&
|
||||
packageJson.scripts &&
|
||||
@@ -340,18 +364,22 @@ export async function runPackageJsonScript(
|
||||
);
|
||||
if (!hasScript) return false;
|
||||
|
||||
const opts = { cwd: destPath, ...spawnOpts };
|
||||
|
||||
if (hasPackageLockJson) {
|
||||
console.log(`Running "npm run ${scriptName}"`);
|
||||
await spawnAsync('npm', ['run', scriptName], opts);
|
||||
if (cliType === 'npm') {
|
||||
const prettyCommand = `npm run ${scriptName}`;
|
||||
console.log(`Running "${prettyCommand}"`);
|
||||
await spawnAsync('npm', ['run', scriptName], {
|
||||
...spawnOpts,
|
||||
cwd: destPath,
|
||||
prettyCommand,
|
||||
});
|
||||
} else {
|
||||
console.log(`Running "yarn run ${scriptName}"`);
|
||||
await spawnAsync(
|
||||
'yarn',
|
||||
['--ignore-engines', '--cwd', destPath, 'run', scriptName],
|
||||
opts
|
||||
);
|
||||
const prettyCommand = `yarn run ${scriptName}`;
|
||||
console.log(`Running "${prettyCommand}"`);
|
||||
await spawnAsync('yarn', ['--ignore-engines', 'run', scriptName], {
|
||||
...spawnOpts,
|
||||
cwd: destPath,
|
||||
prettyCommand,
|
||||
});
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -50,7 +50,7 @@ export interface Config {
|
||||
export interface Meta {
|
||||
isDev?: boolean;
|
||||
skipDownload?: boolean;
|
||||
requestPath?: string;
|
||||
requestPath?: string | null;
|
||||
filesChanged?: string[];
|
||||
filesRemoved?: string[];
|
||||
env?: Env;
|
||||
@@ -187,12 +187,48 @@ export interface ShouldServeOptions {
|
||||
config: Config;
|
||||
}
|
||||
|
||||
export interface StartDevServerOptions {
|
||||
/**
|
||||
* Name of entrypoint file for this particular build job. Value
|
||||
* `files[entrypoint]` is guaranteed to exist and be a valid File reference.
|
||||
* `entrypoint` is always a discrete file and never a glob, since globs are
|
||||
* expanded into separate builds at deployment time.
|
||||
*/
|
||||
entrypoint: string;
|
||||
|
||||
/**
|
||||
* A writable temporary directory where you are encouraged to perform your
|
||||
* build process. This directory will be populated with the restored cache.
|
||||
*/
|
||||
workPath: string;
|
||||
}
|
||||
|
||||
export interface StartDevServerSuccess {
|
||||
/**
|
||||
* Port number where the dev server can be connected to, assumed to be running
|
||||
* on `localhost`.
|
||||
*/
|
||||
port: number;
|
||||
|
||||
/**
|
||||
* Process ID number of the dev server. Useful for the `now dev` server to
|
||||
* shut down the dev server once an HTTP request has been fulfilled.
|
||||
*/
|
||||
pid: number;
|
||||
}
|
||||
|
||||
/**
|
||||
* `startDevServer()` may return `null` to opt-out of spawning a dev server for
|
||||
* a given `entrypoint`.
|
||||
*/
|
||||
export type StartDevServerResult = StartDevServerSuccess | null;
|
||||
|
||||
/**
|
||||
* Credit to Iain Reid, MIT license.
|
||||
* Source: https://gist.github.com/iainreid820/5c1cc527fe6b5b7dba41fec7fe54bf6e
|
||||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-namespace
|
||||
namespace PackageJson {
|
||||
export namespace PackageJson {
|
||||
/**
|
||||
* An author or contributor
|
||||
*/
|
||||
|
||||
@@ -2,10 +2,15 @@
|
||||
"version": 2,
|
||||
"builds": [
|
||||
{ "src": "with-npm/index.js", "use": "@now/node" },
|
||||
{ "src": "with-yarn/index.js", "use": "@now/node" }
|
||||
{ "src": "with-yarn/index.js", "use": "@now/node" },
|
||||
{ "src": "with-yarn-and-npm/index.js", "use": "@now/node" }
|
||||
],
|
||||
"probes": [
|
||||
{ "path": "/with-npm", "mustContain": "npm:RANDOMNESS_PLACEHOLDER" },
|
||||
{ "path": "/with-yarn", "mustContain": "yarn:RANDOMNESS_PLACEHOLDER" }
|
||||
{ "path": "/with-yarn", "mustContain": "yarn:RANDOMNESS_PLACEHOLDER" },
|
||||
{
|
||||
"path": "/with-yarn-and-npm",
|
||||
"mustContain": "yarn:RANDOMNESS_PLACEHOLDER"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
0
packages/now-build-utils/test/fixtures/08-yarn-npm/with-yarn-and-npm/index.js
vendored
Normal file
14
packages/now-build-utils/test/fixtures/08-yarn-npm/with-yarn-and-npm/must-be-yarn.js
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
const execpath = path.basename(process.env.npm_execpath);
|
||||
console.log('execpath', execpath);
|
||||
|
||||
if (execpath === 'yarn.js' || execpath === 'yarn') {
|
||||
fs.writeFileSync(
|
||||
'index.js',
|
||||
'module.exports = (_, resp) => resp.end("yarn:RANDOMNESS_PLACEHOLDER");'
|
||||
);
|
||||
} else {
|
||||
throw new Error('yarn is expected');
|
||||
}
|
||||
3
packages/now-build-utils/test/fixtures/08-yarn-npm/with-yarn-and-npm/package-lock.json
generated
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"lockfileVersion": 1
|
||||
}
|
||||
5
packages/now-build-utils/test/fixtures/08-yarn-npm/with-yarn-and-npm/package.json
vendored
Normal file
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"scripts": {
|
||||
"now-build": "node must-be-yarn.js"
|
||||
}
|
||||
}
|
||||
3
packages/now-build-utils/test/fixtures/08-yarn-npm/with-yarn-and-npm/yarn.lock
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
|
||||
# yarn lockfile v1
|
||||
|
||||
@@ -7,6 +7,19 @@ import {
|
||||
} from '../';
|
||||
|
||||
describe('Test `detectBuilders`', () => {
|
||||
it('should never select now.json src', async () => {
|
||||
const files = ['docs/index.md', 'mkdocs.yml', 'now.json'];
|
||||
const { builders, errors } = await detectBuilders(files, null, {
|
||||
projectSettings: {
|
||||
buildCommand: 'mkdocs build',
|
||||
outputDirectory: 'site',
|
||||
},
|
||||
});
|
||||
expect(errors).toBe(null);
|
||||
expect(builders).toBeDefined();
|
||||
expect(builders![0].src).not.toBe('now.json');
|
||||
});
|
||||
|
||||
it('package.json + no build', async () => {
|
||||
const pkg = { dependencies: { next: '9.0.0' } };
|
||||
const files = ['package.json', 'pages/index.js', 'public/index.html'];
|
||||
@@ -817,6 +830,21 @@ describe('Test `detectBuilders`', () => {
|
||||
|
||||
describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
|
||||
const featHandleMiss = true;
|
||||
|
||||
it('should never select now.json src', async () => {
|
||||
const files = ['docs/index.md', 'mkdocs.yml', 'now.json'];
|
||||
const { builders, errors } = await detectBuilders(files, null, {
|
||||
featHandleMiss,
|
||||
projectSettings: {
|
||||
buildCommand: 'mkdocs build',
|
||||
outputDirectory: 'site',
|
||||
},
|
||||
});
|
||||
expect(errors).toBe(null);
|
||||
expect(builders).toBeDefined();
|
||||
expect(builders![0].src).not.toBe('now.json');
|
||||
});
|
||||
|
||||
it('package.json + no build', async () => {
|
||||
const pkg = { dependencies: { next: '9.0.0' } };
|
||||
const files = ['package.json', 'pages/index.js', 'public/index.html'];
|
||||
|
||||
@@ -21,7 +21,6 @@ describe('Test `walkParentDirs`', () => {
|
||||
await walkParentDirs({ base, start, filename });
|
||||
fail('Expected error');
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
deepEqual(
|
||||
(error as Error).message,
|
||||
'Expected "base" to be absolute path'
|
||||
@@ -36,7 +35,6 @@ describe('Test `walkParentDirs`', () => {
|
||||
await walkParentDirs({ base, start, filename });
|
||||
fail('Expected error');
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
deepEqual(
|
||||
(error as Error).message,
|
||||
'Expected "start" to be absolute path'
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
## Usages
|
||||
|
||||
To install the latest version of Now CLI, visit [zeit.co/download](https://zeit.co/download) or run this command:
|
||||
To install the latest version of Now CLI, visit [vercel.com/download](https://vercel.com/download) or run this command:
|
||||
|
||||
```sh
|
||||
npm i -g now
|
||||
@@ -19,4 +19,4 @@ now # Deploy to the cloud
|
||||
|
||||
## Documentation
|
||||
|
||||
For details on how to use Now CLI, check out our [documentation](https://zeit.co/docs).
|
||||
For details on how to use Now CLI, check out our [documentation](https://vercel.com/docs).
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"name": "now",
|
||||
"version": "17.1.2-canary.4",
|
||||
"version": "18.0.1-canary.6",
|
||||
"preferGlobal": true,
|
||||
"license": "Apache-2.0",
|
||||
"description": "The command-line interface for Now",
|
||||
"homepage": "https://zeit.co",
|
||||
"homepage": "https://vercel.com",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/zeit/now.git",
|
||||
@@ -13,7 +13,7 @@
|
||||
"scripts": {
|
||||
"preinstall": "node ./scripts/preinstall.js",
|
||||
"test-unit": "nyc ava test/unit.js test/dev-builder.unit.js test/dev-router.unit.js test/dev-server.unit.js --serial --fail-fast --verbose",
|
||||
"test-integration-cli": "ava test/integration.js --serial --fail-fast",
|
||||
"test-integration-cli": "ava test/integration.js --serial --fail-fast --verbose",
|
||||
"test-integration-v1": "ava test/integration-v1.js --serial --fail-fast",
|
||||
"test-integration-dev": "ava test/dev/integration.js --serial --fail-fast --verbose",
|
||||
"prepublishOnly": "yarn build",
|
||||
@@ -63,7 +63,8 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@sentry/node": "5.5.0",
|
||||
"@sindresorhus/slugify": "0.10.0",
|
||||
"@sindresorhus/slugify": "0.11.0",
|
||||
"@tootallnate/once": "1.1.2",
|
||||
"@types/ansi-escapes": "3.0.0",
|
||||
"@types/ansi-regex": "4.0.0",
|
||||
"@types/async-retry": "1.2.1",
|
||||
@@ -141,8 +142,9 @@
|
||||
"micro": "9.1.2",
|
||||
"mime-types": "2.1.24",
|
||||
"minimatch": "3.0.4",
|
||||
"mri": "1.1.0",
|
||||
"mri": "1.1.5",
|
||||
"ms": "2.1.2",
|
||||
"nanoid": "3.0.2",
|
||||
"node-fetch": "2.6.0",
|
||||
"npm-package-arg": "6.1.0",
|
||||
"nyc": "13.2.0",
|
||||
|
||||
@@ -39,11 +39,14 @@ async function createBuildersTarball() {
|
||||
}
|
||||
}
|
||||
|
||||
const yarn = join(dirRoot, '../../node_modules/yarn/bin/yarn.js');
|
||||
await execa(process.execPath, [yarn, 'add', '--no-lockfile', ...builders], {
|
||||
cwd: buildersDir,
|
||||
stdio: 'inherit',
|
||||
});
|
||||
await execa(
|
||||
'npm',
|
||||
['install', '--save-exact', '--no-package-lock', ...builders],
|
||||
{
|
||||
cwd: buildersDir,
|
||||
stdio: 'inherit',
|
||||
}
|
||||
);
|
||||
|
||||
const packer = tar.pack(buildersDir);
|
||||
await pipe(
|
||||
|
||||
@@ -8,6 +8,8 @@ import getAliases from '../../util/alias/get-aliases';
|
||||
import getScope from '../../util/get-scope.ts';
|
||||
import stamp from '../../util/output/stamp.ts';
|
||||
import strlen from '../../util/strlen.ts';
|
||||
import getCommandFlags from '../../util/get-command-flags';
|
||||
import cmd from '../../util/output/cmd.ts';
|
||||
|
||||
export default async function ls(ctx, opts, args, output) {
|
||||
const {
|
||||
@@ -101,9 +103,12 @@ export default async function ls(ctx, opts, args, output) {
|
||||
console.log(printAliasTable(aliases));
|
||||
}
|
||||
|
||||
if (pagination && aliases.length === 20) {
|
||||
if (pagination && pagination.count === 20) {
|
||||
const flags = getCommandFlags(opts, ['_', '--next']);
|
||||
output.log(
|
||||
`To display the next page use the flag --next ${pagination.next}`
|
||||
`To display the next page run ${cmd(
|
||||
`now alias ls${flags} --next ${pagination.next}`
|
||||
)}`
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ export default async function set(
|
||||
if (args.length === 0 && !rules) {
|
||||
output.error(
|
||||
`To ship to production, optionally configure your domains (${link(
|
||||
'https://zeit.co/docs/v2/custom-domains/'
|
||||
'https://vercel.com/docs/v2/custom-domains'
|
||||
)}) and run ${cmd('now --prod')}.`
|
||||
);
|
||||
return 1;
|
||||
|
||||
@@ -49,6 +49,7 @@ const help = () => {
|
||||
--ca ${chalk.bold.underline(
|
||||
'FILE'
|
||||
)} CA certificate chain file
|
||||
-N, --next Show next page of results
|
||||
|
||||
${chalk.dim('Examples:')}
|
||||
|
||||
@@ -61,6 +62,12 @@ const help = () => {
|
||||
${chalk.gray('–')} Remove a certificate
|
||||
|
||||
${chalk.cyan('$ now certs rm id')}
|
||||
|
||||
${chalk.gray('–')} Paginate results, where ${chalk.dim(
|
||||
'`1584722256178`'
|
||||
)} is the time in milliseconds since the UNIX epoch.
|
||||
|
||||
${chalk.cyan(`$ now certs ls --next 1584722256178`)}
|
||||
`);
|
||||
};
|
||||
|
||||
@@ -69,7 +76,7 @@ const COMMAND_CONFIG = {
|
||||
issue: ['issue'],
|
||||
ls: ['ls', 'list'],
|
||||
renew: ['renew'],
|
||||
rm: ['rm', 'remove']
|
||||
rm: ['rm', 'remove'],
|
||||
};
|
||||
|
||||
export default async function main(ctx: NowContext) {
|
||||
@@ -80,10 +87,11 @@ export default async function main(ctx: NowContext) {
|
||||
'--challenge-only': Boolean,
|
||||
'--overwrite': Boolean,
|
||||
'--output': String,
|
||||
'--after': String,
|
||||
'--crt': String,
|
||||
'--key': String,
|
||||
'--ca': String
|
||||
'--ca': String,
|
||||
'--next': Number,
|
||||
'-N': '--next',
|
||||
});
|
||||
} catch (err) {
|
||||
handleError(err);
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
import chalk from 'chalk';
|
||||
import ms from 'ms';
|
||||
import plural from 'pluralize';
|
||||
import psl from 'psl';
|
||||
import table from 'text-table';
|
||||
// @ts-ignore
|
||||
import Now from '../../util';
|
||||
@@ -10,14 +8,14 @@ import Client from '../../util/client';
|
||||
import getScope from '../../util/get-scope';
|
||||
import stamp from '../../util/output/stamp';
|
||||
import getCerts from '../../util/certs/get-certs';
|
||||
import { CertNotFound } from '../../util/errors-ts';
|
||||
import strlen from '../../util/strlen';
|
||||
import { Output } from '../../util/output';
|
||||
import { NowContext, Cert } from '../../types';
|
||||
import getCommandFlags from '../../util/get-command-flags';
|
||||
|
||||
interface Options {
|
||||
'--debug'?: boolean;
|
||||
'--after'?: string;
|
||||
'--next'?: number;
|
||||
}
|
||||
|
||||
async function ls(
|
||||
@@ -32,8 +30,7 @@ async function ls(
|
||||
} = ctx;
|
||||
const { currentTeam } = config;
|
||||
const { apiUrl } = ctx;
|
||||
const debug = opts['--debug'];
|
||||
const after = opts['--after'];
|
||||
const { '--debug': debug, '--next': nextTimestamp } = opts;
|
||||
const client = new Client({ apiUrl, token, currentTeam, debug });
|
||||
let contextName = null;
|
||||
|
||||
@@ -47,7 +44,10 @@ async function ls(
|
||||
|
||||
throw err;
|
||||
}
|
||||
|
||||
if (typeof nextTimestamp !== 'undefined' && Number.isNaN(nextTimestamp)) {
|
||||
output.error('Please provide a number for flag --next');
|
||||
return 1;
|
||||
}
|
||||
const now = new Now({ apiUrl, token, debug, currentTeam });
|
||||
const lsStamp = stamp();
|
||||
|
||||
@@ -59,38 +59,29 @@ async function ls(
|
||||
}
|
||||
|
||||
// Get the list of certificates
|
||||
const certificates = await getCerts(output, now, { after }).catch(err => err);
|
||||
|
||||
if (certificates instanceof CertNotFound) {
|
||||
output.error(certificates.message);
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (certificates instanceof Error) {
|
||||
throw certificates;
|
||||
}
|
||||
|
||||
const certs = sortByCn(certificates);
|
||||
|
||||
output.log(
|
||||
`${plural('certificate', certs.length, true)} found under ${chalk.bold(
|
||||
contextName
|
||||
)} ${lsStamp()}`
|
||||
const { certs, pagination } = await getCerts(now, nextTimestamp).catch(
|
||||
err => err
|
||||
);
|
||||
|
||||
if (certs.length >= 100) {
|
||||
const { uid: lastCert } = certificates[certificates.length - 1];
|
||||
output.note(
|
||||
`There may be more certificates that can be retrieved with ${cmd(
|
||||
`now ${process.argv.slice(2).join(' ')} --after=${lastCert}`
|
||||
)}.\n`
|
||||
);
|
||||
}
|
||||
output.log(
|
||||
`${
|
||||
certs.length > 0 ? 'Certificates' : 'No certificates'
|
||||
} found under ${chalk.bold(contextName)} ${lsStamp()}`
|
||||
);
|
||||
|
||||
if (certs.length > 0) {
|
||||
console.log(formatCertsTable(certs));
|
||||
}
|
||||
|
||||
if (pagination && pagination.count === 20) {
|
||||
const flags = getCommandFlags(opts, ['_', '--next']);
|
||||
output.log(
|
||||
`To display the next page run ${cmd(
|
||||
`now certs ls${flags} --next ${pagination.next}`
|
||||
)}`
|
||||
);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -161,18 +152,4 @@ function formatExpirationDate(date: Date) {
|
||||
: chalk.gray(`in ${ms(diff)}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* This function sorts the list of certs by root domain changing *
|
||||
* to 'wildcard' since that will allow psl get the root domain
|
||||
* properly to make the comparison.
|
||||
*/
|
||||
function sortByCn(certsList: Cert[]) {
|
||||
return certsList.concat().sort((a: Cert, b: Cert) => {
|
||||
const domainA = psl.get(a.cns[0].replace('*', 'wildcard'));
|
||||
const domainB = psl.get(b.cns[0].replace('*', 'wildcard'));
|
||||
if (!domainA || !domainB) return 0;
|
||||
return domainA.localeCompare(domainB);
|
||||
});
|
||||
}
|
||||
|
||||
export default ls;
|
||||
|
||||
@@ -98,7 +98,7 @@ async function getCertsToDelete(
|
||||
contextName: string,
|
||||
id: string
|
||||
) {
|
||||
const cert = await getCertById(output, client, id);
|
||||
const cert = await getCertById(client, id);
|
||||
if (cert instanceof ERRORS.CertNotFound) {
|
||||
const certs = await getCertsForDomain(output, client, contextName, id);
|
||||
if (certs instanceof ERRORS.CertsPermissionDenied) {
|
||||
|
||||
@@ -14,6 +14,7 @@ export const latestHelp = () => `
|
||||
'(default)'
|
||||
)}
|
||||
dev Start a local development server
|
||||
env Manages the Environment Variables for your current Project
|
||||
init [example] Initialize an example project
|
||||
ls | list [app] Lists deployments
|
||||
inspect [id] Displays information related to a deployment
|
||||
@@ -28,7 +29,7 @@ export const latestHelp = () => `
|
||||
domains [name] Manages your domain names
|
||||
dns [name] Manages your DNS records
|
||||
certs [cmd] Manages your SSL certificates
|
||||
secrets [name] Manages your secret environment variables
|
||||
secrets [name] Manages your global Secrets, for use in Environment Variables
|
||||
logs [url] Displays the logs for a deployment
|
||||
teams Manages your teams
|
||||
whoami Shows the username of the currently logged in user
|
||||
@@ -46,7 +47,7 @@ export const latestHelp = () => `
|
||||
)} Path to the global ${'`.now`'} directory
|
||||
-d, --debug Debug mode [off]
|
||||
-f, --force Force a new deployment even if nothing has changed
|
||||
--force-with-cache Force a new deployment even if nothing has changed but retain build cache
|
||||
--with-cache Retain build cache when using "--force"
|
||||
-t ${chalk.underline('TOKEN')}, --token=${chalk.underline(
|
||||
'TOKEN'
|
||||
)} Login token
|
||||
@@ -84,7 +85,7 @@ export const latestHelp = () => `
|
||||
|
||||
${chalk.cyan('$ now /usr/src/project')}
|
||||
|
||||
${chalk.gray('–')} Deploy with environment variables
|
||||
${chalk.gray('–')} Deploy with Environment Variables
|
||||
|
||||
${chalk.cyan('$ now -e NODE_ENV=production -e SECRET=@mysql-secret')}
|
||||
|
||||
@@ -98,7 +99,7 @@ export const latestHelp = () => `
|
||||
|
||||
export const latestArgs = {
|
||||
'--force': Boolean,
|
||||
'--force-with-cache': Boolean,
|
||||
'--with-cache': Boolean,
|
||||
'--public': Boolean,
|
||||
'--no-clipboard': Boolean,
|
||||
'--env': [String],
|
||||
|
||||
@@ -352,7 +352,7 @@ export default async function main(
|
||||
path,
|
||||
sourcePath,
|
||||
project
|
||||
? `To change your project settings, go to https://zeit.co/${org.slug}/${project.name}/settings`
|
||||
? `To change your project settings, go to https://vercel.com/${org.slug}/${project.name}/settings`
|
||||
: ''
|
||||
)) === false
|
||||
) {
|
||||
@@ -506,7 +506,7 @@ export default async function main(
|
||||
env: deploymentEnv,
|
||||
build: { env: deploymentBuildEnv },
|
||||
forceNew: argv['--force'],
|
||||
forceNewWithCache: argv['--force-with-cache'],
|
||||
withCache: argv['--with-cache'],
|
||||
quiet,
|
||||
wantsPublic: argv['--public'] || localConfig.public,
|
||||
isFile,
|
||||
@@ -666,7 +666,7 @@ export default async function main(
|
||||
if (err instanceof BuildError) {
|
||||
output.error('Build failed');
|
||||
output.error(
|
||||
`Check your logs at ${now.url}/_logs or run ${code(
|
||||
`Check your logs at https://${now.url}/_logs or run ${code(
|
||||
`now logs ${now.url}`,
|
||||
{
|
||||
// Backticks are interpreted as part of the URL, causing CMD+Click
|
||||
@@ -766,7 +766,7 @@ function handleCreateDeployError(output, error) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
const link = 'https://zeit.co/docs/v2/deployments/configuration/';
|
||||
const link = 'https://vercel.com/docs/configuration';
|
||||
|
||||
output.error(
|
||||
`Failed to validate ${highlight(
|
||||
|
||||
@@ -93,7 +93,7 @@ let paths: string[];
|
||||
|
||||
// Options
|
||||
let forceNew: boolean;
|
||||
let forceNewWithCache: boolean;
|
||||
let withCache: boolean;
|
||||
let deploymentName: string;
|
||||
let sessionAffinity: string;
|
||||
let log: any;
|
||||
@@ -239,7 +239,7 @@ export default async function main(
|
||||
|
||||
// Options
|
||||
forceNew = argv.force;
|
||||
forceNewWithCache = argv['force-with-cache'];
|
||||
withCache = argv['with-cache'];
|
||||
deploymentName = argv.name;
|
||||
sessionAffinity = argv['session-affinity'];
|
||||
debugEnabled = argv.debug;
|
||||
@@ -259,7 +259,7 @@ export default async function main(
|
||||
quiet = !isTTY;
|
||||
({ log, error, note, debug, warn } = output);
|
||||
|
||||
const infoUrl = 'https://zeit.co/guides/migrate-to-zeit-now';
|
||||
const infoUrl = 'https://vercel.com/guides/migrate-to-vercel';
|
||||
|
||||
warn(
|
||||
`You are using an old version of the Now Platform. More: ${link(infoUrl)}`
|
||||
@@ -743,7 +743,7 @@ async function sync({
|
||||
meta: metadata,
|
||||
followSymlinks,
|
||||
forceNew,
|
||||
forceNewWithCache,
|
||||
withCache,
|
||||
forwardNpm,
|
||||
quiet,
|
||||
scale,
|
||||
@@ -794,10 +794,10 @@ async function sync({
|
||||
});
|
||||
}
|
||||
|
||||
let url = 'https://zeit.co/account/plan';
|
||||
let url = 'https://vercel.com/account/plan';
|
||||
|
||||
if (currentTeam) {
|
||||
url = `https://zeit.co/teams/${contextName}/settings/plan`;
|
||||
url = `https://vercel.com/teams/${contextName}/settings/plan`;
|
||||
}
|
||||
|
||||
note(
|
||||
@@ -1104,7 +1104,7 @@ function handleCreateDeployError(output: Output, error: Error) {
|
||||
`Failed to validate ${highlight(
|
||||
'now.json'
|
||||
)}: ${message}\nDocumentation: ${link(
|
||||
'https://zeit.co/docs/v2/advanced/configuration'
|
||||
'https://vercel.com/docs/configuration'
|
||||
)}`
|
||||
);
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ export default async function dev(
|
||||
// retrieve dev command
|
||||
const [link, frameworks] = await Promise.all([
|
||||
getLinkedProject(output, client, cwd),
|
||||
getFrameworks(),
|
||||
getFrameworks(client),
|
||||
]);
|
||||
|
||||
if (link.status === 'error') {
|
||||
@@ -48,7 +48,7 @@ export default async function dev(
|
||||
output.print(
|
||||
`${chalk.red(
|
||||
'Error!'
|
||||
)} Your codebase isn’t linked to a project on ZEIT Now. Run ${cmd(
|
||||
)} Your codebase isn’t linked to a project on Vercel. Run ${cmd(
|
||||
'now'
|
||||
)} to link it.\n`
|
||||
);
|
||||
|
||||
@@ -64,7 +64,7 @@ const help = () => {
|
||||
${chalk.cyan(
|
||||
`$ now dns add <DOMAIN> <NAME> CAA '<FLAGS> <TAG> "<VALUE>"'`
|
||||
)}
|
||||
${chalk.cyan(`$ now dns add zeit.rocks '@' CAA '0 issue "zeit.co"'`)}
|
||||
${chalk.cyan(`$ now dns add zeit.rocks '@' CAA '0 issue "example.com"'`)}
|
||||
|
||||
${chalk.gray('–')} Import a Zone file
|
||||
|
||||
@@ -79,7 +79,7 @@ const COMMAND_CONFIG = {
|
||||
add: ['add'],
|
||||
import: ['import'],
|
||||
ls: ['ls', 'list'],
|
||||
rm: ['rm', 'remove']
|
||||
rm: ['rm', 'remove'],
|
||||
};
|
||||
|
||||
export default async function main(ctx: NowContext) {
|
||||
|
||||