Skip to content

Commit 2e035a5

Browse files
committed
fix(cli): do not install deps for built-in connectors
1 parent 669ede1 commit 2e035a5

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

packages/cli/generators/datasource/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,8 +311,10 @@ module.exports = class DataSourceGenerator extends ArtifactGenerator {
311311
debug(`npmModule - ${pkgs[0]}`);
312312
} else {
313313
const connectorName = this.artifactInfo.connector;
314-
// Other connectors
315-
if (!deps[connectorName]) pkgs.push(connectorName);
314+
// Other connectors that are not listed in `connectors.json`.
315+
// No install is needed for those in connectors.json but without a
316+
// package name as they are built-in connectors
317+
if (!deps[connectorName] && !connector) pkgs.push(connectorName);
316318
}
317319

318320
if (!deps['@loopback/repository']) {

packages/cli/test/integration/generators/datasource.integration.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ function checkBasicDataSourceFiles() {
157157
assert.file(expectedTSFile);
158158
assert.file(expectedJSONFile);
159159
assert.file(expectedIndexFile);
160+
assert.noFile(path.join(SANDBOX_PATH, 'node_modules/memory'));
160161

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

0 commit comments

Comments
 (0)