From b7ab926f7c8cfe1bc91cc451fc9a0c2d8a48af20 Mon Sep 17 00:00:00 2001 From: Alex P Date: Mon, 30 Aug 2021 17:21:45 +0300 Subject: [PATCH] Use yarn for building package, and improve readme to not require npm too --- README.md | 27 +++++++++------------------ package.json | 4 ++-- 2 files changed, 11 insertions(+), 20 deletions(-) diff --git a/README.md b/README.md index d1fec7959..b0c371881 100644 --- a/README.md +++ b/README.md @@ -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. -## 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 - -Clone the repository and `cd` into it - -### Build - -The following command should get you a ZIP file ready to be used on a WordPress site. +1. Clone the repository and `cd` into it. +2. Make sure you have the version in the plugin root file updated. +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: ``` -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 [GPL-2.0 License](LICENSE) diff --git a/package.json b/package.json index f2c5d9f63..bb2825153 100644 --- a/package.json +++ b/package.json @@ -28,10 +28,10 @@ "docker:fix-lint": "docker-compose run --rm test vendor/bin/phpcbf", "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", "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" }, "config": {