From d1c5369f5c3682a5aaa0ad040efe9d94597024e5 Mon Sep 17 00:00:00 2001 From: Janno Teelem Date: Fri, 11 Apr 2025 19:35:10 +0300 Subject: [PATCH 1/3] Update toolkit to default to node22 --- .../src/create-twilio-function/versions.js | 2 +- packages/plugin-serverless/README.md | 2 +- packages/serverless-api/examples/deploy.js | 2 +- packages/serverless-api/src/types/deploy.ts | 2 +- .../templating/__snapshots__/defaultConfig.test.ts.snap | 2 +- packages/twilio-run/src/checks/nodejs-version.ts | 2 +- packages/twilio-run/src/flags.ts | 2 +- packages/twilio-run/src/templating/defaultConfig.ts | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/packages/create-twilio-function/src/create-twilio-function/versions.js b/packages/create-twilio-function/src/create-twilio-function/versions.js index c2817478..cb65f86d 100644 --- a/packages/create-twilio-function/src/create-twilio-function/versions.js +++ b/packages/create-twilio-function/src/create-twilio-function/versions.js @@ -6,7 +6,7 @@ module.exports = { '@twilio/runtime-handler' ].replace(/[\^~]/, ''), twilioRun: pkgJson.dependencies['twilio-run'], - node: '18', + node: '22', typescript: '^5.3.3', serverlessRuntimeTypes: '^4.0.0', copyfiles: '^2.4.1', diff --git a/packages/plugin-serverless/README.md b/packages/plugin-serverless/README.md index 53af0726..5a906868 100644 --- a/packages/plugin-serverless/README.md +++ b/packages/plugin-serverless/README.md @@ -158,7 +158,7 @@ FLAGS --password= A specific API secret or auth token for deployment. Uses fields from .env otherwise --production Please prefer the "activate" command! Deploys to the production environment (no domain suffix). Overrides the value passed via the environment flag. - --runtime= The version of Node.js to deploy the build to. (node18) + --runtime= The version of Node.js to deploy the build to. (node22) --service-sid= SID of the Twilio Serverless Service to deploy to --silent Suppress output and logs. This is a shorthand for "-l none -o none". --to= [Alias for "environment"] diff --git a/packages/serverless-api/examples/deploy.js b/packages/serverless-api/examples/deploy.js index 0230eb46..6b6607cf 100644 --- a/packages/serverless-api/examples/deploy.js +++ b/packages/serverless-api/examples/deploy.js @@ -10,7 +10,7 @@ async function run() { const result = await client.deployProject({ ...config, overrideExistingService: true, - runtime: 'node18', + runtime: 'node22', env: { HELLO: 'ahoy', WORLD: 'welt', diff --git a/packages/serverless-api/src/types/deploy.ts b/packages/serverless-api/src/types/deploy.ts index d9404ea6..a9841843 100644 --- a/packages/serverless-api/src/types/deploy.ts +++ b/packages/serverless-api/src/types/deploy.ts @@ -44,7 +44,7 @@ type DeployProjectConfigBase = { */ overrideExistingService?: boolean; /** - * Version of Node.js to deploy with in Twilio Runtime. Can be "node18" + * Version of Node.js to deploy with in Twilio Runtime. Can be "node22" */ runtime?: string; /** diff --git a/packages/twilio-run/__tests__/templating/__snapshots__/defaultConfig.test.ts.snap b/packages/twilio-run/__tests__/templating/__snapshots__/defaultConfig.test.ts.snap index 3085b401..e72c2708 100644 --- a/packages/twilio-run/__tests__/templating/__snapshots__/defaultConfig.test.ts.snap +++ b/packages/twilio-run/__tests__/templating/__snapshots__/defaultConfig.test.ts.snap @@ -36,7 +36,7 @@ exports[`writeDefaultConfigFile default file should match snapshot 1`] = ` // "production": false /* Promote build to the production environment (no domain suffix). Overrides environment flag */, // "properties": null /* Specify the output properties you want to see. Works best on single types */, // "region": null /* Twilio API Region */, - "runtime": "node18" /* The version of Node.js to deploy the build to. (node18) */, + "runtime": "node22" /* The version of Node.js to deploy the build to. (node22) */, // "serviceName": null /* Overrides the name of the Serverless project. Default: the name field in your package.json */, // "serviceSid": null /* SID of the Twilio Serverless Service to deploy to */, // "sourceEnvironment": null /* SID or suffix of an existing environment you want to deploy from. */, diff --git a/packages/twilio-run/src/checks/nodejs-version.ts b/packages/twilio-run/src/checks/nodejs-version.ts index ff59f306..7215d352 100644 --- a/packages/twilio-run/src/checks/nodejs-version.ts +++ b/packages/twilio-run/src/checks/nodejs-version.ts @@ -1,7 +1,7 @@ import { stripIndent } from 'common-tags'; import { logger } from '../utils/logger'; -const SERVERLESS_NODE_JS_VERSION = ['16.', '18.']; +const SERVERLESS_NODE_JS_VERSION = ['18.', '20.', '22.']; export function printVersionWarning( nodeVersion: string, diff --git a/packages/twilio-run/src/flags.ts b/packages/twilio-run/src/flags.ts index 29462152..17390e2c 100644 --- a/packages/twilio-run/src/flags.ts +++ b/packages/twilio-run/src/flags.ts @@ -228,7 +228,7 @@ export const ALL_FLAGS = { } as Options, runtime: { type: 'string', - describe: 'The version of Node.js to deploy the build to. (node18)', + describe: 'The version of Node.js to deploy the build to. (node22)', } as Options, key: { type: 'string', diff --git a/packages/twilio-run/src/templating/defaultConfig.ts b/packages/twilio-run/src/templating/defaultConfig.ts index 5251b284..03b40f95 100644 --- a/packages/twilio-run/src/templating/defaultConfig.ts +++ b/packages/twilio-run/src/templating/defaultConfig.ts @@ -9,7 +9,7 @@ import { getDebugFunction } from '../utils/logger'; const debug = getDebugFunction('twilio-run:templating:defaultConfig'); -const DEFAULT_RUNTIME = 'node18'; +const DEFAULT_RUNTIME = 'node22'; function renderDefault(config: Options): string { if (config.type === 'boolean') { From 501269ae6ea94daa3c749699dda723210ca9af20 Mon Sep 17 00:00:00 2001 From: makserik <15821542+makserik@users.noreply.github.com> Date: Mon, 14 Apr 2025 11:03:07 +0300 Subject: [PATCH 2/3] Create breezy-files-float.md --- .changeset/breezy-files-float.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .changeset/breezy-files-float.md diff --git a/.changeset/breezy-files-float.md b/.changeset/breezy-files-float.md new file mode 100644 index 00000000..23f08c9e --- /dev/null +++ b/.changeset/breezy-files-float.md @@ -0,0 +1,8 @@ +--- +"@twilio-labs/serverless-api": patch +"twilio-run": patch +"create-twilio-function": patch +"@twilio-labs/plugin-serverless": patch +--- + +Update toolkit to default to node22 From ba982e46dc6755c2ae9e243d917fefce2f5599a1 Mon Sep 17 00:00:00 2001 From: Janno Teelem Date: Mon, 14 Apr 2025 12:14:50 +0300 Subject: [PATCH 3/3] Update breezy-files-float.md --- .changeset/breezy-files-float.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.changeset/breezy-files-float.md b/.changeset/breezy-files-float.md index 23f08c9e..b1eecf71 100644 --- a/.changeset/breezy-files-float.md +++ b/.changeset/breezy-files-float.md @@ -1,8 +1,8 @@ --- -"@twilio-labs/serverless-api": patch -"twilio-run": patch -"create-twilio-function": patch -"@twilio-labs/plugin-serverless": patch +"@twilio-labs/serverless-api": minor +"twilio-run": minor +"create-twilio-function": minor +"@twilio-labs/plugin-serverless": minor --- -Update toolkit to default to node22 +chore: update toolkit to default to node22