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: Issue 97 - NPM Archive Distribution #220

Merged

Conversation

TylerB24890
Copy link
Contributor

@TylerB24890 TylerB24890 commented Aug 28, 2024

Description of the Change

  • Implement archive config in composer.json to ignore files & directories from composer archive command.
  • Implement pre-archive-cmd
    • Will remove dev dependencies prior to archiving the directory
  • Implement post-archive-cmd
    • Will re-install dev dependencies following directory archive
  • Also implements .gitattributes from Stop distributing development files #143

Closes #97

How to test the Change

  1. Pull down the branch
  2. Run npm install && composer install && npm run build
  3. Run npm archive and observe the bundled files.
    • ZIP file should not include node_modules
    • ZIP file will include the /vendor/ directory without any dev dependencies
  4. View /vendor/ directory and confirm dev dependencies have been re-installed.

Changelog Entry

  • Changed - Remove composer dev dependencies from archived project.

Credits

Props @TylerB24890 , @peterwilsoncc , @szepeviktor

Checklist:

@jeffpaul jeffpaul added this to the 2.2.6 milestone Aug 28, 2024
@jeffpaul jeffpaul requested review from peterwilsoncc and removed request for jeffpaul August 28, 2024 16:11
@jeffpaul jeffpaul modified the milestones: 2.2.6, 2.3.0 Aug 28, 2024
Copy link
Contributor

@peterwilsoncc peterwilsoncc left a comment

Choose a reason for hiding this comment

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

This looks good to me and tests well. I've attached a copy of the zip as a record of what's generated. Thanks!

safe-svg.zip

@peterwilsoncc peterwilsoncc merged commit ff7a8bc into 10up:develop Aug 28, 2024
12 checks passed
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.

NPM archive related scripts include node_modules and vendor files in zip.
3 participants