Skip to content

Commit

Permalink
fix: ensure bundleddeps are correctly included in dist (#620)
Browse files Browse the repository at this point in the history
  • Loading branch information
agdimech authored Oct 30, 2023
1 parent 8e7b8b5 commit 8709f3e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 35 deletions.
25 changes: 0 additions & 25 deletions packages/pdk/.projen/deps.json

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

6 changes: 0 additions & 6 deletions packages/pdk/package.json

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

15 changes: 11 additions & 4 deletions projenrc/projects/pdk-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@ export class PdkProject extends PDKProject {
);
jsiiProjects?.forEach((subProject) => {
this.copyProjectSource(subProject);
this.addProjectDeps(subProject);
});
this.addProjectDeps((jsiiProjects || []).flatMap((p) => p.deps.all));
this.emitIndexFile(jsiiProjects);
}

Expand Down Expand Up @@ -201,14 +201,21 @@ export class PdkProject extends PDKProject {
);
}

private addProjectDeps(project: JsiiProject) {
project.deps.all
private addProjectDeps(deps: Dependency[]) {
const bundledDeps = new Set(
deps
.filter((dep) => dep.type === DependencyType.BUNDLED)
.map((dep) => dep.name)
);

deps
.filter((dep) => !dep.name.startsWith(PDK_NAMESPACE))
.forEach((dep) => {
switch (dep.type) {
case DependencyType.BUILD:
case DependencyType.TEST:
this.addDevDeps(this.renderDependency(dep));
!bundledDeps.has(dep.name) &&
this.addDevDeps(this.renderDependency(dep));
break;
case DependencyType.BUNDLED:
this.addBundledDeps(this.renderDependency(dep));
Expand Down

0 comments on commit 8709f3e

Please sign in to comment.