Skip to content
This repository has been archived by the owner on May 20, 2020. It is now read-only.

Configure deps better using Lerna #261

Open
nicholaschiang opened this issue Mar 28, 2020 · 7 comments
Open

Configure deps better using Lerna #261

nicholaschiang opened this issue Mar 28, 2020 · 7 comments
Labels
category:dev-ops help wanted Extra attention is needed. priority:p2 type:task Tasks are the actions that make up epics.

Comments

@nicholaschiang
Copy link
Member

Right now we have some dependencies that are shared across sub-packages contained in the package.json in their top level directories (e.g. firebase is listed as a dependency in the package.json in src/app and in src/site).

We want to move everything to each sub-package (i.e. duplicate dependencies that are hoisted automatically with Lerna). See Lerna's best practices for more information.

One way to test if you've successfully completed what I want here is to remove all of our node_modules directories and run one lerna bootstrap. That should install everything you need to build (minus perhaps some devDependencies that should be specified in a top-level package.json).

Also note that this gets a little bit more difficult with David because we want to be able to track that all of our deps are up to date (in every sub-package).

@nicholaschiang nicholaschiang added help wanted Extra attention is needed. and removed status:not-started labels Mar 28, 2020
@OrkhanHuseynli
Copy link

@nicholaschiang you want to get rid off common "package.json" ?

@nicholaschiang
Copy link
Member Author

Yup @OrkhanHuseynli! We want to get rid of all the dependencies in the common package.json but we'll have to keep the devDependencies to support webpack and such.

@OrkhanHuseynli
Copy link

OrkhanHuseynli commented Mar 29, 2020

@nicholaschiang
to clarify :
are we talking about "tutorbook/package.json"?

@nicholaschiang
Copy link
Member Author

@OrkhanHuseynli The tutorbook/package.json file is just a copy of the src/app/package.json (for David's nice README badge). The idea here is to move all of our deps to the individual sub-package package.json files and then to somehow automatically aggregate those deps into one root package.json that is only used for our README badge.

Does that make sense?

@OrkhanHuseynli
Copy link

@nicholaschiang hmm.....
when you say individual, do you mean
move from src/app/package.json
to (for instance)
src/app/ads/package.json
src/app/analytics/package.json
and so on

by aggregate you mean, copy deps defined in packages.json to the common package.json?
or to copy installed node packages in each package to the common node_packages?

@nicholaschiang
Copy link
Member Author

nicholaschiang commented Mar 29, 2020

Yup, for individual you're correct!

But for aggregate, we want the first option you described:

by aggregate you mean, copy deps defined in packages.json to the common package.json?

Because the only point of that file is to check if all of our deps are up to date.

Also, Lerna can automatically hoist shared dependencies to a top-level node_modules folder by running:

$ lerna bootstrap --hoist

@OrkhanHuseynli
Copy link

@nicholaschiang thanks
I will take a look tomorrow, as it is a late night already in Prague.
I put this task to To-Do list, just in case if someone can pick this up and fix quickly in Americas

@OrkhanHuseynli OrkhanHuseynli removed their assignment Mar 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
category:dev-ops help wanted Extra attention is needed. priority:p2 type:task Tasks are the actions that make up epics.
Projects
None yet
Development

No branches or pull requests

2 participants