Skip to content

Commit

Permalink
version 1
Browse files Browse the repository at this point in the history
  • Loading branch information
10xSebastian committed Sep 2, 2022
1 parent b4d6634 commit 0af2619
Show file tree
Hide file tree
Showing 9 changed files with 184 additions and 24 deletions.
12 changes: 10 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,19 @@ WooCommerce DePay plugin to accept Web3 payments directly into your wallet with

## Development

### Update Version

```
yarn update:version
```

### Release

In order to release this plugin simply push a git tag:

```
git tag v0.0.11
git push origin v0.0.11
PACKAGE_VERSION=$(cat package.json | grep version | head -1 | awk -F: '{ print $2 }' | sed 's/[",]//g' | sed 's/^ *//g')
echo v$PACKAGE_VERSION
git tag v$PACKAGE_VERSION
git push origin v$PACKAGE_VERSION
```
3 changes: 2 additions & 1 deletion depay-woocommerce-payments.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* WC tested up to: 6.8.0
* Requires at least: 5.8
* Requires PHP: 7.0
* Version: 0.0.11
* Version: 1.0.0
*
* @package DePay\Payments
*/
Expand All @@ -21,6 +21,7 @@
define( 'DEPAY_WC_PLUGIN_FILE', __FILE__ );
define( 'DEPAY_WC_ABSPATH', __DIR__ . '/' );
define( 'DEPAY_MIN_WC_ADMIN_VERSION', '0.23.2' );
define( 'DEPAY_CURRENT_VERSION', '1.0.0' );

require_once DEPAY_WC_ABSPATH . '/vendor/autoload.php';

Expand Down
6 changes: 3 additions & 3 deletions includes/class-depay-wc-payments-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ public function __construct(DePay_WC_Payments_Settings $settings) {
}

public function scripts_and_styles() {
wp_register_script('DEPAY_WC_WIDGETS', plugins_url( 'dist/widgets.bundle.js', DEPAY_WC_PLUGIN_FILE ), array(), '0.0.11', true);
wp_register_script('DEPAY_WC_WIDGETS', plugins_url( 'dist/widgets.bundle.js', DEPAY_WC_PLUGIN_FILE ), array(), DEPAY_CURRENT_VERSION, true);
wp_enqueue_script( 'DEPAY_WC_WIDGETS' );
wp_register_style( 'DEPAY_WC_ADMIN', plugins_url( 'assets/css/admin.css', DEPAY_WC_PLUGIN_FILE ), array(), '0.0.11' );
wp_register_style( 'DEPAY_WC_ADMIN', plugins_url( 'assets/css/admin.css', DEPAY_WC_PLUGIN_FILE ), array(), DEPAY_CURRENT_VERSION );
wp_enqueue_style( 'DEPAY_WC_ADMIN' );
wp_register_script('DEPAY_WC_ADMIN', plugins_url( 'dist/admin.js', DEPAY_WC_PLUGIN_FILE ), array('react', 'react-dom', 'wp-hooks', 'wp-element', 'wp-components', 'wp-api', 'wc-components', 'wc-navigation'), '0.0.11', true);
wp_register_script('DEPAY_WC_ADMIN', plugins_url( 'dist/admin.js', DEPAY_WC_PLUGIN_FILE ), array('react', 'react-dom', 'wp-hooks', 'wp-element', 'wp-components', 'wp-api', 'wc-components', 'wc-navigation'), DEPAY_CURRENT_VERSION, true);
wp_enqueue_script( 'DEPAY_WC_ADMIN' );
}

Expand Down
4 changes: 2 additions & 2 deletions includes/class-depay-wc-payments.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ public static function setup_checkout() {
}

public static function setup_checkout_scripts() {
wp_register_script('DEPAY_WC_WIDGETS', plugins_url( 'dist/widgets.bundle.js', DEPAY_WC_PLUGIN_FILE ), array(), '0.0.11', true);
wp_register_script('DEPAY_WC_WIDGETS', plugins_url( 'dist/widgets.bundle.js', DEPAY_WC_PLUGIN_FILE ), array(), DEPAY_CURRENT_VERSION, true);
wp_enqueue_script('DEPAY_WC_WIDGETS');
wp_register_script('DEPAY_WC_CHECKOUT', plugins_url( 'dist/checkout.js', DEPAY_WC_PLUGIN_FILE ), array('wp-api-request', 'jquery'), '0.0.11', true);
wp_register_script('DEPAY_WC_CHECKOUT', plugins_url( 'dist/checkout.js', DEPAY_WC_PLUGIN_FILE ), array('wp-api-request', 'jquery'), DEPAY_CURRENT_VERSION, true);
wp_enqueue_script('DEPAY_WC_CHECKOUT');
}

