-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from hametuha/wip/0.9
Support HPOS
- Loading branch information
Showing
31 changed files
with
2,312 additions
and
1,372 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# | ||
# Exclude these files from release archives. | ||
# | ||
/.browserslistrc export-ignore | ||
/.editorconfig export-ignore | ||
/.eslintrc export-ignore | ||
/.git export-ignore | ||
/.gitattributes export-ignore | ||
/.github export-ignore | ||
/.gitignore export-ignore | ||
/.wp-env.json export-ignore | ||
/bin export-ignore | ||
/composer.template.yaml export-ignore | ||
/composer.lock export-ignore | ||
/package.json export-ignore | ||
/package-lock.json export-ignore | ||
/phpcs.ruleset.xml export-ignore | ||
/phpunit.xml.dist export-ignore | ||
/stylelint.config.js export-ignore | ||
/tests export-ignore | ||
/webpack.config.js export-ignore | ||
|
||
/hametwoo.php export-ignore | ||
|
||
# | ||
# Auto detect text files and perform LF normalization | ||
# http://davidlaing.com/2012/09/19/customise-your-gitattributes-to-become-a-git-ninja/ | ||
# | ||
* text=auto | ||
*.md text | ||
*.php text | ||
*.json text |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: CI/CD | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
jobs: | ||
# WordPress.org が治ったらもどす | ||
# test: | ||
# name: PHP Unit Test | ||
# strategy: | ||
# matrix: | ||
# php: [ '8.2' ] #PHP versions to check. | ||
# wp: [ 'latest' ] # WordPress version to check. | ||
# uses: tarosky/workflows/.github/workflows/wp-unit-test.yml@main | ||
# with: | ||
# php_version: ${{ matrix.php }} | ||
# wp_version: ${{ matrix.wp }} | ||
|
||
lint: | ||
name: PHP Syntax compatibility check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@master | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: '7.4' | ||
tools: composer | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Install Composer | ||
run: composer install --no-interaction --no-progress --optimize-autoloader | ||
|
||
- name: Run PHP Lint | ||
run: composer lint | ||
|
||
short-open-tag: | ||
uses: tarosky/workflows/.github/workflows/php-short-open-tag.yml@main | ||
|
||
status-check: | ||
name: Status Check | ||
runs-on: ubuntu-latest | ||
if: always() | ||
needs: [ short-open-tag, lint ] | ||
steps: | ||
- uses: re-actors/alls-green@release/v1 | ||
with: | ||
jobs: ${{ toJSON(needs) }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
.DS_Store | ||
Thumbs.db | ||
wp-cli.local.yml | ||
node_modules/ | ||
vendor/ | ||
|
||
composer.lock | ||
/node_modules/ | ||
/vendor/ | ||
/wordpress/ | ||
.wp_install_path | ||
*.cache | ||
compose.yaml |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"phpVersion": "8.1", | ||
"core": "WordPress/WordPress#6.6.2", | ||
"config": { | ||
"WP_DEBUG": true, | ||
"WP_DEBUG_LOG": true, | ||
"WP_DEBUG_DISPLAY": true, | ||
"WPMS_ON": true, | ||
"WPMS_SMTP_HOST": "mailhog", | ||
"WPMS_SMTP_PORT": 1025, | ||
"WPMS_MAILER": "smtp", | ||
"HAMAIL_DEBUG": true | ||
}, | ||
"plugins": [ | ||
".", | ||
"https://downloads.wordpress.org/plugin/query-monitor.latest-stable.zip", | ||
"https://downloads.wordpress.org/plugin/woocommerce.7.9.1.zip", | ||
"https://downloads.wordpress.org/plugin/wp-mail-smtp.latest-stable.zip" | ||
], | ||
"lifecycleScripts": { | ||
"afterStart": "bash bin/after-start-scripts.sh" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,70 @@ | ||
# hametwoo | ||
|
||
A utility classes for WooCommerce development. | ||
|
||
[![Build Status](https://travis-ci.org/hametuha/hametwoo.svg)](https://travis-ci.org/hametuha/hametwoo) | ||
|
||
## How to Use | ||
|
||
Include via composer. In your compsoer.json: | ||
Include via composer. In your composer.json: | ||
|
||
``` | ||
{ | ||
"require": { | ||
"hametuha/hametwoo": "~0.8" | ||
"hametuha/hametwoo": "~0.9" | ||
} | ||
} | ||
``` | ||
|
||
This library is useful for making Payment Gateways. | ||
|
||
## Development | ||
|
||
Composer, Node.js, and Docker are required. At first, clone GitHub repository. | ||
|
||
``` | ||
git clone [email protected]:hametuha/hametwoo.git | ||
``` | ||
|
||
Then install dependencies. | ||
|
||
``` | ||
composer install | ||
npm install | ||
``` | ||
|
||
Run local environment. | ||
|
||
``` | ||
npm start | ||
``` | ||
|
||
Run test. | ||
|
||
``` | ||
# PHP Unit test in Docker. | ||
npm test | ||
# PHP Code Sniffer | ||
composer lint | ||
# PHP Code Beautifier | ||
composer format | ||
``` | ||
|
||
To enable mailhog for debug, follow the instruction below. | ||
|
||
``` | ||
# Get docker container ID. | ||
# Notice: run npm start before this step. | ||
npm run path | ||
# You will get container ID at the base name e.g. 0597019337936df00cda1cf5a15016e0 | ||
# Save it as .wp_install_path | ||
touch .wp_install_path | ||
echo 0597019337936df00cda1cf5a15016e0 > .wp_install_path | ||
# Restart docker. | ||
npm run update | ||
# Open http://localhost:8025 | ||
``` | ||
|
||
## License | ||
|
||
GPL 3.0 and later. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# 1. .wp_install_path からハッシュ値を読み込む、なければ終了。 | ||
if [ ! -f .wp_install_path ]; then | ||
echo ".wp_install_path File not found. Skip installation mailhog" | ||
exit 0 | ||
fi | ||
hash_value=$(cat .wp_install_path) | ||
|
||
# 2. Replace %network% in compose.template.yaml with hash | ||
sed "s/%NETWORK_NAME%/${hash_value}/g" compose.template.yaml > compose.yaml | ||
|
||
# 3. Display status | ||
echo "Hash: ${hash_value} in compose.yml" | ||
|
||
docker compose up -d | ||
|
||
echo "mailhog http://localhost:8025" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
volumes: | ||
maildir: {} | ||
|
||
services: | ||
mail: | ||
image: mailhog/mailhog | ||
container_name: mailhog | ||
ports: | ||
- 1025:1025 | ||
- 8025:8025 | ||
environment: | ||
MH_STORAGE: maildir | ||
MH_MAILDIR_PATH: /tmp | ||
volumes: | ||
- maildir:/tmp | ||
networks: | ||
- wpnetwork | ||
|
||
networks: | ||
wpnetwork: | ||
name: %NETWORK_NAME%_default | ||
external: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,56 @@ | ||
{ | ||
"name": "hametuha/hametwoo", | ||
"description": "A utility classes for WooCommerce development", | ||
"type": "library", | ||
"license": "GPL-3.0-or-later", | ||
"authors": [ | ||
{ | ||
"name": "fumikito", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"minimum-stability": "stable", | ||
"require": { | ||
"php": ">=5.4" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "~4.8", | ||
"squizlabs/php_codesniffer": "~2.8", | ||
"wp-coding-standards/wpcs": "~0.11" | ||
}, | ||
"autoload": { | ||
"psr-0": { | ||
"Hametuha\\HametWoo": "src/" | ||
} | ||
} | ||
"name": "hametuha/hametwoo", | ||
"description": "A utility classes for WooCommerce development", | ||
"type": "library", | ||
"scripts": { | ||
"test": "phpunit", | ||
"lint": "phpcs --standard=phpcs.ruleset.xml", | ||
"format": "phpcbf --standard=phpcs.ruleset.xml" | ||
}, | ||
"license": "GPL-3.0-or-later", | ||
"authors": [ | ||
{ | ||
"name": "fumikito", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"minimum-stability": "stable", | ||
"repositories":[ | ||
{ | ||
"type":"composer", | ||
"url":"https://wpackagist.org", | ||
"only": [ | ||
"wpackagist-plugin/*", | ||
"wpackagist-theme/*" | ||
] | ||
} | ||
], | ||
"require": { | ||
"php": ">=7.4" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^6|^7|^8|^9", | ||
"squizlabs/php_codesniffer": "^3.0", | ||
"wp-coding-standards/wpcs": "^3.0.0", | ||
"yoast/phpunit-polyfills": "^2.0.0", | ||
"wpackagist-plugin/woocommerce": "^7.0" | ||
}, | ||
"autoload": { | ||
"psr-0": { | ||
"Hametuha\\HametWoo": "src/" | ||
} | ||
}, | ||
"extra": { | ||
"installer-paths": { | ||
"vendor/plugins/{$name}/": [ | ||
"type:wordpress-plugin" | ||
] | ||
} | ||
}, | ||
"config": { | ||
"allow-plugins": { | ||
"composer/installers": true, | ||
"dealerdirect/phpcodesniffer-composer-installer": true | ||
} | ||
} | ||
} |
Oops, something went wrong.