describe-package: dies silently if a version number isn't passed into the specifier
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 21
- Forks
- 23
- Avg merge
- 1d 22h
- Merged PRs (30d)
- 17
Description
Typical usage is to call describe-package.describeProject('@openfn/common@1.7.5') to get a description of the package. The adaptor-docs component uses this.
But the API is bit slippery - it just takes a specifier as a string. What does this mean? Can it include a version number? Should it?
It didn't used to matter too much but since moving to jsdelivr, if no version number is found in the specifier, this will silently fail to return anything.
There are some steps we need to take here:
- Throw an exception if no version number is provided. I think
describe-pavkageis too low level to go off looking for the latest version (which might not be what the user wants). Let's just be explicit. - Take a
packageNameandversionas two required arguments. Maybe propagate this pattern throughdescribe-packageand even other APIs.specifieris too general. This will break everything but the earlier we do it, the better.
I'm going to raise a couple of related issues in Lightning.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at describe-package.describeProject and trace its callers, including the adaptor-docs component, to understand how specifiers reach jsdelivr. Decide how the package name and version inputs should be represented, then verify that missing versions fail explicitly and that the updated API is propagated through its callers.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100