scalajs-bundler icon indicating copy to clipboard operation
scalajs-bundler copied to clipboard

Package manager abstraction

Open ptrdom opened this issue 2 years ago • 9 comments

References https://github.com/scalacenter/scalajs-bundler/issues/417.

Main idea is to make a package manager abstraction that allows a flexible interaction with plugin's internals so that user's can extend the behavior however they wish.

TODO:

  • [x] Implement pnpm.
  • [x] Fix scripted tests.

ptrdom avatar May 05 '22 17:05 ptrdom

@julienrf @sjrd comments would be appreciated. Could I get some permissions to run CI at will, scripted tests are kind of clunky on my local machine. I could fix up tests that were broken prior to this PR too, but I will need to edit actual CI scripts because I have a feeling it needs some tinkering with Node/npm versions. I do not see where those AppVeyor scripts are located, but do we even need them with GitHub Actions being already in place?

ptrdom avatar May 05 '22 17:05 ptrdom

Also, this very much breaks the backwards compatibility, but I assume that it is fine since the plugin is not v1 yet 😅 Let me know if that is not alright, there is definitely a way to stay backwards compatible, although the old design should be deprecated eventually - things like having both npm and yarn settings available simultaneously are obviously clunky.

ptrdom avatar May 05 '22 17:05 ptrdom

@julienrf @sjrd Could you review this?

ptrdom avatar May 09 '22 14:05 ptrdom

I will try to find some time for it this week.

sjrd avatar May 09 '22 14:05 sjrd

@sjrd Thank you for a very thorough review! I will make the changes as requested.

ptrdom avatar May 16 '22 15:05 ptrdom

@sjrd I think I made all of the modifications you requested, PR is ready for a review. I also updated docs.

ptrdom avatar May 21 '22 10:05 ptrdom

@ptrdom Thanks for this PR, would love to use pnpm with Scala.js. :)

Anything missing for this PR to be merged?

mims-github avatar Feb 22 '23 09:02 mims-github

@sjrd .. Can we request a review of this. I would be happy to add bun support as well on top of this.

Either way the JS community has much faster options than NPM right now which we should take advantage of.

nadenf avatar Jun 29 '23 11:06 nadenf

I think this PR was ignored for long enough to assume that maintainers are not accepting any PRs to actually develop features, which is fine, but it would have been considerate towards community to explicitly state that.

My suggestions for plugin users who want a package manager abstraction:

  • Fork scalajs-bundler and publish a community fork.
  • Move on to Vite in officially promoted way:
    • https://www.scala-js.org/doc/tutorial/scalajs-vite.html
  • Move on to one of the plugins I worked on:
    • https://github.com/ptrdom/scalajs-vite for Vite, feature complete, but I am not working on it any further since I personally think that esbuild is a better bundler for Scala.js.
    • https://github.com/ptrdom/scalajs-esbuild for esbuild, feature complete for web, still working on Electron plugin, and lacks docs, so I would still call it WIP.

ptrdom avatar Jun 29 '23 12:06 ptrdom