Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/zero config setup #115

Merged
merged 111 commits into from
Jan 2, 2019
Merged

Feature/zero config setup #115

merged 111 commits into from
Jan 2, 2019

Conversation

MetarDev
Copy link
Contributor

Still a WIP, opening a PR so this is all tracked.

Updated setup process for boilerplate that should be as simple and intuitive as possible while working on all platforms.

Currently it's 1 script (npm run setup) for setting everything up, after which user can follow the manual WordPress wizard install (by going to website's local url) or try the automatic setup depending on his local dev setup.

Would appreciate any feedback on intuitiveness of this.

Currently done

  • Reworked the setup.sh script so that it's now done in JS (no more bash)
  • rename.jsnow works no matter how many times you run it (saves old state to theme-manifest.json)
  • Added a default theme-manifest.json with initial values we replace using rename.js

To do

  • Output user's pass when creating him
  • Add some validation to user input (for example: only allow lowercase and hyphens for package name, etc)
  • Make the installation pretty ( chalk, some character art, emojis and removing unnecessary output )
  • Test on Windows (doesn't use bash anymore so it should be all good, also running composer using npx)
  • Create a Vagrant setup script

@MetarDev MetarDev added this to the 3.0.0 milestone Sep 21, 2018
@MetarDev MetarDev self-assigned this Sep 21, 2018
bin/setup-wp.js Outdated
dbPass: "wp",
wpUser: "ivan.grginov",
wpPass: "wp-pass",
siteName: "ImeStranice"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a test or? If any default text will be placed it should be in English :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Temp stuff, there's really no need to set any defaults here, will remove. 👍

wp-info.json Outdated
"db-name": "infinum_boilerplate_dev",
"db-user": "wp",
"db-pass": "wp",
"wp-user": "ivan.grginov",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm fine with having your name, but it would be safer to use something totally generic, like infinum.user

@MetarDev
Copy link
Contributor Author

Changes in last push

  • Added the WP install part after the initial setup (wp core install, wp config create and wp theme activate) depending on the user's local dev environment
  • It's now possible to have a working install (with DB and everything) with just 1 call npm run setup on VVV (still need to implement the wp installation part for other local setup - as it is now it just tells you to do it manually by going to your local website url and you will see the WP's 5-min wizard setup)
  • Reworked the update / renaming functions / scripts so they're all async(mostly just so they work with ora)
  • Reworked the rename script completely with new styling

To Do

  • Add "Create database if it doesn't exist" part before wp config create
  • Add some basic compatibility check for setups other than VVV (for example check if we're able to connect to mysql using "best guess" credentials for a particular setup - already using this with VVV - If not, prompt user and check again)
  • Skip setup steps if they're not needed (for example wp core download, as it is now if wp core exists the script will exit with an error - ideally it would just skip to the next part)
  • Check if search / replace is working with hidden files

README.md Outdated
@@ -12,6 +12,8 @@ This repository contains all the tools you need to start building a modern WordP

First you need to install WordPress locally, using any of the local development environment you prefer. You can use XAMPP, MAMP, WAMP, VVV, Docker or Laravel Valet. You'll also need to have [Node.js](https://nodejs.org/en/), [Composer](https://getcomposer.org/) and [WP-CLI](https://wp-cli.org/) installed.

**Note regarding `Windows` - If you're installing this on `Windows` and you're using `XAMPP`, use `XAMPP` shell (Control Panel -> Shell) rather than `cmd` **
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't rendered as bold. A better approach imo would be to add this as a subheading like:

Windows installation

If you're installing this on Windows, and you are using XAMPP, use XAMPP shell (Control Panel -> Shell) rather than the Windows command line prompt.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed this a bit so it no longer needs to be bolded.

@@ -66,18 +68,18 @@ Once you're done with the above setup (no matter which method you used), run `np

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At the top where the ## Initial Setup is, we should add a note that if you are running from the vagrant ssh, these are all installed (node, composer and wp-cli)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also for the manual part, besides running npm start, shouldn't composer installbe ran as well? Line 41

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You still need wp-cli for vagrant (since wp core download is run outside vagrant). And you don't actually need composer regardless (at least not for installation) since we're running it using npx.

As for composer install, that is done just after renaming (actually it's update not install). (1. npm install, 2. renaming, 3. npx composer update, 4. wp core donwload)

readme.txt Outdated
@@ -0,0 +1,106 @@
=== Infinum WordPress Boilerplate ===
Contributors: mustra, dingo_bastard, ivangrginov
Tags: Starter Theme, Webpack, Node, NodeJS, npm, npx, Build Process, Autoprefixr, SCSS, SASS, LESS, Babel, Browsersync, Accessibility Ready, Custom Colors, Custom Header, Custom Logo, Custom Menu, Editor Style, Featured Images, Flexible Header, Footer Widgets, One Column, Theme Options, Translation Ready, Two Columns
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Be very careful when adding Accessibility Ready tag. As any theme submitted with this tag has to go through a special review on wordpress.org.

Also, there seem to be some nonstandard tags here, which could trigger some reviewers:

Rule about tags in style.css and description
Theme tags

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Removed most of the tags since we don't support pretty much anything in the backend without coding it yourself :)

readme.txt Outdated

= Requirements =

* PHP 7 or greater (recommended: PHP 7 or greater)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(recommended: PHP 7.2 or greater) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@dingo-d
Copy link
Contributor

dingo-d commented Dec 27, 2018

OMFG the readme! ❤️ ❤️ 😄

I'd only change one thing: the aliasing for the phpcs. We should add to composer.json the scripts that look like this (the alias can be changed):

"scripts" : {
  "check-cs": "@php ./vendor/bin/phpcs --extensions=php --ignore=/vendor/",
  "fix-cs": "@php ./vendor/bin/phpcbf --extensions=php --ignore=/vendor/",
}

That way you can just run (from where the composer is setup for development)

composer check-cs .

Or specify the directory, and you'll have linting that's fully working. Aliasing can cause some issues, especially if you have globally installed phpcs- the path won't be pulled from the root of your project but the global installation and in case you are not keeping it up to date that can be an issue, also the phpcs.xml.dist won't be picked up from the root of your project.

Other than that really awesome work on the readme, looks sick 😄 👍

@MetarDev
Copy link
Contributor Author

Tested it and seems to work great, I'll all for it! Added the scripts and changed the readme to reflect the changes.

Regarding the readme, still need to add the updated Boilerplate graphics when I get them.

@dingo-d dingo-d merged commit 7ff6d94 into development Jan 2, 2019
@iruzevic iruzevic deleted the feature/zero-config-setup branch January 7, 2019 10:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants