Update extend-cart-checkout-block dependency

This commit is contained in:
Niels Lange 2023-03-14 11:54:12 +07:00
parent 31ec8d8352
commit 42235d1f31
No known key found for this signature in database
GPG Key ID: CAA376E87CD94FE3
10 changed files with 80 additions and 7 deletions

View File

@ -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' );

View File

@ -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 )

View File

@ -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

View File

@ -0,0 +1 @@
16.13.2

View File

@ -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"
```

View File

@ -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

View File

@ -4,6 +4,8 @@ module.exports = {
npmDevDependencies: [
'@woocommerce/dependency-extraction-webpack-plugin',
'@woocommerce/eslint-plugin',
'@wordpress/prettier-config',
'@wordpress/scripts',
],
},
};

View File

@ -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
}
}

View File

@ -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,

View File

@ -61,8 +61,7 @@ module.exports = {
// Add code here to prepend to all .scss/.sass files.
return (
'@import "_colors"; ' +
content
'@import "colors"; ' + content
);
},
},