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

Need Monorepo support #308

Closed
kunyan opened this issue Dec 19, 2021 · 3 comments
Closed

Need Monorepo support #308

kunyan opened this issue Dec 19, 2021 · 3 comments

Comments

@kunyan
Copy link

kunyan commented Dec 19, 2021

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

  1. Clone the repo and set the contextDir to foo.
  2. Run npm run build, however, some dependencies only installed in root, so we will got error

2. Hack the build scripts

  1. Clone the repo from root
  2. Install all dependencies, and add post install to install all dependencies in child packages
  3. 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

@KrisLamote
Copy link

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.

@zmiklank
Copy link
Contributor

Hi @kunyan, do you consider this issue fixed by #424 being merged?

@kunyan
Copy link
Author

kunyan commented Apr 17, 2024

@zmiklank $NPM_BUILD is a good for some monorepo use nx or lerna

@kunyan kunyan closed this as completed Apr 17, 2024
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

No branches or pull requests

3 participants