Skip to content

feat: upgrade twilio v5, use peer deps, enhance tooling #541

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 1 commit into
base: main
Choose a base branch
from

Conversation

mikefaille
Copy link

@mikefaille mikefaille commented Apr 18, 2025

Upgrades core Twilio dependencies to v5.5.2 across the workspace. Resolves associated type conflicts using peer dependencies. Includes enhancements for create-twilio-function and twilio-run.

Dependency & Type Alignment:

  • Upgraded twilio dependency to 5.5.2 in runtime-handler.
  • Changed twilio from a direct dependency to a peerDependency (^5.5.2) in serverless-runtime-types and twilio-run.
  • This enforces the use of the single root twilio instance, resolving type identity conflicts (TS2322/TS2352).
  • Updated type definitions within serverless-runtime-types (types.d.ts) to align with [email protected], primarily using ClientOpts.
  • Added compatibility export ClientOpts as TwilioClientOptions.
  • Updated @twilio/test-dep alias to npm:[email protected].
  • Added root-level peerDependency for twilio for workspace checks.

Package Enhancements:

Requires a clean install (removing node_modules and lockfile) after merging.

Contributing to Twilio

All third-party contributors acknowledge that any contributions they provide will be made under the same open-source license that the open-source project is provided under.

  • I acknowledge that all my contributions will be made under the project's license.

Copy link

changeset-bot bot commented Apr 18, 2025

🦋 Changeset detected

Latest commit: 7b904fb

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 5 packages
Name Type
@twilio-labs/serverless-runtime-types Major
twilio-run Major
create-twilio-function Minor
@twilio/runtime-handler Minor
@twilio-labs/plugin-serverless Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@mikefaille
Copy link
Author

On my project I have a conflict between twilio-labs/serverless-runtime-types and twilio:5
This will solve this issue for everyones who want to use twilio functions using node-twilio:5

@mikefaille mikefaille force-pushed the fix/twilio-dependency-conflict branch from 6c26ece to 26353ae Compare April 20, 2025 10:11
WHAT:
- Upgraded the core `twilio` Node.js helper library to v5.5.2 across
  relevant packages (`runtime-handler`, `create-twilio-function` defaults,
  test dependencies).
- Changed `@twilio-labs/serverless-runtime-types` and
  `@twilio-labs/twilio-run` to declare `twilio` as a `peerDependency`
  (^5.5.2) instead of a direct dependency.
- Updated internal type definitions (`ClientOpts`) for compatibility with
  `[email protected]`.
- Updated Twilio Console URL generation logic in `twilio-run`.
- Updated default dependencies (`typescript`, `serverlessRuntimeTypes`) used
  by `create-twilio-function`.

WHY:
- Aligns the toolkit with the latest Twilio SDK features, improvements, and
  security updates available in v5.
- Resolves potential version conflicts and type mismatches (e.g.,
  TS2322/TS2352) by ensuring a single `twilio` instance is used, managed
  explicitly by the consuming project. This promotes a more stable and
  predictable dependency graph.

BREAKING CHANGE:
Consumers of `@twilio-labs/twilio-run` or projects directly importing
types from `@twilio-labs/serverless-runtime-types` MUST now explicitly
install `twilio` as a direct dependency in their own project.

Add the `twilio` dependency:
```bash
npm install twilio@^5.5.2 --save-dev
yarn add twilio@^5.5.2 --dev
```
@mikefaille mikefaille force-pushed the fix/twilio-dependency-conflict branch from 26353ae to 7b904fb Compare April 20, 2025 10:15
@mikefaille
Copy link
Author

That will fix this issue:
#521

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant