Skip to content

Commit e13487d

Browse files
kraftbjanomiexbrbrr
authored
Monorepo: Reorganize all projects (#18257)
Co-authored-by: Brandon Kraft <[email protected]> Co-authored-by: Brad Jorsch <[email protected]> Co-authored-by: Yaroslav Kukharuk <[email protected]>
1 parent 0501796 commit e13487d

File tree

3,213 files changed

+26091
-21094
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

3,213 files changed

+26091
-21094
lines changed

.eslintignore

+29-17
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,33 @@
1-
*.min.js
2-
/3rd-party/debug-bar/debug-bar.js
3-
/_inc/blocks
4-
/_inc/build
5-
/_inc/client/**/test/*.js
6-
/_inc/jetpack-modules.models.js
7-
/_inc/postmessage.js
8-
/docker/wordpress-develop/
9-
/docker/wordpress/
10-
/modules/custom-css/custom-css/js/core-customizer-css-preview.js
11-
/modules/custom-css/custom-css/js/core-customizer-css.core-4.9.js
12-
/modules/custom-css/custom-css/js/core-customizer-css.js
13-
/packages/lazy-images/src/js/IntersectionObserver-polyfill.js
14-
/packages/*/vendor
15-
/packages/*/wordpress
16-
17-
/modules/widgets/search/js/search-widget-admin.js
1+
### Root
2+
tools/docker/wordpress-develop/
3+
tools/docker/wordpress/
4+
185
/vendor/
196

7+
*.min.js
8+
209
# Ignored by default, but we should check it
2110
!.github/
11+
12+
### Jetpack
13+
projects/plugins/jetpack/3rd-party/debug-bar/debug-bar.js
14+
projects/plugins/jetpack/_inc/blocks
15+
projects/plugins/jetpack/_inc/build
16+
projects/plugins/jetpack/_inc/client/**/test/*.js
17+
projects/plugins/jetpack/_inc/jetpack-modules.models.js
18+
projects/plugins/jetpack/_inc/postmessage.js
19+
20+
projects/plugins/jetpack/modules/custom-css/custom-css/js/core-customizer-css-preview.js
21+
projects/plugins/jetpack/modules/custom-css/custom-css/js/core-customizer-css.core-4.9.js
22+
projects/plugins/jetpack/modules/custom-css/custom-css/js/core-customizer-css.js
23+
projects/plugins/jetpack/modules/widgets/search/js/search-widget-admin.js
24+
25+
projects/plugins/jetpack/vendor/
26+
27+
# Temporary ignore until Jest is set up
28+
projects/plugins/jetpack/extensions/**/test/
29+
30+
### Packages
31+
projects/packages/lazy-images/src/js/IntersectionObserver-polyfill.js
32+
projects/packages/*/vendor
33+
projects/packages/*/wordpress

.eslintrc.js

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ module.exports = {
88
mocha: true,
99
node: true,
1010
jquery: true,
11+
jest: true
1112
},
1213
parserOptions: {
1314
ecmaVersion: 2019,

.github/CODEOWNERS

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
############################################
55

66
# Individual Modules:
7-
/modules/search/ @Automattic/jetpack-search
7+
/projects/plugins/jetpack/modules/search/ @Automattic/jetpack-search
88

99
# Other bits of the Codebase
10-
/_inc/lib/debugger/ @kraftbj
11-
/_inc/lib/jetpack-wpes-query-builder/ @gibrown
10+
/projects/plugins/jetpack/_inc/lib/debugger/ @kraftbj
11+
/projects/plugins/jetpack/_inc/lib/jetpack-wpes-query-builder/ @gibrown
1212

1313
# Functionality that is important to our partners
14-
/class.jetpack-cli.php @automattic/jetpack-infinity
15-
/bin/partner-provision.sh @automattic/jetpack-infinity
16-
/bin/partner-cancel.sh @automattic/jetpack-infinity
14+
/projects/plugins/jetpack/class.jetpack-cli.php @automattic/jetpack-infinity
15+
/tools/partner-provision.sh @automattic/jetpack-infinity
16+
/tools/partner-cancel.sh @automattic/jetpack-infinity

.github/actions/php-pipeline/setup-env.sh

+10-15
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,18 @@ if [[ -n "$GITHUB_PATH" ]]; then
1111
echo "$COMPOSER_BIN_DIR" >> $GITHUB_PATH
1212
fi
1313

14+
# Don't symlink, it breaks when copied later.
15+
export COMPOSER_MIRROR_PATH_REPOS=true
16+
1417
# Configure PHP and PHPUnit environment
18+
cd projects/plugins/jetpack
19+
composer install
1520
if [[ ${PHP_VERSION:0:2} == "8." ]]; then
16-
composer install --ignore-platform-reqs
1721
composer global require "phpunit/phpunit=7.5.*" --ignore-platform-reqs
18-
elif [[ ${PHP_VERSION:0:3} == "7.0" ]]; then
19-
composer remove sirbrillig/phpcs-changed automattic/jetpack-codesniffer --dev
20-
composer install
21-
composer global require "phpunit/phpunit=6.5.*" --no-suggest
22-
elif [[ ${PHP_VERSION:0:2} == "7." ]]; then
23-
composer install
24-
composer global require "phpunit/phpunit=7.5.*" --no-suggest
25-
elif [[ ${PHP_VERSION:0:2} == "5." ]]; then
26-
composer remove sirbrillig/phpcs-changed automattic/jetpack-codesniffer --dev
27-
composer install
28-
composer global require "phpunit/phpunit=5.7.*" --no-suggest
22+
else
23+
composer global require "phpunit/phpunit=5.7.* || 6.5.* || 7.5.*"
2924
fi
25+
cd -
3026

3127
# Setup MySQL
3228
cat <<EOF > ~/.my.cnf
@@ -46,7 +42,7 @@ master)
4642
git clone --depth=1 --branch master git://develop.git.wordpress.org/ /tmp/wordpress-master
4743
;;
4844
latest)
49-
git clone --depth=1 --branch $(php ./tests/get-wp-version.php) git://develop.git.wordpress.org/ /tmp/wordpress-latest
45+
git clone --depth=1 --branch $(php ./tools/get-wp-version.php) git://develop.git.wordpress.org/ /tmp/wordpress-latest
5046
;;
5147
previous)
5248
git clone --depth=1 --branch 5.5 git://develop.git.wordpress.org/ /tmp/wordpress-previous
@@ -59,8 +55,7 @@ if [ $clone_exit_code -ne 0 ]; then
5955
exit 1
6056
fi
6157

62-
cd ..
63-
cp -r jetpack "/tmp/wordpress-$WP_BRANCH/src/wp-content/plugins/jetpack"
58+
cp -r projects/plugins/jetpack "/tmp/wordpress-$WP_BRANCH/src/wp-content/plugins/jetpack"
6459
# Plugin dir for tests in WP >= 5.6-beta1
6560
ln -s "/tmp/wordpress-$WP_BRANCH/src/wp-content/plugins/jetpack" "/tmp/wordpress-$WP_BRANCH/tests/phpunit/data/plugins/jetpack"
6661
cd /tmp/wordpress-$WP_BRANCH

.github/actions/update-package/update-package.sh

-85
This file was deleted.

.github/files/check-excludelist-diff.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ const spawnSync = require( 'child_process' ).spawnSync;
88

99
const res = spawnSync(
1010
'git',
11-
[ 'diff', 'bin/eslint-excludelist.json', 'bin/phpcs-excludelist.json' ],
11+
[ 'diff', 'tools/eslint-excludelist.json', 'tools/phpcs-excludelist.json' ],
1212
{
1313
stdio: [ null, 'pipe', 'inherit' ],
1414
maxBuffer: Infinity,

.github/files/check-monorepo-package-versions.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
set -eo pipefail
44

5-
PACKAGES=$(jq -nc 'reduce inputs as $in ([]; . + [ $in.name ])' ./packages/*/composer.json)
5+
PACKAGES=$(jq -nc 'reduce inputs as $in ([]; . + [ $in.name ])' ./projects/packages/*/composer.json)
66

77
EXIT=0
88
for FILE in $(git ls-files 'composer.json' '**/composer.json'); do
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Enforce read-only repo status
2+
3+
on:
4+
issues:
5+
types: opened
6+
pull_request_target:
7+
types: opened
8+
9+
jobs:
10+
lockdown:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: dessant/repo-lockdown@v2
14+
with:
15+
github-token: ${{ github.token }}
16+
issue-comment: |
17+
Thank you for your interest!
18+
19+
Issues should be filed at https://github.com/Automattic/jetpack/issues. Be sure to mention the product that the issue is regarding.
20+
skip-closed-issue-comment: true
21+
pr-comment: |
22+
Thank you for your interest!
23+
24+
Pull requests should be made against the monorepo at https://github.com/Automattic/jetpack.
25+
skip-closed-pr-comment: true

0 commit comments

Comments
 (0)