DEV: Move `shouldLoadPluginTestJs()` (#19045)

A first step in the effort to depend only on explicitly declared dependencies in package.json.
This commit is contained in:
Jarek Radosz 2022-11-16 11:07:58 +01:00 committed by GitHub
parent b36c5e7565
commit 9bf95d472d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 10 additions and 12 deletions

View File

@ -8,6 +8,7 @@ const fs = require("fs");
const concat = require("broccoli-concat");
const RawHandlebarsCompiler = require("discourse-hbr/raw-handlebars-compiler");
const DiscoursePluginColocatedTemplateProcessor = require("./colocated-template-compiler");
const EmberApp = require("ember-cli/lib/broccoli/ember-app");
function fixLegacyExtensions(tree) {
return new Funnel(tree, {
@ -217,4 +218,8 @@ module.exports = {
// This addon doesn't contribute any 'real' trees to the app
return;
},
shouldLoadPluginTestJs() {
return EmberApp.env() === "development" || process.env.LOAD_PLUGINS === "1";
},
};

View File

@ -11,6 +11,7 @@
"dependencies": {
"discourse-widget-hbs": "1.0.0",
"ember-auto-import": "^2.4.3",
"ember-cli": "~3.28.5",
"ember-cli-babel": "^7.26.10",
"ember-cli-htmlbars": "^6.1.1"
},

View File

@ -1 +0,0 @@
engine-strict = true

View File

@ -8,7 +8,7 @@ const path = require("path");
const fs = require("fs");
const fsPromises = fs.promises;
const { JSDOM } = require("jsdom");
const { shouldLoadPluginTestJs } = require("discourse/lib/plugin-js");
const { shouldLoadPluginTestJs } = require("discourse-plugins");
const { Buffer } = require("node:buffer");
const { cwd, env } = require("node:process");

View File

@ -1,7 +0,0 @@
const EmberApp = require("ember-cli/lib/broccoli/ember-app");
module.exports = {
shouldLoadPluginTestJs() {
return EmberApp.env() === "development" || process.env.LOAD_PLUGINS === "1";
},
};

View File

@ -5,7 +5,7 @@ const concat = require("broccoli-concat");
const mergeTrees = require("broccoli-merge-trees");
const deepmerge = require("deepmerge");
const glob = require("glob");
const { shouldLoadPluginTestJs } = require("discourse/lib/plugin-js");
const { shouldLoadPluginTestJs } = require("discourse-plugins");
let built = false;

View File

@ -6,7 +6,7 @@ const mergeTrees = require("broccoli-merge-trees");
const MessageFormat = require("messageformat");
const deepmerge = require("deepmerge");
const glob = require("glob");
const { shouldLoadPluginTestJs } = require("discourse/lib/plugin-js");
const { shouldLoadPluginTestJs } = require("discourse-plugins");
let built = false;

View File

@ -1,5 +1,5 @@
const TapReporter = require("testem/lib/reporters/tap_reporter");
const { shouldLoadPluginTestJs } = require("discourse/lib/plugin-js");
const { shouldLoadPluginTestJs } = require("discourse-plugins");
const fs = require("fs");
class Reporter {