DEV: Refactor bowerDependencies patch (#24437)

Moves the patch from ember-source to ember-cli so that it's easier for us to feature-flag an ember-source upgrade without fighting with patch-package. We'll be able to remove this patch once we're fully on Ember 5.x.

(ref https://github.com/discourse/discourse/pull/21720)
This commit is contained in:
David Taylor 2023-11-20 13:28:02 +00:00 committed by GitHub
parent 0a58564ddd
commit 5276afa9b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 18 deletions

View File

@ -0,0 +1,16 @@
diff --git a/node_modules/ember-cli/lib/models/project.js b/node_modules/ember-cli/lib/models/project.js
index 7b3c7c9..e0c5fb9 100644
--- a/node_modules/ember-cli/lib/models/project.js
+++ b/node_modules/ember-cli/lib/models/project.js
@@ -716,6 +716,11 @@ class Project {
logger.info('getProjectRoot %s -> %s', process.cwd(), directory);
return directory;
}
+
+ // Allows us to use recent ember-cli with ember-source 3.28.12
+ bowerDependencies(){
+ return [];
+ }
}
class NotFoundError extends Error {

View File

@ -1,18 +0,0 @@
diff --git a/node_modules/ember-source/lib/index.js b/node_modules/ember-source/lib/index.js
index ce887fbeb..8caf078c5 100644
--- a/node_modules/ember-source/lib/index.js
+++ b/node_modules/ember-source/lib/index.js
@@ -45,13 +45,6 @@ module.exports = {
init() {
this._super.init && this._super.init.apply(this, arguments);
- if ('ember' in this.project.bowerDependencies()) {
- // TODO: move this to a throw soon.
- this.ui.writeWarnLine(
- 'Ember.js is now provided by node_module `ember-source`, please remove it from bower'
- );
- }
-
// resets `this.root` to the correct location by default ember-cli
// considers `__dirname` here to be the root, but since our main entry
// point is within a subfolder we need to correct that