Commit Graph

15 Commits

Author SHA1 Message Date
Andy
f7b4dd4458 Revert "[now-static-build] Add support buildCommand, devCommand and outputDirectory (#3422)" (#3428)
This reverts commit 5a6d1a135f.
2019-12-13 18:12:16 -05:00
Steven
d3cc306e5b [now-build-utils] Remove unused execa (#3427)
~~Reverts the execa bump from #3422~~

Removes `execa` since it is no longer used.
2019-12-13 17:23:18 -05:00
Andy
5a6d1a135f [now-static-build] Add support buildCommand, devCommand and outputDirectory (#3422)
* [now-static-build] Handle `buildCommand`, `devCommand` and `outputDirectory`

* Adjust tests

* Swap order

* Add `node_modules/.bin` to PATH

* Remove @types/execa

* Append PATH only to spawn options

* Remove test check

* Only add when there is a command
2019-12-13 19:30:09 +01:00
Andy
67a80d6b83 [now-cli][now-build-utils] Update detectors (#3402)
* [now-build-utils] Consider `yarn build` and `npm run build` as `buildCommand`

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

* Update unit tests

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

* Update tests

* Run prettier

* Add more tests

* [now-cli] Use default detectors

* Add now-dev test

* Add a generic node project fallback

* Fix build

* Use public as default

* Ensure generic node project is last

* Update tests

* Update tests again

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

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

* Remove parentheses

* Revert "Remove parentheses"

This reverts commit 03f9aba07b0a6d4088719ca9afd602ce8fb1e9c1.

* Use getDependencyVersion instead of hasDependency
2019-12-12 18:28:24 +01:00
Steven
3de08e9f3b [now-build-utils] Fix canary selection for static build (#3339)
We expect `now@canary` to use canary builders. This PR fixes a bug where a zero config deployment was selecting `@now/static-build` instead of `@now/static-build@canary`.
2019-11-20 16:17:55 +00:00
Steven
a229747249 [now-build-utils][now-static-build][now-node] Add node 12.x (#3330)
This PR adds support for Node 12 when the user defines `engines` in their `package.json`
2019-11-20 02:34:01 +00:00
Andy
2a59db3029 [now-build-utils] Ensure function paths are relative to the project and improve the error message (#3312)
* [now-build-utils] Ensure function paths are relative to the project and improve the error message

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

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

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

Co-Authored-By: Steven <steven@ceriously.com>
2019-11-15 18:56:23 +01:00
Andy
24da26e7cf [@now/build-utils] Add support for includeFiles and excludeFiles to Functions (#3285)
Add support for `includeFiles` and `excludeFiles` to Functions.

[PRODUCT-27]

[PRODUCT-27]: https://zeit.atlassian.net/browse/PRODUCT-27
2019-11-11 22:17:59 +00:00
Andy
c24d8de960 [all] Updated builders to version: 3 (#3273)
* [now-node] Use builder version 3

* [now-cgi] Use builder version 3

* [now-go] Use builder version 3

* [now-python] Use builder version 3

* [now-ruby] Use builder version 3

* Adjust docs

* [now-ruby] Remove unused import

* Temp. test in iad1

* Revert "Temp. test in iad1"

This reverts commit 4c495baa5888dda5ae8f184f679613e91ab7268c.

* [now-cli] Adjust `now dev` for builder version 3

* [now-build-utils] Do not allow non Community Runtimes

* Temp. Force Build in iad1

* Update DEVELOPING_A_RUNTIME.md

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

* Update docs

* Update test/lib/deployment/now-deploy.js

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

* Remove temp. iad1 check

* Check memory and maxDuration

* Use memory for Lambda

* Only cast once

* Skip tests
2019-11-11 12:33:08 +01:00
Andy
34f6e52335 [all] Fix functions property and update Lambda (#3252)
* Allow functions + next.js

* Don't allow empty or invalid functions

* Make sure runtimes match a source

* Update now-dev to use the functions property

* Functions must match a source file

* Split up functions

* Make sure @now/next does not receive any unused functions

* Allow memory and maxDuration properties on Lambdas

* Add lambda options to @now/node

* Add lambda options to @now/go

* Add lambda options to @now/python

* Add lambda options to @now/ruby

* Update lambda options on @now/node

* Add lambda optiosn to @now/cgi

* Make options optional

* Add lambda options to @now/next

* Fix assertion

* Add test

* Fix tests

* Skip 06-ruby test

* Skip correct tests

* Fix options and cache src check

* Adjust memory test
2019-11-11 12:31:57 +01:00
Andy
e0683d51fa [now-build-utils] Fix custom function runtimes (#3239)
* [now-build-utils] Fix custom runtimes for functions

* [now-cli] Change order
2019-11-11 12:07:28 +01:00
Steven
cd7eabb6b6 [now-build-utils] Fix zero config trailing slash (#3233)
This fixes the scenario where the user defines `trailingSlash: true` and creates a file `/api/users.js`. They would expect to be able to visit `/api/users/` and it should run that function.
2019-11-11 12:07:05 +01:00
Andy
ca8f347e3a [now-build-utils] Validate functions and allow them as config (#3218)
* [now-build-utils] Validate functions and allow them as config

* Apply suggestions from code review

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

* Change memory check

* Adjust test
2019-11-11 12:05:14 +01:00
Andy
f2bd36b4f9 [now-build-utils] Add functions property (#3213)
This updates `@now/build-utils` to add support for the function property including types and tests.

Related: [PRODUCT-27]

[PRODUCT-27]: https://zeit.atlassian.net/browse/PRODUCT-27
2019-11-11 12:04:54 +01:00
Steven
58eef7f394 [now-build-utils] Fix static file serving from now dev (#3167)
This PR does a few things

- Separate tests into `integration.test.js` and `unit.test.js`
- Use one static build instead of many to avoid `should NOT have more than 128 items` error
- Add a new unit test so we don't regress

Fixes #3159
2019-10-21 16:10:39 -07:00