mirror of
https://github.com/discourse/discourse.git
synced 2026-08-05 02:43:08 -05:00
DEV: Update jsconfig (#34285)
to include recently bundled plugins and themes
This commit is contained in:
Regular → Executable
+13
-9
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user