Skip to content
New issue

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

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

Already on GitHub? # to your account

fix: npm ignore __tests__ & stories #1161

Merged
merged 8 commits into from
Jul 27, 2021
Merged

fix: npm ignore __tests__ & stories #1161

merged 8 commits into from
Jul 27, 2021

Conversation

andykenward
Copy link
Contributor

@andykenward andykenward commented Apr 13, 2021

When compiling dist:transpile:cjs or dist:transpile:esm babel is including the folders __tests__ & stories in the output. But we don't want to publish those files to npm. Adding those folders to ignore in the package.json files array should solve this.

@changeset-bot
Copy link

changeset-bot bot commented Apr 13, 2021

⚠️ No Changeset found

Latest commit: 80be3a8

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Apr 13, 2021

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/primer/primer-components/5iKn8hDHSZGDVeDF7UCQHFTesfR6
✅ Preview: https://primer-components-git-fork-andykenward-babel-buil-5a92af-primer.vercel.app

@vercel vercel bot temporarily deployed to Preview April 13, 2021 20:34 Inactive
@colebemis
Copy link
Contributor

Thanks for the PR, @andykenward ❤️ Could you elaborate on what you mean by "dist:types is generating type definitions for the same folders"?

@vercel vercel bot temporarily deployed to Preview April 16, 2021 18:27 Inactive
@andykenward
Copy link
Contributor Author

Sorry, I deleted the scripts dist:types by mistake.

But I mean't that when you run yarn dist:types it generates TypeScript definitions for the __tests__ & stories folders. Which seems pointless.

CleanShot 2021-04-16 at 19 29 17@2x
CleanShot 2021-04-16 at 19 29 47@2x

@colebemis
Copy link
Contributor

Ah, I see. We do want to type check the tests and the stories but we ignore those files when publishing to npm: https://github.com/primer/components/blob/3af005c6ec7d0900cc46728d5c725887bf7ba57c/package.json#L41-L42

@andykenward
Copy link
Contributor Author

Ah, I see. We do want to type check the tests and the stories but we ignore those files when publishing to npm:

https://github.com/primer/components/blob/3af005c6ec7d0900cc46728d5c725887bf7ba57c/package.json#L41-L42

Perhaps also add the compiled stories folder to be ignored too, as this is only for storybookjs?

 "!lib/stories", 
 "!lib-esm/stories" 

@vercel vercel bot temporarily deployed to Preview April 17, 2021 09:02 Inactive
@colebemis
Copy link
Contributor

@andykenward Great idea!

When compiling `dist:transpile:cjs` or `dist:transpile:esm` the folders `__tests__` & `stories` were included.
@vercel vercel bot temporarily deployed to Preview June 18, 2021 21:07 Inactive
@vercel vercel bot temporarily deployed to Preview June 18, 2021 22:30 Inactive
@andykenward
Copy link
Contributor Author

@colebemis Sorry in the delay in this pull request. I've made the discussed changes.

@vercel vercel bot temporarily deployed to Preview June 25, 2021 08:59 Inactive
@andykenward andykenward changed the title fix: cli dist babel ignore __tests__ & stories fix: npm ignore __tests__ & stories Jun 25, 2021
@vercel vercel bot temporarily deployed to Preview June 25, 2021 09:01 Inactive
@vercel vercel bot temporarily deployed to Preview June 27, 2021 10:01 Inactive
@vercel vercel bot temporarily deployed to Preview July 24, 2021 09:20 Inactive
Copy link
Contributor

@colebemis colebemis left a comment

Choose a reason for hiding this comment

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

🚀

@colebemis colebemis enabled auto-merge (squash) July 27, 2021 21:55
@colebemis colebemis merged commit ddb2aed into primer:main Jul 27, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants