Skip to content

Commit

Permalink
feat(cli): move "@loopback/core" to peerDependencies for new extensions
Browse files Browse the repository at this point in the history
Signed-off-by: Miroslav Bajtoš <[email protected]>
  • Loading branch information
bajtos committed Jul 20, 2020
1 parent e8f5f79 commit 2d9cfec
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
10 changes: 9 additions & 1 deletion packages/cli/generators/project/templates/package.json.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,15 @@
"src",
"!*/__tests__"
],
<% if (project.projectType === 'extension') { -%>
"peerDependencies": {
"@loopback/core": "<%= project.dependencies['@loopback/core'] -%>"
},
<% } -%>
"dependencies": {
<% if (project.projectType === 'application') { -%>
"@loopback/boot": "<%= project.dependencies['@loopback/boot'] -%>",
"@loopback/core": "<%= project.dependencies['@loopback/core'] -%>",
<% if (project.projectType === 'application') { -%>
<% if (project.repositories) { -%>
"@loopback/repository": "<%= project.dependencies['@loopback/repository'] -%>",
<% } -%>
Expand All @@ -94,6 +99,9 @@
"devDependencies": {
"@loopback/build": "<%= project.dependencies['@loopback/build'] -%>",
"source-map-support": "<%= project.dependencies['source-map-support'] -%>",
<% if (project.projectType === 'extension') { -%>
"@loopback/core": "<%= project.dependencies['@loopback/core'] -%>",
<% } -%>
"@loopback/testlab": "<%= project.dependencies['@loopback/testlab'] -%>",
"@types/node": "<%= project.dependencies['@types/node'] -%>",
<% if (project.eslint) { -%>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,14 @@
"src",
"!*/__tests__"
],
<% if (project.projectType === 'extension') { -%>
"peerDependencies": {
"@loopback/core": "<%= project.dependencies['@loopback/core'] -%>"
},
"dependencies": {
<% if (project.projectType === 'application') { -%>
"@loopback/boot": "<%= project.dependencies['@loopback/boot'] -%>",
"@loopback/core": "<%= project.dependencies['@loopback/core'] -%>",
<% if (project.projectType === 'application') { -%>
"@loopback/repository": "<%= project.dependencies['@loopback/repository'] -%>",
<% if (project.apiconnect) { -%>
"@loopback/apiconnect": "<%= project.dependencies['@loopback/apiconnect'] -%>",
Expand All @@ -84,9 +88,13 @@
<% } -%>
"tslib": "<%= project.dependencies['tslib'] -%>"
},
<% } -%>
"devDependencies": {
"rimraf": "<%= project.dependencies['rimraf'] -%>",
"source-map-support": "<%= project.dependencies['source-map-support'] -%>",
<% if (project.projectType === 'extension') { -%>
"@loopback/core": "<%= project.dependencies['@loopback/core'] -%>",
<% } -%>
"@loopback/testlab": "<%= project.dependencies['@loopback/testlab'] -%>",
<% if (project.mocha) { -%>
"@types/mocha": "<%= project.dependencies['@types/mocha'] -%>",
Expand Down

0 comments on commit 2d9cfec

Please sign in to comment.