-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #44 from wptrainingteam/feature/migrate-06-inner-b…
…locks-esnext Migrate 06-inner-blocks-esnext
- Loading branch information
Showing
17 changed files
with
240 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# 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 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
indent_style = tab | ||
|
||
[*.{yml,yaml}] | ||
indent_style = space | ||
indent_size = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
"extends": [ "plugin:@wordpress/eslint-plugin/recommended" ], | ||
"settings": { | ||
"jest": { | ||
"version": 26 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# Coverage directory used by tools like istanbul | ||
coverage | ||
|
||
# Compiled binary addons (https://nodejs.org/api/addons.html) | ||
build/Release | ||
|
||
# Dependency directories | ||
node_modules/ | ||
|
||
# Optional npm cache directory | ||
.npm | ||
|
||
# Optional eslint cache | ||
.eslintcache | ||
|
||
# Output of `npm pack` | ||
*.tgz | ||
|
||
# Output of `wp-scripts plugin-zip` | ||
*.zip | ||
|
||
# dotenv environment variables file | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
### Block Development Examples - Inner Blocks dcd824 | ||
|
||
<!-- Please, do not remove these @TABLE EXAMPLES BEGIN and @TABLE EXAMPLES END comments or modify the table inside. This table is automatically generated from the data at data/examples.json and data/tags.json --> | ||
<!-- @TABLE EXAMPLES BEGIN --> | ||
| Folder | <span style="display: inline-block; width:250px">Short description</span> | Tags | ID ([❓](https://github.com/wptrainingteam/block-development-examples/wiki/04-Why-an-ID-for-every-example%3F "Why an ID for every example?")) | Download .zip | Live Demo | | ||
| --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| [📁](https://github.com/wptrainingteam/block-development-examples/tree/trunk/plugins/inner-blocks-dcd824) | Inner Blocks | <small><code><a href="https://github.com/wptrainingteam/block-development-examples/wiki/03-Tags#">undefined</a></code></small> | `dcd824` | [📦](https://raw.githubusercontent.com/wptrainingteam/block-development-examples/deploy/zips/inner-blocks-dcd824.zip "Install the plugin using this zip and activate it. Then use the ID of the block (dcd824) to find it and add it to a post to see it in action") | [![](https://raw.githubusercontent.com/wptrainingteam/block-development-examples/trunk/assets/icon-wp.svg)](https://playground.wordpress.net/#%7B%22landingPage%22:%22/wp-admin/plugins.php%22,%22steps%22:%5B%7B%22step%22:%22login%22,%22username%22:%22admin%22,%22password%22:%22password%22%7D,%7B%22step%22:%22mkdir%22,%22path%22:%22/downloads%22%7D,%7B%22step%22:%22writeFile%22,%22path%22:%22/downloads/plugin.zip%22,%22data%22:%7B%22resource%22:%22url%22,%22url%22:%22https://raw.githubusercontent.com/wptrainingteam/block-development-examples/deploy/zips/inner-blocks-dcd824.zip%22,%22caption%22:%22Downloading%20plugin...%22%7D%7D,%7B%22step%22:%22installPlugin%22,%22pluginZipFile%22:%7B%22resource%22:%22vfs%22,%22path%22:%22/downloads/plugin.zip%22%7D%7D%5D%7D "Use the ID of the block (dcd824) to find it and add it to a post to see it in action") | | ||
<!-- @TABLE EXAMPLES END --> | ||
|
||
## Start Guide | ||
|
||
#### 1. Install dependencies | ||
|
||
Check the [Repo Commands > Dependencies](../../DEVELOPMENT.md#dependencies) instructions for this repo | ||
|
||
#### 2. Generate the build | ||
|
||
Once the dependencies are installed (a `node_modules` folder should have been created), we should [launch the build process](../../DEVELOPMENT.md#build-process) to get the final version of the block that can be used from WordPress. | ||
|
||
#### 3. Use it in a WordPress | ||
|
||
Check the [WordPress Local Development Environment](../../DEVELOPMENT.md#wordpress-local-development-environment) instructions for this repo. | ||
|
||
<details> | ||
<summary><em>If you have a local WordPress installation already running, you can clone the repo inside the <code>plugins</code> folder of that installation and check the example there</em></summary> | ||
<br> | ||
<p>If you do that, you'll need to do the following</p> | ||
<ul> | ||
<li>Remove any <code>node_modules</code> folder inside this folder</li> | ||
<li>Run <code>npm install</code> to install the dependencies</li> | ||
<li>Run <code>npm build</code> to generate the "build" version of the blocks</li> | ||
<li>Activate the plugin in your own WordPress installation</li> | ||
<ul> | ||
</details> | ||
<br> | ||
|
||
At this point you should be able to insert the custom blocks into any post (after activating the plugin) of your WordPress installation, and see how it behaves in the frontend when published. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"$schema": "https://schemas.wp.org/trunk/block.json", | ||
"apiVersion": 3, | ||
"name": "block-development-examples/inner-blocks-dcd824", | ||
"version": "0.1.0", | ||
"title": "Inner Blocks dcd824", | ||
"category": "widgets", | ||
"example": {}, | ||
"textdomain": "block-development-examples", | ||
"editorScript": "file:./index.js", | ||
"keywords": [ | ||
"dcd824" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<?php return array('dependencies' => array('react', 'wp-block-editor', 'wp-blocks'), 'version' => '36f8841581169f541992'); |
Oops, something went wrong.