Add the AWS SDK v3 packages a project imports

Proprietary

In each package.json that declares aws-sdk, adds the @aws-sdk/* packages its sources import once ReplaceAwsSdkV2Clients has migrated them, in the section that declares aws-sdk, and @smithy/smithy-client where a source names the generic ServiceException. Each is declared at 3.x (4.x for @smithy/smithy-client) where the lock group's oldest declared Node.js (engines.node, .nvmrc, .node-version, a Lambda runtime) runs the newest release or declares none, at the bounded range of the last releases that support it (>=3.723.0 <3.968.0 for Node.js 18), and not at all where no release does. Like it, it leaves alone every package.json of a lock group where a source stays on v2. The lock file is not regenerated by this recipe: RemoveUnusedAwsSdkV2Dependency regenerates it where it removes aws-sdk, and elsewhere the package manager's install has to.

org.openrewrite.node.migrate.aws-sdk-v3.add-aws-sdk-v3-dependencies

Optional

The version range to declare for each added @aws-sdk/* package. A lock group whose oldest declared Node.js can't run the newest release it admits is left on v2.

mod run . --recipe=org.openrewrite.node.migrate.aws-sdk-v3.add-aws-sdk-v3-dependencies

Install it once, then run it on every repository under the current directory. New to the Moderne CLI? Set it up.