Skip to content

Conversation

@mskelton
Copy link
Owner

@mskelton mskelton commented Jul 9, 2025

Fixes #360 - removes workspaces and other development-only fields from published package.json to prevent Yarn v1 warnings

mskelton added 2 commits July 9, 2025 14:34
- Fixes #360: Yarn v1 warning about workspaces in published packages
- Adds CI step to clean package.json before publishing
- Removes workspaces, packageManager, scripts, and devDependencies from published package
- Restores original package.json after publishing
- Uses 'if: always()' to ensure restoration even if release fails
- Replace manual CI package.json cleaning with semantic-release plugin
- Plugin automatically removes workspaces, packageManager, scripts, devDependencies
- Maintains clean published package.json while preserving development setup
- More maintainable and follows semantic-release best practices
@mskelton mskelton requested a review from Copilot July 9, 2025 19:37
@mskelton mskelton added the ai Generated with Cursor or Claude Code label Jul 9, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes a Yarn v1 compatibility issue by configuring semantic-release to automatically remove development-only fields from the published package.json file. The changes ensure that fields like workspaces and other dev-specific configurations are stripped during the release process to prevent warnings.

  • Adds the @anolilab/semantic-release-clean-package-json plugin as a development dependency
  • Configures semantic-release to use explicit plugins including the new clean-package-json plugin

Reviewed Changes

Copilot reviewed 2 out of 3 changed files in this pull request and generated no comments.

File Description
package.json Adds the semantic-release-clean-package-json plugin to devDependencies
.releaserc.json Configures semantic-release with explicit plugins list including the clean-package-json plugin
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

@mskelton mskelton merged commit b8401e5 into main Jul 9, 2025
3 checks passed
@mskelton mskelton deleted the fix/remove-workspaces-from-published-package branch July 9, 2025 19:39
@github-actions
Copy link

🎉 This PR is included in version 2.2.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

carlbray pushed a commit to carlbray/eslint-plugin-playwright that referenced this pull request Aug 17, 2025
* fix: remove workspaces and other dev fields from published package.json

- Fixes mskelton#360: Yarn v1 warning about workspaces in published packages
- Adds CI step to clean package.json before publishing
- Removes workspaces, packageManager, scripts, and devDependencies from published package
- Restores original package.json after publishing
- Uses 'if: always()' to ensure restoration even if release fails

* refactor: use @anolilab/semantic-release-clean-package-json plugin

- Replace manual CI package.json cleaning with semantic-release plugin
- Plugin automatically removes workspaces, packageManager, scripts, devDependencies
- Maintains clean published package.json while preserving development setup
- More maintainable and follows semantic-release best practices

* Cursor rules
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ai Generated with Cursor or Claude Code released

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Yarn (1.22.22) throws warning "Workspaces can only be enabled in private projects"

2 participants