Expand Down
2 changes: 1 addition & 1 deletion languages/depay-woocommerce-payments.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# This file is distributed under the same license as the package.
msgid ""
msgstr ""
"Project-Id-Version: DePay WooCommerce Payments 0.0.11\n"
"Project-Id-Version: DePay WooCommerce Payments 1.0.0\n"
"Report-Msgid-Bugs-To: "
"[email protected]\n"
"MIME-Version: 1.0\n"
Expand Down
13 changes: 5 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@depay/web3-woocommerce-depay-payments",
"moduleName": "WooCommerceDePayPayments",
"version": "0.0.11",
"version": "1.0.0",
"description": "WooCommerce DePay plugin to accept Web3 payments directly into your wallet with on-the-fly conversion.",
"main": "./dist/umd/index.js",
"module": "./dist/esm/index.js",
Expand All @@ -10,13 +10,7 @@
],
"scripts": {
"build": "rollup -c rollup.build.config.js",
"lint": "eslint \"src/**/*.{js,jsx,ts,tsx}\"",
"lint:fix": "eslint \"src/**/*.{js,jsx,ts,tsx}\" --fix",
"prepublishOnly": "yarn build",
"test:jest": "npx jest --no-cache",
"test:cypress": "yarn cypress run",
"test:cypress:debug": "yarn cypress run --headed --no-exit",
"test": "yarn test:cypress"
"update:version": "node update-version.js"
},
"repository": "[email protected]:DePayFi/web3-woocommerce-depay-payments.git",
"keywords": [
Expand Down Expand Up @@ -57,10 +51,13 @@
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-react": "^7.21.5",
"eslint-plugin-react-hooks": "^4.2.0",
"open-file-explorer": "^1.0.2",
"prompt": "^1.3.0",
"react": "^18",
"react-dom": "^18",
"react-test-renderer": "^18",
"react-testing-library": "^8.0.1",
"replace-in-file": "^6.3.5",
"rollup": "^2.34.2",
"rollup-plugin-livereload": "^2.0.0",
"rollup-plugin-serve": "^1.1.0",
Expand Down
4 changes: 2 additions & 2 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,5 @@ Building on the idea that "Web3" is the next generation of a blockchain-based an

== Changelog ==

= 0.0.11 =
* Still testing
= 1.0.0 =
* First Version
24 changes: 24 additions & 0 deletions update-version.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const replace = require('replace-in-file')
const prompt = require('prompt')
const package = require('./package.json')
const openExplorer = require('open-file-explorer')

console.log(`Enter new version (current version ${package.version})`)
prompt.start()
prompt.get(['version'], async (err, result)=> {
if(!result.version) { return }
if(!result.version.match(/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/)){
console.log('WRONG VERSION FROMAT (see: https://semver.org)')
return
}

await replace({ files: './package.json', from: `"version": "${package.version}",`, to: `"version": "${result.version}",`})
await replace({ files: './readme.txt', from: `== Changelog ==`, to: `== Changelog ==\n\n= ${result.version} =\n*`})
await replace({ files: './depay-woocommerce-payments.php', from: `* Version: ${package.version}`, to: `* Version: ${result.version}`})
await replace({ files: './depay-woocommerce-payments.php', from: `define( 'DEPAY_CURRENT_VERSION', '${package.version}' );`, to: `define( 'DEPAY_CURRENT_VERSION', '${result.version}' );`})
await replace({ files: './languages/depay-woocommerce-payments.pot', from: `Project-Id-Version: DePay WooCommerce Payments ${package.version}`, to: `Project-Id-Version: DePay WooCommerce Payments ${result.version}`})

console.log('Dont forget to add a changelog entry to readme.txt')
openExplorer('./readme.txt')
})

Loading

0 comments on commit 0af2619

Please sign in to comment.