Skip to content

Commit

Permalink
Detect @ember-data/model in addition to meta-package
Browse files Browse the repository at this point in the history
While ember-data is usually installed it's also possible to use
@ember-data/model (and other packages directly).
  • Loading branch information
jrjohnson authored and SergeAstapov committed Sep 13, 2023
1 parent f93a678 commit 5cdcf75
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/ember-cli-mirage/addon/utils/ember-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import { dependencySatisfies } from '@embroider/macros';
/**
@hide
*/
export const hasEmberData = dependencySatisfies('ember-data', '*');
export const hasEmberData =
dependencySatisfies('@ember-data/model', '*') ||
dependencySatisfies('ember-data', '*');

/**
@hide
Expand Down
5 changes: 5 additions & 0 deletions packages/ember-cli-mirage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"@ember/optional-features": "^2.0.0",
"@ember/string": "^3.1.1",
"@ember/test-helpers": "^2.9.3",
"@ember-data/model": "~4.11.3",
"@embroider/test-setup": "^2.1.1",
"@faker-js/faker": "^6.3.1",
"@glimmer/component": "^1.1.2",
Expand Down Expand Up @@ -99,6 +100,7 @@
},
"peerDependencies": {
"@ember/test-helpers": "*",
"@ember-data/model": "*",
"ember-data": "*",
"ember-qunit": "*",
"ember-source": "^3.28.0 || ^4.0.0 || ^5.0.0",
Expand All @@ -108,6 +110,9 @@
"@ember/test-helpers": {
"optional": true
},
"@ember-data/model": {
"optional": true
},
"ember-data": {
"optional": true
},
Expand Down
37 changes: 37 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5cdcf75

Please sign in to comment.