https://vercel.com/blog/zeit-is-now-vercel
* Updates all org packages from `@now` to `@vercel`
* Updates Now CLI package name from `now` to `vercel`
* Packages contains `"bin"` entries for _both_ `vercel` and `now` in the package.json
* Updates `now-client` package name to `@vercel/client` (org scoped, for authenticity)
There is also a new `publish-legacy.sh` script which ensures that all the legacy package names (i.e. `now`, `now-client`, `@now/node`, etc.) will still be published as well.
We will remove this legacy publishing logic on Jan 1, 2021.
This adds initial support for Windows in GitHub Actions CI tests.
There is still work to be done to prevent certain tests from hanging in CI so those are skipped for now.
In a previous release, we pinned the node version to the project so that we could upgrade new projects to a newer version of Node.js while maintaining backwards compatibility with existing projects.
This puts some burden on the user when they're deployment is a year old and their pinned version of Node reaches EOL. Because we currently force the user to add a package.json.
This PR changes the behavior so projects are no longer pinned. Instead, newer deployments get the latest Node unless they opt-in and pin via package.json.
This PR will use the system installed version of Node.js and avoid printing a warning or error if a discontinued version is selected.
This optimization was already in `@now/node` but for some reason it was never add to `@now/next`.
The reason why its relevant today is because the warnings turned into errors due to Node 8 deprecation and we don't have the "Project" in `now dev` so we don't know which version of node to select.
So instead of determining the version, `now dev` will always use `node` in the PATH and avoid printing warnings or errors. This also results in less FS reads since we no longer need to read package.json.
This PR does the following
- Add and export class, `NowBuildError`, that can be thrown to stop the build and print an error but it will not print a stack trace.
- Improve logic for discontinued node versions and add more tests
- Remove hack (#3425) for undefined TERM, fixed by updating dependencies
- Rename `silent` variable to `isAuto` which means the node version was automatically selected, not defined in `package.json`
- Rename `test` deployments to `test2020` so that a fresh project is created with latest Node.js 12.x
This PR does a few things:
1. Add functions `getLatestNodeVersion()` and `getOldestNodeVersion()` for use in api-project.
2. Add property `config.nodeVersion` which has precedence over default Node 8.
We want new projects to use the latest node version without setting any configuration but we don't want to break old projects. So during project creation, the value of `getLatestNodeVersion()` will be saved and then each deployment of that project will assign that value to `config.nodeVersion`.
Implements [PRODUCT-837]
[PRODUCT-837]: https://zeit.atlassian.net/browse/PRODUCT-837
This PR adds the route `handle: miss` and a catch-all route for the api directory.
The plan is to rename files in `/api` and `/public` (in a future PR) to be extension-less and then the route is only used to rewrite the extension to the extension-less file (for example, `/api/user.go` => `/api/user`)
This reduces the routes needed for zero config (previously N routes for N files down to 1 route for N files).
* Revert "Revert "[now-static-build] Add support `buildCommand`, `devCommand` and `outputDirectory` (#3422)" (#3428)"
This reverts commit f7b4dd4458.
* Handle generic node projects with /public
* Remove .only
* Ensure node_modules/.bin is also available during `now dev`
* Remove config log
* Adjust test
* Fix integration tests
* Fix public check
* Remove build + public
* Remove _scan
* Remove any casting
* Use `spawnCommand` for dev
* Remove unused import
* Remove cross-spawn
* Fix null config
* Fix build
* Only do a single Buffer.concat
* [now-static-build] Handle `buildCommand`, `devCommand` and `outputDirectory`
* Adjust tests
* Swap order
* Add `node_modules/.bin` to PATH
* Remove @types/execa
* Append PATH only to spawn options
* Remove test check
* Only add when there is a command
* [now-build-utils] Consider `yarn build` and `npm run build` as `buildCommand`
* [@now/build-utils] Update new detectors
* Update unit tests
* [@now/build-utils] Update detect-builder and detect-routes
* Update tests
* Run prettier
* Add more tests
* [now-cli] Use default detectors
* Add now-dev test
* Add a generic node project fallback
* Fix build
* Use public as default
* Ensure generic node project is last
* Update tests
* Update tests again
* Update packages/now-build-utils/src/detectors/filesystem.ts
Co-Authored-By: Nathan Rajlich <n@n8.io>
* Remove parentheses
* Revert "Remove parentheses"
This reverts commit 03f9aba07b0a6d4088719ca9afd602ce8fb1e9c1.
* Use getDependencyVersion instead of hasDependency
We expect `now@canary` to use canary builders. This PR fixes a bug where a zero config deployment was selecting `@now/static-build` instead of `@now/static-build@canary`.
* [now-build-utils] Ensure function paths are relative to the project and improve the error message
* Update packages/now-build-utils/src/detect-builders.ts
Co-Authored-By: Steven <steven@ceriously.com>
* Update packages/now-build-utils/src/detect-builders.ts
Co-Authored-By: Steven <steven@ceriously.com>
* [now-node] Use builder version 3
* [now-cgi] Use builder version 3
* [now-go] Use builder version 3
* [now-python] Use builder version 3
* [now-ruby] Use builder version 3
* Adjust docs
* [now-ruby] Remove unused import
* Temp. test in iad1
* Revert "Temp. test in iad1"
This reverts commit 4c495baa5888dda5ae8f184f679613e91ab7268c.
* [now-cli] Adjust `now dev` for builder version 3
* [now-build-utils] Do not allow non Community Runtimes
* Temp. Force Build in iad1
* Update DEVELOPING_A_RUNTIME.md
Co-Authored-By: Steven <steven@ceriously.com>
* Update docs
* Update test/lib/deployment/now-deploy.js
Co-Authored-By: Steven <steven@ceriously.com>
* Remove temp. iad1 check
* Check memory and maxDuration
* Use memory for Lambda
* Only cast once
* Skip tests
* Allow functions + next.js
* Don't allow empty or invalid functions
* Make sure runtimes match a source
* Update now-dev to use the functions property
* Functions must match a source file
* Split up functions
* Make sure @now/next does not receive any unused functions
* Allow memory and maxDuration properties on Lambdas
* Add lambda options to @now/node
* Add lambda options to @now/go
* Add lambda options to @now/python
* Add lambda options to @now/ruby
* Update lambda options on @now/node
* Add lambda optiosn to @now/cgi
* Make options optional
* Add lambda options to @now/next
* Fix assertion
* Add test
* Fix tests
* Skip 06-ruby test
* Skip correct tests
* Fix options and cache src check
* Adjust memory test
This fixes the scenario where the user defines `trailingSlash: true` and creates a file `/api/users.js`. They would expect to be able to visit `/api/users/` and it should run that function.
* [now-build-utils] Validate functions and allow them as config
* Apply suggestions from code review
Co-Authored-By: Steven <steven@ceriously.com>
* Change memory check
* Adjust test
This updates `@now/build-utils` to add support for the function property including types and tests.
Related: [PRODUCT-27]
[PRODUCT-27]: https://zeit.atlassian.net/browse/PRODUCT-27
This PR does a few things
- Separate tests into `integration.test.js` and `unit.test.js`
- Use one static build instead of many to avoid `should NOT have more than 128 items` error
- Add a new unit test so we don't regress
Fixes#3159