Giter Site home page Giter Site logo

Comments (6)

pvdlg avatar pvdlg commented on July 19, 2024

semantic-release-monorepo is not our project and we can't help with it.
At that point monorepo are not supported by semantic-release. See semantic-release/semantic-release#193 (comment). As explained over there semantic-release-monorepo doesn't support all monorepo scenario (namely commits triggering a release on one of the repo that is out of range for another repo) and therefore is not a solution we intend to support.

If you want to configure the tag or registry properties for multiple repo then you should use an .npmrc file in the parent directory.

This plugin rely on the npm CLI and the standard npm mechanism to retrieve configuration properties. All the npm properties should be handled via the standard npm configuration (.npmrc or package.json). The plugin options are reserved for things related to semantic-release or the release process.

I'm going to close this issue as the .npmrc is the recommended approach and there is no plans to accommodate to semantic-release-monorepo. If monorepo are eventually supported by semantic-release it would most likely be via an integration with Lerna as discussed in semantic-release/semantic-release/issues/193.

from npm.

FezVrasta avatar FezVrasta commented on July 19, 2024

Thanks for the reply, from my tests, your suggestion doesn't work.

My npmrc file defines the registry for the scope of my packages (@mycompany), and when I try to publish, it tries to use the public npm registry.
Maybe what you say could work if I defined the top level registry registry = xxx rather than @mycompany:registry = xxx, but this is not what I'm looking for.

I don't see why you should take actions to go against semantic-release-monorepo. I understand you don't want to actively support it, but if people are willing to contribute to your projects to improve its support what's wrong with it?

from npm.

FezVrasta avatar FezVrasta commented on July 19, 2024

After further tests, it seems to work only if the .npmrc file is in the same directory of the package that is being published. So I can't have a single .npmrc in the root of my monorepo and have all the packages read it.

My PR would be extremely useful.

For now I published my fork as semantic-release-monorepo-npm for anyone that may need this.

from npm.

pvdlg avatar pvdlg commented on July 19, 2024

We use registry-auth-token to retrieve the registry configuration in lib/get-registry.js.
I checked and I can confirm that it retrieve the config from the first .npmrc file it find, starting from cwd and going up the directory tree.

If you have publishConfig.registry in your package.json that take precedence over any .npmrc file.

registry-auth-token relies on rc to read the .npmrc. There is the bug dominictarr/rc#101 which create an issue if you read the config multiple time from different directory. Maybe it has an impact.

Regarding semantic-release-monorepo, as explained in semantic-release/semantic-release#193 it's not a solution that allow to fully support monorepo. If we support monorepo in semantic-release we would do it properly and we would cover every cases. As with any project, accepting PR for new features implies to support them on the long run. That mean maintaining the code and supporting users. We don't want to take on that additional work load for a solution that is partial at best.
Actually in the last few weeks we had a large part of the issues open on semantic-release repos related to semantic-release-monorepo even though it's not our project and we don't support it.

That said, as mentioned in semantic-release/semantic-release#193 we are open to fully support monorepo and we'll happily accept contribution under the circumstances explained over there, basically a solution that will provide a full support and that would rely on Lerna rather than re-implementing Lerna features in semantic-release.

from npm.

FezVrasta avatar FezVrasta commented on July 19, 2024

Thanks for the reply, my PR was a 2 lines change, I doubt that would have added so much complexity to the codebase.

Anyway, the fork works just fine, I'll try to keep it up to date with this repo.

from npm.

pvdlg avatar pvdlg commented on July 19, 2024

Well, just as a for info, the PR was really incomplete anyway, it would have miss:

  • documentation
  • tests
  • Handling priorities for all combination of .npmrc, package.json and semantic-release in a sub-project and in the parent directory
  • Handling all of those combination with the currentpkgRoot option

Handling all those case would have resulted in a way more complex changes. In addition, in the future we would have to make sure the config resolution for the registry is identical to the npm CLI resolution. So implementing that properly is not as simple as your 2 lines changes would suggest.

from npm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.