Skip to content
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

chore: add scripts to generate map/tests #929

Merged
merged 1 commit into from
Aug 7, 2024
Merged

chore: add scripts to generate map/tests #929

merged 1 commit into from
Aug 7, 2024

Conversation

trivikr
Copy link
Member

@trivikr trivikr commented Aug 7, 2024

Issue

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

  • yarn tsx scripts/generateClientTypesMap
  • yarn tsx scripts/generateNewClientTests

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.

@trivikr trivikr requested a review from a team as a code owner August 7, 2024 14:55
Copy link

changeset-bot bot commented Aug 7, 2024

⚠️ No Changeset found

Latest commit: 3dd2862

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

@trivikr trivikr merged commit 07e2379 into main Aug 7, 2024
6 checks passed
@trivikr trivikr deleted the scripts-generate branch August 7, 2024 15:07
Copy link
Contributor

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant