[go: nahoru, domu]

Skip to content

Commit

Permalink
Update extend-cart-checkout-block dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
nielslange committed Mar 14, 2023
1 parent 31ec8d8 commit 42235d1
Show file tree
Hide file tree
Showing 10 changed files with 80 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Import the default config file and expose it in the project root.
// Useful for editor integrations.
module.exports = require( '@wordpress/prettier-config' );
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class {{slugPascalCase}}_Blocks_Integration implements IntegrationInterface {
$style_url = plugins_url( $style_path, __FILE__ );
wp_enqueue_style(
'{{slug}}-blocks-integration',
'{{slug}}-checkout-newsletter-subscription-block',
$style_url,
[],
$this->get_file_version( $style_path )
Expand Down
27 changes: 27 additions & 0 deletions packages/js/extend-cart-checkout-block/.editorconfig.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# This file is for unifying the coding style for different editors and IDEs
# editorconfig.org

# WordPress Coding Standards
# https://make.wordpress.org/core/handbook/coding-standards/

root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
tab_width = 4
indent_style = tab
insert_final_newline = true
trim_trailing_whitespace = true

[*.txt]
trim_trailing_whitespace = false

[*.{md,json,yml}]
trim_trailing_whitespace = false
indent_style = space
indent_size = 2

[*.json]
indent_style = tab
1 change: 1 addition & 0 deletions packages/js/extend-cart-checkout-block/.nvmrc.mustache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
16.13.2
23 changes: 20 additions & 3 deletions packages/js/extend-cart-checkout-block/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,29 @@
This is a template to be used with `@wordpress/create-block` to create a WooCommerce Blocks extension starting point.

## Installation

From your `plugins` directory run:
```

```sh
npx @wordpress/create-block -t @woocommerce/extend-cart-checkout-block your_extension_name
```

When this has completed, go to your WordPress plugins page and activate the plugin.

Add some items to your cart and visit the Checkout block, notice there is additional data on the block that this
template has added.
Add some items to your cart and visit the Checkout block, notice there is additional data on the block that this template has added.

### Installing `wp-prettier` (optional)

WooCommerce Blocks uses `wp-prettier` to format the JS files. If you want to use `wp-prettier`, you will need to run the following command:

```sh
nvm use && npm i --D "prettier@npm:wp-prettier@latest"
```

### Installing `wp-env` (optional)

`wp-env` lets you easily set up a local WordPress environment for building and testing your extension. If you want to use `wp-env`, you will need to run the following command:

```sh
nvm use && npm i -D @wordpress/env && npm set-script wp-env "wp-env"
```
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Significance: patch
Type: update

This patch includes the following changes:

- Add `prettier:npm:wp-prettier@2.6.2`
- Add `.wp-env`
- Add `.nvmrc`
- Correct CSS handle of newsletter subscription block
- Correct metadata category of newsletter subscription block
2 changes: 2 additions & 0 deletions packages/js/extend-cart-checkout-block/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ module.exports = {
npmDevDependencies: [
'@woocommerce/dependency-extraction-webpack-plugin',
'@woocommerce/eslint-plugin',
'@wordpress/prettier-config',
'@wordpress/scripts',
],
},
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"phpVersion": null,
"core": null,
"plugins": [
"https://downloads.wordpress.org/plugin/woocommerce.latest-stable.zip",
"https://downloads.wordpress.org/plugin/woo-gutenberg-products-block.latest-stable.zip",
"."
],
"config": {
"JETPACK_AUTOLOAD_DEV": true,
"WP_DEBUG": true,
"SCRIPT_DEBUG": true
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"name": "{{slug}}/checkout-newsletter-subscription",
"version": "2.0.0",
"title": "Newsletter Subscription!",
"category": "{{slug}}",
"category": "woocommerce",
"description": "Adds a newsletter subscription checkbox to the checkout.",
"supports": {
"html": false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ module.exports = {

// Add code here to prepend to all .scss/.sass files.
return (
'@import "_colors"; ' +
content
'@import "colors"; ' + content
);
},
},
Expand Down

0 comments on commit 42235d1

Please sign in to comment.