From 6260b85a722ba4b6b41c4a34111398361da34dd0 Mon Sep 17 00:00:00 2001 From: RahiDroid Date: Tue, 19 Apr 2022 20:32:34 +0530 Subject: [PATCH 1/2] Feat: Trigger 'npm i' post 'composer install' --- composer.json | 5 ++++- package-lock.json | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/composer.json b/composer.json index b719a537..aa504c0a 100644 --- a/composer.json +++ b/composer.json @@ -36,6 +36,9 @@ }, "scripts": { "phpcs" : "@php ./vendor/bin/phpcs", - "phpcs:fix" : "@php ./vendor/bin/phpcbf" + "phpcs:fix" : "@php ./vendor/bin/phpcbf", + "post-install-cmd": [ + "npm i" + ] } } diff --git a/package-lock.json b/package-lock.json index a68e7677..0aedd99b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,7 @@ "": { "name": "elementary-theme", "version": "1.0.0", - "license": "GPL-2.0-or-later", + "license": "MIT", "devDependencies": { "@babel/core": "7.17.8", "@wordpress/babel-preset-default": "6.7.0", From 1b25b093e048cc2bc011f7bc766b4f0178df41f9 Mon Sep 17 00:00:00 2001 From: RahiDroid Date: Tue, 19 Apr 2022 20:57:02 +0530 Subject: [PATCH 2/2] Doc: Update Readme, include composer create-project command --- README.md | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index cb43527e..519f9f5f 100644 --- a/README.md +++ b/README.md @@ -38,10 +38,24 @@ A [Block based](https://developer.wordpress.org/block-editor/how-to-guides/theme ``` ## Get Started :rocket: -1. Clone this repository using `git clone [URL to Git repo]` -1. Having cloned this repository, install node packages and PHP dependencies using: `composer install && npm install`. -That was all! You're good to go with building your block theme. :sparkles: +### Method 1 (Recommended) +``` +composer create-project rtcamp/elementary . --stability="dev" +``` +This command is equivalant of cloning the repository and running `composer install && npm install` + +### Method 2 +Manually clone this repository using +``` +git clone [URL to Git repo] +``` +Having cloned this repository, install node packages and PHP dependencies using +``` +composer install && npm install +``` + +In both the methods, you will be prompted with a theme setup wizard which will help you with the search-replace. That was all! You're good to go with building your block theme. :sparkles: **Note**: Refer to the `.nvmrc` file to check the supported Node.js version for running this project. If your current Node.js version does not run the project successfully on localhost, please use [Node Version Manager](https://github.com/nvm-sh/nvm) on your terminal to configure the right Node.js version.