From 2fe87d21c3c5c02e16be3806e98c9a31c60ff133 Mon Sep 17 00:00:00 2001 From: Grzegorz Ziolkowski Date: Thu, 21 Apr 2022 12:59:57 +0200 Subject: [PATCH 1/4] Scripts: Remove deprecated `format-js` command --- packages/scripts/CHANGELOG.md | 4 +++ packages/scripts/scripts/format-js.js | 36 --------------------------- 2 files changed, 4 insertions(+), 36 deletions(-) delete mode 100644 packages/scripts/scripts/format-js.js diff --git a/packages/scripts/CHANGELOG.md b/packages/scripts/CHANGELOG.md index b522d5eaddc4e9..a3b0b9e1d05e0b 100644 --- a/packages/scripts/CHANGELOG.md +++ b/packages/scripts/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +## Breaking Changes + +- Remove the previously deprecated and undocumented `format-js` command. + ## 22.4.0 (2022-04-08) ### New Feature diff --git a/packages/scripts/scripts/format-js.js b/packages/scripts/scripts/format-js.js deleted file mode 100644 index 76dc3e91cd137b..00000000000000 --- a/packages/scripts/scripts/format-js.js +++ /dev/null @@ -1,36 +0,0 @@ -/** - * External dependencies - */ -const chalk = require( 'chalk' ); - -/** - * Internal dependencies - */ -const { getNodeArgsFromCLI, spawnScript } = require( '../utils' ); - -const { scriptArgs, nodeArgs } = getNodeArgsFromCLI(); - -const keypress = async () => { - process.stdin.setRawMode( true ); - return new Promise( ( resolve ) => - process.stdin.once( 'data', () => { - process.stdin.setRawMode( false ); - resolve(); - } ) - ); -}; - -( async () => { - const message = - `Please note that the ${ chalk.red( - 'format-js' - ) } script has been renamed to ${ chalk.green( 'format' ) }.\n` + - "If you're calling it from any of your own scripts, please update them accordingly.\n" + - 'Press any key to continue.'; - - // eslint-disable-next-line no-console - console.log( message ); - - await keypress(); - spawnScript( 'format', scriptArgs, nodeArgs ); -} )(); From 77da18fdf33e5f7463b29470a3465ebaaff5340e Mon Sep 17 00:00:00 2001 From: Grzegorz Ziolkowski Date: Thu, 21 Apr 2022 13:04:32 +0200 Subject: [PATCH 2/4] Update CHANGELOG --- packages/scripts/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/scripts/CHANGELOG.md b/packages/scripts/CHANGELOG.md index a3b0b9e1d05e0b..6a175f4e65f484 100644 --- a/packages/scripts/CHANGELOG.md +++ b/packages/scripts/CHANGELOG.md @@ -4,7 +4,7 @@ ## Breaking Changes -- Remove the previously deprecated and undocumented `format-js` command. +- Remove the previously deprecated and undocumented `format-js` command ([#40512](https://github.com/WordPress/gutenberg/pull/40512)). ## 22.4.0 (2022-04-08) From 4450e303d1da4dfbde4a2768422ca1194d040fb9 Mon Sep 17 00:00:00 2001 From: Grzegorz Ziolkowski Date: Thu, 21 Apr 2022 13:05:25 +0200 Subject: [PATCH 3/4] Update CHANGELOG --- packages/scripts/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/scripts/CHANGELOG.md b/packages/scripts/CHANGELOG.md index 6a175f4e65f484..dd3c731ae23ac9 100644 --- a/packages/scripts/CHANGELOG.md +++ b/packages/scripts/CHANGELOG.md @@ -4,7 +4,7 @@ ## Breaking Changes -- Remove the previously deprecated and undocumented `format-js` command ([#40512](https://github.com/WordPress/gutenberg/pull/40512)). +- Remove the previously deprecated and undocumented `format-js` command ([#40512](https://github.com/WordPress/gutenberg/pull/40512)). You should use the `format` command instead. ## 22.4.0 (2022-04-08) From 6a20faf39b9d36cce054eccfecd45231804f43b1 Mon Sep 17 00:00:00 2001 From: Grzegorz Ziolkowski Date: Thu, 21 Apr 2022 14:05:08 +0200 Subject: [PATCH 4/4] Remove more occurrences of `format-js` --- .../data-basics/1-data-basics-setup.md | 42 ++++++++++--------- package.json | 1 - 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/docs/how-to-guides/data-basics/1-data-basics-setup.md b/docs/how-to-guides/data-basics/1-data-basics-setup.md index fdaffdd3655815..e899da5bf4a1da 100644 --- a/docs/how-to-guides/data-basics/1-data-basics-setup.md +++ b/docs/how-to-guides/data-basics/1-data-basics-setup.md @@ -8,14 +8,15 @@ Also, this tutorial will lean heavily on Redux concepts such as state, actions, We'll do all the development inside of a WordPress plugin. Let's start by creating a `wp-content/plugins/my-first-gutenberg-app` directory in your local WordPress environment. We will need to create four files inside that directory: -* my-first-gutenberg-app.php – to create a new admin page -* src/index.js – for our JavaScript application -* style.css – for the minimal stylesheet -* package.json – for the build process +- my-first-gutenberg-app.php – to create a new admin page +- src/index.js – for our JavaScript application +- style.css – for the minimal stylesheet +- package.json – for the build process Go ahead and create these files using the following snippets: **src/index.js:** + ```js import { render } from '@wordpress/element'; @@ -23,18 +24,23 @@ function MyFirstApp() { return Hello from JavaScript!; } -window.addEventListener( 'load', function() { - render( - , - document.querySelector( '#my-first-gutenberg-app' ) - ); -}, false ); +window.addEventListener( + 'load', + function () { + render( + , + document.querySelector( '#my-first-gutenberg-app' ) + ); + }, + false +); ``` **style.css:** + ```css .toplevel_page_my-first-gutenberg-app #wpcontent { - background: #FFF; + background: #fff; height: 1000px; } #my-first-gutenberg-app { @@ -68,6 +74,7 @@ window.addEventListener( 'load', function() { ``` **my-first-gutenberg-app.php:** + ```php