Skip to content

Conversation

@octogonz
Copy link
Collaborator

@octogonz octogonz commented Jul 25, 2024

Sometime in March 2022, the CHANGELOG.md file stopped being included in any NPM packages released by Rush Stack.

It was caused by a PNPM upgrade at some point, reflecting a decision made by NPM v7.12.0:

PR npm/cli#3200

  • 99ff40dff npm-packlist@2.2.0:
    • feat(npmignore): Do not force include history, changelogs, notice

image

The fix

Update the .npmignore template for all projects to explicitly include CHANGELOG.md. I've also included CHANGELOG.json since it was included before and might be useful.

CC @chengcyber

@octogonz
Copy link
Collaborator Author

Corresponding TSDoc PR: microsoft/tsdoc#420

@octogonz
Copy link
Collaborator Author

Methodology in case we need it again:

1. Delete the comment that was outside the template block

Search and delete: # (Add your project-specific overrides here)

2. Delete patterns moved to the template

Search and delete: !heft-plugin.json and !rush-plugin-manifest.json

3. Update the template:

Search for: ([\r\n]|.)+LINE[\r\n\s]+#[- ]+

Replace with:

# THIS IS A STANDARD TEMPLATE FOR .npmignore FILES IN THIS REPO.

# Ignore all files by default, to avoid accidentally publishing unintended files.
*

# Use negative patterns to bring back the specific things we want to publish.
!/bin/**
!/lib/**
!/lib-*/**
!/dist/**

!CHANGELOG.md
!CHANGELOG.json
!heft-plugin.json
!rush-plugin-manifest.json
!ThirdPartyNotice.txt

# Ignore certain patterns that should not get published.
/dist/*.stats.*
/lib/**/test/
/lib-*/**/test/
*.test.js

# NOTE: These don't need to be specified, because NPM includes them automatically.
#
# package.json
# README.md
# LICENSE

# ---------------------------------------------------------------------------
# DO NOT MODIFY ABOVE THIS LINE!  Add any project-specific overrides below.
# ---------------------------------------------------------------------------

4. Remove blank lines introduced by deletion

Search for \r?\n\r?\n\r?\n\r?
Replace with \n

@octogonz octogonz merged commit c07320d into main Jul 26, 2024
@octogonz octogonz deleted the octogonz/missing-changelog branch July 26, 2024 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

3 participants