dethcrypto / dethcrypto/eth-sdk
Allow custom package name & version for the generated sdk
- Dominant language
- JavaScript
- Stars
- 428
- Forks
- 45
- PR merge metrics
- No merged PRs in 30d
Description
As _Originally reported by @johanneskares in https://github.com/dethcrypto/eth-sdk/issues/102#issuecomment-1130059542_, the generated package is not compatible with yarn workspaces:
> Now I can include it as depdendency in my monorepo. Only problem is, I manually have to change the name of the generated package, because `yarn` doesn't like the name of the package `.dethcrypto/eth-sdk-client` in `package.json`. When I do
>
> ```
> yarn workspace my-package add .dethcrypto/eth-sdk-client
> ```
>
> I get `Usage Error: The .dethcrypto/eth-sdk-client string didn't match the required format (package-name@range). Did you perhaps forget to explicitly reference the package name?`
>
> When I manually edit it to `dethcrypto-eth-sdk-client-generated`, everything works fine.
Customizing the generated package `name` in the config would solve this.
Also, to use it as a standalone package in a monorepo setup - which is great if you're going to use the sdk in both the backend and front-end - it needs a `version`, which could either be included as a static field in the configuration, or initialized to a configurable value and then dynamically incremented in subsequent updates
The way it works today, I have to rewrite the sdk's `package.json` every time I update it
Contributor guide
Research direction
Start by locating the configuration handling and the generated package.json, then trace how the package name is currently assigned. Define how configurable name and version values should be emitted, and verify that the generated package works as a standalone workspace dependency without manual package.json edits.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, typescript
- Domain
- developer-experience, tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100