Choose the right version of Decidim's package.json#8119
Choose the right version of Decidim's package.json#8119
Conversation
|
@ahukkanen I can't add you as a reviewer, but it would be great if you can check this PR. Thanks! ❤️ |
|
@leio10 I think a better approach would be to release the If you want to go without releasing the dependency to NPM, I think the changes look fine. |
My concern is related to versioning if that list of dependencies changes: if you are running Decidim 0.25.1, but the stable version of Regarding the NPM package, it is possible to do it with a new PR over this one, but it won't be needed if you create a tag with every release. I like the idea to publish an NPM package with each version, but it would imply extra work during the release process, so we can discuss about it to decide if it worth it or not. |
OK, understood the reasoning.
The only thing that I'm worried about with the git repository approach is that it is extremely slow as it copies the whole repository under That's the only reason why I'd like to have a faster installation method. But yes, I understand it is a balance for the ease of maintenance. I'm just seeing that eventually something would have to be released to NPM. E.g. at #8115 I implemented something in the |
|
@ahukkanen ok, speed is a excelent reason to publish an NPM package, so we should include it on the release process 👍 |
|
@ahukkanen I like your approach (I'd just name the |
It's changed now.
With NPM, there is no solution right now other than rolling back to NPM v6 as mentioned in the issue. They discussed about it in the open RFC meeting (linked in that issue) but there was no resolution to this. I also tried with Yarn 2.1+ which does support installing single packages from a Yarn workspace at GitHub but it has the same problem that it does not install the subsequent dependencies of the workspace packages. |
@leio10 Regarding this point, yes I think that would be the case with pull requests. But as mentioned at #8121, I'm not trying to propose moving all assets to NPM, just the dependencies right now and possibly some support stuff (e.g. that would be useful in #8115). I think the situation would be comparable to the current situation if someone wants to update anything in the |
|
@ahukkanen I was able to make this work using |
| coverage/ | ||
| decidim_app-design/ | ||
| docs/ | ||
| development_app/ No newline at end of file |
There was a problem hiding this comment.
I think you could just add an empty files field in the package.json to avoid including everything in the NPM package.
I think the package does not really have to include anything else than the dependencies at this point.
There was a problem hiding this comment.
That's much better, thanks! ❤️
|
@leio10 LGTM, just left one comment above. I think I figured out a way to avoid packing the NPM packages at #8121 but let's merge this one first. In #8121 I applied the same principle that you applied here:
With the local reference, the "linked" package's |
Mm, ok, so one option would be to copy it into an app subfolder as |
Yes, that's exactly what I did at #8121. The downside is still that this needs to be replicated to the design app too because of the root webpacker spec that ensures the I really hope they would find a solution to npm/cli#2339 which would allow avoiding such problems. It's a real headache with the local references. |
|
@ahukkanen I've checked #8121 and I think it would be much better to close this one and merge yours directly. I only find two issues:
It would be nice to address both before merging it, but we can work on them later in future PRs. |
Either way is fine. I just thought your PR adds some important stuff (like the upgrade task changes), so it would be a good starting point. It's not much work to merge it. There are some things that I would like to change with #8121 but I don't believe there's much we can do until they fix the issues at NPM 7... There's also no visibility when they would fix the related NPM issue, so I guess we have to live with it for the time being.
Those references are used when external apps install Decidim from GitHub. It is possible to avoid if we copy the whole The NPM packages should be released to NPM and the actual Decidim applications should refer them directly from NPM by running e.g. With the CI and Decidim development environment, the references are local, so there won't be any git references either. Git references are needed only for git installations of Decidim.
Sure, this can be done, no problem. |
|
Closed in favor of #8121 |
🎩 What? Why?
#8094 prevents to copy the Decidim's
package.jsonto external apps to add the NPM dependencies, but it always retrieve it from thedevelopbranch of this repo. This PR adds some logic to choose the rightpackage.json. It supports the following scenarios, depending on the way thedecidimgem is loaded:This PR also runs that command during the
decidim:upgradetask, to have the app NPM dependencies correctly updated at any moment.I don't know if it's a good idea, but with this we don't need to publish NPM packages.
📌 Related Issues
Testing
Describe the best way to test or validate your PR.
📋 Checklist
🚨 Please review the guidelines for contributing to this repository.
docs/.📷 Screenshots
Please add screenshots of the changes you're proposing
