Open nicholaschiang opened 4 years ago
@nicholaschiang you want to get rid off common "package.json" ?
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.
@nicholaschiang to clarify : are we talking about "tutorbook/package.json"?
@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?
@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?
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
@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
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 thepackage.json
insrc/app
and insrc/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 onelerna bootstrap
. That should install everything you need to build (minus perhaps somedevDependencies
that should be specified in a top-levelpackage.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).