Skip to content

Commit

Permalink
Merge pull request #1224 from bertdeblock/apply-ember-get-config-adap…
Browse files Browse the repository at this point in the history
…ter-conditionally

Don't apply the `ember-get-config` compat adapter when >= v2.1.0
  • Loading branch information
ef4 authored Jul 1, 2022
2 parents 68d1768 + c801ec1 commit 2df43b6
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/compat/src/compat-adapters/ember-get-config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import V1Addon from '../v1-addon';
import writeFile from 'broccoli-file-creator';
import mergeTrees from 'broccoli-merge-trees';
import semver from 'semver';

function createIndexContents(config: any): string {
return `export default ${JSON.stringify(config)};`;
Expand Down Expand Up @@ -28,4 +29,10 @@ export default class extends V1Addon {
writeFile('package.json', JSON.stringify(this.newPackageJSON, null, 2)),
]);
}

// v2.1.0 now behaves the same under Embroider as it does in a classic build:
// https://github.com/mansona/ember-get-config/pull/45
static shouldApplyAdapter(addonInstance: any) {
return semver.lt(addonInstance.pkg.version, '2.1.0');
}
}

0 comments on commit 2df43b6

Please sign in to comment.