mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Add the missing app subdirectory (#9499)
* DEV: Add missing directory to the Discourse ember app * DEV: Resolve imports correctly
This commit is contained in:
@@ -161,7 +161,8 @@ JS
|
||||
path = "discourse/plugins/#{plugin.name}/#{logical_path.sub(/javascripts\//, '')}" if plugin
|
||||
end
|
||||
|
||||
path || logical_path
|
||||
# We need to strip the app subdirectory to replicate how ember-cli works.
|
||||
path || logical_path&.gsub('app/', '')
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -65,7 +65,11 @@ class Ember::Handlebars::Template
|
||||
end
|
||||
|
||||
def global_template_target(namespace, module_name, config)
|
||||
"#{namespace}[#{template_path(module_name, config).inspect}]"
|
||||
# We need this for backward-compatibility reasons.
|
||||
# Plugins may not have an app subdirectory.
|
||||
path = template_path(module_name, config).inspect.gsub('discourse/templates/', '')
|
||||
|
||||
"#{namespace}[#{path}]"
|
||||
end
|
||||
|
||||
# FIXME: Previously, ember-handlebars-templates uses the logical path which incorrectly
|
||||
|
||||
@@ -81,8 +81,8 @@ module PrettyText
|
||||
ctx_load_manifest(ctx, "markdown-it-bundle.js")
|
||||
root_path = "#{Rails.root}/app/assets/javascripts/"
|
||||
|
||||
apply_es6_file(ctx, root_path, "discourse/lib/to-markdown")
|
||||
apply_es6_file(ctx, root_path, "discourse/lib/utilities")
|
||||
apply_es6_file(ctx, root_path, "discourse/app/lib/to-markdown")
|
||||
apply_es6_file(ctx, root_path, "discourse/app/lib/utilities")
|
||||
|
||||
PrettyText::Helpers.instance_methods.each do |method|
|
||||
ctx.attach("__helpers.#{method}", PrettyText::Helpers.method(method))
|
||||
|
||||
Reference in New Issue
Block a user