DEV: Move `discourse.js` to `app/app.js` (#9545)

This is another thing to get our application in line with what Ember CLI
expects.
This commit is contained in:
Robin Ward 2020-04-27 13:28:10 -04:00 committed by GitHub
parent f15fc0ebf3
commit 056327c0c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 19 additions and 5 deletions

View File

@ -5,7 +5,7 @@
//= require ./ember-addons/fmt
//= require ./polyfills
//= require_tree ./select-kit
//= require ./discourse
//= require ./discourse/app/app
//= require ./deprecated
// Stuff we need to load first

View File

@ -1,4 +1,4 @@
// ensure Discourse is added as a global
(function() {
window.Discourse = requirejs("discourse").default;
window.Discourse = requirejs("discourse/app").default;
})();

View File

@ -263,6 +263,14 @@ var define, requirejs;
function requireFrom(name, origin) {
name = transformForAliases(name);
if (name === "discourse") {
// eslint-disable-next-line no-console
console.log(
"discourse has been moved to `discourse/app` - please update your code"
);
name = "discourse/app";
}
if (name === "discourse/models/input-validation") {
// eslint-disable-next-line no-console
console.log(

View File

@ -2,7 +2,7 @@ import Session from "discourse/models/session";
import KeyValueStore from "discourse/lib/key-value-store";
import Store from "discourse/models/store";
import DiscourseLocation from "discourse/lib/discourse-location";
import Discourse from "discourse";
import Discourse from "discourse/app";
import SearchService from "discourse/services/search";
import TopicTrackingState, {
startTracking

View File

@ -324,7 +324,14 @@ module Discourse
ActionView::Base.precompiled_asset_checker = -> logical_path do
default_checker[logical_path] ||
%w{qunit.js qunit.css test_helper.css test_helper.js wizard/test/test_helper.js}.include?(logical_path)
%w{qunit.js
qunit.css
test_helper.css
test_helper.js
wizard/test/test_helper.js
}.include?(logical_path) ||
logical_path =~ /\/node_modules/ ||
logical_path =~ /\/dist/
end
end
end

View File

@ -52,7 +52,6 @@ class DiscourseJsProcessor
preload-application-data
wizard-start
onpopstate-handler
discourse
google-tag-manager
google-universal-analytics
activate-account