Compare commits

...

67 Commits

Author SHA1 Message Date
Nathan Rajlich
63cc9009c8 Publish Stable
- @vercel/frameworks@0.0.15
 - @vercel/build-utils@2.4.0
 - @vercel/cgi@1.0.6
 - vercel@19.1.0
 - @vercel/client@8.1.0
 - @vercel/go@1.1.2
 - @vercel/next@2.6.6
 - @vercel/node-bridge@1.3.1
 - @vercel/node@1.7.0
 - @vercel/python@1.2.2
 - @vercel/routing-utils@1.8.3
 - @vercel/ruby@1.2.2
 - @vercel/static-build@0.17.2
2020-06-11 16:30:31 -07:00
Nathan Rajlich
ccf6e3c432 Publish Canary
- vercel@19.0.2-canary.17
 - @vercel/client@8.0.2-canary.4
2020-06-11 15:17:05 -07:00
Steven
8d015e3138 [client] Fix .vercelignore override default ignore list (#4627)
- Fixes #3747 
- Related to #4325
- Related to [tweet](https://twitter.com/Rich_Harris/status/1270871878018699264) from @Rich-Harris
- Docs updated in https://github.com/vercel/docs/pull/1909

There was an issue that was likely introduced when we started using `@vercel/client`: the [default ignore list](https://vercel.com/docs/v2/build-step#ignored-files-and-folders) could not be overridden. This is because the default `ignores` array was always used instead of the combined `default ignore + user ignore`. The solution was to utilize [`recursive-readdir` ignore function](https://www.npmjs.com/package/recursive-readdir#usage) along with [`ig.ignores` function](https://www.npmjs.com/package/ignore#usage) so that the combined result is used for ignoring files while walking the file tree.

This ensures that the fix from PR #4325 is still effective and also fixes the longstanding bug from Issue #3747.
2020-06-11 18:15:16 -04:00
Nathan Rajlich
42f2fa1a20 [cli] Invalidate the configuration if vercel.json is deleted (#4629)
Before this, if the `vercel.json` file gets deleted while the dev server
is running, then it would still act like the file exists since it would
use the cached version.

Now it properly invalidates to an empty configuration if the
`vercel.json` file does not exist.
2020-06-11 22:06:44 +00:00
Steven
8397aac0e3 [github] Update codeowners (#4630)
* Update codeowners

* Make TooTallNate taller
2020-06-11 16:59:18 -04:00
Nathan Rajlich
7bcdc144eb [cli] Update "npm-install-error" link to "npm-install-failed-dev" (#4628)
Depends on https://github.com/vercel/docs/pull/1908.
2020-06-11 19:08:48 +00:00
Nathan Rajlich
624da9170d Publish Canary
- @vercel/frameworks@0.0.15-canary.5
 - @vercel/build-utils@2.3.2-canary.6
 - vercel@19.0.2-canary.16
 - @vercel/client@8.0.2-canary.3
 - @vercel/node@1.6.2-canary.6
2020-06-10 14:27:18 -07:00
Nathan Rajlich
fb5b013a03 [node] Force module: "commonjs" in startDevServer() (#4621)
This is a follow up to #4514 to handle the case where there is no
`tsconfig.json` closer to the entrypoint. This is likely the case when
`.js` files with ES Modules syntax are being used instead of `.ts`.
2020-06-10 14:26:28 -07:00
Mark Glagola
0a4bb53a58 [cli] Handle aliasWarning and bump to v13/now/deployments (#4605)
* Handle aliasWarning

* Pick best production project domain

* Fix currentTeam assignment

* Adds `https` url check to cli integration tests
2020-06-10 16:00:50 -05:00
Nathan Rajlich
2fbd9c78e3 [cli] Better errors for conflicting configuration files (#4612)
* [cli] Better errors for conflicting configuration files

Renders the link https://vercel.link/combining-old-and-new-config
for all conflicting config errors.

* Fix unit test

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-06-10 12:38:02 -07:00
Nathan Rajlich
1ed2b7a57d [cli] Update @vercel/next to v2.6.5 (#4611)
It got out of sync somehow in 55c60d30e6.
2020-06-10 03:37:58 +00:00
Nathan Rajlich
88cd9ca3c3 [cli] Invalidate build match for changes to config in builds (#4603)
* Fixes changing a `config` value in the `builds` array (such as `helpers: false` for `@vercel/node`) and having it be reflected in `vc dev` without restarting the dev server.
* Re-validates the env vars configuration when a `.env` file changes or the `env` object is changed in `vercel.json` (same for the builds equivalents).
* Ensures that the `NODEJS_HELPERS` build env var is being properly checked in `startDevServer()`.
* Regenerated the `yarn.lock` file because yarn was erroring when trying to add the `fast-deep-equal` dependency.
2020-06-09 19:56:55 +00:00
JJ Kasper
ecea2ca4a3 Publish Stable
- @vercel/next@2.6.5
2020-06-09 13:02:11 -05:00
JJ Kasper
3f132bc15b Publish Canary
- @vercel/build-utils@2.3.2-canary.5
 - vercel@19.0.2-canary.15
 - @vercel/next@2.6.5-canary.0
 - @vercel/routing-utils@1.8.3-canary.6
2020-06-09 11:47:51 -05:00
JJ Kasper
61d95094c0 [next] Re-disable shared lambdas by default (#4609)
As noticed, `now.json` and `vercel.json` files aren't available during the build currently which makes feature detecting and opting out when `routes` are used not work currently so this re-disables the shared lambdas optimization by default while we investigate detecting this
2020-06-09 16:24:21 +00:00
Steven
f7c47975e3 [tests] Add log for error response (#4601) 2020-06-08 17:51:31 -07:00
Nathan Rajlich
7c96f9f9a5 [cli] Show npm output when failing to install Runtimes in vc dev (#4598)
If `npm install` doesn't exit with 0, then log the output to the
termial.

This was already happening with `--debug` due to `stdio: "inherit"`
when debug is enabled, so this change is really only relevant for the
non-debug case.

### Before

```
$ vc dev
Vercel CLI 19.0.2-canary.13 dev (beta) — https://vercel.com/feedback
Error! Command failed with exit code 1: npm install --save-exact --no-package-lock --no-audit --no-progress @now/build-utils@canary @vercel/build-utils@canary now-php@0.0.0
```

### After

Bad dependency:

<img width="641" alt="Screen Shot 2020-06-08 at 12 22 00 PM" src="https://user-images.githubusercontent.com/71256/84071523-b07c4c00-a982-11ea-9200-f18498ae917c.png">

No `npm` installed:

<img width="672" alt="Screen Shot 2020-06-08 at 12 21 16 PM" src="https://user-images.githubusercontent.com/71256/84071456-95114100-a982-11ea-87cc-05ed7fb2cb80.png">
2020-06-08 22:36:47 +00:00
Nathan Rajlich
a5c805b6eb [cli] Use getArgs() instead of mri to parse arguments in vc projects (#4570)
* Ensures that `vc --debug projects ls` properly prints the Projects listing, rather than the usage help info.
 * `vc projects` (without a subcommand) shows the Projects listing (this is consistent with i.e. `vc domains`).
 * Returns with exit code `2` when the usage help info is printed (standard Unix convention).
2020-06-08 21:05:18 +00:00
JJ Kasper
ff2a22023d Publish Stable
- @vercel/next@2.6.4
2020-06-08 14:56:04 -05:00
JJ Kasper
c6efc028aa Publish Canary
- vercel@19.0.2-canary.14
 - @vercel/next@2.6.4-canary.0
2020-06-08 14:48:59 -05:00
JJ Kasper
96565da1cf [next] Add shared lambdas opt-out for functions config (#4596)
As discussed this adds opting out of the shared lambdas optimization when a user adds a functions config in `now.json` or `vercel.json` since this could potentially be a breaking change. We plan to add new handling to still allow customizing this config for the combined lambdas that are created
2020-06-08 19:40:48 +00:00
Steven
afb5e7fc85 [cli] Update tests for 404.html (#4597)
Now that we updated api-deployments, we can remove this TODO and run tests agains `vercel dev` and real deployments.
2020-06-08 18:42:45 +00:00
Nathan Rajlich
34cc987be8 [cli] Make proxyPass() return a 502 if the proxying fails (#4586)
This happens, for example, with a `startDevServer()` process that
crashes (i.e. a syntax error in a Node.js API endpoint) before
responding to the HTTP request.
2020-06-08 18:02:05 +00:00
JJ Kasper
55c60d30e6 Publish Stable
- @vercel/next@2.6.3
2020-06-08 09:54:44 -05:00
Nathan Rajlich
eb993d47ac [cli] Update 502 error template for vc dev (#4583)
* Fix the "Developer Documentation" link.
 * Remove the "If you're a visitor" section - doesn't make sense for `vc dev` since there are no "visitors".
 * Don't link to `_logs` since it's not supported in `vc dev`. Instead direct the user to look at their terminal window to see error logs.
 * Link to new GH issue for non-app error 502 (I don't think this code path ever happens in `vc dev`, but might as well make it correct in case we do in the future).

<img width="1077" alt="Screen Shot 2020-06-05 at 4 15 16 PM" src="https://user-images.githubusercontent.com/71256/83929319-c7832a00-a747-11ea-9cae-b0adac97dfa5.png">
2020-06-05 23:20:33 +00:00
JJ Kasper
d2184628d1 Publish Canary
- vercel@19.0.2-canary.13
 - @vercel/go@1.1.2-canary.2
 - @vercel/next@2.6.3-canary.6
2020-06-05 14:52:45 -05:00
JJ Kasper
65f0cc6797 De-experimentalize shared lambdas optimization by default (#4519)
As discussed this de-experimentalizes the shared lambdas optimization now that we have tested it, it also bails out of the optimization when a `now.json` or `vercel.json` is detected that contains legacy routes
2020-06-05 19:51:21 +00:00
Nathan Rajlich
c628c7b58e [go] Fix typo in go-bridge import (#4578)
Introduced in 56c8af51b.
2020-06-05 13:09:26 +00:00
Steven
4e005274f9 Publish Canary
- @vercel/build-utils@2.3.2-canary.4
 - vercel@19.0.2-canary.12
2020-06-04 18:43:42 -04:00
Steven
482373f711 [cli][build-utils] Add support for custom 404.html for zero config deployments (#4563)
Next.js already has support for [customizing the 404 page](https://nextjs.org/docs/advanced-features/custom-error-page#customizing-the-404-page), but many other frameworks do not or they expect a 404.html in the output directory.

This PR adds support for rendering the a `404.html` page for all zero config deployments.

- Implements ch337
- Related to #3491
2020-06-04 22:36:41 +00:00
Nathan Rajlich
c80bb37e8d Publish Canary
- @vercel/frameworks@0.0.15-canary.4
 - @vercel/build-utils@2.3.2-canary.3
 - vercel@19.0.2-canary.11
 - @vercel/client@8.0.2-canary.2
 - @vercel/go@1.1.2-canary.1
 - @vercel/next@2.6.3-canary.5
 - @vercel/node-bridge@1.3.1-canary.2
 - @vercel/node@1.6.2-canary.5
 - @vercel/python@1.2.2-canary.2
 - @vercel/routing-utils@1.8.3-canary.5
 - @vercel/ruby@1.2.2-canary.1
 - @vercel/static-build@0.17.2-canary.1
2020-06-03 13:58:37 -07:00
Nathan Rajlich
a7acd92ffd [cli][client] Throw an error if both vercel.json and now.json exist (#4316)
* [client] Throw an error if both `vercel.json` and `now.json` exist

* Update packages/now-client/src/create-deployment.ts

Co-authored-by: Steven <steven@ceriously.com>

* Check in CLI as well

* Add integration test

* Add logic to `getLocalPathConfig()` as well

* Fix import path

Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-06-03 13:51:50 -07:00
Max Leiter
035720ca82 [cli] Prioritize index.html over other files named index (#4564)
Mirrors production more closely. Initially reported [on spectrum](https://spectrum.chat/zeit/now/statically-served-default-document-is-the-first-index-file-not-index-html~0ad66f8a-a139-4a0e-94d9-7e5ceb0fa043)
2020-06-03 19:56:36 +00:00
Nathan Rajlich
a6ae923a7a [all] Update TypeScript to v3.9.3 and regenerate yarn.lock file (#4565)
To fix GitHub Dependabot security alerts. See: https://github.com/vercel/vercel/network/alerts

<img width="835" alt="Screen Shot 2020-06-03 at 1 36 50 AM" src="https://user-images.githubusercontent.com/71256/83614929-b7e2c600-a53a-11ea-80b6-190e350283ac.png">

Also updates "typescript" to `3.9.3` for all packages, which is necessary because a downstream dependency is using syntax that requires a newer version of TypeScript.
2020-06-03 09:57:16 -07:00
Nathan Rajlich
83c0711d6e [node] Pass in the tsconfig.json file to startDevServer() (#4514)
So that if a `tsconfig.json` exists closer to the entrypoint file,
then that config file will be correctly used (rather than say, the
root-level `tsconfig.json` file, which may be specific to the frontend
configuration in Next.js for example).
2020-06-03 00:56:44 +00:00
Nathan Rajlich
231f18d56b [cli] Remove unnecessary build outputs (#4547)
Upon investigation into the `dist` dir, it appears that `ncc` is bundling some assets that don't need to be there. This change is a quick band-aid fix to remove those assets, without addressing the underlying cause of _why_ they're being bundled, which requires further investigation.

Overall about 1mb of disk space is saved.
2020-06-02 13:43:34 +00:00
Steven
9d73091d8c Publish Canary
- vercel@19.0.2-canary.10
 - @vercel/routing-utils@1.8.3-canary.4
2020-06-01 18:07:23 -04:00
Steven
0ca3189f79 [routing-utils] Fix headers with content-security-policy URL (#4550)
Fixes a case when the header value contains a URL which was mistaken for a named segment.

https://sentry.io/organizations/zeithq/issues/1702692084/?project=1351065

The regression was introduced in PR #4484 where unnamed segments were implemented for `redirects` and `rewrites` but not handled properly in `headers`.
2020-06-01 22:06:37 +00:00
Nathan Rajlich
9ff5bb9cb3 [cli] Throw an error if both .vercel and .now dirs exist (#4543) 2020-06-01 16:33:19 +00:00
Steven
45d05a603b Publish Canary
- @vercel/routing-utils@1.8.3-canary.3
2020-06-01 10:59:25 -04:00
Steven
6ef3b12fde [build-utils] Revert type of routing errors (#4549)
In PR #4498, the type of the routing error was changed from first error and then the remaining errors. This PR changes the type back such that `error.errors` returns all errors. This will avoid any breaking change.
2020-06-01 14:58:27 +00:00
Steven
b16f94098a Publish Canary
- vercel@19.0.2-canary.9
 - @vercel/routing-utils@1.8.3-canary.2
2020-06-01 08:29:32 -04:00
Steven
be315bebcf [routing-utils] Fix error when segment in query string (#4532)
This PR fixes an issue where the `destination` property defines a query string with a path segment that is not defined in the `source` property.
2020-05-30 00:07:05 +00:00
Steven
5608a4c42c [routing-utils] Improve error messages (#4498)
This PR improves the way we handle routing errors in a few ways:

- The error response is a single error (the first) instead of an array of errors when mixing routing properties
- The error message says which route index has the error
- The error includes `link` and `action` properties to match our API
- The error message for mixed routes with new routing properties has been updated per [ch341](https://app.clubhouse.io/vercel/story/341)

Related to #3491
2020-05-29 22:15:39 +00:00
Steven
66458fe3e0 [cli] Update zeit.ink to vercel.link shortener (#4531)
- Update `zeit.ink` to `vercel.link` shortener
- Support for `output.error()` action parameter
2020-05-29 16:46:35 -04:00
Steven
081b3fd3db Publish Canary
- @vercel/frameworks@0.0.15-canary.3
 - @vercel/build-utils@2.3.2-canary.2
 - @vercel/cgi@1.0.6-canary.0
 - vercel@19.0.2-canary.8
 - @vercel/client@8.0.2-canary.1
 - @vercel/go@1.1.2-canary.0
 - @vercel/next@2.6.3-canary.4
 - @vercel/node-bridge@1.3.1-canary.1
 - @vercel/node@1.6.2-canary.4
 - @vercel/python@1.2.2-canary.1
 - @vercel/routing-utils@1.8.3-canary.1
 - @vercel/ruby@1.2.2-canary.0
 - @vercel/static-build@0.17.2-canary.0
2020-05-28 13:59:24 -04:00
Steven
56c8af51b2 [all] Rename GitHub repo to vercel/vercel (#4506)
We renamed the GitHub repository from `zeit/now` to `vercel/vercel` so this PR updates all references to the repo URL.

There were also a few remaining references to Now CLI that have been updated to Vercel CLI.
2020-05-28 12:06:42 -04:00
Steven
e844a38286 [api] Fix download api (#4512)
The list examples api was updated in #4511 but we also need to update the download example api.
2020-05-27 17:49:46 -04:00
Andy
cfb84b5328 [api] Fix filename and update .vercelignore and vercel.json (#4511)
- Fix a filename in the examples API
- Rename .nowignore to .vercelignore
- Rename now.json to vercel.json
2020-05-27 17:19:15 -04:00
Steven
4c61779d1b [cli][client] Fix windows unit tests (#4509)
Follow up to #4463 to fix failing windows unit tests in `now-client`.
This also fixes `now-cli` tests that started failing after renaming the repo to `vercel/vercel`.
2020-05-27 16:57:17 -04:00
Steven
ee9b3710ec [build-utils] Remove --ignore-engines flag (#4508)
Follow up to #4444 that makes sure we run Next.js tests.

This `--ignore-engines` flag was originally added in https://github.com/vercel/now-builders/pull/463 as a workaround. We can remove it to make sure the version of Node selected will work with the dependencies.

Removing the flag also makes sure that Yarn 2 will work properly, see #4444.
2020-05-27 16:10:42 -04:00
Leo Lamprecht
719d1ffba9 Adjusted old company names (#4507) 2020-05-27 20:54:58 +02:00
Nathan Rajlich
6849e3aec0 [cli] Add additional logging to debug ECONNREFUSED error (#4396) 2020-05-27 16:43:34 +00:00
Sagnik Pradhan
dd2399f361 [build-utils] Fix Yarn 2 install argument order (#4444)
Fix for Yarn Version 2 install error. Positioned the arguments array in proper order #4436 

Co-authored-by: Steven <steven@ceriously.com>
2020-05-27 12:00:05 -04:00
JJ Kasper
684c229984 Publish Canary
- vercel@19.0.2-canary.7
 - @vercel/next@2.6.3-canary.3
 - @vercel/node@1.6.2-canary.3
 - @vercel/routing-utils@1.8.3-canary.0
2020-05-27 09:50:36 -05:00
JJ Kasper
e6c50e2efb [next][routing-utils] Fix unnamed multi-match custom route (#4484)
This adds a failing test for the regex from https://github.com/zeit/next.js/discussions/13347#discussion-4546 

It appears the reason the regex does not work when deployed on Vercel is due to us not indexing the un-named segments and instead we filter them out as noticed by @dav-is. 

This PR adds one approach to resolve this by accounting for the un-named indexes while not allowing them to be used in the destination still.
2020-05-26 23:29:48 +00:00
Steven
0b5d38e862 [cli] Add delay before updating Runtimes in background (#4495)
Similar to #4427 but instead of an option to turn on or off, we delay the background task that updates the Runtimes during development. The idea is that the initial install runs immediately using the bundled Runtimes from the CLI. Then if the user plans to keep developing, we'll check to see if we should update to the latest Runtime version after 30 seconds.
2020-05-26 20:45:21 +00:00
Steven
775e6b4856 [test] Fix cli test for handle miss querystring (#4492)
Follow up to #4346 which works fine locally on macOS but hangs in CI.

This PR modifies the test as a workaround.
2020-05-26 15:09:24 -04:00
Steven
3a9cf083cb [cli] Fix query string routes in dev (#4346)
This PR fixes an issue where the query string from the route destination was not observed.

Co-authored-by: Nathan Rajlich <n@n8.io>
2020-05-26 11:58:01 -04:00
Steven
6b58b56c49 [cli] Fix fork child process on dev (#4462)
When debugging the CLI with `--inspect`, the flag was being passed to the child process as well since #4254.

This PR prevents any arguments from being passed to the child process.
2020-05-26 15:15:00 +00:00
Nathan Rajlich
212cee19b4 [cli] Rename dev test fixtures to vercel.json and use @vercel (#4424)
Also regenerates the `yarn.lock` files via `yarn upgrade`.
2020-05-25 13:32:29 +00:00
Andy Bitz
c9d3ec21c2 Publish Canary
- @vercel/frameworks@0.0.15-canary.2
2020-05-23 03:43:13 +02:00
Andy
5fa8ed56a9 Revert "[frameworks][examples] Add Blitz.js (#4219)" (#4464)
This reverts commit 65446b73da.
2020-05-23 03:40:20 +02:00
Nathan Rajlich
ff80043acf [frameworks] Fix unit tests on Windows (#4463)
For some reason, the glob selector was causing problems on Windows:

```
[frameworks] Running yarn test-unit
$ jest --env node --verbose --runInBand --bail test/*unit.*test.*
No tests found, exiting with code 1
Run with `--passWithNoTests` to exit with code 0
In D:\a\now\now\packages\frameworks
  6 files checked.
  testMatch: **/__tests__/**/*.[jt]s?(x), **/?(*.)+(spec|test).[tj]s?(x) - 1 match
  testPathIgnorePatterns: \\node_modules\\ - 6 matches
  testRegex:  - 0 matches
Pattern: test\\*unit.*test.* - 0 matches
error Command failed with exit code 1.
```

Remove the glob pattern fixes the issue, though it's not clear why it
causes an issue in the first place.

See: https://github.com/zeit/now/runs/701043212
2020-05-22 17:48:11 -07:00
Nathan Rajlich
1f0ebcef24 [node] Fix req.on('data') events in startDevServer() (#4228)
By re-playing the events using `Bridge#launcher()` machinery, so it's
re-using more logic that is used in production, which is a good thing.
2020-05-23 00:39:44 +00:00
Andy Bitz
c35d0e8408 Publish Canary
- @vercel/frameworks@0.0.15-canary.1
2020-05-23 02:02:49 +02:00
Brandon Bayer
65446b73da [frameworks][examples] Add Blitz.js (#4219)
* Add Blitz.js to Frameworks

* update blitz example to latest version

* change blitz dependency to be `latest`

* Update packages/frameworks/frameworks.json

Co-authored-by: Andy <AndyBitz@users.noreply.github.com>

* update logo

Co-authored-by: Andy <AndyBitz@users.noreply.github.com>
Co-authored-by: Steven <steven@ceriously.com>
2020-05-23 01:55:03 +02:00
358 changed files with 49868 additions and 38653 deletions

28
.github/CODEOWNERS vendored
View File

@@ -1,27 +1,27 @@
# Documentation
# https://help.github.com/en/articles/about-code-owners
* @tootallnate
* @TooTallNate
/.github/workflows @AndyBitz @styfle
/packages/frameworks @AndyBitz
/packages/now-cli/src/commands/dev/ @tootallnate @styfle @AndyBitz
/packages/now-cli/src/util/dev/ @tootallnate @styfle @AndyBitz
/packages/now-cli/src/commands/domains/ @javivelasco @mglagola @anatrajkovska
/packages/now-cli/src/commands/certs/ @javivelasco @mglagola @anatrajkovska
/packages/now-cli/src/commands/dev @TooTallNate @styfle @AndyBitz
/packages/now-cli/src/util/dev @TooTallNate @styfle @AndyBitz
/packages/now-cli/src/commands/domains @javivelasco @mglagola @anatrajkovska
/packages/now-cli/src/commands/certs @javivelasco @mglagola @anatrajkovska
/packages/now-cli/src/commands/env @styfle @lucleray
/packages/now-client @rdev
/packages/now-build-utils @styfle @AndyBitz
/packages/now-node @styfle @tootallnate @lucleray
/packages/now-node-bridge @styfle @tootallnate @lucleray
/packages/now-client @rdev @styfle @TooTallNate
/packages/now-build-utils @styfle @AndyBitz @TooTallNate
/packages/now-node @styfle @TooTallNate @lucleray
/packages/now-node-bridge @styfle @TooTallNate @lucleray
/packages/now-next @Timer @ijjk
/packages/now-go @styfle @sophearak
/packages/now-python @styfle @sophearak
/packages/now-ruby @styfle @coetry @nathancahill
/packages/now-go @styfle @TooTallNate
/packages/now-python @styfle @TooTallNate
/packages/now-ruby @styfle @coetry @TooTallNate
/packages/now-static-build @styfle @AndyBitz
/packages/now-routing-utils @styfle @dav-is @ijjk
/examples @mcsdevv @timothyis
/examples/create-react-app @Timer
/examples/nextjs @timneutkens
/examples/nextjs @timneutkens @Timer
/examples/hugo @mcsdevv @timothyis @styfle
/examples/jekyll @mcsdevv @timothyis @sarupbanskota
/examples/jekyll @mcsdevv @timothyis @styfle
/examples/zola @mcsdevv @timothyis @styfle

View File

@@ -1,6 +1,6 @@
# Contributing
When contributing to this repository, please first discuss the change you wish to make via [GitHub Discussions](https://github.com/zeit/now/discussions/new) with the owners of this repository before submitting a Pull Request.
When contributing to this repository, please first discuss the change you wish to make via [GitHub Discussions](https://github.com/vercel/vercel/discussions/new) with the owners of this repository before submitting a Pull Request.
Please read our [code of conduct](CODE_OF_CONDUCT.md) and follow it in all your interactions with the project.
@@ -11,7 +11,7 @@ This project is configured in a monorepo pattern where one repo contains multipl
To get started, execute the following:
```
git clone https://github.com/zeit/now
git clone https://github.com/vercel/vercel
yarn install
yarn bootstrap
yarn build
@@ -82,24 +82,24 @@ trace(['path/to/entrypoint.js'], {
.then(e => console.error(e));
```
When you run this script, you'll see all imported files. If anything file is missing, the bug is in [@zeit/node-file-trace](https://github.com/zeit/node-file-trace) and not the Builder.
When you run this script, you'll see all imported files. If anything file is missing, the bug is in [@zeit/node-file-trace](https://github.com/vercel/node-file-trace) and not the Builder.
## Deploy a Builder with existing project
Sometimes you want to test changes to a Builder against an existing project, maybe with `now dev` or an actual deployment. You can avoid publishing every Builder change to npm by uploading the Builder as a tarball.
Sometimes you want to test changes to a Builder against an existing project, maybe with `vercel dev` or an actual deployment. You can avoid publishing every Builder change to npm by uploading the Builder as a tarball.
1. Change directory to the desired Builder `cd ./packages/now-node`
2. Run `yarn build` to compile typescript and other build steps
3. Run `npm pack` to create a tarball file
4. Run `now *.tgz` to upload the tarball file and get a URL
4. Run `vercel *.tgz` to upload the tarball file and get a URL
5. Edit any existing `vercel.json` project and replace `use` with the URL
6. Run `now` or `now dev` to deploy with the experimental Builder
6. Run `vercel` or `vercel dev` to deploy with the experimental Builder
## Add a New Framework
You can add support for a new Framework by creating a Pull Request for this repository and following the steps below:
1. Add the Framework to the `@now/frameworks` package: The file is located in `packages/frameworks/frameworks.json`. You can copy the structure of an existing one and adjust the required fields. Note that the `settings` property either contains a `value` or a `placeholder`. The `value` property is used when something is not configurable, the `placeholder` is used when something is configurable and can be changed with configuration. An example would be the Output Directory for Hugo, it's `public` by default but can be changed through its config file, so we use `placeholder` with an explanation of what can be used.
2. Add an example to the `examples/` directory: The name of the directory should equal the slug of the framework used in `@now/frameworks`. The `.github/EXAMPLE_README_TEMPLATE.md` file can be used to create a `README.md` file for the example.
3. Update the `@now/static-build` package: The file `packages/now-static-build/src/frameworks.ts` has to be extended. You can add default routes that will always be applied to projects that use this Framework or specify some paths that will be cached to speed up the build process.
1. Add the Framework to the `@vercel/frameworks` package: The file is located in `./packages/frameworks/frameworks.json`. You can copy the structure of an existing one and adjust the required fields. Note that the `settings` property either contains a `value` or a `placeholder`. The `value` property is used when something is not configurable, the `placeholder` is used when something is configurable and can be changed with configuration. An example would be the Output Directory for Hugo, it's `public` by default but can be changed through its config file, so we use `placeholder` with an explanation of what can be used.
2. Add an example to the `./examples` directory: The name of the directory should equal the slug of the framework used in `@vercel/frameworks`. The `.github/EXAMPLE_README_TEMPLATE.md` file can be used to create a `README.md` file for the example.
3. Update the `@vercel/static-build` package: The file `./packages/now-static-build/src/frameworks.ts` has to be extended. You can add default routes that will always be applied to projects that use this Framework or specify some paths that will be cached to speed up the build process.
4. After your Pull Request has been merged and released, other users can select the example on the Vercel dashboard and deploy it.

View File

@@ -6,14 +6,14 @@ This directory is a brief example of a [Name](site-link) site that can be deploy
Deploy your own [Name] project with Vercel.
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now-examples/tree/master/example-directory)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/example-directory)
### How We Created This Example
To get started with [Name] on Vercel, you can use the [CLI Tool Used](CLI-link) to initialize the project:
```shell
$ now init charge
$ vercel init [Name]]
```
### Deploying From Your Terminal
@@ -21,5 +21,5 @@ $ now init charge
Once initialized, you can deploy the [Name] example with just a single command:
```shell
$ now
$ vercel
```

View File

@@ -4,8 +4,8 @@ contact_links:
url: https://vercel.com/support/request
about: Report a bug using the Vercel support form
- name: Feature Request
url: https://github.com/zeit/now/discussions/new?category_id=66161
url: https://github.com/vercel/vercel/discussions/new?category_id=66161
about: Share ideas for new features
- name: Ask a Question
url: https://github.com/zeit/now/discussions/new?category_id=66160
url: https://github.com/vercel/vercel/discussions/new?category_id=66160
about: Ask the community for help

1
.gitignore vendored
View File

@@ -27,3 +27,4 @@ test/lib/deployment/failed-page.txt
/.env
/public
__pycache__
.vercel

View File

@@ -32,7 +32,7 @@ export analyze({
If you are using TypeScript, you should use the following types:
```ts
import { AnalyzeOptions } from '@now/build-utils'
import { AnalyzeOptions } from '@vercel/build-utils'
export analyze(options: AnalyzeOptions) {
return 'fingerprint goes here'
@@ -67,7 +67,7 @@ build({
If you are using TypeScript, you should use the following types:
```ts
import { BuildOptions } from '@now/build-utils'
import { BuildOptions } from '@vercel/build-utils'
export build(options: BuildOptions) {
// Build the code here
@@ -100,7 +100,7 @@ prepareCache({
If you are using TypeScript, you can import the types for each of these functions by using the following:
```ts
import { PrepareCacheOptions } from '@now/build-utils'
import { PrepareCacheOptions } from '@vercel/build-utils'
export prepareCache(options: PrepareCacheOptions) {
return { 'path-to-file': File }
@@ -109,7 +109,7 @@ export prepareCache(options: PrepareCacheOptions) {
### `shouldServe`
An **optional** exported function that is only used by `now dev` in [Now CLI](https:///download) and indicates whether a [Runtime](https://vercel.com/docs/runtimes) wants to be responsible for building a certain request path.
An **optional** exported function that is only used by `vercel dev` in [Vercel CLI](https:///download) and indicates whether a [Runtime](https://vercel.com/docs/runtimes) wants to be responsible for building a certain request path.
```js
shouldServe({
@@ -124,14 +124,14 @@ shouldServe({
If you are using TypeScript, you can import the types for each of these functions by using the following:
```ts
import { ShouldServeOptions } from '@now/build-utils'
import { ShouldServeOptions } from '@vercel/build-utils'
export shouldServe(options: ShouldServeOptions) {
return Boolean
}
```
If this method is not defined, Now CLI will default to [this function](https://github.com/zeit/now/blob/52994bfe26c5f4f179bdb49783ee57ce19334631/packages/now-build-utils/src/should-serve.ts).
If this method is not defined, Vercel CLI will default to [this function](https://github.com/vercel/vercel/blob/52994bfe26c5f4f179bdb49783ee57ce19334631/packages/now-build-utils/src/should-serve.ts).
### Runtime Options
@@ -147,7 +147,7 @@ The exported functions [`analyze`](#analyze), [`build`](#build), and [`prepareCa
## Examples
Check out our [Node.js Runtime](https://github.com/zeit/now/tree/master/packages/now-node), [Go Runtime](https://github.com/zeit/now/tree/master/packages/now-go), [Python Runtime](https://github.com/zeit/now/tree/master/packages/now-python) or [Ruby Runtime](https://github.com/zeit/now/tree/master/packages/now-ruby) for examples of how to build one.
Check out our [Node.js Runtime](https://github.com/vercel/vercel/tree/master/packages/now-node), [Go Runtime](https://github.com/vercel/vercel/tree/master/packages/now-go), [Python Runtime](https://github.com/vercel/vercel/tree/master/packages/now-python) or [Ruby Runtime](https://github.com/vercel/vercel/tree/master/packages/now-ruby) for examples of how to build one.
## Technical Details
@@ -171,14 +171,14 @@ The env and secrets specified by the user as `build.env` are passed to the Runti
### Utilities as peerDependencies
When you publish your Runtime to npm, make sure to not specify `@now/build-utils` (as seen below in the API definitions) as a dependency, but rather as part of `peerDependencies`.
When you publish your Runtime to npm, make sure to not specify `@vercel/build-utils` (as seen below in the API definitions) as a dependency, but rather as part of `peerDependencies`.
## Types
### `Files`
```ts
import { File } from '@now/build-utils';
import { File } from '@vercel/build-utils';
type Files = { [filePath: string]: File };
```
@@ -200,7 +200,7 @@ An example of a valid output `Files` object is:
This is an abstract type that can be imported if you are using TypeScript.
```ts
import { File } from '@now/build-utils';
import { File } from '@vercel/build-utils';
```
Valid `File` types include:
@@ -212,7 +212,7 @@ Valid `File` types include:
### `FileRef`
```ts
import { FileRef } from '@now/build-utils';
import { FileRef } from '@vercel/build-utils';
```
This is a [JavaScript class](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes) that represents an abstract file instance stored in our platform, based on the file identifier string (its checksum). When a `Files` object is passed as an input to `analyze` or `build`, all its values will be instances of `FileRef`.
@@ -229,7 +229,7 @@ This is a [JavaScript class](https://developer.mozilla.org/en-US/docs/Web/JavaSc
### `FileFsRef`
```ts
import { FileFsRef } from '@now/build-utils';
import { FileFsRef } from '@vercel/build-utils';
```
This is a [JavaScript class](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes) that represents an abstract instance of a file present in the filesystem that the build process is executing in.
@@ -247,7 +247,7 @@ This is a [JavaScript class](https://developer.mozilla.org/en-US/docs/Web/JavaSc
### `FileBlob`
```ts
import { FileBlob } from '@now/build-utils';
import { FileBlob } from '@vercel/build-utils';
```
This is a [JavaScript class](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes) that represents an abstract instance of a file present in memory.
@@ -265,7 +265,7 @@ This is a [JavaScript class](https://developer.mozilla.org/en-US/docs/Web/JavaSc
### `Lambda`
```ts
import { Lambda } from '@now/build-utils';
import { Lambda } from '@vercel/build-utils';
```
This is a [JavaScript class](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), called a Serverless Function, that can be created by supplying `files`, `handler`, `runtime`, and `environment` as an object to the [`createLambda`](#createlambda) helper. The instances of this class should not be created directly. Instead, invoke the [`createLambda`](#createlambda) helper function.
@@ -293,20 +293,20 @@ This is an abstract enumeration type that is implemented by one of the following
## JavaScript API
The following is exposed by `@now/build-utils` to simplify the process of writing Runtimes, manipulating the file system, using the above types, etc.
The following is exposed by `@vercel/build-utils` to simplify the process of writing Runtimes, manipulating the file system, using the above types, etc.
### `createLambda`
Signature: `createLambda(Object spec) : Lambda`
```ts
import { createLambda } from '@now/build-utils';
import { createLambda } from '@vercel/build-utils';
```
Constructor for the [`Lambda`](#lambda) type.
```js
const { createLambda, FileBlob } = require('@now/build-utils');
const { createLambda, FileBlob } = require('@vercel/build-utils');
await createLambda({
runtime: 'nodejs8.10',
handler: 'index.main',
@@ -321,7 +321,7 @@ await createLambda({
Signature: `download() : Files`
```ts
import { download } from '@now/build-utils';
import { download } from '@vercel/build-utils';
```
This utility allows you to download the contents of a [`Files`](#files) data structure, therefore creating the filesystem represented in it.
@@ -339,7 +339,7 @@ await download(files, workPath, meta);
Signature: `glob() : Files`
```ts
import { glob } from '@now/build-utils';
import { glob } from '@vercel/build-utils';
```
This utility allows you to _scan_ the filesystem and return a [`Files`](#files) representation of the matched glob search string. It can be thought of as the reverse of [`download`](#download).
@@ -347,7 +347,7 @@ This utility allows you to _scan_ the filesystem and return a [`Files`](#files)
The following trivial example downloads everything to the filesystem, only to return it back (therefore just re-creating the passed-in [`Files`](#files)):
```js
const { glob, download } = require('@now/build-utils')
const { glob, download } = require('@vercel/build-utils')
exports.build = ({ files, workPath }) => {
await download(files, workPath)
@@ -360,7 +360,7 @@ exports.build = ({ files, workPath }) => {
Signature: `getWriteableDirectory() : String`
```ts
import { getWriteableDirectory } from '@now/build-utils';
import { getWriteableDirectory } from '@vercel/build-utils';
```
In some occasions, you might want to write to a temporary directory.
@@ -370,13 +370,13 @@ In some occasions, you might want to write to a temporary directory.
Signature: `rename(Files) : Files`
```ts
import { rename } from '@now/build-utils';
import { rename } from '@vercel/build-utils';
```
Renames the keys of the [`Files`](#files) object, which represent the paths. For example, to remove the `*.go` suffix you can use:
```js
const rename = require('@now/build-utils')
const rename = require('@vercel/build-utils')
const originalFiles = { 'one.go': fileFsRef1, 'two.go': fileFsRef2 }
const renamedFiles = rename(originalFiles, path => path.replace(/\.go$/, '')
```

View File

@@ -175,7 +175,7 @@ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
END OF TERMS AND CONDITIONS
Copyright 2017 ZEIT, Inc.
Copyright 2017 Vercel, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.

View File

@@ -6,8 +6,8 @@
<p align="center">Develop. Preview. Ship.</p>
</p>
[![CI Status](https://badgen.net/github/checks/zeit/now?label=CI)](https://github.com/zeit/now/actions?workflow=CI)
[![Join the community on GitHub Discussions](https://badgen.net/badge/join%20the%20discussion/on%20github/black?icon=github)](https://github.com/zeit/now/discussions)
[![CI Status](https://badgen.net/github/checks/vercel/vercel?label=CI)](https://github.com/vercel/vercel/actions?workflow=CI)
[![Join the community on GitHub Discussions](https://badgen.net/badge/join%20the%20discussion/on%20github/black?icon=github)](https://github.com/vercel/vercel/discussions)
## Usage
@@ -31,4 +31,4 @@ As always, you should use `yarn test-unit` to run the tests and see if your chan
## How to Create a Release
If you have write access to this repository, you can read more about how to publish a release [here](https://github.com/zeit/now/wiki/Creating-a-Release).
If you have write access to this repository, you can read more about how to publish a release [here](https://github.com/vercel/vercel/wiki/Creating-a-Release).

View File

@@ -51,7 +51,8 @@ export async function getGitHubRepoInfo(repo: Repo) {
data.subdir = repo.path.slice(subdirPath.length).split('/');
}
if (data.id === 'zeit/now' && data.subdir && data.subdir[0] === 'examples') {
if (data.id === 'vercel/vercel' && data.subdir && data.subdir[0] === 'examples') {
// from our examples, add `homepage` and `description` fields
const example = data.subdir[1];
const exampleList = await getExampleList();

View File

@@ -45,8 +45,8 @@ export default withApiHandler(async function(req: NowRequest, res: NowResponse)
const example = segment.slice(0, -ext.length);
await extract('https://github.com/zeit/now/archive/master.zip', TMP_DIR);
const directory = `${TMP_DIR}/now-master/examples/${example}`;
await extract('https://github.com/vercel/vercel/archive/master.zip', TMP_DIR);
const directory = `${TMP_DIR}/vercel-master/examples/${example}`;
if (!isDirectory(directory)) {
return notFound(res, `Example '${example}' was not found.`);

View File

@@ -1,5 +1,5 @@
// A proxy to get the basic info of an existing github/gitlab repo:
// GET /info?repo=zeit/micro
// GET /info?repo=vercel/micro
// @ts-ignore
import parseGitUrl from 'parse-github-url';

View File

@@ -8,8 +8,8 @@ export default withApiHandler(async function(
req: NowRequest,
res: NowResponse
) {
await extract('https://github.com/zeit/now/archive/master.zip', '/tmp');
const exampleList = summary('/tmp/now-master/examples');
await extract('https://github.com/vercel/vercel/archive/master.zip', '/tmp');
const exampleList = summary('/tmp/vercel-master/examples');
const existingExamples = Array.from(exampleList).map(key => ({
name: key,

View File

@@ -2,7 +2,7 @@
"name": "api",
"private": true,
"version": "0.0.0",
"description": "API for the zeit/now repo",
"description": "API for the vercel/vercel repo",
"main": "index.js",
"scripts": {
"build": "yarn --cwd .. && node ../utils/run.js build all"

View File

@@ -33,5 +33,5 @@ When passing multiple `--regions` as a CLI parameter,
make sure they're separated by a comma (`,`). For example:
```console
now --regions sfo,bru,gru
vercel --regions sfo,bru,gru
```

View File

@@ -8,13 +8,13 @@ The domain you supplied cannot be verified using either the intended set of name
Apply the intended set of nameservers to your domain or add the given TXT verification record through your domain provider.
You can retrieve both the intended nameservers and TXT verification record for the domain you wish to verify by running `now domains inspect <domain>`.
You can retrieve both the intended nameservers and TXT verification record for the domain you wish to verify by running `vercel domains inspect <domain>`.
When you have added either verification method to your domain, you can run `now domains verify <domain>` again to complete verification for your domain.
When you have added either verification method to your domain, you can run `vercel domains verify <domain>` again to complete verification for your domain.
Vercel will also automatically check periodically that your domain has been verified and automatically mark it as such if we detect either verification method on the domain.
If you would not like to verify your domain, you can remove it from your account using `now domains rm <domain>`.
If you would not like to verify your domain, you can remove it from your account using `vercel domains rm <domain>`.
#### Resources

View File

@@ -9,9 +9,9 @@ You specified the `--env` or `-e` flag with the value of a secret. However, the
Make sure to specify the environment variable and secret like that:
```bash
now -e VARIABLE_NAME=@secret-name
vercel -e VARIABLE_NAME=@secret-name
```
In addition, ensure that the secret (`@secret-name` in the example above) exists in the current scope (the team or user account that you're using).
You can run `now switch` or `--scope` to switch to a different team or user.
You can run `vercel switch` or `--scope` to switch to a different team or user.

View File

@@ -6,4 +6,4 @@ You specified a path as the value for the `--dotenv` flag, but the target of the
#### Possible Ways to Fix It
Make sure the target file you've specified exists and is readable by Now CLI. In addition, please ensure that the filename starts with a dot (example: `.env`) - then it should work.
Make sure the target file you've specified exists and is readable by Vercel CLI. In addition, please ensure that the filename starts with a dot (example: `.env`) - then it should work.

View File

@@ -2,17 +2,17 @@
#### Why This Error Occurred
You ran `now dev` inside a project that contains a `vercel.json` file with `env` or `build.env` properties that use [Now Secrets](https://vercel.com/docs/v2/build-step#environment-variables).
You ran `vercel dev` inside a project that contains a `vercel.json` file with `env` or `build.env` properties that use [Vercel Secrets](https://vercel.com/docs/v2/build-step#environment-variables).
In order to use environment variables in your project locally that have values defined using the Now Secrets format (e.g. `@my-secret-value`), you will need to provide the value as an environment variable using a `.env` or `.env.build` file.
In order to use environment variables in your project locally that have values defined using the Vercel Secrets format (e.g. `@my-secret-value`), you will need to provide the value as an environment variable using a `.env`.
We require this to ensure your app works as you intend it to, in the Now Dev environment, and to provide you with a way to mirror or separate private environment variables within your applications, for example when connecting to a database.
We require this to ensure your app works as you intend it to, in the development environment, and to provide you with a way to mirror or separate private environment variables within your applications, for example when connecting to a database.
Read below for how to address this error.
#### Possible Ways to Fix It
The error message will list environment variables that are required and which file they are required to be included in (either `.env` or `.env.build`).
The error message will list environment variables that are required and which file they are required to be included in `.env`.
If the file does not exist yet, please create the file that the error message mentions and insert the missing environment variable into it.

View File

@@ -9,11 +9,11 @@ You specified the `--env` or `-e` flag and didn't add a name and value for the e
Make sure to set the name and value of the variable like this:
```bash
now -e VARIABLE_NAME="VALUE"
vercel -e VARIABLE_NAME="VALUE"
```
You can also specify a environment variable that contains a secret:
```bash
now -e VARIABLE_NAME=@secret-name
vercel -e VARIABLE_NAME=@secret-name
```

View File

@@ -8,4 +8,4 @@ The `--scope` flag was specified, but there's no value for it available.
In order to make it work, you need to specify a value for the `--scope` flag. This needs to be the slug or ID of the team as which you'd like to act or the username or ID of a user you'd like to act as.
As an example, if your team URL is `https://vercel.com/teams/zeit`, you would set `--scope` to `zeit`.
As an example, if your team URL is `https://vercel.com/my-team`, you would set `--scope` to `my-team`.

View File

@@ -0,0 +1,14 @@
# `@vercel/next` Functions Config Optimized Lambdas Opt-out
#### Why This Warning Occurred
`@vercel/next` by default now bundles pages into optimized functions, minimizing bootup time and increasing overall application throughput.
When the `functions` config is added in `now.json` or `vercel.json`, it causes conflicts with this optimization, so it is opted-out.
#### Possible Ways to Fix It
Remove the `functions` config from your `now.json` or `vercel.json` to take advantage of this optimization.
### Useful Links
- [Functions Config Documentation](https://vercel.com/docs/configuration?query=functions#project/functions)

View File

@@ -0,0 +1,16 @@
# `@vercel/next` Legacy Routes Optimized Lambdas Opt-out
#### Why This Warning Occurred
`@vercel/next` by default now bundles pages into optimized functions, minimizing bootup time and increasing overall application throughput.
When legacy `routes` are added in `now.json` or `vercel.json`, they cause conflicts with this optimization, so it is opted-out.
#### Possible Ways to Fix It
Migrate from using legacy `routes` to the new `rewrites`, `redirects`, and `headers` configurations in your `now.json` or `vercel.json` file or leverage them directly in your `next.config.js` with the built-in [custom routes support](https://github.com/zeit/next.js/issues/9081)
### Useful Links
- [Rewrites Documentation](https://vercel.com/docs/configuration?query=rewrites#project/rewrites)
- [Redirects Documentation](https://vercel.com/docs/configuration?query=rewrites#project/redirects)
- [Headers Documentation](https://vercel.com/docs/configuration?query=rewrites#project/headers)

View File

@@ -2,7 +2,7 @@
#### Why This Error Occurred
You're running Now CLI in a non-terminal context and there are no credentials available. This means that Now CLI is not able to authenticate against our service.
You're running Vercel CLI in a non-terminal context and there are no credentials available. This means that Vercel CLI is not able to authenticate against our service.
#### Possible Ways to Fix It

View File

@@ -2,10 +2,10 @@
#### Why This Error Occurred
You tried to run a command that doesn't allow the `--token` flag (like `now switch`). This is not allowed because commands like these are influencing the configuration files.
You tried to run a command that doesn't allow the `--token` flag (like `vercel switch`). This is not allowed because commands like these are influencing the configuration files.
In turn, they would have to take the value of the `--token` flag into consideration (which is not a good idea, because flags in Now CLI should never change the configuration).
In turn, they would have to take the value of the `--token` flag into consideration (which is not a good idea, because flags in Vercel CLI should never change the configuration).
#### Possible Ways to Fix It
Specify a value for the `--scope` flag. This needs to be the slug or ID of the team as which you'd like to act (as an example, if your team URL is `https://vercel.com/teams/zeit`, the value can be `zeit`) or the username or ID of a user you'd like to act as.
Specify a value for the `--scope` flag. This needs to be the slug or ID of the team as which you'd like to act (as an example, if your team URL is `https://vercel.com/my-team`, the value can be `my-team`) or the username or ID of a user you'd like to act as.

View File

@@ -1,8 +1,8 @@
# `now dev` as `dev` script
# `vercel dev` as `dev` script
#### Why This Error Occurred
The `package.json` file of the used project invokes `now dev` as `dev` script. This would cause `now dev` to recursively invoke itself.
The `package.json` file of the used project invokes `vercel dev` as `dev` script. This would cause `vercel dev` to recursively invoke itself.
#### Possible Ways to Fix It

View File

@@ -20,9 +20,9 @@ Legacy:
Serverless:
- Minimal lambda size of `49Kb` (approximately)
- Uses Next.js build targets (`target: 'serverless'`) in `next.config.js`. [documentation](https://github.com/zeit/next.js#summary)
- Uses Next.js build targets (`target: 'serverless'`) in `next.config.js`. [documentation](https://github.com/vercel/next.js#summary)
- Does not make changes to your application dependencies
- Does not load `next.config.js` ([as per the serverless target documentation](https://github.com/zeit/next.js#summary))
- Does not load `next.config.js` ([as per the serverless target documentation](https://github.com/vercel/next.js#summary))
- Runs `npm install`
- Runs `npm run now-build`
- Does not run `npm install --production` as the output from the build is all that's needed to bundle lambdas.
@@ -69,4 +69,4 @@ module.exports = {
### Useful Links
- [Serverless target implementation](https://github.com/zeit/now-builders/pull/150)
- [Serverless target implementation](https://github.com/vercel/now-builders/pull/150)

View File

@@ -1,22 +1,22 @@
# `@now/static-build` Failed to detect a server running
# `@vercel/static-build` Failed to detect a server running
#### Why This Warning Occurred
When running `now dev`, the `@now/static-build` builder proxies relevant HTTP
requests to the server that is created by the `now-dev` script in the
When running `vercel dev`, the `@vercel/static-build` builder proxies relevant HTTP
requests to the server that is created by the `dev` script in the
`package.json` file.
In order for `now dev` to know which port the server is running on, the builder
In order for `vercel dev` to know which port the server is running on, the builder
is provided a `$PORT` environment variable that the server _must_ bind to. The
error "Failed to detect a server running on port" is printed if the builder fails
to detect a server listening on that specific port within five minutes.
#### Possible Ways to Fix It
Please ensure that your `now-dev` script binds the spawned development server on
Please ensure that your `dev` script binds the spawned development server on
the provided `$PORT` that the builder expects the server to bind to.
For example, if you are using Gatsby, your `now-dev` script must use the `-p`
For example, if you are using Gatsby, your `dev` script must use the `-p`
(port) option to bind to the `$PORT` specified from the builder:
> _In Windows environments, reference the `PORT` environment variable with `%PORT%`_
@@ -26,7 +26,7 @@ For example, if you are using Gatsby, your `now-dev` script must use the `-p`
...
"scripts": {
...
"now-dev": "gatsby develop -p $PORT"
"dev": "gatsby develop -p $PORT"
}
}
```

View File

@@ -2,7 +2,7 @@
#### Why This Error Occurred
You either tried to run Now CLI inside a directory that should never be deployed, or you specified a directory that should never be deployed like this: `now <directory>`.
You either tried to run Vercel CLI inside a directory that should never be deployed, or you specified a directory that should never be deployed like this: `vercel <directory>`.
#### Possible Ways to Fix It

View File

@@ -2,14 +2,14 @@
#### Why This Error Occurred
When supplying a region or DC identifier in `now scale`,
When supplying a region or DC identifier in `vercel scale`,
we weren't able to recognize the value as valid.
#### Possible Ways to Fix It
Check your `now scale` command make sure you are using a
Check your `vercel scale` command make sure you are using a
valid string after the URL. Regions
and DCs have to be in *lowercase*.
and DCs have to be in _lowercase_.
**Valid region identifiers**:
@@ -19,7 +19,7 @@ and DCs have to be in *lowercase*.
- `gru`
- `iad`
In `now-cli`, they currently are transformed to
In Vercel CLI, they currently are transformed to
DC identifiers before being sent to our APIs.
**Valid DC identifiers**:
@@ -32,5 +32,5 @@ DC identifiers before being sent to our APIs.
To pass multiple ones, use a comma:
```
now scale my-url-123.now.sh sfo,bru,gru 1 5
vercel scale my-url-123.now.sh sfo,bru,gru 1 5
```

View File

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

View File

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

View File

@@ -6,5 +6,5 @@ You specified the `--scope` flag and specified the ID or slug of a team that you
#### Possible Ways to Fix It
- Make sure commands like `now ls` work just fine. This will ensure that your user credentials are valid. If it's not working correctly, please log in again using `now login`.
- Ensure that the scope you specified using `--scope` shows up in the output of `now switch`. If it doesn't, you're either not part of the team (if you specified a team) or you logged into the wrong user account.
- Make sure commands like `vercel ls` work just fine. This will ensure that your user credentials are valid. If it's not working correctly, please log in again using `vercel login`.
- Ensure that the scope you specified using `--scope` shows up in the output of `vercel switch`. If it doesn't, you're either not part of the team (if you specified a team) or you logged into the wrong user account.

View File

@@ -6,4 +6,4 @@ You tried to add or update a domain's configuration, but you don't have permissi
#### Possible Ways to Fix It
If you or your team owns the domain, then you are most likely in the wrong context. Use `now switch` to select the team or user that owns the domain.
If you or your team owns the domain, then you are most likely in the wrong context. Use `vercel switch` to select the team or user that owns the domain.

View File

@@ -12,5 +12,5 @@ or from a previous deployment who's alias you're trying to overwrite) has
the `min` scale setting set to `0`. You can do this by running
```
now scale <deployment> 0 10
vercel scale <deployment> 0 10
```

View File

@@ -20,10 +20,10 @@ If you think your code is taking too long to instantiate, this can be due
to slow boot up times. You can supply `--no-verify` to skip verification
if you are confident your code runs properly.
If your application is not listening on a HTTP port, we might be failing to
If your application is not listening on a HTTP port, we might be failing to
instantiate your deployment as well. It might not be showing any errors,
but the deployment instance is effectively not routable and cannot be
verified.
If your instances are crashing before an HTTP port is exposed, verification
will fail as well. Double check your logs (e.g.: by running `now logs <url>`)
will fail as well. Double check your logs (e.g.: by running `vercel logs <url>`)

46
examples/README.md vendored
View File

@@ -14,43 +14,43 @@ Vercel is a cloud platform for static frontends and serverless functions. It ena
This repository consists of multiple examples, created for use with the [Vercel](https://vercel.com) platform. In addition to this, it also contains:
- [Code of Conduct](https://github.com/zeit/now/blob/master/.github/CODE_OF_CONDUCT.md) - our Code of Conduct, adapted from the [Contributor Covenant](http://contributor-covenant.org)
- [Contributing Guidelines](https://github.com/zeit/now/blob/master/.github/CONTRIBUTING.md) - a guide on how to contribute to the Now Examples repository
- [License](https://github.com/zeit/now/blob/master/LICENSE) - the standard MIT license under which these examples are published
- [Code of Conduct](https://github.com/vercel/vercel/blob/master/.github/CODE_OF_CONDUCT.md) - our Code of Conduct, adapted from the [Contributor Covenant](http://contributor-covenant.org)
- [Contributing Guidelines](https://github.com/vercel/vercel/blob/master/.github/CONTRIBUTING.md) - a guide on how to contribute to the examples repository
- [License](https://github.com/vercel/vercel/blob/master/LICENSE) - the standard MIT license under which these examples are published
We recommend familiarizing yourself with the above sections, particularly if you are looking to make a contribution.
## Deploying Examples
To get started using any of these examples as your own project, [install Now](https://vercel.com/download) and use either of the following commands in your terminal:
To get started using any of these examples as your own project, [install Vercel](https://vercel.com/download) and use either of the following commands in your terminal:
```sh
now init # Pick an example in the CLI
now init <example> # Create a new project from a specific <example>
now init <example> <name> # Create a new project from a specific <example> with a different folder <name>
vercel init # Pick an example in the CLI
vercel init <example> # Create a new project from a specific <example>
vercel init <example> <name> # Create a new project from a specific <example> with a different folder <name>
```
Deploying your project takes seconds and can be done with **just a single command**:
```sh
now # Deploys the project with Now
vercel # Deploy your project with the CLI
```
With the `now` command, your project will be built and served by Now, providing you with a URL that can be shared immediately.
With the `vercel` command, your project will be built and served by Vercel, providing you with a URL that can be shared immediately.
## New Examples
We are continuously improving our examples based on best practices and feedback from the community. As a result, it is possible that example names will change and on occasion deprecated in favor of an improved implementation.
For example, the previous `nodejs` example showed a static frontend with a Node.js API. This is illustrated now in the `svelte` example. Below is a table that lists some of the most popular previous examples and the equivalent replacement:
For example, the previous `nodejs` example showed a static frontend with a Node.js API. This is illustrated in the `svelte` example. Below is a table that lists some of the most popular previous examples and the equivalent replacement:
| Previous Example | New Example |
| ----------------- | ------------------------------------------------------------------------------------- |
| **monorepo** | [gatsby-functions](https://github.com/zeit/now/tree/master/examples/gatsby) |
| **nodejs** | [svelte-functions](https://github.com/zeit/now/tree/master/examples/svelte) |
| **nextjs-static** | [nextjs](https://github.com/zeit/now/tree/master/examples/nextjs) |
| **vanilla-go** | [create-react-app](https://github.com/zeit/now/tree/master/examples/create-react-app) |
| **typescript** | [gatsby-functions](https://github.com/zeit/now/tree/master/examples/gatsby) |
| Previous Example | New Example |
| ----------------- | ------------------------------------------------------------------------------------------ |
| **monorepo** | [gatsby-functions](https://github.com/vercel/vercel/tree/master/examples/gatsby) |
| **nodejs** | [svelte-functions](https://github.com/vercel/vercel/tree/master/examples/svelte) |
| **nextjs-static** | [nextjs](https://github.com/vercel/vercel/tree/master/examples/nextjs) |
| **vanilla-go** | [create-react-app](https://github.com/vercel/vercel/tree/master/examples/create-react-app) |
| **typescript** | [gatsby-functions](https://github.com/vercel/vercel/tree/master/examples/gatsby) |
## Migrating and Upgrading
@@ -60,15 +60,15 @@ If you would like to upgrade a project to take advantage of zero configuration,
## How to Contribute
Contributing to Now Examples should be an enjoyable experience, as such we have created a set of [contributing guidelines](https://github.com/zeit/docs/blob/master/CONTRIBUTING.md) to help you do so.
Contributing examples should be an enjoyable experience, as such we have created a set of [contributing guidelines](https://github.com/vercel/vercel/blob/master/.github/CONTRIBUTING.md) to help you do so.
The guidelines cover important information such as the requirements for new examples and where to get help if you have any questions.
We have tried to make contributing to Now Examples as easy as possible, especially for those new to Open Source. If anything is unclear or you have any questions then please reach out to us on [GitHub Discussions](https://github.com/zeit/now/discussions) where we will do our best to help you.
We have tried to make contributing to examples as easy as possible, especially for those new to Open Source. If anything is unclear or you have any questions then please reach out to us on [GitHub Discussions](https://github.com/vercel/vercel/discussions) where we will do our best to help you.
## Reporting Issues
We actively encourage our community to raise issues and provide feedback on areas of Now Examples that could be improved.
We actively encourage our community to raise issues and provide feedback on areas of examples that could be improved.
An issue can be raised by clicking the 'Issues' tab at the top of the repository, followed by the Green 'New issue' button.
@@ -76,10 +76,10 @@ When submitting an issue, please thoroughly and concisely describe the problem y
## License
Now Examples is an open source project released under the [MIT License](https://github.com/zeit/docs/blob/master/LICENSE.md).
This repository is an open source project. See the [License](https://github.com/vercel/vercel/blob/master/LICENSE).
## Get In Touch
If you have any questions that are not covered by raising an issue then please get in touch with us on [GitHub Discussions](https://github.com/zeit/now/discussions). There you will find both members of the community and staff who are happy to help answer questions on anything Vercel related.
If you have any questions that are not covered by raising an issue then please get in touch with us on [GitHub Discussions](https://github.com/vercel/vercel/discussions). There you will find both members of the community and staff who are happy to help answer questions on anything Vercel related.
[![Join the community on GitHub Discussions](https://badgen.net/badge/join%20the%20discussion/on%20github/black?icon=github)](https://github.com/zeit/now/discussions)
[![Join the community on GitHub Discussions](https://badgen.net/badge/join%20the%20discussion/on%20github/black?icon=github)](https://github.com/vercel/vercel/discussions)

View File

@@ -6,7 +6,7 @@ This directory is a brief example of an [AMP](https://amp.dev/) site that can be
Deploy your own AMP project with Vercel.
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/amp)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/amp)
_Live Example: https://amp.now-examples.now.sh_

View File

@@ -1,4 +1,4 @@
![Angular Logo](https://github.com/zeit/now/blob/master/packages/frameworks/logos/angular.svg)
![Angular Logo](https://github.com/vercel/vercel/blob/master/packages/frameworks/logos/angular.svg)
# Angular Example
@@ -8,7 +8,7 @@ This directory is a brief example of an [Angular](https://angular.io/) app that
Deploy your own Angular project with Vercel.
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/angular)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/angular)
_Live Example: https://angular.now-examples.now.sh_

View File

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

View File

@@ -1,4 +1,4 @@
![React Logo](https://github.com/zeit/now/blob/master/packages/frameworks/logos/react.svg)
![React Logo](https://github.com/vercel/vercel/blob/master/packages/frameworks/logos/react.svg)
# React Example
@@ -8,7 +8,7 @@ This directory is a brief example of a [React](https://reactjs.org/) app with [S
Deploy your own React project, along with Serverless Functions, with Vercel.
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/create-react-app-functions)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/create-react-app-functions)
_Live Example: https://create-react-app.now-examples.now.sh/_

View File

@@ -28,7 +28,7 @@ function App() {
</h2>
<p>
<a
href="https://github.com/zeit/now/tree/master/examples/create-react-app"
href="https://github.com/vercel/vercel/tree/master/examples/create-react-app"
target="_blank"
rel="noreferrer noopener"
>

View File

@@ -6,7 +6,7 @@ This directory is a brief example of using a Custom Build script that can be dep
Deploy your own Custom Built project with Vercel.
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/custom-build)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/custom-build)
_Live Example: https://custom-build.now-examples.now.sh_
@@ -15,7 +15,7 @@ _Live Example: https://custom-build.now-examples.now.sh_
To get started deploying a Custom Built project with Vercel, you can use the [Vercel CLI](https://vercel.com/download) to initialize the project:
```shell
$ now init custom-build
$ vercel init custom-build
```
### Deploying From Your Terminal

View File

@@ -6,7 +6,7 @@ This directory is a brief example of a [Docusaurus](https://v2.docusaurus.io) si
Deploy your own Docusaurus project with Vercel.
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now-examples/tree/master/docusaurus-2)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/docusaurus-2)
### How We Created This Example

View File

@@ -1,4 +1,4 @@
![Docusaurus Logo](https://github.com/zeit/now/blob/master/packages/frameworks/logos/docusaurus.svg)
![Docusaurus Logo](https://github.com/vercel/vercel/blob/master/packages/frameworks/logos/docusaurus.svg)
# Docusaurus Example
@@ -8,7 +8,7 @@ This directory is a brief example of a [Docusaurus](https://docusaurus.io/) site
Deploy your own Docusaurus project with Vercel.
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/docusaurus)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/docusaurus)
_Live Example: https://docusaurus.now-examples.now.sh_

View File

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

View File

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

View File

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

View File

@@ -1,4 +1,4 @@
![Gatsby Logo](https://github.com/zeit/now/blob/master/packages/frameworks/logos/gatsby.svg)
![Gatsby Logo](https://github.com/vercel/vercel/blob/master/packages/frameworks/logos/gatsby.svg)
# Gatsby Example
@@ -8,7 +8,7 @@ This directory is a brief example of a [Gatsby](https://www.gatsbyjs.org/) app w
Deploy your own Gatsby project, along with Serverless Functions, with Vercel.
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/gatsby)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/gatsby)
_Live Example: https://gatsby.now-examples.now.sh_

View File

@@ -31,7 +31,7 @@ function Index() {
</h2>
<p>
<a
href="https://github.com/zeit/now-examples/blob/master/gatsby-functions"
href="https://github.com/vercel/vercel/blob/master/gatsby"
target="_blank"
rel="noreferrer noopener"
>

View File

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

View File

@@ -1,4 +1,4 @@
![Hexo Logo](https://github.com/zeit/now/blob/master/packages/frameworks/logos/hexo.svg)
![Hexo Logo](https://github.com/vercel/vercel/blob/master/packages/frameworks/logos/hexo.svg)
# Hexo Example
@@ -8,7 +8,7 @@ This directory is a brief example of a [Hexo](https://hexo.io/) site that can be
Deploy your own Hexo project with Vercel.
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/hexo)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/hexo)
_Live Example: https://hexo.now-examples.now.sh_

View File

@@ -6,7 +6,7 @@ This directory is a brief example of a [Hugo](https://gohugo.io/) app that can b
Deploy your own Hugo project with Vercel.
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/hugo)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/hugo)
_Live Example: https://hugo.now-examples.now.sh_

View File

@@ -6,7 +6,7 @@ This directory is a brief example of an [Ionic Angular](https://ionicframework.c
Deploy your own Ionic Angular project with Vercel.
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/ionic-angular)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/ionic-angular)
_Live Example: https://ionic-angular.now-examples.now.sh_

View File

@@ -6,7 +6,7 @@ This directory is a brief example of an [Ionic React](https://ionicframework.com
Deploy your own Ionic React project with Vercel.
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/ionic-react)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/ionic-react)
_Live Example: https://ionic-react.now-examples.now.sh_

View File

@@ -6,7 +6,7 @@ This directory is a brief example of a [Jekyll](https://jekyllrb.com/) site that
Deploy your own Jekyll project with Vercel.
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/jekyll)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/jekyll)
_Live Example: https://jekyll.now-examples.now.sh_

View File

@@ -6,7 +6,7 @@ This directory is a brief example of a [Middleman](https://middlemanapp.com/) si
Deploy your own Middleman project with Vercel.
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/middleman)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/middleman)
_Live Example: https://middleman.now-examples.now.sh_

View File

@@ -6,7 +6,7 @@ This directory is a brief example of a [Nuxt.js](https://nuxtjs.org) app that ca
Deploy your own Nuxt.js project with Vercel.
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/nuxtjs)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/nuxtjs)
_Live Example: https://nuxtjs.now-examples.now.sh_

View File

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

View File

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

View File

@@ -1,4 +1,4 @@
![Saber Logo](https://github.com/zeit/now/blob/master/packages/frameworks/logos/saber.svg)
![Saber Logo](https://github.com/vercel/vercel/blob/master/packages/frameworks/logos/saber.svg)
# Saber Example
@@ -8,7 +8,7 @@ This directory is a brief example of a [Saber](https://saber.land) site that can
Deploy your own Saber project with Vercel.
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/saber)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/saber)
_Live Example: https://saber.now-examples.now.sh_

View File

@@ -6,7 +6,7 @@ This directory is a brief example of a [Sapper](https://sapper.svelte.dev/) app
Deploy your own Sapper project with Vercel.
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/sapper)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/sapper)
_Live Example: https://sapper.now-examples.now.sh_

View File

@@ -1,4 +1,4 @@
![Scully Logo](https://github.com/zeit/now/blob/master/packages/frameworks/logos/scully.svg)
![Scully Logo](https://github.com/vercel/vercel/blob/master/packages/frameworks/logos/scully.svg)
# Scully Example
@@ -8,7 +8,7 @@ This directory is a brief example of a [Scully](https://scully.io) site that can
Deploy your own Scully project with Vercel.
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/scully)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/scully)
_Live Example: https://scully.now-examples.now.sh_

View File

@@ -6,7 +6,7 @@ This directory is a brief example of a [Stencil](https://stenciljs.com/) app tha
Deploy your own Stencil project with Vercel.
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/stencil)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/stencil)
_Live Example: https://stencil.now-examples.now.sh_

View File

@@ -6,7 +6,7 @@ This directory is a brief example of a [Svelte](https://svelte.dev/) app with [S
Deploy your own Svelte project, along with Serverless Functions, with Vercel.
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/svelte)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/svelte)
_Live Example: https://svelte.now-examples.now.sh_

View File

@@ -20,7 +20,7 @@
</h2>
<p>
<a
href="https://github.com/zeit/now/tree/master/examples/svelte"
href="https://github.com/vercel/vercel/tree/master/examples/svelte"
target="_blank"
rel="noreferrer noopener">
This project

View File

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

View File

@@ -1,4 +1,4 @@
![Vue.js Logo](https://github.com/zeit/now/blob/master/packages/frameworks/logos/vue.svg)
![Vue.js Logo](https://github.com/vercel/vercel/blob/master/packages/frameworks/logos/vue.svg)
# Vue.js Example
@@ -8,7 +8,7 @@ This directory is a brief example of a [Vue.js](https://vuejs.org/) app that can
Deploy your own Vue.js project with Vercel.
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/zeit/now/tree/master/examples/vue)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/vue)
_Live Example: https://vue.now-examples.now.sh_

View File

@@ -3,7 +3,7 @@
"name": "Next.js",
"slug": "nextjs",
"demo": "https://nextjs.now-examples.now.sh",
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/next.svg",
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/next.svg",
"tagline": "Next.js makes you productive with React instantly — whether you want to build static or dynamic sites. ",
"description": "A Next.js app and a Serverless Function API.",
"website": "https://nextjs.org",
@@ -31,7 +31,7 @@
"name": "Gatsby",
"slug": "gatsby",
"demo": "https://gatsby.now-examples.now.sh",
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/gatsby.svg",
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/gatsby.svg",
"tagline": "Gatsby helps developers build blazing fast websites and apps with React.",
"description": "A Gatsby app, using the default starter theme and a Serverless Function API.",
"website": "https://gatsbyjs.org",
@@ -59,7 +59,7 @@
"name": "Hexo",
"slug": "hexo",
"demo": "https://hexo.now-examples.now.sh",
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/hexo.svg",
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/hexo.svg",
"tagline": "Hexo is a fast, simple & powerful blog framework powered by Node.js.",
"description": "A Hexo site, created with the Hexo CLI.",
"website": "https://hexo.io/",
@@ -87,7 +87,7 @@
"name": "Eleventy",
"slug": "eleventy",
"demo": "https://eleventy.now-examples.now.sh",
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/eleventy.svg",
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/eleventy.svg",
"tagline": "11ty is a simpler static site generator written in JavaScript, created to be an alternative to Jekyll.",
"description": "An Eleventy site, created with npm init.",
"website": "https://www.11ty.dev/",
@@ -115,7 +115,7 @@
"name": "Docusaurus 2",
"slug": "docusaurus-2",
"demo": "https://docusaurus-2.now-examples.now.sh",
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/docusaurus.svg",
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/docusaurus.svg",
"tagline": "Docusaurus makes it easy to maintain Open Source documentation websites.",
"description": "A static Docusaurus site that makes it easy to maintain OSS documentation.",
"website": "https://v2.docusaurus.io",
@@ -143,7 +143,7 @@
"name": "Docusaurus 1",
"slug": "docusaurus",
"demo": "https://docusaurus.now-examples.now.sh",
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/docusaurus.svg",
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/docusaurus.svg",
"tagline": "Docusaurus makes it easy to maintain Open Source documentation websites.",
"description": "A static Docusaurus site that makes it easy to maintain OSS documentation.",
"website": "https://docusaurus.io/",
@@ -171,7 +171,7 @@
"name": "Preact",
"slug": "preact",
"demo": "https://preact.now-examples.now.sh",
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/preact.svg",
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/preact.svg",
"tagline": "Preact is a fast 3kB alternative to React with the same modern API.",
"description": "A Preact app, created with the Preact CLI.",
"website": "https://preactjs.com",
@@ -199,7 +199,7 @@
"name": "Dojo",
"slug": "dojo",
"demo": "https://dojo.now-examples.now.sh",
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/dojo.png",
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/dojo.png",
"tagline": "Dojo is a modern progressive, TypeScript first framework.",
"description": "A Dojo app, created with the Dojo CLI's cli-create-app command.",
"website": "https://dojo.io",
@@ -230,7 +230,7 @@
"name": "Ember",
"slug": "ember",
"demo": "https://ember.now-examples.now.sh",
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/ember.svg",
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/ember.svg",
"tagline": "Ember.js helps webapp developers be more productive out of the box.",
"description": "An Ember app, created with the Ember CLI.",
"website": "https://emberjs.com/",
@@ -258,7 +258,7 @@
"name": "Vue.js",
"slug": "vue",
"demo": "https://vue.now-examples.now.sh",
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/vue.svg",
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/vue.svg",
"tagline": "Vue.js is a versatile JavaScript framework that is as approachable as it is performant.",
"description": "A Vue.js app, created with the Vue CLI.",
"website": "https://vuejs.org",
@@ -286,7 +286,7 @@
"name": "Scully",
"slug": "scully",
"demo": "https://scully.now-examples.now.sh",
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/scullyio-logo.png",
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/scullyio-logo.png",
"tagline": "Scully is a static site generator for Angular.",
"description": "The Static Site Generator for Angular apps.",
"website": "https://github.com/scullyio/scully",
@@ -314,7 +314,7 @@
"name": "Ionic Angular",
"slug": "ionic-angular",
"demo": "https://ionic-angular.now-examples.now.sh",
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/ionic.svg",
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/ionic.svg",
"tagline": "Ionic Angular allows you to build mobile PWAs with Angular and the Ionic Framework.",
"description": "An Ionic Angular site, created with the Ionic CLI.",
"website": "https://ionicframework.com",
@@ -342,7 +342,7 @@
"name": "Angular",
"slug": "angular",
"demo": "https://angular.now-examples.now.sh",
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/angular.svg",
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/angular.svg",
"tagline": "Angular is a TypeScript-based cross-platform framework from Google.",
"description": "An Angular app, created with the Angular CLI.",
"website": "https://angular.io",
@@ -370,7 +370,7 @@
"name": "Polymer",
"slug": "polymer",
"demo": "https://polymer.now-examples.now.sh",
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/polymer.svg",
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/polymer.svg",
"tagline": "Polymer is an open-source webapps library from Google, for building using Web Components.",
"description": "A Polymer app, created with the Polymer CLI.",
"website": "https://www.polymer-project.org/",
@@ -398,7 +398,7 @@
"name": "Svelte",
"slug": "svelte",
"demo": "https://svelte.now-examples.now.sh",
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/svelte.svg",
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/svelte.svg",
"tagline": "Svelte lets you write high performance reactive apps with significantly less boilerplate. ",
"description": "A Svelte app, using the Svelte template, and a Serverless Function API.",
"website": "https://svelte.dev",
@@ -426,7 +426,7 @@
"name": "Ionic React",
"slug": "ionic-react",
"demo": "https://ionic-react.now-examples.now.sh",
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/ionic.svg",
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/ionic.svg",
"tagline": "Ionic React allows you to build mobile PWAs with React and the Ionic Framework.",
"description": "An Ionic React site, created with the Ionic CLI.",
"website": "https://ionicframework.com",
@@ -454,7 +454,7 @@
"name": "Create React App",
"slug": "create-react-app",
"demo": "https://react-functions.now-examples.now.sh",
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/react.svg",
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/react.svg",
"tagline": "Create React App allows you to get going with React in no time.",
"description": "A React app, bootstrapped with create-react-app, and a Serverless Function API.",
"website": "https://create-react-app.dev",
@@ -486,7 +486,7 @@
"name": "Gridsome",
"slug": "gridsome",
"demo": "https://gridsome.now-examples.now.sh",
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/gridsome.svg",
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/gridsome.svg",
"tagline": "Gridsome is a Vue.js-powered framework for building websites & apps that are fast by default.",
"description": "A Gridsome app, created with the Gridsome CLI.",
"website": "https://gridsome.org/",
@@ -514,7 +514,7 @@
"name": "UmiJS",
"slug": "umijs",
"demo": "https://umijs.now-examples.now.sh",
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/umi.svg",
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/umi.svg",
"tagline": "UmiJS is an extensible enterprise-level React application framework.",
"description": "An UmiJS app, created using the Umi CLI.",
"website": "https://umijs.org",
@@ -542,7 +542,7 @@
"name": "Sapper",
"slug": "sapper",
"demo": "https://sapper.now-examples.now.sh",
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/svelte.svg",
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/svelte.svg",
"tagline": "Sapper is a framework for building high-performance universal web apps with Svelte.",
"description": "A Sapper app, using the Sapper template.",
"website": "https://sapper.svelte.dev",
@@ -570,7 +570,7 @@
"name": "Saber",
"slug": "saber",
"demo": "https://saber.now-examples.now.sh",
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/saber.svg",
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/saber.svg",
"tagline": "Saber is a framework for building static sites in Vue.js that supports data from any source.",
"description": "A Saber site, created with npm init.",
"website": "https://saber.land/",
@@ -598,7 +598,7 @@
"name": "Stencil",
"slug": "stencil",
"demo": "https://stencil.now-examples.now.sh",
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/stencil.svg",
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/stencil.svg",
"tagline": "Stencil is a powerful toolchain for building Progressive Web Apps and Design Systems.",
"description": "A Stencil site, created with the Stencil CLI.",
"website": "https://stenciljs.com/",
@@ -626,7 +626,7 @@
"name": "Nuxt.js",
"slug": "nuxtjs",
"demo": "https://nuxtjs.now-examples.now.sh",
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/nuxt.svg",
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/nuxt.svg",
"tagline": "Nuxt.js is the web comprehensive framework that lets you dream big with Vue.js.",
"description": "A Nuxt.js app, bootstrapped with create-nuxt-app.",
"website": "https://nuxtjs.org",
@@ -654,7 +654,7 @@
"name": "Hugo",
"slug": "hugo",
"demo": "https://hugo.now-examples.now.sh",
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/hugo.svg",
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/hugo.svg",
"tagline": "Hugo is the worlds fastest framework for building websites, written in Go.",
"description": "A Hugo site, created with the Hugo CLI.",
"website": "https://gohugo.io",
@@ -687,7 +687,7 @@
"name": "Jekyll",
"slug": "jekyll",
"demo": "https://jekyll.now-examples.now.sh",
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/jekyll.svg",
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/jekyll.svg",
"tagline": "Jekyll makes it super easy to transform your plain text into static websites and blogs.",
"description": "A Jekyll site, created with the Jekyll CLI.",
"website": "https://jekyllrb.com/",
@@ -714,7 +714,7 @@
"name": "Brunch",
"slug": "brunch",
"demo": "https://brunch.now-examples.now.sh",
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/brunch.svg",
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/brunch.svg",
"tagline": "Brunch is a fast and simple webapp build tool with seamless incremental compilation for rapid development.",
"description": "A Brunch app, created with the Brunch CLI.",
"website": "https://brunch.io/",
@@ -741,7 +741,7 @@
"name": "Middleman",
"slug": "middleman",
"demo": "https://middleman.now-examples.now.sh",
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/middleman.svg",
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/middleman.svg",
"tagline": "Middleman is a static site generator that uses all the shortcuts and tools in modern web development.",
"description": "A Middleman app, created with the Middleman CLI.",
"website": "https://middlemanapp.com/",
@@ -767,7 +767,7 @@
{
"name": "Other",
"slug": null,
"logo": "https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/other.svg",
"logo": "https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/other.svg",
"description": "No framework or a unoptimized framework.",
"settings": {
"buildCommand": {

View File

@@ -1,17 +1,17 @@
{
"name": "@vercel/frameworks",
"version": "0.0.15-canary.0",
"version": "0.0.15",
"main": "frameworks.json",
"license": "UNLICENSED",
"scripts": {
"test-unit": "jest --env node --verbose --runInBand --bail test/*unit.*test.*"
"test-unit": "jest --env node --verbose --runInBand --bail"
},
"devDependencies": {
"@types/jest": "24.0.22",
"@types/node": "12.0.4",
"ajv": "6.10.2",
"ajv": "6.12.2",
"jest": "24.9.0",
"ts-jest": "24.1.0",
"typescript": "3.5.2"
"typescript": "3.9.3"
}
}

View File

@@ -122,7 +122,7 @@ describe('frameworks', () => {
.map(f => f.logo)
.filter(url => {
const prefix =
'https://raw.githubusercontent.com/zeit/now/master/packages/frameworks/logos/';
'https://raw.githubusercontent.com/vercel/vercel/master/packages/frameworks/logos/';
const name = url.replace(prefix, '');
return existsSync(path.join(__dirname, '..', 'logos', name)) === false;
});

View File

@@ -1,13 +1,13 @@
{
"name": "@vercel/build-utils",
"version": "2.3.2-canary.1",
"version": "2.4.0",
"license": "MIT",
"main": "./dist/index.js",
"types": "./dist/index.d.js",
"homepage": "https://github.com/zeit/now/blob/master/DEVELOPING_A_RUNTIME.md",
"homepage": "https://github.com/vercel/vercel/blob/master/DEVELOPING_A_RUNTIME.md",
"repository": {
"type": "git",
"url": "https://github.com/zeit/now.git",
"url": "https://github.com/vercel/vercel.git",
"directory": "packages/now-build-utils"
},
"scripts": {
@@ -45,7 +45,7 @@
"node-fetch": "2.2.0",
"semver": "6.1.1",
"ts-jest": "24.1.0",
"typescript": "3.5.2",
"typescript": "3.9.3",
"yazl": "2.4.3"
}
}

View File

@@ -82,6 +82,7 @@ export async function detectBuilders(
defaultRoutes: Route[] | null;
redirectRoutes: Route[] | null;
rewriteRoutes: Route[] | null;
errorRoutes: Route[] | null;
}> {
const errors: ErrorResponse[] = [];
const warnings: ErrorResponse[] = [];
@@ -99,6 +100,7 @@ export async function detectBuilders(
defaultRoutes: null,
redirectRoutes: null,
rewriteRoutes: null,
errorRoutes: null,
};
}
@@ -154,6 +156,7 @@ export async function detectBuilders(
defaultRoutes: null,
redirectRoutes: null,
rewriteRoutes: null,
errorRoutes: null,
};
}
@@ -231,6 +234,7 @@ export async function detectBuilders(
redirectRoutes: null,
defaultRoutes: null,
rewriteRoutes: null,
errorRoutes: null,
};
}
@@ -272,6 +276,7 @@ export async function detectBuilders(
redirectRoutes: null,
defaultRoutes: null,
rewriteRoutes: null,
errorRoutes: null,
};
}
@@ -309,6 +314,7 @@ export async function detectBuilders(
redirectRoutes: routesResult.redirectRoutes,
defaultRoutes: routesResult.defaultRoutes,
rewriteRoutes: routesResult.rewriteRoutes,
errorRoutes: routesResult.errorRoutes,
};
}
@@ -898,10 +904,17 @@ function getRouteResult(
defaultRoutes: Route[];
redirectRoutes: Route[];
rewriteRoutes: Route[];
errorRoutes: Route[];
} {
const defaultRoutes: Route[] = [];
const redirectRoutes: Route[] = [];
const rewriteRoutes: Route[] = [];
const errorRoutes: Route[] = [];
const isNextjs =
frontendBuilder &&
((frontendBuilder.use && frontendBuilder.use.startsWith('@vercel/next')) ||
(frontendBuilder.config &&
frontendBuilder.config.framework === 'nextjs'));
if (apiRoutes && apiRoutes.length > 0) {
if (options.featHandleMiss) {
@@ -968,10 +981,21 @@ function getRouteResult(
});
}
if (options.featHandleMiss && !isNextjs) {
// Exclude Next.js to avoid overriding custom error page
// https://nextjs.org/docs/advanced-features/custom-error-page
errorRoutes.push({
status: 404,
src: '^/(?!.*api).*$',
dest: options.cleanUrls ? '/404' : '/404.html',
});
}
return {
defaultRoutes,
redirectRoutes,
rewriteRoutes,
errorRoutes,
};
}

View File

@@ -7,11 +7,13 @@ export class NowBuildError extends Error {
public hideStackTrace = true;
public code: string;
public link?: string;
public action?: string;
constructor({ message, code, link }: Props) {
constructor({ message, code, link, action }: Props) {
super(message);
this.code = code;
this.link = link;
this.action = action;
}
}
@@ -31,4 +33,8 @@ interface Props {
* link to more information about this error.
*/
link?: string;
/**
* Optional "action" to display before the `link`, such as "More details".
*/
action?: string;
}

View File

@@ -48,7 +48,7 @@ export default async function download(
} = meta || {};
if (isDev || skipDownload) {
// In `now dev`, the `download()` function is a no-op because
// In `vercel dev`, the `download()` function is a no-op because
// the `basePath` matches the `cwd` of the dev server, so the
// source files are already available.
return files as DownloadedFiles;

View File

@@ -169,7 +169,7 @@ export async function getNodeVersion(
meta?: Meta
): Promise<NodeVersion> {
if (meta && meta.isDev) {
// Use the system-installed version of `node` in PATH for `now dev`
// Use the system-installed version of `node` in PATH for `vercel dev`
const latest = getLatestNodeVersion();
return { ...latest, runtime: 'nodejs' };
}
@@ -291,7 +291,7 @@ export async function runNpmInstall(
} else {
opts.prettyCommand = 'yarn install';
command = 'yarn';
commandArgs = args.concat(['install', '--ignore-engines']);
commandArgs = ['install', ...args];
}
if (process.env.NPM_ONLY_PRODUCTION) {
@@ -375,7 +375,7 @@ export async function runPackageJsonScript(
} else {
const prettyCommand = `yarn run ${scriptName}`;
console.log(`Running "${prettyCommand}"`);
await spawnAsync('yarn', ['--ignore-engines', 'run', scriptName], {
await spawnAsync('yarn', ['run', scriptName], {
...spawnOpts,
cwd: destPath,
prettyCommand,

View File

@@ -27,6 +27,7 @@ import {
getLatestNodeVersion,
getDiscontinuedNodeVersions,
} from './fs/node-version';
import { NowBuildError } from './errors';
import streamToBuffer from './fs/stream-to-buffer';
import shouldServe from './should-serve';
import debug from './debug';
@@ -111,9 +112,11 @@ export const getPlatformEnv = (name: string): string | undefined => {
const n = process.env[nName];
if (typeof v === 'string') {
if (typeof n === 'string') {
throw new Error(
`Both "${vName}" and "${nName}" env vars are defined. Please only define the "${vName}" env var`
);
throw new NowBuildError({
code: 'CONFLICTING_ENV_VAR_NAMES',
message: `Both "${vName}" and "${nName}" env vars are defined. Please only define the "${vName}" env var.`,
link: 'https://vercel.link/combining-old-and-new-config',
});
}
return v;
}

View File

@@ -114,7 +114,7 @@ export interface BuildOptions {
config: Config;
/**
* Metadata related to the invoker of the builder, used by `now dev`.
* Metadata related to the invoker of the builder, used by `vercel dev`.
* Builders may use the properties on this object to change behavior based
* on the build environment.
*/
@@ -201,7 +201,7 @@ export interface StartDevServerSuccess {
port: number;
/**
* Process ID number of the dev server. Useful for the `now dev` server to
* Process ID number of the dev server. Useful for the `vercel dev` server to
* shut down the dev server once an HTTP request has been fulfilled.
*/
pid: number;

View File

@@ -0,0 +1,11 @@
/node_modules/
/public/build/
.DS_Store
# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
yarnPath: ".yarn/releases/yarn-berry.js"

View File

@@ -0,0 +1,55 @@
_Looking for a shareable component template? Go here --> [sveltejs/component-template](https://github.com/sveltejs/component-template)_
---
# svelte app
This is a project template for [Svelte](https://svelte.dev) apps. It lives at https://github.com/sveltejs/template.
To create a new project based on this template using [degit](https://github.com/Rich-Harris/degit):
```bash
npx degit sveltejs/template svelte-app
cd svelte-app
```
_Note that you will need to have [Node.js](https://nodejs.org) installed._
## Get started
Install the dependencies...
```bash
cd svelte-app
npm install
```
...then start [Rollup](https://rollupjs.org):
```bash
npm run dev
```
Navigate to [localhost:5000](http://localhost:5000). You should see your app running. Edit a component file in `src`, save it, and reload the page to see your changes.
By default, the server will only respond to requests from localhost. To allow connections from other computers, edit the `sirv` commands in package.json to include the option `--host 0.0.0.0`.
## Building and running in production mode
To create an optimised version of the app:
```bash
npm run build
```
You can run the newly built app with `npm run start`. This uses [sirv](https://github.com/lukeed/sirv), which is included in your package.json's `dependencies` so that the app will work when you deploy to platforms like [Heroku](https://heroku.com).
## Single-page app mode
By default, sirv will only respond to requests that match files in `public`. This is to maximise compatibility with static fileservers, allowing you to deploy your app anywhere.
If you're building a single-page app (SPA) with multiple routes, sirv needs to be able to respond to requests for _any_ path. You can make it so by editing the `"start"` command in package.json:
```js
"start": "sirv public --single"
```

View File

@@ -0,0 +1,5 @@
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@vercel/static-build" }],
"probes": [{ "path": "/", "mustContain": "Svelte app" }]
}

View File

@@ -0,0 +1,21 @@
{
"name": "svelte-app",
"version": "1.0.0",
"scripts": {
"build": "rollup -c",
"dev": "rollup -c -w",
"start": "sirv public"
},
"devDependencies": {
"@rollup/plugin-commonjs": "^12.0.0",
"@rollup/plugin-node-resolve": "^8.0.0",
"rollup": "^2.3.4",
"rollup-plugin-livereload": "^1.0.0",
"rollup-plugin-svelte": "^5.0.3",
"rollup-plugin-terser": "^5.1.2",
"svelte": "^3.0.0"
},
"dependencies": {
"sirv-cli": "^0.4.4"
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

View File

@@ -0,0 +1,66 @@
html, body {
position: relative;
width: 100%;
height: 100%;
}
body {
color: #333;
margin: 0;
padding: 8px;
box-sizing: border-box;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}
a {
color: rgb(0,100,200);
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
a:visited {
color: rgb(0,80,160);
}
label {
display: block;
}
input, button, select, textarea {
font-family: inherit;
font-size: inherit;
padding: 0.4em;
margin: 0 0 0.5em 0;
box-sizing: border-box;
border: 1px solid #ccc;
border-radius: 2px;
}
input:disabled {
color: #ccc;
}
input[type="range"] {
height: 0;
}
button {
color: #333;
background-color: #f4f4f4;
outline: none;
}
button:disabled {
color: #999;
}
button:not(:disabled):active {
background-color: #ddd;
}
button:focus {
border-color: #666;
}

View File

@@ -0,0 +1,18 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset='utf-8'>
<meta name='viewport' content='width=device-width,initial-scale=1'>
<title>Svelte app</title>
<link rel='icon' type='image/png' href='/favicon.png'>
<link rel='stylesheet' href='/global.css'>
<link rel='stylesheet' href='/build/bundle.css'>
<script defer src='/build/bundle.js'></script>
</head>
<body>
</body>
</html>

View File

@@ -0,0 +1,71 @@
import svelte from 'rollup-plugin-svelte';
import resolve from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
import livereload from 'rollup-plugin-livereload';
import { terser } from 'rollup-plugin-terser';
const production = !process.env.ROLLUP_WATCH;
export default {
input: 'src/main.js',
output: {
sourcemap: true,
format: 'iife',
name: 'app',
file: 'public/build/bundle.js'
},
plugins: [
svelte({
// enable run-time checks when not in production
dev: !production,
// we'll extract any component CSS out into
// a separate file - better for performance
css: css => {
css.write('public/build/bundle.css');
}
}),
// If you have external dependencies installed from
// npm, you'll most likely need these plugins. In
// some cases you'll need additional configuration -
// consult the documentation for details:
// https://github.com/rollup/plugins/tree/master/packages/commonjs
resolve({
browser: true,
dedupe: ['svelte']
}),
commonjs(),
// In dev mode, call `npm run start` once
// the bundle has been generated
!production && serve(),
// Watch the `public` directory and refresh the
// browser on changes when not in production
!production && livereload('public'),
// If we're building for production (npm run build
// instead of npm run dev), minify
production && terser()
],
watch: {
clearScreen: false
}
};
function serve() {
let started = false;
return {
writeBundle() {
if (!started) {
started = true;
require('child_process').spawn('npm', ['run', 'start', '--', '--dev'], {
stdio: ['ignore', 'inherit', 'inherit'],
shell: true
});
}
}
};
}

View File

@@ -0,0 +1,30 @@
<script>
export let name;
</script>
<main>
<h1>Hello {name}!</h1>
<p>Visit the <a href="https://svelte.dev/tutorial">Svelte tutorial</a> to learn how to build Svelte apps.</p>
</main>
<style>
main {
text-align: center;
padding: 1em;
max-width: 240px;
margin: 0 auto;
}
h1 {
color: #ff3e00;
text-transform: uppercase;
font-size: 4em;
font-weight: 100;
}
@media (min-width: 640px) {
main {
max-width: none;
}
}
</style>

View File

@@ -0,0 +1,10 @@
import App from './App.svelte';
const app = new App({
target: document.body,
props: {
name: 'world'
}
});
export default app;

File diff suppressed because it is too large Load Diff

View File

@@ -531,6 +531,7 @@ describe('Test `detectBuilders`', () => {
const files = ['api/user.php'];
// @ts-ignore
const { errors } = await detectBuilders(files, null, {
// @ts-ignore
functions,
});
@@ -867,12 +868,14 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
defaultRoutes,
redirectRoutes,
rewriteRoutes,
errorRoutes,
} = await detectBuilders(files, pkg, { featHandleMiss });
expect(builders![0].use).toBe('@vercel/next');
expect(errors).toBe(null);
expect(defaultRoutes).toStrictEqual([]);
expect(redirectRoutes).toStrictEqual([]);
expect(rewriteRoutes).toStrictEqual([]);
expect(errorRoutes).toStrictEqual([]);
});
it('package.json + no build + next', async () => {
@@ -887,12 +890,14 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
defaultRoutes,
redirectRoutes,
rewriteRoutes,
errorRoutes,
} = await detectBuilders(files, pkg, { featHandleMiss });
expect(builders![0].use).toBe('@vercel/next');
expect(errors).toBe(null);
expect(defaultRoutes).toStrictEqual([]);
expect(redirectRoutes).toStrictEqual([]);
expect(rewriteRoutes).toStrictEqual([]);
expect(errorRoutes).toStrictEqual([]);
});
it('package.json + no build', async () => {
@@ -913,12 +918,15 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
defaultRoutes,
redirectRoutes,
rewriteRoutes,
errorRoutes,
} = await detectBuilders(files, null, { featHandleMiss });
expect(builders).toBe(null);
expect(errors).toBe(null);
expect(defaultRoutes).toStrictEqual([]);
expect(redirectRoutes).toStrictEqual([]);
expect(rewriteRoutes).toStrictEqual([]);
expect(errorRoutes!.length).toBe(1);
expect((errorRoutes![0] as Source).status).toBe(404);
});
it('no package.json + public', async () => {
@@ -929,6 +937,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
defaultRoutes,
redirectRoutes,
rewriteRoutes,
errorRoutes,
} = await detectBuilders(files, null, { featHandleMiss });
expect(builders![1].use).toBe('@vercel/static');
expect(errors).toBe(null);
@@ -939,6 +948,8 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
expect(redirectRoutes).toStrictEqual([]);
expect(rewriteRoutes!.length).toBe(1);
expect((rewriteRoutes![0] as Source).status).toBe(404);
expect(errorRoutes!.length).toBe(1);
expect((errorRoutes![0] as Source).status).toBe(404);
});
it('no package.json + no build + raw static + api', async () => {
@@ -949,6 +960,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
defaultRoutes,
redirectRoutes,
rewriteRoutes,
errorRoutes,
} = await detectBuilders(files, null, { featHandleMiss });
expect(builders![0].use).toBe('@vercel/node');
expect(builders![0].src).toBe('api/users.js');
@@ -963,6 +975,8 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
expect(redirectRoutes).toStrictEqual([]);
expect(rewriteRoutes!.length).toBe(1);
expect((rewriteRoutes![0] as Source).status).toBe(404);
expect(errorRoutes!.length).toBe(1);
expect((errorRoutes![0] as Source).status).toBe(404);
});
it('package.json + no build + root + api', async () => {
@@ -990,6 +1004,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
defaultRoutes,
redirectRoutes,
rewriteRoutes,
errorRoutes,
} = await detectBuilders(files, undefined, { featHandleMiss });
expect(builders![0].use).toBe('@vercel/node');
expect(builders![0].src).toBe('api/[endpoint]/[id].js');
@@ -1002,6 +1017,8 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
expect(rewriteRoutes!.length).toBe(2);
expect((rewriteRoutes![0] as Source).src).toBe('^/api/([^/]+)/([^/]+)$');
expect((rewriteRoutes![1] as Source).status).toBe(404);
expect(errorRoutes!.length).toBe(1);
expect((errorRoutes![0] as Source).status).toBe(404);
});
it('api + next + public', async () => {
@@ -1016,6 +1033,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
defaultRoutes,
redirectRoutes,
rewriteRoutes,
errorRoutes,
} = await detectBuilders(files, pkg, { featHandleMiss });
expect(builders![0].use).toBe('@vercel/node');
expect(builders![0].src).toBe('api/endpoint.js');
@@ -1029,6 +1047,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
expect(redirectRoutes).toStrictEqual([]);
expect(rewriteRoutes!.length).toBe(1);
expect((rewriteRoutes![0] as Source).status).toBe(404);
expect(errorRoutes).toStrictEqual([]);
});
it('api + next + raw static', async () => {
@@ -1043,6 +1062,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
defaultRoutes,
redirectRoutes,
rewriteRoutes,
errorRoutes,
} = await detectBuilders(files, pkg, { featHandleMiss });
expect(builders![0].use).toBe('@vercel/node');
expect(builders![0].src).toBe('api/endpoint.js');
@@ -1056,6 +1076,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
expect(redirectRoutes).toStrictEqual([]);
expect(rewriteRoutes!.length).toBe(1);
expect((rewriteRoutes![0] as Source).status).toBe(404);
expect(errorRoutes).toStrictEqual([]);
});
it('api + raw static', async () => {
@@ -1066,6 +1087,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
defaultRoutes,
redirectRoutes,
rewriteRoutes,
errorRoutes,
} = await detectBuilders(files, null, { featHandleMiss });
expect(builders![0].use).toBe('@vercel/node');
expect(builders![0].src).toBe('api/endpoint.js');
@@ -1079,6 +1101,8 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
expect(redirectRoutes).toStrictEqual([]);
expect(rewriteRoutes!.length).toBe(1);
expect((rewriteRoutes![0] as Source).status).toBe(404);
expect(errorRoutes!.length).toBe(1);
expect((errorRoutes![0] as Source).status).toBe(404);
});
it('api + raw static + package.json no build script', async () => {
@@ -1093,6 +1117,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
defaultRoutes,
redirectRoutes,
rewriteRoutes,
errorRoutes,
} = await detectBuilders(files, pkg, { featHandleMiss });
expect(builders![0].use).toBe('@vercel/node');
expect(builders![0].src).toBe('api/version.js');
@@ -1106,6 +1131,8 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
expect(redirectRoutes).toStrictEqual([]);
expect(rewriteRoutes!.length).toBe(1);
expect((rewriteRoutes![0] as Source).status).toBe(404);
expect(errorRoutes!.length).toBe(1);
expect((errorRoutes![0] as Source).status).toBe(404);
});
it('api + public', async () => {
@@ -1116,7 +1143,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
'README.md',
];
const { builders } = await detectBuilders(files, undefined, {
const { builders, errorRoutes } = await detectBuilders(files, undefined, {
featHandleMiss,
});
expect(builders![0].use).toBe('@vercel/node');
@@ -1124,6 +1151,8 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
expect(builders![1].use).toBe('@vercel/static');
expect(builders![1].src).toBe('public/**/*');
expect(builders!.length).toBe(2);
expect(errorRoutes!.length).toBe(1);
expect((errorRoutes![0] as Source).status).toBe(404);
});
it('api go with test files', async () => {
@@ -1142,21 +1171,26 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
'api/src/controllers/user.module_test.go',
];
const { builders } = await detectBuilders(files, undefined, {
const { builders, errorRoutes } = await detectBuilders(files, undefined, {
featHandleMiss,
});
expect(builders!.length).toBe(7);
expect(builders!.some(b => b.src.endsWith('_test.go'))).toBe(false);
expect(errorRoutes!.length).toBe(1);
expect((errorRoutes![0] as Source).status).toBe(404);
});
it('just public', async () => {
const files = ['public/index.html', 'public/favicon.ico', 'README.md'];
const { builders } = await detectBuilders(files, undefined, {
const { builders, errorRoutes } = await detectBuilders(files, undefined, {
featHandleMiss,
});
expect(builders![0].src).toBe('public/**/*');
expect(builders![0].use).toBe('@vercel/static');
expect(builders!.length).toBe(1);
expect(errorRoutes!.length).toBe(1);
expect((errorRoutes![0] as Source).status).toBe(404);
});
it('next + public', async () => {
@@ -1166,10 +1200,13 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
};
const files = ['package.json', 'public/index.html', 'README.md'];
const { builders } = await detectBuilders(files, pkg, { featHandleMiss });
const { builders, errorRoutes } = await detectBuilders(files, pkg, {
featHandleMiss,
});
expect(builders![0].use).toBe('@vercel/next');
expect(builders![0].src).toBe('package.json');
expect(builders!.length).toBe(1);
expect(errorRoutes!.length).toBe(0);
});
it('nuxt', async () => {
@@ -1179,10 +1216,14 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
};
const files = ['package.json', 'pages/index.js'];
const { builders } = await detectBuilders(files, pkg, { featHandleMiss });
const { builders, errorRoutes } = await detectBuilders(files, pkg, {
featHandleMiss,
});
expect(builders![0].use).toBe('@vercel/static-build');
expect(builders![0].src).toBe('package.json');
expect(builders!.length).toBe(1);
expect(errorRoutes!.length).toBe(1);
expect((errorRoutes![0] as Source).status).toBe(404);
});
it('nuxt + tag canary', async () => {
@@ -1192,23 +1233,29 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
};
const files = ['package.json', 'pages/index.js'];
const { builders } = await detectBuilders(files, pkg, {
const { builders, errorRoutes } = await detectBuilders(files, pkg, {
tag: 'canary',
featHandleMiss,
});
expect(builders![0].use).toBe('@vercel/static-build@canary');
expect(builders![0].src).toBe('package.json');
expect(builders!.length).toBe(1);
expect(errorRoutes!.length).toBe(1);
expect((errorRoutes![0] as Source).status).toBe(404);
});
it('package.json with no build + api', async () => {
const pkg = { dependencies: { next: '9.0.0' } };
const files = ['package.json', 'api/[endpoint].js'];
const { builders } = await detectBuilders(files, pkg, { featHandleMiss });
const { builders, errorRoutes } = await detectBuilders(files, pkg, {
featHandleMiss,
});
expect(builders![0].use).toBe('@vercel/node');
expect(builders![0].src).toBe('api/[endpoint].js');
expect(builders!.length).toBe(1);
expect(errorRoutes!.length).toBe(1);
expect((errorRoutes![0] as Source).status).toBe(404);
});
it('package.json with no build + public directory', async () => {
@@ -1327,7 +1374,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
it('many static files + one api file', async () => {
const files = Array.from({ length: 5000 }).map((_, i) => `file${i}.html`);
files.push('api/index.ts');
const { builders } = await detectBuilders(files, undefined, {
const { builders, errorRoutes } = await detectBuilders(files, undefined, {
featHandleMiss,
});
@@ -1336,6 +1383,8 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
expect(builders![0].src).toBe('api/index.ts');
expect(builders![1].use).toBe('@vercel/static');
expect(builders![1].src).toBe('!{api/**,package.json}');
expect(errorRoutes!.length).toBe(1);
expect((errorRoutes![0] as Source).status).toBe(404);
});
it('functions with nextjs', async () => {
@@ -1530,6 +1579,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
const files = ['api/user.php'];
// @ts-ignore
const { errors } = await detectBuilders(files, null, {
// @ts-ignore
functions,
featHandleMiss,
});
@@ -1630,6 +1680,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
// @ts-ignore
const { errors } = await detectBuilders(files, null, {
// @ts-ignore
functions,
featHandleMiss,
});
@@ -1646,6 +1697,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
// @ts-ignore: Since we test an invalid type
const { errors } = await detectBuilders(files, null, {
// @ts-ignore
functions,
featHandleMiss,
});
@@ -1681,6 +1733,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
defaultRoutes,
redirectRoutes,
rewriteRoutes,
errorRoutes,
} = await detectBuilders(files, null, {
projectSettings,
featHandleMiss,
@@ -1693,6 +1746,8 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
expect(defaultRoutes).toStrictEqual([]);
expect(redirectRoutes).toStrictEqual([]);
expect(rewriteRoutes).toStrictEqual([]);
expect(errorRoutes!.length).toBe(1);
expect((errorRoutes![0] as Source).status).toBe(404);
});
it('Custom static output directory with api', async () => {
@@ -1707,6 +1762,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
defaultRoutes,
redirectRoutes,
rewriteRoutes,
errorRoutes,
} = await detectBuilders(files, null, {
projectSettings,
featHandleMiss,
@@ -1722,6 +1778,8 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
expect(redirectRoutes).toStrictEqual([]);
expect(rewriteRoutes!.length).toBe(1);
expect((rewriteRoutes![0] as Source).status).toBe(404);
expect(errorRoutes!.length).toBe(1);
expect((errorRoutes![0] as Source).status).toBe(404);
});
it('Framework with non-package.json entrypoint', async () => {
@@ -1730,7 +1788,7 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
framework: 'hugo',
};
const { builders } = await detectBuilders(files, null, {
const { builders, errorRoutes } = await detectBuilders(files, null, {
projectSettings,
featHandleMiss,
});
@@ -1745,6 +1803,8 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
},
},
]);
expect(errorRoutes!.length).toBe(1);
expect((errorRoutes![0] as Source).status).toBe(404);
});
it('No framework, only package.json', async () => {
@@ -1755,7 +1815,9 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
},
};
const { builders } = await detectBuilders(files, pkg, { featHandleMiss });
const { builders, errorRoutes } = await detectBuilders(files, pkg, {
featHandleMiss,
});
expect(builders).toEqual([
{
@@ -1766,13 +1828,15 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
},
},
]);
expect(errorRoutes!.length).toBe(1);
expect((errorRoutes![0] as Source).status).toBe(404);
});
it('Framework with an API', async () => {
const files = ['config.rb', 'api/date.rb'];
const projectSettings = { framework: 'middleman' };
const { builders } = await detectBuilders(files, null, {
const { builders, errorRoutes } = await detectBuilders(files, null, {
projectSettings,
featHandleMiss,
});
@@ -1794,6 +1858,8 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
},
},
]);
expect(errorRoutes!.length).toBe(1);
expect((errorRoutes![0] as Source).status).toBe(404);
});
it('Error for non-api functions', async () => {
@@ -1843,13 +1909,19 @@ describe('Test `detectBuilders` with `featHandleMiss=true`', () => {
it('All static if `buildCommand` is an empty string with an `outputDirectory`', async () => {
const files = ['out/index.html'];
const projectSettings = { buildCommand: '', outputDirectory: 'out' };
const { builders, errors } = await detectBuilders(files, null, {
projectSettings,
featHandleMiss,
});
const { builders, errors, errorRoutes } = await detectBuilders(
files,
null,
{
projectSettings,
featHandleMiss,
}
);
expect(errors).toBe(null);
expect(builders![0]!.use).toBe('@vercel/static');
expect(builders![0]!.src).toBe('out/**/*');
expect(errorRoutes!.length).toBe(1);
expect((errorRoutes![0] as Source).status).toBe(404);
});
it('do not require build script when `buildCommand` is an empty string', async () => {
@@ -2025,9 +2097,13 @@ it('Test `detectRoutes` with `featHandleMiss=true`', async () => {
{
const files = ['api/user.go', 'api/team.js', 'api/package.json'];
const { defaultRoutes, rewriteRoutes } = await detectBuilders(files, null, {
featHandleMiss,
});
const { defaultRoutes, rewriteRoutes, errorRoutes } = await detectBuilders(
files,
null,
{
featHandleMiss,
}
);
expect(defaultRoutes).toStrictEqual([
{ handle: 'miss' },
{
@@ -2043,6 +2119,44 @@ it('Test `detectRoutes` with `featHandleMiss=true`', async () => {
continue: true,
},
]);
expect(errorRoutes).toStrictEqual([
{
status: 404,
src: '^/(?!.*api).*$',
dest: '/404.html',
},
]);
const pattern = new RegExp(errorRoutes![0].src!);
[
'/',
'/index.html',
'/page.html',
'/page',
'/another/index.html',
'/another/page.html',
'/another/page',
'/another/sub/index.html',
'/another/sub/page.html',
'/another/sub/page',
].forEach(file => {
expect(file).toMatch(pattern);
});
[
'/api',
'/api/',
'/api/index.html',
'/api/page.html',
'/api/page',
'/api/sub',
'/api/sub/index.html',
'/api/sub/page.html',
'/api/sub/page',
].forEach(file => {
expect(file).not.toMatch(pattern);
});
}
{
@@ -2326,6 +2440,7 @@ it('Test `detectRoutes` with `featHandleMiss=true`, `cleanUrls=true`', async ()
defaultRoutes,
redirectRoutes,
rewriteRoutes,
errorRoutes,
} = await detectBuilders(files, null, options);
testHeaders(redirectRoutes);
expect(defaultRoutes).toStrictEqual([]);
@@ -2336,6 +2451,13 @@ it('Test `detectRoutes` with `featHandleMiss=true`, `cleanUrls=true`', async ()
continue: true,
},
]);
expect(errorRoutes).toStrictEqual([
{
status: 404,
src: '^/(?!.*api).*$',
dest: '/404',
},
]);
// expected redirect should match inputs
const getLocation = createReplaceLocation(redirectRoutes);

View File

@@ -39,7 +39,7 @@ describe('Test `getPlatformEnv()`', () => {
assert(err);
assert.equal(
err!.message,
'Both "VERCEL_FOO" and "NOW_FOO" env vars are defined. Please only define the "VERCEL_FOO" env var'
'Both "VERCEL_FOO" and "NOW_FOO" env vars are defined. Please only define the "VERCEL_FOO" env var.'
);
});
});

View File

@@ -139,7 +139,7 @@ it('should match all semver ranges', async () => {
expect(await getSupportedNodeVersion('^10.5.0')).toHaveProperty('major', 10);
});
it('should ignore node version in now dev getNodeVersion()', async () => {
it('should ignore node version in vercel dev getNodeVersion()', async () => {
expect(
await getNodeVersion(
'/tmp',

View File

@@ -1,10 +1,10 @@
{
"name": "@vercel/cgi",
"version": "1.0.5",
"version": "1.0.6",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/zeit/now.git",
"url": "https://github.com/vercel/vercel.git",
"directory": "packages/now-cgi"
},
"scripts": {

View File

@@ -6,7 +6,7 @@
<p align="center">Develop. Preview. Ship.</p>
</p>
[![Join the community on GitHub Discussions](https://badgen.net/badge/join%20the%20discussion/on%20github/black?icon=github)](https://github.com/zeit/now/discussions)
[![Join the community on GitHub Discussions](https://badgen.net/badge/join%20the%20discussion/on%20github/black?icon=github)](https://github.com/vercel/vercel/discussions)
## Usage

View File

@@ -1,13 +1,13 @@
{
"name": "vercel",
"version": "19.0.2-canary.6",
"version": "19.1.0",
"preferGlobal": true,
"license": "Apache-2.0",
"description": "The command-line interface for Now",
"homepage": "https://vercel.com",
"repository": {
"type": "git",
"url": "https://github.com/zeit/now.git",
"url": "https://github.com/vercel/vercel.git",
"directory": "packages/now-cli"
},
"scripts": {
@@ -62,13 +62,13 @@
"node": ">= 10"
},
"dependencies": {
"@vercel/build-utils": "2.3.2-canary.1",
"@vercel/go": "1.1.1",
"@vercel/next": "2.6.3-canary.2",
"@vercel/node": "1.6.2-canary.2",
"@vercel/python": "1.2.2-canary.0",
"@vercel/ruby": "1.2.1",
"@vercel/static-build": "0.17.1"
"@vercel/build-utils": "2.4.0",
"@vercel/go": "1.1.2",
"@vercel/next": "2.6.6",
"@vercel/node": "1.7.0",
"@vercel/python": "1.2.2",
"@vercel/ruby": "1.2.2",
"@vercel/static-build": "0.17.2"
},
"devDependencies": {
"@sentry/node": "5.5.0",
@@ -106,7 +106,7 @@
"@zeit/fun": "0.11.2",
"@zeit/ncc": "0.18.5",
"@zeit/source-map-support": "0.6.2",
"ajv": "6.10.2",
"ajv": "6.12.2",
"alpha-sort": "2.0.1",
"ansi-escapes": "3.0.0",
"ansi-regex": "3.0.0",
@@ -136,6 +136,7 @@
"escape-html": "1.0.3",
"esm": "3.1.4",
"execa": "3.2.0",
"fast-deep-equal": "3.1.3",
"fs-extra": "7.0.1",
"get-port": "5.1.1",
"glob": "7.1.2",
@@ -182,7 +183,7 @@
"tmp-promise": "1.0.3",
"tree-kill": "1.2.1",
"ts-node": "8.3.0",
"typescript": "3.6.4",
"typescript": "3.9.3",
"universal-analytics": "0.4.20",
"update-check": "1.5.3",
"utility-types": "2.1.0",

View File

@@ -33,13 +33,13 @@ async function main() {
// During local development, these secrets will be empty.
await createConstants();
// `now dev` uses chokidar to watch the filesystem, but opts-out of the
// `vercel dev` uses chokidar to watch the filesystem, but opts-out of the
// `fsevents` feature using `useFsEvents: false`, so delete the module here so
// that it is not compiled by ncc, which makes the npm package size larger
// than necessary.
await remove(join(dirRoot, '../../node_modules/fsevents'));
// Compile the `doT.js` template files for `now dev`
// Compile the `doT.js` template files for `vercel dev`
console.log();
await execa(process.execPath, [join(__dirname, 'compile-templates.js')], {
stdio: 'inherit',
@@ -75,6 +75,17 @@ async function main() {
const dest = join(dirRoot, 'dist/runtimes');
await cpy('**/*', dest, { parents: true, cwd: runtimes });
// Band-aid to delete stuff that `ncc` bundles, but it shouldn't:
// TypeScript definition files from `@vercel/build-utils`
await remove(join(dirRoot, 'dist', 'dist'));
// The Readme and `package.json` from "config-chain" module
await remove(join(dirRoot, 'dist', 'config-chain'));
// A bunch of source `.ts` files from CLI's `util` directory
await remove(join(dirRoot, 'dist', 'util'));
console.log('Finished building `now-cli`');
}

View File

@@ -5,12 +5,12 @@ const { readFile, writeFile, readdir, remove } = require('fs-extra');
async function main() {
const dirRoot = join(__dirname, '..');
// Compile the `doT.js` template files for `now dev`
// Compile the `doT.js` template files for `vercel dev`
const templatesDir = join(dirRoot, 'src/util/dev/templates');
const dotPacker = join(dirRoot, '../../node_modules/dot/bin/dot-packer');
await execa(process.execPath, [dotPacker], {
cwd: templatesDir,
stdio: 'inherit'
stdio: 'inherit',
});
const files = await readdir(templatesDir);
@@ -24,7 +24,7 @@ async function main() {
[prettier, '--write', '--single-quote', ...compiledFiles],
{
cwd: templatesDir,
stdio: 'inherit'
stdio: 'inherit',
}
);
@@ -60,7 +60,7 @@ async function main() {
)}`;
lines.unshift(
'import encodeHTML from \'escape-html\';',
"import encodeHTML from 'escape-html';",
'',
...def.split('\n')
);

View File

@@ -212,7 +212,7 @@ async function run({ token, config: { currentTeam } }) {
}
// Check if the provided cardId (in case the user
// typed `now billing set-default <some-id>`) is valid
// typed `vercel billing set-default <some-id>`) is valid
if (cardId) {
const label = `Are you sure that you to set this card as the default?`;
const confirmation = await promptBool(label, {
@@ -287,7 +287,7 @@ async function run({ token, config: { currentTeam } }) {
}
// Shoud check if the provided cardId (in case the user
// typed `now billing rm <some-id>`) is valid
// typed `vercel billing rm <some-id>`) is valid
if (cardId) {
const label = `Are you sure that you want to remove this card?`;
const confirmation = await promptBool(label);

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