Skip to content

Commit

Permalink
new minimal-block example plus adjustments
Browse files Browse the repository at this point in the history
  • Loading branch information
juanmaguitar committed Oct 8, 2023
1 parent acf1bb9 commit 07cebeb
Show file tree
Hide file tree
Showing 30 changed files with 1,967 additions and 212 deletions.
115 changes: 0 additions & 115 deletions .github/workflows/e2e-tests.yml

This file was deleted.

1 change: 1 addition & 0 deletions .wp-env.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"./plugins/static-block-b16608",
"./plugins/editable-block-1b8c51",
"./plugins/non-block-react-wp-data-56d6f3",
"./plugins/minimal-gutenberg-block-ca6eda",
"https://downloads.wordpress.org/plugin/gutenberg.16.5.1.zip"
],
"config": {
Expand Down
43 changes: 16 additions & 27 deletions CONTRIBUTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,55 +2,44 @@

## Conventions used for each example in this repo

> [!IMPORTANT]
> The example `slug` should follow the convention `<plugin-slug>-<unique-code>`
- [ ] Each plugin has its own `<unique-code>`
- Get it by running `npm run code:get` from the root of the project
- [ ] Plugin **folder name** should follow the convention `<plugin-slug>-<unique-code>`
- Get it by running `npm run get:hexcode` from the root of the project
- [ ] Plugin **folder name** should be the `<slug>`
- Ex: `dynamic-block-64756b`
- On **`<plugin-folder>/package.json`**
- [ ] **`name`** should follow the convention `@gutenberg-examples/<plugin-slug>-<unique-code>`
- [ ] **`name`** should follow the convention `@gutenberg-examples/<slug>`
- Ex: `"name": "@gutenberg-examples/static-block-b16608"`
- [ ] **`description`** should be descriptive and brief
- Ex: `"description": "Very basic static block"`
- [ ] **`files`** property should be set to `*`
- Ex: `"files": [ "*" ]`
- [ ] **`scripts`**
- It should have the following [scripts](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-scripts/) defined:
- It should have, at least, the following [scripts](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-scripts/) defined:
```
"scripts": {
"build": "wp-scripts build",
"check-engines": "wp-scripts check-engines",
"check-licenses": "wp-scripts check-licenses",
"format": "wp-scripts format",
"lint:css": "wp-scripts lint-style",
"lint:js": "wp-scripts lint-js",
"lint:md:docs": "wp-scripts lint-md-docs",
"lint:pkg-json": "wp-scripts lint-pkg-json",
"packages-update": "wp-scripts packages-update",
"plugin-zip": "wp-scripts plugin-zip",
"start": "wp-scripts start",
"test:e2e": "wp-scripts test-e2e",
"test:unit": "wp-scripts test-unit-js"
"start": "wp-scripts start"
}
```

- On **`<plugin-folder>/index.php`** the `Plugin Name` should follow the convention: `Gutenberg Examples` - `<plugin-title>` + `<unique-code>`
- On **`<plugin-folder>/index.php`** the `Plugin Name` should follow the convention: `Gutenberg Examples` - `<slug>`
- Ex `Plugin Name: Gutenberg Examples - Non Block React WP Data 56d6f3`
- On **`<plugin-folder>/src/block.json`**
- [ ] **`name`** should follow the convention `gutenberg-examples/<plugin-slug>-<unique-code>`
- [ ] **`name`** should follow the convention `gutenberg-examples/<slug>`
- Ex: `"name": "gutenberg-examples/static-block-b16608"`
- [ ] **`title`** should start with the emoji ⭐️
- Ex: `"title": "⭐️ Block Dynamic"`
"title": "⭐️ Block Dynamic",
- [ ] **`keywords`** should include the `<unique-code>`, the `Gutenberg Examples` text and the tags associated to the example
- Ex: `"keywords": [ "64756b", "Gutenberg Examples", "Dynamic", "Create Block" ]`
- [ ] Block CSS class should follow the convention `.wp-block-gutenberg-examples-<plugin-slug>-<unique-code>`
"title": "Block Dynamic",
- [ ] **`keywords`** should include, at least, the `<unique-code>`
- Ex: `"keywords": [ "64756b"]`
- [ ] Block CSS class should follow the convention `.wp-block-gutenberg-examples-<slug>`
- Ex: `.wp-block-gutenberg-examples-editable-block-1b8c51`
- On **`<root-folder>/.wp-env.json`**
- [ ] The local path of the plugin/example (starting from root) should be included in the array `"plugins"`
- Ex: `"./plugins/basic-block-3df23d"`
- On **`<root-folder>/README.md`**
- [ ] Add a new row with the plugin/example info
- Ex: `| ![]( https://placehold.co/15x15/833d15/833d15 ) | 833d15 | Block Interactive | [interactive-block-833d15](./plugins/interactive-block-833d15) | |`
- [ ] Add a new row with the plugin/example info. You can do so by running `npm run table:add -- <slug>`
- Ex: `npm run table:add -- minimal-gutenberg-block-ca6eda`

After ensuring these changes a new install of dependencies and build should be run from the root of the project

Expand Down
Loading

0 comments on commit 07cebeb

Please sign in to comment.