Compare commits

...

2993 Commits

Author SHA1 Message Date
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
Steven
be24510f16 Publish Stable
- @vercel/frameworks@0.1.1
 - @vercel/build-utils@2.5.1
 - vercel@20.1.0
 - @vercel/client@9.0.1
 - @vercel/go@1.1.6
 - @vercel/next@2.6.24
 - @vercel/node@1.8.1
 - @vercel/python@1.2.3
 - @vercel/ruby@1.2.4
 - @vercel/static-build@0.17.8
 - @vercel/redwood@0.1.1
2020-08-27 20:01:15 -04:00
Steven
05c534d855 Publish Canary
- @vercel/frameworks@0.1.1-canary.0
 - @vercel/build-utils@2.5.1-canary.1
 - vercel@20.0.1-canary.2
 - @vercel/client@9.0.1-canary.1
 - @vercel/go@1.1.6-canary.0
 - @vercel/node@1.8.1-canary.0
 - @vercel/python@1.2.3-canary.0
 - @vercel/ruby@1.2.4-canary.0
 - @vercel/static-build@0.17.8-canary.0
 - @vercel/redwood@0.1.1-canary.0
2020-08-27 19:39:21 -04:00
Shu Ding
910169dba7 [cli] Add support for the sourceFilesOutsideRootDirectory option (#5113)
If the value is set to `true` in the project settings, we don't cd into `rootDirectory`. 
We default it to `true` for new projects.
2020-08-27 23:37:50 +00:00
Steven
0fc74feddc [all] Bump ncc to 0.24.0 (#5103)
- Bump ncc to [0.24.0](https://github.com/vercel/ncc/releases/tag/0.24.0)
- Install ncc in each package that depends on it
2020-08-26 11:03:34 -04:00
Naoyuki Kanezawa
a9ea294514 fix framework names (#5104) 2020-08-26 22:14:39 +09:00
Steven
42e0450d87 Publish Canary
- vercel@20.0.1-canary.1
 - @vercel/next@2.6.24-canary.0
2020-08-25 22:13:26 -04:00
Guy Bedford
08c0feb58a [cli] Improve startup perf - disable source maps and minification (#5100)
Currently on my machine, vercel --version takes 850ms to run. With this change, that execution time is reduced to ~550ms.

The reason is that source maps seem to significantly slow down Node.js execution, compounded by the size of the source map, even if it is not used.

I believe the benefits of this perf improvement outweigh the direct source maps and minification benefits.

If it is felt that direct per-file source maps are necessary for internal errors, then reducing the source map size should be investigated further to improve the runtime performance here.
2020-08-25 22:12:25 -04:00
Mark Glagola
60aaf76ed2 [cli] Fix vc domains ls pagination (#5099)
Fixes pagination for vercel cli `domains ls --next <timestamp>`
2020-08-25 19:39:34 -04:00
Matthew Sweeney
bd706beba5 [examples] Update README Files (#5092)
This PR updates the `README.md` files with the following changes:

- Removal of CLI deployment.
- Amends Blitz.js to be in line with other `README.md` formats.
2020-08-25 14:51:46 -04:00
JJ Kasper
b85a0a349a [next] Add test case for root optional revalidate params (#5072)
This adds test cases from https://github.com/vercel/next.js/pull/16451 which are currently failing and will pass after a new canary of Next.js has been published
2020-08-24 16:32:30 +00:00
Steven
a97bc2af6d Publish Canary
- @vercel/build-utils@2.5.1-canary.0
 - vercel@20.0.1-canary.0
 - @vercel/client@9.0.1-canary.0
2020-08-24 11:19:44 -04:00
Steven
a5dc90c8cd Revert "[build-utils] Use handle: error for api 404" (#5088)
* Revert "[build-utils] Use `handle: error` for api 404 (#5064)"

This reverts commit 02e1c921ac.

* Re-enable cli changes

* Re-enable redwood changes

* Minor cleanup
2020-08-24 11:16:32 -04:00
Steven
e90521b5a4 Publish Stable
- @vercel/frameworks@0.1.0
 - @vercel/build-utils@2.5.0
 - vercel@20.0.0
 - @vercel/client@9.0.0
 - @vercel/go@1.1.5
 - @vercel/next@2.6.23
 - @vercel/node@1.8.0
 - @vercel/routing-utils@1.8.4
 - @vercel/static-build@0.17.7
 - @vercel/redwood@0.1.0
2020-08-24 08:25:30 -04:00
Steven
10c598834a Publish Canary
- @vercel/build-utils@2.4.3-canary.5
 - vercel@20.0.0-canary.26
 - @vercel/client@8.2.2-canary.10
2020-08-21 17:53:14 -04:00
Steven
e58b34b82c [build-utils] Fix framework "Other" with Next.js for old projects (#5074)
Since released PR #5009, we had some users that depend on the broken behavior. This adds an arbitrary date so that old projects will use the old broken behavior, and new projects will use the new behavior from #5009.

The reason for the date is that we don't want to force users to create new projects who noticed this broken behavior months ago like this discussion: https://github.com/vercel/vercel/discussions/4138

Its better to be a bit aggressive and set the date far back because users with that want the old behavior have a workaround: select Next.js in the framework dropdown. However, users that want the new behavior with an old project will be stuck without a solution.
2020-08-21 21:51:40 +00:00
Steven
02e1c921ac [cli][build-utils] Use handle: error for api 404 (#5064)
This PR does a few things:

- Consolidates build-utils to use both 404 routes in `handle: error` phase
- Fixes `vc dev` to process `handle: error` phase after the `handle: filesystem` phase
- Updates `/api` 404 route to be excluded for frameworks like RedwoodJS which use their own functions
2020-08-21 20:29:39 +00:00
Steven
fcb14fa70e Publish Canary
- @vercel/redwood@0.0.2-canary.8
2020-08-19 18:26:12 -04:00
Steven
46e18128c7 [redwood] Add support for functions and apiProxyPath config (#5063)
This PR adds two missing features to `@vercel/redwood`:

1. Support for [`functions`](https://vercel.com/docs/configuration#project/functions) in `vercel.json`
2. Support for [`apiProxyPath`](https://redwoodjs.com/docs/app-configuration-redwood-toml#apiproxypath) in `redwood.toml`
3. Support for caching yarn workspaces which has `node_modules` outside the root directory
2020-08-19 22:16:53 +00:00
dav-is
e06d5247ef Publish Canary
- vercel@20.0.0-canary.25
 - @vercel/client@8.2.2-canary.9
2020-08-19 16:40:45 -04:00
Connor Davis
02195b92a7 [client][cli] Add Learn More Option to Warnings (#5022)
The deployment API might return a learn more link to address warnings, tips, or notices

CH-568

```
HTTP/2 200
...
x-vercel-warning-bad-error: Something went wrong
x-vercel-link-bad-error: https://vercel.link/bad-error

x-vercel-notice-low-funds: You are low on funds
x-vercel-link-low-funds: https://vercel.link/increase-funds
...
```

Should output as:
```
Warning: Something went wrong
Learn More: https://vercel.link/bad-error

Notice: You are low on funds
Learn More: https://vercel.link/increase-funds
```
2020-08-19 20:19:28 +00:00
Andy Bitz
7945155a0f Publish Canary
- vercel@20.0.0-canary.24
 - @vercel/next@2.6.23-canary.0
 - @vercel/node@1.7.5-canary.2
 - @vercel/routing-utils@1.8.4-canary.5
2020-08-19 15:01:35 +02:00
Andy
edb6043c2c [cli] Always show renewal price for domains inspect (#5060)
* [cli] Always show renwal price for `domains inspect`

* Update test
2020-08-19 15:00:33 +02:00
Markoz Peña
971481ba51 [node] Add res.redirect() helper method (#4947)
This pull request adds a method redirect, the behavior will be the same as that of Next.js with `pages/api`. This PR takes into account the change that is being made in Next.js with redirect due to the [error that was reported](https://github.com/vercel/next.js/issues/15594) a few hours ago.

Co-authored-by: Steven <steven@ceriously.com>
2020-08-18 18:58:54 -04:00
JJ Kasper
db8e456603 Publish canary
- @vercel/routing-utils@1.8.4-canary.4
2020-08-18 12:37:22 -05:00
JJ Kasper
d1b4f24a4a Publish Stable
- @vercel/next@2.6.22
2020-08-18 12:25:16 -05:00
JJ Kasper
4eb39ed53b Publish Canary
- @vercel/next@2.6.22-canary.1
- @vercel/routing-utils@1.8.4-canary.3
2020-08-18 12:19:58 -05:00
JJ Kasper
6c7236ffd5 [routing-utils] Attempt normal path-to-regexp replacing before custom (#5053)
This corrects behavior that was changed when switching to use `safelyCompile` which caused some `path-to-regexp` replacing behavior to be changed like not removing brackets `{}` around params which are removed in Next.js. This updates to first attempt to use the normal replacing behavior from `path-to-regexp` falling back to the safe compiling logic added when that fails. 

Additional tests have been added to ensure the brackets are stripped as expected when compiling with `path-to-regexp`
2020-08-18 16:57:38 +00:00
Steven
f0def040ac Publish Canary
- vercel@20.0.0-canary.23
 - @vercel/next@2.6.22-canary.0
2020-08-17 17:32:42 -04:00
Steven
ee8dff2dc9 [cli] Remove unused dependencies (#5052)
This PR is a follow up to removing v1 in PR #5011
2020-08-17 21:28:17 +00:00
Steven
df86a6d48c [cli] Fix update message (#5051)
The update message was sometimes printed when there was no update.

This PR fixes the update check to ensure the that it is only printed when the latest version differs from the current version.
2020-08-17 16:15:12 -04:00
JJ Kasper
b3958b3d12 Publish Stable
- @vercel/next@2.6.21
2020-08-17 09:48:34 -05:00
JJ Kasper
8dd22703a7 Publish Canary
- @vercel/next@2.6.21-canary.1
2020-08-17 09:36:53 -05:00
JJ Kasper
c7e2280d23 [next] Fix trailing slash and 404 with next export (#5048)
This fixes the case where `trailingSlash: true` is used with `next export` causing the `404` page to be output as `404/index.html` and we were previously only checking for the 404 output at `404`. This also adds a regression test for this behavior. 

Closes: https://github.com/vercel/next.js/issues/16218
2020-08-17 14:12:22 +00:00
Steven
2c239a6ee2 Publish Canary
- vercel@20.0.0-canary.22
 - @vercel/next@2.6.21-canary.0
 - @vercel/routing-utils@1.8.4-canary.2
2020-08-14 18:32:42 -04:00
Steven
43709fbc74 Remove unused dependencies (#5042)
The CLI doesn't depend on `@vercel/redwood` for `vc dev` since PR #5036 so we can remove it.

Similarly, zero config does not install `@vercel/next` or `@vercel/static-build` during `vc dev` so these can be removed too.

In the case where the user defines `builds` in vercel.json, the runtimes will be installed during the first run of `vc dev`.
2020-08-14 18:26:46 -04:00
JJ Kasper
52cd486e1d Publish Stable
- @vercel/next@2.6.20
2020-08-14 16:17:28 -05:00
JJ Kasper
175f302a7f Publish Canary
- @vercel/next@2.6.20-canary.1
- @vercel/routing-utils@1.8.4-canary.1
2020-08-14 15:36:58 -05:00
JJ Kasper
070bbd5825 [routing-utils] Update rewrite params query appending (#5040)
This updates to not automatically append params to the query for rewrites if one or more of the params are already used in the destination's path. No other behavior is being changed and if the user still wants the params in the query after using them in the destination's path they can manually add them like with redirects.

x-ref: https://github.com/vercel/next.js/pull/16189
2020-08-14 15:59:21 +00:00
Steven
cdeb4004c9 Publish Canary
- vercel@20.0.0-canary.21
 - @vercel/redwood@0.0.2-canary.7
2020-08-13 19:58:42 -04:00
Steven
6bb162e5f5 [cli][redwood] Update frontend framework detection in vc dev (#5036)
This PR uses the the new property added in PR #5034 to determine if a framework has a frontend runtime defined.

It also reverts a couple workarounds add in PR #4937 which was added for RedwoodJS which is no longer necessary since RedwoodJS defines a frontend framework the same way Next.js does.
2020-08-13 23:53:17 +00:00
Steven
8282442939 Publish Canary
- @vercel/frameworks@0.0.18-canary.5
 - @vercel/build-utils@2.4.3-canary.4
 - vercel@20.0.0-canary.20
 - @vercel/client@8.2.2-canary.8
 - @vercel/redwood@0.0.2-canary.6
2020-08-13 15:22:15 -04:00
Steven
1f4f2af2f2 [build-utils][frameworks] Add support for runtime properties (#5034)
This PR adds two properties to `frameworks.json`:

1. `useRuntime` - this moves the special case for non `@vercel/static-build` frontends, so that any framework can do the same as Next.js and RedwoodJS
2. `ignoreRuntimes` - this allows a framework to opt out of api detection such as RedwoodJS which handle's its own `.js` extensions

This also fixes 2 bugs discovered during implementing the feature:

1. `test-unit.yml` was not testing Node 12, it was testing 10 for both runs
2. `sortFilesBySegmentCount()` was non-deterministic causing node 10 and 12 to sort differently
2020-08-13 19:18:31 +00:00
Steven
f1bb0e465a [tests] Increase git fetch depth to support git 2.28 (#5032)
This PR fixes the CI error `fatal: origin/master...HEAD: no merge base`.

Git 2.28 change here: 1457886ce2

More info here: https://github.com/pre-commit/pre-commit/issues/1554
2020-08-13 13:31:08 +00:00
Steven
6dab4399c2 Publish Canary
- vercel@20.0.0-canary.19
 - @vercel/client@8.2.2-canary.7
2020-08-12 19:25:14 -04:00
Max Leiter
e87465d076 [cli][client] (Major) Remove legacy Now CLI 1.0 code (#5011)
It was easier to make a new PR than re-base the old ones:

https://github.com/zeit/now/pull/4017
https://github.com/vercel/vercel/pull/4602

Story: https://app.clubhouse.io/vercel/story/425/remove-all-the-zeit-now-1-0-code-from-vercel-cli
2020-08-12 23:22:21 +00:00
Steven
2f53b0dcdb Publish Canary
- @vercel/frameworks@0.0.18-canary.4
 - vercel@20.0.0-canary.18
 - @vercel/redwood@0.0.2-canary.5
2020-08-12 08:08:57 -04:00
Steven
b2e5212d0f [redwood] Update default build command (#5020)
This PR updates the default build command per @thedavidprice 

It also uses `@vercel/frameworks` as a source of truth for the build command.

If the user has a `build` script in `package.json`, that will take precedence over the default.
2020-08-11 19:08:18 +00:00
Steven
28c9999c10 Publish Canary
- vercel@20.0.0-canary.17
 - @vercel/redwood@0.0.2-canary.4
2020-08-10 17:54:00 -04:00
Steven
edb31fb412 [redwood] Fix file permissions and add support for build script (#4999)
Some files require execution privileges, such as Prisma, so we must preserve the file mode.

We also want redwood to behave the same as other frameworks and use `yarn build` if available.
2020-08-10 21:20:13 +00:00
Andy Bitz
2f0ea24552 Publish Canary
- vercel@20.0.0-canary.16
2020-08-10 22:05:12 +02:00
Andy
7d09fdc5a4 [cli] Update domains command output (#5018)
* [cli] Update `domain` command output

* Undo debug output

* Empty commit
2020-08-10 22:04:18 +02:00
Steven
23dce48b23 Publish Canary
- @vercel/build-utils@2.4.3-canary.3
 - vercel@20.0.0-canary.15
 - @vercel/client@8.2.2-canary.6
 - @vercel/static-build@0.17.7-canary.3
2020-08-10 13:00:57 -04:00
Steven
d7d308ca09 [build-utils] Fix framework "Other" when Next.js is dependency (#5009)
- Fixes discussion #4138
- Related to issue #3774
2020-08-10 16:49:26 +00:00
Steven
0e412361ad [tests] Fix Github Actions CI (#5010)
We're seeing some strange failures during `git diff` so I added it earlier to see if it fails earlier.
2020-08-07 19:37:17 -04:00
Yamagishi Kazutoshi
d563a99fb8 [static-build] Add Docusaurus v2 default routes for assets (#4973)
Reference: https://v2.docusaurus.io/docs/markdown-features/#assets

Co-authored-by: Steven <steven@ceriously.com>
2020-08-07 16:14:55 -04:00
Steven
6ce4c2e182 Publish Canary
- vercel@20.0.0-canary.14
 - @vercel/client@8.2.2-canary.5
 - @vercel/next@2.6.20-canary.0
 - @vercel/static-build@0.17.7-canary.2
2020-08-06 10:10:40 -04:00
Max Leiter
e31d6d4062 [client] Lower upload sempahore size from 700 to 50 connections (#4993)
CH Story:

https://app.clubhouse.io/vercel/story/5291/cli-connection-pooling

(Mac) script for watching count of active connections to API: 
`watch -n 0.1 'netstat -a -n | grep -E \'(13.52.46.156|52.9.164.177)\' | wc -l'`

Limiting the active connections to 50 greatly decreased the amount of active connections but did not noticeably increase the time to upload files. 

For each semaphore size below, I tested uploading 200 files of random size (between 50kb and 100kb) 5 times. More tests on varying file sizes / amounts showed similar results. 

Results:
```
Size: Average time in ms
50  : 25740 ms 
700 : 28763 ms
10  : 29339 ms
```

I also moved the the agent creation outside of the forEach loop when uploading. This is functionally the same (as node would use the same socket for the same hostname) but makes it easier to access the agent object if we need to debug in the future, and it seems unnecessary to create a new object each call.
2020-08-06 03:41:56 +00:00
Nathan Rajlich
f2f421b494 [cli] Default to os.EOL when creating .gitignore file (#4991)
This fixes the scenario where 1) is Windows and 2) there is no
`.gitignore` file in the project, so `vc link` creates one. Before, it was
defaulting to `\n`. Updated to use `os.EOL` so that `\r\n` is used on
Windows.

Also removed `encoding` option to `writeFile()` since `utf8` is already the
default.

Related to #4965.
2020-08-05 22:57:28 +00:00
Nathan Rajlich
46836e12b5 [client] (Major) Remove trailing / from default ignore list (#4810)
The trailing slash ends up making the root directory be accepted,
causing the ignore logic to traverse one level deep into the directory
that should be ignored. Removing the slash makes the root directory be
correctly ignored so that traversing one level into the ignored
directory is avoided, which is less work to do and thus is faster.

Before:

```
> [debug] [2020-07-07T23:22:05.768Z] Locating files /Users/nrajlich/project
> [debug] [2020-07-07T23:22:05.769Z] Ignoring /Users/nrajlich/project/.editorconfig
> [debug] [2020-07-07T23:22:05.769Z] Ignoring /Users/nrajlich/project/.git
> [debug] [2020-07-07T23:22:05.769Z] Ignoring /Users/nrajlich/project/.gitignore
> [debug] [2020-07-07T23:22:05.769Z] Ignoring /Users/nrajlich/project/.next
> [debug] [2020-07-07T23:22:05.769Z] Ignoring /Users/nrajlich/project/.vercel
> [debug] [2020-07-07T23:22:05.770Z] Ignoring /Users/nrajlich/project/.vercelignore
> [debug] [2020-07-07T23:22:05.770Z] Ignoring /Users/nrajlich/project/README.md
> [debug] [2020-07-07T23:22:05.770Z] Ignoring /Users/nrajlich/project/dist
> [debug] [2020-07-07T23:22:05.774Z] Ignoring /Users/nrajlich/project/node_modules/.bin
> [debug] [2020-07-07T23:22:05.775Z] Ignoring /Users/nrajlich/project/node_modules/.yarn-integrity
> [debug] [2020-07-07T23:22:05.775Z] Ignoring /Users/nrajlich/project/node_modules/@ampproject
> [debug] [2020-07-07T23:22:05.775Z] Ignoring /Users/nrajlich/project/node_modules/@babel
> [debug] [2020-07-07T23:22:05.775Z] Ignoring /Users/nrajlich/project/node_modules/@mrmlnc
> [debug] [2020-07-07T23:22:05.775Z] Ignoring /Users/nrajlich/project/node_modules/@next
> [debug] [2020-07-07T23:22:05.775Z] Ignoring /Users/nrajlich/project/node_modules/@nodelib
> [debug] [2020-07-07T23:22:05.775Z] Ignoring /Users/nrajlich/project/node_modules/@tootallnate
> [debug] [2020-07-07T23:22:05.775Z] Ignoring /Users/nrajlich/project/node_modules/@types
> [debug] [2020-07-07T23:22:05.775Z] Ignoring /Users/nrajlich/project/node_modules/@typescript-eslint
> [debug] [2020-07-07T23:22:05.775Z] Ignoring /Users/nrajlich/project/node_modules/@vercel
> [debug] [2020-07-07T23:22:05.775Z] Ignoring /Users/nrajlich/project/node_modules/@webassemblyjs
> [debug] [2020-07-07T23:22:05.775Z] Ignoring /Users/nrajlich/project/node_modules/@xtuc
> [debug] [2020-07-07T23:22:05.775Z] Ignoring /Users/nrajlich/project/node_modules/acorn
> [debug] [2020-07-07T23:22:05.775Z] Ignoring /Users/nrajlich/project/node_modules/acorn-jsx
> [debug] [2020-07-07T23:22:05.775Z] Ignoring /Users/nrajlich/project/node_modules/adjust-sourcemap-loader
> [debug] [2020-07-07T23:22:05.775Z] Ignoring /Users/nrajlich/project/node_modules/aggregate-error
> [debug] [2020-07-07T23:22:05.775Z] Ignoring /Users/nrajlich/project/node_modules/ajv
> [debug] [2020-07-07T23:22:05.775Z] Ignoring /Users/nrajlich/project/node_modules/ajv-errors
> [debug] [2020-07-07T23:22:05.775Z] Ignoring /Users/nrajlich/project/node_modules/ajv-keywords
> [debug] [2020-07-07T23:22:05.775Z] Ignoring /Users/nrajlich/project/node_modules/ally.js
> [debug] [2020-07-07T23:22:05.775Z] Ignoring /Users/nrajlich/project/node_modules/alphanum-sort
> [debug] [2020-07-07T23:22:05.776Z] Ignoring /Users/nrajlich/project/node_modules/anser
> [debug] [2020-07-07T23:22:05.776Z] Ignoring /Users/nrajlich/project/node_modules/ansi-escapes
> [debug] [2020-07-07T23:22:05.776Z] Ignoring /Users/nrajlich/project/node_modules/ansi-regex
> [debug] [2020-07-07T23:22:05.776Z] Ignoring /Users/nrajlich/project/node_modules/ansi-styles
> [debug] [2020-07-07T23:22:05.776Z] Ignoring /Users/nrajlich/project/node_modules/anymatch
> [debug] [2020-07-07T23:22:05.776Z] Ignoring /Users/nrajlich/project/node_modules/aproba
> [debug] [2020-07-07T23:22:05.776Z] Ignoring /Users/nrajlich/project/node_modules/argparse
> [debug] [2020-07-07T23:22:05.776Z] Ignoring /Users/nrajlich/project/node_modules/aria-query
> [debug] [2020-07-07T23:22:05.776Z] Ignoring /Users/nrajlich/project/node_modules/arity-n
> [debug] [2020-07-07T23:22:05.776Z] Ignoring /Users/nrajlich/project/node_modules/arr-diff
> [debug] [2020-07-07T23:22:05.776Z] Ignoring /Users/nrajlich/project/node_modules/arr-flatten
> [debug] [2020-07-07T23:22:05.776Z] Ignoring /Users/nrajlich/project/node_modules/arr-union
> [debug] [2020-07-07T23:22:05.776Z] Ignoring /Users/nrajlich/project/node_modules/array-find-index
> [debug] [2020-07-07T23:22:05.776Z] Ignoring /Users/nrajlich/project/node_modules/array-includes
…
… many more
…
> [debug] [2020-07-07T23:25:19.854Z] Locating files /Users/nrajlich/project: 20.117ms
```

After:

```
> [debug] [2020-07-07T23:24:37.403Z] Locating files /Users/nrajlich/project
> [debug] [2020-07-07T23:24:37.413Z] Ignoring /Users/nrajlich/project/.editorconfig
> [debug] [2020-07-07T23:24:37.414Z] Ignoring /Users/nrajlich/project/.git
> [debug] [2020-07-07T23:24:37.414Z] Ignoring /Users/nrajlich/project/.gitignore
> [debug] [2020-07-07T23:24:37.414Z] Ignoring /Users/nrajlich/project/.next
> [debug] [2020-07-07T23:24:37.414Z] Ignoring /Users/nrajlich/project/.vercel
> [debug] [2020-07-07T23:24:37.415Z] Ignoring /Users/nrajlich/project/.vercelignore
> [debug] [2020-07-07T23:24:37.415Z] Ignoring /Users/nrajlich/project/README.md
> [debug] [2020-07-07T23:24:37.415Z] Ignoring /Users/nrajlich/project/dist
> [debug] [2020-07-07T23:24:37.416Z] Ignoring /Users/nrajlich/project/node_modules
> [debug] [2020-07-07T23:25:19.854Z] Locating files /Users/nrajlich/project: 2.117ms
```

- Related to #3980
- Related to #3747
- Related to #4325 
- Related to #4627
2020-08-05 16:26:58 -04:00
Luis Alvarez D
3fc2611bf0 [examples] Update Next.js Example (#4984)
Related to https://github.com/vercel/docs/pull/2047 - The Next.js docs page will mention features from 9.5, but the current starter is quite outdated.
2020-08-05 19:11:12 +00:00
Steven
b4d8c411bd [examples][static-build] Update ionic-angular to 5.1.1 (#4986)
This PR adds the missing `package-lock.json` file and updates to latest `ionic-angular` boilerplate.
2020-08-05 13:53:29 -04:00
JJ Kasper
82b7d6980c Publish Stable
- @vercel/next@2.6.19
2020-08-05 11:31:59 -05:00
JJ Kasper
895b233605 Publish Canary
- @vercel/frameworks@0.0.18-canary.3
 - vercel@20.0.0-canary.13
 - @vercel/next@2.6.19-canary.1
2020-08-05 11:31:00 -05:00
Joe Haddad
d9e6b5348b [next] Blocking Fallback (ISG) Support (#4985) 2020-08-05 11:49:45 -04:00
Mark Glagola
1934a64864 [cli][certs rm] (Major) Bump to v5 certs API (#4943)
Bumps certs API from `/v3` to  `/v5`.

_Removing auto generated certs will be blocked in `/v5`_
2020-08-04 23:38:53 +00:00
Steven
c412642668 [cli] Handle unauthorized errors when user is not logged in (#4975)
We don't need to report these errors to Sentry because the user attempted a command that requires them to login.

https://sentry.io/organizations/vercel/issues/1498276418/?project=1323225

This will print:
- `NOT_AUTHORIZED`: "The specified token is not valid. Use vc login to generate a new token."
- `TEAM_DELETED`: "Your team was deleted. You can switch to a different one using vc switch"

### Related 
- Related to #4082 
- Related to #3857
2020-08-04 22:34:55 +00:00
Steven
793fe9aee1 [tests] Update cancel action to 0.4.1 (#4980)
Bump `cancel-workflow-action` to [0.4.1](https://github.com/styfle/cancel-workflow-action/releases/tag/0.4.1) to fix a bug where the wrong branch was cancelled.
2020-08-04 17:15:25 -04:00
Joe Haddad
ddc54d2ca4 [next] Run prettier (#4979) 2020-08-04 14:01:33 -07:00
Steven
39e5f0a364 [frameworks][examples] Adjust redwood logo size (#4976)
- Rename redwood logo to redwoodjs to match framework slug
- Update size to 48x48 to match other logos
2020-08-04 15:49:09 -04:00
Steven
43ed9ec859 [cli] Fix tests for .gitignore append during project link (#4978)
Fixes tests from #4965
2020-08-04 18:58:22 +00:00
Kid
8ba44fca79 [cli] Fix .gitignore append during project link (#4965)
* [cli] fix .gitignore updating check

* Detect file EOL

* Semicolon

* Add trailing newline

Co-authored-by: Nathan Rajlich <n@n8.io>
2020-08-04 10:29:08 -07:00
Andy Bitz
27dbefaecf Publish Canary
- vercel@20.0.0-canary.12
 - @vercel/next@2.6.19-canary.0
2020-08-04 19:10:28 +02:00
Andy
b4a13913c7 [cli] Adjust output for recently changed domain commands (#4959)
* [cli] Adjust output for recently changed domain commands

* Update the inspect and list page

* Remove test

* Update packages/now-cli/src/commands/domains/inspect.ts

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

* Change output

* Remove workaround

* Update error

* Include contextName

Co-authored-by: Steven <steven@ceriously.com>
2020-08-04 18:49:46 +02:00
JJ Kasper
f842266b2e Publish Stable
- @vercel/next@2.6.18
2020-08-04 09:27:01 -05:00
JJ Kasper
ad0cc858ed Publish Canary
- vercel@20.0.0-canary.11
 - @vercel/next@2.6.18-canary.0
 - @vercel/node@1.7.5-canary.1
2020-08-04 09:06:29 -05:00
JJ Kasper
4bb7180de9 [next] Ensure trailing slash resolves to functions correctly (#4972)
This makes sure the routes mapping to the serverless functions handle the trailing slash being present or not. This also adds additional test cases to ensure it is functioning correctly
2020-08-04 03:35:50 +00:00
Steven
7a4faa480d [node][next] Bump node-file-trace to 0.8.2 (#4969)
Bump `node-file-trace` to [0.8.2](https://github.com/vercel/node-file-trace/releases/tag/0.8.2)
2020-08-03 11:09:52 -04:00
JJ Kasper
421be5d738 Publish Stable
- @vercel/next@2.6.17
2020-07-31 10:29:04 -05:00
JJ Kasper
b8eaf10974 Publish Canary
- vercel@20.0.0-canary.10
 - @vercel/next@2.6.17-canary.1
2020-07-31 10:20:59 -05:00
JJ Kasper
92a4bf27cf [next] Fix monorepo build edge case without build script (#4956)
This fixes an edge case where a monorepo Next.js app fails to build due to running `next build` manually instead of via `package.json` scripts like we previously were doing. 

Failing project with current `@vercel/next` running `next build` manually: https://vercel.com/jj4/test2020/15fhg1ko3
Succeeding project running changing back to running `next build` through a `package.json` script: https://vercel.com/jj4/test2020/dths5f1nv

x-ref: https://github.com/vercel/vercel/pull/4863
Fixes: https://github.com/vercel/next.js/issues/15713
2020-07-31 15:17:14 +00:00
Steven
2672838b64 Publish Canary
- vercel@20.0.0-canary.9
 - @vercel/next@2.6.17-canary.0
 - @vercel/redwood@0.0.2-canary.3
2020-07-31 09:15:51 -04:00
Steven
1c96071ddc [cli][redwood] Update redwood port detection in vc dev (#4937)
Fixes redwood support for `vc dev`
2020-07-31 13:14:04 +00:00
Steven
71cdf759da [tests] Ignore custom next 404 (#4955)
Commenting out this test assertion until we can fix it in #4946
2020-07-30 20:40:41 -04:00
Torsten Dittmann
93ebd213de [examples] Update deprecated and outdated Svelte example packages (#4706) 2020-07-30 15:44:39 -07:00
JJ Kasper
a32ba8f214 Publish Stable
- @vercel/next@2.6.16
2020-07-30 14:15:29 -05:00
JJ Kasper
d416f70a6e Publish Canary
- @vercel/frameworks@0.0.18-canary.2
 - vercel@20.0.0-canary.8
 - @vercel/next@2.6.16-canary.0
 - @vercel/node@1.7.5-canary.0
 - @vercel/routing-utils@1.8.4-canary.0
 - @vercel/redwood@0.0.2-canary.2
2020-07-30 13:45:26 -05:00
JJ Kasper
ba9e1dd0ba [routing-utils] Update header replacing to handle more cases (#4942)
This adds handling for more cases while updating header values to make sure to escape any characters that could break compiling with `path-to-regexp`

x-ref: https://github.com/vercel/next.js/pull/15592
2020-07-30 18:22:30 +00:00
Steven
d513f74b70 [frameworks][redwood] Bump to RedwoodJS to 0.15.0 (#4953)
Implements https://github.com/redwoodjs/redwood/pull/904
2020-07-30 10:52:04 -04:00
JJ Kasper
47f92f8f14 Publish Stable
- @vercel/next@2.6.15
- @vercel/node@1.7.4
2020-07-29 15:43:53 -05:00
JJ Kasper
9aa669d735 Publish Canary
- vercel@20.0.0-canary.7
 - @vercel/next@2.6.15-canary.0
2020-07-29 15:41:14 -05:00
JJ Kasper
99cab6f34a [next] Fix lambda opt-out for index page (#4950)
This makes sure we detect a fully static `/index` page correctly since the `prerender-manifest` lists it as `/` and we were expecting `/index` during the lambda building opt-out check

x-ref: https://github.com/vercel/next.js/discussions/15619
2020-07-29 16:36:13 -04:00
JJ Kasper
547e7dccf7 [next] Add test cases for route /index handling (#4002)
This adds some test cases for `/index` handling to ensure we are being consistent with local development and production
2020-07-29 17:49:28 +00:00
JJ Kasper
dce9a89407 Publish Stable
- @vercel/next@2.6.14
2020-07-29 08:55:06 -05:00
Steven
c1cdddd974 Publish Canary
- vercel@20.0.0-canary.6
2020-07-28 17:29:59 -04:00
Steven
4bce77dd4b [cli] Fix vercel link command when vercel.json contains builds (#4940)
This PR fixes a bug when running `vercel link` command in a directory with `vercel.json` that contains `builds` property. The problem is that framework auto-detection doesn't run when `builds` is used, only for zero config. So we skip the API and instead create the project without auto-detection during `vc link`.
2020-07-28 17:28:53 -04:00
Steven
3a79810944 Publish Canary
- @vercel/frameworks@0.0.18-canary.1
 - vercel@20.0.0-canary.5
 - @vercel/client@8.2.2-canary.4
 - @vercel/next@2.6.14-canary.2
 - @vercel/node@1.7.4-canary.1
2020-07-27 20:53:09 -04:00
Steven
5b3fbdddb3 [node][next] Bump node-file-trace to 0.8.1 (#4933)
This PR bumps `node-file-trace` to [0.8.1](https://github.com/vercel/node-file-trace/releases/tag/0.8.1) to fix ESM packages used with `require()`.

Fixes https://github.com/vercel/node-file-trace/issues/141
2020-07-27 20:50:45 -04:00
JJ Kasper
25e9ecb5a2 [next] Update test fixtures to latest canary (#4935)
This updates our Next.js test fixtures to run against canary. 

It looks like the mono-repo fixtures will need to be updated to run against canary separately since there may be a conflict with legacy routes and the trailing slash redirect
2020-07-27 19:39:25 -04:00
Nathan Rajlich
415515840c [frameworks] Update "Other" build command placeholder to use "vercel-build" (#4934) 2020-07-27 14:03:16 -07:00
Nathan Rajlich
9ba14be12e [client] Export buildFileTree() and return the ignore list (#4917)
* [client] Export `buildFileTree()` and return the ignore list

The ignore list from this function will be used in production to
render a warning if there are files listed in the `.vercelignore` file
that are being comitted to the project's git repo.

* Tests for `ignoreList`

* Update packages/now-client/src/utils/index.ts

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

Co-authored-by: Steven <steven@ceriously.com>
2020-07-24 17:11:44 -07:00
Steven
f1321946c5 [frameworks] Add link to demo for RedwoodJS (#4921) 2020-07-24 16:22:19 -07:00
Max Leiter
230b69abf4 [cli] Fix external rewrites/redirects in dev (#4914)
Co-authored-by: Steven <steven@ceriously.com>
2020-07-24 16:21:52 -07:00
Igor Klopov
0d96f80ac8 [cli] Print build error message instead of 'Build failed' (#4908)
This PR fixes the `lambda-with-invalid-runtime` CLI test
2020-07-24 12:38:24 -04:00
Steven
178f5e7f00 Publish Canary
- @vercel/build-utils@2.4.3-canary.2
 - vercel@20.0.0-canary.4
 - @vercel/client@8.2.2-canary.3
2020-07-23 21:00:25 -04:00
Steven
dbfdf20c9d [build-utils] Fix redwood /api detection (#4916)
Previously, the zero detection would see js files in the `/api` directory and attempt to use `@vercel/node`. However, this doesn't work with RedwoodJS which uses a different format for [`/api`](https://github.com/vercel/vercel/tree/master/examples/redwoodjs/api) so we must only use `@vercel/redwood` when RedwoodJS is detected.
2020-07-24 00:33:06 +00:00
Juan Campa
a80ed4ec9b [api] Fix api-framework cache header (#4913)
## Problem

`api-frameworks` is not being cached by our edge when used via the fallback-to-front mechanism. That's because the headers are only applied to `/api/frameworks` but not `/api/v1/frameworks` which is the actual path being used.

## Solution

Also apply the caching headers to `/api/<version>/frameworks`
2020-07-23 23:48:47 +00:00
Steven
833c3d7c01 Publish Canary
- @vercel/frameworks@0.0.18-canary.0
 - @vercel/build-utils@2.4.3-canary.1
 - vercel@20.0.0-canary.3
 - @vercel/client@8.2.2-canary.2
 - @vercel/redwood@0.0.2-canary.1
2020-07-23 18:29:16 -04:00
Steven
19d0db7270 [frameworks] Add autodetection for RedwoodJS (#4915)
- Supersedes #4539
- Related to #4676

Co-authored-by: Lachlan Campbell <lachlan@hackclub.com>
2020-07-23 18:02:50 -04:00
Steven
041e8cc601 Publish Canary
- @vercel/build-utils@2.4.3-canary.0
 - vercel@20.0.0-canary.2
 - @vercel/client@8.2.2-canary.1
 - @vercel/static-build@0.17.7-canary.1
 - @vercel/redwood@0.0.2-canary.0
2020-07-23 16:28:44 -04:00
Steven
b118e461b1 [redwoood] Add runtime @vercel/redwood (#4676)
### Changes
- Add new Runtime: `@vercel/redwood`
- Update `run.js` script to sort packages properly

### Related
- Related to #4539 
- Related to #4535
- Depends on https://github.com/apollographql/apollo-server/pull/4311
2020-07-23 16:22:48 -04:00
Andy Bitz
e519d49d7b Publish Canary
- vercel@20.0.0-canary.1
2020-07-23 15:42:46 +02:00
Andy Bitz
27683818ba Bump vercel to 20.0.0-canary.0 2020-07-23 15:42:30 +02:00
Andy
e016e38229 [cli] (Major) Change vc domains add workflow to match the dashboard (#3325)
* [now-cli] Change `now domains add` workflow to match dashboard

* Fix error throwing and add --force

* Remove `now domains verify`

* Count projects when removing a domain

* Include projects for `now inspect`

* Updated `now domains ls`

* Fix `now domains ls`

* Use Finally

* Add tests

* Use --force for domain tests

* Adjust tests

* Adjust test and fix output

* Fix padding

* Adjust more tests

* Ensure the project exists

* Log the deployment

* Fix tests again

* Remove project after test

* Fix command

* Fix test

* Change user after a couple of tests

* Add check

* Use random name for domain

* More logging

* Add more logging

* Remove logging

* Remove .now/project.json every time

* Skip test

* Add test to change user

* More logging

* Use now login

* Remove duplicated test

* Consider linked project for `domains add`

* Fix linting

* Remove unused docs

* Undo changes

* Undo more changes

* Fix typo

* Do not sort projects when there is only one record

* Fix loop

* Deploy with `-V 2`

* Remove verification

* Remove outdated link

* Update packages/now-cli/src/commands/domains/add.ts

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

* Update packages/now-cli/src/commands/domains/add.ts

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

* Use utils for public suffix and service type

* Update packages/now-cli/src/commands/domains/ls.ts

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

* Update packages/now-cli/src/commands/domains/add.ts

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

* Change link

* Undo test changes

* Fix type issues

* Update packages/now-cli/src/commands/domains/add.ts

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

* Use domain config to print info

* Check apex domain when removing a domain

* Remove psl

* List projects when removing a domain

* Do not list projects

* Change user earlier

* Update packages/now-cli/src/commands/domains/inspect.ts

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

* Apply suggestions from code review

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

* Apply suggestions from code review

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

Co-authored-by: Mark Glagola <mark.glagola@gmail.com>
Co-authored-by: Steven <steven@ceriously.com>
2020-07-23 15:41:25 +02:00
Max Leiter
5db1c5e610 [tests] Skip try to purchase a domain CLI test if a VERCEL_TOKEN is provided (#4909)
I placed the check inside the test because otherwise `test.only` and other test functions break with this test.
2020-07-23 01:39:05 +00:00
Steven
24c228569f Publish Canary
- vercel@19.2.1-canary.2
 - @vercel/next@2.6.14-canary.1
2020-07-22 16:09:26 -04:00
Steven
963de9b64f [cli] Update "set up" message (#4907)
Follow up to #4897 

* `vc link` - Update message to say `Set up ~/proj`
* `vc dev` - Update message  to say `Set up and develop ~/proj`
* `vc link --help` - Updated example message to include `vc link ~/proj` usage
2020-07-22 19:13:41 +00:00
JJ Kasper
ab7fd52305 [next] Don't trace pages for lambdas when not needed (#4841)
When pages are fully static and don't leverage preview mode or revalidation we can skip tracing the pages for generating the lambdas since lambdas aren't needed in this case
2020-07-22 18:14:47 +00:00
Nathan Rajlich
0fdb0dac91 [cli] Send the Vercel platform proxy request headers to frontend dev server (#4874)
This is a follow up to #4850 that does the same thing when
proxying to the frontend dev server.
2020-07-22 14:36:15 +00:00
Andy Bitz
bb0b632dcf Publish Canary
- vercel@19.2.1-canary.1
 - @vercel/go@1.1.5-canary.0
 - @vercel/next@2.6.14-canary.0
 - @vercel/node@1.7.4-canary.0
 - @vercel/static-build@0.17.7-canary.0
2020-07-22 13:34:40 +02:00
Andy
ced9495143 Revert "Revert "[go] Implement startDevServer() function (#4662)" (#4899)" (#4906)
This reverts commit 8d1afc026f.
2020-07-22 13:33:36 +02:00
Nathan Rajlich
fadc3f2588 [next][node][static-build] Execute "vercel-build" script if defined (#4863)
* [build-utils] Make `runPackageJsonScript()` run the `vercel-` or `now-` if defined in `package.json`

* [build-utils] Export `getScriptName()`

* [next] Use `getScriptName()` and `remove()`

* [node] Update for `vercel-`

* [static-build] Update for `vercel-`

* Remove debug

* Add `getScriptName()` unit tests

* Test for `vercel-build` in e2e

* Make platform name behavior be opt-in

So that it's not a breaking behavior change.

* Check for only "vercel-build" or "now-build", but not "build"

* Simplify `getScriptName()` to return the first existing script in a possible set

* Revert change

* Fix test

Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-07-21 20:04:24 -07:00
Steven
a1d548dfef Publish Canary
- vercel@19.2.1-canary.0
 - @vercel/client@8.2.2-canary.0
2020-07-21 18:56:21 -04:00
Steven
754090a8ab [cli] Add vercel link command (#4897)
- [x] Add `vercel link` command
- [x] Update `vercel dev` to automatically link 
- [x] Updated `vercel env` error message to mention `vercel link`
- [x] Test `vercel link`
- [x] Test `vercel dev`
- [x] Add `--confirm` flag

### Related

- Fixes #3767
- Fixes #4889 
- Fixes #3991 
- Fixes #4534 
- Related to #3989
2020-07-21 18:52:46 -04:00
dependabot[bot]
8269a48ee0 Bump codecov from 3.6.5 to 3.7.1 (#4900)
Bumps [codecov](https://github.com/codecov/codecov-node) from 3.6.5 to 3.7.1.
<details>
<summary>Commits</summary>
<ul>
<li><a href="29dd5b6b03"><code>29dd5b6</code></a> 3.7.1</li>
<li><a href="c0711c6566"><code>c0711c6</code></a> Switch from execSync to execFileSync (<a href="https://github-redirect.dependabot.com/codecov/codecov-node/issues/180">#180</a>)</li>
<li><a href="5f6cc62d4f"><code>5f6cc62</code></a> Bump lodash from 4.17.15 to 4.17.19 (<a href="https://github-redirect.dependabot.com/codecov/codecov-node/issues/183">#183</a>)</li>
<li><a href="0c4d7f3c6f"><code>0c4d7f3</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/codecov/codecov-node/issues/182">#182</a> from codecov/update-readme-badges</li>
<li><a href="cc5e121842"><code>cc5e121</code></a> Update depstat image and urls</li>
<li><a href="b44b44e1f8"><code>b44b44e</code></a> Update readme with 400 error info (<a href="https://github-redirect.dependabot.com/codecov/codecov-node/issues/181">#181</a>)</li>
<li><a href="bb79335719"><code>bb79335</code></a> V3.7.0 (<a href="https://github-redirect.dependabot.com/codecov/codecov-node/issues/179">#179</a>)</li>
<li><a href="0d7b9b01cb"><code>0d7b9b0</code></a> Remove <code>'x-amz-acl': 'public-read'</code> header (<a href="https://github-redirect.dependabot.com/codecov/codecov-node/issues/178">#178</a>)</li>
<li><a href="eeff4e1953"><code>eeff4e1</code></a> Bump acorn from 5.7.3 to 5.7.4 (<a href="https://github-redirect.dependabot.com/codecov/codecov-node/issues/174">#174</a>)</li>
<li><a href="eb8a527470"><code>eb8a527</code></a> Merge pull request <a href="https://github-redirect.dependabot.com/codecov/codecov-node/issues/172">#172</a> from RoboCafaz/bugfix/codebuild-pr-parser</li>
<li>Additional commits viewable in <a href="https://github.com/codecov/codecov-node/compare/v3.6.5...v3.7.1">compare view</a></li>
</ul>
</details>
<br />


[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=codecov&package-manager=npm_and_yarn&previous-version=3.6.5&new-version=3.7.1)](https://help.github.com/articles/configuring-automated-security-fixes)

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-07-21 17:25:56 +00:00
Andy Bitz
9f05a1865c Publish Stable
- @vercel/frameworks@0.0.17
 - @vercel/build-utils@2.4.2
 - vercel@19.2.0
 - @vercel/client@8.2.1
 - @vercel/go@1.1.4
 - @vercel/next@2.6.13
 - @vercel/node@1.7.3
 - @vercel/static-build@0.17.6
2020-07-21 14:58:27 +02:00
Andy
8d1afc026f Revert "[go] Implement startDevServer() function (#4662)" (#4899)
This reverts commit 04bea1e3cd.
2020-07-21 14:55:59 +02:00
Nathan Rajlich
130f36aad6 Publish Canary
- vercel@19.1.3-canary.6
2020-07-20 23:11:46 -07:00
Nathan Rajlich
dd87c9b0c6 Publish Canary
- vercel@19.1.3-canary.5
 - @vercel/next@2.6.13-canary.2
2020-07-20 19:51:15 -07:00
Max Leiter
f813b3340b [cli] Fetch environment variables from Project Settings if .env file is not present (#4562)
Previously, users would have to run `vc env pull` to fetch cloud environment
variables into `.env`. After this PR, if no `.env` or `.build.env` file is present,
environment variables will be pulled by `vc dev` from your Vercel Environment
Variables settings, no file necessary.
2020-07-20 19:47:13 -07:00
Joe Haddad
976b02e895 [next] Add tests for trailing slash behavior (#4894) 2020-07-20 22:29:09 -04:00
Nathan Rajlich
843be9658c [cli] Use update-notifier instead of update-check (#4896)
This makes the updating logic be asynchronous instead of synchronous, and as such will make boot-up of CLI be faster.

The actual update notification display is identical to previous, we are not using `update-notifier`'s default boxen rendering.
2020-07-20 22:31:15 +00:00
dependabot[bot]
ad501a4cd0 Bump lodash from 4.17.15 to 4.17.19 (#4877)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-20 14:00:32 -04:00
Steven
727ae587db Publish Canary
- @vercel/frameworks@0.0.17-canary.2
 - @vercel/build-utils@2.4.2-canary.1
 - vercel@19.1.3-canary.4
 - @vercel/client@8.2.1-canary.1
 - @vercel/next@2.6.13-canary.1
 - @vercel/node@1.7.3-canary.0
2020-07-20 10:27:10 -04:00
Steven
536b15079b [node][next] Bump node-file-trace to 0.8.0 (#4814)
Bump `node-file-trace` to version [0.7.0](https://github.com/vercel/node-file-trace/releases/tag/0.7.0) and then [0.8.0](https://github.com/vercel/node-file-trace/releases/tag/0.8.0)

- Add support for `exports`, dynamic import from CJS support, package boundary emission
- Fix trailing slash in `require()`
- Import named instead of default
2020-07-20 10:24:05 -04:00
Nathan Rajlich
887882697b [cli] Remove "npm pack" logic from output-is-source dev test (#4870)
Now that `@vercel/static-build` is being symlinked to CLI due to the
yarn workspace, `vc dev` will always use the latest code for
zero-config, so this "npm pack" logic is no longer necessary.

The `vercel.json` also no longer gets created in this test so that
zero-config is used.
2020-07-16 16:44:28 -07:00
Nathan Rajlich
e2db7c7734 [build-utils] Add getScriptName() function (#4869)
And allow a set of possible script names to use in `runPackageJsonScript()`.

These are only the changes to `@vercel/build-utils` from #4863.
2020-07-16 16:42:55 -07:00
Steven
022504787c [frameworks][examples] Update blitz new command (#4868)
Updated description per @leo
2020-07-16 22:16:03 +00:00
Nathan Rajlich
0f424de406 [cli] Set server: Vercel header and remove x-now response headers in vercel dev (#4867)
This matches production.
2020-07-16 20:23:44 +00:00
Nathan Rajlich
4819c3ac61 Publish Canary
- vercel@19.1.3-canary.3
2020-07-15 11:04:16 -07:00
Nathan Rajlich
c28ca7ef2d [cli] Set Vercel platform env vars for startDevServer() invocations (#4855)
Ensures that `VERCEL_REGION` is set for API calls when the runtime
implements `startDevServer()`.

Also adds `VERCEL_URL` which was previously not defined.
2020-07-15 10:34:27 -07:00
Nathan Rajlich
068ea00615 [cli] Set Vercel proxy request headers in startDevServer() (#4850)
The Vercel proxy request headers (`x-vercel-deployment-url` for example)
were not being sent to the dev server when the Runtime defines
`startDevServer()`. This is now fixed.

Also updates the header names to match production:

 - `now` -> `vercel`
 - 'x-now-trace', 'x-now-id', and 'x-now-log-id' are removed

Fixes #4729.
2020-07-14 14:48:46 -07:00
Paco
7f8145ab40 [cli] Minor text changes to wrong config error message (#4848)
CH-3242

From review:
- Capitalize "Project"
- Highlight ".vercel" in code snippet style

Thanks to @styfle for pointing me to output/code.
2020-07-14 13:53:23 +00:00
Steven
1a12715096 Publish Canary
- @vercel/build-utils@2.4.2-canary.0
 - vercel@19.1.3-canary.2
 - @vercel/client@8.2.1-canary.0
 - @vercel/next@2.6.13-canary.0
2020-07-13 18:57:39 -04:00
Steven
5b6d565360 [build-utils] Update error message for unmatched function pattern (#4849)
- [x] Depends on https://github.com/vercel/docs/pull/1985
2020-07-13 22:55:15 +00:00
JJ Kasper
0794158906 Publish Stable
- @vercel/next@2.6.12
2020-07-12 10:30:51 -05:00
JJ Kasper
02cdb88d3b Publish Canary
- vercel@19.1.3-canary.1
 - @vercel/next@2.6.12-canary.0
2020-07-12 10:25:27 -05:00
Paco
fa58855114 [cli] Show helpful error when using unauthorized .vercel config (#4807)
CH-3242

When a user has project configuration in `.vercel` that corresponds to a team that they are not a part of, we currently throw a 403 error. This adds special handling so that we can show a specific message when this happens.

I didn't want to update the return type of `getProjectByIdOrName` because we only want to handle this 403 in a special case, so I `throw` it instead.

Other changes are linter.
2020-07-11 03:52:02 +00:00
JJ Kasper
1fac11792f [next] Fix nested public files being renamed incorrectly (#4817)
This corrects the file rename for public files to not incorrectly rename nested `public` files

x-ref: https://github.com/vercel-support/next-nested-public-dir
2020-07-10 23:52:54 +00:00
Nathan Rajlich
05ffc9ce2b Publish Canary
- @vercel/frameworks@0.0.17-canary.1
 - vercel@19.1.3-canary.0
 - @vercel/go@1.1.4-canary.0
 - @vercel/static-build@0.17.6-canary.1
2020-07-10 15:51:19 -07:00
Nathan Rajlich
f848551043 [cli] Pin @vercel/static-build to "0.17.6-canary.0" (#4837)
It got de-synced in c68e83f972.
2020-07-10 22:49:35 +00:00
Steven
9712abc5bf [frameworks][api] Move dependency to devdependency (#4836)
Follow up to #4829
2020-07-10 16:38:19 -04:00
Nathan Rajlich
a9ef3cc726 [go] Add filesystem write fallback for startDevServer() (#4830)
This is for `@vercel/go` to work on Windows, which currently fails with
this error:

```
panic: write pipe: The handle is invalid.

goroutine 1 [running]:
main.main()
	C:/Users/Nathan/Code/casca/vercel-go-test/.vercel/cache/go/2flefmhra8o/api/vercel-dev-server-main.go:25 +0x1ec
exit status 2
```

So this fallback writes the port number to a temp file that
`startDevServer()` polls for in order to figure out the port number.
2020-07-10 19:55:53 +00:00
Steven
e5cc1d643a [frameworks][api] Add sort order (#4829)
This PR adds an optional property called `sort` to each framework so that we can change the order returned in the API. 
The reason this is necessary is because the order of the original array determines the precedence of framework detection. So we need another way to indicate the order of templates/examples returned from the API.

In particular, we need "Next.js" to be first and "Other" to be last.

I also updated the deprecated `@now/node` usage to `@vercel/node` in the API.
2020-07-10 18:09:14 +00:00
Andy Bitz
c68e83f972 Publish Canary
- @vercel/frameworks@0.0.17-canary.0
 - @vercel/static-build@0.17.6-canary.0
2020-07-10 18:45:47 +02:00
Sébastien Chopin
80118de040 [build-utils] Add Nuxt cache and default routes (#4755)
* [@vercel/build-utils] Improve Nuxt build

Need review from @pi0 and @danielroe

* Update packages/now-static-build/src/frameworks.ts

Co-authored-by: Daniel Roe <daniel@roe.dev>

Co-authored-by: Daniel Roe <daniel@roe.dev>
Co-authored-by: Andy <AndyBitz@users.noreply.github.com>
2020-07-10 18:41:02 +02:00
Sébastien Chopin
c69da18e9c fix: Also handle nuxt-edge detection (#4756)
Co-authored-by: Andy <AndyBitz@users.noreply.github.com>
2020-07-10 17:55:29 +02:00
Steven
e19446f89c Publish Stable
- @vercel/frameworks@0.0.16
 - @vercel/build-utils@2.4.1
 - vercel@19.1.2
 - @vercel/client@8.2.0
 - @vercel/go@1.1.3
 - @vercel/next@2.6.11
 - @vercel/node@1.7.2
 - @vercel/ruby@1.2.3
 - @vercel/static-build@0.17.5
2020-07-10 08:20:44 -07:00
JJ Kasper
ea3233502d Publish Stable
- @vercel/next@2.6.10
2020-07-09 21:30:31 -05:00
JJ Kasper
0a8810b64f Publish Canary
- vercel@19.1.2-canary.22
 - @vercel/next@2.6.10-canary.2
2020-07-09 21:29:18 -05:00
JJ Kasper
f6b373f0f4 [next] Fix preview mode with dynamic routes in shared lambdas (#4812)
This fixes dynamic routes missing inside of shared lambdas for non-revalidate pages that leverage preview mode which causes them to not be able to render. Additional tests have also been added to ensure preview mode is working properly
2020-07-10 02:22:17 +00:00
Steven
7ad2a99cd7 Publish Canary
- @vercel/frameworks@0.0.16-canary.2
 - @vercel/build-utils@2.4.1-canary.3
 - vercel@19.1.2-canary.21
 - @vercel/client@8.1.1-canary.3
 - @vercel/next@2.6.10-canary.1
 - @vercel/static-build@0.17.5-canary.1
2020-07-09 16:42:50 -07:00
JJ Kasper
0349eea494 [next] Add pages with invalid route regexes (#4813)
This adds failing page names to our tests which should be resolved once the correct regexes is being generated for the routes-manifest in Next.js

Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
Co-authored-by: Steven <steven@ceriously.com>
2020-07-09 19:37:13 -04:00
Luc
ed4d006fb7 replace "more details" with "learn more" (#4828)
Follow up to PR #4825. Replace more "More details" with "Learn More".
2020-07-09 19:31:04 -04:00
Steven
12a9d203e9 [cli] Handle 400 errors as user errors (#4827)
When a user performs an action such as trying to add a domain they don't own, the API returns a 400-499 response code.

Previously, we would save this error in Sentry but this PR changes the behavior so that the error is printed locally for the user but not saved in Sentry.
2020-07-09 21:57:18 +00:00
Luc
ac1f4cf789 [cli] Handle API Error action property (#4825)
* handle error action

* fix test
2020-07-09 22:14:30 +02:00
Steven
b284ca350a Revert "[frameworks] Remove blitz demo (#4816)" (#4826)
This reverts commit f11eb32b2c.

Reverts PR #4816

This PR adds back the Blitz.js demo now that we confirmed the example works and is deployed to the correct account.
2020-07-09 13:28:38 -04:00
Steven
a43bf6c912 [cli][static-build] Use titlecase for "Project Settings" (#4820)
"project settings" should be "Project Settings"
2020-07-09 11:56:11 -04:00
Nathan Rajlich
62410806bb Publish Canary
- vercel@19.1.2-canary.20
 - @vercel/next@2.6.10-canary.0
2020-07-08 16:24:18 -07:00
Steven
47e3111cab [all] Change prettier config arrowParens: avoid (#4819)
In PR #4760, Prettier was upgraded to 2.0 which changed the default configuration for `arrowParens` from `avoid` to `always`. This PR changes it back to `avoid` so we don't have PRs changing unnecessary lines during in the commit hook.

See the [Prettier 2.0 Announcement](https://prettier.io/blog/2020/03/21/2.0.0.html#change-default-value-for-arrowparens-to-always-7430httpsgithubcomprettierprettierpull7430-by-kachkaevhttpsgithubcomkachkaev) for more.
2020-07-08 18:46:48 -04:00
Nathan Rajlich
135f35002f [cli] Remove caching of vercel.json config in vc dev (#4808)
This is a re-introduction of #4697, which was reverted for performance
resons. But now that #4760 and #4793 have landed, we can enable this
behavior again.
2020-07-08 22:37:55 +00:00
Steven
ee40052cee Publish Stable
- @vercel/next@2.6.9
2020-07-08 13:53:18 -07:00
JJ Kasper
86b730c1cd Publish Canary
- vercel@19.1.2-canary.19
 - @vercel/next@2.6.9-canary.1
2020-07-08 15:08:29 -05:00
JJ Kasper
b440249c26 [next] Don't use potentially invalid routeKeys/regexes (#4803)
The first version of `routeKeys` which was Array based could contain invalid named regexes which would break the build during route validation so this disables using them in that version of the manifest instead of trying to leverage them still. It also adds an additional test fixture with this version of the manifest to ensure it is still working properly
2020-07-08 20:05:00 +00:00
Steven
5380c12569 Publish Canary
- @vercel/frameworks@0.0.16-canary.1
 - @vercel/build-utils@2.4.1-canary.2
 - vercel@19.1.2-canary.18
 - @vercel/client@8.1.1-canary.2
 - @vercel/next@2.6.9-canary.0
2020-07-08 11:27:30 -07:00
Steven
f11eb32b2c [frameworks] Remove blitz demo (#4816)
This is not ready yet. We need to confirm Blitz is working before we deploy the demo.
2020-07-08 14:19:55 -04:00
Brandon Bayer
3d40e343ac [frameworks][examples] Add Blitz.js (#4465)
This adds [Blitz.js](https://github.com/blitz-js/blitz) to the zero-config frameworks.

Blitz compiles to a Next.js app, so it uses the same `@vercel/next` builder.

The change in `packages/now-build-utils/src/detect-builders.ts` was made according to @styfle's suggestion in Slack.

---

**This is a rerun of #4219 which had to be reverted because of this:**

> It looks like the @vercel/next package still requires next in the dependencies.
>
> When I've deployed the example I've got only a file listing, but when I added next to the dependencies it worked. I'll revert for now.

This new PR fixes that problem with a small refactor to `@vercel/next`.

`@vercel/next` was getting the Next version two different ways:

1. By checking project root package.json for `next` in deps or devDeps
2. By trying to resolve the installed next version and get `version` from its package.json

My refactor consolidates those two approaches by changing the existing `getNextVersion()` function to first try and resolve the real next version. If that fails, fall back to checking the project root.

Blitz bundles Next, so the real next package version should always be resolved.
2020-07-08 13:18:01 -04:00
Nathan Rajlich
80f525796f [cli] Make filesystem globbing faster in vercel dev (#4793)
The current code uses `getAllProjectFiles()` which globs for every file
in the project, not considering the `.vercelignore` file and default
ignore list. For example, every file in the `node_modules` directory is
selected, just for `vercel dev` to manually ignore them afterwards,
which is very slow and wasteful. For a simple Next.js project, this
globbing was taking over 3 seconds on my machine 🤯!

Solution is to use the `staticFiles()` function which is the same as
`vercel dev` uses at boot-up time. This function properly considers the
ignore list and thus is much faster, and the manual filtering is no
longer necessary by `vercel dev`. For the same simple Next.js project,
this function takes on average 10 milliseconds.

Also did a bit of cleanup and removed the `getAllProjectFiles()`
function since it is no longer used anywhere.
2020-07-07 20:30:21 +00:00
Nathan Rajlich
af4ad358f2 [cli] Print a warning if both "functions" and "builds" are defined in vercel.json in vercel dev (#4795)
This matches the error message that is used in production when using the
`vercel dev` command.
2020-07-07 19:41:29 +00:00
Nathan Rajlich
e6033d7a2d [client] Add @vercel/build-utils as a "dependency" (#4804)
Fixes: https://github.com/philcockfield/sample.vercel.client-error
2020-07-07 18:56:31 +00:00
JJ Kasper
d3148dffaa Publish Stable
- @vercel/next@2.6.8
2020-07-06 08:40:44 -05:00
JJ Kasper
30048cf4ff Publish Canary
- vercel@19.1.2-canary.17
 - @vercel/next@2.6.8-canary.7
2020-07-06 08:31:35 -05:00
JJ Kasper
07c65fa5c8 [next] Use correct data route regex (#4778)
For `getServerSideProps` routes the non-named data route was being used for routes causing dynamic route params that were being trusted from the proxy to be incorrect. Our tests weren't failing after trusting the values from the proxy was landed in Next.js on canary due to the `21-server-props` test suite not running against the latest canary which is updated in this PR. 

Note: the below Next.js PR is not needed or can be reverted if this PR is landed

x-ref: https://github.com/vercel/next.js/pull/14829
2020-07-05 21:13:01 +00:00
Nathan Rajlich
411ec64986 [cli] Reduce number of times getNowConfig() is invoked in vercel dev (#4760)
* [cli] Reduce number of times `getNowConfig()` is invoked in `vercel dev`

When using the `vercel dev` command, the `getNowConfig()` function was
being invoked many times per HTTP-request. It should only be read _once_
per HTTP request as it may be an expensive function depending on the
project size.

This change reduces the number of times the function is called to once
per HTTP request, and passes around the resulting `nowConfig` object to
the functions that require it.

* Fix default values

* Remove unnecessary type narrowing

* Remove one more `getNowConfig()` invocation

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-07-02 17:25:07 -07:00
Joe Haddad
e4d2cc704c Add Lockfile to Fix Gatsby Example (#4771)
This adds the Lockfile from Gatsby's official starter to fix deployments.

```
❯ npx gatsby-cli new ~/Desktop/scratch/test-default
❯ cp ~/Desktop/scratch/test-default/yarn.lock examples/gatsby
❯ cd examples/gatsby
❯ yarn
❯ git add examples/gatsby/yarn.lock
```
2020-07-02 21:06:44 +00:00
Joe Haddad
38db720586 Regenerate yarn.lock file (#4769) 2020-07-02 11:20:35 -07:00
Joe Haddad
c26c7886be [next] Skip Lambda Deployment for Static Sites (#4748) 2020-07-02 11:51:02 -04:00
JJ Kasper
b0e5d308ca [next] Add additiontal test cases for basePath support (#4747)
This adds some additional test cases for `basePath` support in Next.js to ensure it is working properly with `@vercel/next`
2020-07-02 09:40:15 +00:00
JJ Kasper
609b98cc73 Publish Canary
- vercel@19.1.2-canary.16
 - @vercel/next@2.6.8-canary.6
2020-07-01 14:46:28 -05:00
JJ Kasper
e0ec6c792b [next] Re-enable shared lambdas by default (#4757)
This re-enables the shared lambdas optimization by default and also adds additional tests to ensure that when a `now.json` or `vercel.json` contains either `routes` or `functions` configs the shared lambda optimization is disabled. 

Additional test deployments done:

- minimal `now.json` with `builds` config [deploy](https://shared-lambdas-tests-d646fsqju.vercel.app)
- `now.json` with `functions` config [deploy](https://shared-lambdas-tests-ahnuosp4s.vercel.app)
- `now.json` with `routes` config [deploy](https://shared-lambdas-tests-gulam3jda.vercel.app)
- minimal `vercel.json` with `builds` config [deploy](https://shared-lambdas-tests-7ic7wzirs.vercel.app)
- `vercel.json` with `functions` config [deploy](https://shared-lambdas-tests-7ic7wzirs.vercel.app)
- `vercel.json` with `routes` config [deploy](https://shared-lambdas-tests-rja2391tq.vercel.app)
2020-07-01 19:44:09 +00:00
Nathan Rajlich
b29db2fd1d [cli] Pin @vercel/static-build to v0.17.5-canary.0 (#4751)
It got de-synced in fa0f1b90b4.
2020-07-01 10:59:22 -07:00
JJ Kasper
b604ced99d Publish Canary
- vercel@19.1.2-canary.15
 - @vercel/next@2.6.8-canary.5
2020-07-01 10:53:18 -05:00
JJ Kasper
b7fd69517e [next] Fix dynamic route mapping with shared lambdas (#4740)
This fixes mapping dynamic routes to their shared lambdas failing from the `dynamicPageLambdaRoute` not being injected directly after the dynamic route due to dynamic routes now containing a `query` which caused the route lookup to fail. 

This is resolved by making sure to parse the pathname while injecting the `dynamicPageLambdaRoute` so the route can be looked up correctly. This also adds additional test cases to prevent regressing on this along with updating existing fixtures for custom routes being de-experimentalized
2020-07-01 07:30:41 +00:00
Nathan Rajlich
4c821a6fb5 Publish Canary
- vercel@19.1.2-canary.14
 - @vercel/node@1.7.2-canary.1
 - @vercel/static-build@0.17.5-canary.0
2020-06-30 16:27:46 -07:00
Nathan Rajlich
5c4fb319af [cli] Revert "Remove caching of vercel.json config in vc dev" (#4749)
This reverts commit ffb98781f1 (#4697),
because it was realized that `vc dev` reads this configuration file many
times per HTTP request, causing the server to feel extremely slow.

Reverting this optimization for now until the over-reading issue is
addressed.
2020-06-30 16:26:56 -07:00
Nathan Rajlich
fbe9ea0750 [node] Set the TypeScript "target" in vc dev (#4728)
Fixes: https://github.com/vercel/vercel/discussions/4724
2020-06-30 16:07:04 -07:00
Andy Bitz
fa0f1b90b4 Publish Stable 2020-06-30 23:33:47 +02:00
Andy Bitz
2daa0e28d3 Publish Canary
- @vercel/frameworks@0.0.16-canary.0
 - vercel@19.1.2-canary.13
 - @vercel/static-build@0.17.4-canary.1
2020-06-30 13:21:02 +02:00
Andy
48358b4986 [@vercel/build-utils] Cache .cache for Eleventy (#4743) 2020-06-30 12:54:44 +02:00
Steven
c59f44a63b [frameworks] Fix build command placeholder nuxt generate (#4737)
The Nuxt placeholder was wrong, it should be `nuxt generate` like the build command here: ca27864201/packages/now-static-build/src/frameworks.ts (L516)
2020-06-29 11:59:34 -04:00
Joe Haddad
ca27864201 Update "description" in package.json for Vercel (#4735) 2020-06-28 22:05:30 -07:00
Steven
6c81a87338 Publish Canary
- vercel@19.1.2-canary.12
 - @vercel/static-build@0.17.4-canary.0
2020-06-27 01:02:10 -04:00
Steven
a7bef9387b [static-build] Fix error handling for unexpected output directory (#4727)
This PR improves the error handling when a zero config framework has an unexpected output directory.

Previously, setting a Docusaurus 2.0 build command to `docusaurus build && mv build foo` would fail with the following:

```
Error: ENOENT: no such file or directory, scandir '/vercel/514ce14b/build'
```

With this PR, the error message will show the expected:

```
Error: No Output Directory named "build" found after the Build completed. You can configure the Output Directory in your project settings. Learn more: https://vercel.com/docs/v2/platform/frequently-asked-questions#missing-public-directory
```

I also changed the usage of [`promisify(fs)`](https://nodejs.org/docs/latest-v10.x/api/util.html#util_util_promisify_original) to [`fs.promises`](https://nodejs.org/docs/latest-v10.x/api/fs.html#fs_fs_promises_api) which is available in Node 10 or newer.

Lastly, I updated the test suite to check if the correct error message is returned for builds we expect to fail.
2020-06-26 23:56:45 -04:00
Nathan Rajlich
65d6c5e1f4 [cli] Use the configured "Output Directory" from project's settings in vc dev (#4715)
Previously, when a project has a specific "Output Directory" configured
in the project settings page, it was not being correctly considered when
using `vercel dev`.

The main fix here is passing in the full project settings object
(including the `outputDirectory`) to the `detectBuilders()` function.

Also cleaned up a few types and updated the error message that was
previously being rendered to use a short link.
2020-06-26 16:07:07 -07:00
Steven
c09355fdb3 Publish Canary
- vercel@19.1.2-canary.11
 - @vercel/client@8.1.1-canary.1
2020-06-26 13:11:05 -04:00
Steven
d9ac4c45e1 [cli] Fix vc dev serving pure static dot files (#4714)
Fixes ch1233 and discussion #4475
2020-06-26 17:10:11 +00:00
nkzawa
c2ff95714f Publish Canary
- @vercel/build-utils@2.4.1-canary.1
 - vercel@19.1.2-canary.10
 - @vercel/client@8.1.1-canary.0
 - @vercel/go@1.1.3-canary.1
 - @vercel/next@2.6.8-canary.4
2020-06-26 13:47:50 +09:00
Naoyuki Kanezawa
a51feb7a62 add source prop when deploying (#4701) 2020-06-26 13:44:31 +09:00
JJ Kasper
ff10918230 [next] Memoize lstating files (#4712)
Closes: https://github.com/vercel/next.js/issues/14429
2020-06-25 22:55:09 +00:00
Nathan Rajlich
04bea1e3cd [go] Implement startDevServer() function (#4662)
Due to Go's peculiar package importing structure, there's unfortunately no way to _directly_ invoke a Go serverless file, so the approach for this `startDevServer()` function is:

 * Create a temp directory in `.vercel/cache`
 * Run the `analyze` Go program on the entrypoint file to determine the `functionName`
 * Copy the entrypoint file into the temp directory, while modifying it to use `package main`
 * Copy the `dev-server.go` file into the temp directory, replacing the placeholder function name with the `functionName` retrieved from the analysis step from before
 * Execute `go run $tmp_dir` to spawn the Go HTTP server on an ephemeral port
 * Return the Go process id and port number for `vercel dev` to proxy to
 * After the Go process has exited, delete the temp directory
2020-06-24 19:50:00 +00:00
Milan Felix Šulc
bc5e5e8a9c [tests] Change now-php to vercel-php (#4710) 2020-06-24 11:58:17 -07:00
JJ Kasper
2e647175f5 Publish Canary
- vercel@19.1.2-canary.9
 - @vercel/next@2.6.8-canary.3
2020-06-24 10:20:04 -05:00
JJ Kasper
1a4e1d2fdd [next] Update revalidate tests and correct shared lambdas revalidate (#4704)
This adds more fine grained tests for our revalidate behavior to ensure pages are actually being updated instead of only checking the headers, it also corrects page lookups failing with shared lambdas enabled for dynamic pages using revalidate. 

Closes: https://github.com/vercel/next.js/issues/14497
2020-06-24 14:53:43 +00:00
Steven
49e2274d81 Publish Canary
- @vercel/build-utils@2.4.1-canary.0
 - vercel@19.1.2-canary.8
2020-06-24 09:24:46 -04:00
Steven
9af3938544 [cli][build-utils] Refactor ajv error message (#4705)
This PR is a follow up to #4694 so we can use this same helper function in the API.

I tried to follow the existing error message format so that the API can use a different prefix than the CLI.

The API currently returns a 400 with `Invalid request` when a Git deploy fails validation:

![api-comment](https://user-images.githubusercontent.com/229881/85466548-1c140b00-b578-11ea-9bed-1eb14df2685a.png)
2020-06-24 13:23:51 +00:00
Nathan Rajlich
7b5bf061c2 Publish Canary
- vercel@19.1.2-canary.7
 - @vercel/go@1.1.3-canary.0
2020-06-22 19:12:28 -07:00
Nathan Rajlich
ffb98781f1 [cli] Remove caching of vercel.json config in vc dev (#4697)
Since the filesystem watcher may be slow, it's actually faster and more
reliable to simply re-read the `vercel.json` configuration for every
HTTP request. This also simplifies the logic as an added benefit.

Some `sleep()` calls are removed from relevant tests that were
previously necessary due to the lag in the filesystem watcher.
2020-06-22 23:45:23 +00:00
Steven
3411fcbb68 Publish Canary
- vercel@19.1.2-canary.6
2020-06-22 18:42:23 -04:00
Steven
55cfd33338 [cli] Improve validation error message for vercel.json (#4694)
This PR improves the validation error message when the user has an invalid `vercel.json` file.

Previously, the error message did not account for nested properties so `{"foo": "will error"}` looked fine because it would mention there is an additional property `foo`. However, the error message for `{ "routes": [{ "foo": "will error" }] }` did not mention anything about `routes` when it explaining there was an additional property `foo`. This became more apparent as we added nested properties for `rewrites` and `redirects` (see tests in this PR).

This PR also adds suggestions for common mistakes such as `src` vs `source`.
2020-06-22 22:38:13 +00:00
JJ Kasper
93a9e5bed3 Publish Canary
- vercel@19.1.2-canary.5
 - @vercel/next@2.6.8-canary.2
2020-06-22 16:38:23 -05:00
JJ Kasper
b454021234 [next] Update tests to run against latest canary (#4682)
In the latest canary of Next.js pages are no longer nested under the `BUILD_ID` folder and instead are nested under a hash for the page bundle content. To prevent these tests from breaking too often from changes in canary this updates to locate the page bundle using the `buildManifest`. This also updates our latest SSG fixture to test against the latest canary to help ensure the feature doesn't break with a new canary release
2020-06-22 21:31:37 +00:00
Nathan Rajlich
bb705cd091 [docs] Refactor "Developing a Runtime" docs and add startDevServer() (#4675)
Co-authored-by: Steven <steven@ceriously.com>
2020-06-22 13:41:10 -07:00
Naoyuki Kanezawa
0986f4bcb6 [cli] Do not confirm vc env pull overwrite if created by CLI (#4678)
Append `# Created by Vercel CLI` to the head of `.env` file and automatically overwrite the file if it's there next time without confirmation.

https://app.clubhouse.io/vercel/story/316
2020-06-22 18:47:34 +00:00
Steven
83f77223aa Publish Canary
- vercel@19.1.2-canary.4
2020-06-19 16:23:32 -04:00
Steven
effda1fa6c [cli] Fix error message when no internet connectivity (#4687)
This PR fixes the error message when the client does not have internet connectivity or perhaps DNS is misconfigured such that the hostname cannot be resolved.
2020-06-19 15:57:26 -04:00
Steven
2ab6a7ef0c Publish Canary
- vercel@19.1.2-canary.3
 - @vercel/next@2.6.8-canary.1
2020-06-18 19:57:28 -04:00
Jean Helou
200bf5e996 [next] Fix nextjs routes in vercel dev (#4510)
This PR fixes #4239 where using `vercel dev` to work on monorepos where
the Next.js app is not in the topmost directory fails to correctly route
to dynamic pages.
After investigating the devServer router, @styfle prompted me to
investigate the @vercel/next builder. He also suggested restricting
`check` to be false only when running in `now dev`.

Co-authored-by: Steven <steven@ceriously.com>
2020-06-18 19:28:53 -04:00
Steven
94ab2512e9 Publish Canary
- vercel@19.1.2-canary.2
 - @vercel/ruby@1.2.3-canary.0
2020-06-18 17:19:29 -04:00
Jared White
da3207278e [ruby] Fix for UTF-8 responses in Ruby functions (#4593)
There's an unexpected string encoding issue with `Net::HTTP`, so this is a workaround. Further details:
https://bugs.ruby-lang.org/issues/15517

Co-authored-by: Steven <steven@ceriously.com>
2020-06-18 17:12:28 -04:00
nkzawa
8e10a82b43 Publish Canary
- vercel@19.1.2-canary.1
2020-06-18 20:24:49 +09:00
Naoyuki Kanezawa
d7731d191b Fix to not render no token error, prompt login instead (#4659)
When `auth.json` exists but no `token` property exists in it, we currently render error like the following screenshot.
<img width="488" alt="Screen Shot 2020-06-15 at 21 32 55" src="https://user-images.githubusercontent.com/775227/84657782-cd4eeb80-af4f-11ea-901d-2ad4b52b6667.png">

This PR fixes to prompt login instead.
<img width="994" alt="Screen Shot 2020-06-15 at 21 28 09" src="https://user-images.githubusercontent.com/775227/84657706-aa243c00-af4f-11ea-915e-4ada7de9c467.png">
2020-06-17 17:20:08 +00:00
Steven
0f5f99e667 Publish Canary
- vercel@19.1.2-canary.0
 - @vercel/next@2.6.8-canary.0
 - @vercel/node@1.7.2-canary.0
2020-06-16 17:41:45 -04:00
Steven
93a7831943 [node][next] Bump node-file-trace to 0.6.5 (#4667)
Bump `node-file-trace` to version [0.6.5](https://github.com/vercel/node-file-trace/releases/tag/0.6.5) to fix a webpack wrappers bug
2020-06-16 21:41:13 +00:00
Steven
0eacbeae11 Publish Stable
- vercel@19.1.1
 - @vercel/next@2.6.7
 - @vercel/node@1.7.1
 - @vercel/static-build@0.17.3
2020-06-16 13:09:42 -04:00
Steven
e50417dc47 Publish Canary
- vercel@19.1.1-canary.4
 - @vercel/static-build@0.17.3-canary.0
2020-06-16 08:55:29 -04:00
Paco
4840a25d30 [static-build] Apply Gatsby default caching routes automatically (#4645)
CH-702
Fixes #3331

If the file generated by `gatsby-plugin-now` does not exist, we'll set up these routes automatically.
2020-06-15 22:15:14 +00:00
Steven
785e91979d Publish Canary
- vercel@19.1.1-canary.3
 - @vercel/next@2.6.7-canary.1
 - @vercel/node@1.7.1-canary.1
2020-06-15 16:46:03 -04:00
Steven
7a776c54b8 [node][next] Bump node-file-trace to 0.6.4 (#4617)
Bump node-file-trace to fix a webpack tracing bug that looks like the following:


```
TypeError: Cannot read property 'type' of null
    at handleWrappers (/vercel/e77875438c1cd74b/.build-utils/.builder/node_modules/@vercel/next/dist/index.js:12763:58)
    at module.exports.447.module.exports (/vercel/e77875438c1cd74b/.build-utils/.builder/node_modules/@vercel/next/dist/index.js:14674:3)
    at Job.emitDependency (/vercel/e77875438c1cd74b/.build-utils/.builder/node_modules/@vercel/next/dist/index.js:11730:40)
    at /vercel/e77875438c1cd74b/.build-utils/.builder/node_modules/@vercel/next/dist/index.js:11755:20
    at async Promise.all (index 9)
    at async Job.emitDependency (/vercel/e77875438c1cd74b/.build-utils/.builder/node_modules/@vercel/next/dist/index.js:11736:5)
    at async Promise.all (index 1)
    at async Object.module.exports.328.module.exports [as default] (/vercel/e77875438c1cd74b/.build-utils/.builder/node_modules/@vercel/next/dist/index.js:11514:3)
    at async Object.module.exports.178.exports.build (/vercel/e77875438c1cd74b/.build-utils/.builder/node_modules/@vercel/next/dist/index.js:6076:69)
    at async buildStep (/var/task/sandbox-worker.js:20407:20)
```

- [0.6.2](https://github.com/vercel/node-file-trace/releases/tag/0.6.2)
- [0.6.3](https://github.com/vercel/node-file-trace/releases/tag/0.6.3) 
- [0.6.4](https://github.com/vercel/node-file-trace/releases/tag/0.6.4)

Depends on #4355
2020-06-15 20:45:15 +00:00
JJ Kasper
997031c53b [next] Update handling experimental basePath (#3791)
As mentioned by @dav-is we can prefix the outputs with the `basePath` instead of using a rewrite so that we make sure to 404 when the basePath isn't prefixed on the output. This behavior is also matched in Next.js with [this PR](https://github.com/zeit/next.js/pull/9988). 

x-ref: https://github.com/zeit/now/pull/3478
2020-06-15 17:43:37 +00:00
Steven
fdee03a599 Publish Canary
- vercel@19.1.1-canary.2
2020-06-15 12:38:11 -04:00
Steven
c5a93ecdad [cli] Fix vc dev proxy to upstream frontend dev server (#4644)
This PR fixes a longstanding issue introduced in #3673 that prevents routing properties from applying to the framework's upstream dev server.

This mimic's the older proxy logic used in build matches here: 5035fa537f/packages/now-cli/src/util/dev/server.ts (L1535-L1539)

- Related to #3777
- Related to #4510
2020-06-15 16:37:08 +00:00
JJ Kasper
5a9391b7ce Publish Canary
- vercel@19.1.1-canary.1
 - @vercel/next@2.6.7-canary.0
2020-06-15 10:20:38 -05:00
JJ Kasper
99e49473b8 [next] Update dynamic route named regexes and route keys (#4355)
This updates to leverage changes from https://github.com/zeit/next.js/pull/12801 which resolves invalid named regexes being used when the segments contain non-word characters e.g. `/[hello-world]`. 

Failing page names have also been added to the `23-custom-routes-verbose` fixture. Since the routeKeys aren't applied for dynamic routes in this PR until the routes-manifest version is bumped in the latest canary of Next.js the added test cases will be passing now and should be re-run to ensure passing after a new canary of Next.js is released with the routes-manifest version bump
2020-06-15 15:15:38 +00:00
Nathan Rajlich
de1cc6f9a7 [cli] Add a test case for resolving default "typescript" version in @vercel/node (#4656)
Adds a test case for #4655 (it got auto-merged too quickly).
2020-06-14 21:52:33 +00:00
Nathan Rajlich
08eedd8f34 Publish Canary
- vercel@19.1.1-canary.0
 - @vercel/node@1.7.1-canary.0
2020-06-14 14:00:04 -07:00
Nathan Rajlich
5021a71a8e [node] Don't resolve "typescript" from the dist dir (#4655)
On Node 10, the `require.resolve()` with "paths" does not return the
proper value relative to the `node_modules` directory. To wit:

```
$ node -v
v10.16.3

$ node -p "require.resolve('typescript', { paths: [process.cwd()] })"
/Users/nrajlich/Code/vercel/vercel/packages/now-node/dist/typescript.js

$ node -v
v14.4.0

$ node -p "require.resolve('typescript', { paths: [process.cwd()] })"
/Users/nrajlich/Code/vercel/vercel/node_modules/typescript/lib/typescript.js
```

(**Note:** cwd when running these commands is the `dist` dir of `@vercel/node`)

So the solution is to just let `require.resolve()` throw an error so the
default string "typescript" is used instead of a resolved absolute path.
2020-06-14 20:47:23 +00:00
Max Leiter
56671d7c2f [tests] Don't revoke VERCEL_TOKEN after tests run (#4643)
`VERCEL_TOKEN` will no longer be invalidated during tests

Story: https://app.clubhouse.io/vercel/story/2281
2020-06-12 22:49:37 +00:00
Steven
5035fa537f [cli] Add test for gatsby cache (#4447)
This PR adds a E2E CLI test to ensure that the Gatsby example deploys correctly and that the second deployment has the proper cached directories.

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

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

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

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

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

* Pick best production project domain

* Fix currentTeam assignment

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

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

* Fix unit test

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

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

### Before

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

### After

Bad dependency:

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

No `npm` installed:

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

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

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

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

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

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

* Check in CLI as well

* Add integration test

* Add logic to `getLocalPathConfig()` as well

* Fix import path

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

* update blitz example to latest version

* change blitz dependency to be `latest`

* Update packages/frameworks/frameworks.json

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

* update logo

Co-authored-by: Andy <AndyBitz@users.noreply.github.com>
Co-authored-by: Steven <steven@ceriously.com>
2020-05-23 01:55:03 +02:00
JJ Kasper
f3c5c60786 Publish Canary
- vercel@19.0.2-canary.6
 - @vercel/next@2.6.3-canary.2
 - @vercel/python@1.2.2-canary.0
2020-05-22 12:47:08 -05:00
JJ Kasper
ca0665efcd [next] Update routes order for shared lambdas (#4428)
* Update routes order for shared lambdas

* Add test case

* update test path

* Update packages/now-next/test/fixtures/23-custom-routes-verbose-shared-lambdas/now.json

* Update headers in probes

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: Joe Haddad <joe.haddad@zeit.co>
2020-05-22 12:44:01 -05:00
Steven
2bc1f9f45e [python] Link to original PR contribution for ASGI (#4448)
This code was contributed by @nathancahill under MIT license but it is likely from the Mangum project, so we'll link to the relevant code as the original source, also MIT License.
2020-05-22 09:17:36 -04:00
Nathan Rajlich
820ecc7254 [tests] Fix Windows tests filtering logic and branch name detection (#4441)
Currently, CI is printing this:

```
Running "test-unit" on branch "(HEAD" with the following packages:
now-cli\test\dev-server.unit.js
now-cli\test\fixtures\unit\now-dev-request-body\api\data-events.js
now-cli\test\fixtures\unit\now-dev-request-body\api\req-body.js
now-node-bridge\src\bridge.ts
now-node\src\dev-server.ts
now-node\src\helpers.ts
now-node\src\launcher.ts
now-cli

[now-cli\test\dev-server.unit.js] Skipping since script "test-unit" is missing from package.json
[now-cli\test\fixtures\unit\now-dev-request-body\api\data-events.js] Skipping since script "test-unit" is missing from package.json
[now-cli\test\fixtures\unit\now-dev-request-body\api\req-body.js] Skipping since script "test-unit" is missing from package.json
[now-node-bridge\src\bridge.ts] Skipping since script "test-unit" is missing from package.json
[now-node\src\dev-server.ts] Skipping since script "test-unit" is missing from package.json
[now-node\src\helpers.ts] Skipping since script "test-unit" is missing from package.json
[now-node\src\launcher.ts] Skipping since script "test-unit" is missing from package.json
```

So, other than `now-cli` which is hard-coded to always run, no other tests were being selected on Windows. This change uses the proper path separator for the OS to fix this.

Also, the branch name detection command is changed to fix the `"(HEAD"` name that is being detected in CI.

With this change, it looks like:

```
Running "test-unit" on branch "fix/tests-windows" with the following packages:

 - now-node
 - now-cli

[now-node] Running yarn test-unit
…
[now-cli] Running yarn test-unit
…
```
2020-05-21 16:03:34 +00:00
Steven
f41899656b [cli] Update runtimes in dev should not audit (#4429)
This PR adds two additional flags to `npm install` when updating Runtimes:

- `--no-audit`:  disable sending of audit reports to the configured registries
- `--no-progress`: disable the progress bar
2020-05-20 13:39:32 +00:00
Steven
c4373cdcad Publish Canary
- vercel@19.0.2-canary.5
 - @vercel/next@2.6.3-canary.1
 - @vercel/node@1.6.2-canary.2
2020-05-19 17:38:43 -04:00
Nathan Rajlich
28502ee32f [cli] Fixes for the vc dev Runtime installation logic (#4421)
* Removes the `get-bundled-builders.ts` file, which is no longer relevant, and was causing a false-positive for `@now/build-utils`.
 * Makes the installing of `@vercel/build-utils` and `@now/build-utils` only happen if there is another Runtime to install.
 * `@vercel/build-utils` and `@now/build-utils` will now be properly checked for updates (but again, only if there is another Runtime to update).
2020-05-19 19:47:09 +00:00
Steven
740b18612f [node][next] Bump node-file-trace to 0.6.1 (#4407)
Bumps node-file-trace to version ~~[0.6.0](https://github.com/zeit/node-file-trace/releases/tag/0.6.0)~~ [0.6.1](https://github.com/zeit/node-file-trace/releases/tag/0.6.1) 

Co-authored-by: Nathan Rajlich <n@n8.io>
2020-05-19 14:50:59 -04:00
Steven
8b4dea8870 [cli] Fix vc env pull escaping quotes (#4412)
Fixes an issue from discussion #4391 so that quotes are no longer escaped per dotenv conventions.

I tested the behavior and it works correctly with Next.js and Create React App.
2020-05-19 08:37:51 -04:00
Steven
e98d24ec8b [cli] Fix vc env pull escaping quotes (#4412)
Fixes an issue from discussion #4391 so that quotes are no longer escaped per dotenv conventions.

I tested the behavior and it works correctly with Next.js and Create React App.
2020-05-19 12:37:37 +00:00
Steven
d4b32ecd6a [cli] Fix vc env pull escaping quotes (#4412)
Fixes an issue from discussion #4391 so that quotes are no longer escaped per dotenv conventions.

I tested the behavior and it works correctly with Next.js and Create React App.
2020-05-19 12:37:31 +00:00
Steven
0a62cf99ed [cli] Fix vc env pull escaping quotes (#4412)
Fixes an issue from discussion #4391 so that quotes are no longer escaped per dotenv conventions.

I tested the behavior and it works correctly with Next.js and Create React App.
2020-05-19 12:37:22 +00:00
Steven
51de339a91 [cli] Fix vc env pull escaping quotes (#4412)
Fixes an issue from discussion #4391 so that quotes are no longer escaped per dotenv conventions.

I tested the behavior and it works correctly with Next.js and Create React App.
2020-05-19 12:37:12 +00:00
Steven
0e3d904573 [cli] Fix vc env pull escaping quotes (#4412)
Fixes an issue from discussion #4391 so that quotes are no longer escaped per dotenv conventions.

I tested the behavior and it works correctly with Next.js and Create React App.
2020-05-19 12:37:03 +00:00
Steven
8c4e43935b [cli] Fix vc env pull escaping quotes (#4412)
Fixes an issue from discussion #4391 so that quotes are no longer escaped per dotenv conventions.

I tested the behavior and it works correctly with Next.js and Create React App.
2020-05-19 12:36:54 +00:00
Steven
82436a7015 [cli] Fix vc env pull escaping quotes (#4412)
Fixes an issue from discussion #4391 so that quotes are no longer escaped per dotenv conventions.

I tested the behavior and it works correctly with Next.js and Create React App.
2020-05-19 12:36:48 +00:00
Steven
70cfdc989e [cli] Fix vc env pull escaping quotes (#4412)
Fixes an issue from discussion #4391 so that quotes are no longer escaped per dotenv conventions.

I tested the behavior and it works correctly with Next.js and Create React App.
2020-05-19 12:36:36 +00:00
Steven
61c38d6823 [cli] Fix vc env pull escaping quotes (#4412)
Fixes an issue from discussion #4391 so that quotes are no longer escaped per dotenv conventions.

I tested the behavior and it works correctly with Next.js and Create React App.
2020-05-19 12:36:21 +00:00
Steven
af932e9a3e [cli] Fix vc env pull escaping quotes (#4412)
Fixes an issue from discussion #4391 so that quotes are no longer escaped per dotenv conventions.

I tested the behavior and it works correctly with Next.js and Create React App.
2020-05-19 12:36:11 +00:00
Steven
805e92579f [cli] Fix vc env pull escaping quotes (#4412)
Fixes an issue from discussion #4391 so that quotes are no longer escaped per dotenv conventions.

I tested the behavior and it works correctly with Next.js and Create React App.
2020-05-19 12:35:56 +00:00
Nathan Rajlich
548fa56803 [cli] Update "custom runtime" dev integration test to vercel-bash@3.0.7 (#4410)
`now-bash@3.0.0` is broken in production because AWS decided to remove
the `which` command from the Lambda environment for some reason. Fixed
in the latest version which uses the updated Vercel name.

Also removes the `skipDeploy: true` flag for this test, and updates the
test names to include "vercel dev" intstead of "now dev".
2020-05-18 16:32:17 -07:00
Steven
c9665b79f1 [tests] Bump cancel-workflow-action to 0.3.2 (#4411)
Bumps the `cancel-workflow-action` to version [0.3.2](https://github.com/styfle/cancel-workflow-action/releases/tag/0.3.2)
2020-05-18 22:33:09 +00:00
Nathan Rajlich
df2d56de19 [cli] Await the FS watcher closing when shutting down vc dev (#4409)
This was missing for some reason :thinking_cat:
2020-05-18 14:32:13 -07:00
Nathan Rajlich
b2eb7a0be2 [cli] Fix dev server unit tests timing out (#4408)
This is a follow-up to #4241, which apparently caused the `vc dev` unit
tests to start timing out. After some digging, it seems the root cause
is that `proxy.close()` callback is never invoked. This makes sense
because we never call `proxy.listen()` or have the `httpProxy` actually
bind to a port.
2020-05-18 20:45:40 +00:00
Steven
ce07084184 Publish Canary
- vercel@19.0.2-canary.4
2020-05-18 14:45:27 -04:00
Steven
4292a59cc0 [docs] Update issue template (#4400) 2020-05-18 11:43:26 -07:00
Matt Dunn-Rankin
3fc616d1e2 [cli] Support WebSocket upgrades in dev (#4241)
We were already using `http-proxy`'s WebSockets option, but we were missing a step! In addition to setting `{ws: true}`, you must also forward WebSocket upgrade events from the front-facing server to the proxy. [(See this example.)](https://github.com/http-party/node-http-proxy#proxying-websockets)

Previously, the proxy server and client _would_ mutually agree to "upgrade" their connection (because we set `{ws: true}`)… but then, when the client would start sending WebSocket data instead of HTTP data, our front-facing server would drop it, because we hadn't configured a place for it to go.

In this change, we configure `this.server` to forward its `upgrade` events to the proxy server.

We also refactor `proxyPass` to use the new shared `this.proxy` instance responsible for the `upgrade` events, instead of creating a new proxy instance for every request. This isn't strictly necessary, but a helpful simplification to clarify that there's no specific reason for the proxy instances to be _different_ than the instance that manages WebSocket upgrades!

This fixes #3451: CRA apps can now auto-refresh when the source code changes, and Firefox can now load the app without crashing on the 6th attempt.

Co-authored-by: Steven <steven@ceriously.com>
2020-05-18 14:42:55 -04:00
Steven
31566b376d [cli] Fix login test with mock server (#4401)
This PR adds a mock server so that `vercel login` can be tested without using the real API.
2020-05-18 14:30:41 -04:00
JJ Kasper
d6b2fb1f31 Publish Canary
- @vercel/frameworks@0.0.15-canary.0
 - @vercel/build-utils@2.3.2-canary.1
 - vercel@19.0.2-canary.3
 - @vercel/next@2.6.3-canary.0
 - @vercel/node@1.6.2-canary.1
2020-05-16 10:42:05 -05:00
JJ Kasper
87f40d98d4 [next] Update to group pages into shared lambdas (#4102)
* Add initial changes for grouping lambdas

* Handle more cases and clean up some stuff

* Remove logs from debugging

* Remove changes from testing and add page layers

* Update output tests

* Move new behavior behind flag

* Add separate tests for new behavior

* Clean-up style diffs

* Update error

* Update to separate out new behavior more

* Apply suggestions from review

Co-authored-by: Tim Neutkens <tim@timneutkens.nl>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-05-16 17:12:41 +02:00
Steven
1b809bc225 [examples] Update readme to use Vercel CLI (#4383)
Fixes an issue someone mentioned in discussion #4361
2020-05-15 19:18:17 +00:00
Steven
05539dcae7 [cli] Add logs when installing Runtimes in dev (#4393)
This PR consolidates the `npm install` for Runtimes during `vercel dev` and adds some additional logging.
2020-05-15 18:04:51 +00:00
Joe Haddad
3ad2efeb74 [next] Update "Routes Manifest" Error (#4368)
This provides the user with additional troubleshooting steps.
2020-05-15 02:11:10 +00:00
Sarup Banskota
e4833027bd [docs] Link to vercel.com (#4329)
We should add a link to vercel.com in the header section of the README — it'll direct readers to our website.
2020-05-14 23:23:25 +00:00
Steven
34a6a16a1b [tests] Update codeowners for mcsdevv (#4385)
Updating codeowners since GitHub username was changed
2020-05-14 20:55:09 +00:00
Steven
b9f7d5b9c8 [tests] Fix test tokens (#4386) 2020-05-14 21:38:43 +02:00
Andy
44105bd4e9 [frameworks] Fix Dojo logo (#4379) 2020-05-14 17:51:44 +02:00
Andy
ba09c08ce3 Adds the missing logo for the Dojo framework (#4377)
Adds the missing logo for the Dojo framework.
2020-05-14 13:43:21 +00:00
Andy
ef63247fc0 [examples][frameworks] Add missing examples and add a test to ensure every framework has an example (#4372)
* Add test to frameworks

* Add example for Docusaurus v2

* Add example for ionic-angular

* Update READMEs

* Use existing versions

* Reset yarn.lock

* Add schema validation and add missing Scully.io logo
2020-05-14 13:30:11 +02:00
Nathan Rajlich
3c75f1440d [build-utils][cli][node] Write the dev mode tsconfig.json files to .vercel/cache (#4230)
Write the generated `tsconfig.json` files that are required to do TypeScript type checking on a single file to the dev cache directory (`.vercel/cache`). This way, they are in a location that is gitignored by default, but still has `require()` access to the types that the project uses.

* `StartDevServerOptions` had to be updated to include `meta`, at which point it's identical to `BuildOptions`, so just make it a type alias instead.
* Vercel CLI is updated to pass in the `meta` object to `startDevServer`
* Vercel CLI is updated to create the `.vercel/cache` dir upon startup, if it does not already exist
* `@vercel/node` now creates the tsconfig files in the dev cache directory, using the `wx` write flags. This ensures that the file is only created once and then cached in the dev cache dir.

An example of a generated tsconfig file for endpoint `api/foo.ts`:

```json
{
  "extends": "../../tsconfig.json",
  "include": ["../../api/foo.ts"]
}
```
2020-05-14 01:15:31 +00:00
Nathan Rajlich
8db178a146 [cli] Pin @vercel/next to v2.6.2 (#4373)
To keep the `lerna` monorepo version pinning intact.

It should have been updated in c23b9ccd1d, but was not because the commit was created manually instead of with `lerna`.
2020-05-13 23:32:31 +00:00
Steven
61f87acaf4 [cli] Fix api url for vc env add (#4371)
This PR fixes a POST request url to match the [api docs](https://vercel.com/docs/api#endpoints/secrets/create-a-new-secret) recommendation so that all data is in the body, not the query string.
2020-05-13 20:47:39 +00:00
Leo Lamprecht
406f6901b4 Removed myself from CODEOWNERS (#4366) 2020-05-13 14:10:38 +02:00
Nathan Rajlich
b15b653d91 [cli] Render a note when installing Vercel CLI and Now CLI is installed (#4344) 2020-05-13 01:02:05 +00:00
Steven
fc7d6bf670 Publish Canary
- vercel@19.0.2-canary.2
 - @vercel/client@8.0.2-canary.0
 - @vercel/node-bridge@1.3.1-canary.0
2020-05-12 20:23:56 -04:00
Vincent Riemer
e774407e8a [client] Fix file tree walking ignored files (i.e. node_modules) (#4325)
Starting with version 18.0.0, there was a regression from ##3980 causing the deploy command to hang indefinitely at the file tree building stage. I triaged the issue to be that the call of `recursive-readdir` was now walking through my `node_modules` folder. This is an issue in my environment since I have a very intricate monorepo with circular symlinks in my node_modules, which causes `recursive-readdir` to go into an infinite loop.

This PR fixes this in 2 commits:
1) The first commit refactors out the file tree building logic into separate utility functions and adds unit tests to verify the expected behavior of not walking through `node_modules` (this commit's unit test run should fail as seen in checks on this PR). This commit does not change any behavior.
2) The second commit fixes the actual issue (causing the unit tests to pass again). When I was bisecting the issue between the 17.0.0 and 18.0.0 tags I noticed that trailing slashes were added to the default ignore's directory entries in `getVercelIgnore()`. I removed them to bring it back to how it was done in v17.0.0 and it resolved the issue.

Hopefully with the added unit tests this shouldn't regress in the future.

Co-authored-by: Steven <steven@ceriously.com>
2020-05-12 20:22:34 -04:00
Nathan Rajlich
d8fb474365 [node-bridge] Catch invalid HTTP request headers (#4188)
* [now-node-bridge] Catch invalid HTTP request headers

In some rare cases, the proxy layer passes what Node.js considers an
invalid HTTP request header causing the `http.request()` function to
throw an error, such as:

```
TypeError [ERR_INVALID_HTTP_TOKEN]: Header name must be a valid HTTP token ["cookie"]
```

So instead, use `req.setHeader()` API with try/catch to skip invalid
HTTP headers and print a message for the deployment logs with debugging
information. This way, the HTTP request will still go through, with
a missing header, rather than causing the whole function to 500.

* Add test

* Don't use `typeof`

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-05-12 16:52:33 -07:00
Steven
eec778b244 [cli] Add test for readme.md with now.json and vercel.json (#4357)
This PR adds a E2E test to make sure #4042 works correctly.
2020-05-12 19:50:29 -04:00
JJ Kasper
c23b9ccd1d Publish Stable
- @vercel/next@2.6.2
2020-05-12 18:23:24 -05:00
JJ Kasper
f61b36495c Publish Canary
- @vercel/build-utils@2.3.2-canary.0
 - vercel@19.0.2-canary.1
 - @vercel/next@2.6.2-canary.0
 - @vercel/node@1.6.2-canary.0
2020-05-12 17:43:17 -05:00
JJ Kasper
a1ec28ba36 Revert "[now-next] Update to pass dynamic page values in the query (#4196)" (#4358)
This reverts commit dfdef0f6fd.

# Conflicts:
#	packages/now-next/src/index.ts
2020-05-12 17:42:38 -05:00
Nathan Rajlich
97eeddb6ac [cli][node] Re-apply @TooTallNate's vc dev updates (#4254)
This reverts commit 099bc6dbf6 (#4231).
2020-05-12 13:58:05 -07:00
Steven
69b62b8101 [build-utils] Detect invalid engines pattern in package.json (#4354)
This PR improves the error message when a user provides an invalid pattern in package.json `engines` field.

## Before

```
TypeError: Invalid comparator: => 10
at Comparator.module.exports.Comparator.parse (/zeit/9cd49d8c66a9bd43/.build-utils/node_modules/@vercel/build-utils/dist/index.js:10262:11) 
at new Comparator (/zeit/9cd49d8c66a9bd43/.build-utils/node_modules/@vercel/build-utils/dist/index.js:10245:8) 
at Range.<anonymous> (/zeit/9cd49d8c66a9bd43/.build-utils/node_modules/@vercel/build-utils/dist/index.js:10439:12) 
at Array.map (<anonymous>) 
at Range.module.exports.Range.parseRange (/zeit/9cd49d8c66a9bd43/.build-utils/node_modules/@vercel/build-utils/dist/index.js:10438:13) 
at Range.<anonymous> (/zeit/9cd49d8c66a9bd43/.build-utils/node_modules/@vercel/build-utils/dist/index.js:10381:17) 
at Array.map (<anonymous>) 
at new Range (/zeit/9cd49d8c66a9bd43/.build-utils/node_modules/@vercel/build-utils/dist/index.js:10380:40) 
at Function.intersects (/zeit/9cd49d8c66a9bd43/.build-utils/node_modules/@vercel/build-utils/dist/index.js:10998:8) 
at /zeit/9cd49d8c66a9bd43/.build-utils/node_modules/@vercel/build-utils/dist/index.js:25847:29
```

## After

```
Found `engines` in `package.json` with an invalid Node.js version range: "=> 10".
Please set "engines": { "node": "12.x" } in your `package.json` file to upgrade to Node.js 12.
More details: https://vercel.com/docs/runtimes#official-runtimes/node-js/node-js-version
```

In this case, the `=>` operator is not valid so the user probably meant `>=` but we only suggest the `10.x` or `12.x` syntax because we can only guarantee a major version.
2020-05-12 14:36:01 -04:00
Steven
591c247c4e [cli] Fix update command (#4353)
The CLI name was updated but not the command.

This PR fixes the command to show the correct package name.

Fixes [PRODUCT-2905](https://vercel.atlassian.net/browse/PRODUCT-2905)
2020-05-12 15:34:02 +00:00
Nathan Rajlich
8dc3744cf3 [build-utils] Use @vercel/static for zero-config (#4345)
Now that `@vercel/static` works in production, we can update
to use it for zero-config.
2020-05-12 01:10:17 +00:00
Steven
8f108c51fa Publish Canary
- vercel@19.0.2-canary.0
2020-05-11 15:56:24 -04:00
Steven
c8e7b266bc [cli] Fix new routing props to be case sensitive (#4341)
This PR fixes a bug where `vc dev` acted differently than real deployments which are supposed to have case sensitive `rewrites` and `redirects`.
2020-05-11 19:55:11 +00:00
Steven
378d62083c [cli] Fix env commands when secret was deleted (#4340)
This PR fixes the scenario when a user adds an environment variable to a project but then deletes the secret associated with the environment variable.

For example:

```sh
echo 'foo' | vc env add FOO development
vc secrets rm foo-development-v1ln
vc env pull                # would error with 404 every time
vc env rm FOO development  # would error with 404 the first time
```

Now we'll warn for `vc env pull` and we will assume success for `vc env rm`.

Fixes https://sentry.io/organizations/zeithq/issues/1612188511/
Fixes https://sentry.io/organizations/zeithq/issues/1656997656/
2020-05-11 19:15:12 +00:00
Steven
8189fb2373 Publish Stable
- @vercel/build-utils@2.3.1
 - vercel@19.0.1
 - @vercel/client@8.0.1
 - @vercel/go@1.1.1
 - @vercel/next@2.6.1
 - @vercel/node@1.6.1
 - @vercel/python@1.2.1
 - @vercel/ruby@1.2.1
 - @vercel/static-build@0.17.1
2020-05-11 09:10:40 -04:00
Nathan Rajlich
76f544cbea Publish Canary
- @vercel/build-utils@2.3.1-canary.0
 - vercel@19.0.1-canary.0
 - @vercel/client@8.0.1-canary.0
 - @vercel/go@1.1.1-canary.0
 - @vercel/next@2.6.1-canary.0
 - @vercel/node@1.6.1-canary.0
 - @vercel/python@1.2.1-canary.0
 - @vercel/ruby@1.2.1-canary.0
 - @vercel/static-build@0.17.1-canary.0
2020-05-09 13:54:05 -07:00
Nathan Rajlich
e246d2ed71 [client] Throw an error if both .vercelignore and .nowignore exist (#4311)
* [client] Throw an error if both `.vercelignore` and `.nowignore` exist

* Remove `.`

* Add tests

* Update test

* [cli] Properly clear spinner if `createDeployment()` async generator throws an error

* Update packages/now-client/src/utils/index.ts

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

* Update packages/now-client/tests/vercelignore.test.ts

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

Co-authored-by: Steven <steven@ceriously.com>
2020-05-09 03:02:16 -07:00
Steven
ed4c759c49 [all] Fix runtimes to work with old versions of CLI (#4317)
This PR fixes an issue where old versions of the CLI would update to the latest builder, but not have a copy of `@vercel/build-utils` because they only shipped with `@now/build-utils`. So in this case, we can fallback to the other package. We must be careful to only import types from `@vercel/build-utils` and anything needed at runtime must be imported from `./build-utils` wrapper.
2020-05-09 04:00:01 +00:00
Steven
2656647891 [cli] Fix error message to display correct config name (#4309)
This PR fixes an issue when the error message assumed the config was `vercel.json` even when the user had `now.json`.

### Before

```
Error! The property `foo` is not allowed in vercel.json – please remove it.
```

### After

```
 Error! The property `foo` is not allowed in now.json – please remove it.
```

Co-authored-by: Nathan Rajlich <n@n8.io>
2020-05-08 19:45:53 -04:00
Steven
3b3c468f3a [cli] Fix deploying v1 with secrets (#4315)
This PR fixes a regression from PR #4084 where secrets were paginated so some v1 deployments that had more than 20 secrets were unable to deploy since CLI version 19.
2020-05-08 23:08:05 +00:00
Nathan Rajlich
4214de2ce0 [built-utils] Make getPlatformEnv() throw if both NOW_ and VERCEL_ are defined (#4313)
Also adds unit tests.
2020-05-08 15:17:29 -07:00
Nathan Rajlich
40b7af4349 [cli] Fix now dev infinite loop for yarn workspaces (#4310)
A couple quick fixes to `now dev` to land on stable, before #4254 gets merged for canary.
2020-05-08 20:37:20 +00:00
Steven
f4d86cb9df [now-cli] Update now env add to skip value if system var (#4306)
This PR updates the CLI to work the same as the dashboard and skip the env var value if the name indicates that it is a [System Environment Variables](https://vercel.com/docs/v2/build-step#system-environment-variables).

Co-authored-by: Luc <luc.leray@gmail.com>
2020-05-08 11:41:41 -04:00
Nathan Rajlich
0492fcb0fc [now-cli] Fix update Changelog URL (#4302)
Incorrect URL: https://github.com/zeit/now/releases/tag/now@19.0.0

Correct URL: https://github.com/zeit/now/releases/tag/vercel@19.0.0
2020-05-08 01:47:36 +00:00
Nathan Rajlich
3a217dc750 [now-build-utils] Use @vercel runtimes for zero-config (#4300)
This reverts commit 8a9b67a3f3 (#4284),
now that `@vercel` runtimes work in production.
2020-05-08 00:02:30 +00:00
Steven
b626f3fe57 Publish Stable
- @vercel/frameworks@0.0.14
 - @vercel/build-utils@2.3.0
 - @vercel/cgi@1.0.5
 - vercel@19.0.0
 - @vercel/client@8.0.0
 - @vercel/go@1.1.0
 - @vercel/next@2.6.0
 - @vercel/node-bridge@1.3.0
 - @vercel/node@1.6.0
 - @vercel/python@1.2.0
 - @vercel/routing-utils@1.8.2
 - @vercel/ruby@1.2.0
 - @vercel/static-build@0.17.0
2020-05-07 18:52:35 -04:00
Steven
96bc0c9bee Publish Canary
- vercel@18.0.1-canary.24
2020-05-07 17:56:40 -04:00
Steven
f4ff8c0268 [now-cli] Change precedence of auth directory (#4299) 2020-05-07 23:55:35 +02:00
Steven
1a5681f287 [now-cli] Add getTitleName() and update getCommandName() (#4296)
This PR adds two functions:

* `getTitleName()` - used to get the uppercase Vercel or Now package name, for example `vercel --version`
* `getCommandName()` - used to get the `vercel` command followed by subcommands, for example in error suggestions
2020-05-07 21:24:15 +00:00
Ana Trajkovska
88b66ae646 Publish Canary
- vercel@18.0.1-canary.23
2020-05-07 22:37:48 +02:00
Ana Trajkovska
db0124782a Implement pagination for vercel teams ls (#4294)
* Implement pagination for `now teams ls`

* Set default empty object

* Use output logger

* Trigger build
2020-05-07 22:36:54 +02:00
Nathan Rajlich
a7a5d4d169 [now-cli] Special case @vercel/static when updating builders (#4295) 2020-05-07 19:40:52 +00:00
Nathan Rajlich
4b39e96c28 Ensure the npm registry is used during "Publish" workflow (#4286)
Unset the `npm_config_registry` env var which yarn overwrites to the
yarn registry, which we don't want since the `.npmrc` file that gets
created is configured to the npm registry.
2020-05-07 19:00:16 +00:00
Steven
f459db9f83 [now-cli] Add e2e test for vercel.json and .vercelignore (#4292)
This PR adds a test for a deployment as well as `now dev` to ensure both `vercel.json` and `.vercelignore` are applied.

I also fixed the remaining test helpers to work with `vercel.json`.
2020-05-07 18:04:37 +00:00
Ana Trajkovska
ad19021969 Publish Canary
- vercel@18.0.1-canary.22
2020-05-07 18:54:37 +02:00
Ana Trajkovska
95e41874e4 Replace now with vercel in pagination message (#4290) 2020-05-07 18:49:15 +02:00
Ana Trajkovska
4d20a1d77b Publish Canary
- vercel@18.0.1-canary.21
2020-05-07 14:56:28 +02:00
Ana Trajkovska
325ee261cb Implement pagination for now dns ls (#4257) 2020-05-07 14:53:08 +02:00
Nathan Rajlich
2e0cee490d Publish Canary
- @vercel/build-utils@2.2.2-canary.8
 - vercel@18.0.1-canary.20
 - @vercel/client@7.1.1-canary.5
 - @vercel/go@1.0.8-canary.2
 - @vercel/next@2.5.5-canary.7
 - @vercel/node@1.5.2-canary.9
 - @vercel/python@1.1.7-canary.3
 - @vercel/ruby@1.1.1-canary.2
 - @vercel/static-build@0.16.1-canary.6
2020-05-06 22:16:10 -07:00
Nathan Rajlich
8a9b67a3f3 [now-build-utils] Use @now runtimes for zero-config (#4284)
* [now-build-utils] Use `@now` runtimes for zero-config

This is a temporary change until the `@vercel` runtimes work in
production.

* Temporary fix to E2E
2020-05-06 22:09:06 -07:00
Nathan Rajlich
f1d9a5da96 [now-build-utils][now-cli] Fix isOfficialRuntime() edge case bug (#4282)
Fixes a bug where `isOfficialRuntime('static', '@now/static-build')` was returning `true` when it should have been `false`.

And use the function from `@vercel/build-utils` in Vercel CLI.
2020-05-07 03:33:35 +00:00
Nathan Rajlich
8d9c463e1f [now-cli] Update references to Now CLI as Vercel CLI (#4279)
Update references to Now CLI as Vercel CLI 

Co-authored-by: Steven <steven@ceriously.com>
2020-05-06 21:15:20 -04:00
Steven
e07e8f841a [now-cli] Add special case for .vercel.app (#4281)
There are a few places the CLI needs to know about the special suffix `.now.sh` so we also need to include the upcoming `.vercel.app` suffix.
2020-05-07 01:09:21 +00:00
Steven
0b8a2c0dab [now-cli] Update README.md image (#4278)
This PR updates the name, logo, and tagline.

This will look correct in both light mode and dark mode and the text is no longer part of the image.
2020-05-06 19:44:24 -04:00
Shu Ding
9c2b7132fa add cors headers (#4280) 2020-05-07 07:40:29 +08:00
Steven
d4639a5108 [now-cli] Rename bin to support vercel and vc (#4277)
We want to make sure the bin matches the [installed package name](https://docs.npmjs.com/files/package.json#bin).

This means `npm i -g now` will remain `now` and `npm i -g vercel` will use `vercel` as the binary name.

This allows support for different versions on one machine such as `npm i -g now@17 vercel@19` for example.

In addition, we will also install a shorthand `vc` so you can do `vc env pull` for example.
2020-05-06 23:12:06 +00:00
Steven
ba25004ea8 [all] Check for VERCEL_ environment variables with getPlatformEnv() (#4274)
Added the following env vars, most are undocumented but its good to be consistent:

- `VERCEL_REGION`
- `VERCEL_DEBUG`
- `VERCEL_BUILDER_DEBUG`
- `VERCEL_TOKEN`
- `__VERCEL_SKIP_DEV_CMD`

I also updated the error code prefixes to remove `NOW_`.
There `code` isn't used anywhere, this is just to make it unique and a little shorter.
2020-05-06 22:13:12 +00:00
Steven
639a9b03d2 [now-cli][now-go][now-python] Use `<project>/.vercel/cache' dir during dev (#4273)
We renamed `.now` to `.vercel` in #4234 but still fallback to `.now` if it exists. This is because we don't want users to have to re-link all their existing projects. So we need to make sure that the Runtimes know which directory to use for caching. This PR introduces the `devCacheDir` for this purpose.
2020-05-06 19:23:39 +00:00
Nathan Rajlich
28ffdfbeef Add logging to debug failed npm publish for legacy package names in CI (#4266)
As you can see in https://github.com/zeit/now/runs/647945621,
the final step for publishing the legacy `@now` packages failed
with a 401 error from npm.

This additional logging an to attempt to debug why that is happening.
2020-05-06 18:22:09 +00:00
Steven
5e222d3c03 [tests] Fix cancel workflow pattern (#4264)
Sometimes, the "Cancel" workflow wouldn't run because it didn't match the branch name.
This PR will fix the glob to match any branch name.

- `*`: Matches zero or more characters, but does not match the `/` character.
- `**`: Matches zero or more of any character.

https://help.github.com/en/actions/reference/workflow-syntax-for-github-actions#filter-pattern-cheat-sheet
2020-05-06 02:14:55 +00:00
Steven
94c8464728 [now-node][now-static-build] Add test for timezone utc (#4265)
This PR adds a couple tests to ensure that the timezone offset is `0` meaning [UTC](https://en.wikipedia.org/wiki/Coordinated_Universal_Time).
2020-05-06 01:14:35 +00:00
Nathan Rajlich
898478d1e1 Publish Canary
- @vercel/frameworks@0.0.14-canary.0
 - @vercel/build-utils@2.2.2-canary.7
 - @vercel/cgi@1.0.5-canary.1
 - vercel@18.0.1-canary.19
 - @vercel/client@7.1.1-canary.4
 - @vercel/go@1.0.8-canary.1
 - @vercel/next@2.5.5-canary.6
 - @vercel/node-bridge@1.2.7-canary.3
 - @vercel/node@1.5.2-canary.8
 - @vercel/python@1.1.7-canary.2
 - @vercel/routing-utils@1.8.2-canary.5
 - @vercel/ruby@1.1.1-canary.1
 - @vercel/static-build@0.16.1-canary.5
2020-05-05 17:11:39 -07:00
Nathan Rajlich
8a68211cad [all] Rename packages to vercel and add logic to publish legacy package names to npm (#4233)
https://vercel.com/blog/zeit-is-now-vercel

* Updates all org packages from `@now` to `@vercel`
* Updates Now CLI package name from `now` to `vercel`
  * Packages contains `"bin"` entries for _both_ `vercel` and `now` in the package.json
* Updates `now-client` package name to `@vercel/client` (org scoped, for authenticity)

There is also a new `publish-legacy.sh` script which ensures that all the legacy package names (i.e. `now`, `now-client`, `@now/node`, etc.) will still be published as well.

We will remove this legacy publishing logic on Jan 1, 2021.
2020-05-05 23:43:57 +00:00
Steven
2765207c93 Publish Canary
- @now/build-utils@2.2.2-canary.6
 - now@18.0.1-canary.18
 - now-client@7.1.1-canary.3
 - @now/routing-utils@1.8.2-canary.4
 - @now/static-build@0.16.1-canary.4
2020-05-05 15:06:47 -04:00
Steven
6b52cfdbc7 [now-cli][now-client] Add support for vercel config files (#4234)
This PR renames the CLI and config files to `vercel`.

https://vercel.com/blog/zeit-is-now-vercel

### Complete
- [x] Help menus and error messages should print cli name from `package.json`
- [x] `now.json` => `vercel.json`
- [x] `.nowignore` => `.vercelignore`
- [x] `~/.now` => `~/.vercel`
- [x] `<project>/.now/project.json` => `<project>/.vercel/project.json`

### TODO
I'm going to do the remaining work in a follow-up PR:
- [ ] `<project>/.now/cache` => `<project>/.vercel/cache` (Runtimes sometimes use this)
- [ ] `NOW_*` special cased environment variables
- [ ] `*.now.sh` special cased url suffix
2020-05-05 14:58:05 -04:00
Ana Trajkovska
f474fa1b8c Publish Canary
- now@18.0.1-canary.17
2020-05-05 01:48:14 +02:00
Ana Trajkovska
2cdee19804 [now-cli] Implement pagination for now env ls (#4200)
This PR implements pagination for listing environment variables for a project.
2020-05-04 23:47:05 +00:00
Steven
e9066a3ead Publish Canary
- @now/build-utils@2.2.2-canary.5
 - now@18.0.1-canary.16
 - @now/node@1.5.2-canary.7
2020-05-04 14:37:51 -04:00
Luc
1461fbe331 [tests] add "no only" and "no skip" eslint rules (#4229)
* add "no only" and "no skip" eslint rules

* ignore irrelevant eslint error

Co-authored-by: Steven <steven@ceriously.com>
2020-05-02 11:35:49 +02:00
Nathan Rajlich
099bc6dbf6 Temporarily revert @TooTallNate's now dev updates (#4231)
Needs more time for testing, and we are preparing a new stable release.

This will be un-reverted after the stable release is tagged.
2020-05-02 00:52:21 +00:00
Steven
fe0d762aca Revert "[now-routing-utils] Fix redirect // when cleanUrls and trailingSlash enabled" (#4232)
Reverts zeit/now#4227

This somehow got merged even though the tests didn't pass. Reverting until it can be merged cleanly.
2020-05-01 22:59:53 +00:00
Steven
07c9c0bb6e [now-routing-utils] Fix redirect // when cleanUrls and trailingSlash enabled (#4227)
This PR fixed a corner case when the user defined both `cleanUrls: true` and `trailingSlash: true` and then visited `/index.html` which would attempt to redirect to the invalid `//` path.
2020-05-01 20:44:39 +00:00
Steven
243018b736 [now-cli] Fix CORS headers in now dev (#4225)
This PR fixes a bug where the headers were not applied when exiting with a status code such as 204.

This is a common pattern for CORS where you want `OPTIONS` method respond with 204 status due to a preflight request.

I also updated the test suite to support the `method` property and ensured a body with empty string is asserted.
2020-05-01 14:29:36 -04:00
JJ Kasper
99436b986a Publish Canary
- @now/build-utils@2.2.2-canary.4
 - now@18.0.1-canary.15
 - now-client@7.1.1-canary.2
 - @now/next@2.5.5-canary.5
 - @now/node@1.5.2-canary.6
 - @now/static-build@0.16.1-canary.3
2020-05-01 13:23:17 -05:00
JJ Kasper
dfdef0f6fd [now-next] Update to pass dynamic page values in the query (#4196)
As discussed this updates to leverage the new named regexes and route keys output in the `routes-manifest.json` to pass the dyname page values in the query to ensure we're handling edge cases with the new custom routes support

Note: the `yarnPreferOffline` change is unrelated and was added to make debugging easier as the build can fail when using this option and the cache is invalid for some packages. 

x-ref: https://github.com/zeit/next.js/pull/12250
2020-05-01 18:08:09 +00:00
Steven
921327d878 [api] Update build script (#4224)
In PR #3514, we added a `/api` directory for functions and a `/public` directory which was created at build time.

This moves the build script to be `now-build` so we don't don't need to build everything in the repo and also no longer need to special case the git env vars.
2020-05-01 09:42:40 -04:00
Arunoda Susiripala
c48fd3e891 Update README.md 2020-05-01 12:18:51 +05:30
Nathan Rajlich
5142e32bed [now-cli] Update now dev HTML templates to use "Vercel" (#4216) 2020-05-01 00:25:01 +00:00
Steven
d360169b06 [now dev] Fix handle: miss override headers (#4217)
Fixes a bug with `now dev` where headers from the `miss` phase were overriding when they shouldn't be.

```json
{
  "version": 2,
  "routes": [
    {
      "handle": "filesystem"
    },
    {
      "src": "/([^/]+)",
      "headers": { "override": "one" },
      "dest": "/blog/$1",
      "check": true
    },
    {
      "handle": "miss"
    },
    {
      "src": "/(.*)",
      "dest": "/src/$1",
      "check": true
    },
    {
      "src": "/src/blog/([^/]+)",
      "headers": { "test": "1", "override": "two" },
      "dest": "/src/blog/$1.html",
      "check": true
    }
  ]
}
```
2020-04-30 23:51:02 +00:00
Nathan Rajlich
7b1893b9f7 [now-node] Use project env vars in startDevServer() and respect NODEJS_HELPERS env var (#4211)
Depends on #4210.
2020-04-30 15:12:46 -07:00
Steven
fb07360b71 [tests] Run now dev tests agains real deployments (#4183)
This PR makes sure that all the `now dev` tests have a corresponding deployment and each assert is also compared to the deployment.

If you want to opt-out of this behavior, for example a test that is meant for specific dev functionality, then there is an option `skipDeploy: true`.

This also fixes a bug where headers were not assigned during proxying to a dev server.
2020-04-30 17:36:32 -04:00
Nathan Rajlich
3a00aed989 [now-cli] Pass in env vars to startDevServer() in now dev (#4210)
The Runtime is expected to set up these env vars in the dev server
child processes that it spawns.
2020-04-30 14:32:29 -07:00
JJ Kasper
64944f8926 [now-cli] (Major) Upload .env files but ignore .local files (#4205)
As discussed this updates to no longer ignore all `.env` files by default and only ignores local env files which matches what we default the `.gitignore` to in our default `create-next-app` [template](20b62de8d7/packages/create-next-app/templates/default/gitignore (L26-L30))

A separate docs PR has been made here https://github.com/zeit/docs/pull/1808 which can be landed after this PR
2020-04-30 21:13:53 +00:00
Nathan Rajlich
5e4eee4db1 [now-cli] Only update build matches once per HTTP request (#4212)
Minor optimization since the "serve" function sometimes gets invoked
recursively.
2020-04-30 20:34:30 +00:00
Nathan Rajlich
a1a5e0ef0d [now-node] Make "without helpers" config option work as expected in startDevServer() (#4208) 2020-04-30 10:49:29 -07:00
Steven
91b9b7f880 Publish Canary
- now@18.0.1-canary.14
 - @now/node@1.5.2-canary.5
2020-04-30 09:20:16 -04:00
Nathan Rajlich
8e29924165 [now-node] Add TypeScript support to startDevServer() (#4185)
Using `ts-node`, with asynchronous type checking via `tsc --no-emit`.

This also removes `ncc` of `typescript` during the build in favor of
having typescript be a regular npm "dependency".
2020-04-30 09:19:30 -04:00
Luis Alvarez D
9083b558f0 Switch to Vercel in the command help for now domains (#4193)
Noticed that we still say `Zeit` while using the now cli.

The inspect command still points to zeit.co when I tested it some hours ago but that seems to be fixed already 😄
2020-04-29 18:19:16 +00:00
Ana Trajkovska
0bf8c3751b Publish Canary
- @now/cgi@1.0.5-canary.0
 - now@18.0.1-canary.13
 - now-client@7.1.1-canary.1
 - @now/next@2.5.5-canary.4
 - @now/node-bridge@1.2.7-canary.2
 - @now/node@1.5.2-canary.4
 - @now/python@1.1.7-canary.1
2020-04-29 12:52:06 +02:00
Ana Trajkovska
3ef832fdbe [now-cli] Implement pagination for now projects ls (#4186)
* Implement pagination for `now projects ls`

* Fix spacing
2020-04-29 12:50:05 +02:00
Nathan Rajlich
4bc6ebe286 [now-cli] Assert 200 status code in dev server unit tests (#4184) 2020-04-28 15:42:25 -07:00
Steven
5660474739 [tests] Remove test.only() so all tests will execute (#4180)
Fix a regression from #4160, specifically bab5794641acbf2ae3f419faf0b1d3565fbf1de3 that was preventing the CLI tests from running.
2020-04-28 19:52:38 +00:00
Nathan Rajlich
e85a62703c [now-cli] Use yarn for now dev integration tests (#4175)
This was switched to `npm` for debugging purposes in #4124, but at this
point we can switch it back to `yarn` so the tests don't take as long.

Co-authored-by: Leo Lamprecht <leo@zeit.co>
2020-04-28 21:09:49 +02:00
Steven
3a3cfd4d7b [tests] Fix remaining lint errors (#4179)
As a follow up to #4178, this fixes the final lint errors so we can run in CI.

Since lint is very quick, about 8 seconds, we can run it on the entire repo instead of only changed files.

I also disabled a couple rules that were leading to 500 warnings we would likely never change.
2020-04-28 11:37:10 -04:00
Nimish Gupta
9570d64b67 fix: removed linting errors on yarn lint (#4178) 2020-04-28 09:11:46 -04:00
Nathan Rajlich
e77ea00e9d Publish Canary
- now@18.0.1-canary.12
2020-04-27 18:22:41 -07:00
Nathan Rajlich
aebe77d222 [now-cli] Make nowCliPkg parameter non-optional (#4173)
To prevent bugs like https://github.com/zeit/now/pull/4163.
2020-04-27 18:21:05 -07:00
Nathan Rajlich
53cb2cc4c5 [now-cli] Don't print "Error starting dev server" message by default (#4172)
It's not useful information and distracts from whatever the actual error
message was from the dev server, which is what the user is actually
interested in.
2020-04-28 01:20:33 +00:00
Arunoda Susiripala
4d75ed5117 [now-cli] Allow to accept equal sign(=) as a value for meta (#4160)
Currently if the value is `=` it will throw an error from the API.
2020-04-28 00:18:51 +00:00
Nathan Rajlich
e6c84dd70b [now-cli] Add 1 minute timeout to now login integration tests (#4166) 2020-04-27 23:21:50 +00:00
Nathan Rajlich
d51f0d0f06 [now-cli] Remove "Stopping now dev server" message (#4165) 2020-04-27 15:01:23 -07:00
JJ Kasper
4cd35c48a2 Publish Canary
- now@18.0.1-canary.11
 - @now/next@2.5.5-canary.3
2020-04-27 16:48:43 -05:00
JJ Kasper
69ac4f3eb8 [now-next] Update error throwing to use NowBuildError (#4167)
Per https://github.com/zeit/now/pull/4161#discussion_r416042826 this updates to use `NowBuildError` for our errors instead of the standard `Error` instance
2020-04-27 20:40:32 +00:00
Nathan Rajlich
2c9cbe20f3 [now-cli] Fix logic to not install bundled runtimes into cache dir for now dev (#4163) 2020-04-27 12:21:29 -07:00
Ana Trajkovska
4ddd2f016c Publish Canary
- @now/build-utils@2.2.2-canary.3
 - now@18.0.1-canary.10
 - @now/next@2.5.5-canary.2
 - @now/routing-utils@1.8.2-canary.3
2020-04-27 20:56:36 +02:00
JJ Kasper
76f61cbbf0 [now-next] Provide a better error when failing to load routes-manifest (#4161)
This updates the error message shown when we fail to load the `routes-manifest` which appears to be happening most often when an incorrect output directory is configured for a Next.js application
2020-04-27 18:05:03 +00:00
YuLe
23fe8affec [now-cli] Use imported pkg instead of require("../package.json") (#4159) 2020-04-27 10:32:33 -07:00
Steven
5334caad54 [api] Use 405 method not allowed (#4148)
I was doing a diff and noticed this returns the wrong status code.

This PR changes the unknown method response to [405 Method Not Allowed](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/405) status code.
2020-04-27 11:38:22 -04:00
Steven
103e4117c3 [now-routing-utils] Add support for permanent in redirects (#4150)
This adds `permanent` for `redirects` defined in Next.js RFC https://github.com/zeit/next.js/issues/9081

```json
{
  "redirects": [
    { "source": "/foo", "destination": "/api/foo", "permanent": true }
  ]
}
```
2020-04-27 11:37:15 -04:00
Ana Trajkovska
3e774d0531 Implement pagination for now dns ls <domain> (#4134)
Co-authored-by: Nathan Rajlich <n@n8.io>
2020-04-27 15:26:53 +02:00
Nathan Rajlich
5e2139f408 Publish Canary
- now@18.0.1-canary.9
2020-04-24 17:33:32 -07:00
Nathan Rajlich
55e4bffcd2 [now-cli] Add the core Runtimes as npm dependencies for now dev (#4117)
Rather than creating a `builders.tar.gz` file with the core Runtimes and
bundling that tarball with Now CLI, simply have them be regular npm
dependencies so that they are installed into Now CLI's `node_modules`
directory.

When one of the core runtimes is specified for a build, the runtime will be
required as a regular module dependency of Now CLI, and the builders cache
will never touched.

Bundled runtimes are also no longer updated, making the runtime versions
pinned to the version of Now CLI.

Logic for the builders cache directory still remains, but will now only be
used when using a Community Runtime (or development tarball URL).
2020-04-25 00:19:58 +00:00
Nathan Rajlich
de3a066934 [now-cli] Use npx to invoke ncc in build script (#4146)
The previous file path for ncc isn't always reliable during development,
depending on which directory `yarn` is invoked in inside the monorepo.

Using `npx` ensures the version specified in the now-cli `package.json`
is used even if it's installed at the root of the monorepo.
2020-04-24 20:05:25 +00:00
Steven
257b0ca5b6 Publish Canary
- now@18.0.1-canary.8
2020-04-24 14:09:01 -04:00
Nathan Rajlich
e826d48814 [now-cli] Remove yarn as a dev dependency (#4141)
Remove yarn dependency since it is no longer used.

Co-authored-by: Steven <steven@ceriously.com>
2020-04-24 12:06:00 -04:00
Nathan Rajlich
d4ecfb04bb [now-cli] Update chokidar to v3.3.1 (#4142)
For Node 14 support:

> npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+.
> Upgrade to chokidar 3 with 15x less dependencies.
2020-04-24 09:25:21 -04:00
Steven
cad10e1918 [now-cli] (Major) Change project settings inheritance (#4135)
When Now CLI 17 introduce the `.now` directory with project settings, it started assuming that the current project scope should be used for all commands. This made `now switch` do nothing unless you changed the current directory.

This PR is a _major_ semver change so that the only commands that inherit the project settings are:

- `now deploy`
- `now dev`
- `now env`

For example, `now ls` will not observe project settings and instead observe `now switch`.
2020-04-24 13:06:01 +00:00
Nathan Rajlich
1e221c48f9 [now-cli] Ensure the builders.tar.gz file is finished extracting (#4124)
`now dev` integration tests have been failing as of recently with failures to require Runtime builders from the builder cache. Upon investigation, it turns out that the `builders.tar.gz` file was not being completely extracted since the integration tests complete quickly and then kill the Now CLI process, which has not yet completed the extraction.

Fix is to ensure the tarball extraction promise is fully resolved before cleanly shutting down.

Also now applying the clean shutdown logic upon `SIGTERM` signal, which is what the integration tests send to shut down the Now CLI process.
2020-04-23 21:49:20 +00:00
Nathan Rajlich
15221bf19c [now-cli] Add the x-vercel-id and x-vercel-cache response headers to now dev (#4137)
Matches current production.
2020-04-23 12:58:25 -07:00
Paco
2513fecaf4 [examples] Update vercel.svg in Next.js example (#4128)
* Update vercel.svg in Next.js example

* Update to thinner variant
2020-04-23 12:42:08 -07:00
Nathan Rajlich
d723d985e3 [now-cli] Prevent infinite loop for Runtime "module not found" in now dev (#4126) 2020-04-23 12:41:47 -07:00
Steven
2d0a71946b Publish Canary
- now@18.0.1-canary.7
 - @now/static-build@0.16.1-canary.2
2020-04-22 17:55:24 -04:00
Steven
4b7af4d7d3 [now-cli] Fix flicker from file upload progress bar (#4125)
This PR fixes a bug where deploying a new project would flicker between two states: the upload progress bar and "Setting up Project" spinner.
2020-04-22 17:48:47 -04:00
Steven
8e3f4a1ca2 [now-static-build] Add tests for gem install of native deps (#4123)
These tests ensure we can install native dependencies with `gem install` such as:
- `rmagic`
- `ruby-vips`

Co-authored-by: Nathan Rajlich <n@n8.io>
2020-04-22 16:25:44 -04:00
Nathan Rajlich
2a9e5798a8 Publish Canary
- @now/build-utils@2.2.2-canary.2
 - now@18.0.1-canary.6
 - now-client@7.1.1-canary.0
 - @now/go@1.0.8-canary.0
 - @now/next@2.5.5-canary.1
 - @now/node@1.5.2-canary.3
 - @now/python@1.1.7-canary.0
 - @now/routing-utils@1.8.2-canary.2
 - @now/ruby@1.1.1-canary.0
 - @now/static-build@0.16.1-canary.1
2020-04-22 11:17:47 -07:00
Nguyễn Hồng Quân
5b369b385d [now-python] Fix: Relative imported module not seen in sys.modules (#4097)
After #4024 was merged, I tested and still got the same error. I searched around and found that the lines of code are in wrong order (ref: https://bugs.python.org/issue37521). So this is the proper fix.

Co-authored-by: Steven <steven@ceriously.com>
2020-04-22 10:07:42 -04:00
Steven
28e01528c5 [all] Rename ZEIT Now to Vercel (#4112)
https://vercel.com/blog/zeit-is-now-vercel

Co-authored-by: Nathan Rajlich <n@n8.io>
2020-04-21 19:11:12 -04:00
Nathan Rajlich
987ce6c26b [now-node] Fix dev server exit event handling (#4113)
Child process `exit` events have two arguments (`code` and `signal`)
so the `once.spread()` function needs to be used.
2020-04-21 14:31:56 -07:00
Leo Lamprecht
21e4d644cf [now-cli] Use vercel.com URL for inspecting deployments (#4111) 2020-04-21 14:12:15 -07:00
Nathan Rajlich
282127e3f9 [now-cli] Use npm instead of yarn for now dev Runtimes installation (#4107)
Stop downloading and caching `yarn` from GitHub Releases in `now dev`,
and instead simply rely on the user having `npm` installed. The user is
extremely likely to have `npm`, since Now CLI now requires `node` to be
installed (no longer using `pkg`) which comes with `npm` bundled by
default.
2020-04-21 19:20:32 +00:00
Nathan Rajlich
7748f50ca9 [now-cli] Clean up builder dev server shutdown logic (#4109)
DRY and removes the `pid` from the set immediately so there's no race
condition if the server is shut down shortly after an HTTP request
(like in the tests).
2020-04-21 15:25:50 +00:00
Steven
224757581d Publish Canary
- @now/build-utils@2.2.2-canary.1
2020-04-20 17:00:58 -04:00
Steven
40e99284c2 [now-build-utils] Prefer yarn over npm install when both detected (#4106)
Previously, when `package-lock.json` was detected, we would always use `npm install`.

This PR changes the behavior to the following:
- If only `package-lock.json` is detected, we use `npm install`.
- If both `package-lock.json` and `yarn.lock` are detected, use `yarn install`.

This will avoid npm bugs such as `npm ERR! Cannot read property 'match' of undefined`.
2020-04-20 20:54:09 +00:00
Steven
54bae977f0 Publish Canary
- @now/routing-utils@1.8.2-canary.1
2020-04-20 14:04:43 -04:00
Steven
867590a6ba [now-routing-utils] Fix validation for rewrite/redirect destination segments (#4105)
- Print an error instead of throwing when `destination` has segment not found in `source`
- Update docs to explain how to fix this error
- Add a couple tests
- Update uncaught `path-to-regexp` error message to print the full route that caused the error
2020-04-20 17:54:25 +00:00
Ana Trajkovska
c89cf6fd57 Publish Canary
- now@18.0.1-canary.5
 - @now/node@1.5.2-canary.2
2020-04-20 14:54:32 +02:00
Ana Trajkovska
b7ad18425f [now-cli] Implement pagination for listing secrets (#4084)
* Implement pagination for listing secrets

* Fix tests

* Improvements

* Fix removing a secret
2020-04-20 14:52:18 +02:00
Nathan Rajlich
5554b2d004 Publish Canary
- now@18.0.1-canary.4
2020-04-17 18:21:55 -07:00
Nathan Rajlich
e4ce0d6802 Publish Canary
- @now/node@1.5.2-canary.1
2020-04-17 18:16:17 -07:00
Nathan Rajlich
f477ee6e3b [now-node] Throw an error if "exit" event happens in dev server (#4095)
If the process exits before the "message" event is sent, then the dev
server crashed upon bootup. Often times caused by a missing dependency.
2020-04-18 01:15:43 +00:00
Nathan Rajlich
59b4029a0c [now-cli] Handle errors from startDevServer() in now dev (#4094) 2020-04-18 00:51:14 +00:00
Nathan Rajlich
8411b53fa3 [now-cli] Use entrypoint instead of src for startDevServer() (#4093)
Otherwise the `src` is modified to not have the file extension when used
with zero-config API routes.
2020-04-17 15:01:44 -07:00
Nathan Rajlich
7651bcf4a4 Publish Canary
- @now/build-utils@2.2.2-canary.0
 - now@18.0.1-canary.3
 - @now/next@2.5.5-canary.0
 - @now/node@1.5.2-canary.0
 - @now/static-build@0.16.1-canary.0
2020-04-17 13:59:52 -07:00
Nathan Rajlich
6fd1b50924 [now dev] Add support for proxying to builder-specific dev servers (#4089)
This is an extension to the Runtime API, where a runtime can optionally define a `startDevServer()` function which is responsible for spawning a single-serve dev server for an individual HTTP request (the dev server is booted up upon receiving an HTTP request, and gets shut down by `now dev` after the HTTP request is completed). For runtimes that define this function, the `build()` function will never be executed, which avoids a lot of unnecessary processing for a dev environment.

Some things this accomplishes:

 * Retains the proper stack trace for errors.
 * Ensures that if a source code file is changed, and then an HTTP request is sent, it's guaranteed to be using the latest code (no file watching, or re-compilations).
 * Avoids creating a Lambda zip file (just to immediately unpack it for dev).
 * Avoids `@zeit/fun` completely, which loses some "correctness" (i.e. function is not frozen in between requests).
 * Backwards compatible with older Now CLIs - versions that don't know about `startDevServer()` will just invoke `build()`, and there's no version change required in the Runtime.
2020-04-17 20:55:44 +00:00
Nathan Rajlich
a03b8689e9 [now dev] Remove "Installing dependencies..." message (#4090)
The `runNpmInstall()` function is already a no-op when invoked via `now dev` (#2926), however the "Installing" message was still being printed, leading to confusion about whether or not they actually are (they're not).
2020-04-17 02:49:33 +00:00
Andy
22c8ed15c7 [now-cli] Fix unhandled unauthorized error and improve getTeamById (#4082)
* [now-cli] Fix unhandled unauthorized error

* Make getTeamById more efficient

* Add cache

* Update packages/now-cli/src/util/get-team-by-id.ts

Co-Authored-By: Nathan Rajlich <n@n8.io>

* Update packages/now-cli/src/util/get-team-by-id.ts

Co-Authored-By: Nathan Rajlich <n@n8.io>

* Update packages/now-cli/src/util/get-team-by-id.ts

Co-Authored-By: Steven <steven@ceriously.com>

Co-authored-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Steven <steven@ceriously.com>
2020-04-16 11:04:56 +02:00
Ana Trajkovska
e1f7b859b6 Publish Canary
- now@18.0.1-canary.2
 - @now/routing-utils@1.8.2-canary.0
2020-04-16 00:03:51 +02:00
Ana Trajkovska
c75cc99f1e [now-cli] Implement pagination for listing certs (#4075)
* Implement pagination for listing certs

* Remove --after option

* Fix tests
2020-04-16 00:02:46 +02:00
Steven
30ddd29889 [now-routing-utils] Fix error when hash contains question mark (#4080)
This PR fixes a [sentry error](https://sentry.io/organizations/zeithq/issues/1610773321/events/af1d6bee58c9413c81eb250ff0178917/) caused by route `destination` that contains a question mark in the hash.
2020-04-15 21:18:00 +00:00
JJ Kasper
21337de7cd Publish Stable
- @now/next@2.5.4
2020-04-15 15:57:17 -05:00
JJ Kasper
a6686f9ff5 Publish Canary
- now@18.0.1-canary.1
 - @now/next@2.5.4-canary.0
2020-04-15 15:52:16 -05:00
JJ Kasper
65c621bd55 [now-next] Fix static 404 not being used in mono-repo set-up (#4083)
This fixes the static 404 page not being used when deploying in a mono-repo structure. Before we weren't taking into account the `entryDirectory` where we needed to causing us to deploy `_error` when we didn't need to

x-ref: https://github.com/zeit/now/discussions/4077#discussioncomment-4625
2020-04-15 20:29:12 +00:00
Luc
0827d3514d [now-cli] Remove custom error when fetching frameworks fail (#4081)
Fix PRODUCT-2364.

Use `Client` instead of `node-fetch` to retrieve frameworks list.
2020-04-15 17:30:48 +00:00
Steven
7bc5d9fb5b Publish Canary
- now@18.0.1-canary.0
2020-04-15 12:30:24 -04:00
Steven
c53106ecee [now-cli] Fix for RangeError invalid count value (#4074)
This PR fixes a [sentry error](https://sentry.io/organizations/zeithq/issues/1611628097/events/75ed28bc6aef42868721a0912875fdbd/) where `repeat()` is passed a negative number and throws [`RangeError: invalid count value`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Resulting_string_too_large).

This PR ensures `repeat()` is always passed 0 or greater.
2020-04-15 15:22:30 +00:00
Andy
91e4d18ab8 [now-cli] Proxy everything except Lambdas to the dev server (#4079) 2020-04-15 16:29:59 +02:00
Steven
33cd78b93a [now-cli] Fix undefined teams and cache result (#4071)
- Fix [sentry error](https://sentry.io/organizations/zeithq/issues/1610513448/events/12bde04e921442a4aae8b7b10a759ecb/) where the `teams` might be undefined.
- Fix regression from #3740 which accidentally removed caching `teams`.
- Fix superflous `console.time()` calls for the same `GET /teams` API call. See below:

```sh
> [debug] [2020-04-14T18:31:00.220Z] GET https://api.zeit.co/www/user
> [debug] [2020-04-14T18:31:00.533Z] GET https://api.zeit.co/www/user : 313.078ms
> [debug] [2020-04-14T18:31:00.543Z] GET https://api.zeit.co/teams
> [debug] [2020-04-14T18:31:00.799Z] GET https://api.zeit.co/teams : 255.459ms
> [debug] #1 GET /teams: 260.198ms
```
2020-04-14 19:35:53 +00:00
Dávid Lévai
a765d27e5a [examples] Fix typo in Gatsby example (#4063)
Co-authored-by: Steven <steven@ceriously.com>
2020-04-14 15:06:18 -04:00
Steven
e65ff4bfd5 [examples] Fix ionic-react missing public directory (#4070)
The `public` directory was missing from the `ionic-react` example because we were ignoring all `public` directories.

This PR adds the public directory back (it is copied from now-static-build test fixtures). I also updated `.gitignore` and `.gitattributes` to be a little more friendly to our test fixtures so this doesn't happen again.
2020-04-14 16:31:49 +00:00
Steven
30a4787390 [now-cli] Fix encoding domain names (#4068)
Fixes [sentry error](https://sentry.io/organizations/zeithq/issues/1611174358/events/c3455f32ce1743b58cc248d548538b21/) so that domain name is always encoded because this input comes from the user.
2020-04-14 16:00:04 +00:00
Naoyuki Kanezawa
36f6f1db77 remove query and all options from log (#4066) 2020-04-15 00:31:57 +09:00
Steven
8043e25d6d Publish Stable
- @now/frameworks@0.0.13
 - @now/build-utils@2.2.1
 - now@18.0.0
 - now-client@7.1.0
 - @now/go@1.0.7
 - @now/next@2.5.3
 - @now/node@1.5.1
 - @now/python@1.1.6
 - @now/routing-utils@1.8.1
 - @now/static-build@0.16.0
2020-04-13 20:19:14 -04:00
Steven
73b4e7aea4 Publish Canary
- now@17.1.2-canary.16
2020-04-13 19:56:50 -04:00
Steven
de7e063c9b [now-cli] Fix now env stdin detection and don't throw for known errors (#4060)
- Capitalize `Environment` in all outputs
- Fix stdin detection so there is no need for timeouts
- Dont throw if the error is bad user input, only throw for unexpected errors
- Fix tests so waiting for prompt will throw if expected output is never received
2020-04-13 19:56:22 -04:00
Steven
e7c30deee8 [now-cli] Change now env pull console output (#4059)
Change from `Created file .env` to `Create .env file` per @leo
2020-04-13 15:50:06 -04:00
Steven
7464fac792 Publish Canary
- now@17.1.2-canary.15
2020-04-13 14:26:03 -04:00
Steven
252363cce4 [now-cli] Prefer .env over .env.build during now dev (#4057)
The latest `now env` subcommand no longer makes the distinction between build time and runtime environment variables so this PR updates `now dev` to no longer make the distinction either.

The only exception is that some builders such as `@now/next` might still rely on the separation so we must preserve the distinction for legacy builders.
2020-04-13 18:22:21 +00:00
Steven
d7dceeb2a1 [now-cli] Update now env to support empty values (#4046)
This PR adds support for empty values when using `now env add|ls|rm|pull`.

This is necessary when using system environment variables such as `NOW_GITHUB_COMMIT_SHA` which will not receive a value from the user but will instead assign a value automatically during deployment.
2020-04-13 15:21:20 +00:00
Ana Trajkovska
6b5b9e8b2f Publish Canary
- @now/build-utils@2.2.1-canary.1
 - now@17.1.2-canary.14
2020-04-10 18:51:20 +02:00
Ana Trajkovska
addd036149 Improve pagination message (#4035) 2020-04-10 18:46:32 +02:00
Steven
7ca672a470 [now-build-utils] Exclude now.json from fallback build src (#4042)
https://github.com/zeit/now/discussions/4016
2020-04-10 16:06:02 +00:00
Ana Trajkovska
3af0e99689 Publish Canary
- now@17.1.2-canary.13
 - @now/python@1.1.6-canary.0
2020-04-10 17:21:15 +02:00
Ana Trajkovska
b14068de8a [now-cli] Fix removing a deployment (#4036)
* Fix removing a deployment

* Add test for removing a deployment

* Add logs

* Fix assertion
2020-04-10 17:19:48 +02:00
Nguyễn Hồng Quân
c9437e714a [now-python] Fix missing sys modules for relative module import (#4024)
Without this fix, Python app which uses [Pydantic](https://pydantic-docs.helpmanual.io/usage/postponed_annotations/) for data validation will crash with log like this:

```py
  File "pydantic/main.py", line 175, in pydantic.main.ModelMetaclass.__new__
    annotations = resolve_annotations(namespace.get('__annotations__', {}), namespace.get('__module__', None))
  File "pydantic/typing.py", line 136, in pydantic.typing.resolve_annotations
    annotations = resolve_annotations(namespace.get('__annotations__', {}), namespace.get('__module__', None))
  File "pydantic/typing.py", line 136, in pydantic.typing.resolve_annotations
    base_globals: Optional[Dict[str, Any]] = sys.modules[module_name].__dict__
KeyError: 'api.main'
```

The added code also follow Python official documentation: https://docs.python.org/3.6/library/importlib.html#importing-a-source-file-directly
2020-04-10 09:53:24 -04:00
Steven
c0aff5cf4a [now-cli] Clean up tests for now dev (#4038)
This PR does a few things:

- Change `dev.unref()` when possible and use `testFixtureStdio` instead
- Replace `fetch()` with `fetchWithRetry()` when possible
- Remove commented-out tests
2020-04-09 23:30:22 +00:00
Allen Hai
9110b14bb4 Publish Canary
- now@17.1.2-canary.12
2020-04-09 17:07:06 -05:00
Steven
40e4b69267 [now-cli] Fix now dev routing for continue: true (#4033)
There was a bug preventing `continue: true` from working between (null => filesystem) phases.

This PR fixes that bug and adds a test to ensure users can rewrite to dynamic path segments.
2020-04-09 21:35:13 +00:00
Ana Trajkovska
6c4934dcc4 Publish Canary
- @now/frameworks@0.0.13-canary.1
 - now@17.1.2-canary.11
 - @now/static-build@0.15.2-canary.4
2020-04-09 22:26:22 +02:00
Ana Trajkovska
d64e54d61a Implement pagination for now ls (#4027) 2020-04-09 22:24:25 +02:00
Allen Hai
0b75bf07f7 [examples][now-static-build] Add Ionic Angular framework (#3970)
This PR adds framework config for Ionic Angular and also updates a mistake found in the dev script of Ionic React, which mistakenly was using the same dev script as Stencil.
2020-04-09 18:44:46 +00:00
Ana Trajkovska
a861a8f3f7 Publish Canary
- now@17.1.2-canary.10
2020-04-09 16:45:12 +02:00
Ana Trajkovska
6407b17b7f Improve pagination message (#4026) 2020-04-09 16:43:26 +02:00
Steven
558463a988 Publish Canary
- now@17.1.2-canary.9
2020-04-08 08:34:50 -04:00
Steven
1a133995b8 [now-cli] Add now env command (#3999)
This PR adds a new command `now env` for managing environment variables for a given project. This will complement the changes in the Dashboard and will provide 3 possible environments: `production`, `preview`, and `development`.

- [x] Add `now env ls`
- [x] Add `now env add`
- [x] Add `now env rm`
- [x] Add `now env pull`
- [x] Add  test for `now env ls`
- [x] Add  test for `now env add`
- [x] Add  test for `now env rm -y`
- [x] Add  test for `now env pull -y`
- [x] Add  test for `now env add FOO preview < secret.txt`
- [x] Add test deployment to verify env var is assigned to both build and runtime
- [x] Test on Windows


```
  ▲ now env [options] <command>

  Commands:

    ls      [environment]              List all variables for the specified environment
    add     [name] [environment]       Add an environment variable (see examples below)
    rm      [name] [environment]       Remove an environment variable (see examples below)
    pull    [filename]                 Read development environment from the cloud and write to a file [.env]

  Options:

    -h, --help                     Output usage information
    -A FILE, --local-config=FILE   Path to the local `now.json` file
    -Q DIR, --global-config=DIR    Path to the global `.now` directory
    -d, --debug                    Debug mode [off]
    -t TOKEN, --token=TOKEN        Login token

  Examples:

  – Add a new variable to multiple environments

      $ now env add <name>
      $ now env add API_TOKEN

  – Add a new variable for a specific environment

      $ now env add <name> <production | preview | development>
      $ now env add DB_CONNECTION production

  – Add a new environment variable from stdin

      $ cat <file> | now env add <name> <production | preview | development>
      $ cat ~/.npmrc | now env add NPM_RC preview
      $ now env add DB_PASS production < secret.txt

  – Remove a variable from multiple environments

      $ now env rm <name>
      $ now env rm API_TOKEN

  – Remove a variable from a specific environment

      $ now env rm <name> <production | preview | development>
      $ now env rm NPM_RC preview
```
2020-04-07 22:49:48 +00:00
Steven
a83eecf674 Publish Canary
- @now/routing-utils@1.8.1-canary.1
2020-04-06 18:42:01 -04:00
Steven
a932ed65fa [now-routing-utils] Catch error from compile route (#4019)
Some inputs cause `compile()` to throw but its not clear which route caused it to fail.

> TypeError: Unexpected MODIFIER at 29, expected END [see source](https://sentry.io/organizations/zeithq/issues/1593291118/?project=1351065)

This PR adds logs so we can see the bad user input and correct accordingly.
2020-04-06 22:40:30 +00:00
JJ Kasper
e2ae497762 Publish Stable
- @now/next@2.5.2
2020-04-06 15:35:12 -05:00
JJ Kasper
89989719c2 Publish Canary
- @now/next@2.5.2-canary.0
 - @now/node@1.5.1-canary.0
 - @now/static-build@0.15.2-canary.3
2020-04-06 15:27:03 -05:00
Joe Haddad
8166b8e1e7 [now-next] Correctly Exclude API Routes from Pages (#4018)
This pull request correctly omits dependencies for API Routes from pages.
2020-04-06 20:19:08 +00:00
Logan McAnsh
1ceeac498c [now-node] Add NowApiHandler type (#4001)
* add NowApiHandler type

`now` equivalent of `NextApiHandler` introduced https://github.com/zeit/next.js/pull/10573

* chore: add fixture

Signed-off-by: Logan McAnsh <logan@mcan.sh>
2020-04-03 18:29:56 -04:00
Arunoda Susiripala
1c47d1360d [now-next] Fix some typos related to fixtures (#3995)
They should be `probes` I guess.
2020-04-03 13:43:22 +00:00
Leo Lamprecht
ddcd0918e9 Removed Environment Variables (#3997) 2020-04-03 01:52:02 +02:00
Steven
573b6b8110 [now-static-build] Fix 12-creact-react-app test fixture (#3990)
Since enabling `CI` environment variable for cloud builds, this test fails because it is meant to emit a warning however that warning has turned into an error.

```
05:40:53.148  Treating warnings as errors because process.env.CI = true.
05:40:53.148  Most CI servers set it automatically.
05:40:53.148  Failed to compile.
05:40:53.149  ./src/App.js
05:40:53.149    Line 1:  'useState' is defined but never used  no-unused-vars
05:40:53.172  error Command failed with exit code 1.
```

We can again treat lint errors as warnings by setting `CI=false`.
2020-04-01 14:27:11 +00:00
Steven
40039d7f9b Publish Canary
- @now/build-utils@2.2.1-canary.0
2020-03-31 17:18:32 -04:00
Steven
dcb37e92f5 [now-build-utils] Hide internal stack trace for errors (#3988)
Example build output given a user's build script named `shouldfail.js`:

## Before

```
/zeit/4af70cdc/shouldfail.js:3
throw new Error('This is my failure')
^
Error: This is my failure
    at Object.<anonymous> (/zeit/4af70cdc/shouldfail.js:3:7)
    at Module._compile (internal/modules/cjs/loader.js:955:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
    at Module.load (internal/modules/cjs/loader.js:811:32)
    at Function.Module._load (internal/modules/cjs/loader.js:723:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10)
    at internal/main/run_main_module.js:17:11
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Exited with 1
    at ChildProcess.<anonymous> (/zeit/687b1c64/.build-utils/node_modules/@now/build-utils/dist/index.js:31350:24)
    at ChildProcess.emit (events.js:223:5)
    at ChildProcess.EventEmitter.emit (domain.js:475:20)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5)
worker exited with code 20 and signal null
Done with "package.json"
```

## After 

```
/zeit/255bfdd/shouldfail.js:3
throw new Error('This is my failure')
^
Error: This is my failure
    at Object.<anonymous> (/zeit/255bfdd/shouldfail.js:3:7)
    at Module._compile (internal/modules/cjs/loader.js:955:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:991:10)
    at Module.load (internal/modules/cjs/loader.js:811:32)
    at Function.Module._load (internal/modules/cjs/loader.js:723:14)
    at Function.Module.runMain (internal/modules/cjs/loader.js:1043:10)
    at internal/main/run_main_module.js:17:11
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Command "yarn run build" exited with 1
worker exited with code 20 and signal null
Done with "package.json"
```
2020-03-31 21:09:57 +00:00
Steven
fe7f875549 Publish Canary
- now@17.1.2-canary.8
2020-03-31 12:20:59 -04:00
Steven
a516ed6fb8 [now-cli] Fix error message link to build logs (#3986)
The current error message prints a link that is not clickable from the terminal.

This PR adds the missing `https://` protocol prefix, so that the link is clickable.
2020-03-31 12:09:11 -04:00
Steven
ca2c5f85ef [now-cli] Fix for adding secret with hyphen prefix (#3983)
Follow up to #3982 which didn't actually fix the secret value. Instead it was adding `true` as the value.
2020-03-31 13:06:46 +00:00
Tim Neutkens
adb5a01cc0 Upgrade Next.js (#3984) 2020-03-31 12:24:21 +02:00
Steven
6b4d39ab4d Publish Canary
- now@17.1.2-canary.7
2020-03-30 18:27:55 -04:00
Steven
07ce3d2e34 [now-cli] Bump mri to 1.1.5 (#3982)
This fixes the error when attempting to add a secret with a hyphen and underscore such as the following:

```
$ now secret add name '-foo_bar'
Error! argv._.slice is not a function
```
2020-03-30 22:13:00 +00:00
JJ Kasper
93ffcf487b Publish Canary
- @now/routing-utils@1.8.1-canary.0
2020-03-30 14:18:01 -05:00
JJ Kasper
3631f0f4cf [now-routing-utils] Update to not add path segments to redirect query automatically (#3981)
As discussed this removes automatically adding path segments to redirect's destination query and only adds them if manually specified

x-ref: https://github.com/zeit/next.js/pull/11497
2020-03-30 18:57:24 +00:00
Steven
b67b5be8a9 Publish Canary
- now@17.1.2-canary.6
 - now-client@7.0.2-canary.2
 - @now/static-build@0.15.2-canary.2
2020-03-30 14:06:57 -04:00
Steven
bf67b1a29e [now-static-build][now-client] Ignore known static outputs (#3980)
We already ignore specific files such as `node_modules` and `.env` during the upload phase so these never make it to the build. However, if those files are generated during the build, that are still emitted.

This PR will ignore these specific files even if they end up in the output directory (for example, when the user assigns `outputDirectory='.'` in project settings)
2020-03-30 17:53:47 +00:00
Max Rovensky
ed86473f74 Publish Canary
- now@17.1.2-canary.5
 - now-client@7.0.2-canary.1
2020-03-30 17:57:56 +08:00
Max
399a3cd114 [now-cli][now-client] Change forceNewWithCache to withCache (#3966)
Follow up to https://github.com/zeit/now/pull/3953 that makes the flag composable
2020-03-30 09:51:05 +00:00
Steven
d0fd09810a Publish Stable
- @now/go@1.0.6
2020-03-28 18:33:40 -04:00
Steven
f298f2e894 Publish Canary
- @now/go@1.0.6-canary.0
2020-03-28 18:21:06 -04:00
Steven
569200ae0e [now-go] Fix import for go-bridge (#3976)
Somehow, PR #3973 broke Go since the bridge is imported from this repo's master branch.

Go has very strict file name constraints and the file `[...path].js` is not compatible.


Here's what a `@now/go` deployment error message looks like:

```
Error: Command failed: go mod tidy
go: finding github.com/zeit/now latest
go: downloading github.com/zeit/now v0.0.0-20200326223129-c91495338d5e
go: extracting github.com/zeit/now v0.0.0-20200326223129-c91495338d5e
-> unzip /tmp/5a0676f5/pkg/mod/cache/download/github.com/zeit/now/@v/v0.0.0-20200326223129-c91495338d5e.zip: malformed file path "packages/now-next/test/fixtures/22-ssg-v2-catchall/pages/[...path].js": double dot
handler imports
github.com/zeit/now/utils/go/bridge: unzip /tmp/5a0676f5/pkg/mod/cache/download/github.com/zeit/now/@v/v0.0.0-20200326223129-c91495338d5e.zip: malformed file path "packages/now-next/test/fixtures/22-ssg-v2-catchall/pages/[...path].js": double dot
```

The solution is to move Go Bridge into a separate repository: https://github.com/zeit/now-go-bridge

This will also have the side effect of speeding up Go imports because the repo will be much smaller.
2020-03-28 22:16:42 +00:00
Nathan Rajlich
c91495338d Update signal-exit to v3.0.3 (#3974)
@tootallnate's bug fix for `SIGHUB` on Windows has been merged and
published as `signal-exit@3.0.3`, so no more need for the "resolutions"
field in `package.json`.

The `yarn.lock` file has been updated accordingly.
2020-03-26 22:31:29 +00:00
JJ Kasper
7eed5574e0 Publish Stable
- @now/next@2.5.1
2020-03-26 16:12:48 -05:00
JJ Kasper
91e6b85cec Publish Canary
- @now/next@2.5.1-canary.0
 - @now/static-build@0.15.2-canary.1
2020-03-26 16:01:00 -05:00
JJ Kasper
3ae83172ec [now-next] Fix dynamic routes and data routes order (#3973)
When using a catch-all route at the base of the project it would cause it to be prioritized over any GS(S)P `/_next/data` routes. This fixes the order putting `/_next/data` routes first as they have higher specificity and adds tests to ensure we don't regress on this
2020-03-26 20:08:51 +00:00
Steven
7c51446e5e [tests] Add additional env vars (#3968)
These are used for testing and health checks.
2020-03-25 22:42:37 +00:00
Steven
400a5c73e8 [examples][now-static-build] Bump ionic-react to latest typescript (#3967)
Fixes an issue with a dependency that was bumped but typescript was pinned in `ionic-react`.


```
$ react-scripts build
Creating an optimized production build...
Failed to compile.
/zeit/333ecfab/node_modules/@types/testing-library__react/node_modules/pretty-format/build/index.d.ts
TypeScript error in /zeit/333ecfab/node_modules/@types/testing-library__react/node_modules/pretty-format/build/index.d.ts(7,13):
'=' expected.  TS1005
     5 |  * LICENSE file in the root directory of this source tree.
     6 |  */
  >  7 | import type * as PrettyFormat from './types';
       |             ^
     8 | /**
     9 |  * Returns a presentation string of your `val` object
    10 |  * @param val any potential JavaScript object
error Command failed with exit code 1.
```
2020-03-25 19:20:59 +00:00
Steven
ec917ace69 Publish Canary
- @now/frameworks@0.0.13-canary.0
 - now@17.1.2-canary.4
 - @now/static-build@0.15.2-canary.0
2020-03-25 13:41:04 -04:00
Anthony Gubler
f5e0afdd7e [examples] Add Dojo Example (#3882)
Adds an example for Dojo applications with ZEIT Now.

Co-Authored-By: Steven <steven@ceriously.com>
Co-Authored-By: Andy <AndyBitz@users.noreply.github.com>
2020-03-25 13:32:33 -04:00
Steven
c1b4c62714 [tests] Cancel previous workflows on push (#3965)
Follow up to #3961

Workflow IDs are found here: from https://api.github.com/repos/zeit/now/actions/workflows
2020-03-25 16:05:32 +00:00
Steven
5e4bdfbe11 [tests] Separate into workflows (#3961)
This PR does a few things:

- Separate tests into multiple workflows
- Rename a few package.json scripts to make naming consistent
- Rename workflows to be uppercase and jobs to be lowercase

The benefits here are:
- Restart a workflow if it fails, for example only restart `now dev` tests
- Easier to read when we need to understand a workflow or modify env vars

After merging, we'll need to modify the required checks in the repo settings.
We'll also need to update the cancel workflow (that will need to be a separate PR).
2020-03-25 11:40:11 -04:00
Andy Bitz
bd4a0cbd32 Publish Stable
- @now/frameworks@0.0.12
 - @now/static-build@0.15.1
2020-03-25 15:57:19 +01:00
Andy Bitz
7ff9adc90e Publish Canary
- @now/frameworks@0.0.12-canary.1
 - @now/static-build@0.15.1-canary.1
2020-03-25 15:56:44 +01:00
Andy
b279f1ffae [frameworks][now-static-build] Support Docusaurus v2 and v1 (#3964)
Support Docusaurus v2 and v1
2020-03-25 14:42:56 +00:00
Ana Trajkovska
344cc103ee Publish Canary
- now@17.1.2-canary.3
2020-03-25 14:11:11 +01:00
Ana Trajkovska
83249b3685 [now-cli] Add pagination for now alias ls (#3915)
* Implement pagination for `now alias ls`

* Fix issue retrieving aliases

* Add help text for pagiting aliases
2020-03-25 14:08:26 +01:00
Andy
79e7a9f477 [now-cli] Update docusaurus test (#3963) 2020-03-25 13:43:53 +01:00
Steven
b3dce70271 Publish Canary
- @now/frameworks@0.0.12-canary.0
 - now@17.1.2-canary.2
 - @now/static-build@0.15.1-canary.0
2020-03-24 19:24:57 -04:00
Steven
cff8d8b8a0 [tests] Fix test initialize existing directory --f -> -f (#3960)
Fixes test after PR #3958
2020-03-24 22:46:42 +00:00
Andy
da892100d9 [frameworks][now-static-build] Fix Docusaurus build command (#3959)
* [frameworks][now-static-build] Fix Docusaurus build command

* Update dev command
2020-03-24 23:03:31 +01:00
Max Leiter
72e87ee6e4 Fix slight spelling mistake: --f -> -f in now --force error (#3958) 2020-03-24 12:51:15 -07:00
Max Rovensky
3f9afad167 Publish Canary
- now@17.1.2-canary.1
 - now-client@7.0.2-canary.0
2020-03-25 03:12:23 +08:00
Max
1527447914 Add --force-with-cache flag support (#3953)
Adds support for an upcoming `forceNewWithCache` API flag
2020-03-24 19:09:10 +00:00
Steven
9ca35df5fb [tests] Fix coverage checks (#3957)
The CodeCov GitHub integration is confused about the monorepo and started reporting failures recently.

<img src="https://user-images.githubusercontent.com/229881/77462927-2983f280-6ddb-11ea-9ee2-38b660b2fd2f.png" height=120 />

We run `codecov` from the CLI so we can disable the integration. 

## References

- https://docs.codecov.io/docs/codecovyml-reference
- https://docs.codecov.io/docs/commit-status#section-disabling-a-status
2020-03-24 18:47:25 +00:00
Ana Trajkovska
05b2e2216c Publish Canary
- now@17.1.2-canary.0
2020-03-24 19:12:47 +01:00
Ana Trajkovska
167fd5750a [now-cli] Add pagination for now domains ls (#3922)
* Implement pagination for listing domains

* Add helpi list for paginating domains
2020-03-24 19:08:52 +01:00
Andy
4a3cd7ec72 [now-cli] Ignore 404 for aliases and certs when removing a domain (#3955) 2020-03-24 01:56:13 +01:00
Andy Bitz
9aef718917 Publish Stable
- now@17.1.1
2020-03-24 00:16:28 +01:00
Ana Trajkovska
3cdc261802 [now-cli] Fix broken message when a deployment is canceled (#3954)
* Fix broken message when a deployment is canceled

* Add \n in the message
2020-03-24 00:14:52 +01:00
Steven
5c71f672b3 Publish Stable
- @now/frameworks@0.0.11
 - @now/build-utils@2.2.0
 - @now/cgi@1.0.4
 - now@17.1.0
 - now-client@7.0.1
 - @now/go@1.0.5
 - @now/next@2.5.0
 - @now/node@1.5.0
 - @now/python@1.1.5
 - @now/routing-utils@1.8.0
 - @now/ruby@1.1.0
 - @now/static-build@0.15.0
2020-03-23 13:59:31 -04:00
Steven
dbc5f73984 Publish Canary
- now@17.0.5-canary.15
2020-03-23 11:03:05 -04:00
Steven
1d269fffc8 [now-cli] Fix ambiguous argument error (#3952)
This updates the error message to offer action items when an ambiguous argument is provided.

## Before

```
Error! The supplied argument "secrets" is ambiguous. Both a directory and a subcommand are known 
```

## After

```
Error! The supplied argument "secrets" is ambiguous.
If you wish to deploy the subdirectory "secrets", first run "cd secrets".
If you wish to use the subcommand "secrets", use "secret" instead.
```
2020-03-23 14:57:59 +00:00
Ana Trajkovska
cc146ba0f5 Publish Canary
- now@17.0.5-canary.14
2020-03-23 00:24:37 +01:00
Ana Trajkovska
f8a2519838 Add help text for paginating deployments for a project (#3948) 2020-03-23 00:21:47 +01:00
Steven
1781376d47 Publish Canary
- @now/build-utils@2.1.2-canary.3
 - @now/ruby@1.0.3-canary.4
 - @now/static-build@0.14.13-canary.6
2020-03-20 15:04:52 -04:00
Steven
d9fda14969 [now-ruby] Upgrade to Ruby 2.7 (#3872)
- Change default version to Ruby `2.7.x` to match our static builds such as jekyll
- Detect ruby version in `Gemfile` in case the user wishes to downgrade to Ruby `2.5.x`
- Print nicer error message in `now dev`

cc @nathancahill @m5o
2020-03-20 18:54:57 +00:00
Steven
a4de9272e7 [now-static-build] Add test for puppeteer during build (#3911)
We recently updated the build image to add the necessary dependencies so that `puppeteer` can run during the build step.

This PR adds a test that takes a screenshot and prints metrics during a static build.

This is necessary to support `react-snap` (along with a few flags in `package.json`).

```json
{
  "reactSnap": {
    "puppeteerArgs": [
      "--no-sandbox",
      "--disable-setuid-sandbox"
    ]
  }
}
```

- Fixes https://github.com/zeit/now-builders/issues/517
- Fixes #2357
2020-03-20 11:54:51 -04:00
Andy Bitz
9b9037de91 Publish Canary
- @now/build-utils@2.1.2-canary.2
 - @now/next@2.4.1-canary.4
 - @now/static-build@0.14.13-canary.5
2020-03-20 15:37:07 +01:00
Andy
8d18c65e3e [now-next][now-static-build][now-build-utils] Use util to get node .bin in path (#3946)
https://zeit.atlassian.net/browse/PRODUCT-1380

This makes `now-next` consider the `node_modules/.bin` path if a custom build command was specified, which makes it work like `now-static-build`.
2020-03-20 14:31:53 +00:00
Ana Trajkovska
e7d7de61b6 Publish Canary
- now@17.0.5-canary.13
 - @now/next@2.4.1-canary.3
2020-03-20 13:04:29 +01:00
Ana Trajkovska
11927883c3 Fix pagination on now ls project (#3945) 2020-03-20 13:03:03 +01:00
Andy
57d25b184b [now-next] Add support for the outputDirectory option (#3897)
* [now-next] Add support for the outputDirectory option

* Add test

* Remove build command

* Remove check

* Add build command

* Rename directory

* Rename

* Fix test and output directory
2020-03-20 11:42:54 +01:00
Steven
95f716fb3f Publish Canary
- now@17.0.5-canary.12
 - @now/next@2.4.1-canary.2
2020-03-19 16:55:36 -04:00
Steven
8dd52605be [now-cli] Print link to more details on error (#3944)
This PR updates API Errors to support the `error.link` property.

Unlike `error.slug` which is only a path to an error message, `error.link` contains the full URL.


### Example Output

```
$ now
Error! Serverless Functions.........etc
> More details: https://zeit.ink/...etc
```
2020-03-19 20:49:57 +00:00
JJ Kasper
4b9c6a2a2a [now-next] Make sure to set 404 status for /404 route itself (#3924)
As discussed this makes sure to set the `404` status on the `/404` path itself
2020-03-19 18:24:20 +00:00
Steven
17f92a5ad3 Publish Canary
- now@17.0.5-canary.11
2020-03-19 13:59:08 -04:00
Ana Trajkovska
0aab7cc509 Fix error on now ls (#3942)
Co-authored-by: Leo Lamprecht <leo@zeit.co>
2020-03-19 18:45:24 +01:00
Steven
b39622b271 [tests] Fix publish job environment variables (#3943) 2020-03-19 18:44:59 +01:00
Ana Trajkovska
1e9aeee8e9 Publish Canary
- now@17.0.5-canary.10
2020-03-19 17:37:56 +01:00
Ana Trajkovska
49fac0dfad Paginate listing deployments for a project (#3933) 2020-03-19 17:21:13 +01:00
Steven
a668df829f Publish Canary
- @now/build-utils@2.1.2-canary.1
 - now@17.0.5-canary.9
 - now-client@7.0.1-canary.4
 - @now/static-build@0.14.13-canary.4
2020-03-19 10:30:33 -04:00
Steven
3d4ef1f825 [now-cli][now-client] Revert major version per #3939 2020-03-19 10:30:07 -04:00
Steven
f986daa1cc [now-client] Fix lint error: forbidden non-null assertion (#3941)
Fixes the following lint error: `Forbidden non-null assertion`.

<img src="https://user-images.githubusercontent.com/229881/77072131-98b8ab80-69c3-11ea-84f5-e45be43951f9.png" height=200 />

I realized this logic was somewhat brittle because it relied on `/` path separators so I switched it to use the native file name function `basename()` to determine if a file begins with a dot.
2020-03-19 13:44:51 +00:00
Steven
549c8777ba [tests] Fix test retry and allow local token (#3940)
This PR updates the way we run integration tests (the ones that create test deployments) so that it will be less likely to fail. 

A couple side effects to this PR:

- To run the tests locally, you must set `NOW_TOKEN` env var (can be found in `~/.now/auth.json`).
- PRs from forked repos won't run tests because they now rely on a secret in GH Actions.
- A couple alias tests that require certs need to be disabled because they will fail.

[PRODUCT-2093]

[PRODUCT-2093]: https://zeit.atlassian.net/browse/PRODUCT-2093
2020-03-19 13:08:46 +00:00
Andy
51d7242fda Revert "[now-cli][now-client] (Major) Remove legacy code (#3840)" (#3939)
* Revert "[now-cli][now-client] (Major) Remove legacy code (#3840)"

* Remove get

* Add projectId to .now/project.json
2020-03-19 00:16:51 +01:00
Nathan Rajlich
36db0e5bab [now-cli] Catch process.kill() for dev process and mute "ESRCH" (#3927)
"ESRCH" error means that the process is no longer running, and thus
already shut down. No need to throw in that case so just ignore the
error.

Fixes: https://sentry.io/organizations/zeithq/issues/1568104652

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-03-18 13:49:22 -07:00
Steven
99368b4248 [all] Fix test fixture pkg names and increase retry (#3935)
Fixes test warnings from `jest-hast-map`:

```
[now-static-build] Running yarn test-integration-once
$ jest --env node --verbose --runInBand test/integration.test.js
jest-haste-map: Haste module naming collision: 12-create-react-app
  The following files share their name; please adjust your hasteImpl:
    * <rootDir>/test/fixtures/12-create-react-app/package.json
    * <rootDir>/test/fixtures/26-ejected-cra/package.json

jest-haste-map: Haste module naming collision: gatsby-starter-default
  The following files share their name; please adjust your hasteImpl:
    * <rootDir>/test/fixtures/10-gatsby/package.json
    * <rootDir>/test/fixtures/10-gatsby-without-build-script/package.json

jest-haste-map: Haste module naming collision: gohugo-default-theme
  The following files share their name; please adjust your hasteImpl:
    * <rootDir>/test/fixtures/31-hugo/themes/ananke/package.json
    * <rootDir>/test/fixtures/46-hugo-with-framework/themes/ananke/package.json

jest-haste-map: Haste module naming collision: gohugo-default-styles
  The following files share their name; please adjust your hasteImpl:
    * <rootDir>/test/fixtures/31-hugo/themes/ananke/src/package.json
    * <rootDir>/test/fixtures/46-hugo-with-framework/themes/ananke/src/package.json

jest-haste-map: Haste module naming collision: 47-nuxt-with-custom-output
  The following files share their name; please adjust your hasteImpl:
    * <rootDir>/test/fixtures/47-nuxt-with-custom-output/package.json
    * <rootDir>/test/fixtures/48-nuxt-without-framework/package.json
```

Also increased test retry to 5.
2020-03-18 16:37:19 -04:00
Andy Bitz
95daf0e292 Publish Canary
- @now/frameworks@0.0.11-canary.2
 - now@18.0.0-canary.12
 - @now/static-build@0.14.13-canary.3
2020-03-18 12:53:21 +01:00
Andy
8bfa9c1a42 [now-cli] Fix ID check for orgs (#3934)
* [now-cli] Fix ID check for orgs

* Validate project settings

* Fix check
2020-03-18 12:51:52 +01:00
Shu Uesugi
4208dc0466 Add missing websites to frameworks (#3814) 2020-03-18 00:08:07 +01:00
Leo Lamprecht
00ae011b95 Use correct frameworks endpoint (#3932) 2020-03-17 23:02:30 +01:00
Andy
a770991a81 [now-cli] Restore now alias <domain> (#3910)
* [now-cli] Restore `now alias <domain>`

* Fix test

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-03-17 22:57:02 +01:00
Leo Lamprecht
f80a6d6392 Add support for /api/v1/frameworks to the framework API (#3931)
* Add support for `/api/v1/frameworks` to the framework API

* Update now.json

* Add another rewrite

Co-authored-by: Andy <AndyBitz@users.noreply.github.com>
Co-authored-by: Andy Bitz <artzbitz@gmail.com>
2020-03-17 22:37:38 +01:00
Andy
30777384ec Revert "Rewrite all paths to frameworks API (#3929)" (#3930)
This reverts commit ff18788b20.
2020-03-17 22:13:06 +01:00
Yamagishi Kazutoshi
0c719b7f6a [now-static-build] Add defaultRoutes for docusaurus v2 (#3909)
Add a default router for Docusaurus v2 to add strong asset caching and 404 page fallback.
2020-03-17 17:12:06 -04:00
Leo Lamprecht
ff18788b20 Rewrite all paths to frameworks API (#3929) 2020-03-17 22:11:22 +01:00
Steven
752ab39787 Publish Canary
- @now/frameworks@0.0.11-canary.1
 - now@18.0.0-canary.11
 - @now/static-build@0.14.13-canary.2
2020-03-17 16:33:13 -04:00
Steven
c1df8c8bd1 [now-static-build] Update error message to mention project settings (#3926)
This PR improves the error message to make it actionable.

The docs will be updated in https://github.com/zeit/docs/pull/1661 with even more detail.
2020-03-17 16:29:43 -04:00
Andy
25fd1df35d [frameworks] Adjust placeholder for build command (#3928) 2020-03-17 20:31:19 +01:00
Steven
d32ab1e0d9 [examples] Update jekyll and middleman to use bundler 2.1.4 (#3923)
These examples were using an old version of Bundler which didn't match our tests and would fail with:

```
/ruby27/lib/ruby/2.7.0/rubygems.rb:275:in `find_spec_for_exe': Could not find 'bundler' (1.17.2) required by your /zeit/6f4b9e46/Gemfile.lock. (Gem::GemNotFoundException)
To update to the latest version installed on your system, run `bundle update --bundler`.
To install the missing version, run `gem install bundler:1.17.2`
	from /ruby27/lib/ruby/2.7.0/rubygems.rb:294:in `activate_bin_path'
	from /ruby27/bin/bundle:23:in `<main>'
```

I ran `bundle update --bundler` in each of these directories and it only updated the version in `Gemfile.lock` because 2.x is mostly backwards compatible.
2020-03-17 11:54:20 -04:00
Steven
a69c460760 [now-cli] Fix test for username (#3916)
We renamed the CI Bot so this will use the name from the context rather than hardcoding the name.
2020-03-17 11:23:21 -04:00
Andy
b985853f15 [frameworks] Remove quotes from placeholder (#3921) 2020-03-17 15:37:24 +01:00
Andy
94e607a93a [frameworks] Fix more placeholders (#3920)
* [frameworks] Fix order in build placeholder

* [frameworks] Adjust order for more frameworks
2020-03-17 15:31:01 +01:00
Andy
f97a81fa14 [frameworks] Fix order in build placeholder (#3918) 2020-03-17 15:20:47 +01:00
Andy
6e28438eb4 [frameworks] Change build placeholder (#3917) 2020-03-17 15:08:28 +01:00
Shu Ding
8fcdf3f458 improve brunch example (#3906) 2020-03-17 00:33:08 +08:00
dependabot[bot]
dbf0cc3562 Bump acorn from 5.7.3 to 5.7.4 (#3913)
Bumps [acorn](https://github.com/acornjs/acorn) from 5.7.3 to 5.7.4.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/5.7.3...5.7.4)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-03-15 11:55:13 +01:00
Steven
27ccfa7e7a Publish Canary
- now@18.0.0-canary.10
2020-03-13 14:22:52 -04:00
Steven
f37edbc670 [now-cli] Fix invalid token error message during project link (#3907)
This PR improves the error message and prevents "An unexpected error occurred" when the token is invalid during a project link step.

I also added the `--token` option to `now dev --help` .

Lastly, I updated `now logout` to work correctly when the token is invalid.

- Fixes #3772 
- Fixes #3786
2020-03-13 00:10:11 +00:00
JJ Kasper
b7943e83d2 Publish Canary
- @now/next@2.4.1-canary.1
 - @now/routing-utils@1.7.1-canary.1
2020-03-12 11:45:18 -05:00
JJ Kasper
300ed5b952 [now-next] Implement new handles for custom routes (#3892)
This implements the new handles from https://github.com/zeit/now/pull/3876 to allow us to ensure the proper order for `rewrites`, `redirects`, and `headers` in Next.js. I also added in the tests from the Next.js [custom-routes test suite](https://github.com/zeit/next.js/tree/canary/test/integration/custom-routes) to ensure we're matching behavior. 

To help keep track of what each probe is testing I added support for parsing the `now.json` files in `testDeployment` as [JSON5](https://www.npmjs.com/package/json5) to allow adding comments before each probe. If this is undesired I can remove this specific change even though it makes managing the fixture tests much easier
2020-03-12 03:18:33 +00:00
Andy Bitz
9e6ebfb3ec Publish Canary
- now@18.0.0-canary.9
2020-03-11 23:02:30 +01:00
Andy
f49620790c [now-cli] Proper error message when now alias misses arguments (#3904)
We need to show a proper error message when `now alias` misses arguments.
2020-03-11 21:57:02 +00:00
Steven
84065688b5 Publish Canary
- now@18.0.0-canary.8
2020-03-11 16:15:11 -04:00
Steven
5a1012fb0f [now-cli] Prevent framework from clearing console in now dev (#3903)
When running a framework like Create React App or Gridsome, the console gets cleared. This prevented the user from seeing the message printed from `now dev` which is typically `http://localhost:3000`. Instead the user would see the framework's URL such as `http://localhost:54684`.

See #3497 for an example.

The solution is to change the child process to pipe stdout/stderr. Since most frameworks detect [`process.stdout.isTTY`](7e6d6cd05f/packages/react-scripts/scripts/start.js (L141-L143)) before clearing the console, this will solve the problem. I was also able to intercept stdout to replace the framework's port with the `now dev` port and I think this will also help prevent confusion.

I also had to set `FORCE_COLOR=1` to avoid losing ANSI colors.

- Related to https://github.com/facebook/create-react-app/issues/2495
- Fixes #3497
2020-03-11 16:11:51 -04:00
Nathan Rajlich
4b6143c293 [now-cli] Remove "Serving all files as static" message (#3901) 2020-03-11 13:03:16 +00:00
Mark Glagola
b6601b0d9a Publish Canary
- now@18.0.0-canary.7
2020-03-10 13:59:46 -05:00
Mark Glagola
2870a1dd49 Fix setup-domain to use aliasDomain for gets (#3871) 2020-03-10 13:35:50 -05:00
Steven
6249f7e293 [now-cli] Change suggestion for rootDirectory to ./ (#3899)
When we ask the question "In which directory is your code located?" we were displaying a prefix  of `cwd/` which is confusing because it seems like you are supposed to type in the current directory. It also doesn't match what is displayed in the Project Settings after it is deployed.

This changes the prefix to `./` so that `rootDirectory` is set to the current directory and the user can type in a subdirectory if they wish such as `./packages/web` for example.

### Before

```
? Set up and deploy “~/Code/app”? [Y/n] y
? Which scope do you want to deploy to? Testing
? Link to existing project? [y/N] n
? What’s your project’s name? app
? In which directory is your code located? app/
```

### After

```
? Set up and deploy “~/Code/app”? [Y/n] y
? Which scope do you want to deploy to? Testing
? Link to existing project? [y/N] n
? What’s your project’s name? app
? In which directory is your code located? ./
```
2020-03-10 10:50:50 -04:00
Steven
6f9545e097 Publish Canary
- @now/build-utils@2.1.2-canary.0
 - @now/next@2.4.1-canary.0
2020-03-09 16:45:24 -04:00
Steven
8095ba5cf9 [now-build-utils] Add env var NPM_ONLY_PRODUCTION (#3898)
In PR #3847 we fixed a bug that prevented installing `devDependencies` when `NODE_ENV=production` this is typically what users want, but there are some cases where a user may wish to skip installing `devDependencies`. For example, if you have more than 500 MB worth of dependencies.

This PR introduces `NPM_ONLY_PRODUCTION=1` which can be used to skip installing `devDependencies` in these rare cases. It is the equivalent of `npm install --production` or `yarn install --production`. There is also `npm install --only=production` for which this new env var gets its name.

#### References
- https://docs.npmjs.com/cli/install
- https://classic.yarnpkg.com/en/docs/cli/install/#toc-yarn-install-production-true-false
2020-03-09 16:41:34 -04:00
Andy
e02128e5a3 [now-next] Consider buildCommand from config (#3895)
* [now-next] Use build command

* Update packages/now-next/src/index.ts

Co-Authored-By: JJ Kasper <jj@jjsweb.site>

Co-authored-by: JJ Kasper <jj@jjsweb.site>
2020-03-09 14:32:36 +01:00
Paco
2567b8c8b8 [examples] Add ZEIT logo to Next.js example (#3893) 2020-03-07 14:40:22 +01:00
Andy Bitz
5bfcdec471 Publish Canary
- now@18.0.0-canary.6
2020-03-07 01:28:48 +01:00
Andy
6609686a2b [now-cli] Fix undefined in error output (#3894)
* [now-cli] Fix undefined in error output

* Revert "[now-cli] Fix undefined in error output"

This reverts commit afee2eb43f92bac4057d69e3d5cfe6593288401d.

* Add now.url
2020-03-07 01:28:07 +01:00
Steven
709aaf2285 Publish Canary
- now@18.0.0-canary.5
2020-03-06 17:47:04 -05:00
Steven
6b3908d4dc [now-cli] Fix now dev env vars in Next.js APIs (#3891)
In Now CLI 17 when Next.js is detected, the `next dev` command is proxied from `now dev`.

This brings Next.js into alignment as other other frameworks such as Gatsby and CRA. But those other frameworks are building static websites, so we were only passing build time env vars. However, Next.js needs runtime env vars for APIs in `/pages/api`.

So the solution is to special case until Next.js can read these files directly. See https://github.com/zeit/next.js/pull/10525

Fixes #3758
2020-03-06 22:43:51 +00:00
m5o
9d19d02a0a [tests] Return an empty array if nowJson.builds is empty (#3886)
* return an empty array if nowJson.builds is empty
  * https://github.com/zeit/now/pull/3622#issuecomment-578995344
  * extracted from PR discussion
    * occur after following change a645d4ee88
  * kudos to @styfle

/cc @styfle
2020-03-06 20:12:44 +00:00
Steven
533b059947 Publish Canary
- now@18.0.0-canary.4
2020-03-06 13:57:53 -05:00
Steven
2a7c1dc4e4 [now-cli] Print error during install for unsupported Node version (#3869)
Fixes #3866 

### Output
```
> now@18.0.0 preinstall /usr/local/lib/node_modules/now
> node ./scripts/preinstall.js

> Error! Detected unsupported Node.js version.
Expected ">= 10" but found "8.10.0".
Please update to the latest Node.js LTS version to install Now CLI.
```
2020-03-06 13:22:24 -05:00
Ana Trajkovska
07a920ed18 Publish Canary
- @now/cgi@1.0.4-canary.0
 - now@18.0.0-canary.3
2020-03-06 13:31:34 +01:00
Ana Trajkovska
db36c874a0 Add period at the end of cancelation deployment message (#3884) 2020-03-06 13:17:29 +01:00
Tim Neutkens
cc58af74d6 Update Next.js example to latest create-next-app format (#3881)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-03-06 12:46:29 +01:00
kodiakhq[bot]
1bcb95a9f0 [now-cgi] Remove unused dependency (#3878)
Removes `@zeit/best` because it is unused and outdated.

We should considered deprecating `@now/cgi` since it only gets [4 downloads per week](https://user-images.githubusercontent.com/229881/75991128-004f0100-5ec4-11ea-9195-bf8019a5a965.png) and has no tests.

I also deleted the nested `yarn.lock` since we only need one at the root for yarn workspaces.
2020-03-05 18:20:11 +00:00
JJ Kasper
e6a0216faf Publish Canary
- @now/frameworks@0.0.11-canary.0
 - now@18.0.0-canary.2
 - now-client@8.0.0-canary.2
 - @now/node@1.4.2-canary.1
 - @now/routing-utils@1.7.1-canary.0
2020-03-05 11:26:21 -06:00
kodiakhq[bot]
283ef46ac5 [now-cli] Bump dot to 1.1.3 (#3877)
Bumps `dot` to the latest version [1.1.3](https://github.com/olado/doT/releases/tag/v1.1.3).
2020-03-05 14:31:14 +00:00
kodiakhq[bot]
b4b1857562 [now-routing-utils] Add support for new handle types (#3876)
This adds support for the new internal `handle` types `error` and `rewrite` and also updates the error messages to be more verbose since additional keys are allowed when using `handle: 'error'`. 

This is needed so that we can implement utilize the new handles in `@now/next` for the new custom-routes support
2020-03-04 23:05:14 +00:00
Matthew Sweeney
c46c56bbf9 Add Issue Templates (#3873)
This PR adds issue templates for common cases:

- Bug Report - to be submitted through the ZEIT Now support form.
- Feature Request - to be handled as a discussion between the community and ZEIT staff.
- Ask a Question - to be posted in Discussions for all to answer.

In addition to this, the PR also removes the Spectrum link from the README.
2020-03-04 11:50:50 -05:00
Nathan Rajlich
62ce2f6cac [now-node] Use url.parse() for req.query helper (#3863)
Given:

```js
module.exports = (req, res) => {
  res.json(req.query)
}
```

Fixes:

```
GET /api/helperparser?a=2&a=1
{"a":"1"}
```

To be:

```
GET /api/helperparser?a=2&a=1
{"a":["2","1"]}
```
2020-03-03 20:38:32 +00:00
Andy
631c7befad [examples] Remove hasDetectors from API (#3865)
Co-authored-by: Leo Lamprecht <mindrun@icloud.com>
2020-03-03 14:27:13 +01:00
Andy
bc18c34d60 [examples] Remove examples without detectors (#3864) 2020-03-03 13:45:27 +01:00
Andy Bitz
6b6a1891c1 Publish Canary
- now@18.0.0-canary.1
 - now-client@8.0.0-canary.1
2020-03-02 22:01:51 +01:00
Andy Bitz
8879b115ef [now-cli][now-client] Bump version 2020-03-02 22:01:29 +01:00
Andy
99c4c32d6d [now-cli][now-client] (Major) Remove legacy code (#3840)
* [now-cli][now-client] Remove legacy code

* Adjust tests

* Adjust more tests

* Remove scale command and --no-scale option from help

* Update packages/now-cli/src/commands/inspect.js

Co-Authored-By: Steven <steven@ceriously.com>

* Remove isBuilds option

* Use Object.entries

* Remove rambda

* Adjust type and remove more unused code

* Use URL instead of url.parse

* Fix linting

* Simplify responseError function

* Remove GNU bash, version 5.0.11(1)-release (x86_64-apple-darwin19.0.0)
These shell commands are defined internally.  Type `help' to see this list.
Type `help name' to find out more about the function `name'.
Use `info bash' to find out more about the shell in general.
Use `man -k' or `info' to find out more about commands not in this list.

A star (*) next to a name means that the command is disabled.

 job_spec [&]                                                                             history [-c] [-d offset] [n] or history -anrw [filename] or history -ps arg [arg...]
 (( expression ))                                                                         if COMMANDS; then COMMANDS; [ elif COMMANDS; then COMMANDS; ]... [ else COMMANDS; ] >
 . filename [arguments]                                                                   jobs [-lnprs] [jobspec ...] or jobs -x command [args]
 :                                                                                        kill [-s sigspec | -n signum | -sigspec] pid | jobspec ... or kill -l [sigspec]
 [ arg... ]                                                                               let arg [arg ...]
 [[ expression ]]                                                                         local [option] name[=value] ...
 alias [-p] [name[=value] ... ]                                                           logout [n]
 bg [job_spec ...]                                                                        mapfile [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c q>
 bind [-lpsvPSVX] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-x keyseq:>  popd [-n] [+N | -N]
 break [n]                                                                                printf [-v var] format [arguments]
 builtin [shell-builtin [arg ...]]                                                        pushd [-n] [+N | -N | dir]
 caller [expr]                                                                            pwd [-LP]
 case WORD in [PATTERN [| PATTERN]...) COMMANDS ;;]... esac                               read [-ers] [-a array] [-d delim] [-i text] [-n nchars] [-N nchars] [-p prompt] [-t t>
 cd [-L|[-P [-e]] [-@]] [dir]                                                             readarray [-d delim] [-n count] [-O origin] [-s count] [-t] [-u fd] [-C callback] [-c>
 command [-pVv] command [arg ...]                                                         readonly [-aAf] [name[=value] ...] or readonly -p
 compgen [-abcdefgjksuv] [-o option] [-A action] [-G globpat] [-W wordlist]  [-F functi>  return [n]
 complete [-abcdefgjksuv] [-pr] [-DEI] [-o option] [-A action] [-G globpat] [-W wordlis>  select NAME [in WORDS ... ;] do COMMANDS; done
 compopt [-o|+o option] [-DEI] [name ...]                                                 set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...]
 continue [n]                                                                             shift [n]
 coproc [NAME] command [redirections]                                                     shopt [-pqsu] [-o] [optname ...]
 declare [-aAfFgilnrtux] [-p] [name[=value] ...]                                          source filename [arguments]
 dirs [-clpv] [+N] [-N]                                                                   suspend [-f]
 disown [-h] [-ar] [jobspec ... | pid ...]                                                test [expr]
 echo [-neE] [arg ...]                                                                    time [-p] pipeline
 enable [-a] [-dnps] [-f filename] [name ...]                                             times
 eval [arg ...]                                                                           trap [-lp] [[arg] signal_spec ...]
 exec [-cl] [-a name] [command [arguments ...]] [redirection ...]                         true
 exit [n]                                                                                 type [-afptP] name [name ...]
 export [-fn] [name[=value] ...] or export -p                                             typeset [-aAfFgilnrtux] [-p] name[=value] ...
 false                                                                                    ulimit [-SHabcdefiklmnpqrstuvxPT] [limit]
 fc [-e ename] [-lnr] [first] [last] or fc -s [pat=rep] [command]                         umask [-p] [-S] [mode]
 fg [job_spec]                                                                            unalias [-a] name [name ...]
 for NAME [in WORDS ... ] ; do COMMANDS; done                                             unset [-f] [-v] [-n] [name ...]
 for (( exp1; exp2; exp3 )); do COMMANDS; done                                            until COMMANDS; do COMMANDS; done
 function name { COMMANDS ; } or name () { COMMANDS ; }                                   variables - Names and meanings of some shell variables
 getopts optstring name [arg]                                                             wait [-fn] [id ...]
 hash [-lr] [-p pathname] [-dt] [name ...]                                                while COMMANDS; do COMMANDS; done
 help [-dms] [pattern ...]                                                                { COMMANDS ; } from subcommand list since it's a global command

* Log errors

Co-authored-by: Steven <steven@ceriously.com>
2020-03-02 21:59:45 +01:00
Steven
857da7774b Publish Stable
- @now/build-utils@2.1.1
2020-02-29 18:44:58 -05:00
Steven
3407e6bd1a Publish Canary
- @now/build-utils@2.1.1-canary.0
 - @now/ruby@1.0.3-canary.3
2020-02-29 18:40:49 -05:00
Steven
553ad240f0 [now-build-utils] Fix NODE_ENV assignment (#3862)
Fixes a regression in #3847 which was preventing the user from assigning `NODE_ENV`.

The root cause was that the spread operator (`...`) performs a shallow clone, not a deep clone. So we must perform another spread to clone the user-provided `env` object before deleting `NODE_ENV` during `npm install`.
2020-02-29 18:37:59 -05:00
m5o
964ce1bb5a [now-ruby] update bundler on ruby rack examples (#3856)
* update bundler on ruby rack examples
  * bundle with latest bundler `v2.1.4`
  * update rack to `v2.2.2`
  🔗 https://github.com/zeit/now/pull/3626
2020-02-28 23:45:54 +00:00
Steven
995aa6eddf Publish Canary
- now@17.0.5-canary.7
2020-02-28 17:39:42 -05:00
Steven
095805e3ad [tests] Fix missing await (#3860)
Follow up to #3858
2020-02-28 17:35:02 -05:00
Steven
b461ed238c [tests] Fix code coverage upload (#3859)
The code coverage report stopped uploading after we switched to GitHub Actions because its not a recognized CI provider.

This PR adds a secret with the code coverage token from [codecov.io](https://codecov.io/gh/zeit/now/settings).
2020-02-28 22:13:04 +00:00
Steven
01e7124189 Publish Canary
- now@17.0.5-canary.6
 - @now/ruby@1.0.3-canary.2
2020-02-28 16:21:56 -05:00
Steven
acd3ac2f98 [now-cli] Disable sentry during local development (#3858)
This PR changes the behavior of error reporting and metrics so that developers who build and run Now CLI locally won't accidentally report any metrics. It also prevents errors during CI tests from being reported.

The env vars are only assigned during the publishing step so that the official Now CLI hosted on npm is the only way to report metrics.
2020-02-28 21:20:36 +00:00
Steven
b50e4209e1 [now-cli] Fix "The specified token is not valid" (#3857)
Fixes https://sentry.io/organizations/zeithq/issues/1537743736/?project=1323225&referrer=slack
2020-02-28 19:59:51 +00:00
m5o
147b4e870c [now-ruby] Add test fixture for ActiveSupport gem (#3853)
* add ruby ActiveSupport test fixture
  > ActiveSupport is a Ruby module & a stand-alone component of Rails that includes additional functionality to core Ruby classes, like Array, String & Numeric.
  🔗 https://guides.rubyonrails.org/active_support_core_extensions.html

* add `Date.current + 10.years` calculation example
2020-02-28 12:56:06 -05:00
Steven
df8327d14c [docs] Update readme (#3855)
Updates the readme to mention the Git Integration and fixes some misinformation.
2020-02-28 12:53:40 -05:00
Joe Haddad
fb4d4b5953 Publish Stable
- @now/build-utils@2.1.0
 - @now/next@2.4.0
 - @now/routing-utils@1.7.0
2020-02-28 10:19:47 -05:00
Joe Haddad
de3701c045 Publish Canary
- @now/ruby@1.0.3-canary.1
2020-02-28 10:18:46 -05:00
m5o
9f9b7934cb [now-ruby] Fix ruby test indentation (#3854)
* fix ruby indentation example
  * 💅 indent with 2 spaces for consistency
2020-02-28 14:34:47 +00:00
Steven
bcded1dd17 Publish Canary
- @now/build-utils@2.0.1-canary.3
 - @now/next@2.3.19-canary.2
 - @now/python@1.1.5-canary.1
2020-02-28 08:57:36 -05:00
Steven
8503af75ba [now-python] Fix space encoding 2020-02-28 08:35:27 -05:00
Joe Haddad
158a50f1aa [now-next] Allow Immutable Fallback Artifact (#3850)
* [now-next] Allow Immutable Fallback Artifact

* trigger
2020-02-27 22:00:09 -05:00
Steven
61da552dd6 [now-build-utils] Add test for NODE_ENV behavior (#3852)
This PR adds a test for #3847.
2020-02-27 21:47:27 +00:00
Steven
fa838eecac Publish Canary
- @now/go@1.0.5-canary.0
 - @now/next@2.3.19-canary.1
 - @now/node@1.4.2-canary.0
 - @now/python@1.1.5-canary.0
 - @now/ruby@1.0.3-canary.0
 - @now/static-build@0.14.13-canary.1
2020-02-27 15:52:36 -05:00
Steven
71b6a58783 [all] Exclude @now/build-utils in bundled builder to fix tests (#3848)
This fixes a bug in our `@now/build-utils` tests that pair the current build-utils with a stable builder. Since ncc was bundling `@now/build-utils`, we weren't able to configure a different version and these tests were not actually testing the correct version of build-utils.

A nice side-effect is that each builder will be about 50% smaller (compared by measuring `dist`).
2020-02-27 15:48:03 -05:00
Joe Haddad
22dd78e286 Publish Canary
- @now/build-utils@2.0.1-canary.2
 - @now/next@2.3.19-canary.0
2020-02-27 12:35:52 -05:00
Joe Haddad
e63fcf2630 [now-next] Add Support for Prerender v2 (#3845)
* [now-next] Add Support for Prerender v2

* Copy test suite

* Test that fallback doesn't work for fallback: false

* record omitted lambdas

* Improve test case

* improve omitted routes logic

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-02-27 12:33:31 -05:00
Steven
98e1553c2e [now-build-utils] Install all deps regardless of NODE_ENV (#3847)
Some build utilities and SSG Frameworks instruct users to set `NODE_ENV=production` which typically means updating `now.json` to the following:

```json
{
  "build": {
    "env": {
      "NODE_ENV": "production"
    }
  }
}
```

The problem is that this environment variable is assigned during `npm install` or `yarn install` which is the equivalent of running install with the `--production` flag. This flag prevents `devDependencies` from installing. This is almost never what the user intends so they have to remove `now.json` and instead updating their build script to `NODE_ENV=production yarn build`.

This PR improves the experience by deleting `NODE_ENV` during the install step.
2020-02-27 12:14:06 -05:00
Steven
4dc506f17a Publish Canary
- @now/build-utils@2.0.1-canary.1
 - now@17.0.5-canary.5
 - @now/routing-utils@1.6.1-canary.1
2020-02-27 08:05:05 -05:00
Steven
3b396f29e9 [now-build-utils][now-routing-utils] Fix appendRoutesToPhase() when input is null (#3843)
This PR fixes `@now/routing-utils` when the input routes are null. It used to return the empty array but now it will still append.

I also added many more tests to `@now/build-utils` when `featureHandleMiss: true` and refactored the code a bit to make dynamic routes and api routes a little more clear.
2020-02-26 23:30:50 +00:00
JJ Kasper
1f128e69e6 Publish Stable
- @now/next@2.3.18
2020-02-26 15:56:41 -06:00
JJ Kasper
f1487c92cb Publish Canary
- now@17.0.5-canary.4
 - @now/next@2.3.18-canary.0
2020-02-26 15:51:27 -06:00
JJ Kasper
45066cdf44 [now-next] Add /_next/data routes for getServerProps pages (#3771)
This adds the `/_next/data` routes for `getServerProps` pages if they exist

x-ref: https://github.com/zeit/next.js/pull/10077
x-ref: https://github.com/zeit/next.js/pull/10622
2020-02-26 21:47:51 +00:00
Ana Trajkovska
7dde9c8207 Publish Canary
- now@17.0.5-canary.3
 - now-client@7.0.1-canary.1
2020-02-26 08:00:09 +01:00
Ana Trajkovska
fd964f825d Handle deployment cancellation (#3823)
Co-authored-by: Max <8418866+rdev@users.noreply.github.com>
2020-02-26 07:21:27 +01:00
Steven
1656c9874e Publish Canary
- @now/build-utils@2.0.1-canary.0
 - now@17.0.5-canary.2
 - @now/routing-utils@1.6.1-canary.0
2020-02-25 17:32:37 -05:00
Steven
d999a3b2ad [now-routing-utils][now-build-utils] Refactor zero-config rewrites (#3832)
This PR refactors the rewrites (the dynamic routes as well as the route that prevents directory listing for zero config deployments) so they are not in the `handle: miss` phase.

This is necessary because the behavior of `handle: miss` will change in an upcoming release.

The solution is to separate these into `rewriteRoutes` that can then be merged properly with the user's routes. They will be appended to the `handle: filesystem` phase (or add the phase if it doesn't exist).
2020-02-25 22:30:36 +00:00
Joe Haddad
cfb7c9e632 Publish Stable
- @now/next@2.3.17
2020-02-25 15:19:05 -05:00
Joe Haddad
06e8472cf7 Publish Canary
- now@17.0.5-canary.1
 - @now/next@2.3.17-canary.0
 - @now/static-build@0.14.13-canary.0
2020-02-25 14:57:42 -05:00
Joe Haddad
92404135d8 [now-next] Always Emit Prerenders (#3837)
This ensures we always emit Prerender objects for bypass tokens.
2020-02-25 19:51:07 +00:00
Nathan Rajlich
8b5cc23d7c [now-cli] Remove v1 "static build" integration tests (#3833)
* [now-cli] Remove v1 "static build" integration tests

These are the last remaining v1 static type deployments being created.

* Remove from `integration.js` as well

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-02-24 17:19:22 -08:00
Shu Uesugi
e10b42bfdc Rename zeit.co/new → zeit.co/import (#3834)
* zeit.co/new → zeit.co/import

* Update docs URL
2020-02-25 01:35:12 +01:00
M. Heide
36f7ec4836 [examples] Fix Go build if Windows Git is configured to checkout CRLF line endings (#3821)
Fixes #3820
2020-02-24 19:53:15 +00:00
Joe Haddad
f89d1c463e Remove Backticks from URL Output (#3830)
![image](https://user-images.githubusercontent.com/616428/75176976-44434880-5703-11ea-8ca5-cb49e4a921cf.png)

![image](https://user-images.githubusercontent.com/616428/75176982-473e3900-5703-11ea-90f6-b31844a486ce.png)
2020-02-24 19:22:58 +00:00
Steven
5dc652eba9 Publish Canary
- now@17.0.5-canary.0
 - now-client@7.0.1-canary.0
2020-02-24 12:53:13 -05:00
Steven
821b2bd50b [now-client] Fix root directory with trailing slash (#3827)
There was a bug in `now-client` when deploying a directory that ends with a slash, for example `/Users/styfle/Code/myapp/` instead of the usual `/Users/styfle/Code/myapp`.

This never affected `now-cli` until we added support for defining the `rootDirectory` which allows the user to type whatever they wish in the Project Settings.

The fix is to use `path.relative()` instead of substring.
2020-02-24 17:45:10 +00:00
Steven
8d5f6f1fa3 Publish Stable
- @now/frameworks@0.0.10
 - @now/build-utils@2.0.0
 - now@17.0.4
 - @now/go@1.0.4
 - @now/next@2.3.16
 - @now/python@1.1.4
 - @now/routing-utils@1.6.0
2020-02-21 18:09:20 -05:00
Steven
617f610c07 [tests] Update cancel workflow (#3817)
Update to latest version, [0.2.0](https://github.com/styfle/cancel-workflow-action/releases/tag/0.2.0), which will fix cancelling on push.

Also this action is available in the [marketplace](https://github.com/marketplace/actions/cancel-workflow-action).
2020-02-21 18:00:27 -05:00
Steven
3229ba0106 Publish Canary
- @now/go@1.0.4-canary.3
 - @now/python@1.1.4-canary.1
2020-02-21 17:27:20 -05:00
Steven
d16a6e4716 [now-go] Fix path segments in now dev (#3816)
The combination of file renaming and brackets doesn't work well for go build so we need to add the file extension back before building.

I also simplified the `.now/cache/folder` logic because it should be the same whether `builds` is defined or not (aka zero config).
2020-02-21 22:25:44 +00:00
Steven
4e5156fb0b [now-python] Fix path segments in now dev (#3815)
The combination of file renaming and brackets doesn't work well for python imports so we need too add the file extension back before importing the python module.

I also simplified the `.now/cache/folder` logic because it should be the same whether `builds` is defined or not (aka zero config).
2020-02-21 20:45:41 +00:00
Joe Haddad
3c013cc36b Publish Canary
- @now/build-utils@2.0.0-canary.2
 - @now/next@2.3.16-canary.1
2020-02-21 11:06:44 -05:00
Joe Haddad
1ed83135be Add Bypass Token to Next.js Builder (#3811)
This pull request adds the bypass token to returned `Prerender` output objects.

There's no tests as this doesn't exist in production yet.
2020-02-21 16:05:22 +00:00
Joe Haddad
0e71ff2df1 [now-build-utils] Add bypassToken to Prerender for iSSG (#3810)
This pull request adds a new `bypassToken` field to the `Prerender` output.

The field is required to be at least 128 bits for security reasons!
2020-02-20 01:59:45 +00:00
JJ Kasper
d8e98ee476 Publish Canary
- @now/next@2.3.16-canary.0
 - @now/routing-utils@1.5.4-canary.0
2020-02-19 16:23:25 -06:00
JJ Kasper
1bc1e8a9b1 [now-routing-utils] Update to not pass used segments in redirect query (#3809)
This updates to not pass segments already used in a redirect's destination query since these values are most likely unwanted and can still be manually added if desired. This change does not affect rewrites and we still pass through all segments in the query
2020-02-19 22:13:36 +00:00
JJ Kasper
274fdeb49a Publish Stable
- @now/next@2.3.15
2020-02-19 15:02:21 -06:00
JJ Kasper
d15c90b42f Publish Canary
- now@17.0.4-canary.3
 - @now/next@2.3.15-canary.0
2020-02-19 14:57:20 -06:00
JJ Kasper
5be2917c47 [now-next] Update 404 handling for pages/404 (#3697)
This adds handling for treating `pages/404.js` as the custom error page in Next.js to allow for more flexible auto static optimization on the 404 page. This makes sure we handle `pages/404.js` being a lambda due to `_app` having `getInitialProps` and also makes sure that visiting `/404` doesn't respond with a 200 status code

~We can add tests for this behavior after the below PR has been released in a canary of Next.js~

x-ref: https://github.com/zeit/next.js/pull/10329
x-ref: https://github.com/zeit/next.js/pull/10593
2020-02-19 20:55:26 +00:00
dependabot[bot]
5f08b24546 Bump codecov from 3.1.0 to 3.6.5 (#3807)
Bumps [codecov](https://github.com/codecov/codecov-node) from 3.1.0 to 3.6.5.
<details>
<summary>Release notes</summary>

*Sourced from [codecov's releases](https://github.com/codecov/codecov-node/releases).*

> ## v3.6.4
> Fix for Cirrus CI
> 
> ## v3.6.3
> AWS Codebuild fixes + package updates
> 
> ## v3.6.2
> command line args sanitised
> 
> ## v3.6.1
> Fix for Semaphore
> 
> ## v3.6.0
> AWS CodeBuild
> Semaphore v2
> 
> ## v3.3.0
> Added pipe `--pipe`, `-l`
</details>
<details>
<summary>Commits</summary>

- See full diff in [compare view](https://github.com/codecov/codecov-node/commits)
</details>
<details>
<summary>Maintainer changes</summary>

This version was pushed to npm by [drazisil](https://www.npmjs.com/~drazisil), a new releaser for codecov since your current version.
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=codecov&package-manager=npm_and_yarn&previous-version=3.1.0&new-version=3.6.5)](https://help.github.com/articles/configuring-automated-security-fixes)

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/zeit/now/network/alerts).

</details>
2020-02-19 20:19:49 +00:00
Steven
cc3026ffcb [tests] Fix builder debug flag (#3805)
When testing, you can set `NOW_BUILDER_DEBUG=1` to print verbose logs from builders.

However, this was causing some tests to fail that depended on a build environment variable.

This PR fixes the assignment so that it preserves the environment variables from the tests by adding `NOW_BUILDER_DEBUG` instead of replacing.
2020-02-18 22:57:17 +00:00
JJ Kasper
8cb6e56679 Publish Stable
- @now/next@2.3.14
2020-02-17 14:28:07 -06:00
JJ Kasper
7da5ff4b1d Publish Canary
- now@17.0.4-canary.2
 - @now/next@2.3.14-canary.1
2020-02-17 11:45:53 -06:00
JJ Kasper
5d1069d464 [now-next] Make sure to 404 and clear cache header for invalid _next requests (#3801)
This handles an edge case where deeply nested dynamic routes were handling `_next` 404s that were cached forever since the immutable header we set isn't cleared after not matching on the filesystem.

I updated our cache-header fixture to check for this edge case also to make sure we don't regress on this
2020-02-17 17:42:51 +00:00
Andy
6e1a72f557 [examples] Use Full URL for Logos (#3800)
Use Full URL for Logos

[PRODUCT-1193]

[PRODUCT-1193]: https://zeit.atlassian.net/browse/PRODUCT-1193
2020-02-17 13:44:35 +00:00
dependabot[bot]
6f97a2cc7a Bump yarn from 1.17.3 to 1.22.0 (#3796)
Bumps [yarn](https://github.com/yarnpkg/yarn) from 1.17.3 to 1.22.0.
<details>
<summary>Changelog</summary>

*Sourced from [yarn's changelog](https://github.com/yarnpkg/yarn/blob/master/CHANGELOG.md).*

> # Changelog
> 
> Please add one entry in this file for each change in Yarn's behavior. Use the same format for all entries, including the third-person verb. Make sure you don't add more than one line of text to keep it clean. Thanks!
> 
> ## Master
> 
> - Passes arguments following `--` when running a workspace script (`yarn workspace pkg run command -- arg`)
> 
>   [#7776](https://github-redirect.dependabot.com/yarnpkg/yarn/pull/7776) - [**Jeff Valore**](https://twitter.com/rally25rs)
> 
> - Prints workspace names with `yarn workspaces` (silence with `-s`)
> 
>   [#7722](https://github-redirect.dependabot.com/yarnpkg/yarn/pull/7722) - [**Orta**](https://twitter.com/orta)
> 
> - Implements `yarn init --install <version>`
> 
>   [#7723](https://github-redirect.dependabot.com/yarnpkg/yarn/pull/7723) - [**Maël Nison**](https://twitter.com/arcanis)
>   
> - Implements `yarn init -2`
> 
>   [#7862](https://github-redirect.dependabot.com/yarnpkg/yarn/pull/7862) - [**Maël Nison**](https://twitter.com/arcanis)
> 
> - Implements `yarn set version <version>` as an alias for `policies set-version`
> 
>   [#7862](https://github-redirect.dependabot.com/yarnpkg/yarn/pull/7862) - [**Maël Nison**](https://twitter.com/arcanis)
> 
> - Fixes an issue where the archive paths were incorrectly sanitized
> 
>   [#7831](https://github-redirect.dependabot.com/yarnpkg/yarn/pull/7831) - [**Maël Nison**](https://twitter.com/arcanis)
> 
> - Allows some dots in binary names again
> 
>   [#7811](https://github-redirect.dependabot.com/yarnpkg/yarn/pull/7811) - [**Valery Bugakov**](https://github.com/valerybugakov)
>   
> - Better error handling on `yarn set version`
> 
>   [#7848](https://github-redirect.dependabot.com/yarnpkg/yarn/pull/7848) - [**Nick Olinger**](https://github.com/olingern)
> 
> ## 1.19.2
> 
> - Folders like `.cache` won't be pruned from the `node_modules` after each install.
> 
>   [#7699](https://github-redirect.dependabot.com/yarnpkg/yarn/pull/7699) - [**Maël Nison**](https://twitter.com/arcanis)
> 
> - Correctly installs workspace child dependencies when workspace child not symlinked to root.
> 
>   [#7289](https://github-redirect.dependabot.com/yarnpkg/yarn/pull/7289) - [**Daniel Tschinder**](https://github.com/danez)
> 
> - Makes running scripts with Plug'n Play possible on node 13.
> 
></tr></table> ... (truncated)
</details>
<details>
<summary>Commits</summary>

- [`eee67d0`](eee67d02ed) v1.22.0
- [`6971622`](69716228e9) Update CHANGELOG.md
- [`0e7133c`](0e7133ca28) Fixes arbitrary file write on fetch ([#7831](https://github-redirect.dependabot.com/yarnpkg/yarn/issues/7831))
- [`fa613f3`](fa613f3a71) handle failed policy set-version ([#7848](https://github-redirect.dependabot.com/yarnpkg/yarn/issues/7848))
- [`f381c5f`](f381c5f0ce) Implements set version ([#7862](https://github-redirect.dependabot.com/yarnpkg/yarn/issues/7862))
- [`d2c3a48`](d2c3a485e0) Configure bug report issue template ([#7844](https://github-redirect.dependabot.com/yarnpkg/yarn/issues/7844))
- [`af4c205`](af4c2056a3) Allow dots in bin names ([#7811](https://github-redirect.dependabot.com/yarnpkg/yarn/issues/7811))
- [`1b334e6`](1b334e687b) fix(workspaces): Pass args following "--" when running workspace scripts ([#7786](https://github-redirect.dependabot.com/yarnpkg/yarn/issues/7786))
- [`2c8e97e`](2c8e97eaf3) Fix suggestions for CLI ([#7808](https://github-redirect.dependabot.com/yarnpkg/yarn/issues/7808))
- [`039bafd`](039bafd74b) Fixes bin overwrites ([#7755](https://github-redirect.dependabot.com/yarnpkg/yarn/issues/7755))
- Additional commits viewable in [compare view](https://github.com/yarnpkg/yarn/compare/v1.17.3...v1.22.0)
</details>
<details>
<summary>Maintainer changes</summary>

This version was pushed to npm by [daniel15](https://www.npmjs.com/~daniel15), a new releaser for yarn since your current version.
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=yarn&package-manager=npm_and_yarn&previous-version=1.17.3&new-version=1.22.0)](https://help.github.com/articles/configuring-automated-security-fixes)

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/zeit/now/network/alerts).

</details>
2020-02-15 01:56:34 +00:00
Steven
6e402bffc3 Publish Canary
- now@17.0.4-canary.1
 - @now/go@1.0.4-canary.2
 - @now/next@2.3.14-canary.0
2020-02-14 15:05:00 -05:00
Steven
e41d0f8e68 [now-go] Fix /api/go.sum detection (#3795)
Follow up to #3793 

The `go.mod` and `go.sum` file must both be moved.
2020-02-14 19:58:44 +00:00
Steven
1a046744f2 [now-go] Add support for root go.mod in api directory (#3793)
Some users wish to put all Go related code in the `/api` directory and the root is reserved for a frontend framework.

This PR adds support for `/api/go.mod` which will act the same as `/go.mod` by moving the file to the root.
2020-02-14 17:32:20 +00:00
Andy
a9bf011f2c [api] Add rewrite to frameworks API (#3794)
* [api] Add rewrite to frameworks API

* Adjust now.json

* Change output file
2020-02-14 00:30:58 +01:00
JJ Kasper
60c76b3290 [now-next] Add support for using the fallback file for dynamic SSG pages (#3752)
This adds support for using the fallback file for dynamic (lazy) SSG pages to allow showing a loading state while the cache is populated with data. We can add tests for this behavior once the below referenced PR is shipped on canary

x-ref: https://github.com/zeit/next.js/pull/10424

~Update: added tests now that fallback support has landed in Next.js although it appears `now-proxy` might need to be updated to revalidate the fallback correctly since the initial fallback is always being shown for lazy SSG pages with these changes~

Looks like this is working properly in `now-proxy` and we were overriding the prerender output with the static page output, thanks @juancampa for helping investigate! 🙏
2020-02-13 01:06:55 +00:00
Steven
c7ff1e7044 [now-cli] Update ZEIT Logo (#3790)
This PR updates the logo to match https://zeit.co/home
2020-02-12 10:17:54 -05:00
Andy Bitz
e2deaef54a Publish Canary
- @now/frameworks@0.0.10-canary.0
2020-02-12 14:46:11 +01:00
Andy
b2c7386c83 [frameworks] Adjust Next.js build command placeholder (#3788) 2020-02-12 14:34:09 +01:00
Steven
3dce84c3cf Publish Canary
- @now/go@1.0.4-canary.1
2020-02-11 16:46:21 -05:00
Steven
443b1ac158 [now-go] Fix path segments with square brackets (#3782)
Previously, `@now/go` would fail when using [Path Segments](https://zeit.co/docs/v2/serverless-functions/introduction#path-segments) since `go build` [doesn't support](https://stackoverflow.com/q/60140859/266535) files that begin with square bracket.

This PR changes the build logic so that the entrypoint file is renamed if if begins with a square bracket.

The output file is not renamed because v3 builders can't rename outputs which works great for this feature.
2020-02-11 21:41:57 +00:00
Andy Bitz
be3dca3d94 Publish Canary
- @now/build-utils@2.0.0-canary.1
 - now@17.0.4-canary.0
 - @now/go@1.0.4-canary.0
 - @now/python@1.1.4-canary.0
2020-02-11 16:50:13 +01:00
Andy Bitz
cb135e4329 [now-build-utils] Bump version 2020-02-11 16:50:01 +01:00
Andy
55c73b68bb [now-build-utils][now-cli] Refactor builds and routes detection (#3784)
* [now-build-utils] Refactor detect builds

* Refactor routes detection

* [now-cli] Adjust `now dev`

* Adjust tests

* Adjust integrations test

* Remove unused file

* Replace reducw with for-loop

* Add cache for absolute paths

* Filter while looping

* Add fallback for entrypoint with buildCommand
2020-02-11 16:47:39 +01:00
Steven
eb793ba139 [tests] Add windows to CI unit tests (#3727)
This adds initial support for Windows in GitHub Actions CI tests.

There is still work to be done to prevent certain tests from hanging in CI so those are skipped for now.
2020-02-11 01:16:14 +00:00
Steven
00908e8ebe [now-python] Fix path segments with square brackets (#3781)
Previously, python would fail when using [Path Segments](https://zeit.co/docs/v2/serverless-functions/introduction#path-segments) as seen in #3729.

This PR changes the import logic so that the entrypoint file is [imported as a relative file path](https://stackoverflow.com/a/67692/266535) instead of by module name.
2020-02-10 21:01:31 +00:00
Leo Lamprecht
5ce7ff86a4 Minor tweaks for CONTRIBUTING.md file (#3778)
* Minor tweaks for CONTRIBUTING.md file

* Update CONTRIBUTING.md

* Update CONTRIBUTING.md
2020-02-10 18:34:00 +01:00
Steven
4b34ee2993 [examples] Remove outdated jekyll build section from README (#3780)
We used to require a `package.json` but we have since introduced [Advanced Project Settings](https://zeit.co/blog/advanced-project-settings) which will ask the user for a build command during the first deploy.
2020-02-10 15:31:52 +00:00
Andi
646bd288ba [now-go] Update go to version 1.13.7 (#3750)
Updates go to the latest version 1.13.7 (https://golang.org/doc/devel/release.html#go1.13). This allows users to use the new error functionality that was introduced in go 1.13 (https://blog.golang.org/go1.13-errors) and also includes a couple of security fixes.

Looking at the last PR that updated the version (https://github.com/zeit/now-builders/pull/247/files) this should be as simple as updating the version number.

P.S. I tried to follow the contribution guidelines, but `yarn lint` fails with `exit code 1`/`295 problems (33 errors, 262 warnings)` and `yarn test` returns `error Command "test" not found` on master. But `yarn test-unit` shows no errors.
2020-02-08 01:47:47 +00:00
Steven
8aba6f1ff8 Publish Stable
- now@17.0.3
2020-02-07 20:01:17 -05:00
Steven
35e5e328aa Publish Canary
- now@17.0.3-canary.1
2020-02-07 19:18:47 -05:00
Andy
bdd4953d62 [now-cli] Consider root directory for now.json (#3764)
* [now-cli] Consider root directory for now.json

* Adjust message check in test

* Fallback if config does not exist as well

* Assign localConfig later and add debug

* Prefere now.json from root directory

* Comment

* Adjust test and add warning
2020-02-08 01:04:34 +01:00
Steven
e938b298e2 [now-cli] Fix port assignment for now dev (#3769)
This fixes a regression from #3749 where the PORT env var was removed. This is necessary so frameworks like create-react-app and gatsby can proxy to `now dev`.

Fixes #3761
2020-02-07 19:03:56 -05:00
Andy
b67f324e10 [api] Add hasDetectors property (#3770) 2020-02-08 00:29:11 +01:00
Andy Bitz
1dfa286af5 Publish Canary
- now@17.0.3-canary.0
2020-02-07 21:14:50 +01:00
Andy
d4391bd4cc [now-cli] Fix chalk template for legacy (#3768)
* [now-cli] Fix chalk template for legacy

* Update packages/now-cli/src/commands/deploy/legacy.ts

Co-Authored-By: Nathan Rajlich <n@n8.io>

Co-authored-by: Nathan Rajlich <n@n8.io>
2020-02-07 21:14:11 +01:00
luc
53eb71f26d Publish Stable
- now@17.0.2
 - @now/routing-utils@1.5.3
2020-02-06 19:18:35 +01:00
luc
92ffd654b5 Publish Canary
- now@17.0.2-canary.1
2020-02-06 18:53:36 +01:00
Luc
36b83f1606 [now-cli] Use npx or yarn to execute dev command (#3760)
1. Use bundled yarn to run `yarn bin`
2. Skip `yarn bin` if `npx` is used
2020-02-06 17:47:39 +00:00
Steven
7a79f620c0 [tests] Fix changelog script (#3751)
Previously, the changelog script was looking for the last "Publish Stable" commit, but it should really be looking for the last Stable release of Now CLI.

This PR updates the changelog script so that it fetches the latest GH Release (which should be Now CLI) and then compares that to the HEAD.
2020-02-06 14:35:15 +00:00
Steven
f3b286ecf3 Publish Canary
- now@17.0.2-canary.0
 - @now/routing-utils@1.5.3-canary.0
2020-02-06 09:12:19 -05:00
Steven
adf31c3fcc [now-routing-utils] Change behavior of trailingSlash: true redirects (#3745)
This PR changes the behavior of `trailingSlash: true` after we received feedback that files should not be redirected with a trailing slash. This matches the behavior of `serve` and `serve-handler`.

### Examples 
* `/index.html` => serve
* `/assets/style.css` => serve
* `/assets` => redirect to `/assets/`
* `/assets/style` => redirect to `/assets/style/` 

### Additional

In order to avoid duplicate content, this PR also adds redirects to files without a trailing slash.

* `/about.html/` => redirect to `/about.html`
* `/assets/style.css/` => redirect to `/assets/style.css`


Fixes #3731
2020-02-06 09:07:46 -05:00
luc
deacdfc47c Publish Stable
- now@17.0.1
2020-02-06 01:07:15 +01:00
Luc
ac9badbe9e [now-cli] Always output deployment url in stdout (#3753) 2020-02-06 00:58:24 +01:00
luc
62beb0f78d Publish Stable
- @now/frameworks@0.0.9
 - @now/build-utils@1.3.9
 - @now/cgi@1.0.3
 - now@17.0.0
 - now-client@7.0.0
 - @now/go@1.0.3
 - @now/next@2.3.13
 - @now/node@1.4.1
 - @now/python@1.1.3
 - @now/routing-utils@1.5.2
 - @now/ruby@1.0.2
 - @now/static-build@0.14.12
2020-02-05 23:03:23 +01:00
luc
5f9777f4af Publish Canary
- now@17.0.0-canary.35
2020-02-05 22:38:39 +01:00
Luc
e00db4437a [now-cli] Use npx when available to run dev command (#3749)
* use npx when available

* add --no-install

* replace $PORT and %PORT% in devCommand

* remove PORT from env variables

* replace more than one $PORT or %PORT%

* fix regex
2020-02-05 22:37:06 +01:00
Steven
b0e4f2590d Publish Stable
- @now/cgi@1.0.2
 - @now/go@1.0.2
 - @now/python@1.1.2
2020-02-05 15:09:14 -05:00
Leo Lamprecht
f0d58eac8c Remove now dev suggestion (#3748) 2020-02-05 20:50:21 +01:00
Steven
dae830d2b6 [examples] Fix hugo theme (#3746)
The Hugo theme was lost when transferring from `zeit/now-examples` to `zeit/now`.

This PR fixes the `.gitignore` file to include the `dist` directory and override our root `.gitignore`.
2020-02-05 19:30:08 +00:00
dependabot[bot]
e3071e4e29 Bump mixin-deep from 1.3.1 to 1.3.2 in /packages/now-cgi (#3736)
Bumps [mixin-deep](https://github.com/jonschlinkert/mixin-deep) from 1.3.1 to 1.3.2.
- [Release notes](https://github.com/jonschlinkert/mixin-deep/releases)
- [Commits](https://github.com/jonschlinkert/mixin-deep/compare/1.3.1...1.3.2)

Signed-off-by: dependabot[bot] <support@github.com>
2020-02-05 09:52:08 -05:00
Steven
073d7ece23 Publish Canary
- @now/build-utils@1.3.9-canary.0
 - now@17.0.0-canary.34
2020-02-05 08:29:10 -05:00
Andy Bitz
071258ba33 Publish Stable
- @now/build-utils@1.3.8
2020-02-05 03:27:31 +01:00
Andy
c0e00dc69a [now-build-utils] Fix build script check (#3743) 2020-02-05 03:27:17 +01:00
luc
6e5c136337 Publish Canary
- now@17.0.0-canary.33
2020-02-05 02:26:53 +01:00
Steven
60428cd4cf [now-cli] Bump @zeit/fun to 0.11.2 (#3741)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-02-05 02:20:54 +01:00
Luc
c6b9d80eec Fix now cli breaking tests (#3742) 2020-02-05 02:17:43 +01:00
Luc
953bdc10e5 [now-cli] Fix prompts and fetch team on windows (#3740)
* fix fetch on windows

* update inquirer

Co-authored-by: Leo Lamprecht <mindrun@icloud.com>
2020-02-05 01:58:49 +01:00
Andy Bitz
becdbd2136 Publish Stable
- @now/build-utils@1.3.7
2020-02-05 01:52:02 +01:00
Luc
da9bb31259 [now-cli] Handle no framework detected case (#3738)
* handle no framework detected case

* remove related test

* simplify

Co-authored-by: Leo Lamprecht <mindrun@icloud.com>
2020-02-05 01:49:13 +01:00
Luc
8cbf036921 [now-cli] Do not prompt for root directory when project is linked (#3737)
* do not prompt for root directory when linked

* run tests

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
Co-authored-by: Leo Lamprecht <mindrun@icloud.com>
2020-02-05 01:48:52 +01:00
Andy
8f66e4a308 [now-build-utils] Handle empty buildCommand and outputDirectory (#3739)
* [now-build-utils] Handle empty buildCommand and outputDirectory

* Update comment
2020-02-05 01:47:54 +01:00
Luc
9627b612f2 [now-cli] Do not show spinners with --debug (#3732)
* create output.wait and use it

* fix printing "ended" multiple times

* update more `wait` -> `output.spinner`

* timeout -> delay
2020-02-04 23:23:37 +01:00
Luc
8a9ded6d61 [now-cli] Slugify suggested project name (#3733)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-02-04 22:29:07 +01:00
Steven
d89c772bd5 [now-build-utils] Exclude _test.go files (#3735)
Typically, Go tests are side-by-side with their source files in a `_test.go`.

The Go documentation says the following:

> To write a new test suite, create a file whose name ends _test.go that contains the TestXxx functions as described here. Put the file in the same package as the one being tested. The file will be excluded from regular package builds but will be included when the “go test” command is run. [View Docs](https://golang.org/pkg/testing/)

This PR excludes the test files from being turned into Serverless Functions.
2020-02-04 21:11:26 +00:00
Steven
32137586b9 Publish Stable
- @now/static-build@0.14.11
2020-02-04 15:10:33 -05:00
Andy Bitz
9a3e435175 Publish Stable
- @now/frameworks@0.0.8
2020-02-04 21:06:30 +01:00
Andy
01d5a10ebd [@now/frameworks] Add Other (#3734)
* [@now/frameworks] Add Other

* Add logo

* Fix typo

* Add description
2020-02-04 21:03:56 +01:00
Steven
040658fbfa Publish Canary
- now@17.0.0-canary.32
 - @now/go@1.0.2-canary.0
2020-02-03 19:43:39 -05:00
Steven
51c00286a4 [now-go] Fix now dev on Windows (#3730) 2020-02-03 19:40:41 -05:00
Steven
c3e274fc2f [now-cli] Fix now dev when api file is added or removed (#3708)
This PR is a follow up to #3703 which fixes file output renaming on initial boot but not when files are added or removed while `now dev` is running. This PR fixes that behavior.
2020-02-03 16:30:37 -05:00
Steven
fe633c528a Publish Canary
- now@17.0.0-canary.31
 - @now/static-build@0.14.11-canary.2
2020-02-03 13:28:43 -05:00
Steven
5e306d49f8 [now-static-build] Fix error when HUGO_VERSION not found (#3724)
This PR improves the error message when the user specifies a version but that version does not exist.

- HUGO_VERSION
- ZOLA_VERSION
- GUTENBERG_VERSION

Typically this means there is no tag for that particular version. It could also mean there is a tag but no binary is attached to the tag/release.

![image](https://user-images.githubusercontent.com/229881/73673953-900f4e80-467d-11ea-90ed-3317cf83c74e.png)

![image](https://user-images.githubusercontent.com/229881/73673985-9d2c3d80-467d-11ea-8ee4-cc6ecabaac20.png)

Related to [zeit/docs#1624](https://github.com/zeit/docs/pull/1624)
2020-02-03 13:21:11 -05:00
Steven
274259b7dd [tests] Update to use github action cancel workflow (#3720)
Removes script and instead uses proper GitHub Action.

This reduces the time to run from 10 seconds to 5 seconds (due to ncc).

https://github.com/styfle/cancel-workflow-action
2020-02-02 02:47:33 +00:00
Steven
230e96c687 [tests] Change warn to error on unsed vars (#3715)
Follow up to #3714 that turns the warning into an error.

![image](https://user-images.githubusercontent.com/229881/73582375-ea7c9500-445a-11ea-9d20-2a17073a068a.png)
2020-02-01 00:41:40 +00:00
Nathan Rajlich
8c0c6e546d [now-cli] Remove unused fs import (#3714)
Fixes GH pull request auto-lint:

> #### Check warning on line 2 in `packages/now-cli/src/util/input/input-root-directory.ts`:
>
> ## GitHub Actions / Unit Tests (ubuntu-latest, 12)
>
> `packages/now-cli/src/util/input/input-root-directory.ts#L2`
>
> ```
> 'fs' is defined but never used
> ```
2020-01-31 18:57:09 -05:00
Steven
5e8541b936 [tests] Don't run tests in forks (#3713)
There is no need to run the tests in a fork because when the forked repo submits a PR to this repo, the tests will run.
2020-01-31 18:49:56 -05:00
Simon Hänisch
300558f24e [now-static-build] Add caching headers for Stencil (#3493)
/cc @adamdbradley @leo
2020-01-31 23:48:46 +00:00
Steven
829f7d8aeb Publish Canary
- @now/build-utils@1.3.7-canary.2
 - @now/python@1.1.2-canary.0
2020-01-31 16:48:34 -05:00
Steven
340f7db68a [now-python] Add excludeFiles config option (#3712)
This PR adds a `config.excludeFiles` pattern for `@now/python` that defaults to `node_modules/**` for users who are using a Node.js SSG frontend with Python APIs backend.

If the user chooses, they can override to any glob pattern such as `{.cache,node_modules}/**`.

Related to #2830
Related to #3416
2020-01-31 21:47:14 +00:00
luc
2fe987b5da Publish Canary
- now@17.0.0-canary.30
2020-01-31 22:13:11 +01:00
Andy
5b3aa48cd6 [now-cli] Adjust error message for Root Directory (#3710)
* [now-cli] Adjust error message for Root Directory

* Update packages/now-cli/src/commands/deploy/latest.js

Co-Authored-By: Luc <luc.leray@gmail.com>

Co-authored-by: Luc <luc.leray@gmail.com>
2020-01-31 21:36:06 +01:00
Steven
080d96bfa1 [api] Silence github comments (#3709)
Most PRs don't touch the examples api so let's silence the comments and cancel in-progress builds if we push again.

This should reduce the noise in this repository.

Documentation: https://zeit.co/docs/configuration#introduction/configuration-reference
2020-01-31 16:57:18 +00:00
Luc
7d9bf682b4 [now-cli] Add [copied to clipboard] (#3707) 2020-01-31 17:16:29 +01:00
Steven
a913a4f59f [tests] Cancel previous CI runs (#3706)
This PR adds an action to cancel previous runs for the current branch using the [github workflow api](https://developer.github.com/v3/actions/workflow_runs/).

This action is ignored for the `master` branch.
2020-01-31 09:30:09 -05:00
Andy Bitz
2042c96d98 Publish Canary
- now@17.0.0-canary.29
2020-01-31 13:30:12 +01:00
Steven
4ca0ff8426 [now-cli] Fix now dev file output renaming (#3703)
There was a bug where python src files were being renamed when it really should be the output files only.

This is a tricky bug because production deployments build all files first and then perform routing. So we simply rename lambda outputs with prod deployments. But `now dev` matches a request URL to a build before performing the build lazily so we have to rename source files.

The solution is to add both the original file name and the renamed file name in the `files` map so that it matches correctly but `zeit/fun` will still copy the original source files in the output correctly.

Routing will match on the extensionless file, the builder will use the file with extension (it doesn't know about file renaming), then the build results in a lambda output which is renamed to extensionless.

I added a test for `@now/python` and updated the `@now/bash` test.

Fixes #3638
2020-01-31 12:20:46 +00:00
Andy
554cc42d83 [now-cli] Add support for the rootDirectory property (#3686)
* [now-cli] Add support for the `rootDirectory` property

* Only check if rootDirectory exists

* Add test

* Support now dev

* Use defaults

* Comment

* Normalize the path input

* Adjust test

* Remove .only

* Adjust more tests

* Adjust test

* Fix test

* Remove unused import

* Update packages/now-cli/src/util/validate-paths.ts

Co-Authored-By: Luc <luc.leray@gmail.com>

* Run check on normalized path

* Add more checks

* Change error message

* Use basename as prefix

* Use correct path when linking

* Update packages/now-cli/src/util/input/input-root-directory.ts

Co-Authored-By: Luc <luc.leray@gmail.com>

Co-authored-by: Luc <luc.leray@gmail.com>
2020-01-31 12:56:09 +01:00
Steven
3f9e30d031 [docs] Update readme with CI status (#3704)
This repo no longer uses Circle CI since #3660 so this PR updates the badge in the readme.
2020-01-30 17:04:33 -05:00
luc
5a9ca8644c Publish Canary
- now@17.0.0-canary.28
2020-01-30 20:07:27 +01:00
Luc
3f362d4b50 [now-cli] Add scope indication to now secrets (#3699)
It looks like this:
![image](https://user-images.githubusercontent.com/6616955/73408935-03bbff00-42fe-11ea-9f1c-70860437c6bc.png)
2020-01-30 19:01:44 +00:00
Steven
7360886c9a [tests] Run unit tests on ubuntu and macos (#3702)
* [tests] Run unit tests on ubuntu and macos

* Add back Node 10 for Now CLI Tests

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-01-30 18:21:16 +01:00
Luc
5b8a1b47b0 [now-cli] Adjust name error messages (#3698)
* adjust `name` error messages

* return after outputting error
2020-01-30 18:10:44 +01:00
luc
0506b262d2 Publish Canary
- now@17.0.0-canary.27
2020-01-30 17:38:31 +01:00
Luc
17c4569f41 [now-cli] Send framework to api-deployments (#3701)
* send `framework` to api-deployments

* add error message

* Update packages/now-cli/src/util/input/edit-project-settings.ts

Co-Authored-By: Steven <steven@ceriously.com>

Co-authored-by: Steven <steven@ceriously.com>
2020-01-30 17:37:48 +01:00
Steven
888ff83309 Publish Stable
- @now/node@1.4.0
 - @now/python@1.1.1
2020-01-30 09:39:59 -05:00
Steven
7191421470 [tests] Fix rate limits for integration tests (#3696)
This PR will fix our CI rate limits for the "Now CLI Tests" check in GH Actions.

Thanks to @AndyBitz for most of the work in #3325
2020-01-29 16:24:02 -05:00
luc
e9c9aa5ce1 Publish Canary
- now@17.0.0-canary.26
2020-01-29 21:10:37 +01:00
Luc
d98f3d8140 [now-cli] Deprecate --name and now.json name property (#3690)
* remove `--name` from help

* add deprecation warning

* refactor

* deprecated `name` property in now.json

* add tests

* remove .only
2020-01-29 21:09:28 +01:00
Luc
fbf659e4e1 [now-cli] Add error message when running now dev on an unlinked folder (#3692)
* refactor getLinkedProject

* adjustments

* refactor getLinkedOrg

* refactor linkFolderToProject to skip linking

* fix dev tests

* adjust tests

* print deployment url for files

* fix missing `NOW_PROJECT_ID` check

* `process.status` -> `link.status`
2020-01-29 21:09:08 +01:00
Steven
6f7069aadd Publish Canary
- @now/python@1.1.1-canary.1
2020-01-29 13:26:41 -05:00
Steven
cef2c889f6 [now-python] Fix dependency detection in now dev (#3695)
Fixes a false positive regression from #3352 where `now dev`  assumed that local dependencies were already installed even when they were not.
2020-01-29 13:24:15 -05:00
Steven
e42d6c422a Publish Canary
- now@17.0.0-canary.25
 - @now/routing-utils@1.5.2-canary.4
2020-01-28 18:15:17 -05:00
Steven
2e9241b454 [now-routing-utils] Enabled case sensitive rewrites and set delimiter (#3688)
This enables case sensitive rewrites and redirects. It also changes the delimiter to `/` to match Next.js.

Unlike `routes` which were case insensitive, `rewrites` and `redirects` are case sensitive.

In the future, we may wish to add an option to toggle the sensitivity.
2020-01-28 18:13:57 -05:00
Steven
257a3b07fc [now-cli] Remove several v1 tests from CI (#3689)
These 5 tests are available in `integration-v1.js` already which can be executed manually.
2020-01-28 17:14:04 -05:00
luc
df9322b392 Publish Canary
- now@17.0.0-canary.24
2020-01-28 20:39:44 +01:00
Luc
28b5476bf3 [now-cli] Add link to "deploying files is deprecated" (#3685) 2020-01-28 20:38:50 +01:00
Luc
70a61f045f [now-cli] (Major) Use local .now scope for all commands and add scope to now whoami (#3643)
* use .now scope for commands

* add cache to getUser

* add cache on getTeams

* add cache for link

* refactor

* add error if NOW_ORG_ID is missing

* remove link cache

* refactor

* fix whoami

* add tests

* move fetching scope/org after subcommand condition

* Update packages/now-cli/src/util/projects/link.ts

Co-Authored-By: Andy <AndyBitz@users.noreply.github.com>

* remove userId from global scope

* show team and user in whoami command

* reset whoami

* Revert "move fetching scope/org after subcommand condition"

This reverts commit d145e6164074fe2442178cd8fafbeb225c978b9c.

* remove `client` from main scope

* tests adjustments

* adjust tests

* adjust tests (bis)

Co-authored-by: Andy <AndyBitz@users.noreply.github.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-01-28 20:38:27 +01:00
luc
238a8a8593 Publish Canary
- now@17.0.0-canary.23
 - now-client@7.0.0-canary.3
2020-01-28 15:48:36 +01:00
Luc
6f2d5c0045 [now-cli] Add README.txt when linking project (#3681)
* add README.txt when linking project

* replace ` with "

* add test

* Apply suggestions from code review

Co-Authored-By: Nathan Rajlich <n@n8.io>

* extract NOW_DIR_README.txt

* Update packages/now-cli/src/util/projects/NOW_DIR_README.txt

Co-Authored-By: Nathan Rajlich <n@n8.io>

Co-authored-by: Nathan Rajlich <n@n8.io>
2020-01-28 15:47:45 +01:00
Luc
fc798da398 [now-client] Update @types/node-fetch (#3682)
* update @types/node-fetch

* fix type error (another)

* add noEmitOnError

* add build test github action to test

* Revert "fix type error (another)"

This reverts commit 1d0dace70a0bf2dfb2473a48408e560f060e5c50.

* Revert "add noEmitOnError"

This reverts commit 57286016c69723b625293621f7474882f802521d.

* Revert "update @types/node-fetch"

This reverts commit 6979b5f866faaa141e5be1b1bda353f01a41349c.

* Revert "Revert "update @types/node-fetch""

This reverts commit 7459fb768cd9574854ac0f9f3d48eca1e5e63821.

* Revert "Revert "fix type error (another)""

This reverts commit 820db234f82d0a624cddb625529196807b571b5e.

* Revert "Revert "add noEmitOnError""

This reverts commit 896fdb9f33c7f5d62fea409a073de5c614d11024.

* Revert "add build test github action to test"

This reverts commit a2f1c2f914e6c66653dfabad262311ee2a2720b3.

* add noEmitOnError to now-cli

* fix signal-exit in yarn.lock
2020-01-28 11:42:32 +01:00
luc
0804483316 Publish Canary
- now@17.0.0-canary.22
2020-01-28 11:36:50 +01:00
Luc
4a087f842e [now-cli] Use devCommand from project settings locally (#3673)
* pull devCommand from cloud

* filter out front end builders with devCommand

* remove unnecessary import

* fix wrong directory listing with devCommand

* fix server not stopping

* Apply suggestions from code review

Co-Authored-By: Nathan Rajlich <n@n8.io>

* remove comment

* remove redundant "if"

Co-authored-by: Nathan Rajlich <n@n8.io>
2020-01-28 11:35:57 +01:00
luc
01c7bf0059 Publish Canary
- now@17.0.0-canary.21
2020-01-28 11:29:25 +01:00
Luc
6c439516db [now-cli] Add tip to connect git repositories after now login is successful (#3678)
* add tip after now login is successful

* write success message to stdout
2020-01-28 11:27:56 +01:00
Steven
0db4ee69ef [tests] Add timeout to test jobs (#3683)
Circle CI used to have a max timeout of 10 minutes.

This adds a timeout to each job so that hanging tests are noticed earlier.

For example, these have been "in progress" for 4 hours: 

![image](https://user-images.githubusercontent.com/229881/73222438-3a90ea00-4131-11ea-97a7-76651a2cce45.png)
2020-01-27 19:25:39 -05:00
Steven
aec8a7ac9a Publish Canary
- now@17.0.0-canary.20
 - now-client@7.0.0-canary.2
 - @now/routing-utils@1.5.2-canary.3
 - @now/ruby@1.0.2-canary.0
2020-01-27 17:08:32 -05:00
m5o
882bc8cb99 [now-ruby] Add rack examples to ruby integration tests (#3626)
* add rack examples to ruby integration tests
  * https://github.com/rack/rack

Co-authored-by: Steven <steven@ceriously.com>
2020-01-27 16:55:13 -05:00
Steven
9aad701dfd [now-routing-utils] Merge destination query string with path segments (#3679)
This PR changes the behavior so that `:segment` in the `source` is always added to the query string unless the `destination` query string already contains a key with the same name.
2020-01-27 16:24:10 -05:00
Luc
f224f574be [now-cli] Deprecate deploying files with Now CLI (#3650)
* deprecate uploading files instead of erroring

* fix misc bugs

* remove final `.`

* add test

* check .now folder does not exist in test

* clean up after test
2020-01-27 20:41:38 +01:00
Andy
e201eaa315 [frameworks] Extend CONTRIBUTING.md (#3675)
* [frameworks] Extend CONTRIBUTING.md

* Update .github/CONTRIBUTING.md

Co-Authored-By: Steven <steven@ceriously.com>

* Update .github/CONTRIBUTING.md

Co-Authored-By: Steven <steven@ceriously.com>

Co-authored-by: Steven <steven@ceriously.com>
2020-01-27 15:54:29 +01:00
Andy
b0ed1f2be0 [now-cli] Remove unused code (#3674)
* [now-cli] Remove unused code

* [now-cli] Remove more unused code
2020-01-27 15:19:41 +01:00
Steven
4ac33e1c03 [now-cli][now-client] Drop support for Node 8 (#3670)
Deployments no longer support Node 8 since reaching EOL so we can also drop all of the special casing used to support Node 8 in Now CLI and Now Client.

The `tsconfig.json` has been updated to ES2018 per [Node-Target-Mapping](https://github.com/microsoft/TypeScript/wiki/Node-Target-Mapping).
2020-01-27 13:32:07 +00:00
luc
27ca517666 Publish Canary
- @now/static-build@0.14.11-canary.1
2020-01-25 23:51:36 +01:00
Luc
734e9c072d [now-static-build] Add public folder to Gatsby cache (#3669)
* add `public` to gatsby cache

* add test
2020-01-25 23:38:36 +01:00
Forrest Oliphant
8db54f3093 [examples] Fix svelte example github link (#3657)
https://svelte.now-examples.now.sh/ currently points to https://github.com/zeit/now-examples/tree/master/svelte-functions ... this should be the right link.
2020-01-25 14:41:37 +00:00
Andy
886c0718d6 [tests] Fix GitHub Actions on master (#3664)
* Checkout master on master

* Check if checkout works

* Revert "Check if checkout works"

This reverts commit 66f712a43edfb938c551110c214661e4a920b492.

* Revert "Checkout master on master"

This reverts commit 41b6eab926474830629e758a51e7cfdd1947bdf2.

* Use --depth=10

* Add another fetch
2020-01-25 10:58:13 +01:00
Andy
e160a2f21f [tests] Use GitHub Actions for the tests (#3660)
* Initial Build step

* Typo

* Remove circleci config

* Fix command

* Change Node version

* Add unit tests

* Use artifact

* Fix workflow file

* Remove node_modules

* Remove .git

* Do not upload files

* Checkout master branch

* Use git fetch

* Add now-dev tests

* Fix workflow file

* Use node10 for building

* Use node12 for building

* Download Hugo before building

* Fetch master branch

* Do not cancel other jobs when one fails

* Add all tests

* Remove needs

* Add build step

* Move test up

* Use isCanary function and remove tests

* Update Publish workflow

* Update .github/workflows/continuous-integration.yml

Co-Authored-By: Steven <steven@ceriously.com>

* Specify more events

* Add publish.sh script

* Remove Node8

Co-authored-by: Steven <steven@ceriously.com>
2020-01-25 00:42:55 +01:00
JJ Kasper
e09a418423 Publish Stable
- @now/next@2.3.12
2020-01-24 12:33:56 -06:00
JJ Kasper
52d4464368 Publish Canary
- @now/next@2.3.12-canary.0
2020-01-24 12:31:50 -06:00
JJ Kasper
4dc635e5f2 [now-next] Revert handle: miss/hit (#3658)
This reverts `handle: miss/hit` as it still needs some things sorted out before we're ready to use it in `@now/next`
2020-01-24 18:22:25 +00:00
Steven
510fb7ee7e Publish Canary
- @now/build-utils@1.3.7-canary.1
 - now@17.0.0-canary.19
2020-01-24 12:16:13 -05:00
Steven
243451e94b [now-build-utils] Add function detectApiExtensions() (#3653)
* [now-routing-utils] Add function detectApiExtensions

* Add more tests, fix broken test

* Add missing check for extensions

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-01-24 12:07:29 -05:00
Andy Bitz
11bbda977d Publish Stable
- @now/frameworks@0.0.7
 - @now/next@2.3.11
2020-01-24 17:20:55 +01:00
Andy Bitz
62c050f394 Publish Canary
- now@17.0.0-canary.18
 - now-client@7.0.0-canary.1
2020-01-24 17:19:27 +01:00
Andy
bd5a013312 [now-client] (Major) Remove builds check from now-client and change events (#3648)
* [now-client][now-cli] Remove builds check from now-client

* [now-client] Adjust README and change version

* Change events and adjust build error

* Use message from error

* Update packages/now-cli/src/util/deploy/process-deployment.ts

Co-Authored-By: Luc <luc.leray@gmail.com>

* [now-cli] Rename event

* Make types more consistent

* Fix type in process-legacy-deployment

* Adjust type in test

* Update type

* Make events type simpler

Co-authored-by: Max <8418866+rdev@users.noreply.github.com>
Co-authored-by: Luc <luc.leray@gmail.com>
2020-01-24 17:18:56 +01:00
Andy Bitz
1823cf452e Publish Canary
- @now/next@2.3.11-canary.4
2020-01-24 16:09:18 +01:00
Andy
c426d72ccf [now-next] Include file mode for pseudo layers (#3655) 2020-01-24 16:08:39 +01:00
Alex Grover
ddf59c052d Remove duplicated line from .gitignore (#3651) 2020-01-24 11:03:51 +01:00
luc
1dcf6e7fb1 Publish Canary
- now@17.0.0-canary.17
2020-01-23 20:06:18 +01:00
Luc
d4f4792988 [now-cli] Add --confirm to help (#3625)
```
$ now --help
[...]
  -c, --confirm                  Confirm default options and skip questions
```
2020-01-23 19:00:55 +00:00
Steven
7e1f2bd10e Publish Canary
- @now/build-utils@1.3.7-canary.0
2020-01-23 12:29:22 -05:00
Steven
a80a1d0c1d [now-build-utils] Fix api directory detection (#3647)
There was an issue where `@now/next` was emitting an api directory with serverless functions but the functions should not be renamed.
2020-01-23 16:54:34 +00:00
Steven
8ff747b4d7 Publish Canary
- @now/next@2.3.11-canary.3
 - @now/routing-utils@1.5.2-canary.2
2020-01-23 09:37:30 -05:00
Steven
aa63b5a581 [github] Update codeowners (#3642)
Added a few more code owners
2020-01-23 00:25:25 +00:00
luc
2094ec3c99 Publish Canary
- now@17.0.0-canary.16
2020-01-23 00:57:56 +01:00
Luc
bf30d10211 [now-cli] Output error if NOW_PROJECT_ID/NOW_ORG_ID is defined without the other (#3630)
* output error if one of both env is missing

* add test

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-01-23 00:53:15 +01:00
Luc
ccc03c9c6e [now-cli] Add warning if linked project was deleted or access was removed (#3631)
![image](https://user-images.githubusercontent.com/6616955/72800302-4ff4a880-3c47-11ea-8d74-0ae0c18469da.png)
2020-01-22 23:27:30 +00:00
Steven
4b7367e2dc [now-routing-utils] Fix segments in query string (#3640)
This PR a regression when path segments are used in the query string.

Take a look at the following ASCII Table for why I had to delete certain parts of the parsed url before formatting again.

https://nodejs.org/api/url.html#url_url_strings_and_url_objects

Related to #3539
2020-01-22 22:46:47 +00:00
JJ Kasper
00aa56a095 [now-next] Add headers support for custom-routes (#3494)
This adds support for `headers` in custom-routes which was landed in Next.js. 

This also updates `@now/routing-utils` `convertHeaders` to call `sourceToRegex` to match behavior with Next.js and allow using `segments` to match in the header `source` as not being able to use the same syntax for a header `source` as a `redirect` source could get confusing
2020-01-22 20:45:36 +00:00
Steven
56ae93a2a5 [examples] Fix jekyll readme build command (#3639)
Fixes #3634
2020-01-22 18:19:12 +00:00
JJ Kasper
adb32a09d3 Publish Canary
- @now/next@2.3.11-canary.2
 - @now/routing-utils@1.5.2-canary.1
2020-01-22 11:46:57 -06:00
JJ Kasper
3358d8e44c [now-next] Add handle: miss and handle: hit for custom-routes (#3489)
This is required to match custom-routes behavior in Next.js by checking dynamic routes after each rewrite although is currently blocked on `now dev` also supporting the feature

This reverts commit 0da98a7f5d.
2020-01-22 17:39:27 +00:00
Steven
c3bd2698e8 [now-routing-utils] Disallow "status" in hit phase (#3637)
This will prevent any strange behavior since production already ignores status code in the hit phase.
2020-01-22 17:03:10 +00:00
Steven
a7baa4761d Publish Canary
- now@17.0.0-canary.15
2020-01-21 19:56:55 -05:00
Steven
5dd2daa970 [now dev] Add support for handle: miss and handle: hit (#3537)
- [x] Add tests from now-proxy for `handle: miss`
- [x] Add tests from now-proxy for `handle: hit`
- [x] Add file output renaming when `featHandleMiss` is true (also assign true for now dev)
2020-01-22 00:54:24 +00:00
JJ Kasper
dd36a489ed Publish Canary
- @now/frameworks@0.0.7-canary.0
 - @now/next@2.3.11-canary.1
 - @now/static-build@0.14.11-canary.0
2020-01-20 15:36:58 -06:00
JJ Kasper
2e742209e3 [now-next] Add initial support for static 404 (#3628)
This adds initial support for static 404 pages when enabled for Next.js applications > `9.2.1-canary.3` it also disables tracing/logging related to lambdas when there aren't any lambdas besides the `_error` when a static 404 is being used 

Closes: #3368
2020-01-20 20:55:08 +00:00
Andy
8d13464cba [frameworks][now-static-build] Use hugo -D --gc as build command (#3624)
* [frameworks][now-static-build] Use `hugo --gc` as build command

* Add -D option
2020-01-20 19:46:15 +01:00
Max Rovensky
20fdcfa0af Publish Stable
- @now/static-build@0.14.10
2020-01-18 04:00:08 +08:00
Max
fac004f83c [now-static-build] Remove legacy message from static build (#3618)
* Remove legacy message from static build

* Remove unused config

* Remove unused config
2020-01-17 20:59:10 +01:00
Andy Bitz
5fee4bbad1 Publish Stable
- @now/static-build@0.14.9
2020-01-17 20:21:52 +01:00
Andy
18e4b18839 [now-static-build] Ignore commands for non-zero-config (#3617) 2020-01-17 20:19:53 +01:00
Max Rovensky
b8627fd384 Publish Stable
- @now/static-build@0.14.8
2020-01-18 02:42:30 +08:00
Max
4e2db6f8a5 [now-static-build] Improve static build errors copy (#3616)
* Improve static build errors copy

* Update packages/now-static-build/src/index.ts

Co-Authored-By: Leo Lamprecht <mindrun@icloud.com>

* Update packages/now-static-build/src/index.ts

Co-Authored-By: Leo Lamprecht <mindrun@icloud.com>

Co-authored-by: Leo Lamprecht <mindrun@icloud.com>
2020-01-17 19:36:52 +01:00
Steven
b685a3afdd Publish Canary
- @now/next@2.3.11-canary.0
 - @now/node@1.3.6-canary.0
2020-01-17 13:09:32 -05:00
Steven
aea3f58970 [api] Fix build script (#3615)
I was getting errors when running `yarn build` locally because the public directory already exists.

This will make sure the public directory is deleted before generating it again.
2020-01-17 13:08:41 -05:00
Steven
b0bb90dc11 Bump node-file-trace to 0.5.1 (#3613)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-01-17 13:07:59 -05:00
Andy Bitz
2132c2463f Publish Stable
- @now/next@2.3.10
 - @now/static-build@0.14.7
2020-01-17 18:09:16 +01:00
JJ Kasper
60bf6e2420 [now-next] Update custom-routes tests (#3614)
This adds `permanent: boolean` to the redirects in the custom-routes tests for `@now/next` since this field is required for redirects in Next.js in the latest version 

unblocks: https://github.com/zeit/now/pull/3613
2020-01-17 16:42:55 +00:00
Andy Bitz
9badc9048c Publish Canary
- @now/static-build@0.14.7-canary.0
2020-01-17 00:52:38 +01:00
Andy
a74c1921f8 [now-static-build] Fix package.json command for frameworks (#3611)
* [now-static-build] Fix package.json command for frameworks

* Add test

* Rename function
2020-01-17 00:51:55 +01:00
luc
e6044f2e8d Publish Canary
- now@17.0.0-canary.14
2020-01-17 00:35:54 +01:00
Luc
78d1afa25e [now-cli] Add NOW_PROJECT_ID and NOW_ORG_ID env variable (#3588)
This PR adds `NOW_PROJECT_ID` and `NOW_ORG_ID` environment variables as a way to specify a project to deploy to when running `now`.

eg.
```
NOW_ORG_ID=abc NOW_PROJECT_ID=123 now
```

When using these environment variables:
- the folder is not linked to the project (ie. no `.now` is created)
- we interrupt the process and show an error message if the project is not found:
![image](https://user-images.githubusercontent.com/6616955/72369004-7a061200-36ff-11ea-8b37-168f5339a2bb.png)
2020-01-16 23:30:51 +00:00
luc
4792adf524 Publish Canary
- now@17.0.0-canary.13
2020-01-16 23:38:21 +01:00
Luc
4d8a99141b [now-cli] Improve formatting of new deploy command prompts (#3607)
- Adjust error prompt
- Add spinner while loading org and project
- Use lighter gray for infos
- Remove `{` in inspector url (was mistakenly added in https://github.com/zeit/now/pull/3599)
- Show error when entering a project name
- Fix bug with spinner not cleared when error is displayed
- "Finalizing" -> "Completing"

![image](https://user-images.githubusercontent.com/6616955/72535453-da6c8f00-3878-11ea-838d-dcb4367e5120.png)
2020-01-16 22:24:57 +00:00
Luc
7954ddc1d0 [now-cli] Create .gitignore if it doesn't exist (#3606)
When linking a new project, create `.gitignore` with `.now` if it doesn't exist yet. If it exists, adds `.now` to it.

Also adds a test for that.
2020-01-16 22:04:38 +00:00
Max
216a1fd9d2 [now-static-build] Use NowBuildError for static build errors (#3609)
This PR fixes error messages and uses `NowBuildError ` for static build errors
2020-01-16 18:41:28 +00:00
Luc
e5add6750c [now-cli] Remove .only and remove duplicate test (#3605) 2020-01-16 13:40:05 +01:00
Andy Bitz
b7533650e1 Publish Stable
- @now/frameworks@0.0.6
 - @now/build-utils@1.3.6
 - @now/static-build@0.14.6
2020-01-16 13:11:31 +01:00
luc
6272f5ce5c Publish Canary
- now@17.0.0-canary.12
2020-01-16 12:03:36 +01:00
Luc
bde0538efe [now-cli] Fix inspector url with custom domain suffix (#3599)
When the user is using custom domain suffix, the inspector url is a bit different:
```
https://zeit.co/{orgSlug}/{projectName}/{deploymentShortId}/{suffix}
```

This PR adds the necessary logic when constructing the inspector url.

cc @TooTallNate
2020-01-16 00:31:18 +00:00
Nathan Rajlich
5e6775fca0 [now-cli] Display assigned alias for v2 upgraded static legacy deployments (#3601)
Since v2 deployments are auto-assigned aliases, render as such to match more closely to the v2 pipeline when a static deployments was implicitly upgraded to the v2 platform.
2020-01-15 23:59:52 +00:00
Andy Bitz
e05e0dc40e Publish Canary
- @now/frameworks@0.0.6-canary.3
 - @now/build-utils@1.3.6-canary.0
 - @now/static-build@0.14.6-canary.0
2020-01-16 00:13:35 +01:00
Andy
96dbc6d348 [now-static-build][frameworks][examples] Fixes examples and adjust frameworks (#3584)
* [examples] Fix ionic-react example

* [examples] Fix vue example

* [examples] Fix mithril example

* [examples] Fix riot example

* Fix readmes

* [now-static-build] Add Zola

* Add tests

* [now-build-utils][frameworks] Adjust detect framework

* Move zola back

* Undo Hugo detection changes

* [examples] Fix Vue logo path

* [now-static-build] Use package.json script if defined instead of framework command

* [now-static-build] Add buildCommand everywhere

* Remove devCommand from frameworks.ts

* Fix type

* Change output directory

* [now-static-build] Remove minNodeRange

* Remove devCommand
2020-01-16 00:12:55 +01:00
luc
0a63bd47e8 Publish Canary
- now@17.0.0-canary.11
2020-01-15 23:27:08 +01:00
Luc
35dd50eb61 [now-cli] Pre-fill "project name" prompt (#3598)
* pre-fill project name prompt

* add test

* more tests

Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-01-15 23:26:23 +01:00
Andy
f70ed94c8c [api] Add Sentry (#3597)
* [api] Add Sentry

* Use function name

* Add test error

* Revert "Add test error"

This reverts commit 39cf8a61dad9fcdcb616e418a0deb6ffe9e04ea9.

* Revert "Revert "Add test error""

This reverts commit c718f201da9d80743319ac87e0d4560e718fff53.

* Add logging

* Revert "Add logging"

This reverts commit 39cd46c8bbeef9024e71fe70478068480a51545b.

* Revert "Revert "Revert "Add test error"""

This reverts commit e6f63ee21fabb4ac8fc065b74281dbcdf5811216.

* Ignore .env

* Use init function for Sentry inline
2020-01-15 23:21:03 +01:00
luc
fb0c8600a2 Publish Canary
- now@17.0.0-canary.10
2020-01-15 22:39:11 +01:00
Luc
5023bdd25d [now-cli] Always add two spaces after emojis and update emojis (#3596)
Updates emojis to fix "spacing issues" with previous emojis and always add 2 spaces after emojis.
- ℹ️ -> 📝
- ⚠️ -> 
- ☑️ -> 🔗



Also fixes a typo:
```
Linked to <project> (created .now and added it to .nowignore)
->
Linked to <project> (created .now and added it to .gitignore)
```

It looks like this:

![image](https://user-images.githubusercontent.com/6616955/72445323-d590d800-37b1-11ea-92eb-a3b503a95774.png)

![image](https://user-images.githubusercontent.com/6616955/72445618-47692180-37b2-11ea-9aed-3b3268c82ad3.png)


![image](https://user-images.githubusercontent.com/6616955/72445492-11c43880-37b2-11ea-8091-1e1e8ac8b3a0.png)
2020-01-15 21:37:57 +00:00
Nathan Rajlich
bf4917ccf2 [now-cli] Handle Now v1 to v2 upgrade (#3593)
* Print warnings / notices from the API
* Print `v2` instead of `v1` when upgraded to v2
* Wait for "alias-assigned" event in v1 pipeline when upgraded to v2
2020-01-15 21:13:44 +00:00
Luc
64aff3aef4 [now-cli] Add tests for project linking and framework detection (#3591)
Adds two test cases:
- linking a project and overwriting build settings
- "overwrite settings" prompt should not appear when no framework is detected
2020-01-15 20:54:18 +00:00
Nathan Rajlich
62b87d1ed1 [now-cli] Remove unnecessary console.log() (#3594)
Seems to be a leftover from dd1d9d856.
2020-01-15 14:58:42 +00:00
Andy
5872114c87 Adjust CONTRIBUTING.md for frameworks (#3592) 2020-01-15 04:11:05 +01:00
luc
ce04246051 Publish Canary
- now@17.0.0-canary.9
2020-01-14 22:21:00 +01:00
Luc
02b03d4533 [now-cli] Hide "overwrite project settings?" prompt if no framework is detected (#3589)
This PR updates the framework auto-detection flow in `deploy` command to not show "overwrite project settings?" prompt when the API returns a `framework` property that is `null`.
2020-01-14 21:09:16 +00:00
Steven
ea396a2c20 Publish Stable
- @now/build-utils@1.3.5
 - @now/next@2.3.9
 - @now/node@1.3.5
 - @now/static-build@0.14.5
2020-01-14 15:29:03 -05:00
Andy
8c083acf78 [now-cli] Change now dev log message from builders to Runtimes (#3590)
* [now-cli] Change `now dev` change log message from `builders` to `runtimes`

* Capitalize

* Capitalize
2020-01-14 20:29:52 +01:00
Steven
4edc1ff2ca Publish Canary
- @now/build-utils@1.3.5-canary.3
 - now@17.0.0-canary.8
 - @now/next@2.3.9-canary.0
 - @now/node@1.3.5-canary.0
 - @now/static-build@0.14.5-canary.2
2020-01-14 13:41:53 -05:00
Steven
ce76dc980d [now-build-utils] Use latest node if no package.json found (#3587)
In a previous release, we pinned the node version to the project so that we could upgrade new projects to a newer version of Node.js while maintaining backwards compatibility with existing projects.

This puts some burden on the user when they're deployment is a year old and their pinned version of Node reaches EOL. Because we currently force the user to add a package.json.

This PR changes the behavior so projects are no longer pinned. Instead, newer deployments get the latest Node unless they opt-in and pin via package.json.
2020-01-14 18:15:17 +00:00
Andy
fc4cb9a044 [now-cli] Fix certs error message and handling (#3585) 2020-01-14 17:39:14 +01:00
luc
a83eb5e729 Publish Canary
- now@17.0.0-canary.7
2020-01-14 16:08:19 +01:00
Luc
1ab6af86c8 [now-cli] Fix now rm -h (#3581)
Currently, `now rm -h` outputs:
![image](https://user-images.githubusercontent.com/6616955/72279572-b6ba0680-3636-11ea-826a-581ebc59c11c.png)

This PR fixes it:
![image](https://user-images.githubusercontent.com/6616955/72279694-f84ab180-3636-11ea-85e4-360069849748.png)
2020-01-14 12:32:58 +00:00
luc
b95d2bdcdc Publish Canary
- now@17.0.0-canary.6
2020-01-14 13:06:22 +01:00
Luc
29222fda9d [now-cli] Tackle deploy revamp feedback (#3580)
* fix "in your organization"

* add feedback link to canary version prompt

* `Detecting framework` -> `Setting up project`

* "Auto-detect project settings (<framework>)"

* "What’s your project’s name?"

*  ->  ☑️

* "organizations" -> "scope"

* always show feedback prompt for `now dev`

* dim feedback prompt
2020-01-14 13:04:40 +01:00
luc
13b22b38fd Publish Canary
- now@17.0.0-canary.5
2020-01-14 12:56:07 +01:00
Luc
9f9d5546ef [now-cli] Update logo 𝚫 -> ▲ (#3582)
The old "ZEIT Now" logo was displayed here, for example:
![image](https://user-images.githubusercontent.com/6616955/72279805-347e1200-3637-11ea-9eab-9b3050b86b74.png)


This PR updates it to the ▲ symbol. Can someone running Windows/Linux help me check the ▲ character also exists there? (cc @dav-is @marcosnils)
2020-01-14 11:54:56 +00:00
luc
22d93baf20 Publish Canary
- @now/frameworks@0.0.6-canary.2
 - now@17.0.0-canary.4
 - now-client@6.0.2-canary.2
2020-01-14 12:02:00 +01:00
Luc
a63ea8c884 [tests] Fix now-cli tests (#3576)
- [x] adds `--confirm` to `now deploy` command
- [x] adds `--confirm` to existing tests
- [x] fix settings types in `@now/frameworks`
- [x] write deployment url to stdout (instead of an alias)
2020-01-14 10:58:29 +00:00
Andy Bitz
41023c488e Publish Canary
- @now/static-build@0.14.5-canary.1
2020-01-13 21:34:19 +01:00
Andy
ebffc8af43 [now-static-build] Fix Docusaurus output directory (#3583)
* [now-static-build] Fix Docusaurus output directory

* Add tests
2020-01-13 20:35:18 +01:00
Naoyuki Kanezawa
e7cb9fc5e2 [tests] Revert NOW_TOKEN env for health checks (#3578)
As we discussed, the health checks need to assign `NOW_TOKEN` env var.

Co-authored-by: Steven <steven@ceriously.com>
2020-01-13 11:58:10 -05:00
Andy Bitz
bf92ffc1a7 Publish Canary
- @now/build-utils@1.3.5-canary.2
2020-01-13 17:15:28 +01:00
Andy
4f88089cfe [now-build-utils] Error for unused functions (#3579)
* [now-build-utils] Error for unused `functions`

* Update packages/now-build-utils/src/detect-builders.ts

Co-Authored-By: Steven <steven@ceriously.com>

Co-authored-by: Steven <steven@ceriously.com>
2020-01-13 17:14:41 +01:00
Andy Bitz
c0416189eb Publish Canary
- now@17.0.0-canary.3
2020-01-11 01:30:12 +01:00
Andy
e2105cec87 [now-cli] Fix emoji spacing (#3574) 2020-01-11 01:29:15 +01:00
Andy Bitz
6cb89c3cab Publish Canary
- now@17.0.0-canary.2
2020-01-11 01:14:04 +01:00
Andy
9a1877de56 [now-cli] Fix emoji width (#3573) 2020-01-11 01:13:20 +01:00
Andy Bitz
ea36b9e11c Publish Canary
- @now/frameworks@0.0.6-canary.1
 - now@17.0.0-canary.1
 - now-client@6.0.2-canary.1
 - @now/static-build@0.14.5-canary.0
2020-01-11 00:39:34 +01:00
Andy Bitz
478104cf99 Bump Now CLI version 2020-01-11 00:38:39 +01:00
Andy
c1dd0cfaba [now-client][now-cli] Revamp Now CLI deploy command (#3467)
* [now-cli] Add support for v12 and new detectors

* first draft

* fix typescript errors

* fix typescript errors (2)

* fix typescript types again

* fix bug in link.ts

* add inspect/preview/production logs

* log now cli version

* adjust copied to clipboard

* print inspector url earlier

* reset stamp when redeploying with project settings

* show "deploying" loader

* remove "..."

* add first prod deployment info logs

* add first prod deployment info logs (2)

* remove console.log

* always set projectName

* fix deploying spinner

* improve project settings edition

* implement flow improvements

* adjust "linked" message order

* add "detecting framework"

* defer printing indications to the end

* remove [in clipboard]

* refactor

* link correct folder when running `now <path>`

* fix incorrect scope when deploying to a team

* fix scope

* add project name in "linked to" message

* fix "project already exists"

* print to stdout

* remove old stdout.write

* remove incorrect `checked`

* remove `--yes`

* add prompts

* add @types/prompts

* try prompts for select org

* roll back to inquirer and add styling to select

* remove nonsense

* format text inputs + patch inquirer

* add confirm input and use for yes/no q

* remove prompts

* 💅 input details

* only copy default projectSettings partially

* adjust multiselect style

* remove console.log

* handle `x-now-tip` headers

* refactor patch-inquirer

* dim default project settings

* add spinners

* use clearTimeout to cancel spinner

* use 1s timeout

* do not apply timeout for deploying spinners

* remove .gitignore from diff

* fix tests

* Remove test

* Revert "Remove test"

This reverts commit 2dba1a8cc3894220fccd68746d07b198556b7ba8.

Co-authored-by: Luc <luc.leray@gmail.com>
Co-authored-by: Leo Lamprecht <mindrun@icloud.com>
2020-01-11 00:35:34 +01:00
Andy
15ce92b9e7 [gatsby-plugin-now] Remove temporarily (#3568)
* [gatsby-plugin-now] Remove temporary

* Remove from now-static-build
2020-01-11 00:08:20 +01:00
Andy
dd1b5f3421 [now-cli] (Major) Remove now alias without arguments (#3318)
* [now-cli] (Major) Remove `now alias` without arguments

* Update packages/now-cli/src/commands/alias/set.ts

Co-Authored-By: Nathan Rajlich <n@n8.io>

* Add URL

Co-authored-by: Nathan Rajlich <n@n8.io>
Co-authored-by: Leo Lamprecht <mindrun@icloud.com>
2020-01-10 23:58:23 +01:00
Nathan Rajlich
b8a11be1a5 [now-cli] Remove hard-refresh to rebuild for now dev (#3328)
This behavior is legacy from the very early days of `now dev`
(before the `files` array was returned from Runtimes) and adds
complexity. We can remove it at this point to simplify dev server.

Co-authored-by: Andy <AndyBitz@users.noreply.github.com>
Co-authored-by: Leo Lamprecht <mindrun@icloud.com>
2020-01-10 23:45:27 +01:00
Andy
1e308dc6ce [examples] Fix scully test (#3572) 2020-01-10 23:36:45 +01:00
Steven
117ce28ddc Publish Canary
- @now/frameworks@0.0.6-canary.0
 - @now/build-utils@1.3.5-canary.1
 - now@16.7.4-canary.0
2020-01-10 15:33:24 -05:00
Steven
85296de51d [now-build-utils] Add function detectApiDirectory() (#3567)
- Add new exported function `detectApiDirectory()`
- Add tests for both `detectApiDirectory()` and `detectOutputDirectory()`
2020-01-10 19:56:47 +00:00
Andy
0b659326d9 [frameworks] Revert rename (#3571)
* Revert "[frameworks] Fix import in test (#3570)"

This reverts commit 9ee86df69d.

* Revert "[frameworks] Rename frameworks to now-frameworks (#3569)"

This reverts commit daa5cbdd4b.
2020-01-10 20:36:17 +01:00
Andy
f35f244deb [now-build-utils] Only allow Serverless Functions in api/ (#3566)
Only allow Serverless Functions in `api/`.
2020-01-10 19:22:59 +00:00
Andy
9ee86df69d [frameworks] Fix import in test (#3570) 2020-01-10 20:01:56 +01:00
Andy
daa5cbdd4b [frameworks] Rename frameworks to now-frameworks (#3569)
* [frameworks] Rename frameworks to now-frameworks

* Adjust .nowignore
2020-01-10 19:13:27 +01:00
Andy
17b7a7bea9 [examples] Fix Nuxt.js example (#3565) 2020-01-10 17:44:37 +01:00
Andy
bcbe0d8060 [examples] Fix subdirectory (#3564) 2020-01-10 17:15:22 +01:00
Andy
3fdea52ff9 [examples] Add CODEOWNERS (#3545)
* Add CODEOWNERS

* Add EXAMPLE_README_TEMPLATE.md

* Add ember
2020-01-10 15:14:58 +01:00
Andy
3cd5a87e20 [examples] Add README (#3544) 2020-01-10 14:34:20 +01:00
Andy
4625f66ebd [examples] Adjust readmes and info endpoint (#3542)
* Adjust README links

* Change example info

* Fix id check
2020-01-10 13:37:33 +01:00
Andy
0c6c6677a7 [examples] Make -functions example the default (#3541)
* Remove now-examples references

* Adjust gatsby example

* Adjust svelte example

* Adjust vanilla example
2020-01-10 12:48:45 +01:00
Andy
2db627b79d Adds manifest.json to examples folder (#3536)
* Revert "Revert "[examples] Add manifest.json""

This reverts commit c65336e63b.

* Revert "Revert "Do not use now-examples anymore""

This reverts commit ac72e944a7.

* Update nowignore

* Fix join

* Fix JSON

* Fix header

* Replace manifest.json with @now/frameworks

* Adjust readmes

* Adjust .nowignore

* Update scully

* Fix description

* Update examples/create-react-app/src/App.js

Co-Authored-By: Shu Ding <ds303077135@gmail.com>

* Update readme

* Add websites

* Use https

* Adjust example URL

* Change order

Co-authored-by: Shu Ding <ds303077135@gmail.com>
2020-01-10 00:14:51 +01:00
Steven
7064f4ee40 Publish Canary
- @now/build-utils@1.3.5-canary.0
 - @now/routing-utils@1.5.2-canary.0
2020-01-09 11:52:54 -05:00
Steven
bf06e9c63c [now-routing-utils] Add extension to routes (#3534)
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-01-09 11:52:03 -05:00
Andy Bitz
c65336e63b Revert "[examples] Add manifest.json"
This reverts commit b7eca1d069.
2020-01-09 17:28:53 +01:00
Andy Bitz
ac72e944a7 Revert "Do not use now-examples anymore"
This reverts commit fdb74b7971.
2020-01-09 17:28:49 +01:00
Andy Bitz
fdb74b7971 Do not use now-examples anymore 2020-01-09 17:26:55 +01:00
Andy Bitz
b7eca1d069 [examples] Add manifest.json 2020-01-09 17:24:54 +01:00
Shu Ding
4930028674 Publish Stable
- @now/frameworks@0.0.5
 - @now/build-utils@1.3.4
 - now@16.7.3
 - @now/routing-utils@1.5.1
2020-01-10 00:12:08 +08:00
Andy
14a82717f1 Fix changelog.js script (#3535) 2020-01-09 17:09:27 +01:00
Andy
9a31d49bc9 Add prettier to package.json (#3532)
Co-authored-by: Leo Lamprecht <mindrun@icloud.com>
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
2020-01-09 16:55:33 +01:00
Shu Ding
f8ddda9a4a fix the name of create-react-app (#3533) 2020-01-09 16:55:12 +01:00
Steven
9d0b0c6e41 [now-routing-utils] Fix error handling on path-to-regexp error (#3523)
This PR fixes an issue where certain patterns caused `path-to-regexp` to throw when it should be returning an error object. The fix is to make sure all inputs work properly with `path-to-regexp` before continuing.
2020-01-09 15:32:22 +00:00
Shu Ding
7e584be2cd add back authorization header for github api (#3529) 2020-01-09 22:58:33 +08:00
Andy
4dd640636c Clean up files in the repo (#3528)
Clean up files in the repo
2020-01-09 14:16:46 +00:00
Andy Bitz
0a3ed02a33 Publish Canary
- @now/build-utils@1.3.4-canary.1
 - now@16.7.3-canary.0
 - @now/routing-utils@1.5.1-canary.0
2020-01-09 14:02:56 +01:00
Andy Bitz
97792dbad0 [now-cli] Bump @zeit/fun to 0.11.0 2020-01-09 14:01:47 +01:00
Steven
25ab63c969 [tests] Update tests for now-php custom runtime (#3524)
Our tests were failing so the latest `now-php` runtime should work properly.
2020-01-08 23:11:43 +00:00
JJ Kasper
6e06b13bf3 [now-routing-utils] Make sure to update segments in destination hash (#3517)
While migrating redirects on `/docs` I noticed we don't update segments in the `hash` of the destination. This updates to also handle these segments and adds a test for this behavior
2020-01-08 19:32:59 +00:00
Steven
6cf5892e27 Publish Canary
- @now/build-utils@1.3.4-canary.0
2020-01-08 11:21:26 -05:00
Steven
f65b7ec546 [now-build-utils] Add getDiscontinuedNodeVersions() function (#3522)
Add an exported function `getDiscontinuedNodeVersions()` so we can gracefully handle discontinued versions of Node in other parts of the system.
2020-01-08 16:15:55 +00:00
Max Rovensky
a36c2eabb3 Publish Stable
- @now/frameworks@0.0.4
 - @now/build-utils@1.3.3
 - now@16.7.2
 - @now/next@2.3.8
 - @now/node@1.3.4
 - @now/static-build@0.14.4
2020-01-08 21:21:09 +08:00
Max Rovensky
be93c55c0b Publish Canary
- now@16.7.2-canary.6
2020-01-08 20:32:00 +08:00
Andy
eeefbeaed4 Use project in now.json and remove unused file (#3518)
* Remove unused file

* Use project instead

* Remove project
2020-01-08 13:23:56 +01:00
Max
027bc6ab5a Don't render Synced X files when everything got deduped (#3520)
This removes `Synced XX files` message if the entire deployment got deduped
2020-01-08 10:03:40 +00:00
Andy
890de6a625 Add API for frameworks and examples (#3514)
* Add API for frameworks and examples

* Adjust headers

* Update frameworks list

* Always use latest

* Add types

* Use now repo for downloading and listing

* Use .existsSync

* Remove unused packages

* Use 307 for redirect

* Add examples

* Update tsconfig.json

Co-Authored-By: Steven <steven@ceriously.com>

* Make examples unique

* Remove detectors from frameworks API

* Use /api instead of Next.js

* Install dependencies

* Rename project

* Change name

* Empty

* Change name

* Update api/tsconfig.json

Co-Authored-By: Steven <steven@ceriously.com>

* Update examples

Co-authored-by: Steven <steven@ceriously.com>
2020-01-07 23:55:39 +01:00
Steven
537d508a1e Publish Canary
- @now/build-utils@1.3.3-canary.0
 - now@16.7.2-canary.5
 - @now/next@2.3.8-canary.0
 - @now/node@1.3.4-canary.0
 - @now/static-build@0.14.4-canary.0
2020-01-07 16:14:57 -05:00
Steven
3b98cdac4b [now-build-utils] Add property hideStackTrace (#3516)
This adds a few properties to NowBuildError so that we can display in the web interface.
2020-01-07 21:01:09 +00:00
Max Rovensky
aaf7d6b1cd Publish Canary
- @now/frameworks@0.0.4-canary.0
 - now@16.7.2-canary.4
2020-01-07 23:18:11 +08:00
Luc
d4b6814d40 [@now/frameworks] Improve Framework type (#3515)
Makes types more specific: we want to avoid missing project settings placeholder/value in the UIs that consume frameworks (cli, front-end, ...).
2020-01-07 15:12:33 +00:00
Max
a85f11aaef Store file count on file_count event for future use (#3505)
Fixes an undefined length issue introduced by #3502
2020-01-07 12:18:41 +00:00
Luc
090c3ef9fc [now-cli] Fix signal-exit in yarn.lock (#3508)
Fix https://github.com/zeit/now/pull/3490/files#r363418297.
2020-01-07 10:38:13 +00:00
Steven
46c8cb1a68 Publish Stable
- @now/build-utils@1.3.2
 - @now/next@2.3.7
 - @now/node@1.3.3
 - @now/static-build@0.14.3
2020-01-06 18:44:26 -05:00
Steven
faeb053ea6 Publish Canary
- @now/build-utils@1.3.2-canary.1
 - now@16.7.2-canary.3
 - @now/next@2.3.7-canary.1
 - @now/node@1.3.3-canary.1
 - @now/static-build@0.14.3-canary.1
2020-01-06 18:30:34 -05:00
Steven
708a09b86a [now-build-utils] Add usage of package.json engines (#3512)
Add a better upgrade message that shows usage of `engines` in the `package.json` file.
2020-01-06 18:29:08 -05:00
Steven
89403e93e4 Publish Canary
- @now/build-utils@1.3.2-canary.0
 - @now/next@2.3.7-canary.0
 - @now/node@1.3.3-canary.0
 - @now/static-build@0.14.3-canary.0
2020-01-06 17:01:47 -05:00
Steven
ecb0c08fe2 [now-build-utils] Fix now dev to use system node (#3509)
This PR will use the system installed version of Node.js and avoid printing a warning or error if a discontinued version is selected.

This optimization was already in `@now/node` but for some reason it was never add to `@now/next`.

The reason why its relevant today is because the warnings turned into errors due to Node 8 deprecation and we don't have the "Project" in `now dev` so we don't know which version of node to select.

So instead of determining the version, `now dev` will always use `node` in the PATH and avoid printing warnings or errors. This also results in less FS reads since we no longer need to read package.json.
2020-01-06 17:00:46 -05:00
Andy Bitz
0b88c158b9 Publish Stable
- @now/frameworks@0.0.3
2020-01-06 20:15:04 +01:00
Andy
ec3a38107a [frameworks] Add settings to frameworks (#3506)
* [frameworks] Add `settings` to frameworks

* Fix svelte

* Add `outputDirectory`

* Update Next.js outputDirectory placeholder

* Type settings

Co-authored-by: Leo Lamprecht <mindrun@icloud.com>
2020-01-06 20:12:38 +01:00
Steven
0c0f1c6eb5 Publish Stable
- @now/build-utils@1.3.1
 - @now/next@2.3.6
 - @now/node@1.3.2
 - @now/static-build@0.14.2
2020-01-06 13:21:41 -05:00
Steven
ed296ef733 Publish Canary
- @now/build-utils@1.3.1-canary.1
 - now@16.7.2-canary.2
 - @now/static-build@0.14.2-canary.0
2020-01-06 13:10:05 -05:00
Steven
246f47ec95 [now-static-build] Fix distDir when zero config framework is detected (#3507)
There was a regression with framework detection that was preferring the frameworks output directory instead of the `distDir` defined in the `@now/static-build`.

The fix is to only run framework detection when `builds` is not defined (ie zero config).

Related to https://github.com/Ebury/chameleon/pull/63
2020-01-06 18:07:25 +00:00
Steven
9d95b99b72 [now-build-utils] Add support for dynamic handle: miss (#3457)
This extends the behavior of `featHandleMiss: true` flag to do the following:

- Reduce zero config API routes so that only dynamic path segment files (`api/[id].js`) get a route.
- Remove zero config out directory route (`public/`)—the files will be renamed instead.
- Use redirects for API routes when `cleanUrls: true` and use rewrites when `cleanUrls: false` from extension to the extension-less file.
- Normalize existing routes to begin with `^` and end with `$`.
2020-01-06 16:07:47 +00:00
Steven
3de8ae9d7e Publish Canary
- @now/build-utils@1.3.1-canary.0
 - @now/node@1.3.2-canary.0
2020-01-06 10:19:23 -05:00
Steven
44f6e1904e [now-build-utils][now-node] Throw new NowBuildError() (#3496)
This PR does the following

- Add and export class, `NowBuildError`, that can be thrown to stop the build and print an error but it will not print a stack trace.
- Improve logic for discontinued node versions and add more tests
- Remove hack (#3425) for undefined TERM, fixed by updating dependencies
- Rename `silent` variable to `isAuto` which means the node version was automatically selected, not defined in `package.json`
- Rename `test` deployments to `test2020` so that a fresh project is created with latest Node.js 12.x
2020-01-06 15:00:27 +00:00
Max Rovensky
d9c84fc4ce Publish Canary
- now@16.7.2-canary.1
 - @now/python@1.1.1-canary.0
2020-01-06 21:45:01 +08:00
Max
b5142d935b Fix event order in CLI (#3502)
This should fix [PRODUCT-893](https://zeit.atlassian.net/browse/PRODUCT-893) and [PRODUCT-941](https://zeit.atlassian.net/browse/PRODUCT-941)
2020-01-06 13:43:44 +00:00
luc
718a451110 Publish Canary
- now@16.7.2-canary.0
 - now-client@6.0.2-canary.0
2020-01-06 11:24:45 +01:00
Andy
9755847855 [now-client] Ignore .env.* files by default (#3436)
Ignore `.env.*` files by default.

[PRODUCT-804]

[PRODUCT-804]: https://zeit.atlassian.net/browse/PRODUCT-804
2020-01-06 10:19:55 +00:00
Luc
abc417b6b3 [now-client] Use @zeit/fetch instead of node-fetch (#3490)
We want to take advantage of the better defaults and retry policies (among others).

This bumps `@zeit/fetch` and replaces `node-fetch` with `@zeit/fetch` in `now-client`.

Also update retry policy for "uploading" files to:
- base 10ms
- 5 retries
- factor 6

which means the timeouts are 10, 60, 360, 2160, 12960
2020-01-06 09:01:17 +00:00
Steven
d6f71c8d7b Publish Stable
- @now/frameworks@0.0.2
 - @now/build-utils@1.3.0
 - now@16.7.1
 - now-client@6.0.1
 - @now/next@2.3.5
 - @now/node@1.3.1
 - @now/python@1.1.0
 - @now/routing-utils@1.5.0
 - @now/static-build@0.14.1
2020-01-03 12:39:08 -05:00
JJ Kasper
d90892dc9c Publish Stable
- @now/next@2.3.4
2020-01-03 08:45:34 -06:00
Tim Neutkens
60d2f8b96c Publish Canary
- @now/next@2.3.4-canary.1
2020-01-03 12:36:15 +01:00
JJ Kasper
2488adf80d [now-next] Add support for experimental basePath (#3478)
* Add support for experimental basePath

* Update base-path fixture

* Update type

* Update basePath route source and add invariants
2020-01-03 12:32:20 +01:00
Steven
9deb5b31d2 Publish Canary
- now@16.7.1-canary.5
2020-01-02 19:32:01 -05:00
Steven
ae55823c3c Publish Canary
- @now/frameworks@0.0.2-canary.3
 - @now/build-utils@1.2.1-canary.7
 - @now/static-build@0.14.1-canary.8
2020-01-02 18:09:49 -05:00
Andy
d3395553fe [frameworks][now-static-build] Add support for Scully (#3469)
Add support for Scully.
2020-01-02 22:25:57 +00:00
JJ Kasper
e742dd3a48 Publish Canary
- @now/next@2.3.4-canary.0
2020-01-02 13:24:06 -06:00
JJ Kasper
4f0f44e746 Publish Stable
- @now/next@2.3.3
2020-01-02 13:18:38 -06:00
JJ Kasper
0da98a7f5d Revert "[now-next] Implement handle: miss for custom-routes (#3456)" (#3488)
This reverts commit 40bbff9bee.
2020-01-02 13:15:16 -06:00
Steven
685989ae57 Publish Canary
- @now/build-utils@1.2.1-canary.6
 - @now/next@2.3.3-canary.0
 - @now/node@1.3.1-canary.1
 - @now/static-build@0.14.1-canary.7
2020-01-02 12:42:36 -05:00
Steven
6bc121e7b1 [now-build-utils] Add support for getLatestNodeVersion() and config.nodeVersion (#3483)
This PR does a few things:

1. Add functions `getLatestNodeVersion()` and `getOldestNodeVersion()` for use in api-project.
2. Add property `config.nodeVersion` which has precedence over default Node 8.

We want new projects to use the latest node version without setting any configuration but we don't want to break old projects. So during project creation, the value of `getLatestNodeVersion()` will be saved and then each deployment of that project will assign that value to `config.nodeVersion`. 

Implements [PRODUCT-837]

[PRODUCT-837]: https://zeit.atlassian.net/browse/PRODUCT-837
2020-01-02 17:34:31 +00:00
JJ Kasper
56d3fed954 Publish Stable
- @now/next@2.3.2
2019-12-31 15:56:54 -06:00
JJ Kasper
40bbff9bee [now-next] Implement handle: miss for custom-routes (#3456)
This implements `{ handle: 'miss' }` which will allow more efficiently checking dynamic routes after a matching rewrite. This is not fully available in production yet and the tests will fail for this PR until it is ready in Now

x-ref: https://github.com/zeit/next.js/pull/9568
2019-12-31 19:36:50 +00:00
Steven
66ab011f4a Publish Canary
- @now/next@2.3.2-canary.0
 - @now/node@1.3.1-canary.0
2019-12-30 13:48:36 -05:00
Steven
f4237d3db0 [now-node][now-next] Bump node-file-trace to 0.4.1 (#3481)
Bumps `node-file-trace` to version [0.4.1](https://github.com/zeit/node-file-trace/releases/tag/0.4.1).

- Add special case for semver@7: [#87](https://github.com/zeit/node-file-trace/pull/87)
- Handle babel/ts compiled imports: [#79](https://github.com/zeit/node-file-trace/pull/79)
2019-12-30 18:26:32 +00:00
JJ Kasper
6f9a083dba [now-next] Add handling for new routes-manifest version (#3482)
This handles the new `routes-manifest` version in the latest canary of Next.js since we throw an error if the version isn't handled by `@now/next`

unblocks: https://github.com/zeit/now/pull/3481
2019-12-30 17:58:19 +00:00
dependabot[bot]
688fcc6a5b Bump handlebars from 4.1.2 to 4.5.3 (#3476)
Bumps [handlebars](https://github.com/wycats/handlebars.js) from 4.1.2 to 4.5.3.
<details>
<summary>Changelog</summary>

*Sourced from [handlebars's changelog](https://github.com/wycats/handlebars.js/blob/master/release-notes.md).*

> ## v4.5.3 - November 18th, 2019
> Bugfixes:
> 
> - fix: add "no-prototype-builtins" eslint-rule and fix all occurences - f7f05d7
> - fix: add more properties required to be enumerable - 1988878
> 
> Chores / Build:
> - fix: use !== 0 instead of != 0 - c02b05f
> - add chai and dirty-chai and sinon, for cleaner test-assertions and spies, 
>   deprecate old assertion-methods  - 93e284e, 886ba86, 0817dad, 93516a0
> 
> Security:
> 
> - The properties `__proto__`, `__defineGetter__`, `__defineSetter__` and `__lookupGetter__` 
>   have been added to the list of "properties that must be enumerable".
>   If a property by that name is found and not enumerable on its parent, 
>   it will silently evaluate to `undefined`. This is done in both the compiled template and the "lookup"-helper. 
>   This will prevent new Remote-Code-Execution exploits that have been
>   published recently.
> 
> Compatibility notes: 
> 
> - Due to the security-fixes. The semantics of the templates using
>   `__proto__`, `__defineGetter__`, `__defineSetter__` and `__lookupGetter__` in the respect that those expression now return 
>   `undefined` rather than their actual value from the proto.
> - The semantics have not changed in cases where the properties are  enumerable, as in:
> 
> ```js
> {
>   __proto__: 'some string'
> }
> ```
> 
> - The change may be breaking in that respect, but we still only 
>   increase the patch-version, because the incompatible use-cases
>   are not intended, undocumented and far less important than fixing
>   Remote-Code-Execution exploits on existing systems.
> 
> 
> 
> [Commits](https://github.com/wycats/handlebars.js/compare/v4.5.2...v4.5.3)
> 
> ## v4.5.2 - November 13th, 2019
> # Bugfixes
> 
> - fix: use String(field) in lookup when checking for "constructor" - d541378
> - test: add fluent API for testing Handlebars - c2ac79c
> 
> Compatibility notes:
> - no incompatibility are to be expected
></tr></table> ... (truncated)
</details>
<details>
<summary>Commits</summary>

- [`c819c8b`](c819c8b533) v4.5.3
- [`827c9d0`](827c9d0747) Update release notes
- [`f7f05d7`](f7f05d7558) fix: add "no-prototype-builtins" eslint-rule and fix all occurences
- [`1988878`](1988878087) fix: add more properties required to be enumerable
- [`886ba86`](886ba86c2f) test/chore: add chai/expect and sinon to "runtime"-environment
- [`0817dad`](0817dad7e7) test: add sinon as global variable to eslint in the specs
- [`93516a0`](93516a0b07) test: add sinon.js for spies, deprecate current assertions
- [`93e284e`](93e284ed9b) chore: add chai and dirty-chai for better test assertions
- [`c02b05f`](c02b05fa81) fix: use !== 0 instead of != 0
- [`8de121d`](8de121d21c) v4.5.2
- Additional commits viewable in [compare view](https://github.com/wycats/handlebars.js/compare/v4.1.2...v4.5.3)
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=handlebars&package-manager=npm_and_yarn&previous-version=4.1.2&new-version=4.5.3)](https://help.github.com/articles/configuring-automated-security-fixes)

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 ignore this [patch|minor|major] version` will close this PR and stop Dependabot creating any more for this minor/major 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/zeit/now/network/alerts).

</details>
2019-12-30 14:13:42 +00:00
Shu Ding
847102cf62 Publish Canary
- @now/frameworks@0.0.2-canary.2
2019-12-28 07:23:53 +08:00
Shu Ding
25d5b9c9cf add missing logos (#3475) 2019-12-28 07:22:47 +08:00
Nathan Rajlich
271bab786e Publish Canary
- now@16.7.1-canary.4
 - now-client@6.0.1-canary.1
 - @now/routing-utils@1.4.1-canary.3
2019-12-23 17:33:19 -08:00
Nathan Rajlich
028e023aba [now-routing-utils] Make status code be configurable (#3470)
Now v1 static deployments use 301 by default, so this change allows the routing utils to match that behavior.
2019-12-24 00:56:47 +00:00
Steven
39719eed20 [now-client] Fix single file deploy with new routing properties (#3465)
There is an undocumented feature that adds a route when a single file is deployed, for example a single image or a zip file. This was causing the legacy routes to be added even when `rewrites` or `redirects` was defined. This PR fixes that case when the user has a single file, `now.json`, with redirects defined.
2019-12-24 00:07:30 +00:00
Andy Bitz
438339258d Publish Canary
- @now/build-utils@1.2.1-canary.5
2019-12-23 22:21:11 +01:00
Andy
be445c987c [now-build-utils] Only add 404 route when there are no api routes (#3468)
* [now-build-utils] Only add 404 route when there are no api routes

* Fix startWith

* Update packages/now-build-utils/src/detect-routes.ts

Co-Authored-By: Steven <steven@ceriously.com>

* Import isHandler

Co-authored-by: Steven <steven@ceriously.com>
2019-12-23 22:20:10 +01:00
Andy Bitz
93fef7885b Publish Canary
- @now/static-build@0.14.1-canary.6
2019-12-23 18:32:49 +01:00
Andy
899c9962ad [now-static-build] Ensure outputDirectory is used when it exists (#3466) 2019-12-23 18:32:29 +01:00
Andy Bitz
2b601d2424 Publish Canary
- @now/static-build@0.14.1-canary.5
2019-12-23 17:15:20 +01:00
Andy
3e36b05434 [now-static-build] Fix outputDirectory and add test (#3464) 2019-12-23 17:14:19 +01:00
Andy Bitz
59c9665c3f Publish Canary
- @now/static-build@0.14.1-canary.4
2019-12-23 15:57:53 +01:00
Andy
901137c7f6 [now-static-build] Add missing frameworks (#3463)
* [now-static-build] Add missing frameworks

* Update test

* Revert "Update test"

This reverts commit 86b2169caf145200b164b0c2f860c22d50b495cb.
2019-12-23 15:55:41 +01:00
Andy Bitz
e594e7bbbb Publish Canary
- @now/build-utils@1.2.1-canary.4
2019-12-23 10:02:00 +01:00
Andy
a477b1c22e [now-build-utils] Add option to ignore build script (#3461) 2019-12-23 10:00:45 +01:00
Andy Bitz
22ac20d838 Publish Canary
- @now/frameworks@0.0.2-canary.1
 - @now/build-utils@1.2.1-canary.3
 - now@16.7.1-canary.3
 - now-client@6.0.1-canary.0
 - @now/static-build@0.14.1-canary.3
2019-12-20 16:30:42 +01:00
Andy
3794234d7a [now-build-utils][now-static-build][now-cli] Update detectors and undo previous changes (#3452)
* Revert detect-builders and detect-routes changes

* Add `projectSettings` and support non-api routes

* Start with framework detectors

* Update @now/static-build

* Update now-dev

* Update tests

* Use local builders fro testing with now-dev

* Add outputDirectory to @now/static builds

* Ignore update only for bundeled builders

* Revert now-dev builder changes

* Revert more changes

* Adjust tests further

* Update gridsome test

* Adjust hugo test

* Undo version change

* Read file instead of importing

* Ignore failed.page.txt

* Update packages/now-build-utils/src/detect-builders.ts

Co-Authored-By: Steven <steven@ceriously.com>

* Simplify outputDirectory

* Remove NODE_ENV

* Convert tests to typescript

* Remove console.log

Co-authored-by: Steven <steven@ceriously.com>
2019-12-20 16:29:39 +01:00
Andy Bitz
92a40db048 Publish Stable
- @now/next@2.3.1
2019-12-20 14:28:26 +01:00
Steven
502aad7c2b Publish Canary
- @now/build-utils@1.2.1-canary.2
 - now@16.7.1-canary.2
 - @now/next@2.3.1-canary.3
 - @now/python@1.0.2-canary.0
 - @now/static-build@0.14.1-canary.2
2019-12-19 13:33:02 -05:00
Steven
b49afb61a6 [now-build-utils] Add handle: miss route to zero config (#3403)
This PR adds the route `handle: miss` and a catch-all route for the api directory.

The plan is to rename files in `/api` and `/public` (in a future PR) to be extension-less and then the route is only used to rewrite the extension to the extension-less file (for example, `/api/user.go` => `/api/user`)

This reduces the routes needed for zero config (previously N routes for N files down to 1 route for N files).
2019-12-19 18:30:48 +00:00
Steven
d380902ad3 [all] Fix types for Route vs Source (#3450)
This PR deletes the incorrect `Route` type defined in `@now/build-utils` and instead relies on the correct type defined in `@now/routing-utils`. There is no change to runtime code since this is strictly a change to the typescript types. The one exception to this is I had to change the sort order for our build script so that `@now/routing-utils` is built first.

This is necessary for PR #3403
2019-12-18 23:10:26 +00:00
Andy
ffaed62094 [now-dev] Update tests with verbose logging (#3447)
Updates the tests for `now dev` to log more and make the hopefully more reliable.
2019-12-18 21:57:59 +00:00
Tommaso De Rossi
b0adeb68fe [now-python] Skip reinstalling user dependencies for now dev (#3352)
Same as #2926 but for python
Fixes #3351
2019-12-18 21:04:06 +00:00
JJ Kasper
2372832654 Publish Canary
- @now/next@2.3.1-canary.2
 - @now/routing-utils@1.4.1-canary.2
2019-12-18 13:57:42 -06:00
JJ Kasper
e6a9586b7e [now-routing-utils] Add replacing of multi-match characters (#3446)
This makes sure to replace multi-match characters used in `path-to-regexp` when converting redirects.

Fixes `/:path*/` being converted to `/$1*/` and now converts it to `/$1/`
2019-12-18 19:43:58 +00:00
Tim Neutkens
9687415eed Publish Canary
- @now/next@2.3.1-canary.1
2019-12-18 10:54:34 +01:00
JJ Kasper
49b375ed6a [now-next] Disable running next export from export-intent (#3448)
As requested by @timneutkens after investigating we're disabling auto running `next export` for the user during a build since most users who want their app exported will define `next export` in their `build` script
2019-12-18 03:01:33 +00:00
Shu Ding
906dea096e Publish Canary
- @now/frameworks@0.0.2-canary.0
 - @now/next@2.3.1-canary.0
2019-12-18 03:04:00 +08:00
Shu Ding
3225a83084 Add @now/frameworks (#3445)
* add @now/frameworks

* add newlines

* add websites

* add logos
2019-12-18 02:35:45 +08:00
JJ Kasper
87794cfcc5 [now-next] Remove node 8 test (#3426)
This removes the `node 8` firebase test since `node 8` is being deprecated and we have the same test running against `node 10` also
2019-12-17 16:08:56 +00:00
Steven
79ad0ce0c4 Publish Canary
- @now/routing-utils@1.4.1-canary.1
2019-12-17 10:24:05 -05:00
Steven
fda5987465 [now-routing-utils] Merge routes with multiple handles (#3442)
This PR adds support for `handle: miss` and `handle: hit` and really any arbitrary `handle` when merging routes from the builder and from the user.
2019-12-17 15:16:07 +00:00
Andy Bitz
5cfdd5a6b2 Publish Canary
- @now/build-utils@1.2.1-canary.1
 - now@16.7.1-canary.1
 - @now/static-build@0.14.1-canary.1
2019-12-17 15:32:03 +01:00
Andy Bitz
bd6e0f9f93 Publish Stable
- @now/next@2.3.0
2019-12-17 15:30:37 +01:00
Andy
aa8d002309 [now-cli][now-build-utils] Adjust tests for new detectors (#3443)
* Adjust README

* Fix now-dev test

* Add hugo to the PATH

* Fix Hugo build

* Add more logging

* Resolve path

* Do not use the build script as dev command

* Update yarn.lock file

* fetch with retry

* Remove sh from README

* Use Set for Hugo config files
2019-12-17 15:27:12 +01:00
Andy Bitz
42ce9aca86 Publish Canary
- @now/build-utils@1.2.1-canary.0
 - now@16.7.1-canary.0
 - @now/next@2.2.1-canary.1
 - @now/routing-utils@1.4.1-canary.0
 - @now/static-build@0.14.1-canary.0
2019-12-17 00:25:35 +01:00
Andy
156f596189 [now-cli][now-static-build] Add support for buildCommand, devCommand and outputDirectory (#3434)
* Revert "Revert "[now-static-build] Add support `buildCommand`, `devCommand` and `outputDirectory` (#3422)" (#3428)"

This reverts commit f7b4dd4458.

* Handle generic node projects with /public

* Remove .only

* Ensure node_modules/.bin is also available during `now dev`

* Remove config log

* Adjust test

* Fix integration tests

* Fix public check

* Remove build + public

* Remove _scan

* Remove any casting

* Use `spawnCommand` for dev

* Remove unused import

* Remove cross-spawn

* Fix null config

* Fix build

* Only do a single Buffer.concat
2019-12-17 00:21:58 +01:00
JJ Kasper
8acfd5bf71 [now-next] Add testing for export handling (#3437)
Follow up to #3431 adding tests for this behavior

Tests to add:
- [x] custom routes: redirects
- [x] custom routes: rewrites
- [x] confirming each test is actually a `next export` deploy somehow
2019-12-16 22:47:36 +00:00
Andy
76c99ebb28 [now-build-utils] Restore previous detectors (#3441) 2019-12-16 23:20:48 +01:00
Alejandro Pacheco
5fb119b99c [now-cli] Changed scale error message (#3394)
The error message does not give a clear reason of why it failed
2019-12-16 21:44:40 +00:00
Steven
99b766d9cb [now-routing-utils] Add validation for handle:hit and handle:miss (#3438)
This PR adds initial support for `handle: hit` and `handle: miss` routes.
2019-12-16 20:56:48 +00:00
Andy
c207cf9b40 [now-cli] Change --team warning style (#3439)
* [now-cli] Change warning style

* Adjust test

* Fix screen error
2019-12-16 19:38:43 +01:00
Andy
dd00ac4621 [now-cli] Change automatic version detection message (#3440)
* [now-cli] Change automatic version detection message

* Fix unit test
2019-12-16 19:16:23 +01:00
Allen Hai
3d18a067a0 remove unused vars from builder-cache file (#3411) 2019-12-16 09:03:58 -05:00
Tim Neutkens
c48571a799 Publish Canary
- @now/next@2.2.1-canary.0
2019-12-16 12:49:02 +01:00
Joe Haddad
6eeb6983d9 [now-next] Support for next export (#3431)
* Add Support for `next export`

* Add some test cases

* tests require canary next.js

* bump

* fix test cases

* Update packages/now-next/src/index.ts

Co-Authored-By: Joe Haddad <joe.haddad@zeit.co>

* Update packages/now-next/src/index.ts

Co-Authored-By: Joe Haddad <joe.haddad@zeit.co>
2019-12-16 12:46:39 +01:00
Steven
aee33f040d Publish Stable
- @now/build-utils@1.2.0
 - @now/cgi@1.0.1
 - now@16.7.0
 - @now/go@1.0.1
 - @now/next@2.2.0
 - @now/node@1.3.0
 - @now/python@1.0.1
 - @now/ruby@1.0.1
 - @now/static-build@0.14.0
2019-12-14 07:58:04 -05:00
Steven
b100677b3b Publish Canary
- @now/next@2.1.2-canary.3
2019-12-14 07:18:41 -05:00
Joe Haddad
9241b3ae2f [now-next] Compute Rewrites & Redirects Earlier (#3430)
This PR strictly moves code to make the diff for an upcoming PR cleaner.
2019-12-14 03:04:35 +00:00
Steven
1088da6871 Publish Canary
- @now/build-utils@1.1.2-canary.5
 - now@16.6.4-canary.6
 - @now/next@2.1.2-canary.2
 - @now/node@1.2.2-canary.2
 - @now/static-build@0.13.2-canary.3
2019-12-13 18:12:54 -05:00
Andy
f7b4dd4458 Revert "[now-static-build] Add support buildCommand, devCommand and outputDirectory (#3422)" (#3428)
This reverts commit 5a6d1a135f.
2019-12-13 18:12:16 -05:00
Steven
fb85b6b27a Publish Canary
- @now/build-utils@1.1.2-canary.4
 - now@16.6.4-canary.5
 - @now/next@2.1.2-canary.1
 - @now/node@1.2.2-canary.1
 - @now/static-build@0.13.2-canary.2
2019-12-13 17:24:55 -05:00
Steven
2e5e9b9a6f [now-build-utils] Fix error tput: No value for $TERM and no -T specified (#3425) 2019-12-13 17:23:41 -05:00
Steven
d3cc306e5b [now-build-utils] Remove unused execa (#3427)
~~Reverts the execa bump from #3422~~

Removes `execa` since it is no longer used.
2019-12-13 17:23:18 -05:00
Steven
d6c6a2a271 [docs] Fix broken link to runtimes (#3424) 2019-12-13 15:48:06 -05:00
Andy Bitz
6171a58ae3 Publish Canary
- @now/build-utils@1.1.2-canary.3
 - now@16.6.4-canary.4
 - @now/static-build@0.13.2-canary.1
2019-12-13 19:39:50 +01:00
Andy
5a6d1a135f [now-static-build] Add support buildCommand, devCommand and outputDirectory (#3422)
* [now-static-build] Handle `buildCommand`, `devCommand` and `outputDirectory`

* Adjust tests

* Swap order

* Add `node_modules/.bin` to PATH

* Remove @types/execa

* Append PATH only to spawn options

* Remove test check

* Only add when there is a command
2019-12-13 19:30:09 +01:00
Steven
68deab9007 [tests] Fix unit test coverage (#3420)
This PR reduces the time running Circle CI tests.

Since creating the monorepo in #2812, the coverage broke and then was fixed in #2876 with a workaround which would run unit tests twice.

More recently, we enabled Now CLI to always run tests in #3305 so that means coverage data is always generated.

This PR is a final proper fix so that unit tests run once which saves approximately 2 minutes per push (CI workflow).
2019-12-12 22:13:02 +00:00
Steven
d6114e2bef [deps] Fix yarn.lock signal-exit (#3419)
This patch was lost in a previous PR so I added it back
2019-12-12 20:16:21 +00:00
Steven
5fdc55f3fb [now-cli] Remove dead link to max lambda size (#3418)
We used to have a default `maxLambdaSize` and allow the user to increase to 50 MB.

However, this is no longer true. Today, the `maxLambdaSize` for every function is 50 MB and is not configurable, it's a hard limit.

This PR removes the dead link to avoid confusion like in Issue #3416.
2019-12-12 19:41:54 +00:00
Mark Glagola
751b166536 [now-cli] Add renewal price to now domains inspect (#3401)
Adds `Renewal Price` to `now domains inspect` command if the domain was bought with ZEIT.
2019-12-12 18:03:19 +00:00
Andy Bitz
6ffc8d97f4 Publish Canary
- @now/build-utils@1.1.2-canary.2
 - now@16.6.4-canary.3
2019-12-12 18:37:10 +01:00
Andy
67a80d6b83 [now-cli][now-build-utils] Update detectors (#3402)
* [now-build-utils] Consider `yarn build` and `npm run build` as `buildCommand`

* [@now/build-utils] Update new detectors

* Update unit tests

* [@now/build-utils] Update detect-builder and detect-routes

* Update tests

* Run prettier

* Add more tests

* [now-cli] Use default detectors

* Add now-dev test

* Add a generic node project fallback

* Fix build

* Use public as default

* Ensure generic node project is last

* Update tests

* Update tests again

* Update packages/now-build-utils/src/detectors/filesystem.ts

Co-Authored-By: Nathan Rajlich <n@n8.io>

* Remove parentheses

* Revert "Remove parentheses"

This reverts commit 03f9aba07b0a6d4088719ca9afd602ce8fb1e9c1.

* Use getDependencyVersion instead of hasDependency
2019-12-12 18:28:24 +01:00
Steven
934cf772bc Publish Canary
- @now/build-utils@1.1.2-canary.1
 - now@16.6.4-canary.2
2019-12-12 10:58:21 -05:00
Andy
b01a24afdb [now-build-utils][now-cli] Move builds schema and functions schema to build-utils (#3417)
* [@now/build-utils] Add functions schema

* [now-cli] Use functions schema from build-utils

* Move buildsSchema to build-utils

* Add retries to test

* Add await
2019-12-12 16:02:19 +01:00
hi_Haowen
0ad75b52bf [now dev] Fix validate functions config failed in now json (#3414)
Follow up to #3408 .

```
> Error! Checking for updates failed
> Now CLI 16.6.3 dev (beta) — https://zeit.co/feedback/dev
> Error! Invalid `functions` property: ['api/test.js'] should NOT have additional properties
```
2019-12-12 13:59:39 +00:00
Andy Bitz
050772e78a Publish Canary
- now@16.6.4-canary.1
2019-12-12 13:23:12 +01:00
Andy
7c05dc1420 [now-cli] Do not handle cert errors for deployments (#3409)
Domain related things for deployment will now happen async
2019-12-12 13:19:26 +01:00
Steven
bdd25ac727 Publish Canary
- @now/build-utils@1.1.2-canary.0
 - @now/cgi@1.0.1-canary.1
 - now@16.6.4-canary.0
 - @now/go@1.0.1-canary.1
 - @now/next@2.1.2-canary.0
 - @now/node@1.2.2-canary.0
 - @now/python@1.0.1-canary.1
 - @now/ruby@1.0.1-canary.1
 - @now/static-build@0.13.2-canary.0
2019-12-11 17:30:11 -05:00
Steven
3a27328828 [now-build-utils] Discontinue Node 8 (#3406)
This PR adds a `discontinueDate` to Node 8 and prints a warning if the current deployment is using it.

```
    ┌──────────────────────────────────────────────────────────────────────────────────────────────┐
    │                                                                                              │
    │   WARNING                                                                                    │
    │                                                                                              │
    │   Node.js 8.10.x will be discontinued on 2020-01-06.                                         │
    │   Deployments created on or after 2020-01-06 will fail to build.                             │
    │   Please use one of the following supported `engines` in `package.json`: ["12.x","10.x"]     │
    │   This change is a result of a decision made by an upstream infrastructure provider (AWS).   │
    │   Read more: https://docs.aws.amazon.com/lambda/latest/dg/runtime-support-policy.html        │
    │                                                                                              │
    └──────────────────────────────────────────────────────────────────────────────────────────────┘
```

Starting January 2020, Node 8 deployments will fail to build and print an error.

```
Found `engines` in `package.json` with an unsupported Node.js version range: 8.10.x
Please use one of the following supported ranges: ["12.x","10.x"]
```

[PRODUCT-796]

[PRODUCT-796]: https://zeit.atlassian.net/browse/PRODUCT-796
2019-12-11 22:27:16 +00:00
Nathan Rajlich
c076a5620f [all] Move "Downloading deployment source files" message to download() (#3413)
Before, the debug log message "Downloading user files..." was copy+pasted to all the builders.

This change centralizes that log message to be inside the `download()` function for consistency and DRY purposes.

Additionally, the wording has changed as per [INFRA-289], and a resulting timestamp message is also printed.

[INFRA-289]: https://zeit.atlassian.net/browse/INFRA-289
2019-12-11 20:59:14 +00:00
Nathan Rajlich
2bd8ef9eed [now-next] Do not pass runtime env vars via argv in now dev (#3340)
Before this change, in `@now/next` when running via `now dev`,
the runtime env vars get passed to the child `dev-server.js`
process via argv.

This is problematic because it causes the env vars to be visible in
the process listing, and also causes the command itself to be very
large.

In some cases, with a lot of env vars, we've seen the command be too
large and it will fail to spawn (https://serverfault.com/a/163390/294389).

This changes the start-up process such that the env vars are passed
in via Node.js `fork()` IPC, rather than via `argv`.
2019-12-11 19:18:08 +00:00
JJ Kasper
500014f2fc [now-next] Handle symlinks in createPseudoLayer (#3404)
This makes sure to handle symlinks created in mono repos while creating the zip for a lambda based page in Next.js

Fixes #3400
2019-12-11 15:43:14 +00:00
JJ Kasper
17687e9bcd Fix unused pre-commit package overriding husky (#3405)
Saw my `pre-commit` hook wasn't being triggered after running `yarn` and noticed it was due to an un-used `pre-commit` dependency in `now-cli` overriding the changes to my `.git/hooks/pre-commit` file done by `husky`

**Note**: you will probably need to run `yarn install --force` after this is applied before the correct `pre-commit` changes are applied by `husky`
2019-12-11 14:35:30 +00:00
Andy
90354e9fe7 [now-cgi][now-next][now-ruby] Unify logging about downloading user files (#3397)
* [now-cgi][now-next][now-ruby] Unify logging about downloading user files

* Update next tests

* Bump Next.js Version
2019-12-10 21:15:32 +01:00
Leo Lamprecht
6236631beb [now-dev] Improved feedback link (#3399)
We've shut down our Typeform for feedback, so we can simply the feedback link. The old one will continue working, but we should start using the new one.

Pending on https://github.com/zeit/front/pull/5874.

Fixes #3377
2019-12-10 18:18:10 +00:00
Steven
75aefdddd6 Publish Stable
- @now/build-utils@1.1.1
 - now@16.6.3
 - now-client@6.0.0
 - @now/next@2.1.1
 - @now/node@1.2.1
 - @now/routing-utils@1.4.0
 - @now/static-build@0.13.1
2019-12-09 08:03:47 -05:00
Steven
566d82e873 Publish Canary
- now@16.6.3-canary.0
 - @now/next@2.1.1-canary.1
 - @now/node@1.2.1-canary.0
 - @now/routing-utils@1.3.4-canary.6
 - @now/static-build@0.13.1-canary.1
2019-12-06 19:49:27 -05:00
Steven
44ae0b654e [now-routing-utils] Use 308 status code (#3392)
We decided that all of the new properties should default to 301 status code for any redirects.
2019-12-07 00:38:26 +00:00
Steven
d8cfaae596 [now-node][now-next][now-static-build] Remove lockfiles from cache (#3391)
The lock files should not be cached because the user may wish to make a new deployment without a `yarn.lock` or `package-lock.json`.

This recently started causing problems because of the order of downloading cache changed from before user files to after user files.

So we need to be extra careful to only cache outputs and not source files.
2019-12-06 23:35:17 +00:00
Steven
a40e0f21ee Publish Canary
- @now/build-utils@1.1.1-canary.2
2019-12-06 15:57:33 -05:00
Steven
ac1f506c98 [now-build-utils] Add --no-audit flag to npm install (#3390)
This PR will reduce deployment time when a `package-lock.json` file is found by avoiding the audit step which usually [sends audit reports](https://docs.npmjs.com/cli/audit#description) to the registry.

The [--no-audit](https://docs.npmjs.com/cli/install) flag was introduced in [npm@6](
https://medium.com/npm-inc/announcing-npm-6-5d0b1799a905) which shipped with Node 10. However, using the flag with npm@5 does not do anything which is great because npm@5 doesn't audit. So this PR is backwards compatible.

### Performance

I tried `npm install` and `npm install --no-audit` with a large project, [StateOfJS](a9fa6d47f9/homepages/stateofjs), which has 2206 packages (audited 21778 packages).

I made sure to `rm -rf node_modules` each time and ran both commands 5 times to make sure it was always faster with `--no-audit`.

- Before: 61 seconds
- After: 49 seconds
2019-12-06 20:48:30 +00:00
Steven
68d5bdcf3d [script] Fix stable publish script (#3389)
Since we switched to a single branch (instead of master/canary), lerna gets confused about which packages to publish because stable and canary releases are in the same branch.

This PR fixes the confusion by looking at the git history and using [--force-publish](https://github.com/lerna/lerna/tree/master/commands/version#--force-publish) on the changed packages.

In order to avoid confusion for the person publishing, I removed the `yarn publish-stable` script in favor of `yarn changelog` which will print the change log and emit a script that can be used to publish stable.

<details><summary>View Example Output</summary>
<p>

```
$ yarn changelog
yarn run v1.19.1
$ node changelog.js
Changes since the last Stable release (21fe0a2):

- [now-cli] Change `--debug` to avoid debugging builders (#3386) [Steven]
- [now-next] Update routes for new check: true behavior (#3383) [JJ Kasper]
- [now-build-utils] Update Detectors API (#3384) [Nathan Rajlich]
- [now-client] Bump version (#3385) [Andy]
- [now-client] (Major) Split `now-client` options (#3382) [Andy]
- [now-cli][now-client] Fix user agent (#3381) [Steven]
- [now-client] Fix `main` in package.json (#3344) [Max]
- [now-build-utils] Change `script` to `scripts` in error message (#3376) [Andy]
- [now-cli] Add support for `check: true` routes in `now dev` (#3364) [Steven]
- [now-cli] Fix preinstall script on windows when `LOCALAPPDATA` is missing (#3365) [Steven]
- [now dev] skip installing already installed versioned runtimes (#3354) [Tommaso De Rossi]
- [now-routing-utils] Update `path-to-regexp` to v6.1.0 (#3361) [Steven]
- [now-routing-utils] Add mergeRoutes function (#3358) [Steven]
- [docs] Remove deprecated LambdaRuntimes (#3346) [Steven]
- [now-routing-utils] Add support for `check: true` (#3343) [Steven]
- [now-static-build] Cache `.cache` folder for gatsby deployments (#3260) (#3342) [Luc]

To publish a stable release, execute the following:

git pull && lerna version --message 'Publish Stable' --exact --force-publish=@now/build-utils,now,now-client,@now/next,@now/routing-utils,@now/static-build
```

</p>
</details>
2019-12-06 19:31:38 +00:00
Andy Bitz
beb51f8c67 Publish Stable
- now@16.6.2
2019-12-06 13:48:44 +01:00
Andy
b881cb7111 [now-cli] Remove github property from payload before sending it (#3388)
* [now-cli] Remove `github` property from payload before sending it

* Add test and remove unused one

* Remove .only

* Remove unused fixture

* Use correct github properties
2019-12-06 13:47:16 +01:00
Andy Bitz
d83bc59257 Publish Stable
- now@16.6.1
2019-12-06 00:18:57 +01:00
Steven
5be9f297de [now-cli] Change --debug to avoid debugging builders (#3386)
* [now-cli] Change `--debug` to avoid debugging builders

* Fix tests

* Replace test with on/off
2019-12-06 00:11:22 +01:00
JJ Kasper
51d440431e Publish Canary
- @now/build-utils@1.1.1-canary.1
 - @now/next@2.1.1-canary.0
2019-12-05 15:18:35 -06:00
JJ Kasper
7cf061122c [now-next] Update routes for new check: true behavior (#3383)
As discussed this moves the `handle: filesystem` usage to the right location now that we have `check: true` for the `rewrites`
2019-12-05 20:48:17 +00:00
Nathan Rajlich
1254368505 [now-build-utils] Update Detectors API (#3384)
* Changes the `buildCommand` and `devCommand` from `string[]` to `string`
 * Renames `buildEnv` to `buildVariables` and `devEnv` to `devVariables`
2019-12-05 20:01:28 +00:00
Andy Bitz
9d4b830c5f Publish Canary
- now@16.6.1-canary.1
 - now-client@6.0.0-canary.1
2019-12-05 14:14:50 +01:00
Andy
37401b4363 [now-client] Bump version (#3385) 2019-12-05 14:14:00 +01:00
Andy
10fe08e14f [now-client] (Major) Split now-client options (#3382)
* Change types

* Split options for now-client

* Fix query and teamId

* Adjust tests

* Fix linting

* Ignore scope

* Adjust now-client tests

* Adjust more tests

* Apply prettier
2019-12-05 14:08:39 +01:00
Steven
0ecdb35d50 [now-cli][now-client] Fix user agent (#3381)
Since switching to a single branch, each package in the monorepo can be independently versioned so that some packages are using a canary version and others using a stable version.

This PR fixes an issue where a canary version of `now-cli` is bundling a stable version of `now-client` and thus does does not deploy zero config using canary builders.

The solution is to pass the User Agent from `now-cli` to `now-client` in a new option.

A nice side-effect of this PR is that we will switch the User Agent back to what it used to be pre-now-client days. It will look something like `now 16.6.1-canary.0 node-v10.17.0 darwin (x64)`.
2019-12-04 23:10:31 +00:00
Steven
caee8fe9ef Publish Canary
- now-client@5.2.5-canary.0
2019-12-04 16:46:43 -05:00
Max
7d92c27b2d [now-client] Fix main in package.json (#3344)
This sets `main` in `now-client` to a proper path.

Follow up to #3315.

Fixes #3373.
2019-12-04 13:25:27 -08:00
Steven
701eabbaba Publish Canary
- now@16.6.1-canary.0
2019-12-04 09:28:21 -05:00
Andy Bitz
e74a1b2d1a Publish Canary
- @now/build-utils@1.1.1-canary.0
2019-12-02 23:41:28 +01:00
Andy
e087b02333 [now-build-utils] Change script to scripts in error message (#3376)
Change `script` to `scripts` in error message.

[PRODUCT-740]

[PRODUCT-740]: https://zeit.atlassian.net/browse/PRODUCT-740
2019-12-02 22:33:27 +00:00
Steven
eea7f902b5 [now-cli] Add support for check: true routes in now dev (#3364)
This PR adds `now dev` support for routes that define `check: true`.

The algorithm is as follows:

- If a matching `dest` file is found, then serve it
- If a matching `src` file is found, then serve it
- Otherwise, behave the same as `continue: true` and continue processing routes
2019-11-28 10:58:13 +00:00
Steven
db7583201b [now-cli] Fix preinstall script on windows when LOCALAPPDATA is missing (#3365)
Usually `LOCALAPPDATA` is set to `C:\Users\{username}\AppData\Local` but occasionally, it is unassigned and causes installation failures. Looks like this could be due to the [registry](https://liquidwarelabs.zendesk.com/hc/en-us/articles/210634163-How-To-Make-APPDATA-and-LOCALAPPDATA-Environment-Variables-Follow-The-Registry-Keys).

If `LOCALAPPDATA` is missing, we can assume that now.exe was not installed before and can skip the deletion step that happens in the preinstall script.
2019-11-28 00:35:53 +00:00
Tommaso De Rossi
023001a8b1 [now dev] skip installing already installed versioned runtimes (#3354)
Fixes #3353
The current solution might break if a user interrupts `now dev` while yarn wrote the package in the cache package.json but has not yet added to node_modules.
This happens in like 20 ms but is possible, so we could execute `yarn` every time to be sure.
Tell me if the above is a problem or not
2019-11-27 11:33:18 +00:00
Steven
4ff8ab2435 Publish Canary
- @now/routing-utils@1.3.4-canary.5
2019-11-26 19:00:34 -05:00
Steven
d2cccbfce6 [now-routing-utils] Update path-to-regexp to v6.1.0 (#3361)
This bumps `path-to-regexp` to the latest version 6.1.0 which fixes optional capture groups like the test I added for `/next.js`.
2019-11-26 23:41:35 +00:00
Steven
970e6c400c Publish Canary
- @now/routing-utils@1.3.4-canary.4
2019-11-26 13:10:09 -05:00
Steven
b4cb7345a1 [now-routing-utils] Add mergeRoutes function (#3358)
This moves the merging logic to `@now/routing-utils` and adds support for `check: true`.

- Builder before filesystem, continue: true
- User before filesystem
- Builder before filesystem, check: true
- Builder before filesystem, continue: false
- Handle filesystem
- Builder after filesystem, continue: true
- User after filesystem
- Builder after filesystem, check: true
- Builder after filesystem, continue: false
2019-11-26 17:51:19 +00:00
Steven
7e75d8c1a3 [docs] Remove deprecated LambdaRuntimes (#3346)
- Removes Node 8.10 and old .NET which are EOL
- Adds a couple missing such as Ruby
2019-11-22 21:12:23 +00:00
Steven
a4ea551160 Publish Canary
- @now/routing-utils@1.3.4-canary.3
2019-11-22 14:41:33 -05:00
Steven
f56ad447a0 [now-routing-utils] Add support for check: true (#3343)
This PR adds support for `check: true` for a route object. It is basically a way to add a rewrite and still check the filesystem.
2019-11-22 19:03:45 +00:00
luc
7656422057 Publish Canary
- @now/static-build@0.13.1-canary.0
2019-11-22 17:39:35 +08:00
Luc
afa2231add [now-static-build] Cache .cache folder for gatsby deployments (#3260) (#3342)
Apply 77348ea71e again.

> Adds `.cache` folder to the Now cache for Gatsby deployments.

> Also adds a generic optional `cachePattern` property to the frameworks array so we can optimize cache paths for other frameworks in the future.
2019-11-22 09:16:51 +00:00
Steven
21fe0a2006 Publish Stable
- @now/build-utils@1.1.0
 - now@16.6.0
 - now-client@5.2.4
 - @now/next@2.1.0
 - @now/node@1.2.0
 - @now/static-build@0.13.0
2019-11-21 13:14:17 -05:00
Steven
23acd3cec6 Publish Canary
- @now/build-utils@1.0.1-canary.4
 - now@16.5.3-canary.6
 - @now/routing-utils@1.3.4-canary.2
2019-11-21 11:45:19 -05:00
Steven
7892f88a42 [now-build-utils] Ignore engines for yarn run (#3341)
Fixes a confusing error message.

<details>
<summary>Click to view error message</summary>
<pre>> Ready! Available at http://localhost:3000
> Building @now/node:index.js
Installing dependencies...
Running "yarn run now-build"
yarn run v1.17.3
error @: The engine "node" is incompatible with this module. Expected version "10.x". Got "12.13.1"
error Commands cannot run with an incompatible environment.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Error: Exited with 1
    at ChildProcess.<anonymous> (/Users/styfle/Library/Caches/co.zeit.now/dev/builders/node_modules/@now/node/dist/index.js:78518:24)
    at ChildProcess.emit (events.js:210:5)
    at ChildProcess.EventEmitter.emit (domain.js:475:20)
    at maybeClose (internal/child_process.js:1021:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:283:5) {
  message: 'Exited with 1'
}</pre>
</details>



The `--ignore-engines` flag was added to `yarn install` many months ago but not `yarn run`.

This PR adds the flag to `yarn run`.

This is useful in `now dev` when the user might have a different Node version installed than what is specified by `engines` in `package.json`.
2019-11-21 16:41:55 +00:00
Steven
aae0e3bec7 Revert [now-cli][now-routing-utils] Add support for v4 builders #3311 (#3333)
Reverts #3311

Previously, we thought we were going to use version 4 to support builder rewrites/redirects => routes. But that is no longer necessary. So instead version 4 will be builders that accept multiple file entrypoints.

Until v4 can be implemented, this reverts v4 changes.

Additionally, I added a helpful error message when the CLI does not support the builder version. In a future PR, we will add better version locking to avoid this type of version mismatch.
2019-11-21 15:49:33 +00:00
Steven
0f8bf39421 Publish Canary
- now@16.5.3-canary.5
 - @now/next@2.0.1-canary.1
 - @now/node@1.1.3-canary.2
 - @now/static-build@0.12.3-canary.2
2019-11-20 15:33:13 -05:00
Steven
36fd96cc6c Publish Canary
- @now/build-utils@1.0.1-canary.3
2019-11-20 11:19:07 -05:00
Steven
3de08e9f3b [now-build-utils] Fix canary selection for static build (#3339)
We expect `now@canary` to use canary builders. This PR fixes a bug where a zero config deployment was selecting `@now/static-build` instead of `@now/static-build@canary`.
2019-11-20 16:17:55 +00:00
Steven
3e739724b3 Publish Canary
- @now/build-utils@1.0.1-canary.2
 - now@16.5.3-canary.4
 - now-client@5.2.4-canary.2
 - @now/node@1.1.3-canary.1
 - @now/static-build@0.12.3-canary.1
2019-11-20 08:55:18 -05:00
Nathan Rajlich
847e538c69 [now-cli] Render an error message when the --token content is invalid (#3335)
Fixes #3334.

```
$ node ~/now-cli/dist/index.js --token $'he˚ll,o\n'
> Error! You defined "--token", but its contents are invalid. Must not contain: "\n", ",", "˚"
> More details: https://err.sh/now/invalid-token-value
```
2019-11-20 11:05:45 +00:00
Nathan Rajlich
64684dd486 [now-build-utils] Run detectors unit tests (#3336)
Renames `test/unit.test.detectors.ts` -> `test/unit.detectors.test.ts`
and adjusts npm `test-unit` command.

Jest only runs tests for files that end in `*.test.ts` or `*.test.js`.
2019-11-19 18:48:15 -08:00
Steven
a229747249 [now-build-utils][now-static-build][now-node] Add node 12.x (#3330)
This PR adds support for Node 12 when the user defines `engines` in their `package.json`
2019-11-20 02:34:01 +00:00
Nathan Rajlich
d1b59c3543 [now-build-utils] Add framework detector functions (#3296)
* [now-build-utils] Add framework detector functions

As described in [PRODUCT-399]. This is similar in nature to the
current framework detection logic in static-build, however the detectors
are now functions which allow for detection of frameworks without
a `package.json` file (i.e. jekyll), and also includes detection of
build and dev commands for use in project settings.

* Dedup `aggregate-error` dep in yarn.lock

* Simplify `hasDependency()`

* Adjust hugo detect logic

* Add "jekyll" detector

* Add "next" detector

* Optimize "gatsby" detector

Check the `package.json` first

* Add optimization to check "package.json" based detectors first

They're by far the most common and only rely on checking the single
`package.json` file. If no pkg-based detector succeeds then the non-pkg
detectors are consulted afterwards.

* Add "vue" detector

* Add "angular" detector

* Add "polymer" detector

* Add "svelte" detector

* Add "create-react-app-ejected" detector

* Add "gridsome" detector

* Add "umi" detector

* Add "sapper" detector

* Add "saber" detector

* Add "stencil" detector

* Add CRA ejected commands

* Add "brunch" detector

* Add "middleman" detector

* Add missing commands

* `buildCommand` is required

* Add initial unit tests

* Fix unit tests on Circle

* Move "jest" and "ts-jest" to the root of the monorepo

* Fix integration tests

* Fix test again

* Update packages/now-build-utils/src/detectors/middleman.ts

Co-Authored-By: Steven <steven@ceriously.com>

* Move `@types/jest` to root level package.json

* Update packages/now-build-utils/src/detectors/ember.ts

Co-Authored-By: Steven <steven@ceriously.com>

* Add `cachePattern`

* Address PR comments

* Add missing `$PORT` entries for devCommands

* Add `firstTruthy()` tests

* Revert some changes

Maybe it fixes CI build?

* Test remove `yaml` module

* Update packages/now-build-utils/src/detectors/next.ts

* Remove `toml`

* Test out "@iarna/toml" module

* Fix build

* Test out "js-yaml" module

* Add new routing properties

* Rename `test/unit.test.ts` to `test/unit.test.detectors.ts`

* Remove `@types/yaml`
2019-11-19 17:16:49 -08:00
JJ Kasper
b241441e37 Publish Canary
- now@16.5.3-canary.3
 - @now/next@2.0.1-canary.0
2019-11-19 15:06:43 -06:00
JJ Kasper
40bfa25b1b [now-next] Fix custom routes order (#3327)
This updates the routes order to make sure `_next/*` routes are at the top so that custom `rewrites`/`redirects` don't conflict with them

x-ref: https://github.com/zeit/next.js/issues/9081#issuecomment-555161265
2019-11-19 21:05:02 +00:00
Nathan Rajlich
c5a4386c1d [now-cli] Update @zeit/fun to v0.10.4 (#3332)
Possibly fixes #3323 (because of zeit/fun#43).
2019-11-19 20:32:36 +00:00
Nathan Rajlich
b3aa3be4b8 [CircleCI] Remove rsync apt-get install (#3329)
Used to be used in the now-cli build script when it was a bash script.
Now it's a TypeScript file and the `cpy` module is used instead.
2019-11-19 08:55:42 +01:00
Steven
528aefcc1e [now-cli] Handle uv_cwd error when cwd is deleted (#3326)
Converts `reportError()` to typescript and adds an ignore list.

In particular, `uv_cwd` comes from `process.cwd()` so we don't need to track these errors in the case the user deletes their current working directory.

This is a follow up to #3194 which handled only one scenario.
2019-11-18 22:27:46 +00:00
Andy
620ee2b7e4 [now-cli] Ensure that stdin exists when calling setRawMode (#3321)
Ensure that `stdin` exists when calling `setRawMode`.

[Error on Sentry](https://sentry.io/organizations/zeithq/issues/1310516610/?project=1323225)

[PRODUCT-637]

[PRODUCT-637]: https://zeit.atlassian.net/browse/PRODUCT-637
2019-11-18 21:22:29 +00:00
Andy Bitz
d55acc246a Publish Canary
- @now/build-utils@1.0.1-canary.1
2019-11-18 11:54:08 +01:00
Andy
2a59db3029 [now-build-utils] Ensure function paths are relative to the project and improve the error message (#3312)
* [now-build-utils] Ensure function paths are relative to the project and improve the error message

* Update packages/now-build-utils/src/detect-builders.ts

Co-Authored-By: Steven <steven@ceriously.com>

* Update packages/now-build-utils/src/detect-builders.ts

Co-Authored-By: Steven <steven@ceriously.com>
2019-11-15 18:56:23 +01:00
Andy Bitz
990dec0fec Publish Stable
- @now/next@2.0.0
2019-11-15 15:33:18 +01:00
Andy
162b17b249 [now-next] Make lambda memory more reliable (#3319) 2019-11-15 15:28:28 +01:00
Steven
e0aea30618 Publish Canary
- now@16.5.3-canary.2
 - @now/routing-utils@1.3.4-canary.1
2019-11-14 16:00:47 -05:00
Steven
49cba94178 [now-cli][now-routing-utils] Add support for v4 builders (#3311)
- Add now dev `BuildResultV4` type similar to V3 but no routes, only superstatic keys
- Add validation to `@now/routing-utils` to ensure V4 Builders do not return `routes`

Note, no builders have been changed yet because this needs to be shipped first so we can bump build-utils and then builders will work in production. Then in a separate PR, we can update builders to V4.
2019-11-14 20:48:13 +00:00
Steven
7dd87815f3 Publish Canary
- now@16.5.3-canary.1
 - now-client@5.2.4-canary.1
2019-11-14 14:18:50 -05:00
Steven
f6fdde816f [now-client] Fix publish output (#3315)
Fixes #3310

The root `package.json` file is copied to `dist` by tsc because of a relative import. This causes npm `files` property to be nested and therefore skip publishing most of the files.

```ts
import pkg from '../../package.json';
```

Disabling `resolveJsonModule` and using `require()` instead fixed it.

However, this change caused `now-cli` build to fail so I had to change the way `now-client` gets imported.
2019-11-14 19:09:03 +00:00
Steven
4c8c6ff236 [script] Cleanup changelog script (#3306)
This script is only used for stable releases so we should filter out canary publish commits.
2019-11-14 18:31:04 +00:00
Steven
46b615a963 [now-cli] Fix localConfig when file is above the target directory (#3293)
Fixes #3209
2019-11-14 18:00:39 +00:00
Steven
8e293dd633 Publish Canary
- gatsby-plugin-now@1.2.6-canary.0
 - @now/build-utils@1.0.1-canary.0
 - @now/cgi@1.0.1-canary.0
 - now@16.5.3-canary.0
 - now-client@5.2.4-canary.0
 - @now/go@1.0.1-canary.0
 - @now/next@1.0.6-canary.0
 - @now/node-bridge@1.2.7-canary.1
 - @now/node@1.1.3-canary.0
 - @now/python@1.0.1-canary.0
 - @now/routing-utils@1.3.4-canary.0
 - @now/ruby@1.0.1-canary.0
 - @now/static-build@0.12.3-canary.0
2019-11-13 10:28:12 -05:00
Thew Dhanat
e040753b27 [now-node] Ignore babel.config.js (#3295)
@now/node shouldn't read user's Babel configuration.
Fix #3280
2019-11-13 14:36:33 +00:00
Andy
463aaf094d [now-cli] Make lambda memory test more consistent (#3301)
Make lambda memory test more consistent
2019-11-13 11:21:53 +00:00
Steven
bf867b028d [tests] Always test now-cli (#3305)
Previously, only the changed package's tests would run.

This PR makes sure that the changed package + `now-cli` tests run every time.
2019-11-13 02:32:02 +00:00
Steven
6dfefc2fe4 Publish Stable
- gatsby-plugin-now@1.2.5
 - now@16.5.2
 - @now/node@1.1.2
 - @now/static-build@0.12.2
2019-11-12 18:52:28 -05:00
Steven
9ba8a8454c Bump versions 2019-11-12 18:51:32 -05:00
Steven
9c72839bfa Empty commit 2019-11-12 18:48:26 -05:00
Steven
2e24c92799 Publish Canary
- gatsby-plugin-now@1.2.4-canary.0
 - @now/node@1.1.1-canary.0
 - @now/static-build@0.12.1-canary.0
2019-11-12 18:18:17 -05:00
Andy
fa98c8aeeb Revert "[now-static-build] Inject gatsby-plugin-now in Gatsby deployments (#3182)" (#3303)
This reverts the following gatsby changes:

- Reverts #3182
- Reverts #3260
- Reverts #3212
2019-11-12 23:13:39 +00:00
Steven
f92e3496b1 [now-node] Bump now-node-bridge (#3304)
A trivial change to follow up to #3300 so that the latest `@now/node-bridge` is bundled with `ncc`.
2019-11-12 22:37:49 +00:00
Steven
0ceea76aa4 Publish Canary
- now@16.5.1-canary.0
 - @now/node-bridge@1.2.7-canary.0
2019-11-12 14:57:22 -05:00
Steven
897d11a1e1 [now-node] Disable default node timeout (#3300)
Node had a default [timeout](https://nodejs.org/api/http.html#http_server_timeout) of 2 minutes until Node 13.x so we'll need to manually disable the timeout so that the `maxDuration` config works properly.
2019-11-12 19:54:05 +00:00
Andy Bitz
8ed59fcdd3 Publish Stable
- gatsby-plugin-now@1.2.3
 - @now/build-utils@1.0.0
 - @now/cgi@1.0.0
 - now@16.5.0
 - now-client@5.2.3
 - @now/go@1.0.0
 - @now/node-bridge@1.2.6
 - @now/node@1.1.0
 - @now/python@1.0.0
 - @now/routing-utils@1.3.3
 - @now/ruby@1.0.0
 - @now/static-build@0.12.0
2019-11-12 15:55:59 +01:00
Andy
7f211cc7fc [all] Set the versions to stable (#3297) 2019-11-12 15:52:16 +01:00
Andy Bitz
c511147c7c Publish Canary
- @now/build-utils@1.0.0-canary.23
 - now@16.1.4-canary.43
 - now-client@5.1.1-canary.18
 - @now/node@1.0.0-canary.17
2019-11-11 23:33:18 +01:00
Nathan Rajlich
2f7f965188 [now-cli] Update execa to v3.2.0 (#3292)
* [now-cli] Update `execa` to v3.2.0

Also requires updating TypeScript to v3.4+
(See: https://github.com/sindresorhus/execa/issues/336)

* Fix tests: code -> exitCode

* code -> exitCode

* More .code to .exitCode

* Update `@zeit/fun` to v0.10.3
2019-11-11 14:21:27 -08:00
Andy
24da26e7cf [@now/build-utils] Add support for includeFiles and excludeFiles to Functions (#3285)
Add support for `includeFiles` and `excludeFiles` to Functions.

[PRODUCT-27]

[PRODUCT-27]: https://zeit.atlassian.net/browse/PRODUCT-27
2019-11-11 22:17:59 +00:00
Andy
f8f9d656e8 [@now/node] Configure helpers and handler with env variables (#3286)
Allow to configure helpers and handler with env variables.

[PRODUCT-27]

[PRODUCT-27]: https://zeit.atlassian.net/browse/PRODUCT-27
2019-11-11 21:24:28 +00:00
Steven
b357f3055d [docs] Cleanup canary links, use master instead (#3291)
Follow up to #3287
2019-11-11 19:54:40 +00:00
Max
f9c1f519f4 [now-client] Clean up fetch headers (#3290)
Reopen of #3255
2019-11-11 19:31:20 +00:00
Steven
057f9f7045 Publish Canary
- now@16.1.4-canary.42
 - @now/node@1.0.0-canary.16
 - @now/ruby@0.1.5-canary.8
2019-11-11 13:53:20 -05:00
Steven
58ec38437d [now-node] Fix TS version selection (#3289)
Previously, the `typescript` dependency resolution was using the package.json beside the `now.json` base directory.

This PR changes the behavior to start looking for package.json in the entrypoint directory.

Fixes #3258
2019-11-11 18:45:39 +00:00
Steven
2964bf50e0 [now-ruby] Fix rails test (#3288)
This test was failing for the last week.

The issue was fixed in the build environment. The root cause was [ruby-build](https://github.com/rbenv/ruby-build) which is used to install the version of Ruby used in `@now/ruby`. It started using an older (possible broken) version of `bundler`. I pinned `ruby-build` to a previous version so that deployments continue working.

So now we can enable the Rails test again (which uses nokogiri).

Fixes #3246
Closes #3274
2019-11-11 16:34:20 +00:00
Leo Lamprecht
c9572c352a Adjust commands for creating releases (#3287)
* Adjust commands for creating releases

* Update package.json

Co-Authored-By: Steven <steven@ceriously.com>

* Update package.json

Co-Authored-By: Steven <steven@ceriously.com>

* Adjusted log line

* Deleted diff.js

* Remove script

* Fix run.js to use master
2019-11-11 10:50:04 -05:00
Andy
b69f176143 [now-cli] Enable Runtime tests (#3284)
Enable Runtime tests, since a new version of the `now-php` package was released.
2019-11-11 12:33:54 +00:00
Leo Lamprecht
484dcd5dc1 Publish
- now@16.1.4-canary.41
2019-11-11 12:59:08 +01:00
Leo Lamprecht
a3412113b7 Trigger publish 2019-11-11 12:58:49 +01:00
Leo Lamprecht
693043bc27 Fixed dependencies 2019-11-11 12:57:44 +01:00
Leo Lamprecht
82a5bafb42 Fixed dependencies (#3283) 2019-11-11 12:51:44 +01:00
Leo Lamprecht
1c8c4c6f72 Publish
- gatsby-plugin-now@1.2.1-canary.5
 - @now/build-utils@1.0.0-canary.22
 - @now/cgi@0.1.5-canary.4
 - now@16.1.4-canary.40
 - now-client@5.1.1-canary.17
 - @now/go@0.5.11-canary.9
 - @now/next@1.0.0-canary.22
 - @now/node-bridge@1.2.4-canary.3
 - @now/node@1.0.0-canary.15
 - @now/python@0.2.17-canary.11
 - @now/routing-utils@1.2.3-canary.12
 - @now/ruby@0.1.5-canary.7
 - @now/static-build@0.9.9-canary.20
2019-11-11 12:49:21 +01:00
Leo Lamprecht
28a2e354d3 Fixed dependencies 2019-11-11 12:48:58 +01:00
Leo Lamprecht
c89e478fc1 Merge branch 'canary' 2019-11-11 12:40:13 +01:00
Luc
7e29a24ea6 [now-static-build] Inject gatsby-plugin-now in Gatsby deployments (#3182)
This PR is an attempt to automatically inject `gatsby-plugin-now` in Gatsby projects, as an optimisation.

- [x] avoid conflicts with existing files
- [x] refactor
2019-11-11 12:39:18 +01:00
JJ Kasper
5fc9b7d36d [now-next] Add loading of custom routes (#3279)
This adds loading of `redirects` and `rewrites` from the `routes-manifest` in supported Next.js versions
2019-11-11 12:36:00 +01:00
Nathan Rajlich
a211c648ed [now-cli] Purge require cache after packages install in now dev (#3277) 2019-11-11 12:34:49 +01:00
Andy
c24d8de960 [all] Updated builders to version: 3 (#3273)
* [now-node] Use builder version 3

* [now-cgi] Use builder version 3

* [now-go] Use builder version 3

* [now-python] Use builder version 3

* [now-ruby] Use builder version 3

* Adjust docs

* [now-ruby] Remove unused import

* Temp. test in iad1

* Revert "Temp. test in iad1"

This reverts commit 4c495baa5888dda5ae8f184f679613e91ab7268c.

* [now-cli] Adjust `now dev` for builder version 3

* [now-build-utils] Do not allow non Community Runtimes

* Temp. Force Build in iad1

* Update DEVELOPING_A_RUNTIME.md

Co-Authored-By: Steven <steven@ceriously.com>

* Update docs

* Update test/lib/deployment/now-deploy.js

Co-Authored-By: Steven <steven@ceriously.com>

* Remove temp. iad1 check

* Check memory and maxDuration

* Use memory for Lambda

* Only cast once

* Skip tests
2019-11-11 12:33:08 +01:00
Andy
34f6e52335 [all] Fix functions property and update Lambda (#3252)
* Allow functions + next.js

* Don't allow empty or invalid functions

* Make sure runtimes match a source

* Update now-dev to use the functions property

* Functions must match a source file

* Split up functions

* Make sure @now/next does not receive any unused functions

* Allow memory and maxDuration properties on Lambdas

* Add lambda options to @now/node

* Add lambda options to @now/go

* Add lambda options to @now/python

* Add lambda options to @now/ruby

* Update lambda options on @now/node

* Add lambda optiosn to @now/cgi

* Make options optional

* Add lambda options to @now/next

* Fix assertion

* Add test

* Fix tests

* Skip 06-ruby test

* Skip correct tests

* Fix options and cache src check

* Adjust memory test
2019-11-11 12:31:57 +01:00
Luc
77348ea71e [now-static-build] Cache .cache folder for gatsby deployments (#3260)
Fix https://github.com/zeit/now/issues/3247.

Adds `.cache` folder to the Now cache for Gatsby deployments.

Also adds a generic optional `cachePattern` property to the frameworks array so we can optimize cache paths for other frameworks in the future.
2019-11-11 12:27:57 +01:00
Steven
a1273d1c9e [now-dev][now-routing-utils] Fix trailingSlash (#3250)
Fixes `trailingSlash: true` in now dev
2019-11-11 12:22:52 +01:00
Steven
4e6e51af9c [now dev] Add support for cleanUrls (#3240)
This PR implements `cleanUrls` for now dev which is similar to the implementation in fmeta-util.

I also added an integration test to ensure correctness.
2019-11-11 12:21:48 +01:00
Steven
a6366eaff6 [now-cli] Fix test invalid-builder-routes (#3249) 2019-11-11 12:20:36 +01:00
Steven
1403cf47b2 [now-dev] Fix route normalization (#3225)
This PR fixes a regression introduced in #3174 when removing the `^` and `$` normalization.

The previous PR was normalizing user-defined routes but forgot to normalize builder routes.

This PR normalizes builder routes 👍
2019-11-11 12:20:22 +01:00
Luc
6a5a964b55 [now-static-build] Improve Gatsby default routes (#3212)
This PR does 3 things:
- add default caching headers
- redirect all missed requests to Gatsby's own 404.html page
- add deprecation message to `gatsby-plugin-now` since we're auto injecting it and it's not needed anymore

Fixes #2859
2019-11-11 12:18:30 +01:00
JJ Kasper
1c40d693c1 [now-next] Add Beta iSSG Support (#3067)
Adds support for new SPRv2 handling in Next.js.

x-ref: #3021
2019-11-11 12:16:36 +01:00
Leo Lamprecht
9cff4ca2c3 Publish
- now@16.1.4-canary.39
2019-11-11 12:15:41 +01:00
JJ Kasper
d1f675bd46 [now-next] Leverage routes-manifest if available for dynamic routes (#3271)
This allows us to start de-coupling the builder from relying on inner utils of Next.js to generate dynamic routes for Now by leveraging a `routes-manifest` output during the build

Relies on: https://github.com/zeit/next.js/pull/9347
2019-11-11 12:10:41 +01:00
Igor Klopov
cce292f639 [now-node] fix reportTSError exiting (#3244)
This fixes abnormal process exit when there is an error like `console.log(Math.round("42"));` and `compilerOptions.noEmitOnError` is `true` in `tsconfig.json`. See 2dee810e74/packages/now-node/src/typescript.ts (L307) and 2dee810e74/packages/now-node/src/typescript.ts (L197)
2019-11-11 12:10:07 +01:00
Andy
adbf2d9c31 [docs] Add memory and maxDuration to runtime development docs (#3261)
Add `memory` and `maxDuration` to runtime development docs
2019-11-11 12:10:03 +01:00
Leo Lamprecht
06e94a1f6f Improve functions check (#3268)
This pull request ensures we're rendering a proper error message if people are trying to use both the `builds` AND the new `functions` property.
2019-11-11 12:09:58 +01:00
Ana Trajkovska
92e396830a [now-cli] Replace Hosts with Deployments API (#3257)
* Replace Hosts with Deployments API

* Trigger tests
2019-11-11 12:09:54 +01:00
Steven
f4df1dfe41 [now-client] Fix file permissions for source files (#3180)
There was a regression since 16.3.0 (now-client refactor) causing file permissions for source files to be not be preserved.

The solution was to add the FS `mode` to each file.

Fixes #3172
2019-11-11 12:09:49 +01:00
Andy
be3bc4273d [now-cli][now-client] Use v11 endpoint for functions (#3266)
* [now-cli][now-client] Use v11 endpoint for functions

* Adjust now-client

* Change version check

* Fix typescript in test
2019-11-11 12:09:45 +01:00
Michel Moreau
b12ed4127e [docs] Update domain-verification error message (#3263)
Closes #3263.
2019-11-11 12:09:36 +01:00
Steven
b6311d5897 [all] Update homepage in package.json (#3265) 2019-11-11 12:09:31 +01:00
Max
cb40985b0e [now-client] Add .nowignore test (#3264)
This adds a test for https://github.com/zeit/now/pull/3186
2019-11-11 12:09:15 +01:00
Steven
7ace8b7103 [now-cli] Fix integration test for maxDuration (#3259)
This test started failing because the error message changed.
2019-11-11 12:08:51 +01:00
Cam Smith
aea17f0c6f [now-cli] Add note for Windows environment variable syntax (#3243) 2019-11-11 12:08:47 +01:00
Leo Lamprecht
5d56eeb871 [docs] Rename "Builders" to "Runtimes" (#3256)
* Renamed "Builders" to "Runtimes"

* Brought html-minifier back

* Adjusted examples
2019-11-11 12:08:43 +01:00
Matthew Sweeney
f3cb60f707 Update Public Directory Link (#3221)
This PR updates the link to the missing build script FAQ, pending a change to the structure of the documentation.

This PR should be merged only when the documentation PR has been - https://github.com/zeit/docs/pull/1423
2019-11-11 12:08:39 +01:00
Connor Davis
1e57be0710 [now-next] 404 Known Static Files Before Dynamic Routes (#3238)
If someone uses a wildcard in the root of pages, it could collide with internal `_next` files:
```
pages/
  [slug]/
    [slug]/
      [slug]/
        [slug].js
```

For example:
`/_next/static/runtime/webpack-hash.js` exists and has no problem routing
`/_next/static/runtime/webpack-old-hash.js` doesn't exist on the server any more but would route to `/[slug].js` with status 200

This could cause strange edge cases related to loading a new version of a Next.js site along with the possible cost of execution if it's a lambda plus the cost of however large the response is.

# Side Notes

Should this:
92d9f2d809/packages/now-next/src/index.ts (L839)

Instead be this?
```
 src: path.join('/', entryDirectory, '_next/static/(?:[^/]+/pages|chunks|runtime|css|media)/.+'),
```

If this is the case, I need to adjust my PR to do the same
2019-11-11 12:08:34 +01:00
Sophearak Tha
ee8e4bfb20 [now-cli] Adjust now ls according to new project overview (#3229)
Fix: [PRODUCT-493]

[PRODUCT-493]: https://zeit.atlassian.net/browse/PRODUCT-493
2019-11-11 12:08:20 +01:00
Sophearak Tha
7355182586 [now-cli] Remove now upgrade command (#3228)
Fix: [PRODUCT-489]

[PRODUCT-489]: https://zeit.atlassian.net/browse/PRODUCT-489
2019-11-11 12:08:00 +01:00
Andy
e0683d51fa [now-build-utils] Fix custom function runtimes (#3239)
* [now-build-utils] Fix custom runtimes for functions

* [now-cli] Change order
2019-11-11 12:07:28 +01:00
Andy
1f1d5ca8bf [now-cli][now-client] Add support for functions property (#3231)
* [now-cli][now-client] Add support for `functions` property

* Fix typo

* Update yarn.lock for test

* Update all yarn.lock files for now dev

* Log fixture that failed

* Use catch instead

* Run dev tests not serial

* Revert "Run dev tests not serial"

This reverts commit bfcd83642bcd2275daaac129b2c8b233f582eaae.

* Do not throw

* Skip nextjs tests on node 8

* Remove only flag

* Ignore 19-mithril

* Revert "Ignore 19-mithril"

This reverts commit d438c40c26a8ef2227a0a0dd7caba8600503d585.

* Revert "Remove only flag"

This reverts commit caff05ad82a184706eb48b6b39df550f8d17bb1d.

* Revert "Skip nextjs tests on node 8"

This reverts commit 3b45ca33b969a56da0bccce4c95cae3b34af98e0.

* Revert "Do not throw"

This reverts commit 55624b9193d7751e1dc16cbee9005fe23ff19662.

* Revert "Revert "Run dev tests not serial""

This reverts commit cd5260a205b6478cb7a44c9ea982b99f26f2f2e9.

* Revert "Run dev tests not serial"

This reverts commit bfcd83642bcd2275daaac129b2c8b233f582eaae.

* Revert "Use catch instead"

This reverts commit fe652995c08e1e8b2ba581aaf7304b5432718161.

* Revert "Log fixture that failed"

This reverts commit feb0e7b393626ce1c117ef95f9e95f7a148e3dab.

* Revert "Update all yarn.lock files for now dev"

This reverts commit 36be4dd98ca6d65850843dc958727952dd7461ee.

* Update yarn.lock for 14-svelte-node

* Update es-abstract in all yarn.lock files

* Skip node test

* Revert "Skip node test"

This reverts commit c9c45ec8d6fcef13cbd300db410699b167d76ed2.

* Remove test.only

* Only execute node test in now-dev

* Revert "Only execute node test in now-dev"

This reverts commit 8ab7a88d696c1faa5fe0fbcca9dcfb0dd375925f.

* Clean cache on macos node8

* Fix query

* Use --skip-integrity-check

* Add --skip-integrity-check to different yarn call

* Add --network-concurrency 1

* Add retry
2019-11-11 12:07:22 +01:00
Max
4dfd11ad8e Fix racing spinners (#3232) 2019-11-11 12:07:16 +01:00
Steven
d46e106dba [now-routing-utils] Fix newline in error message (#3234)
The newlines were not being applied properly since the entry array was stringified.

This PR fixes the newlines for route errors.
2019-11-11 12:07:10 +01:00
Steven
cd7eabb6b6 [now-build-utils] Fix zero config trailing slash (#3233)
This fixes the scenario where the user defines `trailingSlash: true` and creates a file `/api/users.js`. They would expect to be able to visit `/api/users/` and it should run that function.
2019-11-11 12:07:05 +01:00
Leo Lamprecht
bfedde6a4d [now-routing-utils] Improve error message for invalid regexes (#3230)
Currently, this is what you see if you enter invalid regexes with any of the new routing properties:

![image](https://user-images.githubusercontent.com/6170607/67955351-c0fd6480-fbf2-11e9-999c-b36509b5c405.png)

Instead of printing JSON, we want to print a list of all error messages.
2019-11-11 12:06:57 +01:00
Joe Haddad
ece00674b6 [now-next] Use Past Tense (#3226) 2019-11-11 12:06:52 +01:00
Joe Haddad
aa51f9005a [now-next] Reduce Build Noise (#3224)
This PR removes the individual lambda zip prints since they're not very useful. We've already printed this information above and will time them as a group!
2019-11-11 12:06:48 +01:00
Steven
836d0dd6ec [now-routing-utils] Fix redirects when cleanUrls and trailingSlash (#3223)
This fixes the scenario when both `{ cleanUrls: true, and trailingSlash: true }` so that only one redirect occurs when visiting `/file.html`.

Previously, this would have redirected twice from `/file.html` => `/file` => `/file/`.

Now it will redirect once from `/file.html` => `/file/`.
2019-11-11 12:06:34 +01:00
Steven
1947813f04 [now-routing-utils] Return null routes when provided null (#3222)
This PR ensures that null routes are returned as null instead of the empty array.
2019-11-11 12:06:29 +01:00
Steven
9a1eeb6fca [now-routing-utils] Enhance superstatic validation (#3219)
This PR refactors a few things:

- enhance validation so that invalid regex is caught before transforming to routes
- remove `filePaths` input parameter since it is no longer used

After this PR is merged and released, we'll be able to perform validation earlier in the build pipeline and report the errors to the user.
2019-11-11 12:05:32 +01:00
Andy
ca8f347e3a [now-build-utils] Validate functions and allow them as config (#3218)
* [now-build-utils] Validate functions and allow them as config

* Apply suggestions from code review

Co-Authored-By: Steven <steven@ceriously.com>

* Change memory check

* Adjust test
2019-11-11 12:05:14 +01:00
Steven
51146f5baf [now-routing-utils] Fix html redirects for cleanUrls (#3217)
We used to read the output files and create a route for each redirect when `cleanUrls: true`.

Instead, this PR will add 2 redirects for `cleanUrls: true` no matter how many files are in the outputs.
2019-11-11 12:05:09 +01:00
Andy
f2bd36b4f9 [now-build-utils] Add functions property (#3213)
This updates `@now/build-utils` to add support for the function property including types and tests.

Related: [PRODUCT-27]

[PRODUCT-27]: https://zeit.atlassian.net/browse/PRODUCT-27
2019-11-11 12:04:54 +01:00
Nathan Rajlich
818018ce42 [now-cli] Remove now dev cleanCacheDir() function (#3214)
Dead code as of #2097.
2019-11-11 12:04:44 +01:00
Nathan Rajlich
89114179da [now-cli] Remove test.only() in now dev tests (#3278) 2019-11-10 21:45:14 -08:00
JJ Kasper
d50c72f2c3 Publish
- now@16.1.4-canary.38
 - @now/next@1.0.0-canary.21
2019-11-09 23:26:49 -08:00
JJ Kasper
ce241e7690 [now-next] Add loading of custom routes (#3279)
This adds loading of `redirects` and `rewrites` from the `routes-manifest` in supported Next.js versions
2019-11-10 07:17:58 +00:00
JJ Kasper
b72cbfb708 [now-next] Leverage routes-manifest if available for dynamic routes (#3271)
This allows us to start de-coupling the builder from relying on inner utils of Next.js to generate dynamic routes for Now by leveraging a `routes-manifest` output during the build

Relies on: https://github.com/zeit/next.js/pull/9347
2019-11-10 02:02:02 +00:00
Nathan Rajlich
ef7b60225d [now-cli] Purge require cache after packages install in now dev (#3277) 2019-11-09 15:52:55 -08:00
Andy Bitz
b3718d9378 Publish
- @now/build-utils@1.0.0-canary.21
 - @now/cgi@0.1.5-canary.3
 - now@16.1.4-canary.37
 - @now/go@0.5.11-canary.8
 - @now/node@1.0.0-canary.14
 - @now/python@0.2.17-canary.10
 - @now/ruby@0.1.5-canary.6
2019-11-08 22:09:26 +01:00
Andy
c8c56bcdb1 [all] Updated builders to version: 3 (#3273)
* [now-node] Use builder version 3

* [now-cgi] Use builder version 3

* [now-go] Use builder version 3

* [now-python] Use builder version 3

* [now-ruby] Use builder version 3

* Adjust docs

* [now-ruby] Remove unused import

* Temp. test in iad1

* Revert "Temp. test in iad1"

This reverts commit 4c495baa5888dda5ae8f184f679613e91ab7268c.

* [now-cli] Adjust `now dev` for builder version 3

* [now-build-utils] Do not allow non Community Runtimes

* Temp. Force Build in iad1

* Update DEVELOPING_A_RUNTIME.md

Co-Authored-By: Steven <steven@ceriously.com>

* Update docs

* Update test/lib/deployment/now-deploy.js

Co-Authored-By: Steven <steven@ceriously.com>

* Remove temp. iad1 check

* Check memory and maxDuration

* Use memory for Lambda

* Only cast once

* Skip tests
2019-11-08 21:58:34 +01:00
Igor Klopov
a84b9273b2 [now-node] fix reportTSError exiting (#3244)
This fixes abnormal process exit when there is an error like `console.log(Math.round("42"));` and `compilerOptions.noEmitOnError` is `true` in `tsconfig.json`. See 2dee810e74/packages/now-node/src/typescript.ts (L307) and 2dee810e74/packages/now-node/src/typescript.ts (L197)
2019-11-08 17:28:38 +00:00
Andy Bitz
3d67ad16ff Publish
- now@16.1.4-canary.36
 - now-client@5.1.1-canary.16
 - @now/node@1.0.0-canary.13
2019-11-08 02:28:20 +01:00
Andy
dd5d4491e2 [docs] Add memory and maxDuration to runtime development docs (#3261)
Add `memory` and `maxDuration` to runtime development docs
2019-11-08 01:23:10 +00:00
Leo Lamprecht
7dd1199ce0 Improve functions check (#3268)
This pull request ensures we're rendering a proper error message if people are trying to use both the `builds` AND the new `functions` property.
2019-11-08 00:11:46 +00:00
Ana Trajkovska
ee7b64ff3a [now-cli] Replace Hosts with Deployments API (#3257)
* Replace Hosts with Deployments API

* Trigger tests
2019-11-08 00:00:38 +01:00
Steven
6efe7d04bc [now-client] Fix file permissions for source files (#3180)
There was a regression since 16.3.0 (now-client refactor) causing file permissions for source files to be not be preserved.

The solution was to add the FS `mode` to each file.

Fixes #3172
2019-11-07 22:38:35 +00:00
Andy Bitz
b7f8f7c366 Publish
- gatsby-plugin-now@1.2.1-canary.4
 - @now/build-utils@1.0.0-canary.20
 - now@16.1.4-canary.35
 - now-client@5.1.1-canary.15
 - @now/go@0.5.11-canary.7
 - @now/next@1.0.0-canary.20
 - @now/node@1.0.0-canary.12
 - @now/python@0.2.17-canary.9
 - @now/ruby@0.1.5-canary.5
 - @now/static-build@0.9.9-canary.19
2019-11-07 23:28:56 +01:00
Andy
9adbb10fca [now-cli][now-client] Use v11 endpoint for functions (#3266)
* [now-cli][now-client] Use v11 endpoint for functions

* Adjust now-client

* Change version check

* Fix typescript in test
2019-11-07 23:28:14 +01:00
Andy
6646b97a65 Revert "[now-client] ignores is missing ignores added from .nowignore (#3186)" (#3267)
This reverts commit 2a39f61f34.
2019-11-07 22:54:31 +01:00
Michel Moreau
939c3a11d7 [docs] Update domain-verification error message (#3263)
Closes #3263.
2019-11-07 13:04:56 -08:00
Steven
363c3ea39f [all] Update homepage in package.json (#3265) 2019-11-07 14:31:07 -05:00
luc
935fca6986 Publish
- now-client@5.1.1-canary.14
 - @now/static-build@0.9.9-canary.18
2019-11-08 02:08:12 +08:00
Luc
7e20c585a1 [now-static-build] Cache .cache folder for gatsby deployments (#3260)
Fix https://github.com/zeit/now/issues/3247.

Adds `.cache` folder to the Now cache for Gatsby deployments.

Also adds a generic optional `cachePattern` property to the frameworks array so we can optimize cache paths for other frameworks in the future.
2019-11-07 17:58:28 +00:00
Max
7ecdfbb043 [now-client] Add .nowignore test (#3264)
This adds a test for https://github.com/zeit/now/pull/3186
2019-11-07 17:23:11 +00:00
Gerhard Sletten
2a39f61f34 [now-client] ignores is missing ignores added from .nowignore (#3186)
After upgrading to macOS Catalina I get this error on some now-deploys:

```
> Error! ENOENT: no such file or directory, stat '<file that not exist>'
```

and the file is below a folder that should be ignored by `.nowignore`, think this is due to some fs-bug in my node version, but did also discover that the ignore-array returned from `getNowIgnore` did not include the ignores from my `.nowignore`, but only the default defined in the top of the function.

Is this a bug?
2019-11-07 16:30:13 +00:00
Steven
6e0182af02 Publish
- now@16.1.4-canary.34
 - @now/routing-utils@1.2.3-canary.11
2019-11-07 10:48:41 -05:00
Steven
1fd630460c [now-dev][now-routing-utils] Fix trailingSlash (#3250)
Fixes `trailingSlash: true` in now dev
2019-11-07 15:27:53 +00:00
Andy Bitz
4583880377 Publish
- @now/build-utils@1.0.0-canary.19
 - @now/cgi@0.1.5-canary.2
 - now@16.1.4-canary.33
 - @now/go@0.5.11-canary.6
 - @now/next@1.0.0-canary.19
 - @now/node@1.0.0-canary.11
 - @now/python@0.2.17-canary.8
 - @now/ruby@0.1.5-canary.4
 - @now/static-build@0.9.9-canary.17
2019-11-07 14:32:35 +01:00
Andy
abacaf8d40 [all] Fix functions property and update Lambda (#3252)
* Allow functions + next.js

* Don't allow empty or invalid functions

* Make sure runtimes match a source

* Update now-dev to use the functions property

* Functions must match a source file

* Split up functions

* Make sure @now/next does not receive any unused functions

* Allow memory and maxDuration properties on Lambdas

* Add lambda options to @now/node

* Add lambda options to @now/go

* Add lambda options to @now/python

* Add lambda options to @now/ruby

* Update lambda options on @now/node

* Add lambda optiosn to @now/cgi

* Make options optional

* Add lambda options to @now/next

* Fix assertion

* Add test

* Fix tests

* Skip 06-ruby test

* Skip correct tests

* Fix options and cache src check

* Adjust memory test
2019-11-07 14:31:51 +01:00
Steven
de8829ccfe [now-cli] Fix integration test for maxDuration (#3259)
This test started failing because the error message changed.
2019-11-07 12:26:23 +00:00
Cam Smith
ba18a3a0cb [now-cli] Add note for Windows environment variable syntax (#3243) 2019-11-06 17:34:07 -08:00
Leo Lamprecht
0a0f13994f [docs] Rename "Builders" to "Runtimes" (#3256)
* Renamed "Builders" to "Runtimes"

* Brought html-minifier back

* Adjusted examples
2019-11-06 21:20:01 +01:00
Matthew Sweeney
eff29463e7 Update Public Directory Link (#3221)
This PR updates the link to the missing build script FAQ, pending a change to the structure of the documentation.

This PR should be merged only when the documentation PR has been - https://github.com/zeit/docs/pull/1423
2019-11-05 21:39:32 +00:00
Connor Davis
9c62b74122 Publish
- @now/next@1.0.0-canary.18
2019-11-05 11:26:00 -05:00
Connor Davis
5f19e63409 [now-next] 404 Known Static Files Before Dynamic Routes (#3238)
If someone uses a wildcard in the root of pages, it could collide with internal `_next` files:
```
pages/
  [slug]/
    [slug]/
      [slug]/
        [slug].js
```

For example:
`/_next/static/runtime/webpack-hash.js` exists and has no problem routing
`/_next/static/runtime/webpack-old-hash.js` doesn't exist on the server any more but would route to `/[slug].js` with status 200

This could cause strange edge cases related to loading a new version of a Next.js site along with the possible cost of execution if it's a lambda plus the cost of however large the response is.

# Side Notes

Should this:
92d9f2d809/packages/now-next/src/index.ts (L839)

Instead be this?
```
 src: path.join('/', entryDirectory, '_next/static/(?:[^/]+/pages|chunks|runtime|css|media)/.+'),
```

If this is the case, I need to adjust my PR to do the same
2019-11-05 14:53:57 +00:00
Sophearak Tha
1fd4c3a278 Publish
- now@16.1.4-canary.32
2019-11-05 09:35:53 +07:00
Sophearak Tha
281b385188 [now-cli] Adjust now ls according to new project overview (#3229)
Fix: [PRODUCT-493]

[PRODUCT-493]: https://zeit.atlassian.net/browse/PRODUCT-493
2019-11-05 02:25:01 +00:00
Steven
4e4b672af9 [now dev] Add support for cleanUrls (#3240)
This PR implements `cleanUrls` for now dev which is similar to the implementation in fmeta-util.

I also added an integration test to ensure correctness.
2019-11-04 23:42:21 +00:00
Steven
b70ac1ca1c [now-cli] Fix test invalid-builder-routes (#3249) 2019-11-04 17:31:20 -05:00
Sophearak Tha
36fc64d0ed [now-cli] Remove now upgrade command (#3228)
Fix: [PRODUCT-489]

[PRODUCT-489]: https://zeit.atlassian.net/browse/PRODUCT-489
2019-11-04 15:24:49 +00:00
Steven
2dee810e74 [now-dev] Fix route normalization (#3225)
This PR fixes a regression introduced in #3174 when removing the `^` and `$` normalization.

The previous PR was normalizing user-defined routes but forgot to normalize builder routes.

This PR normalizes builder routes 👍
2019-11-01 20:57:17 +00:00
Andy Bitz
4fa468299f Publish
- @now/build-utils@1.0.0-canary.18
 - now@16.1.4-canary.31
2019-11-01 19:21:53 +01:00
Andy
90eac2cf54 [now-build-utils] Fix custom function runtimes (#3239)
* [now-build-utils] Fix custom runtimes for functions

* [now-cli] Change order
2019-11-01 19:20:56 +01:00
Andy Bitz
63ad08074c Publish
- now@16.1.4-canary.30
 - now-client@5.1.1-canary.13
2019-11-01 17:49:59 +01:00
Andy
31fcc56dbd [now-cli][now-client] Add support for functions property (#3231)
* [now-cli][now-client] Add support for `functions` property

* Fix typo

* Update yarn.lock for test

* Update all yarn.lock files for now dev

* Log fixture that failed

* Use catch instead

* Run dev tests not serial

* Revert "Run dev tests not serial"

This reverts commit bfcd83642bcd2275daaac129b2c8b233f582eaae.

* Do not throw

* Skip nextjs tests on node 8

* Remove only flag

* Ignore 19-mithril

* Revert "Ignore 19-mithril"

This reverts commit d438c40c26a8ef2227a0a0dd7caba8600503d585.

* Revert "Remove only flag"

This reverts commit caff05ad82a184706eb48b6b39df550f8d17bb1d.

* Revert "Skip nextjs tests on node 8"

This reverts commit 3b45ca33b969a56da0bccce4c95cae3b34af98e0.

* Revert "Do not throw"

This reverts commit 55624b9193d7751e1dc16cbee9005fe23ff19662.

* Revert "Revert "Run dev tests not serial""

This reverts commit cd5260a205b6478cb7a44c9ea982b99f26f2f2e9.

* Revert "Run dev tests not serial"

This reverts commit bfcd83642bcd2275daaac129b2c8b233f582eaae.

* Revert "Use catch instead"

This reverts commit fe652995c08e1e8b2ba581aaf7304b5432718161.

* Revert "Log fixture that failed"

This reverts commit feb0e7b393626ce1c117ef95f9e95f7a148e3dab.

* Revert "Update all yarn.lock files for now dev"

This reverts commit 36be4dd98ca6d65850843dc958727952dd7461ee.

* Update yarn.lock for 14-svelte-node

* Update es-abstract in all yarn.lock files

* Skip node test

* Revert "Skip node test"

This reverts commit c9c45ec8d6fcef13cbd300db410699b167d76ed2.

* Remove test.only

* Only execute node test in now-dev

* Revert "Only execute node test in now-dev"

This reverts commit 8ab7a88d696c1faa5fe0fbcca9dcfb0dd375925f.

* Clean cache on macos node8

* Fix query

* Use --skip-integrity-check

* Add --skip-integrity-check to different yarn call

* Add --network-concurrency 1

* Add retry
2019-11-01 17:47:50 +01:00
Max Rovensky
958b067303 Publish
- now@16.1.4-canary.29
2019-11-01 21:32:49 +08:00
Max
6af183c7f1 Fix racing spinners (#3232) 2019-11-01 21:30:25 +08:00
Steven
92d9f2d809 Publish
- @now/build-utils@1.0.0-canary.17
 - @now/routing-utils@1.2.3-canary.10
2019-10-31 13:13:40 -04:00
Steven
4d7aaff8d0 [now-routing-utils] Fix newline in error message (#3234)
The newlines were not being applied properly since the entry array was stringified.

This PR fixes the newlines for route errors.
2019-10-31 16:49:05 +00:00
Steven
68b19c8122 [now-build-utils] Fix zero config trailing slash (#3233)
This fixes the scenario where the user defines `trailingSlash: true` and creates a file `/api/users.js`. They would expect to be able to visit `/api/users/` and it should run that function.
2019-10-31 16:27:29 +00:00
Steven
5b600fea44 Publish
- @now/routing-utils@1.2.3-canary.9
2019-10-31 11:24:13 -04:00
Leo Lamprecht
2c867295e6 [now-routing-utils] Improve error message for invalid regexes (#3230)
Currently, this is what you see if you enter invalid regexes with any of the new routing properties:

![image](https://user-images.githubusercontent.com/6170607/67955351-c0fd6480-fbf2-11e9-999c-b36509b5c405.png)

Instead of printing JSON, we want to print a list of all error messages.
2019-10-31 15:22:34 +00:00
Joe Haddad
996c0ffffc Publish
- @now/next@1.0.0-canary.17
2019-10-30 17:47:02 -04:00
Joe Haddad
2344357113 [now-next] Use Past Tense (#3226) 2019-10-30 21:20:51 +00:00
Joe Haddad
e919c591fe Publish
- @now/next@1.0.0-canary.16
2019-10-30 16:45:47 -04:00
Joe Haddad
88516137de [now-next] Reduce Build Noise (#3224)
This PR removes the individual lambda zip prints since they're not very useful. We've already printed this information above and will time them as a group!
2019-10-30 20:43:48 +00:00
Steven
f515138074 Publish
- @now/routing-utils@1.2.3-canary.8
2019-10-30 14:29:11 -04:00
Steven
6d04016054 [now-routing-utils] Fix redirects when cleanUrls and trailingSlash (#3223)
This fixes the scenario when both `{ cleanUrls: true, and trailingSlash: true }` so that only one redirect occurs when visiting `/file.html`.

Previously, this would have redirected twice from `/file.html` => `/file` => `/file/`.

Now it will redirect once from `/file.html` => `/file/`.
2019-10-30 18:27:07 +00:00
Steven
eb968d813c Publish
- @now/routing-utils@1.2.3-canary.7
2019-10-30 10:54:16 -04:00
Steven
37881e0830 [now-routing-utils] Return null routes when provided null (#3222)
This PR ensures that null routes are returned as null instead of the empty array.
2019-10-30 14:51:50 +00:00
luc
e3dd13ba9e Publish
- gatsby-plugin-now@1.2.1-canary.3
 - @now/routing-utils@1.2.3-canary.6
 - @now/static-build@0.9.9-canary.16
2019-10-30 12:14:09 +08:00
Luc
9054b7f2f5 [now-static-build] Improve Gatsby default routes (#3212)
This PR does 3 things:
- add default caching headers 
- redirect all missed requests to Gatsby's own 404.html page
- add deprecation message to `gatsby-plugin-now` since we're auto injecting it and it's not needed anymore

Fixes #2859
2019-10-30 04:12:06 +00:00
Steven
17cd17ac96 [now-routing-utils] Enhance superstatic validation (#3219)
This PR refactors a few things:

- enhance validation so that invalid regex is caught before transforming to routes
- remove `filePaths` input parameter since it is no longer used

After this PR is merged and released, we'll be able to perform validation earlier in the build pipeline and report the errors to the user.
2019-10-29 23:03:39 +00:00
Andy Bitz
d7c2d071c1 Publish
- @now/build-utils@1.0.0-canary.16
2019-10-29 21:07:06 +01:00
Andy
483a117a6a [now-build-utils] Validate functions and allow them as config (#3218)
* [now-build-utils] Validate functions and allow them as config

* Apply suggestions from code review

Co-Authored-By: Steven <steven@ceriously.com>

* Change memory check

* Adjust test
2019-10-29 21:03:04 +01:00
Steven
3c630343d0 Publish
- @now/routing-utils@1.2.3-canary.5
2019-10-29 10:38:40 -04:00
Steven
fe61b31197 [now-routing-utils] Fix html redirects for cleanUrls (#3217)
We used to read the output files and create a route for each redirect when `cleanUrls: true`.

Instead, this PR will add 2 redirects for `cleanUrls: true` no matter how many files are in the outputs.
2019-10-29 14:23:23 +00:00
Joe Haddad
af14d0af4b Publish
- @now/build-utils@1.0.0-canary.15
 - now@16.1.4-canary.28
 - @now/next@1.0.0-canary.15
2019-10-28 21:28:24 -04:00
JJ Kasper
e04e6bb188 [now-next] Add Beta iSSG Support (#3067)
Adds support for new SPRv2 handling in Next.js.

x-ref: #3021
2019-10-29 01:26:42 +00:00
Andy
e36f3d355e [now-build-utils] Add functions property (#3213)
This updates `@now/build-utils` to add support for the function property including types and tests.

Related: [PRODUCT-27]

[PRODUCT-27]: https://zeit.atlassian.net/browse/PRODUCT-27
2019-10-28 23:47:45 +00:00
Nathan Rajlich
24891e3ce8 [now-cli] Remove now dev cleanCacheDir() function (#3214)
Dead code as of #2097.
2019-10-28 16:26:13 -07:00
Steven
147c703cce Publish
- now@16.4.4
 - @now/routing-utils@1.3.2
2019-10-28 10:47:33 -04:00
Steven
3aa92c3f27 [now-routing-utils] Fix validation for routes/cleanUrls (#3211) 2019-10-28 10:41:11 -04:00
Steven
0d29e37dcb Publish
- now@16.1.4-canary.27
 - @now/routing-utils@1.2.3-canary.4
2019-10-28 10:40:03 -04:00
Steven
089b29c2ca [now-routing-utils] Fix validation for routes/cleanUrls (#3211) 2019-10-28 10:38:58 -04:00
Leo Lamprecht
af513c249c Improve test stability (#3208)
This pull request aims to make our test suite more stable.
2019-10-26 17:58:21 +02:00
Leo Lamprecht
d567b5f2fc Improve test stability (#3208)
This pull request aims to make our test suite more stable.
2019-10-26 15:53:38 +00:00
Max Rovensky
c336353020 Publish
- now@16.4.3
2019-10-26 06:03:24 +08:00
Max
523b9de1e0 Separate out queued into it's own spinner (#3206) 2019-10-26 06:02:57 +08:00
Max Rovensky
6151f11657 Publish
- now@16.1.4-canary.26
2019-10-26 05:50:49 +08:00
Max
c0d3847aab Separate out queued into it's own spinner (#3206) 2019-10-26 05:50:15 +08:00
Max Rovensky
93d295ac5c Publish
- now@16.4.2
2019-10-26 04:47:41 +08:00
Max
8430de13c2 Add Queued spinner (#3205)
* Add `Queued` indication before builds begin

* Fix second spinner condition
2019-10-26 04:47:02 +08:00
luc
c78af57d76 Publish
- gatsby-plugin-now@1.2.1-canary.2
 - now@16.1.4-canary.25
 - @now/next@1.0.0-canary.14
 - @now/node@1.0.0-canary.10
 - @now/static-build@0.9.9-canary.15
2019-10-25 22:01:19 +02:00
Max
172605d77d Add Queued spinner (#3205)
* Add `Queued` indication before builds begin

* Fix second spinner condition
2019-10-25 21:59:51 +02:00
Michael Zetterberg fd. Lopez
d7dc5a0c45 [gatsby-plugin-now] Fix logic error for redirect check (#3203)
Currently `__now_routes_g4t5bY.json` always gets created, regardless of existing redirects in Gatsby.

This PR fixes that.

PS. According to https://github.com/zeit/now/blob/canary/CONTRIBUTING.md I should run `yarn lint` and `yarn test` but both fail on a clean clone. Not sure how to handle that.

gist for errors:
- [yarn lint](https://gist.github.com/michaellopez/ae187969b64da017de295967cb0d7539)
- [yarn test](https://gist.github.com/michaellopez/024c484bedca8018e933d61b3a2c13ee)
2019-10-25 19:42:20 +00:00
Steven
75edd0bab5 [now-node][now-next] Bump node-file-trace to 0.4.0 (#3204)
Bump `@zeit/node-file-trace` to version [0.4.0](https://github.com/zeit/node-file-trace/releases/tag/0.4.0).
2019-10-25 18:56:31 +00:00
Luc
ac60b3660c [now-static-build] Inject gatsby-plugin-now in Gatsby deployments (#3182)
This PR is an attempt to automatically inject `gatsby-plugin-now` in Gatsby projects, as an optimisation.

- [x] avoid conflicts with existing files
- [x] refactor
2019-10-25 12:54:14 +00:00
Sophearak Tha
372a674625 Publish
- @now/build-utils@0.11.1
 - now@16.4.1
 - now-client@5.2.2
 - @now/next@1.0.5
 - @now/python@0.3.3
2019-10-25 19:34:00 +07:00
Sophearak Tha
fafeadb7ba update now-cli readme (#3202) 2019-10-25 14:14:24 +02:00
Max
966b1e763f Add apiUrl debug log to now-client (#3201) 2019-10-25 14:14:19 +02:00
Sophearak Tha
6e22c07ecc Publish
- now@16.1.4-canary.24
 - now-client@5.1.1-canary.12
2019-10-25 19:04:10 +07:00
Sophearak Tha
857e4ef874 update now-cli readme (#3202) 2019-10-25 14:02:41 +02:00
Max
aa03f69bdc Add apiUrl debug log to now-client (#3201) 2019-10-25 13:38:58 +02:00
Sophearak Tha
8fc77139e0 Publish
- now@16.1.4-canary.23
2019-10-25 18:04:04 +07:00
Luc
bb60e1a5fe Improve styling of 1.0 message (#3200) 2019-10-25 12:47:19 +02:00
Luc
87802cb002 Improve styling of 1.0 message (#3200) 2019-10-25 12:38:02 +02:00
Nathan Rajlich
cac9f807cc [now-cli] Gracefully exit when the cwd does not exist (#3194)
There have been Sentry errors where `process.cwd()` fails and throws an error. This patch handles that scenario gracefully by printing a more clear error message to the user and avoids sending a report to Sentry.

Fixes #3193.
2019-10-25 11:49:45 +02:00
Steven
a0b1254820 Fix circle ci xcode version (#3197) 2019-10-25 11:48:27 +02:00
Nathan Rajlich
0faff4132b [now-build-utils] Add more complete PackageJson typings (#3198)
* [now-build-utils] Add more complete `PackageJson` typings

Planning on using this in `now-cli`.

* Make "name" optional

* Use a namespace
2019-10-25 11:47:36 +02:00
Joe Haddad
1793a1287d [now-next] Cache All Next.js Directories (#3190)
Next.js now uses the `css` and `media` folders for its build-in CSS support. These files should be cached forever.
2019-10-25 11:45:37 +02:00
Max
5b572239c1 [now-client] Yield an error event if path provided is not absolute (#3173)
This adds an `error` event when provided path to `now-client` isn't absolute
2019-10-25 11:43:34 +02:00
Steven
f6a66d937e [now-client] Change npm publish to use files key (#3181)
- remove `.npmignore`
- use [`files`](https://docs.npmjs.com/files/package.json#files) key in `package.json`
- update metadata in `package.json`
- fix test harness to generate a token for each test deployment

This PR will prevent publishing [tests](https://cdn.jsdelivr.net/npm/now-client@5.2.0/tests/) to npm and any other unused files.
2019-10-25 11:43:29 +02:00
Sophearak Tha
2cf9a2f489 [now-client] [now-cli] Update version of deployment API (#3188)
* Update version of deployment API

* Add `alias-assigned` event and handling

* Replace v9 api with v10

* Don't return on immediate ready

* Handle alias-assigned for v1 deployments

* Improve event ordering

* Detect upload deployment readiness by `alias-assigned`

* rebuild

* Fix upload readiness event type

* Check for aliases before running status checks

* Improve event flow and wait for `ready` in v1 deployments

* Remove console.log
2019-10-25 11:42:18 +02:00
Nathan Rajlich
454f4dcc61 [now-cli] Don't throw if builder child process can not be killed (#3192)
The Sentry error reports that the process has already been killed, so no need to throw in this case.

Fixes #3191.
2019-10-25 11:42:09 +02:00
Yevhen Amelin
6e1065fde2 [now-python] Set PIP_USER environment variable (#3111)
Disables `--user` parameter of the `pip` utility, which is forcibly set under the hood on Debian systems and causes an error in the `pipInstall` function:

`distutils.errors.DistutilsOptionError: can't combine user with prefix, exec_prefix/home, or install_(plat)base`

Fixes #3089
2019-10-25 11:41:19 +02:00
Max
80ce06b20c [now-client] Add apiUrl support (#3168)
This PR adds support for `apiUrl` option to `now-client` as well as a test for it
2019-10-25 11:41:01 +02:00
Nathan Rajlich
99f3ab8b64 [now-cli] Loosen "engines" requirement to Node >= 8 (#3195)
Now that `now-client` does not use `fetch-h2`, any version of Node 8 or newer should work with `now-cli`.

Related to #2711.
2019-10-25 11:40:23 +02:00
Luc
ca4f6d2491 [now-cli] Disable --prod and --target for Now 1.0 deployments (#3189)
This PR disables Now 1.0 production deployments with the following error message:

> Option --prod is not supported for Now 1.0 deployments. To manually alias a deployment, use `now alias` instead.

It looks like this:
<img width="835" alt="Capture d’écran 2019-10-23 à 19 42 09" src="https://user-images.githubusercontent.com/6616955/67419574-3e125380-f5cd-11e9-81ff-63bde292539b.png">

Also disables `--target` for Now 1.0 deployments.
2019-10-25 11:39:53 +02:00
Sophearak Tha
dcd57e148f Publish
- @now/build-utils@1.0.0-canary.14
 - now@16.1.4-canary.22
 - now-client@5.1.1-canary.11
2019-10-25 11:32:43 +07:00
Sophearak Tha
18fa193a17 [now-client] [now-cli] Update version of deployment API (#3188)
* Update version of deployment API

* Add `alias-assigned` event and handling

* Replace v9 api with v10

* Don't return on immediate ready

* Handle alias-assigned for v1 deployments

* Improve event ordering

* Detect upload deployment readiness by `alias-assigned`

* rebuild

* Fix upload readiness event type

* Check for aliases before running status checks

* Improve event flow and wait for `ready` in v1 deployments

* Remove console.log
2019-10-25 11:28:36 +07:00
Nathan Rajlich
34dce350be [now-cli] Loosen "engines" requirement to Node >= 8 (#3195)
Now that `now-client` does not use `fetch-h2`, any version of Node 8 or newer should work with `now-cli`.

Related to #2711.
2019-10-25 00:38:21 +00:00
Nathan Rajlich
c7caa7b905 [now-build-utils] Add more complete PackageJson typings (#3198)
* [now-build-utils] Add more complete `PackageJson` typings

Planning on using this in `now-cli`.

* Make "name" optional

* Use a namespace
2019-10-24 16:02:16 -07:00
Steven
2ceb2a78aa Publish
- @now/routing-utils@1.3.1
2019-10-24 16:59:56 -04:00
Steven
d97da21afc [now-routing-utils] Change cleanUrls to redirect only (#3196)
When `cleanUrls` is true, the redirects will be applied to the routes however there are no longer any rewrites. Instead (through a different PR to fmeta-util) we will rename the file output to remove the `.html` extension.
2019-10-24 16:58:38 -04:00
Steven
7b52b26ff0 Publish
- now@16.1.4-canary.21
 - now-client@5.1.1-canary.10
 - @now/next@1.0.0-canary.13
 - @now/python@0.2.17-canary.7
 - @now/routing-utils@1.2.3-canary.3
2019-10-24 16:09:06 -04:00
Steven
3c958a4429 [now-routing-utils] Change cleanUrls to redirect only (#3196)
When `cleanUrls` is true, the redirects will be applied to the routes however there are no longer any rewrites. Instead (through a different PR to fmeta-util) we will rename the file output to remove the `.html` extension.
2019-10-24 20:07:16 +00:00
Steven
d8660b1db3 Fix circle ci xcode version (#3197) 2019-10-24 15:34:38 -04:00
Nathan Rajlich
0996640798 [now-cli] Gracefully exit when the cwd does not exist (#3194)
There have been Sentry errors where `process.cwd()` fails and throws an error. This patch handles that scenario gracefully by printing a more clear error message to the user and avoids sending a report to Sentry.

Fixes #3193.
2019-10-24 13:15:27 +00:00
Nathan Rajlich
079f4ba6bf [now-cli] Don't throw if builder child process can not be killed (#3192)
The Sentry error reports that the process has already been killed, so no need to throw in this case.

Fixes #3191.
2019-10-23 21:23:03 +00:00
Luc
bdf78efbfb [now-cli] Disable --prod and --target for Now 1.0 deployments (#3189)
This PR disables Now 1.0 production deployments with the following error message:

> Option --prod is not supported for Now 1.0 deployments. To manually alias a deployment, use `now alias` instead.

It looks like this:
<img width="835" alt="Capture d’écran 2019-10-23 à 19 42 09" src="https://user-images.githubusercontent.com/6616955/67419574-3e125380-f5cd-11e9-81ff-63bde292539b.png">

Also disables `--target` for Now 1.0 deployments.
2019-10-23 20:26:09 +00:00
Joe Haddad
07ba180ede [now-next] Cache All Next.js Directories (#3190)
Next.js now uses the `css` and `media` folders for its build-in CSS support. These files should be cached forever.
2019-10-23 17:34:13 +00:00
Max
94a2b017d4 [now-client] Add apiUrl support (#3168)
This PR adds support for `apiUrl` option to `now-client` as well as a test for it
2019-10-23 09:32:47 +00:00
Yevhen Amelin
37c06c89d0 [now-python] Set PIP_USER environment variable (#3111)
Disables `--user` parameter of the `pip` utility, which is forcibly set under the hood on Debian systems and causes an error in the `pipInstall` function:

`distutils.errors.DistutilsOptionError: can't combine user with prefix, exec_prefix/home, or install_(plat)base`

Fixes #3089
2019-10-22 22:26:54 +00:00
Max
42ffc2dafb [now-client] Yield an error event if path provided is not absolute (#3173)
This adds an `error` event when provided path to `now-client` isn't absolute
2019-10-22 20:19:11 +00:00
Steven
cf65fabe27 [now-client] Change npm publish to use files key (#3181)
- remove `.npmignore`
- use [`files`](https://docs.npmjs.com/files/package.json#files) key in `package.json`
- update metadata in `package.json`
- fix test harness to generate a token for each test deployment

This PR will prevent publishing [tests](https://cdn.jsdelivr.net/npm/now-client@5.2.0/tests/) to npm and any other unused files.
2019-10-22 15:30:57 +00:00
Nathan Rajlich
03b5a0c0bf Publish
- @now/build-utils@0.11.0
 - now@16.4.0
 - now-client@5.2.1
 - @now/node@1.0.2
 - @now/python@0.3.2
 - @now/routing-utils@1.3.0
 - @now/static-build@0.11.0
2019-10-21 16:19:11 -07:00
Steven
f76abe3372 [now-build-utils] Add contentType prop to File (#3178)
This PR adds a `contentType` to the File interface.

This is necessary for [PRODUCT-341] to work properly with `cleanUrls` which will strip the file name but we will still need specify `contentType: 'text/html'`.

This is required for @dav-is `api-builds` PR 633 to work properly.

[PRODUCT-341]: https://zeit.atlassian.net/browse/PRODUCT-341
2019-10-21 16:11:16 -07:00
Steven
cdd43b74ae [now-node] Fix helpers when POST json has empty body (#3177)
The `@now/node` helpers json parsing is too strict and doesn't match the behavior of Express when an incoming request has `{ method: 'POST', Content-Type: 'application/json', body: '' }`.

Instead of returning 400, this PR will continue with `body = {}` to match Express.

Fixes https://spectrum.chat/zeit/now/klarna-with-zeit-now~60852003-4db6-4ec4-a611-83b2349ece08
2019-10-21 16:11:09 -07:00
Nathan Rajlich
fa633d0e02 [now-cli] Temporarily force TooTallNate/signal-exit#update/sighub-to-sigint-on-windows for "signal-exit" module (#3171)
Fixes https://github.com/zeit/now/issues/2564.

Upstream fix PR: https://github.com/tapjs/signal-exit/pull/55.
2019-10-21 16:11:00 -07:00
Nathan Rajlich
9b46e60c09 [now-cli] Remove serveProjectAsStatic() (#3170)
Because we treat purely static projects as v2 projects with a `@now/static` builder specified, this is now dead code.
2019-10-21 16:10:54 -07:00
Steven
58eef7f394 [now-build-utils] Fix static file serving from now dev (#3167)
This PR does a few things

- Separate tests into `integration.test.js` and `unit.test.js`
- Use one static build instead of many to avoid `should NOT have more than 128 items` error
- Add a new unit test so we don't regress

Fixes #3159
2019-10-21 16:10:39 -07:00
Nathan Rajlich
e97e0fbb64 [now-cli] Spawn builder child processes with stdio: 'inherit' in now dev (#3113)
Inherit the `now dev` process stdio streams in builder child processes, so that ANSI color codes may be used when stdout is a TTY.

**Examples:**

_Next.js_

<img width="523" alt="Screen Shot 2019-10-01 at 3 42 33 PM" src="https://user-images.githubusercontent.com/71256/66006087-4fe75780-e462-11e9-927f-1e81466c4108.png">

_Gatsby_ (depends on #3112)

<img width="507" alt="Screen Shot 2019-10-01 at 3 40 02 PM" src="https://user-images.githubusercontent.com/71256/66006094-5d9cdd00-e462-11e9-81da-e60bd9516778.png">

Fixes #3135.
2019-10-21 16:10:32 -07:00
Steven
b82876fd82 [now-routing-utils] Add superstatic transformations (#3138)
This implements a new function `getTransformedRoutes()` which transforms some [superstatic](https://github.com/firebase/superstatic#configuration) configuration keys to Now routes so we can eventually use this new keys in `now.json`.

In particular, the following new keys are transformed to `routes`.

- cleanUrls
- rewrites
- redirects
- headers
- trailingSlash

[PRODUCT-341] #close

[PRODUCT-341]: https://zeit.atlassian.net/browse/PRODUCT-341
2019-10-21 16:10:08 -07:00
Steven
02ad32ec22 [tests] Fix tests so they wait for v1 deployments (#3162)
Our tests periodically fail because we're creating too many v1 deployments on a free plan and it times out.

This limits the number of deployments by running v1 exclusively under Node 12.

It also adds a missing waitForDeployment().
2019-10-21 16:09:16 -07:00
Allen Hai
433fe35c93 [now-static-build] Add stencil to list of optimized static frameworks (#3158)
This PR enables a zero-config deployment experience for `stencil` projects. The default build command outputs to a `www` directory.
2019-10-21 16:09:06 -07:00
Jacob Mischka
90c59d6ae2 [now-python] Fix UnicodeDecodeError for binary response from handler (#3148)
Fixes #3147
2019-10-21 16:08:51 -07:00
Joe Haddad
33672c3d78 [now-build-utils] Allow a null fallback in Prerender (#3144)
This allows a `null` `fallback` to be provided to a `Prerender`. The use case is a lazily prerendered route (often meaning dynamically rendered).
2019-10-21 16:08:42 -07:00
Nathan Rajlich
59ae7a989a [now-cli] Set the builder's debug env var based on DevServer.debug (#3139)
This makes it so that a programatically created `DevServer` instance that has `debug` mode enabled also gets set on the builder child processes as expected, rather than only when invoked via CLI.

For example, the `dev-server.unit.js` tests can set `debug: true` and with this change the builder child processes will also have debug logs enabled. See [here](https://git.io/JeW0O).
2019-10-21 16:08:35 -07:00
Nathan Rajlich
5767e9e8c2 [now-static-build] Exit dev server child processes upon SIGINT/SIGTERM (#3136)
Explicitly send the SIGINT / SIGTERM signal to `now dev` server child processes, so that they are not left running when running the now-dev unit tests.

Related to #3113 which has hanging unit tests that never "complete".
2019-10-21 16:08:26 -07:00
Steven
e62b9e8ed9 [now-build-utils] Fix typo occurres => occurs (#3132)
Fixes #2931
2019-10-21 16:08:10 -07:00
Sophearak Tha
59597ccd17 [now-cli] Update readme (#3128) 2019-10-21 16:07:57 -07:00
Andy
7be49c66ef Revert "[now-cli] Remove dev: "now dev" script detection logic in now dev (#3088)" (#3127)
This reverts commit 85170d7231.
2019-10-21 16:07:50 -07:00
Sophearak Tha
1380e25ef3 [now-client] Fix ENOENT regression in now-client (#3125)
This PR should fixes `ENOENT` related errors

```
> Error! ENOENT: no such file or directory, stat '.../node_modules/.bin/...'
```

Related: https://github.com/zeit/now/issues/3104
2019-10-21 16:07:45 -07:00
Nathan Rajlich
e825ce746f [now-cli] Remove dev: "now dev" script detection logic in now dev (#3088)
As of https://github.com/zeit/now-builders/pull/679, this logic is unnecessary because the `@now/static-build` builder will never end up executing the `dev` script when there is a `now.json` file present (and thus, no builds present, aka zero config mode).

Also, statically detecting the `now dev` command from the script command is brittle, as the command could execute a separate shell script that ends up executing `now dev` (and this detection logic would be a false negative).
2019-10-21 16:07:38 -07:00
Steven
dc9b9c240a [now-cli] Add support for new keys in now dev (#3174)
This PR is a followup to #3138 so that `now dev` will validate and transform the following `now.json` config keys to routes:

- cleanUrls
- rewrites
- redirects
- headers
- trailingSlash

[PRODUCT-341] #close

[PRODUCT-341]: https://zeit.atlassian.net/browse/PRODUCT-341
2019-10-21 21:55:28 +00:00
Steven
84d8f73a2d Publish
- @now/build-utils@1.0.0-canary.13
2019-10-21 13:35:03 -04:00
Steven
b24cfb605b [now-build-utils] Add contentType prop to File (#3178)
This PR adds a `contentType` to the File interface.

This is necessary for [PRODUCT-341] to work properly with `cleanUrls` which will strip the file name but we will still need specify `contentType: 'text/html'`.

This is required for @dav-is `api-builds` PR 633 to work properly.

[PRODUCT-341]: https://zeit.atlassian.net/browse/PRODUCT-341
2019-10-21 17:27:46 +00:00
Steven
57f66fe62f Publish
- now@16.1.4-canary.20
 - @now/node@1.0.0-canary.9
2019-10-21 11:57:06 -04:00
Steven
d2cd4a3c5a [now-node] Fix helpers when POST json has empty body (#3177)
The `@now/node` helpers json parsing is too strict and doesn't match the behavior of Express when an incoming request has `{ method: 'POST', Content-Type: 'application/json', body: '' }`.

Instead of returning 400, this PR will continue with `body = {}` to match Express.

Fixes https://spectrum.chat/zeit/now/klarna-with-zeit-now~60852003-4db6-4ec4-a611-83b2349ece08
2019-10-21 15:45:38 +00:00
Joe Haddad
4e58951808 Publish
- @now/next@1.0.4
2019-10-20 14:56:29 -04:00
Joe Haddad
fbd805aad7 [now-next] Update console.time labels for clarity (#3157) 2019-10-20 14:37:35 -04:00
JJ Kasper
2a2705c6e3 Add test for now dev and Next.js src dir (#3149)
Follow up on #3140 we needed to publish the change before we could test it in `now dev`
2019-10-20 14:37:27 -04:00
JJ Kasper
986c957183 [now-next] Add support for src dir in now-dev (#3140)
Fixes: #3133
Fixes: https://github.com/zeit/next.js/issues/9007
2019-10-20 14:37:13 -04:00
Nathan Rajlich
c5d063e876 [now-next] Exit dev server child processes upon SIGINT/SIGTERM (#3137)
Explicitly send the SIGINT / SIGTERM signal to `now dev` server child processes, so that they are not left running when running the now-dev unit tests.

Related to #3113 which has hanging unit tests that never "complete".
2019-10-20 14:37:07 -04:00
Nathan Rajlich
110e1445fa [now-cli] Temporarily force TooTallNate/signal-exit#update/sighub-to-sigint-on-windows for "signal-exit" module (#3171)
Fixes https://github.com/zeit/now/issues/2564.

Upstream fix PR: https://github.com/tapjs/signal-exit/pull/55.
2019-10-18 15:53:00 +00:00
Nathan Rajlich
f9355cbc77 [now-cli] Remove serveProjectAsStatic() (#3170)
Because we treat purely static projects as v2 projects with a `@now/static` builder specified, this is now dead code.
2019-10-18 13:25:01 +00:00
Steven
0a9bbd902f Publish
- @now/build-utils@1.0.0-canary.12
2019-10-17 14:41:00 -04:00
Steven
c8c960f785 [now-build-utils] Fix static file serving from now dev (#3167)
This PR does a few things

- Separate tests into `integration.test.js` and `unit.test.js`
- Use one static build instead of many to avoid `should NOT have more than 128 items` error
- Add a new unit test so we don't regress

Fixes #3159
2019-10-17 18:38:25 +00:00
Steven
fb0f4beca6 Publish
- now@16.1.4-canary.19
 - @now/next@1.0.0-canary.12
 - @now/routing-utils@1.2.3-canary.2
2019-10-17 08:32:17 -04:00
Nathan Rajlich
21398d7214 [now-cli] Spawn builder child processes with stdio: 'inherit' in now dev (#3113)
Inherit the `now dev` process stdio streams in builder child processes, so that ANSI color codes may be used when stdout is a TTY.

**Examples:**

_Next.js_

<img width="523" alt="Screen Shot 2019-10-01 at 3 42 33 PM" src="https://user-images.githubusercontent.com/71256/66006087-4fe75780-e462-11e9-927f-1e81466c4108.png">

_Gatsby_ (depends on #3112)

<img width="507" alt="Screen Shot 2019-10-01 at 3 40 02 PM" src="https://user-images.githubusercontent.com/71256/66006094-5d9cdd00-e462-11e9-81da-e60bd9516778.png">

Fixes #3135.
2019-10-17 00:18:14 +00:00
Steven
a5a56836a8 [now-routing-utils] Add superstatic transformations (#3138)
This implements a new function `getTransformedRoutes()` which transforms some [superstatic](https://github.com/firebase/superstatic#configuration) configuration keys to Now routes so we can eventually use this new keys in `now.json`.

In particular, the following new keys are transformed to `routes`.

- cleanUrls
- rewrites
- redirects
- headers
- trailingSlash

[PRODUCT-341] #close

[PRODUCT-341]: https://zeit.atlassian.net/browse/PRODUCT-341
2019-10-16 22:34:52 +00:00
Steven
e7fd1e3c3f [tests] Fix tests so they wait for v1 deployments (#3162)
Our tests periodically fail because we're creating too many v1 deployments on a free plan and it times out.

This limits the number of deployments by running v1 exclusively under Node 12.

It also adds a missing waitForDeployment().
2019-10-16 21:47:31 +00:00
Joe Haddad
64b24bde56 [now-next] Update console.time labels for clarity (#3157) 2019-10-15 12:39:40 +00:00
Allen Hai
613958d6a5 Publish
- now@16.1.4-canary.18
 - @now/python@0.2.17-canary.6
 - @now/static-build@0.9.9-canary.14
2019-10-14 19:08:32 -05:00
Allen Hai
21e4ebc7a9 [now-static-build] Add stencil to list of optimized static frameworks (#3158)
This PR enables a zero-config deployment experience for `stencil` projects. The default build command outputs to a `www` directory.
2019-10-14 23:49:59 +00:00
JJ Kasper
16ef6229e4 Add test for now dev and Next.js src dir (#3149)
Follow up on #3140 we needed to publish the change before we could test it in `now dev`
2019-10-10 20:36:24 +00:00
Jacob Mischka
9ecb011732 [now-python] Fix UnicodeDecodeError for binary response from handler (#3148)
Fixes #3147
2019-10-10 16:51:37 +00:00
JJ Kasper
de48e28fa1 Publish
- @now/build-utils@1.0.0-canary.11
 - now@16.1.4-canary.17
 - @now/next@1.0.0-canary.11
2019-10-10 10:43:51 -05:00
JJ Kasper
3aecb0905a [now-next] Add support for src dir in now-dev (#3140)
Fixes: #3133
Fixes: https://github.com/zeit/next.js/issues/9007
2019-10-10 14:40:38 +00:00
Joe Haddad
c1b2da1d57 [now-build-utils] Allow a null fallback in Prerender (#3144)
This allows a `null` `fallback` to be provided to a `Prerender`. The use case is a lazily prerendered route (often meaning dynamically rendered).
2019-10-10 05:07:26 +00:00
Nathan Rajlich
c4bee64abd [now-cli] Set the builder's debug env var based on DevServer.debug (#3139)
This makes it so that a programatically created `DevServer` instance that has `debug` mode enabled also gets set on the builder child processes as expected, rather than only when invoked via CLI.

For example, the `dev-server.unit.js` tests can set `debug: true` and with this change the builder child processes will also have debug logs enabled. See [here](https://git.io/JeW0O).
2019-10-09 01:19:10 +00:00
Nathan Rajlich
dbf9c5c46b Publish
- @now/build-utils@1.0.0-canary.10
 - @now/next@1.0.0-canary.10
 - @now/static-build@0.9.9-canary.13
2019-10-08 16:04:24 -07:00
Nathan Rajlich
630ec06d48 [now-static-build] Exit dev server child processes upon SIGINT/SIGTERM (#3136)
Explicitly send the SIGINT / SIGTERM signal to `now dev` server child processes, so that they are not left running when running the now-dev unit tests.

Related to #3113 which has hanging unit tests that never "complete".
2019-10-08 22:57:29 +00:00
Nathan Rajlich
d38e464bfe [now-next] Exit dev server child processes upon SIGINT/SIGTERM (#3137)
Explicitly send the SIGINT / SIGTERM signal to `now dev` server child processes, so that they are not left running when running the now-dev unit tests.

Related to #3113 which has hanging unit tests that never "complete".
2019-10-08 22:25:47 +00:00
Steven
49bd2439a7 [now-build-utils] Fix typo occurres => occurs (#3132)
Fixes #2931
2019-10-07 20:44:44 +00:00
Sophearak Tha
e97314a3c7 Publish
- now@16.1.4-canary.16
2019-10-04 20:25:15 +07:00
Sophearak Tha
acb46cef14 [now-cli] Update readme (#3128) 2019-10-04 20:23:45 +07:00
Sophearak Tha
06b9ff233e Publish
- now-client@5.1.1-canary.9
2019-10-04 19:59:22 +07:00
Andy
a189e72fbe Revert "[now-cli] Remove dev: "now dev" script detection logic in now dev (#3088)" (#3127)
This reverts commit 85170d7231.
2019-10-04 14:54:27 +02:00
Sophearak Tha
75e6b15199 [now-client] Fix ENOENT regression in now-client (#3125)
This PR should fixes `ENOENT` related errors

```
> Error! ENOENT: no such file or directory, stat '.../node_modules/.bin/...'
```

Related: https://github.com/zeit/now/issues/3104
2019-10-04 10:25:26 +00:00
Nathan Rajlich
85170d7231 [now-cli] Remove dev: "now dev" script detection logic in now dev (#3088)
As of https://github.com/zeit/now-builders/pull/679, this logic is unnecessary because the `@now/static-build` builder will never end up executing the `dev` script when there is a `now.json` file present (and thus, no builds present, aka zero config mode).

Also, statically detecting the `now dev` command from the script command is brittle, as the command could execute a separate shell script that ends up executing `now dev` (and this detection logic would be a false negative).
2019-10-03 21:29:54 +00:00
Steven
500c36f5d4 Publish
- now@16.3.1
 - now-client@5.2.0
 - @now/next@1.0.3
 - @now/python@0.3.1
 - @now/static-build@0.10.1
2019-10-03 13:54:14 -04:00
Steven
eeffb55021 Publish
- now@16.1.4-canary.15
 - now-client@5.1.1-canary.8
2019-10-03 13:44:39 -04:00
Steven
69dbbeac44 [now-cli][now-client] Fix v1 files when defining a directory (#3123)
This is a follow up to #3117 which added a fix for `files` but did not observe directories.

This PR fixes the scenario where a directory is defined such that all files inside the directory should be added uploaded (recursively).

Thanks to @williamli 

[PRODUCT-350] #close

[PRODUCT-350]: https://zeit.atlassian.net/browse/PRODUCT-350
2019-10-03 13:44:21 -04:00
Steven
1fe8317f1e [now-cli][now-client] Fix v1 files when defining a directory (#3123)
This is a follow up to #3117 which added a fix for `files` but did not observe directories.

This PR fixes the scenario where a directory is defined such that all files inside the directory should be added uploaded (recursively).

Thanks to @williamli 

[PRODUCT-350] #close

[PRODUCT-350]: https://zeit.atlassian.net/browse/PRODUCT-350
2019-10-03 17:41:37 +00:00
Sophearak Tha
69486c3adb [now-client] [now-cli] Handle notice type (#3122)
This PR handle `notice` type from API respond.
2019-10-03 12:14:02 -04:00
Sophearak Tha
6398ef194c [now-client] [now-cli] Handle notice type (#3122)
This PR handle `notice` type from API respond.
2019-10-03 14:58:00 +00:00
Steven
e6692bb79b [now-cli][now-client] Fix --local-config flag and files key (#3117)
This PR is a followup to #3110 that fixes the first deployment when using the `--local-config` flag and also fixes v1 deployments using the [`files`](https://zeit.co/docs/v1/features/configuration/#files-(array)) key.

The tests have been adjusted so we don't regress in both cases.

Fixes #3099 
Fixes #3105
Fixes #3107
Fixes #3109

[PRODUCT-350] #close

[PRODUCT-350]: https://zeit.atlassian.net/browse/PRODUCT-350
2019-10-03 09:07:01 -04:00
Chris
94fba1d7af [now-python] Encode body as utf-8 before making a request (#3093)
Fixes #3091
2019-10-03 09:06:54 -04:00
Sophearak Tha
223d8f4774 [now-cli] Rename lambda to serverless function (#3100)
This PR fix: [PRODUCT-66] #close

[PRODUCT-66]: https://zeit.atlassian.net/browse/PRODUCT-66
2019-10-03 09:06:49 -04:00
Nathan Rajlich
42e7a7e4e3 [now-static-build] Use stdio: 'inherit' for "dev" script child process (#3112)
Since `@now/static-build` is no longer sniffing the stdio streams for the bound port number in `now dev`, there's no need to have separate stdio streams for the "dev" script. Instead, inherit stdio from the parent process, which will allow for ANSI colors to be used when stdout is a TTY in `now dev`.

Also simplifies the `checkForPort()` function and removes the `promise-timeout` dependency.
2019-10-03 09:06:44 -04:00
Steven
6716fdd49b [now-cli][now-client] Add parameter nowConfig for custom now.json (#3110)
When now-client was implemented, it did not work with `--local-config` flag from now-cli because the only parameters it looks at are the files in a directory.

This fixes the regression in now@16.3.0 so that now-client can accept an optional `nowConfig` object or fallback to the `now.json` file.

Fixes #3099 
Fixes #3105
Fixes #3107
Fixes #3109

[PRODUCT-350] #close


[PRODUCT-350]: https://zeit.atlassian.net/browse/PRODUCT-350
2019-10-03 09:06:38 -04:00
Steven
3b69092fd8 Revert "[tests] Add test all script" since it runs on commit (#3108)
Reverts #3106 from @MAPESO 

The tests seem to be running on each commit which is going to slow down development.
2019-10-03 09:06:32 -04:00
Luis Alvarez D
aa8eaedbc8 [now-next] Upload build-time generated static artifacts (#3096)
For context, when you have a script that generates a new static file at build time (`sitemap.xml` for example), it has to be inside `.next/static`, and then you'll need a Now route for it, with this change you could generate the file inside `public`/`static` and the builder will now take care of it.

The util `includeOnlyEntryDirectory` is no longer being used after this change, should I remove it?
2019-10-03 09:06:25 -04:00
Mark
f519ed373f [tests] Add test all script (#3106)
This PR focuses on adding the `test` script to the `package.json` : )

## Main problem 

Previously there was no `test` script that includes all the tests

<img width="924" alt="Screen Shot 2019-10-01 at 8 13 13 AM" src="https://user-images.githubusercontent.com/16585386/65968681-26f6a080-e429-11e9-9f29-c6fd343fdb12.png">
2019-10-03 09:06:20 -04:00
Ana Trajkovska
851dff4b03 [now-cli] Integrate Projects API v2 (#3063)
This PR integrates v2 of Projects API that fixes an issue for projects named `list` or `remove`, because of the naming of the endpoints in v1. For listing all projects, previously in v1 it was `GET /v1/projects/list` and now it is `GET /v2/projects/`, and for removing a project it was `DELETE /v1/projects/remove`.
2019-10-03 09:06:14 -04:00
Steven
e4d691eda1 Publish
- now@16.1.4-canary.14
 - now-client@5.1.1-canary.7
 - @now/next@1.0.0-canary.9
 - @now/python@0.2.17-canary.5
 - @now/static-build@0.9.9-canary.12
2019-10-03 08:24:31 -04:00
Steven
d9bb6c8a54 [now-cli][now-client] Fix --local-config flag and files key (#3117)
This PR is a followup to #3110 that fixes the first deployment when using the `--local-config` flag and also fixes v1 deployments using the [`files`](https://zeit.co/docs/v1/features/configuration/#files-(array)) key.

The tests have been adjusted so we don't regress in both cases.

Fixes #3099 
Fixes #3105
Fixes #3107
Fixes #3109

[PRODUCT-350] #close

[PRODUCT-350]: https://zeit.atlassian.net/browse/PRODUCT-350
2019-10-03 02:17:11 +00:00
Chris
c3020e3071 [now-python] Encode body as utf-8 before making a request (#3093)
Fixes #3091
2019-10-02 18:04:16 -04:00
Sophearak Tha
e3f31e3e52 [now-cli] Rename lambda to serverless function (#3100)
This PR fix: [PRODUCT-66] #close

[PRODUCT-66]: https://zeit.atlassian.net/browse/PRODUCT-66
2019-10-02 10:35:01 +00:00
Nathan Rajlich
8c40e1be0f [now-static-build] Use stdio: 'inherit' for "dev" script child process (#3112)
Since `@now/static-build` is no longer sniffing the stdio streams for the bound port number in `now dev`, there's no need to have separate stdio streams for the "dev" script. Instead, inherit stdio from the parent process, which will allow for ANSI colors to be used when stdout is a TTY in `now dev`.

Also simplifies the `checkForPort()` function and removes the `promise-timeout` dependency.
2019-10-02 09:42:01 +00:00
Steven
b278c7148b Publish
- now@16.1.4-canary.13
 - now-client@5.1.1-canary.6
 - @now/next@1.0.0-canary.8
2019-10-01 21:36:12 -04:00
Steven
2791338e04 [now-cli][now-client] Add parameter nowConfig for custom now.json (#3110)
When now-client was implemented, it did not work with `--local-config` flag from now-cli because the only parameters it looks at are the files in a directory.

This fixes the regression in now@16.3.0 so that now-client can accept an optional `nowConfig` object or fallback to the `now.json` file.

Fixes #3099 
Fixes #3105
Fixes #3107
Fixes #3109

[PRODUCT-350] #close


[PRODUCT-350]: https://zeit.atlassian.net/browse/PRODUCT-350
2019-10-02 01:28:58 +00:00
Steven
0af87dc2be Revert "[tests] Add test all script" since it runs on commit (#3108)
Reverts #3106 from @MAPESO 

The tests seem to be running on each commit which is going to slow down development.
2019-10-01 20:54:04 +00:00
Luis Alvarez D
32134dd1f5 [now-next] Upload build-time generated static artifacts (#3096)
For context, when you have a script that generates a new static file at build time (`sitemap.xml` for example), it has to be inside `.next/static`, and then you'll need a Now route for it, with this change you could generate the file inside `public`/`static` and the builder will now take care of it.

The util `includeOnlyEntryDirectory` is no longer being used after this change, should I remove it?
2019-10-01 18:57:41 +00:00
Mark
bdd4441d5c [tests] Add test all script (#3106)
This PR focuses on adding the `test` script to the `package.json` : )

## Main problem 

Previously there was no `test` script that includes all the tests

<img width="924" alt="Screen Shot 2019-10-01 at 8 13 13 AM" src="https://user-images.githubusercontent.com/16585386/65968681-26f6a080-e429-11e9-9f29-c6fd343fdb12.png">
2019-10-01 16:44:02 +00:00
Ana Trajkovska
99bc1ae7b6 [now-cli] Integrate Projects API v2 (#3063)
This PR integrates v2 of Projects API that fixes an issue for projects named `list` or `remove`, because of the naming of the endpoints in v1. For listing all projects, previously in v1 it was `GET /v1/projects/list` and now it is `GET /v2/projects/`, and for removing a project it was `DELETE /v1/projects/remove`.
2019-09-30 23:16:40 +00:00
Leo Lamprecht
32aa94bf3d Publish
- now@16.1.4-canary.12
2019-09-30 11:13:18 +02:00
Andy
3201227430 [now-cli] Fix deployment version output (#3097)
It will print `[v2]` for 1.0 deployments when logging initially:

```
• go $ now --force
> WARN! You are using an old version of the Now Platform. More: https://zeit.co/docs/v2/advanced/platform/changes-in-now-2-0
> Deploying ~/projects/zeit/now-builder-v1/examples/docker/go under andyschneider
> Using project now-v1-go-docker
> now-v1-go-docker-xxxxxxx.now.sh [v2] [1s]
> Build completed
> https://now-v1-go-docker-xxxxxxx.now.sh [v1] [in clipboard] (sfo1) [1m]
> Verifying instantiation in sfo1
> ✔ Scaled 1 instance in sfo1 [22s]
> Success! Deployment ready
```

Expected:

```
• go $ nowl --force
> WARN! You are using an old version of the Now Platform. More: https://zeit.co/docs/v2/advanced/platform/changes-in-now-2-0
> Deploying ~/projects/zeit/now-builder-v1/examples/docker/go under andyschneider
> Using project now-v1-go-docker
> now-v1-go-docker-xxxxxxx.now.sh [v1] [2s]
> Build completed
> https://now-v1-go-docker-xxxxxxx.now.sh [v1] [in clipboard] (sfo1) [1m]
> Verifying instantiation in sfo1
> ✔ Scaled 1 instance in sfo1 [23s]
> Success! Deployment ready
```

For v2 it shouldn't print anything, as it's the default.
2019-09-28 15:01:22 +00:00
Max Rovensky
09a421c23b Publish
- @now/build-utils@1.0.0-canary.9
 - now@16.1.4-canary.11
 - now-client@5.1.1-canary.5
 - @now/next@1.0.0-canary.7
 - @now/static-build@0.9.9-canary.11
2019-09-28 03:21:27 +08:00
Max
73ce59b492 [now-client] Use ignore module to handle file ignoring logic (#3092)
This implements ignore handling using `ignore` module, in the same way CLI stable does it
2019-09-27 19:19:35 +00:00
Steven
7911d5857d [now-static-build] Make curl silent (#3090)
We added a message in #3068 so this PR makes curl silent unless it errors.

Also fix typo in Gutenberg 😉 

PRODUCT-7 #close
2019-09-27 14:16:48 +00:00
Max
05a44a0c70 [now-cli] Add not_domain_owner error handling (#3045)
This adds missing error handler for `not_domain_owner` error (fixes #3042)
2019-09-27 12:40:51 +00:00
Nathan Rajlich
efd8863f8b [now-client] Export TypeScript types (#3087)
This makes downstream compilation with `tsc` work correctly.

Otherwise, compilation fails with errors such as:

```
../now-client/dist/src/index.d.ts:1:40 - error TS2304: Cannot find name 'CreateDeploymentFunction'.

1 export declare const createDeployment: CreateDeploymentFunction;
                                         ~~~~~~~~~~~~~~~~~~~~~~~~
````
2019-09-27 14:02:35 +08:00
Sophearak Tha
6699028342 [now-next] Invoke build script (#3073)
This PR make `@now/next` invoke `build` script if user defined.

PRODUCT-106 #close
2019-09-27 02:09:45 +00:00
Leo Lamprecht
aa9a234a0b [now-build-utils] Make grouping prerenders optional (#3082)
As of https://github.com/zeit/now/pull/3081, we make it necessary to group `Prerenders` together for being invalidated at the same time.

However, you might not want that. In turn, we'll make it optional.
2019-09-26 20:48:04 +00:00
Leo Lamprecht
91f836818c [now-build-utils] Allow prerender groups to be defined with an integer (#3081)
This pull request removes the `PrerenderGroup` type in favor of a `group` parameter for the existing `Prerender` type.

This parameter takes in an integer that defines a group of prerenders that should be invalidated at the same time:

```
interface Prerender {
  expiration: number;
  lambda: Lambda;
  fallback: FileBlob | FileFsRef | FileRef;
  group: number;
}
```

**Example:** If two `Prerender` instances exist that have `group` set to `1`, they will both be invalidated at the same time.
2019-09-26 18:20:56 +00:00
Max
5e37bdc54c [now-cli] Add logging to execa calls in tests (#3077)
This implements #3075 for all integration tests
2019-09-26 15:13:03 +00:00
Max
31c48df795 [now-client] Retry on network error (#3072)
This PR improves handling of occasional network errors in `now-client` which should improve benchmarking introduced in #3062
2019-09-26 14:17:54 +00:00
Max
0383b9112b [now-cli] Move hexo test to testFixtureStdio (#3076)
This should fix the `now dev` tests that periodically hang
2019-09-26 05:33:43 +00:00
Max
f4fe8be4df [now-client] Add debug logs (#2997)
This PR adds extensive debug logging to `now-client` and enables it in CLI based on the `--debug` flag

Debug logging works in either of the following two conditions:
- `debug: true` is provided in the `options` object of `createDeployment`/`createLegacyDeployment`
- `process.env.NOW_CLIENT_DEBUG` environment variable is set
2019-09-25 14:38:50 +00:00
Sophearak Tha
cc643e373d [now-cli] Render prompt when deploying home directory (#3057)
Fixes #3069 

PRODUCT-160 #close
2019-09-25 05:34:27 +00:00
Steven
651429cb52 [now-static-build] Add test for BUNDLE_WITHOUT env var (#3070)
This adds a test which confirms that `BUNDLE_WITHOUT="test:development"` works properly.

This env var is equivalent to `bundle install --without test development`.

There's no code change here because groups are defined by the user, therefore they must define which ones to ignore (if any).

- Groups Guide: https://bundler.io/v2.0/guides/groups.html
- BUNDLER_WITHOUT: https://bundler.io/v2.0/bundle_config.html#LIST-OF-AVAILABLE-KEYS
- Example Gemfile: https://github.com/thoughtbot/administrate/blob/master/Gemfile

PRODUCT-133 #close
2019-09-24 22:36:06 +00:00
Steven
a374a5ce96 Use PR description for merge commit body (#3071) 2019-09-24 17:53:14 -04:00
Steven
bbb4501e9b Publish
- now@16.1.4-canary.10
 - @now/node@1.0.0-canary.8
 - @now/static-build@0.9.9-canary.10
2019-09-24 17:15:45 -04:00
Steven
947f9093be [now-static-build] Print version of static generator during build (#3068)
* [now-static-build] Print version of static generator

* Use curl progress bar
2019-09-24 21:14:00 +00:00
Steven
42f16b6d1e [tests] Add benchmark script to randomly generate projects files (#3062) 2019-09-24 19:31:44 +00:00
Steven
9ae747a612 [now-node] Fix sharp test using lock file (#3064) 2019-09-24 01:47:46 +00:00
Steven
9217c5e436 [now-static-build] Add Eleventy to optimized framework list (#3060)
* [now-static-build] Add eleventy to frameworks

* Add test using eleventy-base-blog

* Fix tests with dot files

* Add now.json to 27-eleventy fixture
2019-09-23 15:15:28 +00:00
Sophearak Tha
d23e7b1054 [now-cli] Add NOW_BUILDER_DEBUG to build env if --debug (#3041)
* Add `NOW_BUILDER_DEBUG` to build env if `--debug`

* Add `--debug` build env check

* Add `build-env-debug` to prepare
2019-09-23 14:03:30 +00:00
Sophearak Tha
d23eab61cf [now-cli] Fix 02-angular-node test fail (#3058)
* Improve `02-angular-node` test

* Add `yarn.lock` with pin version
2019-09-23 20:30:27 +07:00
Steven
e631de4cfe Publish
- @now/build-utils@1.0.0-canary.8
 - now@16.1.4-canary.9
 - @now/python@0.2.17-canary.4
 - @now/static-build@0.9.9-canary.9
2019-09-21 17:20:40 -04:00
Steven
0814bef36f [now-python] Fix headers with multiple values (#3053)
* [now-python] Add format_headers()

* Add tests

* Fix filenames

* Fix test probes
2019-09-20 21:55:39 +00:00
Andy
ddce65416c [now-cli][now-static-build] Ignore output directory from now dev (#3024)
* [now-cli][now-static-build] Ignore output directory from `now dev`

* Add test

* Logging

* Fix test

* Fix test

* Adjust test

* Log failed test

* Log stderr

* Change now.json

* Change Ready check

* Dynamically create now.json

* Log error

* Log stderr on error

* Create now.json first

* Handle JSON error

* Don't use JSON output

* Join path

* Add quotes

* Use .values
2019-09-20 13:26:55 +00:00
Sophearak Tha
9e66f9bb08 [now-build-utils] Remove NOW_BUILDER_ANNOTATE (#3027) 2019-09-20 09:07:36 +00:00
Steven
961fbfde55 Publish
- @now/build-utils@1.0.0-canary.7
 - @now/go@0.5.11-canary.5
 - @now/next@1.0.0-canary.6
 - @now/node@1.0.0-canary.7
 - @now/python@0.2.17-canary.3
 - @now/static-build@0.9.9-canary.8
2019-09-19 15:58:01 -04:00
Steven
22550c0c48 [now-static-build][now-build-utils] Add python static generators (#3048)
* [now-static-build] Run pip install requirements.txt

* Add test for pelican

* Add test for mkdocs
2019-09-19 19:44:38 +00:00
Sophearak Tha
4336f48d22 [builders] Consistently capitalize first letter of logs (#3039)
* Consistency capitalize logs line `@now/next`

* Consistency capitalize logs line `@now/node`

* Consistency capitalize logs line `@now/go`

* Consistency capitalize logs line `@now/python`

* Always show `Installing dependencies...`

* Consistency capitalize logs line `run-user-scripts`

* Capitalize `Running`
2019-09-19 17:21:43 +00:00
Steven
cf299562e3 Publish
- @now/static-build@0.9.9-canary.7
2019-09-19 11:17:33 -04:00
Steven
2cd5b35603 [now-static-build] Add prepareCache() function (#3047) 2019-09-19 15:11:37 +00:00
Steven
81abab81f7 [now-static-build] Add support for hugo extended (#3043) 2019-09-19 13:27:01 +00:00
Max Rovensky
ad0d7bd560 Publish
- @now/build-utils@1.0.0-canary.6
 - now@16.1.4-canary.8
 - @now/node@1.0.0-canary.6
 - @now/static-build@0.9.9-canary.6
2019-09-19 19:36:51 +08:00
Nathan Rajlich
140d10e87b [now-cli] Update @zeit/fun to v0.10.2 (#3038)
Fixes #2901.
2019-09-18 10:11:12 +00:00
Nathan Rajlich
6bebc49607 [now-cli] Render logs containing "warning" as yellow (#3035) 2019-09-17 23:14:34 +00:00
Steven
a3aa855290 [docs] Update CI badge to use master (#3037) 2019-09-17 22:33:02 +00:00
Steven
a853cb84cd [tests] Add env var FORCE_BUILD_IN_REGION (#3036)
* [tests] Add env var FORCE_BUILD_IN_REGION

* Add missing config
2019-09-17 21:56:46 +00:00
Steven
a07082ca5c [now-static-build] Add hugo, zola, and gutenberg versioning (#3025)
* [now-static-build] Add hugo, zola, and gutenberg versioning

* Add tests

* Export spawnAsync

* Change spawnAsync to remove cwd
2019-09-17 19:14:39 +00:00
Leo Lamprecht
81c27771bc [now-build-utils] Add types for SPRv2 (#3021)
* Add `Prerender` type for SPRv2

* Make it a default export

* Added `PrerenderGroup` type

* Renamed interface
2019-09-17 18:28:04 +00:00
Andy
502f78e835 [now-cli] Fix fetch body and add secrets tests (#3030) 2019-09-17 13:21:18 +00:00
Nathan Rajlich
d8935cf121 [now-cli] Assign process.exitCode (#3028)
No real functional change here, but assigning to `process.exitCode`
is the more proper Node.js way to set the exit code for the process.
2019-09-17 06:58:43 +00:00
Nathan Rajlich
e3c61ac5b7 [now-cli] Render "stderr" as red in now logs (#3026) 2019-09-17 06:24:34 +00:00
Andy
e8e95b8df6 [now-cli] Adjust the printed version for the deployment (#3014) 2019-09-14 01:15:39 +00:00
Steven
f55be4f2de [docs] Add scripts for changelog and diff (#3017)
* [release] Add scripts for changelog and diff

* Remove publish docs since it in the wiki

* Add support for windows
2019-09-13 23:35:40 +00:00
Steven
ef081cc4b8 [now-node] Change trace errors to warnings (#3016) 2019-09-13 22:40:26 +00:00
Max Rovensky
8e2444d3cd Publish
- now@16.1.4-canary.7
 - now-client@5.1.1-canary.4
2019-09-14 02:32:19 +08:00
Max
f26407e282 [now-cli][now-client] Remove fetch-h2 (#3011)
* Remove fetch-h2

* Fix package.json

* Fix migration issue

* Improve time() call and ensure consistent header names

* Remove unused agent.ts
2019-09-13 18:23:34 +00:00
Andy
cded895bf7 [now-cli] Add test for zero-config and canary builders (#3009)
* [now-cli] Add test for zero-config and canary builders

* Fix test

* Fix test

* Fix url

* Fix path and export

* Make public
2019-09-13 01:59:49 +00:00
Steven
1211ee4fb3 Publish
- now@16.1.4-canary.6
 - @now/go@0.5.11-canary.4
 - @now/node@1.0.0-canary.5
 - @now/ruby@0.1.5-canary.3
2019-09-12 19:29:03 -04:00
Steven
a42bdefe1a [now-node] Add support for AWS Gateway Event (#3010)
* [now-node] Add support for AWS Gateway Event

* Fix funcName

* Fix makeAwsLauncher export

* Add missing return
2019-09-12 23:26:11 +00:00
Steven
f025f1007b Add release notes script to PUBLISHING.md (#3006) 2019-09-12 18:26:21 +00:00
Andy
1c11a57371 [now-cli] Default to empty string for undefined env var when checking (#3008) 2019-09-12 17:48:32 +00:00
Andy
db2d033484 [now-cli] Add changelog link to update message (#3001) 2019-09-12 16:15:33 +00:00
Max
40537c9eba [now-cli] Fix links output during deployment (#2966)
* Fix links output during deployment

* Move "synced" log to `total-fileds` event

* Pluralize synced messages

* Update packages/now-cli/src/util/deploy/process-deployment.ts

Co-Authored-By: Steven <steven@ceriously.com>

* Fix failing tests due to stdout mismatch
2019-09-12 14:40:46 +00:00
Steven
5cabcb7a27 [now-ruby] Use pre-installed ruby 2.5 (#2991)
* [now-ruby] Use pre-installed ruby 2.5

* Change GEM_HOME

* Add polyfill for Node 8
2019-09-12 13:34:54 +00:00
Nathan Rajlich
1be9ac59f0 [now-cli] Show a warning for invalid env vars in now dev (#3002)
* [now-cli] Show a warning for invalid env vars in `now dev`

Closes #2982.

* Add "validate env var names" integration test
2019-09-12 00:12:29 +00:00
Andy
64356baed3 [now-cli] Add tests for alias rules (#3003) 2019-09-11 23:32:20 +00:00
Sophearak Tha
c944706a0f [now-go] Improve test for custom build flags (#2999) 2019-09-11 16:23:54 +00:00
Nathan Rajlich
f15deaa51e [now-cli] Render correct command for now ls $path_alias_url (#2988)
Previously, if you ran `now ls` with a URL for a path alias, then an
error message `Cannot read property 'replace' of undefined` would occur.

Now, a message is logged saying to instead run `now alias ls $url` which
is the correct command to get path rules relevant to a path alias URL.

> Found matching path alias: rules.domain.com
> Please run `now alias ls rules.domain.com` instead

Fixes #2987.
2019-09-11 15:47:56 +00:00
Steven
61c3b94460 Publish
- @now/build-utils@1.0.0-canary.5
 - @now/static-build@0.9.9-canary.5
2019-09-11 10:32:20 -04:00
Steven
89b018240f [now-static-build] Run bundle install when Gemfile is found (#2980)
* [now-static-build] Run `bundle install` for Gemfile

* Add logs

* Add timeout in case proc hangs

* Rename test

* Remove console.log()

* Hide warnings

* Use runBundleInstall()

* [now-build-utils] Remove --deployment flag

* Run tests for build-utils
2019-09-11 10:28:24 -04:00
Steven
0124dc9969 Publish
- now@16.1.4-canary.5
 - @now/next@1.0.0-canary.5
 - @now/node@1.0.0-canary.4
2019-09-10 12:38:03 -04:00
Steven
936441c8a6 [now-node][now-next] Bump node-file-trace to 0.3.1 (#2990) 2019-09-10 16:12:24 +00:00
Sophearak Tha
c80570e096 [now-cli] Hide Init Duration and XRAY TraceId by default (#2984) 2019-09-10 14:22:08 +00:00
Steven
11c67e1c4c Publish
- @now/build-utils@1.0.0-canary.4
2019-09-10 09:18:57 -04:00
Steven
0d1c0e0f30 [now-build-utils] Add function runBundleInstall() (#2986)
* [now-build-utils] Add function `runBundleInstall`

* Add additional flags

* Set jobs to number of cpus

* Format

* Fix formatting

* Add BUNDLE_APP_CONFIG
2019-09-09 21:51:46 +00:00
Steven
f50572813e Publish
- gatsby-plugin-now@1.2.1-canary.1
 - @now/build-utils@1.0.0-canary.3
 - now@16.1.4-canary.4
 - now-client@5.1.1-canary.3
 - @now/next@1.0.0-canary.4
 - @now/node@1.0.0-canary.3
 - @now/static-build@0.9.9-canary.4
2019-09-09 13:09:08 -04:00
Steven
648b3a4ae2 [now-node] Bump node-file-trace to 0.3.0 and print warnings (#2985)
* Bump node-file-trace to 0.3.0

* [now-node] Print warnings from node-file-trace
2019-09-09 16:39:40 +00:00
Joe Haddad
efe114fa86 [now-next] Add monorepo autosetup support (#2961)
* [now-next] Add monorepo autosetup support

* Add actual tests

* Remove invalid test

* Correct contents directory

* Update tests

* Support new Next.js canaries
2019-09-09 14:42:26 +00:00
Max
4445d5e00f [now-client] Fix windows paths handling (#2974)
* Fix windows paths handling in now-client

* Tweak windows paths  handling
2019-09-09 04:05:20 +00:00
Clément ALLAIN
96b3c1ee7f [now-static-build] Fix dev server port detection (#2879)
* [now-static-build] Fix dev server detection

* Code review

* Remove unused dependency

* Fix the checking by really waiting until the port is reachable
2019-09-06 23:38:49 +00:00
Andy
e1a770ac29 [now-build-utils][now-cli] Warn instead of throwing on api and pages/api (#2976)
* [now-build-utils][now-cli] Warn instead of throwing on `api` and `pages/api`

* Remove slash and adjust tests

* Remove @now/build-utils

* Hardcode builders

* Add build-utils

* Change default flag

* More logging

* Add static-build

* Remove other packages from package.json

* New file for bundled function
2019-09-06 22:02:33 +00:00
Andy
db1a2e6482 [now-cli] Display warning when changing the secret name (#2975) 2019-09-06 10:45:57 +00:00
Nathan Rajlich
ecdde7c367 [now-cli] Use PackageJson and Builder types from @now/build-utils (#2971)
No functionality change here, this just removes the `Package` and
`BuildConfig` types from `src/util/dev/types.ts` in favor of the
matching types from `@now/build-utils`.

Also a lot of prettier formatting…
2019-09-06 00:35:49 +00:00
Nathan Rajlich
4d31291ea4 [now-build-utils] Add env and buildEnv to Meta type (#2970)
* [now-build-utils] Add `env` and `buildEnv` to `Meta` type

`now dev` passes in these variables to the "meta" object.

* Fix build
2019-09-05 15:19:17 -07:00
Andy
b70bd670fd [now-build-utils] Throw error on Next.js pages/api and api/ (#2964) 2019-09-05 19:21:59 +00:00
Sophearak Tha
d3017649e0 [now-cli] Add platform in Sentry report (#2960) 2019-09-05 18:57:15 +00:00
Luc
e970584219 [gatsby-plugin-now] Add keywords in package.json (#2965)
* add keywords to gatsby-plugin-now

* add #readme in homepage url
2019-09-05 18:04:32 +00:00
Sophearak Tha
c6205293a9 [now-build-utils] Use debug() on installing to and missing engines (#2954)
* Use debug() on `installing to` output

* Use debug() on `getSupportedNodeVersion` output
2019-09-05 13:19:32 +00:00
Max Rovensky
cb47f7bf4b Publish
- now@16.1.4-canary.3
 - @now/python@0.2.17-canary.2
2019-09-05 17:07:52 +08:00
Nathan Rajlich
a60f107e4b [now-cli] Fix now alias with no arguments (#2959)
Fixes #2941.
2019-09-05 00:09:17 +00:00
Nathan Rajlich
6e43c322cc [CircleCI] Remove publish-stable and publish-canary steps (#2957)
Publishing to npm is now handled by GitHub Actions.

Aside from that, the Circle publishing was broken.
See: https://circleci.com/gh/zeit/now/7213
2019-09-04 20:33:19 +00:00
Steven
4b6387bdb5 [now-python] Use system python with now dev (#2956) 2019-09-04 18:35:33 +00:00
Steven
bcd770c0fe [now-cli] Bump @zeit/fun to 0.10.0 (#2955) 2019-09-04 18:10:33 +00:00
Max Rovensky
bb8c7e9f3b Publish
- now@16.1.4-canary.2
 - now-client@5.1.1-canary.2
2019-09-05 01:03:31 +08:00
Max
6e469272c3 [now-cli] Implement now-client deployments in Now CLI (#2875)
* Imlement `now-client` deployments in Now CLI

* Move now-client to dev dependencies

* Fix missing config for legacy deployments

* Restore no files warning

* Improve error handling

* Port over `--prod`

* Handle single files and warnings better

* Fix legacy deployment env config

* Handle build errors in events

* Don't use ncc for now-client

* Extract `for...await` logic into a `.ts` file

* Revert "Don't use ncc for now-client"

This reverts commit e481a04058952f7011bf5523445256f1b8882dda.

* Add `typings` field to `now-client`

* Regenerate yarn.lock

* Add bootstrap step to CircleCI

* Add bootstrap step before build

* Revert "Add bootstrap step before build"

This reverts commit db9e1113937f113cca8c7c05d5c800fd5d61e84b.

* Revert "Add bootstrap step to CircleCI"

This reverts commit 02c0006a073614814fd174ccbaf1e4e0d8dd3dbf.

* Build `now-client` before CLI

* Sort build scripts

* Tweak empty deployment detection

* Add bootstrap step before build

* Remove now-client dependency from now-client

* Use local dependencies

* Fix paths and regenerate lockfile

* Bypass broken linting rule

* Remove lint ignore

* Use `tsc` instead of `ncc` for `now-client`

Co-Authored-By: Steven <steven@ceriously.com>

* Fix output path for tsc build

* [test] Supress TS warning

* Update packages/now-cli/src/commands/deploy/latest.js

Co-Authored-By: Steven <steven@ceriously.com>

* Update packages/now-cli/src/commands/deploy/latest.js

Co-Authored-By: Steven <steven@ceriously.com>

* Update packages/now-client/package.json

Co-Authored-By: Steven <steven@ceriously.com>

* Change `now-client` output to `dist`

* Implement file events in now-client and bring back progressbar

* Update build script sorting

* Add new logic tests for `now-client`

* Remove redundant target check

* Remove now-client dependency and use local code

* Set exact dependency versions

* Revert "Set exact dependency versions"

This reverts commit e0a31eaf10e498271c9253439d4bbd650738c694.

* Revert local now-client import

* Revert `now-client` dependency to local path

* Implement feedback

* Fix formatting

* Only handle alias errors if `readyState` is `READY`

* Update packages/now-cli/src/commands/deploy/latest.js

Co-Authored-By: Andy <AndyBitz@users.noreply.github.com>

* Update packages/now-cli/src/commands/deploy/latest.js

Co-Authored-By: Andy <AndyBitz@users.noreply.github.com>
2019-09-04 16:50:09 +00:00
Andy Bitz
5e7fa71148 Publish
- now@16.1.4-canary.1
 - @now/next@1.0.0-canary.3
2019-09-04 12:44:04 +02:00
Andy Bitz
12d9a4b4f4 [now-cli] Bump version 2019-09-04 12:42:50 +02:00
Andy
084ab2d0e5 [now-cli] Handle now certs ls for users and teams without certificates (#2945)
* [now-cli] Fix `now certs ls` when the user or team has no certs

* Add tests and move to typescript

* Move index and add to typescript

* Fix reduce function in ls

* Added linebreak

* Update packages/now-cli/src/commands/certs/add.ts

Co-Authored-By: Naoyuki Kanezawa <naoyuki.kanezawa@gmail.com>
2019-09-04 10:35:20 +00:00
Naoyuki Kanezawa
4ca0d936aa Add the nameservers verification check and improve messages (#2943)
* add the nameservers verification check and improve messages

* fix verify message condition
2019-09-04 15:44:49 +09:00
Nathan Rajlich
5d5a55e7e1 [now-cli] Remove now update from --help output (#2951)
Fixes #2940.
2019-09-04 03:30:25 +00:00
Nathan Rajlich
e033e5e0ca [now-cli] Remove scale subcommand from --help (#2923)
Fixes #1998.
2019-09-03 20:08:41 +00:00
Andy
7cb36ef1dd Fix the prettier config (#2946)
* Fix the prettier config

* Try prettier
2019-09-03 18:56:34 +00:00
Andy
9aafb168e9 [now-cli] Install dependencies before running now dev in tests (#2948)
* [now-cli] Install dependencies before running `now dev` in tests

* Check install exit code

* Add more logging

* Add more logging

* More logging

* Include yarn.lock file

* Add lock files to dev fixtures

* Ignore test

* Ignore another test

* Ignore another test

* Whitespace

* Install deps for unit tests

* Whitespace
2019-09-03 18:05:21 +00:00
Andy Bitz
fbb5caf955 Publish
- gatsby-plugin-now@1.2.1-canary.0
 - @now/build-utils@1.0.0-canary.2
 - now@16.1.3-canary.6
 - @now/go@0.5.11-canary.3
 - @now/next@1.0.0-canary.2
 - @now/node@1.0.0-canary.2
 - @now/static-build@0.9.9-canary.3
2019-09-03 09:57:03 +02:00
Andy
3f93da550b [now-build-utils][now-next][now-node] Bump version (#2942)
* [now-build-utils][now-next][now-node] Bump version

* Bump build-utils in @now-cli
2019-09-03 07:53:19 +00:00
Luc
a194e0cc6e [gatsby-plugin-now] Add new package w/support for Gatsby Redirects (#2897)
* add gatsby-plugin-now

* add test

* adjust with lerna

* fix test

* add tests to circleci

* add support for defaultRoutes functions

* add defaultRoutes to gatsby

* fix types

* add test case for gatsby redirects

* remove gatsby, react, react-dom from monorepo deps

* chmod +x build.sh

* add missing build script in fixtures

* do stuff during tests to avoid persistence issue

* move tests setup to build step

* copy gatsby plugin files in test case

* bring back ncc step

* prettier gatsby-plugin-now

* add missing semicolons

* remove eslint, prettier from plugin

* persist build step copied file

* fetch without following redirects

* add files in package.json

* remove force

* fix tests probes

* fetch location is not raw location

* fix test

* add readme

* fix type error

* adjust tests

* add support for `force`

* add tests for `force`

* adjust tests again

* gatsby-plugin-now@1.1.0

* `"` -> `'`

* tweak redirect names in test by precaution

* change file name and delete when consumed

* format files

* gatsby-plugin-now@1.2.0

* Apply suggestions from code review

Co-Authored-By: Steven <steven@ceriously.com>

* tests -> test

* add --verbose

* adjust circleci to persist fixtures

* trigger tests

* add repository and homepage in package.json

* glob files after `defaultRoute` invocation
2019-09-03 04:19:32 +00:00
Andy
b007200bcf [now-node][now-next] Skip installing user dependencies for now dev (#2926)
* Skip installing user dependencies for `now dev`

* Update type

* Install dependecies for test

* Add comma-dangle for @now/next

* Revert "Add comma-dangle for @now/next"

This reverts commit 720d5630f309ec44eb65e280af29db5b14bd50eb.

* Add trailing commas

* Reset typescript update

* Add trailing commas

* Bump @zeit/node-file-trace

* Readd trailing comma

* Bump @zeit/node-file-trace in @now/node
2019-09-02 19:35:48 +00:00
Sophearak Tha
05d88da887 [now-cli] Remove annotate from now logs (#2937)
* Remove annotate from `now logs`

* Filter out runtime logs to be consistency with dashboard logs

* Add integration test
2019-09-02 16:32:45 +00:00
Sophearak Tha
0a429bb2f3 [now-go] Add GO_BUILD_FLAGS support for go build custom flags (#2916)
* Add `GO_BUILD_FLAGS` support for go build custom flags

* Using string-argv package

* Simplify condition
2019-09-02 15:45:13 +00:00
Joe Haddad
468ccb7598 [now-next] Create default file with correct target (#2924) 2019-09-02 13:28:36 +00:00
Andy Bitz
e47f6f55dc Publish
- now@16.1.3-canary.5
2019-09-02 15:11:14 +02:00
Nathan Rajlich
17deed91b2 [now-cli] Update pcre-to-regexp to v1.0.0 (#2932)
No improvements, per say, but the module has been converted to
TypeScript so it supplies its own type definitions now, and we
can delete our hand-crafted typings from this repo.
2019-09-02 12:47:25 +00:00
Nathan Rajlich
cc0bd9f0a2 [now-cli] Use xdg-app-paths for now dev cache dir (#2921)
* [now-cli] Use `xdg-app-paths` for `now dev` cache dir

For consistency, because #2877 uses this module.
No need for multiple modules that do the same thing.

* Update `@zeit/fun` to v0.9.3
2019-09-01 14:25:26 +00:00
Steven
f6f99fef25 Publish
- now@16.1.3-canary.4
 - @now/go@0.5.11-canary.2
 - @now/node@0.12.8-canary.3
2019-08-30 14:36:09 -04:00
Nathan Rajlich
eb252edc7f [now-cli] Output --json to stdout for now alias ls <url> (#2922)
Fixes #1337.
2019-08-30 18:29:28 +00:00
Sophearak Tha
f3213dbcdc [now-node] Cleanup debug output (#2927)
* Ensure traced files have annotate present in all lines

* Remove traced file logs

* Remove `compiling es module file` log

* Cleanup debug output
2019-08-30 16:42:23 +00:00
Sophearak Tha
c637da7710 [now-go] Fix analyze.go fails to parse source file with comments (#2911)
* Fix `analyze.go` fails to parse source file with comments

* Add more tests

* Improve fallback

* Improve check for http.HandlerFunc signature`
2019-08-30 15:32:51 +00:00
Joe Haddad
ab05595582 Publish
- @now/build-utils@0.9.14-canary.2
 - @now/cgi@0.1.5-canary.1
 - now@16.1.3-canary.3
 - now-client@5.1.1-canary.1
 - @now/go@0.5.11-canary.1
 - @now/next@0.7.1-canary.3
 - @now/node-bridge@1.2.4-canary.2
 - @now/node@0.12.8-canary.2
 - @now/python@0.2.17-canary.1
 - @now/routing-utils@1.2.3-canary.1
 - @now/ruby@0.1.5-canary.2
 - @now/static-build@0.9.9-canary.2
2019-08-29 23:15:18 -04:00
JJ Kasper
ba8e714329 [now-next] Use patched version of yazl and trace API pages separate (#2919)
* Update to trace API files separately and use modified yazl

* Remove jszip dependency

* Pin yazl dependency and add types

* Update more types
2019-08-30 02:40:45 +00:00
Luc
ef86bb0bd9 [tests] Unify .editorconfig (#2920) 2019-08-29 23:56:10 +00:00
Andy
be18b54bfd [now-cli] Improve check for update command (#2915)
* [now-cli] Improve check for update command

* Use path.sep

* Fix build
2019-08-29 23:47:53 +00:00
Max Strübing
ed168db23c [now-cli] Use XDG standard instead of writing to home directory (#2877)
* Use XDG standard instead of writing to home directory

* Fix typos

* Use dependencies as dev dependencies

* Remove lodash dependency

* Use xdg-app-paths instead of xdg-portable

* use find instead of filter(...)[0]
2019-08-29 23:04:47 +00:00
Luc
236f5f4159 [tests] Unify linting and autoformatting (#2914)
* add prettier and eslint on root

* remove eslint from now-cli

* adjust root package.json

* adjust eslintignore

* adjust now-cli rules

* remove @zeit/git-hooks in packages

* adjust now-client eslint config

* add lint-staged and hook on pre-commit

* add pre-commit script

* replace @zeit/git-hooks with husky

* remove unnecessary script

* fix eslint errors

* trigger tests

* fix fixable errors

* fix fixable errors (bis)

* revert two changes
2019-08-29 19:17:40 +00:00
Steven
e44a91634e [now-cli] Update readme and links (#2886)
* Update readme and links

* Fix readme image

* Fix homepage

* Update banner image to v3
2019-08-29 16:47:36 +00:00
Naoyuki Kanezawa
8b9426eb6c [tests] Remove fixtures files for integration tests (#2910) 2019-08-29 13:57:26 +00:00
Nathan Rajlich
c62c57f122 [now-cli] Implement continue: true with dest (#2908)
Closes #2685.
2019-08-29 12:39:55 +00:00
Nathan Rajlich
c81db0c8d2 [now-cli] Use a Map for the valid sub-commands (#2913)
Otherwise, JavaScript Object built-ins such as `hasOwnProperty` are
incorrectly considered a valid subcommand, but fail afterwards with
a `require()` error and confusing error message.
2019-08-29 07:56:36 +00:00
Naoyuki Kanezawa
1c64990e9f [now-cli] fix login test (#2909) 2019-08-29 05:45:40 +00:00
Joe Haddad
f1dc7fd14a Publish
- now@16.1.3-canary.2
 - @now/next@0.7.1-canary.2
 - @now/node-bridge@1.2.4-canary.1
 - @now/node@0.12.8-canary.1
 - @now/ruby@0.1.5-canary.1
 - @now/static-build@0.9.9-canary.1
2019-08-28 21:18:57 -04:00
Nathan Rajlich
6079d4be25 [now-cli] Remove deprecated @now/php builder from bundled builders tarball (#2907)
`@now/php` has been deprecated in favor of community-maintained
`now-php`, so don't bundle the deprecated builder with Now CLI.
2019-08-29 00:42:06 +00:00
Andy
2c4b8335ce [now-cli] Allow to fetch more certificates with paging (#2905)
* [now-cli] Allow to fetch more certificates with paging

* Linting

* Update packages/now-cli/src/commands/certs/ls.js

Co-Authored-By: Nathan Rajlich <n@n8.io>
2019-08-28 23:51:10 +00:00
JJ Kasper
9bd2f22d5c [now-next] Optimize lambda creation (#2892)
* Optimize zipping lambdas for now-next

* Update to use jszip to get around bug in yazl

* Add pseudo layer utils

* Apply suggestions from code review

Co-Authored-By: Joe Haddad <joe.haddad@zeit.co>

* Update sema concurrency from tests

* Update packages/now-next/src/index.ts

* Use custom types to fix broken @types package

* Add license header

* Revert "Use custom types to fix broken @types package"

This reverts commit 82441285155f6e0899c43dffdd5e000ecbd7b1b6.

* Fix CI Yarn installation

* TypeScript types should never be hoisted

* Fix all typechecking
2019-08-28 22:43:26 +00:00
Andy
7c421f92e1 [now-cli] Validate inputs for alias, list and remove (#2903)
* [now-cli] Validate inputs for alias, list and remove

* Log test output

* Add more logging to test

* Change to execa

* Use `split`

* Only validate when it exists
2019-08-28 21:30:27 +00:00
Andy
0626db51bd [now-cli] Change success message after login (#2898)
* [now-cli] Change success message after login

* Linting

* Test now login

* Linting

* Revert "Test now login"

This reverts commit 690360db3f148552a456b4ee1bd2a59b8d09216c.

* Revert "Linting"

This reverts commit 3d5ebfaa76ecdcc2152c8344c8e1205b241abe09.

* Adjust test

* Remove binaryPath from args

* Fix loggin test
2019-08-28 22:41:56 +02:00
Kaito Sugimoto
dc29a8b816 [now-cli] Update now alias warning for --prod (#2902) 2019-08-28 18:27:21 +00:00
Joe Haddad
e00e5e18ea Publish
- @now/build-utils@0.9.14-canary.1
 - now@16.1.3-canary.1
 - @now/next@0.7.1-canary.1
2019-08-28 08:28:56 -04:00
Joe Haddad
d0999e7937 [now-build-utils] Add mutable option for backwards compatibility (#2895) 2019-08-28 05:29:34 +00:00
Joe Haddad
158cfad978 [now-next] Do not add initial files to lambda (#2894) 2019-08-28 02:14:02 +00:00
Andy
9145b43a62 [now alias] Improve alias support (#2787)
This enables https://github.com/zeit/now-cli/pull/2747 from @nkzawa again.

We had to revert the previous one, because we didn't want to include it in
the next stable release.

This further makes sure that we don't display `https://` in front of a
wildcard alias, since `https://*.mydomain.tld` is not a valid URL.
2019-08-28 00:47:39 +00:00
Steven
479d271356 Publish
- @now/build-utils@0.9.14-canary.0
 - @now/cgi@0.1.5-canary.0
 - now@16.1.3-canary.0
 - now-client@5.1.1-canary.0
 - @now/go@0.5.11-canary.0
 - @now/next@0.7.1-canary.0
 - @now/node-bridge@1.2.4-canary.0
 - @now/node@0.12.8-canary.0
 - @now/python@0.2.17-canary.0
 - @now/routing-utils@1.2.3-canary.0
 - @now/ruby@0.1.5-canary.0
 - @now/static-build@0.9.9-canary.0
2019-08-27 18:57:46 -04:00
Steven
8119f4cad2 Add GH Actions Publish Workflow (#2891) 2019-08-27 22:35:12 +00:00
Steven
e73b32e9cc [tests] Ignore fixtures in GitHub Languages & fix yarn.lock (#2890) 2019-08-27 17:55:43 +00:00
Sophearak Tha
45bd08e4e5 [now-next] Use debug() from build-utils (#2881)
* [now-next] Use `debug()` from build-utils (#909)

* Use `debug()` from build-utils

* Revert back to warning output

* Remove unnecessary debug check
2019-08-27 15:40:39 +00:00
Sophearak Tha
4528243b5c [now-go] Use debug() from build-utils (#2885)
* [now-go] Use `debug()` from build-utils (#923)

* Use `debug()` from build-utils

* Apply suggestions from code review

Co-Authored-By: Steven <steven@ceriously.com>

* Print errors

* Apply suggestions from code review

Co-Authored-By: Steven <steven@ceriously.com>
2019-08-27 15:25:31 +00:00
Sophearak Tha
bd741cfbeb [now-ruby] Use debug() from build-utils (#2883) 2019-08-27 15:05:13 +00:00
Sophearak Tha
b3b10f0fd7 [now-node] Use debug() from build-utils (#2880)
* Use `debug()` from build-utils

* Remove condition
2019-08-27 10:36:04 -04:00
Sophearak Tha
084c014fff [now-static-build] Use debug() from build-utils (#2884) 2019-08-27 14:15:11 +00:00
Andy
63614e5303 [now-cli] Validate builds and routes for now dev (#2871)
* [now-cli] Validate builds and routes for `now dev`

* Remove @ts-ignore

* Sort the matches such that `utils` modules are compiled first

Because other packages may rely on them

* Prettier

* Add `reject: false` to tests

* Prettier

* Make validation async

* Fix syntax

* Fix type

* Linting

* Fix error check
2019-08-27 13:29:23 +00:00
Sophearak Tha
099d2c8195 [now-cli] Make sure to have event action as string (#2870) 2019-08-27 13:11:09 +00:00
Sophearak Tha
ae813423d8 [now-python] Use debug() from build-utils (#2882)
* Use `debug()` from build-utils

* Apply suggestions from code review

Co-Authored-By: Steven <steven@ceriously.com>
2019-08-27 09:10:43 -04:00
Nathan Rajlich
2a5f3f779e [now dev] Update yarn to v1.17.3 (#2780)
* [now dev] Update `yarn` to v1.17.3

* Wait longer for angular integration test

It keeps on failing

* Only run angular test on Node 10.x

* Revert "Wait longer for angular integration test"

This reverts commit 19d70d4ba9aee49a5114b65f00ef97e2a88dc7ef.
2019-08-26 23:10:06 +00:00
Andy
89e1d83ad4 [now-static-build] Support ejected create-react-app (#2873) 2019-08-26 22:10:31 +00:00
Steven
ce23f9e204 [tests] Fix unit tests & coverage step (#2876)
* Fix unit tests & coverage

* Add missing compile-templates step
2019-08-26 21:17:57 +00:00
Nathan Rajlich
743eb21682 Update links to now-builders repo to now repo (#2862)
* Update links to `now-builders` repo to `now` repo

Also copies over the `.md` files from the now-builders' `errors`
directory so that the https://err.sh links work correctly.

Part of #2782.

* Update `err.sh` links that were formerly `now-cli`

* Empty commit for CI

* Make CircleCI `run.sh` script a bit better

Before it would fail with exit code 1 if there were no matching modified
files because of the `grep` call failing without any `packages` prefixed
files.
2019-08-26 15:13:08 -04:00
Steven
b9f5de2b7a [tests] Change run script from bash to node (#2874)
* [tests] Change run script from bash to node

* Fix loop for runScript

* Fix `all` script test

* Improve console.log() messages

* Use -l instead of -p

* Delete yarn.lock from now-python
2019-08-26 17:49:47 +00:00
Steven
229a62d8b6 Create monorepo (#2812)
* Move now-cli to /packages/now-cli

* Fix .gitignore paths

* Add now-client

* Add lerna to top level

* Add scripts

* Update codeowners

* Fix `/now-cli/build.ts` script

* Fix circleci path to artifacts

* Use relative paths

* Fix path to scripts

* Add test-lint script

* Add missing return type

* Fix typo in test-lint

* Fix string match in shell scripts

* Fix path to hugo

* Add package node_modules

* Delete lock files in packages, use root yarn.lock

* Add missing b.js file

* Add test-integration-now-dev script

* Add missing test files

* Add missing integration test script

* Add missing test files

* Delete travis.yml

* Fix ts-jest in now-client

* Add support for Node 8 (ES2015 target)

* Add support for Node 8

* Add polyfill for Node 8

* Fix polyfill for Node 8

* Only run coverage for now-cli

* Add packages from now-builders

* Run integration tests for builders

* Add node_modules to cache

* Add root readme.md

* Move readme to top level

* Add yarn bootstrap

* Add bootstrap step

* Add dist to `persist_to_workspace`

* Fix 08-yarn-npm integration test

* Remove duplicate path

* Change stdio to inherit

* Add back store_artifacts

* testing - remove bootstrap step

* Add back now-build-utils

* Remove bootstrap step

* Fix test again

* Add console.log()

* Fix lint

* Use local ncc version

* Install go

* Revert changes to stdio and console.log()

* Add missing now-go test

* Add missing integration tests

* Add --runInBand flag

* Fix now-node-bridge persistence

* Add missing symlinks

* Add codeowners

* Consolidate into single run.sh function

* Run uniq

* Fix typo

* Change now-routing-utils to test-unit

* Special case test for node 8

* Add docs from builders

* Only run script for modified packages

* Add test-integration-once which only runs once

* Fix set intersection
2019-08-23 17:00:31 -07:00
Andy Bitz
52a6e60f78 16.1.2-canary.7 2019-08-20 18:58:27 +02:00
Andy
a7cb747130 Use short-form for the update command (#2801)
* Use short-form for the update command

* Adjust test
2019-08-20 18:56:31 +02:00
Andy
918d60576f [now deploy] Fix builds output for failed deployments (#2799)
* [now deploy] Fix builds output for failed deployments

* Add test
2019-08-20 18:13:43 +02:00
Andy
62111977fd [now deploy] Fix --prod flag and adjust message for --target (#2797)
* [now deploy] Fix `--prod` flag and adjust message for `--target`

* Fix tests

* Fix fetch

* Change api version

* Fix url

* Fix test
2019-08-20 17:29:43 +02:00
Andy Bitz
00c05b95e4 16.1.2-canary.6 2019-08-20 00:12:56 +02:00
Andy
9ee83b858c [now deploy] Added --prod flag (#2789)
* [now deploy] Add `--production` and `--staging` flag

* Change message

* Fix tests

* Fix test

* Add another test

* Fix production test

* Update message and add `--prod`

* Update help

* Remove `--staging`

* Use only `--prod`

* Add test

* Add aliasError output

* Fix output
2019-08-20 00:12:14 +02:00
Andy Bitz
e4a181321a Revert "Add more alias support (#2747)"
This reverts commit 957fe9084a.
2019-08-19 11:34:42 +02:00
Andy Bitz
dd6f6aa418 16.1.2-canary.5 2019-08-19 09:55:17 +02:00
Andy
b37bfbc1ed Bump @now/build-utils to 0.9.13 (#2784) 2019-08-19 01:21:49 +02:00
Leo Lamprecht
dd06c4c63d 16.1.2-canary.4 2019-08-18 12:01:43 +00:00
Nathan Rajlich
a6174cde03 [now domain] Handle thrown API errors when purchasing domain fails (#2779)
Fixes #2759.
2019-08-16 02:43:30 +00:00
Nathan Rajlich
c85ab97321 Remove a couple unused import (#2777)
Fixes lint
2019-08-15 19:12:59 -07:00
Naoyuki Kanezawa
957fe9084a Add more alias support (#2747)
* add more alias support

* Update src/util/domains/setup-domain.ts

Co-Authored-By: Nathan Rajlich <n@n8.io>

* Update src/util/domains/setup-domain.ts

Co-Authored-By: Nathan Rajlich <n@n8.io>

* add tests
2019-08-16 00:48:29 +00:00
Nathan Rajlich
70f72e5bb8 Sleep 2 seconds after the now rm integration test (#2776)
Sometimes it fails with a stale 200 status code.
This should make it less flaky.
2019-08-15 16:19:52 -07:00
Nathan Rajlich
4feb961091 16.1.2-canary.3 2019-08-15 11:59:08 -07:00
Nathan Rajlich
6ddc252978 Display rate limit errors message from API response (#2767)
* Display rate limit errors message from API response

Closes #2738.

* Update src/util/handle-error.ts

Co-Authored-By: Steven <steven@ceriously.com>
2019-08-15 07:39:12 +00:00
Naoyuki Kanezawa
5eca7cf5f7 add misssing defaultArgs (#2770) 2019-08-15 11:23:01 +09:00
Nathan Rajlich
76486246c5 Remove leftover console.log() in integration tests (#2768) 2019-08-15 01:17:38 +00:00
Nathan Rajlich
740a7c8886 [now rm] Use the proper client so that the process does not hang (#2762)
* [now rm] Use the proper `client` so that the process does not hang

The crux of this fix is that `getDeploymentByIdOrHost()` and
`getProjectByIdOrName()` were improperly being passed the `Now`
instance instead of the expected `Client` instance, and for some
reason that would cause the process to hang until the underlying
`http.Agent` timed out its connection to the API server.

Also ran `prettier` on this file.

Fixes #2760.

* Remove `console.error()`

* Add integration test

* Fix syntax error

* Add `now rm` 404 integration test

* Remove `.only`
2019-08-15 00:41:53 +00:00
Nathan Rajlich
40b69b4924 [now scale] Fix default max: auto value in --help output (#2763)
Fixes #2368.
Also related to zeit/docs#838.
2019-08-14 10:07:55 -07:00
Nathan Rajlich
c5ef4b1dc5 Fix "occured" -> "occurred" typos (#2761)
See: https://tinyurl.com/occured
2019-08-13 23:47:48 +00:00
Andy
ef793bf7e9 [now dev] Use canary builders for the canary version (#2753)
* Use canary builders for the canary version

* Use the `getDistTag` function instead

* Fix function call

* Add tests

* Remove unused code

* Remove logging
2019-08-13 19:30:48 +00:00
Nathan Rajlich
2be1dd4fcb Use the correct URL in the auth.json and config.json files (#2755)
Fixes #2754.
2019-08-13 17:40:48 +00:00
Nathan Rajlich
a734eb79d9 [now projects] Add subcommand alias for now project (#2750)
Fixes #2162.
2019-08-13 02:37:03 +00:00
Naoyuki Kanezawa
24dc2a36de remove unused HTTP/HTTPS Agent (#2749) 2019-08-13 11:05:45 +09:00
Naoyuki Kanezawa
12881c1b57 support to set api host for development (#2748) 2019-08-13 09:44:45 +09:00
Nathan Rajlich
c66188a6f2 Update clipboardy to v2.1.0 (#2737)
Fixes #564.

Related to #1924.
2019-08-10 12:15:36 +00:00
Andy
61457b532a Bump @now/build-utils to 0.9.12 (#2736) 2019-08-09 20:35:40 +00:00
Nathan Rajlich
d2ff3749ca [now dev] Remove leftover console.error() call (#2735)
Accidentally added in #2720.
2019-08-09 18:48:34 +00:00
Leo Lamprecht
38bc7cc6d6 [now dev] Add --listen / -l flag, deprecate --port / -p (#2720)
* [now dev] Add `--bind` / `-b` flag

This changes the default network interface that `now dev` binds to, in
order to prevent operating system firewalls from showing a confirmation
prompt in order to run.

Fixes #2704.

* Change to `--listen`

* Default port 3000

* Fix unit

* Fix `--port`

* Use `-l` for integration tests

* Add unit tests
2019-08-09 11:16:21 -07:00
Arunoda Susiripala
413fdd7c39 Update index.js (#2733) 2019-08-09 16:07:39 +02:00
Leo Lamprecht
f48bb493b0 [now update] Show correct global or local install command (#2719)
* [now update] Show correct global or local install command

* Remove `canRead` check

* Change bin to lib since the actual script will be there

* Use realpath

* Remove console.error
2019-08-09 01:05:44 +02:00
Nathan Rajlich
962c5db9fe Update serve-handler to v6.1.1 (#2731)
* Update `serve-handler` to v6.1.1

Fixes #2697.

* Fix unit test
2019-08-08 22:26:02 +00:00
Nathan Rajlich
9e961b479c Print HTTP status code upon API JSON parse errors (#2727)
Fixes #2681.
2019-08-08 20:51:23 +00:00
Nathan Rajlich
718100fafc Add accept: application/json header to API HTTP requests (#2726)
All of the APIs already support JSON by default, so this is a no-op for
our APIs, however the proxy layer _does_ respect the `Accept` header to
send JSON error responses, which is useful for more gracefully handling
outage responses (previously they were being returned as plain text,
which Now CLI blindfully tries to parse as JSON and fails with an
unhelpful error message).

Related to #2681.
2019-08-08 20:15:29 +00:00
Steven
2b38f545d0 Add automerge config (#2729) 2019-08-07 18:41:51 -07:00
Nathan Rajlich
55b1327119 [CircleCI] Fix test/dev-server.unit.js being run on CI (#2725)
For some reason, `ava` was silently skipping these tests on CI because
the process was crashing. According to sindre, this is a bug in `ava`,
but with some digging I was able to determine that the root cause of the
crash was that the `builders.tar.gz` file from the `assets` dir was not
being persisted from the previous `build` job in CI.

With the `assets` dir being persisted I now see the `dev-server` unit
tests being executed once again as expected.

Related to: https://twitter.com/sindresorhus/status/1157614353375551493
2019-08-07 12:17:55 -07:00
wtgtybhertgeghgtwtg
a75ec505ad Remove vestigial mkdirp packages (#2724) 2019-08-07 11:15:50 -07:00
Andy Bitz
36b1e129b4 16.1.2-canary.2 2019-08-07 17:32:01 +02:00
Andy
331b6e0a23 [now deploy] Use the project when checking the platform version (#2722)
* [now deploy] Use the project when checking the platform version

* Update src/util/prefer-v2-deployment.ts

Co-Authored-By: Leo Lamprecht <mindrun@icloud.com>

* Update src/util/prefer-v2-deployment.ts

Co-Authored-By: Leo Lamprecht <mindrun@icloud.com>

* Adjust message

* Fallback for local config
2019-08-07 17:31:02 +02:00
Andy Bitz
fc72ecb223 16.1.2-canary.1 2019-08-07 14:32:04 +02:00
Andy
ca51cbcc6b Fix colored text and remove version warning (#2721) 2019-08-07 14:30:30 +02:00
Andy Bitz
6ce8acc4db 16.0.1-canary.3 2019-08-07 11:57:55 +02:00
Andy
a9edec1619 [now deploy] Change the warning messages when the platform version is changed (#2717)
* [now deploy] Change warning message

* Change text

* Add link to message

* Change text
2019-08-07 11:55:44 +02:00
Leo Lamprecht
8638d17d87 Revert "[now dev] Add --bind / -b flag (#2705)"
This reverts commit efe0ca57f0.
2019-08-07 08:12:50 +00:00
Leo Lamprecht
db6ae2998b Revert "[now update] Show correct global or local install command (#2716)"
This reverts commit d667a83af5.
2019-08-07 08:12:32 +00:00
Andy
d667a83af5 [now update] Show correct global or local install command (#2716)
* [now update] Show correct global or local install command

* Remove `canRead` check

* Change bin to lib since the actual script will be there

* Use realpath

* Remove console.error
2019-08-06 22:59:07 +02:00
Andy Bitz
f2a1fb50da 16.0.1-canary.2 2019-08-06 20:10:48 +02:00
Andy
eb356a5d3d [now dev] Bump @now/build-utils to 0.9.10 (#2715) 2019-08-06 20:09:27 +02:00
Nathan Rajlich
efe0ca57f0 [now dev] Add --bind / -b flag (#2705)
This changes the default network interface that `now dev` binds to, in
order to prevent operating system firewalls from showing a confirmation
prompt in order to run.

Fixes #2704.
2019-08-06 14:55:04 +02:00
Andy Bitz
409b7099be 16.0.1-canary.1 2019-08-06 12:51:51 +02:00
Andy
e6653992a7 Bump @now/build-utils to 0.9.9 (#2713)
* Bump `@now/build-utils` to 0.9.9

* Log output

* Only log on error

* Fix tests
2019-08-06 12:50:46 +02:00
Nathan Rajlich
c133e81f6e Require Node.js >= 8.11 in "engines" (#2714)
Closes #2711.
2019-08-05 20:14:42 -07:00
Nathan Rajlich
28bfcb4c58 [now dev] Print warning upon empty cwd directory (#2702)
* [now dev] Render warning upon empty `cwd` directory

The warning matches the one that `now deploy` prints, and only
prints the warning once (rather then upon every HTTP request).

Closes #2696.

* Fix eslint warning

* Add "pipe"

* Debugging…

* Fix integration test

* Debugging…

* Add `--verbose` to "test-integration-now-dev" script

* Ignore `yarn.lock` and `node_modules` in test dir

* Ignore `hugo` binary

* Ignore `public` dir in hugo test fixture

* Add `.gitignore` to `empty` test fixture

* Revert "Debugging…"

This reverts commit 27c6d2e06fe7eff12077a0e88915cf46b39b00ea.

* Ignore `public` / `dist` dirs in fixtures
2019-08-05 19:54:19 -07:00
Nathan Rajlich
5cf8f8a70a Add unhandledRejection and uncaughtException handlers to scripts (#2709)
This is to prevent false-positives like this from occurring,
and fixes the warning from `node`:

```
$ ts-node ./scripts/build.ts
Creating builders tarball with: @now/build-utils@canary, @now/go@canary, @now/next@canary, @now/node@canary, @now/php@canary, @now/static-build@canary
(node:156) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, open '/home/circleci/repo/assets/builders.tar.gz'
    at ReadStream.evt.error.err (/home/circleci/repo/node_modules/promisepipe/index.js:30:23)
    at ReadStream.emit (events.js:198:13)
    at ReadStream.EventEmitter.emit (domain.js:448:20)
    at /home/circleci/repo/node_modules/graceful-fs/graceful-fs.js:207:14
    at /home/circleci/repo/node_modules/graceful-fs/graceful-fs.js:258:16
    at FSReqWrap.args [as oncomplete] (fs.js:140:20)
(node:156) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:156) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
```
2019-08-05 18:11:43 -07:00
Nathan Rajlich
b31ab033c2 Fix format-modified script (#2708)
Before it was only updating _non-staged_ files.

Now, it updates _all_ modified files, staged or not.
2019-08-05 15:50:04 -07:00
Nathan Rajlich
24a3b99ee3 Upgrade ava to v2.2.0 (#2703)
See: https://twitter.com/sindresorhus/status/1157614353375551493
2019-08-05 14:32:39 -07:00
Andy Bitz
9a6ad1ae43 15.9.0-canary.28 2019-08-05 17:36:13 +02:00
Andy
687ef375c8 [now update] Remove is-installed-globally (#2700)
* [now update] Remove `is-installed-globally`

* Only suggest global

* Adjust test
2019-08-05 17:26:45 +02:00
Andy Bitz
538525e639 15.9.0-canary.27 2019-08-05 15:22:56 +02:00
Andy
aff5a0cbed [now deploy] Check if builds are ready right away (#2699)
* [now deploy] Check if builds are ready right away

* Adjust tests

* Remove test

* Log more while testing

* Remove check in tests

* Adjust all tests

* Log more
2019-08-05 15:20:02 +02:00
Nathan Rajlich
b1b1529bd6 15.9.0-canary.26 2019-08-02 16:11:34 -07:00
Andy
bb934f0146 Update @now/build-utils to v0.9.8 (#2694)
* Bump `@now/build-utils` to 0.9.7

* Handle 404 status

* Revert "Handle 404 status"

This reverts commit 6aa25097beb96c8d56ab40c91319278da68d5851.

* Render 404 page

* Bump @now/build-utils
2019-08-02 15:59:00 -07:00
Nathan Rajlich
7d2c5dc39a Assert 200 response status on "deploy a dockerfile project" integration test (#2684)
* Assert 200 response status on "deploy a dockerfile project" integration test

* Fix
2019-08-02 12:42:09 -07:00
Nathan Rajlich
9894869427 [now dev] Support JSON and HTML redirect responses (#2690)
* [now dev] Support JSON and HTML redirect responses

Matches the production behavior.

* Set Now response headers during redirect

* Set `location` header

* Remove unused `matched_route` var
2019-08-02 12:01:55 -07:00
Nathan Rajlich
8e0c1da441 [now dev] Allow custom 404 pages via routes (#2689)
* [now dev] Allow custom 404 pages via `routes`

This matches the behavior in production, which allows a `dest` to be
provided when defining a `status: 404` in the routes configuration.

Related to #2638.

* Fix typo
2019-08-02 11:26:02 -07:00
Andy
6a165e8377 [preinstall/now update] Check if now is installed locally (#2688)
* [preinstall/now update] Check if now is installed locally and adjust messages

* Adjust test

* Add tests

* Wait for deployment to be ready

* Removed log

* Adjust prefix in test

* Adjust path

* Only wait 4 minutes

* More logging

* Change binPrefix to prefix

* Remove all linting warnings

* Adjust env vars for test

* Don't test on node 8

* Log more error information and fail right after 500

* Move docker test up
2019-08-02 20:10:32 +02:00
Nathan Rajlich
eeed5a8273 Fix routes definition in now-dev-static-routes test fixture (#2687)
This is the proper way to define this route because of the capture of
the initial `/`.

Matches how it works in production.
2019-08-01 17:56:34 -07:00
Nathan Rajlich
75d98c649a [now dev] Support JSON and HTML error responses (#2677)
* [now dev] Support JSON and HTML error responses

Closes #2609.

* Compile templates for unit tests in CircleCI

* Update `ts-node` to v8.3.0

* Convert doT.js compiled templates to TypeScript

* Compile templates for lint tests in CircleCI

* Print convert time

* Add 502 error template

* Remove `message` param from `sendError()`

* Prettier

* Add 404 tests

* Fix test
2019-08-01 17:56:06 -07:00
Andy Bitz
d54cc4df51 15.9.0-canary.25 2019-08-01 18:52:26 +02:00
Andy
f211f1fa70 [preinstall] Adjust the error messages (#2682)
* [preinstall] Adjust the error messages

* Remove dot
2019-08-01 18:40:55 +02:00
Nathan Rajlich
f60a373479 [now dev] Use a consistent "pod id" for x-now-id (#2679)
This matches the behavior in production.
2019-07-31 16:31:56 -07:00
Andy
80a82ba276 [now deploy] Change link for legacy warning (#2674)
* [now deploy] Change link for legacy warning

* Remove trailing slash

Co-Authored-By: Steven <steven@ceriously.com>

* Simplify `link` function

Co-Authored-By: Nathan Rajlich <n@n8.io>

* Determine which link to show and add test

* Adjust link for configuration

Co-Authored-By: Steven <steven@ceriously.com>

* Adjust Package type
2019-08-01 00:14:18 +02:00
Andy
8a3d0fb370 [now dev] Bump @now/build-utils to 0.9.6 (#2672) 2019-07-31 18:22:45 +02:00
Andy Bitz
20c2930a90 15.9.0-canary.24 2019-07-31 16:47:00 +02:00
Andy
bccf602496 [now deploy] Check server.js file when detecting the platform version (#2664)
* [now deploy] Check `server.js` file when detecting the platform version

* Fix type
2019-07-31 16:01:15 +02:00
dependabot[bot]
ed92ef8952 Bump yarn to v1.17.3 (#2669)
Bumps [yarn](https://github.com/yarnpkg/yarn) from 1.13.0 to 1.17.3.
- [Release notes](https://github.com/yarnpkg/yarn/releases)
- [Changelog](https://github.com/yarnpkg/yarn/blob/v1.17.3/CHANGELOG.md)
- [Commits](https://github.com/yarnpkg/yarn/compare/v1.13.0...v1.17.3)

Signed-off-by: dependabot[bot] <support@github.com>
2019-07-30 22:05:59 -07:00
Andy
1b9c14bd30 [CircleCI] Add more test suites for macOS support (#2663)
* [CircleCI] Add more tests for macos support

* Change xcode version since node 8.9.x is required

* Log stderr and stdout

* Add custom start script

* Make tests use custom start script

* Made start script executable

* Use correct node path

* Fix script path

* Handle status code

* Use latest Node.js version for macos tests

* Include yarn.lock for ember test

* Only use start script in tests

* Change start script for macos

* Change start script for linux

* Change start script for linux
2019-07-31 03:03:14 +02:00
Sophearak Tha
c287cbeb22 [now dev] Update NOW_BUILDER_DEBUG base on --debug flag (#2655)
* Update `NOW_BUILDER_DEBUG` base on `--debug` flag

* No need to reset `NOW_BUILDER_DEBUG`

* Add comment for `NOW_BUILDER_DEBUG`

* Apply suggestions from code review

Co-Authored-By: Andy <AndyBitz@users.noreply.github.com>
2019-07-30 14:56:38 -07:00
Nathan Rajlich
d29b1b9cfa [now dev] Bundle canary builders for Now CLI canary (#2661)
* [now dev] Bundle `canary` builders for Now CLI canary

Closes #2641.

* Add unit tests

* More unit tests

* Use `semver.parse()` in `getDistTag()`

* Convert build script to TypeScript, DRY the `getDistTag()` function

* Prettier
2019-07-30 14:56:00 -07:00
Andy
49293ae44b [now dev] Update outdated dependencies in tests (#2666) 2019-07-30 11:47:38 -07:00
Andy Bitz
39103f5ae6 15.9.0-canary.23 2019-07-30 15:00:03 +02:00
Nathan Rajlich
af2c894fb9 [CircleCI] Add seperate jobs for now dev integration tests (#2662)
Run the `now dev` integration tests in parallel with the "standard"
integration tests, since they both take a long time. This should
cut the CI testing time in about half.
2019-07-30 11:25:55 +02:00
Andy Bitz
42f9745420 Revert "Revert "15.9.0-canary.22""
This reverts commit 35c3d87055.
2019-07-30 02:25:01 +02:00
Andy
f016f05c11 [now dev] Fix aurelia test (#2660)
* [now dev] Fix aurelia test

* Enable aurelia test again
2019-07-30 02:22:18 +02:00
Nathan Rajlich
257f5f293e Support Node 8 (#2648)
* Support Node 8

This changes the TypeScript compilation target to "es2015" so that
async generator functions are transpiled, which enables Node 8 to be
supported.

As a side-effect, any of the files that utilize `async function*` or
`for await` needed to be converted to TypeScript so that the
transpilation actually happens.

It was painful to do this process for `src/commands/deploy/legacy.ts`,
and since it is legacy code I did not want to make too many changes to
the code, so there's a log of `@ts-ignore` and `any` types being used.
But the behavior of the file should not have changed at all.

* Make `engines` field be ">= 8"

* Add Node 8 to CircleCI matrix

* Remove `console.error()`

* Remove `.ts` extension on import calls

* Use `Now` instead of `any`

* Use native `url` module instead of `whatwg-url`

* Debug integration test

* Skip `02-angular-node` test on Node 8

* Remove debugging

* Add "Downloading Hugo" step to Node 8 tests

* Skip `03-aurelia` test on Node 8

* Skip `03-aurelia` test for all

All node versions are failing with the same error:

https://circleci.com/gh/zeit/now-cli/29922

* Use `fs-extra` instead of `fs.promises` for Node 8
2019-07-29 16:29:15 -07:00
Andy Bitz
35c3d87055 Revert "15.9.0-canary.22"
This reverts commit a78813bd74.
2019-07-30 01:19:44 +02:00
Andy Bitz
a78813bd74 15.9.0-canary.22 2019-07-29 23:02:01 +02:00
Andy
05c2f69523 [now update] Change update notification and remove previous Now CLI installation on preinstall (#2659)
* [now update] Change update notification and remove previous Now CLI installation on `preinstall`

* Use plain js for preinstall script

* Removed unused `rename` import

* Simplified code
2019-07-29 13:22:13 -07:00
Andy
e389a836e1 [now deploy] Consider --npm and --docker for platform detection (#2640)
* [now deploy] Consider `--npm` and `--docker` for platform detection

* Change order

* Change prepare

* Await fixtures

* Remove check

* Revert "Remove check"

This reverts commit 7a5c1c901085d4e22c5a34cc48b5d929a9ee3b80.

* Use async-retry

* Fix fetch

* Log token

* Retry user creation

* Add async

* Add try-catch

* Decrease the retries

* Use original way to get context name
2019-07-29 21:44:37 +02:00
Nathan Rajlich
64c526fe1d [now dev] Redirect when request has multiple slashes (#2645)
* [now dev] Redirect when request has multiple slashes

Closes #2642.

* Add POST passthrough
2019-07-29 11:19:04 -07:00
Max Chehab
e132d74aa8 [now deploy] Fix variable name typo (#2649) 2019-07-29 10:26:56 -07:00
Andy
975c8dc5fc [now dev] Prevent recursive function call for handle: "filesystem" (#2630)
* [now dev] Prevent recursive function call for `handle: "filesystem"`

* Add test

* Update test/dev/integration.js

Co-Authored-By: Nathan Rajlich <n@n8.io>

* Handle recursive `serveProjectAsNowV2` call

* Fix test
2019-07-29 19:09:37 +02:00
Sophearak Tha
3d2929b345 [now dev] Improve integration tests for now dev (#2597)
* Using `stdio` to resolve `now dev` Ready

* Update test/dev/integration.js

Co-Authored-By: Andy <AndyBitz@users.noreply.github.com>

* Improve `testFixtureStdio` and update aurelia fixture

* Remove duplicate test

* Update `create-react-app` and `gatsby` test fixture

* Update `gridsome` test fixture

* Update `hugo` test fixture

* Update `jekyll` test fixture

* Add `marko` test fixture

* Add `mithril` test fixture

* Add `riot` test fixture

* Add `charge` test fixture

* Add `brunch` test fixture

* Add `docusaurus` and `ember` test fixtures

* Install ruby for `jekyll`

* Update base on platform for `jekyll` and `hugo`

* Use `sudo` to when installing `gem`

* Remove `09-jekyll`

* Extract the right filename

* Remove `-L` flag from `curl` for macOS

* Use different version of `hugo`

* Remove `min_version` from `08-hugo` theme
2019-07-29 09:44:30 +07:00
Nathan Rajlich
c91e529782 [now dev] Add server: now response header (#2646)
Matches production.
2019-07-26 17:24:04 -07:00
Nathan Rajlich
495ba3bf98 Add information when team/user/args parsing fails to Sentry reports (#2635)
* Add information when team/user/args parsing fails to Sentry reports

This should give us some insight into #2627.

* Add `node` reporting
2019-07-26 16:41:16 -07:00
Nathan Rajlich
c799886f53 [now dev] Remove accidental test.only() (#2644)
This got committed by accident :(
2019-07-26 16:10:30 -07:00
Andy
bcbaad4371 [now deploy] Determine platform version through Dockerfile and package.json (#2633)
* [now deploy] Determine platform version through `Dockerfile` and
`packge.json`

* Update src/commands/deploy/index.js

Co-Authored-By: Nathan Rajlich <n@n8.io>

* Change notification, add tests, consider `type`

* Change test

* Adjust test

* Adjust test

* Update src/util/prefer-v2-deployment.ts

Co-Authored-By: Nathan Rajlich <n@n8.io>
2019-07-25 17:35:50 -07:00
Nathan Rajlich
91c80ca0a9 Remove leftover references to pkg (#2632)
* Remove leftover references to `pkg`

We are no longer compiling `now-cli` with `pkg` so this is dead code.

* Enable source maps
2019-07-25 17:03:21 -07:00
Andy
e7e0ab7d0d [now dev] Clean up before calling process.exit (#2629)
* [now dev] Clean up before calling `process.exit`

* Log error

* Update src/util/dev/server.ts

Co-Authored-By: Steven <steven@ceriously.com>
2019-07-25 22:04:29 +02:00
Nathan Rajlich
0b6b74938f [now dev] Fix routing catch-all with no slash prefix edge case (#2626)
Fixes #2622.
2019-07-25 11:33:57 -07:00
Andy Bitz
256ca8796f 15.9.0-canary.21 2019-07-25 13:56:20 +02:00
Nathan Rajlich
17c659124b [now deploy] Respect --debug flag for API Client (#2625)
While debugging #2606, I noticed that the `Client` instances for
`now deploy` were not being supplied the appropriate `debug` flag
based on the command line args.
2019-07-24 16:23:37 -07:00
Steven
bcac213114 15.9.0-canary.20 2019-07-24 18:43:07 -04:00
Steven
7f4b2bdc87 [now init] Download /v1 examples without suggestions (#2623) 2019-07-24 18:42:01 -04:00
Nathan Rajlich
94a958f460 [now deploy] Change "Aliases assigned" to "Deployment complete" (#2620)
* [now deploy] Change "Aliases assigned" to "Deployment complete"

Closes #2617.

* Change instances of "Aliased" to "Deployed"
2019-07-24 14:11:31 -07:00
Andy Bitz
7a02249f37 15.9.0-canary.19 2019-07-24 22:55:37 +02:00
Andy
94681f28c6 [now dev] Bump @now/build-utils to 0.9.4 (#2621) 2019-07-24 22:54:41 +02:00
Nathan Rajlich
9fd1cee6f0 [now dev] Fix creating duplicate blocking builds upon bootup (#2618)
PR #2562 caused an issue with blocking builds at bootup being built
twice, which is problematic when i.e. running `yarn` simultaneously
on the same directory causing cache corruption issues.
2019-07-24 12:39:42 -07:00
Nathan Rajlich
2054bb06f1 [now dev] Remove useless debug() call (#2619)
The `getNowConfig(false)` used to be within this `if` branch, so the
debug call made sense there at the time, but as of zero config it got
moved to always be invoked, so this `debug()` call doesn't make sense
anymore.
2019-07-24 12:39:26 -07:00
Sophearak Tha
c0b5a01cae 15.9.0-canary.18 2019-07-24 21:05:10 +07:00
Sophearak Tha
0bbe5f7806 Remove Buffer() deprecation message (#2604)
* Remove `Buffer()` deprecation message

* Switch `micro` back to `9.1.2`
2019-07-24 20:57:55 +07:00
Nathan Rajlich
9e25d8e11c 15.9.0-canary.17 2019-07-23 17:50:44 -07:00
Nathan Rajlich
8623c5201c Add "engines" field to package.json for Node 10 or newer (#2603)
`now-cli` does not work on Node 8 and below because generator
functions are not supported.
2019-07-23 17:50:13 -07:00
Andy
862728f889 Use fs-extra instead of fs.promises to prevent warnings on Node 10 (#2602) 2019-07-23 17:29:37 -07:00
Nathan Rajlich
ad4e20c7e6 [CircleCI] Run integration tests on multiple versions of Node.js (#2596)
* [CircleCI] Run integration tests on multiple versions of Node.js

* Test Node 10 and Node 12

* Remove `fs.promises` usage for Node 8

* More `fs.promises` removal

* Remove Node 8, it is unsupported due to `async` function usage
2019-07-23 16:16:12 -07:00
Andy Bitz
62d782255a Revert "Disable warnings (#2601)"
This reverts commit 23318d9fc9.
2019-07-24 00:10:52 +02:00
Nathan Rajlich
3f18d24915 [now dev] Wait for blocking builds to complete before handling requests (#2562)
* [now dev] Wait for blocking builds to complete before handling requests

After the `now dev` server has already booted, if you delete a build
match that previously required a build at bootup time (i.e. `@now/next`)
from the `builds` array in `now.json` (i.e. change the builder to
`@now/static`), and then change it back to `@now/next`, then previously
the build would never execute.

With this change, the blocking build occurs as expected, and any HTTP
requests that occur are blocked until that build has completed.

* Prettier

* Better diff

* Add test
2019-07-23 14:58:19 -07:00
Andy
23318d9fc9 Disable warnings (#2601)
* Disable warnings

* Fix execution bits

* Revert "Fix execution bits"

This reverts commit f054f6695fe015896a5f6aa8354ac61a57b3cf81.

* Revert "Disable warnings"

This reverts commit 9321cea2820857060db7275eda9c94d951908714.

* Add --no-warnings
2019-07-23 23:40:11 +02:00
Nathan Rajlich
c413cc7349 [now dev] Add warning when there are no build matches (#2594)
* [now dev] Add warning when there are no build matches

This matches the error in production, except it's just a non-fatal
warning when running in `now dev`. This is so that the user can fix
the warning without having to restart the `now dev` server.

* Add integration test
2019-07-23 11:12:34 -07:00
Andy
f268a1b390 [now update] Don't check for updates on now update (#2599) 2019-07-23 19:56:50 +02:00
Nathan Rajlich
19dd33b037 [now update] Render the proper tag and improve yarn detection logic (#2595)
* [now update] Render the proper tag and improve `yarn` detection logic

Before this the suggested command would always have you install the
stable version of `now`.

With this change the `@canary` tag will be suggested if the version of
`now` is from the canary release channel.

Also updates the `isYarn` detection logic to not consider the cwd, and
instead check the installed version of now's `package.json` for clues.

* Move `getUpdateCommand` to util

* Add a unit test

* Use integration test instead
2019-07-23 17:31:15 +02:00
Andy Bitz
a29890c8ee 15.9.0-canary.16 2019-07-22 19:33:20 +02:00
Andy
6e3a495914 [now dev] Fix directory listing race condition (#2591)
* [now dev] Fix directory listing race condition

* Resolve file names

* Check only matched files

* Log stdout and stderr

* Log expected

* Change test

* Revert "Change test"

This reverts commit 149723be0f2015bd400dd5f2d5cce523303a05cf.

* Add timeout to request

* Adjust retries

* Don't use unref

* Remove tests

* Revert "Remove tests"

This reverts commit 6159d657bfa978719ffb23153058b791b2ce8a2a.

* Adjusted test

* Make sure directory exists

* Fix tests

* Add yarn.lock

* Adjust timeout
2019-07-22 18:34:27 +02:00
Sophearak Tha
e1005deeb3 Remove pkg bundling (#2567)
* Remove `pkg` bundling

* Remove `(dev)` from `--version`

* Remove `test/dev-builder.unit.js`

* Temporary disable `update now to canary test`

* Update `now update` command

* Removed useless jobs

* Removed useless code

* Removed more useless code

* Use update command

* Only run publish upon tag

* Removed code

* No need bin, use dist directly

* Update test, using the right file

* Reslove `iconv-lite@0.5.0` version

* Removed useless file

* Added scripts directory

* Removed useless stuff

* Fixed build script

* Fix `now dev` integration test

* Also block coverage on linting
2019-07-22 15:04:51 +02:00
Andy
c61502e24c [now dev] Print Serving all files as static only once (#2590)
* [now dev] Print `Serving all files as static` only once

* Track the config state

* Revert "Track the config state"

This reverts commit 9766941ca8cd1ffeae5fb0729800f05f2547099c.

* Revert "[now dev] Print `Serving all files as static` only once"

This reverts commit 3e30c2440b6c4deed8a14f2359696e7bf8dcdcad.

* Add `isInitialLoad` param
2019-07-22 02:47:09 +02:00
Sophearak Tha
7674a4af4a Add configuration and basic integration tests for now dev (#2553)
* Add configuration and basic integration tests for `now dev`

* Add test fixtures from `now-examples`

* Add `include` to `tsconfig.json`

* Increase retries for 00-list-directory

* Increase retries for `03-aurelia-node`

* Enable test fixtures for hexo, hugo, next, polymer, preact, svelte, vue, and vuepress

* Increase retries for `08-hugo-node`

* Disable `08-hugo-node` fixture

* Enable `04-create-react-app-node` test

* Disable `04-create-react-app-node` test

* Better name for now dev test job
2019-07-22 01:48:23 +02:00
Andy
0245a04db9 Handle more errors when deploying (#2589) 2019-07-22 00:31:56 +02:00
Andy
340537bc0b [now dev] Bump @now/build-utils and throw errors (#2588)
* [now dev] Bump `@now/build-utils` and throw errors

* Fix error handling
2019-07-21 21:37:49 +02:00
Steven
c9383b2535 [now init] Add suggestions for old examples (#2584)
* [now init] Add suggestions for old examples

* Add support for selecting an old example

* Add message for selection

* Wait for user interaction

* Fix typo

* Use v2 api instead

* Move message label to first param

* Bump api url to latest, update download to v2

* Rename found to visible
2019-07-19 19:29:02 -04:00
Andy Bitz
eae9f9ed42 15.9.0-canary.15 2019-07-19 22:29:52 +02:00
Mark Glagola
dfa134e8e4 handle no-change domain transfer policy (#2570) 2019-07-19 13:59:11 -05:00
Sophearak Tha
bb7b99bcf9 15.9.0-canary.14 2019-07-19 22:54:44 +07:00
Andy
074e96e117 Fix update command message (#2581)
* Fix update command

* Update src/commands/update.ts

Co-Authored-By: Leo Lamprecht <mindrun@icloud.com>
2019-07-19 22:48:41 +07:00
Andy
0b82c74c58 [now dev] Bump @now/build-utils (#2582)
* [now dev] Bump @now/build-utils

* Replace `apollo` init example fixure with `angular`

* Update more tests

* Remove `now.json` from check
2019-07-19 22:15:39 +07:00
Andy Bitz
5cc4af257e 15.9.0-canary.13 2019-07-19 14:03:40 +02:00
Andy
1979e2074f [now init] Remove now dev suggestion from now init (#2580) 2019-07-19 14:01:45 +02:00
Andy
e788743f58 [now dev] Remove package.json message (#2576)
* [now dev] Remove package.json message

* Add message that all files are served as static
2019-07-19 11:53:29 +02:00
Sophearak Tha
dae525e56a Remove deprecation message from now alias with args (#2578) 2019-07-19 11:42:32 +02:00
Andy
0e32313395 Fix building indicator jittering (#2577) 2019-07-19 11:22:31 +02:00
Andy Bitz
2ea1b00fda 15.9.0-canary.12 2019-07-19 02:42:03 +02:00
Andy
398b371ded [now dev] Upgrade @now/build-utils and enable more support for static sites (#2575)
* [now dev] Upgrade `@now/build-utils` and enable more support for static sites

* Add tests

* Upgrade @now/build-utils
2019-07-19 02:40:17 +02:00
Andy Bitz
da89cecaab 15.9.0-canary.11 2019-07-18 15:11:41 +02:00
Matthew Sweeney
e821d28ccd Add hint when example not found (#2572)
* add hint when example not found

* update test

* update test
2019-07-18 13:29:43 +01:00
Andy Bitz
3cd2de7728 15.9.0-canary.10 2019-07-18 12:30:15 +02:00
Andy
8e32c66840 Bump mime-types to 2.1.24 (#2571) 2019-07-18 12:29:54 +02:00
Andy Bitz
7716bb5439 15.9.0-canary.9 2019-07-17 23:45:35 +02:00
Andy
42a8dc14b0 Change now update to display npm or yarn command (#2568)
* Change `now update` to display npm or yarn command

* Use `getUpgradeCommand`
2019-07-17 23:39:16 +02:00
Andy Bitz
97ff4515ae 15.9.0-canary.8 2019-07-17 19:32:07 +02:00
Andy
ad6c04b78d [now dev] Fix builder sorting when use is undefined (#2566)
* [now dev] Fix function sorting when `use` is undefined

* Update type

* Add filter

* Fix build
2019-07-17 17:31:37 +02:00
Andy Bitz
68c1f7163f 15.9.0-canary.7 2019-07-17 14:46:29 +02:00
Andy
b94e8a1563 Fix tests order (#2565) 2019-07-17 14:45:58 +02:00
Andy Bitz
60a5659dff Revert "15.9.0-canary.7"
This reverts commit 06b8ccb672.
2019-07-17 14:34:28 +02:00
Andy Bitz
06b8ccb672 15.9.0-canary.7 2019-07-17 12:04:58 +02:00
Andy
ca06186cfe [now dev] Fix builder sorting (#2563)
* [now dev] Fix builder sorting

* Add tests

* Fix path

* Add sleep

* Revert "Add sleep"

This reverts commit 86f0057808eab50f1c977d19989425d633488e23.

* Revert "Fix path"

This reverts commit 14327b83145c8cb24d5e45ac6e91534a7ef093ec.

* Revert "Add tests"

This reverts commit 76849a7a5ce79b54f102a11f66920dccaabeadb6.
2019-07-17 11:49:32 +02:00
Andy
b5349fe6a5 [now dev] Allow now dev as package.json script (#2559)
* [now dev] Allow `now dev` as package.json script

* Fix absolute path for now dev

* Fix directory issue

* Typo

* Update src/commands/dev/dev.ts

Co-Authored-By: Nathan Rajlich <n@n8.io>

* Whitespace

* Make code simpler

* Extend type

* Update errors/now-dev-as-dev-script.md

Co-Authored-By: Nathan Rajlich <n@n8.io>

* Update errors/now-dev-as-dev-script.md

Co-Authored-By: Nathan Rajlich <n@n8.io>
2019-07-17 01:31:56 +02:00
Nathan Rajlich
7ac3c75ee8 15.9.0-canary.6 2019-07-16 14:44:46 -07:00
Nathan Rajlich
00437fe3f8 [now dev] Memoize the getNowConfig() promise (#2561)
The `getNowConfig()` function gets invoked frequently, and it is also
async and makes mutations to the cached now config object. This ends
up being a race condition when `getNowConfig()` is invoked concurrently,
since one of the invocations may end up with an incomplete `NowConfig`
object (namely, with missing `builds`/`routes` arrays due to the
zero-config processing).

This change makes it so that there's only one `getNowConfig()` invocation
being executed at a time, and other concurrent executions will await the
same promise that the original invocation is responsible for.
2019-07-16 14:27:35 -07:00
Nathan Rajlich
930648da13 [now dev] Rename nowJson variables to nowConfig (#2558)
This is only a cosmetic code change, but aligns more nicely with
the new zero-config approach (where there is no `now.json`).
2019-07-16 13:28:18 -07:00
Andy
4945218ea6 [now dev] Bump @now/build-utils to 0.8.8 (#2557) 2019-07-16 20:23:40 +02:00
Andy
12c3987e94 [now dev] Bump @now/build-utils (#2556) 2019-07-16 18:21:09 +02:00
Nathan Rajlich
18cedcb7e6 Update @sentry/node to v5.5.0 (#2542)
Because Sentry gives a big banner saying to update on the error reports.

Related: https://github.com/getsentry/sentry-javascript/blob/master/MIGRATION.md
2019-07-15 17:59:29 -07:00
Nathan Rajlich
925af8066d Update deps of deps in yarn.lock file (#2543)
* Update deps of deps in `yarn.lock` file

To fix #lodashgate:

 * Upgrade `lodash.merge` to version 4.6.2 or later.
 * Upgrade `lodash` to version 4.17.13 or later.

* Regenerate `yarn.lock`
2019-07-15 17:14:23 -07:00
Nathan Rajlich
5f46eb9dd7 [now dev] Wait for updateBuilders() to complete before stop() completes (#2551)
* [now dev] Wait for `updateBuilders()` to complete before `stop()` completes

Since #2477, the unit tests related to `now dev` have become flaky, and
need to be retried a couple of times before running successfully. My
theory is that this is related to having concurrent `yarn` processes
operating on the builders module directory, causing corruption with yarn's
cache. Waiting for the lazy updating `yarn` process to complete makes
sense to me, hopefully CircleCI agrees.

* Debugging "list the scopes" integration test

* Moar debug

* Use regular `require()` when not in a webpack build (ava tests)

* Remove debug
2019-07-15 16:45:05 -07:00
Andy Bitz
24245bd4bb 15.9.0-canary.5 2019-07-15 16:48:43 +02:00
Andy
005dd24b18 [now dev] Apply the ignore pattern to api files (#2548) 2019-07-15 15:32:05 +02:00
Nathan Rajlich
116ee34a10 15.9.0-canary.4 2019-07-12 13:40:03 -07:00
Nathan Rajlich
81cf441f66 Add builders.tar.gz to pkg "assets" configuration (#2541)
Fixes this error from the pkg'd binary:

```
Error: File or directory '/**/now-cli/dist/builders.tar.gz'
was not included into executable at compilation stage.
Please recompile adding it as asset or script.
```
2019-07-12 13:39:43 -07:00
Nathan Rajlich
c5a588744a 15.9.0-canary.3 2019-07-12 12:46:00 -07:00
Nathan Rajlich
48c126a911 [now dev] Bundle the most popular core builders into CLI binary with lazy builder updates (#2477)
* [now dev] Bundle the most popular core builders into CLI binary

Makes Now CLI bundle a tarball inside its snapshot filesystem that
includes the following builders:

 * @now/go
 * @now/next
 * @now/node
 * @now/php
 * @now/static-build

The tarball is generated by the `build.js` script and ensures the
"latest" version of the builders are included into the tarball.

When `now dev` is run, the tarball will be extracted upon the first
run to make these builders "pre-installed" to avoid the "Installing
builders" phase during boot-up.

Overall, this should make booting up `now dev` a lot faster, and help
with offline support.

* Don't install builders if they are bundled

* Persist `assets` dir to CircleCI workspace

* Delete build assets

* Fix installing builders from URL

* Finish builder installation filtering logic

* Still install `@now/build-utils`

* Implement builders installation "stale-while-revalidate"

* Remove `console.time()`

* Fix unit test

* Add `Readonly<>` to `BuilderWithPackage` type props

* Add debug log stack trace upon builder update failure
2019-07-12 12:33:06 -07:00
Sophearak Tha
18c295a88e 15.9.0-canary.2 2019-07-12 22:25:54 +07:00
Sophearak Tha
893871e043 [now dev] Improve max lambda size error message (#2539)
* Improve max lambda size error message

* Better wording
2019-07-12 22:24:49 +07:00
Andy
f2b1c89a53 Remove files from 15.7.0-canary.17 and 15.7.0-canary.14 (#2537) 2019-07-12 15:39:15 +02:00
Andy Bitz
271d7ffc29 15.9.0-canary.1 2019-07-12 15:13:02 +02:00
Andy
fd99217303 Bump @now/build-utils (#2535) 2019-07-12 14:50:14 +02:00
Max Rovensky
77d07f838f 15.7.0-canary.18 2019-07-12 16:38:06 +07:00
Max
1f81d80505 Disable automatic signup (#2530)
* Disable automatic signup

* Use shorter error message

* Update tests

* Update tests with user info

* Create tmpDir before tests

* Tweak fixtures and assertions for new login

* Don't pre-create the test directory in CI

* Use `os.homedir` instead of `~` in tests

* Pre-create auth directory conditionally
2019-07-12 15:34:26 +07:00
Sophearak Tha
7e950496ae 15.7.0-canary.17 2019-07-12 13:10:49 +07:00
Sophearak Tha
ec43780e1b Increase default maxLambdaSize (#2534) 2019-07-12 13:07:27 +07:00
Luc
66fe14d8e2 Remove "missing alias in now.json" warning (#2533) 2019-07-11 16:35:10 -07:00
Andy Bitz
a29abc7d45 15.7.0-canary.16 2019-07-11 13:06:54 +02:00
Nathan Rajlich
5d329e0bc3 [now dev] Render directory listing for Now v2 projects (#2528)
* [now dev] Render directory listing for Now v2 projects

Before directory listings only worked for "all static" deployments since
`now dev` would shell out to `serve-handler` to do the rendering.

Now the directory listing rendering logic is moved into `now dev` which
allows projects with Lambdas to also serve the directory listing
(previously they would just 404).

This removes the special-casing of "all static" deployments so that
there's only one code path.

Fixes #2161.
Fixes #2417.

* Move `serve-handler/src/directory` types to root

* Set `Content-Length` header for dir listing

* Add unit tests for directory listing

* Fix unit test
2019-07-10 19:34:16 -07:00
Andy Bitz
2de9edeed4 15.7.0-canary.15 2019-07-10 21:48:18 +02:00
Andy
954d433f6f [now dev] Update @now/build-utils and handle warnings (#2523)
* [now dev] Update @now/build-utils and handle warnings

* Display warnings from response headers for deployment creation

* Update src/util/dev/server.ts

Co-Authored-By: Nathan Rajlich <n@n8.io>

* Apply routes only when there are no builds

* Updated the build utils
2019-07-10 18:14:08 +02:00
Nathan Rajlich
b18196b394 15.7.0-canary.14 2019-07-09 18:58:23 -07:00
Nathan Rajlich
926c14e0ef [now dev] Update serve-handler to v6.1.0 and enable etag option (#2525)
* [now dev] Update `serve-handler` to v6.1.0 and enable `etag` option

Sending the `ETag` response header matches how Now in production works.

* Test file contents as well
2019-07-09 18:49:38 -07:00
Nathan Rajlich
c2c986e780 Add .gitignore file to test/fixtures/unit/now-dev-default-builds-and-routes (#2524) 2019-07-09 17:50:33 -07:00
Nathan Rajlich
26e87093e1 Add @AndyBitz to now dev CODEOWNERS (#2522) 2019-07-09 14:43:35 -07:00
Nathan Rajlich
ba0323e434 [now dev] Revert "Add etag response header for Lambda invocations" (#2520)
* [now dev] Revert "Add `etag` response header for Lambda invocations"

This reverts commit f80f1f79a6 (#2502).

`ETag` header is only sent in production when the lambda function sets
the "stale-while-revalidate" cache-control header, which will be
implemented in a separate PR.

* Remove `etag` test assertion
2019-07-09 14:40:48 -07:00
Nathan Rajlich
55229e1ed7 Add /src/util/dev to CODEOWNERS file (#2521) 2019-07-09 14:37:12 -07:00
Andy
064213ce52 [now dev] Fix @now/static-build sorting (#2519)
* [now dev] Fix @now/static-build sorting

* Change tests

* Update src/util/dev/server.ts

Co-Authored-By: Nathan Rajlich <n@n8.io>
2019-07-09 23:03:37 +02:00
Andy
f0802c681c [now dev] Tests for routing and apply default frontend builder last (#2518) 2019-07-09 20:58:04 +02:00
Sophearak Tha
a6d2ab7d77 15.7.0-canary.13 2019-07-10 00:06:49 +07:00
Sophearak Tha
c5ced92978 [now-dev] Fix flickering and improve message (#2516)
* Fix flickering and improve message

* Pluralize builds

* Properly handle pluralize form
2019-07-10 00:05:40 +07:00
Andy Bitz
7efe32f9c8 15.7.0-canary.12 2019-07-09 18:16:10 +02:00
Andy
60f163d540 [now dev] Allow the default static build without an api (#2515) 2019-07-09 18:15:34 +02:00
Sophearak Tha
f507f28f30 15.7.0-canary.11 2019-07-09 22:11:57 +07:00
Sophearak Tha
54ae7001ec Handle 400 create alias error (#2514) 2019-07-09 22:04:48 +07:00
Sophearak Tha
d044cfe142 Simplify builds output message (#2512)
* Simplify builds output message

* Properly stop the spinner

* Handle stop spinning properly and remove unused import

* Update src/commands/deploy/latest.js

Co-Authored-By: Leo Lamprecht <mindrun@icloud.com>

* Update src/commands/deploy/latest.js

Co-Authored-By: Leo Lamprecht <mindrun@icloud.com>

* Properly handle stop spinning at build failed

* Update build failed message

* Remove unused variable

* Remove punctuation in error message

* Update integration test reflect latest change
2019-07-09 20:22:07 +07:00
Sophearak Tha
3a1c68b439 Improve now dev output message (#2506)
* Improve `now dev` output message

* Update src/util/dev/builder.ts

Co-Authored-By: Leo Lamprecht <mindrun@icloud.com>
2019-07-09 12:32:24 +02:00
Sophearak Tha
e0489dc171 Throw an error if dev scripts contain now dev in package.json (#2507)
* Throw an error if `dev` scripts contain `now dev` in package.json

* Use proper Package type

* Update src/commands/dev/index.ts
2019-07-09 17:10:57 +07:00
Nathan Rajlich
9919701e2d [now dev] Add test case for lazily installing builders (#2510)
This is a follow up for #2509 to add a unit/regression test ensuring
correct functionality.
2019-07-08 17:44:36 -07:00
Andy Bitz
9ed9ba472e 15.7.0-canary.10 2019-07-08 23:05:40 +02:00
Andy
8513ff260b [now dev] Add support for deployments without now.json (#2498)
* [now-dev] Add zero config

* Update @now/build-utils

* Update @now/build-utils

* Escape glob

* Fix windows and group globbing

* Made sure routes and builds get updated on file events

* Removed useless check

* Add unit tests

* Use fetch instead of get
2019-07-08 23:04:57 +02:00
Nathan Rajlich
900c2a11f7 [now dev] Set Now response headers when proxy passing in routes (#2500)
* [now dev] Set Now response headers when proxy passing in `routes`

* Fix unit test
2019-07-08 22:02:42 +02:00
Nathan Rajlich
00ffd8d46c [now dev] Install missing builders during runtime (#2509)
Before this change, the `installBuilders()` function was only run at
bootup, so if you modify `now.json` during runtime and add a builder
that's not installed, then a `MODULE_NOT_FOUND` error occurs.

Now the `installBuilders()` function is run with the missing builder
so that the builder can be properly loaded.
2019-07-08 11:33:54 -07:00
Leo Lamprecht
cfc326b1ce 15.7.0-canary.9 2019-07-07 16:10:51 +00:00
Olli Vanhoja
dab4c6bf66 Use v3 user tokens API (#2482) 2019-07-07 15:53:46 +02:00
Nathan Rajlich
e21ece1626 [now dev] Allow cache-control header to be overwritten (#2501)
* [now dev] Allow `cache-control` header to be overwritten

This matches the behavior in production.

* Add `now-dev-headers` unit test fixture

* Remove `console.error()` call
2019-07-07 15:43:14 +02:00
Nathan Rajlich
f80f1f79a6 [now dev] Add etag response header for Lambda invocations (#2502)
This matches the behavior in production.
2019-07-07 15:19:54 +02:00
Nathan Rajlich
2414767026 [now dev] Set "must-revalidate" cache-control response header (#2499)
This matches the production router behavior, and prevents running `now
dev` on a different project from serving stale content from a different
project.

Also update the `x-now-id` header to match the production behavior (it
changed at some point).
2019-07-06 00:22:38 +02:00
Nathan Rajlich
887b2ccc6b [now update] Add message saying that Windows is not supported (#2493)
* [now update] Add message saying that Windows is not supported

And direct the user back to the download page in order to re-install.

Closes #2492.

* Exit 1

Co-Authored-By: Steven <steven@ceriously.com>
2019-07-05 13:04:01 -07:00
Sophearak Tha
164d29ccbe 15.7.0-canary.8 2019-07-05 19:31:12 +07:00
Sophearak Tha
4eb46d0436 Bump serve-handler version (#2497) 2019-07-05 19:29:22 +07:00
Nathan Rajlich
e0c6bb4094 [now dev] Move the MissingDotenvVarsError handling to the correct place (#2489)
`validateEnvConfig()` used to be invoked inside of `validateNowConfig()`,
but now it is invoked separately.

Explicitly exiting the process avoids reports going to Sentry.
2019-07-02 11:42:33 -07:00
Steven
3926055a5e 15.7.0-canary.7 2019-07-01 17:55:31 -04:00
Nathan Rajlich
8c00134ad1 [now dev] Use system installed version of Node.js for builds (#2480)
* [now dev] Use system installed version of Node.js for builds

Rather than downloading the 8.10 Node.js binary, simply assume that the
user has their preferred version of `node` already installed onto the
system and use that version.

If there is no `node` binary in the $PATH, then `process.execPath` is
used instead, meaning that the pkg binary node version will be used.

* Simplify `getNodeBin()` using `nothrow` option

* Fix build
2019-07-01 17:54:29 -04:00
Andy Bitz
6a104004e0 15.7.0-canary.6 2019-07-01 19:40:41 +02:00
Sophearak Tha
52df58b7dc 15.7.0-canary.5 2019-07-01 21:21:50 +07:00
Sophearak Tha
983d58c5a6 Improve metrics (#2472)
* ignore metrics with environment variable

* collect exception and exit code

* add deprecated warning for `now alias [id] [url]`

* add exception in util error

* consistent format

* ensure no duplicate warning

* using the right error message

* refactor metrics util
2019-07-01 21:19:49 +07:00
Nathan Rajlich
ec46e616db Remove mkdirp-promise (#2478)
Use the implemention from `fs-extra` instead.
2019-06-28 17:26:02 -07:00
Nathan Rajlich
3758e57cb8 [now dev] Exit the process upon ERR_SERVER_NOT_RUNNING (#2479)
This error happens when Ctrl+C is pressed before the `http.Server`
instance is listening, meaning that the user attempted to quit very
quickly after starting `now dev`.

This change makes the process exit immediately instead of throwing,
which also causes the error to be sent to Sentry (which we do not want).
2019-06-28 17:25:21 -07:00
Mark Glagola
1eaa8f76ea 15.7.0-canary.4 2019-06-28 18:42:10 -05:00
Mark Glagola
8e64d0b5ef More cert error handling for deploy command (#2475)
* More cert errors handling for deploy command

* Apply suggestions from code review

Co-Authored-By: Andy <AndyBitz@users.noreply.github.com>

* Revisions based on review

* Minor revision

* Adds get-deployment-by-id which uses latest v9 endpoint

* Refactor to use apiVersion
2019-06-28 18:28:30 -05:00
Nathan Rajlich
baceee2ecf Update @now/build-utils to v0.7.0 (#2474) 2019-06-28 15:23:55 -07:00
Mark Glagola
a23b7dd2bc Adds --target to arg-common (#2473) 2019-06-28 09:55:43 -05:00
Andy Bitz
0225163353 15.7.0-canary.3 2019-06-28 12:10:34 +02:00
Andy
9dbe89f5aa Change url for revert-alias tests to make it more reliable (#2471)
* Change url for revert-alias tests to make it more reliable

* Use project name from now.json

* Remove unused import in tests
2019-06-28 01:45:52 +02:00
Andy
f89effaa66 Don't verify the user for now dev (#2470) 2019-06-28 00:26:54 +02:00
Andy Bitz
b7e37af8f1 15.7.0-canary.2 2019-06-27 18:32:30 +02:00
Andy
1436e636d3 Don't show warning (#2468) 2019-06-27 18:18:11 +02:00
Andy Bitz
d2c33bbb06 15.7.0-canary.1 2019-06-26 19:28:56 +02:00
Andy Bitz
c5c22620a6 15.6.0-canary.4 2019-06-26 19:02:32 +02:00
Andy
fb7b890e40 Make sure to call secrets API only once (#2464)
* Make sure to call secrets API only once

* Use const
2019-06-26 17:29:35 +02:00
Andy
4e8512e660 Handle deployments rate limit (#2463) 2019-06-26 02:11:30 +02:00
Andy
29de58b5a7 Upgrade esm (#2458)
* Upgrade esm

* Use version 3.1.0

* Use version 3.1.4
2019-06-25 15:04:07 +02:00
Mark Glagola
7a36b9c6a3 15.6.0-canary.3 2019-06-24 13:16:35 -05:00
Mark Glagola
85ba820b27 Handle cert errors in create-deployment (#2455)
* handle cert errors in create-deployment

* Capture challenge_error and txt_record_not_found in mapCertError
2019-06-24 13:02:16 -05:00
Mark Glagola
54ff8ca196 Prompt based DNS add command (#2450)
* Initial prompt based DNS add command

* Adds verify step to dns record prompts

* handle prompt abort
2019-06-24 05:51:59 -05:00
Andy Bitz
9f40a7cca6 15.6.0-canary.2 2019-06-21 18:35:02 +02:00
Andy
9be5970378 now rm improvements (#2449)
* Handle --safe

* Fix  option

* Slice deployments
2019-06-21 18:33:44 +02:00
Andy
2214516689 Handle --safe (#2448)
* Handle --safe

* Fix  option
2019-06-21 17:57:22 +02:00
Andy Bitz
b7f6d4a859 15.6.0-canary.1 2019-06-21 11:31:02 +02:00
Steven
03404e9858 15.4.0-canary.10 2019-06-20 18:11:04 -04:00
Steven
236edcc535 Bump @zeit/fun to 0.9.0 (#2445) 2019-06-20 18:09:06 -04:00
Steven
822b12cc96 [now dev] Improve tests for @now/build-utils@canary (#2444) 2019-06-20 14:38:07 -04:00
Mark Glagola
79d8157798 Move dns_error to generic CertError (#2443) 2019-06-20 09:25:18 -05:00
Mark Glagola
12795f7298 15.4.0-canary.9 2019-06-19 12:35:28 -05:00
Mark Glagola
86f6df6607 Cert error handling revisions/additions (#2437)
* Cert error handling revisions/additions

* Adds certs/add.js back + updated cert error handling to be pipeable

* remove //todo
2019-06-19 12:34:38 -05:00
Steven
b837aca0f8 [now dev] Use canary @now/build-utils or stable based on builders (#2441)
* [now dev] Use canary build utils or stable

* Fix version selection

* Fix test

* Fix typo

* Add tests for getBuildUtils

* Add `latest`
2019-06-18 19:01:16 -04:00
Steven
557ea38869 15.4.0-canary.8 2019-06-18 13:55:55 -04:00
Steven
6a78563b32 Bump @now/build-utils to 0.6.0 (#2440) 2019-06-18 13:49:05 -04:00
Andy Bitz
ec6f71aed9 15.4.0-canary.7 2019-06-18 19:32:09 +02:00
Andy
faccd7fb9e Update help (#2438)
* Update help

* Make whoami advanced

* Make init basic

* Moved update down
2019-06-18 19:19:58 +02:00
Andy Bitz
796bc0acee 15.4.0-canary.6 2019-06-17 23:29:46 +02:00
Andy
ae2638f7a9 Update now rm (#2412)
* Update now rm

* Fixed typo

* Don't use .flat() because of node 10

* Exit process

* Remove only the project instead of all deployments of it

* Changed output text

* Headlines for projects and deployments

* Typo and number prefix
2019-06-17 23:28:16 +02:00
Nathan Rajlich
51b7716cc7 [now update] Handle permissions errors in the file replacement method (#2430)
1. Handle permissions errors in both update mechanisms
 2. Handle `EBUSY` (Windows) as a file busy error
 3. Update permissions error prompt to say "Administrator Command Prompt" on Windows
 4. Add message about "unexpected end of file" error
2019-06-17 13:51:51 -07:00
Nathan Rajlich
c368f98ded 15.4.0-canary.5 2019-06-12 11:09:50 -07:00
Nathan Rajlich
5f1e77cd67 [now dev] Move helper modules to src/util/dev (#2422)
This organization is consistent with how other commands are structured.
2019-06-10 15:41:26 -07:00
Nathan Rajlich
a5b4f0bd87 Lowercase the x-forwarded-* and x-real-ip headers (#2420)
Fixes #2238.
2019-06-10 14:21:53 -07:00
Nathan Rajlich
aab2acf008 [now dev] Run prettier (#2419)
Run `prettier` on the `now dev` codebase since the formatting has
gotten out-of-sync over time.

Also removes a stale TODO comment.
2019-06-10 14:07:02 -07:00
Nathan Rajlich
d740df9600 [now dev] Show a warning when now.json contains a syntax error (#2418)
Rather then throwing which causes the process to exit.
Better to give the developer a chance to fix the syntax
error without having to restart the dev server afterwards.
2019-06-10 13:17:23 -07:00
Nathan Rajlich
cb464939a0 15.4.0-canary.4 2019-06-10 11:50:48 -07:00
Nathan Rajlich
0f2b35175c [now dev] Implement continue: true routes (#2413)
* [now dev] Implement `continue: true` routes

Fixes #2088.

* Add `continue: true` unit test

* Add a `continue: true` unit test that matches
2019-06-10 11:38:22 -07:00
JJ Kasper
33fe99ea43 15.4.0-canary.3 2019-06-08 14:02:45 -07:00
Nathan Rajlich
22344045b8 Add whoami command back (#2411)
* Add `whoami` command back

It was accidentally removed.

Fixes #2410.

* Add `whoami` regression test
2019-06-07 15:14:14 -07:00
JJ Kasper
a81ed47ebc [now-dev] Add checking of RegExp src with beginning slash (#2398)
* Add checking of RegExp src with beginning slash

* Move slash no slash check to same line

* Add unit test for dev-router
2019-06-07 12:40:04 -07:00
Nathan Rajlich
9d247a4fb6 15.4.0-canary.2 2019-06-05 14:55:30 -07:00
Luc
33f6db1daf [now update] Add integration test (#2405)
* add simple integration to test `now update`

* remove `.only`

* verify that `now --version` includes `canary`
2019-06-05 23:46:03 +02:00
Nathan Rajlich
cf7e0e14f5 [now update] No login required (#2406) 2019-06-05 14:12:11 -07:00
Andy Bitz
88a896684f 15.4.0-canary.1 2019-06-05 19:08:51 +02:00
Andy Bitz
55f5aa5b79 15.2.1-canary.7 2019-06-05 14:14:25 +02:00
Andy
a4be2eb79d Fix now rm and decrease total projects for now ls (#2404)
* Use v4 instead to prevent listing the same deployment multiple times

* Remove the latestDeployments since it is depracted and doesn't have the
`readyState` property and only get 35 projects instead of 50 to lower
the rate limit

* Fix tests
2019-06-05 14:13:38 +02:00
Andy Bitz
81c7705690 15.2.1-canary.6 2019-06-05 02:45:24 +02:00
Nathan Rajlich
4dda34fe28 Add now update command (#2388)
* Add `now update` command

Updates the `now` binary in-place.

* Tweaks

* Remove `.ts` suffix in `import` statement

* Remove unused imports

* Implement `getPlatform()`

* Add `ETXTBSY` error fallback method

* Remove `StreamError` import

* Add `chown()` logic

* Remove `console.error()`

* Add `now update` to --help

* Add beta message with feedback URL

* Deprecate `now upgrade` and `now downgrade` commands

* Mention `now upgrade` when a new version is available

* Add `now update` message to `now upgrade`

* Final tweaks
2019-06-05 02:43:43 +02:00
Andy
5a05f6896f Use the projects API for now ls (#2403)
* Use the projects API for `now ls`

* Use recentDeployments
2019-06-05 01:20:14 +02:00
Mark Glagola
e8f7158d52 15.2.1-canary.5 2019-06-04 15:39:04 -05:00
Mark Glagola
fa10b78b30 Handle transfer-in registration_failed (#2402) 2019-06-04 13:08:49 -05:00
Mark
b9be120b17 Update @zeit/ncc to v0.18.5 (#2389) 2019-05-29 17:19:50 -07:00
Nathan Rajlich
4020eb1254 Update @zeit/fun to v0.8.1 (#2391) 2019-05-29 11:16:32 -07:00
Nathan Rajlich
15178f0332 15.2.1-canary.4 2019-05-27 12:54:03 -07:00
Nathan Rajlich
04c11e266a [now dev] Strip prefixed / when doing routes matching (#2361)
* [now dev] Strip prefixed `/` when doing routes matching

The prefixed `/` is implicit when matching routes, so strip them
so that they are optional. This matches the behavior in production.

* Fix unit tests

* More readable

* Add unit test
2019-05-27 12:16:57 -07:00
Steven
7bd40f0aae [now-init] Check for dir existence prior to download (#2379) 2019-05-25 13:53:10 -04:00
Nathan Rajlich
ca17c6da36 [now dev] Use empty string for missing matches (#2376)
Rather than `undefined`. This matches the behavior in production.

Fixes #2375.
2019-05-22 13:04:03 -07:00
Sophearak Tha
16b99a6f72 Mimic browser user agent (#2372) 2019-05-22 09:37:39 +07:00
Sophearak Tha
88a4f52ccd 15.2.1-canary.3 2019-05-20 17:46:46 +07:00
Sophearak Tha
e975ddca8b Add .now ignore by default (#2365) 2019-05-20 17:44:07 +07:00
Leo Lamprecht
225afafe43 15.2.1-canary.2 2019-05-17 18:45:04 +00:00
Andy
1bafb4686f Increase the time we wait for the aliasing (#2360) 2019-05-17 20:43:25 +02:00
Sophearak Tha
2777ec3e2c Integrate universal metrics (#2346)
* integrate universal metrics

* Update src/index.js

Co-Authored-By: Leo Lamprecht <mindrun@icloud.com>

* Add default `collectMetrics` config

* Remove flag, only using global config to disable metrics

* Add GA tracking ID

* Move constant to file

* Rename constant to constants

* Rename `dsn` to `SENTRY_DSN`

* Apply suggestions from code review

Co-Authored-By: Leo Lamprecht <mindrun@icloud.com>

* Remove extra space

* Update event category and action

* Remove usagestate to use universal-analytics

* Chain timing and event function

* Make sure to user are unique

* Ensure unique User ID

* Add extra User-Agent and move metrics into its own file

* Use default export
2019-05-17 19:15:56 +02:00
Samuel Hapák
6f817971d0 Help users to deal with secrets starting with dash (#2253)
People are often trying to store secrets starting with dashes such as 
private keys. These dashes get interpreted as command line options which
effectively prevents a storage of private keys.

Fortunately, this is easily resolved by using bash -- convention to mark
an end of options, such as:

`now secret add google-secret-key -- "-----BEGIN PRIVATE KEY-----
abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVXYZ+/a
-----END PRIVATE KEY-----"

The problem is also discussed in following issues: 
https://github.com/zeit/now-cli/issues/749
https://github.com/zeit/now-cli/issues/80
2019-05-17 18:42:42 +02:00
Nathan Rajlich
9358b01cac [now dev] Create yarn.cmd file on Windows (#2358)
The `yarn.cmd` file is necessary for `yarn` to be executable
when running `now dev` through cmd.exe
2019-05-17 18:41:02 +02:00
Nathan Rajlich
a8f8da9906 15.2.1-canary.1 2019-05-16 10:49:33 -07:00
Nathan Rajlich
b2d8550777 [now dev] Use chokidar for file watching (#2350)
* [now dev] Use `chokidar` for file watching

`nsfw` is not suitable for very large projects because it does not
have any "ignore" functionality implemented.

For macOS, the `useFsEvents` option is _disabled_, so that the
`fsevents.node` binary file does not need to be cached onto the
filesystem, which simplifies things for use with `pkg` binaries.

* Delete the `fsevents` module during build

* Add proper `.nowignore` logic to the chokidar watcher
2019-05-16 10:40:09 -07:00
Nathan Rajlich
51b6031eab [now dev] Consider devDependencies when looking up package name (#2352)
Alpha versions of `now dev` that used npm instead of yarn were
installing the packages to `devDependencies` rather than `dependencies`,
so this fixes package name lookup when a legacy cache like that is on
the user's machine.
2019-05-15 17:47:56 -07:00
Nathan Rajlich
370961e872 15.2.1-canary.0 2019-05-13 12:51:07 -07:00
Nathan Rajlich
43e2970620 15.1.1-canary.4 2019-05-10 20:05:15 -07:00
Nathan Rajlich
385c4e4a2f [now dev] Use the dev server cwd as builder's workPath (#2326)
* [now dev] Use the dev server `cwd` as builder's `workPath`

Rather than copying the source files into a temporary directory,
simply use the existing source files in the `cwd`. This will make
subsequent boots of `now dev` be faster (i.e. because the `node_modules`
directory will already be in place), as well as use much less space on
the filesystem because temporary directory are no longer being used.

This will require some changes to the builders and `@now/build-utils`,
to ensure that the `download()` function is always installing into
`workPath`, and that the `meta` object passed to the `build()` function
is also passed into the `download()` function.

For example:

 - https://github.com/zeit/now-builders/pull/474
 - https://github.com/zeit/now-builders/pull/475

* Update `@now/build-utils` to v0.5.5-canary.1

This makes `download()` be a no-op when running in `now dev`.

* Add test case for `@now/next`

* Fix debug log formatting
2019-05-10 17:13:51 -07:00
Nathan Rajlich
39591b4776 Re-enable "try to create a builds deployments with wrong config" integration test (#2337)
It was temporarily disabled due to server-side issues, but that has been
fixed now.
2019-05-10 11:08:39 -07:00
Mark Glagola
2f0218aaa5 Fix transfer in price for some TLDs (#2334) 2019-05-10 07:54:58 -05:00
Nathan Rajlich
9ed897c6be [now dev] Mix in routes query params when proxying to a URL (#2330)
* [now dev] Mix in routes query params when proxying to a URL

Fixes #2289.

* Refactor unit tests and add a unit test for proxy passing with query params

* Fix TypeScript compile error

* [DEBUG] Disable proxy pass unit test

* Run unit tests serially

* Remove `console.error()` in unit test

* Temporarily disable integration test "try to create a builds deployments with wrong config"
2019-05-10 13:09:28 +02:00
Nathan Rajlich
b53d907b74 Adjust now init and now dev to not require a login token (#2325)
* Adjust `now init` and `now dev` to not require a login token

These two commands should not require a login token because
they do not interact with the Now API.

* Remove `config` from `subcommandsWithoutToken` array

It's not an existing command.
2019-05-07 15:56:08 -07:00
Nathan Rajlich
7aa2a27fc9 15.1.1-canary.3 2019-05-06 16:39:44 -07:00
Nathan Rajlich
742be77cfb [now dev] Inherit env vars from now.json (#2321)
* [now dev] Inherit env vars from `now.json`

Before it was only using env vars defined in the `.env` and `.env.build`
dotenv files.

* Fix secrets validation
2019-05-06 14:38:11 -07:00
Andy Bitz
44946520ef 15.1.1-canary.2 2019-05-06 21:59:43 +02:00
Andy
35d45f7493 Fix Git Bash and make update/uninstall work on Windows (#2322)
* Update index.js

* Fix bash file
2019-05-06 21:58:11 +02:00
Nathan Rajlich
a6fa395822 [now dev] Add meta.env and meta.buildEnv for builders (#2320)
Some builders require access to the runtime env vars, i.e. `@now/next`
since it spawns a `next dev` subprocess and should be passing the
runtime env vars to that.
2019-05-06 11:06:38 -07:00
Leo Lamprecht
48ff96d9e7 15.1.1-canary.1 2019-05-06 12:03:36 +00:00
Spellar Bot
53e0f89311 Fix a few typos in err.sh pages (#2311) 2019-05-03 17:17:44 -07:00
Timothy
871a89bf50 Update missing-env-file.md (#2281)
* Update missing-env-file.md

* Update missing-env-file.md
2019-05-03 17:17:34 -07:00
Nathan Rajlich
648fb6f949 15.0.11-canary.3 2019-05-03 10:37:35 -07:00
Steven
709fd1bf12 Update Readme with now dev workflow (#2308) 2019-05-03 10:18:40 -07:00
Nathan Rajlich
cf51fdb026 [now dev] Implement methods in routes config (#2306)
Fixes #2148.
2019-05-03 14:21:26 +02:00
Nathan Rajlich
1e8a825e94 [now dev] Send all status codes if routes config contains one (#2307)
Before it was only respecting the status code for 301, 302 and 303
status codes. Now it handles any status code defined in the routes
config.

Fixes #2294.
2019-05-03 14:20:33 +02:00
Nathan Rajlich
2ab71798de 15.0.11-canary.2 2019-05-02 12:26:18 -07:00
Matthew Sweeney
683de6048e [now init] Add line breaks to success message (#2285)
* add line break to success message

* change to using original util

* Update src/commands/init/init.ts

Co-Authored-By: msweeneydev <26944716+msweeneydev@users.noreply.github.com>
2019-05-02 12:06:40 -07:00
Nathan Rajlich
49e619ce11 [now dev] Update @zeit/fun and @now/build-utils for Windows (#2302)
Not all builders will be working yet, but this adds minimal Windows
support for `now dev`.
2019-05-02 13:21:01 +02:00
Nathan Rajlich
fc5c8dd74f Convert the build script to Node.js (#2301)
Because, you know, Windows.
2019-05-02 00:11:07 -07:00
Nathan Rajlich
fb46cc7761 [now dev] Show build logs if a build fails during bootup (#2297)
* [now dev] Show build logs if a build fails during bootup

Before, the logs were never shown because `buildProcess` does not emit
an `error` event when the child process exits.

Also updates `ora` to the latest version.

* Remove `@types/ora`

`ora` includes its own TypeScript definitions now.
2019-05-01 23:43:07 -07:00
Nathan Rajlich
332867a9f5 [now dev] Set NOW_REGION: 'dev1' env on the builder processes (#2298) 2019-05-01 13:02:23 -07:00
Steven
dfea510e68 Add .next and .cache to default ignore (#2295) 2019-05-01 14:21:02 -04:00
Nathan Rajlich
baff58eecc Update pkg to v4.3.8 (#2293)
Which includes this fix: https://github.com/zeit/pkg/issues/671

Relevant to `now dev` invoking `yarn` when a package includes
a postinstall script that invokes `node`.
2019-05-01 10:01:59 -07:00
Steven
0db933b6a3 Create CODE_OF_CONDUCT.md (#2290) 2019-05-01 09:38:57 -04:00
Nathan Rajlich
4552ad9b36 [now dev] Use consistent cache directory for nsfw module download (#2280) 2019-04-30 10:08:21 -07:00
Shuying
78a04905f1 Update feedback url (#2278) 2019-04-30 18:49:26 +02:00
Nathan Rajlich
3caa922e76 [now dev] Convert path backslashes to forward slashes for Windows (#2279) 2019-04-30 09:48:12 -07:00
Leo Lamprecht
24572b554b 15.0.11-canary.1 2019-04-30 10:11:51 +00:00
Nathan Rajlich
35109800d5 [now dev] Enable cleanUrls option when deployment is all static (#2277)
So that rendering `index.html` as root works as expected.
2019-04-30 11:17:24 +02:00
Nathan Rajlich
1c009266cc 15.0.10-canary.2 2019-04-29 20:14:50 -07:00
Nathan Rajlich
5ec45459e5 [now dev] Install builders with yarn instead of npm (#2272)
* [now dev] Install builders with `yarn` instead of `npm`

Also invokes via `process.execPath` so that the pkg'd node is used
instead of a global one.

Depends on #2270.

* Install `yarn` to the builder cache dir

Not the `node_modules/.bin` dir, because `yarn` cleans up that directory
when installing modules, so it deletes itself.

* Remove unnecessary unit test

* Always install `yarn`

* Pass in the `yarnPath` to `installBuilders()`

* Restore unit test

* Remove unused `delimiter` import

Co-Authored-By: TooTallNate <n@n8.io>
2019-04-29 19:57:57 -07:00
Steven
37964c1e0f [now dev] Install yarn into builder cache (#2270)
Closes #2063.
2019-04-29 17:44:14 -07:00
Nathan Rajlich
ea8add7316 Update CODEOWNERS for dev, certs and domains commands (#2275)
* Update CODEOWNERS for `dev` command

Also added a fallback for @leo

* Remove `init`, add `domains` and `certs`
2019-04-29 16:38:00 -07:00
Nathan Rajlich
baed2da509 [now dev] Show build timestamps (#2273)
* [now dev] Show build timestamps

Except when running the initial builds

* Fix bad logic
2019-04-29 15:05:10 -07:00
Steven
7be66960b7 [now-dev] Fix .nowignore to match production (#2233)
* Fix now dev usage of .nowignore

* Fix now dev usage of .nowignore

* Move env before nowjson

* Remove console.log()

* Remove comments & unused imports

* Fix merge conflicts

* Fix merge conflicts

* Add docs

* Fix stat mode
2019-04-29 17:35:19 -04:00
Nathan Rajlich
ab6f72e44d [now dev] Don't render initial builds spinner when debug is enabled (#2271) 2019-04-29 13:58:22 -07:00
Leo Lamprecht
251083bf38 15.0.10-canary.1 2019-04-29 18:19:30 +00:00
Leo Lamprecht
6426b1e430 Revert "Enable cleanUrls for entirely static projects (#2268)"
This reverts commit c7ed5d7850.
2019-04-29 18:19:07 +00:00
Nathan Rajlich
635b20d4ab [now dev] Show builder logs, even after build completes (#2269)
This is important for builders like `@now/next` and `@now/static-build`
which launch a child process dev server, and we want those logs to be
visible from the `now dev` console output.
2019-04-29 18:41:01 +02:00
Leo Lamprecht
f38669576a 15.0.9-canary.3 2019-04-29 14:05:32 +00:00
Leo Lamprecht
c7ed5d7850 Enable cleanUrls for entirely static projects (#2268) 2019-04-29 15:25:33 +02:00
Leo Lamprecht
67a918401c Correctly log when setting up Builders (#2267)
* Correctly log when setting up Builders

* Added message about beta
2019-04-29 14:33:23 +02:00
Leo Lamprecht
08f0e02f42 Do not print installing builders for no builds (#2266)
* Do not print installing builders for no builds

* Added unit test
2019-04-29 13:46:18 +02:00
Andy
0748cb7698 Display handle in now inspect (#2265) 2019-04-29 11:47:12 +02:00
Leo Lamprecht
76c9a233b9 15.0.9-canary.2 2019-04-28 21:11:32 +00:00
Leo Lamprecht
b3f584686b Make the message for when the server is running shorter (#2262) 2019-04-28 23:01:24 +02:00
Leo Lamprecht
18f06fde2a Fixed error for .env and .env.build (#2261)
* Do not report env errors to Sentry

* Added guide for missing env file in dev mode

* Update errors/missing-env-file.md

Co-Authored-By: leo <mindrun@icloud.com>

* Update errors/missing-env-file.md

Co-Authored-By: leo <mindrun@icloud.com>
2019-04-28 21:45:35 +02:00
Nathan Rajlich
c13545d585 [now dev] Refactor builders installation logic (#2254)
* [now dev] Refactor builders installation logic

 - Don't run `npm update`, only `npm install`, so no more "Checking for
   builder updates".
 - Don't save `package-lock.json`, to allow builders with newer versions
   than already installed to be updated.
 - Properly supports non-npm-registry builders (i.e. an HTTP URL,
   `github:` syntax, etc.

* Use `Object.entries()`
2019-04-28 12:38:08 -07:00
Matthew Sweeney
112497d55e Adds 'to develop' to now init (#2260)
Adds 'to develop' to now init
2019-04-28 18:58:32 +02:00
Amio
91069f6d38 [now dev] fix directory listing (#2256) 2019-04-28 17:50:23 +02:00
Andy
2cf846ead3 Wait for aliases in tests (#2257) 2019-04-28 17:35:50 +02:00
Leo Lamprecht
310e1b4247 Revert "Add a logout test case" (#2258)
This reverts commit 5754360684c1e34b0351fadd9e2a6e5ef4b8b82f.
2019-04-28 17:22:52 +02:00
Olli Vanhoja
2f12b08616 Use the single request logout endpoint (#2201)
Logout by deleting the currently used auth token.
2019-04-28 10:58:56 +02:00
Nathan Rajlich
744ef92faa [now dev] Don't render building/built logging for @now/static
Since it's a built-in builder.
2019-04-27 18:55:14 -07:00
Leo Lamprecht
aa8d77e571 15.0.9-canary.1 2019-04-27 14:11:26 +00:00
Steven
6f8c9fe548 Add python virtual environment to default ignore (#2241) 2019-04-27 14:11:11 +00:00
Leo Lamprecht
b6ded9a7fe Do not check for @now/static Builder updates (#2251) 2019-04-27 16:10:31 +02:00
Leo Lamprecht
468fa88139 Print missing line when stopping server (#2250) 2019-04-27 15:49:33 +02:00
Leo Lamprecht
1aa46713c2 Only print stopping server if already printed URL (#2249) 2019-04-27 15:40:44 +02:00
JJ Kasper
9029a51707 Update to make sure query isn't stripped (#2246)
* Update to make sure query isn't stripped
before ProxyPass in dev-server

* Add test for stripping query

* normalize semis in test
2019-04-27 14:23:11 +02:00
Nathan Rajlich
6df363e2da [now dev] Better logging while building and error recovery (#2244)
- Have the builder exit if a rejection occurs
 - Respawn the builder upon next rebuild after the builder has exited
 - Log when builder is starting and completed with build time
 - Render build error in the HTTP response
2019-04-27 13:23:45 +02:00
Amio
36f5b265c8 Refine dev log layout (#2245) 2019-04-27 13:13:33 +02:00
Nathan Rajlich
929ea187ce [now dev] Lazily initialize the nodejs8.10 runtime for builds (#2243) 2019-04-26 22:23:43 +02:00
Leo Lamprecht
822f203f5a Bumped @zeit/nsfw to latest (#2242) 2019-04-26 22:20:15 +02:00
Leo Lamprecht
54d02b6ab2 Support Windows when downloading file watcher (#2240) 2019-04-26 21:59:06 +02:00
Andy
f9919fe854 Modify the gitbash file correctly (#2223) 2019-04-26 21:46:12 +02:00
Amio
73de0f228a [now dev] exit on MissingDotenvVarsError (#2237) 2019-04-26 20:09:06 +08:00
Steven
9d73f7735e Convert get-files from JS to TS (#2207)
* Convert get-files from JS to TS

* Bump @zeit/dockerignore to 0.0.5

* Fix types

* Fix typo

* Remove arr-flatten dependency
2019-04-25 16:47:21 -04:00
Leo Lamprecht
a0209f4667 15.0.8-canary.1 2019-04-25 19:29:01 +00:00
Nathan Rajlich
60b36cb3f8 [now dev] Supply empty default now.json if one does not exist (#2231)
This forces all the files to be served as static assets using
`@now/static`, rather than having a special branch that dishes
out to `serve-static`. This is better because it keeps the logic
consistent with when a `now.json` is supplied vs. when it is not,
and allows the code to be simplified by removing checks for if
`getNowJson()` returned anything (previously it could return `null`,
but now that is not the case). Also allows us to remove the now-unused
`serveProjectAsStatic()` function.
2019-04-25 11:56:20 -07:00
Nathan Rajlich
454ce02565 [now dev] Force @now/static to run in-memory (#2230)
* [now dev] Force `@now/static` to run in-memory

The logic for `@now/static` builder is bundled into the `pkg` binary,
and thus is not requireable, so it must instead be run in-memory.

* Also check for stdout TTY before doing the erase lines stuff
2019-04-25 11:13:14 -07:00
Leo Lamprecht
048434a564 15.0.7-canary.8 2019-04-25 14:29:38 +00:00
Nathan Rajlich
0334b75cfa [now dev] Invoke builders in a forked child process (#2227)
* Update `@zeit/fun` to v0.7.0

* Remove `builderCachePromise`

No longer used.

* Remove `intercept-stdout`

* WIP invoke the builder in a forked child process

* WIP Add `builder.js` file

* Remove `BuildResultV1 | BuildResultV2` distinction

Prefer normalizing the `build()` function result to `BuildResult` v2
shape so that we don't have to cast everywhere else.

* Apply build env vars to builder child process

* Copy the `builder.js` file from the pkg filesystem snapshot to the builder cache dir

* Map `FileFsRef` and `FileBlob` of the builder's output back into instances

* Fix `@now/next` :/

* Cleanup

* Print number of initial builds

* Add spinner for building process

* Refine logs

* Support none-tty

* Crop long lines

* Clean up imports

* Refine logs wording
2019-04-25 16:28:58 +02:00
Nathan Rajlich
ce0ed935c8 [now dev] Always watch the entrypoint for triggering rebuilds (#2226)
The `entrypoint` should always be watched, since we know that it was used
to produce the build output. This is for builders that don't implement
a fully featured `watch` return value.
2019-04-24 13:49:50 -07:00
Leo Lamprecht
ad89a63091 15.0.7-canary.7 2019-04-24 18:54:02 +00:00
Nathan Rajlich
d148edcb67 [now dev] Don't include a file in both filesChanged and filesRemoved list (#2225)
* [now dev] Don't include a file in both `filesChanged` and `filesRemoved` list

This makes it so that if a file is added to the "changed" array, then it
is also removed from the "deleted" array, and vice-versa.

* Only render the "files changed/remove" debug log if there are entries
2019-04-24 20:53:29 +02:00
Leo Lamprecht
36d2e29954 15.0.7-canary.6 2019-04-24 17:05:42 +00:00
Leo Lamprecht
76d3643e0f Bumped @now/build-utils to latest version (#2220) 2019-04-24 19:05:07 +02:00
Leo Lamprecht
a12e228cc4 15.0.7-canary.5 2019-04-24 12:21:56 +00:00
Amio
669ee6a65f [now-dev] Exit when incorrect cwd config (#2218)
* [now-dev] Exit when incorrect cwd config

* better wording
2019-04-24 13:25:20 +02:00
Nathan Rajlich
a7f734fadf [now dev] Use minimatch on the watch array to support globs (#2216)
This will be necessary for `@now/static-build` since it needs to watch
all files in the dir containing the entrypoint. For example:

```
watch: [ path.join(path.dirname(entrypoint), '**/*') ]
```
2019-04-24 10:21:43 +08:00
Nathan Rajlich
8405c2d6cd [now dev] Allow a builder watch array to contain "./" prefixed paths (#2217)
The file watcher logic expects that there is no `'./'` prefix on the
watched file paths/patterns, but `path.dirname('foo')` returns `'.'`
which turns into `'./foo'` with `path.join()`. So this allows those
file paths to be returned from the builder and `now dev` normalizes the
paths after the build has completed.
2019-04-23 19:17:02 -07:00
Leo Lamprecht
10316c871b 15.0.7-canary.4 2019-04-23 19:06:55 +00:00
Nathan Rajlich
3b94b105fe [now dev] Add xfwd option to http-proxy (#2215)
This makes the `http-proxy` module set the `X-Forwarded-*` HTTP request
headers to the destination endpoint.
2019-04-23 11:21:41 -07:00
Nathan Rajlich
d7abf96414 [now dev] Pass in the builder-specific workPath to shouldServe() (#2214)
The dev server `cwd` is not correct working path of a build match, so
pass in the correct one. This property will be used by
`@now/static-build`'s dev mode.
2019-04-23 10:49:53 -07:00
Steven
2c4d9d5af0 Ignore __pycache__ directories (#2213) 2019-04-23 11:38:12 -04:00
Mark
e14ddc11ee Update @zeit/ncc to v0.18.1 (#2210) 2019-04-23 17:31:17 +02:00
Leo Lamprecht
11eb122ecc 15.0.7-canary.3 2019-04-23 12:05:47 +00:00
Nathan Rajlich
40be8ef688 [now dev] Remove requiresInitialBuild and make shouldServe() optional for v2 Builders (#2209)
* [now dev] Remove `requiresInitialBuild` and make `shouldServe()` optional for v2 Builders

`@now/next` will be removing `shouldServe()` in favor of returning
a `routes` config array upon bootup. This makes now dev's
`shouldServe()` wrapper function support matching a `routes` config
entry when `shouldServe()` is not defined.

* Remove `console.error()` debugging calls

* Remove `mergeRoutes()` logic

This was incorrect behavior, and more like what `continue: true` is
supposed to do.

* Remove invalid test case

* Remove from the `files` array when ENOENT occurs in file watcher

* Prettier

* Pass workPath to builder.shouldServe() (#2211)
2019-04-23 13:14:19 +02:00
Amio
d7a72a92f2 Support env NOW_BUILDER_CACHE_DIR for debugging builders (#2212)
* Support env NOW_BUILDER_CACHE_DIR for debugging builders

* resolve NOW_BUILDER_CACHE_DIR
2019-04-23 15:25:05 +08:00
Nathan Rajlich
6338809487 [now dev] Resolve built routes after matching builder (#2208)
* [now dev] Resolve built routes after matching builder

This removes the `combineRoutes()` function since it was problematic and
triggered rebuilds upon every HTTP request, which is not necessary and
makes development slower.

Now, when an HTTP request comes in, the `now.json` routes are resolved
first, and then the matched build is checked if it defines any `routes`
in the build output. If it does, and a matching route is found then the
route is handled accordingly.

* Fix dev router unit tests

* Only try to match build routes if `.length > 0`

* Remove `routes` config from `@now/static` build results

This would cause an infinite loop of resolving `entrypoint` to
`entrypoint`, and is not necessary for this builder.
2019-04-22 15:39:25 -07:00
Leo Lamprecht
68408df4d6 Initial build should set requestPath to null (#2200)
* Initial build should set `requestPath` to `null`

* Fixed types

* Fixed type
2019-04-22 20:29:49 +02:00
Nathan Rajlich
7266a97b54 [now dev] Fix typo in debug log (#2206)
Also switch to present-tense wording.
2019-04-22 10:28:08 -07:00
Amio
808038160f [now-dev] make routes from v2 builders optional (#2204) 2019-04-22 15:49:41 +08:00
Leo Lamprecht
994b01719e Better name for continuous property (#2199) 2019-04-21 20:29:47 +02:00
Leo Lamprecht
6e6330bf07 Prevent exit if client closes proxy connection (#2198) 2019-04-21 18:46:57 +02:00
Leo Lamprecht
f8b4958986 15.0.7-canary.2 2019-04-20 00:19:11 +00:00
Leo Lamprecht
b7530d494c Match only the important part while routing (#2195) 2019-04-20 02:19:00 +02:00
Leo Lamprecht
e6aed4bd71 15.0.7-canary.1 2019-04-19 22:11:09 +00:00
Amio
57d6723adb Made sure support for routes works as expected (#2194)
* Fix lost concat result

* Made it work

* Fixed several tests

* Fixed more tests

* Fixed tests
2019-04-20 00:09:00 +02:00
Amio
c0ee3f071e Added support for routes (#2191)
* Add types for updated builder v2 api

* Fix type errors

* outputs => output

* Combine builder routes before routing

* Combine builder routes for all v2 builders

* [temporarily] reveal logs from builder

* Revert "[temporarily] reveal logs from builder"

This reverts commit 9dac764f33d96b5fd004e0839b41228786f83d14.
2019-04-19 16:28:39 +02:00
Amio
54cfe2e99e Reveal builder logs when --debug (#2193)
And added a `debug` flag to `DevServer` class
2019-04-19 21:57:01 +08:00
Andy Bitz
25f6cb7522 15.0.5-canary.5 2019-04-18 15:08:24 +02:00
Andy
0a69920b3f Show all aliases instead of just the first one (#2188) 2019-04-18 15:06:35 +02:00
Andy
adad86401f Now CLI gets a fixed alias (#2189) 2019-04-18 14:56:09 +02:00
Nathan Rajlich
6b3a5880b1 [now dev] Reuse the same workPath for subsequent builds (#2185)
* [now dev] Reuse the same `workPath` for subsequent builds

Reusing the same `workPath` for subsequent builds makes rebuilding
faster, as well as it's necessary for webpack's watcher to work
correctly as it relies on the full filesystem paths being intact.

`prepareCache()` also no longer needs to be invoked, since the
previous `workPath` directory will already contain the necessary files
that the cache would otherwise produce.

* Prettier
2019-04-18 11:57:23 +02:00
Nathan Rajlich
de4e340338 [now dev] Don't trigger a rebuild if an asset was deleted (#2184)
* [now dev] Don't trigger a rebuild if an asset was deleted

This handles the case where an asset was deleted and should no longer be
served after a filesystem watcher event. For example, if a Next.js page
was previously built and the files was deleted from the `pages`
directory, then the rebuild should not happen since it will fail in the
`build()` function anyways.

* Add `config` to `shouldServe()`

* Remove unused `builder` var
2019-04-17 21:25:08 -07:00
Andy Bitz
c10519acc2 15.0.5-canary.4 2019-04-17 23:36:33 +02:00
Andy
dfb4e8921a Show a upgrade message if the build limit is exceeded (#2182)
* Show a upgrade message if the build limit is exceeded

* Typo

* Update src/commands/deploy/latest.js

Co-Authored-By: AndyBitz <AndyBitz@users.noreply.github.com>
2019-04-17 23:34:00 +02:00
Andy Bitz
6e51e5db30 15.0.5-canary.3 2019-04-17 20:32:14 +02:00
Andy
7a9e12affa Show the domain purchase UI (#2168)
* Show the domain purchase UI

* Show the correct error message

* Exit after the domain purchase
2019-04-17 20:27:54 +02:00
Andy
011d41af57 Add tests for the new automatic aliasing in the v9 API (#2180)
* Add tests for the new automatic aliasing in the v9 API

* Show a more descriptive message

* Await sleep

* Add sleep to test

* Decrease sleep
2019-04-17 19:27:07 +02:00
Amio
469e8c0505 Add some debug logs for now-dev (#2181)
* Add some debug logs

* Fix eslint warnings
2019-04-17 18:06:21 +02:00
Duncan
d59bc07b89 Fix batch file command to work from paths with spaces. (#2144)
Fixes #2413.
2019-04-17 10:56:42 +02:00
Nathan Rajlich
e7d101c37e [now dev] Handle filesystem events where the file has already been deleted (#2179)
Editors like `vim` like to use temporary files in the file's working
directory and quickly rename / delete them. This makes `now dev` handle
that gracefully and not crash.
2019-04-16 21:22:42 -07:00
Andy Bitz
b0f83bd1a0 15.0.5-canary.2 2019-04-17 01:25:30 +02:00
Andy
9016f25504 Bump @zeit/nsfw to 2.0.2 (#2178) 2019-04-17 01:09:08 +02:00
Andy
02134807d8 Use the v9 deployments API (#2176) 2019-04-17 00:39:41 +02:00
Nathan Rajlich
fb4da34562 [now dev] Default the Content-Type to "application/octet-stream" (#2177)
This matches the behavior in production, so it is more correct.

This new common `getMimeType()` function also centralizes a place where
we can overwrite the `mime-types` return value to other values to match
production for other future discrepancies.
2019-04-17 00:14:47 +02:00
Leo Lamprecht
0da322560c 15.0.5-canary.1 2019-04-16 19:51:14 +00:00
William Li
4aece1395e [BUG-FIX] team invite ignored scope error (#2140)
* expose teams command to --scope change, fixes #2139
2019-04-16 19:51:00 +00:00
Leo Lamprecht
cc06b39905 15.0.4-canary.8 2019-04-16 19:09:17 +00:00
Amio
de9eebdf76 Mute install logs from @now/node builder (#2171)
* [wip] Mute install logs from @now/node builder

* Bumped build utils
2019-04-16 21:07:40 +02:00
Nathan Rajlich
db1af88681 Pass filesChanges and filesRemoved array to builder's build() (#2174)
This will be required to implement the `@now/node` ncc watcher logic.
2019-04-16 20:24:45 +02:00
Nathan Rajlich
7979110f2b Added file watcher to now dev (#2153)
* [now dev] Add `nsfw` file watcher

WIP for triggering background rebuilds. So far the `files` mapping is
now kept in sync via the events produced by `nsfw`.

* Add `now.json` caching and invalidation from nsfw events

* Add initial rebuilding logic from filesystem watching

* Remove previously built assets when a rebuild occurs

* Make `@now/static` not require a hard refresh

* Shut down the `nsfw` instance when stopping the DevServer

* Prettier and some minor tweaks

* Ship module

* Support private deps

* Fixed tests

* Fixed integration tests

* Revert "Support private deps"

This reverts commit 0b4991b87641d693fa61f81223e0efc2b7006f83.

* Support multiple platforms

* Typed

* Consider Alpine

* Bumped @zeit/nsfw to latest version

* Update src/commands/dev/lib/nsfw-module.ts

Co-Authored-By: leo <mindrun@icloud.com>

* Pass module path differently

* Bumped package

* Make binary executable

* Wait until piping is complete

* Added debug statements
2019-04-16 20:13:15 +02:00
Amio
9a81b5a598 Enable '@typescript-eslint/no-unused-vars': 'warn' (#2172)
* Enable '@typescript-eslint/no-unused-vars': 'warn'

* Clean comments
2019-04-16 20:07:37 +02:00
Nathan Rajlich
23d44347ac Enable source maps for development builds of now-cli (#2170)
If you run `yarn build-dev`, then now source maps are enabled, allowing
us to see the proper line of an error in the source code file instead of
the huge `dist/index.js` file.

Previously they were only enabled for production builds.
2019-04-15 18:27:59 -07:00
Ana Trajkovska
6f2526a75a 15.0.4-canary.7 2019-04-15 22:54:42 +02:00
Ana Trajkovska
2bd4341c07 Handle additional errors when issuing a certificate (#2165)
* Handle additional errors when issuing a certificate

* Rename errors

* Provide more context in CertsDNSError

* Fix CertsDNSError structure

* Display cns with join

* Fix CertsDNSError
2019-04-15 22:47:42 +02:00
Nathan Rajlich
2f3581fe1c [now dev] Add host property to the invoke payload (#2164)
Fixes https://github.com/zeit/now-builders/issues/390.
2019-04-14 15:40:07 -07:00
Nathan Rajlich
6ddb7246d8 [now dev] Use empty version string for @now/static (#2159)
This is just a cosmetic fix so that "vbuilt-in" isn't printed when
`--debug` is enabled.
2019-04-13 14:19:25 -07:00
Nathan Rajlich
ce2773491a 15.0.4-canary.6 2019-04-12 16:16:46 -07:00
Nathan Rajlich
614b9c412a [now dev] Don't run every build when a v1 builder is detected (#2151)
Before this, if a v1 builder was detected then every build match was
built instead of only the matches that use a v1 builder.
2019-04-12 12:00:51 -07:00
Nathan Rajlich
2dfd4e84e1 [now dev] Fix index-based asset lookup logic (#2138)
There was a bug in the index lookup logic such that `GET /404` would be
matching the `/index.*` file. Fixed in this commit.
2019-04-11 18:50:54 -07:00
Leo Lamprecht
0f74a0695c 15.0.4-canary.5 2019-04-11 11:10:37 +00:00
Nathan Rajlich
e85c416d01 [now dev] Refactor to support shouldServe() in Now Builders (#2134)
* WIP refactor to Now Builders v2 API

* More WIP

* Finish up refactor

* Remove `BuiltAsset` type

These properties are on the the `BuildMatch` interface now.

* Fix `handle: filesystem` route post-refactor

* Prettier

* Update src/commands/dev/lib/builder-cache.ts

Co-Authored-By: leo <mindrun@icloud.com>
2019-04-11 13:10:27 +02:00
Leo Lamprecht
6ac63baaa5 15.0.4-canary.4 2019-04-11 10:52:41 +00:00
Amio
96c630b27c Improve eslint config (#2042)
- Get `.ts` files covered 🎉
- Update eslint related dependencies
- Add typescript-eslint [recommended rules](3e26ab684a/packages/eslint-plugin/src/configs/recommended.json), but only enabled ones we already followed, commented ones causing errors.

Commented rules including:

```yaml
  # '@typescript-eslint/no-unused-vars': 1
  # '@typescript-eslint/indent': ['error', 2]
  # '@typescript-eslint/array-type': error
  # '@typescript-eslint/ban-types': error
  # '@typescript-eslint/explicit-member-accessibility': error
  # '@typescript-eslint/member-delimiter-style': error
  # '@typescript-eslint/no-angle-bracket-type-assertion': error
  # '@typescript-eslint/no-explicit-any': warn
  # '@typescript-eslint/no-object-literal-type-assertion': error
  # '@typescript-eslint/no-use-before-define': error
  # '@typescript-eslint/no-var-requires': error
  # '@typescript-eslint/prefer-interface': error
```

### TODO

Go through these commented rules one by one, enable & fix for it or confirm it's disabled. Since enabling some rules would cause massive code change (like `'@typescript-eslint/indent': ['error', 2]`), which might conflict with our ongoing development, we better do this in separated PRs.
2019-04-11 17:29:54 +08:00
Mark Glagola
ff353a264e Handle CAA cert conflict error (#2121)
* Handle CAA cert conflict error

* Fixed error description

* using output.success instead of console.log(...)

* Revert "using output.success instead of console.log(...)"

This reverts commit 2db9a834f3d22ec2da7c692b0e67ea2863078489.
2019-04-10 15:37:59 -05:00
Leo Lamprecht
45097563f0 15.0.4-canary.3 2019-04-10 20:24:31 +00:00
Leo Lamprecht
12370a8033 Add a note about the CDN always being enabled (#2133)
* Revert "Stop indicating whether CDN is enabled (#2132)"

This reverts commit 3dda3e84bf.

* Add a note about the CDN always being enabled

* Removed useless flag

* Added correct table heading
2019-04-10 22:24:14 +02:00
Leo Lamprecht
d1c67b013b 15.0.4-canary.2 2019-04-10 20:02:03 +00:00
Leo Lamprecht
3dda3e84bf Stop indicating whether CDN is enabled (#2132) 2019-04-10 20:47:42 +02:00
Leo Lamprecht
a1a85732d4 15.0.4-canary.1 2019-04-10 17:20:35 +00:00
Leo Lamprecht
bc4a2c8dce Print full validation error message (#2131)
* Print full validation error message

* Shortened second message

* Updated latest pipeline too
2019-04-10 19:19:40 +02:00
Mark Glagola
f22c288bf4 fixes certs rate limited cns arg (#2130) 2019-04-10 11:27:48 -05:00
Amio
37a63e1c70 Bump ava to 1.4.1 (#2128) 2019-04-10 23:55:12 +08:00
Mark Glagola
0c50c5a1a6 15.0.3-canary.6 2019-04-10 10:50:26 -05:00
Mark Glagola
f2c487162f Handle unsupported tld purchase (#2129) 2019-04-10 10:50:10 -05:00
Nathan Rajlich
430696f486 [now dev] Add logging of the builder package versions (#2125)
* [now dev] Add logging of the builder package versions

To aid in debugging errors reported by users.

* Remove bad
2019-04-09 18:50:11 -07:00
Mark Glagola
2426547762 15.0.3-canary.5 2019-04-09 17:21:11 -05:00
Mark Glagola
e877467a98 Fix getCertsById + handle cert not found by id error (#2101)
* fix certs delete + handle not found error

* Converted rm.js -> rm.ts
2019-04-09 17:17:57 -05:00
Nathan Rajlich
060c3de74e [now dev] Add build de-duping for the lazy initial builds case (#2124)
This is the same de-duping logic that occurs when you hard refresh,
but the unbuilt case was still not being considered. This fixes clicking
on an unbuilt link more than once from triggering multiple builds of the
same asset.
2019-04-09 10:07:56 -07:00
Nathan Rajlich
4c297d2ab4 15.0.3-canary.4 2019-04-07 21:59:44 -07:00
Nathan Rajlich
53ccc9e02b [now dev] Update @now/build-utils to v0.4.40 (#2119) 2019-04-07 21:50:45 -07:00
Nathan Rajlich
477b30583e [now dev] Update @now/build-utils to v0.4.40-canary.0 (#2118) 2019-04-07 19:58:35 -07:00
Nathan Rajlich
315bbbe25e 15.0.3-canary.3 2019-04-07 15:18:16 -07:00
Nathan Rajlich
62cc84fc9a [now dev] Add handle: filesystem support (#2116) 2019-04-07 15:17:54 -07:00
Nathan Rajlich
e28bf1152c [now dev] Run npm update to get builder updates (#2117) 2019-04-07 15:13:21 -07:00
Leo Lamprecht
9519b3b0e7 15.0.3-canary.2 2019-04-07 13:49:10 +00:00
Mark
b7462211e6 Update @zeit/ncc to v0.17.4 (#2107) 2019-04-07 15:47:56 +02:00
Nathan Rajlich
13d447a81b [now dev] Run prepareCache() asynchronous (#2105)
* [now dev] Run `prepareCache()` asynchronous

And also wait a few seconds before running the actual logic,
since the `prepareCache()` function may be computationally expensive,
and its run in the same process as `now dev` (for now), so allow
some time for the current HTTP request to complete.

* Add symlinks support to `glob()`, instrument prepareCache time
2019-04-07 15:47:40 +02:00
Nathan Rajlich
049d6e61df [now dev] Invoke prepareCache() from Builders (#2104)
If a builder defines the `prepareCache()` function, then it gets invoked
after `build()` has completed to set up the initial build state of the
next build for this same asset.

For example, the goal for `@now/node` if the package.json has not
changed is to have yarn produce the "Already up-to-date" message on the
next build, because installing dependencies ends up taking a long time
on bigger projects.
2019-04-05 20:26:44 -07:00
Andy Bitz
482aba0c45 15.0.3-canary.1 2019-04-05 23:57:37 +02:00
Andy
f9a931dbd2 Exit if assigning an alias failed while deploying (#2103)
* Error if aliasFinal is an empty array

* Return if alias assignment failed
2019-04-05 23:53:05 +02:00
Leo Lamprecht
ec376e272d 15.0.2-canary.5 2019-04-05 13:37:09 +00:00
William Li
c13d250577 Don't forget to do a yarn install before linking (#2094) 2019-04-05 13:37:04 +00:00
Joe Haddad
c372f1b66b 15.0.2-canary.4 2019-04-04 20:59:24 -04:00
Nathan Rajlich
bd1aa229e3 [now dev] Use a different workPath for every build (#2100)
This is more inline with how a fresh Now deployment works, where
is has to download fresh files each time. This will also fix the issue
with `@now/next` that deleted the `.next` output dir and deleting static
files upon subsequent builds.

This is still a bit unoptimized because `prepareCache()` from the
builder is not yet being invoked, but it's still more correct than
reusing the `workPath`.
2019-04-05 02:21:59 +02:00
Leo Lamprecht
1819c69de5 15.0.2-canary.3 2019-04-05 00:19:55 +00:00
Nathan Rajlich
4fb043c46a Ignore .env and .env.build for deployments by default (#2083)
Because `now dev` uses these dotenv files to define the Now secrets to
use, it would be bad practice to include them in the deployment files
since they will be using development values instead of production values.
2019-04-05 02:11:08 +02:00
Nathan Rajlich
4995318418 [now dev] Clean up dev-router a bit (#2099)
* [now dev] Clean up `dev-router` a bit

This is a follow up to #2095 to move the `resolveRouteParameters()`
funcrtion to the top-level and other slight optimizations like not
re-parsing the URL multiple times.

* Remove unused `qs` import
2019-04-04 15:05:18 -07:00
Nathan Rajlich
6eaf6ecd14 [now dev] Remove now dev cache clean (#2097) 2019-04-04 14:36:05 -07:00
William Li
822971fc7d [now dev] Apply route params to headers (#2095)
* version bump (canary)

* inject paramters into headers.Location fixes #2092

* refactored route parameter resolving function

* Revert "version bump (canary)"

This reverts commit 5857489ceffcbcce07eb6e5d6fcc20279d0ba5fd.

* Update src/commands/dev/lib/dev-router.ts

Co-Authored-By: williamli <email@williamli.dev>

* refactor headers resolution

* try to resolve all parameters inside each child of headers
2019-04-04 13:33:04 -07:00
Nathan Rajlich
fb48402f87 [now dev] Set the same MemorySize on the lambdas as production (#2096)
This should fix https://spectrum.chat/zeit/now/now-dev-javascript-heap-out-of-memory~3fd6e823-59de-426b-ade0-af48d18f3494
2019-04-04 12:25:07 -07:00
Nathan Rajlich
fd241c1e85 Remove 'output logs of a 1.0 deployment' integration test (#2085)
This test is very flaky causing us to constantly restart CircleCI jobs
in order to do releases of `now-cli`. Considering that it's testing the
1.0 pipeline, let's just remove this one to make life easier.
2019-04-04 12:14:42 -07:00
Nathan Rajlich
a3fc36e573 [now dev] Fix the requestPath for the hard-refresh case (#2086)
This passes in the resolved `assetKey` instead of `req.url` to the
builder `requestPath` when a hard-refresh is requested, allowing the
proper single-page rebuild to happen.
2019-04-03 18:37:47 -07:00
Nathan Rajlich
402b4d3457 15.0.2-canary.2 2019-04-03 17:41:19 -07:00
Nathan Rajlich
62625df203 [now dev] Fix subscription resolving logic (#2082)
* [now dev] Fix subscription resolving logic

Strip the leading `/` since the builder outputs don't have one, match
index routes, and pass the resulting subscription key to the builder.

* Fix `index` matching

* Update `@now/build-utils` to v0.4.39-canary.0

* Update `@now/build-utils` to v0.4.39
2019-04-03 17:39:14 -07:00
Leo Lamprecht
658c220c85 15.0.2-canary.1 2019-04-03 11:02:43 +00:00
Leo Lamprecht
4190a6bfbc Revert "[now dev] Less verbose "listening" message (#2062)"
This reverts commit a3f4c6290d.
2019-04-03 10:57:09 +00:00
Nathan Rajlich
7aea928a5a [now dev] Respond with 404 once the server is shutting down (#2070)
In the case of a keep-alive connection from the web browser, and a page
continuing to send HTTP requests to the dev server, sometimes the server
never shuts down. So send a 404 response with `Connection: close` to
force the web browser to close the connection.
2019-04-03 12:55:11 +02:00
Nathan Rajlich
58d4326511 [now dev] Add support for Builder "subscriptions" (#2071)
If the builder has a `subscribe()` function, then the initial
builds are not run and instead an array of "subscriptions" is
created. When an HTTP request comes in that matches one of the
subscription patterns, then this builder will be actually be
executed.
2019-04-03 12:53:35 +02:00
Nathan Rajlich
f7b782440a [now dev] Pass meta object to Builders' build() function (#2069)
This introduces a new object called `meta` that gets passed to the
Now Builders' `build()` function. The `isDev` property is moved to
this object, and a new property `requestPath` is also introduced.

`requestPath` represents the URL that was requested to trigger the
`build()` to be called. It may be used by builders to do incremental
compilation and only re-build the assets related to the URL that was
requested. For example, `@now/next` may use this property to only build
the page that was requested.
2019-04-02 18:53:06 -07:00
Nathan Rajlich
17422184e4 Update pcre-to-regexp to v0.0.5 (#2068)
For `now dev`, this fixes an edge case in named capture groups
in some `routes` definitions that would lead to an error being thrown:

```
Cannot read property '1' of null
```

Also ignoring "handler" routes for now.
2019-04-02 15:32:47 -07:00
Nathan Rajlich
c765e7efbb Update @zeit/ncc to v0.17.3 (#2058) 2019-04-01 15:55:02 -07:00
Nathan Rajlich
a3f4c6290d [now dev] Less verbose "listening" message (#2062)
* [now dev] Less verbose "listening" message

* Add "Listening on"

* Use "Running at"
2019-04-01 14:57:21 -07:00
Leo Lamprecht
c0cd13abcd 14.3.0-canary.27 2019-04-01 15:41:08 +00:00
Nathan Rajlich
6fab380cd9 [now dev] Update bootup message (#2056)
This looks a bit cleaner since the user just typed `now dev` into their
CLI so no need to print the same command again.
2019-04-01 08:18:00 -07:00
Nathan Rajlich
3732f89362 Update @now/build-utils to v0.4.38 (#2055) 2019-04-01 16:58:23 +02:00
Nathan Rajlich
e25388066d 14.3.0-canary.26 2019-03-31 23:56:49 -07:00
Nathan Rajlich
a7f823609d [now dev] Add support for .env and .env.build file to define Now secrets (#2048)
* [now dev] Add support for `.env` file to define Now secrets

If a `now.json` files relies on secret env vars, then they must be
defined in the user's local `.env` file otherwise `now dev` exits with
an error.

* Prettier

* Fix multi-line error output

* Use `code()` to format the dotenv file name

* Add "file" to error message for clarity

* Use `hasOwnProperty()` instead of `in`

* Apply `build.env` vars during builder `build()` invocations

Fixes #2046.
2019-03-31 23:54:12 -07:00
Nathan Rajlich
f9362a1e53 Update @zeit/fun to v0.6.0 (#2049) 2019-03-31 23:17:24 -07:00
Nathan Rajlich
7a9d5e646f 14.3.0-canary.25 2019-03-31 13:38:05 -07:00
Nathan Rajlich
1108daa8ed [now dev] Use cyan for link color
Blue is hard to read on terminals with a black background.
2019-03-31 13:29:21 -07:00
Nathan Rajlich
d59de91fd6 [now dev] Add build deduping (#2044)
Consider the scenario where an HTML asset is built and references other
files that were produced by the build (CSS/JS/img/etc. files). The build
will happen and then the HTML page will be served, and then the browser
will request the assets on the page also with the `no-cache` header,
which would cause a second build right after the first one completed,
which is bad DX and unnecessary.

This commit introduces "build deduping logic" so that this scenario is
avoided by doing two things:

1. Not allowing the same entrypoint to be built at the same time (so if
   a concurrent request happens for an asset that was produced by the same
   entrypoint, the subsequent requests will wait on the already running build
   instead of triggering a new one in parallel.

2. Not allowing an asset to be rebuilt if the previous build completed
   less than two seconds ago. This is to catch the scenario where the
   HTML page is served and the browser quickly requests the assets on
   the page to avoid triggering a second rebuild.
2019-03-31 13:28:26 -07:00
Nathan Rajlich
0cfc31f4ad [now dev] Set the Now proxy and response headers (#2041)
* [now dev] Set the Now proxy and response headers

* Add `X-Real-IP` proxy header

* Set any headers defined in the matched `route` config

* Apply @amio's suggestions
2019-03-31 12:56:40 -07:00
Nathan Rajlich
e1df47dedc [now dev] Send INTERNAL_LAMBDA_NOT_FOUND (#2039)
This is mostly to appease TypeScript since `fn` is an optional prop,
but this shouldn't really ever happen since we run the builds before
responding to HTTP requests.
2019-03-30 18:26:30 -07:00
Nathan Rajlich
b6e4e0d670 [now dev] Use the Output helper (#2038)
* [now dev] Use the `Output` helper

For more consistent logging / styling with the other `now` commands.

* Put `setStatusError()` back
2019-03-30 18:25:22 -07:00
Andy Bitz
5d0338a278 14.3.0-canary.24 2019-03-29 23:01:31 +01:00
Andy
57aad64c23 Group builds with similar paths together to reduce the output (#2015)
* Group builds with similar paths together to reduce the output

* Style the new output

* Ensure space between state and time

* Update src/util/output/builds.js

Co-Authored-By: AndyBitz <AndyBitz@users.noreply.github.com>

* Add comma between ready states

* Tell what is hidden

* Change builds and items
2019-03-29 22:59:27 +01:00
Amio
743db0d265 Refine test jobs (#2028)
- Include `.ts` extension
- Include all `test/*unit.js` (`test-unit` task)
- Make coverage reporting a separate job in circleci config
2019-03-29 20:13:38 +08:00
Nathan Rajlich
a96a3c6623 14.3.0-canary.23 2019-03-28 19:02:49 -07:00
Nathan Rajlich
60c17953c9 [now dev] Send the NO_STATUS_CODE_FROM_LAMBDA upon lambda error (#2037) 2019-03-28 18:01:56 -07:00
Nathan Rajlich
2068de722c [now dev] Fix the path provided to lambda invocations (#2036)
This matches how the Now proxy invokes the lambdas, where the route
`dest` query params are mixed-in to the provided `req.url`, with the
dest query params taking precedence over any conflicting user-provided
query params.
2019-03-28 15:55:02 -07:00
Leo Lamprecht
33d86505e8 14.3.0-canary.22 2019-03-28 22:11:03 +00:00
Leo Lamprecht
2a52d04064 Made aliases clickable after assigning (#2035)
* Made aliases clickable after assigning

* Set in correct place

* Fixed URL

* Attached alias

* Added missing https
2019-03-28 22:54:07 +01:00
Nathan Rajlich
7911bc6aea Add output to DevServer class (#2034) 2019-03-28 22:22:53 +01:00
Nathan Rajlich
733d908c89 [now dev] Listen on the next available port when requested port is taken (#2032)
Fixes #2024.
2019-03-28 21:53:58 +01:00
Leo Lamprecht
798ea44c60 Adjusted aliasing error message to match server (#2030)
* Adjusted aliasing error message to match server

* Correctly escape
2019-03-28 21:19:48 +01:00
Leo Lamprecht
08d4a3759b 14.3.0-canary.21 2019-03-28 13:06:13 +00:00
Nathan Rajlich
b29f602ce9 [now dev] Use pcre-to-regexp to match routes (#2027)
* [now dev] Use `pcre-to-regexp` to match `routes`

The now.json `routes` support PCRE syntax like named captures,
so use the `pcre-to-regexp` module to match the routes.

Fixes #2023.

* Pass the resolved router `dest` and query params to the Lambda
2019-03-27 18:37:43 -07:00
Nathan Rajlich
09c8144f31 [now dev] Centralize error responses logic (#2026)
This just DRYs up the code a bit and centralizes the error sending logic
so that we can more easily add the HTML and JSON versions of the
responses as well.
2019-03-27 17:29:11 -07:00
Nathan Rajlich
b3bd8c5929 [now dev] Don't add .gitignore to the ignore list (#2025)
`.gitignore` is not respected anymore for Now v2, so this was a bug.

Also removes `ncc` and `user` from the ignore list, since that issue was
fixed a while back as well.

Fixes #2021.
2019-03-27 12:32:50 -07:00
Julian Gruber
99790b1560 14.3.0-canary.19 2019-03-27 13:58:24 +01:00
Julian Gruber
31441e8890 Fix the handling of unexpected user errors (#2022)
* fix unexpected `DNSConflictingRecord`

* fix unexpected `EBADF`

* fix unexpected `InvalidDeploymentId`

* fix unexpected `InvalidDomain`

* fix unexpected `DomainNotFound`
2019-03-27 13:34:22 +01:00
Nathan Rajlich
f693acbaa9 14.3.0-canary.18 2019-03-26 18:12:38 -07:00
Amio
c1548a8cbb Add now dev (#1883)
* [WIP] now-dev

* try invoking lambda

* add error status to dev-server

* add basic routing

* add entry for custom @now/static builder

* honor .gitignore & .nowignore while collecting files

* add route for single static file

* add test fixtures for now-dev (nodejs)

* fix miss typed @now/statics

* import types from @now/build-utils

* fix typo @now/statics -> @now/static

* revamped router

* typescript-eslint-parser -> @typescript-eslint/parser

Eliminate error while running pre-commit hooks:

  SUPPORTED TYPESCRIPT VERSIONS: ~3.1.1
  YOUR TYPESCRIPT VERSION: 3.2.2

* send files from local @now/static builder

* use serve-handler when no now.json

* remove http-proxy

* add type def for serve-handler

* code cleanup

* move type declarations to types.ts

* dont rely on `this.cwd` while running builder

* more type definitions

* fix invoking error

* clean code

* better debug logging

* refined request handler logic

* handle /favicon.ico with serve-handler

* make builder-cache self contained

* move builder works to dev-builder.ts

* add proxy_pass handler

* support named groups in routes

* fix creating cache dir error

* add "--nodejs-preview" solely for nodejs

* clean require.cache after required user js

* fix router & header issue in nodejs preview

* [wip] add tests for dev-router

* add tests for dev-router

* lookup "/index.*" for indexes

* refine logging

* [WIP] `now dev` progress point

Actually invoking the `@zeit/fun` module at this point.

Still lots of work to be done…

* Update `@zeit/fun` to v0.0.4

* Remove `--nodejs-preview`

To be replaced by `@zeit/fun`.

* Remove `decache` and `import-fresh`

Leftover from the `--nodejs-preview`.

* Remove "declaration: true" from `tsconfig.json`

Otherwise the ncc `dist` dir ends up full of generated `.d.ts` files.

* Remove `ignore` dep, always use `@zeit/dockerignore`

* Use tarball URL for `@zeit/fun`

Because `@zeit/fun` is not yet public on npm.

* Regenerate `yarn.lock` to fix bad integrity check on fun tarball

* Upgrade to `@zeit/fun` v0.0.6

With re-written unzipping logic utilizing `yauzl`.

* Add lambda function handling logic for the HTTP response

* Match the lambda invoke shape that Now's proxy provides

* Move deps to devDependencies

* Update `@zeit/fun` to v0.0.8

* Update `@zeit/ncc` to v0.15.0

* Attempt to fix unit test for `wait()` helper function

* Add `build.sh` script to work around ncc issues

* Fix `build.sh` script for BSD's chmod

No `--changes` flag.

* Update `@zeit/fun` to v0.0.11

* Update `@zeit/fun` to v0.0.12

* Tweak some comments

* Update `@zeit/fun` to v0.0.13

* Add `now.json` env vars to lambda functions

* Finish removing `--nodejs-preview` flag

* Style tweaks

* Use `npm-package-arg` to parse the "use" builder

* Styling

* Use the parsed `pathname` when matching routes

The querystring portion needs to be removed to match properly.

* Update `@zeit/fun` to v0.1.1

* Support `-d` for debug flag

It was already listed as such in the `--help` output.

* List the `dist/runtimes` dir as pkg "assets"

* Update `@now/build-utils` to v0.4.37-canary.0

* Update `@zeit/fun` to v0.2.0

* Update `@zeit/fun` to v0.2.1

* Rewrite the `req.url` to fix serving FileFsRef assets

* Disable re-building, build all `builds` upon server bootup

* 404 is not a redirect

* warning on more than one argument

* Fix `index` without a file extension matching

* Update `@zeit/fun` to v0.2.2

* Use `async-listen`

* Add shutdown cleanup logic

* Rename `buildLambdas()` to `executeBuilds()`

* Rename `lambda` prop to `fn`

* Misc tweaks

* Pass `isDev: true` to the builder `build()` function

* Use `Object.assign()` instead of object spread

* Set `res.statusCode` instead of `writeHead()`

* Create Lambda functions during build-time

This way, the lambda instance is re-used for subsequent HTTP requests

* Wait for cleanup operations to complete in `stop()`

* Destructure `path` for join()

* Add some missing types

* Store the `buildConfig` on the assets for reverse lookup

* Remove `console.log()`

* Attempt to make globbing faster and ignore files more accurately

* Rewrite `installBuilders()` to be idempotent

So that npm is not executed for canary tags, for example.

This is done by comparing the contents of the package.json file rather
then the `node_modules` directory.

* Use `ignore` instead of `@zeit/dockerignore` for glob-gitignore

It seems that the object produced by `@zeit/dockerignore` is not
compatible with the `glob-gitignore` module, so use the vanilla
`ignore` module instead for now as a workaround.

* Implement a `GlobIgnore` class to replace `glob-gitignore`

This allows us to continue using `@zeit/dockerignore` for proper
consistency.

Closes #1899.

* Prettier

* Skip installing built-in builders (i.e. `@now/static`)

* Remove `console.error()` calls

* Use a deterministic `workPath` directory

So that the same one is re-used in-between subsequent boots of `now dev`

* Add `now.json` validation logic

* Fix serving static assets outside the project working directory

This fixes, for example, `@now/mdx-deck` which outputs static files
from its build process.

* Add comment

* Validate the `now.json` file before launching the dev server

* Respect `maxLambdaSize` config

Closes #1950.

* Add `@types/bytes` dependency

* Make `maxLambdaSize` be optional

Co-Authored-By: TooTallNate <n@n8.io>

* WIP force reload in browser = rebuild asset behavior

* Resolve the `asset` again after re-build

* Remove logging

* Update `@zeit/fun` to v0.3.0

* Update `@now/build-utils` to v0.4.37-canary.1

Sets `npm_config_target` to the proper Node.js version for native
modules.

* Update `@zeit/fun` to v0.3.1

* Fix "hard refresh to reload" after the first rebuild

The `buildConfig` and `buildEntry` proper were not being set on the
rebuilt assets, causing the rebuild to only work the first time.

Now fixed.

* Add logic for the `now dev cache clean` command (#1977)

* Added the cache-clean command

* censer code :)

* Fix non-route match `dest` param

This makes the `go-image-to-ascii` work, since the query param URL gets
properly routed to the `/` route.

* Add support for `FileBlob` outputs

Fixes `@now/optipng`, `@now/html-minifier` and `@now/md` builders.

* Remove `console.error()` call

* Add `now dev cache clean` command

* Use the `assetKey` to look up the Content-Type on FileBlobs

Instead of the `fsPath` of the entrypoint file.

This fixes `@now/md` to return `text/html` Content-Type instead of
`text/markdown` which does not render properly in the web browser.

* Update `@zeit/ncc` to v0.16.1

Co-Authored-By: TooTallNate <n@n8.io>

* Regenerate `yarn.lock` file

* Remove leading `/` on build `src` specifications

* Use `rsync` to copy over all of `fun`'s runtime files

* Update `@zeit/fun` to v0.5.0

* Update `@zeit/fun` to v0.5.1

* try/catch the lambda invoke and send 500 upon error

* Add `rsync` to CircleCI build

* Convert `errors.js` to TypeScript to fix compilation errors

* Also accept `Cache-Control: no-cache` for rebuilding

* Prettier

* Update `@now/build-utils` to v0.4.38-canary.1

* Update `@zeit/ncc` to v0.17.0 (#2017)

* Install `@zeit/fun` from npm

* Remove `console.error()` call

Co-Authored-By: TooTallNate <n@n8.io>

* Create `NowError` subclasses

* Add `LambdaSizeExceededError`

* Return early if there's no builds
2019-03-26 16:47:35 -07:00
Julian Gruber
fc7a75cae2 Fixed GET /v3/now/certs (#2005)
* Fixed `GET /v3/now/certs`

- Limit the response size to 20 because the endpoint doesn't have a default limit
- If the id in `/v3/now/certs/{id}` isn't a valid id the endpoint responds with a set or certs instead
- The route `/v3/now/certs/{idOrCn}` isn't supported any more

* removed limit of 20, the endpoint was updated
2019-03-26 19:55:13 +01:00
Julian Gruber
adced907c9 Fixed the handling of user errors in legacy deploy command (#2006)
* fix disconnected promise chain in legacy deploy
* fix `size_limit_exceeded` in legacy
2019-03-26 19:54:32 +01:00
Julian Gruber
49ae9d43ad Fixed the handling of unexpected DeploymentFailedAliasImpossible (#2020) 2019-03-26 19:53:32 +01:00
Joe Cohen
b40ae12e63 fix typo on domains inspect (#2016) 2019-03-26 10:25:04 +01:00
Leo Lamprecht
0ae9fa8342 14.3.0-canary.17 2019-03-22 00:40:24 +00:00
Leo Lamprecht
833d0b293f Make deployments without builds work (#2004)
* Make deployments without builds work

* Added integration test

* Fixed test
2019-03-22 01:39:58 +01:00
Leo Lamprecht
ea9a870604 14.3.0-canary.16 2019-03-21 02:55:30 +00:00
Leo Lamprecht
c7e5427200 Only block deployment exit if not error (#2000) 2019-03-21 03:53:18 +01:00
Leo Lamprecht
96ddda0009 14.3.0-canary.15 2019-03-20 22:54:26 +00:00
Leo Lamprecht
635115f94b Only announce deployment as ready if alias is set (#1997) 2019-03-20 23:54:01 +01:00
Julian Gruber
9bb1d799d8 14.3.0-canary.14 2019-03-20 22:37:10 +01:00
Julian Gruber
eabd15092c Fixed the handling of user errors (#1989)
* Fixed duplicate `--local-config` option
* Fixed uncaught `ERRORS.DomainPermissionDenied`
* Fixed uncaught `ERRORS.DeploymentNotFound`
* Added arguments parsing errors to Sentry scope
* Fixed stale stream in `cleanup()` of `promptOptions()`
* Fixed uncaught `USER_ABORT`
* Fixed uncaught `ENOENT`
2019-03-20 22:36:17 +01:00
Leo Lamprecht
5e85389792 14.3.0-canary.13 2019-03-19 09:27:59 +00:00
Leo Lamprecht
42eb69bb95 Made -S short flag work properly (#1988) 2019-03-19 10:27:44 +01:00
Julian Gruber
09c9ff5ecd 14.3.0-canary.12 2019-03-18 18:38:38 +01:00
Julian Gruber
2678656f12 Add always report stdarg to Sentry (#1982)
Before this change, only if `user` or `team` could be read from
the scope would stdarg be reported to Sentry, however it's
completely unrelated to the existence of the former and is always
useful debugging information.
2019-03-18 18:36:57 +01:00
Julian Gruber
eb2a7b56b0 Fix the handling of user errors (#1984)
* fix `ms(null)` in `certs rm`

* fix uncaught `InvalidDomain`
2019-03-18 18:15:45 +01:00
Julian Gruber
f33329d396 Fix null pointer access in error reporting (#1983)
* fix null pointer access in error reporting

* refactor
2019-03-18 18:08:38 +01:00
Leo Lamprecht
7d7340bbfc 14.3.0-canary.11 2019-03-18 13:05:36 +00:00
Leo Lamprecht
0bf2115701 Make --scope take priority over scope (#1985) 2019-03-18 14:04:10 +01:00
Leo Lamprecht
0357bfdbaa 14.3.0-canary.10 2019-03-18 09:38:07 +00:00
Amio
52a76299c5 Add hint about -f in now init error message (#1971) 2019-03-17 23:14:44 +08:00
Leo Lamprecht
8de3151b8f 14.3.0-canary.9 2019-03-16 18:04:31 +00:00
Andy
2b3ceba353 Handle the DomainNotVerified error for deployments (#1973) 2019-03-16 19:04:13 +01:00
Leo Lamprecht
378274bc3f Warn of now alias was used (#1972)
* Warn of `now alias` was used

* Mention deploy command
2019-03-16 18:58:14 +01:00
Leo Lamprecht
c3145b0801 14.3.0-canary.8 2019-03-15 23:05:31 +00:00
Leo Lamprecht
5aca7dafec Improved deployment output (#1968)
* Prefix all aliases that are printed

* Pass local config

* Print if --target production is defined, but not alias prop

* Moved warning message
2019-03-15 23:58:32 +01:00
Julian Gruber
803b1ae91b Fix the handling of user errors (#1959)
* fix unexpected `size_limit_exceeded`

* fix unexpected `deployment_type_unsupported`

* fix unexpected `JSONError`

* check if err.sizeLimit exists
2019-03-15 22:17:33 +01:00
Julian Gruber
402c4e75a2 Added back sending process args to Sentry (#1966)
* add `process.argv` to Sentry, without sensitive data

* refactor using `arg` parser

* add secret alias support
2019-03-15 18:54:49 +01:00
Mark Glagola
7a1859d1dd 14.3.0-canary.7 2019-03-14 17:56:15 -05:00
Mark Glagola
927117d5db adds prompt when moving domain to team user is not member of (#1965) 2019-03-14 23:53:41 +01:00
Leo Lamprecht
837f433b5c Revert "Warning w/ prompt when moving to a destination the user is not a member of (#1961)"
This reverts commit 48451e3f81.
2019-03-14 22:32:53 +00:00
Leo Lamprecht
b5b18ffefe 14.3.0-canary.6 2019-03-14 19:45:59 +00:00
Mark Glagola
48451e3f81 Warning w/ prompt when moving to a destination the user is not a member of (#1961) 2019-03-14 20:39:51 +01:00
Leo Lamprecht
ec9e334f9a Improved output for deploy command (#1962)
* Make alias links clickable

* Make output print Ready instead of Success

* Fixed missing export
2019-03-14 20:39:32 +01:00
Leo Lamprecht
f646ddfc0f 14.3.0-canary.5 2019-03-13 21:21:43 +00:00
Leo Lamprecht
2102441cd0 Added warning message about files with no deployments (#1960)
* Added warning message about files with no deployments

* Added integration test

* Fixed charset of test
2019-03-13 22:21:25 +01:00
Julian Gruber
95149c3fe4 14.3.0-canary.4 2019-03-13 20:36:48 +01:00
Julian Gruber
0bfbd40810 Fixed the handling of user errors (#1958) 2019-03-13 20:30:15 +01:00
Julian Gruber
b3a70e980e Refactored flow error checks (#1953) 2019-03-13 20:24:56 +01:00
Leo Lamprecht
952c369646 14.3.0-canary.3 2019-03-13 14:25:41 +00:00
Leo Lamprecht
3effec0dd5 Soft-deprecate the --team flag (#1956)
* Soft-deprecate the `--team` flag

* Check for warning message

* Removed useless error
2019-03-13 14:08:11 +01:00
Amio /
2d563e1694 Added a deploy hint after now init. (#1952)
* [now-init] add a deploy hint after init

* add CODEOWNERS
2019-03-13 10:45:49 +08:00
Leo Lamprecht
e9ceac13b8 14.3.0-canary.2 2019-03-12 23:09:58 +00:00
Leo Lamprecht
06a0607287 Added --scope flag and scope config property (#1939)
* Added basics for new --scope flag

* Fixed usage information

* Fixed integration test

* Fixed usage information about whoami

* Brought back missing whitespace

* Do not push scope property to API

* Ensure we're only reading local config in one place

* Fixed build

* Added test

* Made scope from config work

* Correctly handle error

* Handle Now errors too when loading local config

* Removed NowError

* Revert "Removed NowError"

This reverts commit cfeebc65251d3eb07f9aeb3e548af1d23c00a18e.

* Fixed CI

* Fixed final bug

* Do not consider switch command

* Made it work as expected

* Added test

* Added yet another test for the scope property

* Added space
2019-03-13 00:09:43 +01:00
Leo Lamprecht
7e159646fb 14.3.0-canary.1 2019-03-12 19:36:01 +00:00
Leo Lamprecht
d2781430d3 Allow --target to be set to staging (#1955)
* Allow `--target` to be set to `staging`

* Properly format output

* Added clipboard support

* Send target to server

* Make target optional
2019-03-12 20:35:18 +01:00
Mark Glagola
1bb8c80342 Fallback to descriptive api error message if we cannot resolve domain rm|move conflict (#1951)
* On domain conflict error, use api error message & check resolvable flag

* Updated domain rm w/ attempt precaution

* smaller domain removal conflict construction
2019-03-12 14:14:07 -05:00
Julian Gruber
01e83247ee 14.1.0-canary.7 2019-03-12 19:05:35 +01:00
Julian Gruber
12653f97ad Fixed the handling of user errors
* fix unexpected `payment_error`

* fix unexpected `deployment_not_found`

* fix unexpected `not_authorized` and `team_deleted`

* make id optional in DeploymentNotFound
2019-03-12 19:04:13 +01:00
Mark Glagola
6bcb8651a0 14.1.0-canary.6 2019-03-08 09:53:23 -06:00
Mark Glagola
0071ca68be Adds alias removal warning on domains move (#1933)
* fixes double caret for domains move

* using output.success

* Adds alias removal warning to domains move
2019-03-07 09:43:38 -06:00
Mark Glagola
a89bbdfdf9 14.1.0-canary.5 2019-03-05 20:32:34 -06:00
Mark Glagola
c7bd599e16 Revised domains move flow (#1928)
* Revised domains move flow (rm move-in & move-out for move)

* fixed integration tests for domains move api changes

* handle immediate domain moves

* fixed list scopes integration test

* more integration test fixes
2019-03-05 18:32:41 -06:00
Andy Bitz
c66a5b580d 14.1.0-canary.4 2019-03-03 16:53:39 +01:00
Andy
f145b6a7d2 Overwrite the default batch file on windows (#1922)
* Overwrite the default batch file on windows

* Suppress echoing of the command
2019-03-03 16:48:18 +01:00
Leo Lamprecht
4337f0bab0 14.1.0-canary.3 2019-02-28 19:35:14 +00:00
Javi Velasco
6b37797de9 Add --no-scale option (#1918)
* Add no-scale option

* Reword --no-scale warning
2019-02-28 20:34:44 +01:00
Mark Glagola
1843ac4d31 Added warning for domains-move token expiration (#1916) 2019-02-27 17:24:22 -06:00
Mark Glagola
6399253318 14.1.0-canary.2 2019-02-27 15:47:38 -06:00
Mark Glagola
f3638fb871 Domain move-in & move-out implementation (#1906)
* Initial domain move-in & move-out implementation

* adjusted move apis

* domains move revisions based on API changes

* root domain func fix

* Minor copy fixes + added some integration test for move-in/out

* Handling move in|out conflict

* rm random quotes
2019-02-27 15:46:35 -06:00
Andy Bitz
dc88a310cb 14.1.0-canary.1 2019-02-27 19:36:23 +01:00
Andy
aea9bd4882 Added support for the --target flag (#1893)
* Add support for the target flag

* Show the given alias at the end

* Use the proper naming for the alias properies and include arrays

* Use the correct output

* Make sure that aliasFinal has properties
2019-02-27 19:33:27 +01:00
Olli Vanhoja
b69bb4346c Set verify-deployment-scale timeout to 5 minutes (#1915)
The current client side timeout is shorter than the backend
timeout.
2019-02-27 11:40:22 +01:00
Leo Lamprecht
9af6aa4ba3 14.0.1-canary.1 2019-02-25 20:42:49 +00:00
Leo Lamprecht
dff2704662 Prevent error in now inspect if no dest (#1913) 2019-02-25 21:33:22 +01:00
Mark Glagola
4849352b34 Using @types/psl typings + handling all potential error cases with psl (#1911) 2019-02-25 20:59:43 +01:00
Javi Velasco
87700d9ab9 Fix wrong error message (#1904) 2019-02-25 20:58:37 +01:00
Javi Velasco
c69c0fd915 13.2.0-canary.6 2019-02-10 18:07:34 +01:00
Mark Glagola
4c4d5c7baa Revised the way conflicts are handled when removing a domain (#1884)
* Revised the way conflicts are handled when rm domain

* agent.ts accepts absolute urls

* "delete" copy -> "remove" for consistency

* Revert "agent.ts accepts absolute urls"

This reverts commit 200158d06fcb80417f197910c40e364f8ea5abb2.

* using proper set custom suffix endpoint

* Reuse InvalidDomain error
2019-02-10 17:21:54 +01:00
Sergii Paryzhskyi
1e9d2cf9a0 Add a hint to an error message about missing token (#1877) 2019-02-10 17:21:27 +01:00
Steve Kaliski
5579aba636 fix typo in alias command (#1870) 2019-02-10 17:20:30 +01:00
Olli Vanhoja
c66ad6a60f Handle dns add 400 errors properly (#1867)
Currently 400 errors are left unhandled.
2019-02-10 17:20:03 +01:00
Mark Glagola
8e7f087a68 Handle domain rm attempt for an in progress transfer (#1880) 2019-02-06 23:42:19 +01:00
Mark Glagola
72142c32a1 Catch SourceNotFound error for domains transfer-in (#1879) 2019-02-06 21:51:50 +01:00
Javi Velasco
5999ec7acd Update inspect copy (#1875) 2019-02-04 23:29:33 +01:00
Mark Glagola
af401cdc9b Added import help info to now-cli (now dns -h) (#1876) 2019-02-04 23:29:17 +01:00
Javi Velasco
f879e3ebdd 13.2.0-canary.5 2019-02-04 04:07:49 +01:00
Javi Velasco
a0b838c947 Enhance login (#1873)
* Enhance login

* Consume error from api
2019-02-04 01:05:30 -02:00
Leo Lamprecht
eb2fac75cd 13.2.0-canary.4 2019-02-01 23:11:00 +00:00
Leo Lamprecht
f0b1e57dcb Bumped fetch-h2 to latest version (#1869)
* Bumped `fetch-h2` to latest version

* Fixed code
2019-02-02 00:10:31 +01:00
Olli Vanhoja
f8f12b0596 Show builds rate limit message correctly (#1866) 2019-02-01 22:29:23 +01:00
Javi Velasco
de25859329 13.2.0-canary.3 2019-02-01 22:20:34 +01:00
Mark Glagola
b4430de8de Handle known domains rm errors (#1868) 2019-02-01 14:33:44 -06:00
Mark Glagola
6d6c4aa4b8 Added transferredAt and transferStartedAt (#1865) 2019-02-01 13:32:10 +01:00
Leo Lamprecht
baadff146e 13.2.0-canary.2 2019-01-31 22:47:33 +00:00
Javi Velasco
0b85490804 Remove cf cdn enabled flag (#1852)
* Remove CDN toggling

* Rename cdnEnabled to cfEnabled

* Rename cfEnabled to cloudfareEnabled

* Remove missing error
2019-01-31 23:38:23 +01:00
Andy
8d256228a0 Check if deploymentId exists (#1857)
* Check if deploymentId exists

* Make deploymentId optional for Alias
2019-01-31 13:37:09 +01:00
Arunoda Susiripala
5ad1af6d91 Check the existence of the project before we delete it (#1837) 2019-01-31 13:18:42 +01:00
Leo Lamprecht
38b3095b82 13.2.0-canary.1 2019-01-31 11:57:18 +00:00
Leo Lamprecht
9289d0cd43 Render validation errors for Now 1.0 (#1862) 2019-01-31 12:54:45 +01:00
Mark Glagola
d834c0fc0a Domain transfer in copy change (#1861) 2019-01-30 16:34:24 -06:00
Javi Velasco
7a995c3801 Add import zonefile copy (#1860) 2019-01-30 17:37:08 +01:00
Javi Velasco
2f41a2bc09 Add ability to import a zone file (#1851)
* Add ability to import a zone file

* Use an arg instead of an option for the zone file
2019-01-30 16:21:56 +01:00
Javi Velasco
e1a80c30be Add missing error: InvalidAuthCode (#1859) 2019-01-30 16:08:53 +01:00
Mark Glagola
19994ccf60 Add domain transfer in pricing (#1849)
* Display transfer renewal price for domain transfers

* Check domain transferable status immediately on transfer-in

* Transfer status endpoint change to .../registry

* spelling fix

* Enable transferable check

* Update dependencies
2019-01-30 14:56:38 +01:00
George Tsiolis
1a59b0605f Update legacy note structure (#1855) 2019-01-29 17:06:20 +01:00
Mark Glagola
1c9aeee901 13.1.2-canary.3 2019-01-22 18:44:01 -06:00
Mark Glagola
31bfaa0569 "now domains transfer-in" support (#1767) 2019-01-22 17:31:51 -06:00
Leo Lamprecht
b24182df5b 13.1.2-canary.2 2019-01-22 16:22:32 +00:00
Andy
38923e1f91 Added default script that will run if now fails to install (#1832)
* Added default script that will run if now fails to install

* Don't overwrite the default now script before publishing

* Copy the default now binary on publish instead of keeping it inside the dist folder

* Removed download/dist/now

* Changed text
2019-01-21 19:59:40 +01:00
Leo Lamprecht
aefee0fad2 13.1.2-canary.1 2019-01-17 12:15:18 +00:00
Leo Lamprecht
aa2f53f2d5 Ensure name in package.json works for Now 1.0 (#1835)
* Ensure `name` in `package.json` works for Now 1.0

* Fixed integration test
2019-01-17 13:13:32 +01:00
Leo Lamprecht
a0bce9b3c5 13.1.1-canary.1 2019-01-16 22:59:45 +00:00
Arunoda Susiripala
8e5b7fdc19 Fix formatting issues on project rm confirmation (#1834) 2019-01-16 23:56:16 +01:00
Leo Lamprecht
4ee63506f8 13.1.0-canary.4 2019-01-16 18:43:16 +00:00
Leo Lamprecht
1a239f92f4 Ensure project name is always defined (#1833) 2019-01-16 19:41:03 +01:00
Leo Lamprecht
4f15b724ac 13.1.0-canary.3 2019-01-16 14:20:55 +00:00
Max
1c68a24a70 Support new invite format (#1831)
* Support new invite format

* Use null as initial userInfo value

Co-Authored-By: rdev <8418866+rdev@users.noreply.github.com>

* Add missing semicolon

Co-Authored-By: rdev <8418866+rdev@users.noreply.github.com>

* Add missing semicolon

Co-Authored-By: rdev <8418866+rdev@users.noreply.github.com>
2019-01-16 15:20:24 +01:00
Leo Lamprecht
d863acbc65 13.1.0-canary.2 2019-01-16 10:51:37 +00:00
Leo Lamprecht
c736f2ccb4 Revert "Show deployment URL at the end too (#1827)"
This reverts commit 0f2c677035.
2019-01-16 10:51:10 +00:00
Arunoda Susiripala
3942b88565 Get back the --name property (#1828)
* Get back the --name property
This also removes --project and consider --name as the project name

* Fix unit tests.

* Fix integration tests
2019-01-15 16:15:38 -08:00
Leo Lamprecht
a5ac2aca10 13.1.0-canary.1 2019-01-15 21:21:53 +00:00
Arunoda Susiripala
55ced7a3e5 Added support for projects (#1719)
* Send project property to api-deployments.

* Allow to talk to local api-deployments temporarly.

* Introduce the getProjectName utility.

* Use getProjectName on both legacy and latest deploy commands.

* Add now projects ls support.

* Implement 'now project add' and 'now project rm'

* Show project id

* Add basic now ls support with projects.

* Add some cosmetics changes.

* Make the UI colorful.

* Set the name as project

* Notify the user about the project name

* Remove legacy list

* Make sure 'now projects xxx' possible

* Set the project name in the list header

* Remove unwanted package

* Use --project in tests

* Force --project instead of --name

* Force the use of project property inside now.json

* Update ncc to the latest

* Remove -w from ncc

* Deprecate --name and .name instead of throwing errors

* Use the built-in fetch client

* Fix tests

* Change the order of tests

* Reset integration tests

* Remove some debug logs
2019-01-15 22:11:21 +01:00
Leo Lamprecht
0f2c677035 Show deployment URL at the end too (#1827) 2019-01-15 20:31:07 +01:00
Leo Lamprecht
7493f7d485 Allow user to abort now init (#1826) 2019-01-15 16:49:52 +01:00
Javi Velasco
ccbe18b520 Move all dns commands and subcommands to typescript (#1825) 2019-01-15 11:18:51 +01:00
Andy Bitz
8bde0bc204 13.0.4-canary.2 2019-01-14 22:14:28 +01:00
Leo Lamprecht
28df25e804 Improved test suite (#1820)
* Bumped `@zeit/ncc` to latest

* Reverted lockfile

* Make linking build for dev

* Cover line 21 in util/config/local-path.js

* Heavily improved unit test coverage

* Fixed space

* Got to 90% coverage

* Removed useless code

* Made builds work

* Fixed a few lines

* Fully covered read-metadata.js

* Brought coverage to 95.38

* Removed code that was never executed

* Track everything

* Don't show badge for now
2019-01-14 21:53:13 +01:00
Andy
fa5cb50df9 Add the command to sentry (#1824)
Add the current command to sentry as extra
2019-01-14 21:40:58 +01:00
Timothy
b847e02ff8 Fix config file message (#1821) 2019-01-12 01:05:26 +01:00
Leo Lamprecht
3e7411440b 13.0.4-canary.1 2019-01-10 11:24:25 +00:00
Leo Lamprecht
52fa239ae1 Fixed now logs for 2.0 deployments (#1819)
* Fixed `now logs` for 2.0 deploymens

* Added log test for 2.0

* Make test work
2019-01-10 12:23:39 +01:00
Amio /
fdaed3fd8f better did-you-mean (#1817)
ensure 'node' => 'nodejs' insteadof 'node-server'
2019-01-09 19:43:26 -08:00
Leo Lamprecht
8a3235ce6f 13.0.3-canary.3 2019-01-09 22:01:56 +00:00
Leo Lamprecht
e054c17e31 Do not render that status was inferred (#1816) 2019-01-09 23:01:00 +01:00
Leo Lamprecht
c7b6b4fc3e 13.0.1-canary.3 2019-01-09 14:29:32 +00:00
Leo Lamprecht
4d60b96a75 Made now domains inspect match now inspect (#1815) 2019-01-09 15:29:15 +01:00
Leo Lamprecht
0f0b546fa6 13.0.1-canary.2 2019-01-09 10:54:39 +00:00
Leo Lamprecht
ed454218b6 Bumped update-check to latest version (#1814) 2019-01-09 10:54:18 +00:00
Leo Lamprecht
b2345de9cc Revert "Bumped update-check to latest version (#1813)"
This reverts commit 5dc393f397.
2019-01-09 10:29:22 +00:00
Leo Lamprecht
5dc393f397 Bumped update-check to latest version (#1813) 2019-01-09 11:06:56 +01:00
Leo Lamprecht
ca654d938b 13.0.1-canary.1 2019-01-08 20:24:59 +00:00
Leo Lamprecht
0b0fb6bf1f Fixed several errors (#1811)
* Fixed NOW-CLI-HB

* Fixed code
2019-01-08 15:45:27 +01:00
Leo Lamprecht
ce85bb0578 13.0.0-canary.39 2019-01-07 22:47:07 +00:00
Leo Lamprecht
4c9538d51f Fixed several errors and removed useless file (#1807)
* Fixed NOW-CLI-FK

* Fixed NOW-CLI-F0

* Fixed NOW-CLI-D2

* Fixed NOW-CLI-GK

* Do not render clipboard indicator if error occured

* Removed useless file

* Fixed NOW-CLI-GW

* Fixed NOW-CLI-H3
2019-01-07 23:46:48 +01:00
Timothy
dc5157a252 Add domain verification error document (#1806) 2019-01-07 23:36:10 +01:00
Leo Lamprecht
9cc6d7f4da Overhauled now inspect (#1804)
* Show routes in `now inspect`

* Removed whitespace

* Made UI gorgeous

* Use cyan for meta keys
2019-01-07 20:08:10 +01:00
Leo Lamprecht
18b301e2a6 13.0.0-canary.38 2019-01-04 21:04:30 +00:00
Javi Velasco
35f52410d9 Style fixes (#1796) 2019-01-04 12:57:35 -08:00
Amio /
cf55c05691 Add now-init (#1780)
* Add now-init

* fix ci error

* refactor: (now-init) js => ts, some improvements.

- now-init works like git-clone
  (create new directory / complain about overwritten / can be forced)

- Better guess user intention
  (use jaro-winkler algorithm with "-" awareness)

- Stricter on arguments

- Non-TTY frendly

* add now-init to main help message

* fix miss typed args in didYouMean

* clean console.log

* output a new-line after any response to promptBool

Fix the missing '\n' when promptBool get an negative input ("n"/"N"/Enter/Abort).

Before:

~/git » now init koa
> Did you mean nodejs-koa? [y|N] > No changes made.

After:

~/git » now init koa
> Did you mean nodejs-koa? [y|N]
> No changes made.

* refine now-init output messages

* prettier code format

* update tests for now-init

* put "init" before "help" in now-help message

* remove redundant semicolon
2019-01-04 09:55:00 -08:00
Leo Lamprecht
be9360fbf3 13.0.0-canary.37 2019-01-04 11:47:35 +00:00
Javi Velasco
3fc07738cb Domains improvements (#1795)
* More flexible response error

* Consider async domain purchases

* Jumpline for domains ls

* Jumpline in domains verify

* Remove not needed body performing verification

* Add orderedAt to domains inspect
2019-01-04 12:47:21 +01:00
Leo Lamprecht
299452eb8d Only run prettier for JS/TS files (#1791)
* Only pass modified js files

* Look for TS too
2019-01-03 20:06:57 +01:00
Leo Lamprecht
655bce7795 13.0.0-canary.36 2019-01-01 18:07:40 +00:00
Leo Lamprecht
0289b38e4e Improved performance when creating deployment (#1787) 2019-01-01 18:07:00 +00:00
Leo Lamprecht
bceb401d19 13.0.0-canary.35 2019-01-01 13:41:01 +00:00
Leo Lamprecht
cef74ff787 Moved docs about publishing a release to Wiki (#1786) 2019-01-01 14:40:49 +01:00
Leo Lamprecht
de3b1c896f 13.0.0-canary.34 2019-01-01 12:13:54 +00:00
Olli Vanhoja
c94bbbc3d3 Fix now dns ls misalignment when a domain is not found (#1777)
If a domain is not found the DNS record arrays are aligned
incorrectly and finally some records are shown under wrong domains.
It happens because the length of the domains array differs from the
length of array of record arrays.
2018-12-27 13:46:37 +02:00
Javi Velasco
877737d872 13.0.0-canary.33 2018-12-19 17:33:43 +01:00
Javi Velasco
2c47baeed4 Remove extra request when adding a domain (#1762) 2018-12-19 16:30:26 +01:00
Javi Velasco
0321a03e38 13.0.0-canary.32 2018-12-19 01:20:27 +01:00
Javi Velasco
ba28773dae Do not use certs and aliases in now domains rm (#1761)
* Update types to the new API contract

* Do not use aliases and certs from domain fetch

* Add a dash per row in ns table
2018-12-19 01:18:59 +01:00
Leo Lamprecht
fcb3f7fb4f 13.0.0-canary.31 2018-12-18 22:50:52 +00:00
Leo Lamprecht
1db52a9384 Wait for unhandled rejections to be reported before exiting (#1760) 2018-12-18 23:50:38 +01:00
Javi Velasco
47986470a3 13.0.0-canary.30 2018-12-18 00:40:53 +01:00
Javi Velasco
4ddafa700f Fix issue when we define aliases in now.json array (#1757) 2018-12-18 00:40:22 +01:00
Javi Velasco
2d90f1b02d 13.0.0-canary.29 2018-12-17 23:58:05 +01:00
Javi Velasco
19d67cb42b Domains enhancements (#1755)
* Show a dash where there are no nameservers

* Show actual serviceType in domains

* Format ns table with ticks

* More enhancements
2018-12-17 11:15:35 -08:00
Leo Lamprecht
df2e5c8ab0 13.0.0-canary.28 2018-12-16 16:31:20 +00:00
Leo Lamprecht
02d43366c7 Render better error when source missing (#1754)
* Render better error when source missing

* Added integration test

* Fixed missing
2018-12-16 17:31:08 +01:00
Leo Lamprecht
b51ceb26f8 13.0.0-canary.27 2018-12-13 15:28:41 +00:00
Leo Lamprecht
96f559c513 Ran prettier over the entire codebase (#1749)
* Use correct parser

* Ran prettier over the entire codebase
2018-12-13 16:28:21 +01:00
Javi Velasco
1ed613d5be Fix list DNS issue and migrate certs issue to Typescript (#1747)
* Migrate getDomainDNSRecords to Typescript

* Migrate getDNSRecords to Typescript and fix it

* Migrate cert functions to Typescript and fix issues

* Migrate certs issue to Typescript

* Minor fixes
2018-12-13 15:27:21 +01:00
Leo Lamprecht
2cba7cad2a Use our own @zeit/git-hooks package (#1748)
* Removed legacy dependencies

* Added @zeit/git-hooks

* Added scripts to run before commit

* Format only the modified files

* Revert "Format only the modified files"

This reverts commit 9f4a58d2b978fa286eb7fcf38186bd9d53a2cda1.

* Revert "Added scripts to run before commit"

This reverts commit 07636d945374e404161ad281feed4180801b3509.

* Revert "Added @zeit/git-hooks"

This reverts commit 3f44f401f36fa6965d36ef28b81907c137c08abc.

* Revert "Removed legacy dependencies"

This reverts commit bb02465c59d75bf6b32bd449a04832cf4e2f4bf4.

* Fixed setup

* Print important test parts

* Logged kind

* Added more logs

* No need to remove deployments, we will prune
2018-12-13 15:13:55 +01:00
Javi Velasco
57c684abf3 13.0.0-canary.26 2018-12-12 23:35:49 +01:00
Javi Velasco
eb3970d779 New domains API + Typescript migrations (#1728)
New domains API + Typescript migrations
2018-12-12 23:35:08 +01:00
Leo Lamprecht
39f09d1b4b 13.0.0-canary.25 2018-12-12 17:24:10 +00:00
Mudit Ameta
b876da60aa Update now alias error to mention potentially missing name config (#1742)
* Update `now alias` error to mention potentially missing name config

Running `now alias` in a project that has no `package.json` and doesn't
have a `name` property defined in `now.json` fails with a cryptic
error currently. This, in combination with
https://github.com/zeit/docs/pull/378 tries to better guide the user.

* Add a link to the `name` config property
2018-12-12 18:23:25 +01:00
Joe Cohen
48f85b4450 Use single domain call to remove add domains domains (#1743)
* use single domain call to remove add domains domains

* update sigle domain endpoint and error handling
2018-12-12 18:22:42 +01:00
Leo Lamprecht
6af4b9ecd5 13.0.0-canary.24 2018-12-10 14:26:40 +00:00
Leo Lamprecht
7441730b24 Hot fix for now teams ls (#1737)
* Hot fix for `now teams ls`

* Added integration test
2018-12-10 15:10:33 +01:00
Leo Lamprecht
f444350a4f Revert "Add husky"
This reverts commit 0892443104.
2018-12-10 11:14:02 +00:00
Javi Velasco
0892443104 Add husky 2018-12-10 00:30:16 +01:00
Leo Lamprecht
c97a0cffe1 13.0.0-canary.23 2018-12-07 23:07:06 +00:00
Leo Lamprecht
8ff7340eb2 Make download script work properly (#1729) 2018-12-08 00:06:40 +01:00
Leo Lamprecht
9dcf4d0264 13.0.0-canary.22 2018-12-07 22:37:31 +00:00
Leo Lamprecht
4a38798595 Re-enabled minification and source map reporting (#1727)
* Test tag logging

* Track source maps on Sentry

* Bumped @zeit/ncc to the latest version
2018-12-07 23:37:00 +01:00
Leo Lamprecht
b80804dae5 13.0.0-canary.21 2018-12-07 15:18:30 +00:00
Leo Lamprecht
8e4d885268 Fixed even more Sentry errors (#1726)
* Fixed NOW-CLI-A5

* Fixed NOW-CLI-AW

* Fixed NOW-CLI-B4

* Fixed NOW-CLI-8G

* Fixed NOW-CLI-BV

* Fixed NOW-CLI-6Z

* Fixed NOW-CLI-AV

* Fixed NOW-CLI-6A

* Fixed NOW-CLI-24
2018-12-07 16:18:11 +01:00
Leo Lamprecht
51f229b0bd 13.0.0-canary.20 2018-12-06 22:31:58 +00:00
Leo Lamprecht
c6a16a0279 Downgrade @zeit/ncc (#1725)
* Downgrade `@zeit/ncc`

* Fixed package.json
2018-12-06 23:31:49 +01:00
Leo Lamprecht
16c0a93d46 13.0.0-canary.19 2018-12-06 22:07:41 +00:00
Leo Lamprecht
857129c60f Fixed several errors (#1724)
* Handle EPERM errors when creating config files

* Catch errors when retrieving scope

* Added validation for the API URL

* Removed useless whitespace

* Removed useless file

* Cleaned up `setRawMode` mess

* Removed tests that are erroring on non-TTY

* Set environment based on release channel

* Fixed syntax
2018-12-06 23:07:08 +01:00
Leo Lamprecht
84e6a52834 Improved error reporting system (#1723)
* Configure releases and environment for Sentry

* Correctly send development errors away

* Report Sentry errors with metadata

* Report username and full name of user too

* Better release name
2018-12-06 15:23:46 +01:00
Leo Lamprecht
9a47c6c6d5 Added legacy preferGlobal flag (#1722) 2018-12-06 14:06:36 +01:00
Leo Lamprecht
17362c0cad 13.0.0-canary.18 2018-12-05 22:16:39 +00:00
Leo Lamprecht
e022bffe40 Improved Sentry error reporting (#1720)
* Bumped `@zeit/ncc` to latest version

* Do not report user errors

* Do not report mistyped arguments to Sentry

* Do not report when user aborts action

* Removed all occurances of user errors

* Do not report arg errors

* Correctly report teams and billing errors

* Prevent `setRawMode` from causing an error

* Do not report errors while developing

* Revert "Prevent `setRawMode` from causing an error"

This reverts commit 323296f30bfcca70ea5bb736db98357212f86a0a.

* Fixed whitespace
2018-12-05 23:16:20 +01:00
Leo Lamprecht
f3381e95ef 13.0.0-canary.17 2018-11-30 23:32:14 +00:00
Leo Lamprecht
294f1d7983 Made npm run link work (#1715) 2018-12-01 00:24:48 +01:00
Leo Lamprecht
9bfb33d88c Replaced webpack with ncc (#1710)
* Removed useless stuff

* Removed types

* Removed types file

* Made the build work

* Fixed bundling

* Fixed linting

* Fixed download compiler

* Try to fix bundling problem

* Ignored two things

* Upgraded pkg to stable

* Fixed syntax finally

* Fixed unit tests

* Removed shebangs

* Fixed integration tests

* Made download script work
2018-12-01 00:14:32 +01:00
Leo Lamprecht
12b874507f Changed default of sessionAffinity to random (#1713) 2018-11-30 21:48:43 +01:00
Leo Lamprecht
cee97582fc 13.0.0-canary.16 2018-11-29 18:33:49 +00:00
Gustaf Räntilä
c66b6843a4 Improved http2 stability (#1705) 2018-11-29 19:30:43 +01:00
Leo Lamprecht
9fc03bbc9a Correctly report code coverage (#1709) 2018-11-29 19:30:00 +01:00
Leo Lamprecht
36c875a7f7 Added code coverage report (#1708)
* Added code coverage report

* Correctly include everything

* Ignored useless stuff

* Combine all the coverages

* Corrected requiring

* Persist only what is needed
2018-11-29 19:03:32 +01:00
Leo Lamprecht
48b175fa43 13.0.0-canary.15 2018-11-29 16:01:04 +00:00
Leo Lamprecht
4d35ea9bf3 Ensured now -V 1 owner/repo continues working (#1707)
* Ensured `now -V 1 owner/repo` continues working

* Added newline

* Added tests
2018-11-29 17:00:49 +01:00
Leo Lamprecht
62368fda23 13.0.0-canary.14 2018-11-27 22:37:15 +00:00
Leo Lamprecht
6b89eca022 Render more accurate error when offline (#1704) 2018-11-27 23:36:02 +01:00
Leo Lamprecht
000c02247d 13.0.0-canary.13 2018-11-27 21:19:35 +01:00
Leo Lamprecht
6b899188c4 Render a proper error when offline (#1702)
* Made debugging entry file work

* Render proper error when offline

* Return proper exit code
2018-11-27 21:16:34 +01:00
Leo Lamprecht
24f0efc0e2 13.0.0-canary.12 2018-11-27 19:48:43 +01:00
Leo Lamprecht
b6bbb28757 Render more detailed error when files are not there (#1700) 2018-11-27 19:46:03 +01:00
Leo Lamprecht
8e1cd54c92 13.0.0-canary.11 2018-11-26 11:09:02 +01:00
Leo Lamprecht
8b3dff12e8 Do not render instance count for 2.0 deployments (#1697)
* Do not render instance count for 2.0 deployments

* Added integration test
2018-11-26 11:08:40 +01:00
Leo Lamprecht
c82b18f772 13.0.0-canary.10 2018-11-23 12:11:10 +01:00
Leo Lamprecht
2642e15aff Do not send github property to API (#1694) 2018-11-23 12:10:56 +01:00
Leo Lamprecht
bf4dac5c3b 13.0.0-canary.9 2018-11-22 16:47:53 +01:00
Leo Lamprecht
8729214f8b Do not send alias to the API (#1690) 2018-11-22 16:47:31 +01:00
Leo Lamprecht
ff6073a932 13.0.0-canary.8 2018-11-22 13:39:17 +01:00
Leo Lamprecht
2cfee720a3 Properly render schema validation errors (#1689)
* Properly render schema validation errors

* Added integration test

* Removed useless properties
2018-11-22 13:38:46 +01:00
Leo Lamprecht
061e3d212d 13.0.0-canary.7 2018-11-21 18:11:55 +01:00
Leo Lamprecht
04bb549e36 Make now teams add work (#1684)
* Make `now teams add` work

* Added integration test

* Added comment
2018-11-21 18:11:33 +01:00
Leo Lamprecht
68fcb587a9 13.0.0-canary.6 2018-11-19 13:23:03 +01:00
Leo Lamprecht
93165ef0b2 Do not store a backup of the binary (#1676) 2018-11-19 13:16:31 +01:00
Leo Lamprecht
a616124cc6 Build for dev and not for prod when linking (#1671) 2018-11-16 22:54:20 +01:00
Leo Lamprecht
2ccb8f9a17 13.0.0-canary.5 2018-11-16 00:16:29 +01:00
Leo Lamprecht
4b58fac608 Made publishing work (#1669) 2018-11-16 00:16:02 +01:00
Leo Lamprecht
a4a3d8a6eb 13.0.0-canary.4 2018-11-15 22:21:45 +01:00
Leo Lamprecht
dbcb18bffc Upgrade to Webpack 4.0 (#1667)
* Added support for Webpack 4

* Brought performance back

* Default output dir

* Made it take effect

* Made binary work
2018-11-15 22:19:51 +01:00
Leo Lamprecht
a499580b4d 13.0.0-canary.3 2018-11-15 01:26:16 +01:00
Leo Lamprecht
4fd952b0da Report server errors that are unhandled (#1658) 2018-11-15 01:26:02 +01:00
Evil Rabbit
234ed2718f Update repo banner (#1659) 2018-11-15 01:17:49 +01:00
Leo Lamprecht
77c1818572 13.0.0-canary.2 2018-11-15 01:07:06 +01:00
Leo Lamprecht
b704aca0fe Send unexpected errors away for inspection (#1657)
* Send errors away for inspection

* Allow Sentry to send them away

* Fixed dependency

* Fix credit card input

* Do not test for something that requires TTY

* Track properly

* Make it extra safe

* Added back test
2018-11-15 01:03:46 +01:00
Leo Lamprecht
8226f81026 Added new now upgrade and now downgrade commands (#1656)
* Handle cancelation

* Fixed imports

* Added support for old plans

* Removed test that does not apply anymore
2018-11-14 23:53:46 +01:00
Leo Lamprecht
1b062aa597 Fixed error message for minimum instance count (#1655) 2018-11-14 14:27:14 +01:00
Leo Lamprecht
3f863cace4 13.0.0-canary.1 2018-11-13 23:52:48 +01:00
Leo Lamprecht
737536297c Allow re-using aliases that point to deleted deployments (#1653)
* Allow re-using aliases that point to deleted deployments

* Removed
2018-11-13 23:48:40 +01:00
Leo Lamprecht
c9017b5bf9 12.0.0-canary.100 2018-11-13 20:10:39 +01:00
Leo Lamprecht
89dc51fab5 Log version when debugging (#1652) 2018-11-13 19:03:21 +01:00
Leo Lamprecht
78067113d7 Decrease amount of retries for download (#1651)
This fixes #1622.
2018-11-13 19:00:07 +01:00
Leo Lamprecht
bef3abbe2c Return code 0 if no deployments found when removing (#1650)
* Return code 0 if no deployments found when removing

This fixes #1605.

* Fixed integration test

* Fixed second example too

* Fixed all occurances
2018-11-13 18:54:18 +01:00
Leo Lamprecht
1255c24898 12.0.0-canary.99 2018-11-12 22:12:39 +01:00
Leo Lamprecht
4e0b923552 Made default value for --dotenv (v1) work again (#1649) 2018-11-12 22:12:18 +01:00
Leo Lamprecht
ef9a6ac6aa 12.0.0-canary.98 2018-11-12 13:07:56 +01:00
Leo Lamprecht
60c0d725c9 Added -V to the usage information (#1648) 2018-11-12 12:53:12 +01:00
Leo Lamprecht
59450f470a 12.0.0-canary.97 2018-11-12 12:48:21 +01:00
Leo Lamprecht
09dfd736db Added tests for -V option (#1647)
* Added tests for `-V` option

* Pushed for testing

* Correctly set it

* Revert "Correctly set it"

This reverts commit c76286082d90f091ecec4a317856e91b4558e781.

* Create a new deployment each time
2018-11-12 12:48:08 +01:00
Leo Lamprecht
3852c9bf3f 12.0.0-canary.96 2018-11-10 20:55:57 +01:00
Leo Lamprecht
f3d9208d08 Added support for -V option (#1644) 2018-11-10 20:55:35 +01:00
Leo Lamprecht
c62236791a 12.0.0-canary.95 2018-11-08 22:21:24 +01:00
Leo Lamprecht
bbe6ff820a Made --build-env, --meta and --dotenv work for v1 (#1637)
Made `--build-env`, `--meta` and `--dotenv` work for v1

* Locked multi static file test to v1

* Correct fix

* Final fix

* Config also adds to count

* Fixed single file test

* legacy => old

* Correctly set it
2018-11-08 22:20:33 +01:00
Bart Deslagmulder
47679469ac Updated error documentation about not nameservers (#1629) 2018-11-08 18:49:15 +01:00
Leo Lamprecht
f7e79a31a0 12.0.0-canary.94 2018-11-08 16:27:27 +01:00
Leo Lamprecht
2d8c995756 Added support for Now 2.0 (#1636)
* Removed external providers

* Renamed sh provider

* Removed serverless stuff

* Fixed paths

* Properly pass token

* Fixed paths

* Check for token correctly

* Remove useless properties

* Fixed unit tests

* Keep certain things

* Adjusted remaining parts

* Fixed login

* Remove user properties that are not needed

* Store `platformVersion` for teams

* Store `platformVersion` for users

* Delete team order when logging out

* Made team commands work with tiny config

* Load data dynamically

* Made billing command show correct context

* Fixed remaining occurences of context name

* Fixed remaining pieces

* Test CI

* Clean strings when testing

* Better error check

* Render correct information when asking for credit card

* Migrate from objects to strings

* Better migration message and keep tips

* Remove the old property

* Use note for migration message

* Don't show spinner for loading missing data

* Allow for current team or user to be deleted

* Two deploy files

* Consume context name correctly

* Removed deployment types from new deployer

* Also check for bigger than 1

* Better file names

* Added upgrade message for legacy deployer

* Make help work when logged out

* Error if sub command doesn't exist when requesting help

* Fixed wording

* Support for version property added

* Better handling

* Removed useless props from deploy help

* Don't show version warnings when rendering help

* Fixed wording in readme

* Migrate even if in the middleground

* Make `now whoami` work

* Deprecated support for deploying Git repo in latest deployer

* Added usage information

* Load config separately

* Don't need local config on root

* Correct status code for help test

* Show error only in correct case

* Properly error if path does not exist

* Fixed types

* Fixed remaining occurances of old config

* Don't show warning when rendering help

* Consider version when outputting help

* Only error if path does not exist if it's not help

* Remove testing logging

* Don't error for no-verify

* Stop logging

* Fixed last test

* Added missing semicolons

* Fix indent

* Fix indent again

* Ran prettier over everything

* Added missing types

* Brought test hashes back to normal

* Exit properly when deploying

* Show clipboard note in gray and remove Node.js version

* Completed usage information

* Ensure `now whoami` only outputs the user

* Don not save user data to config

* Removed last traces of `user` and `.api` and `--team` work

* Made `now upgrade` and `now downgrade` correctly render context

* Fixed upgrade/downgrade URL for teams

* Ability to load required data

* Better file name

* Corrected check for current scope

* Don't render version warning when showing help

* Keep polling for handlers

* Render handlers

* Removed useless file

* Much better transpilation setup

* Sweetened logging

* Shortened time it takes to render ready

* Support for error ready states

* Make sure table is not wobbling

* Show times for every handler

* Attach env and build env

* Don't pass useless stuff

* Re-structured pipeline

* Allow empty config

* Do not support package.json config for new pipeline

* Removed occurances of AWS

* Drop useless packages

* Removed useless file

* Ensure the legacy pipeline is working

* Test staging proxy with legacy pipeline

* Adjust test

* Stop testing staging proxy

* Allow for anything

* Pass `handlers` and `routes` to creation endpoint

* Fixed tests

* Revert "Fixed tests"

This reverts commit e0d18a61b9520728089cb2f9e6877c1b91016312.

* Running tests should not be optional

* Support for `-m` and `--meta` added

* Support reading `meta` in local config

* Allow reading `name` from local config

* The `public` prop in local config should be considered

* Handlers deployments should use `.nowignore` and nothing else

* Allow handlers deployments without `handlers` and `routes` in the config

* Locked legacy tests to legacy platform version

* Support aliasing handlers deployments

* Removed useless condition

* Don't allow scaling handlers deployments

* Don't show warning message when deploying single file

* Fixed tests

* Made `now inspect` work

* No type for handlers deployments in list

* Indicate whether a deployment is legacy in `now inspect`

* Made `--force` work for handlers deployments

* Do not document `--dotenv` for handlers (not supported)

* Do not strip `hdl_` from handler IDs

* Fixed for upgrading to latest platform

* Better error for when `version` property is missing

* Render platform version while deploying

* Strip `hdl_` from handler IDs

This reverts commit 750d38ba9074bdc3e63ad2dab8538e51dbba5f03.

* Removed `https://` from handler list

* Removed demo mock

* Cleaner errors

* Make times and erroring work properly

* Print final deployment error

* Removed useless promise

* Prettified code

* Put config utils into correct location

* Moved even more config files

* Removed useless directory

* Removed last useless file

* Fixed wrong paths

* Fixed unit tests

* Update deployment according to handler state, like the server-side loop

* More robust deployment mechanism

* Poll every 1.5 seconds

* Prevent many requests

* Show spinner while waiting for deployment to be ready

* Render how long the deployment took

* Avoid unnecessary repainting

* Automatically remove useless `user` property from config when migrating

* Fixed property names in `now inspect`

* Render platform version for legacy pipeline

* Shortened error messages

* Support `regions` in the local config

* Support for `--regions` added

* Add metadata support for legacy deployments (#2)

* Share handlers table between deploying and inspecting

* Make `now inspect` work nicely

* Renamed handlers to builds

* Stop sending away description

* Bare UI support for builds

* Simper logic for rendering builds

* Render output of builds

* Indicate lambdas in a better way

* Render size for build output

* Do not show type for version 2 deployments

* Fixed time output for `now inspect`

* Don't handle BUILDS type

* Allow for 100% non-config deployments

* Add metadata support for now ls (#3)

* Add metadata support for now ls
So, we can do things like this:
  now ls -m key1=value1 -m key2=value2

* Better description

* Fix wording

* Added final newline

* Add sentry (#4)

* Revert "Add sentry (#4)"

This reverts commit 851d1bdb0e1bbc8f329a45388865b2c41395d8c2.

* Only render build output if it was not copied

* Made `now alias` work with latest staging proxy

* Revert "Made `now alias` work with latest staging proxy"

This reverts commit 16e8998435ef03c50d2737f3ef17fa5c0c2dd33f.

* Bumped deployments API to the latest version

* Made `now rm` work

* Do not print `version` warning for single files

* Removed useless `fs-extra` dependency

* Removed useless dependencies

* Default binaries to Node 10

* Bumped Node.js in Circle CI to latest

* Bumped Xcode to get latest Node.js for integration tests

* Enabled HTTP/2 support

* Removed useless code

* Added integration test for builds

* Bumped `fetch-h2` to the latest version

* Avoid performing network request for rendering help

* Render note when viewing latest help

* Return status code `2` when exiting with help

* Fixed test for usage information

* Removed wrong text in usage info for Now 2.0

* Removed support for `--links` from v2 pipeline

* migrated => upgraded

* Added default routing for single files

* Make `--token` work as expected

* Better message for build errors

* Prevent update notification

* Prevent update notifications from showing

* Only show migration message in debug output

* Prevent flickering of state

* Improved output

* Removed useless assignment

* Corrected padding

* Less padding before state

* Corrected links for global configuration

* Fixed integration tests

* Render region for Lambdas

* Join regions in a better way

* Ensure `now.json` and `.nowignore` (the latter worked anyways) are uploaded

* Fix `build.env` in new deployment API call (#6)

* JSON log the deployment body when debugging (#8)

Otherwise it's just `[object Object]` which is useless.

* Retry to fetch on error on follow mode (#5)

* retry fetch on error on follow mode

* improve logging

* Fixed `--env` and `--build-env` CLI args (#7)

* Fix `--env` and `--build-env` CLI args

* Fall back to `undefined`

* Ensure `now switch` lists active scope in the beginning

* Removed useless code

* Error if `env` or `build.env` have wrong types

* Made `now inspect` look great

* Fixed wrong protocol in URL

* Made `now --team` work with users

* Leave PHP out of integration test for now

* Do not select PHP build

* Fixed integration tests

* Revert "12.0.0-canary.93"

This reverts commit 70a0a594b4.

* Revert "Revert "Add support for top-level "sh" auth""

This reverts commit 4273d62460.

* Revert "12.0.0-canary.92"

This reverts commit 847c71ecf2.

* Revert "Add support for top-level "sh" auth"

This reverts commit c493d651db.

* Revert "12.0.0-canary.91"

This reverts commit 06c954f8fe.

* Revert "Added metadata support for `now inspect` (#1634)"

This reverts commit 9567656b45.

* Revert "12.0.0-canary.90"

This reverts commit 966737be23.

* Revert "Added support for deployment metadata (#1604)"

This reverts commit 6c1188a787.
2018-11-08 16:24:31 +01:00
Leo Lamprecht
70a0a594b4 12.0.0-canary.93 2018-11-03 17:54:47 +01:00
Leo Lamprecht
4273d62460 Revert "Add support for top-level "sh" auth"
This reverts commit c493d651db.
2018-11-03 17:54:36 +01:00
Nathan Rajlich
847c71ecf2 12.0.0-canary.92 2018-11-02 21:01:32 -07:00
Nathan Rajlich
c493d651db Add support for top-level "sh" auth 2018-11-02 21:00:45 -07:00
Leo Lamprecht
06c954f8fe 12.0.0-canary.91 2018-11-02 21:26:13 +01:00
Arunoda Susiripala
9567656b45 Added metadata support for now inspect (#1634) 2018-11-02 21:25:50 +01:00
Leo Lamprecht
966737be23 12.0.0-canary.90 2018-11-02 21:14:24 +01:00
Arunoda Susiripala
6c1188a787 Added support for deployment metadata (#1604)
* Allow to add metadata in the now deploy command.
Use can add multiple items of metadata with:
  '-m key1=val1 -m key2=val2'

* Add a test case.

* Update to accept and send metadata as meta.

* Use correct fields in now.create

* Add now ls support.

* Add an integration tests for ls with metadata

* Added newline

* Removed semicolon
2018-11-02 21:05:47 +01:00
Leo Lamprecht
39fffe6874 12.0.0-canary.89 2018-09-23 17:32:13 +02:00
Evil Rabbit
a75ae8a1b1 Update repo banner 2018-09-23 12:04:53 -03:00
Leo Lamprecht
c1d49fe8aa 12.0.0-canary.88 2018-09-20 15:50:23 +02:00
Mark
577831f775 Suppress the warning of a dependency based on an expression (#1588) 2018-09-20 15:50:07 +02:00
Leo Lamprecht
098ad6e98c 12.0.0-canary.87 2018-09-18 23:07:21 +02:00
Javi Velasco
248fdbaddf Change copy for finish cert message (#1590) 2018-09-18 23:06:56 +02:00
Leo Lamprecht
417a1abcf7 12.0.0-canary.86 2018-09-14 20:43:13 +02:00
Javi Velasco
d36ecec9c4 Bring back now certs add (#1583) 2018-09-14 20:42:57 +02:00
Leo Lamprecht
7a2895d3a3 12.0.0-canary.85 2018-09-12 23:43:53 +02:00
Nathan Rajlich
58f156a491 Render Cloud v2 info about deployments in now inspect (#1577)
`slot` and `limits` are now rendered when it is a Cloud v2 deployment.

Also fixes an issue with static deployments always
rendering `affinity: undefined`.
2018-09-12 23:39:16 +02:00
Nathan Rajlich
02ee8602cd Add "all" pseudo-DC to the constants mapping (#1581) 2018-09-12 23:31:58 +02:00
Nathan Rajlich
e999f5dd72 Add now inspect to --help (#1578) 2018-09-12 23:31:29 +02:00
Leo Lamprecht
5e1b099285 12.0.0-canary.84 2018-09-11 18:34:26 +02:00
Matheus Fernandes
87b1f5a5fb Added new iad1 data center (#1575) 2018-09-11 18:34:08 +02:00
Leo Lamprecht
ae8cbdce0a 12.0.0-canary.83 2018-09-10 19:09:42 +02:00
Cygnusfear
95de48c03f Changed error to log to avoid breaking automatic deployments (#1572)
throwing an error re-opened this issue:
https://github.com/zeit/now-cli/issues/1044

breaks automation when no deployments are found or deployment name is changed
2018-09-10 19:09:36 +02:00
Nathan Rajlich
5ea4fd9a5e Add now whoami to --help (#1573) 2018-09-10 19:06:19 +02:00
Leo Lamprecht
1f3d9e7e0f 12.0.0-canary.82 2018-09-06 21:00:04 +02:00
Jaga Santagostino
05e4528b1c Add changelog link when new version is available (#1530)
* add changelog link if new version is available

* Linked directly
2018-09-06 20:59:24 +02:00
Jarmo Isotalo
40789776bc Prefer URL over deployment ID as the ID not shown in now ls (#1554) 2018-09-06 20:59:19 +02:00
Zeke Sikelianos
75759edd26 Use consistent wording in usage (#1541) 2018-09-06 20:39:53 +02:00
Nathan Rajlich
2a5dc1dba6 Update @zeit/dockerignore to v0.0.3 (#1560)
* Update `@zeit/dockerignore` to v0.0.2

To fix https://github.com/zeit/now-cli/issues/1441.

* Update `@zeit/dockerignore` to v0.0.3
2018-09-06 20:39:09 +02:00
Javi Velasco
0cbf50b7ff 12.0.0-canary.81 2018-09-05 18:00:07 +02:00
Javi Velasco
a3f5b805bb Restructure certs command (#1567)
* Restructure add command

* Remove cert start and finish

* Rename certs add to issue

* Better errors and add cant-solve-challenge

* Show err.sh for dns configuration errors generating certs

* Add err.sh to solve challenges manually

* Add deprecation message to certs add

* Improve grammar

* Minor fixes
2018-09-05 17:58:22 +02:00
Javi Velasco
c337877501 12.0.0-canary.80 2018-09-02 23:24:48 +02:00
Javi Velasco
a6e9dd850a Allow to generate certs solving challenges manually (#1566)
* Move getDomainNameservers function

* Don't show an error as unexpected if there is a code in the error payload

* Add start and finish cert order functions

* Integrate add wildcard cert for external domains

* Use a different endpoint to get a cert by id

* Add new command to download a certificate

* If there are no pending challenges, try to generate the cert right away

* Remove cert download

* Move DNS table options to an object

* Bugfix: cancel spinner message when finish order fails

* Restore add to work only with cert add

* Refactor obtaining cns

* Add start and finish order commands
2018-09-02 23:24:04 +02:00
Leo Lamprecht
a14d4057de 12.0.0-canary.79 2018-09-01 12:18:06 +02:00
Olli Vanhoja
210240ce66 Fix scaling v1 deployments to all DCs (#1556)
```
> Error! An unexpected error occurred in scale: Error: This region (gru1) only accepts Serverless Docker Deployments (400)
```

This is happening because `now-cli` is validating DC names and
expanding "all" locally. However not all DCs have same features but
the client can't be aware of that. Instead of making the client
aware of the differing capabilities of the available DCs we should
pass "all" as a special DC selector, and let the backend handle
scaling properly.
2018-08-28 18:51:52 -07:00
timothyis
d21f7fe75c 12.0.0-canary.78 2018-08-25 15:52:37 +01:00
Timothy
54805cd2a0 Add gru1 (#1545)
* Add gru1

* Add gru to errors

* Hard code sfo,bru scale

* Add --regions argument

* Push with console.log

* Scale to `bru`

* Scale down in bru only
2018-08-25 15:52:16 +01:00
Javi Velasco
c7da2e732a 12.0.0-canary.77 2018-08-24 02:41:01 +02:00
Javi Velasco
4b4beaa892 Pass domain to verify insted of alias when verifying on alias (#1548) 2018-08-24 02:40:35 +02:00
Javi Velasco
e13596acae 12.0.0-canary.76 2018-08-20 20:10:08 +02:00
Javi Velasco
8eb065181f Return scaling validation errors on alias (#1538)
* Return scaling errors on alias

* Join pattern match error in one expression
2018-08-20 19:52:29 +02:00
Javi Velasco
1d97219fef 12.0.0-canary.75 2018-08-20 05:13:55 +02:00
Javi Velasco
d312f94825 Fix updating scale (#1536) 2018-08-20 04:46:55 +02:00
Javi Velasco
478a6f7369 12.0.0-canary.74 2018-08-19 18:22:22 +02:00
Javi Velasco
e309123296 Try to verify against domain name instead of alias (#1534) 2018-08-19 18:21:46 +02:00
Leo Lamprecht
777646cb0e 12.0.0-canary.73 2018-08-13 19:23:27 +02:00
Arunoda Susiripala
39e23f7144 Remove @zeit/schemas (#1507)
We no longer use it inside this repository.
2018-08-13 18:52:58 +02:00
Leo Lamprecht
b68b5c0ea3 12.0.0-canary.72 2018-08-09 12:23:10 +02:00
Sean
46dfeb8ca9 Less cryptic invalid alias message (#1506)
* Less cryptic invalid alias message

* URL -> hostname
2018-08-09 12:23:05 +02:00
Leo Lamprecht
6771ad43af Point Spectrum badge to correct location (#1516) 2018-08-09 12:21:35 +02:00
Luciano Pellacani Franca
1881b9c6cb fixing typo (#1509) 2018-08-07 20:26:05 +01:00
Pranay Prakash
dae6b7a980 12.0.0-canary.71 2018-08-04 03:08:37 +00:00
Pranay Prakash
aed6209f6a Bugfixes and improvements for deployment READY status detection (#1501)
* Have returnify use generators and reinstantiate them upon error

* check for status not_ready instead of 412

* poll every 5s instead of 1s for ready state notification

* poll every 2s for scale verification
2018-08-03 19:31:23 -07:00
Leo Lamprecht
b44a590aa0 12.0.0-canary.70 2018-08-03 08:16:35 +02:00
Olli Vanhoja
936b5fc983 Show selected session affinity when inspecting a deployment (#1489) 2018-08-03 08:12:43 +02:00
yairhaimo
473d6617f2 Include correct help command in now domains (#1492) 2018-08-03 08:11:29 +02:00
Leo Lamprecht
fcf50b5aeb 12.0.0-canary.69 2018-08-02 10:55:58 +02:00
Pranay Prakash
a3835d2e8a Retry 412 errors (#1494)
* retry on 412

* add comment for returnify and exit when the iterator ends
2018-08-02 10:55:02 +02:00
Pranay Prakash
d89481966e poll every 5s (#1496) 2018-08-01 22:56:19 -07:00
Leo Lamprecht
3148ce0f31 12.0.0-canary.68 2018-08-02 07:29:37 +02:00
Leo Lamprecht
f65363856a Better error message for rate limiting deployments (#1495)
* Better error message for rate limiting deployments

* Fixed typo

* Show time until reset

* Removed logging
2018-08-02 07:28:31 +02:00
Leo Lamprecht
e205b57352 12.0.0-canary.67 2018-08-01 13:49:54 +02:00
Aria Malkani
f44a1dbf21 Checks if it is an npm deployment before getting the aliased name (#1490)
* checks it is a npm deployment before reading package.json

* checks if you have a config.type first

* checks if you have a config.type first

* fixed logic for config.type
2018-08-01 13:49:27 +02:00
Leo Lamprecht
b7fe2f606c 12.0.0-canary.66 2018-07-31 10:27:36 +02:00
Leo Lamprecht
6e81c1795c Bumped configuration schemas to the latest version (#1488) 2018-07-31 10:27:22 +02:00
Leo Lamprecht
141d8e4467 12.0.0-canary.65 2018-07-30 13:35:55 +02:00
Robin Millette
edbfeab75f Updated link about authentication file (#1483)
* Fix link to config help

* Update get-default-auth-cfg.js
2018-07-30 13:35:34 +02:00
Robin Millette
e48ea10ebb Updated link about global configuration file (#1482)
* Fix link to config help

* Update get-default-cfg.js
2018-07-30 13:34:52 +02:00
Leo Lamprecht
8565af5526 12.0.0-canary.64 2018-07-30 13:23:30 +02:00
Leo Lamprecht
511d3bae8f Added schema for static header configuration (#1486)
* Added schema for static header configuration

* Bumped yet again
2018-07-30 13:23:07 +02:00
Pranay Prakash
8df233fef1 12.0.0-canary.63 2018-07-29 22:07:06 +00:00
Pranay Prakash
4b97410cc0 Don't downscale previous slot deployment on alias (#1485)
* don't downscale

* use /now/v4/deployments/:id
2018-07-29 15:05:34 -07:00
Leo Lamprecht
aadf8097d1 12.0.0-canary.62 2018-07-24 23:48:57 +02:00
Leo Lamprecht
40d8b74b1b Fixed now billing and use new API (#1477)
* Use correct source when listing

* Use correct source when buying domains

* Replaced the rest too

* Make adding work nicely

* Make listing work for all scopes

* Don't require address

* Bumped lockfile

* Removed more useless code

* Renamed file

* Fixed weird zlib error

* Fixed output

* Added some tests
2018-07-24 23:48:00 +02:00
Leo Lamprecht
8c4d42891c 12.0.0-canary.61 2018-07-22 01:54:51 +02:00
Leo Lamprecht
3672374d23 Fixed integration tests (#1476) 2018-07-22 01:54:05 +02:00
Leo Lamprecht
9ff9d3f174 12.0.0-canary.60 2018-07-19 19:54:19 +02:00
Nathan Rajlich
86540fa7fd Add --build-env to now deploy command (#1459)
* Add `--build-env` to `now deploy` command

Build env vars are only visible during build-time, compared to
regular env vars which are only exposed during runtime.

This also removes the client-side validation of the deployment
schema, because it makes it difficult to keep the client and server
in sync, especially as new features are added. Instead `now-cli`
should be responsible for knowing how to render the server's error
message in an informative and future-proof way so that we can
update the server and even older clients would show the validation
error properly.

* Remove `only` dependency

* Add `--build-env` CLI flag integration test
2018-07-19 19:53:52 +02:00
Pranay Prakash
1538c80a7d 12.0.0-canary.59 2018-07-18 23:29:18 +00:00
Pranay Prakash
0225fcfe51 Improvements to the CLI to handle slot specific flows (#1475)
* Handle scale slots error

* generate and send a requestID when verifying instantiation

* Don't compy incompatible scale settings

* deprecate BinaryDeployment

* add err.sh link

* swap cuid for uuid
2018-07-18 16:26:07 -07:00
Leo Lamprecht
57f3861de6 12.0.0-canary.58 2018-07-17 09:50:26 +02:00
Arunoda Susiripala
04c365a251 Add more integration tests (#1466)
* Add more integration tests related to static builds and env
Here we are adding a few more integration tests for static builds and for using env vars in the build step.

* Add build-env related test case.
2018-07-17 09:47:21 +02:00
Nathan Rajlich
7dfe4690ce 12.0.0-canary.57 2018-07-17 00:10:17 -07:00
Nathan Rajlich
92bcf1b7c9 Remove shallow deployment verification (#1474)
Remove shallow deployment verification
2018-07-17 00:08:55 -07:00
Igor Klopov
8a15d5c65a retry createDeploy if files are missing. addresses #1463 (#1465) 2018-07-13 18:26:12 +03:00
Leo Lamprecht
f64374225d 12.0.0-canary.56 2018-07-11 15:37:44 +02:00
Javi Velasco
7537eac6a7 Control can't solve challenge errors (#1458) 2018-07-11 15:37:22 +02:00
Leo Lamprecht
e2880d2434 12.0.0-canary.55 2018-07-10 19:28:01 +02:00
Javi Velasco
8296de16ef Check domain after adding (#1455)
* Check domain info after adding it

* Add message spiner to show while adding a domain
2018-07-10 19:27:42 +02:00
Leo Lamprecht
5cff5e9dfd 12.0.0-canary.54 2018-07-10 12:16:13 +02:00
Javi Velasco
cb07a748c2 Refactor DNS and update domains with CDN improvements (#1438)
* Do not allow adding domains with subdomains

* Do not ask for confirmation when the domain exists

* Improve message when the domain is under a different account

* Fix flow errors

* Revamp domains add command

* Remove setting dns records when setting up the domain

* Refactor DNS commands

* Hide fields in system dns records and show creator

* Better formatting for dns ls

* Remove exhaustive check of dns record type

* Remove domain ids from responses in domain commands

* Change all `domains` API references to use `v3`

* Update to domains API v3

* Remove NeedUpgrade error and use CDNNeedsUpgrade where it proceeds

* Update copies when adding domains

* Remove extra blank line

* Fix flow errors
2018-07-10 12:13:45 +02:00
Nathan Rajlich
c7b985bdc6 Remove legacy atlas logic (#1451)
* Remove legacy `atlas` logic

No longer used for anything.

* Remove another `atlas`
2018-07-10 11:43:00 +02:00
Javi Velasco
bf32ca0e4a Dont try to generate always wildcard certs when aliasing (#1445)
* Change params order in createAlias

* Make setupDomain return domainInfo

* Do not try to get a wildcard cert for alias when domain is external

* Update setup-domain.js
2018-07-10 11:42:37 +02:00
Javi Velasco
a4e52de0e3 Add retryAfter info to rate limit errors (#1442) 2018-07-10 11:41:28 +02:00
Nathan Rajlich
e43e9b11a0 Wait for static builds to be ready and show logs (#1452)
Implicitly sets the `noVerify` option since there is nothing to verify.
2018-07-10 01:11:10 -07:00
Javi Velasco
847b9e97c4 12.0.0-canary.53 2018-07-09 13:05:01 +02:00
Javi Velasco
baad689286 Fix typo when checking NS during setup domain (#1450) 2018-07-09 12:53:11 +02:00
Arunoda Susiripala
5e7afc4385 12.0.0-canary.52 2018-07-09 09:40:37 +05:30
Matheus Fernandes
d724b7a631 Revert "Upgrade to webpack 4 and latest Babel" (#1448)
* Revert "12.0.0-canary.51"

This reverts commit 5e17fe5ad6.

* Revert "Update `@zeit/schemas` to v1.6.0"

This reverts commit b216adadc0.

* Revert "Upload the Dockerfile if it's a static deployment. (#1437)"

This reverts commit 5078c95667.

* Revert "Upgrade to webpack 4 and latest Babel (#1436)"

This reverts commit 7612d77647.
2018-07-08 20:48:55 -07:00
Nathan Rajlich
5e17fe5ad6 12.0.0-canary.51 2018-07-05 17:52:14 -07:00
Nathan Rajlich
b216adadc0 Update @zeit/schemas to v1.6.0 2018-07-05 17:39:38 -07:00
Arunoda Susiripala
5078c95667 Upload the Dockerfile if it's a static deployment. (#1437)
* Upload the Dockerfile if it's a static deployment.
This allows us to build the Dockerfile and upload static assets

* Allow to upload package.json as well for static deployments.
2018-07-05 22:32:19 +05:30
Javi Velasco
7612d77647 Upgrade to webpack 4 and latest Babel (#1436)
* Upgrade to webpack 4 and last latest

* Fix building commands

* Do not call yarn build when yarn link

* Use resolved paths in webpack config
2018-07-04 17:51:16 +01:00
Leo Lamprecht
0d76041c10 12.0.0-canary.50 2018-07-03 21:20:17 +02:00
Javi Velasco
59be596d24 Allow to deploy and alias when non essential APIs are down (#1435)
* Try to purchase a domain only when there is no other choice

* Allow eventsStream to fail during deployment

* Allow to verify instantiation without events API
2018-07-03 12:18:54 -07:00
Leo Lamprecht
63e51a3c98 12.0.0-canary.49 2018-07-02 11:31:15 +02:00
Leo Lamprecht
7f3128b3e5 Fixed the tests (#1430)
* Fixed the tests

* Wrapped up
2018-07-02 11:30:44 +02:00
Leo Lamprecht
c235813ae7 12.0.0-canary.48 2018-06-22 21:50:33 +02:00
Javi Velasco
3ee18e7051 Small fixes (#1418)
* Remove FlowFixMe in deploy command

* Show success message when creating a cert for alias based on response cns
2018-06-21 23:04:40 -07:00
Leo Lamprecht
14fc5d8796 12.0.0-canary.47 2018-06-21 12:53:44 +02:00
Leo Lamprecht
9fb0077385 Improved error message for schema validation (#1416)
* Bumped schema

* Improved error message for schema validation
2018-06-21 12:53:12 +02:00
Javi Velasco
2e9c7265b6 12.0.0-canary.46 2018-06-19 17:13:48 +02:00
Javi Velasco
d9e77b784a Allow to enable and disable CDN for domains and refactor domains (#1413)
* Move domains command to its own folder

* Refactor domains commands

* Add cdn to domain ls

* Add function to patch domains

* Support toggling cdnEnabled

* Better messages

* Add new cdn options to help command in domains
2018-06-19 17:12:55 +02:00
Javi Velasco
b5b296ad7f 12.0.0-canary.45 2018-06-15 17:35:53 +02:00
Javi Velasco
acdfde5aa2 Deeply nested wildcard certs (#1407)
* Better error when we can't verify a domain during alias

* Remove preferDNS option from CLI and allow wildcard certs for deeply nested
2018-06-15 12:04:10 +02:00
Pranay Prakash
0eddfbd28c Improve the progress bar during upload (#1406)
* use push instead of read

* don't auto-clear

* single progress bar that hangs till last chink

* print symmary beofre link

* print smmary faster

* print more discreet timestamps

* fix tests

* fix flow error
2018-06-13 23:21:39 -04:00
Javi Velasco
037f0610bc 12.0.0-canary.44 2018-06-13 15:39:27 +02:00
Javi Velasco
dd45f8f2ab Request normal cert for deeply nested alias (#1404)
* Request normal cert for deeply nested alias

* When is a deeply nested domain request a normal cert
2018-06-13 15:38:47 +02:00
Leo Lamprecht
d454c84f61 12.0.0-canary.43 2018-06-11 10:40:32 +02:00
Felix Yan
a4c98e07a5 Fix a typo in unique-strings.js (#1400) 2018-06-08 12:20:57 -07:00
Igor Klopov
85715630bd test-integration: test deployment logs output (#1398) 2018-06-08 04:31:36 -07:00
Nathan Rajlich
45d8d4a84f 12.0.0-canary.42 2018-06-07 14:48:16 -07:00
Nathan Rajlich
690882c97a Fix shallow verify (#1397) 2018-06-07 14:45:27 -07:00
Leo Lamprecht
e03836e4a1 12.0.0-canary.41 2018-06-07 11:00:32 +02:00
Leo Lamprecht
d4ec54135a Updated configuration schema (#1394) 2018-06-07 10:59:51 +02:00
Javi Velasco
b29785d851 Ensure there is scale rules before trying to apply (#1389) 2018-06-07 10:52:24 +02:00
Javi Velasco
148870d706 Fixed unexpected error while aliasing (#1387) 2018-06-07 10:50:49 +02:00
Nathan Rajlich
ed1f7e335d Add shallow deployment verification (#1367)
* Add shallow deployment verification

* Add Flow type for `now.retry()`

* Add 3 fetch retries to shallow verify

* Use generics

* Collapse

* Fix

* Add `X-Now-Shallow` verification
2018-06-06 13:08:19 -07:00
Matheus Fernandes
eaf4695194 12.0.0-canary.40 2018-06-01 15:59:43 -07:00
Igor Klopov
c312d42302 reuse getSafeAlias function for all callers of findAliasByAliasOrId (#1385) 2018-06-02 01:27:47 +03:00
Leo Lamprecht
a8a2a6c066 12.0.0-canary.39 2018-05-29 20:07:19 +02:00
Leo Lamprecht
8b3512cb07 Bumped configuration schemas to the latest version (#1379) 2018-05-29 20:06:57 +02:00
Leo Lamprecht
945facdd2c 12.0.0-canary.38 2018-05-29 18:36:15 +02:00
Javi Velasco
8676ed4cff Support for Custom Deployment Suffix (#1378)
* Allow to fallback to passed body parsing a response error

* Extract domain purchase from setup-domain

* Move getCertRequestSettings

* Add create method to Now interface

* Extract print dns table and zeit world table functions

* Add support to generate certificates during deploy

* Point to v5 in deploy endpoint

* Add feedback messages when creating a cert during deployment

* Remove hardcoded references to now.sh

* Dont bump create endpoint version

* Support empty reponses in fetch
2018-05-29 07:58:24 -07:00
Leo Lamprecht
e4d4afa840 12.0.0-canary.37 2018-05-28 13:16:13 +02:00
Leo Lamprecht
81cf286ea4 Bumped configuration schemas to the latest version (#1374) 2018-05-28 13:15:58 +02:00
Leo Lamprecht
e834625728 12.0.0-canary.36 2018-05-28 09:07:30 +02:00
Pranay Prakash
a7c22eb08c add @zeit/dockerignore (#1373) 2018-05-26 09:51:56 -07:00
Leo Lamprecht
837c358371 12.0.0-canary.35 2018-05-25 20:58:30 +02:00
Leo Lamprecht
9743db27e7 Updated configuration schemas to the latest version (#1372) 2018-05-25 11:54:27 -07:00
Tim Neutkens
ce725143e6 12.0.0-canary.34 2018-05-22 17:32:26 +02:00
Tim Neutkens
677805c33a Make sure subdomain is correctly typed / checked (#1364)
Fixes an error introduced in #1344 when running `now alias` on a naked domain like `example.com`.
2018-05-22 17:31:25 +02:00
Pranay Prakash
3d3f1fe39b Make the progress bar for uploads consider bytes, not number of files (#1335)
* use got and propogate uploadProgress

* Accept comma separated cns (#1336)

* use got and propogate uploadProgress

* hook into stream.read

* revert `got` stuff

* remove stray whitespace
2018-05-21 16:40:24 -07:00
Pranay Prakash
123c68ad2b fix clipboard arg parsing (#1358) 2018-05-21 16:39:40 -07:00
Timothy
86861c58af Fix error message via #1350 (#1361) 2018-05-21 16:39:22 -07:00
Pranay Prakash
d4ddb6b3f9 Strip quotes from Dockerfile labels (#1351)
* Strip quotes from Dockerfile labels

* remove console.log

* add test

* issue normal cert for nested subdomain (#1344)

* Prefer HTTP challenge for regular certs

* 12.0.0-canary.31

* Update non-existing team test

* 12.0.0-canary.32

* Bumped `update-check` to the latest version (#1354)

* 12.0.0-canary.33

* Strip quotes from Dockerfile labels

* remove console.log

* add test
2018-05-21 16:39:06 -07:00
Leo Lamprecht
0fc7de40d4 12.0.0-canary.33 2018-05-18 14:06:57 +02:00
Leo Lamprecht
3cb4a9c8dd Bumped update-check to the latest version (#1354) 2018-05-18 14:06:18 +02:00
Javi Velasco
d681289457 12.0.0-canary.32 2018-05-18 03:24:28 +02:00
Javi Velasco
bc1c3c3f5b Update non-existing team test 2018-05-18 03:24:08 +02:00
Javi Velasco
5ae4287c0f 12.0.0-canary.31 2018-05-18 03:02:00 +02:00
Javi Velasco
cde9f56886 Prefer HTTP challenge for regular certs 2018-05-18 03:01:26 +02:00
Pranay Prakash
2b6b006bbd issue normal cert for nested subdomain (#1344) 2018-05-18 02:32:12 +02:00
Leo Lamprecht
54e1bcafc0 12.0.0-canary.30 2018-05-16 21:28:21 +02:00
Leo Lamprecht
7e98d0a22b Store config on platform & load schema from package (#1349)
* Load schema from package

* Send config to deployment endpoint

* Upgraded @zeit/schemas to the latest version

* Removed type for now

* Added config correctly
2018-05-16 21:26:41 +02:00
Tim Neutkens
c27b4a6aaf 12.0.0-canary.29 2018-05-16 18:08:53 +02:00
Javi Velasco
8f17ffd817 Fix table import (#1348) 2018-05-16 18:07:58 +02:00
Leo Lamprecht
0a7d688d32 12.0.0-canary.28 2018-05-15 21:58:07 +02:00
Leo Lamprecht
8cb2fe1284 Account for npm being down (#1346)
* Corrected license file name

* Corrected readme name

* Added editorconfig

* Account for npm being down

* Print full error

* Only show full error while debugging
2018-05-15 21:57:40 +02:00
Leo Lamprecht
e6e375232e 12.0.0-canary.27 2018-05-15 10:07:03 +02:00
Guillermo Rauch
08c4ab8a0c Updated error message about verification timeout 2018-05-15 10:06:37 +02:00
Leo Lamprecht
f86647fc26 12.0.0-canary.26 2018-05-15 10:01:29 +02:00
Javi Velasco
f310f6a86f Accept comma separated cns (#1336) 2018-05-08 21:36:53 +02:00
Javi Velasco
58c6acd265 12.0.0-canary.25 2018-04-27 22:02:10 -07:00
Igor Klopov
c7d97e3866 ignore keep-alive packets for now logs -f (#1331) 2018-04-27 21:45:47 -07:00
Javi Velasco
0890144c61 12.0.0-canary.24 2018-04-26 11:13:14 -07:00
Javi Velasco
69a7d91b57 Safe deployment polling and other minor fixes (#1330)
* Initialize polling function from args

* Remove rule of having a mandatory dest field in path alias rules

* Wait 5 seconds after getting the deployment ready

* Ignore errors coming from events stream
2018-04-26 11:07:15 -07:00
Javi Velasco
a9016c88f6 Refactor scale and remove old alias and scale (#1321)
* Migrate to arg@2.0.0

* Refactor scale command

* Move alias.js to alias/index.js

* Move alias set to its own file

* Move alias ls to its own file

* Move alias rm to its own file

* Remove old alias and scale files

* Update alias integration test

* Fix scaling to 0

* Read scale params from now.json on deploy
2018-04-24 19:16:25 -07:00
Igor Klopov
e8990742cf handle keep-alive event in inspect command (#1326) 2018-04-22 20:16:02 -07:00
Javi Velasco
f51400a3a1 12.0.0-canary.23 2018-04-18 11:27:15 -07:00
Javi Velasco
e763ee5301 Handle ENOENT error when deploying unexistent path (#1320)
* Handle ENOENT error when deploying unexistent path

* Show success on dedupped deployments
2018-04-18 11:26:47 -07:00
Javi Velasco
fd978699e8 Migrate to arg@2.0.0 (#1316) 2018-04-17 19:28:45 -07:00
Javi Velasco
bbd9585829 Fix double ambiguous deploy prompt (#1318) 2018-04-17 19:20:27 -07:00
Javi Velasco
54cf1ebb31 12.0.0-canary.22 2018-04-17 18:07:07 -07:00
Javi Velasco
6fc77c6cfa Fix 0 min scale (#1317) 2018-04-17 18:05:04 -07:00
Javi Velasco
f8372e3bb9 12.0.0-canary.21 2018-04-17 10:49:33 -07:00
Naoyuki Kanezawa
6728be7b1a improve image upload (#1293) 2018-04-17 10:37:17 -07:00
Javi Velasco
65e1a1e731 Fix number of instances verification (#1315) 2018-04-17 10:32:32 -07:00
Javi Velasco
cd9478e853 12.0.0-canary.20 2018-04-16 17:46:47 -07:00
Javi Velasco
b9364ed4fc Improve instance verification for deploy (#1313)
* Refactor verify instances for deploy

* Don't rely on return

* Use new verify instances in alias

* Use new verify instances in alias
2018-04-16 17:45:19 -07:00
Leo Lamprecht
2715e8e9d8 12.0.0-canary.19 2018-04-13 23:23:44 -07:00
Javi Velasco
f987c93cf0 Replace combine-async-generators (#1305)
* Replace combine-asyng-generators

* Ignore empty objects from events stream

* Update type for alias event
2018-04-13 21:55:06 -07:00
Javi Velasco
5c254a7151 Print response in docker test (#1304)
* Print response when failing in docker test file

* Add line

* Parse response text as JSON, print if it fails
2018-04-13 19:49:18 -07:00
Leo Lamprecht
f253e29f33 12.0.0-canary.18 2018-04-13 19:05:49 -07:00
Leo Lamprecht
f37fa13eab Added missing dependencies (#1303) 2018-04-13 19:00:17 -07:00
Javi Velasco
64765b393a Refactor deploy events printing (#1302)
* Move deploy command to its own directory

* Do not show success on downscale message

* Move getDeploymentByIdOrHost to /util/deploy

* Remove unneeded parameter in getAppName

* Better types for copyToClipboard

* Update to babel 7

* Add generator utility functions

* Add function to get deployment events

* Finish  getDeploymentEvents after getting one state-change event

* Refactor deploy events and reduce verification timeout

* Reduce verification timeout for scale and alias

* Use output.log for success message in scale

* Fix integration tests
2018-04-13 18:33:27 -07:00
Leo Lamprecht
54c84b4ce0 12.0.0-canary.17 2018-04-11 12:23:06 -07:00
Javi Velasco
146bcba794 Remove old certs command (#1295) 2018-04-11 12:22:49 -07:00
Leo Lamprecht
d3dd1b731d 12.0.0-canary.16 2018-04-11 11:43:12 -07:00
Javi Velasco
d608ee7390 Remove old alias command (#1294) 2018-04-11 11:42:38 -07:00
Leo Lamprecht
4e2e0950c7 12.0.0-canary.15 2018-04-10 17:53:51 -07:00
Leo Lamprecht
ddc7e97ab6 Fixed typo in release instructions 2018-04-10 17:53:27 -07:00
Leo Lamprecht
a21759ee42 Resolved conflicts 2018-04-10 17:53:02 -07:00
Leo Lamprecht
cc4beb94cf Merge branch 'master' into canary 2018-04-10 17:47:11 -07:00
Leo Lamprecht
0bfafa9311 12.0.0-canary.14 2018-04-10 16:38:48 -07:00
Leo Lamprecht
4eefc34629 Moved documentation for releasing out 2018-04-10 16:26:44 -07:00
Leo Lamprecht
4d3f882dc0 Make clear how a release works exactly 2018-04-10 16:08:39 -07:00
Leo Lamprecht
3a802fbb70 Improved intro and contribution section 2018-04-10 16:07:31 -07:00
Leo Lamprecht
6f00b03d24 Made sure the integration tests work as expected 2018-04-10 15:46:41 -07:00
4089 changed files with 461112 additions and 263306 deletions

View File

@@ -1,490 +0,0 @@
version: 2
jobs:
install:
docker:
- image: circleci/node:10
working_directory: ~/repo
environment:
GOPATH: $HOME/go
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "yarn.lock" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run:
name: Updating apt packages
command: sudo apt-get update
- run:
name: Installing the latest version of Go
command: sudo apt-get install golang-go
- run:
name: Installing Dependencies
command: yarn install --check-files --frozen-lockfile
- save_cache:
paths:
- node_modules
- packages/gatsby-plugin-now/node_modules
- packages/now-build-utils/node_modules
- packages/now-cgi/node_modules
- packages/now-cli/node_modules
- packages/now-client/node_modules
- packages/now-go/node_modules
- packages/now-next/node_modules
- packages/now-node/node_modules
- packages/now-node-bridge/node_modules
- packages/now-python/node_modules
- packages/now-routing-utils/node_modules
- packages/now-ruby/node_modules
- packages/now-static-build/node_modules
key: v1-dependencies-{{ checksum "yarn.lock" }}
- persist_to_workspace:
root: .
paths:
- node_modules
- packages/gatsby-plugin-now/node_modules
- packages/now-build-utils/node_modules
- packages/now-cgi/node_modules
- packages/now-cli/node_modules
- packages/now-client/node_modules
- packages/now-go/node_modules
- packages/now-next/node_modules
- packages/now-node/node_modules
- packages/now-node-bridge/node_modules
- packages/now-python/node_modules
- packages/now-routing-utils/node_modules
- packages/now-ruby/node_modules
- packages/now-static-build/node_modules
build:
docker:
- image: circleci/node:10
working_directory: ~/repo
steps:
- checkout
- run:
name: Installing apt dependencies
command: sudo apt install -y rsync
- attach_workspace:
at: .
- run:
name: Linking dependencies
command: yarn bootstrap
- run:
name: Building
command: yarn build
- store_artifacts:
path: packages/now-cli/dist
- persist_to_workspace:
root: .
paths:
- packages/gatsby-plugin-now/test/fixtures
- packages/now-build-utils/dist
- packages/now-cgi/dist
- packages/now-cli/dist
- packages/now-cli/assets
- packages/now-client/dist
- packages/now-go/dist
- packages/now-next/dist
- packages/now-node/dist
- packages/now-node/test/fixtures/15-helpers/ts/types.d.ts
- packages/now-node/test/fixtures/11-symlinks/symlink
- packages/now-node-bridge/index.js
- packages/now-node-bridge/bridge.js
- packages/now-python/dist
- packages/now-routing-utils/dist
- packages/now-ruby/dist
- packages/now-static-build/dist
- packages/now-static-build/test/fixtures/10a-gatsby-redirects/plugins
test-lint:
docker:
- image: circleci/node:10
working_directory: ~/repo
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Compiling `now dev` HTML error templates
command: node packages/now-cli/scripts/compile-templates.js
- run:
name: Linting Code
command: yarn test-lint
test-integration-macos-node-8:
macos:
xcode: '9.2.0'
working_directory: ~/repo
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Update Node.js
command: curl -sfLS install-node.now.sh/8.11 | sh -s -- --yes
- run:
name: Output version
command: node --version
- run:
name: Running Integration Tests
command: yarn test-integration --clean false
test-integration-macos-node-10:
macos:
xcode: '10.0.0'
working_directory: ~/repo
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Output version
command: node --version
- run:
name: Running Integration Tests
command: yarn test-integration --clean false
test-integration-macos-node-12:
macos:
xcode: '10.3.0'
working_directory: ~/repo
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Output version
command: node --version
- run:
name: Running Integration Tests
command: yarn test-integration --clean false
test-integration-linux-node-8:
docker:
- image: circleci/node:8
working_directory: ~/repo
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Output version
command: node --version
- run:
name: Running Integration Tests
command: yarn test-integration --clean false
test-integration-linux-node-10:
docker:
- image: circleci/node:10
working_directory: ~/repo
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Output version
command: node --version
- run:
name: Running Integration Tests
command: yarn test-integration --clean false
test-integration-linux-node-12:
docker:
- image: circleci/node:12
working_directory: ~/repo
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Output version
command: node --version
- run:
name: Running Integration Tests
command: yarn test-integration --clean false
test-integration-macos-now-dev-node-8:
macos:
xcode: '9.2.0'
working_directory: ~/repo
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Update Node.js
command: curl -sfLS install-node.now.sh/8.11 | sh -s -- --yes
- run:
name: Output version
command: node --version
- run:
name: Downloading Hugo
command: 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:
name: Running Integration Tests for `now dev`
command: yarn test-integration-now-dev --clean false
test-integration-macos-now-dev-node-10:
macos:
xcode: '10.0.0'
working_directory: ~/repo
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Output version
command: node --version
- run:
name: Downloading Hugo
command: 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:
name: Running Integration Tests for `now dev`
command: yarn test-integration-now-dev --clean false
test-integration-macos-now-dev-node-12:
macos:
xcode: '10.3.0'
working_directory: ~/repo
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Output version
command: node --version
- run:
name: Downloading Hugo
command: 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:
name: Running Integration Tests for `now dev`
command: yarn test-integration-now-dev --clean false
test-integration-linux-now-dev-node-8:
docker:
- image: circleci/node:8
working_directory: ~/repo
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Output version
command: node --version
- run:
name: Downloading Hugo
command: curl -L -O https://github.com/gohugoio/hugo/releases/download/v0.55.6/hugo_0.55.6_Linux-64bit.tar.gz && tar -xzf hugo_0.55.6_Linux-64bit.tar.gz && mv ./hugo packages/now-cli/test/dev/fixtures/08-hugo/
- run:
name: Running Integration Tests for `now dev`
command: yarn test-integration-now-dev --clean false
test-integration-linux-now-dev-node-10:
docker:
- image: circleci/node:10
working_directory: ~/repo
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Output version
command: node --version
- run:
name: Downloading Hugo
command: curl -L -O https://github.com/gohugoio/hugo/releases/download/v0.55.6/hugo_0.55.6_Linux-64bit.tar.gz && tar -xzf hugo_0.55.6_Linux-64bit.tar.gz && mv ./hugo packages/now-cli/test/dev/fixtures/08-hugo/
- run:
name: Running Integration Tests for `now dev`
command: yarn test-integration-now-dev --clean false
test-integration-linux-now-dev-node-12:
docker:
- image: circleci/node:12
working_directory: ~/repo
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Output version
command: node --version
- run:
name: Downloading Hugo
command: curl -L -O https://github.com/gohugoio/hugo/releases/download/v0.55.6/hugo_0.55.6_Linux-64bit.tar.gz && tar -xzf hugo_0.55.6_Linux-64bit.tar.gz && mv ./hugo packages/now-cli/test/dev/fixtures/08-hugo/
- run:
name: Running Integration Tests for `now dev`
command: yarn test-integration-now-dev --clean false
test-integration-once:
docker:
- image: circleci/node:10
working_directory: ~/repo
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Output version
command: node --version
- run:
name: Running Integration Tests Once
command: yarn test-integration-once --clean false
coverage:
docker:
- image: circleci/node:10
working_directory: ~/repo
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Compiling `now dev` HTML error templates
command: node packages/now-cli/scripts/compile-templates.js
- run:
name: Run unit tests
command: yarn workspace now run test-unit
- run:
name: Run coverage report
command: yarn workspace now run coverage
source-maps:
docker:
- image: circleci/node:10
working_directory: ~/repo
steps:
- checkout
- attach_workspace:
at: .
- run:
name: Installing Sentry CLI
command: npm install -g @sentry/cli
- run:
name: Creating a New Sentry Release
command: sentry-cli releases new now-cli@`git describe --tags`
- run:
name: Upload Sourcemap Files
command: sentry-cli releases files now-cli@`git describe --tags` upload-sourcemaps ./dist
- run:
name: Finalize Sentry Release
command: sentry-cli releases finalize now-cli@`git describe --tags`
workflows:
version: 2
unscheduled:
jobs:
- install:
filters:
tags:
only: /.*/
- build:
requires:
- install
filters:
tags:
only: /.*/
- test-lint:
requires:
- build
filters:
tags:
only: /.*/
- test-integration-macos-node-8:
requires:
- build
filters:
tags:
only: /.*/
- test-integration-macos-node-10:
requires:
- build
filters:
tags:
only: /.*/
- test-integration-macos-node-12:
requires:
- build
filters:
tags:
only: /.*/
- test-integration-linux-node-8:
requires:
- build
filters:
tags:
only: /.*/
- test-integration-linux-node-10:
requires:
- build
filters:
tags:
only: /.*/
- test-integration-linux-node-12:
requires:
- build
filters:
tags:
only: /.*/
- test-integration-macos-now-dev-node-8:
requires:
- build
filters:
tags:
only: /.*/
- test-integration-macos-now-dev-node-10:
requires:
- build
filters:
tags:
only: /.*/
- test-integration-macos-now-dev-node-12:
requires:
- build
filters:
tags:
only: /.*/
- test-integration-linux-now-dev-node-8:
requires:
- build
filters:
tags:
only: /.*/
- test-integration-linux-now-dev-node-10:
requires:
- build
filters:
tags:
only: /.*/
- test-integration-linux-now-dev-node-12:
requires:
- build
filters:
tags:
only: /.*/
- test-integration-once:
requires:
- build
filters:
tags:
only: /.*/
- coverage:
requires:
- test-integration-macos-node-8
- test-integration-macos-node-10
- test-integration-macos-node-12
- test-integration-linux-node-8
- test-integration-linux-node-10
- test-integration-linux-node-12
- test-integration-macos-now-dev-node-8
- test-integration-macos-now-dev-node-10
- test-integration-macos-now-dev-node-12
- test-integration-linux-now-dev-node-8
- test-integration-linux-now-dev-node-10
- test-integration-linux-now-dev-node-12
- test-integration-once
- test-lint
filters:
tags:
only: /.*/

View File

@@ -1,34 +0,0 @@
#!/bin/bash
set -euo pipefail
if [ -z "$NPM_TOKEN" ]; then
echo "NPM_TOKEN not found. Did you forget to assign the GitHub Action secret?"
exit 1
fi
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
if [ ! -e ~/.npmrc ]; then
echo "~/.npmrc file does not exist, skipping publish"
exit 0
fi
npm_tag=""
tag="$(git describe --tags --exact-match 2> /dev/null || :)"
if [ -z "$tag" ]; then
echo "Not a tagged commit, skipping publish"
exit 0
fi
if [[ "$tag" =~ -canary ]]; then
echo "Publishing canary release"
npm_tag="--npm-tag canary"
else
echo "Publishing stable release"
fi
# Sometimes this is a false alarm and blocks publish
git checkout yarn.lock
yarn run lerna publish from-git $npm_tag --yes

View File

@@ -19,6 +19,11 @@ indent_style = space
[*.py] [*.py]
indent_size = 4 indent_size = 4
[*.go]
indent_style = tab
indent_size = 4
tab_width = 4
[*.asm] [*.asm]
indent_size = 8 indent_size = 8

View File

@@ -1,32 +1,40 @@
node_modules node_modules
dist dist
examples
# gatsby-plugin-now # gatsby-plugin-now
packages/gatsby-plugin-now/test/fixtures packages/gatsby-plugin-now/test/fixtures
# now-cli # build-utils
packages/now-cli/@types packages/build-utils/test/fixtures
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 # cli
packages/now-client/tests/fixtures packages/cli/@types
packages/now-client/lib packages/cli/download
packages/cli/dist
packages/cli/test/fixtures
packages/cli/test/dev/fixtures
packages/cli/bin
packages/cli/link
packages/cli/src/util/dev/templates/*.ts
# now-next # client
packages/now-next/test/fixtures packages/client/tests/fixtures
packages/client/lib
# now-node # next
packages/now-node/src/bridge.ts packages/next/test/fixtures
packages/now-node/test/fixtures
# now-node-bridge # node
packages/now-node-bridge/bridge.* packages/node/src/bridge.ts
packages/node/test/fixtures
# now-static-build # node-bridge
packages/now-static-build/test/fixtures packages/node-bridge/bridge.*
# static-build
packages/static-build/test/fixtures
packages/static-build/test/build-fixtures
# redwood
packages/redwood/test/fixtures

View File

@@ -1,64 +0,0 @@
{
"root": true,
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module",
"modules": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"prettier",
"prettier/@typescript-eslint"
],
"env": {
"node": true,
"jest": true,
"es6": true
},
"rules": {
"require-atomic-updates": 0,
"@typescript-eslint/ban-ts-ignore": 0,
"@typescript-eslint/camelcase": 0,
"@typescript-eslint/explicit-function-return-type": 0,
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-use-before-define": 0
},
"overrides": [
{
"files": ["**/*.js"],
"rules": {
"@typescript-eslint/no-var-requires": "off"
}
},
{
"files": ["packages/now-cli/**/*"],
"rules": {
"lines-between-class-members": 0,
"no-async-promise-executor": 0,
"no-control-regex": 0,
"no-empty": 0,
"prefer-const": 0,
"prefer-destructuring": 0,
"@typescript-eslint/ban-types": 0,
"@typescript-eslint/consistent-type-assertions": 0,
"@typescript-eslint/member-delimiter-style": 0,
"@typescript-eslint/no-empty-function": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-inferrable-types": 0,
"@typescript-eslint/no-var-requires": 0
}
},
{
"files": ["packages/now-client/**/*"],
"rules": {
"prefer-const": 0,
"require-atomic-updates": 0,
"@typescript-eslint/ban-ts-ignore": 0,
"@typescript-eslint/no-explicit-any": 0
}
}
]
}

7
.gitattributes vendored
View File

@@ -1,3 +1,10 @@
# Ignore test fixtures in GitHub Languages # Ignore test fixtures in GitHub Languages
# See https://github.com/github/linguist#vendored-code # See https://github.com/github/linguist#vendored-code
examples/* linguist-vendored
utils/* linguist-vendored
test/* linguist-vendored
packages/*/test/* linguist-vendored packages/*/test/* linguist-vendored
# Go build fails with Windows line endings.
*.go text eol=lf
go.mod text eol=lf

39
.github/CODEOWNERS vendored
View File

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

74
.github/CODE_OF_CONDUCT.md vendored Normal file
View File

@@ -0,0 +1,74 @@
## Code of Conduct
### Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.
### Our Standards
Examples of behavior that contributes to creating a positive environment
include:
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting
### Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
### Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
### Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [coc@vercel.com](mailto:coc@vercel.com). All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
### Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/

96
.github/CONTRIBUTING.md vendored Normal file
View File

@@ -0,0 +1,96 @@
# Contributing
When contributing to this repository, please first discuss the change you wish to make via [GitHub Discussions](https://github.com/vercel/vercel/discussions/new) with the owners of this repository before submitting a Pull Request.
Please read our [code of conduct](CODE_OF_CONDUCT.md) and follow it in all your interactions with the project.
## Local development
This project is configured in a monorepo pattern where one repo contains multiple npm packages. Dependencies are installed and managed with `yarn`, not `npm` CLI.
To get started, execute the following:
```
git clone https://github.com/vercel/vercel
yarn install
yarn bootstrap
yarn build
yarn lint
yarn test
```
Make sure all the tests pass before making changes.
## Verifying your change
Once you are done with your changes (we even suggest doing it along the way ), make sure all the test still run by running
```
yarn build && yarn test
```
from the root of the project.
If any test fails, make sure to fix it along with your changes. See [Interpreting test errors](#Interpreting-test-errors) for more information about how the tests are executed, especially the integration tests.
## Pull Request Process
Once you are confident that your changes work properly, open a pull request on the main repository.
The pull request will be reviewed by the maintainers and the tests will be checked by our continuous integration platform.
## Interpreting test errors
There are 2 kinds of tests in this repository Unit tests and Integration tests.
Unit tests are run locally with `jest` and execute quickly because they are testing the smallest units of code.
### Integration tests
Integration tests create deployments to your Vercel account using the `test` project name. After each test is deployed, the `probes` key is used to check if the response is the expected value. If the value doesn't match, you'll see a message explaining the difference. If the deployment failed to build, you'll see a more generic message like the following:
```
[Error: Fetched page https://test-8ashcdlew.now.sh/root.js does not contain hello Root!. Instead it contains An error occurred with this application.
NO_STATUS_CODE_FRO Response headers:
cache-control=s-maxage=0
connection=close
content-type=text/plain; charset=utf-8
date=Wed, 19 Jun 2019 18:01:37 GMT
server=now
strict-transport-security=max-age=63072000
transfer-encoding=chunked
x-now-id=iad1:hgtzj-1560967297876-44ae12559f95
x-now-trace=iad1]
```
In such cases you can visit the URL of the failed deployment and append `/_logs` so see the build error. In the case above, that would be https://test-8ashcdlew.now.sh/_logs
The logs of this deployment will contain the actual error which may help you to understand what went wrong.
### @vercel/nft
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 { nodeFileTrace } = require('@vercel/nft');
nodeFileTrace(['path/to/entrypoint.js'], {
ts: true,
mixedModules: true,
})
.then(o => console.log(o.fileList))
.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 [@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/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

25
.github/EXAMPLE_README_TEMPLATE.md vendored Normal file
View File

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

11
.github/ISSUE_TEMPLATE/config.yml vendored Normal file
View File

@@ -0,0 +1,11 @@
blank_issues_enabled: false
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=ideas
about: Share ideas for new features
- name: Ask a Question
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

18
.github/workflows/cancel.yml vendored Normal file
View File

@@ -0,0 +1,18 @@
name: Cancel
on:
push:
branches:
- '**'
- '!main'
jobs:
cancel:
name: 'Cancel Previous Runs'
runs-on: ubuntu-latest
timeout-minutes: 2
steps:
- uses: styfle/cancel-workflow-action@0.4.1
with:
workflow_id: 849295, 849296, 849297, 849298
access_token: ${{ github.token }}

View File

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

View File

@@ -0,0 +1,40 @@
name: CLI
on:
push:
branches:
- main
tags:
- '!*'
pull_request:
jobs:
test:
name: CLI
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
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 main --depth=100
- run: git fetch origin ${{ github.ref }} --depth=100
- run: git diff origin/main...HEAD --name-only
- run: yarn install --network-timeout 1000000
- run: yarn run build
- run: yarn test-integration-cli --clean false
env:
VERCEL_TEAM_TOKEN: ${{ secrets.VERCEL_TEAM_TOKEN }}
VERCEL_REGISTRATION_URL: ${{ secrets.VERCEL_REGISTRATION_URL }}

View File

@@ -0,0 +1,43 @@
name: Dev
on:
push:
branches:
- main
tags:
- '!*'
pull_request:
jobs:
test:
name: Dev
timeout-minutes: 60
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
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 main --depth=100
- run: git fetch origin ${{ github.ref }} --depth=100
- 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/cli/test/dev/fixtures/08-hugo/
- run: yarn install --network-timeout 1000000
- run: yarn run build
- run: yarn test-integration-dev --clean false
env:
VERCEL_TEAM_TOKEN: ${{ secrets.VERCEL_TEAM_TOKEN }}
VERCEL_REGISTRATION_URL: ${{ secrets.VERCEL_REGISTRATION_URL }}

View File

@@ -0,0 +1,35 @@
name: E2E
on:
push:
branches:
- main
tags:
- '!*'
pull_request:
jobs:
test:
name: E2E
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 main --depth=100
- run: git fetch origin ${{ github.ref }} --depth=100
- 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:
VERCEL_TEAM_TOKEN: ${{ secrets.VERCEL_TEAM_TOKEN }}
VERCEL_REGISTRATION_URL: ${{ secrets.VERCEL_REGISTRATION_URL }}

43
.github/workflows/test-unit.yml vendored Normal file
View File

@@ -0,0 +1,43 @@
name: Unit
on:
push:
branches:
- main
tags:
- '!*'
pull_request:
jobs:
test:
name: Unit
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
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 main --depth=100
- run: git fetch origin ${{ github.ref }} --depth=100
- 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
- run: yarn run test-unit --clean false
- run: yarn workspace vercel run coverage
if: matrix.os == 'ubuntu-latest' && matrix.node == 12 # only run coverage once
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

31
.gitignore vendored
View File

@@ -1,20 +1,29 @@
node_modules node_modules
package-lock.json
dist dist
.vscode
npm-debug.log npm-debug.log
yarn-error.log yarn-error.log
.nyc_output .nyc_output
coverage coverage
coverage.lcov
*.swp *.swp
*.bak *.bak
*.tgz *.tgz
packages/now-cli/.builders packages/cli/src/util/dev/templates/*.ts
packages/now-cli/assets packages/cli/src/util/constants.ts
packages/now-cli/src/util/dev/templates/*.ts packages/cli/test/**/yarn.lock
packages/now-cli/test/**/yarn.lock !packages/cli/test/dev/**/yarn.lock
!packages/now-cli/test/dev/**/yarn.lock packages/cli/test/**/node_modules
packages/now-cli/test/**/node_modules packages/cli/test/dev/fixtures/08-hugo/hugo
packages/now-cli/test/dev/fixtures/08-hugo/hugo packages/cli/test/dev/fixtures/**/dist
packages/now-cli/test/dev/fixtures/**/dist packages/cli/test/dev/fixtures/**/public
packages/now-cli/test/dev/fixtures/**/public packages/cli/test/dev/fixtures/**/.now
packages/now-cli/test/fixtures/integration packages/cli/test/dev/fixtures/**/.vercel
packages/cli/test/fixtures/integration
test/lib/deployment/failed-page.txt
.DS_Store
.next
/.env
/public
__pycache__
.vercel

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 version = 1
[merge] [merge]
automerge_label = "automerge" automerge_label = ["semver-major","semver-minor","semver-patch"]
blacklist_title_regex = "^WIP.*" blacklist_title_regex = "^WIP.*"
blacklist_labels = ["work in progress"] blacklist_labels = ["work in progress"]
method = "squash" method = "squash"

View File

@@ -1,4 +0,0 @@
{
"singleQuote": true,
"trailingComma": "es5"
}

17
.vercelignore Normal file
View File

@@ -0,0 +1,17 @@
*
# general
!utils/
!utils/run.js
!.yarnrc
!yarn.lock
!package.json
# api
!api/
!api/**
# packages
!packages/
!packages/frameworks
!packages/frameworks/**

View File

@@ -1,74 +0,0 @@
## Code of Conduct
### Our Pledge
In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to making participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, gender identity and expression, level of experience,
nationality, personal appearance, race, religion, or sexual identity and
orientation.
### Our Standards
Examples of behavior that contributes to creating a positive environment
include:
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting
### Our Responsibilities
Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.
Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.
### Scope
This Code of Conduct applies both within project spaces and in public spaces
when an individual is representing the project or its community. Examples of
representing a project or community include using an official project e-mail
address, posting via an official social media account, or acting as an appointed
representative at an online or offline event. Representation of a project may be
further defined and clarified by project maintainers.
### Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [abuse@zeit.co](mailto:abuse@zeit.co). All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.
### Attribution
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at [http://contributor-covenant.org/version/1/4][version]
[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/

View File

@@ -1,96 +0,0 @@
# Contributing
When contributing to this repository, please first discuss the change you wish to make via [GitHub Issue](https://github.com/zeit/now/issues/new) or [Spectrum](https://spectrum.chat/zeit) with the owners of this repository before submitting a Pull Request.
Please read our [code of conduct](CODE_OF_CONDUCT.md) and follow it in all your interactions with the project.
## Local development
This project is configured in a monorepo pattern where one repo contains multiple npm packages. Dependencies are installed and managed with `yarn`, not `npm` CLI.
To get started, execute the following:
```
git clone https://github.com/zeit/now
yarn install
yarn bootstrap
yarn build
yarn lint
yarn test
```
Make sure all the tests pass before making changes.
## Verifying your change
Once you are done with your changes (we even suggest doing it along the way ), make sure all the test still run by running
```
yarn build && yarn test
```
from the root of the project.
If any test fails, make sure to fix it along with your changes. See [Interpreting test errors](#Interpreting-test-errors) for more information about how the tests are executed, especially the integration tests.
## Pull Request Process
Once you are confident that your changes work properly, open a pull request on the main repository.
The pull request will be reviewed by the maintainers and the tests will be checked by our continuous integration platform.
## Interpreting test errors
There are 2 kinds of tests in this repository Unit tests and Integration tests.
Unit tests are run locally with `jest` and execute quickly because they are testing the smallest units of code.
### Integration tests
Integration tests create deployments to your ZEIT account using the `test` project name. After each test is deployed, the `probes` key is used to check if the response is the expected value. If the value doesn't match, you'll see a message explaining the difference. If the deployment failed to build, you'll see a more generic message like the following:
```
[Error: Fetched page https://test-8ashcdlew.now.sh/root.js does not contain hello Root!. Instead it contains An error occurred with this application.
NO_STATUS_CODE_FRO Response headers:
cache-control=s-maxage=0
connection=close
content-type=text/plain; charset=utf-8
date=Wed, 19 Jun 2019 18:01:37 GMT
server=now
strict-transport-security=max-age=63072000
transfer-encoding=chunked
x-now-id=iad1:hgtzj-1560967297876-44ae12559f95
x-now-trace=iad1]
```
In such cases you can visit the URL of the failed deployment and append `/_logs` so see the build error. In the case above, that would be https://test-8ashcdlew.now.sh/_logs
The logs of this deployment will contain the actual error which may help you to understand what went wrong.
### @zeit/node-file-trace
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:
```js
const trace = require('@zeit/node-file-trace');
trace(['path/to/entrypoint.js'], {
ts: true,
mixedModules: true,
})
.then(o => console.log(o.fileList))
.then(e => console.error(e));
```
When you run this script, you'll see all imported files. If anything file is missing, the bug is in [@zeit/node-file-trace](https://github.com/zeit/node-file-trace) and not the Builder.
## Deploy a Builder with existing project
Sometimes you want to test changes to a Builder against an existing project, maybe with `now dev` or an actual deployment. You can avoid publishing every Builder change to npm by uploading the Builder as a tarball.
1. Change directory to the desired Builder `cd ./packages/now-node`
2. Run `yarn build` to compile typescript and other build steps
3. Run `npm pack` to create a tarball file
4. Run `now *.tgz` to upload the tarball file and get a URL
5. Edit any existing `now.json` project and replace `use` with the URL
6. Run `now` or `now dev` to deploy with the experimental Builder

View File

@@ -1,447 +0,0 @@
# Builders Developer Reference
The following page is a reference for how to create a Builder using the available Builder's API.
A Builder is an npm module that exposes a `build` function and optionally an `analyze` function and `prepareCache` function.
Official Builders are published to [npmjs.com](https://npmjs.com) as a package and referenced in the `use` property of the `now.json` configuration file.
However, the `use` property will work with any [npm install argument](https://docs.npmjs.com/cli/install) such as a git repo url which is useful for testing your Builder.
See the [Builders Documentation](https://zeit.co/docs/v2/advanced/builders) to view example usage.
## Builder Exports
### `version`
A **required** exported constant that decides which version of the Builder API to use.
The latest and suggested version is `2`.
### `analyze`
An **optional** exported function that returns a unique fingerprint used for the purpose of [build de-duplication](https://zeit.co/docs/v2/advanced/concepts/immutability#deduplication-algorithm). If the `analyze` function is not supplied, a random fingerprint is assigned to each build.
```js
export analyze({
files: Files,
entrypoint: String,
workPath: String,
config: Object
}) : String fingerprint
```
If you are using TypeScript, you should use the following types:
```ts
import { AnalyzeOptions } from '@now/build-utils'
export analyze(options: AnalyzeOptions) {
return 'fingerprint goes here'
}
```
### `build`
A **required** exported function that returns a [Files](#files) data structure that contains the Build outputs, which can be a [Static File](#file) or a [Serverless Function](#serverless-function).
What's a Serverless Function? Read about [Serverless Function concepts](https://zeit.co/docs/v2/deployments/concepts/lambdas) to learn more.
```js
build({
files: Files,
entrypoint: String,
workPath: String,
config: Object,
meta?: {
isDev?: Boolean,
requestPath?: String,
filesChanged?: Array<String>,
filesRemoved?: Array<String>
}
}) : {
watch: Array<String>,
output: Files output,
routes: Object
}
```
If you are using TypeScript, you should use the following types:
```ts
import { BuildOptions } from '@now/build-utils'
export build(options: BuildOptions) {
// Build the code here
return {
output: {
'path-to-file': File,
'path-to-lambda': Lambda
},
watch: [],
routes: {}
}
}
```
### `prepareCache`
An **optional** exported function that is equivalent to [`build`](#build), but it executes the instructions necessary to prepare a cache for the next run.
```js
prepareCache({
files: Files,
entrypoint: String,
workPath: String,
cachePath: String,
config: Object
}) : Files cacheOutput
```
If you are using TypeScript, you can import the types for each of these functions by using the following:
```ts
import { PrepareCacheOptions } from '@now/build-utils'
export prepareCache(options: PrepareCacheOptions) {
return { 'path-to-file': File }
}
```
### `shouldServe`
An **optional** exported function that is only used by `now dev` in [Now CLI](https:///download) and indicates whether a [Builder](https://zeit.co/docs/v2/advanced/builders) wants to be responsible for building a certain request path.
```js
shouldServe({
entrypoint: String,
files: Files,
config: Object,
requestPath: String,
workPath: String
}) : Boolean
```
If you are using TypeScript, you can import the types for each of these functions by using the following:
```ts
import { ShouldServeOptions } from '@now/build-utils'
export shouldServe(options: ShouldServeOptions) {
return Boolean
}
```
If this method is not defined, Now CLI will default to [this function](https://github.com/zeit/now/blob/52994bfe26c5f4f179bdb49783ee57ce19334631/packages/now-build-utils/src/should-serve.ts).
### Builder Options
The exported functions [`analyze`](#analyze), [`build`](#build), and [`prepareCache`](#preparecache) receive one argument with the following properties.
**Properties:**
- `files`: All source files of the project as a [Files](#files) data structure.
- `entrypoint`: Name of entrypoint file for this particular build job. Value `files[entrypoint]` is guaranteed to exist and be a valid [File](#files) reference. `entrypoint` is always a discrete file and never a glob, since globs are expanded into separate builds at deployment time.
- `workPath`: A writable temporary directory where you are encouraged to perform your build process. This directory will be populated with the restored cache from the previous run (if any) for [`analyze`](#analyze) and [`build`](#build).
- `cachePath`: A writable temporary directory where you can build a cache for the next run. This is only passed to `prepareCache`.
- `config`: An arbitrary object passed from by the user in the [Build definition](#defining-the-build-step) in `now.json`.
## Example: html-minifier
Let's walk through what it takes to create a simple builder that takes in a HTML source file and yields a minified HTML static file as its build output.
While this is a very simple builder, the approach demonstrated here can be used to return anything: one or more static files and/or one or more lambdas.
## Setting up the module
### Defining the analyze step
The `analyze` hook is optional. Its goal is to give the developer a tool to avoid wasting time _re-computing a build_ that has already occurred.
The return value of `analyze` is a _fingerprint_: a simple string that uniquely identifies the build process.
If `analyze` is not specified, its behavior is to use as the fingerprint the combined checksums of **all the files in the same directory level as the entrypoint**. This is a default that errs on making sure that we re-execute builds when files _other than the entrypoint_ (like dependencies, manifest files, etc) have changed.
For our `html-minify` example, we know that HTML files don't have dependencies. Therefore, our analyze step can just return the `digest` of the entrypoint.
Our `index.js` file looks as follows:
```js
exports.analyze = function({ files, entrypoint }) {
return files[entrypoint].digest
}
```
This means that we will only re-minify and re-create the build output _only if the file contents (and therefore its digest) change._
### Defining the build step
Your module will need some utilities to manipulate the data structures we pass you, create new ones and alter the filesystem.
To that end, we expose our API as part of a `@now/build-utils` package. This package is always loaded on your behalf, so make sure it's only included as `peerDependencies` in your `package.json`.
Builders can include dependencies of their liking:
```js
const htmlMinifier = require('html-minifier')
exports.version = 2
exports.analyze = ({ files, entrypoint }) => files[entrypoint].digest
exports.build = async ({ files, entrypoint, config }) => {
const stream = files[entrypoint].toStream()
const options = Object.assign({}, config || {})
const { data } = await FileBlob.fromStream({ stream })
const content = data.toString()
const minified = htmlMinifier(content, options)
const result = new FileBlob({ data: minified })
return {
output: {
[entrypoint]: result
},
watch: [],
routes: {}
}
}
```
### Defining a `prepareCache` step
If our builder had performed work that could be re-used in the next build invocation, we could define a `prepareCache` step.
In this case, there are not intermediate artifacts that we can cache, and our `analyze` step already takes care of caching the full output based on the fingerprint of the input.
## Technical Details
### Execution Context
A [Serverless Function](https://zeit.co/docs/v2/advanced/concepts/lambdas) is created where the builder logic is executed. The lambda is run using the Node.js 8 runtime. A brand new sandbox is created for each deployment, for security reasons. The sandbox is cleaned up between executions to ensure no lingering temporary files are shared from build to build.
All the APIs you export ([`analyze`](#analyze), [`build`](#build) and [`prepareCache`](#preparecache)) are not guaranteed to be run in the same process, but the filesystem we expose (e.g.: `workPath` and the results of calling [`getWriteableDirectory`](#getWriteableDirectory) ) is retained.
If you need to share state between those steps, use the filesystem.
### Directory and Cache Lifecycle
When a new build is created, we pre-populate the `workPath` supplied to `analyze` with the results of the `prepareCache` step of the previous build.
The `analyze` step can modify that directory, and it will not be re-created when it's supplied to `build` and `prepareCache`.
To learn how the cache key is computed and invalidated, refer to the [overview](https://zeit.co/docs/v2/advanced/builders#technical-details).
### Accessing Environment and Secrets
The env and secrets specified by the user as `build.env` are passed to the builder process. This means you can access user env via `process.env` in Node.js.
### Utilities as peerDependencies
When you publish your builder to npm, make sure to not specify `@now/build-utils` (as seen below in the API definitions) as a dependency, but rather as part of `peerDependencies`.
## Types
### `Files`
```ts
import { File } from '@now/build-utils'
type Files = { [filePath: string]: File }
```
This is an abstract type that is implemented as a plain [JavaScript Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object). It's helpful to think of it as a virtual filesystem representation.
When used as an input, the `Files` object will only contain `FileRefs`. When `Files` is an output, it may consist of `Lambda` (Serverless Functions) types as well as `FileRefs`.
An example of a valid output `Files` object is:
```json
{
"index.html": FileRef,
"api/index.js": Lambda
}
```
### `File`
This is an abstract type that can be imported if you are using TypeScript.
```ts
import { File } from '@now/build-utils'
```
Valid `File` types include:
- [`FileRef`](#fileref)
- [`FileFsRef`](#filefsref)
- [`FileBlob`](#fileblob)
### `FileRef`
```ts
import { FileRef } from '@now/build-utils'
```
This is a [JavaScript class](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes) that represents an abstract file instance stored in our platform, based on the file identifier string (its checksum). When a `Files` object is passed as an input to `analyze` or `build`, all its values will be instances of `FileRef`.
**Properties:**
- `mode : Number` file mode
- `digest : String` a checksum that represents the file
**Methods:**
- `toStream() : Stream` creates a [Stream](https://nodejs.org/api/stream.html) of the file body
### `FileFsRef`
```ts
import { FileFsRef } from '@now/build-utils'
```
This is a [JavaScript class](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes) that represents an abstract instance of a file present in the filesystem that the build process is executing in.
**Properties:**
- `mode : Number` file mode
- `fsPath : String` the absolute path of the file in file system
**Methods:**
- `static async fromStream({ mode : Number, stream : Stream, fsPath : String }) : FileFsRef` creates an instance of a [FileFsRef](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) from `Stream`, placing file at `fsPath` with `mode`
- `toStream() : Stream` creates a [Stream](https://nodejs.org/api/stream.html) of the file body
### `FileBlob`
```ts
import { FileBlob } from '@now/build-utils'
```
This is a [JavaScript class](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes) that represents an abstract instance of a file present in memory.
**Properties:**
- `mode : Number` file mode
- `data : String | Buffer` the body of the file
**Methods:**
- `static async fromStream({ mode : Number, stream : Stream }) :FileBlob` creates an instance of a [FileBlob](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object) from [`Stream`](https://nodejs.org/api/stream.html) with `mode`
- `toStream() : Stream` creates a [Stream](https://nodejs.org/api/stream.html) of the file body
### `Lambda`
```ts
import { Lambda } from '@now/build-utils'
```
This is a [JavaScript class](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes), called a Serverless Function, that can be created by supplying `files`, `handler`, `runtime`, and `environment` as an object to the [`createLambda`](#createlambda) helper. The instances of this class should not be created directly. Instead use a call to [`createLambda`](#createlambda).
**Properties:**
- `files : Files` the internal filesystem of the lambda
- `handler : String` path to handler file and (optionally) a function name it exports
- `runtime : LambdaRuntime` the name of the lambda runtime
- `environment : Object` key-value map of handler-related (aside of those passed by user) environment variables
### `LambdaRuntime`
This is an abstract enumeration type that is implemented by one of the following possible `String` values:
- `nodejs10.x`
- `nodejs8.10`
- `go1.x`
- `java-1.8.0-openjdk`
- `python3.6`
- `python2.7`
- `dotnetcore2.1`
- `dotnetcore2.0`
- `dotnetcore1.0`
## JavaScript API
The following is exposed by `@now/build-utils` to simplify the process of writing Builders, manipulating the file system, using the above types, etc.
### `createLambda`
Signature: `createLambda(Object spec) : Lambda`
```ts
import { createLambda } from '@now/build-utils'
```
Constructor for the [`Lambda`](#lambda) type.
```js
const { createLambda, FileBlob } = require('@now/build-utils')
await createLambda({
runtime: 'nodejs8.10',
handler: 'index.main',
files: {
'index.js': new FileBlob({ data: 'exports.main = () => {}' })
}
})
```
### `download`
Signature: `download() : Files`
```ts
import { download } from '@now/build-utils'
```
This utility allows you to download the contents of a [`Files`](#files) data structure, therefore creating the filesystem represented in it.
Since `Files` is an abstract way of representing files, you can think of `download` as a way of making that virtual filesystem _real_.
If the **optional** `meta` property is passed (the argument for [build](#build)), only the files that have changed are downloaded. This is decided using `filesRemoved` and `filesChanged` inside that object.
```js
await download(files, workPath, meta)
```
### `glob`
Signature: `glob() : Files`
```ts
import { glob } from '@now/build-utils'
```
This utility allows you to _scan_ the filesystem and return a [`Files`](#files) representation of the matched glob search string. It can be thought of as the reverse of [`download`](#download).
The following trivial example downloads everything to the filesystem, only to return it back (therefore just re-creating the passed-in [`Files`](#files)):
```js
const { glob, download } = require('@now/build-utils')
exports.build = ({ files, workPath }) => {
await download(files, workPath)
return glob('**', workPath)
}
```
### `getWriteableDirectory`
Signature: `getWriteableDirectory() : String`
```ts
import { getWriteableDirectory } from '@now/build-utils'
```
In some occasions, you might want to write to a temporary directory.
### `rename`
Signature: `rename(Files) : Files`
```ts
import { rename } from '@now/build-utils'
```
Renames the keys of the [`Files`](#files) object, which represent the paths. For example, to remove the `*.go` suffix you can use:
```js
const rename = require('@now/build-utils')
const originalFiles = { 'one.go': fileFsRef1, 'two.go': fileFsRef2 }
const renamedFiles = rename(originalFiles, path => path.replace(/\.go$/, '')
```

433
DEVELOPING_A_RUNTIME.md Normal file
View File

@@ -0,0 +1,433 @@
# Runtime Developer Reference
The following page is a reference for how to create a Runtime by implementing
the Runtime API interface.
A Runtime is an npm module that implements the following interface:
```typescript
interface Runtime {
version: number;
build: (options: BuildOptions) => Promise<BuildResult>;
analyze?: (options: AnalyzeOptions) => Promise<string>;
prepareCache?: (options: PrepareCacheOptions) => Promise<CacheOutputs>;
shouldServe?: (options: ShouldServeOptions) => Promise<boolean>;
startDevServer?: (
options: StartDevServerOptions
) => Promise<StartDevServerResult>;
}
```
The `version` property and the `build()` function are the only _required_ fields.
The rest are optional extensions that a Runtime _may_ implement in order to
enhance functionality. These functions are documented in more detail below.
Official Runtimes are published to [the npm registry](https://npmjs.com) as a package and referenced in the `use` property of the `vercel.json` configuration file.
> **Note:** The `use` property in the `builds` array will work with any [npm
> install argument](https://docs.npmjs.com/cli/install) such as a git repo URL,
> which is useful for testing your Runtime. Alternatively, the `functions` property
> requires that you specify a specifc tag published to npm, for stability purposes.
See the [Runtimes Documentation](https://vercel.com/docs/runtimes) to view example usage.
## Runtime Exports
### `version`
A **required** exported constant that decides which version of the Runtime API to use.
The latest and suggested version is `3`.
**Example:**
```typescript
export const version = 3;
```
### `build()`
A **required** exported function that returns a Serverless Function.
> What's a Serverless Function? Read about [Serverless Functions](https://vercel.com/docs/v2/serverless-functions/introduction) to learn more.
**Example:**
```typescript
import { BuildOptions, createLambda } from '@vercel/build-utils';
export async function build(options: BuildOptions) {
// Build the code here…
const lambda = createLambda(/* … */);
return {
output: lambda,
watch: [
// Dependent files to trigger a rebuild in `vercel dev` go here…
],
routes: [
// If your Runtime needs to define additional routing, define it here…
],
};
}
```
### `analyze()`
An **optional** exported function that returns a unique fingerprint used for the
purpose of [build
de-duplication](https://vercel.com/docs/v2/platform/deployments#deduplication).
If the `analyze()` function is not supplied, then a random fingerprint is
assigned to each build.
**Example:**
```typescript
import { AnalyzeOptions } from '@vercel/build-utils';
export async function analyze(options: AnalyzeOptions) {
// Do calculations to generate a fingerprint based off the source code here…
return 'fingerprint goes here';
}
```
### `prepareCache()`
An **optional** exported function that is executed after [`build()`](#build) is
completed. The implementation should return an object of `File`s that will be
pre-populated in the working directory for the next build run in the user's
project. An example use-case is that `@vercel/node` uses this function to cache
the `node_modules` directory, making it faster to install npm dependencies for
future builds.
**Example:**
```typescript
import { PrepareCacheOptions } from '@vercel/build-utils';
export async function prepareCache(options: PrepareCacheOptions) {
// Create a mapping of file names and `File` object instances to cache here…
return {
'path-to-file': File,
};
}
```
### `shouldServe()`
An **optional** exported function that is only used by `vercel dev` in [Vercel
CLI](https://vercel.com/download) and indicates whether a
[Runtime](https://vercel.com/docs/runtimes) wants to be responsible for responding
to a certain request path.
**Example:**
```typescript
import { ShouldServeOptions } from '@vercel/build-utils';
export async function shouldServe(options: ShouldServeOptions) {
// Determine whether or not the Runtime should respond to the request path here…
return options.requestPath === options.entrypoint;
}
```
If this function is not defined, Vercel CLI will use the [default implementation](https://github.com/vercel/vercel/blob/52994bfe26c5f4f179bdb49783ee57ce19334631/packages/now-build-utils/src/should-serve.ts).
### `startDevServer()`
An **optional** exported function that is only used by `vercel dev` in [Vercel
CLI](https://vercel.com/download). If this function is defined, Vercel CLI will
**not** invoke the `build()` function, and instead invoke this function for every
HTTP request. It is an opportunity to provide an optimized development experience
rather than going through the entire `build()` process that is used in production.
This function is invoked _once per HTTP request_ and is expected to spawn a child
process which creates an HTTP server that will execute the entrypoint code when
an HTTP request is received. This child process is _single-serve_ (only used for
a single HTTP request). After the HTTP response is complete, `vercel dev` sends
a shut down signal to the child process.
The `startDevServer()` function returns an object with the `port` number that the
child process' HTTP server is listening on (which should be an [ephemeral
port](https://stackoverflow.com/a/28050404/376773)) as well as the child process'
Process ID, which `vercel dev` uses to send the shut down signal to.
> **Hint:** To determine which ephemeral port the child process is listening on,
> some form of [IPC](https://en.wikipedia.org/wiki/Inter-process_communication) is
> required. For example, in `@vercel/go` the child process writes the port number
> to [_file descriptor 3_](https://en.wikipedia.org/wiki/File_descriptor), which is read by the `startDevServer()` function
> implementation.
It may also return `null` to opt-out of this behavior for a particular request
path or entrypoint.
**Example:**
```typescript
import { spawn } from 'child_process';
import { StartDevServerOptions } from '@vercel/build-utils';
export async function startDevServer(options: StartDevServerOptions) {
// Create a child process which will create an HTTP server.
//
// Note: `my-runtime-dev-server` is an example dev server program name.
// Your implementation will spawn a different program specific to your runtime.
const child = spawn('my-runtime-dev-server', [options.entrypoint], {
stdio: ['ignore', 'inherit', 'inherit', 'pipe'],
});
// In this example, the child process will write the port number to FD 3…
const portPipe = child.stdio[3];
const childPort = await new Promise(resolve => {
portPipe.setEncoding('utf8');
portPipe.once('data', data => {
resolve(Number(data));
});
});
return { pid: child.pid, port: childPort };
}
```
### Execution Context
- Runtimes are executed in a Linux container that closely matches the Servereless Function runtime environment.
- The Runtime code is executed using Node.js version **12.x**.
- A brand new sandbox is created for each deployment, for security reasons.
- The sandbox is cleaned up between executions to ensure no lingering temporary files are shared from build to build.
All the APIs you export ([`analyze()`](#analyze), [`build()`](#build),
[`prepareCache()`](#preparecache), etc.) are not guaranteed to be run in the
same process, but the filesystem we expose (e.g.: `workPath` and the results
of calling [`getWritableDirectory`](#getWritableDirectory) ) is retained.
If you need to share state between those steps, use the filesystem.
### Directory and Cache Lifecycle
When a new build is created, we pre-populate the `workPath` supplied to `analyze` with the results of the `prepareCache` step of the previous build.
The `analyze` step can modify that directory, and it will not be re-created when it's supplied to `build` and `prepareCache`.
### Accessing Environment and Secrets
The env and secrets specified by the user as `build.env` are passed to the Runtime process. This means you can access user env via `process.env` in Node.js.
### Utilities as peerDependencies
When you publish your Runtime to npm, make sure to not specify `@vercel/build-utils` (as seen below in the API definitions) as a dependency, but rather as part of `peerDependencies`.
## `@vercel/build-utils` Types
### `Files`
```typescript
import { File } from '@vercel/build-utils';
type Files = { [filePath: string]: File };
```
This is an abstract type that is implemented as a plain [JavaScript Object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object). It's helpful to think of it as a virtual filesystem representation.
When used as an input, the `Files` object will only contain `FileRefs`. When `Files` is an output, it may consist of `Lambda` (Serverless Functions) types as well as `FileRefs`.
An example of a valid output `Files` object is:
```javascript
{
"index.html": FileRef,
"api/index.js": Lambda
}
```
### `File`
This is an abstract type that can be imported if you are using TypeScript.
```typescript
import { File } from '@vercel/build-utils';
```
Valid `File` types include:
- [`FileRef`](#fileref)
- [`FileFsRef`](#filefsref)
- [`FileBlob`](#fileblob)
### `FileRef`
```typescript
import { FileRef } from '@vercel/build-utils';
```
This is a [class](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes) that represents an abstract file instance stored in our platform, based on the file identifier string (its checksum). When a `Files` object is passed as an input to `analyze` or `build`, all its values will be instances of `FileRef`.
**Properties:**
- `mode: Number` file mode
- `digest: String` a checksum that represents the file
**Methods:**
- `toStream(): Stream` creates a [Stream](https://nodejs.org/api/stream.html) of the file body
### `FileFsRef`
```typescript
import { FileFsRef } from '@vercel/build-utils';
```
This is a [class](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes) that represents an abstract instance of a file present in the filesystem that the build process is executing in.
**Properties:**
- `mode: Number` file mode
- `fsPath: String` the absolute path of the file in file system
**Methods:**
- `static async fromStream({ mode: Number, stream: Stream, fsPath: String }): FileFsRef` creates an instance of a [FileFsRef](#FileFsRef) from `Stream`, placing file at `fsPath` with `mode`
- `toStream(): Stream` creates a [Stream](https://nodejs.org/api/stream.html) of the file body
### `FileBlob`
```typescript
import { FileBlob } from '@vercel/build-utils';
```
This is a [class](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes) that represents an abstract instance of a file present in memory.
**Properties:**
- `mode: Number` file mode
- `data: String | Buffer` the body of the file
**Methods:**
- `static async fromStream({ mode: Number, stream: Stream }): FileBlob` creates an instance of a [FileBlob](#FileBlob) from [`Stream`](https://nodejs.org/api/stream.html) with `mode`
- `toStream(): Stream` creates a [Stream](https://nodejs.org/api/stream.html) of the file body
### `Lambda`
```typescript
import { Lambda } from '@vercel/build-utils';
```
This is a [class](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes) that represents a Serverless Function. An instance can be created by supplying `files`, `handler`, `runtime`, and `environment` as an object to the [`createLambda`](#createlambda) helper. The instances of this class should not be created directly. Instead, invoke the [`createLambda`](#createlambda) helper function.
**Properties:**
- `files: Files` the internal filesystem of the lambda
- `handler: String` path to handler file and (optionally) a function name it exports
- `runtime: LambdaRuntime` the name of the lambda runtime
- `environment: Object` key-value map of handler-related (aside of those passed by user) environment variables
### `LambdaRuntime`
This is an abstract enumeration type that is implemented by one of the following possible `String` values:
- `nodejs12.x`
- `nodejs10.x`
- `go1.x`
- `java11`
- `python3.8`
- `python3.6`
- `dotnetcore2.1`
- `ruby2.5`
- `provided`
## `@vercel/build-utils` Helper Functions
The following is exposed by `@vercel/build-utils` to simplify the process of writing Runtimes, manipulating the file system, using the above types, etc.
### `createLambda()`
Signature: `createLambda(Object spec): Lambda`
```typescript
import { createLambda } from '@vercel/build-utils';
```
Constructor for the [`Lambda`](#lambda) type.
```js
const { createLambda, FileBlob } = require('@vercel/build-utils');
await createLambda({
runtime: 'nodejs8.10',
handler: 'index.main',
files: {
'index.js': new FileBlob({ data: 'exports.main = () => {}' }),
},
});
```
### `download()`
Signature: `download(): Files`
```typescript
import { download } from '@vercel/build-utils';
```
This utility allows you to download the contents of a [`Files`](#files) data
structure, therefore creating the filesystem represented in it.
Since `Files` is an abstract way of representing files, you can think of
`download()` as a way of making that virtual filesystem _real_.
If the **optional** `meta` property is passed (the argument for
[`build()`](#build)), only the files that have changed are downloaded.
This is decided using `filesRemoved` and `filesChanged` inside that object.
```js
await download(files, workPath, meta);
```
### `glob()`
Signature: `glob(): Files`
```typescript
import { glob } from '@vercel/build-utils';
```
This utility allows you to _scan_ the filesystem and return a [`Files`](#files) representation of the matched glob search string. It can be thought of as the reverse of [`download`](#download).
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')
exports.build = ({ files, workPath }) => {
await download(files, workPath)
return glob('**', workPath)
}
```
### `getWritableDirectory()`
Signature: `getWritableDirectory(): String`
```typescript
import { getWritableDirectory } from '@vercel/build-utils';
```
In some occasions, you might want to write to a temporary directory.
### `rename()`
Signature: `rename(Files, Function): Files`
```typescript
import { rename } from '@vercel/build-utils';
```
Renames the keys of the [`Files`](#files) object, which represent the paths. For example, to remove the `*.go` suffix you can use:
```js
const rename = require('@vercel/build-utils')
const originalFiles = { 'one.go': fileFsRef1, 'two.go': fileFsRef2 }
const renamedFiles = rename(originalFiles, path => path.replace(/\.go$/, '')
```

View File

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

View File

@@ -1,41 +1,34 @@
![now](https://assets.zeit.co/image/upload/v1542240976/repositories/now-cli/now-cli-repo-banner-v3.png) <p align="center">
<a href="https://vercel.com">
<img src="https://assets.vercel.com/image/upload/v1588805858/repositories/vercel/logo.png" height="96">
<h3 align="center">Vercel</h3>
</a>
<p align="center">Develop. Preview. Ship.</p>
</p>
[![Build Status](https://badgen.net/circleci/github/zeit/now/master)](https://circleci.com/gh/zeit/workflows/now/tree/master) [![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 Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/zeit) [![Join the community on GitHub Discussions](https://badgen.net/badge/join%20the%20discussion/on%20github/black?icon=github)](https://github.com/vercel/vercel/discussions)
**Note**: The [canary](https://github.com/zeit/now/tree/canary) branch is under heavy development the stable release branch is [master](https://github.com/zeit/now/tree/master).
## Usage ## Usage
To install the latest version of Now CLI, visit [zeit.co/download](https://zeit.co/download) or run this command: Vercel is the optimal workflow for frontend teams. All-in-one: Static and Jamstack deployment, Serverless Functions, and Global CDN.
``` 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).
npm i -g now
```
To quickly start a new project, run the following commands:
```
now init # Pick an example project to clone
cd <PROJECT> # Change directory to the newly created project
now dev # Run locally during development
now # Deploy to the cloud
```
## Documentation ## Documentation
For details on how to use Now CLI, check out our [documentation](https://zeit.co/docs). For details on how to use Vercel, check out our [documentation](https://vercel.com/docs).
## Caught a Bug? ## Caught a Bug?
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 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` 2. Install dependencies with `yarn install`
3. Compile the code: `yarn build` 3. Compile the code: `yarn build`
4. Link the package to the global module directory: `yarn link` 4. Link the package to the global module directory: `cd ./packages/cli && yarn link`
5. You can now start using `now` anywhere inside the command line 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. As always, you should use `yarn test-unit` to run the tests and see if your changes have broken anything.
## How to Create a Release ## How to Create a Release
If you have write access to this repository, you can read more about how to publish a release [here](https://github.com/zeit/now/wiki/Creating-a-Release). If you have write access to this repository, you can read more about how to publish a release [here](https://github.com/vercel/vercel/wiki/Creating-a-Release).

View File

@@ -1,25 +0,0 @@
# Versioning
Builders are released to two different channels.
## Channels
| Channel | Git Branch | npm dist-tag | use example |
| ------- | ------------------------------------------------------------- | ------------ | ------------------ |
| Canary | [canary](https://github.com/zeit/now/commits/canary) | `@canary` | `@now/node@canary` |
| Stable | [master](https://github.com/zeit/now/commits/master) | `@latest` | `@now/node@latest` |
All PRs are submitted to the `canary` branch. Once a PR is merged into the `canary` branch, it should be published to npm immediately using the Canary Channel.
## Version Selection
Since Builders are published to [npmjs.com](https://npmjs.com), this makes versioning works the same for Builders as it does for any npm package. The `use` statement in [now.json](https://zeit.co/docs/v2/advanced/configuration#builds) has a similar syntax to `npm install`.
The following are valid examples [@now/node](https://www.npmjs.com/package/@now/node?activeTab=versions):
- `@now/node`
- `@now/node@0.7.3`
- `@now/node@canary`
- `@now/node@0.7.2-canary.2`
We always recommend using the latest version by leaving off the dist-tag suffix, `@now/node` for example.

View File

@@ -0,0 +1,25 @@
import Frameworks, { Framework } from '../../../packages/frameworks';
interface Example {
example: string;
path: string;
demo: string;
description: string;
tagline: string;
framework: string;
}
export async function getExampleList(): Promise<Example[]> {
return (Frameworks as Framework[])
.filter(f => f.demo)
.map(framework => {
return {
example: framework.name,
path: `/${framework.slug}`,
demo: framework.demo,
description: framework.description,
tagline: framework.tagline,
framework: framework.slug,
};
});
}

View File

@@ -0,0 +1,18 @@
/**
* Download zip and extract to target directory
*/
import got from 'got';
import unzip from 'unzip-stream';
export async function extract(sourceUrl: string, targetPath: string) {
return new Promise((resolve, reject) => {
got
.stream(sourceUrl)
.pipe(unzip.Extract({ path: targetPath }))
.on('close', resolve)
.on('error', err => {
reject(new Error('Failed extracting from github.'));
});
});
}

View File

@@ -0,0 +1,73 @@
import fetch from 'node-fetch';
import { Repo } from '../types';
import { getExampleList } from './example-list';
/**
* Fetch the meta info of a public github repo
* @param {object} repo parsed by the `parse-github-url` package
*/
export async function getGitHubRepoInfo(repo: Repo) {
const response = await fetch(`https://api.github.com/repos/${repo.repo}`, {
headers: {
Accept: 'application/vnd.github.machine-man-preview+json',
// If we don't use a personal access token,
// it will get rate limited very easily.
Authorization: `Bearer ${process.env.GITHUB_ACCESS_TOKEN}`,
},
});
if (response.status !== 200) {
console.log(`Non-200 response code from GitHub: ${response.status}`);
console.log(await response.text());
return null;
}
const parsed = await response.json();
if (parsed.full_name !== repo.repo) {
console.log(`Invalid response from GitHub`);
console.log(`Received:`, parsed);
return null;
}
const data: { [key: string]: any } = {
id: parsed.full_name,
name: parsed.name,
url: parsed.html_url,
owner: parsed.owner.login,
description: parsed.description,
homepage: parsed.homepage,
size: parsed.size,
createdAt: parsed.created_at,
updatedAt: parsed.updated_at,
stars: parsed.stargazers_count,
branch: repo.branch,
};
const subdirPath = repo.repo + '/tree/' + repo.branch + '/';
if (repo.path.startsWith(subdirPath)) {
// subdir
data.subdir = repo.path.slice(subdirPath.length).split('/');
}
if (data.id === 'vercel/vercel' && data.subdir && data.subdir[0] === 'examples') {
// from our examples, add `homepage` and `description` fields
const example = data.subdir[1];
const exampleList = await getExampleList();
for (const item of exampleList) {
if (item.path === `/${example}`) {
data.homepage = item.demo;
data.description = item.description;
data.exampleName = item.example;
data.tagline = item.tagline;
data.framework = item.framework;
return data;
}
}
}
return data;
}

View File

@@ -0,0 +1,45 @@
import fetch from 'node-fetch';
interface Repo {
repo: string;
owner: {
username: string;
};
username: string;
branch: string;
}
/**
* Fetch the meta info of a public gitlab repo
* @param {object} repo parsed by the `parse-github-url` package
*/
export async function getGitLabRepoInfo(repo: Repo) {
const response = await fetch(
`https://gitlab.com/api/v4/projects/${encodeURIComponent(repo.repo)}`
);
if (response.status !== 200) {
console.log(`Non-200 response code from GitLab: ${response.status}`);
return null;
}
const parsed = await response.json();
if (parsed.path_with_namespace !== repo.repo) {
console.log(`Invalid response from GitLab`);
return null;
}
return {
id: parsed.path_with_namespace,
name: parsed.path,
url: parsed.web_url,
owner: parsed.owner ? parsed.owner.username : repo.owner,
description: parsed.description,
homepage: null,
size: 0,
createdAt: parsed.created_at,
updatedAt: parsed.last_activity_at,
stars: parsed.star_count,
branch: repo.branch,
};
}

View File

@@ -0,0 +1,28 @@
export const mapOldToNew: { [key: string]: string[] } = {
'go-image-to-ascii': ['vanilla-functions'],
markdown: ['hexo', 'docusaurus', 'docz', 'jekyll'],
'mdx-deck': ['docz'],
'mdx-deck-advanced': ['docz'],
'nextjs-mysql': ['nextjs'],
'nextjs-news': ['nextjs'],
'nextjs-nodejs-mongodb': ['nextjs'],
'nextjs-static': ['nextjs'],
'node-server': ['svelte-functions'],
nodejs: ['svelte-functions'],
'nodejs-canvas-partyparrot': ['svelte-functions'],
'nodejs-coffee': ['svelte-functions'],
'nodejs-hapi': ['svelte-functions'],
'nodejs-koa': ['svelte-functions'],
'nodejs-koa-ts': ['gatsby-functions'],
'nodejs-micro': ['svelte-functions'],
'nodejs-ms-graph-security-api': ['svelte-functions'],
'nodejs-pdfkit': ['svelte-functions'],
'nodejs-ts': ['gatsby-functions'],
'nuxt-static': ['nuxtjs'],
static: ['vanilla'],
typescript: ['gatsby-functions'],
umi: ['umijs'],
'vanilla-go': ['vanilla-functions'],
'vanilla-json-api': ['svelte-functions'],
'vue-ssr': ['vue'],
};

View File

@@ -0,0 +1,20 @@
/**
* 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) {
if (!exists(source) || !isDirectory(source)) {
return [];
}
return readdirSync(source)
.filter(name => !isDotFile(name))
.filter(name => isDirectory(join(source, name)));
}

9
api/_lib/types.ts Normal file
View File

@@ -0,0 +1,9 @@
export interface Repo {
repo: string;
owner: {
username: string;
};
username: string;
branch: string;
path: string;
}

View File

@@ -0,0 +1,9 @@
export function assertEnv(name: string) {
const value = process.env[name];
if (!value) {
throw new Error(`Missing env "${name}"`);
}
return value;
}

View File

@@ -0,0 +1,43 @@
import { init, captureException, withScope } from '@sentry/node';
import { assertEnv } from './assert-env';
const serviceName = 'api-frameworks';
let sentryInitDone = false;
function initSentry() {
if (sentryInitDone) {
return;
}
sentryInitDone = true;
init({
dsn: assertEnv('SENTRY_DSN'),
environment: process.env.NODE_ENV || 'production',
release: `${serviceName}`,
});
}
export function errorHandler(error: Error, extras?: { [key: string]: any }) {
if (!process.env.SENTRY_DSN) {
return;
}
initSentry();
try {
withScope(scope => {
scope.setTag('service', serviceName);
scope.setTag('function_name', assertEnv('AWS_LAMBDA_FUNCTION_NAME'));
for (const [k, v] of Object.entries(extras)) {
scope.setExtra(k, v);
}
captureException(error);
});
} catch (e) {
console.error(`Failed to report error to Sentry: ${e}`);
}
}

View File

@@ -0,0 +1,44 @@
import { VercelRequest, VercelResponse } from '@vercel/node';
import { errorHandler } from './error-handler';
type Handler = (req: VercelRequest, res: VercelResponse) => Promise<any>;
export function withApiHandler(handler: Handler): Handler {
return async (req: VercelRequest, res: VercelResponse) => {
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Allow-Methods', 'GET');
res.setHeader(
'Access-Control-Allow-Headers',
'Authorization, Accept, Content-Type'
);
if (req.method === 'OPTIONS') {
return res.status(200).json({});
}
if (req.method !== 'GET') {
return res.status(405).json({
error: {
code: 'method_not_allowed',
message: 'Only GET requests are supported for this endpoint.',
},
});
}
try {
const result = await handler(req, res);
return result;
} catch (error) {
errorHandler(error, {
url: req.url,
});
return res.status(500).json({
error: {
code: 'unexpected_error',
message: 'An unexpected error occurred.',
},
});
}
};
}

View File

@@ -0,0 +1,60 @@
import fs from 'fs';
// @ts-ignore
import tar from 'tar-fs';
import { extract } from '../../_lib/examples/extract';
import { VercelRequest, VercelResponse } from '@vercel/node';
import { withApiHandler } from '../../_lib/util/with-api-handler';
const TMP_DIR = '/tmp';
function isDirectory(path: string) {
return fs.existsSync(path) && fs.lstatSync(path).isDirectory();
}
function notFound(res: VercelResponse, message: string) {
return res.status(404).send({
error: {
code: 'not_found',
message,
},
});
}
function streamToBuffer(stream: any) {
return new Promise((resolve, reject) => {
const buffers: any[] = [];
stream.on('error', (err: any) => {
reject(err);
});
stream.on('data', (b: any) => {
buffers.push(b);
});
stream.on('end', () => {
resolve(Buffer.concat(buffers));
});
});
}
export default withApiHandler(async function (
req: VercelRequest,
res: VercelResponse
) {
const ext = '.tar.gz';
const { segment = '' } = req.query;
if (Array.isArray(segment) || !segment.endsWith(ext)) {
return notFound(res, `Missing ${ext} suffix.`);
}
const example = segment.slice(0, -ext.length);
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.`);
}
const stream = tar.pack(directory);
return res.send(await streamToBuffer(stream));
});

44
api/examples/info.ts Normal file
View File

@@ -0,0 +1,44 @@
// A proxy to get the basic info of an existing github/gitlab repo:
// GET /info?repo=vercel/micro
// @ts-ignore
import parseGitUrl from 'parse-github-url';
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: VercelRequest,
res: VercelResponse
) {
const repoPath = decodeURIComponent((req.query.repo as string) || '');
if (!repoPath) {
return res.status(404).json({
error: {
code: 'not_found',
message: 'Please provide the `repo` parameter.',
},
});
}
const repo = parseGitUrl(repoPath);
if (!repo.repo) {
return res.status(400).json({
error: {
code: 'invalid_repo_url',
message: 'Repository URL is invalid.',
},
});
}
if (repo.host === 'github.com') {
// URL is 'https://github.com/user/repo' or 'user/repo'
return res.json((await getGitHubRepoInfo(repo)) || {});
}
// gitlab
res.json((await getGitLabRepoInfo(repo)) || {});
});

10
api/examples/list-all.ts Normal file
View File

@@ -0,0 +1,10 @@
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: VercelRequest,
res: VercelResponse
) {
res.status(200).json(await getExampleList());
});

27
api/examples/list.ts Normal file
View File

@@ -0,0 +1,27 @@
import { extract } from '../_lib/examples/extract';
import { summary } from '../_lib/examples/summary';
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: VercelRequest,
res: VercelResponse
) {
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,
visible: true,
suggestions: [],
}));
const oldExamples = Object.keys(mapOldToNew).map(key => ({
name: key,
visible: false,
suggestions: mapOldToNew[key],
}));
res.status(200).json([...existingExamples, ...oldExamples]);
});

40
api/frameworks.ts Normal file
View File

@@ -0,0 +1,40 @@
import { VercelRequest, VercelResponse } from '@vercel/node';
import { withApiHandler } from './_lib/util/with-api-handler';
import _frameworks, { Framework } from '../packages/frameworks';
const frameworks = (_frameworks as Framework[])
.sort(
(a, b) =>
(a.sort || Number.MAX_SAFE_INTEGER) - (b.sort || Number.MAX_SAFE_INTEGER)
)
.map(frameworkItem => {
const framework = {
...frameworkItem,
detectors: undefined,
sort: undefined,
dependency: undefined,
defaultRoutes: undefined,
cachePattern: undefined,
devCommand: undefined,
buildCommand: undefined,
};
if (framework.logo) {
framework.logo = `https://res.cloudinary.com/zeit-inc/image/fetch/${framework.logo}`;
}
return framework;
});
export default withApiHandler(async function (
req: VercelRequest,
res: VercelResponse
) {
res.setHeader('Access-Control-Allow-Origin', '*');
res.setHeader('Access-Control-Allow-Methods', 'GET');
res.setHeader(
'Access-Control-Allow-Headers',
'Authorization, Accept, Content-Type'
);
return res.status(200).json(frameworks);
});

24
api/package.json Normal file
View File

@@ -0,0 +1,24 @@
{
"name": "api",
"private": true,
"version": "0.0.0",
"description": "API for the vercel/vercel repo",
"main": "index.js",
"scripts": {
"vercel-build": "yarn --cwd .. && node ../utils/run.js build all"
},
"dependencies": {
"@sentry/node": "5.11.1",
"got": "10.2.1",
"node-fetch": "2.6.1",
"parse-github-url": "1.0.2",
"tar-fs": "2.0.0",
"unzip-stream": "0.3.0"
},
"devDependencies": {
"@types/node": "13.1.4",
"@types/node-fetch": "2.5.4",
"@vercel/node": "1.9.0",
"typescript": "3.9.6"
}
}

16
api/tsconfig.json Normal file
View File

@@ -0,0 +1,16 @@
{
"compilerOptions": {
"target": "esnext",
"skipLibCheck": true,
"strict": false,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"noEmitOnError": true,
"esModuleInterop": true,
"module": "commonjs",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true
},
"include": ["examples", "frameworks.ts"]
}

524
api/yarn.lock Normal file
View File

@@ -0,0 +1,524 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@sentry/apm@5.11.1":
version "5.11.1"
resolved "https://registry.yarnpkg.com/@sentry/apm/-/apm-5.11.1.tgz#cc89fa4150056fbf009f92eca94fccc3980db34e"
integrity sha512-4iZH11p/7w9IMLT9hqNY1+EqLESltiIoF6/YsbpK93sXWGEs8VQ83IuvGuKWxajvHgDmj4ND0TxIliTsYqTqFw==
dependencies:
"@sentry/browser" "5.11.1"
"@sentry/hub" "5.11.1"
"@sentry/minimal" "5.11.1"
"@sentry/types" "5.11.0"
"@sentry/utils" "5.11.1"
tslib "^1.9.3"
"@sentry/browser@5.11.1":
version "5.11.1"
resolved "https://registry.yarnpkg.com/@sentry/browser/-/browser-5.11.1.tgz#337ffcb52711b23064c847a07629e966f54a5ebb"
integrity sha512-oqOX/otmuP92DEGRyZeBuQokXdeT9HQRxH73oqIURXXNLMP3PWJALSb4HtT4AftEt/2ROGobZLuA4TaID6My/Q==
dependencies:
"@sentry/core" "5.11.1"
"@sentry/types" "5.11.0"
"@sentry/utils" "5.11.1"
tslib "^1.9.3"
"@sentry/core@5.11.1":
version "5.11.1"
resolved "https://registry.yarnpkg.com/@sentry/core/-/core-5.11.1.tgz#9e2da485e196ae32971545c1c49ee6fe719930e2"
integrity sha512-BpvPosVNT20Xso4gAV54Lu3KqDmD20vO63HYwbNdST5LUi8oYV4JhvOkoBraPEM2cbBwQvwVcFdeEYKk4tin9A==
dependencies:
"@sentry/hub" "5.11.1"
"@sentry/minimal" "5.11.1"
"@sentry/types" "5.11.0"
"@sentry/utils" "5.11.1"
tslib "^1.9.3"
"@sentry/hub@5.11.1":
version "5.11.1"
resolved "https://registry.yarnpkg.com/@sentry/hub/-/hub-5.11.1.tgz#ddcb865563fae53852d405885c46b4c6de68a91b"
integrity sha512-ucKprYCbGGLLjVz4hWUqHN9KH0WKUkGf5ZYfD8LUhksuobRkYVyig0ZGbshECZxW5jcDTzip4Q9Qimq/PkkXBg==
dependencies:
"@sentry/types" "5.11.0"
"@sentry/utils" "5.11.1"
tslib "^1.9.3"
"@sentry/minimal@5.11.1":
version "5.11.1"
resolved "https://registry.yarnpkg.com/@sentry/minimal/-/minimal-5.11.1.tgz#0e705d01a567282d8fbbda2aed848b4974cc3cec"
integrity sha512-HK8zs7Pgdq7DsbZQTThrhQPrJsVWzz7MaluAbQA0rTIAJ3TvHKQpsVRu17xDpjZXypqWcKCRsthDrC4LxDM1Bg==
dependencies:
"@sentry/hub" "5.11.1"
"@sentry/types" "5.11.0"
tslib "^1.9.3"
"@sentry/node@5.11.1":
version "5.11.1"
resolved "https://registry.yarnpkg.com/@sentry/node/-/node-5.11.1.tgz#2a9c18cd1209cfdf7a69b9d91303413149d2c910"
integrity sha512-FbJs0blJ36gEzE0rc2yBfA/KE+kXOLl8MUfFTcyJCBdCGF8XMETDCmgINnJ4TyBUJviwKoPw2TCk9TL2pa/A1w==
dependencies:
"@sentry/apm" "5.11.1"
"@sentry/core" "5.11.1"
"@sentry/hub" "5.11.1"
"@sentry/types" "5.11.0"
"@sentry/utils" "5.11.1"
cookie "^0.3.1"
https-proxy-agent "^4.0.0"
lru_map "^0.3.3"
tslib "^1.9.3"
"@sentry/types@5.11.0":
version "5.11.0"
resolved "https://registry.yarnpkg.com/@sentry/types/-/types-5.11.0.tgz#40f0f3174362928e033ddd9725d55e7c5cb7c5b6"
integrity sha512-1Uhycpmeo1ZK2GLvrtwZhTwIodJHcyIS6bn+t4IMkN9MFoo6ktbAfhvexBDW/IDtdLlCGJbfm8nIZerxy0QUpg==
"@sentry/utils@5.11.1":
version "5.11.1"
resolved "https://registry.yarnpkg.com/@sentry/utils/-/utils-5.11.1.tgz#aa19fcc234cf632257b2281261651d2fac967607"
integrity sha512-O0Zl4R2JJh8cTkQ8ZL2cDqGCmQdpA5VeXpuBbEl1v78LQPkBDISi35wH4mKmLwMsLBtTVpx2UeUHBj0KO5aLlA==
dependencies:
"@sentry/types" "5.11.0"
tslib "^1.9.3"
"@sindresorhus/is@^1.0.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-1.2.0.tgz#63ce3638cb85231f3704164c90a18ef816da3fb7"
integrity sha512-mwhXGkRV5dlvQc4EgPDxDxO6WuMBVymGFd1CA+2Y+z5dG9MNspoQ+AWjl/Ld1MnpCL8AKbosZlDVohqcIwuWsw==
"@szmarczak/http-timer@^4.0.0":
version "4.0.0"
resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-4.0.0.tgz#309789ccb7842ff1e41848cf43da587f78068836"
integrity sha512-3yoXv8OtGr/r3R5gaWWNQ3VUoQ5G3Gmo8DXX95V14ZVvE2b7Pj6Ide9uIDON8ym4D/ItyfL9ejohYUPqOyvRXw==
dependencies:
defer-to-connect "^1.1.1"
"@types/cacheable-request@^6.0.1":
version "6.0.1"
resolved "https://registry.yarnpkg.com/@types/cacheable-request/-/cacheable-request-6.0.1.tgz#5d22f3dded1fd3a84c0bbeb5039a7419c2c91976"
integrity sha512-ykFq2zmBGOCbpIXtoVbz4SKY5QriWPh3AjyU4G74RYbtt5yOc5OfaY75ftjg7mikMOla1CTGpX3lLbuJh8DTrQ==
dependencies:
"@types/http-cache-semantics" "*"
"@types/keyv" "*"
"@types/node" "*"
"@types/responselike" "*"
"@types/http-cache-semantics@*":
version "4.0.0"
resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.0.tgz#9140779736aa2655635ee756e2467d787cfe8a2a"
integrity sha512-c3Xy026kOF7QOTn00hbIllV1dLR9hG9NkSrLQgCVs8NF6sBU+VGWjD3wLPhmh1TYAc7ugCFsvHYMN4VcBN1U1A==
"@types/keyv@*":
version "3.1.1"
resolved "https://registry.yarnpkg.com/@types/keyv/-/keyv-3.1.1.tgz#e45a45324fca9dab716ab1230ee249c9fb52cfa7"
integrity sha512-MPtoySlAZQ37VoLaPcTHCu1RWJ4llDkULYZIzOYxlhxBqYPB0RsRlmMU0R6tahtFe27mIdkHV+551ZWV4PLmVw==
dependencies:
"@types/node" "*"
"@types/node-fetch@2.5.4":
version "2.5.4"
resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.4.tgz#5245b6d8841fc3a6208b82291119bc11c4e0ce44"
integrity sha512-Oz6id++2qAOFuOlE1j0ouk1dzl3mmI1+qINPNBhi9nt/gVOz0G+13Ao6qjhdF0Ys+eOkhu6JnFmt38bR3H0POQ==
dependencies:
"@types/node" "*"
"@types/node@*", "@types/node@13.1.4":
version "13.1.4"
resolved "https://registry.yarnpkg.com/@types/node/-/node-13.1.4.tgz#4cfd90175a200ee9b02bd6b1cd19bc349741607e"
integrity sha512-Lue/mlp2egZJoHXZr4LndxDAd7i/7SQYhV0EjWfb/a4/OZ6tuVwMCVPiwkU5nsEipxEf7hmkSU7Em5VQ8P5NGA==
"@types/responselike@*":
version "1.0.0"
resolved "https://registry.yarnpkg.com/@types/responselike/-/responselike-1.0.0.tgz#251f4fe7d154d2bad125abe1b429b23afd262e29"
integrity sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==
dependencies:
"@types/node" "*"
"@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"
agent-base@5:
version "5.1.1"
resolved "https://registry.yarnpkg.com/agent-base/-/agent-base-5.1.1.tgz#e8fb3f242959db44d63be665db7a8e739537a32c"
integrity sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g==
arg@^4.1.0:
version "4.1.3"
resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089"
integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==
binary@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/binary/-/binary-0.3.0.tgz#9f60553bc5ce8c3386f3b553cff47462adecaa79"
integrity sha1-n2BVO8XOjDOG87VTz/R0Yq3sqnk=
dependencies:
buffers "~0.1.1"
chainsaw "~0.1.0"
bl@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/bl/-/bl-3.0.0.tgz#3611ec00579fd18561754360b21e9f784500ff88"
integrity sha512-EUAyP5UHU5hxF8BPT0LKW8gjYLhq1DQIcneOX/pL/m2Alo+OYDQAJlHq+yseMP50Os2nHXOSic6Ss3vSQeyf4A==
dependencies:
readable-stream "^3.0.1"
buffer-from@^1.0.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==
buffers@~0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/buffers/-/buffers-0.1.1.tgz#b24579c3bed4d6d396aeee6d9a8ae7f5482ab7bb"
integrity sha1-skV5w77U1tOWru5tmorn9Ugqt7s=
cacheable-lookup@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-0.2.1.tgz#f474ae2c686667d7ea08c43409ad31b2b31b26c2"
integrity sha512-BQ8MRjxJASEq2q+w0SusPU3B054gS278K8sj58QCLMZIso5qG05+MdCdmXxuyVlfvI8h4bPsNOavVUauVCGxrg==
dependencies:
keyv "^3.1.0"
cacheable-request@^7.0.0:
version "7.0.0"
resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-7.0.0.tgz#12421aa084e943ec81eac8c93e56af90c624788a"
integrity sha512-UVG4gMn3WjnAeFBBx7RFoprgOANIAkMwN5Dta6ONmfSwrCxfm0Ip7g0mIBxIRJZX9aDsoID0Ry3dU5Pr0csKKA==
dependencies:
clone-response "^1.0.2"
get-stream "^5.1.0"
http-cache-semantics "^4.0.0"
keyv "^3.0.0"
lowercase-keys "^2.0.0"
normalize-url "^4.1.0"
responselike "^2.0.0"
chainsaw@~0.1.0:
version "0.1.0"
resolved "https://registry.yarnpkg.com/chainsaw/-/chainsaw-0.1.0.tgz#5eab50b28afe58074d0d58291388828b5e5fbc98"
integrity sha1-XqtQsor+WAdNDVgpE4iCi15fvJg=
dependencies:
traverse ">=0.3.0 <0.4"
chownr@^1.1.1:
version "1.1.3"
resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.3.tgz#42d837d5239688d55f303003a508230fa6727142"
integrity sha512-i70fVHhmV3DtTl6nqvZOnIjbY0Pe4kAUjwHj8z0zAdgBtYrJyYwLKCCuRBQ5ppkyL0AkN7HKRnETdmdp1zqNXw==
clone-response@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b"
integrity sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=
dependencies:
mimic-response "^1.0.0"
cookie@^0.3.1:
version "0.3.1"
resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.3.1.tgz#e7e0a1f9ef43b4c8ba925c5c5a96e806d16873bb"
integrity sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=
debug@4:
version "4.1.1"
resolved "https://registry.yarnpkg.com/debug/-/debug-4.1.1.tgz#3b72260255109c6b589cee050f1d516139664791"
integrity sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==
dependencies:
ms "^2.1.1"
decompress-response@^5.0.0:
version "5.0.0"
resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-5.0.0.tgz#7849396e80e3d1eba8cb2f75ef4930f76461cb0f"
integrity sha512-TLZWWybuxWgoW7Lykv+gq9xvzOsUjQ9tF09Tj6NSTYGMTCHNXzrPnD6Hi+TgZq19PyTAGH4Ll/NIM/eTGglnMw==
dependencies:
mimic-response "^2.0.0"
defer-to-connect@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.1.tgz#88ae694b93f67b81815a2c8c769aef6574ac8f2f"
integrity sha512-J7thop4u3mRTkYRQ+Vpfwy2G5Ehoy82I14+14W4YMDLKdWloI9gSzRbV30s/NckQGVJtPkWNcW4oMAUigTdqiQ==
diff@^4.0.1:
version "4.0.2"
resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d"
integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==
duplexer3@^0.1.4:
version "0.1.4"
resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2"
integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=
end-of-stream@^1.1.0, end-of-stream@^1.4.1:
version "1.4.4"
resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0"
integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==
dependencies:
once "^1.4.0"
fs-constants@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad"
integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==
get-stream@^5.0.0, get-stream@^5.1.0:
version "5.1.0"
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-5.1.0.tgz#01203cdc92597f9b909067c3e656cc1f4d3c4dc9"
integrity sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==
dependencies:
pump "^3.0.0"
got@10.2.1:
version "10.2.1"
resolved "https://registry.yarnpkg.com/got/-/got-10.2.1.tgz#7087485482fb31aa6e6399fd493dd04639da117b"
integrity sha512-IQX//hGm5oLjUj743GJG30U2RzjS58ZlhQQjwQXjsyR50TTD+etVMHlMEbNxYJGWVFa0ASgDVhRkAvQPe6M9iQ==
dependencies:
"@sindresorhus/is" "^1.0.0"
"@szmarczak/http-timer" "^4.0.0"
"@types/cacheable-request" "^6.0.1"
cacheable-lookup "^0.2.1"
cacheable-request "^7.0.0"
decompress-response "^5.0.0"
duplexer3 "^0.1.4"
get-stream "^5.0.0"
lowercase-keys "^2.0.0"
mimic-response "^2.0.0"
p-cancelable "^2.0.0"
responselike "^2.0.0"
to-readable-stream "^2.0.0"
type-fest "^0.8.0"
http-cache-semantics@^4.0.0:
version "4.0.3"
resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.0.3.tgz#495704773277eeef6e43f9ab2c2c7d259dda25c5"
integrity sha512-TcIMG3qeVLgDr1TEd2XvHaTnMPwYQUQMIBLy+5pLSDKYFc7UIqj39w8EGzZkaxoLv/l2K8HaI0t5AVA+YYgUew==
https-proxy-agent@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz#702b71fb5520a132a66de1f67541d9e62154d82b"
integrity sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg==
dependencies:
agent-base "5"
debug "4"
inherits@^2.0.3:
version "2.0.4"
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
json-buffer@3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898"
integrity sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=
keyv@^3.0.0, keyv@^3.1.0:
version "3.1.0"
resolved "https://registry.yarnpkg.com/keyv/-/keyv-3.1.0.tgz#ecc228486f69991e49e9476485a5be1e8fc5c4d9"
integrity sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==
dependencies:
json-buffer "3.0.0"
lowercase-keys@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479"
integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==
lru_map@^0.3.3:
version "0.3.3"
resolved "https://registry.yarnpkg.com/lru_map/-/lru_map-0.3.3.tgz#b5c8351b9464cbd750335a79650a0ec0e56118dd"
integrity sha1-tcg1G5Rky9dQM1p5ZQoOwOVhGN0=
make-error@^1.1.1:
version "1.3.6"
resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2"
integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==
mimic-response@^1.0.0:
version "1.0.1"
resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b"
integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==
mimic-response@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-2.0.0.tgz#996a51c60adf12cb8a87d7fb8ef24c2f3d5ebb46"
integrity sha512-8ilDoEapqA4uQ3TwS0jakGONKXVJqpy+RpM+3b7pLdOjghCrEiGp9SRkFbUHAmZW9vdnrENWHjaweIoTIJExSQ==
minimist@0.0.8:
version "0.0.8"
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=
mkdirp@^0.5.1:
version "0.5.1"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz#30057438eac6cf7f8c4767f38648d6697d75c903"
integrity sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=
dependencies:
minimist "0.0.8"
ms@^2.1.1:
version "2.1.2"
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==
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"
resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.0.tgz#453354087e6ca96957bd8f5baf753f5982142129"
integrity sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==
once@^1.3.1, once@^1.4.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
dependencies:
wrappy "1"
p-cancelable@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-2.0.0.tgz#4a3740f5bdaf5ed5d7c3e34882c6fb5d6b266a6e"
integrity sha512-wvPXDmbMmu2ksjkB4Z3nZWTSkJEb9lqVdMaCKpZUGJG9TMiNp9XcbG3fn9fPKjem04fJMJnXoyFPk2FmgiaiNg==
parse-github-url@1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/parse-github-url/-/parse-github-url-1.0.2.tgz#242d3b65cbcdda14bb50439e3242acf6971db395"
integrity sha512-kgBf6avCbO3Cn6+RnzRGLkUsv4ZVqv/VfAYkRsyBcgkshNvVBkRn1FEZcW0Jb+npXQWm2vHPnnOqFteZxRRGNw==
pump@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64"
integrity sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==
dependencies:
end-of-stream "^1.1.0"
once "^1.3.1"
readable-stream@^3.0.1, readable-stream@^3.1.1:
version "3.4.0"
resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.4.0.tgz#a51c26754658e0a3c21dbf59163bd45ba6f447fc"
integrity sha512-jItXPLmrSR8jmTRmRWJXCnGJsfy85mB3Wd/uINMXA65yrnFo0cPClFIUWzo2najVNSl+mx7/4W8ttlLWJe99pQ==
dependencies:
inherits "^2.0.3"
string_decoder "^1.1.1"
util-deprecate "^1.0.1"
responselike@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/responselike/-/responselike-2.0.0.tgz#26391bcc3174f750f9a79eacc40a12a5c42d7723"
integrity sha512-xH48u3FTB9VsZw7R+vvgaKeLKzT6jOogbQhEe/jewwnZgzPcnyWui2Av6JpoYZF/91uueC+lqhWqeURw5/qhCw==
dependencies:
lowercase-keys "^2.0.0"
safe-buffer@~5.2.0:
version "5.2.0"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519"
integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg==
source-map-support@^0.5.17:
version "0.5.19"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61"
integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==
dependencies:
buffer-from "^1.0.0"
source-map "^0.6.0"
source-map@^0.6.0:
version "0.6.1"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
string_decoder@^1.1.1:
version "1.3.0"
resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e"
integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==
dependencies:
safe-buffer "~5.2.0"
tar-fs@2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-2.0.0.tgz#677700fc0c8b337a78bee3623fdc235f21d7afad"
integrity sha512-vaY0obB6Om/fso8a8vakQBzwholQ7v5+uy+tF3Ozvxv1KNezmVQAiWtcNmMHFSFPqL3dJA8ha6gdtFbfX9mcxA==
dependencies:
chownr "^1.1.1"
mkdirp "^0.5.1"
pump "^3.0.0"
tar-stream "^2.0.0"
tar-stream@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.1.0.tgz#d1aaa3661f05b38b5acc9b7020efdca5179a2cc3"
integrity sha512-+DAn4Nb4+gz6WZigRzKEZl1QuJVOLtAwwF+WUxy1fJ6X63CaGaUAxJRD2KEn1OMfcbCjySTYpNC6WmfQoIEOdw==
dependencies:
bl "^3.0.0"
end-of-stream "^1.4.1"
fs-constants "^1.0.0"
inherits "^2.0.3"
readable-stream "^3.1.1"
to-readable-stream@^2.0.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/to-readable-stream/-/to-readable-stream-2.1.0.tgz#82880316121bea662cdc226adb30addb50cb06e8"
integrity sha512-o3Qa6DGg1CEXshSdvWNX2sN4QHqg03SPq7U6jPXRahlQdl5dK8oXjkU/2/sGrnOZKeGV1zLSO8qPwyKklPPE7w==
"traverse@>=0.3.0 <0.4":
version "0.3.9"
resolved "https://registry.yarnpkg.com/traverse/-/traverse-0.3.9.tgz#717b8f220cc0bb7b44e40514c22b2e8bbc70d8b9"
integrity sha1-cXuPIgzAu3tE5AUUwisui7xw2Lk=
ts-node@8.9.1:
version "8.9.1"
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-8.9.1.tgz#2f857f46c47e91dcd28a14e052482eb14cfd65a5"
integrity sha512-yrq6ODsxEFTLz0R3BX2myf0WBCSQh9A+py8PBo1dCzWIOcvisbyH6akNKqDHMgXePF2kir5mm5JXJTH3OUJYOQ==
dependencies:
arg "^4.1.0"
diff "^4.0.1"
make-error "^1.1.1"
source-map-support "^0.5.17"
yn "3.1.1"
tslib@^1.9.3:
version "1.10.0"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.10.0.tgz#c3c19f95973fb0a62973fb09d90d961ee43e5c8a"
integrity sha512-qOebF53frne81cf0S9B41ByenJ3/IuH8yJKngAX35CmiZySA0khhkovshKK+jGCaMnVomla7gVlIcc3EvKPbTQ==
type-fest@^0.8.0:
version "0.8.1"
resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d"
integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==
typescript@3.9.3:
version "3.9.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.3.tgz#d3ac8883a97c26139e42df5e93eeece33d610b8a"
integrity sha512-D/wqnB2xzNFIcoBG9FG8cXRDjiqSTbG2wd8DMZeQyJlP1vfTkIxH4GKveWaEBYySKIg+USu+E+EDIR47SqnaMQ==
typescript@3.9.6:
version "3.9.6"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.6.tgz#8f3e0198a34c3ae17091b35571d3afd31999365a"
integrity sha512-Pspx3oKAPJtjNwE92YS05HQoY7z2SFyOpHo9MqJor3BXAGNaPUs83CuVp9VISFkSjyRfiTpmKuAYGJB7S7hOxw==
unzip-stream@0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/unzip-stream/-/unzip-stream-0.3.0.tgz#c30c054cd6b0d64b13a23cd3ece911eb0b2b52d8"
integrity sha512-NG1h/MdGIX3HzyqMjyj1laBCmlPYhcO4xEy7gEqqzGiSLw7XqDQCnY4nYSn5XSaH8mQ6TFkaujrO8d/PIZN85A==
dependencies:
binary "^0.3.0"
mkdirp "^0.5.1"
util-deprecate@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=
wrappy@1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=
yn@3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"
integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==

View File

@@ -1,18 +0,0 @@
const { execSync } = require('child_process');
const commit = execSync('git log --pretty=format:"%s %H"')
.toString()
.trim()
.split('\n')
.find(line => line.startsWith('Publish '))
.split(' ')
.pop();
if (!commit) {
throw new Error('Unable to find last publish commit');
}
const log = execSync(`git log --pretty=format:"- %s [%an]" ${commit}...HEAD`).toString().trim();
console.log(`Changes since the last publish commit ${commit}:`);
console.log(`\n${log}\n`);

8
codecov.yml Normal file
View File

@@ -0,0 +1,8 @@
codecov:
require_ci_to_pass: yes
coverage:
status:
project: off
patch: off

36
diff.js
View File

@@ -1,36 +0,0 @@
const { execSync } = require('child_process');
const { join } = require('path');
const { tmpdir } = require('os');
const { mkdirSync, writeFileSync } = require('fs');
function getCommits(count) {
return execSync('git log --pretty=format:"%s [%an]"')
.toString()
.trim()
.split('\n')
.slice(0, count)
.filter(line => !line.startsWith('Publish '))
.join('\n');
}
function main(count = '100') {
console.log(`Generating diff using last ${count} commits...`);
const randomTmpId = Math.random().toString().slice(2);
const dir = join(tmpdir(), 'now-diff' + randomTmpId);
mkdirSync(dir);
execSync('git checkout canary && git pull');
const canary = getCommits(count);
execSync('git checkout master && git pull');
const master = getCommits(count);
writeFileSync(join(dir, 'log.txt'), '# canary\n' + canary);
execSync('git init && git add -A && git commit -m "init"', { cwd: dir });
writeFileSync(join(dir, 'log.txt'), '# master\n' + master);
console.log(`Done generating diff. Run the following:`);
console.log(`cd ${dir}`);
console.log('Then use `git diff` or `git difftool` to view the differences.');
}
main(process.argv[2]);

View File

@@ -8,7 +8,7 @@ the provider couldnt solve the requested challenges.
## How to Fix It ## How to Fix It
If your domain is pointing to ZEIT World DNS and youre getting this error, If your domain is pointing to Vercel DNS and youre getting this error,
it could be that: it could be that:
- The domain was acquired recently, and it might not be ready for use yet. - The domain was acquired recently, and it might not be ready for use yet.
@@ -17,11 +17,11 @@ it could be that:
When running into this, ensure that your nameservers are configured correctly. Also, if you bought the domain recently or have made changes, please be patient, When running into this, ensure that your nameservers are configured correctly. Also, if you bought the domain recently or have made changes, please be patient,
it might take a while for these to be ready. it might take a while for these to be ready.
If your domain is _not_ pointing to ZEIT World DNS and youre getting this If your domain is _not_ pointing to Vercel DNS and youre getting this
error, the following methods could help: error, the following methods could help:
- When solving challenges *manually*, ensure that the TXT - When solving challenges _manually_, ensure that the TXT
records required to solve the challenges exist and are propagated. You can do so by querying the nameservers with `nslookup -q=TXT _acme-challenge.domain.com` depending on the Common Names you want for your certificate. records required to solve the challenges exist and are propagated. You can do so by querying the nameservers with `nslookup -q=TXT _acme-challenge.domain.com` depending on the Common Names you want for your certificate.
- If you are not solving the challenges manually you must ensure that you have an - If you are not solving the challenges manually you must ensure that you have an
`ALIAS` and `CNAME` records in place. Ensure also that you have disabled automatic redirects to `https` and ensure all changes were propagated. `ALIAS` and `CNAME` records in place. Ensure also that you have disabled automatic redirects to `https` and ensure all changes were propagated.

View File

@@ -2,14 +2,14 @@
#### Why This Error Occurred #### Why This Error Occurred
When supplying `regions` or `scale` settings, you When supplying `regions` configuration, you
used an unknown or invalid dc identifier. used an unknown or invalid DC identifier.
#### Possible Ways to Fix It #### Possible Ways to Fix It
Check your `now.json` or `--regions` flag and Check your `vercel.json` or `--regions` flag and
make sure you are using a valid string. Regions make sure you are using a valid string. Regions
and DCs have to be in *lowercase*. and DCs have to be in _lowercase_.
**Valid region identifiers**: **Valid region identifiers**:
@@ -19,7 +19,7 @@ and DCs have to be in *lowercase*.
- `gru` - `gru`
- `iad` - `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. DC identifiers before being sent to our APIs.
**Valid DC identifiers**: **Valid DC identifiers**:
@@ -33,5 +33,5 @@ When passing multiple `--regions` as a CLI parameter,
make sure they're separated by a comma (`,`). For example: make sure they're separated by a comma (`,`). For example:
```console ```console
now --regions sfo,bru,gru vercel --regions sfo,bru,gru
``` ```

View File

@@ -4,12 +4,12 @@
When generating a certificate, we have to prove ownership over the domain When generating a certificate, we have to prove ownership over the domain
for the Certificate Authority (CA) that issues it. We also run some pretests for the Certificate Authority (CA) that issues it. We also run some pretests
to make sure the DNS is properly configured before submitting the request to to make sure the DNS is properly configured before submitting the request to
the CA. This error means that these pretests did not succeed. the CA. This error means that these pretests did not succeed.
## How to Fix It ## How to Fix It
If your domain is pointing to ZEIT World DNS and youre getting this error, If your domain is pointing to Vercel DNS and youre getting this error,
it could be that: it could be that:
- The domain was acquired recently, and it might not be ready for use yet. - The domain was acquired recently, and it might not be ready for use yet.
@@ -18,6 +18,6 @@ it could be that:
When running into this, ensure that your nameservers have configuration is correct. Also, if you bought the domain recently or have made changes, please be patient, When running into this, ensure that your nameservers have configuration is correct. Also, if you bought the domain recently or have made changes, please be patient,
it might take a while for these to be ready. it might take a while for these to be ready.
If your domain is _not_ pointing to ZEIT World DNS and youre getting this If your domain is _not_ pointing to Vercel DNS and youre getting this
error, you must ensure that you have an `ALIAS` and `CNAME` records in place. error, you must ensure that you have an `ALIAS` and `CNAME` records in place.
Ensure also that you have disabled automatic redirects to `https` and ensure all changes were propagated. Ensure also that you have disabled automatic redirects to `https` and ensure all changes were propagated.

View File

@@ -2,20 +2,18 @@
#### Why This Error Occurred #### Why This Error Occurred
The domain you supplied cannot be verified using either the intended set of nameservers of the given verification TXT record. The domain you supplied cannot be verified using the intended nameservers.
#### Possible Ways to Fix It #### Possible Way to Fix It
Apply the intended set of nameservers to your domain or add the given TXT verification record through your domain provider. Apply the intended set of nameservers to your domain.
You can retrieve both the intended nameservers and TXT verification record for the domain you wish to verify by running `now domains inspect <domain>`. You can retrieve both the intended nameservers and TXT verification record for the domain you wish to verify by running `vercel domains inspect <domain>`.
When you have added either verification method to your domain, you can run `now domains verify <domain>` again to complete verification for your domain. Vercel will also automatically check periodically that your domain has been verified and automatically mark it as such if we detect either verification method on the domain.
ZEIT will also automatically check periodically that your domain has been verified and automatically mark it as such if we detect either verification method on the domain. If you would not like to verify your domain, you can remove it from your account using `vercel domains rm <domain>`.
If you would not like to verify your domain, you can remove it from your account using `now domains rm <domain>`.
#### Resources #### Resources
- [ZEIT Domains Documentation](https://zeit.co/docs/v2/domains-and-aliases/adding-a-domain/)
- [Zero-Downtime Domain Migration Guide](https://zeit.co/docs/v2/domains-and-aliases/zero-downtime-domain-migration/) - [Vercel Custom Domains Documentation](https://vercel.com/docs/v2/custom-domains)

View File

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

View File

@@ -0,0 +1,53 @@
# Invalid Custom Route `source`
#### Why This Error Occurred
When defining custom routes a route was added that causes an error during parsing. This can be due to trying to use normal `RegExp` syntax like negative lookaheads (`?!exclude`) without following `path-to-regexp`'s syntax for it.
#### Possible Ways to Fix It
Wrap the `RegExp` part of your `source` as an un-named parameter.
**Before**
```js
{
source: '/feedback/(?!general)',
destination: '/api/feedback/general'
}
```
**After**
```js
{
source: '/feedback/((?!general).*)',
destination: '/api/feedback/general'
}
```
Ensure any segments used in the `destination` property are also used in the `source` property.
**Before**
```js
{
source: '/feedback/:type',
destination: '/api/feedback/:id'
}
```
**After**
```js
{
source: '/feedback/:id',
destination: '/api/feedback/:id'
}
```
### Useful Links
- [path-to-regexp](https://github.com/pillarjs/path-to-regexp/tree/v6.1.0)
- [named parameters](https://github.com/pillarjs/path-to-regexp/blob/v6.1.0/Readme.md#named-parameters)
- [un-named paramters](https://github.com/pillarjs/path-to-regexp/blob/v6.1.0/Readme.md#unnamed-parameters)

View File

@@ -0,0 +1,11 @@
# Invalid Token Value
#### Why This Error Occurred
The `--token` flag was specified, but its contents are invalid.
#### Possible Ways to Fix It
The `--token` flag must only contain numbers (0-9) and letters from the alphabet (a-z and A-Z). This needs to be the token of the user account as which you'd like to act.
You can either get the token from the `./vercel/auth.json` file located in your user directory or [from the dashboard](https://vercel.com/account/tokens).

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 Now CLI. In addition, please ensure that the filename starts with a dot (example: `.env`) - then it should work.

View File

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

View File

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

View File

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

View File

@@ -8,4 +8,4 @@ The `--token` flag was specified, but there's no value for it available.
In order to make it work, you need to specify a value for the `--token` flag. This needs to be the token of the user account as which you'd like to act. In order to make it work, you need to specify a value for the `--token` flag. This needs to be the token of the user account as which you'd like to act.
You can either get the token from the `./now/auth.json` file located in your user directory or [from the dashboard](https://zeit.co/account/tokens). You can either get the token from the `./vercel/auth.json` file located in your user directory or [from the dashboard](https://vercel.com/account/tokens).

View File

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

View File

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

View File

@@ -2,9 +2,9 @@
#### Why This Error Occurred #### Why This Error Occurred
You're running Now CLI in a non-terminal context and there are no credentials available. This means that Now CLI is not able to authenticate against our service. You're running Vercel CLI in a non-terminal context and there are no credentials available. This means that Vercel CLI is not able to authenticate against our service.
#### Possible Ways to Fix It #### Possible Ways to Fix It
- Specify a value for the `--token` flag (this needs to be the token of the user account as which you'd like to act). You can either get the token from the `./now/auth.json` file located in your user directory or [from the dashboard](https://zeit.co/account/tokens). - Specify a value for the `--token` flag (this needs to be the token of the user account as which you'd like to act). You can create a new token on your [Settings page](https://vercel.com/account/tokens).
- Ensure that both `~/now/auth.json` and `~/now/config.json` exist - Run `vercel login` to sign in and generate a new token

View File

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

View File

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

View File

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

View File

@@ -2,7 +2,7 @@
#### Why This Error Occurred #### 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 #### Possible Ways to Fix It

View File

@@ -0,0 +1,16 @@
# Routes Manifest Could Not Be Found
#### Why This Error Occurred
This could be caused by a misconfigured "Build Command" or "Output Directory" for your Next.js project.
#### Possible Ways to Fix It
In the Vercel dashboard, open your "Project Settings" and draw attention to "Build & Development Settings":
1. Ensure that the "Build Command" setting is not changed, or that it calls `next build`. If this command is not changed but you are seeing this error, double check that your `build` script in `package.json` calls `next build`.
2. Ensure that the "Output Directory" setting is not changed. This value almost never needs to be configured, and is only necessary if you override `distDir` in `next.config.js`.
3. For `next export` users: **do not override the "Output Directory"**. Next.js automatically detects what folder you outputted `next export` to.
In rare scenarios, this error message can also be caused by a Next.js build failure (if your "Build Command" accidentally returns an exit code that is not 0).
Double check for any error messages above the Routes Manifest error, which may provide additional details.

View File

@@ -1,30 +1,32 @@
# `@now/static-build` Failed to detect a server running # `@vercel/static-build` Failed to detect a server running
#### Why This Warning Occurred #### Why This Warning Occurred
When running `now dev`, the `@now/static-build` builder proxies relevant HTTP When running `vercel dev`, the `@vercel/static-build` builder proxies relevant HTTP
requests to the server that is created by the `now-dev` script in the requests to the server that is created by the `dev` script in the
`package.json` file. `package.json` file.
In order for `now dev` to know which port the server is running on, the builder In order for `vercel dev` to know which port the server is running on, the builder
is provided a `$PORT` environment variable that the server _must_ bind to. The is provided a `$PORT` environment variable that the server _must_ bind to. The
error "Failed to detect a server running on port" is printed if the builder fails error "Failed to detect a server running on port" is printed if the builder fails
to detect a server listening on that specific port within five minutes. to detect a server listening on that specific port within five minutes.
#### Possible Ways to Fix It #### Possible Ways to Fix It
Please ensure that your `now-dev` script binds the spawned development server on Please ensure that your `dev` script binds the spawned development server on
the provided `$PORT` that the builder expects the server to bind to. the provided `$PORT` that the builder expects the server to bind to.
For example, if you are using Gatsby, your `now-dev` script must use the `-p` For example, if you are using Gatsby, your `dev` script must use the `-p`
(port) option to bind to the `$PORT` specified from the builder: (port) option to bind to the `$PORT` specified from the builder:
> _In Windows environments, reference the `PORT` environment variable with `%PORT%`_
``` ```
{ {
... ...
"scripts": { "scripts": {
... ...
"now-dev": "gatsby develop -p $PORT" "dev": "gatsby develop -p $PORT"
} }
} }
``` ```
@@ -32,7 +34,3 @@ For example, if you are using Gatsby, your `now-dev` script must use the `-p`
Consult your static builder program's `--help` or documentation to figure out what Consult your static builder program's `--help` or documentation to figure out what
the command line flag to bind to a specific port is (in many cases, it is one of: the command line flag to bind to a specific port is (in many cases, it is one of:
`-p` / `-P` / `--port`). `-p` / `-P` / `--port`).
### Useful Links
- [`@now/static-build` Local Development Documentation](https://zeit.co/docs/v2/deployments/official-builders/static-build-now-static-build#local-development)

View File

@@ -2,7 +2,7 @@
#### Why This Error Occurred #### Why This Error Occurred
You either tried to run Now CLI inside a directory that should never be deployed, or you specified a directory that should never be deployed like this: `now <directory>`. You either tried to run Vercel CLI inside a directory that should never be deployed, or you specified a directory that should never be deployed like this: `vercel <directory>`.
#### Possible Ways to Fix It #### 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 `now scale`,
we weren't able to recognize the value as valid.
#### Possible Ways to Fix It
Check your `now scale` command make sure you are using a
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 `now-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:
```
now scale my-url-123.now.sh sfo,bru,gru 1 5
```

View File

@@ -1,31 +0,0 @@
# `now scale ls` is deprecated
#### Why This Error Occurred
We have stopped supporting this command, in favor of
better alternatives.
`now scale ls` used to list all the scaling rules
for all your deployments. The output would be too long,
and it would often be hard to find the information
you needed in a long list of items.
#### Possible Ways to Fix It
Instead of using `now scale ls` to list all your deployments
and their scaling rules, first use `now ls` to find
your deployment:
```console
now ls
```
Then, select the URL of your deployment, which uniquely identifies it, and run:
```console
now 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 `now scale` on a path alias (`now alias -r rules.json`).
#### Possible Ways to Fix It
Path aliases are routes to instances. Instances can be scaled independent from each other.
You can view path aliases by running `now alias ls <id>`.
Documentation for Path Aliases can be found [here](https://zeit.co/docs/features/path-aliases).

View File

@@ -6,5 +6,6 @@ You specified the `--scope` flag and specified the ID or slug of a team that you
#### Possible Ways to Fix It #### Possible Ways to Fix It
- Make sure commands like `now ls` work just fine. This will ensure that your user credentials are valid. If it's not working correctly, please log in again using `now login`. - 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 `now switch`. If it doesn't, you're either not part of the team (if you specified a team) or you logged into the wrong user account. - 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 #### 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 #### 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. - 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).
Otherwise, either create a team with the specified slug or ensure that the identifier is correct if you're sure that the scope exists. - 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

@@ -3,18 +3,18 @@
## Why This Error Occurred ## Why This Error Occurred
When generating a certificate, we have to prove ownership over the domain When generating a certificate, we have to prove ownership over the domain
for the Certificate Authority (CA) that issues it. In the case of Wildcard Certificates, for the Certificate Authority (CA) that issues it. In the case of Wildcard Certificates,
the requested challenge consists of adding TXT DNS records so, when the domain does not the requested challenge consists of adding TXT DNS records so, when the domain does not
point to ZEIT World DNS, we cannot create the records to solve the challenge. point to Vercel DNS, we cannot create the records to solve the challenge.
## How to Fix It ## How to Fix It
To generate a certificate solving challenges manually, you must add the given `TXT` records with To generate a certificate solving challenges manually, you must add the given `TXT` records with
the appropriate name to your DNS. Then, after verifying that the CA can read the records, the appropriate name to your DNS. Then, after verifying that the CA can read the records,
you can rerun the issuance command. you can rerun the issuance command.
In case you want to start issuing a certificate to get the records you have to add or to In case you want to start issuing a certificate to get the records you have to add or to
get those records again in the console, You can run the issuance command including the get those records again in the console, You can run the issuance command including the
`--challenge-only` option. This way the CLI will output the challenges information and, `--challenge-only` option. This way the CLI will output the challenges information and,
after adding those records, you can rerun the command without `--challenge-only` to finish after adding those records, you can rerun the command without `--challenge-only` to finish
issuance. issuance.

View File

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

View File

@@ -1,17 +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 `now.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
```
now 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://zeit.co/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 `now logs <url>`)

85
examples/README.md vendored Normal file
View File

@@ -0,0 +1,85 @@
# Vercel Examples
This is the public list of examples for **Vercel**.
All of these ready to deploy examples feature a frontend framework or static site, created with zero configuration using the CLI tools they provide.
The `+functions` examples feature an `/api` directory as well, highlighting how to use serverless functions on top of a framework, again with zero configuration required.
## What is Vercel?
Vercel is a cloud platform for static frontends and serverless functions. It enables developers to host websites and web applications that deploy instantly, scale automatically, and require no supervision.
## What Does this Repository Contain?
This repository consists of multiple examples, created for use with the [Vercel](https://vercel.com) platform. In addition to this, it also contains:
- [Code of Conduct](https://github.com/vercel/vercel/blob/master/.github/CODE_OF_CONDUCT.md) - our Code of Conduct, adapted from the [Contributor Covenant](http://contributor-covenant.org)
- [Contributing Guidelines](https://github.com/vercel/vercel/blob/master/.github/CONTRIBUTING.md) - a guide on how to contribute to the examples repository
- [License](https://github.com/vercel/vercel/blob/master/LICENSE) - the standard MIT license under which these examples are published
We recommend familiarizing yourself with the above sections, particularly if you are looking to make a contribution.
## Deploying Examples
To get started using any of these examples as your own project, [install Vercel](https://vercel.com/download) and use either of the following commands in your terminal:
```sh
vercel init # Pick an example in the CLI
vercel init <example> # Create a new project from a specific <example>
vercel init <example> <name> # Create a new project from a specific <example> with a different folder <name>
```
Deploying your project takes seconds and can be done with **just a single command**:
```sh
vercel # Deploy your project with the CLI
```
With the `vercel` command, your project will be built and served by Vercel, providing you with a URL that can be shared immediately.
## New Examples
We are continuously improving our examples based on best practices and feedback from the community. As a result, it is possible that example names will change and on occasion deprecated in favor of an improved implementation.
For example, the previous `nodejs` example showed a static frontend with a Node.js API. This is illustrated 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/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
If you have an existing project you would like to deploy with Vercel, we recommend reading our guide on [migrating to Vercel and zero configuration](https://vercel.com/guides/migrate-to-vercel). By combining the guide with this repository, you will quickly be able to understand how to deploy your application.
If you would like to upgrade a project to take advantage of zero configuration, you may find the [upgrade guide](https://vercel.com/guides/upgrade-to-zero-configuration) useful. The upgrade guide covers how to remove configuration from existing projects along with how to use the `/api` directory.
## How to Contribute
Contributing examples should be an enjoyable experience, as such we have created a set of [contributing guidelines](https://github.com/vercel/vercel/blob/master/.github/CONTRIBUTING.md) to help you do so.
The guidelines cover important information such as the requirements for new examples and where to get help if you have any questions.
We have tried to make contributing to examples as easy as possible, especially for those new to Open Source. If anything is unclear or you have any questions then please reach out to us on [GitHub Discussions](https://github.com/vercel/vercel/discussions) where we will do our best to help you.
## Reporting Issues
We actively encourage our community to raise issues and provide feedback on areas of examples that could be improved.
An issue can be raised by clicking the 'Issues' tab at the top of the repository, followed by the Green 'New issue' button.
When submitting an issue, please thoroughly and concisely describe the problem you are experiencing so that we may easily understand and resolve the issue in a timely manner.
## License
This repository is an open source project. See the [License](https://github.com/vercel/vercel/blob/master/LICENSE).
## Get In Touch
If you have any questions that are not covered by raising an issue then please get in touch with us on [GitHub Discussions](https://github.com/vercel/vercel/discussions). There you will find both members of the community and staff who are happy to help answer questions on anything Vercel related.
[![Join the community on GitHub Discussions](https://badgen.net/badge/join%20the%20discussion/on%20github/black?icon=github)](https://github.com/vercel/vercel/discussions)

1
examples/amp/.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
.env

19
examples/amp/README.md Normal file
View File

@@ -0,0 +1,19 @@
# AMP Example
This directory is a brief example of an [AMP](https://amp.dev/) site that can be deployed with Vercel and zero configuration.
## Deploy Your Own
Deploy your own AMP project with Vercel.
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/main/examples/amp)
_Live Example: https://amp.now-examples.now.sh_
### How We Created This Example
To get started deploying AMP with Vercel, you can use the [Vercel CLI](https://vercel.com/download) to initialize the project:
```shell
$ vercel init amp
```

BIN
examples/amp/favicon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

72
examples/amp/index.html Normal file
View File

@@ -0,0 +1,72 @@
<!DOCTYPE html>
<html >
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,minimum-scale=1" />
<link rel="shortcut icon" href="favicon.png">
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
<link rel="canonical" href="index.html" />
<title>AMP Website</title>
<script async src="https://cdn.ampproject.org/v0.js"></script>
<style amp-custom>
body > * {
margin: 3rem 1rem;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
color: #525252;
}
h3 {
font-size: 2rem;
}
h4 {
margin-top: 2rem;
}
p {
font-size: 1.2rem;
line-height: 2rem;
}
.links {
display: flex;
justify-content: center;
margin-bottom: 3rem;
}
.links a {
margin: 0 10px;
font-size: 1rem;
color: #005af0;
}
</style>
</head>
<body>
<center>
<amp-img width=150 height=150 layout="fixed" class="logo" src="logo.png"></amp-img>
<h3>Welcome to your AMP page</h3>
<p>AMP is a web component framework to <br> easily create user-first websites, stories, ads and emails.</p>
<h4>Links</h4>
<div class="links">
<a href="https://amp.dev/">Homepage</a>
<a href="https://amp.dev/documentation/guides-and-tutorials/?format=websites">Tutorials</a>
<a href="https://amp.dev/documentation/examples/">Examples</a>
<a href="https://blog.amp.dev">Blog</a>
</div>
<h4>Ready to get started?</h4>
<div class="links">
<a href="https://amp.dev/documentation/guides-and-tutorials/start/create/?format=websites">Create your first AMP page</a>
</div>
<h4>Get involved</h4>
<div class="links">
<a href="https://twitter.com/amphtml">Twitter</a>
<a href="https://amphtml.slack.com">Slack</a>
<a href="https://amp.dev/events/amp-conf-2019">AMP Conf</a>
<a href="https://amp.dev/events/amp-roadshow">AMP Roadshow</a>
</div>
</center>
</body>
</html>

BIN
examples/amp/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

52
examples/angular/.gitignore vendored Normal file
View File

@@ -0,0 +1,52 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
# compiled output
/dist
/tmp
/out-tsc
# Only exists if Bazel was run
/bazel-out
# dependencies
/node_modules
# profiling files
chrome-profiler-events.json
speed-measure-plugin.json
# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace
# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*
# misc
/.sass-cache
/connect.lock
/coverage
/libpeerconnection.log
npm-debug.log
yarn-error.log
testem.log
/typings
# System Files
.DS_Store
Thumbs.db
# Environment Variables
.env
.env.build
.vercel

View File

@@ -0,0 +1,21 @@
![Angular Logo](https://github.com/vercel/vercel/blob/master/packages/frameworks/logos/angular.svg)
# Angular Example
This directory is a brief example of an [Angular](https://angular.io/) app that can be deployed with Vercel and zero configuration.
## Deploy Your Own
Deploy your own Angular project with Vercel.
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/import/project?template=https://github.com/vercel/vercel/tree/main/examples/angular)
_Live Example: https://angular.now-examples.now.sh_
### How We Created This Example
To get started with Angular, you can use the [Angular CLI](https://cli.angular.io/) to initialize the project:
```shell
$ ng new
```

View File

@@ -0,0 +1,109 @@
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"version": 1,
"newProjectRoot": "projects",
"projects": {
"angular": {
"projectType": "application",
"schematics": {},
"root": "",
"sourceRoot": "src",
"prefix": "app",
"architect": {
"build": {
"builder": "@angular-devkit/build-angular:browser",
"options": {
"outputPath": "dist/angular",
"index": "src/index.html",
"main": "src/main.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.app.json",
"aot": false,
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.css"],
"scripts": []
},
"configurations": {
"production": {
"fileReplacements": [
{
"replace": "src/environments/environment.ts",
"with": "src/environments/environment.prod.ts"
}
],
"optimization": true,
"outputHashing": "all",
"sourceMap": false,
"extractCss": true,
"namedChunks": false,
"aot": true,
"extractLicenses": true,
"vendorChunk": false,
"buildOptimizer": true,
"budgets": [
{
"type": "initial",
"maximumWarning": "2mb",
"maximumError": "5mb"
}
]
}
}
},
"serve": {
"builder": "@angular-devkit/build-angular:dev-server",
"options": {
"browserTarget": "angular:build"
},
"configurations": {
"production": {
"browserTarget": "angular:build:production"
}
}
},
"extract-i18n": {
"builder": "@angular-devkit/build-angular:extract-i18n",
"options": {
"browserTarget": "angular:build"
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "tsconfig.spec.json",
"karmaConfig": "karma.conf.js",
"assets": ["src/favicon.ico", "src/assets"],
"styles": ["src/styles.css"],
"scripts": []
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"tsconfig.app.json",
"tsconfig.spec.json",
"e2e/tsconfig.json"
],
"exclude": ["**/node_modules/**"]
}
},
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js",
"devServerTarget": "angular:serve"
},
"configurations": {
"production": {
"devServerTarget": "angular:serve:production"
}
}
}
}
}
},
"defaultProject": "angular"
}

View File

@@ -0,0 +1,28 @@
import { AppPage } from './app.po';
import { browser, logging } from 'protractor';
describe('workspace-project App', () => {
let page: AppPage;
beforeEach(() => {
page = new AppPage();
});
it('should display welcome message', () => {
page.navigateTo();
expect(page.getTitleText()).toEqual('Welcome to angular!');
});
afterEach(async () => {
// Assert that there are no errors emitted from the browser
const logs = await browser
.manage()
.logs()
.get(logging.Type.BROWSER);
expect(logs).not.toContain(
jasmine.objectContaining({
level: logging.Level.SEVERE,
} as logging.Entry)
);
});
});

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