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

Use export assignment #373

Merged
merged 4 commits into from
Aug 9, 2019
Merged

Use export assignment #373

merged 4 commits into from
Aug 9, 2019

Conversation

G-Rath
Copy link
Collaborator

@G-Rath G-Rath commented Aug 9, 2019

@SimenB I probably spent more time than I should, but hey least I know a lot more about babel :D

I'll make a PR into jest soon, once I've convinced my laptop to play nice (and once I've figured out how to install the package...).

@G-Rath G-Rath requested a review from SimenB August 9, 2019 01:43
yarn.lock Outdated Show resolved Hide resolved
@SimenB SimenB merged commit 9653c2b into master Aug 9, 2019
@SimenB SimenB deleted the use-export-assignment branch August 9, 2019 12:46
@G-Rath
Copy link
Collaborator Author

G-Rath commented Aug 10, 2019

@SimenB would you be able to recommend a good look to learn how to do mono-repos to make a PR for this into jest?

I've gotten the repo forked & setup locally, w/ all but two tests passing, but I've never worked w/ a mono-repo before, & jest is a big one 😬

I'm keen to make the PR myself, as I'm wanting to take a crack at 8330 after I've finished the TS conversation here (as a bit of a "break" before jumping into the open issues here).

@SimenB
Copy link
Member

SimenB commented Aug 10, 2019

A monorepo isn't anything super special, and contributing.md should have the details on how to work with the code base. I don't know of any guides or blog posts, so I guess my googling would be as good as yours 🙂 Any particular questions?

w/ all but two tests passing

If those are for mercurial (hg), don't worry about them. They fail for me as well. I think you need some specific version of mercurial installed, but I haven't bothered to look into it

@G-Rath
Copy link
Collaborator Author

G-Rath commented Aug 10, 2019

A monorepo isn't anything super special, and contributing.md should have the details on how to work with the code base

Yeah, I've got it all setup & working, but the one thing contributing.md doesn't covert is adding new packages:

g-rath@CINDY:/c/Users/G-Rath/workspace/projects-oss/jest$ yarn add -D babel-plugin-replace-ts-export-assignment
yarn add v1.17.3
error Running this command will add the dependency to the workspace root rather than the workspace itself, which might not be what you want - if you really meant it, make it explicit by running this command again with the -W flag (or --ignore-workspace-root-check).
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

I saw that and decided to bail for now, in favor of reading up on how dependencies are handled in monorepos.

So that's pretty much my main question: how do I add new dependencies?

If those are for mercurial (hg), don't worry about them

They were, which is exactly why I ignored them 😄 I figured if they were really failing outside my environment, someone would already be handling it.

@SimenB
Copy link
Member

SimenB commented Aug 10, 2019

Aha! Yeah, just do what the error suggests, add the -W flag 🙂

@G-Rath
Copy link
Collaborator Author

G-Rath commented Aug 10, 2019

Cheers, worked as expected - I'm now running the 8min+ test suite 😬

I'll carry on working on this stuff while pondering if I should have called it babel-plugin-typescript-replace-export-assignment 😕


Just to complete my knowledge: Since packages don't have their own lock files, am I correct in thinking that adding a dep in a "package" works by the normal npm i/yarn add, which lerna intercepts & redirects/applies/magically-teleports into the root lock file?

@SimenB
Copy link
Member

SimenB commented Aug 10, 2019

You must use yarn, but yeah, it's added to the root lockfile. This is because we use yarn workspaces: https://yarnpkg.com/lang/en/docs/workspaces/. Jest uses lerna for publishing, not for dependency management 🙂

@SimenB
Copy link
Member

SimenB commented Aug 12, 2019

🎉 This PR is included in version 22.15.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants