aws / aws-sdk-js-codemod

Codemod scripts to update AWS SDK for JavaScript APIs.
MIT No Attribution
73 stars 10 forks source link

chore: add scripts to generate map/tests #929

Closed trivikr closed 3 months ago

trivikr commented 3 months ago

Issue

The scripts were written to help automate generation of client types map and new client tests, and they were run manually

Description

Adds scripts to generate map/tests

Testing

generate:map

# The exports from index.ts were comments. Step is removed for brevity.
$ rm -rf src/transforms/v2-to-v3/config/CLIENT_TYPES_MAP.ts src/transforms/v2-to-v3/config/CLIENT_REQ_RESP_TYPES_MAP.ts

$ git status --porcelain
 D src/transforms/v2-to-v3/config/CLIENT_REQ_RESP_TYPES_MAP.ts
 D src/transforms/v2-to-v3/config/CLIENT_TYPES_MAP.ts

$ yarn generate:map

$ git status
On branch scripts-generate
nothing to commit, working tree clean

generate:tests

$ rm -rf src/transforms/v2-to-v3/__fixtures__/new-client/*

$ git status --porcelain
 D src/transforms/v2-to-v3/__fixtures__/new-client/global-import-equals.input.ts
 D src/transforms/v2-to-v3/__fixtures__/new-client/global-import-equals.output.ts
 D src/transforms/v2-to-v3/__fixtures__/new-client/global-import-star.input.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/global-import-star.output.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/global-import.input.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/global-import.output.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/global-require-property-with-name.input.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/global-require-property-with-name.output.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/global-require-property.input.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/global-require-property.output.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/global-require.input.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/global-require.output.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/service-import-deep-all.input.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/service-import-deep-all.output.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/service-import-deep-star-with-name.input.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/service-import-deep-star-with-name.output.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/service-import-deep-star.input.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/service-import-deep-star.output.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/service-import-deep-with-name.input.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/service-import-deep-with-name.output.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/service-import-deep.input.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/service-import-deep.output.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/service-import-equals-with-name.input.ts
 D src/transforms/v2-to-v3/__fixtures__/new-client/service-import-equals-with-name.output.ts
 D src/transforms/v2-to-v3/__fixtures__/new-client/service-import-equals.input.ts
 D src/transforms/v2-to-v3/__fixtures__/new-client/service-import-equals.output.ts
 D src/transforms/v2-to-v3/__fixtures__/new-client/service-import-with-name.input.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/service-import-with-name.output.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/service-import.input.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/service-import.output.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/service-require-deep-all.input.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/service-require-deep-all.output.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/service-require-deep-with-name.input.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/service-require-deep-with-name.output.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/service-require-deep.input.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/service-require-deep.output.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/service-require-with-name.input.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/service-require-with-name.output.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/service-require.input.js
 D src/transforms/v2-to-v3/__fixtures__/new-client/service-require.output.js

$ yarn generate:tests

$ git status
On branch scripts-generate
nothing to commit, working tree clean

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

changeset-bot[bot] commented 3 months ago

⚠️ No Changeset found

Latest commit: 3dd286218f169776b368b77e97715799600d449d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

github-actions[bot] commented 2 months ago

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.