microsoft / microsoft/DefinitelyTyped-tools

Including versions that are not published to npm breaks dtslint

Open
#31 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

header-parser
Dominant language
TypeScript
Stars
423
Forks
237
Avg merge
18h 18m
Merged PRs (30d)
11

Description

When this package updates to include new versions of the typescript package, and those versions are not published to npm, it causes dtslint not to work.

For example, at the time of this writing, there is no version 3.5 or 3.6 published. However, when dtslint uses TypeScriptVersion.all to seed the generation of package.json files in the installer, those version numbers are used for the typescript dependency, and then npm install ... is run in those directories. This causes dtslint to fail with the following error:

npm ERR! notarget No matching version found for typescript@3.5
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

This is an important issue for maintainers who use dtslint to verify their type definition files. I happen to maintain @slack/web-api, which depends on dtslint for this reason. We hit this issue here: https://travis-ci.org/slackapi/node-slack-sdk/jobs/538163092.

I'm not sure where else definitelytyped-header-parser is used, so perhaps this is more of an issue for dtslint, but there were no changes in that package which directly caused this issue. Please feel free to close in favor of the issue I will create in that repo as well.

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 in src/installer.ts, especially the TypeScriptVersion.all path that generates package.json files before running npm install. Check how unpublished TypeScript versions enter those dependencies, then verify that dtslint installation no longer requests unavailable versions and completes successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.