You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+27-28Lines changed: 27 additions & 28 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,12 +47,24 @@ Create Guten Block is not like other [starter-kits](https://github.com/ahmadawai
47
47
48
48
## GETTING STARTED!
49
49
50
-
It's really easy to get started with `create-guten-block`. Just install it as a global module and run it to create your next-gen Gutenberg block plugin for WordPress.
50
+
Let's create a WordPress block plugin...
51
+
52
+
#### β‘οΈ Quick Overview
53
+
54
+
Run step `#1` and `#2` quickly in one go β Run inside local WP install E.g. `/wp.local/wp-content/plugins/` directory.
55
+
```sh
56
+
npx create-guten-block my-block
57
+
cd my-block
58
+
npm start
59
+
```
60
+
([npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) comes with npm 5.2+ and higher, see [instructions for older npm versions](https://gist.github.com/ahmadawais/e4c69b22561c7079c9d99faba90e3b23))
61
+
62
+
63
+
> π _If you want to study the detailed installation of step `#1` and `#2` β then take a look at the steps below_.
51
64
52
-
_Let's get you started!_
53
65
54
66
<details>
55
-
<summary><strong> STEP #0</strong> β If you don't have <code>Node.js</code> + <code>npm</code> installed then read this. (CLICK TO EXPAND!)</summary>
67
+
<summary><strong> STEP #0</strong> β Don't have <code>Node.js</code> + <code>npm</code> installed? Read this. (CLICK TO EXPAND!)</summary>
56
68
57
69
In case you are an absolute beginner to the world of `Node.js`, JavaScript, and `npm` packages β all you need to do is go to the Node's site [download + install](https://nodejs.org/en/download/) Node on your system. This will install both `Node.js` and `npm`, i.e., node package manager β the command line interface of Node.js.
58
70
@@ -70,29 +82,21 @@ npm -v
70
82
71
83
### β STEP #1
72
84
73
-
Install `create-guten-block`globally on your system.
85
+
All you have to do is run the following command and it will create a WordPress block plugin. It's done by installing and running the `create-guten-block`command and providing it with a unique name for a WordPress plugin that will get created.
74
86
75
-
Youβll need to have Node >= 8 on your local development machine (but itβs not required on the server). You can use [nvm](https://github.com/creationix/nvm#installation) (macOS/Linux) or [nvm-windows](https://github.com/coreybutler/nvm-windows#node-version-manager-nvm-for-windows) to easily switch Node versions between different projects.
76
87
88
+
> β οΈ Make sure run this command in your local WordPress install's plugins folder i.e. `/local_dev_site.tld/wp-content/plugins/` folder β since this command will produce a WordPress plugin that you can go to `WP Admin` βΆοΈ `Plugins` to activate.
77
89
78
90
```sh
79
-
npm install create-guten-block --global
91
+
npx create-guten-block my-block
80
92
```
93
+
([npx](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) comes with npm 5.2+ and higher, see [instructions for older npm versions](https://gist.github.com/ahmadawais/e4c69b22561c7079c9d99faba90e3b23))
81
94
82
-

95
+

83
96
84
97
_It'll take a couple of minutes to install._
85
98
86
-
### β STEP #2
87
-
88
-
Now all you have to do is create a gutenberg block and start building. It's done by running the `create-guten-block` command and providing it with a unique name for a WordPress plugin that will get created.
89
-
90
-
> β οΈ Make sure run this command in your local WordPress install's plugins folder i.e. `/local_dev_site.tld/wp-content/plugins/` folder β since this command will produce a WordPress plugin that you can go to `WP Admin` βΆοΈ `Plugins` to activate.
91
-
92
-
```sh
93
-
create-guten-block my-block
94
-
```
95
-

99
+
>Youβll need to have Node >= 8 and npm >= 5.3 on your local development machine (but itβs not required on the server). You can use [nvm](https://github.com/creationix/nvm#installation) (macOS/Linux) or [nvm-windows](https://github.com/coreybutler/nvm-windows#node-version-manager-nvm-for-windows) to easily switch Node versions between different projects.
96
100
97
101
It will create a directory called `my-block` inside the current folder.
98
102
Inside that directory, it will generate the initial project structure and install the transitive dependencies:
1.**`create-guten-block`** is a global command-line utility that you use to create new WP Gutenberg plugins.
240
+
1.**`create-guten-block`** is a command-line utility that you use to create new WP Gutenberg plugins.
238
241
1.**`cgb-scripts`** is a development dependency in the generated plugin projects.
239
242
240
-
You almost never need to update `create-guten-block` itself: it delegates all the setup to `cgb-scripts`. But as this project matures, there might be a few changes over time and you can re-run the global install.
241
-
242
-
```js
243
-
npm install create-guten-block --global
244
-
```
243
+
You never need to update `create-guten-block` itself as it's run via [`npx`](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) and it delegates all the setup to `cgb-scripts`.
245
244
246
245
When you run `create-guten-block`, it always creates the project with the latest version of `cgb-scripts` so youβll get all the new features and improvements in newly created plugins automatically.
247
246
@@ -335,4 +334,4 @@ This FOSS (free and open source software) project is updated and maintained with
This project is inspired by the work of more people than I could mention here. But thank you, [Dan Abramov](https://twitter.com/dan_abramov) for Create React App, [Andrew Clark](https://twitter.com/acdlite), and [Christopher Chedeau](https://twitter.com/vjeux), [Sophie Alpert](https://twitter.com/sophiebits) from React.js team, [Wes Bos](https://twitter.com/wesbos) for awesome courses for [React](https://ReactForBeginners.com/friend/AHMADAWAIS), [ES6](https://ES6.io/friend/AHMADAWAIS), and [Node](https://LearnNode.com/friend/AHMADAWAIS) beginners. [Kent C. Dodds](https://twitter.com/kentcdodds) for his open source evangelism, WordPress Core Contributors, [Gary](https://twitter.com/GaryPendergast) for keeping everyone sane, [Gutenberg](http://github.com/wordpress/gutenberg) developers [Matias](https://twitter.com/matias_ventura), [Riad](https://github.com/youknowriad), [Andrew](https://github.com/aduth), [Ella](https://twitter.com/ellaiseulde), [Joen](https://github.com/jasmussen), [Tammie](https://twitter.com/karmatosed), [Greg](https://twitter.com/gziolo) and contributors, and other WordPress community members like [Zac](https://twitter.com/zgordon) for his [course on Gutenberg](https://ahmda.ws/ZacGutenbergCourse), and also my friend [Morten](https://twitter.com/mor10) for all the #Guten-motivation, [Icons8](https://icons8.com/) for the awesome icons, [Maedah](https://twitter.com/MaedahBatool/) for managing this project, and to everyone I forgot.
337
+
This project is inspired by the work of more people than I could mention here. But thank you, [Dan Abramov](https://twitter.com/dan_abramov) for Create React App, [Andrew Clark](https://twitter.com/acdlite), and [Christopher Chedeau](https://twitter.com/vjeux), [Sophie Alpert](https://twitter.com/sophiebits) from React.js team, [Wes Bos](https://twitter.com/wesbos) for awesome courses for [React](https://ReactForBeginners.com/friend/AHMADAWAIS), [ES6](https://ES6.io/friend/AHMADAWAIS), and [Node](https://LearnNode.com/friend/AHMADAWAIS) beginners. [Kent C. Dodds](https://twitter.com/kentcdodds) for his open source evangelism, WordPress Core Contributors, [Gary](https://twitter.com/GaryPendergast) for keeping everyone sane, [Gutenberg](http://github.com/wordpress/gutenberg) developers [Matias](https://twitter.com/matias_ventura), [Riad](https://github.com/youknowriad), [Andrew](https://github.com/aduth), [Ella](https://twitter.com/ellaiseulde), [Joen](https://github.com/jasmussen), [Tammie](https://twitter.com/karmatosed), [Greg](https://twitter.com/gziolo) and contributors, and other WordPress community members like [Zac](https://twitter.com/zgordon) for his [course on Gutenberg](https://ahmda.ws/ZacGutenbergCourse), and also my friend [Morten](https://twitter.com/mor10) for all the #Guten-motivation, [Icons8](https://icons8.com/) for the awesome icons, [Maedah](https://twitter.com/MaedahBatool/) for managing this project, and to everyone I forgot.
0 commit comments