-
Notifications
You must be signed in to change notification settings - Fork 53
Export: Exclude node_modules and .git paths from site export
#1264
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
Conversation
| const isNodeModulesDirectory = relativePath.includes( 'node_modules' ); | ||
| const isGitDirectory = relativePath.includes( '.git' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be safe to exclude all those paths that include node_modules or .git in them, but happy to make it more strict if you think it's necessary. 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree IMO this should be strict enough! 👌
epeicher
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gcsecsey
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @ivan-ottinger for working on this and for adding such detailed testing steps! 🙌
The changes LGTM and it's working great for me too! Thanks @epeicher for the handy tree listing command, it made screenshotting much easier! 😄
| My site files | exported files |
|---|---|
![]() |
![]() |
| const isNodeModulesDirectory = relativePath.includes( 'node_modules' ); | ||
| const isGitDirectory = relativePath.includes( '.git' ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree IMO this should be strict enough! 👌
|
Thank you for your review, Roberto and Gergely! 🙂 |
* Exclude `node_modules` from plugin directories during site export * Remove leftover code * Exclude node_modules and .git directories from file export in a simpler way
sejas
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work! I confirm that the .git and node_modules folders, along with all the files inside them, are excluded. This PR changes the behaviour of Sync and Import/Export features.
I left a comment on STU-411 to update docs in Import/Export mentioning that these folders are excluded.
Some logs I've added
----> Excluding wp-content/plugins/node_modules
----> Excluding wp-content/plugins/node_modules/.DS_Store
----> Excluding wp-content/plugins/node_modules/.git
----> Excluding wp-content/plugins/node_modules/yay
----> Excluding wp-content/plugins/node_modules/yay/test.diff
----> Excluding wp-content/plugins/node_modules/.git/test.diff
----> Excluding wp-content/plugins/mine/.git
----> Excluding wp-content/plugins/mine/.git/test.diff
----> Excluding wp-content/mu-plugins/sqlite-database-integration
----> Excluding wp-content/mu-plugins/sqlite-database-integration/LICENSE
----> Excluding wp-content/mu-plugins/sqlite-database-integration/activate.php
----> Excluding wp-content/mu-plugins/sqlite-database-integration/admin-notices.php
----> Excluding wp-content/mu-plugins/sqlite-database-integration/admin-page.php
----> Excluding wp-content/mu-plugins/sqlite-database-integration/constants.php
----> Excluding wp-content/mu-plugins/sqlite-database-integration/db.copy
----> Excluding wp-content/mu-plugins/sqlite-database-integration/deactivate.php
----> Excluding wp-content/mu-plugins/sqlite-database-integration/health-check.php
----> Excluding wp-content/mu-plugins/sqlite-database-integration/load.php
----> Excluding wp-content/mu-plugins/sqlite-database-integration/php-polyfills.php
----> Excluding wp-content/mu-plugins/sqlite-database-integration/readme.txt
----> Excluding wp-content/mu-plugins/sqlite-database-integration/wp-includes
----> Excluding wp-content/mu-plugins/sqlite-database-integration/wp-includes/sqlite
----> Excluding wp-content/mu-plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-db.php
----> Excluding wp-content/mu-plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-lexer.php
----> Excluding wp-content/mu-plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-pdo-user-defined-functions.php
----> Excluding wp-content/mu-plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-query-rewriter.php
----> Excluding wp-content/mu-plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-token.php
----> Excluding wp-content/mu-plugins/sqlite-database-integration/wp-includes/sqlite/class-wp-sqlite-translator.php
----> Excluding wp-content/mu-plugins/sqlite-database-integration/wp-includes/sqlite/db.php
----> Excluding wp-content/mu-plugins/sqlite-database-integration/wp-includes/sqlite/install-functions.php
|
Thanks, Antonio! |




Related issues
Proposed Changes
node_modulesand.gitpaths from site exportTesting Instructions
npm start..gitandnode_moduleswith some random files in them./wp-content/plugins,/wp-content/themes, etc. ....gitornode_modulesdirectories present.Pre-merge Checklist