diff --git a/.changeset/breezy-files-float.md b/.changeset/breezy-files-float.md new file mode 100644 index 00000000..b1eecf71 --- /dev/null +++ b/.changeset/breezy-files-float.md @@ -0,0 +1,8 @@ +--- +"@twilio-labs/serverless-api": minor +"twilio-run": minor +"create-twilio-function": minor +"@twilio-labs/plugin-serverless": minor +--- + +chore: update toolkit to default to node22 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') {