Use yarn for building package, and improve readme

to not require npm too
This commit is contained in:
Alex P 2021-08-30 17:21:45 +03:00
parent 36790fa22d
commit b7ab926f7c
2 changed files with 11 additions and 20 deletions

View file

@ -44,30 +44,21 @@ After some changes in `.env` (such as PHP, WP versions) you may need to rebuild
See [package.json](/package.json) for other useful commands. See [package.json](/package.json) for other useful commands.
## Preparation for wordpress.org release ## Building a release package
If you want to deploy a new version, you need to do some preparation: If you want to build a release package
(that can be used for deploying a new version on wordpress.org or manual installation on a WP website via ZIP uploading),
follow these steps:
### Clone 1. Clone the repository and `cd` into it.
2. Make sure you have the version in the plugin root file updated.
Clone the repository and `cd` into it 3. Update the PayPal JavaScript SDK integration date by using the current date for the `PAYPAL_INTEGRATION_DATE` constant.
4. The following command should get you a ZIP file ready to be used on a WordPress site:
### Build
The following command should get you a ZIP file ready to be used on a WordPress site.
``` ```
npm run build $ yarn run build
``` ```
### Update version
Make sure you have the version in the plugin root file updated.
### Fixate integration date
Fix the PayPal JavaScript SDK integration date by using the current date for the `PAYPAL_INTEGRATION_DATE` constant.
## License ## License
[GPL-2.0 License](LICENSE) [GPL-2.0 License](LICENSE)

View file

@ -28,10 +28,10 @@
"docker:fix-lint": "docker-compose run --rm test vendor/bin/phpcbf", "docker:fix-lint": "docker-compose run --rm test vendor/bin/phpcbf",
"prebuild": "rm -rf ./vendor", "prebuild": "rm -rf ./vendor",
"build": "composer install --no-dev && npm run build:dev && npm run archive", "build": "composer install --no-dev && yarn run build:dev && yarn run archive",
"prearchive": "rm -rf $npm_package_name.zip", "prearchive": "rm -rf $npm_package_name.zip",
"archive": "zip -r $npm_package_name.zip . -x **.git/\\* **node_modules/\\*", "archive": "zip -r $npm_package_name.zip . -x **.git/\\* **node_modules/\\*",
"postarchive": "npm run archive:cleanup && rm -rf $npm_package_name && unzip $npm_package_name.zip -d $npm_package_name && rm $npm_package_name.zip && zip -r $npm_package_name.zip $npm_package_name && rm -rf $npm_package_name", "postarchive": "yarn run archive:cleanup && rm -rf $npm_package_name && unzip $npm_package_name.zip -d $npm_package_name && rm $npm_package_name.zip && zip -r $npm_package_name.zip $npm_package_name && rm -rf $npm_package_name",
"archive:cleanup": "zip -d $npm_package_name.zip .env* docker/\\* docker-compose.yml .editorconfig tests/\\* .github/\\* wordpress_org_assets/\\* \\*.DS_Store README.md .gitattributes .gitignore .travis.yml composer.json composer.lock package.json package-lock.json patchwork.json yarn.lock phpunit.xml.dist .phpunit.result.cache phpcs.xml.dist modules/ppcp-button/.babelrc modules/ppcp-button/package.json modules/ppcp-button/webpack.config.js modules/ppcp-button/yarn.lock vendor/\\*/.idea/\\* vendor/\\*/.gitignore vendor/\\*/.gitattributes vendor/\\*/.travis.yml" "archive:cleanup": "zip -d $npm_package_name.zip .env* docker/\\* docker-compose.yml .editorconfig tests/\\* .github/\\* wordpress_org_assets/\\* \\*.DS_Store README.md .gitattributes .gitignore .travis.yml composer.json composer.lock package.json package-lock.json patchwork.json yarn.lock phpunit.xml.dist .phpunit.result.cache phpcs.xml.dist modules/ppcp-button/.babelrc modules/ppcp-button/package.json modules/ppcp-button/webpack.config.js modules/ppcp-button/yarn.lock vendor/\\*/.idea/\\* vendor/\\*/.gitignore vendor/\\*/.gitattributes vendor/\\*/.travis.yml"
}, },
"config": { "config": {