Compare commits

...

2895 Commits

Author SHA1 Message Date
Steven
c5ebaa11ea Publish
- gatsby-plugin-now@1.2.2
 - @now/build-utils@0.10.1
 - now@16.3.0
 - now-client@5.1.4
 - @now/go@0.6.0
 - @now/next@1.0.2
 - @now/node@1.0.1
 - @now/python@0.3.0
 - @now/ruby@0.1.7
 - @now/static-build@0.10.0
2019-09-30 09:41:51 -04:00
Andy
934fbc8992 [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-30 09:38:16 -04:00
Max
72cb5515fd [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-30 09:38:06 -04:00
Steven
c7f0770d53 [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-30 09:38:00 -04:00
Max
7ea49e8ada [now-cli] Add not_domain_owner error handling (#3045)
This adds missing error handler for `not_domain_owner` error (fixes #3042)
2019-09-30 09:37:55 -04:00
Nathan Rajlich
cae6ce96b3 [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-30 09:37:49 -04:00
Sophearak Tha
3699dfd756 [now-next] Invoke build script (#3073)
This PR make `@now/next` invoke `build` script if user defined.

PRODUCT-106 #close
2019-09-30 09:37:41 -04:00
Leo Lamprecht
6dca96d877 [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-30 09:37:36 -04:00
Leo Lamprecht
88c14b27a2 [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-30 09:37:31 -04:00
Max
0d2a9539f6 [now-cli] Add logging to execa calls in tests (#3077)
This implements #3075 for all integration tests
2019-09-30 09:37:25 -04:00
Max
bae160bd7c [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-30 09:37:19 -04:00
Max
92852ecff2 [now-cli] Move hexo test to testFixtureStdio (#3076)
This should fix the `now dev` tests that periodically hang
2019-09-30 09:37:12 -04:00
Max
ac0c841cb8 [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-30 09:37:05 -04:00
Sophearak Tha
53e4b71f89 [now-cli] Render prompt when deploying home directory (#3057)
Fixes #3069 

PRODUCT-160 #close
2019-09-30 09:36:53 -04:00
Steven
017a2692ca [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-30 09:36:45 -04:00
Steven
311f89eecb Use PR description for merge commit body (#3071) 2019-09-30 09:36:39 -04:00
Steven
40d2bc4743 [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-30 09:36:33 -04:00
Steven
37160cbc8b [tests] Add benchmark script to randomly generate projects files (#3062) 2019-09-30 09:36:28 -04:00
Steven
3807a2b018 [now-node] Fix sharp test using lock file (#3064) 2019-09-30 09:36:21 -04:00
Steven
b6697dd432 [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-30 09:36:16 -04:00
Sophearak Tha
6c33496e8a [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-30 09:36:08 -04:00
Sophearak Tha
89f32625ed [now-cli] Fix 02-angular-node test fail (#3058)
* Improve `02-angular-node` test

* Add `yarn.lock` with pin version
2019-09-30 09:35:53 -04:00
Steven
8253e76ec0 [now-python] Fix headers with multiple values (#3053)
* [now-python] Add format_headers()

* Add tests

* Fix filenames

* Fix test probes
2019-09-30 09:35:44 -04:00
Andy
e0b3e9606a [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-30 09:35:38 -04:00
Sophearak Tha
dc75a303f7 [now-build-utils] Remove NOW_BUILDER_ANNOTATE (#3027) 2019-09-30 09:35:33 -04:00
Steven
c1eb8ec78c [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-30 09:35:26 -04:00
Sophearak Tha
12435f25fd [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-30 09:35:21 -04:00
Steven
d4dc5222cf [now-static-build] Add prepareCache() function (#3047) 2019-09-30 09:35:14 -04:00
Steven
bf1e59b2d3 [now-static-build] Add support for hugo extended (#3043) 2019-09-30 09:35:06 -04:00
Nathan Rajlich
3657e4a36e [now-cli] Update @zeit/fun to v0.10.2 (#3038)
Fixes #2901.
2019-09-30 09:34:43 -04:00
Nathan Rajlich
09efc1d865 [now-cli] Render logs containing "warning" as yellow (#3035) 2019-09-30 09:34:19 -04:00
Steven
22bded50b6 [master only] Fix merge conflict 2019-09-17 18:39:06 -04:00
Steven
b5b02be3c2 [docs] Update CI badge to use master (#3037) 2019-09-17 18:36:49 -04:00
Steven
776f372eb3 [tests] Add env var FORCE_BUILD_IN_REGION (#3036)
* [tests] Add env var FORCE_BUILD_IN_REGION

* Add missing config
2019-09-17 18:35:42 -04:00
Steven
81279fd40b [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 18:35:34 -04:00
Leo Lamprecht
3342485d29 [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:35:27 -04:00
Andy
028ee848f5 [now-cli] Fix fetch body and add secrets tests (#3030) 2019-09-17 18:35:19 -04:00
Nathan Rajlich
7e64c3b8a9 [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 18:35:09 -04:00
Nathan Rajlich
704031f7b2 [now-cli] Render "stderr" as red in now logs (#3026) 2019-09-17 18:35:02 -04:00
Andy
5e3c184735 [now-cli] Adjust the printed version for the deployment (#3014) 2019-09-17 18:34:54 -04:00
Steven
88a8022787 [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-17 18:34:49 -04:00
Steven
96844dc4a5 [now-node] Change trace errors to warnings (#3016) 2019-09-17 18:34:44 -04:00
Max
a09acd6969 [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-17 18:34:38 -04:00
Andy
4e232f78de [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-17 18:34:29 -04:00
Steven
b146a04772 [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-17 18:34:20 -04:00
Steven
eaaa50e616 Add release notes script to PUBLISHING.md (#3006) 2019-09-17 18:34:14 -04:00
Andy
c893eaeb7a [now-cli] Default to empty string for undefined env var when checking (#3008) 2019-09-17 18:34:08 -04:00
Andy
5bf7d7fd07 [now-cli] Add changelog link to update message (#3001) 2019-09-17 18:34:00 -04:00
Max
ca8fc92b94 [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-17 18:33:53 -04:00
Steven
9956e85f12 [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-17 18:33:47 -04:00
Nathan Rajlich
7fa4739c78 [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-17 18:33:40 -04:00
Andy
0ef2e2a7ec [now-cli] Add tests for alias rules (#3003) 2019-09-17 18:33:34 -04:00
Sophearak Tha
8fd1752acf [now-go] Improve test for custom build flags (#2999) 2019-09-17 18:33:29 -04:00
Nathan Rajlich
14a1446faf [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-17 18:33:16 -04:00
Steven
0c2c8c5ae5 [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-17 18:33:07 -04:00
Steven
511b27ad39 [now-node][now-next] Bump node-file-trace to 0.3.1 (#2990) 2019-09-17 18:33:00 -04:00
Sophearak Tha
e22ce7da0a [now-cli] Hide Init Duration and XRAY TraceId by default (#2984) 2019-09-17 18:32:54 -04:00
Steven
d9a4ce06bc [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-17 18:32:46 -04:00
Steven
77fb14cc60 [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-17 18:32:39 -04:00
Clément ALLAIN
17c397211e [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-17 18:32:20 -04:00
Andy
6ca83644bc [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-17 18:31:56 -04:00
Andy
d1946ea9b6 [now-cli] Display warning when changing the secret name (#2975) 2019-09-17 18:31:44 -04:00
Nathan Rajlich
cc9eae3b71 [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-17 18:31:37 -04:00
Nathan Rajlich
7bbc17df4b [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-17 18:31:31 -04:00
Andy
df6b2be482 [now-build-utils] Throw error on Next.js pages/api and api/ (#2964) 2019-09-17 18:30:40 -04:00
Sophearak Tha
5ff6263fb7 [now-cli] Add platform in Sentry report (#2960) 2019-09-17 18:30:33 -04:00
Luc
04dc8aaf73 [gatsby-plugin-now] Add keywords in package.json (#2965)
* add keywords to gatsby-plugin-now

* add #readme in homepage url
2019-09-17 18:30:25 -04:00
Sophearak Tha
5435805e58 [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-17 18:30:16 -04:00
Nathan Rajlich
903f819c5d [now-cli] Fix now alias with no arguments (#2959)
Fixes #2941.
2019-09-17 18:29:41 -04:00
Nathan Rajlich
5d927b2d25 [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-17 18:29:11 -04:00
Steven
b7a260cc6d [now-python] Use system python with now dev (#2956) 2019-09-17 18:29:03 -04:00
Steven
e8ba8fb97b [now-cli] Bump @zeit/fun to 0.10.0 (#2955) 2019-09-17 18:28:49 -04:00
Max
dd1d9d856b [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-17 18:27:13 -04:00
Steven
eef4c65e5f Publish
- @now/next@1.0.1
2019-09-17 17:44:26 -04:00
Joe Haddad
3f64594a22 [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-17 17:22:22 -04:00
Max Rovensky
3f5f71f8ab Publish
- now-client@5.1.3
2019-09-09 23:32:19 +08:00
Max
2a44179898 [now-client] Fix windows paths handling (#2974)
* Fix windows paths handling in now-client

* Tweak windows paths  handling
2019-09-09 23:31:16 +08:00
Andy Bitz
4a6ddf8b1d Publish
- gatsby-plugin-now@1.2.1
 - @now/build-utils@0.10.0
 - @now/cgi@0.1.6
 - now@16.2.0
 - now-client@5.1.2
 - @now/go@0.5.12
 - @now/next@1.0.0
 - @now/node-bridge@1.2.5
 - @now/node@1.0.0
 - @now/python@0.2.18
 - @now/routing-utils@1.2.4
 - @now/ruby@0.1.6
 - @now/static-build@0.9.10
2019-09-05 18:25:48 +02:00
Andy Bitz
eeb1b2442c Revert "[now-cli] Implement now-client deployments in Now CLI (#2875)"
This reverts commit 129f234aaa.
2019-09-05 00:03:23 +02:00
Max
129f234aaa [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 23:54:21 +02:00
Nathan Rajlich
331c352e2b [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-04 23:46:31 +02:00
Nathan Rajlich
2ccbaea9dd [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-09-04 23:45:44 +02:00
Sophearak Tha
069eca3c62 [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-04 23:44:13 +02:00
Nathan Rajlich
305e364f8b [now-cli] Output --json to stdout for now alias ls <url> (#2922)
Fixes #1337.
2019-09-04 23:41:27 +02:00
Nathan Rajlich
4068805ae0 [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-04 23:36:16 +02:00
Andy
9a1e7a4a7a [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 23:25:31 +02:00
Naoyuki Kanezawa
bbad3d1b96 Add the nameservers verification check and improve messages (#2943)
* add the nameservers verification check and improve messages

* fix verify message condition
2019-09-04 23:25:23 +02:00
Nathan Rajlich
c62116d9a4 [now-cli] Remove now update from --help output (#2951)
Fixes #2940.
2019-09-04 23:25:11 +02:00
Nathan Rajlich
c94086ff21 [now-cli] Remove scale subcommand from --help (#2923)
Fixes #1998.
2019-09-04 23:25:00 +02:00
Andy
e99caa7b97 Fix the prettier config (#2946)
* Fix the prettier config

* Try prettier
2019-09-04 23:24:52 +02:00
Andy
658b9e9007 [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-04 23:24:45 +02:00
Luc
3ef27ae45c [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-04 23:23:58 +02:00
Andy
e669cd1152 [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-04 23:23:47 +02:00
Sophearak Tha
b22aa7c0cf [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-04 23:23:33 +02:00
Joe Haddad
582cbb61fb [now-next] Create default file with correct target (#2924) 2019-09-04 23:23:10 +02:00
Sophearak Tha
7f4197cf43 [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-09-04 23:22:49 +02:00
JJ Kasper
30889db487 [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-09-04 23:22:30 +02:00
Luc
2d08d5d23e [tests] Unify .editorconfig (#2920) 2019-09-04 23:22:16 +02:00
Luc
59e7367e03 [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-09-04 23:22:02 +02:00
Naoyuki Kanezawa
84af278e86 [tests] Remove fixtures files for integration tests (#2910) 2019-09-04 23:21:51 +02:00
JJ Kasper
67d9ee39e2 [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-09-04 23:21:32 +02:00
Joe Haddad
6c67bb81f7 [now-next] Do not add initial files to lambda (#2894) 2019-09-04 23:21:03 +02:00
Steven
aba19701c0 [tests] Ignore fixtures in GitHub Languages & fix yarn.lock (#2890) 2019-09-04 23:20:47 +02:00
Sophearak Tha
bb79402999 [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-09-04 23:20:37 +02:00
Sophearak Tha
420bc4b244 [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-09-04 23:20:27 +02:00
Sophearak Tha
323c3d74cb [now-ruby] Use debug() from build-utils (#2883) 2019-09-04 23:20:20 +02:00
Sophearak Tha
4ecec8a8f6 [now-node] Use debug() from build-utils (#2880)
* Use `debug()` from build-utils

* Remove condition
2019-09-04 23:20:13 +02:00
Sophearak Tha
98883f9978 [now-static-build] Use debug() from build-utils (#2884) 2019-09-04 23:20:04 +02:00
Sophearak Tha
37cf3be437 [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-09-04 23:19:45 +02:00
Andy Bitz
62e3949c65 Publish
- @now/build-utils@0.9.14
 - @now/cgi@0.1.5
 - now@16.1.3
 - now-client@5.1.1
 - @now/go@0.5.11
 - @now/next@0.7.1
 - @now/node-bridge@1.2.4
 - @now/node@0.12.8
 - @now/python@0.2.17
 - @now/routing-utils@1.2.3
 - @now/ruby@0.1.5
 - @now/static-build@0.9.9
2019-09-02 22:15:34 +02:00
Sophearak Tha
c191861639 [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-09-02 21:28:17 +02:00
Joe Haddad
c820509c29 [now-build-utils] Add mutable option for backwards compatibility (#2895) 2019-09-02 21:26:30 +02:00
Andy
199f98153f [now-static-build] Support ejected create-react-app (#2873) 2019-09-02 21:22:38 +02:00
Andy
a64b96f87b [now-cli] Improve check for update command (#2915)
* [now-cli] Improve check for update command

* Use path.sep

* Fix build
2019-09-02 17:50:37 +02:00
Max Strübing
f179864986 [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-09-02 17:50:29 +02:00
Steven
73af1b3d91 [now-cli] Update readme and links (#2886)
* Update readme and links

* Fix readme image

* Fix homepage

* Update banner image to v3
2019-09-02 17:50:17 +02:00
Nathan Rajlich
56afa1b464 [now-cli] Implement continue: true with dest (#2908)
Closes #2685.
2019-09-02 17:50:06 +02:00
Nathan Rajlich
0e0f453e4e [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-09-02 17:49:59 +02:00
Naoyuki Kanezawa
78d25d97fb [now-cli] fix login test (#2909) 2019-09-02 17:49:52 +02:00
Andy
d6ce0e4c23 [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-09-02 17:49:40 +02:00
Andy
434de228cc [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-09-02 17:49:34 +02:00
Andy
d75b0c9578 [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-09-02 17:49:26 +02:00
Kaito Sugimoto
16e24e8464 [now-cli] Update now alias warning for --prod (#2902) 2019-09-02 17:49:19 +02:00
Andy
8365d7c4de [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-09-02 17:49:09 +02:00
Steven
a958492256 Add GH Actions Publish Workflow (#2891) 2019-09-02 17:49:01 +02:00
Andy
6285ac589d [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-09-02 17:47:54 +02:00
Sophearak Tha
2ac87b0144 [now-cli] Make sure to have event action as string (#2870) 2019-09-02 17:47:49 +02:00
Nathan Rajlich
21fd1761ae [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-09-02 17:47:42 +02:00
Steven
3664a2da8b [tests] Fix unit tests & coverage step (#2876)
* Fix unit tests & coverage

* Add missing compile-templates step
2019-09-02 17:47:33 +02:00
Nathan Rajlich
8a6f3c61bb 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-09-02 17:47:26 +02:00
Steven
f5f7dd9e8a [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-09-02 17:47:17 +02:00
Steven
b0ad5238f7 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 23:57:00 +00:00
Andy Bitz
774e0a0ebb 16.1.2 2019-08-20 22:20:01 +02:00
Andy
ec7a258b37 Use short-form for the update command (#2801)
* Use short-form for the update command

* Adjust test
2019-08-20 19:48:33 +02:00
Andy
5fbe136485 [now deploy] Fix builds output for failed deployments (#2799)
* [now deploy] Fix builds output for failed deployments

* Add test
2019-08-20 18:14:11 +02:00
Andy
e6c56a69ce [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 18:01:44 +02:00
Andy
d93c76d5e6 [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 10:02:41 +02:00
Andy
e0814d6ed5 Bump @now/build-utils to 0.9.13 (#2784) 2019-08-20 10:02:32 +02:00
Nathan Rajlich
5e6a241baa [now domain] Handle thrown API errors when purchasing domain fails (#2779)
Fixes #2759.
2019-08-20 10:02:23 +02:00
Nathan Rajlich
8cbebc936e Remove a couple unused import (#2777)
Fixes lint
2019-08-20 10:02:16 +02:00
Nathan Rajlich
90f7f8620c 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-20 10:02:04 +02:00
Nathan Rajlich
59bbe7e0c9 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-20 10:01:57 +02:00
Naoyuki Kanezawa
151b66a3f9 add misssing defaultArgs (#2770) 2019-08-20 10:01:48 +02:00
Nathan Rajlich
d9f3367a77 Remove leftover console.log() in integration tests (#2768) 2019-08-20 10:01:42 +02:00
Nathan Rajlich
f3f6880632 [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-20 10:01:35 +02:00
Nathan Rajlich
59335cdd81 [now scale] Fix default max: auto value in --help output (#2763)
Fixes #2368.
Also related to zeit/docs#838.
2019-08-20 10:01:24 +02:00
Nathan Rajlich
a93c09a794 Fix "occured" -> "occurred" typos (#2761)
See: https://tinyurl.com/occured
2019-08-20 10:01:16 +02:00
Andy
b60768a8b3 [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-20 10:01:05 +02:00
Nathan Rajlich
da96ead170 Use the correct URL in the auth.json and config.json files (#2755)
Fixes #2754.
2019-08-20 10:00:55 +02:00
Nathan Rajlich
45f7dc126c [now projects] Add subcommand alias for now project (#2750)
Fixes #2162.
2019-08-20 10:00:46 +02:00
Naoyuki Kanezawa
7d41511564 remove unused HTTP/HTTPS Agent (#2749) 2019-08-20 10:00:38 +02:00
Naoyuki Kanezawa
a4e184007d support to set api host for development (#2748) 2019-08-20 10:00:30 +02:00
Nathan Rajlich
2055eb32b8 Update clipboardy to v2.1.0 (#2737)
Fixes #564.

Related to #1924.
2019-08-20 10:00:21 +02:00
Andy
3ae3cbf34b Bump @now/build-utils to 0.9.12 (#2736) 2019-08-20 10:00:14 +02:00
Nathan Rajlich
56d4a75d39 [now dev] Remove leftover console.error() call (#2735)
Accidentally added in #2720.
2019-08-20 10:00:03 +02:00
Leo Lamprecht
c86a9217c4 [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-20 09:59:54 +02:00
Arunoda Susiripala
dc7c6166e3 Update index.js (#2733) 2019-08-20 09:59:47 +02:00
Leo Lamprecht
25facf4934 [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-20 09:59:39 +02:00
Nathan Rajlich
7f0ce26472 Update serve-handler to v6.1.1 (#2731)
* Update `serve-handler` to v6.1.1

Fixes #2697.

* Fix unit test
2019-08-20 09:59:29 +02:00
Nathan Rajlich
031067869a Print HTTP status code upon API JSON parse errors (#2727)
Fixes #2681.
2019-08-20 09:59:16 +02:00
Nathan Rajlich
2e30bbef7e 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-20 09:58:47 +02:00
Steven
13d04a069e Add automerge config (#2729) 2019-08-20 09:58:40 +02:00
Nathan Rajlich
26b3d36101 [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-20 09:58:32 +02:00
wtgtybhertgeghgtwtg
3db861fcc4 Remove vestigial mkdirp packages (#2724) 2019-08-20 09:58:24 +02:00
Andy Bitz
df580d4873 16.1.1 2019-08-07 17:33:41 +02:00
Andy
78567ff89b [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:33:24 +02:00
Andy
605a9f68e7 Fix colored text and remove version warning (#2721) 2019-08-07 14:37:28 +02:00
Andy Bitz
4e4bc98194 16.1.0 2019-08-07 12:41:04 +02:00
Andy
3efa988f5e [now dev] Bump @now/build-utils to 0.9.10 (#2715) 2019-08-07 12:25:09 +02:00
Andy
d3366403fe 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-07 12:24:43 +02:00
Nathan Rajlich
5860645cdb Require Node.js >= 8.11 in "engines" (#2714)
Closes #2711.
2019-08-07 12:24:35 +02:00
Nathan Rajlich
3ff2004929 [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-07 12:24:26 +02:00
Nathan Rajlich
9a38260a2b 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-07 12:24:18 +02:00
Nathan Rajlich
96fca45a41 Fix format-modified script (#2708)
Before it was only updating _non-staged_ files.

Now, it updates _all_ modified files, staged or not.
2019-08-07 12:24:11 +02:00
Nathan Rajlich
cb106185cb Upgrade ava to v2.2.0 (#2703)
See: https://twitter.com/sindresorhus/status/1157614353375551493
2019-08-07 12:24:01 +02:00
Andy
cd6d98b314 [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 12:11:32 +02:00
Andy Bitz
0aa8fa09cb [now deploy] Check server.js file when detecting the platform version (#2664)
This reverts commit 3e5ddad5ca.
2019-08-07 12:10:59 +02:00
Andy Bitz
d71f74fa54 [now deploy] Consider --npm and --docker for platform detection (#2640)
This reverts commit 79e0792a57.
2019-08-07 12:10:53 +02:00
Andy Bitz
47ce713a86 [now deploy] Determine platform version through Dockerfile and package.json (#2633)
This reverts commit 8da0534d4f.
2019-08-07 12:10:42 +02:00
Andy Bitz
3c5b94855a [now deploy] Check if builds are ready right away (#2699)
This reverts commit 92cff5c947.
2019-08-07 12:08:43 +02:00
Andy Bitz
0fb6c77dec 16.0.0 2019-08-05 19:58:37 +02:00
Andy Bitz
8da0534d4f Revert "[now deploy] Determine platform version through Dockerfile and package.json (#2633)"
This reverts commit 9244e43ccf.
2019-08-05 18:49:51 +02:00
Andy Bitz
79e0792a57 Revert "[now deploy] Consider --npm and --docker for platform detection (#2640)"
This reverts commit 69e7c57975.
2019-08-05 18:49:12 +02:00
Andy Bitz
3e5ddad5ca Revert "[now deploy] Check server.js file when detecting the platform version (#2664)"
This reverts commit 482ca7a8a6.
2019-08-05 18:44:38 +02:00
Andy Bitz
92cff5c947 Revert "[now deploy] Check if builds are ready right away (#2699)"
This reverts commit 2877563064.
2019-08-05 18:43:26 +02:00
Andy
4f8cf6793b [now update] Remove is-installed-globally (#2700)
* [now update] Remove `is-installed-globally`

* Only suggest global

* Adjust test
2019-08-05 18:40:41 +02:00
Andy
2877563064 [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 18:40:34 +02:00
Andy
dea74233c6 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-05 18:40:28 +02:00
Nathan Rajlich
4fbd75f384 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-05 18:40:22 +02:00
Nathan Rajlich
21bd8297e0 [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-05 18:40:16 +02:00
Nathan Rajlich
188150da26 [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-05 18:40:08 +02:00
Andy
83d50374ff [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-05 18:40:00 +02:00
Nathan Rajlich
2b3d4cd449 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-05 18:39:52 +02:00
Nathan Rajlich
0ef680484d [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-05 18:39:47 +02:00
Andy
54ee476f91 [preinstall] Adjust the error messages (#2682)
* [preinstall] Adjust the error messages

* Remove dot
2019-08-05 18:39:40 +02:00
Nathan Rajlich
4d81ee8c87 [now dev] Use a consistent "pod id" for x-now-id (#2679)
This matches the behavior in production.
2019-08-05 18:39:34 +02:00
Andy
33cd5d6c1d [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-05 18:39:28 +02:00
Andy
24525ec768 [now dev] Bump @now/build-utils to 0.9.6 (#2672) 2019-08-05 18:39:19 +02:00
Andy
482ca7a8a6 [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-08-05 18:39:11 +02:00
dependabot[bot]
e8c81fbd81 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-08-05 18:39:05 +02:00
Andy
6322be2bf7 [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-08-05 18:38:59 +02:00
Sophearak Tha
88a0fb2009 [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-08-05 18:38:52 +02:00
Nathan Rajlich
ba007f89ff [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-08-05 18:38:45 +02:00
Andy
00129ea452 [now dev] Update outdated dependencies in tests (#2666) 2019-08-05 18:38:38 +02:00
Nathan Rajlich
924b0ff427 [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-08-05 18:38:30 +02:00
Andy
70571d10c1 [now dev] Fix aurelia test (#2660)
* [now dev] Fix aurelia test

* Enable aurelia test again
2019-08-05 18:38:21 +02:00
Nathan Rajlich
aee22a3d38 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-08-05 18:38:13 +02:00
Andy
81162c0ccf [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-08-05 18:38:05 +02:00
Andy
69e7c57975 [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-08-05 18:37:58 +02:00
Nathan Rajlich
4e796ca952 [now dev] Redirect when request has multiple slashes (#2645)
* [now dev] Redirect when request has multiple slashes

Closes #2642.

* Add POST passthrough
2019-08-05 18:37:53 +02:00
Max Chehab
518d0313f7 [now deploy] Fix variable name typo (#2649) 2019-08-05 18:37:47 +02:00
Andy
6ea080d48b [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-08-05 18:37:33 +02:00
Sophearak Tha
748e34757e [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-08-05 18:37:26 +02:00
Nathan Rajlich
c93c458cd4 [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-08-05 18:36:05 +02:00
Nathan Rajlich
3c10787621 [now dev] Add server: now response header (#2646)
Matches production.
2019-08-05 18:31:23 +02:00
Nathan Rajlich
f60a9f0c58 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-08-05 18:31:17 +02:00
Nathan Rajlich
544d26dea9 [now dev] Remove accidental test.only() (#2644)
This got committed by accident :(
2019-08-05 18:31:11 +02:00
Andy
9244e43ccf [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-08-05 18:31:06 +02:00
Nathan Rajlich
d44b147684 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-08-05 18:30:59 +02:00
Andy
bb5fbc28a0 [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-08-05 18:30:53 +02:00
Nathan Rajlich
3a501a0c08 [now dev] Fix routing catch-all with no slash prefix edge case (#2626)
Fixes #2622.
2019-08-05 18:30:47 +02:00
Sophearak Tha
1fe5dbd7cd Remove Buffer() deprecation message (#2604)
* Remove `Buffer()` deprecation message

* Switch `micro` back to `9.1.2`
2019-08-05 18:13:18 +02:00
Nathan Rajlich
7a97a40039 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-08-05 18:12:44 +02:00
Nathan Rajlich
cda6a2cbb6 [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-08-05 18:11:49 +02:00
Sophearak Tha
50a87c4965 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-08-05 18:10:57 +02:00
Andy Bitz
f6552c48d6 15.8.7 2019-07-26 13:40:40 +02:00
Andy Bitz
577cd76ae6 Revert "Add "engines" field to package.json for Node 10 or newer (#2603)"
This reverts commit 91a1a4828a.
2019-07-26 10:45:55 +02:00
Andy Bitz
bed4efeef0 15.8.6 2019-07-25 17:26:59 +02:00
Andy Bitz
53f0adb88a Revert "[now update] Render the proper tag and improve yarn detection logic (#2595)"
This reverts commit 4ceb4c8984.
2019-07-25 17:06:27 +02:00
Nathan Rajlich
61c82890c1 [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-25 14:03:52 +02:00
Steven
176a750ece [now init] Download /v1 examples without suggestions (#2623) 2019-07-25 14:03:41 +02:00
Nathan Rajlich
88cdcdf979 [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-25 14:03:30 +02:00
Andy
bf12602aca [now dev] Bump @now/build-utils to 0.9.4 (#2621) 2019-07-25 14:03:23 +02:00
Nathan Rajlich
bafb14526d [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-25 14:03:16 +02:00
Nathan Rajlich
778b77e829 [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-25 14:03:07 +02:00
Nathan Rajlich
91a1a4828a 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-25 14:00:16 +02:00
Andy
5a187b97ab Use fs-extra instead of fs.promises to prevent warnings on Node 10 (#2602) 2019-07-25 14:00:04 +02:00
Nathan Rajlich
d78cd371ed [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-25 13:59:20 +02:00
Nathan Rajlich
a720d5b181 [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-25 13:59:09 +02:00
Andy
dd50eae762 [now update] Don't check for updates on now update (#2599) 2019-07-25 13:58:59 +02:00
Nathan Rajlich
4ceb4c8984 [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-25 13:58:53 +02:00
Andy
f9c262f4bb [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-25 13:58:43 +02:00
Andy
57d9c6e39b [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-25 13:58:33 +02:00
Sophearak Tha
e45e403bb3 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-25 13:58:25 +02:00
Andy
2fe38b1527 Handle more errors when deploying (#2589) 2019-07-25 13:58:18 +02:00
Andy
f6a38717f2 [now dev] Bump @now/build-utils and throw errors (#2588)
* [now dev] Bump `@now/build-utils` and throw errors

* Fix error handling
2019-07-25 13:58:10 +02:00
Steven
31c0ac8a54 [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-25 13:58:04 +02:00
Andy Bitz
3774792740 15.8.5 2019-07-19 22:31:53 +02:00
Mark Glagola
a9b3ee96cd handle no-change domain transfer policy (#2570) 2019-07-19 22:31:39 +02:00
Andy
b6946e2f15 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:31:31 +02:00
Andy
a4ad8c64e6 [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:31:24 +02:00
Andy Bitz
29d18dccb2 15.8.4 2019-07-19 14:07:01 +02:00
Andy
89057232eb [now init] Remove now dev suggestion from now init (#2580) 2019-07-19 14:06:16 +02:00
Andy
8a2d3d0c2c [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 14:06:10 +02:00
Sophearak Tha
a01c210bf0 Remove deprecation message from now alias with args (#2578) 2019-07-19 14:06:04 +02:00
Andy
53515e6142 Fix building indicator jittering (#2577) 2019-07-19 14:05:58 +02:00
Andy
2aeab737d9 [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 14:05:52 +02:00
Andy Bitz
64caeeb115 15.8.3 2019-07-18 15:24:57 +02:00
Matthew Sweeney
e5e33549f8 Add hint when example not found (#2572)
* add hint when example not found

* update test

* update test
2019-07-18 15:24:35 +02:00
Andy Bitz
d812b18d52 15.8.2 2019-07-18 13:59:11 +02:00
Andy
d7ef4b533f Bump mime-types to 2.1.24 (#2571) 2019-07-18 13:58:27 +02:00
Andy
a5e857df7b Change now update to display npm or yarn command (#2568)
* Change `now update` to display npm or yarn command

* Use `getUpgradeCommand`
2019-07-18 13:58:21 +02:00
Andy Bitz
c3001fe708 15.8.1 2019-07-17 19:46:29 +02:00
Andy
8309ec6327 [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 19:35:37 +02:00
Andy
921a54ed22 Fix tests order (#2565) 2019-07-17 19:35:30 +02:00
Andy
c82350dca6 [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 19:35:22 +02:00
Andy
7e3a5a7e2c [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 19:35:14 +02:00
Nathan Rajlich
ada83ccb63 [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-17 19:35:05 +02:00
Nathan Rajlich
a4220a0e7d [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-17 19:34:58 +02:00
Andy
92be615c3c [now dev] Bump @now/build-utils to 0.8.8 (#2557) 2019-07-17 19:34:51 +02:00
Andy
847dace212 [now dev] Bump @now/build-utils (#2556) 2019-07-17 19:34:45 +02:00
Nathan Rajlich
5a43516354 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-17 19:34:38 +02:00
Nathan Rajlich
868d4522db 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-17 19:34:33 +02:00
Nathan Rajlich
4d0c638688 [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-17 19:34:27 +02:00
Andy
0080c456d8 [now dev] Apply the ignore pattern to api files (#2548) 2019-07-17 19:34:15 +02:00
Nathan Rajlich
cd36a835eb 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-17 19:34:07 +02:00
Nathan Rajlich
01b9913204 [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-17 19:33:54 +02:00
Sophearak Tha
d58a189265 [now dev] Improve max lambda size error message (#2539)
* Improve max lambda size error message

* Better wording
2019-07-17 19:33:46 +02:00
Andy Bitz
9f9ce09acc 15.8.0 2019-07-12 15:49:49 +02:00
Andy Bitz
8e1ca16d38 Revert "Include changes from 15.7.0-canary.14"
This reverts commit 6d4a552c96.
2019-07-12 15:25:12 +02:00
Andy Bitz
9291efcfc3 Revert "Include tests from 15.7.0-canary.17"
This reverts commit 350d63eacd.
2019-07-12 15:25:10 +02:00
Nathan Rajlich
6d4a552c96 Include changes from 15.7.0-canary.14 2019-07-12 15:10:34 +02:00
Sophearak Tha
350d63eacd Include tests from 15.7.0-canary.17 2019-07-12 15:05:35 +02:00
Andy
a7d4ce8c3f Bump @now/build-utils (#2535) 2019-07-12 14:54:19 +02:00
Max
a4fdc8561c 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 14:53:12 +02:00
Sophearak Tha
08fff2a145 Increase default maxLambdaSize (#2534) 2019-07-12 14:53:04 +02:00
Luc
6b4b73ee94 Remove "missing alias in now.json" warning (#2533) 2019-07-12 14:52:57 +02:00
Nathan Rajlich
98d511b03c [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-12 14:52:50 +02:00
Andy
ad5aa576f3 [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-12 14:52:43 +02:00
Nathan Rajlich
855940c6fc [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-12 14:52:34 +02:00
Nathan Rajlich
ac794e704d Add .gitignore file to test/fixtures/unit/now-dev-default-builds-and-routes (#2524) 2019-07-12 14:52:27 +02:00
Nathan Rajlich
09e663d86e Add @AndyBitz to now dev CODEOWNERS (#2522) 2019-07-12 14:52:20 +02:00
Nathan Rajlich
20ee6752ad [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-12 14:52:10 +02:00
Nathan Rajlich
586e76f930 Add /src/util/dev to CODEOWNERS file (#2521) 2019-07-12 14:51:40 +02:00
Andy
27730b4568 [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-12 14:51:32 +02:00
Andy
00c792297a [now dev] Tests for routing and apply default frontend builder last (#2518) 2019-07-12 14:51:25 +02:00
Sophearak Tha
ee80ea59f4 [now-dev] Fix flickering and improve message (#2516)
* Fix flickering and improve message

* Pluralize builds

* Properly handle pluralize form
2019-07-12 14:51:19 +02:00
Andy
d355e9e202 [now dev] Allow the default static build without an api (#2515) 2019-07-12 14:51:09 +02:00
Sophearak Tha
8289c159c5 Handle 400 create alias error (#2514) 2019-07-12 14:50:55 +02:00
Sophearak Tha
d11f8e4ebf 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-12 14:50:49 +02:00
Sophearak Tha
43bf805392 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-12 14:50:41 +02:00
Sophearak Tha
e57cf657fe 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-12 14:50:33 +02:00
Nathan Rajlich
020f9d8da5 [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-12 14:50:26 +02:00
Andy
a40f0b6d65 [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-12 14:50:02 +02:00
Nathan Rajlich
69f81e0ab9 [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-12 14:49:53 +02:00
Nathan Rajlich
37a3fb0497 [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-12 14:49:47 +02:00
Nathan Rajlich
1a9958c71e [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-07 16:40:59 +00:00
Sophearak Tha
6688935436 Bump serve-handler version (#2497) 2019-07-07 16:40:49 +00:00
Olli Vanhoja
0541ac8284 Use v3 user tokens API (#2482) 2019-07-07 16:40:34 +00:00
Nathan Rajlich
cf4eebbc95 [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 16:40:31 +00:00
Nathan Rajlich
3383798bf1 [now dev] Add etag response header for Lambda invocations (#2502)
This matches the behavior in production.
2019-07-07 16:40:28 +00:00
Nathan Rajlich
aba51841a2 [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-07 16:40:22 +00:00
Nathan Rajlich
1712405cd3 [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-07 16:40:19 +00:00
Nathan Rajlich
27186a377e 15.7.0 2019-07-05 11:30:08 -07:00
Nathan Rajlich
f5fca3a0fb [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-05 11:25:24 -07:00
Sophearak Tha
4b75f20f9b 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-05 11:25:16 -07:00
Nathan Rajlich
64fe29bfea Remove mkdirp-promise (#2478)
Use the implemention from `fs-extra` instead.
2019-07-05 11:25:10 -07:00
Nathan Rajlich
eea09ca6cc [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-07-05 11:25:02 -07:00
Mark Glagola
f7919230fc 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-07-05 11:24:55 -07:00
Nathan Rajlich
5e092cde57 Update @now/build-utils to v0.7.0 (#2474) 2019-07-05 11:24:49 -07:00
Mark Glagola
96bb51f266 Adds --target to arg-common (#2473) 2019-07-05 11:24:40 -07:00
Andy Bitz
ad8b141c1c 15.6.2 2019-06-28 12:14:02 +02:00
Andy
9b23d61720 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 12:12:10 +02:00
Andy
d993650a84 Don't verify the user for now dev (#2470) 2019-06-28 12:12:03 +02:00
Andy
f0dbb33fd1 Don't show warning (#2468) 2019-06-28 12:11:55 +02:00
Andy Bitz
b22b3787ff 15.6.1 2019-06-26 22:57:50 +02:00
Andy
e700ad78ee Make sure to call secrets API only once (#2464)
* Make sure to call secrets API only once

* Use const
2019-06-26 22:57:14 +02:00
Andy
85ccf59a08 Handle deployments rate limit (#2463) 2019-06-26 22:57:05 +02:00
Andy
094277cb2e Upgrade esm (#2458)
* Upgrade esm

* Use version 3.1.0

* Use version 3.1.4
2019-06-26 22:56:57 +02:00
Mark Glagola
e5c7e2d8f0 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-26 22:56:49 +02:00
Mark Glagola
3ee7babf4a Prompt based DNS add command (#2450)
* Initial prompt based DNS add command

* Adds verify step to dns record prompts

* handle prompt abort
2019-06-26 22:56:41 +02:00
Steven
e630eaebcd 15.6.0 2019-06-21 17:46:51 -04:00
Andy
493e972720 now rm improvements (#2449)
* Handle --safe

* Fix  option

* Slice deployments
2019-06-21 17:13:59 +00:00
Andy
e008b6e1cb Handle --safe (#2448)
* Handle --safe

* Fix  option
2019-06-21 17:13:54 +00:00
Steven
c739d564a9 Bump @zeit/fun to 0.9.0 (#2445) 2019-06-21 11:39:04 +00:00
Steven
dd6dbbfc9b [now dev] Improve tests for @now/build-utils@canary (#2444) 2019-06-21 11:39:00 +00:00
Mark Glagola
498615b6b3 Move dns_error to generic CertError (#2443) 2019-06-21 11:38:56 +00:00
Mark Glagola
491da80c90 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-21 11:38:52 +00:00
Steven
7ceeaf9a6a [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-21 11:38:48 +00:00
Steven
d6e09b098e Bump @now/build-utils to 0.6.0 (#2440) 2019-06-21 11:38:42 +00:00
Andy
9056ba54c3 Update help (#2438)
* Update help

* Make whoami advanced

* Make init basic

* Moved update down
2019-06-21 11:38:37 +00:00
Andy
964d5b3238 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-21 11:38:32 +00:00
Nathan Rajlich
8c035be63f [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-21 11:38:26 +00:00
Leo Lamprecht
6c264fe243 15.5.0 2019-06-13 14:00:50 +00:00
Nathan Rajlich
1380c9fb2c [now dev] Move helper modules to src/util/dev (#2422)
This organization is consistent with how other commands are structured.
2019-06-13 13:55:57 +00:00
Nathan Rajlich
9827f1cb69 Lowercase the x-forwarded-* and x-real-ip headers (#2420)
Fixes #2238.
2019-06-13 13:55:53 +00:00
Nathan Rajlich
8fe220c330 [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-13 13:55:49 +00:00
Nathan Rajlich
9b5b360465 [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-13 13:55:44 +00:00
Nathan Rajlich
a8d4b7826f [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-13 13:55:39 +00:00
Nathan Rajlich
593bcb1025 Add whoami command back (#2411)
* Add `whoami` command back

It was accidentally removed.

Fixes #2410.

* Add `whoami` regression test
2019-06-13 13:55:34 +00:00
JJ Kasper
ece9f46798 [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-13 13:55:29 +00:00
Nathan Rajlich
e245b2fd90 15.4.0 2019-06-05 15:13:03 -07:00
Luc
ba6ddc380d [now update] Add integration test (#2405)
* add simple integration to test `now update`

* remove `.only`

* verify that `now --version` includes `canary`
2019-06-05 15:12:45 -07:00
Nathan Rajlich
402ec684eb [now update] No login required (#2406) 2019-06-05 15:12:39 -07:00
Andy
8b8af21445 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 15:12:32 -07:00
Nathan Rajlich
1ead4f2e2c 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 15:12:27 -07:00
Andy
43047cfa24 Use the projects API for now ls (#2403)
* Use the projects API for `now ls`

* Use recentDeployments
2019-06-05 15:12:18 -07:00
Mark Glagola
33dc9a5767 Handle transfer-in registration_failed (#2402) 2019-06-05 15:12:10 -07:00
Mark
8bf7ed52c4 Update @zeit/ncc to v0.18.5 (#2389) 2019-06-05 15:12:01 -07:00
Nathan Rajlich
a495b19793 Update @zeit/fun to v0.8.1 (#2391) 2019-06-05 15:11:54 -07:00
Nathan Rajlich
42b24b4904 [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-06-05 15:11:48 -07:00
Steven
10347279ba [now-init] Check for dir existence prior to download (#2379) 2019-06-05 15:11:39 -07:00
Nathan Rajlich
a31c29fc13 [now dev] Use empty string for missing matches (#2376)
Rather than `undefined`. This matches the behavior in production.

Fixes #2375.
2019-06-05 15:11:32 -07:00
Sophearak Tha
9d110bd1c9 Mimic browser user agent (#2372) 2019-06-05 15:11:25 -07:00
Nathan Rajlich
de7c0aec39 15.3.0 2019-05-20 13:11:18 -07:00
Sophearak Tha
6232078ad3 Add .now ignore by default (#2365) 2019-05-20 19:15:30 +00:00
Andy
418d550f2a Increase the time we wait for the aliasing (#2360) 2019-05-20 19:15:25 +00:00
Sophearak Tha
81b0e995e1 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-20 19:15:18 +00:00
Samuel Hapák
22fd52c8db 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-20 19:15:14 +00:00
Nathan Rajlich
6a20529b89 [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-20 19:15:10 +00:00
Nathan Rajlich
1988f820bf [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-20 19:15:06 +00:00
Nathan Rajlich
0bafb6286a [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-20 19:15:01 +00:00
Nathan Rajlich
80ebd659fc [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-20 19:14:56 +00:00
Nathan Rajlich
2d16c36f8d 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-20 19:14:51 +00:00
Mark Glagola
ca1930cb44 Fix transfer in price for some TLDs (#2334) 2019-05-20 19:14:45 +00:00
Nathan Rajlich
91b4e7a308 [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-20 19:14:40 +00:00
Nathan Rajlich
4fac67f39e 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-20 19:14:35 +00:00
Nathan Rajlich
7c4ab3989a 15.2.0 2019-05-06 18:16:47 -07:00
Nathan Rajlich
2c6faa5eab [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 18:15:29 -07:00
Andy
2707149352 Fix Git Bash and make update/uninstall work on Windows (#2322)
* Update index.js

* Fix bash file
2019-05-06 18:15:23 -07:00
Nathan Rajlich
2834c188e7 [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 18:15:18 -07:00
Nathan Rajlich
0f31bc1f68 15.1.0 2019-05-03 17:24:33 -07:00
Steven
6f3ff2abf0 Update Readme with now dev workflow (#2308) 2019-05-03 17:21:52 -07:00
Nathan Rajlich
3398e6da27 [now dev] Implement methods in routes config (#2306)
Fixes #2148.
2019-05-03 17:21:51 -07:00
Nathan Rajlich
22f7d69a7e [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 17:21:51 -07:00
Matthew Sweeney
cb76d02dcc [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-03 17:21:50 -07:00
Nathan Rajlich
49d5802e3d [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-03 17:21:50 -07:00
Nathan Rajlich
38164f980b Convert the build script to Node.js (#2301)
Because, you know, Windows.
2019-05-03 17:21:50 -07:00
Nathan Rajlich
1cff0342e8 [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-03 17:21:49 -07:00
Nathan Rajlich
b6117e4a63 [now dev] Set NOW_REGION: 'dev1' env on the builder processes (#2298) 2019-05-03 17:21:49 -07:00
Steven
48c6510135 Add .next and .cache to default ignore (#2295) 2019-05-03 17:21:49 -07:00
Nathan Rajlich
4e505f40f7 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-03 17:21:48 -07:00
Steven
a3fe672b2a Create CODE_OF_CONDUCT.md (#2290) 2019-05-03 17:21:48 -07:00
Nathan Rajlich
e029e875d8 [now dev] Use consistent cache directory for nsfw module download (#2280) 2019-05-03 17:21:48 -07:00
Shuying
ef6e6c8d0d Update feedback url (#2278) 2019-05-03 17:21:47 -07:00
Nathan Rajlich
4a4e9764de [now dev] Convert path backslashes to forward slashes for Windows (#2279) 2019-05-03 17:21:47 -07:00
Spellar Bot
4260b6c390 Fix a few typos in err.sh pages (#2311) 2019-05-03 13:22:33 -07:00
Timothy
d47591ccda Update missing-env-file.md (#2281)
* Update missing-env-file.md

* Update missing-env-file.md
2019-04-30 20:16:36 +02:00
Leo Lamprecht
6e5915a664 15.0.11 2019-04-30 10:31:36 +00:00
Nathan Rajlich
a1631dfd9f [now dev] Enable cleanUrls option when deployment is all static (#2277)
So that rendering `index.html` as root works as expected.
2019-04-30 10:14:26 +00:00
Nathan Rajlich
db15047cc1 [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-30 10:14:22 +00:00
Steven
ba8c641c58 [now dev] Install yarn into builder cache (#2270)
Closes #2063.
2019-04-30 10:14:18 +00:00
Nathan Rajlich
3d17f3b38b 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-30 10:14:14 +00:00
Nathan Rajlich
5ca3cae9e8 [now dev] Show build timestamps (#2273)
* [now dev] Show build timestamps

Except when running the initial builds

* Fix bad logic
2019-04-30 10:14:09 +00:00
Steven
97d3413621 [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-30 10:14:05 +00:00
Nathan Rajlich
bddab3c5d1 [now dev] Don't render initial builds spinner when debug is enabled (#2271) 2019-04-30 10:14:00 +00:00
Leo Lamprecht
14aaf3b375 15.0.10 2019-04-29 19:04:10 +00:00
Leo Lamprecht
ecaee451c8 Revert "Enable cleanUrls for entirely static projects (#2268)"
This reverts commit c7ed5d7850.
2019-04-29 19:04:04 +00:00
Nathan Rajlich
a43d6f9792 [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 19:04:00 +00:00
Leo Lamprecht
78aea6ab13 15.0.9 2019-04-29 15:14:34 +00:00
Leo Lamprecht
3fa104a531 Enable cleanUrls for entirely static projects (#2268) 2019-04-29 14:59:55 +00:00
Leo Lamprecht
864c937de1 Correctly log when setting up Builders (#2267)
* Correctly log when setting up Builders

* Added message about beta
2019-04-29 14:59:52 +00:00
Leo Lamprecht
8114ede173 Do not print installing builders for no builds (#2266)
* Do not print installing builders for no builds

* Added unit test
2019-04-29 14:59:48 +00:00
Andy
7294f8f2e1 Display handle in now inspect (#2265) 2019-04-29 14:59:45 +00:00
Leo Lamprecht
f53feed8f5 Make the message for when the server is running shorter (#2262) 2019-04-29 14:59:40 +00:00
Leo Lamprecht
18dc7cb3f4 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-29 14:59:37 +00:00
Nathan Rajlich
5d8b27ebbe [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-29 14:59:33 +00:00
Matthew Sweeney
8a347d0a7a Adds 'to develop' to now init (#2260)
Adds 'to develop' to now init
2019-04-29 14:59:29 +00:00
Amio
4e884fb59d [now dev] fix directory listing (#2256) 2019-04-29 14:59:25 +00:00
Andy
1bf4af7269 Wait for aliases in tests (#2257) 2019-04-29 14:59:22 +00:00
Leo Lamprecht
e383c2c4d6 Revert "Add a logout test case" (#2258)
This reverts commit 5754360684c1e34b0351fadd9e2a6e5ef4b8b82f.
2019-04-29 14:59:18 +00:00
Olli Vanhoja
8fce8bb75d Use the single request logout endpoint (#2201)
Logout by deleting the currently used auth token.
2019-04-29 14:59:14 +00:00
Nathan Rajlich
ee158a7862 [now dev] Don't render building/built logging for @now/static
Since it's a built-in builder.
2019-04-29 14:59:10 +00:00
Leo Lamprecht
c80a5b6f9d Do not check for @now/static Builder updates (#2251) 2019-04-29 14:59:01 +00:00
Leo Lamprecht
97763ce5e8 Print missing line when stopping server (#2250) 2019-04-29 14:58:58 +00:00
Leo Lamprecht
f5f0c9eccd Only print stopping server if already printed URL (#2249) 2019-04-29 14:58:55 +00:00
JJ Kasper
2822c314eb 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-29 14:58:51 +00:00
Nathan Rajlich
2f170dbd45 [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-29 14:58:48 +00:00
Amio
b5ed4c48ed Refine dev log layout (#2245) 2019-04-29 14:58:44 +00:00
Nathan Rajlich
672cd5efbb [now dev] Lazily initialize the nodejs8.10 runtime for builds (#2243) 2019-04-29 14:58:40 +00:00
Leo Lamprecht
37d410c6cf Bumped @zeit/nsfw to latest (#2242) 2019-04-29 14:58:35 +00:00
Leo Lamprecht
d270a07e2a Support Windows when downloading file watcher (#2240) 2019-04-29 14:58:31 +00:00
Andy
1f66976beb Modify the gitbash file correctly (#2223) 2019-04-29 14:58:27 +00:00
Amio
ff601a4c70 [now dev] exit on MissingDotenvVarsError (#2237) 2019-04-29 14:58:24 +00:00
Steven
73d23126f5 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-29 14:58:19 +00:00
Steven
5a1b6e6569 Add python virtual environment to default ignore (#2241) 2019-04-26 15:56:02 -04:00
Leo Lamprecht
f8f5a554e1 15.0.8 2019-04-25 20:57:35 +00:00
Nathan Rajlich
b93e8edb83 [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 20:57:24 +00:00
Nathan Rajlich
4fe1a3831d [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 20:57:17 +00:00
Leo Lamprecht
2be128639c 15.0.7 2019-04-25 15:05:38 +00:00
Nathan Rajlich
8557c4baf0 [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 15:03:19 +00:00
Nathan Rajlich
037283ed07 [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-25 15:03:13 +00:00
Nathan Rajlich
122a83e556 [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-25 15:03:09 +00:00
Leo Lamprecht
c13fc9d406 Bumped @now/build-utils to latest version (#2220) 2019-04-25 15:03:03 +00:00
Amio
4595449561 [now-dev] Exit when incorrect cwd config (#2218)
* [now-dev] Exit when incorrect cwd config

* better wording
2019-04-25 15:02:58 +00:00
Nathan Rajlich
fb474e5a5f [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-25 15:02:53 +00:00
Nathan Rajlich
582fb18c22 [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-25 15:02:49 +00:00
Nathan Rajlich
26c4f91c58 [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-25 15:02:44 +00:00
Nathan Rajlich
aa1d41f89c [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-25 15:02:38 +00:00
Steven
a23ad79c99 Ignore __pycache__ directories (#2213) 2019-04-25 15:02:34 +00:00
Mark
18f3c50003 Update @zeit/ncc to v0.18.1 (#2210) 2019-04-25 15:02:28 +00:00
Nathan Rajlich
28a478311c [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-25 15:01:05 +00:00
Amio
01d380a7e7 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-25 15:01:01 +00:00
Nathan Rajlich
276860aead [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-25 15:00:56 +00:00
Leo Lamprecht
2ccbaba654 Initial build should set requestPath to null (#2200)
* Initial build should set `requestPath` to `null`

* Fixed types

* Fixed type
2019-04-25 15:00:52 +00:00
Nathan Rajlich
737aa45a81 [now dev] Fix typo in debug log (#2206)
Also switch to present-tense wording.
2019-04-25 15:00:48 +00:00
Amio
e39dfdd329 [now-dev] make routes from v2 builders optional (#2204) 2019-04-25 15:00:44 +00:00
Leo Lamprecht
71f6711ab4 Better name for continuous property (#2199) 2019-04-25 15:00:39 +00:00
Leo Lamprecht
4849381e60 Prevent exit if client closes proxy connection (#2198) 2019-04-25 15:00:35 +00:00
Leo Lamprecht
1dcd5a7e4e Match only the important part while routing (#2195) 2019-04-25 15:00:31 +00:00
Amio
8e4d7d769e 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-25 15:00:27 +00:00
Amio
56fabb8b87 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-25 15:00:23 +00:00
Amio
c4bd356fc7 Reveal builder logs when --debug (#2193)
And added a `debug` flag to `DevServer` class
2019-04-25 15:00:19 +00:00
Nathan Rajlich
97ec2d1011 [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-25 15:00:08 +00:00
Nathan Rajlich
35e9bb4e5e [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-25 14:59:51 +00:00
Andy
5a0ff896a2 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-25 14:59:46 +00:00
Andy
03915685eb Show the domain purchase UI (#2168)
* Show the domain purchase UI

* Show the correct error message

* Exit after the domain purchase
2019-04-25 14:59:41 +00:00
Amio
0dae0401ee Add some debug logs for now-dev (#2181)
* Add some debug logs

* Fix eslint warnings
2019-04-25 14:59:21 +00:00
Nathan Rajlich
b706a526a4 [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-25 14:59:12 +00:00
Nathan Rajlich
071c523dd6 [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-25 14:59:02 +00:00
Amio
8de99d13f5 Mute install logs from @now/node builder (#2171)
* [wip] Mute install logs from @now/node builder

* Bumped build utils
2019-04-25 14:58:54 +00:00
Nathan Rajlich
db9ed9ea54 Pass filesChanges and filesRemoved array to builder's build() (#2174)
This will be required to implement the `@now/node` ncc watcher logic.
2019-04-25 14:58:48 +00:00
Nathan Rajlich
defb2f1776 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-25 14:58:43 +00:00
Amio
de560ea31a Enable '@typescript-eslint/no-unused-vars': 'warn' (#2172)
* Enable '@typescript-eslint/no-unused-vars': 'warn'

* Clean comments
2019-04-25 14:58:37 +00:00
Nathan Rajlich
f90179761f 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-25 14:58:32 +00:00
Ana Trajkovska
e35ce0591f 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-25 14:58:26 +00:00
Nathan Rajlich
5ccf7013fe [now dev] Add host property to the invoke payload (#2164)
Fixes https://github.com/zeit/now-builders/issues/390.
2019-04-25 14:58:06 +00:00
Nathan Rajlich
74d2a7da58 [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-25 14:58:01 +00:00
Nathan Rajlich
691e9ea1ee [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-25 14:57:55 +00:00
Nathan Rajlich
3ea00009aa [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-25 14:57:41 +00:00
Andy Bitz
10af9ce5c5 15.0.6 2019-04-18 21:26:53 +02:00
Andy
d4fbbd6dfe Show all aliases instead of just the first one (#2188) 2019-04-18 21:26:07 +02:00
Andy
9994fc0824 Now CLI gets a fixed alias (#2189) 2019-04-18 21:25:57 +02:00
Andy Bitz
c7beaaab94 Revert "Revert "Fix batch file command to work from paths with spaces. (#2144)""
This reverts commit 16c2946e32.
2019-04-18 21:25:08 +02:00
Andy Bitz
ba02d56a4e 15.0.5 2019-04-17 21:12:45 +02:00
Andy
e03d16462f 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 21:05:48 +02:00
Andy
0547a82a5c Use the v9 deployments API (#2176) 2019-04-17 21:05:40 +02:00
Andy Bitz
16c2946e32 Revert "Fix batch file command to work from paths with spaces. (#2144)"
This reverts commit ce4d9d21d6.
2019-04-17 10:57:19 +02:00
Duncan
ce4d9d21d6 Fix batch file command to work from paths with spaces. (#2144)
Fixes #2413.
2019-04-17 10:53:29 +02:00
William Li
479f224240 [BUG-FIX] team invite ignored scope error (#2140)
* expose teams command to --scope change, fixes #2139
2019-04-12 18:36:37 +08:00
Leo Lamprecht
b8abd8e6b2 15.0.4 2019-04-11 11:36:22 +00:00
Nathan Rajlich
6748053233 [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 11:30:46 +00:00
Amio
3cc3b17b1d 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 11:30:40 +00:00
Mark Glagola
1d525023df 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-11 11:30:35 +00:00
Leo Lamprecht
be1ebdbdd3 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-11 11:30:32 +00:00
Leo Lamprecht
90aae568c5 Stop indicating whether CDN is enabled (#2132) 2019-04-11 11:30:27 +00:00
Leo Lamprecht
c311ecbc07 Print full validation error message (#2131)
* Print full validation error message

* Shortened second message

* Updated latest pipeline too
2019-04-11 11:30:19 +00:00
Mark Glagola
1a676c0203 fixes certs rate limited cns arg (#2130) 2019-04-11 11:30:15 +00:00
Amio
692a08c134 Bump ava to 1.4.1 (#2128) 2019-04-11 11:30:11 +00:00
Mark Glagola
321ee681c5 Handle unsupported tld purchase (#2129) 2019-04-11 11:30:07 +00:00
Nathan Rajlich
8847783063 [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-11 11:29:59 +00:00
Mark Glagola
9c0cf1eb9e Fix getCertsById + handle cert not found by id error (#2101)
* fix certs delete + handle not found error

* Converted rm.js -> rm.ts
2019-04-11 11:29:54 +00:00
Nathan Rajlich
688d50b662 [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-11 11:29:48 +00:00
Leo Lamprecht
4039ae9772 15.0.3 2019-04-08 12:16:20 +00:00
Nathan Rajlich
88842d5a54 [now dev] Update @now/build-utils to v0.4.40 (#2119) 2019-04-08 12:03:52 +00:00
Nathan Rajlich
44d02b78ac [now dev] Update @now/build-utils to v0.4.40-canary.0 (#2118) 2019-04-08 12:03:48 +00:00
Nathan Rajlich
c3d5a7b8ff [now dev] Add handle: filesystem support (#2116) 2019-04-08 12:03:42 +00:00
Nathan Rajlich
403d24d934 [now dev] Run npm update to get builder updates (#2117) 2019-04-08 12:03:35 +00:00
Mark
943fe8989b Update @zeit/ncc to v0.17.4 (#2107) 2019-04-08 12:03:30 +00:00
Nathan Rajlich
893fe29514 [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-08 12:03:26 +00:00
Nathan Rajlich
568559daa5 [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-08 12:03:21 +00:00
Andy
9e713e0565 Exit if assigning an alias failed while deploying (#2103)
* Error if aliasFinal is an empty array

* Return if alias assignment failed
2019-04-08 12:03:14 +00:00
Leo Lamprecht
583b566133 15.0.2 2019-04-05 14:00:22 +00:00
Leo Lamprecht
4f639e608b Make npm not prefer offline (#2102) 2019-04-05 15:48:53 +02:00
Nathan Rajlich
70c2c42416 [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 13:33:35 +00:00
Nathan Rajlich
ec56091f98 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 13:33:31 +00:00
Nathan Rajlich
4325aa9eb4 [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-05 13:33:27 +00:00
Nathan Rajlich
e01549a978 [now dev] Remove now dev cache clean (#2097) 2019-04-05 13:33:24 +00:00
William Li
2d855391b6 [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-05 13:33:20 +00:00
Nathan Rajlich
feb88e5aa3 [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-05 13:33:15 +00:00
Nathan Rajlich
257a8e7be1 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-05 13:33:11 +00:00
Nathan Rajlich
f0473e9155 [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-05 13:33:05 +00:00
Nathan Rajlich
e0a3a39faa [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-05 13:33:00 +00:00
Nathan Rajlich
c24afe3714 [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-05 13:32:56 +00:00
Nathan Rajlich
705fdfba38 [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-05 13:32:52 +00:00
Nathan Rajlich
210d4f9d5c [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-05 13:32:48 +00:00
Nathan Rajlich
8396f17c40 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-05 13:32:44 +00:00
Nathan Rajlich
cc22b4a005 Update @zeit/ncc to v0.17.3 (#2058) 2019-04-05 13:32:39 +00:00
William Li
f8cbe364be Don't forget to do a yarn install before linking (#2094) 2019-04-05 02:11:35 +02:00
Leo Lamprecht
242be8da28 15.0.1 2019-04-01 15:51:50 +00:00
Nathan Rajlich
67157c5a92 [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 15:42:12 +00:00
Nathan Rajlich
f3764abd19 Update @now/build-utils to v0.4.38 (#2055) 2019-04-01 15:42:09 +00:00
Leo Lamprecht
5a49c41b20 15.0.0 2019-04-01 11:13:50 +00:00
Leo Lamprecht
810e27c08d Adjusted aliasing error message to match server (#2030)
* Adjusted aliasing error message to match server

* Correctly escape
2019-04-01 11:03:45 +00:00
Leo Lamprecht
37e3c6132c Made aliases clickable after assigning (#2035)
* Made aliases clickable after assigning

* Set in correct place

* Fixed URL

* Attached alias

* Added missing https
2019-04-01 11:03:30 +00:00
Andy
4a6e565027 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-04-01 11:03:16 +00:00
Amio
03f45f5d3e 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-04-01 11:03:11 +00:00
Nathan Rajlich
0c5bae6f37 [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-04-01 13:01:57 +02:00
Nathan Rajlich
f9f29485ad Update @zeit/fun to v0.6.0 (#2049) 2019-04-01 13:01:57 +02:00
Nathan Rajlich
9033bcddfe [now dev] Use cyan for link color
Blue is hard to read on terminals with a black background.
2019-04-01 13:01:57 +02:00
Nathan Rajlich
f1873c51d2 [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-04-01 13:01:57 +02:00
Nathan Rajlich
af3594e106 [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-04-01 13:01:57 +02:00
Nathan Rajlich
3e8a8ac79f [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-04-01 13:01:57 +02:00
Nathan Rajlich
bc7153883d [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-04-01 13:01:57 +02:00
Nathan Rajlich
92826db86b [now dev] Send the NO_STATUS_CODE_FROM_LAMBDA upon lambda error (#2037) 2019-04-01 13:01:57 +02:00
Nathan Rajlich
9ea2216d4a [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-04-01 13:01:57 +02:00
Nathan Rajlich
df6eb070d8 Add output to DevServer class (#2034) 2019-04-01 13:01:57 +02:00
Nathan Rajlich
632d7b0651 [now dev] Listen on the next available port when requested port is taken (#2032)
Fixes #2024.
2019-04-01 13:01:57 +02:00
Nathan Rajlich
fd3c110c02 [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-04-01 13:01:57 +02:00
Nathan Rajlich
6c8dc90267 [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-04-01 13:01:57 +02:00
Nathan Rajlich
3f57d1381e [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-04-01 13:01:57 +02:00
Amio
02b3c5f535 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-04-01 13:01:57 +02:00
Julian Gruber
4e11f7f064 14.2.4 2019-03-28 14:38:21 +01:00
Julian Gruber
52d214f1ff 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-28 14:34:39 +01:00
Julian Gruber
3a0b5c33cd 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-28 14:30:12 +01:00
Julian Gruber
809356afed 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-28 14:30:02 +01:00
Julian Gruber
1b01015a8c 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-28 14:29:56 +01:00
Julian Gruber
ef2d75394a Fixed the handling of unexpected DeploymentFailedAliasImpossible (#2020) 2019-03-28 14:29:40 +01:00
Joe Cohen
c0c4a7f254 fix typo on domains inspect (#2016) 2019-03-28 14:22:42 +01:00
Leo Lamprecht
121343e1dd 14.2.3 2019-03-22 01:02:53 +00:00
Leo Lamprecht
a4294cfe84 Make deployments without builds work (#2004)
* Make deployments without builds work

* Added integration test

* Fixed test
2019-03-22 01:02:37 +00:00
Leo Lamprecht
c86e750883 14.2.2 2019-03-21 03:01:24 +00:00
Leo Lamprecht
75dd772811 Only block deployment exit if not error (#2000) 2019-03-21 03:01:16 +00:00
Leo Lamprecht
f4849cd55e 14.2.1 2019-03-21 01:30:42 +00:00
Leo Lamprecht
ce7d75d6b2 Only announce deployment as ready if alias is set (#1997) 2019-03-20 23:52:14 +00:00
Leo Lamprecht
720aee7250 14.2.0 2019-03-19 12:17:42 +00:00
Leo Lamprecht
47ca5f3072 Made -S short flag work properly (#1988) 2019-03-19 09:44:41 +00:00
Julian Gruber
0ce633a1ea 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-19 09:13:42 +00:00
Julian Gruber
93d0019153 Fix the handling of user errors (#1984)
* fix `ms(null)` in `certs rm`

* fix uncaught `InvalidDomain`
2019-03-19 09:13:37 +00:00
Julian Gruber
f89417c06c Fix null pointer access in error reporting (#1983)
* fix null pointer access in error reporting

* refactor
2019-03-19 09:13:33 +00:00
Amio
6344a08c91 Add hint about -f in now init error message (#1971) 2019-03-19 09:13:14 +00:00
Andy
a981c711b6 Handle the DomainNotVerified error for deployments (#1973) 2019-03-19 09:13:08 +00:00
Leo Lamprecht
3b250af6d6 Warn of now alias was used (#1972)
* Warn of `now alias` was used

* Mention deploy command
2019-03-19 09:13:04 +00:00
Leo Lamprecht
70de080be7 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-19 09:12:59 +00:00
Julian Gruber
f629787d04 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-19 09:12:54 +00:00
Julian Gruber
e20ba6e741 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-19 09:12:51 +00:00
Mark Glagola
00d30d2ddc adds prompt when moving domain to team user is not member of (#1965) 2019-03-19 09:12:47 +00:00
Leo Lamprecht
9921d282d3 Improved output for deploy command (#1962)
* Make alias links clickable

* Make output print Ready instead of Success

* Fixed missing export
2019-03-19 09:12:42 +00:00
Leo Lamprecht
b70678a8a9 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-19 09:12:38 +00:00
Andy
3fc9051268 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-03-19 09:12:32 +00:00
Leo Lamprecht
436c7fe0ad 14.1.1 2019-03-18 13:17:10 +00:00
Leo Lamprecht
7c837caef9 Make --scope take priority over scope (#1985) 2019-03-18 13:16:59 +00:00
Leo Lamprecht
fbe751e348 Revert "Added support for the --target flag (#1893)"
This reverts commit 2fea26772d.
2019-03-18 13:10:01 +00:00
Leo Lamprecht
dc95b8584d Revert "Allow --target to be set to staging (#1955)"
This reverts commit d8d51b7128.
2019-03-18 13:10:00 +00:00
Leo Lamprecht
4e715bc408 Revert "Improved output for deploy command (#1962)"
This reverts commit 0e2d23f01c.
2019-03-18 13:09:59 +00:00
Leo Lamprecht
9093fcebcd Revert "adds prompt when moving domain to team user is not member of (#1965)"
This reverts commit 8d33b2c866.
2019-03-18 13:09:58 +00:00
Leo Lamprecht
d6e1508ffc Revert "Added back sending process args to Sentry (#1966)"
This reverts commit 8ee47fbc90.
2019-03-18 13:09:57 +00:00
Leo Lamprecht
02b59926d5 Revert "Fix the handling of user errors (#1959)"
This reverts commit d059597a63.
2019-03-18 13:09:56 +00:00
Leo Lamprecht
a78770c11e Revert "Improved deployment output (#1968)"
This reverts commit b0ab91d794.
2019-03-18 13:09:54 +00:00
Leo Lamprecht
d3d72f0bb3 Revert "Warn of now alias was used (#1972)"
This reverts commit 473eae1c65.
2019-03-18 13:09:53 +00:00
Leo Lamprecht
09aa8400ab Revert "Handle the DomainNotVerified error for deployments (#1973)"
This reverts commit ae2dfd41d2.
2019-03-18 13:09:52 +00:00
Leo Lamprecht
41cea25bb0 "Revert "Add hint about -f in now init error message (#1971)"
This reverts commit 6f386e7ca2.
2019-03-18 13:09:41 +00:00
Amio
6f386e7ca2 Add hint about -f in now init error message (#1971) 2019-03-18 09:45:15 +00:00
Andy
ae2dfd41d2 Handle the DomainNotVerified error for deployments (#1973) 2019-03-18 09:45:11 +00:00
Leo Lamprecht
473eae1c65 Warn of now alias was used (#1972)
* Warn of `now alias` was used

* Mention deploy command
2019-03-18 09:45:05 +00:00
Leo Lamprecht
b0ab91d794 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-18 09:45:00 +00:00
Julian Gruber
d059597a63 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-18 09:44:48 +00:00
Julian Gruber
8ee47fbc90 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-18 09:44:42 +00:00
Mark Glagola
8d33b2c866 adds prompt when moving domain to team user is not member of (#1965) 2019-03-18 09:44:36 +00:00
Leo Lamprecht
0e2d23f01c Improved output for deploy command (#1962)
* Make alias links clickable

* Make output print Ready instead of Success

* Fixed missing export
2019-03-18 09:44:08 +00:00
Leo Lamprecht
d8d51b7128 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-18 09:43:29 +00:00
Andy
2fea26772d 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-03-18 09:42:21 +00:00
Leo Lamprecht
d430953d1e 14.1.0 2019-03-14 15:29:28 +00:00
Leo Lamprecht
f099496aba 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-14 15:17:14 +00:00
Julian Gruber
78ac52c3b4 Fixed the handling of user errors (#1958) 2019-03-14 15:17:10 +00:00
Julian Gruber
60ea982ed8 Refactored flow error checks (#1953) 2019-03-14 15:17:04 +00:00
Leo Lamprecht
dc80b099bf Soft-deprecate the --team flag (#1956)
* Soft-deprecate the `--team` flag

* Check for warning message

* Removed useless error
2019-03-14 15:16:58 +00:00
Amio /
f40e0a8ff9 Added a deploy hint after now init. (#1952)
* [now-init] add a deploy hint after init

* add CODEOWNERS
2019-03-14 15:16:52 +00:00
Leo Lamprecht
9341136f16 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-14 15:16:45 +00:00
Mark Glagola
d1261dd0a5 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-14 15:13:59 +00:00
Julian Gruber
7486b6fb60 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-14 15:13:53 +00:00
Mark Glagola
6e3993ecf8 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-14 15:13:46 +00:00
Mark Glagola
81c5c15437 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-14 15:13:39 +00:00
Mark Glagola
d66bf78e23 Added warning for domains-move token expiration (#1916) 2019-03-14 15:13:23 +00:00
Mark Glagola
48786382ec 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-03-14 15:13:16 +00:00
Andy Bitz
4440bb3741 14.0.3 2019-03-03 22:47:26 +01:00
Andy
ef7ead405c Overwrite the default batch file on windows (#1922)
* Overwrite the default batch file on windows

* Suppress echoing of the command
2019-03-03 22:46:43 +01:00
Leo Lamprecht
c61c90a224 14.0.2 2019-03-01 12:05:25 +00:00
Javi Velasco
bb222b2466 Add --no-scale option (#1918)
* Add no-scale option

* Reword --no-scale warning
2019-03-01 12:04:11 +00:00
Olli Vanhoja
1a0cc26f69 Set verify-deployment-scale timeout to 5 minutes (#1915)
The current client side timeout is shorter than the backend
timeout.
2019-03-01 12:03:54 +00:00
Leo Lamprecht
f95cdb30a1 14.0.1 2019-02-26 08:21:58 +00:00
Leo Lamprecht
8308b2a4f3 Prevent error in now inspect if no dest (#1913) 2019-02-26 08:21:41 +00:00
Mark Glagola
c89a19ab84 Using @types/psl typings + handling all potential error cases with psl (#1911) 2019-02-26 08:21:22 +00:00
Javi Velasco
8eaebdee4e Fix wrong error message (#1904) 2019-02-26 08:20:56 +00:00
Leo Lamprecht
07041e1b7b 14.0.0 2019-02-15 11:18:38 +00:00
Mark Glagola
f0c97a33d9 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-14 10:30:59 +00:00
Sergii Paryzhskyi
424ad79c36 Add a hint to an error message about missing token (#1877) 2019-02-14 10:29:57 +00:00
Steve Kaliski
c51f902a0c fix typo in alias command (#1870) 2019-02-14 10:29:52 +00:00
Olli Vanhoja
9a5d097f57 Handle dns add 400 errors properly (#1867)
Currently 400 errors are left unhandled.
2019-02-14 10:29:48 +00:00
Mark Glagola
3b9e5b91b1 Handle domain rm attempt for an in progress transfer (#1880) 2019-02-14 10:29:43 +00:00
Mark Glagola
19c74080b8 Catch SourceNotFound error for domains transfer-in (#1879) 2019-02-14 10:29:40 +00:00
Javi Velasco
a5dd13912c Update inspect copy (#1875) 2019-02-14 10:29:36 +00:00
Mark Glagola
046fb8c38e Added import help info to now-cli (now dns -h) (#1876) 2019-02-14 10:29:30 +00:00
Leo Lamprecht
16acc6c424 Bumped fetch-h2 to latest version (#1869)
* Bumped `fetch-h2` to latest version

* Fixed code
2019-02-14 10:29:22 +00:00
Olli Vanhoja
9b74c2db3e Show builds rate limit message correctly (#1866) 2019-02-14 10:29:17 +00:00
Mark Glagola
c462c27751 Handle known domains rm errors (#1868) 2019-02-14 10:29:11 +00:00
Mark Glagola
ba33cd9106 Added transferredAt and transferStartedAt (#1865) 2019-02-14 10:27:00 +00:00
Javi Velasco
e26f31babd Remove cf cdn enabled flag (#1852)
* Remove CDN toggling

* Rename cdnEnabled to cfEnabled

* Rename cfEnabled to cloudfareEnabled

* Remove missing error
2019-02-14 10:26:56 +00:00
Andy
618bcf236c Check if deploymentId exists (#1857)
* Check if deploymentId exists

* Make deploymentId optional for Alias
2019-02-14 10:26:52 +00:00
Arunoda Susiripala
1264b33b49 Check the existence of the project before we delete it (#1837) 2019-02-14 10:26:48 +00:00
Leo Lamprecht
101de40cc6 Render validation errors for Now 1.0 (#1862) 2019-02-14 10:26:43 +00:00
Mark Glagola
9e4dc9e0db Domain transfer in copy change (#1861) 2019-02-14 10:26:39 +00:00
Javi Velasco
d851a5b2d0 Add import zonefile copy (#1860) 2019-02-14 10:26:34 +00:00
Javi Velasco
16fed01d72 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-02-14 10:26:30 +00:00
Javi Velasco
3ad9b03066 Add missing error: InvalidAuthCode (#1859) 2019-02-14 10:26:24 +00:00
Mark Glagola
f794c99462 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-02-14 10:26:19 +00:00
George Tsiolis
9e79e06da9 Update legacy note structure (#1855) 2019-02-14 10:26:12 +00:00
Mark Glagola
45bf56671a "now domains transfer-in" support (#1767) 2019-02-14 10:26:07 +00:00
Andy
937fb75eb2 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-02-14 10:26:01 +00:00
Javi Velasco
5405828d4d 13.1.3 2019-02-04 04:22:52 +01:00
Javi Velasco
5b16110d0b Enhance login (#1873)
* Enhance login

* Consume error from api
2019-02-04 04:20:57 +01:00
Leo Lamprecht
258d7a3feb 13.1.2 2019-01-17 12:23:48 +00:00
Leo Lamprecht
2dd5cd3f63 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 12:16:12 +00:00
Leo Lamprecht
7e92912972 13.1.1 2019-01-16 23:14:06 +00:00
Arunoda Susiripala
bf2abe724f Fix formatting issues on project rm confirmation (#1834) 2019-01-16 23:13:57 +00:00
Leo Lamprecht
5d6e1e6210 13.1.0 2019-01-16 22:01:50 +00:00
Leo Lamprecht
ba9cae2d56 Ensure project name is always defined (#1833) 2019-01-16 18:45:04 +00:00
Max
4b243346e8 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 18:44:56 +00:00
Arunoda Susiripala
a9fe32611f 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-16 18:44:46 +00:00
Arunoda Susiripala
7d54ccc668 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-16 18:44:31 +00:00
Javi Velasco
946e5cb78c Move all dns commands and subcommands to typescript (#1825) 2019-01-16 18:44:15 +00:00
Leo Lamprecht
402b9e3daa 13.0.6 2019-01-15 16:03:55 +00:00
Leo Lamprecht
3c20c4b690 Allow user to abort now init (#1826) 2019-01-15 15:57:25 +00:00
Leo Lamprecht
3ee1cf1eee 13.0.5 2019-01-15 10:07:41 +00:00
Leo Lamprecht
d2931a540a 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-15 09:55:59 +00:00
Andy
9596a415bf Add the command to sentry (#1824)
Add the current command to sentry as extra
2019-01-15 09:55:54 +00:00
Timothy
4e1ebfc541 Fix config file message (#1821) 2019-01-15 09:55:49 +00:00
Amio /
ca086e01c7 better did-you-mean (#1817)
ensure 'node' => 'nodejs' insteadof 'node-server'
2019-01-15 09:55:44 +00:00
Leo Lamprecht
4dae0cd0d5 13.0.4 2019-01-10 11:32:38 +00:00
Leo Lamprecht
4dfacb63a1 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 11:26:56 +00:00
Leo Lamprecht
531a2dc12c 13.0.3 2019-01-09 22:13:13 +00:00
Leo Lamprecht
0e011570be Do not render that status was inferred (#1816) 2019-01-09 22:13:02 +00:00
Leo Lamprecht
e785d967bf 13.0.2 2019-01-09 14:35:47 +00:00
Leo Lamprecht
55004d4a6a Made now domains inspect match now inspect (#1815) 2019-01-09 14:30:12 +00:00
Leo Lamprecht
ac7ff6a4a7 13.0.1 2019-01-09 12:00:15 +00:00
Leo Lamprecht
d768b93441 Bumped update-check to latest version (#1814) 2019-01-09 10:55:43 +00:00
Leo Lamprecht
ecf0df8c6e Fixed several errors (#1811)
* Fixed NOW-CLI-HB

* Fixed code
2019-01-08 20:35:04 +00:00
Leo Lamprecht
2da216d9ca 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:00:43 +00:00
Timothy
9e512690ff Add domain verification error document (#1806) 2019-01-07 23:00:40 +00:00
Leo Lamprecht
ec25aae9ea Overhauled now inspect (#1804)
* Show routes in `now inspect`

* Removed whitespace

* Made UI gorgeous

* Use cyan for meta keys
2019-01-07 23:00:36 +00:00
Leo Lamprecht
4c96c2feef 13.0.0 2019-01-05 07:50:55 +00:00
Amio /
25eeafb6c3 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 21:16:25 +00:00
Javi Velasco
da8801d236 Style fixes (#1796) 2019-01-04 21:16:23 +00:00
Javi Velasco
60da071e7d 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 13:14:53 +00:00
Leo Lamprecht
80fe47ef79 Only run prettier for JS/TS files (#1791)
* Only pass modified js files

* Look for TS too
2019-01-04 13:14:49 +00:00
Leo Lamprecht
c0e4ed05bf Improved performance when creating deployment (#1787) 2019-01-04 13:14:44 +00:00
Leo Lamprecht
a300096620 Moved docs about publishing a release to Wiki (#1786) 2019-01-04 13:14:38 +00:00
Olli Vanhoja
c3281a6cbc 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.
2019-01-04 13:14:32 +00:00
Javi Velasco
fcf3f63796 Remove extra request when adding a domain (#1762) 2019-01-04 13:14:27 +00:00
Javi Velasco
a86c1d980b 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
2019-01-04 13:14:22 +00:00
Leo Lamprecht
4f1e6c4a6f Wait for unhandled rejections to be reported before exiting (#1760) 2019-01-04 13:14:17 +00:00
Javi Velasco
d0ffac21d3 Fix issue when we define aliases in now.json array (#1757) 2019-01-04 13:14:12 +00:00
Javi Velasco
721639ae6b Domains enhancements (#1755)
* Show a dash where there are no nameservers

* Show actual serviceType in domains

* Format ns table with ticks

* More enhancements
2019-01-04 13:14:05 +00:00
Leo Lamprecht
0ade88209d Render better error when source missing (#1754)
* Render better error when source missing

* Added integration test

* Fixed missing
2019-01-04 13:14:00 +00:00
Leo Lamprecht
553f299299 Ran prettier over the entire codebase (#1749)
* Use correct parser

* Ran prettier over the entire codebase
2019-01-04 13:13:55 +00:00
Javi Velasco
07dd59b017 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
2019-01-04 13:13:50 +00:00
Leo Lamprecht
869a48f392 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
2019-01-04 13:13:45 +00:00
Javi Velasco
5ffa933b7f New domains API + Typescript migrations (#1728)
New domains API + Typescript migrations
2019-01-04 13:13:37 +00:00
Leo Lamprecht
e14681e6c4 Revert "Use single call on aliases and certs on domain rm (#1763)"
This reverts commit 4f549a1fa5.
2019-01-04 13:13:23 +00:00
Leo Lamprecht
48f790c60f Revert "Stop using domains v4 in stable (#1764)"
This reverts commit 61bd0b7038.
2019-01-04 13:12:37 +00:00
Javi Velasco
df01e07f66 12.1.14 2018-12-19 14:53:06 +01:00
Javi Velasco
61bd0b7038 Stop using domains v4 in stable (#1764) 2018-12-19 14:52:32 +01:00
Javi Velasco
e8570dd47f 12.1.13 2018-12-19 12:20:30 +01:00
Joe Cohen
4f549a1fa5 Use single call on aliases and certs on domain rm (#1763) 2018-12-19 12:06:48 +01:00
Leo Lamprecht
e160e4e578 12.1.12 2018-12-12 22:05:10 +00:00
Mudit Ameta
2378b78c69 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 17:25:37 +00:00
Joe Cohen
3b500bad64 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 17:25:31 +00:00
Leo Lamprecht
ab81bbea68 12.1.11 2018-12-10 14:49:22 +00:00
Leo Lamprecht
1f2a0d6163 Hot fix for now teams ls (#1737)
* Hot fix for `now teams ls`

* Added integration test
2018-12-10 14:27:41 +00:00
Leo Lamprecht
9b922c9f7d 12.1.10 2018-12-10 11:05:52 +00:00
Leo Lamprecht
b1bce843d4 Make download script work properly (#1729) 2018-12-07 23:07:33 +00:00
Leo Lamprecht
067bd9f75e 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 22:38:45 +00:00
Leo Lamprecht
b6213b17ae 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 15:19:06 +00:00
Leo Lamprecht
869375a6ac Downgrade @zeit/ncc (#1725)
* Downgrade `@zeit/ncc`

* Fixed package.json
2018-12-06 22:32:45 +00:00
Leo Lamprecht
cb460beb86 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 22:15:54 +00:00
Leo Lamprecht
6e8cc57b65 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 22:15:43 +00:00
Leo Lamprecht
d18ae25c19 Added legacy preferGlobal flag (#1722) 2018-12-06 22:15:39 +00:00
Leo Lamprecht
62176311c9 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 22:18:05 +00:00
Leo Lamprecht
ae03014b87 12.1.9 2018-12-05 17:06:02 +00:00
Leo Lamprecht
6defc8eb31 Made npm run link work (#1715) 2018-11-30 23:33:33 +00:00
Leo Lamprecht
6635e72598 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-11-30 23:33:26 +00:00
Leo Lamprecht
0eacea6fcd Changed default of sessionAffinity to random (#1713) 2018-11-30 23:33:20 +00:00
Gustaf Räntilä
fae3c2e1bd Improved http2 stability (#1705) 2018-11-29 18:33:26 +00:00
Leo Lamprecht
ed89a92f39 Correctly report code coverage (#1709) 2018-11-29 18:33:20 +00:00
Leo Lamprecht
c4e2a63f76 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 18:33:16 +00:00
Leo Lamprecht
0baa065fce 12.1.8 2018-11-29 16:13:52 +00:00
Leo Lamprecht
075c1522f8 Ensured now -V 1 owner/repo continues working (#1707)
* Ensured `now -V 1 owner/repo` continues working

* Added newline

* Added tests
2018-11-29 16:04:02 +00:00
Leo Lamprecht
9c52309fb3 12.1.7 2018-11-28 12:00:48 +00:00
Leo Lamprecht
ebaa5dc70b Render more accurate error when offline (#1704) 2018-11-27 22:47:55 +00:00
Leo Lamprecht
5f9c5b1cf4 Render more detailed error when files are not there (#1700) 2018-11-27 21:59:22 +01:00
Leo Lamprecht
57f6895f92 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:58:59 +01:00
Leo Lamprecht
fee4e23c11 12.1.6 2018-11-26 13:07:40 +01:00
Leo Lamprecht
adac5826bd 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:09:44 +01:00
Leo Lamprecht
e2885e2a00 Do not send github property to API (#1694) 2018-11-23 12:11:47 +01:00
Leo Lamprecht
6879e0e819 Do not send alias to the API (#1690) 2018-11-22 16:48:32 +01:00
Leo Lamprecht
d3fd83c2ac Properly render schema validation errors (#1689)
* Properly render schema validation errors

* Added integration test

* Removed useless properties
2018-11-22 13:47:01 +01:00
Leo Lamprecht
da5c75c911 12.1.5 2018-11-21 22:15:35 +01:00
Leo Lamprecht
e6802d89aa Make now teams add work (#1684)
* Make `now teams add` work

* Added integration test

* Added comment
2018-11-21 18:22:37 +01:00
Leo Lamprecht
731e36a393 12.1.4 2018-11-20 21:16:27 +01:00
Leo Lamprecht
e94b0dfa88 Do not store a backup of the binary (#1676) 2018-11-19 13:25:50 +01:00
Leo Lamprecht
5cf6016d50 Build for dev and not for prod when linking (#1671) 2018-11-19 13:25:45 +01:00
Leo Lamprecht
cde888ed2b Made publishing work (#1669) 2018-11-19 13:25:38 +01:00
Leo Lamprecht
fe07405971 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-19 13:25:23 +01:00
Leo Lamprecht
c154d600fd 12.1.3 2018-11-15 17:25:59 +01:00
Leo Lamprecht
25bdc3b5a8 Report server errors that are unhandled (#1658) 2018-11-15 01:33:11 +01:00
Evil Rabbit
71dce28494 Update repo banner (#1659) 2018-11-15 01:33:06 +01:00
Leo Lamprecht
cf39c76986 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:33:00 +01:00
Leo Lamprecht
e779b8342d 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-15 01:32:53 +01:00
Leo Lamprecht
f229f09715 Fixed error message for minimum instance count (#1655) 2018-11-15 01:32:46 +01:00
Leo Lamprecht
80d166ad0d 12.1.2 2018-11-14 00:39:26 +01:00
Leo Lamprecht
2b7e21b31d Allow re-using aliases that point to deleted deployments (#1653)
* Allow re-using aliases that point to deleted deployments

* Removed
2018-11-13 23:58:05 +01:00
Leo Lamprecht
c157e08179 Log version when debugging (#1652) 2018-11-13 20:20:57 +01:00
Leo Lamprecht
96ff68a8a1 Decrease amount of retries for download (#1651)
This fixes #1622.
2018-11-13 20:20:51 +01:00
Leo Lamprecht
46fc00918e 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 20:20:45 +01:00
Leo Lamprecht
be98a38c9a 12.1.1 2018-11-12 22:24:47 +01:00
Leo Lamprecht
59717b32a5 Made default value for --dotenv (v1) work again (#1649) 2018-11-12 22:13:21 +01:00
Leo Lamprecht
0ee868e009 12.1.0 2018-11-12 13:29:37 +01:00
Leo Lamprecht
075dea2b8f Added -V to the usage information (#1648) 2018-11-12 12:59:39 +01:00
Leo Lamprecht
a6ab26f93c 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:58 +01:00
Leo Lamprecht
520d3e2a06 Added support for -V option (#1644) 2018-11-10 20:56:39 +01:00
Leo Lamprecht
f3ed32e06b 12.0.1 2018-11-08 23:25:25 +01:00
Leo Lamprecht
eded40049d 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 23:01:46 +01:00
Bart Deslagmulder
56e1a37ae1 Updated error documentation about not nameservers (#1629) 2018-11-08 23:01:37 +01:00
Leo Lamprecht
49d29b2a0d 12.0.0 2018-11-08 16:44:13 +01:00
Leo Lamprecht
f330d2c7ed 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:29:05 +01:00
Leo Lamprecht
dbdc0ed52f 11.5.2 2018-11-03 18:09:20 +01:00
Leo Lamprecht
fd59f931fa Revert "Add support for top-level "sh" auth"
This reverts commit b78f61e03d.
2018-11-03 18:09:06 +01:00
Leo Lamprecht
5139c1fa3f 11.5.1 2018-11-03 14:03:59 +01:00
Nathan Rajlich
b78f61e03d Add support for top-level "sh" auth 2018-11-03 14:03:40 +01:00
Leo Lamprecht
42253cdb53 11.5.0 2018-11-02 21:48:39 +01:00
Arunoda Susiripala
e4bcb809f3 Added metadata support for now inspect (#1634) 2018-11-02 21:26:53 +01:00
Arunoda Susiripala
3d2edff0d3 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:15:06 +01:00
Leo Lamprecht
f93538cf1e 11.4.6 2018-09-23 17:40:59 +02:00
Evil Rabbit
69d5c480a1 Update repo banner 2018-09-23 17:32:52 +02:00
Mark
550ce4ea2a Suppress the warning of a dependency based on an expression (#1588) 2018-09-20 16:01:51 +02:00
Leo Lamprecht
57aa4dbce4 11.4.5 2018-09-18 23:43:18 +02:00
Javi Velasco
16b351de2e Change copy for finish cert message (#1590) 2018-09-18 23:08:06 +02:00
Leo Lamprecht
badd37e150 11.4.4 2018-09-14 20:57:08 +02:00
Javi Velasco
60de863a2c Bring back now certs add (#1583) 2018-09-14 20:44:05 +02:00
Leo Lamprecht
6272e1fba3 11.4.3 2018-09-14 20:05:49 +02:00
Nathan Rajlich
d717381df4 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:52:16 +02:00
Nathan Rajlich
3fa28867bd Add "all" pseudo-DC to the constants mapping (#1581) 2018-09-12 23:52:12 +02:00
Nathan Rajlich
e1058f0ab3 Add now inspect to --help (#1578) 2018-09-12 23:52:07 +02:00
Leo Lamprecht
aa2913ea07 11.4.2 2018-09-11 18:42:57 +02:00
Matheus Fernandes
2f07212e20 Added new iad1 data center (#1575) 2018-09-11 18:34:59 +02:00
Nathan Rajlich
43eeaa1abf Add now whoami to --help (#1573) 2018-09-10 19:10:45 +02:00
Cygnusfear
164ae1fac1 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:08:49 +02:00
Javi Velasco
6123df568c 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-06 20:58:52 +02:00
Javi Velasco
705cb5fed3 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-06 20:58:45 +02:00
Zeke Sikelianos
c5ce183705 Use consistent wording in usage (#1541) 2018-09-06 20:58:25 +02:00
Nathan Rajlich
2cf750b309 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:58:21 +02:00
Jaga Santagostino
ac85a4f313 Add changelog link when new version is available (#1530)
* add changelog link if new version is available

* Linked directly
2018-09-06 20:47:21 +02:00
Jarmo Isotalo
76904d1d13 Prefer URL over deployment ID as the ID not shown in now ls (#1554) 2018-09-06 20:40:30 +02:00
Leo Lamprecht
bb110697a3 11.4.1 2018-09-01 13:05:43 +02:00
Olli Vanhoja
2d2f671681 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-09-01 12:20:06 +02:00
timothyis
ff7f6c5a19 11.4.0 2018-08-25 16:30:47 +01:00
Timothy
e03d036131 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 16:29:22 +01:00
Javi Velasco
5bb5f18b7e 11.3.13 2018-08-24 02:42:31 +02:00
Javi Velasco
33b9c6b03c Pass domain to verify insted of alias when verifying on alias (#1548) 2018-08-24 02:42:00 +02:00
Javi Velasco
11e03c331a 11.3.12 2018-08-20 20:34:44 +02:00
Javi Velasco
417901d048 Return scaling validation errors on alias (#1538)
* Return scaling errors on alias

* Join pattern match error in one expression
2018-08-20 20:33:50 +02:00
Javi Velasco
fc7b267ccf Fix updating scale (#1536) 2018-08-20 20:33:50 +02:00
Javi Velasco
5c78a80923 11.3.11 2018-08-19 18:27:40 +02:00
Javi Velasco
8f365cdd66 Try to verify against domain name instead of alias (#1534) 2018-08-19 18:27:10 +02:00
Leo Lamprecht
bff8c8d549 11.3.10 2018-08-14 12:30:44 +02:00
Arunoda Susiripala
e189ab86be Remove @zeit/schemas (#1507)
We no longer use it inside this repository.
2018-08-13 19:28:16 +02:00
Leo Lamprecht
1563cc9b4f 11.3.9 2018-08-09 12:33:29 +02:00
Luciano Pellacani Franca
ec09c16e0a fixing typo (#1509) 2018-08-09 12:33:21 +02:00
Leo Lamprecht
12d3a2057b Point Spectrum badge to correct location (#1516) 2018-08-09 12:33:17 +02:00
Sean
fb7e0b9fb6 Less cryptic invalid alias message (#1506)
* Less cryptic invalid alias message

* URL -> hostname
2018-08-09 12:22:23 +02:00
Pranay Prakash
6d32834716 11.3.8 2018-08-04 03:24:57 +00:00
Pranay Prakash
5121541af3 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-04 03:24:45 +00:00
Leo Lamprecht
40514cd51c 11.3.7 2018-08-03 22:39:19 +02:00
Olli Vanhoja
24e302ac06 Show selected session affinity when inspecting a deployment (#1489) 2018-08-03 08:14:51 +02:00
yairhaimo
8d3095ecf3 Include correct help command in now domains (#1492) 2018-08-03 08:14:46 +02:00
Leo Lamprecht
563b16e180 11.3.6 2018-08-03 08:03:40 +02:00
Pranay Prakash
47a646f5f1 Retry 412 errors (#1494)
* retry on 412

* add comment for returnify and exit when the iterator ends
2018-08-02 10:59:03 +02:00
Pranay Prakash
1d2dfcd686 poll every 5s (#1496) 2018-08-02 10:58:58 +02:00
Leo Lamprecht
dcb2508a0d 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:32:12 +02:00
Aria Malkani
2bb4c2e467 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:57:03 +02:00
Leo Lamprecht
790a7c577e 11.3.5 2018-07-31 10:39:08 +02:00
Leo Lamprecht
4d29f1a848 Bumped configuration schemas to the latest version (#1488) 2018-07-31 10:28:05 +02:00
Leo Lamprecht
1a19e1df42 11.3.4 2018-07-31 09:13:21 +02:00
Robin Millette
be5ba54a3f Updated link about authentication file (#1483)
* Fix link to config help

* Update get-default-auth-cfg.js
2018-07-30 13:37:32 +02:00
Robin Millette
4eaa10f104 Updated link about global configuration file (#1482)
* Fix link to config help

* Update get-default-cfg.js
2018-07-30 13:37:26 +02:00
Leo Lamprecht
6001899745 Added schema for static header configuration (#1486)
* Added schema for static header configuration

* Bumped yet again
2018-07-30 13:24:53 +02:00
Pranay Prakash
87e2339b26 11.3.3 2018-07-29 22:30:48 +00:00
Pranay Prakash
c1659eae06 Don't downscale previous slot deployment on alias (#1485)
* don't downscale

* use /now/v4/deployments/:id
2018-07-29 22:29:10 +00:00
Leo Lamprecht
edc397209c 11.3.2 2018-07-27 10:20:29 +02:00
Leo Lamprecht
975def8281 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:50:24 +02:00
Leo Lamprecht
d910135e84 11.3.1 2018-07-22 02:01:19 +02:00
Leo Lamprecht
186d1e452a Fixed integration tests (#1476) 2018-07-22 01:55:32 +02:00
Leo Lamprecht
68820cb76a 11.3.0 2018-07-19 20:00:37 +02:00
Pranay Prakash
2c725b0360 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-19 20:00:17 +02:00
Nathan Rajlich
cb525d368d 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 20:00:04 +02:00
Leo Lamprecht
a62a60b5e6 11.2.10 2018-07-17 09:57:40 +02:00
Arunoda Susiripala
d4382007d6 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:50:02 +02:00
Nathan Rajlich
d27963dd32 Remove shallow deployment verification (#1474)
Remove shallow deployment verification
2018-07-17 09:49:47 +02:00
Igor Klopov
a8839d1904 retry createDeploy if files are missing. addresses #1463 (#1465) 2018-07-16 16:47:09 +03:00
Leo Lamprecht
a7283efe8e 11.2.9 2018-07-11 15:46:03 +02:00
Javi Velasco
c46e70ba8c Control can't solve challenge errors (#1458) 2018-07-11 15:38:32 +02:00
Javi Velasco
72e0ec6af7 Check domain after adding (#1455)
* Check domain info after adding it

* Add message spiner to show while adding a domain
2018-07-10 19:29:49 +02:00
Leo Lamprecht
8873c3fe28 Brought stable dependencies in sync with canary (#1453) 2018-07-10 12:35:37 +02:00
Javi Velasco
8c4d54e50b 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:26:35 +02:00
Nathan Rajlich
be926ae491 Remove legacy atlas logic (#1451)
* Remove legacy `atlas` logic

No longer used for anything.

* Remove another `atlas`
2018-07-10 12:26:30 +02:00
Javi Velasco
6547bb709e 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 12:26:27 +02:00
Javi Velasco
c9e88b6ca4 Add retryAfter info to rate limit errors (#1442) 2018-07-10 12:26:22 +02:00
Nathan Rajlich
a94136c3a7 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 12:26:17 +02:00
Javi Velasco
3672f3e925 11.2.8 2018-07-09 13:11:43 +02:00
Javi Velasco
9ccea637ab Fix typo when checking NS during setup domain (#1450) 2018-07-09 13:07:09 +02:00
Arunoda Susiripala
8b2efb6367 11.2.7 2018-07-09 10:09:32 +05:30
Matheus Fernandes
a5e3f0d65a 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:49:20 -07:00
Leo Lamprecht
cd5ca57ca3 11.2.6 2018-07-06 10:20:57 +02:00
Nathan Rajlich
fd59680b8e Update @zeit/schemas to v1.6.0 2018-07-06 10:20:09 +02:00
Arunoda Susiripala
24a1561ddc 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-06 10:20:01 +02:00
Javi Velasco
64ae48dc93 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-06 10:19:55 +02:00
Javi Velasco
09b366b273 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 21:23:57 +02:00
Leo Lamprecht
cfee3bfff4 11.2.5 2018-07-02 11:46:55 +02:00
Leo Lamprecht
fca499925c Fixed the tests (#1430)
* Fixed the tests

* Wrapped up
2018-07-02 11:31:50 +02:00
Javi Velasco
d379ce1011 Small fixes (#1418)
* Remove FlowFixMe in deploy command

* Show success message when creating a cert for alias based on response cns
2018-06-22 21:51:06 +02:00
Leo Lamprecht
cb87e8f21c Improved error message for schema validation (#1416)
* Bumped schema

* Improved error message for schema validation
2018-06-21 13:00:17 +02:00
Javi Velasco
d4c90da151 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-20 22:24:46 +02:00
Javi Velasco
722c0a8bc2 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-20 22:24:41 +02:00
Pranay Prakash
55585204b3 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-20 22:24:35 +02:00
Javi Velasco
4156f465da 11.2.4 2018-06-13 20:56:38 +02:00
Javi Velasco
90905d598b 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 20:56:10 +02:00
Leo Lamprecht
0e3f241389 11.2.3 2018-06-11 14:52:53 +02:00
Felix Yan
83abedf811 Fix a typo in unique-strings.js (#1400) 2018-06-11 10:41:46 +02:00
Igor Klopov
94128271ed test-integration: test deployment logs output (#1398) 2018-06-11 10:41:39 +02:00
Nathan Rajlich
759442edac Fix shallow verify (#1397) 2018-06-08 10:32:08 +02:00
Javi Velasco
38c90e29ad Ensure there is scale rules before trying to apply (#1389) 2018-06-07 11:21:48 +02:00
Javi Velasco
83a853054c Fixed unexpected error while aliasing (#1387) 2018-06-07 11:21:42 +02:00
Nathan Rajlich
eb51f69c8a 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-07 11:21:35 +02:00
Leo Lamprecht
835679cd0c 11.2.2 2018-06-07 11:19:13 +02:00
Leo Lamprecht
76bff85b7f Updated configuration schema (#1394) 2018-06-07 11:03:20 +02:00
Matheus Fernandes
861a193446 11.2.1 2018-06-01 16:00:51 -07:00
Igor Klopov
a4935c33b4 reuse getSafeAlias function for all callers of findAliasByAliasOrId (#1385) 2018-06-01 16:00:42 -07:00
Leo Lamprecht
aa3919f870 11.2.0 2018-06-01 10:21:05 +02:00
Javi Velasco
0e18114d6d 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 20:16:11 +02:00
Leo Lamprecht
0e5a300a14 11.1.16 2018-05-29 20:13:32 +02:00
Leo Lamprecht
95a68395b9 Bumped configuration schemas to the latest version (#1379) 2018-05-29 20:10:37 +02:00
Leo Lamprecht
6d7917c879 11.1.15 2018-05-28 13:21:52 +02:00
Leo Lamprecht
686b9aa92f Bumped configuration schemas to the latest version (#1374) 2018-05-28 13:17:11 +02:00
Pranay Prakash
381d5993e6 add @zeit/dockerignore (#1373) 2018-05-28 13:16:54 +02:00
Leo Lamprecht
8475cde41b Updated configuration schemas to the latest version (#1372) 2018-05-25 20:59:05 +02:00
Leo Lamprecht
e82c550da8 11.1.14 2018-05-25 10:37:00 +02:00
Pranay Prakash
baa1404771 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-24 22:17:30 +02:00
Pranay Prakash
9beb114ae5 fix clipboard arg parsing (#1358) 2018-05-24 22:17:25 +02:00
Timothy
1162463777 Fix error message via #1350 (#1361) 2018-05-24 22:17:19 +02:00
Pranay Prakash
33356b3240 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-24 22:17:15 +02:00
Leo Lamprecht
3b3faa21a1 11.1.13 2018-05-23 20:49:53 +02:00
Tim Neutkens
776d89b70a 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-23 20:49:43 +02:00
Leo Lamprecht
afc2b0380a 11.1.12 2018-05-18 14:18:34 +02:00
Leo Lamprecht
e4ba6040cc Bumped update-check to the latest version (#1354) 2018-05-18 14:08:02 +02:00
Javi Velasco
7d19db4686 Update non-existing team test 2018-05-18 09:40:56 +02:00
Javi Velasco
0371874dbb Prefer HTTP challenge for regular certs 2018-05-18 09:40:50 +02:00
Pranay Prakash
6cbd61554a issue normal cert for nested subdomain (#1344) 2018-05-18 09:40:45 +02:00
Leo Lamprecht
48a490790c 11.1.11 2018-05-17 10:26:00 +02:00
Leo Lamprecht
b96b7fc3a7 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:29:54 +02:00
Tim Neutkens
dfdd002708 11.1.10 2018-05-16 18:22:22 +02:00
Javi Velasco
001c5f04b2 Fix table import (#1348) 2018-05-16 18:21:53 +02:00
Leo Lamprecht
7ef2be299d 11.1.9 2018-05-15 22:52:46 +02:00
Leo Lamprecht
9feb6ebff2 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 22:09:27 +02:00
Leo Lamprecht
12a8aa8a40 11.1.8 2018-05-15 10:18:56 +02:00
Javi Velasco
ea18c2c7ce Accept comma separated cns (#1336) 2018-05-15 10:14:25 +02:00
Igor Klopov
b721acb49e ignore keep-alive packets for now logs -f (#1331) 2018-05-15 10:14:19 +02:00
Javi Velasco
024a3d16db 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-05-15 10:14:13 +02:00
Javi Velasco
75e493332e 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-05-15 10:14:06 +02:00
Igor Klopov
ff0b772b62 handle keep-alive event in inspect command (#1326) 2018-05-15 10:13:56 +02:00
Guillermo Rauch
eb746ae0f8 Updated error message about verification timeout 2018-05-15 10:04:38 +02:00
Javi Velasco
82eefe68e2 11.1.7 2018-04-18 11:35:50 -07:00
Javi Velasco
538e1e7b9c Handle ENOENT error when deploying unexistent path (#1320)
* Handle ENOENT error when deploying unexistent path

* Show success on dedupped deployments
2018-04-18 11:35:11 -07:00
Javi Velasco
c12d2f4226 Migrate to arg@2.0.0 (#1316) 2018-04-18 11:35:11 -07:00
Javi Velasco
b4428d099b Fix double ambiguous deploy prompt (#1318) 2018-04-18 11:35:11 -07:00
Javi Velasco
0acf907f47 Fix 0 min scale (#1317) 2018-04-18 11:35:11 -07:00
Naoyuki Kanezawa
d837756200 improve image upload (#1293) 2018-04-18 11:35:11 -07:00
Javi Velasco
f54566725e 11.1.6 2018-04-17 12:10:00 -07:00
Javi Velasco
ff34e3dfb1 Fix number of instances verification (#1315) 2018-04-17 12:09:45 -07:00
Leo Lamprecht
0b7a726f08 11.1.5 2018-04-16 19:37:45 -07:00
Javi Velasco
b53aef6254 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 19:37:02 -07:00
Javi Velasco
ba4612042c Replace combine-async-generators (#1305)
* Replace combine-asyng-generators

* Ignore empty objects from events stream

* Update type for alias event
2018-04-16 19:36:55 -07:00
Javi Velasco
0d22fef2a0 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-16 19:36:49 -07:00
Leo Lamprecht
6f6ff45062 Added missing dependencies (#1303) 2018-04-16 19:36:42 -07:00
Javi Velasco
8ba2ae634f 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-16 19:36:36 -07:00
Leo Lamprecht
fc1eae21ea 11.1.4 2018-04-11 12:32:03 -07:00
Javi Velasco
454a15cb25 Remove old certs command (#1295) 2018-04-11 12:23:51 -07:00
Leo Lamprecht
84b8b85f8d 11.1.3 2018-04-11 11:53:18 -07:00
Javi Velasco
2a2a7a7bd9 Remove old alias command (#1294) 2018-04-11 11:44:03 -07:00
Leo Lamprecht
addc237f7a 11.1.2 2018-04-10 18:07:23 -07:00
Leo Lamprecht
034763218b Fixed typo in release instructions 2018-04-10 18:02:20 -07:00
Leo Lamprecht
18c6822b67 11.1.1 2018-04-10 17:24:56 -07:00
Leo Lamprecht
9ced8b7e75 Moved documentation for releasing out 2018-04-10 16:53:01 -07:00
Leo Lamprecht
67c556f2e3 Make clear how a release works exactly 2018-04-10 16:52:56 -07:00
Leo Lamprecht
cea3072f1a Improved intro and contribution section 2018-04-10 16:52:51 -07:00
Leo Lamprecht
2e09ca0286 Made sure the integration tests work as expected 2018-04-10 16:52:45 -07:00
Tim Neutkens
dd77a721d6 11.1.0 2018-04-10 15:23:06 +02:00
Javi Velasco
b44bd7c2ca Merge canary and solve conflicts 2018-04-10 06:18:47 -07:00
Tim Neutkens
26e9922016 Bring back integration tests as part of releasing 2018-04-10 14:55:51 +02:00
Tim Neutkens
e7ffddb4ee 12.0.0-canary.13 2018-04-10 14:39:41 +02:00
Tim Neutkens
22c73ff5af Temporarily disable integration tests 2018-04-10 14:38:53 +02:00
Javi Velasco
934f8b8cc3 12.0.0-canary.12 2018-04-10 05:29:04 -07:00
Javi Velasco
66c726f3ee 12.0.0-canary.11 2018-04-10 04:36:53 -07:00
Javi Velasco
a49e6640a3 Remove setup domain message 2018-04-10 04:35:20 -07:00
Javi Velasco
88b935ba4f 12.0.0-canary.10 2018-04-10 03:20:43 -07:00
Javi Velasco
98744f5bdf Remove certs by cn (#1288)
* Allow to remove certs by cn and id

* Use getCerts in certs ls command
2018-04-10 03:18:51 -07:00
Javi Velasco
0e0855370e Certificates revamped (#1282)
* Certificates revamped

* Change copy of certs loading msg

* Be more specific when we generate a certificate from alias

* Better messages when creating certs

* Ensure TTY works for alias

* Check if DNS records are configured instead of checking resolved server

* Fallback to a normal cert when the DNS settings are not valid for wildcard

* Be explicit setting alias.zeit.co DNS records

* Check DNS records to request a certificate that will success for zeit.world
2018-04-10 01:51:03 -07:00
Leo Lamprecht
26b11b8939 11.0.7 2018-04-09 17:57:27 -07:00
Leo Lamprecht
e1f8c752c8 Don't render update message on non-TTY (#1281) 2018-04-09 17:42:31 -07:00
Leo Lamprecht
b68c631a5a 12.0.0-canary.9 2018-04-09 17:08:12 -07:00
Leo Lamprecht
91b691ba0a Don't render update message on non-TTY (#1281) 2018-04-09 17:07:41 -07:00
Leo Lamprecht
4aec88d4af 12.0.0-canary.8 2018-04-09 16:14:00 -07:00
Javi Velasco
9b0bdc3f13 Find instances count when listing an alias with deployment ls (#1280) 2018-04-09 16:03:29 -07:00
Leo Lamprecht
7f2e14061d 12.0.0-canary.7 2018-04-08 22:04:48 -07:00
Javi Velasco
7c96f2d08c Refactored now alias to be more bullet-proof (#1267) 2018-04-08 22:03:45 -07:00
Leo Lamprecht
e1c5af561d Replaced the update checker (#1275)
* Replaced update checker

* Moved to devDeps

* Removed prod dep entry
2018-04-08 21:07:58 -07:00
Leo Lamprecht
594c715943 12.0.0-canary.6 2018-04-08 20:35:34 -07:00
Leo Lamprecht
6ca2931de8 Replaced the update checker (#1275)
* Replaced update checker

* Moved to devDeps

* Removed prod dep entry
2018-04-08 20:33:29 -07:00
Leo Lamprecht
01363a5ef9 Re-added dependencies required for download (#1259) 2018-04-06 10:47:45 -07:00
Javi Velasco
0f1471fee4 Remove unused dependencies (#1258) 2018-04-06 10:47:39 -07:00
Sreeram Jayan
0e7ce49ad4 Validate now.json before parsing it (#1239) 2018-04-06 10:47:34 -07:00
Leo Lamprecht
1b9ece5137 11.0.6 2018-04-05 13:30:54 -07:00
Leo Lamprecht
27a7490585 Made sure now alias accepts URLs as targets (#1266) 2018-04-05 13:25:49 -07:00
Leo Lamprecht
885f5a8225 12.0.0-canary.5 2018-04-05 13:25:07 -07:00
Leo Lamprecht
6ba3e8d035 Made sure now alias accepts URLs as targets (#1266) 2018-04-05 13:23:25 -07:00
Leo Lamprecht
babe6f1a09 11.0.5 2018-04-05 00:24:44 -07:00
Leo Lamprecht
482754fc00 Make now ls work as expected (#1263)
* Made domains as app names work again

* Made it work as expected
2018-04-05 00:23:53 -07:00
Leo Lamprecht
a98539b1d3 12.0.0-canary.4 2018-04-05 00:16:49 -07:00
Leo Lamprecht
3224ce7e58 Make now ls work as expected (#1263)
* Made domains as app names work again

* Made it work as expected
2018-04-05 00:15:18 -07:00
Leo Lamprecht
9b325e55dd 11.0.4 2018-04-04 18:47:22 -07:00
Leo Lamprecht
105d68681a Ensure listing single deployments work (#1260)
* Only try to find more deployments if app name defined

* Made note util correct

* Added support for listing single deployments

* Reverted unnecessary change
2018-04-04 18:46:52 -07:00
Javi Velasco
d7a852af8b Corrected downscaling mechanism (#1256)
* Prevent downscaling the current deployment

* Only downscale a deployment after aliasing if it has no other alias
2018-04-04 18:46:43 -07:00
Leo Lamprecht
469b1e8989 Improved integration tests (#1257)
* Assert exit code properly

* Don't strip ANSI stuff
2018-04-04 18:46:36 -07:00
Javi Velasco
2c53007070 Enable ES6 modules (#1255) 2018-04-04 18:46:30 -07:00
Leo Lamprecht
86f9e8bb2f 12.0.0-canary.3 2018-04-04 18:37:35 -07:00
Leo Lamprecht
abdb261717 Ensure listing single deployments work (#1260)
* Only try to find more deployments if app name defined

* Made note util correct

* Added support for listing single deployments

* Reverted unnecessary change
2018-04-04 18:32:03 -07:00
Leo Lamprecht
f9cca94951 Re-added dependencies required for download (#1259) 2018-04-04 17:15:41 -07:00
Javi Velasco
029e5f8e0a Remove unused dependencies (#1258) 2018-04-04 15:49:53 -07:00
Javi Velasco
d278d517df Corrected downscaling mechanism (#1256)
* Prevent downscaling the current deployment

* Only downscale a deployment after aliasing if it has no other alias
2018-04-04 15:07:22 -07:00
Leo Lamprecht
41046531d5 Improved integration tests (#1257)
* Assert exit code properly

* Don't strip ANSI stuff
2018-04-04 14:50:00 -07:00
Sreeram Jayan
d039fb0bbe Validate now.json before parsing it (#1239) 2018-04-04 12:29:13 -07:00
Javi Velasco
baff437e69 Enable ES6 modules (#1255) 2018-04-04 12:22:37 -07:00
Leo Lamprecht
0b895845a1 11.0.3 2018-04-04 12:07:22 -07:00
Igor Klopov
d47fd0e10a Fixed static deployments on the OSS plan (#1253) 2018-04-04 12:07:14 -07:00
Leo Lamprecht
fc46bc077f 12.0.0-canary.2 2018-04-04 11:58:48 -07:00
Igor Klopov
16b7ff9a25 Fixed static deployments on the OSS plan (#1253) 2018-04-04 11:50:15 -07:00
Leo Lamprecht
ccb79a1096 11.0.2 2018-04-04 11:13:50 -07:00
Javi Velasco
fd557ac9fe Only write URL to stdout (#1245)
* Only write URL to stdout

* Update wait.js
2018-04-04 11:11:21 -07:00
Leo Lamprecht
f643f6c28a 12.0.0-canary.1 2018-04-04 11:07:34 -07:00
Javi Velasco
362fc0b3d8 Only write URL to stdout (#1245)
* Only write URL to stdout

* Update wait.js
2018-04-04 10:59:27 -07:00
Matheus Fernandes
3329bbf053 11.0.0-canary.37 2018-04-03 23:20:08 -03:00
Matheus Fernandes
3357a5de77 11.0.1 2018-04-03 23:17:49 -03:00
Javi Velasco
ad780bdcd8 Remove DNS extra check in alias for verified domains (#1242) 2018-04-03 23:08:41 -03:00
Javi Velasco
d1c3ac5015 Ensure deployment scale exists before the check on deploy (#1241) 2018-04-03 23:08:36 -03:00
Zander Martineau
91409f44b5 fix spelling (#1240) 2018-04-03 23:08:31 -03:00
Javi Velasco
f6eb444841 Bugfix: return array of targets of one item when config alias is a string (#1238) 2018-04-03 23:08:27 -03:00
Javi Velasco
f4cc42e25c Remove version trailin space (#1236) 2018-04-03 23:08:11 -03:00
Javi Velasco
570c6849ca Fallback appName to package.json for alias (#1235) 2018-04-03 23:07:56 -03:00
Javi Velasco
cc5d396758 Don't try to scale static deployments (#1232) 2018-04-03 23:07:42 -03:00
Javi Velasco
281c236945 Remove DNS extra check in alias for verified domains (#1242) 2018-04-03 17:49:29 -07:00
Javi Velasco
b90cfde7c0 Ensure deployment scale exists before the check on deploy (#1241) 2018-04-03 15:42:02 -07:00
Zander Martineau
c46d3dbd10 fix spelling (#1240) 2018-04-04 00:05:56 +02:00
Javi Velasco
d3fed8a717 Bugfix: return array of targets of one item when config alias is a string (#1238) 2018-04-03 14:38:54 -07:00
Javi Velasco
7cc55b6cb1 Remove version trailin space (#1236) 2018-04-03 13:54:03 -07:00
Javi Velasco
9847355983 11.0.0-canary.36 2018-04-03 13:41:50 -07:00
Javi Velasco
267b4c904c Fallback appName to package.json for alias (#1235) 2018-04-03 13:40:00 -07:00
Javi Velasco
859790da87 Don't try to scale static deployments (#1232) 2018-04-03 13:39:49 -07:00
Leo Lamprecht
214da9a221 11.0.0-canary.35 2018-04-03 09:29:44 -07:00
Leo Lamprecht
4579919077 Properly handle event polling (#1228) 2018-04-03 09:29:33 -07:00
Leo Lamprecht
d2509e45db 11.0.0 2018-04-03 09:13:21 -07:00
Leo Lamprecht
793e1b11da Properly handle event polling (#1228) 2018-04-03 09:09:17 -07:00
Guillermo Rauch
0e9a21a263 Support for globally distributed deployments (#1205)
* Introduce v3 deployment scaling API

* Less retries on setScale()

* now scale cmd v3

* Deployment id fixes

* bump `ecmaVersion` we lint against, to consider object rest spread

* move EPIPE workaround to the main file

* uniform exiting approach

* clean up list command to avoid globals, be simpler to read

* add ability to supply a custom API version to `now.list()` helper

* upgrade babel toolchain

* introduce `arg`, which will incrementally replace `mri`

* global args accepted by all subcommands

* update lock

* fix `>` to be red when rendering errors

* use new output helpers by @tootallnate

* make object spread work

* bump flow webpack plugin

* lock

* revert to ava 0.25.x

* deprecate `now ls help` since an app could be named `help`

* validate number of arguments

* Fixed integration tests to match downgraded AVA

* Trimmed newline

* WIP

* whitespace fix

* add source map support by @timneutkens

* fix source maps paths

* remove sort-deployments util. it only considers `package.json`

* created -> age for consistency

* remove sorting what wasn't working well

* multiple improvements and simplifications

* improve rendering of urls, fix filtering by app

* only attempt to fetch instances if we have a count > 0

* better check for no deployments

* add instance lists if --all is supplied

* prevent the `.map` file from being included by pkg

* Store artifacts in Circle CI

* adapt INITIALIZING display by suggestion of @tootallnate

* Nothing to return

* now scale: Args parsing and remove ls

* various code improvements, error link for deprecation of `now scale ls`

* improve help

* make error more specific to deployment

* use new error output utilities for `now deploy`

* make some requires conditional

* default command style fix

* add reusable dc validation and normalization utilities

* start doing dc / region validation in scale

* refactor deploy to use reusable dc / region utils

* add slug support for warn util

* add success helper

* improve `scale` command

* add `responseErrorMessage` helper

* add `now.fetch()` helper

* remove console.log

* tweak output

* draft of verification step

* better errors

* implement (customizable) verification timeout

* bump now-host api to v3

* finish verification

* improve verification and sanitization

* improve copy

* fix ctrl+c during scale

* fix max scale in the absense of max

* improved rules saving

* fix listing the context you're running `now list` under

* add context name to list commands from slots

* improve --no-verify

* add 'elapsed' utility to print out the elapsed time nicely

* add per-dc timers

* improve debug helper to save date, improve time helper to log eagerly

* log every request, automatically

* tweak

* general tweaks to `now deploy`

* pass additional now config fields

* refactor `now rm`

* begin `inspect` command

* bump fetch-h2

* nearly complete new inspect command

* add `(dev)` to --version while in development

* fix 404 error if app is not matched

* improve scaling

* pass event types to the events endpoint

* fix file uploads

* fix passing a deployment hostname with trailing `/`

* fetch events only for non-static

* include uid in inspect

* finish up events

* reduce one indent by recommendation of @leo

* fix debugging for `now ls`

* Always return and exit at top-level in now.js

* improved scale message

* more elegant way of exiting, allowing for resource cleanup & faster

* flowify

* fix strange error which happens when orderly cleanup is done

* flow

* flow fix

* invoke now.close()

* improve list indentation

* refactor alias

* exit clean

* improve fallthrough entry in path alias

* make scale exit properly

* fix closing agent for inspection

* add type of deployment to ls

* better error handling of 403

* improve list style

* various algorithmic improvements

* Certificates refactor to consume the new API (#1210)

* Adapt cert command to the new api

* Use the new certs api for cert command

* Console log certs table and point to the right endpoint

* Remove unused certs client file

* Refactor certs commands

* Fix access to args

* Always close client

* Refactor alias (#1216)

* remove unnecessary file

* reads events from /deployment/:id/events endpoint (#1219)

* add polling (#1220)

* add polling

* hack to prevent partial json to be unluckily parsed in _flush

* cleanupAndResolveCalled to prevent running twice

* call onOpen only of going to 'log'. also call from cleanup

* callOnOpenOnce, don't reject on stream error, polling to finish

* fix eraseLines, make cleanup routine reject

* remove build-logger.js

* restored printEvent from deleted build-logger.js

* print locations of instance events

* bump api versions

* Switch now logs to events endpoint (#1223)

* move eraseLines to onRetry. show error in onRetry

* move printEvents to 'sh/util/events.js'

* use printEvents in `now logs` command

* pass printEvent to events.js

* make both follow and non-follow modes work

* remove socket.io

* improve logs command

* clarify team context

* Refactor alias

* Use ellapsed util in stamp

* use v3

* Refactor alias (#1224)

* Refactor alias

* Use ellapsed util in stamp

* Improvements

* Fix unit tests

* Ensure body exists when copying error attrs

* Add hook to close socket and wait message on process exit

* More retries when verifying the DNS records in alias

* Remove nowExit event listener on close

* Add remaning DCs message right away on alias

* Consistent timestamp when creating a deployment + scale dcs

* Ignore flow error

* Remove not needed now.close from alias

* Remove not needed now.close from inspect

* Bugfix: bind context to close socket handler

* Better error handling for scale command

* Now logs limit (#1226)

* restored -n LIMIT cli arg

* show date in format usabe for since and until

* pass direction and limit to endpoint

* implement follow mode after backwards slice

* add query, fix linefeeds, strip term commands

* implement head argument

* better logs default

* logs: fix -o raw mode, fix all mode

* Add verification for deploy

* Run integration tests using random email address

* Fix flow errors

* Fix wrong scale check

* Finish deploy on state READY

* Correct URL parsing

* Bumped Node.js to the latest version

* Output node version

* fix url display

* Returned URLs

* Improve messages in scale

* Clear URLs

* Strip ANSI codes

* Better logging messages for deploy

* Print ls to console instead of stderr

* Add create certificate certificate and ensure verification is done for a domain

* Write success in alias to stdout

* clearURL in stdout for alias test

* Update scale integration test

* Use stdout for scale success message

* Write alias rm response to stdout

* Refactor alias rm to use fetch from now client

* Fix tests
2018-04-03 08:14:41 -07:00
Javi Velasco
c37d741cf2 Add expectedPrice check (#1215)
* Add expectedPrice check

* Add expectedPrice to domain buy method
2018-04-03 08:14:34 -07:00
Leo Lamprecht
893fbd899e 11.0.0-canary.34 2018-04-03 05:36:58 -07:00
Guillermo Rauch
6d14a1bbd4 Support for globally distributed deployments (#1205)
* Introduce v3 deployment scaling API

* Less retries on setScale()

* now scale cmd v3

* Deployment id fixes

* bump `ecmaVersion` we lint against, to consider object rest spread

* move EPIPE workaround to the main file

* uniform exiting approach

* clean up list command to avoid globals, be simpler to read

* add ability to supply a custom API version to `now.list()` helper

* upgrade babel toolchain

* introduce `arg`, which will incrementally replace `mri`

* global args accepted by all subcommands

* update lock

* fix `>` to be red when rendering errors

* use new output helpers by @tootallnate

* make object spread work

* bump flow webpack plugin

* lock

* revert to ava 0.25.x

* deprecate `now ls help` since an app could be named `help`

* validate number of arguments

* Fixed integration tests to match downgraded AVA

* Trimmed newline

* WIP

* whitespace fix

* add source map support by @timneutkens

* fix source maps paths

* remove sort-deployments util. it only considers `package.json`

* created -> age for consistency

* remove sorting what wasn't working well

* multiple improvements and simplifications

* improve rendering of urls, fix filtering by app

* only attempt to fetch instances if we have a count > 0

* better check for no deployments

* add instance lists if --all is supplied

* prevent the `.map` file from being included by pkg

* Store artifacts in Circle CI

* adapt INITIALIZING display by suggestion of @tootallnate

* Nothing to return

* now scale: Args parsing and remove ls

* various code improvements, error link for deprecation of `now scale ls`

* improve help

* make error more specific to deployment

* use new error output utilities for `now deploy`

* make some requires conditional

* default command style fix

* add reusable dc validation and normalization utilities

* start doing dc / region validation in scale

* refactor deploy to use reusable dc / region utils

* add slug support for warn util

* add success helper

* improve `scale` command

* add `responseErrorMessage` helper

* add `now.fetch()` helper

* remove console.log

* tweak output

* draft of verification step

* better errors

* implement (customizable) verification timeout

* bump now-host api to v3

* finish verification

* improve verification and sanitization

* improve copy

* fix ctrl+c during scale

* fix max scale in the absense of max

* improved rules saving

* fix listing the context you're running `now list` under

* add context name to list commands from slots

* improve --no-verify

* add 'elapsed' utility to print out the elapsed time nicely

* add per-dc timers

* improve debug helper to save date, improve time helper to log eagerly

* log every request, automatically

* tweak

* general tweaks to `now deploy`

* pass additional now config fields

* refactor `now rm`

* begin `inspect` command

* bump fetch-h2

* nearly complete new inspect command

* add `(dev)` to --version while in development

* fix 404 error if app is not matched

* improve scaling

* pass event types to the events endpoint

* fix file uploads

* fix passing a deployment hostname with trailing `/`

* fetch events only for non-static

* include uid in inspect

* finish up events

* reduce one indent by recommendation of @leo

* fix debugging for `now ls`

* Always return and exit at top-level in now.js

* improved scale message

* more elegant way of exiting, allowing for resource cleanup & faster

* flowify

* fix strange error which happens when orderly cleanup is done

* flow

* flow fix

* invoke now.close()

* improve list indentation

* refactor alias

* exit clean

* improve fallthrough entry in path alias

* make scale exit properly

* fix closing agent for inspection

* add type of deployment to ls

* better error handling of 403

* improve list style

* various algorithmic improvements

* Certificates refactor to consume the new API (#1210)

* Adapt cert command to the new api

* Use the new certs api for cert command

* Console log certs table and point to the right endpoint

* Remove unused certs client file

* Refactor certs commands

* Fix access to args

* Always close client

* Refactor alias (#1216)

* remove unnecessary file

* reads events from /deployment/:id/events endpoint (#1219)

* add polling (#1220)

* add polling

* hack to prevent partial json to be unluckily parsed in _flush

* cleanupAndResolveCalled to prevent running twice

* call onOpen only of going to 'log'. also call from cleanup

* callOnOpenOnce, don't reject on stream error, polling to finish

* fix eraseLines, make cleanup routine reject

* remove build-logger.js

* restored printEvent from deleted build-logger.js

* print locations of instance events

* bump api versions

* Switch now logs to events endpoint (#1223)

* move eraseLines to onRetry. show error in onRetry

* move printEvents to 'sh/util/events.js'

* use printEvents in `now logs` command

* pass printEvent to events.js

* make both follow and non-follow modes work

* remove socket.io

* improve logs command

* clarify team context

* Refactor alias

* Use ellapsed util in stamp

* use v3

* Refactor alias (#1224)

* Refactor alias

* Use ellapsed util in stamp

* Improvements

* Fix unit tests

* Ensure body exists when copying error attrs

* Add hook to close socket and wait message on process exit

* More retries when verifying the DNS records in alias

* Remove nowExit event listener on close

* Add remaning DCs message right away on alias

* Consistent timestamp when creating a deployment + scale dcs

* Ignore flow error

* Remove not needed now.close from alias

* Remove not needed now.close from inspect

* Bugfix: bind context to close socket handler

* Better error handling for scale command

* Now logs limit (#1226)

* restored -n LIMIT cli arg

* show date in format usabe for since and until

* pass direction and limit to endpoint

* implement follow mode after backwards slice

* add query, fix linefeeds, strip term commands

* implement head argument

* better logs default

* logs: fix -o raw mode, fix all mode

* Add verification for deploy

* Run integration tests using random email address

* Fix flow errors

* Fix wrong scale check

* Finish deploy on state READY

* Correct URL parsing

* Bumped Node.js to the latest version

* Output node version

* fix url display

* Returned URLs

* Improve messages in scale

* Clear URLs

* Strip ANSI codes

* Better logging messages for deploy

* Print ls to console instead of stderr

* Add create certificate certificate and ensure verification is done for a domain

* Write success in alias to stdout

* clearURL in stdout for alias test

* Update scale integration test

* Use stdout for scale success message

* Write alias rm response to stdout

* Refactor alias rm to use fetch from now client

* Fix tests
2018-04-03 05:32:53 -07:00
Javi Velasco
c70d86c738 Add expectedPrice check (#1215)
* Add expectedPrice check

* Add expectedPrice to domain buy method
2018-03-29 10:58:57 -07:00
Leo Lamprecht
ab8f7e21a3 Run scheduled tests on Linux and unscheduled on macOS (#1213) 2018-03-27 18:18:36 -07:00
Leo Lamprecht
b7f56a6b9d Run scheduled tests on Linux and unscheduled on macOS (#1213) 2018-03-27 18:16:18 -07:00
Leo Lamprecht
2212130beb 10.2.2 2018-03-27 17:01:36 -07:00
Leo Lamprecht
294171ed37 Run integration tests on Linux (#1212) 2018-03-27 16:55:16 -07:00
Bart Deslagmulder
c025aa7596 Fix typos (#1208) 2018-03-27 16:55:10 -07:00
Guillermo Rauch
73035bd549 Explain how to run it locally 2018-03-27 16:55:04 -07:00
Leo Lamprecht
3a3fdef1a8 11.0.0-canary.33 2018-03-27 16:42:16 -07:00
Leo Lamprecht
7602daaaef Run integration tests on Linux (#1212) 2018-03-27 16:41:10 -07:00
Guillermo Rauch
6d5b6c6e73 Explain how to run it locally 2018-03-27 16:25:35 -07:00
Bart Deslagmulder
f44e177e43 Fix typos (#1208) 2018-03-22 14:03:08 -07:00
Leo Lamprecht
137552beed 10.2.1 2018-03-16 20:04:48 -07:00
Leo Lamprecht
8bca751e8e Added scheduled CI tests (#1199)
* Added scheduled CI tests

* Run every hour
2018-03-16 19:57:00 -07:00
Nathan Rajlich
b26228ebde Gracefully handle no scale object being returned (#1200)
* Gracefully handle no `scale` object being returned

* Fixed tests
2018-03-16 19:56:56 -07:00
Leo Lamprecht
0e43f85176 11.0.0-canary.32 2018-03-16 19:56:19 -07:00
Leo Lamprecht
11e645f334 Added scheduled CI tests (#1199)
* Added scheduled CI tests

* Run every hour
2018-03-16 19:49:49 -07:00
Nathan Rajlich
10eb83207b Gracefully handle no scale object being returned (#1200)
* Gracefully handle no `scale` object being returned

* Fixed tests
2018-03-16 19:42:26 -07:00
Leo Lamprecht
3a16b092f2 10.2.0 2018-03-16 18:44:45 -07:00
Nathan Rajlich
889d30322f Log the DC(s) that the deployment has been scaled to (#1197)
* Log the DC(s) that the deployment has been scaled to

* Fix Flow error
2018-03-16 18:37:37 -07:00
Leo Lamprecht
ed66a4b7f0 Pinned CI images (#1195)
* Pinned CI images

* Ignored error file

* Switched to different version
2018-03-16 18:37:29 -07:00
Guillermo Rauch
7b31ea29a1 Note about canary development 2018-03-16 18:37:12 -07:00
Guillermo Rauch
70ef3433a8 Update readme.md 2018-03-16 18:37:02 -07:00
Leo Lamprecht
efd3d97305 11.0.0-canary.31 2018-03-16 18:31:34 -07:00
Nathan Rajlich
05ba34f602 Log the DC(s) that the deployment has been scaled to (#1197)
* Log the DC(s) that the deployment has been scaled to

* Fix Flow error
2018-03-16 18:27:39 -07:00
Leo Lamprecht
cff85f78af Pinned CI images (#1195)
* Pinned CI images

* Ignored error file

* Switched to different version
2018-03-16 18:24:19 -07:00
Guillermo Rauch
cb015d8219 Note about canary development 2018-03-16 18:04:13 -07:00
Guillermo Rauch
50bd83abd8 Update readme.md 2018-03-16 18:01:18 -07:00
Volker Rose
ce7d482830 Fix waiting message appearance on now ls (#1192)
* Added debounced waiting message to `list` command

Refs #1167, #1166

* Integrated debouncing directly into wait function

Refs #1167, #1166

* Moved debouncing in `wait` module directly to `wait` function

Refs #1167, #1166

* Added test for `wait`function

Refs #1167, #1166

* Removes oboslete logging from `wait` utitlity

* Removed semis

* Removed semis

* Make sense of it

* Bumped lockfile

* Moved stopping of spinner right before first output within `now ls`
2018-03-16 14:06:27 -07:00
Naoyuki Kanezawa
6e48216234 Added support for multiple regions (#1191) 2018-03-16 14:06:21 -07:00
Volker Rose
05299eefb0 Added debounced waiting message to now ls (#1178)
* Added debounced waiting message to `list` command

Refs #1167, #1166

* Integrated debouncing directly into wait function

Refs #1167, #1166

* Moved debouncing in `wait` module directly to `wait` function

Refs #1167, #1166

* Added test for `wait`function

Refs #1167, #1166

* Removes oboslete logging from `wait` utitlity

* Removed semis

* Removed semis

* Make sense of it

* Bumped lockfile
2018-03-16 14:05:45 -07:00
Leo Lamprecht
a360a0b3f1 11.0.0-canary.30 2018-03-15 16:32:29 -07:00
Naoyuki Kanezawa
d819f5dc93 Added support for multiple regions (#1191) 2018-03-15 16:31:19 -07:00
Volker Rose
08508d1555 Fix waiting message appearance on now ls (#1192)
* Added debounced waiting message to `list` command

Refs #1167, #1166

* Integrated debouncing directly into wait function

Refs #1167, #1166

* Moved debouncing in `wait` module directly to `wait` function

Refs #1167, #1166

* Added test for `wait`function

Refs #1167, #1166

* Removes oboslete logging from `wait` utitlity

* Removed semis

* Removed semis

* Make sense of it

* Bumped lockfile

* Moved stopping of spinner right before first output within `now ls`
2018-03-15 11:02:15 -07:00
Leo Lamprecht
4a6290bd1a 11.0.0-canary.29 2018-03-14 13:53:08 -07:00
Volker Rose
a226f6bffa Added debounced waiting message to now ls (#1178)
* Added debounced waiting message to `list` command

Refs #1167, #1166

* Integrated debouncing directly into wait function

Refs #1167, #1166

* Moved debouncing in `wait` module directly to `wait` function

Refs #1167, #1166

* Added test for `wait`function

Refs #1167, #1166

* Removes oboslete logging from `wait` utitlity

* Removed semis

* Removed semis

* Make sense of it

* Bumped lockfile
2018-03-14 13:48:21 -07:00
Leo Lamprecht
059882fdb9 10.1.6 2018-03-13 20:47:35 -07:00
Leo Lamprecht
cf079e70d2 Added Spectrum badge (#1184) 2018-03-10 20:57:34 -08:00
Leo Lamprecht
49c470d131 Show better errors messages (#1182)
* Added support for fallback error

* Better errors for uploading files

* Ensure all errors are covered

* Formatted properly

* Added a few tests

* Wrapped up tests
2018-03-10 20:57:26 -08:00
Leo Lamprecht
3df6f62af8 11.0.0-canary.27 2018-03-10 20:51:50 -08:00
Leo Lamprecht
c9966aaf84 Added Spectrum badge (#1184) 2018-03-10 20:51:32 -08:00
Leo Lamprecht
d6c63921b8 11.0.0-canary.26 2018-03-10 19:19:52 -08:00
Leo Lamprecht
8a844f1880 Show better errors messages (#1182)
* Added support for fallback error

* Better errors for uploading files

* Ensure all errors are covered

* Formatted properly

* Added a few tests

* Wrapped up tests
2018-03-10 18:26:50 -08:00
Leo Lamprecht
650efbac89 10.1.5 2018-03-08 14:17:58 -08:00
Leo Lamprecht
7b149d0eb7 New integration test suite added (#1173)
* Proper unit tests

* Made integration tests run in CI

* Added packing to integration tests

* Don't lint test fixtures

* Added missing files

* Added command for local testing

* Correct command for local testing

* Compare client version

* Separate file for helper

* Added micro fixture

* Check OSS confirmation message

* Even better

* Deploy a microservice

* Made it run

* Remove deployment properly

* Clean up everything

* Fixed linting

* Added missing fixtures

* Added missing files

* Fixed linking

* Remove only deployments created in session

* Create alias for deployment

* Wrapped up 10 test

* Try scaling the deployment directly

* Wrapped up the 15 tests

* Ensure files are actually equal

* Test docker deployments

* Made sense of all

* Remove right after

* Set redirect URL properly

* Run integration tests on macOS

* Clean up in the end

* Use existing method to clean up

* Revoke the token properly

* Check for team error

* Wrapped up 18 tests

* Try deploying a static directory

* Try running it in user directory

* Auto-generate integration tests

* Removed Yarn lockfile

* Fixed linting

* Run test only if the one before was successful

* Bumped lockfile

* Removed catching

* Removed useless dependency

* Removed line

* Don't kill app and restore config

* Test properly locally

* Fixed linting

* Fixed properly

* Comment added

* Fixed arguments
2018-03-08 14:13:08 -08:00
Leo Lamprecht
627b570aa0 11.0.0-canary.25 2018-03-08 14:12:18 -08:00
Leo Lamprecht
17c5710b55 New integration test suite added (#1173)
* Proper unit tests

* Made integration tests run in CI

* Added packing to integration tests

* Don't lint test fixtures

* Added missing files

* Added command for local testing

* Correct command for local testing

* Compare client version

* Separate file for helper

* Added micro fixture

* Check OSS confirmation message

* Even better

* Deploy a microservice

* Made it run

* Remove deployment properly

* Clean up everything

* Fixed linting

* Added missing fixtures

* Added missing files

* Fixed linking

* Remove only deployments created in session

* Create alias for deployment

* Wrapped up 10 test

* Try scaling the deployment directly

* Wrapped up the 15 tests

* Ensure files are actually equal

* Test docker deployments

* Made sense of all

* Remove right after

* Set redirect URL properly

* Run integration tests on macOS

* Clean up in the end

* Use existing method to clean up

* Revoke the token properly

* Check for team error

* Wrapped up 18 tests

* Try deploying a static directory

* Try running it in user directory

* Auto-generate integration tests

* Removed Yarn lockfile

* Fixed linting

* Run test only if the one before was successful

* Bumped lockfile

* Removed catching

* Removed useless dependency

* Removed line

* Don't kill app and restore config

* Test properly locally

* Fixed linting

* Fixed properly

* Comment added

* Fixed arguments
2018-03-08 13:59:01 -08:00
Leo Lamprecht
86e19e46f5 10.1.4 2018-03-02 15:35:54 -08:00
Sreeram Jayan
d57d90381c Fixed duplicate deployment type prompt (#1168)
* 1163:Fix duplicate deployment type prompt

* Replace existing assets
2018-03-02 15:35:47 -08:00
Leo Lamprecht
3882c64a1d 11.0.0-canary.24 2018-03-02 15:28:08 -08:00
Sreeram Jayan
a5a18821cc Fixed duplicate deployment type prompt (#1168)
* 1163:Fix duplicate deployment type prompt

* Replace existing assets
2018-03-02 15:27:43 -08:00
Tim Neutkens
3fb89120f9 10.1.3 2018-03-02 16:44:22 +01:00
Tim Neutkens
93daac8be9 Remove .ws blocking (#1164)
Allow alias creation for `.ws` domains
2018-03-02 16:44:13 +01:00
Tim Neutkens
4dc9982f1d 11.0.0-canary.23 2018-03-02 16:42:22 +01:00
Tim Neutkens
781f79a87a Remove .ws blocking (#1164)
Allow alias creation for `.ws` domains
2018-03-02 12:40:22 -03:00
Leo Lamprecht
74b7bf6aeb 10.1.2 2018-03-01 21:45:15 -08:00
Sergio Xalambrí
003dac4d1e Allow aliasing .ws domains (#1161) 2018-03-01 21:44:57 -08:00
Leo Lamprecht
7e81abb2b6 11.0.0-canary.22 2018-03-01 21:39:52 -08:00
Sergio Xalambrí
2bcac63885 Allow aliasing .ws domains (#1161) 2018-03-02 02:31:52 -03:00
Leo Lamprecht
1f8343f350 10.1.1 2018-03-01 13:07:22 -08:00
Sreeram Jayan
f27f5180d6 Fixed synchronization timer when deploying (#1160) 2018-03-01 13:07:17 -08:00
Leo Lamprecht
baa5fa8019 11.0.0-canary.21 2018-03-01 13:00:33 -08:00
Sreeram Jayan
179e88b24f Fixed synchronization timer when deploying (#1160) 2018-03-01 12:31:02 -08:00
Leo Lamprecht
a9fd348ca2 10.1.0 2018-03-01 00:44:45 -08:00
Leo Lamprecht
b3ba4e232b Brought CI configuration in sync with canary 2018-03-01 00:43:03 -08:00
Leo Lamprecht
fee759f68d Removed configuration file for Travis CI 2018-03-01 00:42:15 -08:00
Leo Lamprecht
05a6db2956 11.0.0-canary.20 2018-03-01 00:40:57 -08:00
Leo Lamprecht
ae3a19c4e1 Removed configuration file for Travis CI 2018-03-01 00:40:53 -08:00
Leo Lamprecht
4e29f3fd5d Ensure the CI works as intended (#1155) 2018-03-01 00:39:25 -08:00
Leo Lamprecht
a7aa1bbff7 Fixed GitHub, Bitbucket and GitLab deployments (#1154) 2018-03-01 00:39:17 -08:00
Leo Lamprecht
d741019cb5 Switched from Travis CI to Circle CI (#1152)
* Added Circle CI config

* Test it

* Ensure machine property

* Another missing part

* Run one after another

* Use the same image in all jobs

* Made it shorter

* Sweeter syntax

* Split into separate jobs

* Pass on data

* Pass everything around

* Renamed workflow

* Fan-out/fan-in

* Added new build badge

* Better link for badge

* Named commands

* Show help

* Properly attach node modules for deployment

* Capitalized titles

* Install correct uploader

* Use correct image

* Try the uploading

* Try it like this

* Set user and repo

* Filter binaries properly

* Compress binaries only when deploying

* Switched image for deployment step

* Removed Cache

* Install Go properly

* Removed slash

* Set env var correctly for Go

* Use separate jobs

* Cache Go dependencies

* Only upload on tagged builds

* Separate jobs for channels

* Corrected description

* Optimized for maximum performance

* Removed dependency

* Use lockfile for checksum
2018-03-01 00:39:10 -08:00
Leo Lamprecht
48b6c7bab8 Added support multiple path arguments (#1148)
* Switched commands to Yarn

* Only use what's needed

* Use correct command to link

* Show proper deploying output

* Handle everything

* Log it when doing it

* Make all others work

* Fixed syntax

* Removed semis

* Fixed rest

* Make GitHub uploads work again

* Made it work properly

* Ensure paths are relative

* Made it work

* Bumped lockfile

* Fixed code

* Corrected code

* Properly debug

* Fixed linting

* Made it work correctly

* Fixed missing parenthesis
2018-03-01 00:39:03 -08:00
Leo Lamprecht
f536ac3f03 11.0.0-canary.19 2018-03-01 00:23:34 -08:00
Leo Lamprecht
87f289bef1 Only upload compressed binaries 2018-03-01 00:23:30 -08:00
Leo Lamprecht
82d8c26e1e 11.0.0-canary.18 2018-03-01 00:16:44 -08:00
Leo Lamprecht
ee2843bd3b Ensure commands are being run correctly 2018-03-01 00:16:40 -08:00
Leo Lamprecht
40ff0071d7 11.0.0-canary.17 2018-03-01 00:08:10 -08:00
Leo Lamprecht
b7e374cae5 Corrected input for CI 2018-03-01 00:08:08 -08:00
Leo Lamprecht
d42d695d85 11.0.0-canary.16 2018-03-01 00:04:13 -08:00
Leo Lamprecht
1d0943eaa4 Upload each binary separately 2018-03-01 00:04:08 -08:00
Leo Lamprecht
290e187925 11.0.0-canary.15 2018-02-28 23:47:48 -08:00
Leo Lamprecht
0031b273cb Ensure uploaded releases are compressed 2018-02-28 23:47:45 -08:00
Leo Lamprecht
92f5041105 11.0.0-canary.14 2018-02-28 23:40:39 -08:00
Leo Lamprecht
614e403b43 Resolve the full path of binaries 2018-02-28 23:40:30 -08:00
Leo Lamprecht
abbbee14fa 11.0.0-canary.13 2018-02-28 23:28:39 -08:00
Leo Lamprecht
34f52809e7 Corrected path for uploading release 2018-02-28 23:28:28 -08:00
Leo Lamprecht
20aad0e7e9 11.0.0-canary.12 2018-02-28 23:22:44 -08:00
Leo Lamprecht
51171cd9e7 Use different library for uploading releases 2018-02-28 23:22:39 -08:00
Leo Lamprecht
9fea77787b 11.0.0-canary.11 2018-02-28 22:57:32 -08:00
Leo Lamprecht
297f07e4e4 Use custom regular expressions for publishing 2018-02-28 22:57:20 -08:00
Leo Lamprecht
220cea23cd 11.0.0-canary.10 2018-02-28 22:31:31 -08:00
Leo Lamprecht
4594540c2e Properly handle branch detection 2018-02-28 22:31:24 -08:00
Leo Lamprecht
b61d05c8f8 11.0.0-canary.9 2018-02-28 22:27:39 -08:00
Leo Lamprecht
e7383d32de Detect tags and branches correctly 2018-02-28 22:27:28 -08:00
Leo Lamprecht
83e1f67052 11.0.0-canary.8 2018-02-28 22:11:20 -08:00
Leo Lamprecht
c6f12dcb35 Handle tag checkouts properly (#1157) 2018-02-28 22:11:00 -08:00
Leo Lamprecht
d1554d07d4 11.0.0-canary.7 2018-02-28 21:43:57 -08:00
Leo Lamprecht
c4793b9a88 Deploy and publish using Circle CI (#1156) 2018-02-28 21:42:10 -08:00
Leo Lamprecht
0a8f874096 11.0.0-canary.6 2018-02-28 21:28:56 -08:00
Leo Lamprecht
14e4cd7bfb Ensure the CI works as intended (#1155) 2018-02-28 21:25:32 -08:00
Leo Lamprecht
0c97fb327f 11.0.0-canary.5 2018-02-28 20:49:54 -08:00
Leo Lamprecht
4acb5c464b Fixed GitHub, Bitbucket and GitLab deployments (#1154) 2018-02-28 20:47:01 -08:00
Leo Lamprecht
80e66ad010 Switched from Travis CI to Circle CI (#1152)
* Added Circle CI config

* Test it

* Ensure machine property

* Another missing part

* Run one after another

* Use the same image in all jobs

* Made it shorter

* Sweeter syntax

* Split into separate jobs

* Pass on data

* Pass everything around

* Renamed workflow

* Fan-out/fan-in

* Added new build badge

* Better link for badge

* Named commands

* Show help

* Properly attach node modules for deployment

* Capitalized titles

* Install correct uploader

* Use correct image

* Try the uploading

* Try it like this

* Set user and repo

* Filter binaries properly

* Compress binaries only when deploying

* Switched image for deployment step

* Removed Cache

* Install Go properly

* Removed slash

* Set env var correctly for Go

* Use separate jobs

* Cache Go dependencies

* Only upload on tagged builds

* Separate jobs for channels

* Corrected description

* Optimized for maximum performance

* Removed dependency

* Use lockfile for checksum
2018-02-28 19:20:40 -08:00
Leo Lamprecht
21cb5f2ad3 11.0.0-canary.4 2018-02-28 14:13:05 -08:00
Leo Lamprecht
f4c47fd3f4 Added support multiple path arguments (#1148)
* Switched commands to Yarn

* Only use what's needed

* Use correct command to link

* Show proper deploying output

* Handle everything

* Log it when doing it

* Make all others work

* Fixed syntax

* Removed semis

* Fixed rest

* Make GitHub uploads work again

* Made it work properly

* Ensure paths are relative

* Made it work

* Bumped lockfile

* Fixed code

* Corrected code

* Properly debug

* Fixed linting

* Made it work correctly

* Fixed missing parenthesis
2018-02-28 14:11:52 -08:00
Leo Lamprecht
4978716725 10.0.3 2018-02-28 12:37:43 -08:00
Leo Lamprecht
c9358c4877 Ensure chalk is being used properly (#1151) 2018-02-28 12:30:46 -08:00
Leo Lamprecht
14d198cd30 11.0.0-canary.3 2018-02-28 12:30:19 -08:00
Leo Lamprecht
809c41d21a Ensure chalk is being used properly (#1151) 2018-02-28 12:28:48 -08:00
Leo Lamprecht
3469220226 10.0.2 2018-02-28 11:51:30 -08:00
Leo Lamprecht
f4715dfdec Added missing variable references (#1150) 2018-02-28 11:49:35 -08:00
Leo Lamprecht
8f8ee5fb73 11.0.0-canary.2 2018-02-28 11:49:09 -08:00
Leo Lamprecht
be754d8619 Added missing variable references (#1150) 2018-02-28 11:48:59 -08:00
Leo Lamprecht
2ff7f2c68c 10.0.1 2018-02-28 10:37:25 -08:00
Leo Lamprecht
2c95f2c9a9 Bumped lockfile 2018-02-28 10:37:04 -08:00
Matheus Fernandes
c8d2530620 Ensure new deployments are working correctly (#1149) 2018-02-28 10:36:56 -08:00
Nathan Rajlich
2eb736f97d Add new output helper functions (#1146)
* Add "output" helper

* Cleanup and use `output` helper in Now class

* Fixes

* Update `chalk` to v2.3.1

* More logging

* Finish `now deploy` using new output functions

* Remove `.only()`

* Tests are silent

* Prevent double `> >` at the beginning of the user log line
2018-02-28 10:36:50 -08:00
Leo Lamprecht
c73c0ba9f4 11.0.0-canary.1 2018-02-28 10:34:42 -08:00
Leo Lamprecht
04470a68c0 Bumped lockfile 2018-02-28 10:34:19 -08:00
Matheus Fernandes
f72dcefebd Ensure new deployments are working correctly (#1149) 2018-02-28 10:31:05 -08:00
Nathan Rajlich
030317ba67 Add new output helper functions (#1146)
* Add "output" helper

* Cleanup and use `output` helper in Now class

* Fixes

* Update `chalk` to v2.3.1

* More logging

* Finish `now deploy` using new output functions

* Remove `.only()`

* Tests are silent

* Prevent double `> >` at the beginning of the user log line
2018-02-27 16:59:25 -08:00
Leo Lamprecht
d36df53043 10.0.0 2018-02-27 10:23:30 -08:00
Leo Lamprecht
d8faea8332 Don't upload meta files for static deployments (#1144)
* Don't upload meta files for static deployments

* Updated lockfile

* Ignore dockerfile as well
2018-02-26 17:17:23 -08:00
Sam Pal
42f131086f Made now <file> work (#1139)
* Added functionality for single static file deployments.

* Added friendly error message to now alias command

* Deleted temp files

* Removed empty line

* Make it work

* Removed alias message

* Corrected intentation

* Brought variable back

* Removed it

* Set correct name

* Bumped lockfile
2018-02-26 17:17:17 -08:00
Conner Petzold
0450be2653 Add output mode option to logs command (#1131)
* Fix readme typo

* Add raw output mode
2018-02-26 17:17:12 -08:00
Leo Lamprecht
ccb1900af7 10.0.0-canary.30 2018-02-26 17:16:04 -08:00
Leo Lamprecht
dd9b75cbf1 Don't upload meta files for static deployments (#1144)
* Don't upload meta files for static deployments

* Updated lockfile

* Ignore dockerfile as well
2018-02-26 17:13:52 -08:00
Sam Pal
4401e4d3ee Made now <file> work (#1139)
* Added functionality for single static file deployments.

* Added friendly error message to now alias command

* Deleted temp files

* Removed empty line

* Make it work

* Removed alias message

* Corrected intentation

* Brought variable back

* Removed it

* Set correct name

* Bumped lockfile
2018-02-26 16:17:53 -08:00
Conner Petzold
a6fe7953e3 Add output mode option to logs command (#1131)
* Fix readme typo

* Add raw output mode
2018-02-26 15:41:59 -08:00
Ayushi Singh
d72ab61e6f Added friendly error message to now alias (#1140)
* Added friendly error message to now alias command

* Delete .login.js.swp

* Delete .domains.js.swp
2018-02-25 22:20:38 -08:00
Leo Lamprecht
d96473f5ed Removed undefined variable reference (#1143) 2018-02-25 22:20:33 -08:00
Leo Lamprecht
f5fefa88a4 10.0.0-canary.29 2018-02-25 22:19:31 -08:00
Ayushi Singh
b3234d2f5e Added friendly error message to now alias (#1140)
* Added friendly error message to now alias command

* Delete .login.js.swp

* Delete .domains.js.swp
2018-02-25 22:17:36 -08:00
Leo Lamprecht
dfe8163daf Removed undefined variable reference (#1143) 2018-02-25 22:11:20 -08:00
Leo Lamprecht
4391dae4b0 Bumped lockfile 2018-02-24 21:29:06 -08:00
Guillermo Rauch
e991904d02 bump email-prompt to fix #1104 2018-02-24 21:25:46 -08:00
Shaleen Jain
6d40ccb04a Add remaining missing 'console.log' (#1098) 2018-02-24 21:24:57 -08:00
Olli Vanhoja
e2518666ea Remove whois check when using domains add command
When a domain is added with `now domains add` command it's often
because the user needs a working Zone file before changing the NS
records at the registrar or due to issues with the whois service.
Therefore the command is almost always run with `-f` flag.

Remove the `--force` option and always add send the domain add
request without client side verification.
2018-02-24 21:22:15 -08:00
Nathan Rajlich
e83fb66513 Don't print the alias uid upon removal (#1109)
It's irrelevant information and now the uids are very long,
so let's not bother printing that information.
2018-02-24 21:20:47 -08:00
Robert Koch
3f5d3b3238 Corrected whitelisting mechanism for now.json (#1126)
* Updated how files are retrieved so whitelisted files specified in now.json or package.json are always added to the deployment, even if they are excluded in gitignore or npmignore.

* added new tests to check whitelisting of files in now.json and package.json and fixed/modified old tests to work with new behaviour.

* Ran linter, removed console statements.

* Wrote some documentation, fixed some typos, and removed some comments. Also ran prettier.

* Use spaces

* Use more spaces

* Use more spaces

* Use more spaces

* Use more spaces

* Use more spaces

* Use more spaces

* Use more spaces

* Use more spaces

* Corrected indentation

* Corrected indentation

* Corrected indentation
2018-02-24 21:07:54 -08:00
Leo Lamprecht
db2c31d917 Pinned missing dependencies 2018-02-24 21:03:58 -08:00
Sam Pal
b8306ef3ba Added missing deps to package.json (#1137) 2018-02-24 21:03:53 -08:00
Leo Lamprecht
94ac6b9272 10.0.0-canary.28 2018-02-24 20:07:45 -08:00
Leo Lamprecht
86da780308 Pinned missing dependencies 2018-02-24 20:06:30 -08:00
Sam Pal
eab8692a58 Added missing deps to package.json (#1137) 2018-02-25 00:47:30 -03:00
Sreeram Jayan
c1d16f9965 Display confirmation message before adding a domain (#1130) 2018-02-24 19:34:35 -08:00
Guillermo Rauch
a63cb28723 Improved error for environment variable type (#1135) 2018-02-24 19:34:25 -08:00
Pranay Prakash
837dd124ea Circumvent attempt to connect logger if reusing an old deployment (#1132) 2018-02-24 19:33:06 -08:00
Leo Lamprecht
7177cad905 10.0.0-canary.27 2018-02-24 19:29:29 -08:00
Matt Mazzola
c2f7f118e9 Remove Microsoft Azure deployment section from README.md (#1138)
Apparently azure deployment was listed in the docs before it was actually supported by now-cli.

I just went through and become confused by the same error message and found the issue:
https://github.com/zeit/now-cli/issues/787

It seems it's easy to remove this section and add it back later when the feature is added
2018-02-24 19:29:23 -08:00
Matt Mazzola
3be1165552 Remove Microsoft Azure deployment section from README.md (#1138)
Apparently azure deployment was listed in the docs before it was actually supported by now-cli.

I just went through and become confused by the same error message and found the issue:
https://github.com/zeit/now-cli/issues/787

It seems it's easy to remove this section and add it back later when the feature is added
2018-02-24 19:23:47 -08:00
Leo Lamprecht
844f940123 10.0.0-canary.26 2018-02-24 11:32:24 -08:00
Robert Koch
cb7c81c66a Corrected whitelisting mechanism for now.json (#1126)
* Updated how files are retrieved so whitelisted files specified in now.json or package.json are always added to the deployment, even if they are excluded in gitignore or npmignore.

* added new tests to check whitelisting of files in now.json and package.json and fixed/modified old tests to work with new behaviour.

* Ran linter, removed console statements.

* Wrote some documentation, fixed some typos, and removed some comments. Also ran prettier.

* Use spaces

* Use more spaces

* Use more spaces

* Use more spaces

* Use more spaces

* Use more spaces

* Use more spaces

* Use more spaces

* Use more spaces

* Corrected indentation

* Corrected indentation

* Corrected indentation
2018-02-24 11:30:02 -08:00
Sreeram Jayan
3a009fccf0 Display confirmation message before adding a domain (#1130) 2018-02-24 11:13:17 -08:00
Guillermo Rauch
e6f2364c71 Improved error for environment variable type (#1135) 2018-02-24 11:11:46 -08:00
Pranay Prakash
aed5cdb1a8 Circumvent attempt to connect logger if reusing an old deployment (#1132) 2018-02-22 21:33:48 +01:00
Leo Lamprecht
44fd600abb 9.3.3 2018-02-18 14:42:35 -08:00
Leo Lamprecht
17f593e004 Shortened message (#1125) 2018-02-16 18:25:18 -08:00
Leo Lamprecht
37636d84d9 10.0.0-canary.25 2018-02-16 18:21:55 -08:00
Leo Lamprecht
5a87eafb87 Shortened message (#1125) 2018-02-16 18:21:02 -08:00
Leo Lamprecht
8cf760d9d5 Perfected OSS confirmation prompt (#1124)
* Start using v3 endpoint

* Make it work

* Make it bullet proof

* Hide message the second time

* Make sense

* Show upgrade link in note

* Removed useless space

* Show upgrade notice in all cases
2018-02-16 17:53:26 -08:00
Leo Lamprecht
31c11dc06c 10.0.0-canary.24 2018-02-16 17:43:04 -08:00
Leo Lamprecht
ef66da7f3f Perfected OSS confirmation prompt (#1124)
* Start using v3 endpoint

* Make it work

* Make it bullet proof

* Hide message the second time

* Make sense

* Show upgrade link in note

* Removed useless space

* Show upgrade notice in all cases
2018-02-16 17:41:20 -08:00
Leo Lamprecht
8bc1b3f715 How to do a release 2018-02-13 11:44:44 -08:00
Leo Lamprecht
cceafabcd3 How to do a release 2018-02-13 11:38:04 -08:00
Leo Lamprecht
7c19bda30d 9.3.2 2018-02-13 11:31:01 -08:00
Olli Vanhoja
2588253b3d Removed WHOIS fallback (#1121)
The fallback is no longer needed.
2018-02-13 11:29:30 -08:00
Leo Lamprecht
5b56483a93 10.0.0-canary.23 2018-02-13 11:28:23 -08:00
Olli Vanhoja
3d52e8aeac Removed WHOIS fallback (#1121)
The fallback is no longer needed.
2018-02-13 11:28:09 -08:00
Matheus Fernandes
50d59902d6 10.0.0-canary.22 2018-02-13 10:47:57 -02:00
Matheus Fernandes
f4c14be2f2 Release 9.3.1 2018-02-13 10:46:03 -02:00
Matheus Fernandes
86bf608be3 Add more missing console.logs (#1116) 2018-02-13 10:45:30 -02:00
Olli Vanhoja
cf62cdd6f2 Fix creating a new default certificate
The commit 6e476ad454 broke
creating new certificates with `now certs create`.
2018-02-13 10:45:04 -02:00
Matheus Fernandes
5ccb953be1 Add more missing console.logs (#1116) 2018-02-12 11:57:14 -08:00
Leo Lamprecht
0d7b3a27e9 9.3.0 2018-02-09 21:59:42 -08:00
Nathan Rajlich
587201f723 Add now alias rm -y (#1114) 2018-02-09 21:59:31 -08:00
Leo Lamprecht
caeceb7edc 10.0.0-canary.21 2018-02-09 21:56:56 -08:00
Nathan Rajlich
6d9aa9134f Add now alias rm -y (#1114) 2018-02-09 21:50:03 -08:00
Leo Lamprecht
f392aa6d7a 10.0.0-canary.20 2018-02-09 21:05:14 -08:00
Matheus Fernandes
f92e592533 Fix many issues with now teams (#1113)
* Correctly extract the subcommand

* Check team name charset upon every keypress

* Add missing `console.log`s

* Add missing `process.stdout.write`

* Add more missing console.logs

* Add missing return

* Add more missing `process.stdout.write`

* We have to treat `switch` differently, unfortunately

* No need to print the team id

* Fix grammar
2018-02-09 21:04:14 -08:00
Leo Lamprecht
9b23518273 9.2.10 2018-02-09 21:02:04 -08:00
Matheus Fernandes
527650f210 Fix many issues with now teams (#1113)
* Correctly extract the subcommand

* Check team name charset upon every keypress

* Add missing `console.log`s

* Add missing `process.stdout.write`

* Add more missing console.logs

* Add missing return

* Add more missing `process.stdout.write`

* We have to treat `switch` differently, unfortunately

* No need to print the team id

* Fix grammar
2018-02-09 20:59:20 -08:00
Leo Lamprecht
cc9f9eb85d 10.0.0-canary.19 2018-02-09 15:20:23 -08:00
Naoyuki Kanezawa
8f4991ab70 fix help message for session-affinity (#1112) 2018-02-09 15:20:19 -08:00
Leo Lamprecht
7b98381471 9.2.9 2018-02-09 15:17:38 -08:00
Naoyuki Kanezawa
615756552d fix help message for session-affinity (#1112) 2018-02-09 15:14:46 -08:00
Leo Lamprecht
8c16f42826 10.0.0-canary.18 2018-02-06 17:05:37 -08:00
Matheus Fernandes
c4259323d3 Fixed now teams add and now cc add (#1110)
* Add missing `stdout.write`s

* Add missing console.log

* Add missing await
2018-02-06 17:03:00 -08:00
Leo Lamprecht
7b8c3934e2 9.2.8 2018-02-06 17:02:26 -08:00
Matheus Fernandes
930d085fe3 Fixed now teams add and now cc add (#1110)
* Add missing `stdout.write`s

* Add missing console.log

* Add missing await
2018-02-06 17:00:58 -08:00
Leo Lamprecht
d9469898f2 10.0.0-canary.17 2018-02-06 12:13:08 -08:00
Nathan Rajlich
e9c2d3790a Don't print the alias uid upon removal (#1109)
It's irrelevant information and now the uids are very long,
so let's not bother printing that information.
2018-02-06 12:12:21 -08:00
Guillermo Rauch
635a99cb31 bump email-prompt to fix #1104 2018-02-04 18:51:15 -08:00
Leo Lamprecht
aae2f5619f 10.0.0-canary.16 2018-01-31 23:17:16 +01:00
Olli Vanhoja
d0bc560625 Fix creating a new default certificate
The commit 6e476ad454 broke
creating new certificates with `now certs create`.
2018-01-30 16:23:19 +01:00
Shaleen Jain
1572fefe8c Add remaining missing 'console.log' (#1098) 2018-01-29 07:28:00 -08:00
Olli Vanhoja
1508486dc1 Remove whois check when using domains add command
When a domain is added with `now domains add` command it's often
because the user needs a working Zone file before changing the NS
records at the registrar or due to issues with the whois service.
Therefore the command is almost always run with `-f` flag.

Remove the `--force` option and always add send the domain add
request without client side verification.
2018-01-27 13:57:56 +01:00
Leo Lamprecht
c43c6c2c3c 9.2.7 2018-01-20 20:32:20 +01:00
Igor Klopov
5cb792bfbf Update pkg to the latest stable version (#1090)
* update pkg to 4.3.0 stable

* Bumped lockfile
2018-01-20 20:31:42 +01:00
Leo Lamprecht
56c0385d53 Show link for update message (#1091) 2018-01-20 20:31:37 +01:00
Leo Lamprecht
372b31461c 10.0.0-canary.15 2018-01-20 20:29:08 +01:00
Igor Klopov
aa63219743 Update pkg to the latest stable version (#1090)
* update pkg to 4.3.0 stable

* Bumped lockfile
2018-01-20 20:28:25 +01:00
Leo Lamprecht
0ffaf5afd7 Show link for update message (#1091) 2018-01-20 20:23:45 +01:00
Leo Lamprecht
00f8d88578 9.2.6 2018-01-20 11:32:13 +01:00
Leo Lamprecht
e4ffdc024e Pull releases directly from GitHub (#1089) 2018-01-20 11:30:59 +01:00
Leo Lamprecht
b166bc7903 10.0.0-canary.14 2018-01-20 11:28:42 +01:00
Leo Lamprecht
d5369224a4 Pull releases directly from GitHub (#1089) 2018-01-20 11:28:22 +01:00
Leo Lamprecht
a1ca1c047b 9.2.5 2018-01-19 18:31:14 +01:00
Leo Lamprecht
8cc806c4d7 Bring back progress bar (#1088)
* Bundle with compression

* Force gzip to overwrite existing compressions

* Clear directory

* Bring back progress bar

* Start using Cloudinary

* Always ungzip, since we're only shipping .gz

* Only upload .gz files

* Don't test after deployment

Exiting with 1 here doesn't crash test
2018-01-19 18:30:58 +01:00
Leo Lamprecht
a9bd2b8818 10.0.0-canary.13 2018-01-19 18:25:08 +01:00
Leo Lamprecht
ee3e7f0288 Bring back progress bar (#1088)
* Bundle with compression

* Force gzip to overwrite existing compressions

* Clear directory

* Bring back progress bar

* Start using Cloudinary

* Always ungzip, since we're only shipping .gz

* Only upload .gz files

* Don't test after deployment

Exiting with 1 here doesn't crash test
2018-01-19 18:18:46 +01:00
Sreeram Jayan
038c5c0e38 Allow --type to overwrite config (#1086)
* Fix DNS record typo (#929)

* 1064:Check if deployment type is specified/configured.
2018-01-19 13:00:54 +01:00
Sreeram Jayan
2525cd9efb Allow --type to overwrite config (#1086)
* Fix DNS record typo (#929)

* 1064:Check if deployment type is specified/configured.
2018-01-19 13:00:08 +01:00
Leo Lamprecht
cc1e2462f4 10.0.0-canary.12 2018-01-18 23:26:49 +01:00
Leo Lamprecht
d1071e1cd2 Ensure we're catching errors 2018-01-18 23:26:37 +01:00
Matheus Fernandes
c37f3602fb Remove broken function call 2018-01-18 23:26:31 +01:00
Leo Lamprecht
ca8e26f857 Revert "Revert "Show an even better message""
This reverts commit a12fd8cbe2.
2018-01-18 23:25:59 +01:00
Leo Lamprecht
af468f2c8e Revert "Revert "Temporarily disable progress bar""
This reverts commit 0c83b0fddf.
2018-01-18 23:25:46 +01:00
Leo Lamprecht
96084a09c0 9.2.4 2018-01-18 23:23:24 +01:00
Leo Lamprecht
a0a8ac46f5 Ensure we're catching errors 2018-01-18 23:23:12 +01:00
Leo Lamprecht
5f30faabde 10.0.0-canary.11 2018-01-18 22:57:38 +01:00
Leo Lamprecht
0c83b0fddf Revert "Temporarily disable progress bar"
This reverts commit 1edaa48351.
2018-01-18 22:57:20 +01:00
Leo Lamprecht
a12fd8cbe2 Revert "Show an even better message"
This reverts commit a5ddfa1ba0.
2018-01-18 22:57:12 +01:00
Matheus Fernandes
ee8084c98a 9.2.3 2018-01-18 19:38:43 -02:00
Matheus Fernandes
f00f874898 Remove broken function call 2018-01-18 19:38:32 -02:00
Leo Lamprecht
8d752a9bc7 9.2.2 2018-01-18 22:08:20 +01:00
Leo Lamprecht
7c891ac7d2 Show an even better message 2018-01-18 22:07:30 +01:00
Leo Lamprecht
f95cbe080f Temporarily disable progress bar 2018-01-18 22:07:25 +01:00
Leo Lamprecht
147580785f 10.0.0-canary.10 2018-01-18 22:06:06 +01:00
Leo Lamprecht
a5ddfa1ba0 Show an even better message 2018-01-18 22:03:51 +01:00
Leo Lamprecht
1edaa48351 Temporarily disable progress bar 2018-01-18 22:02:47 +01:00
Leo Lamprecht
b0238d827c 9.2.1 2018-01-18 21:28:21 +01:00
Leo Lamprecht
cde0620851 Check content encoding while installing (#1083) 2018-01-18 21:28:18 +01:00
Leo Lamprecht
e188d37348 10.0.0-canary.9 2018-01-18 21:24:12 +01:00
Leo Lamprecht
d08d9d91ae Check content encoding while installing (#1083) 2018-01-18 18:23:36 -02:00
Leo Lamprecht
e87a5b8644 9.2.0 2018-01-18 18:48:13 +01:00
Olli Vanhoja
76bf75d3bf Allow overwriting custom certs with auto-renewable ones (#1082)
Currently it's not possible to create a new auto-renewable
certificate if a custom certificate already exist for a domain,
as we only allow the other direction from the cli.

Add a command flag that allows overwriting a custom certificate
with an auto-renewable certificate.

`now cert create --overwrite zeit.rocks`
2018-01-18 18:48:07 +01:00
Leo Lamprecht
de12cba1df 10.0.0-canary.8 2018-01-18 18:44:26 +01:00
Olli Vanhoja
6e476ad454 Allow overwriting custom certs with auto-renewable ones (#1082)
Currently it's not possible to create a new auto-renewable
certificate if a custom certificate already exist for a domain,
as we only allow the other direction from the cli.

Add a command flag that allows overwriting a custom certificate
with an auto-renewable certificate.

`now cert create --overwrite zeit.rocks`
2018-01-18 18:42:39 +01:00
Leo Lamprecht
f8defc0499 9.1.0 2018-01-14 15:07:03 +01:00
Leo Lamprecht
7ad65696f6 Brought branch in sync with canary 2018-01-14 15:02:45 +01:00
Leo Lamprecht
df4e15ed56 10.0.0-canary.7 2018-01-14 14:47:32 +01:00
Leo Lamprecht
b6a4e3d2f4 Fixed package description 2018-01-14 14:47:17 +01:00
Leo Lamprecht
ac81d4657c Properly error on wrong token and handle team (#1073)
* Properly error on wrong token and handle team

* Better wording
2018-01-14 14:41:48 +01:00
Leo Lamprecht
b81488ac6b Ignore npm lockfile 2018-01-14 14:41:41 +01:00
Gillian
d1bbf85f37 Changed error message to match correct command (#1071) 2018-01-14 14:41:35 +01:00
Leo Lamprecht
7f71e693c5 Use package for checking for updates (#1070)
* Use package for checking for updates

* Set dep for dev
2018-01-14 14:41:26 +01:00
Leo Lamprecht
5d16bf5976 Removed triangle from company name 2018-01-14 14:40:24 +01:00
Leo Lamprecht
c7addf7c47 Properly detect API property
This is a hotfix!
2018-01-14 14:40:11 +01:00
Leo Lamprecht
68562d9f6f Added api option to local config (#1069)
* Always load local config

* Ensure local path can be specified by flag

* Respect path properly

* Catch more

* Stop catching

* Catch better
2018-01-14 14:40:04 +01:00
Igor Klopov
e2eb3180c1 Fix absent deployment for alias (#1063)
* fix absent deployment for alias

* deploymentDeletedStub and fix in row composition
2018-01-14 14:39:56 +01:00
Tim Neutkens
a6af5c8696 Error explanation for unauthorized domain access (#1059) 2018-01-14 14:39:51 +01:00
Olli Vanhoja
c4969b17dd Add an example of adding a CAA record (#1062) 2018-01-14 14:39:45 +01:00
Tim Neutkens
0d8b4a8386 Catch path alias scaling (#1057)
* Catch path alias scaling

* Better wording

* Fix grammar mistake
2018-01-14 14:39:39 +01:00
Leo Lamprecht
9bf7963f01 10.0.0-canary.6 2018-01-14 12:11:01 +01:00
Leo Lamprecht
28069beddc Properly error on wrong token and handle team (#1073)
* Properly error on wrong token and handle team

* Better wording
2018-01-14 12:08:26 +01:00
Leo Lamprecht
b25af90e99 Ignore npm lockfile 2018-01-13 20:19:39 +01:00
Leo Lamprecht
7258da68a8 10.0.0-canary.5 2018-01-12 20:29:48 +01:00
Gillian
17cb604161 Changed error message to match correct command (#1071) 2018-01-12 19:15:09 +01:00
Leo Lamprecht
4d31dd23fd 10.0.0-canary.4 2018-01-12 12:22:23 +01:00
Leo Lamprecht
1898fe813e Use package for checking for updates (#1070)
* Use package for checking for updates

* Set dep for dev
2018-01-12 12:21:34 +01:00
Leo Lamprecht
7d85470634 Removed triangle from company name 2018-01-12 10:27:11 +01:00
Leo Lamprecht
37d0584a30 10.0.0-canary.3 2018-01-11 23:46:46 +01:00
Leo Lamprecht
59598e529b Properly detect API property
This is a hotfix!
2018-01-11 23:46:28 +01:00
Leo Lamprecht
de9c1ca9a9 10.0.0-canary.2 2018-01-11 23:11:27 +01:00
Leo Lamprecht
1c131f2f25 Added api option to local config (#1069)
* Always load local config

* Ensure local path can be specified by flag

* Respect path properly

* Catch more

* Stop catching

* Catch better
2018-01-11 23:08:39 +01:00
Leo Lamprecht
c608435e32 10.0.0-canary.1 2018-01-10 12:04:28 +01:00
Igor Klopov
78d7c5cef5 Fix absent deployment for alias (#1063)
* fix absent deployment for alias

* deploymentDeletedStub and fix in row composition
2018-01-08 18:01:58 +01:00
Tim Neutkens
f2c5230424 Error explanation for unauthorized domain access (#1059) 2018-01-08 18:01:36 +01:00
Olli Vanhoja
b4636ca7ef Add an example of adding a CAA record (#1062) 2018-01-06 15:21:17 +01:00
Tim Neutkens
a357e21bb6 Catch path alias scaling (#1057)
* Catch path alias scaling

* Better wording

* Fix grammar mistake
2018-01-03 20:52:27 +01:00
Leo Lamprecht
c93eed08fc 9.0.1 2017-12-22 12:15:40 +01:00
Leo Lamprecht
33e7e410d2 Improved usage information 2017-12-22 12:15:34 +01:00
Leo Lamprecht
7811824a2c Corrected company name in license 2017-12-22 12:15:30 +01:00
Leo Lamprecht
d6bd77b903 9.0.0-canary.25 2017-12-22 12:12:41 +01:00
Leo Lamprecht
b36b970006 Improved usage information 2017-12-22 12:12:06 +01:00
Leo Lamprecht
f8969d2561 Corrected company name in license 2017-12-22 12:06:44 +01:00
Leo Lamprecht
132eabf450 9.0.0 2017-12-21 19:21:30 +01:00
Guillermo Rauch
ae1db0097e Overhauled deployment events and logs (#993)
* add jsonlines dep

* overhauled deployment events and logs output

* suppress http2 warnings

* make wait cancelation idempotent

* improve debugging and event fetching

* include node `--no-warnings` to avoid http2 warnings

* improve instrumentation

* log with info helper

* more consistent output
2017-12-21 17:07:36 +01:00
Leo Lamprecht
d0d8f11e15 Bumped lockfile 2017-12-21 16:43:06 +01:00
tripott
05ea32fea1 Fixed typo in project configuration docs (#1049) 2017-12-21 16:37:14 +01:00
Leo Lamprecht
8bb187f01e Improved error messages (#1048)
* Improved error messages

* Removed weird messages
2017-12-21 16:37:08 +01:00
Olli Vanhoja
9f18f60fc8 Optimized the deployment process (#1028)
The do..while loop causes event handlers to be registered
multiple times in case of an error occurs while creating a
deployment after uploading missing files. The loop doesn't
save nothing more than one call to `now.create()`.
2017-12-21 16:37:01 +01:00
Nathan Rajlich
c8e20a4038 Simplify the env parsing logic (#1046)
* Simplify the `env` parsing logic

This should be 100% backwards compatible with the previous
behavior, but with some new additions:

 * When using an Array in `package.json:now.env` or `now.json:env`, you
   may specify the value or secret name after an `=` sign (before, the
   entire string was attempted to be the env var key name, which was
   just wrong _(this is the main "fix")_.
 * Specifying `null` as the value of an env var in an Object forces the
   user prompt (before, this was only possibly by using an Array without
   an `=` sign).
 * You may specify an env var on the CLI without an `=` sign and it will
   show the user prompt (kind of silly since the user is invoking the
   command anyways, but this works due to the new normalization)
 * Less converting the env between Array and Object representations.

The code is also simpler to read now, and a few helpful comments added
as well.

* fix `now -e MY_SHELL_VAR` inheriting from user's env
2017-12-21 16:36:56 +01:00
Yuri Yakovlev
ef9c3c9c1f Exit with correct status code (#1045) 2017-12-21 16:36:40 +01:00
Nathan Rajlich
e60e8ddc6b Reject Errors properly in now logs -f (#1041) 2017-12-21 16:36:26 +01:00
Nathan Rajlich
fd4c1dea76 Remove --base64 argument from now secret add (#1033)
It's been broken on the server-side for quite a while now,
and on top of that it's never been clear as to *how* you
get the binary value back out from within the deployment.

For these reasons, let's get rid of the option altogether.

Users who need to encode binary data as the secret value
should encode to base64 manually. For example:

```
$ now secret add my-secret $(echo 'foo' | base64)
```
2017-12-21 16:36:01 +01:00
Nathan Rajlich
243ca1e06a Return an empty object early when nothing to prompt (#1032)
* Return an empty object early when nothing to prompt

So that the `console.log()` a few lines down does
not get invoked

* Use `Object.keys()` to iterate over the answers
2017-12-21 16:35:54 +01:00
Olli Vanhoja
6456b00441 Sort certs by root domain (#1030)
Instead of sorting cert CNs by the full domain we should sort them
by the root domain to group all likely related certs together.
2017-12-21 16:35:48 +01:00
Nathan Rajlich
5b17f5f08b Do not reference newTeam when switching to user scope (#1029)
Fixes error:

    $ now switch tootallnate
    > Error! An unexpected error occurred in switch: TypeError: Cannot read property 'slug' of undefined
        at module.exports (/snapshot/now-cli/dist/now.js:2995:81)
        at <anonymous>
        at process._tickCallback (internal/process/next_tick.js:188:7)
2017-12-21 16:35:42 +01:00
Leo Lamprecht
dd4df0ba4c Upgrade Node.js to the latest version (#1025) 2017-12-21 16:35:36 +01:00
Olli Vanhoja
699752f631 Improve domain removal UX (#1022)
- Don't prefix the domain with https as it may not be even using
  https nor have any records
- Don't show domain ID after the domain is removed as it has no
  meaning for cli users
2017-12-21 16:35:30 +01:00
Nathan Rajlich
a31f88848d Pluralize words automatically (#1024)
* use `pluralize` module

Instead of manually formatting these singular vs. plural cases.

Note that `util/alias.js` was previously incorrectly always printing as
plural, which is what let me down this rabbit hole in the first place.

* Bumped pkg version

* Downgrade node temporarily
2017-12-21 16:35:16 +01:00
Leo Lamprecht
065c9363f9 9.0.0-canary.24 2017-12-20 22:37:37 +01:00
tripott
c47302b2aa Fixed typo in project configuration docs (#1049) 2017-12-20 21:56:15 +01:00
Leo Lamprecht
7274d41b43 9.0.0-canary.23 2017-12-20 21:40:39 +01:00
Leo Lamprecht
3f306a1bfb Improved error messages (#1048)
* Improved error messages

* Removed weird messages
2017-12-20 21:36:37 +01:00
Leo Lamprecht
c9f5d4286b 9.0.0-canary.22 2017-12-20 19:15:13 +01:00
Olli Vanhoja
75be1ebc9c Optimized the deployment process (#1028)
The do..while loop causes event handlers to be registered
multiple times in case of an error occurs while creating a
deployment after uploading missing files. The loop doesn't
save nothing more than one call to `now.create()`.
2017-12-20 19:13:41 +01:00
Nathan Rajlich
7c3b2da48c Simplify the env parsing logic (#1046)
* Simplify the `env` parsing logic

This should be 100% backwards compatible with the previous
behavior, but with some new additions:

 * When using an Array in `package.json:now.env` or `now.json:env`, you
   may specify the value or secret name after an `=` sign (before, the
   entire string was attempted to be the env var key name, which was
   just wrong _(this is the main "fix")_.
 * Specifying `null` as the value of an env var in an Object forces the
   user prompt (before, this was only possibly by using an Array without
   an `=` sign).
 * You may specify an env var on the CLI without an `=` sign and it will
   show the user prompt (kind of silly since the user is invoking the
   command anyways, but this works due to the new normalization)
 * Less converting the env between Array and Object representations.

The code is also simpler to read now, and a few helpful comments added
as well.

* fix `now -e MY_SHELL_VAR` inheriting from user's env
2017-12-20 18:59:38 +01:00
Leo Lamprecht
c70a645516 9.0.0-canary.21 2017-12-19 13:24:52 +01:00
Yuri Yakovlev
c580d55be7 Exit with correct status code (#1045) 2017-12-19 13:23:47 +01:00
Nathan Rajlich
caa7ef61ec Reject Errors properly in now logs -f (#1041) 2017-12-15 09:11:52 +01:00
Leo Lamprecht
65dbb158ce 9.0.0-canary.20 2017-12-11 11:31:46 +01:00
Nathan Rajlich
5463e8b5d8 Remove --base64 argument from now secret add (#1033)
It's been broken on the server-side for quite a while now,
and on top of that it's never been clear as to *how* you
get the binary value back out from within the deployment.

For these reasons, let's get rid of the option altogether.

Users who need to encode binary data as the secret value
should encode to base64 manually. For example:

```
$ now secret add my-secret $(echo 'foo' | base64)
```
2017-12-11 11:29:59 +01:00
Nathan Rajlich
a63123e206 Return an empty object early when nothing to prompt (#1032)
* Return an empty object early when nothing to prompt

So that the `console.log()` a few lines down does
not get invoked

* Use `Object.keys()` to iterate over the answers
2017-12-08 21:31:53 +01:00
Olli Vanhoja
846c02c9e4 Sort certs by root domain (#1030)
Instead of sorting cert CNs by the full domain we should sort them
by the root domain to group all likely related certs together.
2017-12-08 18:32:50 +01:00
Nathan Rajlich
101b728d9b Do not reference newTeam when switching to user scope (#1029)
Fixes error:

    $ now switch tootallnate
    > Error! An unexpected error occurred in switch: TypeError: Cannot read property 'slug' of undefined
        at module.exports (/snapshot/now-cli/dist/now.js:2995:81)
        at <anonymous>
        at process._tickCallback (internal/process/next_tick.js:188:7)
2017-12-07 11:57:21 -08:00
Leo Lamprecht
63514669ea 9.0.0-canary.19 2017-12-06 23:33:22 +01:00
Leo Lamprecht
44397246bc Upgrade Node.js to the latest version (#1025) 2017-12-06 23:32:13 +01:00
Olli Vanhoja
d9a58fc8ce Improve domain removal UX (#1022)
- Don't prefix the domain with https as it may not be even using
  https nor have any records
- Don't show domain ID after the domain is removed as it has no
  meaning for cli users
2017-12-06 23:03:21 +01:00
Nathan Rajlich
57943d0f0a Pluralize words automatically (#1024)
* use `pluralize` module

Instead of manually formatting these singular vs. plural cases.

Note that `util/alias.js` was previously incorrectly always printing as
plural, which is what let me down this rabbit hole in the first place.

* Bumped pkg version

* Downgrade node temporarily
2017-12-06 23:02:41 +01:00
Leo Lamprecht
a6ceb44a5c 9.0.0-canary.18 2017-11-28 00:09:08 +01:00
Matheus Fernandes
bbc1b509f0 If quiet, be quiet 2017-11-22 17:58:12 -08:00
Matheus Fernandes
8936a1bf42 8.5.4 2017-11-22 17:28:24 -08:00
Matheus Fernandes
abc70e8558 If quiet, be quiet 2017-11-22 17:27:44 -08:00
Leo Lamprecht
c9c68b561c 8.5.3 2017-11-23 01:39:56 +01:00
Melvin
c6c64a1953 Only make global auth file readable/writable by owner (#1001) 2017-11-23 01:26:08 +01:00
Seth Holladay
bcce2c5ffc Overhaul JSON reading, parsing, and writing (#899)
* Fix `now alias` for domains without DNS records (#898)

* 8.3.9

* Overhaul JSON loading and parsing

Reading JSON files from disk is now simpler, with clearer error messages.

Fixes #893

* More robust JSON writing

Make directories if needed and write to disk atomically.

* Remove unused import

* Escape @ in MX record example (#900)

* Pinned dependencies
2017-11-23 01:25:38 +01:00
Matheus Fernandes
058a30aec3 Made now switch and now logs -f work properly (#1003)
* Add missing `console.log`s

* Bubble the exit code correctly

* Clear the "final answer" output from inquirer on `now switch`

* Add more missing `console.log` :(

* Add the team slug to the success message

* Adjust `now log -f` to work with the new exit logic
2017-11-23 01:23:41 +01:00
Guillermo Rauch
7ba73f909c Fix deployments with no now.json file (#999) 2017-11-23 01:21:16 +01:00
Leo Lamprecht
90db214ac1 9.0.0-canary.17 2017-11-23 01:10:44 +01:00
Matheus Fernandes
887b625114 Made now switch and now logs -f work properly (#1003)
* Add missing `console.log`s

* Bubble the exit code correctly

* Clear the "final answer" output from inquirer on `now switch`

* Add more missing `console.log` :(

* Add the team slug to the success message

* Adjust `now log -f` to work with the new exit logic
2017-11-23 01:07:52 +01:00
Melvin
260aa944d5 Only make global auth file readable/writable by owner (#1001) 2017-11-22 11:27:08 +01:00
Guillermo Rauch
aa25de5cf8 Fix unexpected err message (#1000)
* fix deployments with no `now.json`

* improved global error handler
2017-11-21 16:56:19 -08:00
Guillermo Rauch
4ee4dd3645 Fix unexpected err message (#1000)
* fix deployments with no `now.json`

* improved global error handler
2017-11-21 16:52:22 -08:00
Leo Lamprecht
acf1ae9771 9.0.0-canary.16 2017-11-21 18:04:16 +01:00
Guillermo Rauch
42c6d6b52b Fix deployments with no now.json file (#999) 2017-11-21 18:03:54 +01:00
Leo Lamprecht
32384c847f 9.0.0-canary.15 2017-11-20 11:17:23 +01:00
Leo Lamprecht
15b8f857f0 8.5.2 2017-11-20 11:14:54 +01:00
Sebastian Richter
ef9862cbfb Better error message for missing gcp property (#997)
* Better error message

Better error message when "gcp" property is missing in now.json

* Make sure gcpConfig is defined

* Replaced destructor
2017-11-20 11:13:15 +01:00
George Tsiolis
21251548a7 Prevent trailing link character consumption by some terminals (#990)
* fix: broken link in missing `start` script error

* fix: removed trailing dot in error message
2017-11-20 11:13:02 +01:00
Nathan Rajlich
83fe413b96 Fix location of credentials files on error page (#995) 2017-11-20 11:11:23 +01:00
Nathan Rajlich
9a018b41cd Add "No Open Port Found" error page (#994) 2017-11-20 11:11:19 +01:00
Guillermo Rauch
2804bedab6 Overhauled deployment events and logs (#993)
* add jsonlines dep

* overhauled deployment events and logs output

* suppress http2 warnings

* make wait cancelation idempotent

* improve debugging and event fetching

* include node `--no-warnings` to avoid http2 warnings

* improve instrumentation

* log with info helper

* more consistent output
2017-11-20 11:06:02 +01:00
Sebastian Richter
934d159bc8 Better error message for missing gcp property (#997)
* Better error message

Better error message when "gcp" property is missing in now.json

* Make sure gcpConfig is defined

* Replaced destructor
2017-11-20 11:04:22 +01:00
Nathan Rajlich
dc4327e883 Fix location of credentials files on error page (#995) 2017-11-18 17:02:18 -08:00
Nathan Rajlich
0826958221 Add "No Open Port Found" error page (#994) 2017-11-18 16:54:17 -08:00
Graham Kaemmer
401f503d43 Add option to append 'https://' to deployment URL in now list (#991)
* Add option to append 'https://' to deployment URL in now list (#800)

* Rename includeProtocol -> includeScheme
2017-11-17 09:18:06 -08:00
George Tsiolis
75c6bcb291 Prevent trailing link character consumption by some terminals (#990)
* fix: broken link in missing `start` script error

* fix: removed trailing dot in error message
2017-11-17 02:37:18 -08:00
Leo Lamprecht
92c561af9b 9.0.0-canary.14 2017-11-13 22:34:05 +01:00
Leo Lamprecht
0a2f38b424 Hide debugging line in now deploy 2017-11-13 22:33:47 +01:00
Leo Lamprecht
77d2bcc119 8.5.1 2017-11-13 22:28:54 +01:00
Leo Lamprecht
555d0538e8 Hide debugging line in now deploy 2017-11-13 22:26:52 +01:00
Leo Lamprecht
4c619ecb6c 8.5.0 2017-11-13 21:41:38 +01:00
Leo Lamprecht
9c74c887c3 Bumped lockfile 2017-11-13 21:33:49 +01:00
Leo Lamprecht
33d7a02297 Fixed package description 2017-11-13 21:26:07 +01:00
Pranay Prakash
3dd2752b63 Only load the http2 module if HTTP/2 is enabled (#987)
* hide fetch-h2 import behind flag

* Removed semicolons
2017-11-13 21:20:29 +01:00
Leo Lamprecht
81b86c0798 9.0.0-canary.13 2017-11-13 21:18:48 +01:00
Pranay Prakash
d370205fda Only load the http2 module if HTTP/2 is enabled (#987)
* hide fetch-h2 import behind flag

* Removed semicolons
2017-11-13 21:18:03 +01:00
Igor Klopov
388e235d01 Made installation work on Git Bash (#986)
* look in APPDATA directory if not found in Program Files

* modifyGitBashFile to replace "now "with "now.exe"

* fix npm rm -g now

* fix fetch-h2 dep version
2017-11-13 20:12:07 +01:00
Josh Junon
529fb33f3b add explicit build script 2017-11-13 20:08:07 +01:00
Joe Lim
45874fe1ce Improve nameserver error message (#984) 2017-11-13 20:07:56 +01:00
Josh Junon
01334ea74e Improve wording of GCP login message 2017-11-13 20:06:36 +01:00
Naoyuki Kanezawa
7f86e54675 Add error handling to login command (#974)
* add error handling on login command

* fix error message
2017-11-13 20:06:30 +01:00
Leo Lamprecht
b86368a49f Removed useless keyword 2017-11-13 20:06:17 +01:00
Joe Lim
63f88b66eb Show login window message for GCP (#982) 2017-11-13 20:05:59 +01:00
Matheus Fernandes
148673057d Set the host header when using http2 2017-11-13 20:04:12 +01:00
Matheus Fernandes
2ce875df79 Bump fetch-h2 2017-11-13 20:03:58 +01:00
Josh Junon
9a705f6c85 improve api v2 support 2017-11-13 20:03:49 +01:00
Leo Lamprecht
8097f53aab Ensure that update message shows up (#971) 2017-11-13 20:03:34 +01:00
Leo Lamprecht
e04aa38dc2 Fixes inconsistency with flag for API URL (#968)
* Fixed inconsistency with API flag

* Accept config key

* Moved to earlier position
2017-11-13 20:02:25 +01:00
Olli Vanhoja
ba0e5bd131 Use the new deployment removal API (#966) 2017-11-13 20:02:12 +01:00
Olli Vanhoja
0afd40f47c Use v2 API to get a deployments list (#967) 2017-11-13 20:02:07 +01:00
Olli Vanhoja
5124f3d1bc Removed useless header from API requests (#964) 2017-11-13 20:02:00 +01:00
Leo Lamprecht
aa461b564d Start using Node.js 9.0.0 with PKG 2017-11-13 20:01:34 +01:00
Pranay Prakash
c68fed4fc5 Added support for HTTP/2 (#953)
* first working version

* implemented socket switching at socket request limit

* Use http2 only on canary

* fix typo
2017-11-13 19:59:55 +01:00
Leo Lamprecht
6f7ffafdc7 9.0.0-canary.12 2017-11-13 19:15:43 +01:00
Leo Lamprecht
2c3808ce77 Bumped lockfile 2017-11-13 19:13:37 +01:00
Igor Klopov
7774d7d72a Made installation work on Git Bash (#986)
* look in APPDATA directory if not found in Program Files

* modifyGitBashFile to replace "now "with "now.exe"

* fix npm rm -g now

* fix fetch-h2 dep version
2017-11-13 18:57:17 +01:00
Josh Junon
b3cd68bbb3 add explicit build script 2017-11-11 23:09:08 -08:00
Joe Lim
d69435c93f Improve nameserver error message (#984) 2017-11-10 23:09:03 -08:00
Josh Junon
b052388050 Improve wording of GCP login message 2017-11-10 11:56:37 -08:00
Leo Lamprecht
39566519e4 9.0.0-canary.11 2017-11-10 20:41:18 +01:00
Naoyuki Kanezawa
2d08379f87 Add error handling to login command (#974)
* add error handling on login command

* fix error message
2017-11-10 20:40:41 +01:00
Joe Lim
68a0332fce Show login window message for GCP (#982) 2017-11-10 20:39:47 +01:00
Matheus Fernandes
41f58d27db 9.0.0-canary.10 2017-11-09 12:27:46 +00:00
Matheus Fernandes
1047edd986 Set the host header when using http2 2017-11-09 12:27:11 +00:00
Matheus Fernandes
611401e2e1 Bump fetch-h2 2017-11-09 12:27:11 +00:00
Matheus Fernandes
853760b8c6 Revert "Temporarily disable HTTP2 when talking with now-bru's API (#973)"
This reverts commit cfcd6005ff.
2017-11-09 12:27:10 +00:00
Josh Junon
97d6604691 improve api v2 support 2017-11-08 19:33:40 -08:00
Matheus Fernandes
cfcd6005ff Temporarily disable HTTP2 when talking with now-bru's API (#973) 2017-11-09 00:51:53 +01:00
Leo Lamprecht
b06ef97ec8 9.0.0-canary.9 2017-11-07 22:05:10 +01:00
Leo Lamprecht
e6e92a27b4 Ensure that update message shows up (#971) 2017-11-07 12:57:04 -08:00
Leo Lamprecht
aeaf03a420 9.0.0-canary.8 2017-11-07 17:50:00 +01:00
Leo Lamprecht
826f983fb0 Removed useless keyword 2017-11-07 17:48:51 +01:00
Leo Lamprecht
12cbf0c0b8 Fixes inconsistency with flag for API URL (#968)
* Fixed inconsistency with API flag

* Accept config key

* Moved to earlier position
2017-11-07 17:34:12 +01:00
Olli Vanhoja
66e70c8074 Use the new deployment removal API (#966) 2017-11-06 22:56:43 +01:00
Olli Vanhoja
35eeeba9b4 Use v2 API to get a deployments list (#967) 2017-11-06 22:55:49 +01:00
Olli Vanhoja
eef37799b7 Removed useless header from API requests (#964) 2017-11-06 10:15:58 +01:00
Leo Lamprecht
0c4e00bb1b 8.4.0 2017-11-05 20:47:16 +01:00
Leo Lamprecht
45cb08e925 Bumped lockfile 2017-11-05 20:43:08 +01:00
Pranay Prakash
9a78e75466 Faster array-unique implementation (#933)
* faster unique implementation

* use my own arrayUnique implementation

* forgot to remove the extra array access
2017-11-05 20:41:17 +01:00
Leo Lamprecht
7b656d4ad4 Channel-specific Travis CI config 2017-11-05 20:34:17 +01:00
Leo Lamprecht
57ad585bed 9.0.0-canary.7 2017-11-05 19:39:51 +01:00
Leo Lamprecht
b5af6276e1 Start using Node.js 9.0.0 with PKG 2017-11-05 19:36:06 +01:00
Leo Lamprecht
fe5231a665 Canary-specific Travis CI config 2017-11-05 19:33:26 +01:00
Guillermo Rauch
450d2098e7 Fix zeit.world DNS examples list (#959)
* fix DNS examples list

* Update errors.js
2017-10-31 22:44:18 +01:00
Pranay Prakash
472d1ffab0 Added support for HTTP/2 (#953)
* first working version

* implemented socket switching at socket request limit

* Use http2 only on canary

* fix typo
2017-10-31 11:41:16 +01:00
Leo Lamprecht
861b2a5f3b 9.0.0-canary.6 2017-10-30 14:50:37 +01:00
Olli Vanhoja
bdb360704b Fixed zeit.world nameservers check (#954)
Instead of checking if the nameservers are from a known list we
can just check that every nameserver set for the domain ends with
.zeit.world.
2017-10-30 14:47:33 +01:00
Leo Lamprecht
3b9c861269 8.3.12 2017-10-30 14:46:09 +01:00
Vitor Capretz
90e2f4b6f5 Added validation for .ws domains (#935)
as in #365, ZEIT.world currently doesn't support .ws domains
and user should receive a notice when adding aliases or adding domains
2017-10-30 14:42:17 +01:00
Felix Yan
d7b0c3b303 Fixed a few comment typos (#947) 2017-10-30 14:41:35 +01:00
Matt Keas
1dbbbbb085 Fixes runtime issues with a type and some missing require statements (#946)
* Fix `now alias` for domains without DNS records (#898)

* 8.3.9

* Ensure that `now logout` revokes the token (#920)

* 8.3.10

* instead of opening url with xdg-open (which is causing #911), print the URL for the user to open or click, as diff versions of xdg-open may be needed on various linux distros and opn has some issues within pkg.

* adds check for the platform, uses opn on windows/mac and just prints out URL for linux

* fixed runtime issues
2017-10-30 14:40:41 +01:00
Ryan Tsao
a6a7627c90 Wait until deployment is ready before exiting (#940) 2017-10-30 14:40:25 +01:00
Leo Lamprecht
20e9906d18 Corrected deployment to npm 2017-10-30 14:39:59 +01:00
Pranay Prakash
01dadf2d8d Exclude _fixtures from eslint (#928) 2017-10-30 14:38:43 +01:00
Olli Vanhoja
e524770fb7 Fixed zeit.world nameservers check (#954)
Instead of checking if the nameservers are from a known list we
can just check that every nameserver set for the domain ends with
.zeit.world.
2017-10-30 14:33:56 +01:00
Leo Lamprecht
8d7bae3792 8.3.11 2017-10-30 14:12:09 +01:00
Olli Vanhoja
5713718512 Use second generation of API for creating deployments (#906)
* Fix `now alias` for domains without DNS records (#898)

* 8.3.9

* Escape @ in MX record example (#900)

* Remove duplication of deployment complete print out

* Use v2 now API

v2 API requires the client to upload files before creating a
deployment.
2017-10-30 14:10:48 +01:00
Olli Vanhoja
0a8f602644 Ignore DNS record conflict on aliasing (#924)
Conflicting record is just the right record in most of the cases
and in other cases altering the record would break something
explicitly setup by the user.
2017-10-30 14:10:18 +01:00
Matt Keas
128b2b7faa Get now gcp login working on various linux distros again (#944)
* Fix `now alias` for domains without DNS records (#898)

* 8.3.9

* Ensure that `now logout` revokes the token (#920)

* 8.3.10

* instead of opening url with xdg-open (which is causing #911), print the URL for the user to open or click, as diff versions of xdg-open may be needed on various linux distros and opn has some issues within pkg.

* adds check for the platform, uses opn on windows/mac and just prints out URL for linux
2017-10-30 14:08:43 +01:00
Sergio Xalambrí
871b56ee42 Fix DNS record typo (#929) 2017-10-30 14:08:31 +01:00
Leo Lamprecht
6cd5308725 Only output error slug if it's available (#939) 2017-10-30 14:05:32 +01:00
Pranay Prakash
8cfe55b400 Add comments about new array-unique implementation (#948)
* Add comments about new array-unique implementation

* fix typo
2017-10-25 23:27:25 +02:00
Felix Yan
c49ba28bbf Fixed a few comment typos (#947) 2017-10-25 20:25:09 +02:00
Matt Keas
82112c79d6 Fixes runtime issues with a type and some missing require statements (#946)
* Fix `now alias` for domains without DNS records (#898)

* 8.3.9

* Ensure that `now logout` revokes the token (#920)

* 8.3.10

* instead of opening url with xdg-open (which is causing #911), print the URL for the user to open or click, as diff versions of xdg-open may be needed on various linux distros and opn has some issues within pkg.

* adds check for the platform, uses opn on windows/mac and just prints out URL for linux

* fixed runtime issues
2017-10-21 00:45:09 +02:00
Matt Keas
d30dcf4db7 Get now gcp login working on various linux distros again (#944)
* Fix `now alias` for domains without DNS records (#898)

* 8.3.9

* Ensure that `now logout` revokes the token (#920)

* 8.3.10

* instead of opening url with xdg-open (which is causing #911), print the URL for the user to open or click, as diff versions of xdg-open may be needed on various linux distros and opn has some issues within pkg.

* adds check for the platform, uses opn on windows/mac and just prints out URL for linux
2017-10-20 23:58:47 +02:00
Leo Lamprecht
9fc096d2d5 9.0.0-canary.5 2017-10-20 14:41:08 +02:00
Leo Lamprecht
8a6f967032 Bumped lockfile 2017-10-20 14:40:55 +02:00
Sergio Xalambrí
6a35a8b84a Fix DNS record typo (#929) 2017-10-20 14:39:11 +02:00
Ryan Tsao
336427afda Wait until deployment is ready before exiting (#940) 2017-10-20 14:34:59 +02:00
Leo Lamprecht
4444ca712a Fixed issues with code style 2017-10-20 01:03:36 +02:00
Pranay Prakash
ba1f96a1fd Faster array-unique implementation (#933)
* faster unique implementation

* use my own arrayUnique implementation

* forgot to remove the extra array access
2017-10-20 00:59:06 +02:00
Leo Lamprecht
697fd8b7c9 Only output error slug if it's available (#939) 2017-10-20 00:49:09 +02:00
Vitor Capretz
74951214e3 Added domain validation to the alias being set (#936)
Added domain validation to the alias being set
2017-10-16 18:07:01 +02:00
Vitor Capretz
35c6e89b4a Added validation for .ws domains (#935)
as in #365, ZEIT.world currently doesn't support .ws domains
and user should receive a notice when adding aliases or adding domains
2017-10-16 10:50:18 +02:00
Pranay Prakash
3aa19d366a Exclude _fixtures from eslint (#928) 2017-10-12 23:53:16 +02:00
Leo Lamprecht
b369779321 9.0.0-canary.4 2017-10-12 00:44:34 +02:00
Olli Vanhoja
da923fa879 Ignore DNS record conflict on aliasing (#924)
Conflicting record is just the right record in most of the cases
and in other cases altering the record would break something
explicitly setup by the user.
2017-10-12 00:41:09 +02:00
Leo Lamprecht
94952c0bd0 Even more bullet proof conditions 2017-10-11 22:48:20 +02:00
Leo Lamprecht
a4f012e5a6 Make sure to install dependencies on CI 2017-10-11 22:34:06 +02:00
Leo Lamprecht
5abf1dfb94 Use custom clone of repository on CI 2017-10-11 22:31:20 +02:00
Leo Lamprecht
0ca7d1fe44 9.0.0-canary.3 2017-10-09 18:21:18 +02:00
Leo Lamprecht
8083740804 Ensured correct arguments order
This closes #909
2017-10-09 18:20:04 +02:00
Leo Lamprecht
fd68ad8a79 Removed accidental echo output 2017-10-09 18:07:09 +02:00
Leo Lamprecht
d4714b05eb Check for tag correctly 2017-10-09 17:59:53 +02:00
Leo Lamprecht
48d76a734a Properly check for current branch on CI 2017-10-09 17:51:48 +02:00
Leo Lamprecht
9ce5ae8d95 9.0.0-canary.2 2017-10-09 17:35:26 +02:00
Leo Lamprecht
0b9bc73521 Ensure that now logout revokes the token (#920) 2017-10-09 17:34:18 +02:00
Leo Lamprecht
d8b559d952 8.3.10 2017-10-09 17:30:11 +02:00
Leo Lamprecht
ee4d441543 Ensure that now logout revokes the token (#920) 2017-10-09 17:29:45 +02:00
Leo Lamprecht
e91d767186 Removed deprecated Babel preset (#919)
* Removed deprecated Babel preset

* Fixed dependencies
2017-10-09 17:20:34 +02:00
Seth Holladay
3f0b06a642 Overhaul JSON reading, parsing, and writing (#899)
* Fix `now alias` for domains without DNS records (#898)

* 8.3.9

* Overhaul JSON loading and parsing

Reading JSON files from disk is now simpler, with clearer error messages.

Fixes #893

* More robust JSON writing

Make directories if needed and write to disk atomically.

* Remove unused import

* Escape @ in MX record example (#900)

* Pinned dependencies
2017-10-09 16:48:13 +02:00
Olli Vanhoja
4338c6a205 Use second generation of API for creating deployments (#906)
* Fix `now alias` for domains without DNS records (#898)

* 8.3.9

* Escape @ in MX record example (#900)

* Remove duplication of deployment complete print out

* Use v2 now API

v2 API requires the client to upload files before creating a
deployment.
2017-10-09 16:15:37 +02:00
Matheus Fernandes
935fd58fd9 8.3.9 2017-09-29 00:31:33 +02:00
Matheus Fernandes
0d806f95ce Fix now alias for domains without DNS records (#898) 2017-09-29 00:31:08 +02:00
Leo Lamprecht
01b7f35845 Check for deployment conditions correctly (#897) 2017-09-28 12:06:47 +02:00
Leo Lamprecht
50194b30ae 9.0.0-canary.1 2017-09-28 11:37:55 +02:00
Leo Lamprecht
b0a3e92416 Tag canary releases properly on npm (#896) 2017-09-28 11:27:20 +02:00
Leo Lamprecht
03bb490673 Bumped dependencies to the latest version (#895) 2017-09-28 11:19:25 +02:00
Leo Lamprecht
7e02ca947e 8.3.8 2017-09-28 11:10:21 +02:00
Nathan Rajlich
592b4c71aa Do not consider deployment name in now scale (#874)
Consider a deployment with an app name that matches the
alias URL. Rather than matching what deployment the alias
points to, we would match the first deployment where that
name equals the alias doman name, which is not correct.
2017-09-28 11:05:12 +02:00
Nathan Rajlich
42b88df32f Do not print the fetch error when now alias validation fails (#894) 2017-09-28 11:01:52 +02:00
Nathan Rajlich
ab8bd45ca2 fix whitespace issue when deploying a remote repo 2017-09-27 23:56:54 +02:00
Leo Lamprecht
1a6a3f854c Removed slackup in favor of upcoming canary builds (#889) 2017-09-26 15:37:20 +02:00
Leo Lamprecht
923a6de903 8.3.7 2017-09-26 13:30:32 +02:00
Jon Babsvik
4861177900 Updated now ls -h to include the --all flag (#888) 2017-09-26 12:22:08 +02:00
Olli Vanhoja
ce36c4d507 Simplify domain DNS record validation (#885)
Instead of trying to figure out whether a custom domain resolves
to a certain IP address we could just try to make a `HEAD` request
and check the `Server` header in the response. This change will
make the cli ready for anycast DNS that may resolve to any
location.
2017-09-26 00:12:03 +02:00
Olli Vanhoja
f0655e785e Removed the -F flag (#886) 2017-09-26 00:05:13 +02:00
Leo Lamprecht
af697e5715 8.3.6 2017-09-22 23:41:38 +02:00
Igor Klopov
8b06b0b302 Let it show n/a instead of 17k days (#877) 2017-09-22 23:41:09 +02:00
Matheus Fernandes
72265c49c6 Add missing console.log 2017-09-22 23:35:34 +02:00
Leo Lamprecht
56a5adeb3a Renamed "now CLI" to "Now CLI" 2017-09-19 23:29:35 +02:00
Matheus Fernandes
b339fcb309 8.3.5 2017-09-19 04:34:31 +02:00
Matheus Fernandes
b033558aeb Add missing console.log 2017-09-19 01:55:28 +02:00
Matheus Fernandes
8c83b52b1a Fix method on log 2017-09-19 01:54:58 +02:00
Matheus Fernandes
cce5bfad82 Add missing console.log 2017-09-19 01:37:37 +02:00
Leo Lamprecht
0ae01581cc Fixed a typo in an error 2017-09-17 17:47:44 +02:00
Leo Lamprecht
a02d7012be 8.3.4 2017-09-17 17:26:21 +02:00
Leo Lamprecht
2a0d4555dc Added links to the errors (#869)
* Added two example error links

* More messages added

* Even more cool stuff

* Removed useless assignments

* Weird stuff removed

* Fixed exiting

* Added missing space

* Added another error message
2017-09-17 17:24:22 +02:00
Leo Lamprecht
0b1acc13a8 8.3.3 2017-09-17 00:52:31 +02:00
Joe Haddad
9e9f53fd64 Ensure retrying GCP deployments (#862) 2017-09-17 00:50:24 +02:00
Sergio Xalambrí
75c2b86e48 Brought Git deployments back to live (#867)
* Remove the hack

That hack removed the path user/repo from argv

* Use rawPath instead of path

With path it's going to always pass that try, we need to check the the rawPath is valid not the path

* Make GH, relative path and current path deployments work

* Remove semicolon
2017-09-17 00:01:54 +02:00
Leo Lamprecht
fad6109cf2 Corrected deployment type example (#864) 2017-09-16 15:59:26 +02:00
Leo Lamprecht
d888e59af2 8.3.2 2017-09-15 19:58:49 +02:00
Leo Lamprecht
8dd0cf7e58 Removed redundant check 2017-09-15 19:58:40 +02:00
Leo Lamprecht
cef988b078 Made --team accept the username (#860)
* Made `--team` accept the username

* Only handle value when credentials exist
2017-09-15 19:56:51 +02:00
Leo Lamprecht
0a327e3ae8 Only download team data if it's not cached (#859) 2017-09-15 19:15:13 +02:00
Luke Childs
ac7ae6629a Check if the files config property is an array (#858) 2017-09-15 16:02:19 +02:00
Leo Lamprecht
696f8a20be 8.3.1 2017-09-15 12:16:04 +02:00
Leo Lamprecht
6f56046c2a Allow --token to act without a config file (#855) 2017-09-15 12:12:06 +02:00
Leo Lamprecht
72e8c0be62 8.3.0 2017-09-15 00:18:35 +02:00
Leo Lamprecht
f8c0288bb3 Ability to set team scope using --team flag (#852)
* Fixed linting

* Use `mri` for setting the token

* Ability to set team scope using `--team` flag

* Added correct utils

* Handle 403 errors

* Better 403 error message

* Made it even more bullet proof

* Added to usage information
2017-09-14 23:58:53 +02:00
Leo Lamprecht
734c78f8fc Prevent --token from overwriting the user config (#851)
* Respect currently scoped team

* Allow `--token` to overwrite the config token

* Fixed syntax

* Print an error when switching team
2017-09-14 12:04:30 +02:00
Leo Lamprecht
7a916bd3da Made --local-config work properly (#850) 2017-09-13 22:49:30 +02:00
Matheus Fernandes
da5f1ac3ae Made sure to use the correct output utilities (#841) 2017-09-13 01:02:06 +02:00
Matheus Fernandes
80e1ee829f Fix edge case where --token was being ignored (#840)
* Fix edge case where `--token` was being ignored

* Fix logic
2017-09-12 23:31:42 +02:00
Josh Junon
3874ab76cb 8.2.5 2017-09-12 21:00:54 +02:00
Josh Junon
058fb5334d fix path detection when a path is specified (#839) 2017-09-12 20:53:00 +02:00
Leo Lamprecht
da15ce73f0 8.2.4 2017-09-12 12:36:04 +02:00
Leo Lamprecht
6332196b27 Introduced a much cleaner token name (#837) 2017-09-12 12:28:33 +02:00
Matheus Fernandes
7c5b04b39e 8.2.3 2017-09-11 11:31:57 +02:00
Matheus Fernandes
86deb0a1c6 Fix arguemnt types on now dns add 2017-09-11 11:30:40 +02:00
Leo Lamprecht
00f5d39114 8.2.2 2017-09-09 17:05:43 +02:00
Leo Lamprecht
1af69b9800 Argument parsing in now scale is now more efficient (#835)
* Support IDs on the `now scale` sub command

* Made it even shorter

* Correct usage info

* Fixed syntax
2017-09-09 17:05:21 +02:00
Leo Lamprecht
5670d93877 Made now scale work properly again (#834) 2017-09-09 11:47:26 -03:00
Leo Lamprecht
3bd40ae9c9 Fixed guide on how to install the package (#832) 2017-09-08 15:09:01 -07:00
Leo Lamprecht
c4d9383d86 8.2.1 2017-09-08 23:35:01 +02:00
Leo Lamprecht
17cc5d1630 Replaced minimist with mri (faster and lighter) (#831)
* Cleaned up help for `now scale`

* Made it even better

* Fixed dot notation

* Perfected secrets help

* Cleaned up teams help

* Help for upgrade cmd

* Fixed even more

* Help for login command

* Made output work for command

* Cleaned up domains help

* Cleaned up all remaining commands

* Fixed indentation for alias command

* Missing flag added

* Another missing flag added

* Replaced `minimist` with `mri` (faster and lighter)
2017-09-08 23:25:11 +02:00
Leo Lamprecht
aa4f7d1ccc Cleaned up the usage information (#830)
* Cleaned up help for `now scale`

* Made it even better

* Fixed dot notation

* Perfected secrets help

* Cleaned up teams help

* Help for upgrade cmd

* Fixed even more

* Help for login command

* Made output work for command

* Cleaned up domains help

* Cleaned up all remaining commands

* Fixed indentation for alias command

* Missing flag added

* Another missing flag added

* Fixed help
2017-09-08 23:14:11 +02:00
Leo Lamprecht
1ebb39ff67 Removed not working --login flag from usage information (#826) 2017-09-08 13:52:28 -03:00
Leo Lamprecht
1bfaaea8cb Test installation over npm after deployment (#828) 2017-09-08 13:52:00 -03:00
Leo Lamprecht
b5361468dd Added missing --token flag to now scale sub command (#829) 2017-09-08 13:51:15 -03:00
Leo Lamprecht
9a4cb75151 8.2.0 2017-09-08 13:33:27 +02:00
Leo Lamprecht
4d985b5521 Prevent doubled usage information output (#820)
* Prevent doubled usage information output

* Return instead of exiting without util

* Made it work
2017-09-08 13:26:37 +02:00
Leo Lamprecht
1134f65cda Added new flags for local and global config (#818)
* Added new config flag to usage info

* Different available short names for flags

* Made global config flag work

* Existance of global now dir is already handled

* Made it all work
2017-09-08 13:18:12 +02:00
Leo Lamprecht
daad07abbf Temporarily hide providers from usage information (#819) 2017-09-08 13:14:10 +02:00
Leo Lamprecht
f86f074a80 Corrected flags for now teams sub command (#822) 2017-09-08 13:07:34 +02:00
Leo Lamprecht
ebcc92c879 Revert "Made now whoami return the correct team context" (#824)
* Revert "Deploy on Now if no provider is specified (#821)"

This reverts commit bbb33417ee.

* Revert "Made `now whoami` return the correct team context (#823)"

This reverts commit a9e6e6c247.
2017-09-08 08:03:21 -03:00
Leo Lamprecht
bbb33417ee Deploy on Now if no provider is specified (#821) 2017-09-08 12:58:44 +02:00
Leo Lamprecht
a9e6e6c247 Made now whoami return the correct team context (#823) 2017-09-08 12:34:20 +02:00
Leo Lamprecht
929a14cc84 Don't delete dependencies before deploying 2017-09-06 18:42:54 +02:00
Leo Lamprecht
134056883c 8.1.0 2017-09-06 18:35:16 +02:00
Leo Lamprecht
f0bb4e3cdc Let the CI deploy releases to npm automatically (#816) 2017-09-06 18:34:53 +02:00
Roberto
8fafe75793 Use config for GCP settings, allow function update (#803)
* Use same function to verify the deployed function
* Use Google CloudFunction property names
* change gcpConfig.name to gcpConfig.functionName
* availableMemoryMb => memory
2017-09-06 10:47:13 +02:00
Benoit Averty
cc74eaf4c7 Only show account info caching message in TTY (#811)
* Only show account info caching message in TTY

* fix typo

* Fixed syntax
2017-09-06 10:38:35 +02:00
Nathan Rajlich
900f2bd306 Fixed typo in usage information 2017-09-06 10:27:03 +02:00
Leo Lamprecht
f4c536cc87 8.0.2 2017-09-05 12:16:33 +02:00
Leo Lamprecht
f67af44f21 Fixed the input and output utilities (#808)
* Fixed the input and output utilities

* Stop swallowing errors
2017-09-05 12:02:57 +02:00
Leo Lamprecht
9a9736bdd2 Made token-based authentication work (#805) 2017-09-05 09:57:57 +02:00
Leo Lamprecht
8d919874a5 8.0.1 2017-09-04 12:52:46 +02:00
Leo Lamprecht
5ef6f7be3d Only prompt for login in TTY, otherwise throw error (#798)
* Only prompt for login in terminal, otherwise throw error

* Removed colors for non-TTY
2017-09-04 12:51:50 +02:00
Michael Hsu
77e95e28b9 Don't prompt for login if token was defined (#797)
* fix(prompt): unexpected Prompt for login when given token [#795]

* update

* update
2017-09-04 12:26:56 +02:00
Leo Lamprecht
38f240bb64 Removed automatic tagging as beta 2017-09-04 02:55:15 +02:00
Leo Lamprecht
8bfcf68215 8.0.0 2017-09-04 02:42:50 +02:00
Leo Lamprecht
dd4db2427f Prompt for login if no credentials defined (#795)
* Prompt for login if no credentials defined

* Sub commands should lead to login as well

* Show a message

* Fixed syntax

* Even more syntax fixed
2017-09-04 02:38:29 +02:00
Leo Lamprecht
c1b6b819ae Automatically migrate the old configuration file (#794)
* Automatically migrate the old configuration file

* Fixed git.io links

* credentials.json => auth.json

* Let the user know

* Removed trailing dot
2017-09-04 01:51:34 +02:00
Leo Lamprecht
fdfdf8039b 8.0.0-beta.11 2017-09-03 19:34:50 +02:00
Leo Lamprecht
665e36eddf Google Cloud Platform support is working again 2017-09-03 18:11:42 +02:00
Leo Lamprecht
c156dd8698 Uploading testing builds should work now 2017-09-03 17:00:57 +02:00
Leo Lamprecht
a5cdaae401 Handle packing differently on CI 2017-09-03 16:56:14 +02:00
Leo Lamprecht
e5cd439383 Fixed tests for packed binary 2017-09-03 16:51:37 +02:00
Leo Lamprecht
4c7536ba51 Usage information is now consistent across commands 2017-09-03 16:38:31 +02:00
Leo Lamprecht
9b36c27598 Made usage information work for all commands 2017-09-03 16:29:43 +02:00
Leo Lamprecht
2fd34580f3 8.0.0-beta.10 2017-09-02 17:53:51 +02:00
Leo Lamprecht
cf97a06610 Use new config for everything 2017-09-02 17:44:33 +02:00
Leo Lamprecht
9492e395ca Fixed all remaining team features 2017-09-02 17:35:36 +02:00
Leo Lamprecht
c3f9a0ea75 Made team switching work again 2017-09-02 17:25:16 +02:00
Donnie West
0586987441 Prevent cross device linking error by copying instead of linking (#789) 2017-09-02 17:10:29 +02:00
Leo Lamprecht
aa38e055e7 Made tests for packed binary work 2017-09-02 17:09:39 +02:00
Leo Lamprecht
96bafc0e0d Temporarily use Yarn 2017-09-02 17:03:00 +02:00
Leo Lamprecht
bd35c4091f Fixed tests 2017-09-02 16:44:52 +02:00
Leo Lamprecht
7fee74a0c0 Bumped lockfile 2017-09-02 16:38:13 +02:00
Leo Lamprecht
d0562dd3bf Several tests added 2017-09-02 13:41:32 +02:00
Leo Lamprecht
25e59997f5 Corrected linting ignore configuration 2017-09-02 13:32:40 +02:00
Leo Lamprecht
b6a0e8730c No need to print when initializing config 2017-09-02 13:30:24 +02:00
Leo Lamprecht
20816b5a34 Smaller text for logo 2017-09-02 13:28:12 +02:00
Leo Lamprecht
62bece4a2f New repo banner added 2017-09-02 13:26:02 +02:00
Leo Lamprecht
9c5cb06bd0 8.0.0-beta.9 2017-09-02 01:07:10 +02:00
Leo Lamprecht
c32c36a98f New token for uploading releases 2017-09-02 01:05:47 +02:00
Leo Lamprecht
10a1d9125c Fixed command logo 2017-09-02 00:52:24 +02:00
Leo Lamprecht
1db1fbd9b4 Bumped dependencies to the latest version 2017-09-02 00:47:17 +02:00
Leo Lamprecht
8435180f13 Replaced all name occurences 2017-09-02 00:08:25 +02:00
Leo Lamprecht
3e677e3a34 Merged in the zeit/now repository 2017-09-01 23:36:24 +02:00
Leo Lamprecht
6f4f252875 Removed everything 2017-09-01 23:36:12 +02:00
Leo Lamprecht
2f723a3c1b Removed useless file 2017-09-01 21:43:03 +02:00
Leo Lamprecht
f6685729ae Perfected code structure for .sh 2017-09-01 21:40:40 +02:00
Leo Lamprecht
b9e7eb1d0b Even better structure for code 2017-09-01 21:12:55 +02:00
Leo Lamprecht
9b297cf76f Removed useless legacy files 2017-09-01 20:48:17 +02:00
Leo Lamprecht
ce2fe449cd Made loggin out from .sh work 2017-09-01 20:25:54 +02:00
Leo Lamprecht
fc082a8416 Corrected import comments 2017-09-01 20:07:13 +02:00
Leo Lamprecht
5b38f092d7 Made commands take advantage of new config 2017-09-01 19:56:48 +02:00
Leo Lamprecht
48a1ad5280 Better order for .sh commands 2017-09-01 19:15:06 +02:00
Leo Lamprecht
5e36b2f2e3 Support for special commands 2017-09-01 19:14:04 +02:00
Leo Lamprecht
ded122806f Implemented the last sub command 2017-09-01 13:35:49 +02:00
Leo Lamprecht
fbf58ef698 Made logs and logout work 2017-09-01 13:27:53 +02:00
Leo Lamprecht
f8339c53d8 Support for all aliases added 2017-09-01 13:12:46 +02:00
Leo Lamprecht
1b83978ac4 Added all team features and ability to upgrade 2017-09-01 12:49:50 +02:00
Leo Lamprecht
110abfce03 Fixed empty user-agent on logs 2017-09-01 12:25:55 +02:00
Leo Lamprecht
71a04d2811 Ability to load logs added 2017-09-01 12:19:15 +02:00
Leo Lamprecht
3bfd534700 Ability to get secrets and current team 2017-08-30 13:56:05 +02:00
Leo Lamprecht
110c959902 Ability to remove deployments brought back 2017-08-30 13:29:47 +02:00
Leo Lamprecht
c5d0f10455 Syntax improved 2017-08-30 13:24:53 +02:00
Leo Lamprecht
2a50c2bd7f Commands for getting DNS, domains and certs added 2017-08-30 13:24:25 +02:00
Leo Lamprecht
36a2fee6e6 Now able to debug and set a API URL 2017-08-30 13:07:43 +02:00
Leo Lamprecht
5a49cf0102 Added now scale and now alias sub commands 2017-08-30 13:03:38 +02:00
Leo Lamprecht
d383505b7c Brought back the now ls sub command 2017-08-30 12:46:08 +02:00
Leo Lamprecht
9ce4085a7b Always save dependencies as devDependencies 2017-08-30 11:57:30 +02:00
Igor Klopov
61631dc227 Made installation work on Windows (#56)
* use 'which' to detect the path of global cmd

* Take advantage of `which-promise`
2017-08-30 11:53:50 +02:00
Alexis Sgarbossa
575c0f46ee Fixed broken link for getting started (#750) 2017-08-29 16:27:15 +02:00
Matheus Fernandes
2f810ef60f 7.4.0 2017-08-25 06:23:43 -03:00
Matheus Fernandes
ca1be7b501 Add support for coupon codes (#747)
* [BREAKING] `now domains`: remove `--config` flag

Needed so we can introduce `--coupon`

* Remove test code

* Fix the amount of erased lines upon error

* Make it async

* Add option to clear the output after adding the card

* Tweak success message

* Add support for coupon codes
2017-08-25 06:16:30 -03:00
Igor Klopov
7336c8cb0e Fix for #729 (#745)
* use 'which' to detect the path of global cmd

* fix downloading apline binaries
2017-08-24 16:04:46 -03:00
Nathan Rajlich
d8de1bcd91 secrets: treat any 4xx error code as "user error" (#744)
The Secrets endpoints used to inappropriately return a 400
error code when a secret name collision occurred (i.e. when
creating a secret with a name that already exists, or when
trying to rename a secret to a name that is already in use).
Now they return 409 Conflict which is more correct for those
scenarios.

So while we're at it, just treat all 4xx error codes as user errors.
2017-08-24 15:58:51 -03:00
Matheus Fernandes
733a288677 7.3.1 2017-08-22 19:06:52 -03:00
Matheus Fernandes
372f2b4e4d When on non-TTY mode, wait for the deployment to complete before exiting (#743)
* When on non-tty mode, wait for the deployment to complete before exiting

* Fix typo
2017-08-23 00:05:44 +02:00
Jarmo Isotalo
55879b3e32 Atomically is the correct word (#741) 2017-08-21 11:21:37 +03:00
Leo Lamprecht
67801791c5 8.0.0-beta.8 2017-08-19 02:39:02 +02:00
Leo Lamprecht
ed90053a12 Automatically publish as a beta release 2017-08-19 02:38:43 +02:00
Leo Lamprecht
d75c3f9348 Set correct paths in bundle 2017-08-19 02:34:18 +02:00
Leo Lamprecht
cba609effd 8.0.0-beta.7 2017-08-19 01:23:27 +02:00
Leo Lamprecht
0b82f77def Bumped babel-loader to the latest version 2017-08-19 01:21:32 +02:00
Leo Lamprecht
ee6c78edd0 Made google cloud deployments work again 2017-08-19 01:19:57 +02:00
Leo Lamprecht
913e99364b 8.0.0-beta.6 2017-08-18 14:58:52 +02:00
Leo Lamprecht
e51e713564 Copy missing file into bundle 2017-08-18 14:58:33 +02:00
Leo Lamprecht
98ec36da64 8.0.0-beta.5 2017-08-18 14:15:43 +02:00
Leo Lamprecht
18cfb8ce75 Exit process when not logged into GCP and trying to deploy 2017-08-18 14:14:23 +02:00
Leo Lamprecht
e0fa631b99 Correctly inject directory names 2017-08-18 14:12:57 +02:00
Leo Lamprecht
f84e4e76a9 Removed unused dependency 2017-08-18 13:58:57 +02:00
Leo Lamprecht
a1f7dd1bea Use correct npm scripts 2017-08-18 13:54:23 +02:00
Leo Lamprecht
0ee23be289 8.0.0-beta.4 2017-08-18 13:43:32 +02:00
Leo Lamprecht
36d7cfd4eb Field for repository added to package info 2017-08-18 13:43:13 +02:00
Leo Lamprecht
b4db734ec6 Added missing arr-flatten dependency 2017-08-18 13:42:33 +02:00
Leo Lamprecht
a1a646e303 Bumped dependencies to the latest version 2017-08-18 13:40:18 +02:00
Leo Lamprecht
c508751bc3 Removed a directory description 2017-08-18 13:36:46 +02:00
Leo Lamprecht
98a654ab67 Remember the configuration again 2017-08-18 13:36:12 +02:00
Leo Lamprecht
0f4a493aa9 Sweetened message login messages 2017-08-18 13:24:10 +02:00
Leo Lamprecht
cbe4af8eaa Use mri instead of minimist 2017-08-18 13:16:01 +02:00
Leo Lamprecht
17796a682d 8.0.0-beta.3 2017-08-15 21:06:46 +02:00
Leo Lamprecht
ebf6c27aa3 Build before linking 2017-08-15 21:05:29 +02:00
Leo Lamprecht
7746efff3e Additional information added to readme 2017-08-15 20:55:39 +02:00
Leo Lamprecht
4f0651b26b Avoid useless bundle builds 2017-08-15 20:43:04 +02:00
Leo Lamprecht
870c95c870 Fixed deployments 2017-08-15 20:29:27 +02:00
Leo Lamprecht
f3b6f9edb0 Ignore pkg output in Git 2017-08-15 20:26:45 +02:00
Igor Klopov
ebd3db90b0 Yarn artifacts + fix alpine download (#51)
* backup of binary to be included into yarn artifacts

* fix downloading alpine binary
2017-08-15 20:25:47 +02:00
Leo Lamprecht
9d7cac8acb Build again before deploying 2017-08-15 20:18:34 +02:00
Leo Lamprecht
55dec6e419 Fixed ability to push releases to Slack 2017-08-15 20:13:07 +02:00
Leo Lamprecht
c847179be1 Missing pkg dependency added 2017-08-15 20:05:23 +02:00
Leo Lamprecht
ecbef2ac9d Ensure that package bundle doesn't get lost on CI 2017-08-15 19:59:43 +02:00
Leo Lamprecht
341c22ac31 Removed native module from dependency list 2017-08-15 19:56:27 +02:00
Leo Lamprecht
d2642f9601 Missing badges added 2017-08-15 19:51:42 +02:00
Leo Lamprecht
1f5a2dbd65 Use Travis CI instead of Circle CI 2017-08-15 19:47:11 +02:00
Leo Lamprecht
9d9fd7e097 Tell npm to publish as beta 2017-08-15 19:07:55 +02:00
Leo Lamprecht
6efdb0fb9d Test on Circle CI 2017-08-15 19:06:36 +02:00
Leo Lamprecht
30ed4bcc64 Added missing dependency 2017-08-15 19:03:54 +02:00
Leo Lamprecht
06f5ebf111 Added support for updates 2017-08-15 18:58:19 +02:00
Leo Lamprecht
fb67971bfd Package description added 2017-08-15 18:30:48 +02:00
Leo Lamprecht
c7535de719 Added ability to link in development 2017-08-15 18:30:13 +02:00
Leo Lamprecht
d2617270bb Fixed URL for pkg downloads 2017-08-15 18:26:49 +02:00
Leo Lamprecht
7e37d8825c Create a bundle using pkg on the fly 2017-08-15 18:25:31 +02:00
Leo Lamprecht
35e7b994ef Fixed Flow errors 2017-08-15 18:11:13 +02:00
Leo Lamprecht
3bb9011e2a Replaced fs.promised with fs-extra-promise 2017-08-15 17:50:07 +02:00
Leo Lamprecht
cfcfe4a729 Moved all dependencies into a single property 2017-08-15 17:46:25 +02:00
Leo Lamprecht
9be5808029 Made pre-commit hook only lint Flow code 2017-08-15 17:42:39 +02:00
Leo Lamprecht
b612fbc02b Removed examples, that's what the site is for 2017-08-15 17:37:20 +02:00
Leo Lamprecht
6ba6999bb9 Removed useless dependencies 2017-08-15 17:35:54 +02:00
Leo Lamprecht
e787d72a2f Tell Webpack to build into the correct directory 2017-08-15 17:26:28 +02:00
Leo Lamprecht
8f2f359462 Use Webpack for building Flow code 2017-08-15 17:21:12 +02:00
Leo Lamprecht
1ff8139f74 Automatically run flow when source changes 2017-08-15 16:56:39 +02:00
Leo Lamprecht
340b8721ac Made sure that shortlinks point to the right place 2017-08-15 16:37:09 +02:00
Leo Lamprecht
d8c8bb62bc Removed license note in readme.md 2017-08-15 16:30:12 +02:00
Leo Lamprecht
39bda5f6b6 Converted pre-commit hook to script 2017-08-15 16:27:20 +02:00
Leo Lamprecht
cf40198b22 Better directory name for build output 2017-08-15 16:26:18 +02:00
Leo Lamprecht
ac31ded446 Comments for ignored files 2017-08-15 16:24:52 +02:00
Leo Lamprecht
ba9567941d Made company name in license legally correct 2017-08-15 16:24:23 +02:00
Leo Lamprecht
100b37b475 Lowercased text files 2017-08-15 16:22:57 +02:00
Leo Lamprecht
2b908305d0 Bumped dependencies to the latest version 2017-08-15 16:22:42 +02:00
Leo Lamprecht
9d29e64038 Improved order of package fields 2017-08-15 16:20:50 +02:00
Leo Lamprecht
b5fcb44c64 Pinned dependencies 2017-08-15 16:20:13 +02:00
Logan McAnsh
602e121742 Fixed a typo in the now scale usage information (#734)
Fixed a typo in the `now scale` usage information
2017-08-15 15:33:50 +02:00
Leo Lamprecht
4bdaa3fa26 8.0.0-beta.2 2017-08-14 12:56:01 +02:00
Matheus Fernandes
8973f7c184 Move legacy code to where it belongs 2017-08-08 00:48:34 -03:00
Matheus Fernandes
21cbdc2059 7.3.0 2017-07-29 18:50:19 -03:00
Leo Lamprecht
43f7262bff Bumped dependencies to the latest version 2017-07-29 23:25:04 +02:00
Leo Lamprecht
4ae45b4e7e Invalided cache for slack badge 2017-07-29 23:20:19 +02:00
Igor Klopov
f4c6054acb Don't deploy again when name or public state changes (#706)
* no need in forceNew after https://github.com/zeit/now-create/pull/83

* fix lint
2017-07-29 23:15:14 +02:00
Matheus Fernandes
6169cc2f5b Fix the default config description (#38)
* There's no auth stuff in here

* `now` -> `Now`

* Add missing `'`

* Mention `now config help`
2017-07-28 14:44:09 +03:00
Naoyuki Kanezawa
817184951d Add basic config command (#33)
* add basic config command

* Add a success message

* Grammar

* Remove extra spaces
2017-07-21 00:31:28 -03:00
Naoyuki Kanezawa
cad1fbd31d Generate random bucket names and save to config (#32) 2017-07-21 00:31:17 -03:00
Naoyuki Kanezawa
648da4e85a Ignore out dir on lint (#35) 2017-07-21 00:00:38 -03:00
Naoyuki Kanezawa
71c586ec7b Fix flow annotations to suppress errors (#36) 2017-07-20 23:58:48 -03:00
Naoyuki Kanezawa
776c759de8 retry createFunction for the case role is not ready on aws deployment (#31) 2017-07-20 12:09:04 +08:00
Naoyuki Kanezawa
1ec72f0eef Add progress module to dependencies (#30) 2017-07-19 11:53:24 -03:00
Matheus Fernandes
e061c9bbc4 Tell ESLint to ignore legacy code 2017-07-19 09:47:39 -03:00
Matheus Fernandes
dc03fb4d4e Add the license 2017-07-19 09:47:23 -03:00
Elliott Beach
4db2c0619d Text.js: Remove bad restore call. (#26)
Fixes #25.
The `restore` call is not needed, since at this point no user input has been processed.
Even if you moved the definition up, it would still cause a ReferenceError due to setRawMode not existing, so it's best to just not do it.
2017-07-19 18:04:41 +09:00
Guillermo Rauch
9fe6e928f8 exit correctly from unhandled errors 2017-07-18 15:04:30 +08:00
Guillermo Rauch
2003bb67bf Merge branch 'master' of github.com:zeit/now 2017-07-18 15:04:09 +08:00
Guillermo Rauch
3e64c39390 handle unexpected rejections correctly 2017-07-18 15:00:42 +08:00
– Amio –
d0dae3b01a Fix typos in Readme.md (#20)
* Fix more typos in Readme.md

* `\` -> `|`
2017-07-16 14:13:47 -03:00
Mirza Brunjadze
2e548e5838 Fix typos in Readme.md (#19) 2017-07-14 18:42:14 +08:00
Guillermo Rauch
475e662992 preview tag -> beta 2017-07-13 22:26:45 +08:00
Guillermo Rauch
0b5998d4b2 Delete test.js 2017-07-13 21:51:30 +08:00
Guillermo Rauch
185c78a0fe Update Readme.md 2017-07-13 21:47:13 +08:00
Guillermo Rauch
4c5a0a0050 preview 2017-07-13 20:49:15 +08:00
Igor Klopov
316d711a9c Support for Node.js 0.10 and Git for Windows (#713)
* add support of nodejs 0.10

* handle 'incorrect header check' error from gunzip

* fix progress bar

* use async-retry restart after 'incorrect header check'

* fix for #613
2017-07-11 13:01:57 +02:00
nkzawa
dd43a3a57f Release 7.2.4 2017-07-09 11:32:15 +09:00
nkzawa
5be95dc6f8 use https for badge url 2017-07-09 11:26:37 +09:00
Naoyuki Kanezawa
2bc4a1e601 use https for downloading now binary (#712) 2017-07-08 19:20:46 -07:00
Leo Lamprecht
6bddeabdb3 Lockfile updated 2017-07-09 00:17:28 +02:00
Leo Lamprecht
2db1e514e2 7.2.3 2017-07-09 00:11:38 +02:00
Leo Lamprecht
4b163c4835 Now fetching CLI downloads from our CDN 2017-07-09 00:10:16 +02:00
Leo Lamprecht
f5c1261553 Only upload CI binaries to Slack for our branches 2017-07-08 11:26:46 +02:00
Leo Lamprecht
4a1e04fe46 Match all tags on Circle CI, we always use SemVer 2017-07-08 11:20:58 +02:00
Leo Lamprecht
a9c862a228 Allow GitHub Releases uploader to extend existing one 2017-07-08 00:18:40 +02:00
Leo Lamprecht
66a0641214 7.2.2 2017-07-07 23:52:00 +02:00
Leo Lamprecht
3647ce7bd9 Only allow releases inside the ZEIT org 2017-07-07 23:50:47 +02:00
Naoyuki Kanezawa
ed34ef6f74 Avoid retrieving the deployment list when aliasing (#708)
* 7.2.0

* alias: use deployment url which is included in alias data

* alias: remove remaining https prefix
2017-07-07 23:50:31 +02:00
Leo Lamprecht
153b20cee5 Automatically publish to npm 2017-07-07 23:41:05 +02:00
Leo Lamprecht
1cb7b3c8e4 Install custom dependencies after the normal ones 2017-07-07 23:34:42 +02:00
Leo Lamprecht
21b0c13b6b Let Circle CI determine the git tag 2017-07-07 23:34:31 +02:00
Leo Lamprecht
d4bcf75055 7.2.1 2017-07-07 23:28:52 +02:00
Leo Lamprecht
4a7cefa922 Perfected structure for testing config 2017-07-07 23:25:14 +02:00
Leo Lamprecht
9b138191d9 Better grouping for Circle CI commands 2017-07-07 23:20:07 +02:00
Leo Lamprecht
c74a88c2b6 Ensure that directory with packed binary exists 2017-07-07 23:05:00 +02:00
Leo Lamprecht
f035cd7415 Load binaries for release from ./packed 2017-07-07 22:57:18 +02:00
Leo Lamprecht
816b23177d Add binaries to the correct tag when releasing 2017-07-07 22:48:47 +02:00
Leo Lamprecht
1d2b6bc3e1 Don't check node version when uploading binary to Slack 2017-07-07 22:05:36 +02:00
Leo Lamprecht
8869a98597 Upload binaries to Slack for testing 2017-07-07 18:45:25 +02:00
Leo Lamprecht
4db07394a3 Adjusted uploading script for Slack 2017-07-07 18:44:18 +02:00
Leo Lamprecht
8f79c9d6f1 Make artifacts available on Circle CI 2017-07-07 18:29:21 +02:00
Leo Lamprecht
dd956e6cf7 Circle CI is using NVM to install Node.js 2017-07-07 18:24:21 +02:00
Leo Lamprecht
e11dde4c97 Use the latest Node.js version in Circle CI 2017-07-07 18:21:50 +02:00
Leo Lamprecht
517a811e08 Added ability to build on Circle CI 2017-07-07 18:18:39 +02:00
Naoyuki Kanezawa
84ecbcb772 Removed HTTPS prefix from alias list (#709)
* 7.2.0

* alias: remove https prefix
2017-07-07 17:49:52 +02:00
Leo Lamprecht
8dacdf8241 7.2.0 2017-07-07 13:18:52 +02:00
Olli Vanhoja
9fcf9c004e Remove associated aliases and certificates before removing a domain (#703)
* Remove associated aliases and certificates before removing a domain

Previously this has been partially done on the server side but
it's better to do it client side to avoid accidentally removing
something that shouldn't be removed in team environments.

* Don't print the domain id

* Grammar

* Remove indentation
2017-07-07 01:04:58 -03:00
Matheus Fernandes
4dcab272df Don't throw Domain not found when trying to now alias to a new domain (#702)
* Don't throw `Domain not found` when trying to alias to a new domain

* Remove `console.log`

* Prettier stuff
2017-07-07 01:02:34 -03:00
Leo Lamprecht
55d25a19d5 Avoid npm run link warnings 2017-07-04 12:20:48 +02:00
Leo Lamprecht
6eae5d1ab2 Lockfile added 2017-07-04 12:19:19 +02:00
Leo Lamprecht
7fcda07cc7 7.1.1 2017-06-28 20:19:13 +02:00
Leo Lamprecht
b2a4c7e7f5 Prettified everything 2017-06-28 20:17:19 +02:00
Leo Lamprecht
7e21d71a04 Bumped dependencies to the latest version 2017-06-28 20:13:46 +02:00
Jarmo Isotalo
1daaf3037b Keep trying to scale if deployment is not yet ready (#701)
* Keep on polling now-scale when deployment is not ready

* Use `ms`
2017-06-28 20:08:51 +02:00
Igor Klopov
50b7f87854 Fixed property username not being defined (#700)
https://github.com/zeit/now-cli/blob/7.1.0/bin/now-deploy.js#L298
fixes https://github.com/zeit/now-cli/issues/633
2017-06-28 19:44:18 +02:00
Leo Lamprecht
0392b5e318 7.1.0 2017-06-25 19:02:56 +02:00
Leo Lamprecht
d793695dcc Downgraded socket.io-client to avoid several problems 2017-06-25 18:35:49 +02:00
Leo Lamprecht
a604c1f558 Bumped dependencies to the latest version 2017-06-25 18:33:58 +02:00
Igor Klopov
ebcda315a5 Ensured correct output for error messages (#694)
* add await to responseError calls

* add await to login(apiUrl) calls
2017-06-25 18:32:56 +02:00
Josh Junon
17b7a5464d Now respecting the files property inside now.json (#692)
* whitelist now.json files over .gitignores (fixes #596)

* Prettified
2017-06-24 17:49:29 +02:00
Guillermo Rauch
301166831a Fixed missing token handling (#690)
* handle API errors when fetching user

* handle API errors in some of the core Now methods

* add ability for `handleError` to report full stack trace in debug mode

* make `responseError` utility reusable

* handle top-level promise errors in entry functions of all commands

* allow for logging in when user has a bad token

* fix CI

* Fix reference error

* Improve message

* Fix typo

* Prettify
2017-06-20 12:07:21 +02:00
Leo Lamprecht
89e08bc2e7 7.0.2 2017-06-17 14:47:54 +02:00
Igor Klopov
95042e1a77 Ask to re-install with --unsafe-perm on EACCES (#683)
* ask user to reinstall with --unsafe-perm on EACCES

* webpack overrides process.env totally. removed DefinePlugin

* Cleaned up the code a little

* Missing import comments added
2017-06-17 12:44:18 +02:00
Matheus Fernandes
d60251703c 7.0.1 2017-06-15 19:40:34 -07:00
Matheus Fernandes
8d971d7b2b Bump email-promptfixes #679 2017-06-15 19:39:40 -07:00
Matheus Fernandes
a88ecb9936 Revert ea9af7d and fix the existing message (#680) 2017-06-15 18:38:27 -07:00
Leo Lamprecht
b6a714f6c7 Be more definite about what is being installed 2017-06-15 16:19:27 +02:00
Leo Lamprecht
9d30b4fcd3 7.0.0 2017-06-15 16:05:07 +02:00
Leo Lamprecht
9fbeb61ff7 Prettified arrow function 2017-06-15 15:37:18 +02:00
Leo Lamprecht
ea9af7d746 Display proper error message if path doesn't exist
This closes #675
2017-06-15 15:35:45 +02:00
Leo Lamprecht
8a603c04d8 Made now cc add case-unsensitive
This closes #631
2017-06-15 15:29:36 +02:00
Leo Lamprecht
12edb30d20 Use arrow functions and import comments where possible 2017-06-15 14:28:24 +02:00
Mike Engel
9089fb8a41 Allow credit card numbers to be pasted with now cc add (#656)
This fixes a bug where, when pasting a credit card, it would print the
number correctly, but also append too much placeholder. When hitting
enter, backspace, or another number, it would begin printing (and
formatting) `undefined`. This adds a special case where the CC will be
formatted to account for spaces when comparing against the length of the
existing value or placeholder.
2017-06-15 14:26:05 +02:00
Leo Lamprecht
e2cc19e8d5 Added npm run prettify for running prettier manually 2017-06-15 14:16:00 +02:00
David Corwin
27319e34b4 Improved usage information for now switch (#668)
* updated help message for `now switch` to reference the argument for the team as the slug instead of the id

* Improved message

* Prettified
2017-06-15 14:06:25 +02:00
Naoyuki Kanezawa
1fc76f1b60 Removed IDs from secrets list (#665)
* remove secret ids

* prettier
2017-06-14 10:30:56 +02:00
Albert Martin
020365fd55 Fixed aliased results appearing in list with --safe flag (#672) 2017-06-14 09:28:39 +02:00
David Corwin
348b19e54d Try to clone git repositories over SSH on failure (#671)
* updated help message for `now switch` to reference the argument for the team as the slug instead of the id

* try ssh if https does not work

* add editor settings to .gitignore, update yarn.lock

* reverting change to teams in separate pr

* Removed unused ignored prop
2017-06-14 09:21:48 +02:00
Igor Klopov
588ba5acf1 Stop showing the full build path in stack traces (#669) 2017-06-13 11:59:41 +02:00
Leo Lamprecht
1fba7da419 6.4.1 2017-06-12 22:24:35 +02:00
Leo Lamprecht
3711d09352 Made using an array for the env variable list work 2017-06-12 22:23:45 +02:00
Leo Lamprecht
0fe740f847 6.4.0 2017-06-12 17:22:29 +02:00
Leo Lamprecht
925eb96882 Added npm run clean for cleaning up the development environment 2017-06-12 17:18:10 +02:00
Olli Vanhoja
5080520616 Reduce the number of retries on cert creation (#664)
Retrying multiple times on cert creation doesn't usually help but
makes the user wait for a longer time for nothing. Usually there
is either a configuration error that must be solved or the DNS
change hasn't propagated yet, which will usually take longer than
the retry window.
2017-06-12 17:14:46 +02:00
Leo Lamprecht
ac2a75fe41 Now asking for value of missing environment variables (#645)
* Ask for missing environment variables

* Prettified

* Use `info` helper

* Only apply fields if `now` is available

* Don't log

* Isolate our Inquirer patch

* Patch Inquirer before asking for the env fields

* Don't ask for env vars that are already defined
2017-06-12 16:24:49 +02:00
Igor Klopov
627ded2ee7 Removed useless code from installation mechanism (#663) 2017-06-12 16:10:09 +02:00
Leo Lamprecht
10862abef2 Linked to document about how to install the CLI 2017-06-12 10:15:44 +02:00
Olli Vanhoja
566f8bc17a Ask if the user really wants to add a subdomain as a domain (#662)
Closes #481
2017-06-12 09:54:52 +02:00
greenkeeper[bot]
d108fe9d67 chore(package): update psl to version 1.1.19 (#660) 2017-06-11 11:35:21 +02:00
greenkeeper[bot]
212e8a9d67 chore(package): update lint-staged to version 3.6.1 (#657) 2017-06-10 13:18:28 +02:00
Leo Lamprecht
0d2d056d37 6.3.2 2017-06-10 00:04:53 +02:00
Leo Lamprecht
390eaef7b5 Allowed using process.exit() in installation script 2017-06-09 22:26:55 +02:00
Leo Lamprecht
15b9b258ed Don't trigger installation when in development mode 2017-06-09 22:23:18 +02:00
greenkeeper[bot]
c36b2c0fbf chore(package): update @google/maps to version 0.4.0 (#653) 2017-06-09 16:47:16 +02:00
greenkeeper[bot]
8ed0575796 chore(package): update babel-core to version 6.25.0 (#652) 2017-06-09 16:46:55 +02:00
greenkeeper[bot]
b74b349230 Update prettier to the latest version 🚀 (#648)
* chore(package): update prettier to version 1.4.3

* Bump prettier
2017-06-08 12:18:26 -07:00
Jarmo Isotalo
499bba0324 Don't return an empty object that would then be stored as the user, but (#650)
instead return null which is then easier to catch (as the code already
expects to receive)
2017-06-08 11:37:37 -07:00
greenkeeper[bot]
fc4e07611a chore(package): update inquirer to version 3.1.0 (#644) 2017-06-07 14:47:58 +02:00
greenkeeper[bot]
96389a2898 chore(package): update webpack to version 3.0.0-rc.1 (#643) 2017-06-07 14:47:41 +02:00
greenkeeper[bot]
bcfe6881e0 chore(package): update update-notifier to version 2.2.0 (#640) 2017-06-06 22:12:05 +02:00
greenkeeper[bot]
2d0b0ef2e7 chore(package): update pkg to version 4.0.0 (#634) 2017-06-05 12:40:03 +03:00
Leo Lamprecht
931745ff81 6.3.1 2017-06-03 21:14:04 +02:00
Leo Lamprecht
d6e9640d02 Don't upgrade certain packages automatically 2017-06-03 21:12:51 +02:00
Leo Lamprecht
b6da4e8501 Downgraded socket.io-client 2017-06-03 21:10:25 +02:00
greenkeeper[bot]
1660e425e7 chore(package): update async-retry to version 1.1.1 (#629) 2017-06-03 18:11:49 +02:00
greenkeeper[bot]
4f47b0527a chore(package): update prettier to version 1.4.2 (#628) 2017-06-03 18:11:32 +02:00
Leo Lamprecht
5e81689ede 6.3.0 2017-06-03 17:22:17 +02:00
Leo Lamprecht
18410e9b38 Bumped socket.io-client to the latest version 2017-06-03 17:15:44 +02:00
greenkeeper[bot]
f1a42eb6ab Update prettier to the latest version 🚀 (#626)
* chore(package): update prettier to version 1.4.1

* Prettified everything

* Fixed linting
2017-06-03 17:02:29 +02:00
Albert Martin
ba1543e3e8 Persist current team when using token auth (#616) 2017-06-03 16:48:07 +02:00
Jarmo Isotalo
493d9123fd Option --session-affinity was added for setting session affinity (#600) 2017-06-03 16:44:14 +02:00
Albert Martin
3b11fd1d7e Added --safe flag for skipping aliased deployments (#617) 2017-06-03 16:40:18 +02:00
Naoyuki Kanezawa
01c49c9b1e Made now logs <instance-url> work (#614) 2017-06-03 16:38:32 +02:00
greenkeeper[bot]
c69de6b3ec chore(package): update node-fetch to version 1.7.1 (#627) 2017-06-03 16:36:52 +02:00
Leo Lamprecht
3bef4d1b4e 6.2.6 2017-06-02 22:45:46 +02:00
Igor Klopov
2873dcc4e4 Download from GitHub directly (#625)
* directly downloads the version specified in package.json.version

* catch 'error' event from resp.body
2017-06-02 22:41:15 +02:00
Leo Lamprecht
8c5130fd02 Removed useless dependency 2017-06-02 19:38:21 +02:00
greenkeeper[bot]
f19672a398 chore(package): update lint-staged to version 3.6.0 (#620) 2017-06-02 16:05:27 +02:00
Igor Klopov
d186767b58 Make update notifications work again (#610)
* Revert "Disable update-notifier (#609)"

This reverts commit b7a8f23475.

* pkg@3.0.6

* output 'please update' for both npm and non-npm install
2017-06-01 11:50:46 -07:00
nkzawa
6a9cb8d095 6.2.5 2017-06-01 21:53:47 +09:00
Naoyuki Kanezawa
f29cb1c69e Fix repeated logs and corrupted characters (#611)
* revert socket.io-client version for now

* don't print duplicated build logs
2017-06-01 04:00:36 -07:00
Matheus Fernandes
f2b1de2e5c 6.2.4 2017-05-31 17:23:51 -07:00
Matheus Fernandes
b7a8f23475 Disable update-notifier (#609)
* Revert "Only show update notifications when loaded from npm (#606)"

This reverts commit 3ef666ba8d.

* Revert "Brought the update notification back"

This reverts commit 5d3d9d4f37.
2017-05-31 17:14:17 -07:00
Leo Lamprecht
a48c099ffa Slight improvements to reasons for shipping a pkg-ed binary 2017-05-31 21:09:33 +02:00
Leo Lamprecht
a68004ad8b Another reason for shipping a pkg binary 2017-05-31 08:21:27 +02:00
Leo Lamprecht
1fd521ab27 Improved the link to the Dockerfile docs 2017-05-31 08:20:11 +02:00
Leo Lamprecht
9c44a813ea 6.2.3 2017-05-31 08:14:39 +02:00
Igor Klopov
3ef666ba8d Only show update notifications when loaded from npm (#606)
* Revert "Brought the update notification back"

This reverts commit 5d3d9d4f37.

* add _npmPkg to pkg when now is installed via npm

* Prettified it

* Set _npmPkg to null
2017-05-31 08:09:11 +02:00
Jarmo Isotalo
29a81e1dd6 Show the diff 2017-05-30 16:32:56 -07:00
Leo Lamprecht
5d3d9d4f37 Brought the update notification back 2017-05-30 21:04:11 +02:00
Leo Lamprecht
1e86a4fb13 Support now.name inside package.json
This closes #604
2017-05-30 20:53:58 +02:00
Leo Lamprecht
a933176241 6.2.2 2017-05-30 17:32:14 +02:00
Leo Lamprecht
3fc4dc3725 Removed unused dependency 2017-05-30 17:31:44 +02:00
Leo Lamprecht
207dd6f46b Only log success messages when in TTY
This closes #579
2017-05-30 17:01:16 +02:00
Leo Lamprecht
3411f7f066 Throw an error if current path doesn't exist
This closes #598
2017-05-30 15:23:36 +02:00
Leo Lamprecht
cfa03a6622 6.2.1 2017-05-30 14:41:24 +02:00
Leo Lamprecht
a1aae0da52 Allow type fields in metafiles to hide type prompt
This closes #603
2017-05-30 14:39:45 +02:00
Leo Lamprecht
9e36331621 Bumped dependencies to the latest version 2017-05-30 14:34:19 +02:00
greenkeeper[bot]
4c9034ad10 chore(package): update download to version 6.2.2 (#601) 2017-05-29 15:04:16 -07:00
Albin Ekblom
55184e917f Fix file count with 1 file (#599) 2017-05-29 13:28:57 -07:00
greenkeeper[bot]
6bc6089d2f chore(package): update lint-staged to version 3.5.1 (#595) 2017-05-29 18:14:18 +02:00
Leo Lamprecht
5000b2a90c 6.2.0 2017-05-29 16:59:56 +02:00
Leo Lamprecht
7845b34b2b Determine deployment type like Now Desktop (#589)
* Automatically decide deployment type

* Should be a devDep

* Not throwing anymore if both Dockerfile and package.json exist

* Ask to choose type again

* Revert "Not throwing anymore if both Dockerfile and package.json exist"

This reverts commit 2d7136f2dc870406e60289e33de3b2beaea3a917.

* Prettified
2017-05-28 21:08:16 +02:00
Igor Klopov
cea8aea3c0 the 'now' installation (#590) 2017-05-28 13:43:30 +02:00
Matheus Fernandes
6b6297e061 Fix now domains add -f – it shouldn't throw 2017-05-28 01:22:15 -07:00
Nathan Rajlich
24ce1c2b98 Add now whoami command
This version simply prints out the logged in username,
for consistency.

It no longer prints out the current team name.

Squashed commit of the following:

commit 1d4ef6af9507a1180fd9e84b7cc64c7fe3e815fa
Author: Nathan Rajlich <nathan@tootallnate.net>
Date:   Fri May 26 14:40:00 2017 -0700

    add "whoami" to valid command names

commit 6ea37e49eb1ea2d9b5b12befe26a6a15972e1f6c
Author: Nathan Rajlich <nathan@tootallnate.net>
Date:   Fri May 26 14:37:56 2017 -0700

    don't log current team name in `now whoami`

    Instead, consistently return the logged in username.
2017-05-26 14:40:31 -07:00
Guillermo Rauch
f791b6bd62 Revert "add now whoami subcommand (#587)" (#588)
This reverts commit 44f5b9f0a3.
2017-05-26 14:26:13 -07:00
Nathan Rajlich
44f5b9f0a3 add now whoami subcommand (#587)
Not logged in:

```
$ now whoami
> Not currently logged in! Please run `now --login`.
```

Logged in, stdout is a TTY:

```
$ now whoami
> tootallnate
$ now switch zeit
$ now whoami
> zeit
```

Stdout is NOT a TTY:

```
$ echo "Logged in to Now as $(now whoami)"
Logged in to Now as tootallnate
```

Closes #585.
2017-05-26 14:22:20 -07:00
Matheus Fernandes
20d93f317d Fix useCurrentTeam logic
NOTE: This option is not used anywhere as of right now
2017-05-26 01:32:27 -07:00
Albin Ekblom
5367cecd5f Use correct file count (#586) 2017-05-25 18:28:41 -07:00
greenkeeper[bot]
841d452928 chore(package): update lint-staged to version 3.5.0 (#584) 2017-05-25 20:59:10 +02:00
Cody Brunner
033393fc20 Fixed help message for now alias (#578) 2017-05-25 14:33:14 +02:00
greenkeeper[bot]
804267ae4b chore(package): update webpack to version 2.6.1 (#580) 2017-05-25 14:32:18 +02:00
greenkeeper[bot]
a503ec33ba chore(package): update pkg to version 3.0.5 (#577) 2017-05-24 12:49:06 +02:00
greenkeeper[bot]
882ea23372 chore(package): update download to version 6.2.0 (#574) 2017-05-24 00:16:26 +02:00
Leo Lamprecht
491de33f3d 6.1.1 2017-05-23 21:08:34 +02:00
Leo Lamprecht
81a2b874b9 Indicate how to link the package properly 2017-05-23 21:05:24 +02:00
Igor Klopov
28a3e0f7ce Make now link great again (#573)
* `link` directory to run `npm link` inside

* since `lib` is default source dir name for js (`src` is mostly c++)

* fix linting

* Revert "since `lib` is default source dir name for js (`src` is mostly c++)"

This reverts commit 799edd4e717e66f763593636e7fbbe4b5df239a6.

* Added script for linking
2017-05-23 21:04:14 +02:00
Leo Lamprecht
23bc156a07 Improved filename of postinstall script 2017-05-23 13:57:59 +02:00
Leo Lamprecht
fdc161c6d4 6.1.0 2017-05-23 12:56:19 +02:00
Leo Lamprecht
f5b87517c6 License field added back 2017-05-23 12:56:05 +02:00
Albin Ekblom
1224aa6d87 Added file count, fix #370 (#558)
* Add file count, fix #370

* Remove progress-bar when complete
2017-05-23 12:50:57 +02:00
CHaBou
567210270a Add teams ls command (#563)
* Add `teams ls` command

* Fix Prettier

* Add `teams list` command alias

* Add table output primitive

* Use table output primitive to list team

* Fix name/email for user

* Change indicator for current team
2017-05-23 12:50:07 +02:00
Igor Klopov
ff5d38644c Added 'downloading' and 'interrupted' state (#570)
* move placeholder population to index.js

* detect ctrl+c and put 'please reinstall' to placeholder
2017-05-23 12:48:49 +02:00
greenkeeper[bot]
06e95223be chore(package): update node-fetch to version 1.7.0 (#572) 2017-05-23 12:48:25 +02:00
greenkeeper[bot]
501dbdb13c chore(package): update webpack to version 2.6.0 (#571) 2017-05-23 12:48:10 +02:00
Nathan Rajlich
23abd2a826 make promptBool() return false upon Ctrl+C (#557)
* move `prompt-options.js` to utils/input dir

* make `promptBool()` return false upon Ctrl+C

Also make the `info('Aborted')` output more consistent
across the CLI.

* Revert "handle user abort in `now domains buy` (#554)"

This reverts commit 34151c8193.
2017-05-22 14:41:55 -07:00
Leo Lamprecht
dd4d374552 6.0.5 2017-05-22 21:10:58 +02:00
Leo Lamprecht
8d427de1e3 Retrieve the correct URL for downloading the CLI 2017-05-22 21:10:47 +02:00
Leo Lamprecht
3c8f8a00ae Upload binaries to slack after deploying 2017-05-22 21:00:58 +02:00
Leo Lamprecht
15bed6b4e5 6.0.4 2017-05-22 20:55:37 +02:00
Leo Lamprecht
fe0c4a35cf Read package.json on runtime when downloading 2017-05-22 20:55:29 +02:00
Leo Lamprecht
5536960871 Only include the files that are needed 2017-05-22 20:45:39 +02:00
Leo Lamprecht
1b882989de 6.0.3 2017-05-22 20:35:20 +02:00
Leo Lamprecht
bfb83d7f1a Prepared for the npm release 2017-05-22 20:35:12 +02:00
Leo Lamprecht
672a16168c Always download the specified version 2017-05-22 20:32:50 +02:00
Leo Lamprecht
9654b36f77 Sweetened a title in the readme 2017-05-22 20:23:13 +02:00
Leo Lamprecht
f92e556b7c Build inside a single directory 2017-05-22 20:21:27 +02:00
Leo Lamprecht
c9dabd9a53 Explain why we're shipping the bundled CLI 2017-05-22 20:05:47 +02:00
Leo Lamprecht
bbee653c29 Add now cli proxy (#569)
* unite now-cli and now-cli-proxy into single repo

* fix xo

* package.json.name is `now`
2017-05-22 20:03:27 +02:00
Matheus Fernandes
8eee576d7c 6.0.0 2017-05-22 01:56:27 -07:00
Matheus Fernandes
4f29b6fb8c Make --public skip the OSS prompt 2017-05-22 01:54:50 -07:00
Matheus Fernandes
9802391cc8 Remove now open 2017-05-22 01:42:28 -07:00
Matheus Fernandes
d737b56470 Improve now scale and now alias (#565)
* Improve now alias and scale ux

* Print scaling rules even when there is nothing to change, and fix scale-info

* Allow scale to take alias as parameter

* Remove debug print

* Fix list prefix color

* Fix output styling
2017-05-22 01:37:39 -07:00
Matheus Fernandes
b035f500dd Fix Slack script 2017-05-22 00:28:28 -07:00
Matheus Fernandes
adda12a2ef Show a proper message for non-supported TLDs 2017-05-22 00:21:52 -07:00
Matheus Fernandes
769f8c298a Make the messaging more clear and consistent when buying a domain 2017-05-21 23:30:23 -07:00
Matheus Fernandes
dd1071366d Show the period when prompting for a domain purchase 2017-05-21 23:16:00 -07:00
Leo Lamprecht
bc8fd3346a 5.3.3 2017-05-20 22:48:31 +02:00
Leo Lamprecht
91ddc55d5b Set correct name for bundled binaries 2017-05-20 22:31:07 +02:00
Nathan Rajlich
2b21208b07 note that logs are public with OSS deployments (#562) 2017-05-20 22:26:56 +02:00
Leo Lamprecht
aa4d874b9e More suitable name 2017-05-20 17:38:10 +02:00
Leo Lamprecht
53ca25ef79 5.3.2 2017-05-20 15:11:29 +02:00
Leo Lamprecht
529f6d4248 Made readme explanation even more descriptive 2017-05-20 15:08:40 +02:00
Leo Lamprecht
a7414e69a7 Better description 2017-05-20 15:08:03 +02:00
Leo Lamprecht
82116771c7 Indicate where to find the proxy 2017-05-20 15:04:40 +02:00
Leo Lamprecht
a4c22f0c06 Removed husky because it is not needed 2017-05-20 13:06:00 +02:00
Leo Lamprecht
b189d4ce97 Don't build slack script 2017-05-20 13:02:24 +02:00
Leo Lamprecht
41bebe8e12 Don't show warnings when linting 2017-05-20 12:56:23 +02:00
Leo Lamprecht
7352306deb Removed build step 2017-05-20 12:52:09 +02:00
Leo Lamprecht
7c1b09c823 We'll never put this on npm directly 2017-05-20 12:48:09 +02:00
Leo Lamprecht
5657943b73 Unncessary package fields removed 2017-05-20 12:47:54 +02:00
greenkeeper[bot]
3253586096 fix(package): update ignore to version 3.3.1 (#560) 2017-05-19 23:13:15 +02:00
Albin Ekblom
6602b8ac36 Replace fs-promise with fs-extra (#559) 2017-05-19 12:59:42 +02:00
Nathan Rajlich
cde2647587 show usage message upon login (#556)
Rather than eagerly deploying upon first usage.

Fixes #533.
2017-05-18 12:02:28 -07:00
Nathan Rajlich
34151c8193 handle user abort in now domains buy (#554)
Fixes #547.
2017-05-18 09:53:28 -07:00
Jarmo Isotalo
84204d7b59 Improve scaling for static deployments 2017-05-17 16:37:26 -07:00
greenkeeper[bot]
3973798a99 chore(package): update lint-staged to version 3.4.2 (#553) 2017-05-17 23:57:10 +02:00
Nathan Rajlich
bc26a57d7c Don't print out stack traces upon user abort (#544)
* remove `instanceof` check

Use duck-type checking instead.

* handle USER_ABORT errors in `handleError()`

* don't print out stack traces upon user abort

Also eliminates the usage of `async-retry` since it was
pretty much overkill for this use case. Instead just extract
the logic out into its own function and call it recursively
when we have to do the user prompt.

* Print `Aborted` upon user about
2017-05-17 13:25:04 -07:00
Jarmo Isotalo
6c86472f57 Try to make sure prettier doesn't make us waste time again (#551)
* Try running prettier, if it modifies the code fail

* Prettify
2017-05-17 12:30:40 -07:00
Leo Lamprecht
e6601b549c 5.3.1 2017-05-17 18:39:44 +02:00
Olli Vanhoja
5040b71173 Fix ls listing for 0 priorities (#550) 2017-05-17 18:29:39 +02:00
Jarmo Isotalo
1076bdc348 Remove unnecessary step from caught a bug list. 2017-05-16 17:07:34 -07:00
greenkeeper[bot]
559cfcb427 fix(package): update ms to version 2.0.0 (#546) 2017-05-16 14:31:25 +02:00
Jarmo Isotalo
f66032b1b6 Don't try scaling static deployments (#543)
* Don't try scaling static deployments

* Use `error` instead of `console.log`
2017-05-15 15:57:55 -07:00
Nathan Rajlich
2ebd4be0d8 remove id from now domains ls (#541)
Also moves the URL to the first column of the table,
swapping the `domain` and `dns` fields.
2017-05-15 14:57:34 -07:00
Nathan Rajlich
4f64762ffc exit the process immediately upon Ctrl+C (#540)
During the deployment selection prompt, don't print out a stack
trace of the "Aborted" error to the user, just exit the process
directly.
2017-05-15 13:17:49 -07:00
Leo Lamprecht
8cdc0ac9c0 5.3.0 2017-05-15 17:07:53 +02:00
Leo Lamprecht
42c1e16d3a Bumped dependencies to the latest version 2017-05-15 17:07:19 +02:00
Jarmo Isotalo
14dbbcec41 Make now scale ls to work with static deployments 2017-05-15 02:33:58 -07:00
Tony Kovanen
9483e8a736 Instantly complete static deployments after sync 2017-05-14 23:42:18 -07:00
Tony Kovanen
4763e4cbff Hide scale settings for static deploys 2017-05-14 23:16:21 -07:00
Tony Kovanen
095569969b Proper getting of files for static deployments 2017-05-14 23:06:40 -07:00
Tony Kovanen
ea7dadeb67 Fix getting files for static deployments 2017-05-14 22:50:29 -07:00
Tony Kovanen
45e55d58e2 Support static types when deploying 2017-05-14 20:39:43 -07:00
Tony Kovanen
91de162fd5 New static deployment support 2017-05-14 20:36:28 -07:00
greenkeeper[bot]
73b5464d1a chore(package): update pkg to version 3.0.4 (#538) 2017-05-14 11:50:50 +02:00
greenkeeper[bot]
ba713d2fdb fix(package): update clipboardy to version 1.1.2 (#537) 2017-05-13 18:32:48 +02:00
greenkeeper[bot]
cce19f01b3 fix(package): update download to version 6.1.0 (#535) 2017-05-12 18:05:48 +02:00
greenkeeper[bot]
db31624fd7 fix(package): update socket.io-client to version 2.0.0 (#524) 2017-05-09 08:04:52 +02:00
Matheus Fernandes
d3a37e052b 5.2.3 2017-05-08 06:25:02 -07:00
Matheus Fernandes
60837a0368 Show a nicer error if trying to buy a domain without a credit card 2017-05-08 06:24:35 -07:00
greenkeeper[bot]
37107ddc9a fix(package): update email-prompt to version 0.3.0 (#520) 2017-05-08 15:14:59 +02:00
Leo Lamprecht
809ce879c0 5.2.2 2017-05-08 10:23:38 +02:00
Leo Lamprecht
0981262132 Pinned progress dependency 2017-05-08 10:22:27 +02:00
Leo Lamprecht
d6c29ace51 Updated serve to the latest version 2017-05-08 10:21:56 +02:00
Leo Lamprecht
97e6db13f2 Bumped dependencies to the latest version 2017-05-08 10:12:25 +02:00
Matheus Fernandes
9213e8acda Fix domain/subdomain usage on now alias's buy logic 2017-05-07 21:35:49 -07:00
Matheus Fernandes
51e2951dee userId => uid 2017-05-05 19:24:59 -07:00
Matheus Fernandes
14a3a0205d Tweak docs 2017-05-05 19:23:04 -07:00
Nathan Rajlich
7e0f5f1a56 dynamically update the "serve" version for static deployments (#513)
Since we use Greenkeeper to update dependencies for `now-cli`,
we can depend on it to keep the version of `serve` that we use
for static deployments up-to-date at all times.
2017-05-05 19:03:23 -07:00
Nathan Rajlich
68a3f51dff implement public property for now.json and pkg.now
Closes #463.
2017-05-05 16:06:46 -07:00
Nathan Rajlich
3902a7da62 update "serve" for static deployments to v5.1.4 2017-05-05 16:03:21 -07:00
Matheus Fernandes
08049e2e05 5.2.1 2017-05-05 15:26:32 -07:00
Matheus Fernandes
26b9d64b61 Add missing break 2017-05-05 15:23:53 -07:00
greenkeeper[bot]
cd470813da chore(package): update pkg to version 3.0.3 (#512) 2017-05-05 14:34:33 -07:00
Nathan Rajlich
49a2a645c8 refactor the readMetaData() function (#508)
* refactor the `readMetaData()` function

* add a couple new test cases

* test: restore "build" prefix

Fixes Node.js <= v6

* add default values for `npm`/`docker` get files functions

Makes the logic simpler, since we don't have to check for existence.

* throw an error when missing start/now-start or server.js

* pass in entire `readMetaData()` result to Now.create()

This avoids us reading these files from the filesystem again
2017-05-05 14:10:22 -07:00
Matheus Fernandes
b35e7e7411 5.2.0 2017-05-05 13:09:21 -07:00
Matheus Fernandes
8ebd5b91ec Prettier stuff 2017-05-05 13:04:13 -07:00
Matheus Fernandes
1478009c22 Remove lockfile 2017-05-05 12:58:18 -07:00
Matheus Fernandes
b6dadac9f5 Add now login and document now logout 2017-05-05 12:57:48 -07:00
Jarmo Isotalo
a1e5ba0b26 Remove id's from now-alias (#500)
* Remove id's from now-alias

* Colors

* Less hacky formatting
2017-05-05 12:49:48 -07:00
Matheus Fernandes
8b306e657b Fix --token support
Closes #499
Closes #474
Closes #484
2017-05-05 12:04:09 -07:00
Matheus Fernandes
b0593c1f33 Remove useless HTTP header 2017-05-05 12:02:06 -07:00
Jarmo Isotalo
9e22ad34d2 Fix path alias updates (#493)
* Catch path alias changes correctly
Fixes #492

* And the automatic petteier changes for alias
2017-05-04 16:17:05 -07:00
Jarmo Isotalo
bc0b06721a Sort now scale ls output similarly to now ls (#494)
* Sort `now scale ls` similarly how `now ls` is sorted

* Remove unused dependency
2017-05-04 16:16:13 -07:00
greenkeeper[bot]
bde309850e fix(package): update docker-file-parser to version 1.0.2 (#496) 2017-05-04 16:10:18 -07:00
Jarmo Isotalo
b67e683f38 Fixes an error of missing context after logging in while deploying. (#498)
```
> Error! Unknown error: TypeError: Cannot read property 'username' of undefined
TypeError: Cannot read property 'username' of undefined
    at /usr/local/lib/node_modules/now/build/bin/now-deploy.js:316:115
    at Generator.next (<anonymous>)
    at c (/usr/local/lib/node_modules/now/build/bin/now-deploy.js:760:99)
```
2017-05-04 16:08:08 -07:00
Jarmo Isotalo
a09abbcad4 Always scale up but never down when matching scale on alias (#504) 2017-05-04 15:54:31 -07:00
Jarmo Isotalo
c05405e193 Read docker label correctly, fixes #368 (#501) 2017-05-04 15:53:22 -07:00
Igor Klopov
c97edc61b5 Move list of pkg targets to package.json.pkg.targets (#503) 2017-05-04 15:51:12 -07:00
Matheus Fernandes
04f457550e Log the body of the request when the first step of a login fails 2017-05-03 19:49:07 -07:00
greenkeeper[bot]
0cf8c73602 chore(package): update prettier to version 1.3.0 (#487) 2017-05-03 00:52:01 +02:00
Matheus Fernandes
013061a6a3 5.1.2 2017-05-02 14:39:00 -07:00
Matheus Fernandes
c51743153d Pass missing variable 2017-05-02 14:38:35 -07:00
Matheus Fernandes
0f10a7bcda Fix undefined var usages + prettify 2017-05-02 14:12:10 -07:00
Matheus Fernandes
f421eee664 5.1.1 2017-05-02 14:07:17 -07:00
Matheus Fernandes
1773cfc817 Log more info when --login fails 2017-05-02 14:04:08 -07:00
Matheus Fernandes
0d92683420 Merge branch 'master' of github.com:zeit/now-cli 2017-05-02 14:03:50 -07:00
Tim Neutkens
9964d0e4fd now scale <id> auto (#485) 2017-05-02 22:30:49 +02:00
Matheus Fernandes
5f48a289d5 Fix calls to undefined.price while aliasing 2017-05-02 12:16:04 -07:00
Nathan Rajlich
554170e3b4 check for Dockerfile when now.json is present (#486)
Consider a tree like:

```
.
├── Dockerfile
└── now.json

0 directories, 2 files
```

Before this patch, this deployment would be considered a "static"
deployment, which is incorrect. Now it is properly detected
as a "docker" deployment type.
2017-05-02 11:29:28 -07:00
Leo Lamprecht
66557d79bb 5.1.0 2017-05-02 12:22:20 +02:00
Leo Lamprecht
f165778e55 Removed useless file 2017-05-02 12:12:10 +02:00
Leo Lamprecht
b0a88b377c Prettified everything 2017-05-02 12:10:22 +02:00
Leo Lamprecht
c90ca1b859 Tell prettier not to use semicolons 2017-05-02 12:08:18 +02:00
Steve Faulkner
0c4f9dcd62 Add support for now alias domain.tld (#467) 2017-05-02 12:06:18 +02:00
Leo Lamprecht
09c3de40cc Added now logout 2017-05-02 11:51:53 +02:00
greenkeeper[bot]
03def6c052 fix(package): update ignore to version 3.3.0 (#482)
https://greenkeeper.io/
2017-05-02 11:20:30 +02:00
Nathan Rajlich
cc8e0b8e4a Use implicit "start" script when server.js exists
Moves the verification step to the `create()` function,
instead of in `readMetaData()`.

Closes https://github.com/zeit/now-cli/issues/181.
2017-05-02 11:10:44 +02:00
Nathan Rajlich
e0e5d03949 Do not truncate lines from build logs
Is is disrupting to remove logs that are potentially
useful for diagnosing when something is going wrong
when starting up / building a deployment.

Just log stdout in its entirety to the `now` build output
with no lines being removed in the process.

As discussed with @rauchg.
2017-05-02 11:06:40 +02:00
nkzawa
9889a3b3d0 always strip trailing / 2017-05-02 11:04:11 +02:00
nkzawa
eb48779827 logs: check if deployment url includes path 2017-05-02 11:03:58 +02:00
Leo Lamprecht
2a25bfcee4 Indicate how to buy a new domain
This closes #473
2017-05-02 10:34:10 +02:00
Jarmo Isotalo
1248c46295 Improve command line args validation. Fixes #478. 2017-05-02 01:23:29 -07:00
Leo Lamprecht
c1ba650ec4 Replace copy-paste with clipboardy
This closes #457
2017-05-02 10:19:26 +02:00
Leo Lamprecht
b2fe453993 Bumped dependencies to latest version 2017-05-02 10:13:40 +02:00
greenkeeper[bot]
594534250d chore(package): update pkg to version 3.0.1 (#476)
https://greenkeeper.io/
2017-05-01 19:23:07 -07:00
Jarmo Isotalo
d24bb92dea Don't fail when no deployments are found Fixes #471 2017-05-01 12:49:28 -07:00
Nathan Rajlich
5a295017ec Fix failing tests on master branch (#469)
* remove "always-include-main" test case

It was testing for incorrect behavior that has now been fixed.

See: https://github.com/zeit/now-cli/pull/464

* remove "files" array from `main` related test cases

Makes these three tests pass once again.

* always run a test for "pack-now" even when not in CI

Otherwise `ava` fails because the test did not
run any assertions.
2017-05-01 11:39:25 -07:00
Matheus Fernandes
e59e7616c7 Add logs, teams, switch, scale, new ls and much more (#468)
* Feature/teams (#25)

* Add the skeleton of `now teams`

* Add support for "complex" command aliases

This adds the ability to set, for example, `now switch` as an alias for `now teams switch`.
Subsequent commands and arguments are taken into account: `now switch zeit --debug` will be parsed to `now teams switch zeit --debug`.

* `now switch` => `now teams switch`

* Extract `rightPad`

* Extract `eraseLines`

* Extract `✓`

* Text input: add `valid` option

* Text input: add `forceLowerCase` option

* Add preliminary `now teams add`

* Make the linter happy

* Extract `> NOTE: ...`

* Add missing labels

* Fix typos

* Add missing parameters

* Change the section label after inviting all specified team mates

* Call the API after each email submission

* Show the elapsed time after each `inviteUser` api call

* Handle user aborts

* We don't need `args` for `now teams add`

* Add missing `await`

* Extract regex

* `process.exit()` => `exit(1)`

* `prompt-bool` is an `input` util, not an `output` one

* Add the ability to delete a key from the config file

* Add `fatal-error`

* Add `now teams invite`

* This shouldn't be black

* Save the username in `~/.now.json` upon login

* Save the token and userId instead of token and email

* Fix typo

* Save more info about the user to `~/.now.json` upon login

* `~/.now.json`: Persist the current time when login in

* Add `user` helper

* `user.userId` => `user.id`

* Tweak code organization

* Add caching system to `.now.json`

* Automatically switch to a team after its creation

* Introduce the concept of `inactive` teams

* Use bold for `payment method`

* Remove duplicated code

* Add line breaks

* Auto complete with the first match

* Remove placeholder stuff

* Add the user's email to the list of suggestions

* FIx bad merge

* Add `now switch`

* Make `now teams invite` more reliable and faster

* Shut up XO

* Improve autocompletion

* Fix TypeError

* Make stuff pretty

* Not sure how this got overwritten

* Feature/domains (#26)

* Add the skeleton of `now teams`

* Add support for "complex" command aliases

This adds the ability to set, for example, `now switch` as an alias for `now teams switch`.
Subsequent commands and arguments are taken into account: `now switch zeit --debug` will be parsed to `now teams switch zeit --debug`.

* `now switch` => `now teams switch`

* Extract `rightPad`

* Extract `eraseLines`

* Extract `✓`

* Text input: add `valid` option

* Text input: add `forceLowerCase` option

* Add preliminary `now teams add`

* Make the linter happy

* Extract `> NOTE: ...`

* Add missing labels

* Fix typos

* Add missing parameters

* Change the section label after inviting all specified team mates

* Call the API after each email submission

* Show the elapsed time after each `inviteUser` api call

* Handle user aborts

* We don't need `args` for `now teams add`

* Add missing `await`

* Extract regex

* `process.exit()` => `exit(1)`

* `prompt-bool` is an `input` util, not an `output` one

* Add the ability to delete a key from the config file

* Add `fatal-error`

* Add `now teams invite`

* This shouldn't be black

* Save the username in `~/.now.json` upon login

* Save the token and userId instead of token and email

* Fix typo

* Save more info about the user to `~/.now.json` upon login

* `~/.now.json`: Persist the current time when login in

* Add `user` helper

* `user.userId` => `user.id`

* Tweak code organization

* Add caching system to `.now.json`

* Automatically switch to a team after its creation

* Introduce the concept of `inactive` teams

* Use bold for `payment method`

* Remove duplicated code

* Add line breaks

* Auto complete with the first match

* Remove placeholder stuff

* Add the user's email to the list of suggestions

* FIx bad merge

* Add `now switch`

* Make `now teams invite` more reliable and faster

* Shut up XO

* Improve autocompletion

* Fix TypeError

* Make stuff pretty

* Not sure how this got overwritten

* `prompt-bool` is an `input` util, not an `output` one

* Make stuff pretty

* Not sure how this got overwritten

* Add domains.status, price and buy

* Add `now domains buy`

* Add the ability to buy a domain when running `now alias`

* Logs (#27)

* Added `logs` sub command

* add missing dependencies

* use utils/output/logo

* logs: fix wrong reference

* logs: fix buffer time

* sort build logs (#19)

* logs: use lib/logs

* lib/logs: fix

* logs: resolve url to id

* logs: default to follow

* logs: don't resolve URL to id

* logs: revert to default unfollow

* logs: add since option and until option

* logs: fix default number of logs

* fix logs auth

* logs: listen ready event

* logs: new endpoint

* log: remove v query param

* logs: default to not include access logs

* fix styles of now-logs

* logs: remove relative time

* Fix bad merge conflict

* Add `now scale` (#28)

* Inital drafts fro `now-scale`

* More final draft

* sketch new `now ls` format

* Add sketch for `now ls --all`

* Placeholder for `now scale ls`

* "Prettify" and improve scale command

Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>

* Adopt to now-list api changes

* Improve now-list --all colors

Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>

* Add now scale ls

Signed-off-by: Jarmo Isotalo <jamo@isotalo.fi>

* Prettify

* Show auto correctly

* Add partial match scale for now alias

* Make alias to match scale before uptading alias and presumably a bunch of unrelated style changes

* Replace spinners with help text

* Make the list :nice:

* Make now-list great again

* Final touches

* Allow --all only when app is defined

* Add progress tracking to scale

* Correctly use --all for > 0 deployments found [1s] and improve scale info ux

* Show --all info if we are hiding stuff

* Fixes

* Refactor scale info and unfreeze

* Fixes

* Proper progress bar

* Fix bad merge

* Fix auth for now-scale

* logs: fix reading config

* Fix reference

* Small ux tweaks

* Improve now alias ux

* Fix a ton of lint errors

* Fix scaling up and alias ux

* Fix lint errors + prettify

* Make `bin/now-scale.js` available via `now scale`

* Fix errornous syntax for domains list

* And use correct header for domains list

* Update now-scale help to match new spec

* `await` for `cfg.read()` on `cfg.remove()`

* Update scale command

* Cleanu
p

* Fetch the teams from the api on teams.ls()

Plus prettier shit

* Run prettier hooks manually

* Make `now switch` perfect

* Rm unused variables

* Lint

* Ruin ux but lint

* Consume `POST /teams`

* Consume `PATCH /teams/:id`

* Fix/teams support (#29)

* Add teams support for lib/index.js

* Consume `POST /teams/:id/members`

* Make `now teams create` and `now teams invite` perfect

* Add a way to not send `?teamId` if necessary

* Add `?teamId=${currentTeam.id}` support to all comamnds and subcommands

* Display the username only if it's available

* Consume the preoduction endpoits for domain purchase

* Fix typo

* Fix grammar

* Fix grammar

* Remove useless require

* Display the user name/team slug on creation/list commands

* Remove use of old, now undefined variable

* Show domains in bold on `now domains ls`

* `user.userId` => `user.uid`

* Remove console.log

* Show a better messsage upon unexpected `domains.buy()` error

* typo

* Consume new `/plan` API and fix plan check

* Update `now upgrade` – consume new APIs and expose new plans

* Fix `now ugprade` info message

* `now cc`: consume new APIs and fix error messages

* Add team/user context to `now alias` when buying a domain

* Fix wording on `now domains buy`

* Add stamp to domain purchase

* Improve scale ux

* Remove ToS prompt upon login

* Fix `prompt-bool` trailing issues

* Remove useless `require`

* Allow `now switch <username>`

* Make `now help` better

* This shouldn't be here

* Make `now switch` incredible

* Remove old stuff from ~/.now.json

* Add comments

* `now team` => `now teams`

* 5.0.0

* Fix linter

* Fix DNS

* Parse subdomain

* FIx lint

* drop IDs for certs

* Make now ls look nice also when noTTY

* Make now list look nice when colors are not supported

* Mane certs ls look nice when we have no colers

* Now ls --all can also take uniq url as a parameter

* Improve now ls --all

* Now ls -all takes alias as an argument
2017-05-01 11:26:08 -07:00
Nathan Rajlich
60b1859317 don't include the "main" file by default (#464)
It's not correct to forcefully include the file specified in "main"
at upload-time. Consider an `npm run build` script that ends up
creating the file that "main" specifies. It would not exist until
inside the deployment, after the build script is ran for that
deployment.

Fixes https://github.com/zeit/now-cli/issues/281.
2017-04-28 16:21:00 -07:00
greenkeeper[bot]
befcceefd0 fix(package): update ansi-escapes to version 2.0.0 (#454)
https://greenkeeper.io/
2017-04-24 10:07:48 +02:00
Tim Neutkens
930c2eb90a Check if name is empty (#451) 2017-04-20 13:56:47 -04:00
Matheus Fernandes
22150f5fd6 Remove useless require 2017-04-19 13:19:02 -07:00
Matheus Fernandes
6d92cfd0b8 Await for the removal 2017-04-18 21:04:24 -07:00
Matheus Fernandes
5682d00bf3 Do not hang forever if not on a TTY 2017-04-18 21:02:27 -07:00
Tim Neutkens
425b54e6f3 Fix method typo (#446) 2017-04-17 19:24:57 +02:00
greenkeeper[bot]
3714ed7fa6 fix(package): update arr-flatten to version 1.0.3 (#445)
https://greenkeeper.io/
2017-04-17 17:10:48 +02:00
Matheus Fernandes
f1dbdc58f6 Do not print a new line after the prompt "message" 2017-04-17 01:41:28 -07:00
Leo Lamprecht
676ac019ab Remove error message for older node versions
As discussed with @timneutkens
2017-04-15 15:25:15 +02:00
Leo Lamprecht
2055271732 4.11.2 2017-04-15 15:10:44 +02:00
Leo Lamprecht
99f677652b Show proper error if start and now-start scripts are missing 2017-04-15 15:10:27 +02:00
Leo Lamprecht
4af632dfa5 Make error message appear below node 6 2017-04-15 15:06:15 +02:00
greenkeeper[bot]
270532221c chore(package): update slackup to version 2.0.1 (#442)
https://greenkeeper.io/
2017-04-14 21:11:41 +02:00
greenkeeper[bot]
a5ba36ad65 chore(package): update slackup to version 2.0.0 (#441)
https://greenkeeper.io/
2017-04-14 20:54:21 +02:00
greenkeeper[bot]
9b3c14862b fix(package): update arr-flatten to version 1.0.2 (#440)
https://greenkeeper.io/
2017-04-14 13:29:41 +02:00
greenkeeper[bot]
08279a03e3 chore(package): update prettier to version 1.1.0 (#439)
https://greenkeeper.io/
2017-04-13 20:09:06 -07:00
greenkeeper[bot]
a5e26ac2ab chore(package): update prettier to version 1.0.0 (#437)
https://greenkeeper.io/
2017-04-13 20:36:38 +02:00
Matheus Fernandes
f3736dc6b9 Increase the timeout for "unwanted" builds 2017-04-12 17:43:19 -07:00
Leo Lamprecht
c8d8daa334 4.11.1 2017-04-11 13:12:38 +02:00
Leo Lamprecht
7e16fd0eda Show general help when running now help help
This closes #419
2017-04-11 12:40:12 +02:00
Leo Lamprecht
fb9f3962b8 Bumped dependencies to the latest version 2017-04-11 12:32:13 +02:00
Leo Lamprecht
c2b39a0965 Invalidate cache for Slack badge 2017-04-11 12:24:55 +02:00
Matheus Fernandes
8064465322 4.11.0 2017-04-09 15:35:59 -07:00
Naoyuki Kanezawa
05ed90e2a2 Auth build logger (#425)
* sort build logs (#19)

* authenticate build logger
2017-04-09 15:29:07 -07:00
Matheus Fernandes
9717d06a55 Prompt the user before uploading OSS code (#435)
* Make `promptBool` print nothing as trailing by default

* Prompt OSS users before uploading the code

* Fetch the plan as soon as possible

* Use `info` on `prompt-bool`

* Fix trailing print on `prompt-bool`

* Better wording for the message

* Erease the prompt after receivng an answer
2017-04-09 15:23:35 -07:00
Matheus Fernandes
f8d345dc17 Delay the message when ignoring the node version 2017-04-07 21:52:19 -07:00
Matheus Fernandes
cba4f154c6 prettify stuff 2017-04-07 21:49:37 -07:00
Naoyuki Kanezawa
0962246f03 add prettier (#416) 2017-04-07 21:47:34 -07:00
Matheus Fernandes
0915a19f48 Feature/slack builds (#432)
* Upload builds to Slack after every commit

* Make XO happy

* chmod +x

* Do not skip pull requests

* Add `slackup` dependency

* Use the new `slackup` API

* `node` === latest

* `msg2` => `msg`

* Build the slack script before using it on CI

* Shut up XO

* chmod +x

* Move the built scripts to the `build` directory

* Bump `slackup`

* Fix spacing

* fml

* Let the Slack know when the node version is being skipped
2017-04-07 21:42:08 -07:00
greenkeeper[bot]
719b3a2630 fix(package): update ignore to version 3.2.7 (#428)
https://greenkeeper.io/
2017-04-06 21:39:20 -07:00
greenkeeper[bot]
6e266cfbcd fix(package): update progress to version 2.0.0 (#415)
https://greenkeeper.io/
2017-04-04 19:12:43 +02:00
greenkeeper[bot]
b954d26d6d fix(package): update psl to version 1.1.18 (#412)
https://greenkeeper.io/
2017-04-02 09:42:01 +02:00
greenkeeper[bot]
83c003cba9 fix(package): update stripe to version 4.17.0 (#409)
https://greenkeeper.io/
2017-03-31 23:36:21 +02:00
Leo Lamprecht
264d6fa3c4 4.10.3 2017-03-30 21:54:57 +02:00
Leo Lamprecht
9837b7ff28 Allow subdomain param in now dns to be a number 2017-03-30 21:54:46 +02:00
greenkeeper[bot]
0ac9896e7c fix(package): update stripe to version 4.16.1 (#408)
https://greenkeeper.io/
2017-03-30 20:15:03 +02:00
greenkeeper[bot]
2d38d38c95 fix(package): update fs-promise to version 2.0.2 (#405)
https://greenkeeper.io/
2017-03-26 16:25:54 +02:00
greenkeeper[bot]
b6b736baa2 chore(package): update xo to version 0.19.0 (#404)
https://greenkeeper.io/
2017-03-25 21:20:04 +01:00
Leo Lamprecht
6f76fc4612 We're only extending a single ESLint config 2017-03-25 15:22:05 +01:00
greenkeeper[bot]
1f30e8ccac fix(package): update bytes to version 2.5.0 (#402)
https://greenkeeper.io/
2017-03-25 08:07:56 +01:00
greenkeeper[bot]
002e254f18 chore(package): update husky to version 0.13.3 (#399)
https://greenkeeper.io/
2017-03-24 16:36:06 +01:00
greenkeeper[bot]
676d2858f5 fix(package): update ora to version 1.2.0 (#400)
https://greenkeeper.io/
2017-03-24 16:35:52 +01:00
greenkeeper[bot]
a5321ae623 fix(package): update fs-promise to version 2.0.1 (#397)
https://greenkeeper.io/
2017-03-24 10:40:29 +01:00
greenkeeper[bot]
c6b4823574 fix(package): update stripe to version 4.16.0 (#395)
https://greenkeeper.io/
2017-03-22 21:20:55 +01:00
Leo Lamprecht
35ccd93cb0 Create binaries before deploying 2017-03-22 20:27:09 +01:00
Leo Lamprecht
a75cb9cd62 4.10.2 2017-03-21 14:25:46 +01:00
Leo Lamprecht
7d75703825 Make now dns rm work again 2017-03-21 14:23:51 +01:00
Leo Lamprecht
97437870ca 4.10.1 2017-03-21 11:14:31 +01:00
Leo Lamprecht
b1663954fe Removed useless async decleration 2017-03-21 11:06:31 +01:00
Leo Lamprecht
9c280f896f Made code faster by removing moot await 2017-03-21 10:59:38 +01:00
Leo Lamprecht
b190c0fff5 Removed duplicated "Error" prefix from error messages 2017-03-21 10:49:28 +01:00
Leo Lamprecht
1f85f6d5db Moved back to XO for linting
cc @sindresorhus
2017-03-21 10:31:26 +01:00
Leo Lamprecht
7d19ad2e83 Prettified everything 2017-03-21 09:42:53 +01:00
greenkeeper[bot]
d0e256f0eb fix(package): update ms to version 1.0.0 (#394)
https://greenkeeper.io/
2017-03-19 22:48:06 +01:00
Leo Lamprecht
d3f33b144a 4.10.0 2017-03-19 22:18:25 +01:00
Leo Lamprecht
a49a033408 Upgraded instance of serve 2017-03-19 22:17:54 +01:00
Leo Lamprecht
417fc70572 Linked to documentation 2017-03-19 22:16:52 +01:00
Leo Lamprecht
468b690f9f Use ESLint for checking for code style 2017-03-19 22:13:54 +01:00
Leo Lamprecht
6827853915 Flag for XO removed 2017-03-19 21:53:52 +01:00
Leo Lamprecht
4dd2f5c96c Use single quotes when prettifying the code 2017-03-19 21:52:54 +01:00
Leo Lamprecht
4119c17abe Prettified everything 2017-03-19 21:51:57 +01:00
Leo Lamprecht
20d5c5bfd6 Replaced XO with Prettier 2017-03-19 21:49:02 +01:00
greenkeeper[bot]
c7c47a935d chore(package): update xo to version 0.18.0 (#392)
https://greenkeeper.io/
2017-03-18 15:58:01 -07:00
greenkeeper[bot]
9d1d47a591 chore(package): update pkg to version 3.0.0-beta.29 (#385)
https://greenkeeper.io/
2017-03-17 09:18:11 +01:00
greenkeeper[bot]
6ba3544fa7 fix(package): update ignore to version 3.2.6 (#383)
https://greenkeeper.io/
2017-03-17 09:17:54 +01:00
greenkeeper[bot]
82e9193180 fix(package): update ignore to version 3.2.5 (#382)
https://greenkeeper.io/
2017-03-15 14:11:50 +01:00
Leo Lamprecht
74f7812778 4.9.0 2017-03-15 09:58:32 +01:00
Naoyuki Kanezawa
ea35eb19ee sort build logs (#19) 2017-03-15 09:57:14 +01:00
Matheus Fernandes
d6edca4d01 Ask the user to agree with our ToS and Privacy Polic upon login 2017-03-13 17:08:55 -03:00
Leo Lamprecht
694258813a Upload binaries to GitHub Releases automatically 2017-03-13 19:11:48 +01:00
greenkeeper[bot]
9c873db26c fix(package): update psl to version 1.1.17 (#381)
https://greenkeeper.io/
2017-03-13 19:02:46 +01:00
Leo Lamprecht
3cdaece9cd 4.8.1 2017-03-13 18:49:48 +01:00
greenkeeper[bot]
4d68d8d842 chore(package): update husky to version 0.13.3-0 (#379)
https://greenkeeper.io/
2017-03-13 08:17:34 +01:00
Matheus Fernandes
14cd7e02ee Brought [cmd] value for now billing back
This reverts commit 55633bbd33.
2017-03-13 08:08:15 +01:00
Matheus Fernandes
b276eff149 4.8.0 2017-03-13 00:11:58 -03:00
Jarmo Isotalo
a3bb086e5a Improve path alias ux (#376)
* Improved UX for showing errors on path based aliases

*   Refactor our read confirmation

* Cleanup now-alias to use read-confirmation

* `read-bool` is an input util, not an output one

* Use `prompt-bool` instead of `read-confimation`

* Make `prompt-bool` print a new line before resolving/rejecting
2017-03-13 00:10:52 -03:00
Leo Lamprecht
55633bbd33 The billing and cc commands do not accept a value 2017-03-12 19:28:50 +01:00
Matheus Fernandes
edde07a21f Ask the user to --force if the build step fails 2017-03-11 19:42:40 -03:00
Olli Vanhoja
c2c2285136 Add support for SRV DNS records (#371) 2017-03-10 17:35:26 -03:00
greenkeeper[bot]
38db333353 fix(package): update stripe to version 4.15.1 (#375)
https://greenkeeper.io/
2017-03-09 10:38:40 +01:00
greenkeeper[bot]
a604ac647a fix(package): update ms to version 0.7.3 (#374)
https://greenkeeper.io/
2017-03-08 23:14:41 +01:00
Matheus Fernandes
ea6f43658a 4.7.1 2017-03-08 09:12:29 -03:00
Jarmo Isotalo
d3ed44132d Fix happy side effectss on domain setup (#372) 2017-03-07 17:36:48 -03:00
Leo Lamprecht
33cc1160cd 4.7.0 2017-03-07 09:59:42 +01:00
Jarmo Isotalo
61962e841f Add support for path based routes 2017-03-07 10:48:15 +02:00
Leo Lamprecht
e7386ebce5 Test on LTS version of Node as well 2017-03-06 12:32:01 +01:00
Leo Lamprecht
349c0c9244 Added now open to usage information 2017-03-06 12:31:39 +01:00
greenkeeper[bot]
0d11148da4 fix(package): update inquirer to version 3.0.6 (#369)
https://greenkeeper.io/
2017-03-03 21:56:52 +01:00
greenkeeper[bot]
d09b641db3 chore(package): update husky to version 0.13.2 (#364)
https://greenkeeper.io/
2017-03-02 22:04:22 +01:00
Leo Lamprecht
e5babe0c7c Run serve in production mode and update it 2017-02-28 23:05:18 +01:00
Leo Lamprecht
150e79a814 4.6.1 2017-02-27 22:09:43 +01:00
Igor Klopov
133d0d93da Pkg with node async/await support (#360)
* pkg 3.0.0-beta.28

* use non-transpiled code for packing
2017-02-27 21:26:12 +01:00
greenkeeper[bot]
5a3f30ca0e fix(package): update inquirer to version 3.0.5 (#358)
https://greenkeeper.io/
2017-02-27 21:25:00 +01:00
Matheus Fernandes
82ccf3da37 Name => Full Name 2017-02-27 14:06:55 -03:00
greenkeeper[bot]
1ae05ffddf fix(package): update cross-spawn to version 5.1.0 (#357)
https://greenkeeper.io/
2017-02-27 06:19:48 +01:00
Igor Klopov
b257d1e92b Use lib/pkg.js instead of pkg.json (#356)
* seems the file is outdated and not needed

* new pkg.js instead of pkg.json - reads .. and ../..
2017-02-25 21:49:53 +01:00
greenkeeper[bot]
1fcae7b182 fix(package): update inquirer to version 3.0.4 (#352)
https://greenkeeper.io/
2017-02-23 16:48:44 +01:00
greenkeeper[bot]
10b543fd0f fix(package): update inquirer to version 3.0.3 (#351)
https://greenkeeper.io/
2017-02-23 15:45:46 +01:00
Leo Lamprecht
719add7e13 4.6.0 2017-02-23 09:56:00 +01:00
Leo Lamprecht
d137549694 Proper name for command used for opening last deployment 2017-02-23 09:55:36 +01:00
Leo Lamprecht
b60f412d6f Dynamically load logo for now open 2017-02-23 09:53:45 +01:00
Leo Lamprecht
681b2aef28 Better message for opening latest deployment 2017-02-23 09:52:15 +01:00
Leo Lamprecht
1c746c53a7 Missing colon added to usage information 2017-02-23 09:45:33 +01:00
Leo Lamprecht
0d78192acb Pinned credit-card dependency 2017-02-23 09:43:36 +01:00
Jaga Santagostino
103c6abbdc Implemented now-browse (#339) 2017-02-23 09:42:17 +01:00
Leo Lamprecht
797cdd8308 Bumped serve to latest version 2017-02-23 09:38:19 +01:00
Matheus Fernandes
3bf077fe2d Use a triangle that's actually printable on Windows (#348) 2017-02-23 09:37:21 +01:00
greenkeeper[bot]
b0ca5dc638 fix(package): update inquirer to version 3.0.2 (#346)
https://greenkeeper.io/
2017-02-23 08:34:05 +01:00
Leo Lamprecht
0be4c893e2 4.5.8 2017-02-21 22:14:18 +01:00
Matheus Fernandes
712af5ddb2 Auto generate a pkg.json based on package.json (#341) 2017-02-21 21:49:15 +01:00
Leo Lamprecht
21fe658968 4.5.7 2017-02-21 19:02:48 +01:00
Leo Lamprecht
8a1cfb3a46 Added newline before build steps 2017-02-21 19:02:24 +01:00
Leo Lamprecht
b47a93bed6 Lowercased text files 2017-02-21 18:36:32 +01:00
Leo Lamprecht
4d0efbc1c4 Missing import comments added 2017-02-21 18:36:11 +01:00
Leo Lamprecht
abaa83eee7 Removed TODO comments 2017-02-21 18:25:54 +01:00
Leo Lamprecht
657059aae4 Updated ignore dependency 2017-02-21 18:20:33 +01:00
greenkeeper[bot]
0257687b2d chore(package): update ava to version 0.18.2 (#334)
https://greenkeeper.io/
2017-02-21 18:06:42 +01:00
greenkeeper[bot]
41ccd6bbc9 fix(package): update update-notifier to version 2.1.0 (#329)
https://greenkeeper.io/
2017-02-21 18:06:31 +01:00
greenkeeper[bot]
06d51b2bd4 fix(package): update docker-file-parser to version 1.0.1 (#327)
https://greenkeeper.io/
2017-02-21 18:06:20 +01:00
greenkeeper[bot]
d422f772aa chore(package): update pkg to version 3.0.0-beta.27 (#324)
https://greenkeeper.io/
2017-02-21 18:06:08 +01:00
greenkeeper[bot]
80964bc4f3 fix(package): update ignore to version 3.2.3 (#335)
https://greenkeeper.io/
2017-02-19 23:45:57 -05:00
greenkeeper[bot]
bd2efa8e7f fix(package): update socket.io-client to version 1.7.3 (#323)
https://greenkeeper.io/
2017-02-17 09:19:07 +01:00
Hugo
7c14fd7cb1 Fix now alias failing when now.json doesn’t define deployment type (#321) 2017-02-16 22:44:22 +01:00
greenkeeper[bot]
c495fdcf99 chore(package): update pkg to version 3.0.0-beta.26 (#322)
https://greenkeeper.io/
2017-02-16 16:54:36 -03:00
Leo Lamprecht
9d8ab51657 4.5.6 2017-02-15 23:58:54 +01:00
Leo Lamprecht
52c63854d5 Correctly load async-retry 2017-02-15 23:58:26 +01:00
Leo Lamprecht
5e68fa683c 4.5.5 2017-02-15 23:13:10 +01:00
Leo Lamprecht
737086b30b How to see usage information 2017-02-15 23:12:26 +01:00
Leo Lamprecht
4df3eabaf9 Linked to website from usage section 2017-02-15 23:11:06 +01:00
Leo Lamprecht
3b231f2841 AVA comes with async/await built-in 2017-02-15 23:09:07 +01:00
Leo Lamprecht
3ec770b56c Updated dependencies to latest version 2017-02-15 23:07:17 +01:00
Leo Lamprecht
ae9dd8f441 Make static deployments definable
This closes #318
2017-02-15 23:00:43 +01:00
Leo Lamprecht
0f52271757 Use static deployment type if defined in config 2017-02-15 22:38:30 +01:00
Leo Lamprecht
2f85a6a966 Split error into multiple lines 2017-02-15 21:58:24 +01:00
greenkeeper[bot]
2b4f6dd4cb fix(package): update async-retry to version 0.3.0 (#314)
https://greenkeeper.io/
2017-02-15 21:24:57 +01:00
Matheus Fernandes
525d802ee3 4.5.4 2017-02-15 11:03:58 -03:00
Matheus Fernandes
fb7bfdbc4e Mention now upgrade instead of https://zeit.co/account 2017-02-15 10:56:18 -03:00
Matheus Fernandes
a3d66c3ccd Hide the credit card number once it's submitted 2017-02-14 15:12:28 -03:00
Igor Klopov
bc7759786b test packed now binary (#311) 2017-02-14 18:49:48 +01:00
Jeroen Engels
c0d1a4fc9e Fix typo in billing (#312) 2017-02-14 14:27:49 -03:00
Leo Lamprecht
e019a2ab77 4.5.3 2017-02-14 16:22:49 +01:00
Leo Lamprecht
b239630f7b Inlined version 2017-02-14 16:22:06 +01:00
Leo Lamprecht
2ed971a458 4.5.2 2017-02-14 15:50:50 +01:00
Leo Lamprecht
ddfc2217fd Do not copy package.json to build directory 2017-02-14 15:47:09 +01:00
Leo Lamprecht
183f2486e2 Find the closest package.json automatically 2017-02-14 15:46:20 +01:00
Leo Lamprecht
01e9ee8c2e 4.5.1 2017-02-14 15:11:04 +01:00
Leo Lamprecht
a0c63e70e4 Only upload build directory to npm 2017-02-14 15:08:15 +01:00
Matheus Fernandes
afee7770df 4.5.0 2017-02-14 10:36:53 -03:00
Matheus Fernandes
47a5c69c26 Add now billing and now upgrade (#309)
* Add the skeleton of `now cc`

* Add the `ls` command

* Add `inquirer` dependency

* Add the `set-default` command

* Fix typo

* Show the real number of cards when selecting the default one

* Add the `ls` command

* Fix: Do not throw if there's no cards in the account

* Add `blessed` dependency

* Add the first sketch of `now cc add`

* Add instructions

* Add labels

* Save every element in the `elements` array instead of variables

* Tweaks

* Fix: update the element attribute if it's not a special case

* Add the `name` input; Add moving between inputs; Make the state more reliable

* Auto "detect" if the input is losing focus

* Remove useless stuff

* Add the ability to move between the fields with tab/shift+tab

* Add CCV field

* Make the cycling between the fields "infinite"

* Add expiration date field and allow only numbers in the CCV field

* The form shouldn't have a fixed height

* Add the address box and label

* Add the address fields

* Remove blessed stuff

* Add preliminary input field

* output utils

* add prompt for booleans

* fix @matheuss linting problems

* remove example

* lint

* error and info helpers

* helper for embedded commands

* Remove useless stuff

* Add `trailing` option

* Add `resolveChars` option

* Add `validate` option

* Add `strip-ansi` dependency

* Add `credit-card` dependency

* Add credit card masking

* Add support for expiration date mask

* Make things simpler

* Add auto completion support

* Always show the `card_` id prefix

* Add `@google/maps` dependency

* Always print the initial value if it's available

* Add `stripe` dependency

* Add `add()` method

* Add billing related utils

* Add `now cc add`

* Rename `cc` to `billing`

* Fix: log only one blank line

* Refactor

* Add list input component

* This shouldn't be here

* Add `code` output util

* Add `now upgrade | downgrade`

* add build step

* make it more future-proof

* more reliable build

* remove lock for now

* Hide the CCV

* Print the new line before `Saving card`

* Use the new `success` component

* Add confirmation steps for `cc rm` and `cc set-default`

* Temporarily monket patch Inquirer

* Build before testing

* Run the tests using the built files

* Fix the `prepublish` script and run the `build` one before packaging

* Improve `now help`
2017-02-14 10:35:28 -03:00
Leo Lamprecht
5a97704d28 4.4.2 2017-02-13 23:42:22 +01:00
Tim Neutkens
dd8cc832cd Fix dotenv now.json option behaviour (#304) 2017-02-13 21:19:22 +01:00
greenkeeper[bot]
f238309319 fix(package): update update-notifier to version 2.0.0 (#305)
https://greenkeeper.io/
2017-02-13 21:18:58 +01:00
Leo Lamprecht
26c135cdce 4.4.1 2017-02-13 14:36:52 +01:00
Leo Lamprecht
5f0de768c3 No need to specify --dotenv 2017-02-13 14:36:35 +01:00
Leo Lamprecht
94738e65dd 4.4.0 2017-02-13 14:11:38 +01:00
Leo Lamprecht
75c30279cc Log version without weird prefix 2017-02-13 14:11:18 +01:00
Leo Lamprecht
5e5ac5dab9 Corrected position of exit import 2017-02-13 11:09:11 +01:00
tim neutkens
8c8db8ecf8 Allow dotenv option in now.json 2017-02-12 17:06:25 +01:00
tim neutkens
de8470fe02 Move duplicated code into utils module 2017-02-12 17:05:26 +01:00
greenkeeper[bot]
f7ea829fb8 fix(package): update fs-promise to version 2.0.0 (#302)
https://greenkeeper.io/
2017-02-12 17:04:57 +01:00
Leo Lamprecht
23b3e79299 4.3.0 2017-02-10 23:39:03 +01:00
Leo Lamprecht
036205fa44 Removed --alias from option list (deprecated) 2017-02-10 23:36:31 +01:00
Leo Lamprecht
8cde1663c5 Re-alias when running now alias 2017-02-10 23:35:39 +01:00
Leo Lamprecht
3786f53dc8 Read aliases from alias property in now.json 2017-02-10 23:21:32 +01:00
Leo Lamprecht
c545968ff6 Don't throw an error if alias doesn't exist 2017-02-10 22:59:26 +01:00
Leo Lamprecht
b90aaf4375 Split out mechanism for aliasing into separate file 2017-02-10 22:54:41 +01:00
Leo Lamprecht
8b86db4777 Deprecated --alias 2017-02-10 22:32:13 +01:00
Leo Lamprecht
dab9978ba6 No need to exit here 2017-02-10 21:26:59 +01:00
Leo Lamprecht
d1ce432c65 Normalize deployment URLs before removing
This closes #299
2017-02-10 21:19:24 +01:00
Leo Lamprecht
10d029dcbd 4.2.2 2017-02-06 15:10:44 +01:00
Leo Lamprecht
3464f34579 Make static deployments work again 2017-02-06 15:10:34 +01:00
Leo Lamprecht
dea9bac0ac Updated dependencies to latest version 2017-02-06 14:51:47 +01:00
Leo Lamprecht
eb3c42ec2a 4.2.1 2017-02-06 14:31:12 +01:00
Leo Lamprecht
07544a04aa Pinned dependencies 2017-02-06 14:22:47 +01:00
Leo Lamprecht
c3011837eb Save exact version of dependencies 2017-02-06 14:22:30 +01:00
Leo Lamprecht
f0b85bc2bf Install latest version of serve (make static deployments work) 2017-02-06 14:21:49 +01:00
Leo Lamprecht
cda2a33e34 4.2.0 2017-02-06 11:18:16 +01:00
Leo Lamprecht
a5a3b01af9 Upgraded serve yet again 2017-02-06 11:16:51 +01:00
Tim Neutkens
4badb34a71 Add --dotenv flag to load .env file (#284)
* Add --dotenv flag to load .env file

* Alias -E to --dotenv

* Allow custom .env config file name

* Change 'Will default' to 'Defaults'
2017-02-05 22:24:44 +01:00
Leo Lamprecht
dae5027c94 4.1.2 2017-02-04 20:51:33 +01:00
Jarmo Isotalo
a6cad020f9 Show build errors (#286) 2017-02-04 20:50:44 +01:00
Tim Neutkens
2289a23054 Improve dns example (#283) 2017-02-04 12:38:07 +01:00
Leo Lamprecht
373e17a51d Bumped serve 2017-02-04 12:10:10 +01:00
Leo Lamprecht
2fd04c5021 4.1.1 2017-02-04 11:24:29 +01:00
Leo Lamprecht
cc338d4039 Only show update notification if one is available 2017-02-04 11:24:21 +01:00
Leo Lamprecht
78a8f2627b 4.1.0 2017-02-04 09:40:37 +01:00
Jarmo Isotalo
e71cdb8440 Log erros and stacktraces (#276) 2017-02-04 09:37:55 +01:00
Igor Klopov
2a00eb632a now-alpine + suppress a pkg warning (#277)
* explicitly list pkg targets (alpine is not in default list)

* suppress pkg warnings by adding 'may-exclude'
2017-02-04 09:37:40 +01:00
greenkeeper[bot]
e16fa03b90 chore(package): update ava to version 0.18.1 (#280)
https://greenkeeper.io/
2017-02-04 09:37:03 +01:00
Leo Lamprecht
f3b2324039 Link changelog for new update 2017-02-04 08:13:56 +01:00
Leo Lamprecht
1304f9b916 Custom message for update 2017-02-03 22:57:51 +01:00
Olli Vanhoja
213d9080b9 Improved domain verification (#270)
New domains are no longer allowed as unverified, that allows us to
simplify `now alias` command a bit.
2017-02-01 09:28:31 -08:00
Tim Neutkens
d8f532cabf Added husky (#251)
* Added husky

* Lint on precommit
2017-01-31 14:51:35 -02:00
Leo Lamprecht
cb7fb54805 4.0.1 2017-01-30 22:27:22 +01:00
Leo Lamprecht
be1a799f18 Bumped serve 2017-01-30 22:27:08 +01:00
Leo Lamprecht
61b7f21e09 No need to tell greenkeeper about the emails 2017-01-29 23:08:13 +01:00
Leo Lamprecht
6e59af191f 4.0.0 2017-01-28 13:19:56 +01:00
Leo Lamprecht
516ad204c0 Only show update message in production 2017-01-28 13:19:41 +01:00
Olli Vanhoja
548088111b Improve now alias UX in case of an external DNS and a CNAME entry 2017-01-28 12:38:25 +01:00
Leo Lamprecht
add7bcfbea Require --alias for all existing kinds of automatic aliasing 2017-01-28 12:34:17 +01:00
Leo Lamprecht
7ccb4de336 New name for alias property 2017-01-28 11:12:50 +01:00
Leo Lamprecht
fb03bd6c21 Allow the alias field to be an array 2017-01-28 11:09:44 +01:00
Leo Lamprecht
bde79dbab8 NPM => npm 2017-01-28 10:19:10 +01:00
Leo Lamprecht
90f2781c9a 3.1.2 2017-01-27 21:10:52 +01:00
Leo Lamprecht
8027751e4b Bumped serve yet again 2017-01-27 21:10:43 +01:00
Leo Lamprecht
6c5c8cb93d Don't generate sourcemaps when transpiling 2017-01-27 21:09:39 +01:00
Leo Lamprecht
1770486ff6 Bumped serve to latest version 2017-01-27 20:58:12 +01:00
Matheus Fernandes
b16a747d54 3.1.1 2017-01-27 11:28:44 -02:00
Matheus Fernandes
c31c926aac Pass a Windows-aware Regex to async-to-gen/register 2017-01-27 11:24:47 -02:00
José Padilla
6799c0eefe Update async-to-gen (#258) 2017-01-27 09:33:43 +01:00
Leo Lamprecht
76fd0838ed 3.1.0 2017-01-26 23:00:39 +01:00
Matheus Fernandes
3269d4203b Only transform our code with async-to-gen/register (#254) 2017-01-26 22:47:28 +01:00
Guillermo Rauch
83326fd8c4 add now.json support 2017-01-25 17:08:34 -08:00
Guillermo Rauch
f6e67cb8f8 Merge pull request #2 from zeit/now.json
Support for `now.json`
2017-01-25 17:06:21 -08:00
Nathan Rajlich
9540863c0e fix typo 2017-01-25 16:04:39 -08:00
Nathan Rajlich
957744e3a5 add now.json:name field support 2017-01-25 16:00:49 -08:00
Nathan Rajlich
7f92455b2e lint *again* 2017-01-25 15:37:32 -08:00
Nathan Rajlich
73f22bb68e use G's wording for error message 2017-01-25 15:37:32 -08:00
Nathan Rajlich
540caa4db7 fixes for when nowConfig is null 2017-01-25 15:37:32 -08:00
Nathan Rajlich
0b2b39222c lint 2017-01-25 15:37:32 -08:00
Nathan Rajlich
1151830af6 a couple more test cases and fixes for them 2017-01-25 15:37:32 -08:00
Nathan Rajlich
7daf1e4c49 Only throw when both pkg.now and now.json are present
Fixes failing test case.
2017-01-25 15:37:32 -08:00
Nathan Rajlich
38fe08ad97 rename getMetadata() to readMetaData()
Matches what it's called elsewhere in the codebase
2017-01-25 15:37:32 -08:00
Nathan Rajlich
4ad921e958 add first now.json test case
Passing.
2017-01-25 15:37:32 -08:00
Nathan Rajlich
d9b5c4d4fa fix lint 2017-01-25 15:37:32 -08:00
Nathan Rajlich
f6c0e65b7f fail hard when both a now.json and package.json file with "now" are present
As discussed in the GH issue.
2017-01-25 15:37:32 -08:00
Nathan Rajlich
c44284b0b3 remove unused require call 2017-01-25 15:37:32 -08:00
Nathan Rajlich
c11131310c fix lint 2017-01-25 15:37:32 -08:00
Nathan Rajlich
76e4ab5037 support now.files in now.json
Needs a test case still...
2017-01-25 15:37:32 -08:00
Nathan Rajlich
cee788d3e1 add a strict mode to readMetadata()
Test cases will set this to `false`, because they're
missing `scripts.start` and other required properties in this function
2017-01-25 15:37:32 -08:00
Nathan Rajlich
4c9caa420b initial now.json support 2017-01-25 15:37:10 -08:00
Tim Neutkens
168f553025 Remove unused dependencies (#250) 2017-01-25 19:59:02 -02:00
Jesús Lobos
73a1f84080 Fix Native and Packages comment structure (#244) 2017-01-25 13:43:19 +01:00
Leo Lamprecht
b7f756aeda 3.0.1 2017-01-24 14:19:55 +01:00
Eli Perelman
6e62d874bc Normalize package.json main file for extensionless or directory entries 2017-01-24 14:10:15 +01:00
Guillermo Rauch
5fd5802880 Improved agent (#240)
* improves agent

- reverts spdy for now (causing issues with alias)
- sets up an agent pool of 4 max sockets with a 10s keep alive timeout
- better error handling and re-initialization

* improves agent

- reverts spdy for now (causing issues with alias)
- sets up an agent pool of 4 max sockets with a 10s keep alive timeout
- better error handling and re-initialization
2017-01-24 14:07:30 +01:00
Jarmo Isotalo
3732bfb16c Don't require for CMD and EXPOSE to be defined in Dockerfile used for (#237)
deploying but allow those to be defined in upstream Dockerfiles
2017-01-24 14:06:04 +01:00
Guillermo Rauch
6622ddcfb9 Release 3.0.0 2017-01-21 15:02:45 -08:00
Guillermo Rauch
2c245a5cab fix merge 2017-01-21 15:01:10 -08:00
Guillermo Rauch
0265530f25 Merge branch 'master' of github.com:zeit/now 2017-01-21 14:59:21 -08:00
Guillermo Rauch
244137ae90 Ignore improvements (#234)
* fix non-determinism in tests

* if `.dockerignore` doesn't exist, use `.gitignore`

* add back duplicate dei

* Move comment to appropriate line

* also check for exactly two duplicates
2017-01-21 14:58:31 -08:00
Guillermo Rauch
347d06242e add back duplicate dei 2017-01-21 13:59:49 -08:00
Guillermo Rauch
cb3da35156 Merge branch 'master' of github.com:zeit/now 2017-01-21 13:59:28 -08:00
Guillermo Rauch
485915b300 if .dockerignore doesn't exist, use .gitignore 2017-01-21 13:55:40 -08:00
Guillermo Rauch
06b34a0730 fix non-determinism in tests 2017-01-21 13:55:28 -08:00
Leo Lamprecht
a3a74ab253 2.0.5 2017-01-21 15:12:29 +01:00
Matheus Fernandes
49de0d3331 Print the error message for a aborted login in a new line (#229) 2017-01-17 16:45:31 +01:00
Greenkeeper
85a68b9fe7 chore(package): update ora to version 1.0.0 (#227) 2017-01-17 11:11:36 +01:00
Leo Lamprecht
0c02113e2a 2.0.4 2017-01-16 19:08:51 +01:00
Leo Lamprecht
c45eeed38f No version property required 2017-01-16 19:00:54 +01:00
Leo Lamprecht
d8e4e41b8d Pinned serve but allowing patches 2017-01-16 18:57:16 +01:00
Matheus Fernandes
cb8403174b Make clear that the alias must exist when using --alias (#222) 2017-01-14 22:48:53 +01:00
Olli Vanhoja
311abf3d2f now-rm: Don't show URL for incomplete deployments (#221)
Fixes this:

> The following deployment will be removed permanently:
XXXXXXXXXXXXXXXXXXXXXXXX      https://null      21d ago
2017-01-14 22:48:43 +01:00
Leo Lamprecht
0c2ef197ad 2.0.3 2017-01-11 15:17:59 +01:00
Leo Lamprecht
5c1b239ca6 Prevent pkg from throwing a warning 2017-01-11 15:17:48 +01:00
Leo Lamprecht
59734bf31b MOAR comments 2017-01-11 15:15:12 +01:00
Leo Lamprecht
b997c71dd4 Contextual newlines added 2017-01-11 15:01:42 +01:00
Olli Vanhoja
0b4660158a Fix file mode passing for regular deployments (#214)
Commit bbf1b30c4d broke file modes
for regular deployments as file mode isn't retrieved anymore.
2017-01-11 14:52:40 +01:00
Leo Lamprecht
a76397f0fb Testing token needs to be inside its property 2017-01-10 22:53:33 +01:00
Leo Lamprecht
058c3f63ab Make tests use the correct binary 2017-01-10 21:16:16 +01:00
Leo Lamprecht
c46f5e66dd 2.0.2 2017-01-10 19:59:44 +01:00
Leo Lamprecht
2fa62da2d8 Don't ignore modules directory when transpiling 2017-01-10 19:59:31 +01:00
Leo Lamprecht
dabcc64660 2.0.1 2017-01-10 19:42:27 +01:00
Leo Lamprecht
03708278df Load sub commands using extensions 2017-01-10 19:42:10 +01:00
Leo Lamprecht
f82cbe9bc5 Tell pkg not to use the harmony flag 2017-01-10 19:30:26 +01:00
Leo Lamprecht
513ecfb7de Added extensions to binaries 2017-01-10 19:30:12 +01:00
Leo Lamprecht
7628017eb6 2.0.0 2017-01-10 18:58:51 +01:00
Leo Lamprecht
158bf64ea2 No need to set language type anymore 2017-01-10 18:54:33 +01:00
Leo Lamprecht
56f4c2818a Hide weird XO error in Atom 2017-01-10 18:51:50 +01:00
Leo Lamprecht
9f073ad25c Use async-to-gen for all Node versions 2017-01-10 18:48:56 +01:00
Leo Lamprecht
5030008631 Tell XO to ignore enclosed version 2017-01-10 12:20:47 +01:00
Leo Lamprecht
df111b9eba Only allow process.exit in certain places 2017-01-10 12:04:58 +01:00
Leo Lamprecht
fc8708923e Re-enable rule for unresolved imports 2017-01-10 12:03:26 +01:00
Leo Lamprecht
d01bf29690 Check for update using a package 2017-01-10 12:03:02 +01:00
Leo Lamprecht
06fad401bf Removed unused code 2017-01-10 11:59:56 +01:00
Leo Lamprecht
6186c8b06b Start JS syntax right on top 2017-01-10 11:56:43 +01:00
Leo Lamprecht
e981e0a218 Make description match the repo's 2017-01-10 11:39:52 +01:00
Leo Lamprecht
18d0963ad4 Added a missing newline before checking support of async/await 2017-01-10 11:36:47 +01:00
Leo Lamprecht
7e30961ae1 No need to ignore build directory anymore 2017-01-10 11:34:38 +01:00
Leo Lamprecht
18d9de4121 Removed main property (not needed) 2017-01-10 11:33:33 +01:00
Leo Lamprecht
2a26f01a95 Stop pinning dependencies 2017-01-10 11:31:28 +01:00
Leo Lamprecht
b1090fe97e Let Travis CI decide whether or not to use sudo 2017-01-10 11:29:25 +01:00
Leo Lamprecht
38b56b118c There's no build directory anymore 2017-01-10 11:28:27 +01:00
Leo Lamprecht
21c235bb4c No dev script needed 2017-01-10 11:27:54 +01:00
Leo Lamprecht
3043215350 Upload folders to npm 2017-01-10 11:27:13 +01:00
Leo Lamprecht
bf2af9d8d5 Properly indented pkg property 2017-01-10 11:26:29 +01:00
Jarmo Isotalo
059918e7ee Remove babel as dependecy (#209)
* Remove babel as a dependency
* Migrate from import foo from foo to const foo = require('foo')
* Update module.exports
* Update commander syntax

* Update pkg config and fix stuff

* Make XO happy

* Fix path in tests

* Fix typo

* Fix cleanup

* Debug pkg

* Fix pkg

* Fix process.argv for subcommands

* Run with --harmony-async-await when supported thx igor for help with this trick :D

* Use bash

* Set engines.node in package.json
2017-01-10 11:21:53 +01:00
Greenkeeper
75de2865d6 chore(package): update ora to version 0.4.1 (#210) 2017-01-10 09:28:08 +01:00
Olli Vanhoja
29066338d8 Fix now alias on new domains (#207)
Bail if no records are found for a domain to allow adding the records.

now alias derp domain.com -d
> [debug] Checking for updates.
> [debug] Up to date (1.0.0).
> [debug] /list: 583.880ms
> [debug] matched deployment derp by url derp.now.sh
> domain.com is a custom domain.
> Verifying the DNS settings for domain.com (see https://zeit.world for help)
> [debug] #1 GET /domains/domain.com: 271.741ms
> [debug] Found domain domain.com with verified:true
> [debug] No records found for "domain.com"
> Verification OK!
2017-01-09 09:07:43 +01:00
Leo Lamprecht
8c3a40b6f8 Options is a sub section of usage 2017-01-08 22:46:17 +01:00
Leo Lamprecht
10fd578a51 Command for usage information 2017-01-08 22:45:43 +01:00
Leo Lamprecht
81940de06e How to get a testing token 2017-01-08 14:41:39 +01:00
Luke Childs
efb8da72e7 Allow shorthand aliases with now --alias (#206) 2017-01-08 12:29:05 +01:00
Leo Lamprecht
49c7ae052d 1.0.0 2017-01-07 22:31:12 +01:00
Luke Edwards
9a37e9deb2 insert newline into alias-success msg (#203) 2017-01-07 20:33:56 +01:00
Luke Edwards
c584f42791 copy alias to clipboard & show message (#201)
* copy alias to clipboard & show message

* ensure status output if not ttys or cant copy
2017-01-07 07:59:59 +01:00
Luke Morton
afc329a61c Multiple aliases during deploy (#202)
A small superficial change to bin/now-deploy.js so that we can specify one or more aliases whilst deploying.

**Examples**

```
now --alias a.com
now --alias a.com --alias b.com
```

We handle the alias assignment serially so that the CLI output makes sense.

**Some thoughts**

 - I’m hoping this PR can close out #172
 - Aware this PR likely affects #68
 - This is a superficial change, really we should update the lib/alias.js to handle multiple domains
2017-01-07 07:57:41 +01:00
Leo Lamprecht
e7de9abb9a Removed terminal indicators 2017-01-06 22:26:09 +01:00
Leo Lamprecht
f7830c1ff8 0.39.1 2017-01-06 10:20:35 +01:00
Guillermo Rauch
8b7d1e60ec Improve ignore semantics. (#200)
* improve ignore semantics

* add files accidentally ignored previously
2017-01-06 10:15:46 +01:00
Luke Edwards
f2a4ee0adc XO Happiness (#197)
* Comply to rule 'no-useless-escape'

* Comply to rule 'no-case-declarations'

* Comply to rule 'ava/no-ignored-test-files'
2017-01-03 10:22:11 +01:00
Leo Lamprecht
c92fd09dc5 0.39.0 2017-01-02 21:22:20 +01:00
Leo Lamprecht
bbf1b30c4d Set a default file mode for package.json 2017-01-02 21:18:16 +01:00
Greenkeeper
960c80ae3f chore(package): update tmp-promise to version 1.0.3 (#196) 2017-01-02 17:29:08 +01:00
Leo Lamprecht
0cc0544ec3 Authors added 2017-01-02 14:52:06 +01:00
Olli Vanhoja
1652fd01a1 Add auto-renew column to now certs ls (#195) 2017-01-02 09:18:52 +01:00
Leo Lamprecht
ac07fc3ee2 0.38.0 2016-12-30 23:00:15 +01:00
Olli Vanhoja
1c7a13fe68 Add an option to copy symlinks (#191) 2016-12-30 18:44:18 +01:00
Olli Vanhoja
02b0a9e2d3 Add TXT record type to now dns --help (#190)
TXT record support was recently added to now.
2016-12-29 11:01:59 -08:00
Olli Vanhoja
c509dfd5d7 Support basic file modes (#187)
now-cli should pass file mode bits when creating a deployment.
2016-12-28 22:15:55 +01:00
Leo Lamprecht
8698bd694f Removed unnecessary semicolon 2016-12-24 09:30:43 +01:00
Olli Vanhoja
14d861e6d1 Show an appropriate message for incomplete deployments (#185)
If syncing files fails or the user just happens to run `now ls`
before the deployment is ready `https://null` is shown as an URL
to the deployment. Instead of showing `null` we could show
something nice.
2016-12-24 09:24:52 +01:00
Leo Lamprecht
8ab8ca53d2 0.37.1 2016-12-23 22:11:59 +01:00
Igor Klopov
1ce72df4fd show Using Node.js only for npm deployment type (#183) 2016-12-23 18:24:22 +01:00
Leo Lamprecht
e803dc80f9 Make FAQs link to homepage 2016-12-21 18:55:03 +01:00
Leo Lamprecht
028e9092df Both now-cli and now-desktop need the same here 2016-12-20 22:18:00 +01:00
Leo Lamprecht
1aa4fd88f3 Adjusted cmd name for development 2016-12-20 22:16:01 +01:00
Leo Lamprecht
9a249649da New script for building added 2016-12-20 13:21:33 +01:00
Leo Lamprecht
2ddfeb9ca9 Proper script name for development 2016-12-20 13:20:53 +01:00
Leo Lamprecht
45193ee497 Make FAQ plural 2016-12-20 12:32:33 +01:00
Leo Lamprecht
0754cffa11 Tell gulp to cache 2016-12-20 12:19:45 +01:00
Greenkeeper
06f1584e0d chore(package): update ora to version 0.4.0 (#176) 2016-12-17 22:38:28 +01:00
Greenkeeper
ffd92902fc chore(package): update alpha-sort to version 2.0.0 (#174) 2016-12-17 12:07:37 +01:00
Leo Lamprecht
0bc7d0fb50 0.37.0 2016-12-15 10:41:12 +01:00
Leo Lamprecht
84342092cd Better error message if alias is missing 2016-12-15 10:39:41 +01:00
Leo Lamprecht
09b91e8fbb Support IDs for auto aliasing 2016-12-15 10:37:23 +01:00
Leo Lamprecht
68a53c67f2 Ability to automatically assign an alias 2016-12-15 10:25:26 +01:00
Leo Lamprecht
2276dfb5d5 Basics for automatically assigning alias 2016-12-15 10:21:17 +01:00
Leo Lamprecht
0830aabe08 Only show update message in npm version
This closes #62
2016-12-15 08:15:13 +01:00
Leo Lamprecht
aeb7f4a5db 0.36.2 2016-12-12 19:11:59 +01:00
Leo Lamprecht
af76505c9e Improved flow for confirming address 2016-12-12 19:00:42 +01:00
Leo Lamprecht
6879ee1d4d Updated dependencies 2016-12-12 18:40:14 +01:00
Leo Lamprecht
cf5b9ad125 Replace publicsuffixlist with psl 2016-12-12 18:31:29 +01:00
Leo Lamprecht
f997a8fa61 List got renamed 2016-12-12 18:01:37 +01:00
Leo Lamprecht
cd9891dbc9 0.36.1 2016-12-12 10:03:17 +01:00
Olli Vanhoja
3a8f11b1ba alias set --debug: Only print nameservers if we fetched them (#166) 2016-12-09 15:44:05 +01:00
Matheus Fernandes
692bd34ced Add dns entry to the global help (#164) 2016-12-09 16:32:36 +02:00
Igor Klopov
03b33945d8 pkg@3.0.0-beta.22 fixes publicsuffixlist issue (#165) 2016-12-09 15:22:45 +01:00
Leo Lamprecht
3c28d01fc7 0.36.0 2016-12-08 20:54:29 +01:00
Leo Lamprecht
26afd83c1a Ability to skip confirmation when deleting deployments 2016-12-08 18:09:19 +01:00
Olli Vanhoja
2fdfbbdc22 Improve client side domain verification (#161)
No need to check nameservers if the domain is already known and
verified by now.
2016-12-08 14:07:22 +01:00
Jarmo Isotalo
0e486282a0 Fix unhandled promise rejection (#162) 2016-12-08 14:59:31 +02:00
Leo Lamprecht
ec7cacad34 0.35.0 2016-12-07 18:29:52 +01:00
Leo Lamprecht
e12c4212c9 Sprinkled a few newlines on there 2016-12-07 18:28:45 +01:00
Olli Vanhoja
1fee62c596 Support domain name verification 2016-12-07 09:15:35 +02:00
Leo Lamprecht
999936059f 0.34.1 2016-12-05 12:46:24 +01:00
Leo Lamprecht
f86d576b6c More explicit heading 2016-12-05 12:45:51 +01:00
Leo Lamprecht
3a4e070c2d Repo slug changed 2016-12-05 12:45:30 +01:00
Jarmo Isotalo
802e59f680 Improve error handling for alias creation, fixes #156 2016-12-03 22:17:50 +02:00
Leo Lamprecht
c9808b7a6e Missing import types added 2016-12-03 14:24:50 +01:00
Leo Lamprecht
23aab1f0db 0.34.0 2016-12-03 14:16:42 +01:00
Leo Lamprecht
79d07274ce Regular dirs can be deployed as usual 2016-12-03 14:13:46 +01:00
Leo Lamprecht
673b0dcd96 Don't deploy homedir, downloads or desktop
This closes #99
2016-12-03 14:11:16 +01:00
Leo Lamprecht
d8da820fe7 y OR N 2016-12-03 13:36:07 +01:00
Leo Lamprecht
1ee41f3c2a Don't just break for older nodes 2016-12-03 13:11:18 +01:00
Leo Lamprecht
3f4d419f78 Force new deployment if -n or -p defined
This closes #136
2016-12-03 12:54:06 +01:00
Leo Lamprecht
0db509d0b5 Missing greather-than-sign added 2016-12-03 12:48:50 +01:00
Leo Lamprecht
25fef39f1a Ability to set name
This closes #150
2016-12-03 12:41:08 +01:00
Jarmo Isotalo
9ca1a486bd Fix typo 2016-12-03 01:32:38 +02:00
Jarmo Isotalo
96fc0c9497 0.33.2 2016-12-02 16:07:11 +02:00
Jarmo Isotalo
4de1c69b6a Improve error handling when issuing cert fails (#154)
Fix `now certs ls` error when showing expiration date
Improve logging for when alias creation fails
2016-12-02 15:27:13 +02:00
Leo Lamprecht
6b35479a24 0.33.1 2016-12-01 01:22:01 +01:00
Leo Lamprecht
1154873822 Show proper deploying message 2016-12-01 01:21:57 +01:00
Leo Lamprecht
578a02d9ad 0.33.0 2016-11-29 19:11:57 +01:00
Leo Lamprecht
cf414438b0 Better title for contribution section 2016-11-29 19:11:34 +01:00
Leo Lamprecht
ccefece100 Removed duplicated fixture 2016-11-29 19:09:27 +01:00
Leo Lamprecht
6e94359052 Support for private Git repos 2016-11-29 19:03:51 +01:00
Leo Lamprecht
2b8fafa66f 0.32.0 2016-11-28 23:13:15 +01:00
Leo Lamprecht
8028b87531 Tell users that Bitbucket is available 2016-11-28 23:13:11 +01:00
Leo Lamprecht
7ae4532ea7 Bitbucket's master branches are default 2016-11-28 23:11:31 +01:00
Leo Lamprecht
de0635e8b1 Use a clean prefix when deploying 2016-11-28 23:09:56 +01:00
Leo Lamprecht
9bfa06f163 Support for Bitbucket 2016-11-28 23:01:04 +01:00
Leo Lamprecht
fd0ff2fbf6 Make code naming for multiple platforms 2016-11-28 22:51:28 +01:00
Leo Lamprecht
b04ab0470b Show cooler messages when deploying from other platforms 2016-11-28 22:47:08 +01:00
Leo Lamprecht
77412000ca Accept GitLab URLs 2016-11-28 22:39:27 +01:00
Leo Lamprecht
a63924ff85 0.31.0 2016-11-28 17:27:07 +01:00
Leo Lamprecht
124d308863 Merged GitHub support 2016-11-28 17:21:36 +01:00
Greenkeeper
b73ff09703 chore(package): update socket.io-client to version 1.7.1 (#145) 2016-11-28 11:44:48 +01:00
Leo Lamprecht
4a5de7321a Much stricter repo URL checking 2016-11-28 11:36:03 +01:00
Leo Lamprecht
27b860d6fe Only show examples related to now deploy 2016-11-28 11:13:07 +01:00
Leo Lamprecht
5d5a59d1b1 Make important info bold when error occurs 2016-11-28 11:04:41 +01:00
Leo Lamprecht
c9c32664bb Don't indicate git ref if master branch 2016-11-28 10:59:30 +01:00
Leo Lamprecht
0ea689c27a Shorten git reference if commit 2016-11-28 10:56:54 +01:00
Leo Lamprecht
5fb53762eb Show the git reference when deploying 2016-11-28 10:52:31 +01:00
Leo Lamprecht
04d58f2558 Throw error if URL is not valid 2016-11-28 10:43:54 +01:00
Leo Lamprecht
8075ffae4e Show good looking messages when deploying Git URL 2016-11-27 22:26:26 +01:00
Leo Lamprecht
be9e61dfeb Support GitLab as well 2016-11-27 22:17:22 +01:00
Leo Lamprecht
9d7746f9ed Support for deploying GitHub URLs 2016-11-27 22:14:56 +01:00
Greenkeeper
3e43225204 chore(package): update socket.io-client to version 1.7.0 (#144) 2016-11-27 09:36:02 +01:00
Leo Lamprecht
5d1cce8c1c Respect git ref in error message 2016-11-26 17:53:43 +01:00
Leo Lamprecht
09670c986e Support for git references 2016-11-26 17:44:59 +01:00
Leo Lamprecht
3e7634159e Only show message if GH search takes long 2016-11-26 17:24:59 +01:00
Leo Lamprecht
fd0e39da0e Only do one network roundtrip to GitHub 2016-11-26 17:18:48 +01:00
Leo Lamprecht
d51a6024c7 Swallow errors, just check if falsy 2016-11-26 17:05:50 +01:00
Leo Lamprecht
bb74c71896 Check if path is a repo path via regex 2016-11-26 12:38:17 +01:00
Leo Lamprecht
c92d4dfb37 Clean up tmp dir for repo in a better way 2016-11-26 12:28:32 +01:00
Leo Lamprecht
5e5545789f Handle potential error when converting res to JSON 2016-11-26 12:19:49 +01:00
Cody Zuschlag
50db54fd83 pass flags to subcommands (#98)
* rework args parsing

* test args parsing
2016-11-26 12:12:26 +01:00
Leo Lamprecht
fd24ea0c6a Fixed tests 2016-11-25 17:50:32 +01:00
Leo Lamprecht
81a1b8946b Install it globally 2016-11-25 16:25:38 +01:00
Leo Lamprecht
b9f9e71b9f Neat loading animation for looking on GitHub 2016-11-25 16:15:40 +01:00
Leo Lamprecht
fe6bd9b1f2 Forgot to load fs-promise 2016-11-25 16:10:10 +01:00
Leo Lamprecht
43d0b5693a Remove tmp dir for repo after deployment went ok 2016-11-25 15:50:15 +01:00
Leo Lamprecht
e16a6eaa30 Tell user that we're looking on GitHub 2016-11-25 15:31:18 +01:00
Leo Lamprecht
6a1837c4af Make users able to deploy GitHub repos 2016-11-25 15:28:08 +01:00
Leo Lamprecht
04e50b24e4 Basic implementation for GitHub deployments 2016-11-25 15:13:17 +01:00
Leo Lamprecht
2aa9da584a Shorter sentence for FAQ link 2016-11-24 19:53:00 +01:00
Leo Lamprecht
357c3f2e43 No need for package.json or Dockerfile 2016-11-24 19:52:06 +01:00
Leo Lamprecht
c9e53761d3 0.30.0 2016-11-24 18:54:01 +01:00
Leo Lamprecht
5a6d8481d6 Domain should not be part of sentence 2016-11-24 18:20:42 +01:00
Leo Lamprecht
2109f12954 More accurate help for DNS cmd 2016-11-24 18:16:00 +01:00
Olli Vanhoja
ca09ec1baa DNS Management added 2016-11-24 18:12:22 +01:00
Jarmo Isotalo
a8f93a1674 Release 0.29.1 2016-11-23 23:33:50 +02:00
Jarmo Isotalo
1fb629da63 Fix regression where setting a single env variable with -e failed (#141) 2016-11-23 13:23:38 -08:00
Leo Lamprecht
628f41db88 0.29.0 2016-11-23 21:27:48 +01:00
Leo Lamprecht
96d93820c6 Added correct path for fixtures 2016-11-23 17:17:31 +01:00
Leo Lamprecht
026e2cdf7b Bumped dependencies 2016-11-23 12:51:39 +01:00
Greenkeeper
da3278f0f9 chore(package): update graceful-fs to version 4.1.11 (#140) 2016-11-22 21:09:24 +01:00
Eric Ferraiuolo
ec76f6b706 Add now.env in package.json as env source (#119)
This adds package.json as new source for environment variables, which
are merged with `-e` CLI arguments (CLI args take precedence).

With the ability to specify environment variables in package.json,
developers don't need to remember which `-e` arguments to add, and
can simply run `now`.

```json
"now": {
  "env": {
    "foo": "bar"
  }
}
```

The above is the same as running:
```
now -e foo=bar
```

Fixes #116
2016-11-21 08:54:34 +01:00
Benjamín Eidelman
dec416255f fixes #66 - removing minimatch dependency (#108) 2016-11-18 12:36:31 +01:00
Olli Vanhoja
89940c1362 Parse glob patterns and ignore special files (#130)
* Revert "Ignore special files on deploy (#115)"

This reverts commit 1de3b40fc4.
Fixes #127

* Parse glob patterns and ignore special files

Currently glob patterns are not parsed when selecting files to be
uploaded.

Fixes #127
Fixes #112

* Include dot files in matches

* Fix resolving of the glob promise array
2016-11-18 12:35:58 +01:00
Igor Klopov
48fea47e11 pkg 3.0.0-beta.21 (#135) 2016-11-18 12:35:11 +01:00
Leo Lamprecht
f7bd36ec79 Removed logo until delta works everywhere 2016-11-18 12:00:30 +01:00
Leo Lamprecht
e151ea3c63 Delta added 2016-11-18 11:58:38 +01:00
Olli Vanhoja
5ce0fa9d99 Fix linter errors (#131) 2016-11-15 13:31:52 +02:00
Tony Kovanen
2f25c2c589 Release 0.28.1 2016-11-09 20:49:04 +02:00
Tony Kovanen
107d5b5858 Add verification code if provided upon login 2016-11-09 20:43:01 +02:00
Olli Vanhoja
1de3b40fc4 Ignore special files on deploy (#115)
Fixes #112
2016-11-01 20:07:12 +02:00
Olli Vanhoja
129372d161 Certs improvements (#114)
* Exit cleanly if a cert entry is not found with getCertIdCn()

* Support creating a new cert entry with user-provide certificate files
2016-11-01 00:07:09 +02:00
Guillermo Rauch
a935dd5bed Release 0.28.0 2016-10-29 13:11:25 +02:00
Matheus Fernandes
53f1ffab40 Fix code style 💅 (#107) 2016-10-29 13:01:00 +02:00
Olli Vanhoja
8c62269567 Fix DNS verification on 'now alias' (#106) 2016-10-29 12:59:20 +02:00
Olli Vanhoja
6d83be5f25 Now deploy env fixes (#105)
* Fix key and value checks

- key can't be empty string nor undefined or null
- value is always undefined if it's not set

* Fix crash if env key and value are missing when using -e
2016-10-28 23:50:52 +02:00
Safia Abdalla
b1e4e43e81 Use chalk.gray styling for errors (#104) 2016-10-28 23:50:18 +02:00
Olli Vanhoja
f31d1f0804 Fixes to Dockerfile metadata parsing (#103)
- No need to check if pkg.name is null
- Properly default to basename if labels.name isn't set
2016-10-29 00:32:36 +03:00
Jarmo Isotalo
d091240115 If package.json or Dockerfile is present, assume it's static (#100)
deployment
2016-10-29 00:31:56 +03:00
Jarmo Isotalo
b4fc6a9c23 Downgrade socket.io client (#101)
Untill these
https://github.com/socketio/engine.io-client/pull/514
https://github.com/socketio/engine.io-client/pull/513
make it to latest socket.io-client
2016-10-29 00:30:03 +03:00
Leo Lamprecht
6841d2d136 0.27.0 2016-10-28 16:53:12 +03:00
Olli Vanhoja
ed7fdd9807 Revert "chore(package): update ms to version 0.7.2 (#97)"
This reverts commit 12984463a3.

0.7.2 breaks 'now cert ls'
2016-10-28 16:52:04 +03:00
Leo Lamprecht
b563900702 Adapt deployment name from package 2016-10-28 13:39:56 +02:00
Leo Lamprecht
6159263d8f Set package.json on the fly 2016-10-28 13:34:40 +02:00
Leo Lamprecht
c5626178ed Move files into content dir if static 2016-10-28 13:21:21 +02:00
Leo Lamprecht
243d068491 Detect static projects 2016-10-28 11:44:47 +02:00
Leo Lamprecht
fb89e1e2bb Added enforcable deployment types 2016-10-26 12:40:50 +02:00
Leo Lamprecht
589d2fc72c Removed static command 2016-10-26 12:30:24 +02:00
Greenkeeper
8096a045a0 chore(package): update babel-register to version 6.18.0 (#96) 2016-10-25 11:47:01 +02:00
Greenkeeper
05ade18e8a chore(package): update babel-preset-es2015 to version 6.18.0 (#95) 2016-10-25 11:34:16 +02:00
Remy Sharp
ce32dce2aa Support now alias reading config.alias (#93)
* feat: support `now alias` reading config.alias

Reads the last deployment and will automatically alias to the package.json's config.alias property

* chore: corrected typo on `console.time`

* fix: use `root/now.alias` over `root/config.alias`
2016-10-25 10:39:59 +02:00
Greenkeeper
12984463a3 chore(package): update ms to version 0.7.2 (#97) 2016-10-25 10:29:25 +02:00
Olli Vanhoja
530a9fb357 Add a flag for skipping DNS verification (#94)
Some registrars requires that the DNS records are already setup
before delegating the domain to a nameserver.
2016-10-24 20:26:29 +03:00
Leo Lamprecht
e9a95e7253 Only check if opts.body exists and doesn't have a falsy value 2016-10-24 18:54:24 +02:00
Leo Lamprecht
881f382a43 Remove unnecessary statement 2016-10-24 16:54:54 +02:00
Leo Lamprecht
8b56a13221 Deploy cwd if no path defined 2016-10-24 16:53:50 +02:00
Greenkeeper
850cbf2e3a chore(package): update socket.io-client to version 1.5.1 (#91) 2016-10-24 11:11:20 +02:00
Leo Lamprecht
e32bd818e4 Make binaries comply to linting rules 2016-10-22 16:17:21 +02:00
Leo Lamprecht
c67c051699 The binaries are made of JavaScript 2016-10-22 15:43:45 +02:00
Leo Lamprecht
f0b0e23ce7 Badge for XO 2016-10-22 14:22:00 +02:00
Leo Lamprecht
82d65a7577 Finished XO setup 2016-10-22 14:21:17 +02:00
Leo Lamprecht
3979d8472a Fixed even more XO issues 2016-10-22 14:16:22 +02:00
Leo Lamprecht
0fec0f6602 Move config properties to top 2016-10-22 12:55:04 +02:00
Leo Lamprecht
561dabf837 Switch to XO 2016-10-22 12:54:38 +02:00
Leo Lamprecht
076817309c Group imports by kind 2016-10-22 12:32:53 +02:00
Leo Lamprecht
fb28ec4ba5 Empty line after binary indicator 2016-10-22 12:25:19 +02:00
Leo Lamprecht
3c7898b760 New line for each flag 2016-10-22 12:23:05 +02:00
Leo Lamprecht
f677786035 Added static sub-command to usage information 2016-10-22 12:16:37 +02:00
Leo Lamprecht
eba64c615e It's now called 'static', not 'serve' 2016-10-22 12:13:14 +02:00
Leo Lamprecht
cf39f7f032 Added core of static sub-command 2016-10-22 12:09:50 +02:00
Leo Lamprecht
79389c1a60 Put each command into its own line 2016-10-22 11:56:28 +02:00
Leo Lamprecht
66711afaeb Capitalize command descriptions 2016-10-22 11:49:21 +02:00
Leo Lamprecht
f051736995 0.26.0 2016-10-20 13:48:07 +02:00
Nathan Rajlich
76e3afe88e remove: delete deployment by URL (#172)
So this now works:

```
now rm https://ffitest-hcznbannyc.now.sh
```

Fixes #87.
2016-10-20 13:57:35 +03:00
Nathan Rajlich
c2fa7e8565 document secrets and certs commands (#168)
* document `secrets` command in --help

* document `certs` command in --help
2016-10-20 13:56:35 +03:00
Nathan Rajlich
3f78172428 only consider 1 result for the "single" verbage (#170)
English is hard… 0 uses the "multiple" verbage. We want:

  0 domains
  1 domain
  2 domains
  3 domains
  …etc.
2016-10-20 13:56:04 +03:00
Nathan Rajlich
139a44918e alias: better "invalid arguments" error messages (#169) 2016-10-20 13:55:35 +03:00
Nathan Rajlich
aa66f07cd5 deploy: document --npm and --docker 2016-10-20 13:55:13 +03:00
Jarmo Isotalo
65a7ee7158 Allow env value to contain '=' 2016-10-20 13:53:33 +03:00
Olli Vanhoja
40000d7f3c now-certs: Fix typo on formatExpirationDate() 2016-10-20 13:52:44 +03:00
Olli Vanhoja
b98bc74f0b Don't print the list if there is no entries 2016-10-20 13:51:18 +03:00
Olli Vanhoja
87c4b1fc16 Add header to alias and secrets command 2016-10-20 13:51:10 +03:00
Olli Vanhoja
b6f135419d Proper strlen function for strings containing ANSI escape codes 2016-10-20 13:50:56 +03:00
Olli Vanhoja
c75b9adcc0 Formatting for cert expiration time 2016-10-20 13:50:48 +03:00
Olli Vanhoja
298591af81 now-alias: Renew expired cert automatically 2016-10-20 13:50:38 +03:00
Olli Vanhoja
4338e776e3 now-certs: Show expiration date for certs 2016-10-20 13:50:29 +03:00
Olli Vanhoja
0355c57e6d domains: chalk.dim() for the headers 2016-10-20 13:50:20 +03:00
Olli Vanhoja
d743f483cd Show domain entry type in now domain ls 2016-10-20 13:50:11 +03:00
Olli Vanhoja
4db4353d5d now certs management
* Move cert handling to index.js
* Add 'now certs' commands for certificate management
2016-10-20 13:49:54 +03:00
Olli Vanhoja
db10a26c84 Fix table alignments in listings 2016-10-20 13:49:45 +03:00
Greenkeeper
030687ec85 chore(package): update eslint-plugin-promise to version 3.2.1 (#77) 2016-10-18 19:43:33 +02:00
Greenkeeper
20f88fbf32 chore(package): update eslint to version 3.8.0 (#73) 2016-10-15 00:31:20 +02:00
Greenkeeper
2479935b8f chore(package): update spdy to version 3.4.4 (#71) 2016-10-12 22:46:19 +02:00
Greenkeeper
d33e0bc4eb chore(package): update ignore to version 3.2.0 (#70) 2016-10-11 16:49:41 +02:00
Leo Lamprecht
f37710e5cf Save exact version of each dependency 2016-10-10 17:18:28 +02:00
Leo Lamprecht
c78eb92669 Pin dependencies 2016-10-10 17:15:15 +02:00
Greenkeeper
306a696eab chore(package): update eslint-plugin-promise to version 3.0.0 (#67) 2016-10-08 12:19:21 +02:00
Igor Klopov
4dd2cfe51f package.json pkgConfig -> pkg (#64) 2016-10-06 13:17:40 +02:00
Leo Lamprecht
607dd03fd8 0.25.2 2016-10-04 22:56:11 +02:00
Leo Lamprecht
2c762b4e23 Upgrade pkg 2016-10-04 22:52:12 +02:00
Leo Lamprecht
df165aaa63 License field added 2016-10-04 11:26:50 +02:00
Leo Lamprecht
cd03fea493 Upgrade dependencies 2016-10-04 11:26:37 +02:00
Leo Lamprecht
81172f4344 License added 2016-10-03 02:28:14 +02:00
Matheus Fernandes
a709864864 Fix: encode accented chars in filenames (#61) 2016-10-03 01:29:53 +02:00
Matheus Fernandes
4debd4b3e7 Show lowercased secret name after now secret add (#57) 2016-10-01 07:56:48 +02:00
Olli Vanhoja
569ac6bb1a Merge pull request #48 from dotcypress/patch-1
Fix `now alias ls` inconsistency
2016-09-27 23:14:49 +03:00
Vitaly Domnikov
cc157180a8 Fix now alias ls inconsistency
Fix `now alias ls` inconsistency.
2016-09-27 13:04:47 -07:00
Leo Lamprecht
4c885942b7 Merge pull request #44 from zeit/greenkeeper-graceful-fs-4.1.7
Update graceful-fs to version 4.1.7 🚀
2016-09-26 23:45:51 +02:00
Leo Lamprecht
6ea8ce3a16 Merge branch 'master' into greenkeeper-graceful-fs-4.1.7 2016-09-26 23:45:33 +02:00
Leo Lamprecht
9222b7ec25 Merge pull request #43 from zeit/greenkeeper-eslint-config-standard-6.1.0
Update eslint-config-standard to version 6.1.0 🚀
2016-09-26 23:45:24 +02:00
greenkeeperio-bot
5fdda12570 chore(package): update graceful-fs to version 4.1.7 2016-09-26 23:42:49 +02:00
greenkeeperio-bot
eb05d305b5 chore(package): update eslint-config-standard to version 6.1.0 2016-09-26 23:41:36 +02:00
Leo Lamprecht
18e4d44772 Merge pull request #42 from zeit/greenkeeper-node-fetch-1.6.3
Update node-fetch to version 1.6.3 🚀
2016-09-26 09:56:14 +02:00
greenkeeperio-bot
eeae89e4b9 chore(package): update node-fetch to version 1.6.3 2016-09-26 08:25:00 +02:00
Leo Lamprecht
4a7854c535 Merge pull request #41 from zeit/greenkeeper-cross-spawn-4.0.2
Update cross-spawn to version 4.0.2 🚀
2016-09-25 15:27:53 +02:00
greenkeeperio-bot
432c566230 chore(package): update cross-spawn to version 4.0.2 2016-09-25 13:47:28 +02:00
Leo Lamprecht
83e814448f Merge pull request #39 from zeit/greenkeeper-eslint-3.6.0
Update eslint to version 3.6.0 🚀
2016-09-25 11:49:05 +02:00
Leo Lamprecht
1bdf2cfbd8 Merge branch 'master' into greenkeeper-eslint-3.6.0 2016-09-24 12:18:59 +02:00
Leo Lamprecht
c64350bf72 Merge pull request #40 from zeit/greenkeeper-node-fetch-1.6.2
Update node-fetch to version 1.6.2 🚀
2016-09-24 12:18:50 +02:00
greenkeeperio-bot
09347bfd36 chore(package): update node-fetch to version 1.6.2 2016-09-24 11:58:27 +02:00
greenkeeperio-bot
57a4b79731 chore(package): update eslint to version 3.6.0 2016-09-24 00:06:52 +02:00
Leo Lamprecht
454b5f049f Merge pull request #38 from kevmannn/master
Fix `now ls` output in case of 0 deployments
2016-09-23 23:57:08 +02:00
Kevin Donahue
deea02a1bf Fix now ls output in case of 0 deployments 2016-09-23 17:38:19 -04:00
Leo Lamprecht
db769605be Use JSON for travis config 2016-09-22 16:54:36 +02:00
Leo Lamprecht
9802ec5bb3 Merge pull request #37 from zeit/greenkeeper-spdy-3.4.2
Update spdy to version 3.4.2 🚀
2016-09-22 13:55:41 +02:00
greenkeeperio-bot
87efb7683b chore(package): update spdy to version 3.4.2 2016-09-22 13:54:17 +02:00
Leo Lamprecht
8167517961 Merge pull request #36 from zeit/greenkeeper-update-all
Update all dependencies 🌴
2016-09-22 13:14:15 +02:00
greenkeeperio-bot
ea7d378404 chore(package): update dependencies 2016-09-22 13:10:57 +02:00
Tony Kovanen
1d92df0e1d Merge pull request #35 from makeusabrew/master
Import login method to now-secrets
2016-09-20 19:50:10 +03:00
Nick Payne
9c9682354c Import login method to now-secrets 2016-09-20 17:40:26 +01:00
Leo Lamprecht
528b6fdc0f FAQ added 2016-09-18 00:14:35 +02:00
Leo Lamprecht
6f1e84636b Badges for build and slack 2016-09-14 12:24:06 +02:00
Leo Lamprecht
5e2d50fdd1 0.25.1 2016-09-14 11:39:18 +02:00
Leo Lamprecht
13642efae5 Make description match the one on the site 2016-09-14 11:39:14 +02:00
Leo Lamprecht
cbf4678973 Merge pull request #28 from timneutkens/hotfix/repository-field
Added repository to package.json
2016-09-13 08:31:57 +02:00
tim neutkens
338a50489b Added repository to package.json 2016-09-13 08:11:05 +02:00
Leo Lamprecht
d78059d81d How to test 2016-09-11 11:11:28 +02:00
Leo Lamprecht
6025838728 Consistant style for usage 2016-09-11 11:10:00 +02:00
Leo Lamprecht
b057e7f3f2 How to contribute 2016-09-11 11:08:50 +02:00
Leo Lamprecht
c616652bd8 Merge pull request #26 from Rowno/secrets-numeric-value
secrets: make sure the value is a string
2016-09-11 10:44:28 +02:00
Roland Warmerdam
1f97633b0f secrets: make sure the value is a string
Fixes #21
2016-09-10 14:58:48 -07:00
Leo Lamprecht
d4cfb7c30b Only clone latest commit and don't use sudo 2016-09-10 20:12:55 +02:00
Leo Lamprecht
68d46e4b07 Indicate CLI 2016-09-10 20:12:16 +02:00
Leo Lamprecht
d7694d3a98 Ignore more things 2016-09-10 20:12:05 +02:00
Leo Lamprecht
44eced3b8c Delete HISTORY.md 2016-09-10 20:10:12 +02:00
Guillermo Rauch
545f644a4c Release 0.25.0 2016-09-09 14:36:50 -07:00
Guillermo Rauch
dc5a796677 improve error message for not finding a manifest file 2016-09-09 14:36:43 -07:00
Guillermo Rauch
d3c04a5774 package: bump version 2016-09-09 14:29:12 -07:00
Guillermo Rauch
a399d6d0bf Release 0.24.1 2016-09-09 14:27:07 -07:00
Guillermo Rauch
57d6197472 add ignore dep 2016-09-09 14:26:54 -07:00
Guillermo Rauch
d994bdb225 Release 0.24.0 2016-09-09 13:57:48 -07:00
Guillermo Rauch
641eab5ed3 simpler readme 2016-09-08 18:51:05 -07:00
Nathan Rajlich
eec0e8ebd9 now rm: remove by app name (#150)
* remove: implement remove by app name

Now you can do `now rm app-name` and remove all
deployments under that app name.

Syntax parallels `now ls app-name`.

* remove: only confirm deletion once

Also now supports arbitrary number of IDs/names to remove,
so that i.e. `xargs` could be used:

```
$ echo TYA4oUPKMloPXpWe3EDw5Dhs LtbfMjHFm92GnoSOVFHSps1E | xargs now rm
```
2016-09-08 13:39:19 -07:00
Guillermo Rauch
5bf0cfe897 Fix ignore (#151)
* switch to better ignore module, improve debugging

* add regression test for prefix bug (#142)

* remove old lib
2016-09-08 12:38:19 -07:00
Leo Lamprecht
00a29d2f3a Merge pull request #148 from igorklopov/master
Bump to latest pkg with `--out-dir` and stable cli
2016-09-07 10:45:20 +02:00
Leo Lamprecht
eb75cf45eb Improved description 2016-09-07 10:44:08 +02:00
igorklopov
612098e6b7 directory out dedicated to pkg output 2016-09-06 19:23:57 +00:00
igorklopov
91ce470af5 bump pkg to 3.0.0-beta.6 2016-09-06 19:18:00 +00:00
Igor Klopov
9414d8b078 Switch from enclose to pkg (#127)
* removed `enclose`, added `pkg`

* pinned `pkg`version

* bump pkg to beta.4
2016-09-06 10:34:17 -07:00
Naoyuki Kanezawa
2501399ca9 Merge pull request #147 from zeit/fix/spacing
Make indendation consistent
2016-09-05 20:11:21 -07:00
Guillermo Rauch
fc8e4f8e20 make indendation consistent 2016-09-05 20:09:52 -07:00
Naoyuki Kanezawa
d99235ce92 Merge pull request #146 from zeit/add/list-counts
Add totals to listings and fix plurals
2016-09-05 20:08:34 -07:00
Guillermo Rauch
c4248cebaa add totals to listings and fix plurals 2016-09-05 20:01:44 -07:00
Guillermo Rauch
ab84fc4bd0 Release 0.23.1 2016-09-05 16:35:32 -07:00
Guillermo Rauch
ecc112a6dd workaround for node-spdy bug 2016-09-05 16:01:15 -07:00
Guillermo Rauch
603841f0b6 index: filter empty entries 2016-09-05 12:51:00 -07:00
Guillermo Rauch
114da38c25 alias: improve error 2016-09-05 12:45:56 -07:00
Olli Vanhoja
2bc5d26fa7 Fix whois-ns-fallback request once again (#143)
try-catch in getNameservers() doesn't work as expected because
a promise is returned succesfully before it's evaluation and
try-catch in the function won't catch if it fails later on.
2016-09-04 19:13:20 -07:00
Guillermo Rauch
a09cd39165 Release 0.23.0 2016-09-02 09:41:08 -07:00
Naoyuki Kanezawa
ed8daff427 Merge pull request #134 from zeit/revert-132-fix/now-io-v2
Revert "Use now-io API v2"
2016-09-03 01:26:23 +09:00
Naoyuki Kanezawa
152363bf2b Revert "Use now-io API v2" 2016-09-03 01:23:24 +09:00
Naoyuki Kanezawa
463ea607ff use now-io api v2 (#132) 2016-09-02 08:58:21 -07:00
Guillermo Rauch
69e23163f4 fix help 2016-09-01 17:15:47 -07:00
Leo Lamprecht
c1831689b9 Merge pull request #133 from zeit/greenkeeper-babel-plugin-transform-runtime-6.15.0
Update babel-plugin-transform-runtime to version 6.15.0 🚀
2016-09-01 17:21:01 +02:00
greenkeeperio-bot
6597b7321f chore(package): update babel-plugin-transform-runtime to version 6.15.0 2016-09-01 17:08:34 +02:00
Naoyuki Kanezawa
85fc7fc336 fix the initial value of the env option (#131) 2016-08-31 21:53:44 -07:00
Tony Kovanen
b02849fba8 Merge pull request #129 from zeit/alias-fix
Add a missing await
2016-08-31 15:53:13 +03:00
Olli Vanhoja
ea6f682ea4 Add a missing await 2016-08-31 15:49:20 +03:00
Naoyuki Kanezawa
fc4a936ce2 Merge pull request #128 from zeit/add/env-option
Better create error messages
2016-08-31 16:06:38 +09:00
Guillermo Rauch
edf0834d7c Merge branch 'master' into add/env-option 2016-08-31 00:00:17 -07:00
Guillermo Rauch
d450d45842 merge with master 2016-08-30 23:59:17 -07:00
Guillermo Rauch
bf685a0dde now-deploy: do not attempt to unescape non-string env values 2016-08-30 23:57:34 -07:00
Guillermo Rauch
b83dbfb6ae index: drastically improve error handling / messages for create 2016-08-30 23:57:13 -07:00
Guillermo Rauch
a3fe6eda84 Add -e (#126)
* implement `-e`

* index: pass along `env` to `/create`

* index: add `listSecrets` method

* secrets: fix api calls

* support for escaping
2016-08-30 11:48:20 -07:00
Guillermo Rauch
cedf4a40bf support for escaping 2016-08-30 00:10:20 -07:00
Guillermo Rauch
954be0b939 secrets: fix api calls 2016-08-30 00:00:38 -07:00
Guillermo Rauch
08801432c6 index: add listSecrets method 2016-08-30 00:00:25 -07:00
Guillermo Rauch
efdd6b8d29 index: pass along env to /create 2016-08-30 00:00:15 -07:00
Guillermo Rauch
72d2aba201 implement -e 2016-08-30 00:00:02 -07:00
Nathan Rajlich
b55c3138b0 fix Docker CMD docs link (#124) 2016-08-28 14:20:19 -07:00
Nathan Rajlich
da8310ef33 Use "cross-spawn" instead of "cross-spawn-async" (#125)
Fixes the warning upon `npm install`.
"cross-spawn-async" is now deprecated: https://git.io/v6hdS
2016-08-28 14:20:08 -07:00
Guillermo Rauch
b1d61b914c Release 0.22.0 2016-08-26 17:11:52 -07:00
Guillermo Rauch
c93d93c9a6 hide secrets for now 2016-08-26 17:11:11 -07:00
Leo Lamprecht
4131b0eb16 Merge pull request #123 from zeit/greenkeeper-eslint-3.4.0
Update eslint to version 3.4.0 🚀
2016-08-26 21:28:07 +02:00
Tony Kovanen
638b5700b4 Merge pull request #103 from zeit/nowenv
Add an environment variable to change .now.json location
2016-08-26 21:17:59 +03:00
greenkeeperio-bot
027ca1cdd3 chore(package): update eslint to version 3.4.0 2016-08-26 20:04:39 +02:00
Olli Vanhoja
c6f42c36e3 Add --token and --config options
--token=MYTOKEN
--config=/path/to/.now.json
2016-08-26 16:46:51 +03:00
Olli Vanhoja
72e67224ae Add an environment variable to change .now.json location
For issue #99
2016-08-26 16:46:51 +03:00
Tony Kovanen
c4c9786821 Merge pull request #122 from zeit/domain-api-rework
Always register the domain for the user before trying to use it
2016-08-26 14:31:21 +03:00
Olli Vanhoja
75f1cef880 Always register the domain for the user before trying to use it 2016-08-26 14:28:43 +03:00
Tony Kovanen
f137ef04bd Merge pull request #117 from zeit/dom-alias-rmwarm
Warn about removing bound aliases when removing a domain
2016-08-26 13:29:43 +03:00
Leo Lamprecht
429cb48a70 Merge pull request #120 from zeit/greenkeeper-babel-register-6.14.0
Update babel-register to version 6.14.0 🚀
2016-08-25 14:19:34 +02:00
greenkeeperio-bot
0e37b949d6 chore(package): update babel-register to version 6.14.0 2016-08-25 14:19:20 +02:00
Leo Lamprecht
d5e76b33ea Merge pull request #121 from zeit/greenkeeper-babel-preset-es2015-6.14.0
Update babel-preset-es2015 to version 6.14.0 🚀
2016-08-25 14:19:05 +02:00
greenkeeperio-bot
2f10d8c0d8 chore(package): update babel-preset-es2015 to version 6.14.0 2016-08-25 09:48:52 +02:00
Leo Lamprecht
60576f83fc Merge pull request #119 from zeit/greenkeeper-email-validator-1.0.5
Update email-validator to version 1.0.5 🚀
2016-08-24 22:16:43 +02:00
Leo Lamprecht
ecf341d045 Merge pull request #118 from zeit/greenkeeper-eslint-config-standard-6.0.0
Update eslint-config-standard to version 6.0.0 🚀
2016-08-24 22:16:39 +02:00
greenkeeperio-bot
d3e8f8566c chore(package): update email-validator to version 1.0.5 2016-08-24 19:59:29 +02:00
greenkeeperio-bot
841e437820 chore(package): update eslint-config-standard to version 6.0.0 2016-08-24 16:03:17 +02:00
Olli Vanhoja
74adb7b613 Don't use domain-regex
It's broken, it doesn't match what you think it will match.
2016-08-24 07:21:07 +03:00
Olli Vanhoja
a0127daef1 Warn about removing bound aliases when removing a domain 2016-08-23 22:54:45 +03:00
Leo Lamprecht
d441c120a6 Stop minifying the code
This makes it really really hard to track down errors
2016-08-22 17:12:29 +02:00
Leo Lamprecht
039e16a569 Merge pull request #116 from zeit/greenkeeper-graceful-fs-4.1.6
Update graceful-fs to version 4.1.6 🚀
2016-08-19 16:31:28 +02:00
greenkeeperio-bot
b705e7e8dd chore(package): update graceful-fs to version 4.1.6 2016-08-19 16:22:44 +02:00
Naoyuki Kanezawa
1b9f905289 Merge pull request #115 from zeit/add/env-flags
Add secrets support
2016-08-19 12:49:46 +09:00
Guillermo Rauch
2c28348ed9 help: add rename 2016-08-18 20:39:13 -07:00
Guillermo Rauch
cf0b8d260a fix help 2016-08-18 20:38:49 -07:00
Guillermo Rauch
20e0cd7778 secrets: fix rename 2016-08-18 20:26:41 -07:00
Guillermo Rauch
8354ee8cea fix rename 2016-08-18 20:20:07 -07:00
Guillermo Rauch
8bf096b41c Merge branch 'master' into add/env-flags 2016-08-18 18:58:56 -07:00
Guillermo Rauch
fbfb7ac5e5 Release 0.21.1 2016-08-17 16:40:34 -07:00
Guillermo Rauch
24a9e32a9d fix for windows 2016-08-17 16:36:18 -07:00
Guillermo Rauch
187686d981 fixes for rm 2016-08-16 19:59:52 -07:00
Guillermo Rauch
4aba5cc709 Merge branch 'master' into add/env-flags 2016-08-16 18:40:41 -07:00
Guillermo Rauch
244d90167a Release 0.21.0 2016-08-16 10:50:12 -07:00
Olli Vanhoja
a42a2a56bc Merge pull request #102 from zeit/cnameprot-error
Show a proper error message for protected domain names
2016-08-16 14:16:05 +03:00
Leo Lamprecht
f63de5f86e Merge pull request #112 from zeit/greenkeeper-eslint-3.3.1
Update eslint to version 3.3.1 🚀
2016-08-16 12:39:52 +02:00
Leo Lamprecht
349c5242b6 Don't update babel-runtime for now
@rase-
2016-08-16 12:38:59 +02:00
Tony Kovanen
ab692f4fda Merge pull request #113 from zeit/downgrade-babel
Fix exceptions
2016-08-16 13:02:15 +03:00
Olli Vanhoja
cbb5ae30c9 Fix exceptions
Currently babel-runtime versions newer than 6.5.0 swallows
exceptions and causes async-retry blocks to return 'undefined' as
a return value.
2016-08-16 13:00:20 +03:00
greenkeeperio-bot
97deb721fe chore(package): update eslint to version 3.3.1 2016-08-15 23:32:50 +02:00
Olli Vanhoja
749cd8ac1f domain add: Try fallback if the list of name servers is empty (#111) 2016-08-15 14:28:32 -07:00
Guillermo Rauch
14774c5e9d Release 0.20.0 2016-08-15 11:16:44 -07:00
Guillermo Rauch
3025a091a5 fix try/catch in async with older babel-runtime :\ 2016-08-15 09:00:21 -07:00
Guillermo Rauch
ff4a54a4b2 Merge branch 'master' into add/env-flags 2016-08-14 23:12:02 -07:00
Guillermo Rauch
ba79563416 now-deploy: remove build logger erorr handler 2016-08-14 23:11:46 -07:00
Guillermo Rauch
14be7dd818 build-logger: handle socket errors better 2016-08-14 23:11:12 -07:00
Guillermo Rauch
0523226252 now-deploy: fix if 2016-08-14 17:41:58 -07:00
Guillermo Rauch
4abbc8546d Merge branch 'master' into add/env-flags 2016-08-14 17:12:41 -07:00
Guillermo Rauch
9c8211caaa improve performance of file retrieval 2016-08-14 15:02:10 -07:00
Tony Kovanen
597d515633 Include comment parsing from the Dockerfile 2016-08-14 22:53:31 +03:00
Leo Lamprecht
c38fc3a56c Merge pull request #109 from zeit/greenkeeper-del-2.2.2
Update del to version 2.2.2 🚀
2016-08-13 15:12:26 +02:00
greenkeeperio-bot
72b71b08ce chore(package): update del to version 2.2.2 2016-08-13 02:09:46 +02:00
Leo Lamprecht
e767f4b104 Merge pull request #108 from zeit/greenkeeper-eslint-3.3.0
Update eslint to version 3.3.0 🚀
2016-08-13 00:24:17 +02:00
Leo Lamprecht
d63a44df30 Disable greenkeeper emails 2016-08-12 20:48:18 +02:00
greenkeeperio-bot
9cbaa9b68a chore(package): update eslint to version 3.3.0 2016-08-12 20:46:16 +02:00
Guillermo Rauch
092d994ec5 initial sketch 2016-08-11 17:04:09 -07:00
Olli Vanhoja
04003b207b Show a proper error message for protected domain names 2016-08-12 02:59:42 +03:00
Igor Klopov
a55ce9450d Fixes eslinting (do you have problems?) (#104)
https://github.com/eslint/eslint/issues/6274
https://github.com/babel/babel-eslint/issues/350
2016-08-11 14:19:48 -07:00
Olli Vanhoja
18733b30ee Fix rm warnings (#107) 2016-08-11 14:19:35 -07:00
Tony Kovanen
6cf81fd084 Merge pull request #105 from zeit/add/deploy-public-option
[WIP] deploy: add `--public` option
2016-08-10 14:15:20 +03:00
Leo Lamprecht
3e5eee71c9 Looks like this isn't working within Travis 2016-08-10 11:21:51 +02:00
Leo Lamprecht
800702932c Use the latest stable version 2016-08-10 11:16:09 +02:00
Leo Lamprecht
6d80f2c685 Create package.json for negation 2016-08-10 11:11:27 +02:00
Leo Lamprecht
7d2e7e7a64 Merge pull request #106 from zeit/greenkeeper-update-all
Update all dependencies 🌴
2016-08-10 11:00:18 +02:00
greenkeeperio-bot
73e9780210 chore(package): update dependencies
https://greenkeeper.io/
2016-08-10 10:58:49 +02:00
Nathan Rajlich
89f50abf4f add "public" logic to the Now lib client 2016-08-09 18:19:29 -07:00
Nathan Rajlich
98c7b3f84a deploy: add --public option
To create a deployment as "public" (`/_src` route works)
when the user has a "premium" plan.
2016-08-09 18:06:42 -07:00
Tony Kovanen
fbd4255796 Merge pull request #100 from zeit/improve/npmignore
Improve file retrieval and ignores, fix bugs, add .dockerignore support
2016-08-04 10:26:52 +03:00
Guillermo Rauch
39a4435e4b wow 2016-08-03 18:59:52 -07:00
Guillermo Rauch
615bc96859 bump ava 2016-08-03 15:21:02 -07:00
Guillermo Rauch
7d9be2458d revamping and improving ignored files 2016-08-03 13:22:34 -07:00
Guillermo Rauch
3cc3f45471 more reasonable ignored 2016-08-03 10:48:04 -07:00
Guillermo Rauch
eb0aeda7bf improve docker validation 2016-08-01 21:30:42 -07:00
Guillermo Rauch
a23f147b48 Add support for Dockerfile (#98)
* add support for `Dockerfile`

* add dockerfile `EXPOSE` validation
2016-08-01 10:47:37 -07:00
Tony Kovanen
f7ff9d2d44 Merge pull request #95 from zeit/add/shorter-deploy-message
Add shorter deploy message
2016-07-31 22:38:47 +03:00
Guillermo Rauch
5cd530551e Merge branch 'master' into add/shorter-deploy-message 2016-07-31 12:36:46 -07:00
Tony Kovanen
29d569771a Merge pull request #80 from zeit/add/piping
Add piping support
2016-07-31 21:27:27 +03:00
Tony Kovanen
3cee6daa9d Merge pull request #96 from zeit/fix/colors-in-stderr-non-tty
Fix colors in stderr non tty
2016-07-31 21:26:21 +03:00
Guillermo Rauch
cf2755206c Merge branch 'master' into add/piping 2016-07-30 19:19:16 -07:00
Guillermo Rauch
3004cde653 Merge branch 'master' into add/shorter-deploy-message 2016-07-30 19:18:49 -07:00
Guillermo Rauch
4d7e4b1691 Merge branch 'master' into fix/colors-in-stderr-non-tty 2016-07-30 19:18:21 -07:00
Guillermo Rauch
9794a2574d add .travis.yml with node 2016-07-30 19:11:39 -07:00
Guillermo Rauch
4bd702bf45 use chalk for stderr colors 2016-07-30 19:10:21 -07:00
Guillermo Rauch
a3746ba8f4 Merge branch 'add/piping' into add/shorter-deploy-message 2016-07-30 19:07:51 -07:00
Guillermo Rauch
7d005c3a33 Merge branch 'master' into add/piping 2016-07-30 19:07:16 -07:00
Guillermo Rauch
5791b49653 error: prevent ansi escapes for colors in stdout 2016-07-30 18:57:01 -07:00
Guillermo Rauch
eafc25eefa shorten path for better UX 2016-07-30 18:10:16 -07:00
Tony Kovanen
264a18732b Rename to forwardNpm and check .now.json for it (#90) 2016-07-30 17:31:46 -07:00
Guillermo Rauch
de8e3e03cd check-update: only warn about truly new versions 2016-07-30 17:30:48 -07:00
Guillermo Rauch
396bd8713f activate quiet mode when piping 2016-07-30 17:30:36 -07:00
Guillermo Rauch
3eabe0e183 fix updates warning about older versions 2016-07-30 17:30:09 -07:00
Guillermo Rauch
2678b3ae3e Merge branch 'master' into add/piping 2016-07-27 18:00:26 -07:00
Guillermo Rauch
9284265f14 Release 0.19.0 2016-07-22 17:41:22 -07:00
Guillermo Rauch
38d1e4d32f alias: handle ESERVFAIL 2016-07-22 17:40:12 -07:00
Tony Kovanen
a6be53e5e4 Merge pull request #83 from zeit/add/send-npmrc-public-regisry-auth-token
Send npmrc public regisry auth token
2016-07-18 00:21:24 +03:00
Tony Kovanen
7ab8e0d344 Add cmd line flag to forward NPM auth token 2016-07-17 12:54:43 +03:00
Tony Kovanen
7539686483 Keep reading lower .npmrc if no auth in project 2016-07-17 01:52:25 +03:00
Tony Kovanen
9feed0c767 Look up forward-npm from now nowProperties 2016-07-17 01:49:26 +03:00
Tony Kovanen
f4c55e2864 Forward registry auth token only if asked 2016-07-15 20:24:40 +03:00
Tony Kovanen
cb86654e21 Send registry auth token from .npmrc if accessible 2016-07-15 20:21:38 +03:00
Igor Klopov
67b55610b7 make a binary of now using enclosejs (#81)
* make a binary of `now` using enclosejs

* pin enclosejs version
2016-07-07 09:30:49 -07:00
Guillermo Rauch
0af1f69ed2 index: add quiet mode 2016-07-05 16:17:21 -07:00
Guillermo Rauch
7eab45a017 build-logger: log only errors in quiet mode 2016-07-05 16:16:24 -07:00
Guillermo Rauch
de932b8643 now-deploy: stay quiet on non-tty 2016-07-05 16:16:01 -07:00
Leo Lamprecht
91648d269b Start script 2016-06-24 14:33:49 +02:00
Leo Lamprecht
19484a40e5 These binaries don't have any exts 2016-06-24 14:33:49 +02:00
Leo Lamprecht
902872a0a0 Add logo to heading 2016-06-24 13:49:27 +02:00
Leo Lamprecht
43c224c436 Clean up gulpfile 2016-06-24 13:40:47 +02:00
Leo Lamprecht
7a7f54bb8c Uppercase names for markdown files 2016-06-24 13:33:59 +02:00
Leo Lamprecht
b235adf2a0 Put ESLint config into package.json 2016-06-24 13:33:27 +02:00
Guillermo Rauch
9e2c485e28 bump version 2016-06-23 11:21:17 -07:00
Guillermo Rauch
4551f19b13 Release 0.18.1 2016-06-23 11:20:58 -07:00
Guillermo Rauch
07339ffa0b Release 0.18.0 2016-06-23 11:19:36 -07:00
Guillermo Rauch
e9bc5ac1c1 alias: setup * and none records automatically 2016-06-23 11:06:38 -07:00
Guillermo Rauch
1be3a4685b fix remove 2016-06-23 10:35:08 -07:00
Guillermo Rauch
eb04657b2f Add zeit world (wip) (#67)
* alias: clean up the alias (trailing and leading dots)

* alias: improve domain validation and implement zeit.world

* is-zeit-world: detect valid zeit.world nameservers

* package: add domain-regex dep

* now-alias: fix edge case with older aliases or removed deployments

* alias: move listing aliases and retrying to `index`

* index: generalize retrying and alias listing

* alias: remove `retry` dep

* now-remove: print out alias warning

* typo

* now-alias: prevent double lookup

* now: add domain / domains command

* now-deploy: document `domain`

* agent: allow for tls-less, agent-less requests while testing

* is-zeit-world: fix nameserver typo

* dns: as-promised

* now-alias: fix `rm` table

* now-alias: no longer admit argument after `alias ls`

@rase- please verify this, but I think it was overkill?

* admit "aliases" as an alternative to alias

* make domain name resolution, creation and verification reusable

* index: add nameserver discover, domain setup functions (reused between alias and domains)

* now-domains: add command

* domains: commands

* package: bump eslint

* now-alias: simplify sort

* now-domains: sort list

* now-domains: improve deletion and output of empty elements

* errors: improve output

* domains: add more debug output

* domains: extra logging

* errors: improve logging

* now-remove: improve `now rm` error handling

* index: more reasonable retrying

* alias: support empty dns configurations

* dns: remove ns fn

* alias: improve post-dns-editing verification

* index: remove unneeded dns lookup

* index: implement new `getNameservers`

* index: customizable retries

* alias: improve error

* improve error handling and cert retrying

* customizable retries

* alias: better error handling

* alias: display both error messages

* better error handling

* improve error handling for certificate verification errors

* alias: set up a `*` CNAME to simplify further aliases

* alias: fewer retries for certs, more spaced out (prevent rate limiting issues)

* alias: ultimate error handling

* add whois fallback

* adjust timer labels for whois fallback

* index: whois fallback also upon 500 errors

* alias: fix error message

* fix duplicate aliases declaration
2016-06-23 10:14:23 -07:00
Naoyuki Kanezawa
15d6a9d621 don't use http2 agent when url is http (#76) 2016-06-22 09:29:09 -07:00
Naoyuki Kanezawa
7cab91211e send user-agent on login (#75) 2016-06-21 08:39:03 -07:00
Guillermo Rauch
e7b0362c7f Merge pull request #70 from zeit/add/alias-removal-warning
Add alias removal warning
2016-06-15 17:11:44 -07:00
Guillermo Rauch
0892e032db now-remove: print out alias warning 2016-06-10 16:33:58 -07:00
Guillermo Rauch
290d1ffb93 alias: remove retry dep 2016-06-10 16:21:28 -07:00
Guillermo Rauch
c19cafd3ea index: generalize retrying and alias listing 2016-06-10 16:21:26 -07:00
Guillermo Rauch
02ea07cf1a alias: move listing aliases and retrying to index 2016-06-10 16:21:22 -07:00
Guillermo Rauch
6dcd7b68dd now-alias: fix edge case with older aliases or removed deployments 2016-06-10 15:04:52 -07:00
Guillermo Rauch
455d1fb8c9 Release 0.17.1 2016-06-07 09:45:26 -07:00
Guillermo Rauch
d638b9e731 package: bump email-prompt for windows fix 2016-06-07 09:44:54 -07:00
Guillermo Rauch
dc9a20e42f Release 0.17.0 2016-06-06 16:03:37 -07:00
Guillermo Rauch
902cfdf979 index: engines can be null 2016-06-06 12:51:14 -07:00
Tony Kovanen
75d9723d76 Merge pull request #66 from zeit/add/version-reporting
index: add version reporting, support for `engines`
2016-06-06 22:12:32 +03:00
Guillermo Rauch
1642469761 index: add version reporting, support for engines 2016-06-06 12:11:26 -07:00
Guillermo Rauch
816f2c3af1 Merge pull request #65 from zeit/add/token-name
Send token name
2016-06-06 07:27:33 -07:00
nkzawa
08c860af41 fix tokenName 2016-06-06 11:58:36 +09:00
Guillermo Rauch
d68223775a Release 0.16.0 2016-06-03 16:35:57 -07:00
Guillermo Rauch
5a17da1e04 now-deploy: add "initializing" message 2016-06-03 16:20:03 -07:00
Guillermo Rauch
de521f37b7 Merge pull request #63 from zeit/move-from-now-engines-to-now.engines
Use `"now"` nampespace for `"engines"`
2016-06-03 08:56:33 -07:00
Tony Kovanen
9d49f5f955 Use "now" nampespace for "engines" 2016-06-03 13:14:48 +03:00
nkzawa
2eb172171f login: post tokenName 2016-06-03 01:15:49 +09:00
Guillermo Rauch
591788f247 compile 2016-05-30 18:46:03 -07:00
Guillermo Rauch
64a126e6a0 Release 0.15.0 2016-05-30 18:38:43 -07:00
Guillermo Rauch
eb0522bf52 Merge pull request #59 from zeit/alias
Alias
2016-05-30 14:41:26 -07:00
Guillermo Rauch
57909cba11 alias: certificate provisioning 2016-05-30 13:27:09 -07:00
Guillermo Rauch
ae320f56db /certs > /now/certs 2016-05-30 13:18:30 -07:00
Guillermo Rauch
b5820c4a47 bump async-retry and remove old retry 2016-05-30 13:14:38 -07:00
Guillermo Rauch
547a93127a alias: handle 304 2016-05-30 13:02:48 -07:00
Guillermo Rauch
6172678a90 alias: improve out 2016-05-30 13:02:48 -07:00
Tony Kovanen
7f4e498b57 Underline urls in alias rm and show target 2016-05-30 21:44:46 +03:00
Tony Kovanen
7c6df1dd7d Merge branch 'alias' of github.com:zeithq/now into alias 2016-05-30 21:22:57 +03:00
Tony Kovanen
196692a5c5 Add confirmation to alias rm 2016-05-30 21:15:20 +03:00
Guillermo Rauch
7bcea8e19d alias: handle 409 2016-05-30 10:57:36 -07:00
Guillermo Rauch
77d10deddb add confirmation for removal 2016-05-30 09:37:23 -07:00
Guillermo Rauch
62bacc5968 now-alias: close socket gracefully 2016-05-30 09:13:09 -07:00
Guillermo Rauch
b788d7118b alias: tweak error 2016-05-30 09:12:02 -07:00
Guillermo Rauch
7d9ffcb45b tweak error messages 2016-05-30 09:11:12 -07:00
Guillermo Rauch
23d7d66bb7 package: roll back babel-runtime to make retry work again 2016-05-30 09:07:06 -07:00
Guillermo Rauch
1b5c88eedb alias: verify ownership first for custom domains 2016-05-30 09:06:36 -07:00
Guillermo Rauch
b1f754b437 alias: improve success output 2016-05-30 07:54:30 -07:00
Guillermo Rauch
a649bd7597 now-alias: improve ls output 2016-05-30 07:54:19 -07:00
Tony Kovanen
4935563d45 Fix alias rm bail 2016-05-30 16:27:13 +03:00
Tony Kovanen
f10c533a61 Move exit 2016-05-30 15:27:56 +03:00
Tony Kovanen
c93fbc6489 Fix default usage of alias set 2016-05-30 14:04:36 +03:00
Tony Kovanen
794e89439f Thow error if specified ls selector not found 2016-05-30 13:02:45 +03:00
Tony Kovanen
b29fce99db Fix timestamp usage 2016-05-30 12:00:10 +03:00
Tony Kovanen
cf4b176ec9 Accept alias name in now alias rm, add retries 2016-05-30 11:32:12 +03:00
Tony Kovanen
32ad62d57c now alias ls: accept deployment url 2016-05-30 11:03:42 +03:00
Tony Kovanen
21bb73b3c8 Basic alias rm 2016-05-30 02:48:45 +03:00
Tony Kovanen
4aab8c6c8e alias ls logic 2016-05-30 00:52:00 +03:00
Tony Kovanen
9418d983f2 exit(0) when successful 2016-05-29 23:13:03 +03:00
Tony Kovanen
47f797bd4a Exit early for 304 2016-05-29 23:11:35 +03:00
Tony Kovanen
2c030e2888 Fix lint 2016-05-29 22:25:19 +03:00
Tony Kovanen
ad6c9d5373 Fix success output 2016-05-29 22:22:35 +03:00
Tony Kovanen
887f3e39b9 Await all fetches 2016-05-29 21:56:27 +03:00
Tony Kovanen
80237aef32 Fix alias argv usage 2016-05-29 21:47:26 +03:00
Guillermo Rauch
f5c5309bc8 alias: complete set 2016-05-29 10:44:21 -07:00
Guillermo Rauch
dbf56429bf alias: match hostname prefix without .now.sh 2016-05-28 11:40:43 -07:00
Guillermo Rauch
9d95c2bf2b gulpfile: also compile by default 2016-05-28 11:39:04 -07:00
Guillermo Rauch
7bb90816a2 gulpfile: temporarily disable lint and enable watch 2016-05-28 11:23:28 -07:00
Guillermo Rauch
92ffaf1b1e ua: fix package location 2016-05-28 11:22:45 -07:00
Guillermo Rauch
212b9f2e67 alias: implement uid / host search 2016-05-28 11:22:33 -07:00
Guillermo Rauch
b65f57e4d5 now-alias: pass only strings (minimist converts to Number) 2016-05-28 11:22:14 -07:00
Guillermo Rauch
7feb738b33 now-alias: support userError errors 2016-05-28 11:21:55 -07:00
Guillermo Rauch
aff3109936 add to-host tests 2016-05-28 11:20:56 -07:00
Guillermo Rauch
dc03bb9ec7 add function to convert host parameters to hostname 2016-05-28 11:11:50 -07:00
Guillermo Rauch
6459ff0cec added duplicate hash test 2016-05-28 11:11:38 -07:00
Guillermo Rauch
68a2ceb482 test: upgrade to latest ava, remove old tests, add names test 2016-05-28 11:11:18 -07:00
Guillermo Rauch
d738f8d84a add user-agent to all outgoing requests 2016-05-27 18:17:10 -07:00
Guillermo Rauch
c65a8ad7ce properly specify minimist options 2016-05-27 18:08:24 -07:00
Guillermo Rauch
83b948f8d6 prevent minimist from parsing an argument as an option value
otherwise:
`now -d /path`

would fail

protip cc @rase- @nkzawa
2016-05-27 17:56:24 -07:00
Guillermo Rauch
54bb5eeb39 now-alias: remove redundant msg 2016-05-27 17:48:12 -07:00
Guillermo Rauch
7ab2360393 now-deploy: consistency in help 2016-05-27 17:38:22 -07:00
Guillermo Rauch
2b1851abd5 now-alias: improve copy 2016-05-27 17:37:40 -07:00
Guillermo Rauch
751fa7d990 now: add ln as basic command 2016-05-27 17:28:54 -07:00
Guillermo Rauch
4ec6e8ec9d now-alias: refer to _ to get custom args 2016-05-27 17:27:34 -07:00
Guillermo Rauch
75aad74a6f lint 2016-05-27 17:26:33 -07:00
Guillermo Rauch
4e4671d6f3 now-deploy: improve help 2016-05-27 17:26:08 -07:00
Guillermo Rauch
90c602d9c1 now-alias: add add as synonym to set 2016-05-27 17:13:18 -07:00
Guillermo Rauch
3643bac7b9 now-alias: add support for implicit set 2016-05-27 16:57:06 -07:00
Guillermo Rauch
ecc7d10ac4 index: restore _fetch 2016-05-27 16:32:48 -07:00
Guillermo Rauch
69fda5cf98 index: de-privatize fetch 2016-05-27 16:21:31 -07:00
Guillermo Rauch
953b32a939 improve stdout 2016-05-27 16:11:43 -07:00
Guillermo Rauch
6d1cc81e3c help columns consistently 2016-05-27 15:53:08 -07:00
Guillermo Rauch
c5e966c1c1 now-remove: make consistent with now-alias 2016-05-27 15:46:08 -07:00
Guillermo Rauch
e0a7229b12 now-alias: improve docs 2016-05-27 15:33:14 -07:00
Guillermo Rauch
0c0c6854f2 alias: use global retry 2016-05-27 14:21:03 -07:00
Guillermo Rauch
439866a2d5 now-remove: consistent alias position 2016-05-27 14:20:47 -07:00
Guillermo Rauch
c8d320c71c now-list: consistent alias position 2016-05-27 14:20:38 -07:00
Guillermo Rauch
a2855c178e now-alias: clean up docs and fix node bug with early exit 2016-05-27 14:20:24 -07:00
Guillermo Rauch
d56f6adc75 improve display of now list 2016-05-27 13:04:56 -07:00
Guillermo Rauch
60833ebdd1 package: bump projects 2016-05-27 12:32:52 -07:00
Guillermo Rauch
8d51393a16 bump email-prompt (bad publish with npm on node 6) 2016-05-27 12:19:01 -07:00
Guillermo Rauch
525242ce54 Merge branch 'add/now-alias' 2016-05-27 09:14:30 -07:00
Guillermo Rauch
53537461c7 bump email-prompt to support spacebar-triggered email autocompletion 2016-05-27 08:49:52 -07:00
Guillermo Rauch
fe4912f8c0 Revert "Revert "add http2 support back""
This reverts commit 1bd1b56ce3.
2016-05-27 08:36:51 -07:00
Guillermo Rauch
551e3fbed8 Release 0.14.4 2016-05-23 14:31:33 -07:00
Tony Kovanen
55249aa193 Merge pull request #53 from zeit/implement/async-retry
Implement `async-retry`
2016-05-24 00:29:35 +03:00
Guillermo Rauch
5a198a9680 implement async-retry 2016-05-23 14:20:54 -07:00
Guillermo Rauch
a01ce1076b fix debug 2016-05-23 11:16:50 -07:00
Guillermo Rauch
90bae4d604 Release 0.14.3 2016-05-23 11:11:21 -07:00
Guillermo Rauch
1bd1b56ce3 Revert "add http2 support back"
This reverts commit b1a979d698.
2016-05-23 11:11:02 -07:00
Guillermo Rauch
87b907e272 Release 0.14.2 2016-05-23 10:58:36 -07:00
Guillermo Rauch
b1dd15879c Release 0.14.1 2016-05-23 10:11:52 -07:00
Guillermo Rauch
d481c5e966 remove .next from ignored 2016-05-23 08:57:18 -07:00
Guillermo Rauch
d26a6242ac add support for email-prompt 2016-05-23 08:11:55 -07:00
Guillermo Rauch
8526739dfa Release 0.14.0 2016-05-22 14:55:45 -07:00
Guillermo Rauch
ba586793ec Merge branch 'master' of github.com:zeithq/now 2016-05-22 13:18:50 -07:00
Naoyuki Kanezawa
d400c9de6c Merge pull request #52 from zeit/add/email-validation
Add email validation and input retrying
2016-05-22 13:21:11 +09:00
Guillermo Rauch
d29be302f3 less strict email validation (ditch support for hostnames) 2016-05-21 20:55:11 -07:00
Guillermo Rauch
4b1a90d1f8 add email validation and input retrying 2016-05-21 20:46:38 -07:00
Guillermo Rauch
f0748bd61b Merge branch 'add/http-2' 2016-05-18 14:58:23 -07:00
Guillermo Rauch
21ea9859a2 index: simplify _fetch 2016-05-18 11:58:34 -07:00
Guillermo Rauch
f1f4930072 package: bump spdy 2016-05-18 11:58:26 -07:00
Guillermo Rauch
8cedc55394 now-remove: exit process after saying n to remove 2016-05-18 09:01:52 -07:00
Guillermo Rauch
86dc31ec5c Release 0.13.3 2016-05-17 14:41:05 -07:00
Guillermo Rauch
f4c9ad240d Merge branch 'master' into add/http-2 2016-05-17 10:42:29 -07:00
Guillermo Rauch
be5cd55a81 Release 0.13.2 2016-05-17 10:07:38 -07:00
Guillermo Rauch
0ce5e8dc76 Merge branch 'master' of github.com:zeithq/now 2016-05-17 08:42:54 -07:00
Tony Kovanen
6d189db9d8 Sketch requests
(Mostly we need to decide what the route for DELETE is gonna look like)
2016-05-16 16:02:33 +03:00
Tony Kovanen
cdcded8b95 Add very basic now-alias structure 2016-05-16 15:17:29 +03:00
Guillermo Rauch
1c0321dae1 Merge pull request #50 from zeit/add/now-engines
Add now-engines
2016-05-15 14:03:51 -07:00
Tony Kovanen
18ce422962 Add warnings for unfound node version match 2016-05-16 00:00:53 +03:00
Tony Kovanen
194330216a Read and send now-engines 2016-05-15 18:32:44 +03:00
Guillermo Rauch
dd5516e1ed remove test and tests from ignored files 2016-05-14 09:39:46 -07:00
Guillermo Rauch
9315160111 Release 0.13.1 2016-05-12 16:47:35 -07:00
Guillermo Rauch
b44140e262 fix zeit endpoints 2016-05-12 16:46:36 -07:00
Guillermo Rauch
e712759b50 Release 0.13.0 2016-05-12 16:25:37 -07:00
Guillermo Rauch
f41397651f login: adapt code for api.zeit.co 2016-05-12 16:25:15 -07:00
Guillermo Rauch
e860c1d3c0 Merge pull request #47 from zeit/add/api-zeit-warnings
migrate to api.zeit.co and add warnings support
2016-05-12 13:23:48 -07:00
Tony Kovanen
7608bf6fd6 Fix file size warning reporting 2016-05-12 23:09:25 +03:00
Tony Kovanen
5caa1dc8f4 Fix .reason match for file size warnings 2016-05-12 23:00:24 +03:00
Guillermo Rauch
19a2e55a90 migrate to api.zeit.co and add warnings support 2016-05-12 12:41:18 -07:00
Guillermo Rauch
b1a979d698 add http2 support back 2016-05-06 10:09:39 -07:00
Guillermo Rauch
e3e2950a93 Release 0.12.0 2016-04-29 13:25:59 -07:00
Guillermo Rauch
01d8b9e9a9 Merge pull request #44 from zeit/fix/properly-send-duplicate-files-with-same-sha
Send duplicate file SHAs with different paths
2016-04-25 10:26:21 -07:00
Tony Kovanen
336c688d45 Use prototype to apply concat and comment intent 2016-04-25 20:21:27 +03:00
Tony Kovanen
bb22a4c542 Send duplicate file SHAs with different paths 2016-04-25 00:04:13 +03:00
Guillermo Rauch
66ba99fdbf Release 0.11.0 2016-04-24 12:38:30 -07:00
Guillermo Rauch
4a91aed504 index: improve error for wrong directory 2016-04-23 16:27:56 -07:00
Guillermo Rauch
81214d9fcf now-remove: improve success message output 2016-04-23 16:26:12 -07:00
Guillermo Rauch
f5975b3d3b Merge pull request #43 from zeit/add/url-to-confirm
Show url instead of deployment id in confirmation
2016-04-23 16:23:32 -07:00
Tony Kovanen
95a0263295 Parity of output with now ls 2016-04-24 02:15:42 +03:00
Tony Kovanen
f3591dedf6 Remove double space 2016-04-24 01:59:06 +03:00
Tony Kovanen
e8ff848e3b Add https:// to displayed url for cmd + click 2016-04-24 01:56:09 +03:00
Tony Kovanen
231ad68934 Show url instead of deployment id in confirmation 2016-04-24 01:51:16 +03:00
Guillermo Rauch
ceb7812ec8 now-remove: improve ux a bit, make colors more consistent 2016-04-23 15:29:50 -07:00
Guillermo Rauch
d498b1056e now-remove: show help upon missing id 2016-04-23 15:23:46 -07:00
Guillermo Rauch
9522653e34 now-deploy: simplify help 2016-04-23 11:15:20 -07:00
Guillermo Rauch
8213f16cb8 Merge pull request #40 from zeit/add/now-rm
Add now rm
2016-04-23 10:42:15 -07:00
Guillermo Rauch
402f3abb34 Release 0.10.2 2016-04-23 10:32:13 -07:00
Guillermo Rauch
531fed6b76 Merge pull request #42 from zeit/fix/path-handling-on-windows
Fix path handling for windows
2016-04-23 10:31:25 -07:00
Tony Kovanen
aaa036f3e7 Fix path handling for windows 2016-04-23 15:52:46 +03:00
Guillermo Rauch
f862c33ba6 Release 0.10.1 2016-04-22 18:13:40 -07:00
Naoyuki Kanezawa
a56efa9911 Merge pull request #41 from zeit/fix/subcommands-on-windows
Fix subcommands (including deploying) on windows
2016-04-21 18:36:09 +09:00
Tony Kovanen
49f45a8456 Fix subcommands (including deploying) on windows 2016-04-21 12:31:35 +03:00
Tony Kovanen
d7ed912502 Add back help for now-rm 2016-04-20 18:28:22 +03:00
Tony Kovanen
f30fa9a848 Merge branch 'master' of github.com:zeithq/now into add/now-rm 2016-04-20 16:28:25 +03:00
Tony Kovanen
63ed5b31cc Add --hard option to now-rm 2016-04-20 16:24:16 +03:00
Guillermo Rauch
190179806f Release 0.10.0 2016-04-19 22:42:51 -03:00
Guillermo Rauch
5cf2ebe45b now-list: style 2016-04-19 21:36:04 -03:00
Tony Kovanen
56fc395c58 Remove docs for now rm temporarily 2016-04-20 01:45:08 +03:00
Tony Kovanen
8da4db0fae Fix debug print 2016-04-20 01:29:07 +03:00
Tony Kovanen
d2d81ff188 Show error properly on missing did 2016-04-20 01:27:56 +03:00
Tony Kovanen
18e516bfab Add help 2016-04-20 01:27:50 +03:00
Guillermo Rauch
fc1026d2b8 Merge pull request #38 from zeit/fix/now-list-style
Improve the style of now-list
2016-04-19 19:15:57 -03:00
Tony Kovanen
0e2041d638 Fix body 2016-04-19 23:53:31 +03:00
Tony Kovanen
18825653b3 Merge branch 'master' of github.com:zeithq/now into add/now-rm 2016-04-19 15:31:29 +03:00
Tony Kovanen
d1fd53b3de Merge pull request #39 from zeit/add/help
Add help subcommand
2016-04-19 15:29:42 +03:00
nkzawa
dc92b119ce add help for now-list 2016-04-19 20:28:43 +09:00
nkzawa
0c652d73c8 display default help if wrong command was specified 2016-04-19 20:28:28 +09:00
nkzawa
66f4cc2de6 fix help text 2016-04-19 20:12:44 +09:00
nkzawa
400a67bef9 add the help command 2016-04-19 20:00:17 +09:00
nkzawa
f2282a1791 improve the style of now-list 2016-04-19 13:48:27 +09:00
Tony Kovanen
9b55ca862c Merge branch 'master' of github.com:zeithq/now into add/now-rm 2016-04-17 21:37:04 +03:00
Tony Kovanen
39585776cc Merge pull request #35 from zeit/fix/now-list-sort
Sort now-list result
2016-04-17 01:21:41 +03:00
nkzawa
13be7ae16a sort now-list result 2016-04-17 07:01:13 +09:00
Tony Kovanen
9ade9b0921 Add sketch of now-rm 2016-04-17 00:15:21 +03:00
Tony Kovanen
c389f56d7e Merge pull request #34 from zeit/add/now-list
Add now list
2016-04-16 16:11:17 +03:00
nkzawa
063110008b resume stdin only when reading email 2016-04-16 17:44:10 +09:00
nkzawa
5df1bc6132 now-list: format output 2016-04-16 17:32:42 +09:00
nkzawa
7903aa69a6 add url option for development 2016-04-16 01:23:37 +09:00
nkzawa
0bd3127687 now-deploy: don't check update 2016-04-16 01:20:54 +09:00
nkzawa
1577f471de add base command 2016-04-16 01:20:41 +09:00
nkzawa
ac8256fcb8 bin/now -> bin/now-deploy 2016-04-16 01:20:26 +09:00
Guillermo Rauch
0870dc3a6b Release 0.9.19 2016-04-06 14:35:08 -07:00
Guillermo Rauch
27882ab109 Merge pull request #15 from zeit/fix/windows-path-to-relative
X-platform `toRelative`
2016-04-06 14:34:12 -07:00
Tony Kovanen
8798bd5270 X-platform toRelative 2016-04-07 00:22:59 +03:00
Guillermo Rauch
80772edd4b Release 0.9.18 2016-04-06 13:19:05 -07:00
Guillermo Rauch
cc8bcfadb1 Merge pull request #14 from zeit/fix/list-main-or-files-entry-if-not-found-at-all
If file not found at all, don't attempt to list it
2016-04-06 13:16:36 -07:00
Tony Kovanen
44de0cc8d7 If file not found at all, don't attempt to list it
Like the automatically generated `index.js` main from `npm init` if it's
actually not there.
2016-04-06 23:13:20 +03:00
Guillermo Rauch
a4679cfb1b Release 0.9.17 2016-04-06 09:12:45 -07:00
Guillermo Rauch
b4e1acdb85 Release 0.9.16 2016-04-01 14:07:14 -07:00
Guillermo Rauch
8f473e90b4 always print deployment status 2016-04-01 14:02:40 -07:00
Guillermo Rauch
cbc93e8c6c Release 0.9.15 2016-04-01 12:24:55 -07:00
Guillermo Rauch
2b9b1606a0 fix closing of process 2016-04-01 11:49:36 -07:00
Tony Kovanen
d46433433f Merge pull request #13 from zeithq/add/build-output
Add build output
2016-03-31 18:17:27 +03:00
Guillermo Rauch
8663d3f072 build-logger: connect to io.now.sh and render logs 2016-03-30 20:30:40 -07:00
Guillermo Rauch
c89f0603ea print logs from build 2016-03-30 20:30:18 -07:00
Guillermo Rauch
54d98c6a4e index: prevent shadowing 2016-03-30 20:30:01 -07:00
Guillermo Rauch
a2b90e5376 package: use more accurate terminology (url vs host) 2016-03-30 20:29:44 -07:00
Guillermo Rauch
0656e1b1eb package: add ansi-escapes and socket.io-client 2016-03-30 20:28:46 -07:00
Guillermo Rauch
9701e71450 Merge pull request #12 from zeithq/fix/unwanted-bail
Fix unwanted bails
2016-03-30 08:32:30 -07:00
Tony Kovanen
5d37847b08 Fix unwanted bails 2016-03-30 17:27:15 +03:00
Guillermo Rauch
1aa4fbf216 now: fix indent 2016-03-29 22:21:49 -07:00
Tony Kovanen
44b34a3956 Merge pull request #11 from zeithq/fix/skip-updates-on-no-tty
ignore update checking if no tty
2016-03-30 00:23:53 +03:00
Guillermo Rauch
b7dc0a2c90 ignore update checking if no tty 2016-03-29 14:13:25 -07:00
Tony Kovanen
df4fd9320a Merge pull request #10 from zeithq/ditch/commander-js
now: move from commander to minimist
2016-03-29 23:08:04 +03:00
Guillermo Rauch
a759be2203 now: move from commander to minimist 2016-03-29 12:54:09 -07:00
Guillermo Rauch
85dc7afc01 Merge pull request #9 from zeithq/fix/429-error-handling
Fix rate limit error handling
2016-03-19 11:33:40 -07:00
nkzawa
d0ef4ef7fc add messages for rate limit exceeded error 2016-03-20 02:04:14 +09:00
nkzawa
51286add0f no retry if client error 2016-03-20 02:04:03 +09:00
Guillermo Rauch
36f79d17e3 Release 0.9.14 2016-03-17 19:36:10 -07:00
Guillermo Rauch
ed56084f2c index: support now-start 2016-03-17 19:35:40 -07:00
Guillermo Rauch
ae93e2bcf7 Release 0.9.13 2016-03-12 23:15:50 -08:00
Guillermo Rauch
e924034425 index: validate name in package.json 2016-03-12 23:15:01 -08:00
Guillermo Rauch
830a43d2dd Release 0.9.12 2016-03-12 22:14:53 -08:00
Guillermo Rauch
d669b4db7d login: use https for api.now.sh 2016-03-12 22:14:21 -08:00
Guillermo Rauch
a589367ab8 Release 0.9.11 2016-03-12 22:11:19 -08:00
Guillermo Rauch
239a5cd40e fix registration url 2016-03-12 22:10:50 -08:00
Guillermo Rauch
590e0939ab Release 0.9.10 2016-03-12 21:18:31 -08:00
Guillermo Rauch
988a92a97b delete post-install 2016-03-12 21:17:50 -08:00
Guillermo Rauch
041574a544 Release 0.9.9 2016-03-12 20:11:34 -08:00
Guillermo Rauch
4909c75edc now: expose version 2016-03-12 20:10:58 -08:00
2470 changed files with 314082 additions and 1209 deletions

490
.circleci/config.yml Normal file
View File

@@ -0,0 +1,490 @@
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: /.*/

34
.circleci/publish.sh Executable file
View File

@@ -0,0 +1,34 @@
#!/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

37
.editorconfig Normal file
View File

@@ -0,0 +1,37 @@
root = true
[*]
indent_style = space
indent_size = 2
tab_width = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[{*.json,*.json.example,*.gyp,*.yml,*.yaml}]
indent_style = space
indent_size = 2
[{*.py,*.asm}]
indent_style = space
[*.py]
indent_size = 4
[*.asm]
indent_size = 8
[*.md]
trim_trailing_whitespace = false
# Ideal settings - some plugins might support these.
[*.js]
quote_type = single
[{*.c,*.cc,*.h,*.hh,*.cpp,*.hpp,*.m,*.mm,*.mpp,*.js,*.java,*.go,*.rs,*.php,*.ng,*.jsx,*.ts,*.d,*.cs,*.swift}]
curly_bracket_next_line = false
spaces_around_operators = true
spaces_around_brackets = outside
# close enough to 1TB
indent_brace_style = K&R

32
.eslintignore Normal file
View File

@@ -0,0 +1,32 @@
node_modules
dist
# gatsby-plugin-now
packages/gatsby-plugin-now/test/fixtures
# now-cli
packages/now-cli/@types
packages/now-cli/download
packages/now-cli/dist
packages/now-cli/test/fixtures
packages/now-cli/test/dev/fixtures
packages/now-cli/bin
packages/now-cli/link
packages/now-cli/src/util/dev/templates/*.ts
# now-client
packages/now-client/tests/fixtures
packages/now-client/lib
# now-next
packages/now-next/test/fixtures
# now-node
packages/now-node/src/bridge.ts
packages/now-node/test/fixtures
# now-node-bridge
packages/now-node-bridge/bridge.*
# now-static-build
packages/now-static-build/test/fixtures

View File

@@ -1,12 +1,64 @@
{
"extends": "standard",
"parser": "babel-eslint",
"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": {
"yoda": 0,
"arrow-parens": 0,
"semi": [2, "always"],
"no-extra-semi": 2,
"semi-spacing": [2, { "before": false, "after": true }],
"no-shadow": [2, {"builtinGlobals": true, "hoist": "functions"}]
}
"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
}
}
]
}

3
.gitattributes vendored Normal file
View File

@@ -0,0 +1,3 @@
# Ignore test fixtures in GitHub Languages
# See https://github.com/github/linguist#vendored-code
packages/*/test/* linguist-vendored

18
.github/CODEOWNERS vendored Normal file
View File

@@ -0,0 +1,18 @@
# Documentation
# https://help.github.com/en/articles/about-code-owners
* @tootallnate @leo
/packages/now-cli/src/commands/dev/ @tootallnate @leo @styfle @AndyBitz
/packages/now-cli/src/util/dev/ @tootallnate @leo @styfle @AndyBitz
/packages/now-cli/src/commands/domains/ @javivelasco @mglagola @anatrajkovska
/packages/now-cli/src/commands/certs/ @javivelasco @mglagola @anatrajkovska
/packages/now-client @leo @rdev
/packages/now-build-utils @styfle @AndyBitz
/packages/now-node @styfle @tootallnate @lucleray
/packages/now-node-bridge @styfle @tootallnate @lucleray
/packages/now-next @Timer
/packages/now-go @styfle @sophearak
/packages/now-python @styfle @sophearak
/packages/now-ruby @styfle @coetry @nathancahill
/packages/now-static-build @styfle @AndyBitz
/packages/now-routing-utils @dav-is

33
.github/workflows/publish.yml vendored Normal file
View File

@@ -0,0 +1,33 @@
name: Publish
on:
push:
branches:
- master
- canary
tags:
- '!*'
jobs:
Publish:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [10.x]
steps:
- uses: actions/checkout@v1
- name: Checkout
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}
- name: Install
run: yarn install --check-files --frozen-lockfile
- name: Build
run: yarn build
- name: Publish
run: yarn publish-from-github
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

19
.gitignore vendored
View File

@@ -1,3 +1,20 @@
node_modules
build
package-lock.json
dist
npm-debug.log
yarn-error.log
.nyc_output
coverage
*.swp
*.bak
*.tgz
packages/now-cli/.builders
packages/now-cli/assets
packages/now-cli/src/util/dev/templates/*.ts
packages/now-cli/test/**/yarn.lock
!packages/now-cli/test/dev/**/yarn.lock
packages/now-cli/test/**/node_modules
packages/now-cli/test/dev/fixtures/08-hugo/hugo
packages/now-cli/test/dev/fixtures/**/dist
packages/now-cli/test/dev/fixtures/**/public
packages/now-cli/test/fixtures/integration

17
.kodiak.toml Normal file
View File

@@ -0,0 +1,17 @@
version = 1
[merge]
automerge_label = "automerge"
blacklist_title_regex = "^WIP.*"
blacklist_labels = ["work in progress"]
method = "squash"
delete_branch_on_merge = true
block_on_reviews_requested = false
notify_on_conflict = true
optimistic_updates = true
[merge.message]
title = "pull_request_title"
body = "pull_request_body"
include_pr_number = true
body_type = "markdown"

4
.prettierrc Normal file
View File

@@ -0,0 +1,4 @@
{
"singleQuote": true,
"trailingComma": "es5"
}

1
.yarnrc Normal file
View File

@@ -0,0 +1 @@
save-prefix ""

74
CODE_OF_CONDUCT.md 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 [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/

96
CONTRIBUTING.md 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 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

447
DEVELOPING_A_BUILDER.md Normal file
View File

@@ -0,0 +1,447 @@
# 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$/, '')
```

View File

@@ -1,58 +0,0 @@
0.9.8 / 2016-03-12
==================
* cap maximum concurrent uploads due to HTTP/2 streams limit [@rauchg]
* make login resolve token [@rase-]
0.9.7 / 2016-03-10
==================
* Add `-F, --forceSync` flag [@rauchg]
0.9.6 / 2016-03-04
==================
* send files as buffers [@rase-]
* simplify cfg reading / merging [@rauchg]
* ignored: ignore `.dockerignore` [@rauchg]
* add auto updater with support for timeout, exit handler [@rauchg]
* package: bump `gulp-eslint` to work with latest eslint [@rauchg]
* fix eslint [@rauchg]
0.9.5 / 2016-03-04
==================
* login: fix usage of `Object.assign` [@rauchg]
* post-install: improve error handling [@rauchg]
* post-install: make runnable as script [@rauchg]
* package: use `build/scripts` for postinstall [@rauchg]
* index: fallback to directory name [@rauchg]
* index: send `package.json` metadata like `name` [@rauchg]
0.9.4 / 2016-03-03
==================
* login: extend configuration instead of overwriting it [@rauchg]
0.9.3 / 2016-03-03
==================
* more debug information [@rauchg]
0.9.2 / 2016-03-03
==================
* update ignores list [@rauchg]
0.9.1 / 2016-03-03
==================
* index: throw error if `start` is not defined. [@rauchg]
* now: revert usage of `now` [@rauchg]
* package: simplify `files` [@rauchg]
0.9.0 / 2016-03-03
==================
* initial release

190
LICENSE Normal file
View File

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

41
README.md Normal file
View File

@@ -0,0 +1,41 @@
![now](https://assets.zeit.co/image/upload/v1542240976/repositories/now-cli/now-cli-repo-banner-v3.png)
[![Build Status](https://badgen.net/circleci/github/zeit/now/master)](https://circleci.com/gh/zeit/workflows/now/tree/master)
[![Join the community on Spectrum](https://withspectrum.github.io/badge/badge.svg)](https://spectrum.chat/zeit)
**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
To install the latest version of Now CLI, visit [zeit.co/download](https://zeit.co/download) or run this command:
```
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
For details on how to use Now CLI, check out our [documentation](https://zeit.co/docs).
## 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
2. Install dependencies with `yarn install`
3. Compile the code: `yarn build`
4. Link the package to the global module directory: `yarn link`
5. You can now start using `now` 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.
## 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).

View File

@@ -1,45 +0,0 @@
# now
The fastest way to deploy a Node.JS service.
## How it works
In any directory with a `package.json`, run:
```bash
$ now
> https://some-code-nd23n2.now.sh
```
every time you run it, you get a new URL (unless nothing's changed).
### Conventions
1. `package.json` must contain a `start` task inside `scripts`.
If a `now` script is defined, that's used instead.
2. Only files that would be included in `npm publish` are synchronized.
`package.json` `files` field, `.npmignore` and `.gitignore` are supported.
3. If a build step is needed, specify a `build` task in `scripts`.
If `now-build` is defined, that's used instead.
## Installing
```bash
$ npm install -g now
> Enter your email: rauchg@gmail.com.
> We sent an email. Click to log in.
```
## Features
- **Slim**. No reliance on Git.
- **Fast**. Blazing fast sync with deduping.
- **Standard**. Respects npm and Node.JS conventions.
- **Easy**. No need to specify ports, `Dockerfile` or config.
## Options
```
-d Debug mode. Lists all files to be uploaded.
-f Force. Creates a new URL even if nothing has changed.
```

25
VERSIONING.md Normal file
View File

@@ -0,0 +1,25 @@
# 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.

151
bin/now
View File

@@ -1,151 +0,0 @@
#!/usr/bin/env node
import program from 'commander';
import Progress from 'progress';
import copy from '../lib/copy';
import * as cfg from '../lib/cfg';
import { resolve } from 'path';
import login from '../lib/login';
import checkUpdate from '../lib/check-update';
import bytes from 'bytes';
import chalk from 'chalk';
import Now from '../lib';
import ms from 'ms';
program
.usage('[options]')
.option('-d, --debug', 'Debug mode [off]', false)
.option('-f, --force', 'Force a new deployment even if nothing has changed', false)
.option('-F, --forceSync', 'Force a new deployment even if nothing has changed and force syncing of all files', false)
.option('-L, --login', 'Configure login')
.option('-C, --no-clipboard', 'Do not attempt to copy URL to clipboard')
.parse(process.argv);
let path = program.args[program.args.length - 1];
if (path) {
if ('/' !== path[0]) {
path = resolve(process.cwd(), path);
}
} else {
path = process.cwd();
}
const debug = !!program.debug;
const clipboard = !program.noClipboard;
const config = cfg.read();
const update = checkUpdate({ debug });
const exit = (code) => {
update.then(() => process.exit(code));
// don't wait for updates more than a second
// when the process really wants to exit
setTimeout(() => process.exit(code), 1000);
};
if (!config.token || program.login) {
login()
.then((token) => {
if (program.login) {
console.log('> Logged in successfully. Token saved in ~/.now.json');
exit(0);
} else {
sync(token).catch((err) => {
error(`Unknown error: ${err.stack}`);
exit(1);
});
}
})
.catch((e) => {
error(`Authentication error ${e.message}`);
exit(1);
});
} else {
sync(config.token).catch((err) => {
error(`Unknown error: ${err.stack}`);
exit(1);
});
}
async function sync (token) {
const start = Date.now();
console.log(`> Deploying "${path}"`);
const now = new Now(token, { debug });
try {
await now.create(path, { forceNew: program.force, forceSync: program.forceSync });
} catch (err) {
handleError(err);
return;
}
const { url } = now;
const elapsed = ms(new Date() - start);
if (clipboard) {
try {
await copy(url);
console.log(`> ${chalk.cyan('Ready!')} ${chalk.bold(`https://${url}`)} (copied to clipboard) [${elapsed}]`);
} catch (err) {
console.log(`> ${chalk.cyan('Ready!')} ${chalk.bold(`https://${url}`)} [${elapsed}]`);
}
} else {
console.log(`> ${url} [${elapsed}]`);
}
const start_u = new Date();
const complete = () => {
const elapsed_u = ms(new Date() - start_u);
console.log(`> Sync complete (${bytes(now.syncAmount)}) [${elapsed_u}] `);
now.close();
exit(0);
};
if (now.syncAmount) {
const bar = new Progress('> Upload [:bar] :percent :etas', {
width: 20,
complete: '=',
incomplete: '',
total: now.syncAmount
});
now.upload();
now.on('upload', ({ name, data }) => {
const amount = data.length;
if (debug) {
console.log(`> [debug] Uploaded: ${name} (${bytes(data.length)})`);
}
bar.tick(amount);
});
now.on('complete', complete);
now.on('error', (err) => {
error('Upload failed');
handleError(err);
exit(1);
});
} else {
console.log('> Sync complete (cached)');
now.close();
exit(0);
}
}
function handleError (err) {
if (403 === err.status) {
error('Authentication error. Run `now -L` or `now --login` to log-in again.');
} else if (err.userError) {
error(err.message);
} else if (500 === err.status) {
error('Unexpected server error. Please retry.');
} else {
error(`Unexpected error. Please try later. (${err.message})`);
}
exit(1);
}
function error (err) {
console.error(`> \u001b[31mError!\u001b[39m ${err}`);
}

18
changelog.js Normal file
View File

@@ -0,0 +1,18 @@
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`);

36
diff.js Normal file
View File

@@ -0,0 +1,36 @@
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

@@ -0,0 +1,27 @@
# The DNS Challenge Could Not Be Solved
## Why This Error Occurred
When generating a certificate, we have to prove ownership over the domain
for the Certificate Authority (CA) that issues it. This error means that
the provider couldnt solve the requested challenges.
## How to Fix It
If your domain is pointing to ZEIT World DNS and youre getting this error,
it could be that:
- The domain was acquired recently, and it might not be ready for use yet.
- Required DNS records have not propagated yet.
When running into this, ensure that your nameservers are configured correctly. Also, if you bought the domain recently or have made changes, please be patient,
it might take a while for these to be ready.
If your domain is _not_ pointing to ZEIT World DNS and youre getting this
error, the following methods could help:
- When solving challenges *manually*, ensure that the TXT
records required to solve the challenges exist and are propagated. You can do so by querying the nameservers with `nslookup -q=TXT _acme-challenge.domain.com` depending on the Common Names you want for your certificate.
- 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.

View File

@@ -0,0 +1,37 @@
# Invalid Region or DC Identifier
#### Why This Error Occurred
When supplying `regions` or `scale` settings, you
used an unknown or invalid dc identifier.
#### Possible Ways to Fix It
Check your `now.json` or `--regions` flag and
make sure you are using a valid string. 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`
When passing multiple `--regions` as a CLI parameter,
make sure they're separated by a comma (`,`). For example:
```console
now --regions sfo,bru,gru
```

View File

@@ -0,0 +1,23 @@
# The DNS Configuration can't be verified
## Why This Error Occurred
When generating a certificate, we have to prove ownership over the domain
for the Certificate Authority (CA) that issues it. We also run some pretests
to make sure the DNS is properly configured before submitting the request to
the CA. This error means that these pretests did not succeed.
## How to Fix It
If your domain is pointing to ZEIT World DNS and youre getting this error,
it could be that:
- The domain was acquired recently, and it might not be ready for use yet.
- Required DNS records have not propagated yet.
When running into this, ensure that your nameservers have configuration is correct. Also, if you bought the domain recently or have made changes, please be patient,
it might take a while for these to be ready.
If your domain is _not_ pointing to ZEIT World DNS and youre getting this
error, you must ensure that you have an `ALIAS` and `CNAME` records in place.
Ensure also that you have disabled automatic redirects to `https` and ensure all changes were propagated.

View File

@@ -0,0 +1,21 @@
# Domain Verification
#### Why This Error Occurred
The domain you supplied cannot be verified using either the intended set of nameservers of the given verification TXT record.
#### Possible Ways to Fix It
Apply the intended set of nameservers to your domain or add the given TXT verification record through your domain provider.
You can retrieve both the intended nameservers and TXT verification record for the domain you wish to verify by running `now domains inspect <domain>`.
When you have added either verification method to your domain, you can run `now domains verify <domain>` again to complete verification for your domain.
ZEIT will also automatically check periodically that your domain has been verified and automatically mark it as such if we detect either verification method on the domain.
If you would not like to verify your domain, you can remove it from your account using `now domains rm <domain>`.
#### Resources
- [ZEIT Domains Documentation](https://zeit.co/docs/v2/domains-and-aliases/adding-a-domain/)
- [Zero-Downtime Domain Migration Guide](https://zeit.co/docs/v2/domains-and-aliases/zero-downtime-domain-migration/)

17
errors/env-no-secret.md Normal file
View File

@@ -0,0 +1,17 @@
# Secret Not Found
#### Why This Error Occurred
You specified the `--env` or `-e` flag with the value of a secret. However, the secret doesn't exist in the current scope you're in.
#### Possible Ways to Fix It
Make sure to specify the environment variable and secret like that:
```bash
now -e VARIABLE_NAME=@secret-name
```
In addition, ensure that the secret (`@secret-name` in the example above) exists in the current scope (the team or user account that you're using).
You can run `now switch` or `--scope` to switch to a different team or user.

View File

@@ -0,0 +1,21 @@
# Bad Type in Env Value
#### Why This Error Occurred
You supplied a value in the `env` of your deployment whose type is not allowed.
This occurs for example if you use a `Boolean` as a type:
```json
{
"env": {
"VALID": 1,
"INVALID": true
}
}
```
#### Possible Ways to Fix It
The only accepted types are `String` or `Number`. If you're using a
`Boolean`, consider using `1` (`Number`) or `"true"` (`String`).

View File

@@ -0,0 +1,9 @@
# 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

@@ -0,0 +1,26 @@
# Missing Environment Variables While Developing
#### Why This Error Occurred
You ran `now dev` inside a project that contains a `now.json` file with `env` or `build.env` properties that use [Now Secrets](https://zeit.co/docs/v2/deployments/environment-variables-and-secrets).
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.
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.
Read below for how to address this error.
#### Possible Ways to Fix It
The error message will list environment variables that are required and which file they are required to be included in (either `.env` or `.env.build`).
If the file does not exist yet, please create the file that the error message mentions and insert the missing environment variable into it.
For example, if the error message shows that the environment variable `TEST` is missing from `.env`, then the `.env` file should look like this:
```
TEST=value
```
In the above example, `TEST` represents the name of the environment variable and `value` its value.
For more information on Environment Variables in development, [see the documentation](https://zeit.co/docs/v2/development/environment-variables/).

View File

@@ -0,0 +1,19 @@
# Missing Env Key and Value
#### Why This Error Occurred
You specified the `--env` or `-e` flag and didn't add a name and value for the environment variable.
#### Possible Ways to Fix It
Make sure to set the name and value of the variable like this:
```bash
now -e VARIABLE_NAME="VALUE"
```
You can also specify a environment variable that contains a secret:
```bash
now -e VARIABLE_NAME=@secret-name
```

View File

@@ -0,0 +1,11 @@
# Missing Scope Value
#### Why This Error Occurred
The `--scope` flag was specified, but there's no value for it available.
#### Possible Ways to Fix It
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`.

View File

@@ -0,0 +1,11 @@
# Missing Token Value
#### Why This Error Occurred
The `--token` flag was specified, but there's no value for it available.
#### Possible Ways to Fix It
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).

View File

@@ -0,0 +1,10 @@
# No Credentials Found
#### 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.
#### 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).
- Ensure that both `~/now/auth.json` and `~/now/config.json` exist

View File

@@ -0,0 +1,10 @@
# No Open Port Found
#### Why This Error Occurred
Your application code exited or timed out before binding to a port number.
#### Possible Ways to Fix It
- For Node.js deployments, a call to [`Server#listen()`](https://nodejs.org/dist/latest/docs/api/http.html#http_server_listen) might be missing.
- For Docker deployments, there might be a mismatch from what the `EXPOSE` directive specifies compared to what your application binds to.

View File

@@ -0,0 +1,11 @@
# No Token Allowed
#### 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.
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).
#### 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.

View File

@@ -0,0 +1,9 @@
# `now dev` as `dev` script
#### Why This Error Occurred
The `package.json` file of the used project invokes `now dev` as `dev` script. This would cause `now dev` to recursively invoke itself.
#### Possible Ways to Fix It
Adjust the `dev` script inside the `package.json` file to match what your framework uses to begin development mode, e.g. `next` for Next.js or `gatsby develop` for Gatsby.

View File

@@ -0,0 +1,72 @@
# `@now/next` Legacy Mode
#### Why This Warning Occurred
`@now/next` has two modes: `legacy` and `serverless`. You will always want to use the `serverless` mode. `legacy` is to provide backwards compatibility with previous `@now/next` versions.
The differences:
Legacy:
- Minimal lambda size of `2.2Mb` (approximately)
- Forces `next@v7.0.2-canary.49` and `next-server@v7.0.2-canary.49`
- Forces all `dependencies` to be `devDependencies`
- Loads `next.config.js` on bootup, breaking sometimes when users didn't use `phases` to load files
- Used `next-server` which is the full Next.js server with routing etc.
- Runs `npm install`
- Runs `npm run now-build`
- Runs `npm install --production` after build
Serverless:
- Minimal lambda size of `49Kb` (approximately)
- Uses Next.js build targets (`target: 'serverless'`) in `next.config.js`. [documentation](https://github.com/zeit/next.js#summary)
- 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))
- Runs `npm install`
- Runs `npm run now-build`
- Does not run `npm install --production` as the output from the build is all that's needed to bundle lambdas.
- No runtime dependencies, meaning smaller lambda functions
- Optimized for fast [cold start](https://zeit.co/blog/serverless-ssr#cold-start)
#### Possible Ways to Fix It
In order to create the smallest possible lambdas Next.js has to be configured to build for the `serverless` target.
1. Serverless Next.js requires Next.js 8 or later, to upgrade you can install the `latest` version:
```
npm install next --save
```
2. Add the `now-build` script to your `package.json`
```json
{
"scripts": {
"now-build": "next build"
}
}
```
3. Add `target: 'serverless'` to `next.config.js`
```js
module.exports = {
target: 'serverless',
// Other options are still valid
};
```
4. Optionally make sure the `"src"` in `"builds"` points to your application `package.json`
```js
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@now/next" }]
}
```
### Useful Links
- [Serverless target implementation](https://github.com/zeit/now-builders/pull/150)

View File

@@ -0,0 +1,45 @@
# `@now/next` No Serverless Pages Built
#### Why This Error Occurred
This error occurs when you have your application is not configured for Serverless Next.js build output.
#### Possible Ways to Fix It
In order to create the smallest possible lambdas Next.js has to be configured to build for the `serverless` target.
1. Serverless Next.js requires Next.js 8 or later, to upgrade you can install the `latest` version:
```
npm install next --save
```
2. Add the `now-build` script to your `package.json`
```json
{
"scripts": {
"now-build": "next build"
}
}
```
3. Add `target: 'serverless'` to `next.config.js`
```js
module.exports = {
target: 'serverless',
// Other options
};
```
4. Remove `distDir` from `next.config.js` as `@now/next` can't parse this file and expects your build output at `/.next`
5. Optionally make sure the `"src"` in `"builds"` points to your application `package.json`
```js
{
"version": 2,
"builds": [{ "src": "package.json", "use": "@now/next" }]
}
```

View File

@@ -0,0 +1,38 @@
# `@now/static-build` Failed to detect a server running
#### Why This Warning Occurred
When running `now dev`, the `@now/static-build` builder proxies relevant HTTP
requests to the server that is created by the `now-dev` script in the
`package.json` file.
In order for `now dev` to know which port the server is running on, the builder
is provided a `$PORT` environment variable that the server _must_ bind to. The
error "Failed to detect a server running on port" is printed if the builder fails
to detect a server listening on that specific port within five minutes.
#### Possible Ways to Fix It
Please ensure that your `now-dev` script binds the spawned development server on
the provided `$PORT` that the builder expects the server to bind to.
For example, if you are using Gatsby, your `now-dev` script must use the `-p`
(port) option to bind to the `$PORT` specified from the builder:
```
{
...
"scripts": {
...
"now-dev": "gatsby develop -p $PORT"
}
}
```
Consult your static builder program's `--help` or documentation to figure out what
the command line flag to bind to a specific port is (in many cases, it is one of:
`-p` / `-P` / `--port`).
### Useful Links
- [`@now/static-build` Local Development Documentation](https://zeit.co/docs/v2/deployments/official-builders/static-build-now-static-build#local-development)

View File

@@ -0,0 +1,15 @@
# Path Not Deployable
#### 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>`.
#### Possible Ways to Fix It
Make sure that you're not trying to deploy one of these directories:
- User
- Downloads
- Desktop
These directories are not supported for security reasons.

View File

@@ -0,0 +1,32 @@
# 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

@@ -0,0 +1,36 @@
# 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
```

31
errors/scale-ls.md Normal file
View File

@@ -0,0 +1,31 @@
# `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

@@ -0,0 +1,12 @@
# 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

@@ -0,0 +1,10 @@
# Scope Not Accessible
#### Why This Error Occurred
You specified the `--scope` flag and specified the ID or slug of a team that you're not a part of or a user whose account you don't own. This problem could also occur if your user credentials aren't valid anymore.
#### Possible Ways to Fix It
- Make sure commands like `now ls` work just fine. This will ensure that your user credentials are valid. If it's not working correctly, please log in again using `now login`.
- Ensure that the scope you specified using `--scope` shows up in the output of `now switch`. If it doesn't, you're either not part of the team (if you specified a team) or you logged into the wrong user account.

View File

@@ -0,0 +1,11 @@
# Scope Not Existent
#### 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.
#### Possible Ways to Fix It
If you're sure the specified team exists, please make sure that you're a part of it (ask an owner of the team to invite you). If you specified the identifier of a user, make sure you are actually the owner of this account.
Otherwise, either create a team with the specified slug or ensure that the identifier is correct if you're sure that the scope exists.

View File

@@ -0,0 +1,20 @@
# DNS Challenges must be solved manually
## Why This Error Occurred
When generating a certificate, we have to prove ownership over the domain
for the Certificate Authority (CA) that issues it. In the case of Wildcard Certificates,
the requested challenge consists of adding TXT DNS records so, when the domain does not
point to ZEIT World DNS, we cannot create the records to solve the challenge.
## How to Fix It
To generate a certificate solving challenges manually, you must add the given `TXT` records with
the appropriate name to your DNS. Then, after verifying that the CA can read the records,
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
get those records again in the console, You can run the issuance command including the
`--challenge-only` option. This way the CLI will output the challenges information and,
after adding those records, you can rerun the command without `--challenge-only` to finish
issuance.

View File

@@ -0,0 +1,9 @@
# Not authorized to access domain
#### Why This Error Occurred
You tried to add or update a domain's configuration, but you don't have permission to modify the domain.
#### 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.

17
errors/v2-no-min.md Normal file
View File

@@ -0,0 +1,17 @@
# 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

@@ -0,0 +1,29 @@
# 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>`)

View File

@@ -1,75 +0,0 @@
const gulp = require('gulp');
const del = require('del');
const ext = require('gulp-ext');
const babel = require('gulp-babel');
const eslint = require('gulp-eslint');
const uglify = require('gulp-uglify');
const help = require('gulp-task-listing');
gulp.task('help', help);
gulp.task('compile', [
'compile-lib',
'compile-bin',
'compile-scripts'
]);
gulp.task('compile-lib', function () {
return gulp.src('lib/**/*.js')
.pipe(babel({
presets: ['es2015'],
plugins: [
'syntax-async-functions',
'transform-async-to-generator',
'transform-runtime'
]
}))
.pipe(uglify())
.pipe(gulp.dest('build/lib'));
});
gulp.task('compile-bin', function () {
return gulp.src('bin/*')
.pipe(babel({
presets: ['es2015'],
plugins: [
'syntax-async-functions',
'transform-async-to-generator',
'transform-runtime'
]
}))
.pipe(uglify())
.pipe(ext.crop())
.pipe(gulp.dest('build/bin'));
});
gulp.task('compile-scripts', function () {
return gulp.src('scripts/*')
.pipe(babel({
presets: ['es2015'],
plugins: [
'syntax-async-functions',
'transform-async-to-generator',
'transform-runtime'
]
}))
.pipe(ext.crop())
.pipe(gulp.dest('build/scripts'));
});
gulp.task('lint', function () {
return gulp.src([
'gulpfile.js',
'lib/**/*.js',
'bin/*'
])
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
});
gulp.task('clean', function () {
return del(['build']);
});
gulp.task('default', ['lint', 'compile']);

14
lerna.json Normal file
View File

@@ -0,0 +1,14 @@
{
"npmClient": "yarn",
"useWorkspaces": true,
"packages": ["packages/*"],
"command": {
"publish": {
"npmClient": "npm",
"allowBranch": ["master", "canary"],
"registry": "https://registry.npmjs.org/"
}
},
"version": "independent"
}

View File

@@ -1,63 +0,0 @@
import http2 from 'spdy';
import fetch from 'node-fetch';
/**
* Returns a `fetch` version with a similar
* API to the browser's configured with a
* HTTP2 agent.
*
* It encodes `body` automatically as JSON.
*
* @param {String} host
* @return {Function} fetch
*/
export default class Agent {
constructor (host, { debug } = {}) {
this._host = host;
this._debug = debug;
this._initAgent();
}
_initAgent () {
this._agent = http2.createAgent({
host: this._host,
port: 443
}).once('error', (err) => this._onError(err));
}
_onError (err) {
// XXX: should we `this.emit()`?
if (this._debug) {
console.log('> [debug] agent connection error', err.stack);
}
this._error = err;
}
fetch (path, opts = {}) {
if (this._error) {
if (this._debug) console.log('> [debug] re-initializing agent after error');
this._error = null;
this._initAgent();
}
const { body } = opts;
opts.agent = this._agent;
if (body && 'object' === typeof body && 'function' !== typeof body.pipe) {
opts.headers['Content-Type'] = 'application/json';
opts.body = JSON.stringify(body);
}
if (null != opts.body && 'function' !== typeof body.pipe) {
opts.headers['Content-Length'] = Buffer.byteLength(opts.body);
}
return fetch(`https://${this._host}${path}`, opts);
}
close () {
if (this._debug) console.log('> [debug] closing agent');
return this._agent.close();
}
}

View File

@@ -1,27 +0,0 @@
import path from 'path';
import fs from 'fs-promise';
import { homedir } from 'os';
const file = path.resolve(homedir(), '.now.json');
export function read () {
let existing = null;
try {
existing = fs.readFileSync(file, 'utf8');
existing = JSON.parse(existing);
} catch (err) {}
return existing || {};
}
/**
* Merges the `data` object onto the
* JSON config stored in `.now.json`.
*
* (atomic)
* @param {Object} data
*/
export function merge (data) {
const cfg = Object.assign({}, read(), data);
fs.writeFileSync(file, JSON.stringify(cfg, null, 2));
}

View File

@@ -1,68 +0,0 @@
import ms from 'ms';
import pkg from '../../package'; // relative to `build/` :\
import fetch from 'node-fetch';
import chalk from 'chalk';
/**
* Configures auto updates.
* Sets up a `exit` listener to report them.
*/
export default function checkUpdate (opts = {}) {
let updateData;
const update = check(opts).then((data) => {
updateData = data;
// forces the `exit` event upon Ctrl + C
process.on('SIGINT', () => {
// clean up output after ^C
process.stdout.write('\n');
process.exit(1);
});
}, (err) => console.error(err.stack));
process.on('exit', (code) => {
if (updateData) {
const { current, latest, at } = updateData;
const ago = ms(Date.now() - at);
console.log(`> ${chalk.white.bgRed('UPDATE NEEDED')} ` +
`Current: ${current} ` +
`Latest ${chalk.bold(latest)} (released ${ago} ago)`);
console.log('> Run `npm install -g now` to update');
}
});
return update;
}
function check ({ debug = false }) {
return new Promise((resolve, reject) => {
if (debug) console.log('> [debug] Checking for updates.');
fetch('https://registry.npmjs.org/now').then((res) => {
if (200 !== res.status) {
if (debug) console.log(`> [debug] Update check error. NPM ${res.status}.`);
resolve(false);
return;
}
res.json().then((data) => {
const { latest } = data['dist-tags'];
const current = pkg.version;
if (latest !== pkg.version) {
if (debug) console.log(`> [debug] Needs update. Current ${current}, latest ${latest}`);
resolve({
latest,
current,
at: new Date(data.time[latest])
});
} else {
if (debug) console.log(`> [debug] Up to date (${pkg.version}).`);
resolve(false);
}
}, () => resolve(false));
}, () => resolve(false));
});
}

View File

@@ -1,10 +0,0 @@
import { copy as _copy } from 'copy-paste';
export default function copy (text) {
return new Promise((resolve, reject) => {
_copy(text, (err) => {
if (err) return reject(err);
resolve();
});
});
}

View File

@@ -1,166 +0,0 @@
import bytes from 'bytes';
import flatten from 'arr-flatten';
import unique from 'array-unique';
import minimatch from 'minimatch';
import IGNORED from './ignored';
import { resolve } from 'path';
import { stat, readdir, readFile } from 'fs-promise';
/**
* Returns a list of files in the given
* directory that are subject to be
* synchronized.
*
* @param {String} full path to directory
* @param {String} contents of `package.json` to avoid lookup
* @param {Object} options:
* - `limit` {Number|null} byte limit
* - `debug` {Boolean} warn upon ignore
* @return {Array} comprehensive list of paths to sync
*/
export default async function getFiles (path, pkg, { limit = null, debug = false }) {
if (!pkg) {
const pkgPath = resolve(path, 'package.json');
const pkgData = await readFile(pkgPath, 'utf8');
pkg = JSON.parse(pkgData);
}
let search = (pkg.files || ['.']).concat('package.json');
if (pkg.main) search = search.concat(pkg.main);
search = search.map((file) => asAbsolute(file, path));
// compile list of ignored patterns and files
const npmIgnore = await maybeRead(resolve(path, '.npmignore'));
const gitIgnore = npmIgnore
? ''
: (await maybeRead(resolve(path, '.gitignore')));
const ignored = unique(IGNORED
.concat(gitIgnore.split('\n').filter(invalidFilter))
.concat(npmIgnore.split('\n').filter(invalidFilter)))
.map((file) => resolve(path, file));
// get files
return unique((await explode(search, ignored, { limit, debug })));
}
/**
* Returns a filter function that
* excludes ignored files in the path.
*
* @param {String} path
* @return {Function} filter fn
*/
const isIgnored = (file, ignored) => {
return ignored.some((test) => {
// test that the target file is not under
// an ignored directory
const dir = test + '/';
if (file.substr(0, dir.length) === dir) return true;
// if not match wildcards
return minimatch(file, test);
});
};
/**
* Returns a filter function that
* excludes invalid rules for .*ignore files
*
* @param {String} path
* @return {Function} filter fn
*/
const invalidFilter = (path) => {
return !(
/* commments */
'#' === path[0] ||
/* empty lines or newlines */
!path.trim().length
);
};
/**
* Transform relative paths into absolutes,
* and maintains absolutes as such.
*
* @param {String} maybe relative path
* @param {String} parent full path
*/
const asAbsolute = function (path, parent) {
if ('/' === path[0]) return path;
return resolve(parent, path);
};
/**
* Explodes directories into a full list of files.
* Eg:
* in: ['/a.js', '/b']
* out: ['/a.js', '/b/c.js', '/b/d.js']
*
* @param {Array} of {String}s representing paths
* @param {Array} of ignored {String}s.
* @param {Object} options:
* - `limit` {Number|null} byte limit
* - `debug` {Boolean} warn upon ignore
* @return {Array} of {String}s of full paths
*/
const explode = async function (paths, ignored, { limit, debug }) {
const many = async (all) => {
return await Promise.all(all.map(async (file) => {
return await list(file);
}));
};
const list = async (file) => {
let path = file;
let s;
try {
s = await stat(path);
} catch (e) {
// in case the file comes from `files` or `main`
// and it wasn't specified with `.js` by the user
path = file + '.js';
s = await stat(path);
}
if (isIgnored(file, ignored)) {
if (debug) console.log(`> [debug] Ignoring "${file}"`);
return null;
}
if (s.isDirectory()) {
const all = await readdir(file);
return many(all.map(subdir => asAbsolute(subdir, file)));
} else {
if (null != limit && s.size > limit) {
console.error('> \u001b[31mWarning!\u001b[39m Skipping file ' +
`over ${bytes(limit)}: ${path}`);
return null;
}
return path;
}
};
return flatten((await many(paths))).filter((v) => null != v);
};
/**
* Returns the contents of a file if it exists.
*
* @return {String} results or `''`
*/
const maybeRead = async function (path) {
try {
return (await readFile(path, 'utf8'));
} catch (e) {
return '';
}
};

View File

@@ -1,30 +0,0 @@
import { createHash } from 'crypto';
import { readFile } from 'fs-promise';
/**
* Computes hashes for the contents of each file given.
*
* @param {Array} of {String} full paths
* @return {Map}
*/
export default async function hashes (files) {
const entries = await Promise.all(files.map(async (name) => {
const data = await readFile(name);
return [hash(data), { name, data }];
}));
return new Map(entries);
}
/**
* Computes a hash for the given buf.
*
* @param {Buffer} file data
* @return {String} hex digest
*/
function hash (buf) {
return createHash('sha1')
.update(buf)
.digest('hex');
}

View File

@@ -1,27 +0,0 @@
export default [
'._*',
'.hg',
'.git',
'.svn',
'.next',
'.dockerignore',
'.gitignore',
'.npmrc',
'.*.swp',
'.DS_Store',
'.wafpickle-*',
'.lock-wscript',
'npm-debug.log',
'config.gypi',
'node_modules',
'CVS',
'README',
'README.*',
'CHANGELOG',
'History.md',
'LICENSE',
'Readme',
'Readme.*',
'test',
'tests'
];

View File

@@ -1,193 +0,0 @@
import getFiles from './get-files';
import hash from './hash';
import retry from './retry';
import bytes from 'bytes';
import Agent from './agent';
import EventEmitter from 'events';
import { basename, resolve } from 'path';
import { stat, readFile } from 'fs-promise';
import resumer from 'resumer';
import splitArray from 'split-array';
// limit of size of files to find
const ONEMB = bytes('1mb');
// how many concurrent HTTP/2 stream uploads
const MAX_CONCURRENT = 10;
export default class Now extends EventEmitter {
constructor (token, { forceNew = false, debug = false }) {
super();
this._token = token;
this._debug = debug;
this._forceNew = forceNew;
this._agent = new Agent('api.now.sh', { debug });
this._onRetry = this._onRetry.bind(this);
}
async create (path, { forceNew, forceSync }) {
this._path = path;
try {
await stat(path);
} catch (err) {
throw new Error(`Could not read directory ${path}.`);
}
let pkg;
try {
pkg = await readFile(resolve(path, 'package.json'));
pkg = JSON.parse(pkg);
} catch (err) {
const e = Error(`Failed to read JSON in "${path}/package.json"`);
e.userError = true;
throw e;
}
if (!pkg.scripts || !pkg.scripts.start) {
const e = Error('Missing `start` script in `package.json`. ' +
'See: https://docs.npmjs.com/cli/start.');
e.userError = true;
throw e;
}
if (this._debug) console.time('> [debug] Getting files');
const files = await getFiles(path, pkg, { limit: ONEMB, debug: this._debug });
if (this._debug) console.timeEnd('> [debug] Getting files');
if (this._debug) console.time('> [debug] Computing hashes');
const hashes = await hash(files);
if (this._debug) console.timeEnd('> [debug] Computing hashes');
this._files = hashes;
const deployment = await retry(async (bail) => {
if (this._debug) console.time('> [debug] /create');
const res = await this._fetch('/create', {
method: 'POST',
body: {
forceNew,
forceSync,
name: pkg.name || basename(path),
description: pkg.description,
files: Array.from(this._files).map(([sha, { data, name }]) => {
return {
sha,
size: data.length,
file: toRelative(name, this._path)
};
})
}
});
if (this._debug) console.timeEnd('> [debug] /create');
// no retry on 403
if (403 === res.status) {
if (this._debug) {
console.log('> [debug] bailing on creating due to 403');
}
return bail(responseError(res));
}
if (200 !== res.status) {
throw new Error('Deployment initialization failed');
}
return res.json();
}, { retries: 3, minTimeout: 2500, onRetry: this._onRetry });
this._id = deployment.deploymentId;
this._url = deployment.url;
this._missing = deployment.missing || [];
return this._url;
}
upload () {
const parts = splitArray(this._missing, MAX_CONCURRENT);
if (this._debug) {
console.log('> [debug] Will upload ' +
`${this._missing.length} files in ${parts.length} ` +
`steps of ${MAX_CONCURRENT} uploads.`);
}
const uploadChunk = () => {
Promise.all(parts.shift().map((sha) => retry(async (bail) => {
const file = this._files.get(sha);
const { data, name } = file;
if (this._debug) console.time(`> [debug] /sync ${name}`);
const stream = resumer().queue(data).end();
const res = await this._fetch('/sync', {
method: 'POST',
headers: {
'Content-Type': 'application/octet-stream',
'Content-Length': data.length,
'x-now-deployment-id': this._id,
'x-now-sha': sha,
'x-now-file': toRelative(name, this._path),
'x-now-size': data.length
},
body: stream
});
if (this._debug) console.timeEnd(`> [debug] /sync ${name}`);
// no retry on 403
if (403 === res.status) {
if (this._debug) console.log('> [debug] bailing on creating due to 403');
return bail(responseError(res));
}
this.emit('upload', file);
}, { retries: 5, randomize: true, onRetry: this._onRetry })))
.then(() => parts.length ? uploadChunk() : this.emit('complete'))
.catch((err) => this.emit('error', err));
};
uploadChunk();
}
_onRetry (err) {
if (this._debug) {
console.log(`> [debug] Retrying: ${err.stack}`);
}
}
close () {
this._agent.close();
}
get url () {
return this._url;
}
get syncAmount () {
if (!this._syncAmount) {
this._syncAmount = this._missing
.map((sha) => this._files.get(sha).data.length)
.reduce((a, b) => a + b, 0);
}
return this._syncAmount;
}
async _fetch (url, opts) {
opts.headers = opts.headers || {};
opts.headers.authorization = `Bearer ${this._token}`;
return await this._agent.fetch(url, opts);
}
}
function toRelative (path, base) {
const fullBase = /\/$/.test(base) ? base + '/' : base;
const relative = path.substr(fullBase.length);
if (relative.startsWith('/')) return relative.substr(1);
return relative;
}
function responseError (res) {
const err = new Error('Response error');
err.status = res.status;
return err;
}

View File

@@ -1,81 +0,0 @@
import chalk from 'chalk';
import fetch from 'node-fetch';
import * as cfg from './cfg';
import { stringify as stringifyQuery } from 'querystring';
const URL = 'http://api-registration.now.sh';
const stdin = process.openStdin();
function readEmail () {
return new Promise((resolve, reject) => {
process.stdout.write('> Enter your email address: ');
stdin.on('data', (d) => {
stdin.destroy();
resolve(d.toString().trim());
});
});
}
async function getVerificationToken (email) {
const data = JSON.stringify({ email });
const res = await fetch(URL, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'Content-Length': Buffer.byteLength(data)
},
body: data
});
if (200 !== res.status) {
throw new Error('Verification error');
}
const body = await res.json();
return body.token;
}
async function verify (email, verificationToken) {
const query = {
email,
token: verificationToken
};
const res = await fetch(`${URL}/verify?${stringifyQuery(query)}`);
const body = await res.json();
return body.token;
}
function sleep (ms) {
return new Promise((resolve, reject) => {
setTimeout(resolve, ms);
});
}
async function register () {
const email = await readEmail();
const verificationToken = await getVerificationToken(email);
console.log(`> Please follow the link sent to ${chalk.bold(email)} to log in.`);
process.stdout.write('> Waiting for confirmation..');
let final;
do {
await sleep(2500);
try {
final = await verify(email, verificationToken);
} catch (e) {}
process.stdout.write('.');
} while (!final);
process.stdout.write('\n');
return { email, token: final };
}
export default async function () {
const loginData = await register();
cfg.merge(loginData);
return loginData.token;
}

View File

@@ -1,29 +0,0 @@
import retrier from 'retry';
export default function retry (fn, opts) {
return new Promise((resolve, reject) => {
const op = retrier.operation(opts);
const { onRetry } = opts;
// we allow the user to abort retrying
// this makes sense in the cases where
// knowledge is obtained that retrying
// would be futile (e.g.: auth errors)
const bail = (err) => reject(err);
op.attempt((num) => {
if (num > 1 && onRetry) {
const errs = op.errors();
onRetry(errs[errs.length - 1]);
}
fn(bail)
.then((val) => resolve(val))
.catch(err => {
if (!op.retry(err)) {
reject(op.mainError());
}
});
});
});
}

View File

@@ -1,20 +0,0 @@
import getFiles from './get-files';
import { resolve } from 'path';
getFiles(resolve('../mng-test/files-in-package'))
.then(files => {
console.log(files);
getFiles(resolve('../mng-test/files-in-package-ignore'))
.then(files2 => {
console.log('ignored: ');
console.log(files2);
})
.catch(err => {
console.log(err.stack);
});
})
.catch(err => {
console.log(err.stack);
});

View File

@@ -1,77 +1,62 @@
{
"name": "now",
"version": "0.9.8",
"description": "Realtime Deployments for Node.JS apps.",
"main": "./build/lib/index",
"files": [
"build"
],
"bin": {
"now": "./build/bin/now"
"name": "now-builders",
"version": "0.0.0",
"private": true,
"license": "MIT",
"workspaces": {
"packages": [
"packages/*"
],
"nohoist": [
"**/@types/**"
]
},
"dependencies": {
"arr-flatten": "1.0.1",
"array-unique": "0.2.1",
"babel-runtime": "6.6.1",
"bytes": "2.3.0",
"chalk": "1.1.1",
"commander": "2.9.0",
"copy-paste": "1.1.4",
"fs-promise": "0.4.1",
"graceful-fs": "4.1.3",
"minimatch": "3.0.0",
"ms": "0.7.1",
"node-fetch": "1.3.3",
"progress": "1.1.8",
"resumer": "0.0.0",
"retry": "0.9.0",
"spdy": "3.2.3",
"split-array": "1.0.1"
"lerna": "3.16.4"
},
"devDependencies": {
"alpha-sort": "1.0.2",
"ava": "0.12.0",
"babel-eslint": "5.0.0",
"babel-plugin-transform-runtime": "6.6.0",
"babel-plugin-syntax-async-functions": "6.5.0",
"babel-plugin-transform-async-to-generator": "6.7.0",
"babel-preset-es2015": "6.3.13",
"babel-register": "6.6.5",
"del": "2.2.0",
"eslint-config-standard": "5.1.0",
"eslint-plugin-standard": "1.3.2",
"gulp": "3.9.0",
"gulp-babel": "6.1.2",
"gulp-eslint": "2.0.0",
"gulp-ext": "1.0.0",
"gulp-task-listing": "1.0.1",
"gulp-uglify": "1.5.3",
"eslint": "2.3.0",
"eslint-plugin-promise": "1.1.0",
"estraverse-fb": "1.3.1"
"@typescript-eslint/eslint-plugin": "2.0.0",
"@typescript-eslint/parser": "2.0.0",
"@zeit/ncc": "0.20.4",
"async-retry": "1.2.3",
"buffer-replace": "1.0.0",
"eslint": "6.2.2",
"eslint-config-prettier": "6.1.0",
"husky": "3.0.4",
"lint-staged": "9.2.5",
"node-fetch": "2.6.0",
"prettier": "1.18.2"
},
"scripts": {
"gulp": "gulp",
"test": "ava",
"postinstall": "build/scripts/post-install"
"lerna": "lerna",
"bootstrap": "lerna bootstrap",
"publish-stable": "git checkout master && git pull && lerna version --exact",
"publish-canary": "git checkout canary && git pull && lerna version prerelease --preid canary --exact",
"publish-from-github": "./.circleci/publish.sh",
"diff": "node diff.js",
"changelog": "node changelog.js",
"build": "node run.js build all",
"test-lint": "node run.js test-lint",
"test-unit": "node run.js test-unit",
"test-integration": "node run.js test-integration",
"test-integration-once": "node run.js test-integration-once",
"test-integration-now-dev": "node run.js test-integration-now-dev",
"lint": "eslint . --ext .ts,.js"
},
"babel": {
"presets": [
"es2015"
"lint-staged": {
"*.{js,ts}": [
"prettier --write",
"eslint",
"git add"
],
"plugins": [
"transform-runtime",
"syntax-async-functions",
"transform-async-to-generator"
"*.{json,md}": [
"prettier --write",
"git add"
]
},
"ava": {
"failFast": true,
"files": [
"test/*.js"
],
"require": [
"babel-register"
]
"husky": {
"hooks": {
"pre-commit": "lint-staged"
}
}
}

View File

@@ -0,0 +1,6 @@
#!/bin/bash
set -euo pipefail
# build fixtures for tests
yarn --cwd test/fixtures install
yarn --cwd test/fixtures run build

View File

@@ -0,0 +1,33 @@
const path = require('path');
const writeFile = require('util').promisify(require('fs').writeFile);
const REDIRECT_FILE_NAME = '__now_routes_g4t5bY.json';
exports.onPostBuild = async ({ store }) => {
const { redirects, program } = store.getState();
if (!redirects.length === 0) {
return;
}
const routes = [{ handle: 'filesystem' }];
for (const redirect of redirects) {
const route = {
src: redirect.fromPath,
status: redirect.statusCode || (redirect.isPermanent ? 301 : 302),
headers: { Location: redirect.toPath }
};
if (redirect.force) {
routes.unshift(route);
} else {
routes.push(route);
}
}
await writeFile(
path.join(program.directory, 'public', REDIRECT_FILE_NAME),
JSON.stringify(routes)
);
};

View File

@@ -0,0 +1 @@
// noop

View File

@@ -0,0 +1,36 @@
{
"name": "gatsby-plugin-now",
"version": "1.2.2",
"main": "index.js",
"license": "MIT",
"homepage": "https://github.com/zeit/now/tree/canary/packages/gatsby-plugin-now#readme",
"repository": {
"type": "git",
"url": "https://github.com/zeit/now.git",
"directory": "packages/gatsby-plugin-now"
},
"keywords": [
"gatsby",
"gatsby-plugin"
],
"scripts": {
"build": "./build.sh",
"test-integration-once": "jest --verbose"
},
"files": [
"index.js",
"gatsby-node.js"
],
"peerDependencies": {
"gatsby": ">=2.0.0"
},
"devDependencies": {
"jest": "24.9.0"
},
"jest": {
"testPathIgnorePatterns": [
"/node_modules/",
"<rootDir>/test/fixtures/"
]
}
}

View File

@@ -0,0 +1,24 @@
# gatsby-plugin-now
This plugin generates [Now Routes](https://zeit.co/docs/v2/advanced/routes) for [redirects](https://www.gatsbyjs.org/docs/actions/#createRedirect) you configured for to your Gatsby project.
### Usage
1. Install the plugin:
```
npm install gatsby-plugin-now --save-dev
```
2. Add it to the configuration file:
```
// gatsby-config.js
module.exports = {
plugins: [
'gatsby-plugin-now'
]
}
```
3. [Deploy your project to ZEIT Now](https://www.gatsbyjs.org/docs/deploying-to-zeit-now/)

View File

@@ -0,0 +1,86 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`test generated now routes 1`] = `
Array [
Object {
"headers": Object {
"Location": "/",
},
"src": "/my-special-redirect",
"status": 302,
},
Object {
"handle": "filesystem",
},
Object {
"headers": Object {
"Location": "/page-2",
},
"src": "/page2",
"status": 301,
},
Object {
"headers": Object {
"Location": "/page-2/",
},
"src": "/page2/",
"status": 301,
},
Object {
"headers": Object {
"Location": "/",
},
"src": "/orange",
"status": 302,
},
Object {
"headers": Object {
"Location": "/",
},
"src": "/grape",
"status": 302,
},
Object {
"headers": Object {
"Location": "/page-2/",
},
"src": "/blue",
"status": 302,
},
Object {
"headers": Object {
"Location": "/page-2/",
},
"src": "/randirect",
"status": 302,
},
Object {
"headers": Object {
"Location": "/",
},
"src": "/juice",
"status": 302,
},
Object {
"headers": Object {
"Location": "/",
},
"src": "/soda",
"status": 302,
},
Object {
"headers": Object {
"Location": "/page-2/",
},
"src": "/donut",
"status": 302,
},
Object {
"headers": Object {
"Location": "/page-2/",
},
"src": "/randorect",
"status": 302,
},
]
`;

View File

@@ -0,0 +1,4 @@
public
node_modules
.cache
yarn.lock

View File

@@ -0,0 +1,3 @@
module.exports = {
plugins: [{ resolve: require.resolve('../../') }]
};

View File

@@ -0,0 +1,105 @@
'use strict';
// Implement the Gatsby API “createPages”. This is called once the
// data layer is bootstrapped to let plugins create pages from data.
exports.createPages = ({ actions }) => {
// need createRedirect action in actions collection
// to make the redirection magic happen.
// https://www.gatsbyjs.org/docs/bound-action-creators/
const { createRedirect } = actions;
// Lets set up some string consts to use thoroughout the following.
// MDN > JavaScript reference > Statements and declarations
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/const
// Maybe we usually redirect to page 2, with trailing slash.
const page2Path = `/page-2/`;
// But sometimes to homepage.
const homePath = `/`;
// One-off redirect, note trailing slash missing on fromPath and
// toPath here.
createRedirect({
fromPath: `/page2`,
isPermanent: true,
redirectInBrowser: true,
toPath: `/page-2`
});
// Another one-off redirect, note trailing slash on toPath here.
// This time we want trailing slash on toPath so we use
// page2Path. Need to handle trailing-slashed and non-trailing-
// slashed fromPaths separately, Gatsby serves page components
// at either version by default, but we need to explicitly redirect
// both versions independently, more on page components:
// Docs > Building with Components
// https://www.gatsbyjs.org/docs/building-with-components/
// and handling trailing slashes:
// Docs > Creating and modifying pages > Removing trailing slashes
// https://www.gatsbyjs.org/docs/creating-and-modifying-pages/#removing-trailing-slashes
createRedirect({
fromPath: `/page2/`,
isPermanent: true,
redirectInBrowser: true,
toPath: page2Path
});
// One approach to handle several redirects at once is to create an
// array of from/to path pairs.
let redirectBatch1 = [
{ f: `/orange`, t: `/` },
// We could use homePath and page2Path directly here.
{ f: `/grape`, t: homePath },
{ f: `/blue`, t: page2Path },
// or leave to empty and swap for page2Path later on.
{ f: `/randirect`, t: `` }
];
// Then we can loop through the array of object literals to create
// each redirect. A for loop would do the trick
for (var { f: f, t: t } of redirectBatch1) {
// Here we swap any empty toPath values for trusty page 2 via
// page2Path.
if (t === ``) {
t = page2Path;
}
createRedirect({
fromPath: f,
redirectInBrowser: true,
toPath: t
});
// Uncomment next line to see loop in action during build
// console.log('\nRedirecting:\n' + f + '\nTo:\n' + t + '\n');
// or check .cache/redirects.json post-compile.
}
// A more modern approach might use forEach rather than for...of
// Compare
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Loops_and_iteration#for...of_statement
// and
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/forEach
let redirectBatch2 = [
{ f: `/juice`, t: `/` },
{ f: `/soda`, t: `/` },
{ f: `/donut`, t: page2Path },
{ f: `/randorect`, t: `` }
];
redirectBatch2.forEach(({ f, t }) => {
if (t === ``) {
t = page2Path;
}
createRedirect({
fromPath: f,
redirectInBrowser: true,
toPath: t
});
// Uncomment next line to see forEach in action during build
// console.log('\nRedirecting:\n' + f + '\nTo:\n' + t + '\n');
});
createRedirect({
fromPath: '/my-special-redirect',
toPath: homePath,
force: true
});
};

View File

@@ -0,0 +1,11 @@
{
"name": "fixtures",
"dependencies": {
"gatsby": "2.14.0",
"react": "16.9.0",
"react-dom": "16.9.0"
},
"scripts": {
"build": "gatsby build"
}
}

View File

@@ -0,0 +1,9 @@
import React from 'react';
const IndexPage = () => (
<div>
<h1>Hi people</h1>
</div>
);
export default IndexPage;

View File

@@ -0,0 +1,5 @@
test('test generated now routes', async () => {
const nowRoutes = require('./fixtures/public/__now_routes_g4t5bY.json');
expect(nowRoutes).toMatchSnapshot();
});

3
packages/now-build-utils/.gitignore vendored Normal file
View File

@@ -0,0 +1,3 @@
dist
test/symlinks-out
test/symlinks.zip

View File

@@ -0,0 +1,3 @@
/src
/test
tmp

View File

@@ -0,0 +1,6 @@
tsc
rm dist/index.js
ncc build src/index.ts -o dist/main
mv dist/main/index.js dist/index.js
rm -rf dist/main

View File

@@ -0,0 +1 @@
module.exports = require('./dist/index').FileBlob;

View File

@@ -0,0 +1 @@
module.exports = require('./dist/index').FileFsRef;

View File

@@ -0,0 +1 @@
module.exports = require('./dist/index').FileRef;

View File

@@ -0,0 +1 @@
module.exports = require('../dist/index').download;

View File

@@ -0,0 +1 @@
module.exports = require('../dist/index').getWriteableDirectory;

View File

@@ -0,0 +1 @@
module.exports = require('../dist/index').glob;

View File

@@ -0,0 +1 @@
module.exports = require('../dist/index').rename;

View File

@@ -0,0 +1 @@
module.exports = require('../dist/index');

View File

@@ -0,0 +1 @@
module.exports = require('../dist/index').streamToBuffer;

View File

@@ -0,0 +1 @@
module.exports = require('./dist/index');

View File

@@ -0,0 +1,43 @@
{
"name": "@now/build-utils",
"version": "0.10.1",
"license": "MIT",
"main": "./dist/index.js",
"types": "./dist/index.d.js",
"homepage": "https://zeit.co/docs/v2/deployments/builders/developer-guide",
"repository": {
"type": "git",
"url": "https://github.com/zeit/now.git",
"directory": "packages/now-build-utils"
},
"scripts": {
"build": "./build.sh",
"test-integration-once": "jest --env node --verbose --runInBand",
"prepublishOnly": "./build.sh"
},
"devDependencies": {
"@types/async-retry": "^1.2.1",
"@types/cross-spawn": "6.0.0",
"@types/end-of-stream": "^1.4.0",
"@types/fs-extra": "^5.0.5",
"@types/glob": "^7.1.1",
"@types/multistream": "2.1.1",
"@types/node-fetch": "^2.1.6",
"@types/semver": "6.0.0",
"@types/yazl": "^2.4.1",
"async-retry": "1.2.3",
"async-sema": "2.1.4",
"cross-spawn": "6.0.5",
"end-of-stream": "1.4.1",
"execa": "^1.0.0",
"fs-extra": "7.0.0",
"glob": "7.1.3",
"into-stream": "5.0.0",
"minimatch": "3.0.4",
"multistream": "2.1.1",
"node-fetch": "2.2.0",
"semver": "6.1.1",
"typescript": "3.5.2",
"yazl": "2.4.3"
}
}

View File

@@ -0,0 +1,5 @@
export default function debug(message: string, ...additional: any[]) {
if (process.env.NOW_BUILDER_DEBUG) {
console.log(message, ...additional);
}
}

View File

@@ -0,0 +1,216 @@
import { PackageJson, Builder, Config } from './types';
import minimatch from 'minimatch';
interface ErrorResponse {
code: string;
message: string;
}
interface Options {
tag?: 'canary' | 'latest' | string;
}
const src = 'package.json';
const config: Config = { zeroConfig: true };
const MISSING_BUILD_SCRIPT_ERROR: ErrorResponse = {
code: 'missing_build_script',
message:
'Your `package.json` file is missing a `build` property inside the `script` property.' +
'\nMore details: https://zeit.co/docs/v2/advanced/platform/frequently-asked-questions#missing-build-script',
};
// Static builders are special cased in `@now/static-build`
function getBuilders(): Map<string, Builder> {
return new Map<string, Builder>([
['next', { src, use: '@now/next', config }],
]);
}
// Must be a function to ensure that the returned
// object won't be a reference
function getApiBuilders(): Builder[] {
return [
{ src: 'api/**/*.js', use: '@now/node', config },
{ src: 'api/**/*.ts', use: '@now/node', config },
{ src: 'api/**/*.go', use: '@now/go', config },
{ src: 'api/**/*.py', use: '@now/python', config },
{ src: 'api/**/*.rb', use: '@now/ruby', config },
];
}
function hasPublicDirectory(files: string[]) {
return files.some(name => name.startsWith('public/'));
}
function hasBuildScript(pkg: PackageJson | undefined) {
const { scripts = {} } = pkg || {};
return Boolean(scripts && scripts['build']);
}
async function detectBuilder(pkg: PackageJson): Promise<Builder> {
for (const [dependency, builder] of getBuilders()) {
const deps = Object.assign({}, pkg.dependencies, pkg.devDependencies);
// Return the builder when a dependency matches
if (deps[dependency]) {
return builder;
}
}
// By default we'll choose the `static-build` builder
return { src, use: '@now/static-build', config };
}
// Files that match a specific pattern will get ignored
export function ignoreApiFilter(file: string) {
if (file.includes('/.')) {
return false;
}
if (file.includes('/_')) {
return false;
}
if (file.endsWith('.d.ts')) {
return false;
}
// If the file does not match any builder we also
// don't want to create a route e.g. `package.json`
if (getApiBuilders().every(({ src }) => !minimatch(file, src))) {
return false;
}
return true;
}
// We need to sort the file paths by alphabet to make
// sure the routes stay in the same order e.g. for deduping
export function sortFiles(fileA: string, fileB: string) {
return fileA.localeCompare(fileB);
}
async function detectApiBuilders(files: string[]): Promise<Builder[]> {
const builds = files
.sort(sortFiles)
.filter(ignoreApiFilter)
.map(file => {
const result = getApiBuilders().find(({ src }): boolean =>
minimatch(file, src)
);
return result ? { ...result, src: file } : null;
});
const finishedBuilds = builds.filter(Boolean);
return finishedBuilds as Builder[];
}
// When a package has files that conflict with `/api` routes
// e.g. Next.js pages/api we'll check it here and return an error.
async function checkConflictingFiles(
files: string[],
builders: Builder[]
): Promise<ErrorResponse | null> {
// For Next.js
if (builders.some(builder => builder.use.startsWith('@now/next'))) {
const hasApiPages = files.some(file => file.startsWith('pages/api/'));
const hasApiBuilders = builders.some(builder =>
builder.src.startsWith('api/')
);
if (hasApiPages && hasApiBuilders) {
return {
code: 'conflicting_files',
message:
'It is not possible to use `api` and `pages/api` at the same time, please only use one option',
};
}
}
return null;
}
// When zero config is used we can call this function
// to determine what builders to use
export async function detectBuilders(
files: string[],
pkg?: PackageJson | undefined | null,
options?: Options
): Promise<{
builders: Builder[] | null;
errors: ErrorResponse[] | null;
warnings: ErrorResponse[];
}> {
const errors: ErrorResponse[] = [];
const warnings: ErrorResponse[] = [];
// Detect all builders for the `api` directory before anything else
let builders = await detectApiBuilders(files);
if (pkg && hasBuildScript(pkg)) {
builders.push(await detectBuilder(pkg));
const conflictError = await checkConflictingFiles(files, builders);
if (conflictError) {
warnings.push(conflictError);
}
} else {
if (pkg && builders.length === 0) {
// We only show this error when there are no api builders
// since the dependencies of the pkg could be used for those
errors.push(MISSING_BUILD_SCRIPT_ERROR);
return { errors, warnings, builders: null };
}
// We allow a `public` directory
// when there are no build steps
if (hasPublicDirectory(files)) {
builders.push({
use: '@now/static',
src: 'public/**/*',
config,
});
} else if (builders.length > 0) {
// We can't use pattern matching, since `!(api)` and `!(api)/**/*`
// won't give the correct results
builders.push(
...files
.filter(name => !name.startsWith('api/'))
.filter(name => !(name === 'package.json'))
.map(name => ({
use: '@now/static',
src: name,
config,
}))
);
}
}
// Change the tag for the builders
if (builders && builders.length) {
const tag = options && options.tag;
if (tag) {
builders = builders.map((originBuilder: Builder) => {
// Copy builder to make sure it is not a reference
const builder = { ...originBuilder };
// @now/static has no canary builder
if (builder.use !== '@now/static') {
builder.use = `${builder.use}@${tag}`;
}
return builder;
});
}
}
return {
builders: builders.length ? builders : null,
errors: errors.length ? errors : null,
warnings,
};
}

View File

@@ -0,0 +1,295 @@
import { Route, Builder } from './types';
import { parse as parsePath } from 'path';
import { ignoreApiFilter, sortFiles } from './detect-builders';
function escapeName(name: string) {
const special = '[]^$.|?*+()'.split('');
for (const char of special) {
name = name.replace(new RegExp(`\\${char}`, 'g'), `\\${char}`);
}
return name;
}
function joinPath(...segments: string[]) {
const joinedPath = segments.join('/');
return joinedPath.replace(/\/{2,}/g, '/');
}
function concatArrayOfText(texts: string[]): string {
if (texts.length <= 2) {
return texts.join(' and ');
}
const last = texts.pop();
return `${texts.join(', ')}, and ${last}`;
}
// Takes a filename or foldername, strips the extension
// gets the part between the "[]" brackets.
// It will return `null` if there are no brackets
// and therefore no segment.
function getSegmentName(segment: string): string | null {
const { name } = parsePath(segment);
if (name.startsWith('[') && name.endsWith(']')) {
return name.slice(1, -1);
}
return null;
}
function createRouteFromPath(filePath: string): Route {
const parts = filePath.split('/');
let counter = 1;
const query: string[] = [];
const srcParts = parts.map((segment, index): string => {
const name = getSegmentName(segment);
const isLast = index === parts.length - 1;
if (name !== null) {
// We can't use `URLSearchParams` because `$` would get escaped
query.push(`${name}=$${counter++}`);
return `([^\\/]+)`;
} else if (isLast) {
const { name: fileName, ext } = parsePath(segment);
const isIndex = fileName === 'index';
const prefix = isIndex ? '\\/' : '';
const names = [
prefix,
prefix + escapeName(fileName),
prefix + escapeName(fileName) + escapeName(ext)
].filter(Boolean);
// Either filename with extension, filename without extension
// or nothing when the filename is `index`
return `(${names.join('|')})${isIndex ? '?' : ''}`;
}
return segment;
});
const { name: fileName } = parsePath(filePath);
const isIndex = fileName === 'index';
const src = isIndex
? `^/${srcParts.slice(0, -1).join('/')}${srcParts.slice(-1)[0]}$`
: `^/${srcParts.join('/')}$`;
const dest = `/${filePath}${query.length ? '?' : ''}${query.join('&')}`;
return { src, dest };
}
// Check if the path partially matches and has the same
// name for the path segment at the same position
function partiallyMatches(pathA: string, pathB: string): boolean {
const partsA = pathA.split('/');
const partsB = pathB.split('/');
const long = partsA.length > partsB.length ? partsA : partsB;
const short = long === partsA ? partsB : partsA;
let index = 0;
for (const segmentShort of short) {
const segmentLong = long[index];
const nameLong = getSegmentName(segmentLong);
const nameShort = getSegmentName(segmentShort);
// If there are no segments or the paths differ we
// return as they are not matching
if (segmentShort !== segmentLong && (!nameLong || !nameShort)) {
return false;
}
if (nameLong !== nameShort) {
return true;
}
index += 1;
}
return false;
}
// Counts how often a path occurres when all placeholders
// got resolved, so we can check if they have conflicts
function pathOccurrences(filePath: string, files: string[]): string[] {
const getAbsolutePath = (unresolvedPath: string): string => {
const { dir, name } = parsePath(unresolvedPath);
const parts = joinPath(dir, name).split('/');
return parts.map(part => part.replace(/\[.*\]/, '1')).join('/');
};
const currentAbsolutePath = getAbsolutePath(filePath);
return files.reduce((prev: string[], file: string): string[] => {
const absolutePath = getAbsolutePath(file);
if (absolutePath === currentAbsolutePath) {
prev.push(file);
} else if (partiallyMatches(filePath, file)) {
prev.push(file);
}
return prev;
}, []);
}
// Checks if a placeholder with the same name is used
// multiple times inside the same path
function getConflictingSegment(filePath: string): string | null {
const segments = new Set<string>();
for (const segment of filePath.split('/')) {
const name = getSegmentName(segment);
if (name !== null && segments.has(name)) {
return name;
}
if (name) {
segments.add(name);
}
}
return null;
}
function sortFilesBySegmentCount(fileA: string, fileB: string): number {
const lengthA = fileA.split('/').length;
const lengthB = fileB.split('/').length;
if (lengthA > lengthB) {
return -1;
}
if (lengthA < lengthB) {
return 1;
}
// Paths that have the same segment length but
// less placeholders are preferred
const countSegments = (prev: number, segment: string) =>
getSegmentName(segment) ? prev + 1 : 0;
const segmentLengthA = fileA.split('/').reduce(countSegments, 0);
const segmentLengthB = fileB.split('/').reduce(countSegments, 0);
if (segmentLengthA > segmentLengthB) {
return 1;
}
if (segmentLengthA < segmentLengthB) {
return -1;
}
return 0;
}
interface RoutesResult {
defaultRoutes: Route[] | null;
error: { [key: string]: string } | null;
}
async function detectApiRoutes(files: string[]): Promise<RoutesResult> {
if (!files || files.length === 0) {
return { defaultRoutes: null, error: null };
}
// The deepest routes need to be
// the first ones to get handled
const sortedFiles = files
.filter(ignoreApiFilter)
.sort(sortFiles)
.sort(sortFilesBySegmentCount);
const defaultRoutes: Route[] = [];
for (const file of sortedFiles) {
// We only consider every file in the api directory
// as we will strip extensions as well as resolving "[segments]"
if (!file.startsWith('api/')) {
continue;
}
const conflictingSegment = getConflictingSegment(file);
if (conflictingSegment) {
return {
defaultRoutes: null,
error: {
code: 'conflicting_path_segment',
message:
`The segment "${conflictingSegment}" occurres more than ` +
`one time in your path "${file}". Please make sure that ` +
`every segment in a path is unique`
}
};
}
const occurrences = pathOccurrences(file, sortedFiles).filter(
name => name !== file
);
if (occurrences.length > 0) {
const messagePaths = concatArrayOfText(
occurrences.map(name => `"${name}"`)
);
return {
defaultRoutes: null,
error: {
code: 'conflicting_file_path',
message:
`Two or more files have conflicting paths or names. ` +
`Please make sure path segments and filenames, without their extension, are unique. ` +
`The path "${file}" has conflicts with ${messagePaths}`
}
};
}
defaultRoutes.push(createRouteFromPath(file));
}
// 404 Route to disable directory listing
if (defaultRoutes.length) {
defaultRoutes.push({
status: 404,
src: '/api(\\/.*)?$'
});
}
return { defaultRoutes, error: null };
}
function hasPublicBuilder(builders: Builder[]): boolean {
return builders.some(
builder =>
builder.use === '@now/static' &&
builder.src === 'public/**/*' &&
builder.config &&
builder.config.zeroConfig === true
);
}
export async function detectRoutes(
files: string[],
builders: Builder[]
): Promise<RoutesResult> {
const routesResult = await detectApiRoutes(files);
if (routesResult.defaultRoutes && hasPublicBuilder(builders)) {
routesResult.defaultRoutes.push({
src: '/(.*)',
dest: '/public/$1'
});
}
return routesResult;
}

View File

@@ -0,0 +1,46 @@
import assert from 'assert';
import intoStream from 'into-stream';
import { File } from './types';
interface FileBlobOptions {
mode?: number;
data: string | Buffer;
}
interface FromStreamOptions {
mode?: number;
stream: NodeJS.ReadableStream;
}
export default class FileBlob implements File {
public type: 'FileBlob';
public mode: number;
public data: string | Buffer;
constructor({ mode = 0o100644, data }: FileBlobOptions) {
assert(typeof mode === 'number');
assert(typeof data === 'string' || Buffer.isBuffer(data));
this.type = 'FileBlob';
this.mode = mode;
this.data = data;
}
static async fromStream({ mode = 0o100644, stream }: FromStreamOptions) {
assert(typeof mode === 'number');
assert(typeof stream.pipe === 'function'); // is-stream
const chunks: Buffer[] = [];
await new Promise<void>((resolve, reject) => {
stream.on('data', chunk => chunks.push(Buffer.from(chunk)));
stream.on('error', error => reject(error));
stream.on('end', () => resolve());
});
const data = Buffer.concat(chunks);
return new FileBlob({ mode, data });
}
toStream(): NodeJS.ReadableStream {
return intoStream(this.data);
}
}

View File

@@ -0,0 +1,97 @@
import assert from 'assert';
import fs from 'fs-extra';
import multiStream from 'multistream';
import path from 'path';
import Sema from 'async-sema';
import { File } from './types';
const semaToPreventEMFILE = new Sema(20);
interface FileFsRefOptions {
mode?: number;
fsPath: string;
}
interface FromStreamOptions {
mode: number;
stream: NodeJS.ReadableStream;
fsPath: string;
}
class FileFsRef implements File {
public type: 'FileFsRef';
public mode: number;
public fsPath: string;
constructor({ mode = 0o100644, fsPath }: FileFsRefOptions) {
assert(typeof mode === 'number');
assert(typeof fsPath === 'string');
this.type = 'FileFsRef';
this.mode = mode;
this.fsPath = fsPath;
}
static async fromFsPath({
mode,
fsPath,
}: FileFsRefOptions): Promise<FileFsRef> {
let m = mode;
if (!m) {
const stat = await fs.lstat(fsPath);
m = stat.mode;
}
return new FileFsRef({ mode: m, fsPath });
}
static async fromStream({
mode = 0o100644,
stream,
fsPath,
}: FromStreamOptions): Promise<FileFsRef> {
assert(typeof mode === 'number');
assert(typeof stream.pipe === 'function'); // is-stream
assert(typeof fsPath === 'string');
await fs.mkdirp(path.dirname(fsPath));
await new Promise<void>((resolve, reject) => {
const dest = fs.createWriteStream(fsPath, {
mode: mode & 0o777,
});
stream.pipe(dest);
stream.on('error', reject);
dest.on('finish', resolve);
dest.on('error', reject);
});
return new FileFsRef({ mode, fsPath });
}
async toStreamAsync(): Promise<NodeJS.ReadableStream> {
await semaToPreventEMFILE.acquire();
const release = () => semaToPreventEMFILE.release();
const stream = fs.createReadStream(this.fsPath);
stream.on('close', release);
stream.on('error', release);
return stream;
}
toStream(): NodeJS.ReadableStream {
let flag = false;
// eslint-disable-next-line consistent-return
return multiStream(cb => {
if (flag) return cb(null, null);
flag = true;
this.toStreamAsync()
.then(stream => {
cb(null, stream);
})
.catch(error => {
cb(error, null);
});
});
}
}
export = FileFsRef;

View File

@@ -0,0 +1,100 @@
import assert from 'assert';
import fetch from 'node-fetch';
import multiStream from 'multistream';
import retry from 'async-retry';
import Sema from 'async-sema';
import { File } from './types';
interface FileRefOptions {
mode?: number;
digest: string;
mutable?: boolean;
}
const semaToDownloadFromS3 = new Sema(5);
class BailableError extends Error {
public bail: boolean;
constructor(...args: string[]) {
super(...args);
this.bail = false;
}
}
export default class FileRef implements File {
public type: 'FileRef';
public mode: number;
public digest: string;
private mutable: boolean;
constructor({ mode = 0o100644, digest, mutable = false }: FileRefOptions) {
assert(typeof mode === 'number');
assert(typeof digest === 'string');
this.type = 'FileRef';
this.mode = mode;
this.digest = digest;
this.mutable = mutable;
}
async toStreamAsync(): Promise<NodeJS.ReadableStream> {
let url = '';
// sha:24be087eef9fac01d61b30a725c1a10d7b45a256
const [digestType, digestHash] = this.digest.split(':');
if (digestType === 'sha') {
// This CloudFront URL edge caches the `now-files` S3 bucket to prevent
// overloading it. Mutable files cannot be cached.
// `https://now-files.s3.amazonaws.com/${digestHash}`
url = this.mutable
? `https://now-files.s3.amazonaws.com/${digestHash}`
: `https://dmmcy0pwk6bqi.cloudfront.net/${digestHash}`;
} else if (digestType === 'sha+ephemeral') {
// This URL is currently only used for cache files that constantly
// change. We shouldn't cache it on CloudFront because it'd always be a
// MISS.
url = `https://now-ephemeral-files.s3.amazonaws.com/${digestHash}`;
} else {
throw new Error('Expected digest to be sha');
}
await semaToDownloadFromS3.acquire();
// console.time(`downloading ${url}`);
try {
return await retry(
async () => {
const resp = await fetch(url);
if (!resp.ok) {
const error = new BailableError(
`download: ${resp.status} ${resp.statusText} for ${url}`
);
if (resp.status === 403) error.bail = true;
throw error;
}
return resp.body;
},
{ factor: 1, retries: 3 }
);
} finally {
// console.timeEnd(`downloading ${url}`);
semaToDownloadFromS3.release();
}
}
toStream(): NodeJS.ReadableStream {
let flag = false;
// eslint-disable-next-line consistent-return
return multiStream(cb => {
if (flag) return cb(null, null);
flag = true;
this.toStreamAsync()
.then(stream => {
cb(null, stream);
})
.catch(error => {
cb(error, null);
});
});
}
}

View File

@@ -0,0 +1,75 @@
import path from 'path';
import FileFsRef from '../file-fs-ref';
import { File, Files, Meta } from '../types';
import { remove, mkdirp, readlink, symlink } from 'fs-extra';
export interface DownloadedFiles {
[filePath: string]: FileFsRef;
}
const S_IFMT = 61440; /* 0170000 type of file */
const S_IFLNK = 40960; /* 0120000 symbolic link */
export function isSymbolicLink(mode: number): boolean {
return (mode & S_IFMT) === S_IFLNK;
}
async function downloadFile(file: File, fsPath: string): Promise<FileFsRef> {
const { mode } = file;
if (mode && isSymbolicLink(mode) && file.type === 'FileFsRef') {
const [target] = await Promise.all([
readlink((file as FileFsRef).fsPath),
mkdirp(path.dirname(fsPath)),
]);
await symlink(target, fsPath);
return FileFsRef.fromFsPath({ mode, fsPath });
} else {
const stream = file.toStream();
return FileFsRef.fromStream({ mode, stream, fsPath });
}
}
async function removeFile(basePath: string, fileMatched: string) {
const file = path.join(basePath, fileMatched);
await remove(file);
}
export default async function download(
files: Files,
basePath: string,
meta?: Meta
): Promise<DownloadedFiles> {
const { isDev = false, skipDownload = false, filesChanged = null, filesRemoved = null } =
meta || {};
if (isDev || skipDownload) {
// In `now dev`, the `download()` function is a no-op because
// the `basePath` matches the `cwd` of the dev server, so the
// source files are already available.
return files as DownloadedFiles;
}
const files2: DownloadedFiles = {};
await Promise.all(
Object.keys(files).map(async name => {
// If the file does not exist anymore, remove it.
if (Array.isArray(filesRemoved) && filesRemoved.includes(name)) {
await removeFile(basePath, name);
return;
}
// If a file didn't change, do not re-download it.
if (Array.isArray(filesChanged) && !filesChanged.includes(name)) {
return;
}
const file = files[name];
const fsPath = path.join(basePath, name);
files2[name] = await downloadFile(file, fsPath);
})
);
return files2;
}

View File

@@ -0,0 +1,10 @@
import { join } from 'path';
import { tmpdir } from 'os';
import { mkdirp } from 'fs-extra';
export default async function getWritableDirectory() {
const name = Math.floor(Math.random() * 0x7fffffff).toString(16);
const directory = join(tmpdir(), name);
await mkdirp(directory);
return directory;
}

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