Commit Graph

417 Commits

Author SHA1 Message Date
Vincent Voyer
667af829c4 [build-utils][cli][client][node][next][static-config]: forward crons from vercel.json to config.json (#9454)
This PR changes the way cron jobs are being created in the build output
API. This is my first time contributing here. If you see something
unusual, let me know.

 Good for review

Our goal is to:
- Allow creating cron jobs via the `crons` property of `vercel.json` for
end users
- Allow framework authors to create cron jobs on Vercel via the `crons`
property of the Build Output API configuration

---

As you can see, we removed the previous implementation where cron jobs
could be configured at the function code level (export const cron = ""),
on top of vercel.json `functions` property. Here's why:

- All frameworks would have to implement the configure at the function
code level
- Not all frameworks can easily map a path to a specific function
(example: SvelteKit) and would have to bail on bundling functions inside
the same lambda
- Configuring a path + scheduler provides a better mapping of what cron
jobs are as of today: API routes on a schedule and not functions on a
schedule
- Dynamic routes Cron Jobs will be supported:
/api/crons/sync-slack-team/230
- Query parameters will be supported support:
/api/crons/sync-slack-team/230?secret=32k13l2k13lk21 (= securing cron
jobs v0)
- 100% frameworks compatibility from day one

Next.js and other frameworks may choose to implement their own cron jobs
feature that will then need to be configured through the `crons`
property of `config.json` (build output API).

cc @timneutkens @Rich-Harris 

Internal thread:
https://vercel.slack.com/archives/C04DWF5HB6K/p1676366892714349
2023-02-16 11:49:09 +01:00
Sean Massa
9308a0fda5 Publish Stable
- @vercel/build-utils@6.2.4
 - vercel@28.15.6
 - @vercel/client@12.3.10
 - @vercel/frameworks@1.3.1
 - @vercel/fs-detectors@3.7.13
 - @vercel/gatsby-plugin-vercel-builder@1.1.6
 - @vercel/go@2.3.6
 - @vercel/hydrogen@0.0.52
 - @vercel/next@3.4.5
 - @vercel/node@2.9.5
 - @vercel/python@3.1.48
 - @vercel/redwood@1.1.4
 - @vercel/remix@1.3.1
 - @vercel/routing-utils@2.1.9
 - @vercel/ruby@1.3.64
 - @vercel/static-build@1.3.8
2023-02-15 12:26:53 -06:00
Sean Massa
881e43a0e2 Publish Stable
- @vercel/build-utils@6.2.3
 - vercel@28.15.5
 - @vercel/client@12.3.9
 - @vercel/fs-detectors@3.7.12
 - @vercel/gatsby-plugin-vercel-builder@1.1.5
 - @vercel/go@2.3.5
 - @vercel/hydrogen@0.0.51
 - @vercel/next@3.4.4
 - @vercel/node@2.9.4
 - @vercel/python@3.1.47
 - @vercel/redwood@1.1.3
 - @vercel/remix-entry-server@0.1.0
 - @vercel/remix@1.3.0
 - @vercel/ruby@1.3.63
 - @vercel/static-build@1.3.7
2023-02-14 15:38:34 -06:00
Steven
8f49969585 [tests] Update tests script names (#9433)
### Description 

These script names are currently really long and that makes it difficult
to read.

In particular, the most important part (the package name) is often
truncated.

See before/after below.

## Before

<img width="302" alt="image"
src="https://user-images.githubusercontent.com/229881/218588978-b8ed9a7a-f4da-4d58-af3f-2b1a7087737d.png">

## After

<img width="290" alt="image"
src="https://user-images.githubusercontent.com/229881/218596895-65627ad0-2895-4bd7-8506-f5f545a419d3.png">
2023-02-14 10:31:46 -05:00
Sean Massa
a010d8fe8a [cli] add slash before url for edge function errors (#9428)
Edge Functions and Serverless Functions were both updated to show the path of their entry points, but it turns out Serverless Function paths started with a slash and Edge Function paths did not.

The [related code for Serverless Functions](d628880942/packages/node-bridge/helpers.ts) does not need to be updated.

---

Before:

<img width="996" alt="CleanShot 2023-02-13 at 13 23 42@2x" src="https://user-images.githubusercontent.com/41545/218554154-2b112a68-2d68-4968-bae7-acf6e85a72a2.png">

---

After: 

<img width="921" alt="CleanShot 2023-02-13 at 13 20 22@2x" src="https://user-images.githubusercontent.com/41545/218554029-c3dce6b1-b01f-4a78-aa32-f6891ff16e51.png">
2023-02-13 21:37:16 +00:00
Nathan Rajlich
e7947a1b33 [node] Make NFT resolve "worker"/"browser" exports for Edge Functions (#9377)
This makes `react-dom` work as expected from within Edge Functions. Otherwise, NFT will only select the Node.js version of the files which do not work with react-dom within an Edge Function.
2023-02-13 20:27:37 +00:00
Sean Massa
95a4dcfb33 Publish Stable
- @vercel/build-utils@6.2.2
 - vercel@28.15.4
 - @vercel/client@12.3.8
 - @vercel/fs-detectors@3.7.11
 - @vercel/gatsby-plugin-vercel-builder@1.1.4
 - @vercel/go@2.3.4
 - @vercel/hydrogen@0.0.50
 - @vercel/next@3.4.3
 - @vercel/node-bridge@3.1.11
 - @vercel/node@2.9.3
 - @vercel/python@3.1.46
 - @vercel/redwood@1.1.2
 - @vercel/remix@1.2.13
 - @vercel/ruby@1.3.62
 - @vercel/static-build@1.3.6
2023-02-13 12:47:15 -06:00
Sean Massa
d628880942 [cli][node][node-bridge] improve edge/serverless function error messages (#9410)
The error messages shown during `vc dev` when an Edge or Serverless functions returns a promise that ends up being rejected could be better.

Main changes:

- removed "socket hang up" error messages because they were not helpful to the user
- changed serverless function error handling to log explicitly and exit
- changed serverless function error message to include the request path
- changed edge function error message to include request path and a faked (but useful) stack trace

## Current

### In Production

**Serverless Function:** In production, for a serverless function rejected promise, you'll see this in the logs:

```
Unhandled Promise Rejection 	{
  "errorType": "Runtime.UnhandledPromiseRejection",
  "errorMessage": "Error: intentional break!",
  "reason": {
    "errorType": "Error",
    "errorMessage": "intentional break!",
    "stack": [
      "Error: intentional break!",
      "    at handler (/var/task/api/node.js:3:9)",
      "    at Server.<anonymous> (/var/task/___vc/__helpers.js:813:19)",
      "    at Server.emit (node:events:527:28)",
      "    at parserOnIncoming (node:_http_server:956:12)",
      "    at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)"
    ]
  },
  "promise": {},
  "stack": [
    "Runtime.UnhandledPromiseRejection: Error: intentional break!",
    "    at process.<anonymous> (file:///var/runtime/index.mjs:1194:17)",
    "    at process.emit (node:events:539:35)",
    "    at process.emit (/var/task/___vc/__sourcemap_support.js:559:21)",
    "    at emit (node:internal/process/promises:140:20)",
    "    at processPromiseRejections (node:internal/process/promises:274:27)",
    "    at processTicksAndRejections (node:internal/process/task_queues:97:32)"
  ]
}
Unknown application error occurred
Runtime.Unknown
```

**Edge Function:** In production, for an edge function rejected promise, you'll see this in the logs:

```
Error: intentional break!
    at (api/edge.js:10:10)
```

In both cases, in the browser, you see the "This Serverless/Edge Function has crashed." template with no error message or stack trace.


### In `vc dev`


**Serverless Function:** In `vc dev`, for a serverless function rejected promise, you'll see this in the output:

```
Unhandled rejection: Error: intentional break!
    at handler (/Users/smassa/source/demo/edge-errors/api/node.js:3:9)
    at Server.<anonymous> (/Users/smassa/source/vercel/vercel/packages/node-bridge/helpers.js:813:19)
    at Server.emit (node:events:513:28)
    at Server.emit (node:domain:489:12)
    at parserOnIncoming (node:_http_server:998:12)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)
Error: Failed to complete request to /api/node: Error: socket hang up
```

**Edge Function:** In `vc dev`, for an edge function rejected promise, you'll see this in the output:

```
Unhandled rejection: intentional break!
Error: Failed to complete request to /api/edge: Error: socket hang up
```

## After Changes

### In `vc dev`


**Serverless Function:** In `vc dev`, for a serverless function rejected promise, you'll see this in the output:

```
Rejected Promise returned from /api/node: Error: intentional break!
    at handler (/Users/smassa/source/demo/edge-errors/api/node.js:3:9)
    at Server.<anonymous> (/Users/smassa/source/vercel/vercel/packages/node-bridge/helpers.js:824:19)
    at Server.emit (node:events:513:28)
    at Server.emit (node:domain:489:12)
    at parserOnIncoming (node:_http_server:998:12)
    at HTTPParser.parserOnHeadersComplete (node:_http_common:128:17)
```

**Edge Function:** In `vc dev`, for an edge function rejected promise, you'll see this in the output:

```
Rejected Promise returned from api/edge: intentional break!
    at (api/edge.ts)
```

We can't show the real stack trace for Edge Functions because the bundling + VM execution mangles it. What's rendered here is a fake one, but it's still useful to the user.

If we currently showed the real stack trace for edge functions, it would look like:

```
Rejected Promise returned from api/edge: intentional break!
    at edge (evalmachine.<anonymous>:35:9)
    at FetchEvent.<anonymous> (evalmachine.<anonymous>:87:26)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async EdgeRuntime.dispatchFetch (evalmachine.<anonymous>:29:7)
    at async Server.handler (/Users/smassa/source/vercel/vercel/node_modules/.pnpm/edge-runtime@2.0.0/node_modules/edge-runtime/src/server/create-handler.ts:46:26)
```

## Follow Up

We'll look into improving the Edge Function error stack traces later.
2023-02-11 00:14:58 +00:00
Steven
f5280cb375 [node] Fix incorrect stack trace of TS error (#9409)
### Description

TS has an option, `noEmitOnError`, that is used to either fail the build by throwing when `true` or just print the error and continuing to build when `false`.

This PR fixes the case when `noEmitOnError: false`. Previously showing an error stack trace but now it correctly shows the error message without the stack.

### Before

<img width="1186" alt="image" src="https://user-images.githubusercontent.com/229881/218186616-9e6f04ea-0256-4ed6-8705-50e8dd5090f5.png">

### After

<img width="1195" alt="image" src="https://user-images.githubusercontent.com/229881/218186818-526b2b6a-599e-43e1-aa7b-7f536887730a.png">
2023-02-10 20:29:45 +00:00
JJ Kasper
c1c8b454cc Publish Stable
- @vercel/build-utils@6.2.1
 - vercel@28.15.2
 - @vercel/client@12.3.7
 - @vercel/fs-detectors@3.7.10
 - @vercel/gatsby-plugin-vercel-builder@1.1.2
 - @vercel/go@2.3.3
 - @vercel/hydrogen@0.0.49
 - @vercel/next@3.4.1
 - @vercel/node@2.9.2
 - @vercel/python@3.1.45
 - @vercel/redwood@1.1.1
 - @vercel/remix@1.2.12
 - @vercel/ruby@1.3.61
 - @vercel/static-build@1.3.4
2023-02-07 11:51:17 -08:00
Andy Bitz
a585969dd3 Publish Stable
- @vercel/build-utils@6.2.0
 - vercel@28.15.1
 - @vercel/client@12.3.6
 - @vercel/fs-detectors@3.7.9
 - @vercel/gatsby-plugin-vercel-builder@1.1.1
 - @vercel/go@2.3.2
 - @vercel/hydrogen@0.0.48
 - @vercel/next@3.4.0
 - @vercel/node@2.9.1
 - @vercel/python@3.1.44
 - @vercel/redwood@1.1.0
 - @vercel/remix@1.2.11
 - @vercel/ruby@1.3.60
 - @vercel/static-build@1.3.3
2023-02-06 17:24:54 +01:00
Steven
b5a9408272 [node] Add log for unused config runtime (#9373)
Both `runtime: undefined` and `runtime: nodejs` have the same behavior
but we want to change that in the future.

The first step is to see if `runtime: nodejs` is currently used at all.
2023-02-03 10:46:18 -05:00
Andy Bitz
a4d16c681a Publish Stable
- @vercel/build-utils@6.1.0
 - vercel@28.15.0
 - @vercel/client@12.3.5
 - @vercel/fs-detectors@3.7.8
 - @vercel/gatsby-plugin-vercel-builder@1.1.0
 - @vercel/go@2.3.1
 - @vercel/hydrogen@0.0.47
 - @vercel/next@3.3.21
 - @vercel/node@2.9.0
 - @vercel/python@3.1.43
 - @vercel/redwood@1.0.54
 - @vercel/remix@1.2.10
 - @vercel/ruby@1.3.59
 - @vercel/static-build@1.3.2
 - @vercel/static-config@2.0.12
2023-02-01 23:26:52 +01:00
Andy
61bbd4f98b [cli] Add crons to build output (#9360)
Co-authored-by: George Karagkiaouris <gkaragkiaouris2@gmail.com>
Co-authored-by: Chris Barber <chris.barber@vercel.com>
Co-authored-by: Nathan Rajlich <n@n8.io>
2023-02-01 22:47:55 +01:00
chloetedder
ada9a48d57 Publish Stable
- @vercel/build-utils@6.0.1
 - vercel@28.14.1
 - @vercel/client@12.3.4
 - @vercel/fs-detectors@3.7.7
 - @vercel/gatsby-plugin-vercel-builder@1.0.3
 - @vercel/go@2.3.0
 - @vercel/hydrogen@0.0.46
 - @vercel/next@3.3.20
 - @vercel/node@2.8.17
 - @vercel/python@3.1.42
 - @vercel/redwood@1.0.53
 - @vercel/remix@1.2.9
 - @vercel/ruby@1.3.58
 - @vercel/static-build@1.3.1
2023-01-30 15:19:54 -07:00
Steven
25f6595d36 Publish Stable
- @vercel/build-utils@6.0.0
 - vercel@28.13.2
 - @vercel/client@12.3.3
 - @vercel/edge@0.2.7
 - @vercel/frameworks@1.3.0
 - @vercel/fs-detectors@3.7.6
 - @vercel/gatsby-plugin-vercel-builder@1.0.1
 - @vercel/go@2.2.31
 - @vercel/hydrogen@0.0.45
 - @vercel/next@3.3.19
 - @vercel/node@2.8.16
 - @vercel/python@3.1.41
 - @vercel/redwood@1.0.52
 - @vercel/remix@1.2.8
 - @vercel/ruby@1.3.57
 - @vercel/static-build@1.2.1
2023-01-26 11:19:03 -05:00
Ethan Arrowood
92f5b6e0c9 Publish Stable
- vercel@28.13.0
 - @vercel/gatsby-plugin-vercel-builder@0.1.2
 - @vercel/next@3.3.18
 - @vercel/node@2.8.15
 - @vercel/static-build@1.2.0
2023-01-20 10:27:31 -07:00
Nathan Rajlich
053ec92d5f [node] Add build logs probe for TypeScript usage messages (#9261)
Follow-up to https://github.com/vercel/vercel/pull/9258, even though that issue seemed to only happen when linked to the monorepo locally. In any case, this test will ensure those log messages are intact for any other change around that part of the codebase in the future.
2023-01-19 21:39:27 +00:00
Nathan Rajlich
eae45f4019 [node] Fix TypeScript built-in compiler log message check (#9258)
This check started breaking probably after the pnpm switch, so switch to a simpler solution that doesn't require comparing the paths.
2023-01-19 13:12:31 +00:00
Steven
79ef5c3724 Publish Stable
- vercel@28.12.7
 - @vercel/client@12.3.2
 - @vercel/gatsby-plugin-vercel-builder@0.1.0
 - @vercel/next@3.3.16
 - @vercel/node-bridge@3.1.10
 - @vercel/node@2.8.14
 - @vercel/remix@1.2.6
2023-01-18 08:39:44 -05:00
Steven
4ccdcde463 Publish Stable
- @vercel/build-utils@5.9.0
 - vercel@28.12.6
 - @vercel/client@12.3.1
 - @vercel/fs-detectors@3.7.5
 - @vercel/go@2.2.30
 - @vercel/hydrogen@0.0.44
 - @vercel/next@3.3.15
 - @vercel/node@2.8.13
 - @vercel/python@3.1.40
 - @vercel/redwood@1.0.51
 - @vercel/remix@1.2.5
 - @vercel/ruby@1.3.56
 - @vercel/static-build@1.1.7
2023-01-17 19:25:26 -05:00
Sean Massa
6d97e1673e Publish Stable
- vercel@28.12.5
 - @vercel/client@12.3.0
 - @vercel/node-bridge@3.1.9
 - @vercel/node@2.8.12
2023-01-17 13:46:58 -06:00
Sean Massa
b5cdc82a1c Publish Stable
- @vercel/build-utils@5.8.3
 - vercel@28.12.4
 - @vercel/client@12.2.31
 - @vercel/edge@0.2.6
 - @vercel/error-utils@1.0.8
 - @vercel/frameworks@1.2.4
 - @vercel/fs-detectors@3.7.4
 - @vercel/gatsby-plugin-vercel-analytics@1.0.6
 - @vercel/go@2.2.29
 - @vercel/hydrogen@0.0.43
 - @vercel/next@3.3.14
 - @vercel/node-bridge@3.1.8
 - @vercel/node@2.8.11
 - @vercel/python@3.1.39
 - @vercel/redwood@1.0.50
 - @vercel/remix@1.2.4
 - @vercel/routing-utils@2.1.8
 - @vercel/ruby@1.3.55
 - @vercel/static-build@1.1.6
 - @vercel/static-config@2.0.11
2023-01-13 15:45:03 -06:00
Nathan Rajlich
c7851404b3 [*] Remove "workspace:" (#9225) 2023-01-13 15:42:29 -06:00
Sean Massa
e54da8a2e5 Publish Stable
- @vercel/build-utils@5.8.2
 - vercel@28.12.3
 - @vercel/client@12.2.30
 - @vercel/edge@0.2.5
 - @vercel/error-utils@1.0.7
 - @vercel/frameworks@1.2.3
 - @vercel/fs-detectors@3.7.3
 - @vercel/gatsby-plugin-vercel-analytics@1.0.5
 - @vercel/go@2.2.28
 - @vercel/hydrogen@0.0.42
 - @vercel/next@3.3.13
 - @vercel/node-bridge@3.1.7
 - @vercel/node@2.8.10
 - @vercel/python@3.1.38
 - @vercel/redwood@1.0.49
 - @vercel/remix@1.2.3
 - @vercel/routing-utils@2.1.7
 - @vercel/ruby@1.3.54
 - @vercel/static-build@1.1.5
 - @vercel/static-config@2.0.10
2023-01-13 15:06:45 -06:00
Sean Massa
b793a67588 Publish Stable
- @vercel/build-utils@5.8.1
 - vercel@28.12.2
 - @vercel/client@12.2.29
 - @vercel/edge@0.2.4
 - @vercel/error-utils@1.0.6
 - @vercel/frameworks@1.2.2
 - @vercel/fs-detectors@3.7.2
 - @vercel/gatsby-plugin-vercel-analytics@1.0.4
 - @vercel/go@2.2.27
 - @vercel/hydrogen@0.0.41
 - @vercel/next@3.3.12
 - @vercel/node-bridge@3.1.6
 - @vercel/node@2.8.9
 - @vercel/python@3.1.37
 - @vercel/redwood@1.0.48
 - @vercel/remix@1.2.2
 - @vercel/routing-utils@2.1.6
 - @vercel/ruby@1.3.53
 - @vercel/static-build@1.1.4
 - @vercel/static-config@2.0.9
2023-01-13 15:01:55 -06:00
Sean Massa
e71d5638ee Publish Stable
- @vercel/build-utils@5.8.0
 - vercel@28.12.1
 - @vercel/client@12.2.28
 - @vercel/edge@0.2.3
 - @vercel/error-utils@1.0.5
 - @vercel/frameworks@1.2.1
 - @vercel/fs-detectors@3.7.1
 - @vercel/gatsby-plugin-vercel-analytics@1.0.3
 - @vercel/go@2.2.26
 - @vercel/hydrogen@0.0.40
 - @vercel/next@3.3.11
 - @vercel/node-bridge@3.1.5
 - @vercel/node@2.8.8
 - @vercel/python@3.1.36
 - @vercel/redwood@1.0.47
 - @vercel/remix@1.2.1
 - @vercel/routing-utils@2.1.5
 - @vercel/ruby@1.3.52
 - @vercel/static-build@1.1.3
 - @vercel/static-config@2.0.8
2023-01-13 14:47:25 -06:00
Sean Massa
62b28ad0b4 Publish Stable
- @vercel/build-utils@5.7.6
 - vercel@28.12.0
 - @vercel/client@12.2.27
 - @vercel/edge@0.2.2
 - @vercel/error-utils@1.0.4
 - @vercel/frameworks@1.2.0
 - @vercel/fs-detectors@3.7.0
 - @vercel/gatsby-plugin-vercel-analytics@1.0.2
 - @vercel/go@2.2.25
 - @vercel/hydrogen@0.0.39
 - @vercel/next@3.3.10
 - @vercel/node-bridge@3.1.4
 - @vercel/node@2.8.7
 - @vercel/python@3.1.35
 - @vercel/redwood@1.0.46
 - @vercel/remix@1.2.0
 - @vercel/routing-utils@2.1.4
 - @vercel/ruby@1.3.51
 - @vercel/static-build@1.1.2
 - @vercel/static-config@2.0.7
2023-01-13 14:00:46 -06:00
Steven
1efb5d6c0d [fs-detectors] Add support for api/**/*.tsx zero config detection (#9216)
There are cases where you would want to use `.tsx` with Serverless Functions, such as OG Image Generation.

This PR adds zero config detection for `.tsx` file extensions and also consolidates the glob pattern into a single string matching all valid `@vercel/node` cases.

https://twitter.com/hasparus/status/1593136849404694528

https://linear.app/vercel/issue/VCCLI-322
2023-01-13 17:59:49 +00:00
Ethan Arrowood
9c768b98b7 [tests] Migrate from yarn to pnpm (#9198)
<picture data-single-emoji=":pnpm:" title=":pnpm:"><img class="emoji" src="https://single-emoji.vercel.app/api/emoji/eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIn0..4mJzrO94AnSn0Pue.4apgaKtTUdQ-wxNyahjdJj28u8bbXreLoTA8AGqYjLta3MrsFvbo9DsQFth4CoIkBgXFhQ5_BVcKNfYbwLg4bKzyIvItKe4OFS8AzG7Kkicz2kUUZk0.nXyK_PvHzZFGA-MQB6XHfA" alt=":pnpm:" width="20" height="auto" align="absmiddle"></picture> 

yarn has become increasingly more difficult to use as the v1 we rely on no longer receives updates. pnpm is faster and is actively maintained. 

This PR migrates us to pnpm.
2023-01-11 23:35:13 +00:00
JJ Kasper
4c3bc05322 Publish Stable
- @vercel/build-utils@5.7.5
 - vercel@28.11.1
 - @vercel/client@12.2.26
 - @vercel/fs-detectors@3.6.2
 - @vercel/gatsby-plugin-vercel-analytics@1.0.1
 - @vercel/go@2.2.24
 - @vercel/hydrogen@0.0.38
 - @vercel/next@3.3.9
 - @vercel/node@2.8.6
 - @vercel/python@3.1.34
 - @vercel/redwood@1.0.45
 - @vercel/remix@1.1.7
 - @vercel/ruby@1.3.50
 - @vercel/static-build@1.1.1
2023-01-11 12:01:03 -08:00
Ethan Arrowood
721cd3afcb Publish Stable
- @vercel/build-utils@5.7.4
 - vercel@28.11.0
 - @vercel/client@12.2.25
 - @vercel/frameworks@1.1.18
 - @vercel/fs-detectors@3.6.1
 - @vercel/gatsby-plugin-vercel-analytics@1.0.0
 - @vercel/go@2.2.23
 - @vercel/hydrogen@0.0.37
 - @vercel/next@3.3.8
 - @vercel/node@2.8.5
 - @vercel/python@3.1.33
 - @vercel/redwood@1.0.44
 - @vercel/remix@1.1.6
 - @vercel/ruby@1.3.49
 - @vercel/static-build@1.1.0
2023-01-09 15:53:47 -07:00
Steven
fc0e6872e5 Publish Stable
- vercel@28.10.3
 - @vercel/frameworks@1.1.17
 - @vercel/fs-detectors@3.6.0
 - @vercel/next@3.3.7
 - @vercel/node-bridge@3.1.3
 - @vercel/node@2.8.4
 - @vercel/redwood@1.0.43
 - @vercel/remix@1.1.5
 - @vercel/static-build@1.0.46
2023-01-05 16:27:06 -05:00
Steven
feceeef7b7 [node] Fix ESM output from TS source (#7954)
- Depends on https://github.com/vercel/nft/pull/297
- Fixes #7908 
- Fixes #6194 

This PR bumps `@vercel/nft` (for production) and `ts-node` (for
development) to fix ESM behavior.

Because Node.js cannot dynamically set [loader
hooks](https://nodejs.org/docs/latest-v18.x/api/esm.html#loaders) once a
process is started, I had to change the way `ts-node` is registered by
using environment variables such as `NODE_OPTIONS`. Most of the logic
for TS and ESM was pulled out of the child process and into the parent.

Co-authored-by: Ethan Arrowood <ethan.arrowood@vercel.com>
2023-01-05 15:25:32 -05:00
Steven
d6cccd70f2 Publish Stable
- @vercel/build-utils@5.7.3
 - vercel@28.10.2
 - @vercel/client@12.2.24
 - @vercel/fs-detectors@3.5.7
 - @vercel/go@2.2.22
 - @vercel/hydrogen@0.0.36
 - @vercel/next@3.3.6
 - @vercel/node@2.8.3
 - @vercel/python@3.1.32
 - @vercel/redwood@1.0.42
 - @vercel/remix@1.1.4
 - @vercel/ruby@1.3.48
 - @vercel/static-build@1.0.45
2023-01-03 17:31:50 -05:00
Chris Barber
cb29bfdd68 Publish Stable
- @vercel/build-utils@5.7.2
 - vercel@28.10.1
 - @vercel/client@12.2.23
 - @vercel/frameworks@1.1.16
 - @vercel/fs-detectors@3.5.6
 - @vercel/go@2.2.21
 - @vercel/hydrogen@0.0.35
 - @vercel/next@3.3.5
 - @vercel/node@2.8.2
 - @vercel/python@3.1.31
 - @vercel/redwood@1.0.41
 - @vercel/remix@1.1.3
 - @vercel/ruby@1.3.47
 - @vercel/static-build@1.0.44
2022-12-22 18:47:23 -06:00
Steven
4484c13448 Publish Stable
- @vercel/build-utils@5.7.1
 - vercel@28.9.0
 - @vercel/client@12.2.22
 - @vercel/frameworks@1.1.15
 - @vercel/fs-detectors@3.5.5
 - @vercel/go@2.2.20
 - @vercel/hydrogen@0.0.34
 - @vercel/next@3.3.3
 - @vercel/node@2.8.1
 - @vercel/python@3.1.30
 - @vercel/redwood@1.0.40
 - @vercel/remix@1.1.2
 - @vercel/ruby@1.3.46
 - @vercel/static-build@1.0.43
2022-12-14 16:23:22 -05:00
Sean Massa
584d0ea853 Publish Stable
- vercel@28.8.0
 - @vercel/node@2.8.0
2022-12-07 09:53:52 -06:00
Damien Simonin Feugas
2413e684a1 feat(node,cli): allows 'edge' as possible runtime value (#9016)
### 📖 What's in there?

As part of Edge function GA, we're allowing `edge` as a runtime value.
This is adding to the allowed list, so we stay backward compatible.

[Linear ticket](https://linear.app/vercel/issue/EC-481/add-edge-to-the-list-of-allowed-runtimes)

I've kept one instance of `experimental-edge` in the test fixtures to ensure we still supports it.

### 📋 Checklist

####  🧪 Tests

- [x] The code changed/added as part of this PR has been covered with tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [x] This PR has a concise title and thorough description useful to a reviewer
- [x] Issue from task tracker has a link to this PR
2022-12-07 13:35:08 +00:00
Sean Massa
b37ac5f798 Publish Stable
- @vercel/build-utils@5.7.0
 - vercel@28.7.1
 - @vercel/client@12.2.21
 - @vercel/go@2.2.19
 - @vercel/hydrogen@0.0.33
 - @vercel/next@3.3.2
 - @vercel/node@2.7.1
 - @vercel/python@3.1.29
 - @vercel/redwood@1.0.39
 - @vercel/remix@1.1.1
 - @vercel/ruby@1.3.45
 - @vercel/static-build@1.0.42
2022-12-02 14:15:48 -06:00
Steven
d649a3c931 [node] Add caching for TS compile per file (#8987)
As a follow up to #8986, we can reduce the TS compile time even more by caching TS compile per file so we never compile the same file twice.  This brings down the total deployment time of a large app with many `api/*.ts` from 7 min to 5 min.

Note: review this PR with [whitespace disabled](https://github.com/vercel/vercel/pull/8987/files?w=1).

- Related to https://github.com/vercel/customer-issues/issues/925
2022-12-01 18:34:56 +00:00
Sean Massa
a19447f9cd Publish Stable
- @vercel/build-utils@5.6.0
 - vercel@28.6.0
 - @vercel/client@12.2.20
 - @vercel/frameworks@1.1.13
 - @vercel/fs-detectors@3.5.3
 - @vercel/go@2.2.18
 - @vercel/hydrogen@0.0.32
 - @vercel/next@3.3.0
 - @vercel/node@2.7.0
 - @vercel/python@3.1.28
 - @vercel/redwood@1.0.38
 - @vercel/remix@1.1.0
 - @vercel/ruby@1.3.44
 - @vercel/static-build@1.0.40
2022-11-29 10:13:02 -06:00
Steven
f875825893 [node] Add caching to TS compile (#8986)
Since introducing `vc build`, we no longer have isolated builds. This means we can share the cache across builds and improve TS compile across multiple builds.

For example, `api/foo.js` and `api/bar.js` are two different builds but they will likely share the same `tsconfig.json`. So this PR caches the initialization used before running the TS compiler so that it can be shared between builds of the same deployment.

In one customer build, we saw deployment time drop from 14 min to 7 min.

- Related to https://github.com/vercel/customer-issues/issues/925
2022-11-28 23:24:58 +00:00
Sean Massa
fa154098c8 [tests] Fix CI after Node 18 updates (#8959)
There are some more test failures after the node 18 updates rolled out. This PR fixes all of them.
2022-11-23 17:40:51 +00:00
Nathan Rajlich
7003531d5d Publish Stable
- @vercel/build-utils@5.5.9
 - vercel@28.5.6
 - @vercel/client@12.2.19
 - @vercel/go@2.2.17
 - @vercel/hydrogen@0.0.31
 - @vercel/next@3.2.13
 - @vercel/node@2.6.4
 - @vercel/python@3.1.27
 - @vercel/redwood@1.0.37
 - @vercel/remix@1.0.37
 - @vercel/ruby@1.3.43
 - @vercel/static-build@1.0.39
2022-11-21 11:46:27 -08:00
Chris Barber
1542aff9ec [cli][next] Removed --forceExit from jest args (#8718)
Remove `--forceExit` and wait for the child `vc dev` process to close
before continuing.

Listen to the `'close'` event instead of `'exit'` to ensure stdio has
been flushed and closed before continuing.

Some tests cause `vc dev` to spawn child processes that in turn spawn
nested child processes that do not exit when the parent exits, so a
`nukeProcessTree()` helper was added to ensure all spawned processes are
cleaned up. Furthermore, some of the nested child processes don't
respond well to `SIGTERM` and we need to use `SIGKILL` if `SIGTERM`
doesn't do the job.

I uncovered a larger issue exposed by removing the `--forceExit` flag.
The go builder uses `go run` to build and run the go-based serverless
function. Turns out that `go run` will build the executable, then spawn
it with a parent process id (ppid) of `1` (launchd) on macOS. This means
that the go serverless function executable is not detected as a child
process of `vc dev` and won't be cleaned up, yet has inherited `stdout`
and `stderr` keeping Jest alive. The solution is to explicitly `go
build` the serverless executable, then run it.

### 📋 Checklist

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [x] The code changed/added as part of this PR has been covered with
tests
- [x] All tests pass locally with `yarn test-unit`

#### Code Review

- [ ] This PR has a concise title and thorough description useful to a
reviewer
- [ ] Issue from task tracker has a link to this PR

Co-authored-by: Sean Massa <EndangeredMassa@gmail.com>
2022-11-18 11:26:53 -06:00
Ethan Arrowood
74593e4d81 Publish Stable
- @vercel/build-utils@5.5.8
 - vercel@28.5.2
 - @vercel/client@12.2.18
 - @vercel/go@2.2.16
 - @vercel/hydrogen@0.0.30
 - @vercel/next@3.2.12
 - @vercel/node@2.6.3
 - @vercel/python@3.1.26
 - @vercel/redwood@1.0.36
 - @vercel/remix@1.0.36
 - @vercel/ruby@1.3.42
 - @vercel/static-build@1.0.37
2022-11-15 14:56:46 -07:00
JJ Kasper
0964be1710 Publish Stable
- vercel@28.4.15
 - @vercel/client@12.2.16
 - @vercel/error-utils@1.0.3
 - @vercel/frameworks@1.1.11
 - @vercel/fs-detectors@3.4.8
 - @vercel/hydrogen@0.0.29
 - @vercel/next@3.2.9
 - @vercel/node-bridge@3.1.2
 - @vercel/node@2.6.2
 - @vercel/redwood@1.0.34
 - @vercel/remix@1.0.35
 - @vercel/routing-utils@2.1.2
 - @vercel/static-build@1.0.35
 - @vercel/static-config@2.0.6
2022-11-07 12:46:03 -08:00
Ethan Arrowood
253b4fd1d2 [cli][client][error-utils][frameworks][fs-detectors][hydrogen][next][node-bridge][node][redwood][remix][routing-utils][static-config] update @types/node to v14 across repo (#8842)
### Related Issues

Updates @types/node to the latest version within the v14 major (based on `npm view @types/node`)

```
❯ npm view @types/node@'>=14.0.0 <15.0.0' version | tail -1
@types/node@14.18.33 '14.18.33'
```

This PR also fixes the various necessary type changes

### 📋 Checklist

<!--
  Please keep your PR as a Draft until the checklist is complete
-->

#### Tests

- [ ] The code changed/added as part of this PR has been covered with tests
- [ ] All tests pass locally with `yarn test-unit`

#### Code Review

- [ ] This PR has a concise title and thorough description useful to a reviewer
- [ ] Issue from task tracker has a link to this PR
2022-11-04 20:21:13 +00:00
Andy McKay
a567d047d1 Publish Stable
- @vercel/build-utils@5.5.7
 - vercel@28.4.14
 - @vercel/client@12.2.15
 - @vercel/edge@0.1.1
 - @vercel/error-utils@1.0.2
 - @vercel/frameworks@1.1.10
 - @vercel/fs-detectors@3.4.7
 - @vercel/go@2.2.15
 - @vercel/hydrogen@0.0.28
 - @vercel/next@3.2.8
 - @vercel/node-bridge@3.1.1
 - @vercel/node@2.6.1
 - @vercel/python@3.1.24
 - @vercel/redwood@1.0.33
 - @vercel/remix@1.0.34
 - @vercel/routing-utils@2.1.1
 - @vercel/ruby@1.3.41
 - @vercel/static-build@1.0.34
 - @vercel/static-config@2.0.5
2022-11-02 13:14:37 -07:00