diff --git a/.github/workflows/block-json-check.yml b/.github/workflows/block-json-check.yml new file mode 100644 index 0000000..b4fdfa2 --- /dev/null +++ b/.github/workflows/block-json-check.yml @@ -0,0 +1,29 @@ +name: Test for block.json files. + +on: + pull_request: + branches: [ trunk, develop ] + +jobs: + block-file-check: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Get all files + id: changed-block-json-files + uses: tj-actions/changed-files@v44 + + - name: Leave a comment and reject PR if block.json file is present + if: contains(steps.changed-block-json-files.outputs.all_changed_files, 'block.json') + uses: actions/github-script@v7 + with: + script: | + github.rest.issues.createComment({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + body: '> [!CAUTION]\n> This PR includes a `block.json` file. If you are adding a new block, please ensure this goes into [the WPCOM Special Projects Monorepo](https://github.com/a8cteam51/special-projects-blocks-monorepo) instead. You will find[ full documentation on the process here](https://github.com/a8cteam51/special-projects-blocks-monorepo/wiki). Please discuss with WPComSP Engineering Leads if you believe your block should be exempt from the monorepo.' + }) + core.setFailed('This PR included a block.json file and so was rejected.') diff --git a/.github/workflows/fill-in-scaffold.yml b/.github/workflows/fill-in-scaffold.yml index 332b7df..64c507e 100644 --- a/.github/workflows/fill-in-scaffold.yml +++ b/.github/workflows/fill-in-scaffold.yml @@ -30,7 +30,6 @@ jobs: git submodule update git mv --force README.scaffold.md README.md git mv themes/build-processes-demo themes/${{ github.event.repository.name }} - git mv mu-plugins/build-processes-demo-blocks mu-plugins/${{ github.event.repository.name }}-blocks git mv mu-plugins/build-processes-demo-features mu-plugins/${{ github.event.repository.name }}-features - name: Commit the changed files. diff --git a/.gitignore b/.gitignore index a2435c3..968e393 100644 --- a/.gitignore +++ b/.gitignore @@ -15,7 +15,6 @@ mu-plugins/* !mu-plugins/mu-loader.php !mu-plugins/colophon !mu-plugins/team51-tracking -!mu-plugins/build-processes-demo-blocks !mu-plugins/build-processes-demo-features themes/* diff --git a/README.md b/README.md index c035a47..f5d3e74 100644 --- a/README.md +++ b/README.md @@ -80,11 +80,7 @@ FSE template parts are included in this to show desired folder structure only. Y ### Gutenberg blocks -All custom-built blocks must be placed in a mu-plugin. The demo project contains a mu-plugin called `build-processes-demo-blocks` which exemplifies building two blocks called `build-processes-demo/foobar` and `build-processes-demo/spamham`, respectively. - -By separating the blocks from the theme into a mu-plugin, we can ensure that the blocks are always available on the site, even if the theme is changed (e.g., because of a future redesign or as part of the debugging process). Moreover, it forces us, as developers, to think about the blocks as a separate entity from the theme and to design the code as such thus making it easier to reuse them in other projects. - -The mu-plugin must contain enough CSS for the block to be functional and not appear broken. All other styling can be held in the mu-plugin or the theme. [Seedlet is an example](https://github.com/Automattic/themes/tree/trunk/seedlet/assets/sass/blocks) of a theme providing its own styling for the blocks. +Custom blocks should now use the [WPCom Special Projects Blocks Monorepo](https://github.com/a8cteam51/special-projects-blocks-monorepo). You'll find full written documentation for how to use this system [in the Wiki of the repo](https://github.com/a8cteam51/special-projects-blocks-monorepo/wiki). ### Features plugin diff --git a/composer.json b/composer.json index 46b166f..fb4743c 100644 --- a/composer.json +++ b/composer.json @@ -47,30 +47,22 @@ "scripts": { "format:php": [ "@format:php:theme", - "@format:php:blocks", "@format:php:features" ], "format:php:theme": "phpcbf --standard=./themes/build-processes-demo/.phpcs.xml.dist --basepath=. ./themes/build-processes-demo -v", - "format:php:blocks": "phpcbf --standard=./mu-plugins/build-processes-demo-blocks/.phpcs.xml.dist --basepath=. ./mu-plugins/build-processes-demo-blocks -v", "format:php:features": "phpcbf --standard=./mu-plugins/build-processes-demo-features/.phpcs.xml.dist --basepath=. ./mu-plugins/build-processes-demo-features -v", "lint:php": [ "@lint:php:theme", - "@lint:php:blocks", "@lint:php:features" ], "lint:php:theme": "phpcs --standard=./themes/build-processes-demo/.phpcs.xml.dist --basepath=. ./themes/build-processes-demo -v", - "lint:php:blocks": "phpcs --standard=./mu-plugins/build-processes-demo-blocks/.phpcs.xml.dist --basepath=. ./mu-plugins/build-processes-demo-blocks -v", "lint:php:features": "phpcs --standard=./mu-plugins/build-processes-demo-features/.phpcs.xml.dist --basepath=. ./mu-plugins/build-processes-demo-features -v", "internationalize": [ "@makepot:theme", "@updatepo:theme", - "@makepot:blocks", - "@updatepo:blocks", - "@makejson:blocks", - "@makepot:features", "@updatepo:features" ], @@ -79,11 +71,6 @@ "updatepo:theme": "wp i18n update-po themes/build-processes-demo/languages/build-processes-demo.pot", "makemo:theme": "wp i18n make-mo themes/build-processes-demo/languages", - "makepot:blocks": "wp i18n make-pot mu-plugins/build-processes-demo-blocks", - "updatepo:blocks": "wp i18n update-po mu-plugins/build-processes-demo-blocks/languages/build-processes-demo-blocks.pot", - "makejson:blocks": "wp i18n make-json mu-plugins/build-processes-demo-blocks/languages --pretty-print --no-purge", - "makemo:blocks": "wp i18n make-mo mu-plugins/build-processes-demo-blocks/languages", - "makepot:features": "wp i18n make-pot mu-plugins/build-processes-demo-features", "updatepo:features": "wp i18n update-po mu-plugins/build-processes-demo-features/languages/build-processes-demo-features.pot", "makemo:features": "wp i18n make-mo mu-plugins/build-processes-demo-features/languages", diff --git a/mu-plugins/build-processes-demo-blocks/.phpcs.xml.dist b/mu-plugins/build-processes-demo-blocks/.phpcs.xml.dist deleted file mode 100644 index 7e2cfc0..0000000 --- a/mu-plugins/build-processes-demo-blocks/.phpcs.xml.dist +++ /dev/null @@ -1,28 +0,0 @@ - - - Custom ruleset for the Build Processes Demo site custom blocks. - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/mu-plugins/build-processes-demo-blocks/build-processes-demo-blocks.php b/mu-plugins/build-processes-demo-blocks/build-processes-demo-blocks.php deleted file mode 100644 index 602ef8f..0000000 --- a/mu-plugins/build-processes-demo-blocks/build-processes-demo-blocks.php +++ /dev/null @@ -1,44 +0,0 @@ - array('react', 'wp-block-editor', 'wp-blocks', 'wp-i18n'), 'version' => '7ca65f205b3d240a0d1a'); diff --git a/mu-plugins/build-processes-demo-blocks/build/foobar/index.css b/mu-plugins/build-processes-demo-blocks/build/foobar/index.css deleted file mode 100644 index c8b399f..0000000 --- a/mu-plugins/build-processes-demo-blocks/build/foobar/index.css +++ /dev/null @@ -1 +0,0 @@ -.wp-block-create-block-todo-list{border:1px dotted red} diff --git a/mu-plugins/build-processes-demo-blocks/build/foobar/index.js b/mu-plugins/build-processes-demo-blocks/build/foobar/index.js deleted file mode 100644 index 203cc03..0000000 --- a/mu-plugins/build-processes-demo-blocks/build/foobar/index.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,o={314:()=>{const e=window.wp.blocks,o=window.React,r=window.wp.i18n,s=window.wp.blockEditor,t=JSON.parse('{"UU":"build-processes-demo/foobar"}');(0,e.registerBlockType)(t.UU,{edit:function(){return(0,o.createElement)("p",{...(0,s.useBlockProps)()},(0,r.__)("Todo List – hello from the editor!","build-processes-demo-blocks"))},save:function(){return(0,o.createElement)("p",{...s.useBlockProps.save()},(0,r.__)("Todo List – hello from the saved content from foobar!","build-processes-demo-blocks"))}})}},r={};function s(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={exports:{}};return o[e](i,i.exports,s),i.exports}s.m=o,e=[],s.O=(o,r,t,i)=>{if(!r){var n=1/0;for(p=0;p=i)&&Object.keys(s.O).every((e=>s.O[e](r[c])))?r.splice(c--,1):(l=!1,i0&&e[p-1][2]>i;p--)e[p]=e[p-1];e[p]=[r,t,i]},s.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),(()=>{var e={409:0,541:0};s.O.j=o=>0===e[o];var o=(o,r)=>{var t,i,[n,l,c]=r,a=0;if(n.some((o=>0!==e[o]))){for(t in l)s.o(l,t)&&(s.m[t]=l[t]);if(c)var p=c(s)}for(o&&o(r);as(314)));t=s.O(t)})(); \ No newline at end of file diff --git a/mu-plugins/build-processes-demo-blocks/build/foobar/style-index.css b/mu-plugins/build-processes-demo-blocks/build/foobar/style-index.css deleted file mode 100644 index 92a65d9..0000000 --- a/mu-plugins/build-processes-demo-blocks/build/foobar/style-index.css +++ /dev/null @@ -1 +0,0 @@ -.wp-block-create-block-todo-list{background-color:#21759b;color:#fff;padding:2px} diff --git a/mu-plugins/build-processes-demo-blocks/build/foobar/view.asset.php b/mu-plugins/build-processes-demo-blocks/build/foobar/view.asset.php deleted file mode 100644 index 2f8edfd..0000000 --- a/mu-plugins/build-processes-demo-blocks/build/foobar/view.asset.php +++ /dev/null @@ -1 +0,0 @@ - array(), 'version' => 'e4f9e5fad1b89bab144d'); diff --git a/mu-plugins/build-processes-demo-blocks/build/foobar/view.js b/mu-plugins/build-processes-demo-blocks/build/foobar/view.js deleted file mode 100644 index b2baf2c..0000000 --- a/mu-plugins/build-processes-demo-blocks/build/foobar/view.js +++ /dev/null @@ -1 +0,0 @@ -console.log("Hello World! (from foobar block)"); \ No newline at end of file diff --git a/mu-plugins/build-processes-demo-blocks/build/spamham/block.json b/mu-plugins/build-processes-demo-blocks/build/spamham/block.json deleted file mode 100644 index efb0a21..0000000 --- a/mu-plugins/build-processes-demo-blocks/build/spamham/block.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "$schema": "https://schemas.wp.org/trunk/block.json", - "apiVersion": 3, - "name": "build-processes-demo/spamham", - "version": "0.1.0", - "title": "SpamHam Block", - "category": "widgets", - "icon": "smiley", - "description": "Example block scaffolded with Create Block tool.", - "supports": { - "html": false - }, - "textdomain": "build-processes-demo-blocks", - "editorScript": "file:./index.js", - "editorStyle": "file:./index.css", - "style": "file:./style-index.css", - "viewScript": "file:./view.js" -} \ No newline at end of file diff --git a/mu-plugins/build-processes-demo-blocks/build/spamham/index.asset.php b/mu-plugins/build-processes-demo-blocks/build/spamham/index.asset.php deleted file mode 100644 index a6b723f..0000000 --- a/mu-plugins/build-processes-demo-blocks/build/spamham/index.asset.php +++ /dev/null @@ -1 +0,0 @@ - array('react', 'wp-block-editor', 'wp-blocks', 'wp-i18n'), 'version' => '99b507a2085594109135'); diff --git a/mu-plugins/build-processes-demo-blocks/build/spamham/index.css b/mu-plugins/build-processes-demo-blocks/build/spamham/index.css deleted file mode 100644 index c8b399f..0000000 --- a/mu-plugins/build-processes-demo-blocks/build/spamham/index.css +++ /dev/null @@ -1 +0,0 @@ -.wp-block-create-block-todo-list{border:1px dotted red} diff --git a/mu-plugins/build-processes-demo-blocks/build/spamham/index.js b/mu-plugins/build-processes-demo-blocks/build/spamham/index.js deleted file mode 100644 index 0a62201..0000000 --- a/mu-plugins/build-processes-demo-blocks/build/spamham/index.js +++ /dev/null @@ -1 +0,0 @@ -(()=>{"use strict";var e,o={36:()=>{const e=window.wp.blocks,o=window.React,r=window.wp.i18n,s=window.wp.blockEditor,t=JSON.parse('{"UU":"build-processes-demo/spamham"}');(0,e.registerBlockType)(t.UU,{edit:function(){return(0,o.createElement)("p",{...(0,s.useBlockProps)()},(0,r.__)("Todo List – hello from the editor!","build-processes-demo-blocks"))},save:function(){return(0,o.createElement)("p",{...s.useBlockProps.save()},(0,r.__)("Todo List – hello from the saved content from spamham!","build-processes-demo-blocks"))}})}},r={};function s(e){var t=r[e];if(void 0!==t)return t.exports;var i=r[e]={exports:{}};return o[e](i,i.exports,s),i.exports}s.m=o,e=[],s.O=(o,r,t,i)=>{if(!r){var n=1/0;for(p=0;p=i)&&Object.keys(s.O).every((e=>s.O[e](r[a])))?r.splice(a--,1):(l=!1,i0&&e[p-1][2]>i;p--)e[p]=e[p-1];e[p]=[r,t,i]},s.o=(e,o)=>Object.prototype.hasOwnProperty.call(e,o),(()=>{var e={375:0,983:0};s.O.j=o=>0===e[o];var o=(o,r)=>{var t,i,[n,l,a]=r,c=0;if(n.some((o=>0!==e[o]))){for(t in l)s.o(l,t)&&(s.m[t]=l[t]);if(a)var p=a(s)}for(o&&o(r);cs(36)));t=s.O(t)})(); \ No newline at end of file diff --git a/mu-plugins/build-processes-demo-blocks/build/spamham/style-index.css b/mu-plugins/build-processes-demo-blocks/build/spamham/style-index.css deleted file mode 100644 index 92a65d9..0000000 --- a/mu-plugins/build-processes-demo-blocks/build/spamham/style-index.css +++ /dev/null @@ -1 +0,0 @@ -.wp-block-create-block-todo-list{background-color:#21759b;color:#fff;padding:2px} diff --git a/mu-plugins/build-processes-demo-blocks/build/spamham/view.asset.php b/mu-plugins/build-processes-demo-blocks/build/spamham/view.asset.php deleted file mode 100644 index b66bbc7..0000000 --- a/mu-plugins/build-processes-demo-blocks/build/spamham/view.asset.php +++ /dev/null @@ -1 +0,0 @@ - array(), 'version' => '7f7ecf737046d3460562'); diff --git a/mu-plugins/build-processes-demo-blocks/build/spamham/view.js b/mu-plugins/build-processes-demo-blocks/build/spamham/view.js deleted file mode 100644 index 0b66dc1..0000000 --- a/mu-plugins/build-processes-demo-blocks/build/spamham/view.js +++ /dev/null @@ -1 +0,0 @@ -console.log("Hello World! (from spamham block)"); \ No newline at end of file diff --git a/mu-plugins/build-processes-demo-blocks/includes/index.php b/mu-plugins/build-processes-demo-blocks/includes/index.php deleted file mode 100644 index 49d255d..0000000 --- a/mu-plugins/build-processes-demo-blocks/includes/index.php +++ /dev/null @@ -1 +0,0 @@ - 1);" - }, - "Todo List \u2013 hello from the saved content from foobar!": [ - "Todo List \u2013 ol\u00e1 do conte\u00fado salvo do foobar!" - ] - } - } -} \ No newline at end of file diff --git a/mu-plugins/build-processes-demo-blocks/languages/build-processes-demo-blocks-pt_BR-62306f07e46a696df40c04ed00be9347.json b/mu-plugins/build-processes-demo-blocks/languages/build-processes-demo-blocks-pt_BR-62306f07e46a696df40c04ed00be9347.json deleted file mode 100644 index 787408b..0000000 --- a/mu-plugins/build-processes-demo-blocks/languages/build-processes-demo-blocks-pt_BR-62306f07e46a696df40c04ed00be9347.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "translation-revision-date": "2022-12-15 22:53-0300", - "generator": "WP-CLI\/2.10.0", - "source": "build\/spamham\/index.js", - "domain": "messages", - "locale_data": { - "messages": { - "": { - "domain": "messages", - "lang": "pt_BR", - "plural-forms": "nplurals=2; plural=(n > 1);" - }, - "Todo List \u2013 hello from the editor!": [ - "Todo List \u2013 ol\u00e1 do editor!" - ], - "Todo List \u2013 hello from the saved content from spamham!": [ - "Todo List \u2013 ol\u00e1 do conte\u00fado salvo do spamham!" - ] - } - } -} \ No newline at end of file diff --git a/mu-plugins/build-processes-demo-blocks/languages/build-processes-demo-blocks-pt_BR-6d26648a83d0938df57a8214a30bfe3a.json b/mu-plugins/build-processes-demo-blocks/languages/build-processes-demo-blocks-pt_BR-6d26648a83d0938df57a8214a30bfe3a.json deleted file mode 100644 index 9d1b456..0000000 --- a/mu-plugins/build-processes-demo-blocks/languages/build-processes-demo-blocks-pt_BR-6d26648a83d0938df57a8214a30bfe3a.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "translation-revision-date": "2022-12-15 22:53-0300", - "generator": "WP-CLI\/2.10.0", - "source": "src\/foobar\/edit.js", - "domain": "messages", - "locale_data": { - "messages": { - "": { - "domain": "messages", - "lang": "pt_BR", - "plural-forms": "nplurals=2; plural=(n > 1);" - }, - "Todo List \u2013 hello from the editor!": [ - "Todo List \u2013 ol\u00e1 do editor!" - ] - } - } -} \ No newline at end of file diff --git a/mu-plugins/build-processes-demo-blocks/languages/build-processes-demo-blocks-pt_BR-c9765000425dbc84461459e2139c909a.json b/mu-plugins/build-processes-demo-blocks/languages/build-processes-demo-blocks-pt_BR-c9765000425dbc84461459e2139c909a.json deleted file mode 100644 index d09291d..0000000 --- a/mu-plugins/build-processes-demo-blocks/languages/build-processes-demo-blocks-pt_BR-c9765000425dbc84461459e2139c909a.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "translation-revision-date": "2022-12-15 22:53-0300", - "generator": "WP-CLI\/2.10.0", - "source": "src\/spamham\/save.js", - "domain": "messages", - "locale_data": { - "messages": { - "": { - "domain": "messages", - "lang": "pt_BR", - "plural-forms": "nplurals=2; plural=(n > 1);" - }, - "Todo List \u2013 hello from the saved content from spamham!": [ - "Todo List \u2013 ol\u00e1 do conte\u00fado salvo do spamham!" - ] - } - } -} \ No newline at end of file diff --git a/mu-plugins/build-processes-demo-blocks/languages/build-processes-demo-blocks-pt_BR-dcf90255c130f6304074a9c28ed264e8.json b/mu-plugins/build-processes-demo-blocks/languages/build-processes-demo-blocks-pt_BR-dcf90255c130f6304074a9c28ed264e8.json deleted file mode 100644 index b0f0a29..0000000 --- a/mu-plugins/build-processes-demo-blocks/languages/build-processes-demo-blocks-pt_BR-dcf90255c130f6304074a9c28ed264e8.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "translation-revision-date": "2022-12-15 22:53-0300", - "generator": "WP-CLI\/2.10.0", - "source": "src\/spamham\/edit.js", - "domain": "messages", - "locale_data": { - "messages": { - "": { - "domain": "messages", - "lang": "pt_BR", - "plural-forms": "nplurals=2; plural=(n > 1);" - }, - "Todo List \u2013 hello from the editor!": [ - "Todo List \u2013 ol\u00e1 do editor!" - ] - } - } -} \ No newline at end of file diff --git a/mu-plugins/build-processes-demo-blocks/languages/build-processes-demo-blocks-pt_BR-e9c088d1a85a612091ae2409b056f300.json b/mu-plugins/build-processes-demo-blocks/languages/build-processes-demo-blocks-pt_BR-e9c088d1a85a612091ae2409b056f300.json deleted file mode 100644 index fb0e760..0000000 --- a/mu-plugins/build-processes-demo-blocks/languages/build-processes-demo-blocks-pt_BR-e9c088d1a85a612091ae2409b056f300.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "translation-revision-date": "2022-12-15 22:53-0300", - "generator": "WP-CLI\/2.10.0", - "source": "build\/foobar\/index.js", - "domain": "messages", - "locale_data": { - "messages": { - "": { - "domain": "messages", - "lang": "pt_BR", - "plural-forms": "nplurals=2; plural=(n > 1);" - }, - "Todo List \u2013 hello from the editor!": [ - "Todo List \u2013 ol\u00e1 do editor!" - ], - "Todo List \u2013 hello from the saved content from foobar!": [ - "Todo List \u2013 ol\u00e1 do conte\u00fado salvo do foobar!" - ] - } - } -} \ No newline at end of file diff --git a/mu-plugins/build-processes-demo-blocks/languages/build-processes-demo-blocks-pt_BR.mo b/mu-plugins/build-processes-demo-blocks/languages/build-processes-demo-blocks-pt_BR.mo deleted file mode 100644 index 530121f..0000000 Binary files a/mu-plugins/build-processes-demo-blocks/languages/build-processes-demo-blocks-pt_BR.mo and /dev/null differ diff --git a/mu-plugins/build-processes-demo-blocks/languages/build-processes-demo-blocks-pt_BR.po b/mu-plugins/build-processes-demo-blocks/languages/build-processes-demo-blocks-pt_BR.po deleted file mode 100644 index 54e0ae3..0000000 --- a/mu-plugins/build-processes-demo-blocks/languages/build-processes-demo-blocks-pt_BR.po +++ /dev/null @@ -1,72 +0,0 @@ -msgid "" -msgstr "" -"Project-Id-Version: Build Processes Demo Blocks 0.1.0\n" -"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/build-processes-demo-blocks\n" -"Last-Translator: \n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2022-12-16T01:48:48+00:00\n" -"PO-Revision-Date: 2022-12-15 22:53-0300\n" -"Language: pt_BR\n" -"Plural-Forms: nplurals=2; plural=(n > 1);\n" -"X-Generator: Poedit 3.2.2\n" -"X-Domain: build-processes-demo-blocks\n" - -#. Plugin Name of the plugin -#: build-processes-demo-blocks.php -msgid "Build Processes Demo Blocks" -msgstr "Blocos de demonstração de processos de build" - -#. Description of the plugin -#: build-processes-demo-blocks.php -msgid "Example block scaffolded with Create Block tool." -msgstr "Bloco de exemplo criado com o Create Block." - -#. Author URI of the plugin -#: build-processes-demo-blocks.php -msgid "https://wpspecialprojects.wordpress.com/" -msgstr "" - -#: build/foobar/index.js:1 -#: build/spamham/index.js:1 -#: src/foobar/edit.js:35 -#: src/spamham/edit.js:35 -msgid "Todo List – hello from the editor!" -msgstr "Todo List – olá do editor!" - -#: build/foobar/index.js:1 -#: src/foobar/save.js:28 -msgid "Todo List – hello from the saved content from foobar!" -msgstr "Todo List – olá do conteúdo salvo do foobar!" - -#: build/spamham/index.js:1 -#: src/spamham/save.js:28 -msgid "Todo List – hello from the saved content from spamham!" -msgstr "Todo List – olá do conteúdo salvo do spamham!" - -#: build/foobar/block.json -#: src/foobar/block.json -msgctxt "block title" -msgid "FooBar Block" -msgstr "Bloco FooBar" - -#: build/foobar/block.json -#: build/spamham/block.json -#: src/foobar/block.json -#: src/spamham/block.json -msgctxt "block description" -msgid "Example block scaffolded with Create Block tool." -msgstr "Bloco de exemplo criado com o Create Block." - -#: build/spamham/block.json -#: src/spamham/block.json -msgctxt "block title" -msgid "SpamHam Block" -msgstr "Bloco SpamHam" - -#. Author of the plugin -#: build-processes-demo-blocks.php -msgid "WordPress.com Special Projects" -msgstr "" diff --git a/mu-plugins/build-processes-demo-blocks/languages/build-processes-demo-blocks.pot b/mu-plugins/build-processes-demo-blocks/languages/build-processes-demo-blocks.pot deleted file mode 100644 index f44b87f..0000000 --- a/mu-plugins/build-processes-demo-blocks/languages/build-processes-demo-blocks.pot +++ /dev/null @@ -1,72 +0,0 @@ -# Copyright (C) 2024 WordPress.com Special Projects -# This file is distributed under the GPL-3.0-or-later. -msgid "" -msgstr "" -"Project-Id-Version: Build Processes Demo Blocks 0.1.0\n" -"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/build-processes-demo-blocks\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2024-03-29T12:45:54+00:00\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"X-Generator: WP-CLI 2.10.0\n" -"X-Domain: build-processes-demo-blocks\n" - -#. Plugin Name of the plugin -#: build-processes-demo-blocks.php -msgid "Build Processes Demo Blocks" -msgstr "" - -#. Description of the plugin -#: build-processes-demo-blocks.php -msgid "Example block scaffolded with Create Block tool." -msgstr "" - -#. Author of the plugin -#: build-processes-demo-blocks.php -msgid "WordPress.com Special Projects" -msgstr "" - -#. Author URI of the plugin -#: build-processes-demo-blocks.php -msgid "https://wpspecialprojects.wordpress.com/" -msgstr "" - -#: build/foobar/index.js:1 -#: build/spamham/index.js:1 -#: src/foobar/edit.js:35 -#: src/spamham/edit.js:35 -msgid "Todo List – hello from the editor!" -msgstr "" - -#: build/foobar/index.js:1 -#: src/foobar/save.js:28 -msgid "Todo List – hello from the saved content from foobar!" -msgstr "" - -#: build/spamham/index.js:1 -#: src/spamham/save.js:28 -msgid "Todo List – hello from the saved content from spamham!" -msgstr "" - -#: build/foobar/block.json -#: src/foobar/block.json -msgctxt "block title" -msgid "FooBar Block" -msgstr "" - -#: build/foobar/block.json -#: build/spamham/block.json -#: src/foobar/block.json -#: src/spamham/block.json -msgctxt "block description" -msgid "Example block scaffolded with Create Block tool." -msgstr "" - -#: build/spamham/block.json -#: src/spamham/block.json -msgctxt "block title" -msgid "SpamHam Block" -msgstr "" diff --git a/mu-plugins/build-processes-demo-blocks/languages/index.php b/mu-plugins/build-processes-demo-blocks/languages/index.php deleted file mode 100644 index 49d255d..0000000 --- a/mu-plugins/build-processes-demo-blocks/languages/index.php +++ /dev/null @@ -1 +0,0 @@ - - { __( - 'Todo List – hello from the editor!', - 'build-processes-demo-blocks' - ) } -

- ); -} diff --git a/mu-plugins/build-processes-demo-blocks/src/foobar/editor.scss b/mu-plugins/build-processes-demo-blocks/src/foobar/editor.scss deleted file mode 100644 index f0f4913..0000000 --- a/mu-plugins/build-processes-demo-blocks/src/foobar/editor.scss +++ /dev/null @@ -1,9 +0,0 @@ -/** - * The following styles get applied inside the editor only. - * - * Replace them with your own styles or remove the file completely. - */ - -.wp-block-create-block-todo-list { - border: 1px dotted #f00; -} diff --git a/mu-plugins/build-processes-demo-blocks/src/foobar/index.js b/mu-plugins/build-processes-demo-blocks/src/foobar/index.js deleted file mode 100644 index ade1e47..0000000 --- a/mu-plugins/build-processes-demo-blocks/src/foobar/index.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Registers a new block provided a unique name and an object defining its behavior. - * - * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ - */ -import { registerBlockType } from '@wordpress/blocks'; - -/** - * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. - * All files containing `style` keyword are bundled together. The code used - * gets applied both to the front of your site and to the editor. - * - * @see https://www.npmjs.com/package/@wordpress/scripts#using-css - */ -import './style.scss'; - -/** - * Internal dependencies - */ -import Edit from './edit'; -import save from './save'; -import metadata from './block.json'; - -/** - * Every block starts by registering a new block type definition. - * - * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ - */ -registerBlockType( metadata.name, { - /** - * @see ./edit.js - */ - edit: Edit, - - /** - * @see ./save.js - */ - save, -} ); diff --git a/mu-plugins/build-processes-demo-blocks/src/foobar/save.js b/mu-plugins/build-processes-demo-blocks/src/foobar/save.js deleted file mode 100644 index f81469c..0000000 --- a/mu-plugins/build-processes-demo-blocks/src/foobar/save.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Retrieves the translation of text. - * - * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-i18n/ - */ -import { __ } from '@wordpress/i18n'; - -/** - * React hook that is used to mark the block wrapper element. - * It provides all the necessary props like the class name. - * - * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops - */ -import { useBlockProps } from '@wordpress/block-editor'; - -/** - * The save function defines the way in which the different attributes should - * be combined into the final markup, which is then serialized by the block - * editor into `post_content`. - * - * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#save - * - * @return {JSX.Element} Element to render. - */ -export default function save() { - return ( -

- { __( - 'Todo List – hello from the saved content from foobar!', - 'build-processes-demo-blocks' - ) } -

- ); -} diff --git a/mu-plugins/build-processes-demo-blocks/src/foobar/style.scss b/mu-plugins/build-processes-demo-blocks/src/foobar/style.scss deleted file mode 100644 index 785e1bd..0000000 --- a/mu-plugins/build-processes-demo-blocks/src/foobar/style.scss +++ /dev/null @@ -1,12 +0,0 @@ -/** - * The following styles get applied both on the front of your site - * and in the editor. - * - * Replace them with your own styles or remove the file completely. - */ - -.wp-block-create-block-todo-list { - background-color: #21759b; - color: #fff; - padding: 2px; -} diff --git a/mu-plugins/build-processes-demo-blocks/src/foobar/view.js b/mu-plugins/build-processes-demo-blocks/src/foobar/view.js deleted file mode 100644 index d43153f..0000000 --- a/mu-plugins/build-processes-demo-blocks/src/foobar/view.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Use this file for JavaScript code that you want to run in the front-end - * on posts/pages that contain this block. - * - * When this file is defined as the value of the `viewScript` property - * in `block.json` it will be enqueued on the front end of the site. - * - * Example: - * - * ```js - * { - * "viewScript": "file:./view.js" - * } - * ``` - * - * If you're not making any changes to this file because your project doesn't need any - * JavaScript running in the front-end, then you should delete this file and remove - * the `viewScript` property from `block.json`. - * - * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#view-script - */ - -/* eslint-disable no-console */ -console.log( 'Hello World! (from foobar block)' ); -/* eslint-enable no-console */ diff --git a/mu-plugins/build-processes-demo-blocks/src/index.php b/mu-plugins/build-processes-demo-blocks/src/index.php deleted file mode 100644 index 49d255d..0000000 --- a/mu-plugins/build-processes-demo-blocks/src/index.php +++ /dev/null @@ -1 +0,0 @@ - - { __( - 'Todo List – hello from the editor!', - 'build-processes-demo-blocks' - ) } -

- ); -} diff --git a/mu-plugins/build-processes-demo-blocks/src/spamham/editor.scss b/mu-plugins/build-processes-demo-blocks/src/spamham/editor.scss deleted file mode 100644 index f0f4913..0000000 --- a/mu-plugins/build-processes-demo-blocks/src/spamham/editor.scss +++ /dev/null @@ -1,9 +0,0 @@ -/** - * The following styles get applied inside the editor only. - * - * Replace them with your own styles or remove the file completely. - */ - -.wp-block-create-block-todo-list { - border: 1px dotted #f00; -} diff --git a/mu-plugins/build-processes-demo-blocks/src/spamham/index.js b/mu-plugins/build-processes-demo-blocks/src/spamham/index.js deleted file mode 100644 index ade1e47..0000000 --- a/mu-plugins/build-processes-demo-blocks/src/spamham/index.js +++ /dev/null @@ -1,39 +0,0 @@ -/** - * Registers a new block provided a unique name and an object defining its behavior. - * - * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ - */ -import { registerBlockType } from '@wordpress/blocks'; - -/** - * Lets webpack process CSS, SASS or SCSS files referenced in JavaScript files. - * All files containing `style` keyword are bundled together. The code used - * gets applied both to the front of your site and to the editor. - * - * @see https://www.npmjs.com/package/@wordpress/scripts#using-css - */ -import './style.scss'; - -/** - * Internal dependencies - */ -import Edit from './edit'; -import save from './save'; -import metadata from './block.json'; - -/** - * Every block starts by registering a new block type definition. - * - * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-registration/ - */ -registerBlockType( metadata.name, { - /** - * @see ./edit.js - */ - edit: Edit, - - /** - * @see ./save.js - */ - save, -} ); diff --git a/mu-plugins/build-processes-demo-blocks/src/spamham/save.js b/mu-plugins/build-processes-demo-blocks/src/spamham/save.js deleted file mode 100644 index eefcf97..0000000 --- a/mu-plugins/build-processes-demo-blocks/src/spamham/save.js +++ /dev/null @@ -1,34 +0,0 @@ -/** - * Retrieves the translation of text. - * - * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-i18n/ - */ -import { __ } from '@wordpress/i18n'; - -/** - * React hook that is used to mark the block wrapper element. - * It provides all the necessary props like the class name. - * - * @see https://developer.wordpress.org/block-editor/reference-guides/packages/packages-block-editor/#useblockprops - */ -import { useBlockProps } from '@wordpress/block-editor'; - -/** - * The save function defines the way in which the different attributes should - * be combined into the final markup, which is then serialized by the block - * editor into `post_content`. - * - * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-edit-save/#save - * - * @return {JSX.Element} Element to render. - */ -export default function save() { - return ( -

- { __( - 'Todo List – hello from the saved content from spamham!', - 'build-processes-demo-blocks' - ) } -

- ); -} diff --git a/mu-plugins/build-processes-demo-blocks/src/spamham/style.scss b/mu-plugins/build-processes-demo-blocks/src/spamham/style.scss deleted file mode 100644 index 785e1bd..0000000 --- a/mu-plugins/build-processes-demo-blocks/src/spamham/style.scss +++ /dev/null @@ -1,12 +0,0 @@ -/** - * The following styles get applied both on the front of your site - * and in the editor. - * - * Replace them with your own styles or remove the file completely. - */ - -.wp-block-create-block-todo-list { - background-color: #21759b; - color: #fff; - padding: 2px; -} diff --git a/mu-plugins/build-processes-demo-blocks/src/spamham/view.js b/mu-plugins/build-processes-demo-blocks/src/spamham/view.js deleted file mode 100644 index 5826de6..0000000 --- a/mu-plugins/build-processes-demo-blocks/src/spamham/view.js +++ /dev/null @@ -1,25 +0,0 @@ -/** - * Use this file for JavaScript code that you want to run in the front-end - * on posts/pages that contain this block. - * - * When this file is defined as the value of the `viewScript` property - * in `block.json` it will be enqueued on the front end of the site. - * - * Example: - * - * ```js - * { - * "viewScript": "file:./view.js" - * } - * ``` - * - * If you're not making any changes to this file because your project doesn't need any - * JavaScript running in the front-end, then you should delete this file and remove - * the `viewScript` property from `block.json`. - * - * @see https://developer.wordpress.org/block-editor/reference-guides/block-api/block-metadata/#view-script - */ - -/* eslint-disable no-console */ -console.log( 'Hello World! (from spamham block)' ); -/* eslint-enable no-console */ diff --git a/package.json b/package.json index 2b05ce6..6e4c096 100644 --- a/package.json +++ b/package.json @@ -49,7 +49,6 @@ ], "scripts": { "build": "npm-run-all --sequential build:**", - "build:blocks": "wp-scripts build --webpack-src-dir=mu-plugins/$npm_package_name-blocks/src --output-path=mu-plugins/$npm_package_name-blocks/build", "build:scripts:theme": "wp-scripts build --webpack-src-dir=themes/$npm_package_name/assets/js/src --output-path=themes/$npm_package_name/assets/js/build", "build:scripts:features": "wp-scripts build --webpack-src-dir=mu-plugins/$npm_package_name-features/assets/js/src --output-path=mu-plugins/$npm_package_name-features/assets/js/build", "build:styles:theme": "postcss themes/$npm_package_name/assets/css/src/*.scss --dir themes/$npm_package_name/assets/css/build --ext css --env production", @@ -75,7 +74,6 @@ "check-engines": "wp-scripts check-engines", "check-licenses": "wp-scripts check-licenses", "start": "npm-run-all --parallel start:**", - "start:blocks": "wp-scripts start --webpack-src-dir=mu-plugins/$npm_package_name-blocks/src --output-path=mu-plugins/$npm_package_name-blocks/build", "start:scripts:theme": "wp-scripts start --webpack-src-dir=themes/$npm_package_name/assets/js/src --output-path=themes/$npm_package_name/assets/js/build", "start:scripts:features": "wp-scripts start --webpack-src-dir=mu-plugins/$npm_package_name-features/assets/js/src --output-path=mu-plugins/$npm_package_name-features/assets/js/build", "start:styles:theme": "postcss themes/$npm_package_name/assets/css/src/*.scss --dir themes/$npm_package_name/assets/css/build --ext css --env development --watch --verbose",