Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Fix: Changes not detected by changeset cli 2.23.1 #871

Merged
merged 2 commits into from Jul 13, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/slimy-dolls-hang.md
@@ -0,0 +1,5 @@
---
"@changesets/cli": patch
---

Fixed filtering of the ignored packages when adding a changeset.
2 changes: 1 addition & 1 deletion packages/cli/src/commands/add/index.ts
Expand Up @@ -42,7 +42,7 @@ export default async function add(
});
const changePackagesName = changedPackages
.map(pkg => pkg.packageJson.name)
.filter(pkgName => config.ignore.includes(pkgName));
.filter(pkgName => !config.ignore.includes(pkgName));

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's why

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ouch 😬 sorry for that!


newChangeset = await createChangeset(changePackagesName, packages);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this line correct? Could you check this as well?

Because I got an error below

$ /Users/ms.park/Desktop/workspace/payment.ohou.se/node_modules/.bin/changeset
🦋  error TypeError: Cannot read properties of undefined (reading 'packageJson')
🦋  error     at createChangeset (/Users/ms.park/Desktop/workspace/payment.ohou.se/node_modules/@changesets/cli/dist/cli.cjs.dev.js:415:75)
🦋  error     at add (/Users/ms.park/Desktop/workspace/payment.ohou.se/node_modules/@changesets/cli/dist/cli.cjs.dev.js:507:26)
🦋  error     at async run$2 (/Users/ms.park/Desktop/workspace/payment.ohou.se/node_modules/@changesets/cli/dist/cli.cjs.dev.js:1254:5)
error Command failed with exit code 1.

And this error is from this line.

This line was originally same with before

    newChangeset = await createChangeset(changePackagesName, packages.packages);

But this had been changed since 2.23.1

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With what version do you experience this problem? With the 2.23.1 or with the version of the code from this PR?

printConfirmationMessage(newChangeset, packages.length > 1);
Expand Down