Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions .changeset/fair-poems-pull.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
'@twilio-labs/serverless-twilio-runtime': major
'create-twilio-function': major
'@twilio-labs/plugin-serverless': major
'@twilio-labs/plugin-assets': major
'twilio-run': major
---

**WHAT**: Remove Node.js 18 from supported versions.

**WHY**: Node.js 18 is EOL and will not receive bug fixes or security upgrades. Users should migrate to Node.js 20 or 22.

**BREAKING CHANGE**: Projects using `create-twilio-function`, `@twilio-labs/plugin-asset`, `@twilio-labs/plugin-serverless`, `@twilio-labs/serverless-twilio-runtime` or `twilio-run` will have to migrate to Node.js 20 or 22.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
18
20
4 changes: 2 additions & 2 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ If you are planning to contribute something that does not have an open issue yet

## Requirements

Make sure you have Node.js 18 or newer installed. Due to compatibility with Twilio
Functions this project has to support at least Node.js 18.0.0.
Make sure you have Node.js 20 or newer installed. Due to compatibility with Twilio
Functions this project has to support at least Node.js 20.0.0.

We are using the npm CLI to manage our project. You'll need at least `npm` version 8 or newer.

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"prettier": "^2.2.1",
"rimraf": "^3.0.2",
"ts-jest": "^29.1.2",
"typedoc": "^0.27.4",
"typedoc": "^0.28.14",
"typescript": "^5.3.3"
},
"lint-staged": {
Expand Down
2 changes: 1 addition & 1 deletion packages/create-twilio-function/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"yargs": "^17.2.1"
},
"engines": {
"node": ">=12.22.1"
"node": "^20.x || ^22.x"
},
"files": [
"bin/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module.exports = {
'@twilio/runtime-handler'
].replace(/[\^~]/, ''),
twilioRun: pkgJson.dependencies['twilio-run'],
node: '22',
node: '^20.x || ^22.x',
typescript: '^5.3.3',
serverlessRuntimeTypes: '^4.0.0',
copyfiles: '^2.4.1',
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-assets/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"rimraf": "^5.0.5"
},
"engines": {
"node": ">=18"
"node": "^20.x || ^22.x"
},
"files": [
"/oclif.manifest.json",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-serverless/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"oclif": "^4.0.0"
},
"engines": {
"node": ">=18.0.0"
"node": "^20.x || ^22.x"
},
"files": [
"/oclif.manifest.json",
Expand Down
2 changes: 1 addition & 1 deletion packages/serverless-twilio-runtime/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Serverless Framework plugin to deploy to the Twilio Runtime.

### Pre-requisites

- Node.js v18.x (this is the runtime version supported by Twilio Functions)
- Node.js v20.x (this is the runtime version supported by Twilio Functions)
- Serverless CLI v1.50.0+. You can run npm i -g serverless if you don't already have it.
- A Twilio account. If you don't have one you can [sign up quickly](https://www.twilio.com/try-twilio).

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ function generateMockCallSite(
getFunction: jest.fn(),
getFunctionName: jest.fn(),
getMethodName: jest.fn(),
getPosition: jest.fn(),
getFileName: jest.fn().mockReturnValue(fileName),
getLineNumber: jest.fn(),
getColumnNumber: jest.fn(),
getEnclosingColumnNumber: jest.fn(),
getEnclosingLineNumber: jest.fn(),
getEvalOrigin: jest.fn(),
isToplevel: jest.fn(),
isEval: jest.fn(),
Expand All @@ -27,6 +30,8 @@ function generateMockCallSite(
isAsync: jest.fn(),
isPromiseAll: jest.fn(),
getPromiseIndex: jest.fn(),
getScriptHash: jest.fn(),
getScriptNameOrSourceURL: jest.fn(),
toString: () => {
return str;
},
Expand Down
2 changes: 1 addition & 1 deletion packages/twilio-run/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@
"README.md"
],
"engines": {
"node": ">=18.0.0"
"node": "^20.x || ^22.x"
},
"gitHead": "6db273648ed19474f4125042556b10c051529912"
}
2 changes: 1 addition & 1 deletion packages/twilio-run/src/checks/nodejs-version.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { stripIndent } from 'common-tags';
import { logger } from '../utils/logger';

const SERVERLESS_NODE_JS_VERSION = ['18.', '20.', '22.'];
const SERVERLESS_NODE_JS_VERSION = ['20.', '22.'];

export function printVersionWarning(
nodeVersion: string,
Expand Down