You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Monorepo is becoming more and more popular repo style in Node.js ecosystem.
It support the developers could arrange the packages as they want and link them together.
The current s2i steps looks not support monorepo. I can show some example which I met
the monorepo folders are like this
packages/
foo/
src/
README.md
package.json
bar/
src/
README.md
package.json
.eslintrc
package.json
Some common devDependencies had been install to the root package.json. like eslint, typescript and others
So the foo and bar won't need to install them.
If I need build the foo only, For current s2i workflow, I have 2 choice.
1 Use git contextDir
Clone the repo and set the contextDir to foo.
Run npm run build, however, some dependencies only installed in root, so we will got error
2. Hack the build scripts
Clone the repo from root
Install all dependencies, and add post install to install all dependencies in child packages
Add some env vars to make build script could detect which package I want to build
Solution
I think the only way to fix this issue for now is make the build command to a env vars. make user could custom it(Like $NPM_RUN)
Add a $NPM_BUILD might be the most easy way to resolve it
The text was updated successfully, but these errors were encountered:
I was kindof assuming that the NPM_RUN env var would be doing that. iow if present run an alternative build script during openshift Build and running an alternatif start script for the openshift Deploy. But this indeed doesn't seem to be the case.
Monorepo is becoming more and more popular repo style in Node.js ecosystem.
It support the developers could arrange the packages as they want and link them together.
The current s2i steps looks not support monorepo. I can show some example which I met
the monorepo folders are like this
Some common devDependencies had been install to the root package.json. like eslint, typescript and others
So the
foo
andbar
won't need to install them.If I need build the
foo
only, For current s2i workflow, I have 2 choice.1 Use git contextDir
contextDir
tofoo
.npm run build
, however, some dependencies only installed in root, so we will got error2. Hack the
build
scriptspackages
build
script could detect which package I want to buildSolution
I think the only way to fix this issue for now is make the
build
command to a env vars. make user could custom it(Like $NPM_RUN)Add a $NPM_BUILD might be the most easy way to resolve it
The text was updated successfully, but these errors were encountered: