-
Notifications
You must be signed in to change notification settings - Fork 810
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Gutenblocks: Revert move to JP (#11682)
* Revert "Add source for Gutenberg extensions (#11633)" This reverts commit a2bf967. * Revert "Build: Prepare tooling for Gutenberg extensions in Jetpack (#11639)" This reverts commit 0d14622.
- Loading branch information
Showing
226 changed files
with
150 additions
and
15,391 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,20 @@ | ||
<?php | ||
|
||
// The repo root path. | ||
$path = dirname( dirname( __FILE__ ) ) . '/'; | ||
|
||
// Build an iterator over all files in the repo that match the regex in the RegexIterator. | ||
$path = dirname( dirname( __FILE__ ) ) . '/'; | ||
$directory = new RecursiveDirectoryIterator( $path ); | ||
$iterator = new RecursiveIteratorIterator( $directory ); | ||
$regex = new RegexIterator( $iterator, '/^.+\.(css|js)$/i', RecursiveRegexIterator::GET_MATCH ); | ||
|
||
$ignore_paths = array( | ||
'_inc/client/', | ||
'bin/', | ||
'docker/', | ||
'docs/', | ||
'extensions/', | ||
'logs/', | ||
'node_modules/', | ||
'tests/', | ||
'tools/', | ||
'vendor/', | ||
); | ||
|
||
$manifest = array(); | ||
foreach ( $regex as $path_to_file => $value ) { | ||
$path_from_repo_root = str_replace( $path, '', $path_to_file ); | ||
|
||
// Ignore top-level files. | ||
if ( false === strpos( $path_from_repo_root, '/' ) ) { | ||
foreach ( $regex as $file => $value ) { | ||
$file = str_replace( $path, '', $file ); | ||
$directory = substr( $file, 0, strpos( $file, '/' ) ); | ||
if ( in_array( $directory, array( 'node_modules', 'tests' ) ) ) { | ||
continue; | ||
} | ||
|
||
// Ignore explicit ignore list. | ||
foreach ( $ignore_paths as $ignore_path ) { | ||
if ( 0 === strpos( $path_from_repo_root, $ignore_path ) ) { | ||
continue 2; | ||
} | ||
} | ||
|
||
$manifest[] = $path_from_repo_root; | ||
$manifest[] = $file; | ||
} | ||
|
||
$export = var_export( $manifest, true ); | ||
|
||
file_put_contents( $path . 'modules/photon-cdn/jetpack-manifest.php', "<?php | ||
// This file is autogenerated by bin/build-asset-cdn-json.php | ||
\$assets = $export;\r\n" ); | ||
file_put_contents( $path . 'modules/photon-cdn/jetpack-manifest.php', "<?php \r\n\$assets = $export;\r\n" ); |
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 |
---|---|---|
@@ -1,38 +1,40 @@ | ||
# Jetpack Block Editor Extensions | ||
|
||
This directory lists extensions for the Block Editor, also known as Gutenberg, | ||
[that was introduced in WordPress 5.0](https://wordpress.org/news/2018/12/bebo/). | ||
This directory lists extensions for the Block Editor, also known as Gutenberg, [that was introduced in WordPress 5.0](https://wordpress.org/news/2018/12/bebo/). | ||
|
||
## Extension Type | ||
|
||
We define different types of block editor extensions: | ||
|
||
- Blocks are available in the editor itself. | ||
- Plugins are available in the Jetpack sidebar that appears on the right side of the block editor. | ||
- Blocks are available in the editor itself, and live in the `blocks` directory. | ||
- Plugins are available in the Jetpack sidebar that appears on the right side of the block editor. Those live in the `plugins` directory. | ||
|
||
When adding a new extension, add a new directory for your extension the matching directory. | ||
|
||
## Extension Structure | ||
|
||
Extensions loosely follow this structure: | ||
Your extension should follow this structure: | ||
|
||
``` | ||
. | ||
└── block-or-plugin-name/ | ||
├── block-or-plugin-name.php ← PHP file where the block and its assets are registered. | ||
├── editor.js ← script loaded only in the editor | ||
├── editor.scss ← styles loaded only in the editor | ||
├── view.js ← script loaded in the editor and theme | ||
└── view.scss ← styles loaded in the editor and theme | ||
└── blockname/ | ||
└── blockname.php ← PHP file where the block and its assets are registered. | ||
``` | ||
|
||
If your block depends on another block, place them all in extensions folder: | ||
|
||
``` | ||
. | ||
├── block-name/ | ||
├── blockname/ | ||
└── sub-blockname/ | ||
``` | ||
|
||
**Note that this directory is still being populated. For now, you can find the blocks [here](https://github.com/Automattic/wp-calypso/tree/master/client/gutenberg/extensions). | ||
|
||
## Develop new blocks | ||
|
||
Coming when [#11640](https://github.com/Automattic/jetpack/pull/11640) lands. | ||
You can follow [the instructions here](../docs/guides/gutenberg-blocks.md) to add your own block to Jetpack. | ||
|
||
## Block naming conventions | ||
|
||
Blocks should use the `jetpack/` prefix, e.g. `jetpack/markdown`. |
200 changes: 0 additions & 200 deletions
200
extensions/blocks/business-hours/components/day-edit.js
This file was deleted.
Oops, something went wrong.
58 changes: 0 additions & 58 deletions
58
extensions/blocks/business-hours/components/day-preview.js
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.