Skip to content

Conversation

@vmcj
Copy link
Member

@vmcj vmcj commented Sep 27, 2025

NPM is another packagemanager for JS. So we use composer first and when we can't find the package there we check with npm.

This change does require more changes for maintainer-install & any checkout.

If we do this it makes introducing MathJax a lot easier and we can now also version control other javascript libraries.

@nickygerritsen
Copy link
Member

If we do this, I'd suggest going for npm (or yarn) fully for JS dependencies

@vmcj
Copy link
Member Author

vmcj commented Sep 27, 2025

If we do this, I'd suggest going for npm (or yarn) fully for JS dependencies

So also remove JS dependencies in composer and add them in npm? I'm fine with either of the 2 but for adaptation doing it in composer is an easier learningpath.

I somehow never used yarn but if that's the better of the 2 but I have no experience with that translation path.

I also think we should only do this in the next release so we have some time to discuss.

@nickygerritsen
Copy link
Member

If we do this, I'd suggest going for npm (or yarn) fully for JS dependencies

So also remove JS dependencies in composer and add them in npm? I'm fine with either of the 2 but for adaptation doing it in composer is an easier learningpath.

I somehow never used yarn but if that's the better of the 2 but I have no experience with that translation path.

I also think we should only do this in the next release so we have some time to discuss.

I think it doesn't make sense to have 2 package managers for frontend dependencies, that's why I suggest using npm (or yarn, which can read the same package.json file) for all.

@vmcj vmcj marked this pull request as draft September 28, 2025 11:10
@vmcj vmcj force-pushed the introduce_npm branch 4 times, most recently from d4096af to 3bfe280 Compare October 27, 2025 18:27
@vmcj vmcj marked this pull request as ready for review October 27, 2025 18:27
@vmcj
Copy link
Member Author

vmcj commented Oct 27, 2025

The other packages are harder to either find (dataTables) or don't work 1-on-1 (font-awesome). I'll look at those in another PR. Reviewing is easiest commit by commit and by just skipping the monaco one as that's the one touching most files.

Copy link
Member

@nickygerritsen nickygerritsen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to update the docs for yarn as well and later update the Docker images.

@vmcj
Copy link
Member Author

vmcj commented Oct 31, 2025

We need to update the docs for yarn as well
I think I already mention yarn in the docs? So what is missing?

and later update the Docker images.
Yes, and ansible will also need it.

@nickygerritsen
Copy link
Member

We need to update the docs for yarn as well
I think I already mention yarn in the docs? So what is missing?

and later update the Docker images.
Yes, and ansible will also need it.

sorry i missed it. it's missing for fedora though


domserver: composer-dump-autoload

dependencies: composer-dependencies node-dependencies
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should (all, also composer-dependencies-dev below) be added as phony dependencies under .PHONY to make it clear that no actual target with this name gets created.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, I see that composer-dependencies{,-dev} are actually recursive targets from the root Makefile, so that should then be renamed there too.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I already renamed the composer-dependencies{,-dev} to dependencies{,-dev} in all files (so also the root one). I've now added the .PHONY targets in the webapp/Makefile. I think that's what you meant?

$(addprefix maintainer-,conf install) clean-autoconf config distdocs \
composer-dependencies composer-dependencies-dev \
coverity-conf coverity-build
dependencies dependencies-dev coverity-conf coverity-build
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding the phony targets here is not strictly necessary, as recursive targets are already marked phony in https://github.com/DOMjudge/domjudge/blob/main/Makefile.global#L94, but this doesn't hurt.

vmcj added 2 commits November 4, 2025 20:29
Either Composer managed those before,
or those were checked into git.

Now we track those with `yarn`:
- Coloris
- JQuery debounce
- Monaco editor
- Bootstrap-toggle
- File-saver
- d3
- nvd3
- Select2

D3 has a newer release but we can't upgrade because of the nvd3 which needs
this specific Major version.
@vmcj vmcj enabled auto-merge November 4, 2025 19:39
@vmcj vmcj added this pull request to the merge queue Nov 4, 2025
Merged via the queue into DOMjudge:main with commit 808748c Nov 4, 2025
37 checks passed
@vmcj vmcj deleted the introduce_npm branch November 4, 2025 20:09
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

Successfully merging this pull request may close these issues.

3 participants