React-native-web: Lerna monorepo

Created on 26 Sep 2017  路  10Comments  路  Source: necolas/react-native-web

Lerna monorepo will help manage the main package, babel plugin, benchmarks, docs, and future work

Most helpful comment

Just specify those in your workspaces, but be sure to have a "private: true" in your package.json for each examples, so bump are made automatically but nothing never gets published.

All 10 comments

If you haven't already, I recommend taking a look at Yarn workspaces.

If you want to use Yarn workspaces there is a library called boltpkg, which can use Yarn workspaces, and does have equal features to Lerna.

See https://github.com/boltpkg/bolt.

FYI, you can use lerna AND yarn workspaces. Lerna will help for publising, yarn workspace don't handle that. I am using lerna with yarn workspaces in https://github.com/phenomic/phenomic

See https://github.com/phenomic/phenomic/blob/f1fa0950af78077e6d59126df034a4e3daf03983/lerna.json#L5-L6

I tried using Lerna and I don't get how to link the packages within the monorepo, or what the "lerna workflow" is meant to look like. The project docs are all API-focused, and not workflow focused. Also had a look at how pouchdb does it, which seems alright too https://github.com/pouchdb/pouchdb

You should try yarn workspaces feature (since you have a yarn lock file).
You just have to enable it (via the config) and then do "yarn" at the root of the repo. yarn handles the magic. Just be sure that each packages define their deps correctly (otherwise no link). Eg: https://github.com/phenomic/phenomic/blob/206737df86f4f20a045fc489feb60903ce5fa435/packages/preset-react-app/package.json#L27-L35

Do you still have to manually manage the dependencies field or do those versions get automatically updated each time you bump the monorepo's top-level version?

This thing can be managed by lerna on publish. Lerna is good for that.

Hi, I'm a little late but may I kindly ask, how about phenomic's example folder, do you handle its dependencies manually? What I mean is when there's a new version of your packages, on lerna publish or bootstrap, are example apps dependencies automatically updated? Thanks a lot!

Just specify those in your workspaces, but be sure to have a "private: true" in your package.json for each examples, so bump are made automatically but nothing never gets published.

@MoOx Works like a charm! thanks a lot!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MovingGifts picture MovingGifts  路  3Comments

ricklove picture ricklove  路  3Comments

necolas picture necolas  路  3Comments

iksent picture iksent  路  3Comments

SamyPesse picture SamyPesse  路  3Comments