OpenFn / OpenFn/kit

describe-package: dies silently if a version number isn't passed into the specifier

Open
#129 0 comments 0 reactions 0 assignees View on GitHub

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-pavkage is 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 packageName and version as two required arguments. Maybe propagate this pattern through describe-package and even other APIs. specifier is 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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.