Repository navigation
[6.2] Fix: Add method to copy Codemirror license file to builder - #47794
Conversation
|
It would be great if you could take another look at this as well @dgrammatiko |
|
I have tested this item ✅ successfully on 732952d This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/47794. |
|
The failing system tests are not related to this PR. |
|
why do we need a specific method for inclufing the licence for codemirror but not for all other packages? Surely this is a bandage and not a fix to why the code that works for all other packages doesnt work for codemirror. Or is there something specific about codemirror causing this break? Its important to understand the reason so that when we introduce a new package from a new vendor in the future we know if we need to create a specific code for the licence or not |
@brianteeman The reason why codemirror is special here is because in our package.json we do not have one dependency for codemirror but several, and there is no master dependency above it, so we have several source folders in node_modules but onmly one target folder in media/vendor. That's why it needs that special treatment. See https://github.com/joomla/joomla-cms/blob/6.2-dev/package.json#L37-L51 . P.S.: The LICENSE file is the same for all of these. |
|
Thank you for the explanation |
|
LGTM |
|
Wouldn't it be sufficient to align these two? |
|
is this code redundant now? joomla-cms/build/build-modules-js/settings.json Lines 641 to 644 in 2d1c08e |
|
I've experimented a bit with your idea. It's possible, but what benefit do we gain from it? @heelc29
If I add In this specific builder we are handling two different resources: |
@brianteeman No, see my description of the PR
We could specify the path directly in the method, but since this would be the only instance in the entire build process not to define the license file in the global settings, it would likely create maintenance friction in the long run. |
|
we could say this is the only licence that needs special handling outside of the global settings but I get your point ;) |
@LadySolveig The advantage would be that you would only need to adjust this line, rather than having to extend the The The |
|
@heelc29 I see, you mean that since the entire vendor folder is deleted anyway...IF I run a complete new build with all. However, it will only be cleared up completely then when you run To be honest, I'm quite pragmatic about this. We can also align the paths like you suggested if we're willing to accept the little inconsistency in that specific case. |
|
Thank you very much! |
|
Weird ... I had successfully tested this PR, and after that were no changes except of clean branch updates, but now after it has been merged into 6.2-dev it does not work anymore for me on a current 6.2-dev branch which includes this PR on the same environment (Linux) as used for my successful test. The Can it be that the Windows fix from the other PR has changed something here? From code reading I would not expect that, but I don't have any other idea now. |
|
same problem here after a cvlean checkout followed by composer install npm install and i am on windows |
|
Ah .. I see .. it's copied to a different place, not the |
|
Hmm, but e.g. for TinyMCE, the file But for Codemirror it is now That seems inconsistent to me. |
|
yes I see that - its definitely in the wrong place. the licence must be in the vendor/codemirror folder |
|
@brianteeman Could you test PR #47823 ? For me it fixes the issue witht eh LICENSE file without causing any other differences. |

Pull Request resolves #46879 (comment) .
Summary of Changes
Add method to copy the CodeMirror license file to the builder. This ensures that the required license file is included in the build output if specified in the build settings.
Build process improvements:
copymethod toCodemirrorModuleBuilderthat copies the CodeMirror license file to the target location if specified in the build settings (settings.json). This method first calls the parentcopymethod, then checks for the license filename in the build settings, resolves its path, and copies it to the build output directory.Testing Instructions
run
npm ciIssues are currently occurring on Windows - for testing this PR with Windows you have to wait that this PR #47793 is merged before, or apply the patch manually.
To validate the test results, please specify the operating system on which the tests were executed.
Actual result BEFORE applying this Pull Request
No
LICENSEfile in `media/plg_editors_codemirrorExpected result AFTER applying this Pull Request
media/plg_editors_codemirror/LICENSEis availbale in the media folder after buildLink to documentations
Please select:
Documentation link for guide.joomla.org:
No documentation changes for guide.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed