Skip to content
This repository has been archived by the owner on Feb 18, 2022. It is now read-only.

Work around npm pack issue with scoped packages #47

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

noahtallen
Copy link

Resolves #46

Currently, it is not possible to run npm test @namespace/package locally for DefinitelyTyped (see DefinitelyTyped/DefinitelyTyped#56042). The error is a bug in npm, where it gives the incorrect filename for packed packages:

# Reported filename:
npm pack @wordpress/data-controls
# npm notice filename:      @wordpress/data-controls-2.2.6.tgz

# Actual filename:
ls
# wordpress-data-controls-2.2.6.tgz

Specifically, npm strips the leading @ and removes the / for the file it saves, but doesn't apply those changes to the filename it reports.

Dts critic relies on npm pack's reported filename. To work around this problem, if the downloaded tarball can't be found, we do the string replacement ourselves as a backup.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fails to unpack the source package with scoped package
1 participant