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

Allow publishing of packages with ignored devDependencies #907

Open
wants to merge 24 commits into
base: main
Choose a base branch
from

Conversation

georeith
Copy link

Resolves: #906

@changeset-bot
Copy link

changeset-bot bot commented Aug 10, 2022

🦋 Changeset detected

Latest commit: 736a89a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 16 packages
Name Type
@changesets/cli Minor
@changesets/config Minor
@changesets/get-dependents-graph Minor
@changesets/types Minor
@changesets/apply-release-plan Patch
@changesets/assemble-release-plan Patch
@changesets/get-release-plan Patch
@changesets/changelog-git Patch
@changesets/changelog-github Patch
get-workspaces Patch
@changesets/git Patch
@changesets/parse Patch
@changesets/pre Patch
@changesets/read Patch
@changesets/release-utils Patch
@changesets/write Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@codesandbox-ci
Copy link

codesandbox-ci bot commented Aug 10, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 736a89a:

Sandbox Source
Vanilla Configuration

@georeith georeith closed this Aug 10, 2022
@georeith georeith reopened this Aug 10, 2022
@georeith georeith closed this Aug 10, 2022
@georeith georeith reopened this Aug 10, 2022
@georeith
Copy link
Author

georeith commented Aug 10, 2022

didn't mean to close and reopen this I thought I was in a different PR and was getting confused why I couldn't merge the PR (and also why @KasFijolek approved) 😊

@kachkaev
Copy link

Might be worth looking at "private": true instead. Context: #906 (comment) (UPD2)

@@ -115,4 +115,39 @@ describe("getting the dependency graph", function() {
`);
})
);

it("should skip devDependencies if specified", function() {
Copy link
Member

Choose a reason for hiding this comment

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

It would also be great to have a test for the version command (I assume that it's where the original problem originated). While this package here might be directly responsible for the issue - it is an implementation detail and I would like to have a test for what people usually interact with (so @changesets/cli)

@@ -71,6 +71,8 @@ export type Config = {
/** The minimum bump type to trigger automatic update of internal dependencies that are part of the same release */
updateInternalDependencies: "patch" | "minor";
ignore: ReadonlyArray<string>;
/** Allows packages to be published if they have ignored packages in their devDependencies */
allowIgnoredDevDependencies?: boolean;
Copy link
Member

Choose a reason for hiding this comment

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

q: what would be the downsides of removing this flag entirely and instead just ignoring such dev dependencies at all times?

Copy link

Choose a reason for hiding this comment

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

This would be fine, and certainly would be fine if the dev dependency is marked as private.

@wycats
Copy link

wycats commented Sep 19, 2022

This change would really improve my workflow 😄

@Andarist
Copy link
Member

@wycats I'm OK with this "feature" request - but I think that the additional config option that has been introduced here is redundant. Would you be able to prepare a PR targeting this PR that would introduce the requested changes? I'm a little bit busy right now and it might take me some days to get to this myself.

@georeith
Copy link
Author

georeith commented Jun 14, 2023

@Andarist I reworked this removing the extra config option and made it so it just ignores devDependencies when looking at ignored files. I added a test for the version command.

I opted to not make it ignore devDependencies everywhere as devDependencies can have an effect on your package's output (they may affect how it is built) but it is fine for them to be ignored.

@georeith georeith requested a review from Andarist June 14, 2023 16:48
@@ -73,5 +73,6 @@
"scripts/*"
]
},
"prettier": {}
"prettier": {},
"packageManager": "yarn@1.22.19"
Copy link
Author

Choose a reason for hiding this comment

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

For those of us who use another version of yarn than classic and have corepack enabled this will use the right yarn version when working on this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow versioning/publishing of packages with ignored devDependencies
5 participants