Skip to content

Commit

Permalink
Merge pull request #1369 from mkszepp/add-semver-for-ember-data
Browse files Browse the repository at this point in the history
Add semverRange <=4.11.0 for ember-data
  • Loading branch information
ef4 authored Mar 7, 2023
2 parents 97d8b0d + 0df6d02 commit e0fe915
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/compat/src/addon-dependency-rules/ember-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { PackageRules } from '..';
let rules: PackageRules[] = [
{
package: '@ember-data/store',
semverRange: '<=4.11.0',
addonModules: {
'-private.js': {
dependsOnModules: ['@ember-data/record-data/-private'],
Expand Down
5 changes: 5 additions & 0 deletions packages/compat/src/compat-adapters/ember-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { join } from 'path';
import { Memoize } from 'typescript-memoize';
import { Node } from 'broccoli-node-api';
import { sync as resolveSync } from 'resolve';
import semver from 'semver';

export class EmberDataBase extends V1Addon {
// May of the ember-data packages use rollup to try to hide their internal
Expand All @@ -14,6 +15,10 @@ export class EmberDataBase extends V1Addon {
customizes(...names: string[]) {
return super.customizes(...names.filter(n => n !== 'treeForAddon'));
}

static shouldApplyAdapter(addonInstance: any) {
return semver.lt(addonInstance.pkg.version, '4.11.1');
}
}

export default class EmberData extends EmberDataBase {
Expand Down

0 comments on commit e0fe915

Please sign in to comment.