Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: ignore private or ignored packages #105

Merged
merged 3 commits into from
May 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/quick-ligers-flash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"changesets-gitlab": minor
---

feat: ignore private or ignored packages for comment
14 changes: 12 additions & 2 deletions src/get-changed-packages.ts
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,14 @@ export const getChangedPackages = async ({
throw new Error('an error occurred when fetching files')
}

const config = await configPromise.then(rawConfig =>
parseConfig(rawConfig, packages),
)

const releasePlan = assembleReleasePlan(
await Promise.all(changesetPromises),
packages,
await configPromise.then(rawConfig => parseConfig(rawConfig, packages)),
config,
await preStatePromise,
)

Expand All @@ -194,7 +198,13 @@ export const getChangedPackages = async ({
: packages.packages.filter(pkg =>
changedFiles.some(changedFile => changedFile.includes(pkg.dir)),
)
).map(x => x.packageJson.name),
)
.filter(
pkg =>
pkg.packageJson.private !== true &&
!config.ignore.includes(pkg.packageJson.name),
)
.map(x => x.packageJson.name),
releasePlan,
}
}