I have a PR to fix this and make some minor composer changes here:
https://github.com/discourse/discourse/pull/34668