Skip to content

Commit

Permalink
Support for declaring extensions as peer dependencies (#11808)
Browse files Browse the repository at this point in the history
Ensures that the ExtensionPackageCollector also correctly picks up theia extensions that are declared as peerDependencies.

Contributed on behalf of STMicroelectronics
  • Loading branch information
tortmayr authored Nov 28, 2022
1 parent c3ba8a9 commit 2ec7d87
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,11 @@ export class ExtensionPackageCollector {
}

protected collectPackages(pck: NodePackage): void {
if (!pck.dependencies) {
return;
}
// eslint-disable-next-line guard-for-in
for (const dependency in pck.dependencies) {
const versionRange = pck.dependencies[dependency]!;
this.collectPackage(dependency, versionRange);
for (const [dependency, versionRange] of [
...Object.entries(pck.dependencies ?? {}),
...Object.entries(pck.peerDependencies ?? {})
]) {
this.collectPackage(dependency, versionRange!);
}
}

Expand Down
1 change: 1 addition & 0 deletions dev-packages/application-package/src/npm-registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ export interface NodePackage {
maintainers?: Maintainer[];
keywords?: string[];
dependencies?: Dependencies;
peerDependencies?: Dependencies;
[property: string]: any;
}

Expand Down

0 comments on commit 2ec7d87

Please sign in to comment.