DEV: Update jsconfig (#34285)

to include recently bundled plugins and themes
This commit is contained in:
Jarek Radosz
2025-08-13 21:17:50 +02:00
committed by GitHub
parent 9df1128374
commit 0b5211671c
5 changed files with 204 additions and 14 deletions
Regular → Executable
+13 -9
View File
@@ -1,3 +1,4 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
require "pathname"
@@ -51,22 +52,25 @@ def write_config(package_dir, extras: {})
}
output = <<~JSON
// This file was generated by scripts/build_jsconfig.rb
// This file was generated by script/build_jsconfig.rb
#{JSON.pretty_generate(config)}
JSON
File.write("#{package_dir}/jsconfig.json", output)
end
core_plugins = `git ls-files plugins/*/plugin.rb`.lines.map { |path| path.split("/")[1] }
plugin_configs =
core_plugins
.map do |name|
[
"discourse/plugins/#{name}/*",
["plugins/#{name}/assets/javascripts", "plugins/#{name}/test/javascripts"],
]
`git ls-files plugins/*/plugin.rb`.lines
.map { File.dirname(_1) }
.map do |path|
["discourse/#{path}/*", ["#{path}/assets/javascripts", "#{path}/test/javascripts"]]
end
.to_h
write_config ".", extras: { **plugin_configs }
theme_configs =
`git ls-files themes/*/about.json`.lines
.map { File.dirname(_1) }
.map { |path| ["discourse/#{path}/*", ["#{path}/javascripts", "#{path}/test"]] }
.to_h
write_config ".", extras: plugin_configs.merge(theme_configs)