Skip to content

Option to generate npm pacakges with package.json version matching smithy/aws-sdk client versions #1870

@everett1992

Description

@everett1992

Even with the recent changes to codegen to produce clients that depend on ^ ranges, it's a good idea to match the version of all the clients a consumer depends on. @aws-sdk/ clients are published together, so it's easy to match @aws-sdk/clients-s3 and @aws-sdk/clients-ec2.

I'd like an option in smithy-build.json to set the generated package.json version matching the smithy/aws-sdk ecosystem.
I've been implementing this feature in my own packages with a script that updates the version based on the version of @aws-sdk/types, but it's not going to be accurate.

          "packageJson": {
	            "scripts": {
	              "prepare": "npm pkg set version=$(npx -y semver -c \"$(npm pkg get 'dependencies.@aws-sdk/types')\")"
	            }
	          }

Another part of this feature request that I haven't solved myself is how to version model changes when there haven't been any codegen changes. I'd still want the version to be close to smithy's, and I wouldn't want it to conflict with future smithy versions.
I think I could use a timestamp for the patch version.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions