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

Namespace composer packages with Strauss #3621

Merged
merged 12 commits into from
Aug 30, 2023
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
6 changes: 3 additions & 3 deletions .github/workflows/build-and-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ jobs:
- name: Set PHP version
uses: shivammathur/setup-php@v2
with:
php-version: '7.0' # Minimum required version
php-version: '8.2'
coverage: none

- name: composer install
run: composer install --no-dev -o
run: composer install

- name: install node v18
uses: actions/setup-node@v3
Expand All @@ -40,7 +40,7 @@ jobs:
git config user.name github-actions
git config user.email github-actions@github.com
git checkout -b "release-$VERSION"
git add -f dist/* vendor/*
git add -f dist/* vendor-prefixed/*
git commit --no-verify -m "Release $VERSION"
git tag "$VERSION"
git push --tags
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Build with vendor (test)
name: Build with vendor-prefixed

on:
pull_request:
Expand All @@ -17,11 +17,11 @@ jobs:
- name: Set PHP version
uses: shivammathur/setup-php@v2
with:
php-version: '7.0' # Minimum required version
php-version: '8.2'
coverage: none

- name: composer install
run: composer install --no-dev -o
run: composer install

- name: install node v18
uses: actions/setup-node@v3
Expand All @@ -42,7 +42,7 @@ jobs:
- name: Make artifacts available
uses: actions/upload-artifact@v3
with:
name: cypress-artifact
name: Plugin Zip
retention-days: 2
path: |
${{ github.workspace }}/elasticpress.zip
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/cypress-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ jobs:
- name: Set PHP version
uses: shivammathur/setup-php@v2
with:
php-version: '7.0'
php-version: '8.2'
tools: cs2pr
coverage: none

- name: composer install
run: composer install --no-dev -o
run: composer install

- name: "Install node v${{ env.NODE_VERSION }}"
uses: actions/setup-node@v3
Expand Down Expand Up @@ -132,12 +132,12 @@ jobs:
- name: Set PHP version
uses: shivammathur/setup-php@v2
with:
php-version: '7.0'
php-version: '8.2'
tools: cs2pr
coverage: none

- name: composer install
run: composer install --no-dev -o
run: composer install

- name: "Install node v${{ env.NODE_VERSION }}"
uses: actions/setup-node@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ jobs:
coverage: none

- name: composer install
run: composer install --ignore-platform-reqs
run: composer install

- name: PHPCS check
run: './vendor/bin/phpcs . -q --report=checkstyle --runtime-set testVersion 7.0- | cs2pr'
2 changes: 1 addition & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ jobs:
coverage: none

- name: Install dependencies
run: composer install --ignore-platform-reqs
run: composer install

- name: Setup WP Tests
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/vendor/
/vendor-prefixed/
node_modules
/dist
.idea
Expand Down
2 changes: 1 addition & 1 deletion bin/build-zip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ npm run build
rm ./elasticpress.zip

git archive --output=elasticpress.zip HEAD
zip -ur elasticpress.zip dist vendor
zip -ur elasticpress.zip dist vendor-prefixed
27 changes: 19 additions & 8 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,33 +30,44 @@
"require": {
"php": ">=7.0",
"composer/installers": "^1.0 || ^2.0",
"psr/container": "^1.0 || ^2.0"
"psr/container": "1.0.0"
},
"require-dev": {
"10up/phpcs-composer": "dev-master",
"wpackagist-plugin/woocommerce":"*",
"phpcompatibility/phpcompatibility-wp": "*",
"yoast/phpunit-polyfills": "^1.0"
"yoast/phpunit-polyfills": "^1.0",
"brianhenryie/strauss": "^0.14.0"
},
"scripts": {
"lint": "phpcs . -s --runtime-set testVersion 7.0-",
"lint-fix": "phpcbf .",
"test": "phpunit",
"test-single-site": "phpunit -c single-site.xml.dist",
"setup-local-tests": "bash bin/install-wp-tests.sh ep_wp_test root password 127.0.0.1 latest true"
"setup-local-tests": "bash bin/install-wp-tests.sh ep_wp_test root password 127.0.0.1 latest true",
"strauss": [ "vendor/bin/strauss" ],
"post-install-cmd": [
"@strauss"
],
"post-update-cmd": [
"@strauss"
]
},
"extra": {
"installer-paths": {
"vendor/{$name}/": ["type:wordpress-plugin", "type:wordpress-theme"]
}
"vendor/{$name}/": ["type:wordpress-plugin", "type:wordpress-theme"]
},
"strauss": {
"target_directory": "vendor-prefixed",
"namespace_prefix": "ElasticPress\\Vendor_Prefixed\\",
"classmap_prefix": "ElasticPress_Vendor_Prefixed_",
"constant_prefix": "EP_VENDOR_"
}
},
"config": {
"allow-plugins": {
"composer/installers": true,
"dealerdirect/phpcodesniffer-composer-installer": true
},
"platform": {
"php": "7.0"
}
}
}
Loading
Loading