Skip to content

Commit

Permalink
fix(cli): do not install deps for built-in connectors
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondfeng committed Feb 12, 2019
1 parent 669ede1 commit 2e035a5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/cli/generators/datasource/index.js
Expand Up @@ -311,8 +311,10 @@ module.exports = class DataSourceGenerator extends ArtifactGenerator {
debug(`npmModule - ${pkgs[0]}`);
} else {
const connectorName = this.artifactInfo.connector;
// Other connectors
if (!deps[connectorName]) pkgs.push(connectorName);
// Other connectors that are not listed in `connectors.json`.
// No install is needed for those in connectors.json but without a
// package name as they are built-in connectors
if (!deps[connectorName] && !connector) pkgs.push(connectorName);
}

if (!deps['@loopback/repository']) {
Expand Down
Expand Up @@ -157,6 +157,7 @@ function checkBasicDataSourceFiles() {
assert.file(expectedTSFile);
assert.file(expectedJSONFile);
assert.file(expectedIndexFile);
assert.noFile(path.join(SANDBOX_PATH, 'node_modules/memory'));

assert.fileContent(expectedTSFile, /import {inject} from '@loopback\/core';/);
assert.fileContent(
Expand Down

0 comments on commit 2e035a5

Please sign in to comment.