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

Build: remove unneeded files from packages' production builds. #22498

Merged
merged 5 commits into from
Jan 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions projects/packages/assets/.gitattributes
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# Files not needed to be distributed in the package.
.gitattributes export-ignore
.github/ export-ignore
phpunit.xml.dist export-ignore
tests/ export-ignore
.gitattributes export-ignore
.github/ export-ignore
phpunit.xml.dist export-ignore
tests/ export-ignore
webpack.config.js export-ignore

# Files not needed in the production build.
.gitignore production-exclude
.phpcs.dir.xml production-exclude
.phpcsignore production-exclude
/changelog/** production-exclude
.gitignore production-exclude
.phpcs.dir.xml production-exclude
.phpcsignore production-exclude
/changelog/** production-exclude

# Files to include in the production build.
/build/** production-include
/build/** production-include
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Build: remove unneeded files from production build.
1 change: 1 addition & 0 deletions projects/packages/jitm/.gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ webpack.config.js export-ignore
.gitignore production-exclude
.phpcs.dir.xml production-exclude
phpunit.xml.dist production-exclude
.eslintignore production-exclude
tests/** production-exclude
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Build: remove unneeded files from production build.
1 change: 1 addition & 0 deletions projects/packages/my-jetpack/.gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ package.json export-ignore
# Remember to end all directories with `/**` to properly tag every file.
.gitignore production-exclude
.phpcs.dir.xml production-exclude
jest.setup.js production-exclude
_inc/** production-exclude
changelog/** production-exclude
phpunit.xml.dist production-exclude
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Build: remove unneeded files from production build.
1 change: 1 addition & 0 deletions projects/packages/post-list/.gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
package.json export-ignore
webpack.config.js export-ignore
gulpfile.babel.js export-ignore
phpunit.xml.dist export-ignore
.babelrc export-ignore

# Files to include in the mirror repo
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Build: remove unneeded files from production build.
6 changes: 5 additions & 1 deletion projects/packages/search/.gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ package.json export-ignore
/changelog/** production-exclude
/.gitignore production-exclude
/.eslintrc.js production-exclude
/.eslintignore production-exclude
/.size-limit.js production-exclude
/babel.config* production-exclude
/jest.config.js production-exclude
/postcss.config.js production-exclude
Expand All @@ -19,5 +21,7 @@ package.json export-ignore
/src/**/test/** production-exclude
/src/**/*.scss production-exclude
# JS scripts to integrate with customizer and wigets might need to be explicitly included.
/src/**/*.[jt]s?(x) production-exclude
/src/**/*.js production-exclude
/src/**/*.jsx production-exclude
/src/**/*.ts production-exclude
Comment on lines -22 to +26
Copy link
Member Author

Choose a reason for hiding this comment

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

I've switched to more explicit declarations here because the pattern does not seem to work:
https://github.com/Automattic/jetpack-search/tree/e408700a61a7937263cdb48320acc91def69a95d/src/customberg

Copy link
Contributor

Choose a reason for hiding this comment

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

The ?(x) bit isn't a supported part of the syntax.

.phpcs.dir.xml production-exclude
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: changed

Build: remove unneeded files from production build.
2 changes: 1 addition & 1 deletion projects/packages/search/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "jetpack-search",
"version": "0.5.3",
"version": "0.5.4-alpha",
"description": "Package for Jetpack Search products",
"main": "main.js",
"directories": {
Expand Down
1 change: 1 addition & 0 deletions projects/plugins/jetpack/.gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
# Files to exclude from Automattic/jetpack-production.
# Remember to end all directories with `/**` to properly tag every file.
.eslintrc.js production-exclude
.eslintignore production-exclude
/.gitattributes production-exclude
/.gitignore production-exclude
/.phpcs.dir.xml production-exclude
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: other

Build: remove unneeded files from production build.