Skip to content

Commit b8401e5

Browse files
authored
fix: clean published package.json (#371)
* fix: remove workspaces and other dev fields from published package.json - 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 * 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
1 parent ef5e251 commit b8401e5

File tree

4 files changed

+62
-1
lines changed

4 files changed

+62
-1
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
alwaysApply: true
3+
---
4+
5+
## Pull Requests
6+
7+
- When creating pull requests, add the `cursor` label to the pull request.
8+
9+
## Commits
10+
11+
- This project uses semantic-release to automatically publish new versions of
12+
the package.
13+
- When creating commits, use the following format:
14+
- `feat: add new feature`
15+
- `fix: fix bug`
16+
- `chore: update dependencies`
17+
- `docs: update documentation`
18+
- `refactor: refactor code`
19+
- `test: add tests`
20+
- `style: update styles`

.releaserc.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
11
{
2-
"extends": "@mskelton/semantic-release-config"
2+
"extends": "@mskelton/semantic-release-config",
3+
"plugins": [
4+
"@semantic-release/commit-analyzer",
5+
"@semantic-release/release-notes-generator",
6+
"@anolilab/semantic-release-clean-package-json",
7+
"@semantic-release/npm",
8+
"@semantic-release/github"
9+
]
310
}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
"globals": "^13.23.0"
4747
},
4848
"devDependencies": {
49+
"@anolilab/semantic-release-clean-package-json": "^3.0.2",
4950
"@mskelton/eslint-config": "^9.0.1",
5051
"@mskelton/semantic-release-config": "^1.0.1",
5152
"@types/estree": "^1.0.6",

pnpm-lock.yaml

Lines changed: 33 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)