Commit Graph

313 Commits

Author SHA1 Message Date
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
Amio
692a08c134 Bump ava to 1.4.1 (#2128) 2019-04-11 11:30:11 +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
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
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
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
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
Amio
6344a08c91 Add hint about -f in now init error message (#1971) 2019-03-19 09:13:14 +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
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
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
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
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
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
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
Mark Glagola
45bf56671a "now domains transfer-in" support (#1767) 2019-02-14 10:26:07 +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
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
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
Amio /
ca086e01c7 better did-you-mean (#1817)
ensure 'node' => 'nodejs' insteadof 'node-server'
2019-01-15 09:55:44 +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
ecf0df8c6e Fixed several errors (#1811)
* Fixed NOW-CLI-HB

* Fixed code
2019-01-08 20:35:04 +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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
186d1e452a Fixed integration tests (#1476) 2018-07-22 01:55:32 +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
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
Leo Lamprecht
fca499925c Fixed the tests (#1430)
* Fixed the tests

* Wrapped up
2018-07-02 11:31:50 +02:00
Igor Klopov
94128271ed test-integration: test deployment logs output (#1398) 2018-06-11 10:41:39 +02:00