Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[esinstall] add type-only package handling #1133

Merged
merged 1 commit into from
Sep 26, 2020

Conversation

FredKSchott
Copy link
Owner

Changes

Testing

  • Improv test to catch this (previously swallowed by our "nothing to install" error handling).

@FredKSchott FredKSchott requested a review from a team as a code owner September 26, 2020 00:37
@vercel
Copy link

vercel bot commented Sep 26, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/pikapkg/snowpack/fej2ptglz
✅ Preview: https://snowpack-git-esinstall-dts-package-handling.pikapkg.vercel.app

| {
type: 'DTS';
loc: undefined;
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

importMap.imports[installSpecifier] = `./${proxiedName}`;
} else if (resolvedResult.type === 'DTS') {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻 This is clean!

importMap.imports[installSpecifier] = `./${proxiedName}`;
} else if (resolvedResult.type === 'DTS') {
// This is fine! Skip type-only packages
logger.debug(`[${installSpecifier}] target points to a TS-only package.`);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏻

@@ -11298,19 +11298,61 @@ const foo = 'bar';
export { foo };"
`;

exports[`snowpack install dep-types-only: allFiles 1`] = `
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

@drwpow drwpow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! This is much needed

@FredKSchott FredKSchott merged commit 95857f0 into master Sep 26, 2020
@FredKSchott FredKSchott deleted the esinstall-dts-package-handling branch September 26, 2020 01:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants