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

Set up monorepo with lerna #92

Closed
wants to merge 3 commits into from
Closed

Set up monorepo with lerna #92

wants to merge 3 commits into from

Conversation

paulmelnikow
Copy link
Collaborator

@paulmelnikow paulmelnikow commented Oct 31, 2017

I took a stab at this. Wasn't too bad. Let me know if you have questions!

Todo

  • Update developer documentation

@Fishbowler
Copy link
Collaborator

Got this set up, but how does it work in practice? How do I require it in a project? Lerna docs seem thin on this.
What changes are required to plugins to make them work?

@paulmelnikow
Copy link
Collaborator Author

This doesn't affect the way you use the library or its plugins, since right now there is only the one package called icedfrisby. This will make it easy for us to split out icedfrisby-joi, though that hasn't happened yet.

The main repo postinstall script will go install dependencies in all the subprojects. Being new to this, I'm not sure what else there is to document…

@Fishbowler
Copy link
Collaborator

I mean that when I change my dependencies to include

"icedfrisby": "git+ssh://git@github.com/IcedFrisby/IcedFrisby.git#lerna",

then run my tests that begin

const frisby = require('icedfrisby')

I get Error: Cannot find module 'icedfrisby'. My node-modules has icedfrisby-monorepo with a packages folder containing icedfrisby. What changes are needed to use this in a real test project?

@paulmelnikow
Copy link
Collaborator Author

I gotcha – you're wanting to use it through vcs. I'm not totally sure, to be honest, that's a good question.

Out of curiosity, are vcs links like that something you typically commit, or just use locally?

@Fishbowler
Copy link
Collaborator

Fishbowler commented Dec 7, 2017 via email

@paulmelnikow
Copy link
Collaborator Author

Yea, when it's published it should work just like before.

Have you tried using npm link for your local testing? It is pretty flaky, but usually I end up getting it to work. You could also try using a local module, which might be a better bet.

@paulmelnikow
Copy link
Collaborator Author

If you're able to get the local module working, feel free to push some doc to this branch, or let me know and I can add it.

I'm eager to get this in!

@Fishbowler
Copy link
Collaborator

Every method still ends up with that same folder structure of icedfrisby-monorepo\packages\icedfrisby, and fails the require('icedfrisby')

npm link docs even say

Note that package-name is taken from package.json, not from directory name.

https://docs.npmjs.com/cli/link

Maybe we should npm publish as another tag and try from there?

@paulmelnikow
Copy link
Collaborator Author

Did you try running npm link from inside packages/icedfrisby? Or using local with that path?

@Fishbowler
Copy link
Collaborator

If I link to the package, the diff is pretty a reliable indicator that this will work. Is there a way we can test that the lerna config is gonna work?

Gut feel to progress is that we need to be confident in 2.0a1 and merge this in and make it 2.0a2. I'll start taking a look at a1 now.

@Fishbowler
Copy link
Collaborator

I've already spotted one thing though - I can't use eslint in the repo as it stands. The monorepo package doesn't have the lint command, and the subpackage doesn't have a reference to eslint. Not sure what the preference for this is?

@Fishbowler
Copy link
Collaborator

All of the 2.0a1 unit tests pass, the docs look good, and my work repo of ~250 checks (inc ones with plugins) all run fine using 1.5 and 2.0a1.

@paulmelnikow
Copy link
Collaborator Author

I've been switching from Greenkeeper to Dependabot on other projects and have found it much more reliable, especially for dealing with lockfiles.

Dependabot now supports Lerna:

https://dependabot.com/blog/lerna-support/

paulmelnikow added a commit that referenced this pull request Jul 3, 2020
@paulmelnikow
Copy link
Collaborator Author

Gonna close this for now.

@paulmelnikow paulmelnikow deleted the lerna branch July 3, 2020 17:50
paulmelnikow added a commit that referenced this pull request Jul 3, 2020
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.

None yet

2 participants