Skip to content

chore: update toolkit to default to node22 #540

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
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
8 changes: 8 additions & 0 deletions .changeset/breezy-files-float.md
Original file line number Diff line number Diff line change
@@ -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
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: '18',
node: '22',
typescript: '^5.3.3',
serverlessRuntimeTypes: '^4.0.0',
copyfiles: '^2.4.1',
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-serverless/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ FLAGS
--password=<value> 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=<value> The version of Node.js to deploy the build to. (node18)
--runtime=<value> The version of Node.js to deploy the build to. (node22)
--service-sid=<value> SID of the Twilio Serverless Service to deploy to
--silent Suppress output and logs. This is a shorthand for "-l none -o none".
--to=<value> [Alias for "environment"]
Expand Down
2 changes: 1 addition & 1 deletion packages/serverless-api/examples/deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ async function run() {
const result = await client.deployProject({
...config,
overrideExistingService: true,
runtime: 'node18',
runtime: 'node22',
env: {
HELLO: 'ahoy',
WORLD: 'welt',
Expand Down
2 changes: 1 addition & 1 deletion packages/serverless-api/src/types/deploy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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. */,
Expand Down
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 = ['16.', '18.'];
const SERVERLESS_NODE_JS_VERSION = ['18.', '20.', '22.'];

export function printVersionWarning(
nodeVersion: string,
Expand Down
2 changes: 1 addition & 1 deletion packages/twilio-run/src/flags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
2 changes: 1 addition & 1 deletion packages/twilio-run/src/templating/defaultConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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') {
Expand Down