mirror of
https://github.com/discourse/discourse.git
synced 2025-05-24 02:38:16 +08:00
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:
@ -46,7 +46,7 @@ def write_template(path, task_name, template)
|
||||
|
||||
File.write(output_path, "#{header}\n\n#{template}")
|
||||
puts "#{basename} created"
|
||||
system("yarn run prettier --write #{output_path}", exception: true)
|
||||
system("pnpm prettier --write #{output_path}", exception: true)
|
||||
puts "#{basename} prettified"
|
||||
end
|
||||
|
||||
@ -59,7 +59,7 @@ def write_hbs_template(path, task_name, template)
|
||||
basename = File.basename(path)
|
||||
output_path = "#{Rails.root}/app/assets/javascripts/#{path}"
|
||||
File.write(output_path, "#{header}\n#{template}")
|
||||
system("yarn run prettier --write #{output_path}", exception: true)
|
||||
system("pnpm prettier --write #{output_path}", exception: true)
|
||||
puts "#{basename} created"
|
||||
end
|
||||
|
||||
@ -204,7 +204,7 @@ end
|
||||
task "javascript:update" => "clean_up" do
|
||||
require "uglifier"
|
||||
|
||||
system("yarn install", exception: true)
|
||||
system("pnpm install", exception: true)
|
||||
|
||||
versions = {}
|
||||
start = Time.now
|
||||
|
Reference in New Issue
Block a user