Skip to content

Replace all hyphens in adapter name with underscore#730

Merged
dskloetc merged 1 commit intomainfrom
kloet/all-underscores
Mar 31, 2026
Merged

Replace all hyphens in adapter name with underscore#730
dskloetc merged 1 commit intomainfrom
kloet/all-underscores

Conversation

@dskloetc
Copy link
Copy Markdown
Contributor

Description

When using yarn new in external-adapters-js to create a new adapter, if the adapter name has a hyphen in it, this hyphen gets replaced with an underscore, as well as the letter turned to upper case, to determine the name of the adapter object.

See for example "generic-api" became "GENERIC_API".

But if the name has multiple hyphens, only the first one gets replaced by an underscore and we need to fix this manually, which sometimes is forgotten. For example "bitgo-reserves-test" became "BITGO_RESERVES-TEST".

Changes

Fix the template code to call replaceAll instead of replace.

Testing

In external-adapters-js:

  1. Use these instructions to point packages/scripts/package.json to the local framework repo with the fix.
  2. Run yarn new and follow the instructions.
  3. Create an adapter with name aa-bb-cc-dd.
  4. Inspect the contents of packages/sources/aa-bb-cc-dd/src/index.ts

@dskloetc dskloetc marked this pull request as ready for review March 31, 2026 10:27
@dskloetc dskloetc requested a review from a team as a code owner March 31, 2026 10:27
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Mar 31, 2026

NPM Publishing labels 🏷️

🔵 This PR has the none label set and it will not cause a version bump.

@dskloetc dskloetc merged commit 8ea1beb into main Mar 31, 2026
18 of 19 checks passed
@github-actions
Copy link
Copy Markdown
Contributor

🚀 Successfully created version bump PR: #707

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants