Compare commits

...

674 Commits

Author SHA1 Message Date
Steven
5cf0c316e9 Publish Stable
- @vercel/python@2.1.0
2021-11-23 08:57:58 -05:00
Steven
f4501433c8 Publish Canary
- vercel@23.1.3-canary.38
 - vercel-plugin-python@1.0.0-canary.6
 - @vercel/python@2.0.6-canary.7
2021-11-22 18:43:37 -05:00
Steven
19831593ce [python] Add warning for deprecated version (#7053)
- Print warning when python 3.6 is selected
- Print warning when invalid python version is selected
2021-11-22 23:36:30 +00:00
Steven
5d85bb1426 [tests] Bump cancel action to 0.9.1 (#7055) 2021-11-22 17:24:35 -05:00
Andy Bitz
f194d54b0c Publish Canary
- vercel@23.1.3-canary.37
2021-11-22 23:14:32 +01:00
Andy
6542086843 Revert "[cli] Switch from hardlinks to symlinks in vc build" (#7054)
* Revert "[cli] Switch from hardlinks to symlinks in vc build (#7026)"

This reverts commit 6dff0875f5.

* Keep copy logic
2021-11-22 23:12:46 +01:00
Andy Bitz
2721b3449d Publish Canary
- @vercel/build-utils@2.12.3-canary.20
 - vercel@23.1.3-canary.36
 - @vercel/client@10.2.3-canary.21
 - @vercel/node@1.12.2-canary.7
 - vercel-plugin-go@1.0.0-canary.5
 - vercel-plugin-node@1.12.2-canary.11
 - vercel-plugin-python@1.0.0-canary.5
 - vercel-plugin-ruby@1.0.0-canary.4
2021-11-22 13:22:56 +01:00
Andy
adb284519a [plugin-node][node] Fix dependency installation, handler path, and build script (#7043)
* [plugin-node][node] Fix dependency installation, handler path, and build script

* Use smaller library for testing

* Make test work on windows

* Remove .output before fixture runs and update routes update

* Apply suggestions from code review

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

Co-authored-by: Steven <steven@ceriously.com>
2021-11-22 13:21:20 +01:00
Steven
b2d91f3121 [cli] Fix metrics crash on some platforms (#7034) 2021-11-20 20:31:39 -05:00
Steven
32664cd13b Publish Canary
- @vercel/build-utils@2.12.3-canary.19
 - vercel@23.1.3-canary.35
 - @vercel/client@10.2.3-canary.20
 - @vercel/frameworks@0.5.1-canary.12
 - vercel-plugin-go@1.0.0-canary.4
 - vercel-plugin-node@1.12.2-canary.10
 - vercel-plugin-python@1.0.0-canary.4
 - vercel-plugin-ruby@1.0.0-canary.3
2021-11-20 10:20:05 -05:00
Sam Ko
db468c489a [frameworks] Fix Parcel default output directory to dist (#7029)
### Related Issues

The Parcel template via the Project Creating Flow returns a build error because the default output directory for the Parcel **Framework Preset** is searching for `public` instead of `dist`. The default behavior of Parcel's CLI I believe is `dist`.

### 📋 Checklist

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [ ] The code changed/added as part of this PR has been covered with tests
- [ ] All tests pass locally with `yarn test-unit`

#### Code Review

- [ ] This PR has a concise title and thorough description useful to a reviewer
- [ ] Issue from task tracker has a link to this PR
2021-11-20 01:44:22 +00:00
Steven
edd9bb506c [frameworks][cli] Consolidate buildCommand and devCommand (#7032)
* [frameworks] Consolidate buildCommand and devCommand

* Fix default build command when no override or package.json found
2021-11-19 19:07:52 -05:00
Steven
a72549a290 [tests] Make test more reliable for function timeout (#7033) 2021-11-19 17:26:32 -05:00
Steven
4aa6a13912 Publish Canary
- vercel@23.1.3-canary.34
 - vercel-plugin-python@1.0.0-canary.3
 - @vercel/python@2.0.6-canary.6
2021-11-19 14:42:02 -05:00
Steven
81ea0082f1 [python] Upgrade python 3.9 (#7008)
* [python] Upgrade python 3.9

* Fix python path

* Improve testing

* Add support for version selection via Pipfile

* Parse the "Pipfile.lock" instead

* Fix support for Node.js 12
2021-11-19 13:42:17 -05:00
Jared Palmer
6dff0875f5 [cli] Switch from hardlinks to symlinks in vc build (#7026)
* Switch from hardlinks to symlinks in vc build

* Remove error handling that fs-extra already takes care of

* Add comment

* Put back symlink error handling
2021-11-19 12:36:31 -05:00
Steven
30aa392c0a [tests] Increase CI duration (#7030)
Seems like macOS sometimes exceeds 60 min so this bumps the timeout.

The build can be between 3 minutes and 5 minutes. The tests can be between 45 minutes and 55 minutes.
2021-11-19 14:59:12 +00:00
Miroslav Simulcik
c4fc060030 [cli] Fix spinner output outside of TTY (#7017)
* Fix spinner output outside of TTY

* Use console.log

* Fix tests

* Revert "Fix tests"

This reverts commit 44383eea2dc3bb699d943079d77961ed86fe65d6.

* Revert "Use console.log"

This reverts commit 251bd1d624532e9ecfb4aee5b31538aa4ba740ef.
2021-11-17 14:04:59 +01:00
Steven
3fa08bf64f [cli] Fix update command to favor npm (#7018) 2021-11-16 16:07:31 -05:00
Steven
43056bde1f Publish Canary
- vercel@23.1.3-canary.33
2021-11-15 18:07:17 -05:00
Steven
a49966b9b4 [cli] Change vc build to use stdout (#7005) 2021-11-15 18:06:48 -05:00
Steven
7f55de71bb Publish Canary
- vercel@23.1.3-canary.32
 - @vercel/go@1.2.4-canary.4
 - vercel-plugin-go@1.0.0-canary.3
2021-11-15 13:37:04 -05:00
Steven
db8e36e04c [go] Add support for version 1.17 (#7002)
* Support more Go versions

Co-authored-by: Stefan M <StefMa@users.noreply.github.com>
2021-11-15 13:36:26 -05:00
Andy Bitz
82924bb5c4 Publish Canary
- vercel@23.1.3-canary.31
 - vercel-plugin-node@1.12.2-canary.9
2021-11-15 14:11:55 +01:00
Andy
18b5fac93e [vercel-plugin-node] Use .nft.json files instead of directories. (#6988)
* Ignore install step if package.json does not exist in entrypoint directory

* [plugin-node] Use `.nft.json` files

* Bump @vercel/fun

* Update package.json

* Remove package

* Remove import

* Update paths

* Revert "Update paths"

This reverts commit fa304e90381f475c64b2333402dca489813522da.

* Update path for windows

* Update handler path
2021-11-15 14:08:49 +01:00
Miroslav Simulcik
a6012e600b [cli] Fix updating of gitignore in vercel link (#6986)
* Fix updating of gitignore in link

* Fix modification of gitignore file during linking

* Fix empty file case
2021-11-12 17:11:21 +01:00
Steven
c3abf73f58 Publish Canary
- @vercel/build-utils@2.12.3-canary.18
 - vercel@23.1.3-canary.30
 - @vercel/client@10.2.3-canary.19
 - vercel-plugin-go@1.0.0-canary.2
 - vercel-plugin-node@1.12.2-canary.8
 - vercel-plugin-python@1.0.0-canary.2
 - vercel-plugin-ruby@1.0.0-canary.2
2021-11-11 14:54:33 -05:00
Steven
4873b8b379 [build-utils][node] Add updateFunctionsManifest function (#6971) 2021-11-11 14:53:43 -05:00
Miroslav Simulcik
6248139281 [cli] Prevent recursion of vercel build and vercel dev (#6960)
* Prevent infinite recursion of vercel build and dev

* Improved text

* Improved the text further

* Add tests

* Debug test

* Add debug log

* Debug test

* debug test

* Debug test

* Fix test

* Debug tests

* Debug test

* Remove only from tests

* Add error documentation

* Improved docs

* Fix other test

* Fixed links to error docs

* Remove legacy error page

* Use nicer error links

Co-authored-by: Leo Lamprecht <leo@vercel.com>
2021-11-11 10:51:30 -05:00
Miroslav Simulcik
507a5de3cd [tests] Fix getting of config paths (#6969)
Co-authored-by: Steven <steven@ceriously.com>
2021-11-09 14:34:41 -05:00
Gary Borton
be1c78e72f Publish Canary
- vercel@23.1.3-canary.29
 - vercel-plugin-middleware@0.0.0-canary.7
2021-11-09 11:07:01 -08:00
Gary Borton
c277c649c6 Fix middleware build result. Return middleware next when invalid result. (#6963)
* Fix middleware build result. Return middleware next when invalid result.

* Add a unit test that would have failed before previous commit.

* Copy next.js behavior.

* Add a test for invalid responses from middleware.

Co-authored-by: Leo Lamprecht <leo@vercel.com>
2021-11-09 11:06:16 -08:00
Steven
ed1dacd276 Publish Canary
- @vercel/build-utils@2.12.3-canary.17
 - vercel@23.1.3-canary.28
 - @vercel/client@10.2.3-canary.18
 - vercel-plugin-go@1.0.0-canary.1
 - vercel-plugin-python@1.0.0-canary.1
 - vercel-plugin-ruby@1.0.0-canary.1
 - @vercel/python@2.0.6-canary.5
 - @vercel/ruby@1.2.8-canary.4
2021-11-09 12:50:34 -05:00
Steven
144e890bfa Add plugin packages for go/python/ruby (#6961)
* Add plugin packages

* Fix usage

* Fix build

* Fix workspace linking to build-utils
2021-11-09 12:48:40 -05:00
Andy Bitz
af097c2c06 Publish Canary
- vercel@23.1.3-canary.27
2021-11-09 16:44:14 +01:00
Andy
873a582986 [cli] Ignore .next/cache in vc build (#6968)
* [cli] Ignore .next/cache in `vc build`

* Handle middleware-manifest.json

* Update manifest update
2021-11-09 16:43:26 +01:00
Andy Bitz
986b4c0b1a Publish Canary
- vercel@23.1.3-canary.26
2021-11-09 01:31:30 +01:00
Andy
14071819ac [cli] Fix NFT output path for monorepos (#6965)
* [cli] Fix `output` path for `.output` for `node_modules`

* Use baseDir instead of cwd

* Update comment

* Update output for requiredServerFiles
2021-11-09 01:30:49 +01:00
jj@jjsweb.site
2a8588a0c5 Publish Canary
- @vercel/build-utils@2.12.3-canary.16
 - vercel@23.1.3-canary.25
 - @vercel/client@10.2.3-canary.17
 - @vercel/frameworks@0.5.1-canary.11
 - @vercel/routing-utils@1.11.4-canary.6
2021-11-08 14:42:18 -06:00
JJ Kasper
0f7e89f76c [routing-utils] Add caseSensitive field to routes schema (#6952)
### Related Issues

x-ref: https://github.com/vercel/customer-issues/issues/34

### 📋 Checklist

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [ ] This PR has a concise title and thorough description useful to a reviewer
- [ ] Issue from task tracker has a link to this PR
2021-11-08 20:29:31 +00:00
Andy Bitz
e68ed33a88 Publish Canary
- vercel@23.1.3-canary.24
 - vercel-plugin-middleware@0.0.0-canary.6
2021-11-08 19:38:58 +01:00
Gary Borton
d3e98cdb73 [cli] Run middleware as a plugin instead of running directly (#6941)
* Move loadPlugins to a utils file to be shared w/ dev server.

* Update loadCliPlugins to also return startDevServer and runDevMiddleware based plugins.

* Move plugins back to dependencies.

These can't be bundled as it interferes with plugin resolution.

* Hook up middleware plugins to dev server.

* Pass output object to loadCliPlugins instead of a logging function.

* Allow more than one runDevMiddleware defining plugins.

* Bundle esbuild w/ middleware plugin.

* Keep esbuild as an external

* Update middleware's esbuild.

* set old space size

* Revert "set old space size"

This reverts commit b579194a862949a11769e9087f01c31f2e1f3b60.

* Use --max-old-space-size for CLI unit tests

* Increase memory

* Use `run.js` to set the memory

* Make NODE_OPTIONS optional

Co-authored-by: Leo Lamprecht <leo@vercel.com>
Co-authored-by: Andy <AndyBitz@users.noreply.github.com>
Co-authored-by: Andy Bitz <artzbitz@gmail.com>
2021-11-08 19:38:13 +01:00
Andy Bitz
bf4e77110f Publish Canary
- vercel@23.1.3-canary.23
 - @vercel/node@1.12.2-canary.6
 - vercel-plugin-node@1.12.2-canary.7
2021-11-08 15:00:01 +01:00
Nathan Rajlich
5b5197d2c5 [node] Create vercel-plugin-node (#6874)
* [node] Refactor to Vercel CLI Plugin

* Enforce "index" suffix on output Serverless Functions

So that nesting works properly

* Some cleanup

* Add version

* Use `@vercel/static-config`

* .

* Add support for wildcard routes

* Don't compile dotfiles, underscore prefixed files, files within `node_modules`, nor TypeScript definition files

Matches the logic from `maybeGetBuilder()` in `@vercel/build-utils`.

* Bump version

* Introduce testing framework

* Debug

* Add test without any deps

* Longer timeout to install Node.js for vercel/fun

* Install deps

* Add legacy Node.js server interface test

* More tests

* Test "assets" fixture

* Test "helpers" fixture

* fix

* Support AWS native API

* Remove debugging `console.log()` calls

* Use plugin-node for new plugin instead

* Revert "Use plugin-node for new plugin instead"

This reverts commit f317b8c6ecdc67a74d5f2b12a2e7567a27d4b6b8.

* Move to `plugin-node` directory

* Update plugin-node version in package.json

* Checkout node from main

* Add yarn.lock files for tests

* Update node-bridge

Co-authored-by: Andy <AndyBitz@users.noreply.github.com>
Co-authored-by: Andy Bitz <artzbitz@gmail.com>
2021-11-08 14:59:01 +01:00
Steven
a6ccf6c180 Publish Canary
- @vercel/build-utils@2.12.3-canary.15
 - vercel@23.1.3-canary.22
 - @vercel/client@10.2.3-canary.16
 - @vercel/node-bridge@2.1.1-canary.2
 - @vercel/node@1.12.2-canary.5
2021-11-05 18:40:08 -04:00
Steven
8d848ebe8b [node] Fix launcher ESM on Windows dev (#6953) 2021-11-05 18:38:55 -04:00
Steven
6ef2c16d63 [build-utils] Add convertRuntimeToPlugin() (#6942) 2021-11-05 16:12:21 -04:00
Andy Bitz
6c71ceaaeb Publish Canary
- vercel@23.1.3-canary.21
2021-11-05 10:26:15 +01:00
Andy
1dcb6dfc6f [cli] Rename certain outputs in vercel build (#6948) 2021-11-05 10:24:49 +01:00
Steven
4fd24575e5 Publish Canary
- vercel@23.1.3-canary.20
 - vercel-plugin-middleware@0.0.0-canary.5
2021-11-03 09:06:27 -04:00
Gary Borton
8714f1905e [cli] Render an error page when middleware explodes. (#6934)
### Related Issues

This adds error handling for middleware in `vc dev`

Local looks a little different than production:
Local
![image](https://user-images.githubusercontent.com/4172067/139951848-efa08a88-aeee-446f-8319-35c8bb0b1d75.png)

Production
![image](https://user-images.githubusercontent.com/4172067/139951580-33a4ad0f-18a5-4aa1-bfb0-5e1da646a4b8.png)


### 📋 Checklist

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [ ] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [x] This PR has a concise title and thorough description useful to a reviewer
- [ ] Issue from task tracker has a link to this PR
2021-11-02 23:57:46 +00:00
Jared Palmer
2e69f2513d [cli] Make sure vc pull properly sets currentTeam (#6936)
### Related Issues

> Fixes https://github.com/vercel/runtimes/issues/219

### 📋 Checklist

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [ ] This PR has a concise title and thorough description useful to a reviewer
- [ ] Issue from task tracker has a link to this PR
2021-11-02 23:07:28 +00:00
Gary Borton
979e4b674a [cli] Bundle middleware deps (#6932)
* Use ncc to bundle middleware plugin, move dependencies to devDependencies, remove querystring

* Switch from globby (deprecated dependencies) to glob in middleware plugin.

* Bundle the node-plugin and middleware-plugin into cli.
2021-11-02 17:08:02 -04:00
Nathan Rajlich
07fa47bcfb Publish Canary
- vercel@23.1.3-canary.19
 - vercel-plugin-middleware@0.0.0-canary.4
2021-10-29 18:17:08 -07:00
Nathan Rajlich
307c4fc377 [cli] Bump vercel-plugin-node to latest 2021-10-29 18:16:16 -07:00
Nathan Rajlich
44868d79b6 Add initial vercel-plugin-middleware (#6892)
* Add initial `vercel-plugin-middleware`

* Ignore `entries.js` from ESLint

* Add `runDevMiddleware()` stub

* Add test

* Add support for "_middleware.{js,ts}" to `vercel dev` (#6880)

* Add websandbox from next.js codebase.

* Use node-fetch instead of next's polyfilled fetch.

* Handle middleware rewrites.

* Add response, headers, and request to websandbox context.

* Move websandbox dependency to middleware plugin.

* Add integration tests, update websandbox to support ts files and json imports.

* commit yarn.lock changes after rebasing

* Clean up left over console.logs, fix some tsc issues, and rebase issue.

* Fix failing test and eslint.

* Fix middleware test on windows.

* [examples] Update Vercel Next.js example template to 12.0.1 (#6905)

* Mark the Plugins as external to CLI's ncc build

* [cli] Improve tracing in vc build (#6898)

* [cli] Fix tracing for `vc build`

* Ignore object when there are no changes

* Make Next < 12 work with FS API w/ nft

* Update packages/cli/src/commands/build.ts

Co-authored-by: Nathan Rajlich <n@n8.io>

* Document how Next.js processing works in build

* [cli] Fix static assets (#6906)

* Make sure output path is .next

* Fix up require-server-files for processing

* Fix typo

* Move static

* Update static rename

Co-authored-by: Andy Bitz <artzbitz@gmail.com>
Co-authored-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Andy <AndyBitz@users.noreply.github.com>

* Publish Canary

 - vercel@23.1.3-canary.17
 - @vercel/client@10.2.3-canary.15
 - @vercel/static-config@0.0.1-canary.0

* [cli] Ignore `.env` and `.gitignore` in "vc build" (#6910)

* Publish Canary

 - vercel@23.1.3-canary.18

* Pass workPath to plugins.

The new plugin architecture doesn't pass a full BuildOptions object, previous
to this commit it wasn't passing any options at all. I've added workingPath to
support running dev/build from directories other than the project root.

* Remove error state when package.json exists, but no build script

This allows vercel build to continue working for projects that are not using
frameworks, but use package.json to manage dependencies.

* Fix types, pull in middleware header fix from next.js

Next js PR w/ the header fix:
https://github.com/vercel/next.js/pull/30560

* Fix missing entries file for vc build.

* Update call signature of middleware when using vc build.

Co-authored-by: Drew Bredvick <dbredvick@gmail.com>
Co-authored-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Jared Palmer <jared@jaredpalmer.com>
Co-authored-by: Andy Bitz <artzbitz@gmail.com>
Co-authored-by: Andy <AndyBitz@users.noreply.github.com>

Co-authored-by: Gary Borton <gdborton@gmail.com>
Co-authored-by: Drew Bredvick <dbredvick@gmail.com>
Co-authored-by: Jared Palmer <jared@jaredpalmer.com>
Co-authored-by: Andy Bitz <artzbitz@gmail.com>
Co-authored-by: Andy <AndyBitz@users.noreply.github.com>
2021-10-29 17:15:20 -07:00
Nathan Rajlich
df9a4afa5c Publish Canary
- vercel@23.1.3-canary.18
2021-10-29 12:22:35 -07:00
Nathan Rajlich
8a6869bae2 [cli] Ignore .env and .gitignore in "vc build" (#6910) 2021-10-29 12:21:46 -07:00
Andy Bitz
a3fc3c1ca7 Publish Canary
- vercel@23.1.3-canary.17
 - @vercel/client@10.2.3-canary.15
 - @vercel/static-config@0.0.1-canary.0
2021-10-29 20:49:54 +02:00
Jared Palmer
44037c58be [cli] Improve tracing in vc build (#6898)
* [cli] Fix tracing for `vc build`

* Ignore object when there are no changes

* Make Next < 12 work with FS API w/ nft

* Update packages/cli/src/commands/build.ts

Co-authored-by: Nathan Rajlich <n@n8.io>

* Document how Next.js processing works in build

* [cli] Fix static assets (#6906)

* Make sure output path is .next

* Fix up require-server-files for processing

* Fix typo

* Move static

* Update static rename

Co-authored-by: Andy Bitz <artzbitz@gmail.com>
Co-authored-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Andy <AndyBitz@users.noreply.github.com>
2021-10-29 20:49:21 +02:00
Drew Bredvick
1a9419b690 [examples] Update Vercel Next.js example template to 12.0.1 (#6905) 2021-10-29 13:03:31 -04:00
Nathan Rajlich
93d0e5966c [cli] Fix integration tests that check .gitignore (#6904) 2021-10-28 12:37:39 -07:00
Nathan Rajlich
306f3a1312 Add to "static-config" to run.js script 2021-10-27 17:36:32 -07:00
Nathan Rajlich
9c67e8115e Add @vercel/static-config (#6897) 2021-10-27 17:03:12 -07:00
Andy
b890ac1e44 [cli] Fix tracing for vc build (#6896)
* [cli] Fix tracing for `vc build`

* Ignore object when there are no changes
2021-10-28 00:20:44 +02:00
Andy
28e71ff109 [cli][client] Add step for checks (#6889)
* [cli][client] Add step for checks

* Update output

* Remove skipped message

* Correctly use `finishedEvents`

* Update packages/cli/src/commands/deploy/index.ts

Co-authored-by: Chris <7249920+chriswdmr@users.noreply.github.com>

* Add back deleted files

Co-authored-by: Chris <7249920+chriswdmr@users.noreply.github.com>
2021-10-27 20:22:35 +02:00
Andy Bitz
2bf060c708 Publish Canary
- @vercel/build-utils@2.12.3-canary.14
 - vercel@23.1.3-canary.16
 - @vercel/client@10.2.3-canary.14
 - @vercel/frameworks@0.5.1-canary.10
2021-10-26 14:10:32 +02:00
Jared Palmer
c8ef1d71d1 [cli] Add vercel build (#6861)
* Add PoC pull command

* Improve pull's linking logic

* Remove `__VERCEL_SKIP_PULL_CMD` env var and unneeded type narrowing

* Improve pull's link logic

* Fix team mock

* Add smoke test for vc pull

* Add setupFixture helper

* Remove debug duplicate

* Use a fixture in pull test

* Put back debug

* Fix unit test

* Fix test on windows

* Remove mock-stdin

* Pass cwd to link and pull

* Add help command for `vc pull`

* Organize imports

* Update packages/cli/src/commands/deploy/args.ts

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

* Use tmp-promise instead of tmp

* Update packages/cli/src/commands/pull.ts

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

* Update packages/cli/src/commands/pull.ts

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

* Clean up pull comments and variable declarations

* Remove graceful tmp directory cleanup

* Put back graceful cleanup

* Print output for debugging

* Moar debug

* Set 10s timeout for `vc pull` test

* Change fixture to now-pull-next

* Fix pull test name

* Switch project mock to use encrypted env

* Add --env flag

* Update fixtures

* Remove now- from everywhere

* Remove instrumentation

* Rename setupFixture to setup-fixture

* Add deprecation warning to `vc env pull`

* Update packages/cli/src/commands/deploy/args.ts

Co-authored-by: Nathan Rajlich <nathan@tootallnate.net>

* Update packages/cli/src/commands/env/pull.ts

Co-authored-by: Nathan Rajlich <nathan@tootallnate.net>

* Fix pull and update imports

* Revamped build command

* printConfig -> renderConfig

* Remove frameworks

* Add build state unit test for gatsby

* Update packages/cli/src/commands/pull.ts

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

* Update packages/cli/src/commands/env/index.ts

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

* Update packages/cli/src/util/projects/write-project-settings.ts

Co-authored-by: Nathan Rajlich <nathan@tootallnate.net>

* Update packages/cli/src/commands/pull.ts

Co-authored-by: Nathan Rajlich <nathan@tootallnate.net>

* Don't writeProjectSettings in env pull

* Cleanup fixtures once afterAll

* Add help text for --env and -y

* Add output for pull

* Write project settings output after env output

* Pushing for Nate

* Add todo about handling Other's build output directory

* Add support for plugins

* Improve prompt logic loop

* Pluralize plugin output

* Better plugin failure handling

* Refactor away from BuildState class

* Remove unused file

* Correct framework detection logic, smart copy w/hardlinks

* Generate build manifest

* Generate routes-manifest.json

* Remove ambiguity when calling vc build

* Make sure manifests have all keys

* Ensure that .output is added to .gitignore in vc link

* Remove directoryListing from project settings

* Add support for default cli plugins

* Remove directory listing

* Install vercel-plugin-node

* Patch console.log and console.error for plugins

* Improve build output

* Remove unused unit tests

* Allow build without token

* Add vercel plugin middleware

* Bump vercel-plugin-middleware

* Bump middleware plugin

* Tweak require.resolve

* Tweak require.resolve to __dirname

* Update `vercel-plugin-node`

* Fix prefixed logs when using formatters i.e. `%j`

* Pretty print the manifest files

* Get unique CLI deps

For the case where the local project has one of the CLI default plugins
specified.

* Update packages/cli/package.json

Co-authored-by: Nathan Rajlich <nathan@tootallnate.net>

* Add help output

* Remove p-limit properly

* Confirm before pull in build

* Bump `vercel-plugin-node`

* [cli] Make Next.js move files into .output (#6885)

* Use OUTPUT_DIR

* Return properly if no package.json exists and no build command

* Invert logic for runPackageJsonScript

* Bump `vercel-plugin-middleware`

* Fix defaultHeaders in frameworks

* Fix build when nft files is object

* Update `yarn.lock`

* 2nd attempt at --prebuilt (#6888)

Co-authored-by: Andy Bitz <artzbitz@gmail.com>

* Add beta and feedback to vc build

Co-authored-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Nathan Rajlich <nathan@tootallnate.net>
Co-authored-by: Andy Bitz <artzbitz@gmail.com>
2021-10-26 14:04:52 +02:00
Nathan Rajlich
3d2efc7dcd [frameworks] Fix small typo in "Other" preset description (#6882) 2021-10-23 14:56:22 +00:00
jj@jjsweb.site
cd7185a872 Publish Canary
- @vercel/build-utils@2.12.3-canary.13
 - vercel@23.1.3-canary.15
 - @vercel/client@10.2.3-canary.13
 - @vercel/frameworks@0.5.1-canary.9
 - @vercel/routing-utils@1.11.4-canary.5
2021-10-21 17:58:50 -05:00
Kiko Beats
981a76fbe2 [routing-utils] Add missing fields (#6872)
* chore: add missing fields

* Update types.ts

* Update types.ts

* chore add missing as part of the schema

* test: add missing case
2021-10-21 17:57:48 -05:00
Nathan Rajlich
c35c05446b [cli] Add CLI login unit test (#6866)
This has just been sitting in my working tree for a while, might as well push it up.
2021-10-19 20:38:29 +00:00
Jared Palmer
b88e65c4ad [cli] Add vercel pull command (#6822)
Add `vercel pull` command. Closes https://github.com/vercel/runtimes/issues/142. 

![CleanShot 2021-10-19 at 08 50 07](https://user-images.githubusercontent.com/4060187/137946853-860204ba-afaa-42da-be8a-d35bec97c808.png)

It does the following:
- Pull the `.env` file (it calls `pull` internally)
- Adds the following to `.vercel/project.json` (which will then be used by `vercel build`):
   ```tsx
   interface ProjectLink {
        projectId: string
        orgId: string
        settings: {
          buildCommand: string | null,
          devCommand:  string | null,
          directoryListing:  string | null,
          outputDirectory:  string | null,
          rootDirectory:  string | null,
          framework: string | null,
        }
    }
   ```
This PR also deprecates `vc env pull` with a warning:

![CleanShot 2021-10-19 at 08 50 21](https://user-images.githubusercontent.com/4060187/137946847-e102bd99-943a-4f07-b457-fe886007c044.png)

### 📋 Checklist

- [x] Help output
- [x] Flags (need to combine flags from `env pull`)

#### Tests

- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [x] This PR has a concise title and thorough description useful to a reviewer
- [x] Issue from task tracker has a link to this PR
2021-10-19 19:10:31 +00:00
Javi Velasco
9e16ce750b Publish Canary
- @vercel/build-utils@2.12.3-canary.12
 - vercel@23.1.3-canary.14
 - @vercel/client@10.2.3-canary.12
 - @vercel/frameworks@0.5.1-canary.8
 - @vercel/routing-utils@1.11.4-canary.4
2021-10-19 14:52:11 +02:00
Javi Velasco
2105d31730 Update middleware route (#6863) 2021-10-19 14:50:41 +02:00
jj@jjsweb.site
3d7e01ebf0 Publish Canary
- @vercel/build-utils@2.12.3-canary.11
 - vercel@23.1.3-canary.13
 - @vercel/client@10.2.3-canary.11
 - @vercel/frameworks@0.5.1-canary.7
 - @vercel/routing-utils@1.11.4-canary.3
2021-10-18 16:50:01 -05:00
JJ Kasper
dccacc4ca0 [routing-utils] Update routes schema for new property (#6860)
Adds an additional property for the `routes` schema. 

### Related Issues

N/A

### 📋 Checklist

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [ ] This PR has a concise title and thorough description useful to a reviewer
- [ ] Issue from task tracker has a link to this PR
2021-10-18 21:45:42 +00:00
Devon Govett
be5c0da521 [example][frameworks] Add support for Parcel framework (#6836) 2021-10-14 14:53:57 -07:00
Katie Byers
f985d953ed [cli] Fix swapped error messages in executeBuild() (#6724) 2021-10-14 14:31:02 -07:00
Nathan Rajlich
b8f8289afe [cli] Use getters for Now props that mirror Client (#6838)
This will prevent any issues where the `Now` instance is out-of-sync with the `Client` instance, for example, during a re-auth where a new auth token is issued. Also reduces a bit of code which is nice.
2021-10-13 22:40:06 +00:00
Nathan Rajlich
e01a1cebfd [cli] Don't pass teamId query param to /verify token endpoint (#6841)
Fixes an issue where the token would not be properly upgraded while
a Team scope was currently active, causing a new auth token to be issued
and lose the previous access scope(s).
2021-10-13 14:39:24 -07:00
Matt Netkow
2515d522a3 [frameworks] Make "vercel dev" work with Ionic Angular projects (#6658) 2021-10-13 11:32:26 -07:00
Nathan Rajlich
32e935d632 [cli] Use GET /v2/user endpoint (#6828)
The `/www/user` endpoint is deprecated.
2021-10-13 17:20:54 +00:00
Miroslav Simulcik
e6818dd3f9 Publish Canary
- @vercel/build-utils@2.12.3-canary.10
 - vercel@23.1.3-canary.12
 - @vercel/client@10.2.3-canary.10
2021-10-13 16:52:12 +02:00
Miroslav Simulcik
e510415a66 Add regions to lambda options (#6829) 2021-10-13 16:47:18 +02:00
Nathan Rajlich
1be75712e0 [cli] Add outputBuffer getter and mutable isTTY for tests (#6827)
These changes originally from #6652, but pulled out to be merged
separately.

`outputBuffer` is a simpler way of asserting tests against the CLI
output instead of working directly withe Jest mock function.

`output.isTTY` is also now mutable, so that we can write tests for both
cases when the output is different based on TTY-ness (for example,
see the updated `vc whoami` tests in this PR).
2021-10-12 16:16:55 -07:00
Andy Bitz
f682aefc9d Publish Canary
- @vercel/build-utils@2.12.3-canary.9
 - vercel@23.1.3-canary.11
 - @vercel/client@10.2.3-canary.9
 - @vercel/frameworks@0.5.1-canary.6
2021-10-12 12:56:49 +02:00
Andy
cd485c1866 [frameworks] Add Nuxt 3 to framework detection (#6823) 2021-10-12 12:43:40 +02:00
Steven
f7de7227b4 Publish Canary
- @vercel/build-utils@2.12.3-canary.8
 - vercel@23.1.3-canary.10
 - @vercel/client@10.2.3-canary.8
2021-09-23 14:28:52 -04:00
Steven
abea217177 [build-utils] Add allowQuery to Prerender (#6766) 2021-09-23 14:25:44 -04:00
Steven
4e52f8532b Publish Canary
- @vercel/build-utils@2.12.3-canary.7
 - vercel@23.1.3-canary.9
 - @vercel/client@10.2.3-canary.7
 - @vercel/go@1.2.4-canary.3
 - @vercel/node@1.12.2-canary.4
 - @vercel/python@2.0.6-canary.4
 - @vercel/ruby@1.2.8-canary.3
2021-09-21 22:20:00 -04:00
Steven
702cb9e29c [all] Revert to @vercel/ncc@0.24.0 (#6749) 2021-09-21 22:17:06 -04:00
jj@jjsweb.site
d3d5555d79 Publish Canary
- @vercel/build-utils@2.12.3-canary.6
 - vercel@23.1.3-canary.8
 - @vercel/client@10.2.3-canary.6
 - @vercel/frameworks@0.5.1-canary.5
 - @vercel/routing-utils@1.11.4-canary.2
2021-09-20 19:35:05 -05:00
JJ Kasper
2fd3fc73e5 [routing-utils] Allow passing internal params to convertRewrites (#6742)
This adds an argument to allow passing internal param names that should be ignored when considering whether params should be auto-added to a rewrite's destination query. After adding this we should be able to resolve https://github.com/vercel/next.js/issues/27563 in the runtime where `convertRewrites` is called. 

This matches Next.js' handling for internal params which can be seen [here](e90825ad88/packages/next/shared/lib/router/utils/prepare-destination.ts (L203))

### Related Issues

x-ref: https://github.com/vercel/next.js/issues/27563

### 📋 Checklist

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [ ] This PR has a concise title and thorough description useful to a reviewer
- [ ] Issue from task tracker has a link to this PR
2021-09-21 00:15:29 +00:00
Steven
de0b13a46e Publish Canary
- vercel@23.1.3-canary.7
 - @vercel/node@1.12.2-canary.3
2021-09-16 12:54:47 -04:00
Steven
d0fe85db92 [node] Bump nft to 0.14.0 (#6727) 2021-09-16 12:49:04 -04:00
jj@jjsweb.site
bfbd927320 Publish Canary
- @vercel/build-utils@2.12.3-canary.5
 - vercel@23.1.3-canary.6
 - @vercel/client@10.2.3-canary.5
 - @vercel/frameworks@0.5.1-canary.4
 - @vercel/routing-utils@1.11.4-canary.1
2021-09-14 15:02:32 -05:00
JJ Kasper
90bacf88b8 [routing-utils] Fix host segment replacing (#6713)
* Fix host segment replacing

* Add additional check
2021-09-14 13:20:35 -05:00
Steven
07c369c542 Publish Canary
- @vercel/build-utils@2.12.3-canary.4
 - vercel@23.1.3-canary.5
 - @vercel/client@10.2.3-canary.4
 - @vercel/go@1.2.4-canary.2
 - @vercel/node@1.12.2-canary.2
 - @vercel/python@2.0.6-canary.3
 - @vercel/ruby@1.2.8-canary.2
2021-09-13 16:32:45 -04:00
Steven
a2e4186ccb [all] Bump ncc to 0.31.1 (#6700)
https://github.com/vercel/ncc/releases/tag/0.31.0

https://github.com/vercel/ncc/releases/tag/0.31.1
2021-09-13 20:20:48 +00:00
Steven
6e1d708e3f Publish Canary
- vercel@23.1.3-canary.4
 - @vercel/python@2.0.6-canary.2
2021-09-08 13:56:20 -04:00
Noa
38503103c3 [python] Use pip --upgrade when installing function dependencies (#6683)
Co-authored-by: Steven <steven@ceriously.com>
2021-09-08 13:54:03 -04:00
jj@jjsweb.site
e8fec4b69c Publish Canary
- @vercel/build-utils@2.12.3-canary.3
 - vercel@23.1.3-canary.3
 - @vercel/client@10.2.3-canary.3
 - @vercel/frameworks@0.5.1-canary.3
 - @vercel/routing-utils@1.11.4-canary.0
2021-09-07 11:52:01 -05:00
JJ Kasper
b3ffcdf80d [routing-utils] Ensure headers with only has items are replaced correctly (#6686)
This ensures we replace header values correctly when no named segments are used and only has items are used. 

### Related Issues

Fixes: https://vercel.slack.com/archives/CHTTGQYQ4/p1631023974185700

### 📋 Checklist

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [ ] This PR has a concise title and thorough description useful to a reviewer
- [ ] Issue from task tracker has a link to this PR
2021-09-07 16:17:01 +00:00
Leo Lamprecht
43c1a93c1d Enabled blank issues temporarily 2021-09-06 18:24:53 +02:00
Leo Lamprecht
5b118fd4e6 Disable blank issues again 2021-09-06 14:47:15 +02:00
Leo Lamprecht
8916b674af Temporarily enable blank issues 2021-09-06 14:41:32 +02:00
Brody McKee
1807f83c69 Update NPM publish token (#6672) 2021-09-03 19:44:59 +03:00
Steven
74e8ec7c64 Fix lerna publish for automation token (#6666)
Related to https://github.com/lerna/lerna/issues/2788
2021-09-03 00:20:20 +00:00
Steven
2644e3127b Publish Canary
- @vercel/build-utils@2.12.3-canary.2
 - vercel@23.1.3-canary.2
 - @vercel/client@10.2.3-canary.2
2021-09-02 08:42:33 -04:00
Leo Lamprecht
d77ac04b0c Disable blank issues again 2021-09-02 13:52:18 +02:00
Leo Lamprecht
0ef9c8df4d Temporarily enable issues 2021-09-02 13:45:20 +02:00
Steven
dfc4c98820 [build-utils] Fix custom 404 route (#6657)
The Custom 404 feature was originally implemented in #4563 but was matching too broadly (see [gist](https://gist.github.com/kjk/4dc57da62d7e715c687cc7914847ffb2))

This PR fixes the custom 404 route and updates the tests.
2021-09-02 00:12:45 +00:00
Steven
0e51884725 Publish Canary
- @vercel/build-utils@2.12.3-canary.1
 - vercel@23.1.3-canary.1
 - @vercel/client@10.2.3-canary.1
 - @vercel/frameworks@0.5.1-canary.2
 - @vercel/go@1.2.4-canary.1
 - @vercel/node-bridge@2.1.1-canary.1
 - @vercel/node@1.12.2-canary.1
 - @vercel/python@2.0.6-canary.1
 - @vercel/ruby@1.2.8-canary.1
2021-08-31 17:18:35 -04:00
Steven
1b264fe60e [build-utils] Add allowQuery to Lambda (#6651) 2021-08-31 17:17:31 -04:00
Nathan Rajlich
f18bca9718 [cli] Refactor legacy Now client to TypeScript (#6650) 2021-08-31 12:47:17 -07:00
Steven
c23dc73f41 [examples] Bump Next.js to 11.1.2 (#6648)
* Bump Next.js to 11.1.1

* Bump Next.js to 11.1.2
2021-08-31 10:53:18 -04:00
Nathan Rajlich
273718e0b7 [cli] Rewrite Unit tests to TypeScript + Jest (#6638)
* Rewrites the CLI unit tests to be TypeScript and use Jest (consistent with the unit tests in the other packages in this repo).
* The file structure of the new test files mirrors that of the `src` directory, so that it's easy to find the relevant tests.
* Code coverage is also properly set up through Jest - you can already see a big increase in coverage from this PR.
* Adds a mock API server framework, with the intention of making it possible to write granular tests of the CLI commands. Using mocks also has the benefit of not requiring `VERCEL_TOKEN` env var to be set, so 3rd party PRs will be able to have their tests run. Ultimately this will also help with test coverage, since we will be writing unit tests that test the commands' code directly.
* Converts `Output` into a proper class (which is subclassed for the mocks).
2021-08-30 22:07:09 +00:00
Nathan Rajlich
230b88bf9b [cli] Remove broken vc downgrade command (#6643)
It maps to an "upgrade" command, which does not exist.

Fixes:

```
$ vc downgrade
Vercel CLI 23.1.2
Error! Cannot find module './upgrade'
```
2021-08-28 18:01:31 +00:00
Nathan Rajlich
676a3d2568 [cli] Refactor src/index to TypeScript (#6602)
Refactors the CLI entrypoint `src/index.js` to TypeScript.
2021-08-27 19:48:31 +00:00
Nathan Rajlich
f221f041d0 Update @vercel/ncc to v0.29.2 (#6605) 2021-08-27 10:03:36 -07:00
Kaitlyn
aca42b2aac [examples] Update angular example to npm 7 (#6636) 2021-08-25 17:24:37 -07:00
Kaitlyn Carter
cf11a8efb5 Revert "delete yarn.lock"
This reverts commit b941715d7b.
2021-08-25 18:43:29 -04:00
Kaitlyn Carter
be09349daf Revert "update npm peer dependencies"
This reverts commit a01372bcbb.
2021-08-25 18:34:21 -04:00
Kaitlyn Carter
a01372bcbb update npm peer dependencies 2021-08-25 17:51:22 -04:00
Kaitlyn Carter
b941715d7b delete yarn.lock 2021-08-25 17:48:44 -04:00
Nathan Rajlich
ee9a8a0415 [cli] Refactor vc teams to TypeScript (#6610) 2021-08-24 11:08:30 -07:00
jj@jjsweb.site
2ad27eefb0 Publish Canary
- @vercel/build-utils@2.12.3-canary.0
 - vercel@23.1.3-canary.0
 - @vercel/client@10.2.3-canary.0
 - @vercel/frameworks@0.5.1-canary.1
 - @vercel/go@1.2.4-canary.0
 - @vercel/node-bridge@2.1.1-canary.0
 - @vercel/node@1.12.2-canary.0
 - @vercel/python@2.0.6-canary.0
 - @vercel/ruby@1.2.8-canary.0
2021-08-24 09:36:40 -05:00
Nathan Rajlich
578fe8a930 [cli] Support --project flag in vc link command (#6614)
To make setting up local dev README instructions easier for new users being introduced to a Vercel project, support flags to make the `vc link` command be non-interactive, in the case where the project name does not match the name of the directory where the code is located:

```
$ vc link --scope acme --project docs
```

Related to https://github.com/vercel/front/pull/10732.
2021-08-23 23:22:57 +00:00
JJ Kasper
04ea3bb88d [node-bridge] Fix error in node-bridge from decoded path (#6583)
* Fix error in node-bridge from decoded path

* Apply suggestions from code review

Co-authored-by: Steven <steven@ceriously.com>
2021-08-23 14:50:18 -05:00
Steven
46116022b7 [cli] Update readme (#6622) 2021-08-23 12:04:38 -04:00
Lee Robinson
f80539df82 Update README (#6618) 2021-08-22 23:39:04 +00:00
Johan Eliasson
daf06307b4 Fix deprecation message for NowRequestBody (#6613) 2021-08-20 12:58:47 -07:00
Nathan Rajlich
0bd028cd84 [cli] Show server-side errorMessage upon deployment UNEXPECTED_ERROR (#6606)
Before:

```
Error! Unexpected error. Please try again later. ()
```

After:

```
Error! An unexpected error happened when running this build. We have been notified of the problem. If you have any questions, please contact support@vercel.com.
```
2021-08-17 18:28:56 -07:00
Nathan Rajlich
1c48030e1e [cli] Stop installing @now/build-utils for vc dev (#6604)
Users should not be using any legacy Runtimes that depend on `@now/build-utils` at this point, since those have not received updates in a long time.
2021-08-17 17:35:55 +00:00
Nathan Rajlich
1dc05428d7 [go][node][python][ruby] Remove @now/build-utils backwards compat hack (#6603)
`@now/build-utils` has not been published in a long time, so let's remove this logic.
2021-08-17 15:29:52 +00:00
Nathan Rajlich
288dca045c [cli] Refactor a handful of util modules to TypeScript (#6584) 2021-08-13 20:26:02 +00:00
Steven
8c5bc04fde Fix publish script for Windows (#6591)
* Fix publish script for Windows

* Update changelog.js
2021-08-13 12:03:54 -04:00
Steven
a07e6fc103 [examples] Bump Next.js to 11.1.0 (#6582) 2021-08-11 15:41:38 -04:00
Nathan Rajlich
9af3054d41 [cli] Use client.fetch() in vc init (#6575)
Gives us debug logging and retries, etc.
2021-08-11 19:04:01 +00:00
Nathan Rajlich
9fb254e14a [cli] Attempt to fix the "lambda-with-3-second-timeout" E2E test (#6579) 2021-08-11 00:50:57 -07:00
William Li
3616bdf17a bump react-scripts to @latest (#6577) 2021-08-11 11:11:43 +08:00
Nathan Rajlich
52a89fd4b7 [cli] Remove withSpinner() helper (#6576)
It's not really necessary and doesn't use the common `Output` instance.
2021-08-10 10:41:44 -07:00
Nathan Rajlich
d4db6635f1 [cli] Remove unnecessary await in Dev tests (#6572)
This is the result of VS Code's "remove all unneeded await calls" formatter.
2021-08-10 02:01:56 -07:00
Nathan Rajlich
f1009a80cd [api] Fix GET /api/examples/list output (#6574)
A regression from #6554 caused the return value to contain a nested
object with a `name` property for the `name` key of the response in the
list.
2021-08-09 22:24:17 -07:00
Steven
2756d1e323 [client][frameworks][api] Update readdir() call with withFileTypes (#6554)
Avoids running unnecessary code such as `stat().isDirectory()`.
2021-08-09 14:27:50 -07:00
Nathan Rajlich
5b61b16bd1 Publish Stable
- @vercel/build-utils@2.12.2
 - vercel@23.1.2
 - @vercel/client@10.2.2
 - @vercel/node@1.12.1
2021-08-09 11:21:40 -07:00
Nathan Rajlich
41c61f8f8b Publish Canary
- vercel@23.1.2-canary.1
2021-08-09 10:00:43 -07:00
Nathan Rajlich
6c52e1fad7 [cli] Add "outDir" to tsconfig.json (#6566)
Fixes TypeScript errors.
2021-08-09 09:58:30 -07:00
Nathan Rajlich
d2e82fdc3a [cli] Fix in-flight re-login when there are no existing credentials (#6565) 2021-08-08 00:57:23 -07:00
Nathan Rajlich
a60b1b225b Publish Canary
- @vercel/build-utils@2.12.2-canary.0
 - vercel@23.1.2-canary.0
 - @vercel/client@10.2.2-canary.0
 - @vercel/node@1.12.1-canary.0
2021-08-06 17:15:13 -07:00
Kaitlyn
18bec983ae [build-utils] check to see that the node version is less then 16 befo… (#6553)
### Related Issues

Check the project's nodeVersion setting for when we release Node 16 and later

### 📋 Checklist

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [ ] The code changed/added as part of this PR has been covered with tests
- [ ] All tests pass locally with `yarn test-unit`

#### Code Review

- [ ] This PR has a concise title and thorough description useful to a reviewer
- [ ] Issue from task tracker has a link to this PR
2021-08-07 00:14:21 +00:00
Nathan Rajlich
e6fb2ffe05 Publish Stable
- @vercel/build-utils@2.12.1
 - vercel@23.1.1
 - @vercel/client@10.2.1
2021-08-06 13:00:16 -07:00
Nathan Rajlich
0533cfd566 [build-utils] Fix test name 2021-08-06 12:48:58 -07:00
Nathan Rajlich
3db8618885 Publish Canary
- @vercel/build-utils@2.12.1-canary.0
 - vercel@23.1.1-canary.0
 - @vercel/client@10.2.1-canary.0
 - @vercel/frameworks@0.5.1-canary.0
2021-08-06 11:52:56 -07:00
Nathan Rajlich
4722ea5ad6 [build-utils] Make scanParentDirs() work with npm Workspaces (#6559)
Currently, when `scanParentDirs()` finds the closest `package.json` file, it stops iteration regardless of whether or not a lockfile was found. For npm Workspaces, this is problematic because if you are deploying a subdirectory of a monorepo, then there will be no lockfile in the subdirectory (the `package-lock.json` file is at the root of the project). So instead of stopping once the `package.json` file is found, instead stop when the first lockfile is found.
2021-08-06 18:48:23 +00:00
Nathan Rajlich
c7bd6f3266 [tests] Define jest/ts-jest deps at the root level (#6556)
And remove `jest`/`ts-jest` from the individual packages. It is important to have a consistent version of `jest` being used throughout the monorepo, otherwise bizarre errors surface that cause jest to crash, such as [here](https://github.com/vercel/vercel/runs/3255999061?check_suite_focus=true):

```
TypeError: this._environment.runScript is not a function

  at Runtime._execModule (../../node_modules/jest-runner/node_modules/jest-runtime/build/index.js:856:41)
```
2021-08-05 21:06:18 +00:00
Nathan Rajlich
1a776ad343 Publish Stable
- @vercel/build-utils@2.12.0
 - vercel@23.1.0
 - @vercel/client@10.2.0
 - @vercel/frameworks@0.5.0
 - @vercel/go@1.2.3
 - @vercel/node-bridge@2.1.0
 - @vercel/node@1.12.0
 - @vercel/python@2.0.5
 - @vercel/routing-utils@1.11.3
 - @vercel/ruby@1.2.7
2021-08-05 12:50:38 -07:00
Kaitlyn Carter
f0dab7d26d Publish Canary
- @vercel/build-utils@2.11.2-canary.7
 - vercel@23.0.2-canary.12
 - @vercel/client@10.1.2-canary.8
2021-08-04 16:43:03 -04:00
Kaitlyn
9a5ad5c31f [build-utils] Add logging for when npm 7 is used (#6552) 2021-08-04 13:41:12 -07:00
Nathan Rajlich
a6243962b8 Publish Canary
- @vercel/build-utils@2.11.2-canary.6
 - vercel@23.0.2-canary.11
 - @vercel/client@10.1.2-canary.7
 - @vercel/frameworks@0.4.2-canary.5
2021-08-03 11:13:36 -07:00
Nathan Rajlich
9cb7d315c5 [build-utils] Invoke npm 7 when lockfile version 2 is detected (#6532)
As the title suggests, this PR makes it such that npm 7 will be invoked when there is a `package-lock.json` file with `lockfileVersion` 2 or greater, by prepending the the `$PATH` a directory within the build container where npm 7 is located.

The test fixture `20-npm-7` is also enabled for E2E testing, to ensure that the proper npm version is enabled in the production build.
2021-08-03 16:16:24 +00:00
Kaitlyn
ef37279270 [build-utils] Return "lockfileVersion" property in scanParentDirs() function (#6533)
### Related Issues
[23112](https://app.clubhouse.io/vercel/story/23112/make-scanparentdirs-function-return-the-lockfileversion-property)

#### Tests

- [* ] The code changed/added as part of this PR has been covered with tests
- [* ] All tests pass locally with `yarn test-unit`

#### Code Review

- [*] This PR has a concise title and thorough description useful to a reviewer
- [* ] Issue from task tracker has a link to this PR
2021-07-30 22:20:24 +00:00
Leo Lamprecht
f919137443 Fixed links (#6529) 2021-07-29 13:47:12 +02:00
Sébastien Chopin
c6f2021d15 [examples][frameworks][nuxtjs] Update design and starter page (#6290) 2021-07-29 13:19:52 +02:00
Nathan Rajlich
3608bcf6f1 [build-utils] Convert integration tests to TypeScript (#6528) 2021-07-28 22:08:01 +00:00
Nathan Rajlich
f036162aa3 [build-utils] Convert unit.test to TypeScript and fix jest types in VS Code (#6527)
Makes the `test/unit.test.ts` file be TypeScript, and import from the source TypeScript code. This way, we don't need to run `yarn build` to test local changes when testing.

Also, VS Code was complaining about the types for jest `describe()`/`it()` not being installed, even though they are. After some digging, I found that TypeScript has a peculiar behavior with types in monorepo setups. [This solution](https://github.com/microsoft/TypeScript-Node-Starter/issues/196#issuecomment-771988960) describing adding a `tsconfig.json` inside of the `tests` dir seems to do the trick.
2021-07-28 20:49:42 +00:00
Ana Trajkovska
e271c2598e [examples] Update Deploy button URLs in examples (#6523) 2021-07-28 10:42:09 -04:00
Leo Lamprecht
c857ad7f65 Don't render SvelteKits port flag in the UI (#6522)
Like this, we can avoid that the dashboard will ask people to pass `--port` when running SvelteKit's Development Command.

Only `vercel dev` will make use of it.
2021-07-27 13:06:47 +00:00
JJ Kasper
8f7c2f6385 Publish Canary
- @vercel/build-utils@2.11.2-canary.5
 - vercel@23.0.2-canary.10
 - @vercel/client@10.1.2-canary.6
 - @vercel/frameworks@0.4.2-canary.4
 - @vercel/routing-utils@1.11.3-canary.1
2021-07-26 13:02:53 -05:00
JJ Kasper
232f55df22 Fix has segment validation in destination (#6521)
This ensures we validate segments being used from `has` in the `destination` correctly

### Related Issues

x-ref: https://vercel.slack.com/archives/CLDDX2Y0G/p1627285500281300

### 📋 Checklist

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [ ] This PR has a concise title and thorough description useful to a reviewer
- [ ] Issue from task tracker has a link to this PR
2021-07-26 17:22:27 +00:00
Lee Robinson
43d365c73d Publish Canary
- @vercel/build-utils@2.11.2-canary.4
 - vercel@23.0.2-canary.9
 - @vercel/client@10.1.2-canary.5
 - @vercel/frameworks@0.4.2-canary.3
2021-07-23 09:21:24 -05:00
Lee Robinson
8950cd9685 [frameworks][examples] Add support for zero-config SvelteKit (#6482)
While we already have support for [SvelteKit](https://sveltekit-delta.vercel.app) on Vercel with the [File System API](https://vercel.com/docs/more/adding-your-framework), this makes the Svelte logo show up and adds an example. I also updated the Svelte example to match their default template and guide the user to use SvelteKit if they want functions.

https://sveltekit.examples.vercel.com
2021-07-23 14:17:22 +00:00
Nathan Rajlich
868fc6159c Publish Canary
- vercel@23.0.2-canary.8
2021-07-22 17:33:30 -07:00
Nathan Rajlich
7cadbc3989 [cli] Add request counter to --debug logs (#6510)
Follow up to #6508. Adds a request "counter" that increments for every API request, matching how `front` does it.

Also tweaks the `output.time()` output a bit by rendering the timestamp in gray, and with `[]` brackets. If the time diff is < 1000ms then the full milliseconds will be printed intstead of the seconds.

<img width="710" alt="Screen Shot 2021-07-22 at 2 45 39 PM" src="https://user-images.githubusercontent.com/71256/126713843-db70ed9c-4752-4ca9-8f54-313c4cb44914.png">
2021-07-22 22:36:01 +00:00
Kaitlyn
89553e6015 [cli] Add "x-vercel-id" response header to --debug logs (#6508) 2021-07-22 14:26:21 -07:00
Nathan Rajlich
181f1d60b6 [cli] Allow dynamic label in output.time() function (#6492)
Updates the `output.time()` function to accept a function as the "label" parameter. When a function is passed, it will be invoked twice, once at the beginning of the promise being executed, and a second time after the promise has resolved. The second time, the return value of the promise is passed to the label function, so that the resolved value may be used to create the label.

Drops usage of Node's `console.time()` and `console.timeEnd()` since we were using it in a hacky and unnecessary way.
2021-07-19 20:48:02 +00:00
Nathan Rajlich
8cc72a6872 [cli] Remove "now" from variable names in vc dev (#6483) 2021-07-19 10:32:21 -07:00
Nathan Rajlich
e37e558674 Publish Canary
- vercel@23.0.2-canary.7
2021-07-16 09:35:15 -07:00
Markoz Peña
e0a62dabaa [cli] Convert vc ls and vc rm commands to TypeScript (#6460) 2021-07-15 01:33:15 -07:00
Nathan Rajlich
c23473df49 [cli] Handle the ssoUserId being pasted in "out-of-band" login mode (#6476)
Handles the edge case where a SAML login is executed for an unconnected user, so they have to complete a two-step login.
2021-07-14 18:58:36 +00:00
Nathan Rajlich
0569b268e6 [cli] Add "Local Development" section to README (#6472)
Adds a section to the CLI readme explaining how to check out the source code and use `ts-eager` for local development.
2021-07-14 07:24:57 +00:00
ernestd
db955473d9 Add billing to list of commands (#6471) 2021-07-13 14:15:56 -04:00
Steven
311ef26f60 Publish Canary
- @vercel/build-utils@2.11.2-canary.3
 - vercel@23.0.2-canary.6
 - @vercel/client@10.1.2-canary.4
 - @vercel/frameworks@0.4.2-canary.2
2021-07-13 12:34:37 -04:00
Stephanie Dietz
c08462a46b [examples][frameworks] Add support for vite (#6445)
Co-authored-by: Lee Robinson <me@leerob.io>
Co-authored-by: Steven <steven@ceriously.com>
2021-07-13 12:33:57 -04:00
Nathan Rajlich
24b2f16afb Publish Canary
- vercel@23.0.2-canary.5
 - @vercel/client@10.1.2-canary.3
2021-07-12 15:00:14 -07:00
Nathan Rajlich
919c667ff1 [cli] Add "out-of-band" mode to vc login (#6455)
Adds an "out-of-band" login mode to the `vc login` command, for use in headless environments like inside a Docker container or an SSH session. In these situations, spawning a localhost HTTP server won't work, because the HTTP server will not be accessible to the web browser that is doing the authentication.

In "out-of-band" mode, the login URL is simply presented to the user, and they must visit the login URL in their web browser and complete the authentication. The callback URL is a page on front that shows the verification token to the user and instructs them to copy + paste the token back into the CLI, at which point the login can complete.

Docker/SSH sessions are attempted to be automatically detected, and "out-of-band" mode is enabled implicitly. But there is also an `--oob` flag in case that detection logic were to fail (or if you'd like to run OOB mode locally).

This PR also adds shortcut flags for the Git provider login mechanisms, i.e. `vc login --github`.


https://user-images.githubusercontent.com/71256/125129304-1f5f3380-e0b4-11eb-8139-d1109811bd86.mov
2021-07-12 20:29:54 +00:00
Mark Glagola
ab3f99bfea [cli][client] Printable link from deployment.aliasWarning (#6454)
* Ability to print `links` from `aliasWarning`

* Update latest.ts

* Add link style
2021-07-08 18:58:22 -05:00
Markoz Peña
a8615d3c34 [cli] Convert vc projects to TypeScript (#6452) 2021-07-08 14:46:37 -07:00
Nathan Rajlich
0a09a5232c Publish Canary
- vercel@23.0.2-canary.4
 - @vercel/node-bridge@2.0.1-canary.2
 - @vercel/node@1.11.2-canary.4
2021-07-07 19:35:35 -07:00
Nathan Rajlich
f3190b7f74 [node] Use require() when source is TypeScript in vc dev (#6448) 2021-07-07 19:33:45 -07:00
JJ Kasper
cf827a8b91 Publish Canary
- @vercel/build-utils@2.11.2-canary.2
 - vercel@23.0.2-canary.3
 - @vercel/client@10.1.2-canary.2
 - @vercel/frameworks@0.4.2-canary.1
 - @vercel/go@1.2.3-canary.0
 - @vercel/node-bridge@2.0.1-canary.1
 - @vercel/node@1.11.2-canary.3
 - @vercel/python@2.0.5-canary.0
 - @vercel/routing-utils@1.11.3-canary.0
 - @vercel/ruby@1.2.7-canary.0
2021-07-06 22:43:13 -05:00
Steven
bed83e829c [routing-utils] Fix rewrites with query string array in destination (#6441)
Related to https://github.com/vercel/next.js/pull/26619
2021-07-06 22:24:40 +00:00
Markoz Peña
0f0ee4e845 [cli] Convert vc whoami to TypeScript (#6435) 2021-07-06 15:10:00 -04:00
Steven
2d70c6c811 [test] Update publish-canary script (#6432) 2021-07-02 11:54:53 -04:00
Nathan Rajlich
887309f0a5 [cli] Convert vc deploy to TypeScript (#6413)
This is a continuation of https://github.com/vercel/vercel/pull/6382 (thank you @markozxuu!) with merge conflicts addressed and pushed to a local branch, so that CI tests run.
2021-06-30 18:26:29 +00:00
Nathan Rajlich
8a7657c80b [cli] Use output.spinner() instead of wait() (#6414) 2021-06-29 18:48:50 -07:00
Nathan Rajlich
279d0bf988 [cli] Set current scope to proper team after SSO login (#6415) 2021-06-29 16:42:40 -07:00
Nathan Rajlich
d2b31d03da [cli] Use Client instead of LoginParams for login (#6409)
* [cli] Use `Client` instead of `LoginParams`

* Use `client.fetch()`

* Fix email verify

* Remove redundant "user-agent" header

* Fix test
2021-06-29 01:48:36 -07:00
Nathan Rajlich
16acf906fc Update to TypeScript 4.3.4 (#6397)
Also updates eslint and related packages to work with the new TypeScript version.
2021-06-25 23:45:53 +00:00
Nathan Rajlich
0127d17703 Fix Ruby E2E tests (#6401)
Currently the `06-rails` test is failing at build time with:

```
16:27:09.550  	    'Your bundle is locked to mimemagic (0.3.3) from rubygems repository\n' +
16:27:09.550  	    'https://rubygems.org/ or installed locally, but that version can no longer be\n' +
16:27:09.550  	    'found in that source. That means the author of mimemagic (0.3.3) has removed it.\n' +
16:27:09.550  	    "You'll need to update your bundle to a version other than mimemagic (0.3.3) that\n" +
16:27:09.550  	    "hasn't been removed in order to install.",
```

So I ran `bundler update` in the "06-rails" Ruby test fixture to update the deps in the Gemfile.lock file.
2021-06-25 14:41:52 -07:00
Steven
0bfc2a3693 Publish Canary
- @vercel/build-utils@2.11.2-canary.1
 - vercel@23.0.2-canary.2
 - @vercel/client@10.1.2-canary.1
 - @vercel/frameworks@0.4.2-canary.0
 - @vercel/node@1.11.2-canary.2
2021-06-25 11:22:56 -04:00
Steven
b9809b140c [node] Fix ESM when package.json type: module (#6399)
* [node] Fix ESM when package.json `type: module`

* Fix cjs and add test fixture
2021-06-25 11:14:05 -04:00
Steven
faaccc1f9f [frameworks] Add missing cachePattern to Next.js (#6396) 2021-06-24 15:31:16 -04:00
Nathan Rajlich
4b61f1dd61 [cli] Set proper currentTeam in vc deploy (#6394)
Fixes an edge case bug when the user has a current scope that is
different than the owner of the project that is being deployed.

When this was the case, the API call to get the certs for a domain at
the end of the `vc deploy` command was using the incorrect `teamId`,
potentially causing a 403 error (when the current auth token does not
have access to the selected scope).
2021-06-24 12:06:27 -07:00
Steven
cdd417455f [frameworks] Add cachePattern to API response (#6395) 2021-06-24 14:44:38 -04:00
Leonardo Merlin
fe671f56c5 chore(examples): update nuxtjs (#6383)
* chore: update nuxtjs example

* fix: remove @nuxtjs/pwa

Co-authored-by: Leonardo Merlin <lmerlin@schubergphilis.com>
2021-06-23 19:19:04 -07:00
Nathan Rajlich
ddf9e6cf3f [cli] Make vc deploy not load current "scope" (#6388)
`vc deploy` doesn't care about the current "scope" that the CLI has selected, since it uses the `.vercel` directory to determine the ownerId and projectId.

Therefore, it should not be fetching the team details of the selected scope during `vc deploy`, since it's possible that the token might not have access to the current scope and returns a 403, even though that API call is unnecessary for the `vc deploy` command to complete.
2021-06-23 12:32:43 -07:00
Steven
13b03c6abd Publish Canary
- @vercel/build-utils@2.11.2-canary.0
 - vercel@23.0.2-canary.1
 - @vercel/client@10.1.2-canary.0
 - @vercel/node@1.11.2-canary.1
2021-06-23 10:54:17 -04:00
Steven
7dd4c629ad [node] Add support for ESM to vc dev (#6385)
Follow up to #6121
2021-06-23 14:48:47 +00:00
Nathan Rajlich
81b3d7f5f1 [cli] Fix vc login hanging for a few seconds before exiting (#6387)
Closing keep-alive HTTP connections was causing the `server.close()` call
to take a few seconds before completing, so set the `Connection: close`
response header in order to make the connections close immediately,
so that `server.close()` is fast.
2021-06-22 20:57:15 -07:00
Steven
3566c32209 [build-utils] Add support for .mjs with zero config (#6386)
Follow up to #6121
2021-06-23 02:21:16 +00:00
Nathan Rajlich
267ca7b379 [cli] Print timestamp for each line for multi-line log entries (#6384) 2021-06-22 16:46:03 -07:00
Steven
7b9d9954b8 Publish Canary
- vercel@23.0.2-canary.0
 - @vercel/node-bridge@2.0.1-canary.0
 - @vercel/node@1.11.2-canary.0
2021-06-22 15:46:21 -04:00
Steven
79675db241 [node][node-bridge] Add support for ESM (#6121) 2021-06-22 15:44:30 -04:00
Nathan Rajlich
3ac8a3f67f [cli] Make vercel dev command exit quickly (#6365)
Considering that it's a development environment, it's not important to wait for ongoing HTTP request connections to complete. Sometimes it takes a long time for all the shutdown operations to complete, which makes the command feel sluggish. So let's just `process.exit()` and exit quickly.
2021-06-18 23:33:37 +00:00
Nathan Rajlich
2f19949133 [cli] Finish executing the original command after login with no credentials (#6364) 2021-06-18 13:10:30 -07:00
Paco
85fd2aed7e Update Next.js example favicon (#6367) 2021-06-18 12:35:01 -07:00
Steven
e659eecf48 Publish Stable
- @vercel/build-utils@2.11.1
 - vercel@23.0.1
 - @vercel/client@10.1.1
 - @vercel/frameworks@0.4.1
 - @vercel/node@1.11.1
 - @vercel/python@2.0.4
 - @vercel/routing-utils@1.11.2
2021-06-15 17:29:53 -04:00
Steven
b428f7ff83 Publish Canary
- vercel@23.0.1-canary.4
2021-06-15 16:37:28 -04:00
Nathan Rajlich
5eb133283d Remove utils/go (#6362)
This code now lives in its own repository, so the code in this repo is not being used.

https://github.com/vercel/go-bridge
2021-06-15 12:49:18 +00:00
Nathan Rajlich
646c29600e [cgi] Remove @vercel/cgi Runtime (#6361)
This Runtime is very old, outdated, unmaintained, and has never been documented.

Additionally, it no longer compiles with the latest version of Go. So
rather than fixing it, let's just remove it since we don't want to
invest any more time into it.
2021-06-14 20:49:05 -07:00
Nathan Rajlich
469eb4315d [cli] Update "open" to v8.2.0 (#6348)
Fixes an issue where the bundled `xdg-open` script would not be used.
2021-06-10 19:14:57 -07:00
JJ Kasper
6dc54d0d64 Publish Canary
- @vercel/build-utils@2.11.1-canary.1
 - vercel@23.0.1-canary.3
 - @vercel/client@10.1.1-canary.1
 - @vercel/frameworks@0.4.1-canary.1
 - @vercel/routing-utils@1.11.2-canary.1
2021-06-08 11:38:01 -05:00
JJ Kasper
adc84d5148 Fix check: true beforeFiles order (#6337) 2021-06-08 11:35:31 -05:00
Nathan Rajlich
88642b1ce8 [cli] Print login URL to terminal (#6336)
In some cases (i.e. when SSH'd to a remote machine) the `open` command will not work reliably. So we need to print the URL to the user as a fallback for those cases when the web browser is not automatically opened.

This also moves where `tokenName` is specified to be in the "verify" endpoint, so that it does not need to be part of the URL that gets printed to the user.

<img width="738" alt="Screen Shot 2021-06-07 at 2 12 47 PM" src="https://user-images.githubusercontent.com/71256/121089239-b5452d00-c79b-11eb-85b2-0e45b817dff0.png">
2021-06-07 22:13:58 +00:00
Steven
4b8d207533 [cli] Warn when vercel.json uses has (#6327) 2021-06-07 14:45:36 -04:00
Steven
36fe5cc4d1 [test] Fix corrupt bmp test (#6328) 2021-06-07 09:31:51 -04:00
JJ Kasper
370b0dbed2 Publish Canary
- vercel@23.0.1-canary.2
 - @vercel/node@1.11.1-canary.0
2021-06-06 15:24:50 -05:00
JJ Kasper
cc7a82fb0a [node] Update nft to 0.13.1 (#6333) 2021-06-06 16:22:56 -04:00
Markoz Peña
6eea26c39e [cli] Convert vc alias to TS (#6325)
* refactor: Remove unncessary file

* feat(cli/alias): Migration to TS

* refactor(cli/alias): Add a line break

* refactor(cli/alias): Remove unnecesary code

* feat(cli): Add `Paginationoptions` type to `pagination`

* feat(cli/commands): Rewrite th `alias ls` command to TS

* refactor: Remove unncessary code

* feat: Create helper function for `getSafeAlias`

* refactor: Remove unnecessary code

* feat: Remove parameter generic, "null" for the fetch

* feat(cli/alias): Rewritten in full TS

* feat: Add Partial to opts

* refactor: Remove comment @ts-ignore

* feat: Add Partial to opts

* feat: Only should be return `alias.uid`

* refactor: Remove `Alias` type from of the parameter `id`

* refactor: Remove destructuring from alias object

* refactor: Remove unnecessary code

* feat: Rename `created` property to `createdAt` of number type

* refactor: Move getSafeAlias function in the same file

* refactor: Simplifying code

* refactor: Intentation did not affect diff on git

* Add null back to type

Co-authored-by: Steven <steven@ceriously.com>
2021-06-04 16:43:39 -04:00
Nathan Rajlich
b8bfae7840 [cli] Fix vc logout command when using Team scope (#6322)
Fixes logout command not working when switched to a Team scope:

```
$ vc login
$ vc switch $some_team
$ vc logout
Failed during logout
```
2021-06-04 19:48:03 +00:00
Nathan Rajlich
dc6a0a1cbb [cli] Upgrade token scopes in vc switch command (#6323)
Pass the `Authorization` request header to the verify endpoint so that the current auth token will be upgraded with the new scope.

[ch22273]
2021-06-04 18:33:49 +00:00
Steven
a6807c9d21 Publish Canary
- vercel@23.0.1-canary.1
 - @vercel/python@2.0.4-canary.0
2021-06-01 14:35:09 -04:00
Steven
c628090d08 [cli] Fix vc projects rm race condition (#6306)
The call to `GET /projects/info` is used to check existence but it can cause a race condition if the project was removed before the `DELETE /v2/projects` is called.

Instead, we rely on the response from `DELETE /v2/projects` to determine if the project exists or not.

This will also allow us to remove a legacy API endpoint in the future (see related API PR)
2021-06-01 18:31:20 +00:00
Hydrophobefireman
4e0b291ed1 [python] Remove imports from werkzeug._compat (#6283) 2021-06-01 09:15:06 -04:00
JJ Kasper
ee0bc9b0c8 Publish Canary
- @vercel/build-utils@2.11.1-canary.0
 - vercel@23.0.1-canary.0
 - @vercel/client@10.1.1-canary.0
 - @vercel/frameworks@0.4.1-canary.0
 - @vercel/routing-utils@1.11.2-canary.0
2021-05-26 13:44:39 -05:00
JJ Kasper
e516c1f49f Ensure beforeFiles rewrites come after redirects when continuing (#6289) 2021-05-26 12:50:51 -05:00
JJ Kasper
01f53f36fc [routing-utils] Ensure header key value casing is normalized (#6284)
This ensures we normalize header `key` values in `has` items to be lower-case as the proxy currently only matches against the lower-case variant. Updated superstatic tests to ensure the header key is normalized correctly. 

### Related Issues

[related thread](https://vercel.slack.com/archives/C01N3RWTE5V/p1621937306006400)

### 📋 Checklist

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [ ] This PR has a concise title and thorough description useful to a reviewer
- [ ] Issue from task tracker has a link to this PR
2021-05-25 22:46:28 +00:00
Nathan Rajlich
f2d396caae Publish Stable
- @vercel/build-utils@2.11.0
 - vercel@23.0.0
 - @vercel/client@10.1.0
 - @vercel/frameworks@0.4.0
 - @vercel/node@1.11.0
 - @vercel/python@2.0.3
 - @vercel/routing-utils@1.11.1
2021-05-25 14:56:11 -07:00
Matheus Fernandes
001f2f60b8 Use proper Apache License format (#6189)
The existing LICENSE file was missing the Appendix, and also
used weird formatting. Now it's an exact copy of the original:

https://www.apache.org/licenses/LICENSE-2.0.txt.
2021-05-25 13:27:32 -07:00
Nathan Rajlich
78ca930287 [cli] Show user's name in vc switch command (#6288)
This more closely matches the Team picker on vercel.com.

Will still show "email" if no "name" is defined.
2021-05-25 13:18:14 -07:00
Nathan Rajlich
b03e18df12 Publish Canary
- vercel@22.0.2-canary.7
 - @vercel/python@2.0.3-canary.0
2021-05-25 11:07:16 -07:00
Nathan Rajlich
3a6b8b072c [cli] Reauthenticate scopes with limited access in vc switch (#6280)
In the `vc switch` command, if your current access token results in
"limited" Team information being returned, then show a lock emoji
next to the team/user name in the select input.

When a locked scope is selected, then pre-emptively prompt the
user to re-authenticate using a valid login method in relation to
the desired scope.

https://user-images.githubusercontent.com/71256/119441172-87abae80-bcda-11eb-801a-cb6837bae353.mov

[ch21964]
2021-05-25 11:03:06 -07:00
Steven
d480cd6bbd [cli] Bump codecov to 3.8.2 (#6279)
Closes #5814
2021-05-24 23:16:02 +00:00
Nathan Rajlich
181b624bf4 [cli] Add SAML reauthentication logic when using different scope (#6263)
When the API returns a SAML error, then show the proper reauthentication prompt depending on the scope being requested:

Team with SAML enforced, shows only SSO login option:

<img width="476" alt="Screen Shot 2021-05-24 at 1 50 29 PM" src="https://user-images.githubusercontent.com/71256/119406131-31694c00-bc97-11eb-858a-52e5fe7052d1.png">

Team with SAML enabled, but not enforced, prompts with all login methods:

<img width="352" alt="Screen Shot 2021-05-24 at 1 50 36 PM" src="https://user-images.githubusercontent.com/71256/119406134-3201e280-bc97-11eb-9166-60fbfec47ee0.png">

Team without SAML enabled, or User scope, shows prompt with SSO option removed:

<img width="366" alt="Screen Shot 2021-05-24 at 1 50 44 PM" src="https://user-images.githubusercontent.com/71256/119406137-3201e280-bc97-11eb-8c5c-b88eb9983500.png">

[ch21964]
2021-05-24 15:16:24 -07:00
Nathan Rajlich
200495e4ce [cli] Use ts-eager to execute build script (#6278)
* [cli] Use `ts-eager` to execute build script

* Use `node -r ts-eager/register` to workaround Windows issue
2021-05-24 18:14:55 -04:00
Steven
9178f14c40 Publish Stable
- @vercel/python@2.0.2
2021-05-24 16:46:49 -04:00
Nathan Rajlich
9a790f5352 [cli] Set tokenName query param for Git provider login methods (#6277)
We're not currently setting the `tokenName` when logging in via a
Git provider, so the name becomes the default "Website" one which
is confusing / incorrect.
2021-05-24 13:38:55 -07:00
Steven
33d8be7f8f [cli] Fix vc logout retry (#6276)
* [cli] Fix `vc logout` retry

* Fix logout message
2021-05-24 16:26:01 -04:00
JJ Kasper
82aa86b786 Apply dependabot changes (#6275)
* Bump elliptic in /packages/cli/test/dev/fixtures/02-angular-node

Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.2 to 6.5.4.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.2...v6.5.4)

Signed-off-by: dependabot[bot] <support@github.com>

* Bump node-fetch from 2.6.0 to 2.6.1 in /api

Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1.
- [Release notes](https://github.com/bitinn/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md)
- [Commits](https://github.com/bitinn/node-fetch/compare/v2.6.0...v2.6.1)

Signed-off-by: dependabot[bot] <support@github.com>

* Bump ssri from 6.0.1 to 6.0.2 in /examples/blitzjs

Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/npm/ssri/releases)
- [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md)
- [Commits](https://github.com/npm/ssri/compare/v6.0.1...v6.0.2)

Signed-off-by: dependabot[bot] <support@github.com>

* Bump hosted-git-info from 2.8.8 to 2.8.9 in /examples/angular

Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9)

Signed-off-by: dependabot[bot] <support@github.com>

* Bump hosted-git-info from 2.8.8 to 2.8.9 in /examples/blitzjs

Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9)

Signed-off-by: dependabot[bot] <support@github.com>

* Bump ssri in /packages/cli/test/dev/fixtures/02-angular-node

Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/npm/ssri/releases)
- [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md)
- [Commits](https://github.com/npm/ssri/compare/v6.0.1...v6.0.2)

Signed-off-by: dependabot[bot] <support@github.com>

* Bump ssri in /packages/cli/test/dev/fixtures/04-create-react-app

Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/npm/ssri/releases)
- [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md)
- [Commits](https://github.com/npm/ssri/compare/v6.0.1...v6.0.2)

Signed-off-by: dependabot[bot] <support@github.com>

* Bump ssri in /packages/cli/test/dev/fixtures/03-aurelia

Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/npm/ssri/releases)
- [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md)
- [Commits](https://github.com/npm/ssri/compare/v6.0.1...v6.0.2)

Signed-off-by: dependabot[bot] <support@github.com>

* Bump hosted-git-info in /packages/cli/test/dev/fixtures/02-angular-node

Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9)

Signed-off-by: dependabot[bot] <support@github.com>

* Bump url-parse in /packages/cli/test/dev/fixtures/04-create-react-app

Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.4.7 to 1.5.1.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](https://github.com/unshiftio/url-parse/compare/1.4.7...1.5.1)

Signed-off-by: dependabot[bot] <support@github.com>

* Bump url-parse in /packages/cli/test/dev/fixtures/03-aurelia

Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.4.7 to 1.5.1.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](https://github.com/unshiftio/url-parse/compare/1.4.7...1.5.1)

Signed-off-by: dependabot[bot] <support@github.com>

* Bump handlebars in /packages/cli/test/dev/fixtures/02-angular-node

Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.7.6 to 4.7.7.
- [Release notes](https://github.com/wycats/handlebars.js/releases)
- [Changelog](https://github.com/handlebars-lang/handlebars.js/blob/master/release-notes.md)
- [Commits](https://github.com/wycats/handlebars.js/compare/v4.7.6...v4.7.7)

Signed-off-by: dependabot[bot] <support@github.com>

* Bump lodash in /packages/cli/test/dev/fixtures/02-angular-node

Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>

* Bump hosted-git-info in /packages/cli/test/dev/fixtures/03-aurelia

Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9)

Signed-off-by: dependabot[bot] <support@github.com>

* Bump hosted-git-info

Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9)

Signed-off-by: dependabot[bot] <support@github.com>

* Bump lodash in /packages/cli/test/dev/fixtures/03-aurelia

Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>

* Bump url-parse in /packages/cli/test/dev/fixtures/02-angular-node

Bumps [url-parse](https://github.com/unshiftio/url-parse) from 1.4.7 to 1.5.1.
- [Release notes](https://github.com/unshiftio/url-parse/releases)
- [Commits](https://github.com/unshiftio/url-parse/compare/1.4.7...1.5.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Steven <steven@ceriously.com>
2021-05-24 15:49:31 -04:00
Steven
6288d5ef43 Publish Canary
- vercel@22.0.2-canary.6
 - @vercel/client@10.0.1-canary.5
 - @vercel/node@1.10.1-canary.2
 - @vercel/python@2.0.2-canary.0
2021-05-24 13:37:57 -04:00
Steven
00a97b7ae2 [node] Bump nft to 0.12.2 (#6274) 2021-05-24 13:34:28 -04:00
Steven
a19fb3aa0f [python] Fix installRequirement to use explicit version (#6272)
* [python] Fix installRequirement to use explicit version

* Remove `--upgrade`
2021-05-24 11:41:57 -04:00
Nathan Rajlich
93fae76f9c [cli] Simplify emoji module (#6260) 2021-05-21 13:53:13 -07:00
Nathan Rajlich
e5131d5557 [cli] Update NowConfig references to VercelConfig (#6256)
The `NowConfig` interface is deprecated.
2021-05-21 12:21:38 -07:00
Nathan Rajlich
930063638c [cli] Refactor vc logs command (#6259) 2021-05-21 11:36:58 -07:00
Nathan Rajlich
7b509ae672 [cli] Refactor vc switch command (#6257)
Refactors the `vc switch` command to more closely match how the team picker works on the Vercel dashboard:

 * Converts to TypeScript
 * Adds separator between user scope and team scopes
 * Sorts teams by name
 * No longer places the current scope at the top of the list (but the current scope is still selected by default)
2021-05-20 11:19:38 -07:00
Nathan Rajlich
711da37771 [cli] Refactor vc inspect command (#6258) 2021-05-20 10:30:33 -07:00
Steven
5e50b96994 Publish Canary
- vercel@22.0.2-canary.5
 - @vercel/node@1.10.1-canary.1
2021-05-13 16:40:36 -04:00
Steven
35d2f5950f [node] Bump nft to 0.12.0 (#6229) 2021-05-13 16:22:58 -04:00
Steven
37f969416c Publish Canary
- @vercel/build-utils@2.10.3-canary.4
 - vercel@22.0.2-canary.4
 - @vercel/client@10.0.1-canary.4
 - @vercel/node@1.10.1-canary.0
2021-05-10 14:01:41 -04:00
Steven
75630e0982 [node] Bump nft to 0.11.2 (#6211)
* [node] Bump nft to 0.11.2

* Fix tests since node 10.x is discontinued
2021-05-10 14:01:02 -04:00
dependabot[bot]
038c228af4 Bump hosted-git-info from 2.8.8 to 2.8.9 (#6200)
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-07 16:48:18 -04:00
dependabot[bot]
a17aaebba3 Bump lodash from 4.17.19 to 4.17.21 (#6195)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.19 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.19...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-07 16:40:35 -04:00
dependabot[bot]
c39ba31b4b Bump handlebars from 4.7.6 to 4.7.7 (#6196)
Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.7.6 to 4.7.7.
- [Release notes](https://github.com/wycats/handlebars.js/releases)
- [Changelog](https://github.com/handlebars-lang/handlebars.js/blob/master/release-notes.md)
- [Commits](https://github.com/wycats/handlebars.js/compare/v4.7.6...v4.7.7)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-07 16:31:07 -04:00
Nathan Rajlich
91414d6f38 [build-utils] Remove 15-yarn-ignore-engines test fixture (#6193)
It's failing during runtime, like here: https://github.com/vercel/vercel/runs/2520732314

With an error like so:

```
[GET] / 2021-05-06T20:02:55.411Z	undefined	ERROR	The gRPC
binary module was not installed. This may be fixed by running "npm rebuild"
Original error: Cannot find module
'/var/task/node_modules/grpc/src/node/extension_binary/node-v83-linux-x64-glibc/grpc_node.node'
Require stack:
- /var/task/node_modules/grpc/src/grpc_extension.js
- /var/task/node_modules/grpc/src/client_interceptors.js
- /var/task/node_modules/grpc/src/client.js
- /var/task/node_modules/grpc/index.js
- /var/task/node_modules/google-gax/build/src/grpc.js
- /var/task/node_modules/google-gax/build/src/index.js
-
/var/task/node_modules/@google-cloud/scheduler/src/v1beta1/cloud_scheduler_client.js
- /var/task/node_modules/@google-cloud/scheduler/src/v1beta1/index.js
- /var/task/node_modules/@google-cloud/scheduler/src/index.js
- /var/task/index.js
- /var/task/___vc_launcher.js
- /var/runtime/UserFunction.js
- /var/runtime/index.js 2021-05-06T20:02:55.411Z	undefined	ERROR
Did you forget to add it to "dependencies" in `package.json`? RequestId:
2cdba37e-4bf4-4a2f-b443-4ebcc99fe308 Error: Runtime exited with error: exit
status 1 Runtime.ExitError
```

Because grpc is failing with NFT.

But also, the test is no longer necessary because we no longer support Node 8 which was what the original test intended https://github.com/vercel/now-builders/pull/463
2021-05-06 22:43:22 +00:00
Nathan Rajlich
00bb723db3 Publish Canary
- @vercel/build-utils@2.10.3-canary.3
 - vercel@22.0.2-canary.3
 - @vercel/client@10.0.1-canary.3
 - @vercel/frameworks@0.3.3-canary.3
2021-05-05 13:09:43 -07:00
Nathan Rajlich
65a97720b3 [cli] Refactor vc login command (#6185)
Refactors the CLI `vc login` command with the following features:

* Adds GitHub, GitLab and Bitbucket as login options
* Uses a "list" input to select which login method to use (same list as `vc init`)
* Support connecting SAML Profile to Vercel user during login
2021-05-05 13:08:26 -07:00
Steven
88eaf6efab [examples] Update pusher example to use deploy button (#6183) 2021-05-04 11:55:40 -04:00
Sam Ko
abf159d5e0 Update @ionic/angular devCommand (#6158)
Co-authored-by: Andy <AndyBitz@users.noreply.github.com>
2021-05-04 16:48:14 +02:00
luc
a23879b507 Publish Canary
- @vercel/build-utils@2.10.3-canary.2
 - vercel@22.0.2-canary.2
 - @vercel/client@10.0.1-canary.2
 - @vercel/frameworks@0.3.3-canary.2
2021-05-04 09:33:09 +02:00
Luc Leray
a713b9170b [frameworks] Add placeholder to frameworks' dev command (#6168)
* adjust type

* add placeholders

* adjust unit test
2021-05-03 17:26:27 +02:00
dependabot[bot]
8fd57459a1 Bump ssri from 6.0.1 to 6.0.2 (#6132)
Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/npm/ssri/releases)
- [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md)
- [Commits](https://github.com/npm/ssri/compare/v6.0.1...v6.0.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-01 20:29:19 -04:00
Markoz Peña
9a3dc8ed5f [dependencies] Bump husky from v3 to v6 (#6157)
Co-authored-by: Steven <steven@ceriously.com>
2021-05-01 20:28:34 -04:00
dependabot[bot]
c46dd8c556 Bump ssri from 6.0.1 to 6.0.2 in /examples/angular (#6131)
Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2.
- [Release notes](https://github.com/npm/ssri/releases)
- [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md)
- [Commits](https://github.com/npm/ssri/compare/v6.0.1...v6.0.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-30 12:07:03 -04:00
JJ Kasper
e28edc5c93 Publish Canary
- @vercel/build-utils@2.10.3-canary.1
 - vercel@22.0.2-canary.1
 - @vercel/client@10.0.1-canary.1
 - @vercel/frameworks@0.3.3-canary.1
 - @vercel/routing-utils@1.11.1-canary.1
2021-04-29 11:03:01 -05:00
JJ Kasper
3fc4f64824 Replace regex lexer with minimal regex for named groups (#6171) 2021-04-29 11:01:39 -05:00
Steven
90e51287e9 [build-utils] Fix unit tests for Node.js version check (#6155)
Fixes unit tests since we throw now for Node.js 10 since April 20th.

https://vercel.com/changelog/node-js-10-is-being-deprecated
2021-04-26 18:54:56 +00:00
JJ Kasper
6d8b10802c Publish Canary
- @vercel/build-utils@2.10.3-canary.0
 - vercel@22.0.2-canary.0
 - @vercel/client@10.0.1-canary.0
 - @vercel/frameworks@0.3.3-canary.0
 - @vercel/routing-utils@1.11.1-canary.0
2021-04-23 14:48:09 -05:00
JJ Kasper
1dd2ffd895 Ensure segments from only has are replaced (#6142)
This ensures that when segments are coming from only `has` items we still replace them correctly as they currently don't get replaced if the `source` doesn't have any segments as well. 

### Related Issues

x-ref: https://vercel.slack.com/archives/CLDDX2Y0G/p1619061783470000

### 📋 Checklist

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [ ] This PR has a concise title and thorough description useful to a reviewer
- [ ] Issue from task tracker has a link to this PR
2021-04-23 18:20:49 +00:00
Steven
e4d422a2d7 Publish Stable
- vercel@22.0.1
2021-04-22 15:07:42 -04:00
Steven
bd55ad8212 Publish Canary
- vercel@22.0.1-canary.0
2021-04-22 14:50:59 -04:00
Nathan Rajlich
6591dae152 [cli] Update default auth config comment to say "Vercel" (#6140) 2021-04-22 14:40:11 -04:00
Steven
a490faa496 [cli] Fix SAML usage with --token (#6139) 2021-04-22 14:39:51 -04:00
Steven
8fe16f1b0a [cli] Fix vercel login command (#6138)
* Revert file symbol usage for login

* Add missing remove() to test
2021-04-22 13:35:07 -04:00
Steven
bac19b66af Publish Stable
- @vercel/build-utils@2.10.2
 - vercel@22.0.0
 - @vercel/client@10.0.0
 - @vercel/frameworks@0.3.2
 - @vercel/node@1.10.0
 - @vercel/routing-utils@1.11.0
2021-04-21 16:57:38 -04:00
Steven
b58090a181 [examples] Update deploy URL to use main (#6133)
CH-21338
2021-04-21 16:37:16 -04:00
Steven
8c1b707f38 Publish Canary
- @vercel/build-utils@2.10.2-canary.6
 - vercel@21.3.4-canary.13
 - @vercel/client@9.0.9-canary.7
 - @vercel/frameworks@0.3.2-canary.6
2021-04-21 15:18:08 -04:00
Steven
4b4caccb3d [cli] (Major) Remove deprecated vc domains verify command (#6130)
The command `vc domains verify` was deprecated in #4959 so we can remove it for the next major version.
2021-04-21 19:07:39 +00:00
Steven
102dc04221 Update CI badge (#6116) 2021-04-15 10:50:25 -04:00
Nathan Rajlich
8d96a57117 Update references of default branch to "main" (#6114) 2021-04-15 10:11:13 -04:00
JJ Kasper
bf3a1fc832 Publish Canary
- @vercel/build-utils@2.10.2-canary.5
 - vercel@21.3.4-canary.12
 - @vercel/client@9.0.9-canary.6
 - @vercel/frameworks@0.3.2-canary.5
 - @vercel/routing-utils@1.10.2-canary.3
2021-04-14 13:34:55 -05:00
JJ Kasper
d4db04207b Ensure has segments are replaced in destination (#6059)
* Ensure has segments are replaced in destination

* update type

* Use regex lexar for gathering named groups from has

* Update to use shared repo for regex lexer

* apply suggestions

* remove regexr from .eslintignore
2021-04-14 11:24:33 -05:00
Steven
9e5edd6c51 Publish Canary
- vercel@21.3.4-canary.11
 - @vercel/node@1.9.2-canary.1
2021-04-14 09:34:38 -04:00
Steven
09db5cc2a9 [node] Bump nft to 0.10.0 (#6109)
Bump nft to version [0.10.0](https://github.com/vercel/nft/releases/tag/0.10.0)
2021-04-13 23:25:41 +00:00
Steven
b2653c457b Publish Canary
- vercel@21.3.4-canary.10
 - @vercel/client@9.0.9-canary.5
 - @vercel/node@1.9.2-canary.0
2021-04-13 16:04:20 -04:00
Steven
6617ace647 [cli] Replace "mri" with "arg" (#6108)
Replace a few usages of [mri](https://www.npmjs.com/package/mri) with [arg](https://www.npmjs.com/package/arg) which will ensure that unknown flags will throw instead of skip silently.

This also bumps `arg` to version 5.0.0 which has support for TS types.
2021-04-13 15:26:29 -04:00
Steven
b4bebb41be [cli][client] Drop support for Node.js 10 (#6101)
Node.js 10 is about to reach EOL so we can drop CLI support in the next major release. We'll support 12+ going forward.

Node.js 12 needs `es2019` because it doesn't support the `es2020` features of optional chaining and nullish coalescing as seen from the [compatibility table](https://kangax.github.io/compat-table/es2016plus/#node12_11).
2021-04-12 15:34:51 -04:00
Steven
40aaa0952f [cli] Fix error usage before defined (#6099)
This PR fixes a couple regressions from #6016:

- Using `error` before its imported. [See index.js](https://github.com/vercel/vercel/pull/6016/files#diff-032eb615f83c504bbb0ec2dfae005b7cea1748c905270acfffe6be0ee3fef7acL3)
- Passing the incorrect params to `add()`. [See add.js](https://github.com/vercel/vercel/pull/6016/files#diff-ee72a76cd216b786bc71a05d76a1b3c760a73248e5b8363ec2f83dd1d46b63d7R39)

We should eventually move these files to TS to catch these types of bugs.
2021-04-12 12:52:43 -04:00
Joe Haddad
af6344209c [examples] Upgrade Next.js example (#6097)
This PR upgrades the Next.js example to resolve noisy install warnings, plus, it's quicker!
2021-04-12 08:42:05 +00:00
Steven
7ccdc7baac Publish Canary
- vercel@21.3.4-canary.9
2021-04-09 11:32:02 -04:00
Steven
363922dd11 [cli] Add vc link to vc help output (#6086) 2021-04-08 18:21:56 -04:00
Steven
a8aa08600b [cli] Improve error docs for --scope (#6085) 2021-04-08 18:21:12 -04:00
Steven
ea798e40af [cli] Bump chalk and change "update available" color (#6084)
- Bump `chalk` to latest version https://github.com/chalk/chalk/releases
- Use black text instead of white text
- Use cyan background instead of red background


### Before
![before](https://user-images.githubusercontent.com/229881/114088378-f3e56680-9882-11eb-90e9-e628d4c1a397.png)

### After
![after](https://user-images.githubusercontent.com/229881/114088526-19727000-9883-11eb-870f-b8b7d45e7cc2.png)
2021-04-08 22:00:59 +00:00
Steven
d9e0c44d3a Publish Canary
- vercel@21.3.4-canary.8
2021-04-08 15:24:37 -04:00
Steven
0a2d55d83d [cli] Update vc env messages (#6081) 2021-04-08 15:17:39 -04:00
Steven
b4cb2fc391 Publish Canary
- vercel@21.3.4-canary.7
2021-04-03 17:00:51 -04:00
Nathan Rajlich
ada5b35966 [cli] Use updated SSO auth URL for login (#6063)
The `/registration` prefix is no longer necessary.
2021-04-02 16:17:48 -07:00
Steven
cc54d260a7 Publish Canary
- vercel@21.3.4-canary.6
2021-04-02 12:05:55 -04:00
Steven
8147e75d89 [cli] (Major) Update vc env command (#6049)
### Changes

- Add support for Git Branch
- Use a single env type: "encrypted"
- Remove unnecessary questions during `vc env add`


#### Tests

- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [x] This PR has a concise title and thorough description useful to a reviewer
- [x] Issue from task tracker has a link to this PR
2021-04-02 16:05:01 +00:00
Steven
c0bcc15d28 [examples] Update CRA go.mod (#6051) 2021-04-01 20:53:36 -04:00
Nathan Rajlich
43d4268759 [cli] Make vc whoami not require team context (#6057)
If the user is signed in to a team with SAML enforced, but the
current token is not a SAML token, then `getScope()` will fail.

So add the option to opt-out of team information in `getScope()`
and use that new option in `vc whoami` since it doesn't require
team information.
2021-04-01 12:36:09 -07:00
Nathan Rajlich
3e91f446b4 Publish Canary
- vercel@21.3.4-canary.5
2021-04-01 11:46:34 -07:00
Nathan Rajlich
bdb6e33b41 [cli] Re-trigger SSO auth when a SAML error is encountered (#6053)
When the API returns a `saml: true` error, CLI will re-trigger the SSO
auth browser window so that the user can sign into their identity
provider again. Once the new token is received, it is saved to the
`auth.json` file (unless the token was specified via `--token`) for
future use.
2021-04-01 11:43:28 -07:00
Nathan Rajlich
2eb3d7ac57 [cli] Refactor to merge NowContext into Client (#6016)
This is a rather large refactor of the CLI codebase that merges the
`NowContext` object into the `Client` class.

There's a few reasons to do this:

  1. Nearly every sub-command was creating its own `Client` instance, leading to a lot of duplicated code. It makes more sense to create one instance and pass it to every sub-command, which deletes a lot of code as well.
  2. There's a lot of overlap between `NowContext` and the props on the `Client` class, so it was a relatively easy transition.
  3. The main reason is so the same `authConfig` is used throughout the program lifecycle. This paves the way for updating the token mid-flight when i.e. a SAML token has expired. In a follow-up PR, CLI will handle that scenario gracefully by re-triggering the SAML auth flow.
2021-03-31 13:55:13 -07:00
dependabot[bot]
ec24d0f39a Bump elliptic in /packages/cli/test/dev/fixtures/03-aurelia (#5943)
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.2 to 6.5.4.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.2...v6.5.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: Steven <steven@ceriously.com>
2021-03-29 20:08:10 -04:00
dependabot[bot]
75976a441d Bump y18n in /packages/cli/test/dev/fixtures/03-aurelia (#6048)
Bumps [y18n](https://github.com/yargs/y18n) from 3.2.1 to 3.2.2.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-29 16:26:38 -07:00
Paco
905b67512c [examples] Commit yarn.lock for all package.json frameworks (#6036)
* Add yarn.lock to all examples

* Add missing yarn lock

* Deploy all examples after yarn.lock changes

* Remove package-lock

* Update ionic angular to working version

* Skip libCheck to make ionic-angular build

* Rename nowignore to vercelignore, remove yarn.lock from ignore

* Revert zola changes
2021-03-29 16:15:36 -06:00
Steven
0564690f49 [examples] Add yarn.lock to blitz (#6037) 2021-03-26 19:49:43 -04:00
Steven
364b832565 [test] Add next image bmp test (#6024)
This was fixed in proxy PR 1963 so we can add a test here to confirm `next dev` and the deployment work the same way.
2021-03-23 18:33:55 +00:00
Nathan Rajlich
41ce96a2db Publish Canary
- @vercel/build-utils@2.10.2-canary.4
 - vercel@21.3.4-canary.4
 - @vercel/client@9.0.9-canary.4
 - @vercel/frameworks@0.3.2-canary.4
 - @vercel/routing-utils@1.10.2-canary.2
2021-03-22 17:52:18 -07:00
Connor Davis
a4b4397151 [routing-utils] Add schema descriptions to routing schema (#6023)
Our automated documentation requires descriptions in the schema

#### Tests

- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [x] This PR has a concise title and thorough description useful to a reviewer
2021-03-23 00:51:30 +00:00
dav-is
473159f1da Publish Canary
- @vercel/build-utils@2.10.2-canary.3
 - vercel@21.3.4-canary.3
 - @vercel/client@9.0.9-canary.3
 - @vercel/frameworks@0.3.2-canary.3
 - @vercel/routing-utils@1.10.2-canary.1
2021-03-22 16:45:42 -04:00
Connor Davis
c6267b5acc [routing-utils] Add has type host to schema (#6022)
We need to support `{ "source": "/", "has": { "type", "host", "value": "vercel.com" }, "destination": "/prod" }`

#### Tests

- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [x] This PR has a concise title and thorough description useful to a reviewer
- [x] Issue from task tracker has a link to this PR

CH-19565
2021-03-22 20:37:27 +00:00
Steven
8a919043a2 [frameworks] Fix "svelte" detection and Dev Command (#6014)
- We were matching any project using [sirv](https://www.npmjs.com/package/sirv) which was too broad.
- Hot reloading didn't work because default dev command was incorrect.

This PR updates the framework detection and default dev command to match the example:

c2e7be80e8/examples/svelte/package.json (L6)
2021-03-19 22:21:46 +00:00
Steven
c2e7be80e8 Publish Canary
- @vercel/build-utils@2.10.2-canary.2
 - vercel@21.3.4-canary.2
 - @vercel/client@9.0.9-canary.2
 - @vercel/frameworks@0.3.2-canary.2
2021-03-18 12:12:43 -04:00
Steven
d95175253a [frameworks] Add envPrefix property (#6007) 2021-03-18 12:11:30 -04:00
Steven
e2106d12f6 Publish Canary
- @vercel/build-utils@2.10.2-canary.1
 - vercel@21.3.4-canary.1
 - @vercel/client@9.0.9-canary.1
 - @vercel/frameworks@0.3.2-canary.1
2021-03-12 11:14:27 -05:00
Steven
84f95465f7 [frameworks] Add static 404 route to CRA (#5972)
Since CRA is an SPA (all routes fallback to index.html), we can't do a proper custom 404.

But we can do a custom 404 when accessing the static directory, for example `/static/foo.html`.

To handle something like `/foo`, the user needs to do a client-side routing 404 like this example: https://reactrouter.com/web/example/no-match


### 📋 Checklist

#### Tests

- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [ ] This PR has a concise title and thorough description useful to a reviewer
- [ ] Issue from task tracker has a link to this PR
2021-03-12 16:10:44 +00:00
Nathan Rajlich
0ae74546a6 [cli] Add SAML Single Sign-On to vercel login (#5957) 2021-03-11 15:29:07 -08:00
JJ Kasper
be2ae2c539 Publish Canary
- @vercel/build-utils@2.10.2-canary.0
 - vercel@21.3.4-canary.0
 - @vercel/client@9.0.9-canary.0
 - @vercel/frameworks@0.3.2-canary.0
 - @vercel/routing-utils@1.10.2-canary.0
2021-03-11 14:00:10 -06:00
JJ Kasper
4969a65209 [routing-utils] Add has route field to schema (#5919)
### Related Issues

x-ref: https://github.com/vercel/next.js/pull/22341
x-ref: https://github.com/vercel/next.js/issues/22345

### 📋 Checklist

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [ ] This PR has a concise title and thorough description useful to a reviewer
- [ ] Issue from task tracker has a link to this PR
2021-03-11 19:44:15 +00:00
ernestd
7275878b2b [frameworks] Update demo URLs to use *.examples.vercel.com (#5960) 2021-03-10 11:45:52 -08:00
Nathan Rajlich
53d429e3f5 [cli] Convert vercel login command to TypeScript (#5951)
* WIP convert `vc login` command to TypeScript

* Fix build
2021-03-08 15:59:42 -08:00
Nathan Rajlich
3f1384bd1a [cli] Remove "micro" dependency (#5950) 2021-03-08 13:48:18 -08:00
Steven
703b2649bc Publish Stable
- @vercel/build-utils@2.10.1
 - @vercel/cgi@1.0.7
 - vercel@21.3.3
 - @vercel/client@9.0.8
 - @vercel/frameworks@0.3.1
 - @vercel/go@1.2.2
 - @vercel/node-bridge@1.3.3
 - @vercel/node@1.9.1
 - @vercel/python@2.0.1
 - @vercel/routing-utils@1.10.1
 - @vercel/ruby@1.2.6
2021-03-08 16:08:16 -05:00
Steven
2497909d9b Publish Canary
- vercel@21.3.3-canary.3
 - @vercel/node@1.9.1-canary.4
2021-03-08 13:40:30 -05:00
Steven
0ad45c8b13 [node] Fix tsCompile uninitialized error (#4275)
This PR fixes an error that happens when `includeFiles` has `.ts` files:

```
ReferenceError: Cannot access 'tsCompile' before initialization
```

~~However its not clear what the expected behavior is. Should the `.ts` files be compiled to `.js` or should they be considered assets and included as-is?~~

We will assume that `includeFiles` is only for assets and thus `.ts` files should not be compiled, they're included as-is.

[ch20529]
2021-03-08 18:11:51 +00:00
Steven
9acf8e1737 Publish Canary
- @vercel/build-utils@2.10.1-canary.0
 - @vercel/cgi@1.0.7-canary.1
 - vercel@21.3.3-canary.2
 - @vercel/client@9.0.8-canary.0
 - @vercel/frameworks@0.3.1-canary.0
 - @vercel/go@1.2.2-canary.0
 - @vercel/node-bridge@1.3.3-canary.0
 - @vercel/node@1.9.1-canary.3
 - @vercel/python@2.0.1-canary.0
 - @vercel/routing-utils@1.10.1-canary.0
 - @vercel/ruby@1.2.6-canary.1
2021-03-08 10:15:42 -05:00
Steven
f5f07c5d15 [all] Remove more "now" references (#5944)
Follow up to #5928 to remove a few more "now" references and replace with "vercel" where appropriate.
2021-03-08 10:08:09 -05:00
dependabot[bot]
c0d22cf78d Bump websocket-extensions (#5933)
Bumps [websocket-extensions](https://github.com/faye/websocket-extensions-node) from 0.1.3 to 0.1.4.
- [Release notes](https://github.com/faye/websocket-extensions-node/releases)
- [Changelog](https://github.com/faye/websocket-extensions-node/blob/master/CHANGELOG.md)
- [Commits](https://github.com/faye/websocket-extensions-node/compare/0.1.3...0.1.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-07 13:43:02 -05:00
dependabot[bot]
c9811225ad Bump ini in /packages/cli/test/dev/fixtures/04-create-react-app (#5934)
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.8.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.8)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-06 23:52:06 -05:00
dependabot[bot]
68eeb6a5bd Bump elliptic in /packages/cli/test/dev/fixtures/04-create-react-app (#5935)
Bumps [elliptic](https://github.com/indutny/elliptic) from 6.5.2 to 6.5.4.
- [Release notes](https://github.com/indutny/elliptic/releases)
- [Commits](https://github.com/indutny/elliptic/compare/v6.5.2...v6.5.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-06 23:49:01 -05:00
dependabot[bot]
ec10f326c1 Bump ini in /packages/cli/test/dev/fixtures/03-aurelia (#5936)
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.8.
- [Release notes](https://github.com/isaacs/ini/releases)
- [Commits](https://github.com/isaacs/ini/compare/v1.3.5...v1.3.8)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-06 23:48:22 -05:00
ernestd
cfae7ec3c2 [all] Remove now prefix in packages (#5928)
* remove prefix from codeowners

* remove references from ignore files

* Remove prefix from package json and tests

* Add run js without prefixes

* Rename package folders

* Delete auto generated test files

* Remove now-node in integration test

* Put back deleted vercel json files

* Remove eol

* Add styfle suggestion to comment in utils/run.js

Co-authored-by: Steven <steven@ceriously.com>
2021-03-05 16:55:30 -08:00
Steven
85b253cdd0 Publish Canary
- vercel@21.3.3-canary.1
 - @vercel/node@1.9.1-canary.2
2021-03-05 16:58:30 -05:00
Steven
a6e4f8d8bb [node] Bump nft to 0.9.6 (#5932)
Bump nft to version [0.9.6](https://github.com/vercel/nft/releases/tag/0.9.6)
2021-03-05 21:56:04 +00:00
Steven
9c7e27b551 [tests] Install Go in GH Actions Workflows (#5931)
We need to make CI explicit about the lowest common denominator for Go Version like we do with the Node.js Version.

This will add about 10 seconds to CI which is negligible to the 8 min+ CI currently.
2021-03-05 19:41:47 +00:00
Mark Glagola
60b882c493 use vercel.app instead of now.sh for integration test (#5929) 2021-03-04 16:20:22 -06:00
Steven
21072b1f1f Publish Canary
- vercel@21.3.3-canary.0
 - @vercel/node@1.9.1-canary.1
2021-03-03 17:28:21 -05:00
Steven
a186ad643a [node] Update tests for Node.js 14 (#5925) 2021-03-03 17:27:21 -05:00
Nathan Rajlich
4c0055eaf0 Publish Stable
- vercel@21.3.2
 - @vercel/python@2.0.0
2021-03-02 11:03:53 -08:00
Nathan Rajlich
910a905192 Remove @vercel/python stable publish blacklist (#5920) 2021-03-02 11:01:02 -08:00
Steven
156a9be06e Publish Stable
- vercel@21.3.1
 - @vercel/go@1.2.1
2021-02-26 16:21:51 -05:00
Steven
e2132ee36d Publish Canary
- vercel@21.3.1-canary.0
 - @vercel/go@1.2.1-canary.0
2021-02-26 15:22:59 -05:00
Steven
4572230c1d [go] Fix analyze ignore list (#5906)
A regression was introduced in #5873 that caused the analyze step to parse Go's internal source files (eg `golang/test/bombad.go`) instead of only parsing the user's source code (eg `api/users.go`).

This resulted in the error:

```
Failed to parse AST for "api/users.go"
Error: Command failed: /vercel/1ab928d537d26157/.build-utils/.builder/node_modules/@vercel/go/dist/analyze -modpath=/vercel/workpath1 /vercel/workpath1/api/users.go
2021/02/26 14:26:42 Could not parse Go file "/vercel/workpath1/.vercel/cache/golang/test/bombad.go"
```
2021-02-26 20:15:34 +00:00
Steven
8cfac4cf86 Publish Stable
- @vercel/frameworks@0.3.0
 - @vercel/build-utils@2.10.0
 - vercel@21.3.0
 - @vercel/client@9.0.7
 - @vercel/go@1.2.0
 - @vercel/routing-utils@1.10.0
2021-02-25 19:53:07 -05:00
Steven
4f20783000 Publish Canary
- vercel@21.2.4-canary.14
2021-02-25 17:47:42 -05:00
Mark Glagola
968b7c3fb5 [cli] Use inspectorUrl from api (#5904)
Uses inspector url from api rather than generating one locally.

### 📋 Checklist

#### Tests

- [ ] The code changed/added as part of this PR has been covered with tests
- [ ] All tests pass locally with `yarn test-unit`

#### Code Review

- [ ] This PR has a concise title and thorough description useful to a reviewer
- [ ] Issue from task tracker has a link to this PR
2021-02-25 22:29:19 +00:00
Steven
407c4ec5f4 Publish Canary
- @vercel/build-utils@2.9.1-canary.10
 - vercel@21.2.4-canary.13
 - @vercel/client@9.0.7-canary.10
2021-02-24 17:52:33 -05:00
Steven
bcf393d125 [build-utils] Fix warning for canary (#5892)
### Related Issues

Follow up to #5888

### 📋 Checklist

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [x] This PR has a concise title and thorough description useful to a reviewer
- [x] Issue from task tracker has a link to this PR
2021-02-24 17:52:03 -05:00
Steven
115ae0a229 Publish Canary
- @vercel/build-utils@2.9.1-canary.9
 - vercel@21.2.4-canary.12
 - @vercel/client@9.0.7-canary.9
2021-02-24 08:43:24 -05:00
Steven
d149489c9e [build-utils] Update warning for api + pages/api (#5888)
This PR updates the warning for `api` + `pages/api` to only be printed when Next.js is mixed with `@vercel/node` functions. It should not print the warning with `@vercel/go` functions for example.

### 📋 Checklist

#### Tests

- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [x] This PR has a concise title and thorough description useful to a reviewer
- [x] Issue from task tracker has a link to this PR
2021-02-24 01:12:14 +00:00
Steven
5b2e6052fc Publish Canary
- vercel@21.2.4-canary.11
 - @vercel/go@1.1.9-canary.1
2021-02-23 17:45:14 -05:00
Steven
38cb5a3b99 [go] Add Go version selection via go.mod (#5873)
### 📋 Checklist

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [x] This PR has a concise title and thorough description useful to a reviewer
- [x] Issue from task tracker has a link to this PR
2021-02-23 16:41:59 -05:00
Steven
84e828a0ca Publish Canary
- @vercel/frameworks@0.2.1-canary.7
 - @vercel/build-utils@2.9.1-canary.8
 - vercel@21.2.4-canary.10
 - @vercel/client@9.0.7-canary.8
2021-02-23 13:13:43 -05:00
Steven
157ce5346d [build-utils] Update Node.js 10 deprecation message (#5881)
This PR updates the discontinued date according to the changelog.

It also conditionally prints a hint to update `engines` if present or update Project Settings.

https://vercel.com/changelog/node-js-10-is-being-deprecated
2021-02-23 18:12:43 +00:00
Nathan Rajlich
0256157391 [examples] Fix "nuxtjs" example by adding a yarn.lock file (#5882)
`@babel/preset-env` shipped a change that broke Nuxt.js usage of the
module, so here we add a `yarn.lock` file that pins the preset-env
version to 7.12.17.

See: https://github.com/nuxt/nuxt.js/issues/8882
2021-02-22 18:03:50 -08:00
Steven
a45b3d0982 [examples] Update jekyll and middleman (#5871)
This PR updates the examples for jekyll and middleman to use the latest version.

I confirmed these examples work with both stable and canary.
2021-02-22 10:14:32 -05:00
Connor Davis
26af6dbc03 [tests] Update 502 to 504 for Serverless Function timeout (#5874)
We now return a 504 for lambda timeouts

### Related Issues

Related to https://github.com/vercel/now-proxy/pull/1970

#### Tests

- [x] The code changed/added as part of this PR has been covered with tests
- [ ] All tests pass locally with `yarn test-unit`

#### Code Review

- [x] This PR has a concise title and thorough description useful to a reviewer
2021-02-20 17:04:29 +00:00
Mark Glagola
38130103a0 [cli] Replace now.sh tests with vercel.app 2021-02-19 19:22:51 -05:00
Steven
978485818a Publish Canary
- @vercel/build-utils@2.9.1-canary.7
 - vercel@21.2.4-canary.9
 - @vercel/client@9.0.7-canary.7
2021-02-19 14:38:17 -05:00
Steven
0270784cbb [build-utils] Remove flags from bundle install (#5865)
This PR removes the flags from `bundle install` which fixes the deprecated warnings such as 

```
[DEPRECATED] The `--no-prune` flag is deprecated because it relies on being remembered across bundler invocations, which bundler will no longer do in future versions. Instead please use `bundle config set --local no_prune 'true'`, and stop using this flag
```

These flags already represent the defaults for `bundle install` anyway and we can pass environment variables in the spawn options instead.
2021-02-19 19:37:39 +00:00
Naoyuki Kanezawa
345e514924 [build-utils] Fix glob to find symlinks pointing to a directory (#5870)
https://app.clubhouse.io/vercel/story/16876

This will fix the issue that symlinks pointing to a directory is not returned on `prepareCache` and node modules linked to local files don't work.

### Related Issues

### 📋 Checklist

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [x] This PR has a concise title and thorough description useful to a reviewer
- [x] Issue from task tracker has a link to this PR

Co-authored-by: Steven <steven@ceriously.com>
2021-02-19 12:43:52 -05:00
Steven
df62ec6ed0 [cli] Disable Next.js gif test and Node.js 10 tests (#5867)
* Disable gif optimization test

* Disable Node 10 tests
2021-02-19 11:20:35 -05:00
Steven
f7f81fb896 Publish Canary
- @vercel/frameworks@0.2.1-canary.6
 - @vercel/build-utils@2.9.1-canary.6
 - vercel@21.2.4-canary.8
 - @vercel/client@9.0.7-canary.6
2021-02-18 09:53:11 -05:00
Steven
a210c6e4f0 [frameworks] Add cachePattern to jekyll and middleman (#5862)
Cache the results of `bundle install`.

Related to #3908
2021-02-18 09:52:22 -05:00
Steven
50080e4b92 Publish Canary
- @vercel/frameworks@0.2.1-canary.5
 - @vercel/build-utils@2.9.1-canary.5
 - vercel@21.2.4-canary.7
 - @vercel/client@9.0.7-canary.5
 - @vercel/go@1.1.9-canary.0
2021-02-17 19:48:18 -05:00
Steven
5845bebe2d [go] Update to version 1.16 (#5858)
https://blog.golang.org/go1.16

[ch19891]
2021-02-18 00:39:09 +00:00
Steven
3e18146846 [frameworks][examples] Update RedwoodJS to 0.25.0 (#5842)
RedwoodJS [v0.25.0](https://github.com/redwoodjs/redwood/releases/tag/v0.25.0) changed to a different build command: [yarn rw deploy vercel](https://redwoodjs.com/docs/cli-commands#vercel)

This also updates the example to use the latest template from `created-redwood-app`.
2021-02-17 16:02:53 -05:00
Steven
dbde60f47f [tests] Add test for animated gif bypass (#5851)
Animated gif should bypass (serve as-is).

This is to avoid the time it takes to optimize animated images which can sometimes take minutes.

It also matches how `next dev` works so we want to stay consistent (this tests both dev and a deployment).
2021-02-16 12:16:45 -05:00
luc
aa3db23cad Publish Canary
- vercel@21.2.4-canary.6
2021-02-16 15:45:00 +01:00
Luc Leray
60a5b0a586 [cli] Use POST /projects for vc projects add (#5824)
* replace "ensure project" with "create project"

* Revert "replace "ensure project" with "create project""

This reverts commit c6955d5abda5eb9e1140d5d1d76ec7a4b193fe90.

* add test

* upsert project
2021-02-15 21:29:23 +01:00
Nathan Rajlich
8b682ccc41 Publish Canary
- @vercel/frameworks@0.2.1-canary.4
 - @vercel/build-utils@2.9.1-canary.4
 - vercel@21.2.4-canary.5
 - @vercel/client@9.0.7-canary.4
2021-02-12 18:08:29 -08:00
Nathan Rajlich
50055963af [frameworks] Fix "zola" framework detection (#5844)
`"hugo"` was a false-positive.
2021-02-12 18:07:53 -08:00
Nathan Rajlich
43fa6e6d97 Publish Canary
- @vercel/frameworks@0.2.1-canary.3
 - @vercel/build-utils@2.9.1-canary.3
 - vercel@21.2.4-canary.4
 - @vercel/client@9.0.7-canary.3
2021-02-12 16:08:49 -08:00
Nathan Rajlich
98c0b9b573 [frameworks] Add "detectors" for Zola framework (#5843) 2021-02-12 16:04:25 -08:00
Nathan Rajlich
8b8541f4aa Publish Canary
- @vercel/frameworks@0.2.1-canary.2
 - @vercel/build-utils@2.9.1-canary.2
 - vercel@21.2.4-canary.3
 - @vercel/client@9.0.7-canary.2
2021-02-12 14:22:16 -08:00
Nathan Rajlich
59cc2bf0f2 [build-utils] Inherit process.env when runPackageJsonScript() is invoking yarn (#5841)
This is a more proper fix for #5825.
2021-02-12 14:17:59 -08:00
Nathan Rajlich
30e078062f [frameworks] Add defaultVersion field (#5839)
This will be used on the docs page to render the default version that is
included in the build image.
2021-02-12 12:21:05 -08:00
Nathan Rajlich
4d015a60ef [tests] Add --network-timeout 1000000 to yarn install (#5840)
Seems like this might help with the networking issues in CI.
See https://github.com/yarnpkg/yarn/issues/4890#issuecomment-358179301
2021-02-12 12:20:48 -08:00
Nathan Rajlich
ad0e66242d [build-utils] Fix unit tests from @vercel/frameworks type change (#5829)
Fixes TypeScript error:

```
test/unit.framework-detector.test.ts:52:40 - error TS4104: The type 'readonly Framework[]' is 'readonly' and cannot be assigned to the mutable type 'Framework[]'.

52     expect(await detectFramework({ fs, frameworkList })).toBe(null);
                                          ~~~~~~~~~~~~~
```
2021-02-12 15:51:34 +00:00
Ana Jovanova
044f956de2 Publish Canary
- vercel@21.2.4-canary.2
2021-02-12 11:38:39 +01:00
Ana Trajkovska
d26ed43d26 [cli] Implement generic announcement system (#5697)
This PR improves the CLI in a way that if the API from any request returns a response which contains a header with the prefix `x-vercel-warning-*`, `x-vercel-notice-*` or `x-vercel-tip-*`, it will print out the message to the output to let the user know.

This new feature also supports additional headers which improve the message, so that a link can be printed out for more information. Those are `x-vercel-link-*`, where we specify a link, and `x-vercel-action`, where we specify the text before the link.

Here's an example for a warning message which warns the user if they add a DNS record for a domain which does not use Vercel Nameservers:

<img width="719" alt="Screenshot 2021-01-18 at 17 49 14" src="https://user-images.githubusercontent.com/35507539/104943788-8da12400-59b6-11eb-8e54-77a3c517e56d.png">

The API request from above which creates a DNS record has the following HTTP response headers set:

```
x-vercel-warning-create-domain-record: Your Domain isn't using Vercel nameservers. In order for the changes to your DNS Records to get applied, however, it needs to.
x-vercel-link-create-domain-record: https://vercel.link/configure-vercel-nameservers
```

If `x-vercel-action` is not specified, it defaults to `Learn More`.

### 📋 Checklist

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [ ] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [x] This PR has a concise title and thorough description useful to a reviewer
- [x] Issue from task tracker has a link to this PR
2021-02-12 09:28:47 +00:00
Nathan Rajlich
84d859a016 Publish Canary
- @vercel/frameworks@0.2.1-canary.1
 - @vercel/build-utils@2.9.1-canary.1
 - vercel@21.2.4-canary.1
 - @vercel/client@9.0.7-canary.1
 - @vercel/routing-utils@1.9.3-canary.0
2021-02-11 14:42:07 -08:00
Nathan Rajlich
9238687089 [frameworks] Restore correct order of frameworks for detection (#5828) 2021-02-11 14:41:20 -08:00
Nathan Rajlich
212c91cf32 [frameworks] Add type annotations (#5819)
* [frameworks] Add type annotations

This will be necessary for static type analysis in our API docs generator.

* Apply suggestions from code review

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

* Add quotes to @examples

Co-authored-by: Steven <steven@ceriously.com>
2021-02-11 11:42:13 -08:00
Nathan Rajlich
48b34f5b02 [frameworks] Add test case to ensure all "demo" URLs are public Vercel deployments (#5818)
All demo URLs must be public for the template import flow, so this test case ensures that we don't accidentally publish a demo URL that is not public.
2021-02-10 22:35:08 +00:00
Nathan Rajlich
b2c72538a3 [frameworks] Export frameworks array with as const (#5817)
This will be necessary for static type analysis in our API docs generator.

The default export is still typed as `Framework[]` for backwards-compat purposes, but the `frameworks` export is the statically typed array.
2021-02-10 21:40:05 +00:00
Nathan Rajlich
57d8702188 [build-utils][cli] Fix frameworks usage (#5811)
Fixes unit test failures like: https://github.com/vercel/vercel/runs/1867209532#step:11:191 from PR #5740
2021-02-10 04:14:02 +00:00
Allen Hai
9a72195d8a [routing-utils] add user boolean prop to route schema (#5788)
This PR adds a boolean `user` property to help determine which routes where added by the user and which routes were added by the platform.
2021-02-10 01:42:50 +00:00
Nathan Rajlich
29ab7f7cfb Publish Canary
- @vercel/frameworks@0.2.1-canary.0
 - @vercel/build-utils@2.9.1-canary.0
 - vercel@21.2.4-canary.0
 - @vercel/client@9.0.7-canary.0
2021-02-09 15:13:16 -08:00
Nathan Rajlich
ffa36c12d5 [frameworks] Convert to TypeScript (#5740)
This PR converts the `frameworks.json` file to TypeScript, and extends the values with the detection logic from `@vercel/static-build`, so that it's publicly editable. You also don't need to do the type casting downstream anymore.

As a consequence, it also makes Zola a 1st-class framework, as it was previously missing from the `frameworks.json` file, but present in the static-build frameworks. An example has been included based on their "Getting Started" tutorial.

CH-3808
CH-18771
2021-02-09 22:55:49 +00:00
Nathan Rajlich
d1fc729d31 [cli] Use sleep() util function in vc dev (#5784) 2021-02-08 17:20:47 -08:00
Nathan Rajlich
ba47ad00f9 [examples][tests] Update "gridsome" and "hexo" for Node 14 (#5802)
The version of `sharp` used in gridsome 0.6.0 does not compile on Node 14.
2021-02-08 19:02:39 -05:00
Steven
2b62de803f Publish Stable
- @vercel/build-utils@2.9.0
 - vercel@21.2.3
 - @vercel/client@9.0.6
2021-02-04 15:43:26 -05:00
Steven
196433ec9d Publish Canary
- @vercel/build-utils@2.8.1-canary.1
 - vercel@21.2.3-canary.0
 - @vercel/client@9.0.6-canary.4
2021-02-04 14:26:59 -05:00
Steven
0cdd571087 [build-utils] Add support for Node.js 14, warn for Node.js 10 (#5761)
### Related

Related to #4754 

### Upstream

https://aws.amazon.com/blogs/compute/node-js-14-x-runtime-now-available-in-aws-lambda/

### 📋 Checklist


#### Tests

- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [x] This PR has a concise title and thorough description useful to a reviewer
- [x] Issue from task tracker has a link to this PR
2021-02-04 14:25:16 -05:00
Steven
5e2227507d [docs] Fix links to GH Discussion categories (#5777) 2021-02-01 12:08:57 -05:00
Nathan Rajlich
e3d478a471 Publish Stable
- vercel@21.2.2
 - @vercel/go@1.1.8
2021-01-29 16:57:35 -08:00
Steven
187d41434a Publish Canary
- vercel@21.2.2-canary.1
2021-01-29 18:55:54 -05:00
Steven
f6fde2d351 [cli] Update error message when project is not found (#5770)
Both `vc` and `vc dev` already ask to link/setup when the project is not found, so this will update the error message to mention the possible reasons why a project was not found.

### Before

```
$ vc
Vercel CLI 21.2.1
️ Your project was either removed from Vercel or you’re not a member of it anymore.
? Set up and deploy “~/Code/myproject”? [Y/n]
```

### After

```
$ vc
Vercel CLI 21.2.1
️ Your Project was either deleted, transferred to a new Team, or you don’t have access to it anymore.
? Set up and deploy “~/Code/myproject”? [Y/n]
```


### 📋 Checklist



#### Tests

- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [x] This PR has a concise title and thorough description useful to a reviewer
- [x] Issue from task tracker has a link to this PR
2021-01-29 18:54:30 -05:00
Steven
e09ceca95d Publish Canary
- @vercel/build-utils@2.8.1-canary.0
 - @vercel/cgi@1.0.7-canary.0
 - vercel@21.2.2-canary.0
 - @vercel/client@9.0.6-canary.3
 - @vercel/go@1.1.8-canary.0
 - @vercel/node@1.9.1-canary.0
 - @vercel/python@1.2.5-canary.1
 - @vercel/ruby@1.2.6-canary.0
2021-01-29 12:40:38 -05:00
Igor Klopov
d9318af654 [go] support skipDownload flag (#5767) 2021-01-29 12:37:06 -05:00
Nathan Rajlich
679cd6f14e [cli] Use output.stopSpinner() interface consistently (#5762)
There was an issue with `output.spinner()` spinner if the old-style
interface was used (invoking the return value to stop the spinner),
which caused the internal spinner instance in `output` to be defined,
but in a "stopped" state. Then later the `text` gets updated to a
different value but the spinner is still stopped and nothing gets
rendered.

The fix is to ensure that `output.stopSpinner()` is called rather
than directly invoking the cancel function. In fact, the return
value of `output.spinner()` has been removed completely.
2021-01-28 14:16:17 -08:00
Nathan Rajlich
47c7a13324 [all] Rewrite build scripts in JavaScript (#5763)
Fixes these strange Windows failures that randomly started happening:

https://github.com/vercel/vercel/pull/5761/checks?check_run_id=1780742477
2021-01-28 19:20:07 +00:00
Nathan Rajlich
f498d25d8b Publish Stable
- vercel@21.2.1
2021-01-27 14:26:52 -08:00
Nathan Rajlich
726d3924ae Publish Canary
- vercel@21.2.1-canary.0
 - @vercel/python@1.2.5-canary.0
2021-01-26 18:31:12 -08:00
Nathan Rajlich
d3e6c2d335 [python] Fix request URL path encoding for basic, WSGI and ASGI interfaces (#5739)
`@vercel/python` has been incorrectly "unquoting" the incoming request
URL for all Python interfaces (basic, WSGI, ASGI). The proper behavior is
to pass along the request URL to the serverless function handler unmodified.

This is proven by the additional test that is added in this PR, which actually
fires up the corresponding Python server via i.e. `python3 api/asgi.py`,
and executes the test probes defined in the
`test/fixtures/00-request-path/vercel.json` file. Adding this test ensures
that the request URL behavior of `@vercel/python` matches the behavior
as compared to executing via `python` directly.
2021-01-26 12:37:15 -08:00
Nathan Rajlich
f9ed84a5c9 [cli] Pass the output object to vercel switch command (#5756)
Fixes error: `Cannot read property 'spinner' of undefined`
2021-01-26 12:34:08 -08:00
Nathan Rajlich
88a815b5f0 Publish Stable
- vercel@21.2.0
2021-01-25 14:44:41 -08:00
Steven
9f49743ea4 Publish Stable
- @vercel/build-utils@2.8.0
2021-01-22 18:53:38 -05:00
Steven
0ac3ae19c0 Publish Canary
- @vercel/build-utils@2.7.1-canary.2
 - vercel@21.1.1-canary.3
 - @vercel/client@9.0.6-canary.2
2021-01-22 18:48:09 -05:00
Steven
e7920fd783 [build-utils] Fix warning message (#5741) 2021-01-22 18:47:33 -05:00
Steven
b4c13470df Publish Canary
- @vercel/build-utils@2.7.1-canary.1
 - vercel@21.1.1-canary.2
 - @vercel/client@9.0.6-canary.1
2021-01-22 11:59:09 -05:00
Steven
2a797b77b9 [build-utils] Add support for config.nodeVersion (#5729)
### 📋 Checklist

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [x] This PR has a concise title and thorough description useful to a reviewer
- [x] Issue from task tracker has a link to this PR
2021-01-22 11:57:55 -05:00
Nathan Rajlich
85a34126df Publish Canary
- vercel@21.1.1-canary.1
2021-01-21 22:48:10 -08:00
Nathan Rajlich
92889c5376 [cli] Re-use a single Output instance throughout the codebase (#5722)
Previously every command implementation was invoking `createOutput()` individually, causing multiple instances of `Output` to be created, which was unnecessary, and causes issues with the shared `spinner` instance introduced by #5717.

Now, the `Output` instance created in `src/index.js` is passed down to the sub-command being executed and therefore re-used.
2021-01-21 19:57:08 -08:00
Nathan Rajlich
66a7fa30b8 [cli] Show login prompt for vercel dev (#5718)
`vercel dev` requires the user to be logged in ever since the project needs to be queried from the database.

**Before:**

<img width="682" alt="Screen Shot 2021-01-18 at 7 58 56 PM" src="https://user-images.githubusercontent.com/71256/104986545-14aac800-59c8-11eb-8302-836a5481ce5f.png">

**After:**

<img width="497" alt="Screen Shot 2021-01-18 at 7 59 01 PM" src="https://user-images.githubusercontent.com/71256/104986547-15dbf500-59c8-11eb-85f6-d0ad628c8e8d.png">
2021-01-21 19:56:35 -08:00
Nathan Rajlich
a7ba405503 [cli] Make Output class a singleton and have reusable Spinner (#5717)
This is a refactor of the `ora` Spinner usage to make the preferred usage be via the `output.spinner()` and `output.stopSpinner()` functions.

* The `Output` instance has a local spinner instance that can be updated via multiple calls to `output.spinner()`.
* `output.print()` and friends call `output.stopSpinner()` implicitly, so `output.stopSpinner()` doesn't need to be called unless it is desired to immediately remove the spinner before rendering the next text.
* Because there's meant to be a shared `spinner` for the `output` instance, it means that the same `output` instance needs to be used throughout the CLI lifecycle. Therefore, the `createOutput()` function now returns a singleton so that it's guaranteed to be the same instance.

https://user-images.githubusercontent.com/71256/105009979-0670a200-59f0-11eb-9853-232f92eae536.mov

https://user-images.githubusercontent.com/71256/105010034-17211800-59f0-11eb-918d-b15f457e9640.mov

In the "before" video above, note how there's a brief second where the spinner is cleared, but the deployment URL has not yet been printed. In the "after" video, this is fixed and the spinner is only cleared once the CLI is ready to render the deployment URL.
2021-01-19 11:38:29 -08:00
luc
84145245ba Publish Canary
- @vercel/build-utils@2.7.1-canary.0
 - vercel@21.1.1-canary.0
 - @vercel/client@9.0.6-canary.0
2021-01-19 09:29:20 +01:00
Luc Leray
90d2e8b63b [cli] Hide "Development" for secret env variables (#5710) 2021-01-19 09:27:42 +01:00
Nathan Rajlich
0d31fe8018 [cli] Fix cleanUrls: true when using outputDirectory (#5701)
This is essentially a refactor of the `@vercel/static` builder that
simplifies the code a lot and fixes a bug where `cleanUrls: true`
was not working correctly when using an `outputDirectory`.
2021-01-18 12:03:34 -08:00
Mark Glagola
37d747c241 [cli] Add auto renew prompt to domains buy (#5663)
Add auto renew prompt to `domains buy`

```diff
 > The domain "example.com" is available to buy under <username>!
 > Buy now for $20 (1yr)? [y|N] 
+ > Auto renew yearly for $20? [Y|n] 
```

### 📋 Checklist

#### Tests

- [ ] The code changed/added as part of this PR has been covered with tests
- [ ] All tests pass locally with `yarn test-unit`

#### Code Review

- [ ] This PR has a concise title and thorough description useful to a reviewer
- [ ] Issue from task tracker has a link to this PR
2021-01-15 19:13:37 +00:00
Nathan Rajlich
3f052d905f [build-utils] Remove now-next and now-static-build tests (#5695)
These directories are no longer in this repository, so the tests were failing.
2021-01-14 13:50:19 +00:00
Nathan Rajlich
0b60467d2f Publish Stable
- @vercel/build-utils@2.7.0
 - vercel@21.1.0
 - @vercel/client@9.0.5
 - @vercel/go@1.1.7
 - @vercel/node-bridge@1.3.2
 - @vercel/node@1.9.0
 - @vercel/python@1.2.4
 - @vercel/routing-utils@1.9.2
 - @vercel/ruby@1.2.5
2021-01-13 17:18:43 -08:00
Nathan Rajlich
4384a6104f Publish Canary
- vercel@21.0.2-canary.10
2021-01-13 11:42:54 -08:00
Nathan Rajlich
f40f95ff37 [cli] Respect the directoryListing Project setting in vc dev (#5690)
Implements the ["Directory Listing" Project setting](https://vercel.com/changelog/listing-the-content-of-directories-can-now-be-toggled) in `vercel dev`.

The Dev integration test file has been updated to allow specifying custom Project settings that will be `PATCH`'d to the project document before running `vc deploy` / `vc dev`.
2021-01-13 15:36:12 +00:00
Nathan Rajlich
90c05250b0 Publish Canary
- vercel@21.0.2-canary.9
 - @vercel/go@1.1.7-canary.1
 - @vercel/node@1.8.6-canary.5
2021-01-12 17:47:24 -08:00
Nathan Rajlich
030880fe74 [node][go] Fix order of exit code in startDevServer() error reason (#5688) 2021-01-12 17:02:55 -08:00
Nathan Rajlich
02bc88f33b [cli] Use cmd() formatting for "npm not installed" message (#5687)
* [cli] Use `cmd()` formatting for "npm not installed" message

* Fix build
2021-01-12 17:02:36 -08:00
Nathan Rajlich
38ff557cad [cli] Skip "00-list-directory" and "temporary directory listing" tests temporarily (#5689)
* [cli] Skip "now-dev-directory-listing" test temporarily

* Disable correct tests

* Fix `vc env` test
2021-01-12 17:01:56 -08:00
Nathan Rajlich
47c34842d5 Publish Canary
- vercel@21.0.2-canary.8
 - @vercel/go@1.1.7-canary.0
 - @vercel/node@1.8.6-canary.4
 - @vercel/python@1.2.4-canary.0
 - @vercel/ruby@1.2.5-canary.0
2021-01-12 14:51:30 -08:00
Nathan Rajlich
d21b215ad0 [cli] Add error link when startDevServer() throws, and make npm not installed formatting consistent (#5684) 2021-01-12 14:47:11 -08:00
Nathan Rajlich
5827737fd5 [node][go] Better startDevServer() error message (#5674)
* [go] Better `startDevServer()` error message

* [node] Better `startDevServer()` error message

Co-authored-by: Steven <steven@ceriously.com>
2021-01-11 15:55:58 -08:00
Steven
a9e078d410 [all] Rename init files to vc_ prefix (#5675)
These files show up in error logs, so its confusing to see the [legacy now terminology](https://vercel.com/blog/zeit-is-now-vercel).
2021-01-11 20:38:03 +00:00
Lee Robinson
b4d9b17fb8 Update to latest Create Next App example. (#5655) 2021-01-10 19:52:18 -06:00
Steven
02c55bf634 [cli] Remove legacy example from vc ls --help (#5651)
`vc ls --help` was still listing an example using `--all` which was removed with Now 1.0 in PR #5011.

This PR removes that legacy example.
2021-01-07 20:28:48 +00:00
Nathan Rajlich
08af15055f Publish Canary
- vercel@21.0.2-canary.7
2021-01-06 18:33:16 -08:00
Nathan Rajlich
0597aaa5e4 [cli] Print better message upon ENOENT error when invoking startDevServer() (#5643)
When `spawn()` emits an "ENOENT" error, meaning that the command was not
found, the error would only be visible if `--debug` was enabled for vc
dev.

Now we will always render any error from `startDevServer()`, as well as
special-case the "ENOENT" error informing the user to double check their
installation of the command.
2021-01-06 13:48:55 -08:00
Nathan Rajlich
176856a1ea Stop publishing legacy @now scoped packages (#5641)
These `@now` scoped packages have been published and deprecated with the following warning since May 2020:

```
DEPRECATED ⚠️  - "@now/node" is deprecated and will stop receiving updates on December 31, 2020. Please use "@vercel/node" instead.
```

Since it is now 2021, the time has come to stop publishing.

### Related Issues

[[ch3378]]
2021-01-06 01:59:25 +00:00
Nathan Rajlich
375a55ebed [next][redwood][static-build] Remove frontend runtimes (#5640) 2021-01-05 14:11:55 -08:00
JJ Kasper
7d33a05581 Publish Stable
- @vercel/next@2.7.8
2021-01-05 09:58:19 -06:00
JJ Kasper
0377c8b737 [next] Add tests for optional catch-all fallback true page params (#5247)
This adds tests for optional catch-all `fallback: true` pages to ensure the params are normalized correctly. These should be failing initially until the PR with the normalizing fix in Next.js is released to canary. 

x-ref: https://github.com/vercel/next.js/issues/17220
2021-01-05 04:59:16 +00:00
Nathan Rajlich
662d546388 Publish Canary
- @vercel/node-bridge@1.3.2-canary.1
2021-01-04 16:37:52 -08:00
Nathan Rajlich
8c514b5608 [node-bridge] Publish launcher.* files to npm (#5636) 2021-01-04 16:37:22 -08:00
Nathan Rajlich
a6ec53d9d3 Publish Canary
- vercel@21.0.2-canary.6
 - @vercel/node-bridge@1.3.2-canary.0
 - @vercel/node@1.8.6-canary.3
 - @vercel/static-build@0.18.1-canary.1
 - @vercel/redwood@0.2.1-canary.0
2021-01-04 16:27:14 -08:00
Nathan Rajlich
3ad5903f70 [node-bridge] Move launcher.ts to @vercel/node-bridge (#5634)
The `launcher.ts` file is more closely aligned to the node bridge package, as it's used by other runtimes as well.
2021-01-04 16:25:27 -08:00
Nathan Rajlich
3cf155e999 [tests] Retry fetch upon "ECONNREFUSED" (#5635)
CI failed due to this error code, which can be retried.
2021-01-04 16:06:28 -08:00
JJ Kasper
d9a298d97c Publish Canary
- @vercel/next@2.7.8-canary.0
2021-01-04 15:15:21 -06:00
JJ Kasper
487d3c8554 [next] Ensure 404 route is correct for GSP/GIP 404 (#5632)
This is a follow-up to https://github.com/vercel/vercel/pull/5618 ensuring the 404 route is pointing to the static 404 output correctly when `_app.gip` and getStaticProps in `/404.js` is used

### Related Issues

Fixes: https://github.com/vercel/next.js/issues/19849

#### Tests

- [ ] The code changed/added as part of this PR has been covered with tests
- [ ] All tests pass locally with `yarn test-unit`

#### Code Review

- [ ] This PR has a concise title and thorough description useful to a reviewer
- [ ] Issue from task tracker has a link to this PR
2021-01-04 20:53:29 +00:00
JJ Kasper
9d0bfd3656 Publish Stable
- @vercel/next@2.7.7
2021-01-02 12:24:18 -06:00
JJ Kasper
ec75333569 [next] Fix next test files lint (#5619) 2020-12-31 17:10:52 -06:00
JJ Kasper
51aab912a2 Publish Canary
- @vercel/next@2.7.7-canary.2
2020-12-31 16:01:02 -06:00
JJ Kasper
670b2653c0 [next] Ensure 404 is static with _app.GIP and 404 GSP (#5618) 2020-12-31 15:47:18 -06:00
JJ Kasper
f71686fdad Publish Canary
- vercel@21.0.2-canary.5
 - @vercel/next@2.7.7-canary.1
 - @vercel/node@1.8.6-canary.2
2020-12-29 18:26:39 -06:00
Joe Haddad
ec9c8ce150 [next] share cache between nft runs (#5614)
This should result in faster Lambda tracing, as it avoids duplicate work.
2020-12-29 19:04:47 -05:00
Steven
a2048fc6d3 [node][next] Bump nft to 0.9.5 (#5581)
This PR bumps nft from version 0.9.4 to [0.9.5](https://github.com/vercel/nft/releases/tag/0.9.5).
2020-12-28 12:23:03 -05:00
Steven
09ff9cda9f [docs] Fix error message when credentials are missing (#5590) 2020-12-21 12:12:32 -08:00
Nathan Rajlich
3a4d6f7848 Publish Canary
- vercel@21.0.2-canary.4
 - @vercel/node@1.8.6-canary.1
2020-12-21 10:11:14 -08:00
Andy
9a0d676c0d Remove "Add a new framework" CONTRIBUTING.md (#5583) 2020-12-18 12:34:50 -08:00
Nathan Rajlich
25cd7b9e6e [cli] Fix vc logs -o raw and add test (#5571)
There are events (i.e. with `type: "deployment-event"`) that do not
contain a `text` property, so check that it's a string before invoking
`.replace()` on it.

Fixes this stack trace:

```
Error! An unexpected error occurred in logs: TypeError: Cannot read property 'replace' of undefined
    at Object.printLogRaw [as raw] (/home/me/nextjs-site/node_modules/vercel/dist/index.js:203803:10)
    at printEvent (/home/me/nextjs-site/node_modules/vercel/dist/index.js:203688:35)
    at Array.forEach (<anonymous>)
    at main (/home/me/nextjs-site/node_modules/vercel/dist/index.js:203690:31)
    at processTicksAndRejections (internal/process/task_queues.js:93:5)
    at main (/home/me/nextjs-site/node_modules/vercel/dist/index.js:207173:16)
```
2020-12-16 16:16:36 -08:00
Steven
f926d5516c [examples] Update gatsby to use @vercel/node (#5567)
[`@now/node`](https://www.npmjs.com/package/@now/node) is deprecated in favor of [`@vercel/node`](https://www.npmjs.com/package/@vercel/node)
2020-12-14 18:29:10 -05:00
Nathan Rajlich
4603383850 [node] Add Vercel prefixed TypeScript types (#5568)
The `Now` prefixed types remain as aliases for backwards-compat purposes.

#### Tests

- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [x] This PR has a concise title and thorough description useful to a reviewer
2020-12-14 18:26:22 -05:00
Nathan Rajlich
c0c57889c8 Publish Canary
- @vercel/build-utils@2.6.1-canary.2
 - vercel@21.0.2-canary.3
 - @vercel/client@9.0.5-canary.2
 - @vercel/next@2.7.7-canary.0
 - @vercel/static-build@0.18.1-canary.0
2020-12-14 09:59:43 -08:00
Nathan Rajlich
85908a0524 [build-utils][static-build][next] Force YARN_NODE_LINKER="node-modules" env var when executing yarn (#5552)
### Related Issues

* https://vercel.com/knowledge/does-vercel-support-yarn-2
* https://github.com/vercel/vercel/discussions/4223
* https://github.com/vercel/vercel/discussions/4910
* https://github.com/vercel/vercel/issues/5136
* https://github.com/vercel/vercel/issues/5280

### 📋 Checklist

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [ ] This PR has a concise title and thorough description useful to a reviewer
- [ ] Issue from task tracker has a link to this PR
2020-12-14 04:27:59 +00:00
Andy Bitz
503b9a2429 Publish Canary
- @vercel/build-utils@2.6.1-canary.1
 - vercel@21.0.2-canary.2
 - @vercel/client@9.0.5-canary.1
2020-12-11 19:02:19 +01:00
Andy
eac8f32ae7 [cli][build-utils] Change type to handle builds without a src property (#5553)
* [cli][build-utils] Change type to handle builds without a `src` property

* Add test

* Update unit tests

* Update test

* Undo test changes
2020-12-11 19:00:49 +01:00
dependabot[bot]
3f76fefde6 Bump ini from 1.3.5 to 1.3.7 (#5550)
Bumps [ini](https://github.com/isaacs/ini) from 1.3.5 to 1.3.7.
<details>
<summary>Commits</summary>
<ul>
<li><a href="c74c8af35f"><code>c74c8af</code></a> 1.3.7</li>
<li><a href="024b8b55ac"><code>024b8b5</code></a> update deps, add linting</li>
<li><a href="032fbaf5f0"><code>032fbaf</code></a> Use Object.create(null) to avoid default object property hazards</li>
<li><a href="2da90391ef"><code>2da9039</code></a> 1.3.6</li>
<li><a href="cfea636f53"><code>cfea636</code></a> better git push script, before publish instead of after</li>
<li><a href="56d2805e07"><code>56d2805</code></a> do not allow invalid hazardous string as section name</li>
<li>See full diff in <a href="https://github.com/isaacs/ini/compare/v1.3.5...v1.3.7">compare view</a></li>
</ul>
</details>
<details>
<summary>Maintainer changes</summary>
<p>This version was pushed to npm by <a href="https://www.npmjs.com/~isaacs">isaacs</a>, a new releaser for ini since your current version.</p>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=ini&package-manager=npm_and_yarn&previous-version=1.3.5&new-version=1.3.7)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/vercel/vercel/network/alerts).

</details>
2020-12-10 22:09:11 +00:00
Steven
79ddc5746b Publish Canary
- @vercel/routing-utils@1.9.2-canary.4
2020-12-10 15:14:12 -05:00
Javi Velasco
9a14615b43 [routing-utils] More accurate schema (#5477)
This PR completes the routes schema to be more accurate for the provided type.
This will allow us to generate the type dynamically from the JSON Schema
2020-12-10 20:10:57 +00:00
JJ Kasper
6d6ccbdc25 [tests] Add retrying for GitHub actions connection error (#5533)
Follow-up to https://github.com/vercel/vercel/pull/5526 this also adds retrying for fetch connection issues in GitHub Actions to prevent false test failures.

x-ref: https://github.com/vercel/vercel/runs/1518604380
2020-12-09 21:11:01 +00:00
JJ Kasper
704424ec58 Publish Stable
- @vercel/next@2.7.6
2020-12-08 10:49:48 -06:00
JJ Kasper
c471127c69 Publish Canary
- @vercel/next@2.7.6-canary.1
2020-12-08 10:33:13 -06:00
JJ Kasper
c02dc9ac49 [next] Add public dir check and update tests (#5526)
* Add public dir check and update tests

* De-dupe test checks a bit
2020-12-08 10:25:55 -05:00
JJ Kasper
dd10e8cc77 Publish Canary
- @vercel/next@2.7.6-canary.0
 - @vercel/routing-utils@1.9.2-canary.3
2020-12-01 16:11:08 -06:00
Connor Davis
cf69c2398c [next] Add Important Headers to Avoid Users Overriding Cache Headers (#5452)
We want to ensure users cannot override Next.js' cache-control headers

### Related Issues

https://app.clubhouse.io/vercel/story/14921/add-important-headers-to-routes
https://app.clubhouse.io/vercel/story/15528/add-important-to-cache-control-headers-in-next-js

#### Tests

- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [x] This PR has a concise title and thorough description useful to a reviewer
- [x] Issue from task tracker has a link to this PR


Fixes: https://github.com/vercel/vercel/pull/5452
2020-12-01 22:08:50 +00:00
JJ Kasper
e48707571f Publish Stable
- @vercel/next@2.7.5
2020-11-30 11:06:59 -06:00
JJ Kasper
6051fe6f0c Publish Canary
- @vercel/next@2.7.5-canary.1
2020-11-30 11:00:43 -06:00
JJ Kasper
2b3ba8a14f [next] Make sure to use outputDirectory when loading prerenderManifest (#5487)
* Make sure to use outputDirectory when loading prerenderManifest

* Add test case
2020-11-30 10:57:56 -06:00
Steven
25bea3f83e Publish Canary
- vercel@21.0.2-canary.1
 - @vercel/next@2.7.5-canary.0
 - @vercel/node@1.8.6-canary.0
2020-11-24 15:24:52 -05:00
Steven
b3e1828ebe [node][next] Bump nft to 0.9.4 (#5455)
This PR bumps nft to [0.9.4](https://github.com/vercel/nft/releases/tag/0.9.4)
2020-11-24 14:32:46 -05:00
Andy Bitz
e0e2a8e87e Publish Canary
- @vercel/routing-utils@1.9.2-canary.2
2020-11-24 19:52:19 +01:00
Andy
37ec89796d [routing-utils] Handle null phase at the beginning (#5470)
* [routing-utils] Handle `null` phase at the beginning

* Add fixed list

* Add tests

* Change hit and miss order

* Put null at the start

* Undo order changes

Co-authored-by: Steven <steven@ceriously.com>
2020-11-24 19:51:06 +01:00
JJ Kasper
d3e2a4c4db Publish Stable
- @vercel/next@2.7.4
2020-11-24 11:14:03 -06:00
JJ Kasper
ece3645914 Publish Canary
- vercel@21.0.2-canary.0
 - @vercel/next@2.7.4-canary.0
2020-11-24 10:53:50 -06:00
JJ Kasper
fee386493b [next] Add handle: resource to ensure 404 page (#5454)
This adds `handle: resource` to ensure the 404 page is shown instead of a directory listing when there isn't an index route for an output directory. This also removes the `.well-known` route added in https://github.com/vercel/vercel/pull/5447 in favor of adding it in Next.js itself here https://github.com/vercel/next.js/pull/19364 and revalidate tests wait times are increased in this PR due to [this thread](https://vercel.slack.com/archives/C9MMK4674/p1605821738156200)

x-ref: https://github.com/vercel/next.js/pull/19364
Fixes: https://github.com/vercel/next.js/issues/16555
2020-11-24 16:38:43 +00:00
Luc Leray
d95ed184ab [tests] Add test for secrets decryption in vc env pull and vc dev (#5461)
* add test for env with decryptable secret

* Apply suggestions from code review

Co-authored-by: Nathan Rajlich <nathan@tootallnate.net>

Co-authored-by: Nathan Rajlich <nathan@tootallnate.net>
2020-11-23 10:38:29 +01:00
luc
aef8e6388e Publish Stable
- vercel@21.0.1
2020-11-23 00:48:10 +01:00
luc
ba43e88603 Publish Canary
- vercel@21.0.1-canary.0
2020-11-23 00:39:59 +01:00
Igor Klopov
e61f9740c4 [cli] Fix secrets decryption when running vc env pull and vc dev (#5460) 2020-11-23 00:39:17 +01:00
luc
c4b010fe8b Publish Stable
- vercel@21.0.0
2020-11-20 23:10:15 +01:00
luc
db18eb091f Publish Canary
- vercel@20.1.5-canary.6
2020-11-20 17:33:55 +01:00
Luc Leray
360e62d172 [cli] Download automatically exposed System Environment Variables when running vercel env pull (#5451)
* fix VERCEL_REGION and NOW_REGION

* remove VERCEL_REGION from exposeSystemEnvs

* refactor exposeSystemEnvs

* refactor getDecryptedEnvRecords

* consider project envs in exposeSystemEnvs

* simplify exposeSystemEnvs

* correctly set value of VERCEL_URL system envs

* make exposeSystemEnvs return all envs object

* parse url in server

* simplify

* refactor getDecryptedEnvRecords

* add comment

* remove unnecessary code

* add test

* fix test

* fix dev server unit tests

* always expose NOW_REGION

* fix dev test

* fix dev test

* only retrieve system env values when autoExposeSystemEnvs is true
2020-11-20 17:33:16 +01:00
JJ Kasper
8c3cd0332d Publish Stable
- @vercel/next@2.7.3
2020-11-19 14:47:12 -06:00
JJ Kasper
f5f276021e Publish Canary
- @vercel/next@2.7.3-canary.0
2020-11-19 14:30:56 -06:00
JJ Kasper
9fbec823f3 [next] Ensure public files are matched with i18n domains (#5447)
This makes sure we strip all locales during the `handle: 'miss'` phase to allow locale domains to match public files correctly. This also updates the trailing slash redirect handling to match the behavior for `.well-known` added in https://github.com/vercel/vercel/pull/5407

We aren't able to add tests for locale domains with the current test flow yet since they require domains be assigned although the changes in this PR was tested manually against http://i18n-support.vercel.app/ with `@ijjk/now-next@0.1.3-i18n`

x-ref: https://github.com/vercel/vercel/pull/5407
Fixes: https://github.com/vercel/next.js/issues/19324
2020-11-19 20:24:46 +00:00
luc
18c3dd3a63 Publish Canary
- vercel@20.1.5-canary.5
2020-11-19 16:01:27 +01:00
Ana Trajkovska
5a4a20b33f Remove code which removes auto-generated secrets (#5440) 2020-11-19 16:00:57 +01:00
luc
4489ed0c85 Publish Canary
- vercel@20.1.5-canary.4
2020-11-18 16:11:28 +01:00
Luc Leray
359f23daf1 [cli] Expose VERCEL_REGION when autoExposeSystemEnvs is true (#5437)
* auto expose VERCEL_REGION

* add test
2020-11-18 16:00:20 +01:00
luc
4ef92e85db Publish Canary
- vercel@20.1.5-canary.3
2020-11-18 00:27:15 +01:00
Naoyuki Kanezawa
659c4d6ccd [cli] Expose system envs when autoExposeSystemEnvs is enabled on vc dev (#5434)
Ref: https://app.clubhouse.io/vercel/story/15112

We added a property called `autoExposeSystemEnvs` to projects. If that property is `true`, we automatically expose system env variables such as `VERCEL=1`, `VERCEL_ENV=<production | preview>`, ... to the runtime and build time.

This PR makes sure we mirror this behavior when running `vc dev` locally.

### 📋 Checklist

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [x] This PR has a concise title and thorough description useful to a reviewer
- [x] Issue from task tracker has a link to this PR
2020-11-17 23:21:40 +00:00
JJ Kasper
e93d477df8 Publish Stable
- @vercel/next@2.7.2
2020-11-17 14:49:04 -06:00
JJ Kasper
f64625655b Publish Canary
- @vercel/next@2.7.2-canary.0
2020-11-17 14:11:32 -06:00
JJ Kasper
25a8189997 [next] Correct non-dynamic index SSG data route output (#5435)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-11-17 15:09:56 -05:00
Andy Bitz
25c3e627cf Publish Canary
- @vercel/build-utils@2.6.1-canary.0
 - vercel@20.1.5-canary.2
 - @vercel/client@9.0.5-canary.0
2020-11-17 18:13:30 +01:00
Andy
1d6d8b530f [build-utils] Remove continue: true from 404 route (#5432)
* [build-utils] Remove `continue: true` from 404 route

* Update tests
2020-11-17 18:08:29 +01:00
Steven
e821cc0ae7 [cli] Add tests to compare dev/prd image optimization (#5428)
Add E2E test for to test image optimization against `vc dev` as well as a prod deployment.

### 📋 Checklist

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [x] This PR has a concise title and thorough description useful to a reviewer
- [x] Issue from task tracker has a link to this PR (CH13104)
2020-11-16 20:20:27 +00:00
JJ Kasper
8ecbdc5d03 Publish Stable
- @vercel/next@2.7.1
2020-11-14 16:48:35 -06:00
JJ Kasper
895224985b Publish Canary
- @vercel/next@2.7.1-canary.0
2020-11-14 16:23:24 -06:00
JJ Kasper
0f42a63c03 [next] Ensure correct route order for i18n + custom-routes (#5421)
Co-authored-by: Steven <steven@ceriously.com>
2020-11-14 17:13:08 -05:00
dav-is
81e4c9e6fe Publish Canary
- @vercel/routing-utils@1.9.2-canary.1
2020-11-13 13:48:28 -05:00
Connor Davis
a0a29dc836 [routing-utils] Exclude /.well-known from trailing slash redirect (#5407)
`/.well-known` files shouldn't have trailing slashes added as these clients likely do not follow redirects

Specifically, `/.well-known/apple-developer-merchantid-domain-association` cannot have trailing slash.

### Related Issues

https://vercel.slack.com/archives/CLDDX2Y0G/p1605127589058800

#### Tests

- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [x] This PR has a concise title and thorough description useful to a reviewer
- [x] Issue from task tracker has a link to this PR
2020-11-12 22:38:01 +00:00
luc
c1f9d51d7a Publish Canary
- vercel@20.1.5-canary.1
2020-11-12 22:06:16 +01:00
Luc Leray
422f0558c1 [cli] Rename "Provided by system" to "Reference ..." (#5415)
* Revert "Revert "[cli] (major) Update `vercel env` (#5372)" (#5410)"

This reverts commit 2d24a75ca6.

* fetch system env values from dedicated endpoint

* rename "Provided by System"
2020-11-12 22:05:24 +01:00
luc
f064ae2908 Publish Canary
- vercel@20.1.5-canary.0
 - @vercel/routing-utils@1.9.2-canary.0
2020-11-12 21:07:28 +01:00
Luc Leray
58c3e636f0 [cli] (Major) Update vc env (#5413)
* Revert "Revert "[cli] (major) Update `vercel env` (#5372)" (#5410)"

This reverts commit 2d24a75ca6.

* fetch system env values from dedicated endpoint
2020-11-12 21:06:25 +01:00
Connor Davis
d5081367f3 [routing-utils] Add important headers to disallow users from overriding (#5409)
If a builder wants to set a header that isn't allowed to be overridden by users, it should use `important: true`

#### Tests

- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [x] This PR has a concise title and thorough description useful to a reviewer
- [x] Issue from task tracker has a link to this PR: CH-14921
2020-11-12 17:45:33 +00:00
luc
0ee88366ff Publish Stable
- vercel@20.1.4
2020-11-12 17:16:29 +01:00
luc
9ae42c9e92 Publish Canary
- vercel@20.1.4-canary.1
2020-11-12 16:59:28 +01:00
Luc Leray
62b8df4a8d [cli] Fix vc env rm with advanced env variables (#5411) 2020-11-12 16:58:41 +01:00
luc
73ec7f3018 Publish Canary
- vercel@20.1.4-canary.0
2020-11-12 15:31:54 +01:00
Luc Leray
2d24a75ca6 Revert "[cli] (major) Update vercel env (#5372)" (#5410)
* Revert "[cli] (major) Update `vercel env` (#5372)"

This reverts commit 9a57cc72dd.

* fix test

* do not change prompt UI
2020-11-12 15:30:47 +01:00
Nathan Rajlich
3f92c42ad6 Publish Stable
- @vercel/frameworks@0.2.0
 - @vercel/build-utils@2.6.0
 - vercel@20.1.3
 - @vercel/client@9.0.4
 - @vercel/next@2.7.0
 - @vercel/node@1.8.5
 - @vercel/routing-utils@1.9.1
 - @vercel/static-build@0.18.0
 - @vercel/redwood@0.2.0
2020-11-11 16:01:46 -08:00
Andy Bitz
d824f79d5a Publish Canary
- @vercel/static-build@0.17.16-canary.1
2020-11-12 00:36:43 +01:00
Andy
eefbf3a52d [static-build] Fix order of applying routes (#5408)
* [static-build] Fix order of applying routes

* Add test

* Fix 11-svelte
2020-11-12 00:36:02 +01:00
Nathan Rajlich
dda793018b Publish Canary
- @vercel/build-utils@2.5.5-canary.4
 - vercel@20.1.3-canary.9
 - @vercel/client@9.0.4-canary.5
2020-11-11 14:30:14 -08:00
Nathan Rajlich
9e588068ea [build-utils] Include installCommand when empty string (#5406)
* [build-utils] Include `installCommand` when empty string

An empty string for the Project's `installCommand` setting has different
behavior than `null`, so properly provide the empty string to the
Runtime.

* Move tests to proper section
2020-11-11 14:14:57 -08:00
Chris Leishman
76a7a51bdc [docs] Add required information for pull requests (#5282) 2020-11-11 19:43:20 +00:00
Nathan Rajlich
5f5b5b0340 Publish Canary
- vercel@20.1.3-canary.8
 - @vercel/next@2.6.39-canary.1
 - @vercel/node@1.8.5-canary.0
 - @vercel/static-build@0.17.16-canary.0
 - @vercel/redwood@0.1.2-canary.3
2020-11-11 10:31:14 -08:00
Nathan Rajlich
a0ce373dc9 [static-build][next][node][redwood] Invoke installCommand from Project settings (#5393)
* [static-build] Invoke `installCommand` from Project settings

* [next] Invoke `installCommand` from Project settings

* [redwood] Invoke `installCommand` from Project settings

* [node] Remove `--prefer-offline` npm flag

* [static-build] Remove `--prefer-offline` npm flag

* [next] Remove extra console.log()

* Move `installTime` to inside else branch

* Use `as keyof Config`

* [static-build] Add `installCommand` integration test

* [next] Add `installCommand` integration test

* Use `.`

* [redwood] Add `installCommand` integration test

* Skip `installCommand` if string is empty

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-11-11 10:26:57 -08:00
Steven
049ffb268b [examples] Update svelte example with latest rollup (#5404)
Updated the template using `npx degit sveltejs/template my-svelte-project`

I also added a `yarn.lock` file so dependencies don't break for future deployments.

Related to https://github.com/Samuel-Martineau/generator-svelte/issues/7
2020-11-11 09:44:06 -05:00
Andy Bitz
94483c8b36 Publish Stable
- @vercel/static-build@0.17.15
2020-11-10 21:32:13 +01:00
Andy Bitz
078f9de44e Publish Canary
- @vercel/frameworks@0.1.2-canary.2
 - @vercel/build-utils@2.5.5-canary.3
 - vercel@20.1.3-canary.7
 - @vercel/client@9.0.4-canary.4
 - @vercel/static-build@0.17.15-canary.0
 - @vercel/redwood@0.1.2-canary.2
2020-11-10 21:18:48 +01:00
Andy
0ae41f97a4 [static-build] Ignore framework routes if config/routes.json is present (#5401) 2020-11-10 21:17:45 +01:00
Nathan Rajlich
9fb6a1ec4c [frameworks] Use "value" instead of "placeholder" for frameworks with known installCommand (#5400) 2020-11-10 11:25:16 -08:00
Andy Bitz
21be46c8bb Publish Stable
- @vercel/static-build@0.17.14
2020-11-10 18:51:06 +01:00
Andy
91942fc4d2 [static-build] Expect routes array directly (#5399) 2020-11-10 18:49:51 +01:00
Andy Bitz
8e02f2289f Publish Stable
- @vercel/static-build@0.17.13
2020-11-10 16:21:58 +01:00
Andy Bitz
4205d643a1 Publish Canary
- @vercel/next@2.6.39-canary.0
 - @vercel/static-build@0.17.13-canary.0
2020-11-10 16:19:08 +01:00
Andy
b2dda4dbb9 [static-build] Support static and config directory in .vercel_build_output (#5396)
* Handle routes and static files from the build output directory

* Add logging

* Move comment
2020-11-10 16:18:07 +01:00
Joe Haddad
f36eac3d0a [next] files within the buildId directory are immutable (#5386)
Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
2020-11-10 09:19:26 -05:00
Andy Bitz
a2c56425f4 Publish Stable
- @vercel/static-build@0.17.12
2020-11-10 00:43:05 +01:00
Andy Bitz
c759bfda9c Publish Canary
- @vercel/client@9.0.4-canary.3
 - @vercel/static-build@0.17.12-canary.0
2020-11-10 00:14:31 +01:00
Andy
57995001ac [static-build] Add directory for Serverless Functions (#5390)
* [@vercel/static-build] Add directory for Serverless Functions

* Update tests and only consider index.js files

* Import only once

* Only change for zeroConfig

* Update packages/now-static-build/src/utils/_shared.ts

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

* Update packages/now-static-build/test/fixtures/62-function-output-directory-with-static/now.json

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

* Update packages/now-static-build/test/fixtures/61-function-output-directory/now.json

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

* Update build

* Fix type

* Remove line

* Add to .vercelignore

* Fix paths in test

* Move more files

* Remove special case for test

Co-authored-by: Steven <steven@ceriously.com>
2020-11-10 00:09:23 +01:00
Nathan Rajlich
e5553d8ec2 Publish Canary
- @vercel/build-utils@2.5.5-canary.2
 - vercel@20.1.3-canary.6
 - @vercel/client@9.0.4-canary.2
2020-11-09 15:02:17 -08:00
Nathan Rajlich
dcee5b16c7 [build-utils] Add installCommand to Config object (#5391) 2020-11-09 22:27:29 +00:00
JJ Kasper
b190f2e118 Publish Stable
- @vercel/next@2.6.38
2020-11-07 12:11:05 -06:00
JJ Kasper
2389d3e936 Publish Canary
- @vercel/next@2.6.38-canary.0
2020-11-07 11:55:08 -06:00
JJ Kasper
0f4ed1965a [next] Correct data routes with basePath (#5381) 2020-11-06 23:40:32 -05:00
luc
e1e38ee536 Publish Canary
- vercel@20.1.3-canary.5
2020-11-06 16:50:13 +01:00
Luc Leray
dc1ff00610 [cli] Show error when removing env variable from no target environment (#5378)
* error if no env target is selected

* improve prompt ui

* add test
2020-11-06 16:49:34 +01:00
luc
5f31736603 Publish Canary
- vercel@20.1.3-canary.4
2020-11-05 23:17:08 +01:00
Luc Leray
9a57cc72dd [cli] (major) Update vercel env (#5372)
* prompt to select env type

* improve copy

* create env variable with type

* remove nanoid dependency

* use encodeURIComponent

* refactor envType -> type

* refactor envName -> key

* do not hide value input

* adjust value prompt depending on type

* handle std input for plaintext env variables

* show custom error when secret is not found

* handle secret name input starting with `@`

* fix system env value question

* improve ui of prompts

* expand env list in vc rm

* adjust tests

* environment -> environments

* list multiple targets in vc env ls

* show value for system env vars

* adjust tests

* capitalize targets

* add <type> to arguments

* always use stdInput for envValue

* fix number of arguments error

* adjust tests

* refactor ProjectEnvType

* refactor SYSTEM_ENV_VALUES

* fix typo for typePlaceholder

* use getCommandName

* use title

* remove @ts-ignore

* improve types

* show key controls for checkbox prompt
2020-11-05 22:58:58 +01:00
JJ Kasper
9d9c5f3753 Publish Stable
- @vercel/next@2.6.37
2020-11-05 12:44:43 -06:00
JJ Kasper
deeefc0c93 Publish Canary
- @vercel/next@2.6.37-canary.0
2020-11-05 11:50:05 -06:00
JJ Kasper
5c23b08bc1 Ensure auto-export dynamic routes are routed properly (#5377) 2020-11-05 11:48:29 -06:00
dependabot[bot]
7c4e25ccce Bump bl from 1.2.2 to 1.2.3 (#5363)
Bumps [bl](https://github.com/rvagg/bl) from 1.2.2 to 1.2.3.
- [Release notes](https://github.com/rvagg/bl/releases)
- [Commits](https://github.com/rvagg/bl/compare/v1.2.2...v1.2.3)

Signed-off-by: dependabot[bot] <support@github.com>
2020-11-05 10:24:17 -05:00
Joe Haddad
1bfa310945 Publish Stable
- @vercel/static-build@0.17.11
2020-11-04 23:29:30 -05:00
Joe Haddad
c96062266b Publish Canary
- @vercel/frameworks@0.1.2-canary.1
 - @vercel/build-utils@2.5.5-canary.1
 - vercel@20.1.3-canary.3
 - @vercel/client@9.0.4-canary.1
 - @vercel/static-build@0.17.11-canary.0
 - @vercel/redwood@0.1.2-canary.1
2020-11-04 23:12:46 -05:00
Joe Haddad
5bea99c1d9 [static-build] zero-config gatsby should support export default (#5375) 2020-11-04 23:11:40 -05:00
Luc Leray
358be773a2 [tests] Cleanup fixture folder before running CLI test (#5374) 2020-11-05 02:09:36 +01:00
Nathan Rajlich
9ebf4e531d [frameworks] Add installCommand placeholders (#5373) 2020-11-04 16:24:06 -08:00
Joe Haddad
71e79258b7 Publish Stable
- @vercel/next@2.6.36
 - @vercel/static-build@0.17.10
2020-11-03 10:49:41 -05:00
Joe Haddad
1dfafe7040 Publish Canary
- @vercel/next@2.6.36-canary.0
2020-11-03 10:40:07 -05:00
JJ Kasper
78ed452a99 [next] Ensure localeDetection: false is honored (#5365)
This disables adding the locale redirects when `localeDetection` is set to `false` 

x-ref: https://github.com/vercel/next.js/issues/18482
2020-11-03 01:58:40 +00:00
Joe Haddad
d408e2ef1a Publish Canary
- @vercel/static-build@0.17.10-canary.0
2020-11-02 15:04:48 -05:00
Joe Haddad
8ebb1fd9ce [static-build] add Vercel Analytics Support for Gatsby (#5366) 2020-11-02 15:03:45 -05:00
JJ Kasper
4eb5ad625c Publish Stable
- @vercel/next@2.6.35
2020-11-02 10:26:52 -06:00
luc
7164f6e58e Publish Canary
- vercel@20.1.3-canary.2
2020-11-02 15:43:54 +01:00
Naoyuki Kanezawa
a36d084b3e [cli] Add support for plaintext env variables (#5345)
* fix plain envs can not be retrieved

* add test

* add test for `vc dev`

* use v6 to retrieve env variables

* fix v6 return type

* use v6 to display env vars

* add test for vc env ls

* expand env vars with multiple targets

* minor type fixes

* always use v6 for getEnvVariables

Co-authored-by: luc <luc.leray@gmail.com>
2020-11-02 15:42:28 +01:00
JJ Kasper
8a16447fed Publish Canary
- vercel@20.1.3-canary.1
 - @vercel/next@2.6.35-canary.1
2020-11-01 12:24:51 -06:00
Leo Lamprecht
efda4ab6b9 Updated Next.js Template to use latest version of Next.js and React (#5358) 2020-11-01 17:13:16 +01:00
JJ Kasper
16060a71a9 [next] Add additional tests for i18n revalidate params (#5356) 2020-11-01 15:15:20 +01:00
Luc Leray
b18e0a7415 [cli] Replace util/prompt-bool by util/input/confirm (#5359) 2020-10-31 22:07:35 +01:00
JJ Kasper
1251f11a97 Publish Canary
- @vercel/next@2.6.35-canary.0
2020-10-31 00:34:03 -05:00
JJ Kasper
07235e22f6 [next] Fix root-most optional-catchall with i18n (#5354)
* Fix root-most optional-catchall with i18n

* Ensure dynamic prerenders revalidation

* Add test delay
2020-10-30 17:40:39 -05:00
JJ Kasper
81011df816 Publish Stable
- @vercel/next@2.6.34
2020-10-30 10:50:03 -05:00
JJ Kasper
c8d31bdcf7 Publish Canary
- @vercel/next@2.6.34-canary.0
2020-10-30 10:16:20 -05:00
JJ Kasper
5e7f1158ad [next] Ensure revalidation works with i18n (#5350)
This corrects some i18n pages being considered staticPages instead of prerender items which was breaking revalidate behavior. This also adds more verbose tests for i18n ensuring revalidation is working correctly

x-ref: https://github.com/vercel/next.js/discussions/18443
Fixes: https://github.com/vercel/next.js/issues/18503
2020-10-30 14:59:47 +00:00
JJ Kasper
df5aa1f10d Publish Stable
- @vercel/next@2.6.33
2020-10-27 13:41:00 -05:00
JJ Kasper
eb1ba97309 Publish Canary
- @vercel/next@2.6.33-canary.0
2020-10-27 13:33:33 -05:00
JJ Kasper
8047d6de49 [next] Fix index data path for non-locale path (#5339)
* Fix index data path for non-locale path

* Add index SSG test

* Update tests for canary

* Correct logic check to handle default locale
2020-10-27 13:33:02 -05:00
JJ Kasper
7470ff3724 Publish Stable
- @vercel/next@2.6.32
2020-10-27 09:30:43 -05:00
JJ Kasper
8340d9327c Publish Canary
- @vercel/next@2.6.32-canary.1
2020-10-27 09:11:04 -05:00
JJ Kasper
d278425810 Update tests for stabilized field (#5337) 2020-10-27 09:05:39 -05:00
JJ Kasper
8b26bbe643 [next] Add redirecting domain specific locales (#5333)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-10-27 11:32:08 +01:00
JJ Kasper
fa8e1e73c8 Ensure index GSP data is available at correct path (#5336) 2020-10-27 01:51:58 -05:00
JJ Kasper
f8abcbcd9f Remove unstable_ prefix from unstable_blocking (#5334) 2020-10-27 00:42:11 -05:00
Andy Bitz
e18ff683b2 Publish Canary
- @vercel/frameworks@0.1.2-canary.0
 - @vercel/build-utils@2.5.5-canary.0
 - vercel@20.1.3-canary.0
 - @vercel/client@9.0.4-canary.0
 - @vercel/redwood@0.1.2-canary.0
2020-10-26 16:22:53 +01:00
Andy
f28293a5a8 [frameworks] Add recommended integrations and related dependencies (#5330)
Adds the `recommendedIntegrations` property to the frameworks list with related dependencies.

Story https://app.clubhouse.io/vercel/story/13391
2020-10-26 15:10:40 +00:00
Steven
a4963a89c7 Publish Canary
- @vercel/next@2.6.32-canary.0
2020-10-25 16:58:01 -04:00
Steven
21df39fe8c [next] Image Optimization for default loader (#5321)
We currently pass through `images` whenever its defined, but this is enabling Image Optimization in the Proxy for every Next.js project.

Instead, we should check to see if the default loader is used (the same use for `next dev`) as a signal to enable this feature in the deployment.

Related to https://github.com/vercel/next.js/issues/18122
2020-10-24 12:55:53 +00:00
JJ Kasper
5ad9d61451 Publish Stable
- @vercel/next@2.6.31
2020-10-23 15:48:21 -05:00
JJ Kasper
8b5a2aa44f Publish Canary
- @vercel/next@2.6.31-canary.0
2020-10-23 15:17:30 -05:00
JJ Kasper
d0da1ce195 [next] Add handling for not found routes with i18n (#5313)
* Add handling for not found routes with i18n

* Update prerender lambda check
2020-10-23 14:34:17 -05:00
JJ Kasper
fd5d3b2921 Publish Stable
- @vercel/next@2.6.30
2020-10-20 13:11:20 -05:00
JJ Kasper
d22bdeb8d0 Publish Canary
- @vercel/next@2.6.30-canary.0
2020-10-20 12:59:12 -05:00
JJ Kasper
c120fd82f9 [next] Ensure root-most index GSP page is located correctly (#5309) 2020-10-20 19:58:18 +02:00
JJ Kasper
2474a80ff1 Correct i18n trailing slash redirect priority (#5306) 2020-10-20 11:01:31 -05:00
JJ Kasper
cc1cdbe610 Publish Stable
- @vercel/next@2.6.29
2020-10-20 06:15:03 -05:00
JJ Kasper
0b92f8ceee Publish Canary
- @vercel/next@2.6.29-canary.0
 - @vercel/routing-utils@1.9.1-canary.1
2020-10-20 05:08:26 -05:00
JJ Kasper
be82a88d1a [next] Add i18n support handling (#5298)
* Add initial locale output mapping

* Add additional probes

* Add locale specific 404 handling

* Add locale specific 404s, locale redirects, and more tests

* Update wildcard value

* Fix wildcard handling and update route type

* Update addLocale util

* Apply suggestions from code review

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

* Remove redundant console.error

Co-authored-by: Steven <steven@ceriously.com>
Co-authored-by: Leo Lamprecht <leo@zeit.co>
2020-10-20 12:05:06 +02:00
JJ Kasper
64da08f0f2 Publish Stable
- @vercel/next@2.6.28
2020-10-20 05:00:10 -05:00
Steven
2e957fce55 Publish Canary
- @vercel/next@2.6.28-canary.0
2020-10-16 18:19:07 -04:00
Steven
c7ead151f5 [next] Add support for Image Optimization (#5296)
This PR sends the results of the image optimization config from next.config.js to the build output.

x-ref: https://github.com/vercel/next.js/pull/17749
2020-10-16 17:56:14 -04:00
dav-is
e2baf9b00f Publish Canary
- @vercel/routing-utils@1.9.1-canary.0
2020-10-14 16:48:04 -04:00
Connor Davis
ba8ef7bc98 Add custom locale cookie (#5293) 2020-10-14 16:46:40 -04:00
JJ Kasper
c5d04e0d4f Publish Stable
- @vercel/next@2.6.27
2020-10-13 14:40:53 -05:00
JJ Kasper
b4f849418d Publish Canary
- @vercel/next@2.6.27-canary.0
2020-10-13 00:17:38 -05:00
JJ Kasper
b37c4f211e [next] Update next.config backup name to be deterministic (#5288) 2020-10-13 01:13:40 -04:00
Daniel Roe
f06efe167c [docs] Update contributing example of @vercel/nft (#5284) 2020-10-12 15:01:27 -04:00
dependabot[bot]
296d8da676 Bump next from 9.5.1 to 9.5.4 in /examples/nextjs (#5278)
Bumps [next](https://github.com/vercel/next.js) from 9.5.1 to 9.5.4.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/vercel/next.js/releases">next's releases</a>.</em></p>
<blockquote>
<h2>v9.5.4</h2>
<p><strong>This upgrade is <em>completely backwards compatible and recommended for all users on versions below 9.5.4.</em> For future security related communications of our OSS projects, please <a href="https://vercel.com/security">join this mailing list</a>.</strong></p>
<p>A security team from one of our partners noticed an issue in Next.js that allowed for open redirects to occur.</p>
<p>Specially encoded paths could be used with the trailing slash redirect to allow an open redirect to occur to an external site.</p>
<p>In general, this redirect does not directly harm users although can allow for phishing attacks by redirecting to an attackers domain from a trusted domain.</p>
<p>We recommend upgrading to the latest version of Next.js to improve the overall security of your application.</p>
<h2>How to Upgrade</h2>
<ul>
<li>We have released patch versions for both the stable and canary channels of Next.js.</li>
<li>To upgrade run <code>npm install next@latest --save</code></li>
</ul>
<h2>Impact</h2>
<ul>
<li><strong>Affected</strong>: Users of Next.js between 9.5.0 and 9.5.3</li>
<li><strong>Not affected</strong>: Deployments on Vercel (<a href="https://vercel.com">https://vercel.com</a>) are not affected</li>
<li><strong>Not affected</strong>: Deployments using <code>next export</code></li>
</ul>
<p>We recommend everyone to upgrade regardless of whether you can reproduce the issue or not.</p>
<h3>How to Assess Impact</h3>
<p>If you think users could have been affected, you can filter logs of affected sites by <code>%2F</code> with a 308 response.</p>
<h2>What is Being Done</h2>
<p>As Next.js has grown in popularity, it has received the attention of security teams and auditors. We are thankful to those that reached out for their investigation and discovery of the original bug and subsequent responsible disclosure.</p>
<p>We've landed a patch that ensures encoding is handled properly for these types of redirects so the open redirect can no longer occur.</p>
<p>Regression tests for this attack were added to the <a href="https://github.com/vercel/next.js/blob/canary/test/integration/production/test/security.js">security</a> integration test suite.</p>
<ul>
<li>We have notified known Next.js users in advance of this publication.</li>
<li>A public CVE was released.</li>
<li>If you want to stay on top of our security related news impacting Next.js or other Vercel projects, please <a href="https://zeit.co/security">join this mailing list</a>.</li>
<li>We encourage responsible disclosure of future issues. Please email us at <strong><a href="https://github.com/vercel/next.js/blob/HEAD/mailto:security@zeit.co">security@vercel.com</a>.</strong> We are actively monitoring this mailbox.</li>
</ul>
<hr />
<h3>Core Changes</h3>
<ul>
<li>Make the image post-processor ignore SVG images: <a href="https://github-redirect.dependabot.com/vercel/next.js/issues/16732">#16732</a></li>
<li>Only update lookups for dev overlay if mounted: <a href="https://github-redirect.dependabot.com/vercel/next.js/issues/16776">#16776</a></li>
<li>Ensure interpolating dynamic href values works correctly: <a href="https://github-redirect.dependabot.com/vercel/next.js/issues/16774">#16774</a></li>
<li>Add automatic reloading when editing GS(S)P methods: <a href="https://github-redirect.dependabot.com/vercel/next.js/issues/16744">#16744</a></li>
<li>Update to show build indicator while re-fetching GS(S)P data in dev: <a href="https://github-redirect.dependabot.com/vercel/next.js/issues/16789">#16789</a></li>
</ul>
<!-- raw HTML omitted -->
</blockquote>
<p>... (truncated)</p>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="6588108150"><code>6588108</code></a> v9.5.4</li>
<li><a href="7108567b06"><code>7108567</code></a> v9.5.4-canary.25</li>
<li><a href="5d79a8c0c4"><code>5d79a8c</code></a> Update workflow step to restore cache (<a href="https://github-redirect.dependabot.com/vercel/next.js/issues/17656">#17656</a>)</li>
<li><a href="4c38e3ed8e"><code>4c38e3e</code></a> fix typo (<a href="https://github-redirect.dependabot.com/vercel/next.js/issues/17653">#17653</a>)</li>
<li><a href="241f38eaa8"><code>241f38e</code></a> v9.5.4-canary.24</li>
<li><a href="7dec91175c"><code>7dec911</code></a> change anonymous functions to named in docs examples (<a href="https://github-redirect.dependabot.com/vercel/next.js/issues/17510">#17510</a>)</li>
<li><a href="1659e4da61"><code>1659e4d</code></a> Update migrating from Gatsby docs. (<a href="https://github-redirect.dependabot.com/vercel/next.js/issues/17636">#17636</a>)</li>
<li><a href="06a8b1ad67"><code>06a8b1a</code></a> Add docs on how to migrate from Gatsby. (<a href="https://github-redirect.dependabot.com/vercel/next.js/issues/17491">#17491</a>)</li>
<li><a href="04234cc312"><code>04234cc</code></a> Update to use hasNextSupport for custom-routes in next export check (<a href="https://github-redirect.dependabot.com/vercel/next.js/issues/17630">#17630</a>)</li>
<li><a href="742f5d9a46"><code>742f5d9</code></a> test(create-next-app): increase coverage (<a href="https://github-redirect.dependabot.com/vercel/next.js/issues/17507">#17507</a>)</li>
<li>Additional commits viewable in <a href="https://github.com/vercel/next.js/compare/v9.5.1...v9.5.4">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=next&package-manager=npm_and_yarn&previous-version=9.5.1&new-version=9.5.4)](https://docs.github.com/en/github/managing-security-vulnerabilities/configuring-github-dependabot-security-updates)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/vercel/vercel/network/alerts).

</details>
2020-10-09 14:32:15 +00:00
Steven
981e4183c6 Publish Stable
- @vercel/build-utils@2.5.4
 - vercel@20.1.2
 - @vercel/client@9.0.3
 - @vercel/node@1.8.4
 - @vercel/routing-utils@1.9.0
2020-10-08 09:10:16 -04:00
Steven
1706a00cb9 Publish Canary
- @vercel/build-utils@2.5.4-canary.0
 - vercel@20.1.2-canary.5
 - @vercel/client@9.0.3-canary.0
2020-10-06 09:10:41 -04:00
Steven
d7bd03cf1d [build-utils] Fix framework "CRA" when Next.js is dependency (#5246)
Fixes https://github.com/vercel/vercel/discussions/4288#discussioncomment-88998

This was fixed when "Framework: Other" in #5009 but this PR fixes it when "Framework: CRA" or any framework selection.
2020-10-06 13:09:02 +00:00
dav-is
e27ff8d2e0 Publish Canary
- vercel@20.1.2-canary.4
2020-10-05 18:14:54 -04:00
RAJPRAKASH
bc6da39cc2 [examples] Fix link to gatsby live example (#5205)
Fixes the link in the gatsby example back to the repo.

Co-authored-by: Steven <steven@ceriously.com>
2020-10-05 18:08:29 -04:00
dav-is
727109c64a Publish Canary
- @vercel/routing-utils@1.8.5-canary.0
2020-10-05 18:03:21 -04:00
Connor Davis
817410a8e2 [routing-utils] Add locale to routes schema (#5259)
We need to add a `locale` property to `routes`: CH-12345, CH-12349
2020-10-05 21:25:21 +00:00
Steven
e022e7b79c Publish Canary
- vercel@20.1.2-canary.3
2020-10-05 15:20:29 -04:00
Steven
dda6c24a3d [cli] Fix progress bar completion (#5260)
In some rare cases, the progress bar will still be in progress when the deployment completes, which causes the  "Inspect" URL to print on the same line as the progress bar instead of a new line.

This PR fixes that corner case.
2020-10-05 19:10:20 +00:00
Steven
7c922a4092 [cli] Remove 1.0 path alias rules (#5258)
We don't support routing path aliases anymore, now that we've completely shut down the ZEIT Now 1.0 infrastructure. This PR removes path alias rules from Vercel CLI.
2020-10-05 17:48:37 +00:00
Steven
376dec8f33 Publish Canary
- vercel@20.1.2-canary.2
2020-10-02 19:18:35 -04:00
Steven
16e101d262 [cli] Fix dev routing when using routes with a frontend framework (#5253)
There was a regression when introducing multiple phases such as `hit` and `miss` which caused `routes` to stop working because the transition from `null` phase to the `filesystem` phase resets any dest rewrites.

The workaround is to detect when we don't have a `filesystem` phase and exit early.
2020-10-02 22:46:53 +00:00
Nathan Rajlich
41ce1a4291 Publish Canary
- vercel@20.1.2-canary.1
 - @vercel/node@1.8.4-canary.0
2020-09-25 10:00:24 -07:00
Nathan Rajlich
449f35cf33 [node] Only use the project's local "typescript" when it has compatible ScriptTarget (#5220)
https://app.clubhouse.io/vercel/story/8304
2020-09-24 15:18:09 -07:00
Nathan Rajlich
d683402bba Publish Canary
- vercel@20.1.2-canary.0
2020-09-23 13:23:44 -07:00
Nathan Rajlich
2051a1cd9b [cli] Ensure the devProcessPort is set during "upgrade" events (#5226)
Related to: https://twitter.com/raymondcamden/status/1308838251902521348
2020-09-23 20:16:51 +00:00
Steven
1eeeaf23a1 Publish Stable
- @vercel/build-utils@2.5.3
 - vercel@20.1.1
 - @vercel/client@9.0.2
 - @vercel/next@2.6.26
 - @vercel/node@1.8.3
 - @vercel/static-build@0.17.9
2020-09-21 15:12:38 -04:00
Steven
f347164b6c Publish Canary
- vercel@20.1.1-canary.8
2020-09-18 17:51:03 -04:00
Steven
ea4be8a001 [tests] Delay deprecation message (#5210)
Follow up to #5158 to add longer delay.

There is an issue with npm consistency after publishing so we wait longer before deprecating the `now` package because its a little larger than the others.
2020-09-18 16:02:35 -04:00
JJ Kasper
19ac74d59e Publish Canary
- vercel@20.1.1-canary.7
 - @vercel/client@9.0.2-canary.5
 - @vercel/next@2.6.26-canary.3
 - @vercel/node@1.8.3-canary.2
 - @vercel/static-build@0.17.9-canary.1
2020-09-15 19:21:01 -05:00
JJ Kasper
9a87d4ea8e [next] Fix API page check (#5196)
This corrects the `isApiPage` check to not incorrectly detect `/api-docs` as an API route. 

Note: tests won't pass until a new canary with the below Next.js PR has been landed

x-ref: https://github.com/vercel/next.js/pull/17092
Closes: https://github.com/vercel/next.js/issues/17091
2020-09-15 15:28:19 +00:00
Albert Martin
35fd7b5f9c [static-build] Fix immutable cache header for Vue assets (#5070)
We have started migrating our projects to use Vue CLI with the Vercel zero-config builders. One particularly bug we ran into was due to the `Cache-Control` headers automatically applied on these resources that [differ from the documentation](https://vercel.com/docs/edge-network/caching#static-files):

> By default we return a `Cache-Control` header containing `public, max-age=0, must-revalidate` to prevent clients (e.g. browsers) from caching the file locally.

Instead of these headers, we were seeing `immutable` on all our resources. This is a good assumption for a vanilla Vue CLI setup because by default a content hash is used on every chunk, even the entry, which will change as soon as the file contents change. However, this may not always be the case, particularly on Vue CLI projects with any modifications to the build process, custom plugins, etc. that may exclude one or more files from the hash.

In our case this was breaking things in dramatic ways every time we deployed (and we deploy quite often!). Since the resources were being sent with the `immutable` header, the client browser was persisting these in cache and subsequent deployments with potentially breaking changes caused errors that were only resolved by clearing the client browser cache.

Example:

```
dist
├── css
│   ├── app.db598b39.css
│   └── common.css
├── js
│   ├── app.ac201ece.js
│   ├── chunk-587c608b.7d4361a1.js
│   ├── chunk-vendors.00676d62.js
│   └── common.js
└── index.html
```

In the above example, `common.css` and `common.js` are not hashed, but still have an `immutable` header preventing them from being re-validated by the client browser when a new deployment modifies their content.

To solve for this, I've updated the RegExp for Vue CLI to only apply the `immutable` caching header on files which have a content hash. This should solve for both vanilla Vue CLI setups and more advanced ones in which there may exist both files with and without a content hash.

Co-authored-by: Steven <steven@ceriously.com>
2020-09-14 09:08:15 -04:00
Steven
eb8db25845 [cli] Remove v1 messages and docs (#5183)
We removed v1 support in [20.0.0](https://github.com/vercel/vercel/releases/tag/vercel%4020.0.0) so this PR removes the unused documentation, warning messages, etc.
2020-09-11 22:46:32 +00:00
Steven
5c3cd17074 [tests] Cache token when possible (#5179)
This PR solves an issue where tests would sometimes be rate limited when generating a token. This can be solved by caching the token like we do for E2E tests.

Example failure: https://github.com/vercel/vercel/runs/1098030228#step:11:9376

I also update the `@vercel/node` tests to compare the error message, exactly like how we do it with `@vercel/static-build`.
2020-09-11 10:02:07 -04:00
Nathan Rajlich
72572ba6be Publish Canary
- @vercel/build-utils@2.5.3-canary.1
 - vercel@20.1.1-canary.6
 - @vercel/client@9.0.2-canary.4
 - @vercel/node@1.8.3-canary.1
 - @vercel/static-build@0.17.9-canary.0
2020-09-10 17:20:10 -07:00
Nathan Rajlich
b69a41a0aa [node] Use ts.readConfigFile() to parse user's tsconfig.json file (#5180)
TypeScript supports comments in the `tsconfig.json` file, which is not
compatible with `JSON.parse()` so we have to use the built-in function
to parse the config file.

Fixes #4835.
2020-09-10 17:18:30 -07:00
dependabot[bot]
7c35d7992b Bump node-fetch from 2.6.0 to 2.6.1 (#5176)
Bumps [node-fetch](https://github.com/bitinn/node-fetch) from 2.6.0 to 2.6.1.
<details>
<summary>Release notes</summary>
<p><em>Sourced from <a href="https://github.com/bitinn/node-fetch/releases">node-fetch's releases</a>.</em></p>
<blockquote>
<h2>v2.6.1</h2>
<p><strong>This is an important security release. It is strongly recommended to update as soon as possible.</strong></p>
<p>See <a href="https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md#v261">CHANGELOG</a> for details.</p>
</blockquote>
</details>
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/node-fetch/node-fetch/blob/master/docs/CHANGELOG.md">node-fetch's changelog</a>.</em></p>
<blockquote>
<h2>v2.6.1</h2>
<p><strong>This is an important security release. It is strongly recommended to update as soon as possible.</strong></p>
<ul>
<li>Fix: honor the <code>size</code> option after following a redirect.</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li><a href="b5e2e41b2b"><code>b5e2e41</code></a> update version number</li>
<li><a href="2358a6c256"><code>2358a6c</code></a> Honor the <code>size</code> option after following a redirect and revert data uri support</li>
<li><a href="8c197f8982"><code>8c197f8</code></a> docs: Fix typos and grammatical errors in README.md (<a href="https://github-redirect.dependabot.com/bitinn/node-fetch/issues/686">#686</a>)</li>
<li><a href="1e99050f94"><code>1e99050</code></a> fix: Change error message thrown with redirect mode set to error (<a href="https://github-redirect.dependabot.com/bitinn/node-fetch/issues/653">#653</a>)</li>
<li><a href="244e6f63d4"><code>244e6f6</code></a> docs: Show backers in README</li>
<li><a href="6a5d192034"><code>6a5d192</code></a> fix: Properly parse meta tag when parameters are reversed (<a href="https://github-redirect.dependabot.com/bitinn/node-fetch/issues/682">#682</a>)</li>
<li><a href="47a24a03eb"><code>47a24a0</code></a> chore: Add opencollective badge</li>
<li><a href="7b136627c5"><code>7b13662</code></a> chore: Add funding link</li>
<li><a href="5535c2ed47"><code>5535c2e</code></a> fix: Check for global.fetch before binding it (<a href="https://github-redirect.dependabot.com/bitinn/node-fetch/issues/674">#674</a>)</li>
<li><a href="1d5778ad0d"><code>1d5778a</code></a> docs: Add Discord badge</li>
<li>Additional commits viewable in <a href="https://github.com/bitinn/node-fetch/compare/v2.6.0...v2.6.1">compare view</a></li>
</ul>
</details>
<details>
<summary>Maintainer changes</summary>
<p>This version was pushed to npm by <a href="https://www.npmjs.com/~akepinski">akepinski</a>, a new releaser for node-fetch since your current version.</p>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=node-fetch&package-manager=npm_and_yarn&previous-version=2.6.0&new-version=2.6.1)](https://docs.github.com/en/github/managing-security-vulnerabilities/configuring-github-dependabot-security-updates)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
- `@dependabot use these labels` will set the current labels as the default for future PRs for this repo and language
- `@dependabot use these reviewers` will set the current reviewers as the default for future PRs for this repo and language
- `@dependabot use these assignees` will set the current assignees as the default for future PRs for this repo and language
- `@dependabot use this milestone` will set the current milestone as the default for future PRs for this repo and language

You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/vercel/vercel/network/alerts).

</details>
2020-09-10 22:50:00 +00:00
JJ Kasper
290fdc0506 Publish Canary
- @vercel/next@2.6.26-canary.2
2020-09-10 13:15:27 -05:00
JJ Kasper
fc2d9f99e6 [next] Optimize page loading for shared lambdas (#5156)
This updates to prevent loading all pages at once for shared lambdas and waits to require the page when it's needed

Fixes https://github.com/vercel/next.js/issues/16990
2020-09-10 14:24:36 +00:00
Steven
1fd24fb4fc Publish Canary
- vercel@20.1.1-canary.5
 - @vercel/next@2.6.26-canary.1
2020-09-09 20:40:33 -04:00
Steven
17c72f1d35 [next] Fix config functions src file (#5168)
The [functions](https://vercel.com/docs/configuration#project/functions) property matches source files and it wasn't working for `index.js` or `.ts` files because `next build` converts the source file `pages/api/index.js` to the output `.next/server/pages/api.js`. So this PR fixes the logic to reverse the output page to source file.
2020-09-09 23:41:12 +00:00
Steven
9c1154c108 [tests] Fix test for functions in vercel.json (#5169) 2020-09-09 18:08:14 -04:00
dav-is
613c384ce8 Publish Canary
- @vercel/build-utils@2.5.3-canary.0
 - vercel@20.1.1-canary.4
 - @vercel/client@9.0.2-canary.3
 - @vercel/next@2.6.26-canary.0
 - @vercel/node@1.8.3-canary.0
2020-09-09 09:59:50 -04:00
Gianmarco
a9598d14e3 [docs] Fix typo in error message (#5141) 2020-09-08 16:48:52 -04:00
Connor Davis
48935e92d8 Remove extra newline in warning (#5165) 2020-09-08 11:23:28 -04:00
Steven
1b1e72ab88 Publish Stable
- @vercel/build-utils@2.5.2
 - @vercel/next@2.6.25
 - @vercel/node@1.8.2
2020-09-08 09:56:26 -04:00
Steven
0f574f67f6 [examples] Update Ember with missing robots.txt (#5164)
Fixes https://github.com/emberjs/ember.js/issues/19132

Source: https://github.com/ember-cli/ember-new-output/blob/master/public/robots.txt
2020-09-08 09:49:41 -04:00
Steven
0d4be3f5f2 Publish Canary
- @vercel/build-utils@2.5.2-canary.2
 - vercel@20.1.1-canary.3
 - @vercel/client@9.0.2-canary.2
 - @vercel/next@2.6.25-canary.2
 - @vercel/node@1.8.2-canary.2
2020-09-05 15:16:56 -04:00
Steven
a971c2aa3a [tests] Delay deprecation message (#5158)
This PR is a follow up to #5157 which was unable to deprecate a package immediately after publishing and failed with E405. So this PR adds a delay between publish and deprecate. It also uses the `-f` flag suggested in the error message. https://github.com/vercel/vercel/runs/1076007594#step:6:649
2020-09-05 15:13:48 -04:00
Steven
66414bd65a Publish Canary
- @vercel/build-utils@2.5.2-canary.1
 - vercel@20.1.1-canary.2
 - @vercel/client@9.0.2-canary.1
 - @vercel/next@2.6.25-canary.1
 - @vercel/node@1.8.2-canary.1
2020-09-05 13:54:34 -04:00
Steven
3b021993b5 [tests] Fix deprecation message (#5157)
This PR is a follow up to #5119 which had the names backwards.

I fixed the variable names to avoid the confusion since "new" and "old" were ambiguous.

I also removed the incorrect deprecation message from packages published during commit c9597dc199.
2020-09-05 13:49:20 -04:00
JJ Kasper
c9597dc199 Publish Canary
- @vercel/build-utils@2.5.2-canary.0
 - vercel@20.1.1-canary.1
 - @vercel/client@9.0.2-canary.0
 - @vercel/next@2.6.25-canary.0
 - @vercel/node@1.8.2-canary.0
2020-09-05 00:16:18 -05:00
Steven
1b5c94b392 [node][next] Fix nft tracing for monorepos (#5143)
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-09-05 01:13:54 -04:00
dav-is
bd1393a9d6 Publish Canary
- vercel@20.1.1-canary.0
2020-09-04 18:40:25 -04:00
dependabot[bot]
47ddd36fec [cli] Update http-proxy to v1.18.1 (#5152)
Bumps [http-proxy](https://github.com/http-party/node-http-proxy) from 1.17.0 to 1.18.1.
- [Release notes](https://github.com/http-party/node-http-proxy/releases)
- [Changelog](https://github.com/http-party/node-http-proxy/blob/master/CHANGELOG.md)
- [Commits](https://github.com/http-party/node-http-proxy/compare/1.17.0...1.18.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-09-04 14:33:56 -07:00
dependabot[bot]
bd047cdc6a Update tree-kill to v1.2.2 (#5151)
Bumps [tree-kill](https://github.com/pkrumins/node-tree-kill) from 1.2.1 to 1.2.2.
- [Release notes](https://github.com/pkrumins/node-tree-kill/releases)
- [Commits](https://github.com/pkrumins/node-tree-kill/compare/v1.2.1...v1.2.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-09-04 14:33:32 -07:00
Connor Davis
477f9e8753 [cli] Fix color and indention in learn more link (#5148)
CH-568

Before:
![image](https://user-images.githubusercontent.com/11590024/92258007-2883e080-eea4-11ea-8c14-af0f3c9e27a6.png)

After:
![Screenshot-2020-09-04-11:44](https://user-images.githubusercontent.com/11590024/92258023-3174b200-eea4-11ea-9170-0acd4d6f883b.png)
2020-09-04 21:25:52 +00:00
Mike Hartington
183ea42f94 [examples] chore(ionic-angular): remove Google Maps API key (#5130) 2020-08-31 11:58:52 -07:00
Steven
57a17eb416 [tests] Deprecate "now" npm package in favor of "vercel" (#5119)
We deprecated all the `now` scoped packages in favor of the `vercel` equivalents, however the deprecation message disappears after each publish, so we must to run `npm deprecate` after `npm publish` for legacy packages.
2020-08-28 15:39:06 -04:00
4527 changed files with 274892 additions and 328615 deletions

View File

@@ -1,39 +1,17 @@
node_modules
dist
examples
# gatsby-plugin-now
packages/gatsby-plugin-now/test/fixtures
# now-build-utils
packages/now-build-utils/test/fixtures
# now-cli
packages/now-cli/@types
packages/now-cli/download
packages/now-cli/dist
packages/now-cli/test/fixtures
packages/now-cli/test/dev/fixtures
packages/now-cli/bin
packages/now-cli/link
packages/now-cli/src/util/dev/templates/*.ts
# now-client
packages/now-client/tests/fixtures
packages/now-client/lib
# now-next
packages/now-next/test/fixtures
# now-node
packages/now-node/src/bridge.ts
packages/now-node/test/fixtures
# now-node-bridge
packages/now-node-bridge/bridge.*
# now-static-build
packages/now-static-build/test/fixtures
# redwood
packages/redwood/test/fixtures
packages/*/test/fixtures
packages/cli/@types
packages/cli/download
packages/cli/dist
packages/cli/test/dev/fixtures
packages/cli/bin
packages/cli/link
packages/cli/src/util/dev/templates/*.ts
packages/client/tests/fixtures
packages/client/lib
packages/node/src/bridge.ts
packages/node-bridge/bridge.js
packages/node-bridge/launcher.js
packages/middleware/src/entries.js

30
.github/CODEOWNERS vendored
View File

@@ -4,21 +4,21 @@
* @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/env @styfle @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 @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
/packages/cli/src/commands/dev @TooTallNate @styfle @AndyBitz
/packages/cli/src/util/dev @TooTallNate @styfle @AndyBitz
/packages/cli/src/commands/domains @javivelasco @mglagola @anatrajkovska
/packages/cli/src/commands/certs @javivelasco @mglagola @anatrajkovska
/packages/cli/src/commands/env @styfle @lucleray
/packages/client @rdev @styfle @TooTallNate
/packages/build-utils @styfle @AndyBitz @TooTallNate
/packages/node @styfle @TooTallNate @lucleray
/packages/node-bridge @styfle @TooTallNate @lucleray
/packages/next @Timer @ijjk
/packages/go @styfle @TooTallNate
/packages/python @styfle @TooTallNate
/packages/ruby @styfle @coetry @TooTallNate
/packages/static-build @styfle @AndyBitz
/packages/routing-utils @styfle @dav-is @ijjk
/examples @mcsdevv @timothyis
/examples/create-react-app @Timer
/examples/nextjs @timneutkens @Timer

View File

@@ -68,13 +68,13 @@ In such cases you can visit the URL of the failed deployment and append `/_logs`
The logs of this deployment will contain the actual error which may help you to understand what went wrong.
### @zeit/node-file-trace
### @vercel/nft
Some of the Builders use `@zeit/node-file-trace` to tree-shake files before deployment. If you suspect an error with this tree-shaking mechanism, you can create the following script in your project:
Some of the Builders use `@vercel/nft` to tree-shake files before deployment. If you suspect an error with this tree-shaking mechanism, you can create the following script in your project:
```js
const trace = require('@zeit/node-file-trace');
trace(['path/to/entrypoint.js'], {
const { nodeFileTrace } = require('@vercel/nft');
nodeFileTrace(['path/to/entrypoint.js'], {
ts: true,
mixedModules: true,
})
@@ -82,24 +82,15 @@ 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/vercel/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 [@vercel/nft](https://github.com/vercel/nft) 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 `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`
1. Change directory to the desired Builder `cd ./packages/node`
2. Run `yarn build` to compile typescript and other build steps
3. Run `npm pack` to create a tarball file
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 `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 `@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,7 +6,7 @@ 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/vercel/vercel/tree/master/example-directory)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vercel/vercel/tree/main/example-directory)
### How We Created This Example

View File

@@ -1,11 +1,11 @@
blank_issues_enabled: false
blank_issues_enabled: true
contact_links:
- name: Bug Report
url: https://vercel.com/support/request
about: Report a bug using the Vercel support form
- name: Feature Request
url: https://github.com/vercel/vercel/discussions/new?category_id=66161
url: https://github.com/vercel/vercel/discussions/new?category=ideas
about: Share ideas for new features
- name: Ask a Question
url: https://github.com/vercel/vercel/discussions/new?category_id=66160
url: https://github.com/vercel/vercel/discussions/new?category=help
about: Ask the community for help

20
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1,20 @@
### Related Issues
> Fixes #1
> Related to #2
### 📋 Checklist
<!--
Please keep your PR as a Draft until the checklist is complete
-->
#### Tests
- [ ] The code changed/added as part of this PR has been covered with tests
- [ ] All tests pass locally with `yarn test-unit`
#### Code Review
- [ ] This PR has a concise title and thorough description useful to a reviewer
- [ ] Issue from task tracker has a link to this PR

View File

@@ -3,7 +3,7 @@ on:
push:
branches:
- '**'
- '!master'
- '!main'
jobs:
cancel:
@@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- uses: styfle/cancel-workflow-action@0.4.1
- uses: styfle/cancel-workflow-action@0.9.1
with:
workflow_id: 849295, 849296, 849297, 849298
access_token: ${{ github.token }}

View File

@@ -3,7 +3,7 @@ name: Publish
on:
push:
branches:
- master
- main
tags:
- '!*'
@@ -12,12 +12,15 @@ jobs:
name: Publish
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
- uses: actions/setup-go@v2
with:
node-version: 10
go-version: '1.13.15'
- uses: actions/setup-node@v2
with:
node-version: 12
- uses: actions/checkout@v1
- name: Install
run: yarn install --check-files --frozen-lockfile
run: yarn install --check-files --frozen-lockfile --network-timeout 1000000
- name: Build
run: yarn build
env:
@@ -26,6 +29,6 @@ jobs:
- name: Publish
run: yarn publish-from-github
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN_ELEVATED }}
GA_TRACKING_ID: ${{ secrets.GA_TRACKING_ID }}
SENTRY_DSN: ${{ secrets.SENTRY_DSN }}

View File

@@ -3,7 +3,7 @@ name: CLI
on:
push:
branches:
- master
- main
tags:
- '!*'
pull_request:
@@ -16,21 +16,24 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
node: [10, 12]
node: [12]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-go@v2
with:
go-version: '1.13.15'
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- uses: actions/checkout@v2
with:
fetch-depth: 100
- run: git --version
- run: git fetch origin master --depth=100
- run: git fetch origin main --depth=100
- run: git fetch origin ${{ github.ref }} --depth=100
- run: git diff origin/master...HEAD --name-only
- run: yarn install
- run: git diff origin/main...HEAD --name-only
- run: yarn install --network-timeout 1000000
- run: yarn run build
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: yarn test-integration-cli --clean false
env:
VERCEL_TEAM_TOKEN: ${{ secrets.VERCEL_TEAM_TOKEN }}

View File

@@ -3,7 +3,7 @@ name: Dev
on:
push:
branches:
- master
- main
tags:
- '!*'
pull_request:
@@ -11,29 +11,32 @@ on:
jobs:
test:
name: Dev
timeout-minutes: 45
timeout-minutes: 75
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
node: [10, 12]
node: [12]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-go@v2
with:
go-version: '1.13.15'
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- uses: actions/checkout@v2
with:
fetch-depth: 100
- run: git --version
- run: git fetch origin master --depth=100
- run: git fetch origin main --depth=100
- run: git fetch origin ${{ github.ref }} --depth=100
- run: git diff origin/master...HEAD --name-only
- run: git diff origin/main...HEAD --name-only
- name: Install Hugo
if: matrix.os == 'macos-latest'
run: curl -L -O https://github.com/gohugoio/hugo/releases/download/v0.56.0/hugo_0.56.0_macOS-64bit.tar.gz && tar -xzf hugo_0.56.0_macOS-64bit.tar.gz && mv ./hugo packages/now-cli/test/dev/fixtures/08-hugo/
- run: yarn install
run: curl -L -O https://github.com/gohugoio/hugo/releases/download/v0.56.0/hugo_0.56.0_macOS-64bit.tar.gz && tar -xzf hugo_0.56.0_macOS-64bit.tar.gz && mv ./hugo packages/cli/test/dev/fixtures/08-hugo/
- run: yarn install --network-timeout 1000000
- run: yarn run build
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: yarn test-integration-dev --clean false
env:
VERCEL_TEAM_TOKEN: ${{ secrets.VERCEL_TEAM_TOKEN }}

View File

@@ -3,7 +3,7 @@ name: E2E
on:
push:
branches:
- master
- main
tags:
- '!*'
pull_request:
@@ -14,14 +14,20 @@ jobs:
timeout-minutes: 120
runs-on: ubuntu-latest
steps:
- uses: actions/setup-go@v2
with:
go-version: '1.13.15'
- uses: actions/setup-node@v2
with:
node-version: 12
- uses: actions/checkout@v2
with:
fetch-depth: 100
- run: git --version
- run: git fetch origin master --depth=100
- run: git fetch origin main --depth=100
- run: git fetch origin ${{ github.ref }} --depth=100
- run: git diff origin/master...HEAD --name-only
- run: yarn install
- run: git diff origin/main...HEAD --name-only
- run: yarn install --network-timeout 1000000
- run: yarn run build
- run: yarn test-integration-once --clean false
env:

View File

@@ -3,7 +3,7 @@ name: Unit
on:
push:
branches:
- master
- main
tags:
- '!*'
pull_request:
@@ -16,20 +16,23 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
node: [10, 12]
node: [12]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/setup-go@v2
with:
go-version: '1.13.15'
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- uses: actions/checkout@v2
with:
fetch-depth: 100
- run: git --version
- run: git fetch origin master --depth=100
- run: git fetch origin main --depth=100
- run: git fetch origin ${{ github.ref }} --depth=100
- run: git diff origin/master...HEAD --name-only
- uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node }}
- run: yarn install
- run: git diff origin/main...HEAD --name-only
- run: yarn install --network-timeout 1000000
- run: yarn run build
- run: yarn run lint
if: matrix.os == 'ubuntu-latest' && matrix.node == 12 # only run lint once

23
.gitignore vendored
View File

@@ -9,17 +9,17 @@ coverage.lcov
*.swp
*.bak
*.tgz
packages/now-cli/src/util/dev/templates/*.ts
packages/now-cli/src/util/constants.ts
packages/now-cli/test/**/yarn.lock
!packages/now-cli/test/dev/**/yarn.lock
packages/now-cli/test/**/node_modules
packages/now-cli/test/dev/fixtures/08-hugo/hugo
packages/now-cli/test/dev/fixtures/**/dist
packages/now-cli/test/dev/fixtures/**/public
packages/now-cli/test/dev/fixtures/**/.now
packages/now-cli/test/dev/fixtures/**/.vercel
packages/now-cli/test/fixtures/integration
packages/cli/src/util/dev/templates/*.ts
packages/cli/src/util/constants.ts
packages/cli/test/**/yarn.lock
!packages/cli/test/dev/**/yarn.lock
packages/cli/test/**/node_modules
packages/cli/test/dev/fixtures/08-hugo/hugo
packages/cli/test/dev/fixtures/**/dist
packages/cli/test/dev/fixtures/**/public
packages/cli/test/dev/fixtures/**/.now
packages/cli/test/dev/fixtures/**/.vercel
packages/cli/test/fixtures/integration
test/lib/deployment/failed-page.txt
.DS_Store
.next
@@ -27,3 +27,4 @@ test/lib/deployment/failed-page.txt
/public
__pycache__
.vercel
.output

1
.husky/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
_

4
.husky/pre-commit Executable file
View File

@@ -0,0 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"
yarn pre-commit

View File

@@ -1,7 +1,7 @@
version = 1
[merge]
automerge_label = "automerge"
automerge_label = ["semver-major","semver-minor","semver-patch"]
blacklist_title_regex = "^WIP.*"
blacklist_labels = ["work in progress"]
method = "squash"

View File

@@ -332,7 +332,7 @@ This is an abstract enumeration type that is implemented by one of the following
- `nodejs10.x`
- `go1.x`
- `java11`
- `python3.8`
- `python3.9`
- `python3.6`
- `dotnetcore2.1`
- `ruby2.5`
@@ -398,12 +398,12 @@ 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('@vercel/build-utils')
const { glob, download } = require('@vercel/build-utils');
exports.build = ({ files, workPath }) => {
await download(files, workPath)
return glob('**', workPath)
}
await download(files, workPath);
return glob('**', workPath);
};
```
### `getWritableDirectory()`

332
LICENSE
View File

@@ -1,190 +1,202 @@
Apache License
Version 2.0, January 2004
https://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
1. Definitions.
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
1. Definitions.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
END OF TERMS AND CONDITIONS
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
Copyright 2017 Vercel, Inc.
END OF TERMS AND CONDITIONS
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
APPENDIX: How to apply the Apache License to your work.
https://www.apache.org/licenses/LICENSE-2.0
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
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.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

View File

@@ -6,14 +6,18 @@
<p align="center">Develop. Preview. Ship.</p>
</p>
[![CI Status](https://badgen.net/github/checks/vercel/vercel?label=CI)](https://github.com/vercel/vercel/actions?workflow=CI)
[![CI Status](https://github.com/vercel/vercel/actions/workflows/test-unit.yml/badge.svg)](https://github.com/vercel/vercel/actions/workflows/test-unit.yml)
[![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
Vercel is the optimal workflow for frontend teams. All-in-one: Static and Jamstack deployment, Serverless Functions, and Global CDN.
Vercel is a platform for **static sites and frontend frameworks**, built to integrate with your headless content, commerce, or database.
Get started by [Importing a Git Project](https://vercel.com/import) and use `git push` to deploy. Alternatively, you can [install Vercel CLI](https://vercel.com/download).
We provide a **frictionless developer experience** to take care of the hard things: deploy instantly, scale automatically, and serve personalized content around the globe.
We make it easy for frontend teams to **develop, preview, and ship** delightful user experiences, where performance is the default.
Get started by [Importing a Git Project](https://vercel.com/new) and use `git push` to deploy. Alternatively, you can [install Vercel CLI](https://vercel.com/cli).
## Documentation
@@ -24,7 +28,7 @@ For details on how to use Vercel, check out our [documentation](https://vercel.c
1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device
2. Install dependencies with `yarn install`
3. Compile the code: `yarn build`
4. Link the package to the global module directory: `cd ./packages/now-cli && yarn link`
4. Link the package to the global module directory: `cd ./packages/cli && yarn link`
5. You can start using `vercel` anywhere inside the command line
As always, you should use `yarn test-unit` to run the tests and see if your changes have broken anything.

View File

@@ -2,19 +2,19 @@
* Get example list from extracted folder
*/
import { join } from 'path';
import { lstatSync, existsSync, readdirSync } from 'fs';
const exists = (path: string) => existsSync(path);
const isDotFile = (name: string) => name.startsWith('.');
const isDirectory = (path: string) => lstatSync(path).isDirectory();
export function summary(source: string) {
export function summary(source: string): string[] {
if (!exists(source) || !isDirectory(source)) {
return [];
}
return readdirSync(source)
.filter(name => !isDotFile(name))
.filter(name => isDirectory(join(source, name)));
return readdirSync(source, { withFileTypes: true })
.filter(d => !isDotFile(d.name))
.filter(d => d.isDirectory())
.map(d => d.name);
}

View File

@@ -1,10 +1,10 @@
import { NowRequest, NowResponse } from '@vercel/node';
import { VercelRequest, VercelResponse } from '@vercel/node';
import { errorHandler } from './error-handler';
type Handler = (req: NowRequest, res: NowResponse) => Promise<any>;
type Handler = (req: VercelRequest, res: VercelResponse) => Promise<any>;
export function withApiHandler(handler: Handler): Handler {
return async (req: NowRequest, res: NowResponse) => {
return async (req: VercelRequest, res: VercelResponse) => {
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Allow-Methods', 'GET');
res.setHeader(

View File

@@ -2,7 +2,7 @@ import fs from 'fs';
// @ts-ignore
import tar from 'tar-fs';
import { extract } from '../../_lib/examples/extract';
import { NowRequest, NowResponse } from '@vercel/node';
import { VercelRequest, VercelResponse } from '@vercel/node';
import { withApiHandler } from '../../_lib/util/with-api-handler';
const TMP_DIR = '/tmp';
@@ -11,7 +11,7 @@ function isDirectory(path: string) {
return fs.existsSync(path) && fs.lstatSync(path).isDirectory();
}
function notFound(res: NowResponse, message: string) {
function notFound(res: VercelResponse, message: string) {
return res.status(404).send({
error: {
code: 'not_found',
@@ -36,8 +36,8 @@ function streamToBuffer(stream: any) {
}
export default withApiHandler(async function (
req: NowRequest,
res: NowResponse
req: VercelRequest,
res: VercelResponse
) {
const ext = '.tar.gz';
const { segment = '' } = req.query;
@@ -48,8 +48,8 @@ export default withApiHandler(async function (
const example = segment.slice(0, -ext.length);
await extract('https://github.com/vercel/vercel/archive/master.zip', TMP_DIR);
const directory = `${TMP_DIR}/vercel-master/examples/${example}`;
await extract('https://github.com/vercel/vercel/archive/main.zip', TMP_DIR);
const directory = `${TMP_DIR}/vercel-main/examples/${example}`;
if (!isDirectory(directory)) {
return notFound(res, `Example '${example}' was not found.`);

View File

@@ -3,14 +3,14 @@
// @ts-ignore
import parseGitUrl from 'parse-github-url';
import { NowRequest, NowResponse } from '@vercel/node';
import { VercelRequest, VercelResponse } from '@vercel/node';
import { withApiHandler } from '../_lib/util/with-api-handler';
import { getGitHubRepoInfo } from '../_lib/examples/github-repo-info';
import { getGitLabRepoInfo } from '../_lib/examples/gitlab-repo-info';
export default withApiHandler(async function (
req: NowRequest,
res: NowResponse
req: VercelRequest,
res: VercelResponse
) {
const repoPath = decodeURIComponent((req.query.repo as string) || '');

View File

@@ -1,10 +1,10 @@
import { NowRequest, NowResponse } from '@vercel/node';
import { VercelRequest, VercelResponse } from '@vercel/node';
import { getExampleList } from '../_lib/examples/example-list';
import { withApiHandler } from '../_lib/util/with-api-handler';
export default withApiHandler(async function (
req: NowRequest,
res: NowResponse
req: VercelRequest,
res: VercelResponse
) {
res.status(200).json(await getExampleList());
});

View File

@@ -1,15 +1,15 @@
import { extract } from '../_lib/examples/extract';
import { summary } from '../_lib/examples/summary';
import { NowRequest, NowResponse } from '@vercel/node';
import { VercelRequest, VercelResponse } from '@vercel/node';
import { mapOldToNew } from '../_lib/examples/map-old-to-new';
import { withApiHandler } from '../_lib/util/with-api-handler';
export default withApiHandler(async function (
req: NowRequest,
res: NowResponse
req: VercelRequest,
res: VercelResponse
) {
await extract('https://github.com/vercel/vercel/archive/master.zip', '/tmp');
const exampleList = summary('/tmp/vercel-master/examples');
await extract('https://github.com/vercel/vercel/archive/main.zip', '/tmp');
const exampleList = summary('/tmp/vercel-main/examples');
const existingExamples = Array.from(exampleList).map(key => ({
name: key,

View File

@@ -1,4 +1,4 @@
import { NowRequest, NowResponse } from '@vercel/node';
import { VercelRequest, VercelResponse } from '@vercel/node';
import { withApiHandler } from './_lib/util/with-api-handler';
import _frameworks, { Framework } from '../packages/frameworks';
@@ -12,6 +12,8 @@ const frameworks = (_frameworks as Framework[])
...frameworkItem,
detectors: undefined,
sort: undefined,
dependency: undefined,
defaultRoutes: undefined,
};
if (framework.logo) {
@@ -22,8 +24,8 @@ const frameworks = (_frameworks as Framework[])
});
export default withApiHandler(async function (
req: NowRequest,
res: NowResponse
req: VercelRequest,
res: VercelResponse
) {
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Allow-Methods', 'GET');

View File

@@ -5,12 +5,12 @@
"description": "API for the vercel/vercel repo",
"main": "index.js",
"scripts": {
"build": "yarn --cwd .. && node ../utils/run.js build all"
"vercel-build": "yarn --cwd .. && node ../utils/run.js build all"
},
"dependencies": {
"@sentry/node": "5.11.1",
"got": "10.2.1",
"node-fetch": "2.6.0",
"node-fetch": "2.6.1",
"parse-github-url": "1.0.2",
"tar-fs": "2.0.0",
"unzip-stream": "0.3.0"
@@ -18,7 +18,7 @@
"devDependencies": {
"@types/node": "13.1.4",
"@types/node-fetch": "2.5.4",
"@vercel/node": "1.7.2",
"@vercel/node": "1.9.0",
"typescript": "3.9.6"
}
}

View File

@@ -5,6 +5,7 @@
"strict": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"noEmitOnError": true,
"esModuleInterop": true,
"module": "commonjs",
"moduleResolution": "node",

View File

@@ -134,10 +134,10 @@
dependencies:
"@types/node" "*"
"@vercel/node@1.7.2":
version "1.7.2"
resolved "https://registry.yarnpkg.com/@vercel/node/-/node-1.7.2.tgz#85cb8aac661c02dfef6fe752740f5b162e90767b"
integrity sha512-XV5lrLC+K/cxsaFj8H2OoGu1zliOqnxcrOnPInI8HmQjR/Tztt+0nzgpt+7sx8wXcrib0Nu7lK303jP7VjSETw==
"@vercel/node@1.9.0":
version "1.9.0"
resolved "https://registry.yarnpkg.com/@vercel/node/-/node-1.9.0.tgz#6b64f3b9a962ddb1089276fad00f441a1f4b9cf0"
integrity sha512-Vk/ZpuY4Cdc8oUwBi/kf8qETRaJb/KYdFddVkLuS10QwA0yJx+RQ11trhZ1KFUdc27aBr5S2k8/dDxK8sLr+IA==
dependencies:
"@types/node" "*"
ts-node "8.9.1"
@@ -362,10 +362,10 @@ ms@^2.1.1:
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
node-fetch@2.6.0:
version "2.6.0"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.0.tgz#e633456386d4aa55863f676a7ab0daa8fdecb0fd"
integrity sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==
node-fetch@2.6.1:
version "2.6.1"
resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.1.tgz#045bd323631f76ed2e2b55573394416b639a0052"
integrity sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==
normalize-url@^4.1.0:
version "4.5.0"

View File

@@ -6,3 +6,5 @@ coverage:
project: off
patch: off
fixes:
- "::packages/cli/" # move root e.g., "path/" => "after/path/"

View File

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

View File

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

View File

@@ -6,5 +6,5 @@ You're running Vercel CLI in a non-terminal context and there are no credentials
#### Possible Ways to Fix It
- Specify a value for the `--token` flag (this needs to be the token of the user account as which you'd like to act). You can either get the token from the `./vercel/auth.json` file located in your user directory or [from the dashboard](https://vercel.com/account/tokens).
- Ensure that both `~/vercel/auth.json` and `~/vercel/config.json` exist
- Specify a value for the `--token` flag (this needs to be the token of the user account as which you'd like to act). You can create a new token on your [Settings page](https://vercel.com/account/tokens).
- Run `vercel login` to sign in and generate a new token

View File

@@ -2,7 +2,7 @@
#### Why This Error Occurred
This error occurs when you have your application is not configured for Serverless Next.js build output.
This error occurs when your application is not configured for Serverless Next.js build output.
#### Possible Ways to Fix It

View File

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

View File

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

View File

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

View File

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

View File

@@ -7,4 +7,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 `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.
- If you're using the `--token` flag, make sure your token is not expired. You can generate a new token on your [Settings page](https://vercel.com/account/tokens).
- Ensure that the scope you specified using `--scope` flag shows up in the output of `vercel switch`. If it doesn't, you're either not a member of the team or you logged into the wrong user account. You can ask an owner of the team to invite you.

View File

@@ -2,10 +2,10 @@
#### Why This Error Occurred
You specified the `--scope` flag and specified the ID or slug of a team that does not exist or that you're not a part of. Similarly you might have specified the ID or username of user whose account you don't own.
You specified the `--scope` flag and specified the ID or slug of a team that does not exist or that you're not a member. Similarly you might have specified the ID or username of user whose account you don't own.
#### Possible Ways to Fix It
If you're sure the specified team exists, please make sure that you're a part of it (ask an owner of the team to invite you). If you specified the identifier of a user, make sure you are actually the owner of this account.
Otherwise, either create a team with the specified slug or ensure that the identifier is correct if you're sure that the scope exists.
- 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`.
- If you're using the `--token` flag, make sure your token is not expired. You can generate a new token on your [Settings page](https://vercel.com/account/tokens).
- Ensure that the scope you specified using `--scope` flag shows up in the output of `vercel switch`. If it doesn't, you're either not a member of the team or you logged into the wrong user account. You can ask an owner of the team to invite you.

View File

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

View File

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

14
examples/README.md vendored
View File

@@ -44,13 +44,13 @@ We are continuously improving our examples based on best practices and feedback
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/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) |
| Previous Example | New Example |
| ----------------- | ---------------------------------------------------------------------------------------- |
| **monorepo** | [gatsby-functions](https://github.com/vercel/vercel/tree/main/examples/gatsby) |
| **nodejs** | [svelte-functions](https://github.com/vercel/vercel/tree/main/examples/svelte) |
| **nextjs-static** | [nextjs](https://github.com/vercel/vercel/tree/main/examples/nextjs) |
| **vanilla-go** | [create-react-app](https://github.com/vercel/vercel/tree/main/examples/create-react-app) |
| **typescript** | [gatsby-functions](https://github.com/vercel/vercel/tree/main/examples/gatsby) |
## Migrating and Upgrading

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/vercel/vercel/tree/master/examples/amp)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vercel/vercel/tree/main/examples/amp)
_Live Example: https://amp.now-examples.now.sh_

View File

@@ -48,3 +48,5 @@ Thumbs.db
# Environment Variables
.env
.env.build
.vercel

View File

@@ -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/vercel/vercel/tree/master/examples/angular)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vercel/vercel/tree/main/examples/angular&template=angular)
_Live Example: https://angular.now-examples.now.sh_

13218
examples/angular/package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -12,37 +12,38 @@
},
"private": true,
"dependencies": {
"@angular/animations": "~8.1.0",
"@angular/common": "~8.1.0",
"@angular/compiler": "~8.1.0",
"@angular/core": "~8.1.0",
"@angular/forms": "~8.1.0",
"@angular/platform-browser": "~8.1.0",
"@angular/platform-browser-dynamic": "~8.1.0",
"@angular/router": "~8.1.0",
"@angular/animations": "^8.1.0",
"@angular/common": "^8.1.0",
"@angular/core": "^8.1.0",
"@angular/forms": "^8.1.0",
"@angular/platform-browser": "^8.1.0",
"@angular/platform-browser-dynamic": "^8.1.0",
"@angular/router": "^8.1.0",
"rxjs": "~6.4.0",
"tslib": "^1.9.0",
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.801.0",
"@angular/cli": "~8.1.0",
"@angular/compiler-cli": "~8.1.0",
"@angular-devkit/build-angular": "^12.2.2",
"@angular/cli": "^12.2.2",
"@angular/compiler": "^12.2.2",
"@angular/compiler-cli": "^12.2.2",
"@angular/language-service": "~8.1.0",
"@types/node": "~8.9.4",
"@types/jasmine": "~3.3.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "^5.0.0",
"jasmine-core": "~3.4.0",
"glob-parent": "^5.1.2",
"jasmine-core": "^3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.1.0",
"karma": "^6.3.4",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"protractor": "~5.4.0",
"protractor": "^7.0.0",
"ts-node": "~7.0.0",
"tslint": "~5.15.0",
"typescript": "~3.4.3"
"typescript": "^4.2.4"
}
}

View File

@@ -8,7 +8,7 @@ This directory is a brief example of a [Blitz.js](https://blitzjs.com/) project
Deploy your own Blitz.js project with Vercel by viewing the [documentation on deploying to Vercel](https://blitzjs.com/docs/deploy-vercel)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/master/examples/blitzjs)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vercel/vercel/tree/main/examples/blitzjs&template=blitzjs)
### How We Created This Example

View File

@@ -29,7 +29,7 @@
"dependencies": {
"@prisma/cli": "latest",
"@prisma/client": "latest",
"blitz": "latest",
"blitz": "0.17.0",
"react": "experimental",
"react-dom": "experimental"
},
@@ -49,7 +49,7 @@
"lint-staged": "10.2.10",
"prettier": "2.0.5",
"pretty-quick": "2.0.1",
"typescript": "3.9.5"
"typescript": "4.1.5"
},
"private": true
}

9388
examples/blitzjs/yarn.lock Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -27,4 +27,5 @@ public/
# Environment Variables
.env
.env.build
.env.build
.vercel

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/vercel/vercel/tree/master/examples/brunch)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vercel/vercel/tree/main/examples/brunch&template=brunch)
_Live Example: https://brunch.now-examples.now.sh_

3475
examples/brunch/yarn.lock Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -25,4 +25,5 @@ yarn-error.log*
# Environment Variables
.env
.env.build
.env.build
.vercel

View File

@@ -0,0 +1 @@
README.md

View File

@@ -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/vercel/vercel/tree/master/examples/create-react-app-functions)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vercel/vercel/tree/main/examples/create-react-app-functions&template=create-react-app)
_Live Example: https://create-react-app.now-examples.now.sh/_

View File

@@ -1,3 +0,0 @@
module example-date
go 1.12

View File

@@ -0,0 +1,3 @@
module example-date
go 1.16

View File

@@ -5,7 +5,7 @@
"dependencies": {
"react": "^16.6.1",
"react-dom": "^16.6.1",
"react-scripts": "2.1.1"
"react-scripts": "^4.0.3"
},
"scripts": {
"dev": "BROWSER=none react-scripts start",

View File

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

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
README.md

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/vercel/vercel/tree/master/examples/custom-build)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vercel/vercel/tree/main/examples/custom-build)
_Live Example: https://custom-build.now-examples.now.sh_

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/vercel/vercel/tree/master/docusaurus-2)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vercel/vercel/tree/main/docusaurus-2&template=docusaurus-2)
### How We Created This Example

View File

@@ -7,9 +7,10 @@ lib/core/MetadataBlog.js
translated_docs
build/
yarn.lock
node_modules
i18n/*
.env
.env.build
.env.build
.vercel

View File

@@ -0,0 +1 @@
README.md

View File

@@ -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/vercel/vercel/tree/master/examples/docusaurus)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vercel/vercel/tree/main/examples/docusaurus&template=docusaurus)
_Live Example: https://docusaurus.now-examples.now.sh_

File diff suppressed because it is too large Load Diff

View File

@@ -2,3 +2,5 @@ node_modules/
_build/
output/
.cert/
.vercel

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/vercel/vercel/tree/master/dojo)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vercel/vercel/tree/main/dojo&template=dojo)
### How We Created This Example

11081
examples/dojo/yarn.lock Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1 @@
README.md

View File

@@ -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/vercel/vercel/tree/master/examples/eleventy)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vercel/vercel/tree/main/examples/eleventy&template=eleventy)
_Live Example: https://eleventy.now-examples.now.sh_

3126
examples/eleventy/yarn.lock Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -27,3 +27,6 @@
# Environment Variables
.env
.env.build
# Vercel
.vercel

View File

@@ -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/vercel/vercel/tree/master/examples/ember)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vercel/vercel/tree/main/examples/ember&template=ember)
_Live Example: https://ember.now-examples.now.sh_

8912
examples/ember/yarn.lock Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -68,3 +68,5 @@ yarn-error.log
.pnp.js
# Yarn Integrity file
.yarn-integrity
.vercel

View File

@@ -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/vercel/vercel/tree/master/examples/gatsby)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vercel/vercel/tree/main/examples/gatsby&template=gatsby)
_Live Example: https://gatsby.now-examples.now.sh_

View File

@@ -1,6 +1,6 @@
import { NowRequest, NowResponse } from '@now/node';
import { VercelRequest, VercelResponse } from '@vercel/node';
export default (_req: NowRequest, res: NowResponse) => {
export default (_req: VercelRequest, res: VercelResponse) => {
const date = new Date().toString();
res.status(200).send(date);
};

View File

@@ -12,7 +12,7 @@
"react-helmet": "^5.2.0"
},
"devDependencies": {
"@now/node": "^1.3.0"
"@vercel/node": "1.9.0"
},
"scripts": {
"dev": "gatsby develop",

View File

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

View File

@@ -1107,15 +1107,6 @@
"@nodelib/fs.scandir" "2.1.3"
fastq "^1.6.0"
"@now/node@^1.3.0":
version "1.7.1"
resolved "https://registry.yarnpkg.com/@now/node/-/node-1.7.1.tgz#764a0c6bcb24967f8014c4f73ad238c292996fe3"
integrity sha512-+srVKopsVTPDR3u9eOjJryZroLTrPp8XEOuIDGBdfFcJuS7qpAomctSbfyA7WNyjC0ExtUxELqBg5sAedG5+2g==
dependencies:
"@types/node" "*"
ts-node "8.9.1"
typescript "3.9.3"
"@pieh/friendly-errors-webpack-plugin@1.7.0-chalk-2":
version "1.7.0-chalk-2"
resolved "https://registry.yarnpkg.com/@pieh/friendly-errors-webpack-plugin/-/friendly-errors-webpack-plugin-1.7.0-chalk-2.tgz#2e9da9d3ade9d18d013333eb408c457d04eabac0"
@@ -1409,6 +1400,15 @@
dependencies:
wonka "^4.0.14"
"@vercel/node@1.9.0":
version "1.9.0"
resolved "https://registry.yarnpkg.com/@vercel/node/-/node-1.9.0.tgz#6b64f3b9a962ddb1089276fad00f441a1f4b9cf0"
integrity sha512-Vk/ZpuY4Cdc8oUwBi/kf8qETRaJb/KYdFddVkLuS10QwA0yJx+RQ11trhZ1KFUdc27aBr5S2k8/dDxK8sLr+IA==
dependencies:
"@types/node" "*"
ts-node "8.9.1"
typescript "3.9.3"
"@webassemblyjs/ast@1.9.0":
version "1.9.0"
resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.9.0.tgz#bd850604b4042459a5a41cd7d338cbed695ed964"

View File

@@ -6,3 +6,5 @@ node_modules
dist
.env
.env.*
.vercel

View File

@@ -0,0 +1 @@
README.md

View File

@@ -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/vercel/vercel/tree/master/examples/gridsome)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vercel/vercel/tree/main/examples/gridsome&template=gridsome)
_Live Example: https://gridsome.now-examples.now.sh_

View File

@@ -8,6 +8,6 @@
"explore": "gridsome explore"
},
"dependencies": {
"gridsome": "^0.6.0"
"gridsome": "0.7.23"
}
}

9001
examples/gridsome/yarn.lock Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -6,4 +6,5 @@ node_modules/
public/
.deploy*/
.env
.env.build
.env.build
.vercel

View File

@@ -0,0 +1 @@
README.md

View File

@@ -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/vercel/vercel/tree/master/examples/hexo)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vercel/vercel/tree/main/examples/hexo&template=hexo)
_Live Example: https://hexo.now-examples.now.sh_

View File

@@ -3,18 +3,18 @@
"version": "0.0.0",
"private": true,
"hexo": {
"version": "3.9.0"
"version": "5.3.0"
},
"dependencies": {
"hexo": "^3.9.0",
"hexo-generator-archive": "^0.1.5",
"hexo-generator-category": "^0.1.3",
"hexo-generator-index": "^0.2.1",
"hexo-generator-tag": "^0.2.0",
"hexo-renderer-ejs": "^0.3.1",
"hexo-renderer-stylus": "^0.3.3",
"hexo-renderer-marked": "^1.0.1",
"hexo-server": "^0.3.3"
"hexo": "^5.3.0",
"hexo-generator-archive": "^1.0.0",
"hexo-generator-category": "^1.0.0",
"hexo-generator-index": "^2.0.0",
"hexo-generator-tag": "^1.0.0",
"hexo-renderer-ejs": "^1.0.0",
"hexo-renderer-marked": "^3.3.0",
"hexo-renderer-stylus": "^2.0.1",
"hexo-server": "^2.0.0"
},
"scripts": {
"dev": "hexo server -p $PORT",

1259
examples/hexo/yarn.lock Normal file

File diff suppressed because it is too large Load Diff

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/vercel/vercel/tree/master/examples/hugo)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vercel/vercel/tree/main/examples/hugo&template=hugo)
_Live Example: https://hugo.now-examples.now.sh_

View File

@@ -34,4 +34,4 @@ $RECYCLE.BIN/
Thumbs.db
UserInterfaceState.xcuserstate
.vercel
.vercel

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/vercel/vercel/tree/master/examples/ionic-angular)
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/vercel/vercel/tree/main/examples/ionic-angular&template=ionic-angular)
_Live Example: https://ionic-angular.now-examples.now.sh_

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