DEV: Switch to pnpm for JS dependencies (#28671)

This will bring significant improvements to install speed & storage requirements. For information on how it may affect you, see https://meta.discourse.org/t/324521

This commit:
- removes the `yarn.lock` and replaces with `pnpm-lock.yaml`
- updates workspaces to pnpm format
- adjusts package dependencies to work with pnpm's stricter resolution strategy
- updates Rails app to load modules from more specific node_modules directories
- adds a `.pnpmfile` which automatically cleans up old yarn-managed `node_modules` directories
- updates various scripts to call `pnpm` instead of `yarn`
- updates patches to use pnpm's native patch system instead of patch-package
- adds a patch for licensee to support pnpm
This commit is contained in:
David Taylor
2024-09-03 10:51:07 +01:00
committed by GitHub
parent 9b4b5b5028
commit 80b9c280ba
56 changed files with 18609 additions and 13553 deletions

View File

@ -66,12 +66,12 @@ module PrettyText
end
root_path = "#{Rails.root}/app/assets/javascripts"
node_modules = "#{Rails.root}/node_modules"
d_node_modules = "#{Rails.root}/app/assets/javascripts/discourse/node_modules"
md_node_modules = "#{Rails.root}/app/assets/javascripts/discourse-markdown-it/node_modules"
ctx.load("#{node_modules}/loader.js/dist/loader/loader.js")
ctx.load("#{d_node_modules}/loader.js/dist/loader/loader.js")
ctx.load("#{md_node_modules}/markdown-it/dist/markdown-it.js")
ctx.load("#{root_path}/handlebars-shim.js")
ctx.load("#{node_modules}/xss/dist/xss.js")
ctx.load("#{md_node_modules}/xss/dist/xss.js")
ctx.load("#{Rails.root}/lib/pretty_text/vendor-shims.js")
ctx_load_directory(