diff --git a/.gitignore b/.gitignore index 81275690e..3d3cf93f9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,9 @@ /vendor/ /build/ node_modules -phpunit.xml .phpunit.result.cache composer.lock yarn-error.log modules/ppcp-button/assets/* +.idea/ +*.zip diff --git a/README.md b/README.md index 55721c57c..cc93d4843 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ PayPal's latest complete payments processing solution. Accept PayPal, PayPal Cre 1. Clone repository 2. `$ cd woocommerce-paypal-payments` 3. `$ composer install` -4. `$ yarn run dev` +4. `$ yarn run build:dev` 5. Change the `PAYPAL_INTEGRATION_DATE` constant to `gmdate( 'Y-m-d' )` to run the latest PayPal JavaScript SDK Note: PHPUnit needs at least PHP 7.3. @@ -34,12 +34,10 @@ Clone the repository and `cd` into it ### Build -Build the plugin and remove unnecessary files: +The following command should get you a ZIP file ready to be used on a WordPress site. + ``` -composer install --no-dev -yarn run build -rm -rf ./{tests,.git,.github,.gitignore,.travis.yml,composer.json,composer.lock,package.json,phpcs.xml.dist,phpunit.xml.dist,.phpunit.result.cache,yarn.lock} -rm -rf ./modules/ppcp-button/{node_modules/,.babelrc,package.json,webpack.config.js,yarn.lock} +npm run build ``` ### Update version diff --git a/package.json b/package.json index c6a94769a..70654b37c 100644 --- a/package.json +++ b/package.json @@ -1,19 +1,26 @@ { - "name": "izettle-woocommerce", - "version": "0.1.0", - "description": "iZettle WooCommerce", - "repository": "https://github.com/inpsyde/izettle-woocommerce", + "name": "woocommerce-paypal-payments", + "version": "1.0.0", + "description": "WooCommerce PayPal Payments", + "repository": "https://github.com/woocommerce/woocommerce-paypal-payments", "license": "GPL-2.0", - "author": "Inpsyde GmbH", + "author": "WooCommerce", "scripts": { - "install:assets:ppcp-button": "cd modules/ppcp-button && yarn install", - "install:assets": "yarn run install:assets:ppcp-button", - "build:assets:ppcp-button": "cd modules/ppcp-button && yarn run build", - "build:assets": "yarn run build:assets:ppcp-button", - "build": "yarn run install:assets && yarn run build:assets" + "install:modules:ppcp-button": "cd modules/ppcp-button && yarn install", + "install:modules": "yarn run install:modules:ppcp-button", + "build:modules:ppcp-button": "cd modules/ppcp-button && yarn run build", + "build:modules": "yarn run build:modules:ppcp-button", + "build:dev": "yarn run install:modules && yarn run build:modules", + + "prebuild": "rm -rf ./vendor", + "build": "composer install --no-dev && npm run build:dev && npm run archive", + "prearchive": "rm -rf $npm_package_name.zip", + "archive": "composer archive --file=$npm_package_name --format=zip && npm run archive:cleanup", + "archive:cleanup": "zip -d $npm_package_name.zip tests/\\* .github/\\* wordpress_org_assets/\\* modules/ppcp-button/node_modules/\\* \\*.DS_Store README.md .gitattributes .gitignore .travis.yml composer.json composer.lock package.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", + "postarchive": "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" }, "dependencies": { }, "devDependencies": { } -} \ No newline at end of file +}