* [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
* [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
* [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
* [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
* [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
* [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
* [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
* [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
* [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
* 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
* [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
* 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
* [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
* [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
* 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
* [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
* [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
* [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
* 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