Skip to content

Commit

Permalink
Merge branch 'master' into fix/toolbar-block-highlight-rendering
Browse files Browse the repository at this point in the history
  • Loading branch information
Jon Q committed Jun 30, 2020
2 parents 1bd4189 + c2c083c commit 6e2e085
Show file tree
Hide file tree
Showing 95 changed files with 3,095 additions and 2,323 deletions.
129 changes: 129 additions & 0 deletions docs/architecture/folder-structure.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
# Folder Structure

The following snippet explains how the Gutenberg repository is structured omitting irrelevant or obvious items with further explanations:

├── LICENSE
├── README.md
├── SECURITY.md
├── CONTRIBUTING.md
├── CONTRIBUTORS.md
├── CODE_OF_CONDUCT.md
├── .editorconfig
├── .eslintignore
├── .eslintrc
├── .jshintignore
├── .eslintignore
├── .prettierrc.js
├── .stylelintrc.json
├── .markdownlintignore
├── .npmpackagejsonlintrc.json
├── phpcs.xml.dist
│ Dot files and config files used to configure the various linting tools
│ used in the repository (PHP, JS, styles...).
├── .browserslistrc
├── babel.config.js
├── jsconfig.json
├── tsconfig.json
├── tsconfig.base.json
├── webpack.config.js
│ Transpilation and bundling Config files.
├── .wp-env.json
│ Config file for the development and testing environment.
│ Includes WordPress and the Gutenberg plugin.
├── composer.lock
├── composer.json
│ Handling of PHP dependencies. Essentially used for development tools.
│ The production code don't use external PHP dependencies.
├── package-lock.json
├── package.json
│ Handling of JavaScript dependencies. Both for development tools and
│ production dependencies.
│ The package.json also serves to define common tasks and scripts
| used for day to day development.
├── changelog.txt
├── readme.txt
│ Readme and Changelog of the Gutenberg plugin hosted on the WordPress
│ plugin repository.
├── gutenberg.php
│ Entry point of the Gutenberg plugin.
├── post-content.php
│ Demo post content used on the Gutenberg plugin to showcase the editor.
├── .github/*
│ Config of the different Github features (issues and PR templates, CI, owners).
├── bin/api-docs
│ Tool/script used to generate the API Docs.
├── bin/packages
│ Set of scripts used to build the WordPress packages.
├── bin/plugin
│ Tool use to perform the Gutenberg plugin release and the npm releases as well.
├── docs/tool
│ Tool used to generate the Block editor handbook's markdown pages.
├── docs/*.md
│ Set of documentation pages composing the [Block editor handbook](https://developer.wordpress.org/block-editor/).
├── lib
│ PHP Source code of the Gutenberg plugin.
├── packages
│ Source code of the WordPress packages.
│ Packages can be:
│ - Production JavaScript scripts and styles loaded on WordPress
│ and the Gutenberg plugin or distributed as npm packages.
│ - Development tools available on npm.
├── packages/{packageName}/package.json
│ Dependencies of the current package.
├── packages/{packageName}/CHANGELOG.md
├── packages/{packageName}/README.md
├── packages/{packageName}/src/**/*.js
├── packages/{packageName}/src/**/*.scss
│ Source code of a given package.
|
├── packages/{packageName}/src/**/*.test.js
│ JavaScript unit tests.
|
├── packages/{packageName}/src/**/{ComponentName}/index.js
│ Entry point of a given component.
|
├── packages/{packageName}/src/**/{ComponentName}/style.scss
│ Style entry point for a given component.
├── packages/{packageName}/src/**/{ComponentName}/stories/*.js
│ Component Stories to load on the Gutenberg storybook.
├── packages/e2e-tests
│ End-2-end tests of the Gutenberg plugin.
│ Distributed as a package for potential reuse in Core and other plugins.
├── phpunit
│ Unit tests for the PHP code of the Gutenberg plugin.
├── storybook
│ Config of the [Gutenberg Storybook](http://wordpress.github.io).
├── test/integration
│ Set of WordPress packages integration tests.
├── test/native
│ Configuration for the Gutenberg Mobile unit tests.
└── test/unit
Configuration for the Packages unit tests.

1 change: 1 addition & 0 deletions docs/architecture/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

This living document serves as a high-level documentation to explain the conceptual choices and tool choices in the Gutenberg repository.

- [Understand the repository folder structure](/docs/architecture/folder-structure.md).
- [Modularity and WordPress Packages](/docs/architecture/modularity.md).
- [Block Editor Performance](/docs/architecture/performance.md).
- What are the decision decisions behind the Data Module?
Expand Down
6 changes: 6 additions & 0 deletions docs/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
"markdown_source": "../docs/architecture/readme.md",
"parent": "principles"
},
{
"title": "Folder Structure",
"slug": "folder-structure",
"markdown_source": "../docs/architecture/folder-structure.md",
"parent": "architecture"
},
{
"title": "Modularity",
"slug": "modularity",
Expand Down
6 changes: 3 additions & 3 deletions docs/rfc/block-registration.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,9 +149,9 @@ Blocks are grouped into categories to help users browse and discover them.

The core provided categories are:

- common
- formatting
- layout
- text
- media
- design
- widgets
- embed

Expand Down
1 change: 1 addition & 0 deletions docs/toc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

{ "docs/contributors/principles.md": [
{ "docs/architecture/readme.md": [
{ "docs/architecture/folder-structure.md": [] },
{ "docs/architecture/modularity.md": [] },
{ "docs/architecture/performance.md": [] },
{ "docs/architecture/automated-testing.md": [] }
Expand Down
2 changes: 1 addition & 1 deletion lib/template-loader.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ function gutenberg_override_query_template( $template, $type, array $templates =
function create_auto_draft_for_template_part_block( $block ) {
$template_part_ids = array();

if ( 'core/template-part' === $block['blockName'] ) {
if ( 'core/template-part' === $block['blockName'] && isset( $block['attrs']['slug'] ) ) {
if ( isset( $block['attrs']['postId'] ) ) {
// Template part is customized.
$template_part_id = $block['attrs']['postId'];
Expand Down
Loading

0 comments on commit 6e2e085

Please sign in to comment.