stanleyyylau / melement

MIT License
0 stars 0 forks source link

FoundationPress Build Status

Gitter

Melement is built on foundationpress

1. Clone the repository and install with npm

$ cd my-wordpress-folder/wp-content/themes/
$ git clone https://github.com/olefredrik/FoundationPress.git
$ cd FoundationPress
$ npm install

2. While you're working on your project, run:

$ npm run watch

If you want to take advantage of browser-sync (automatic browser refresh when a file is saved), simply open your Gulpfile.js and put your local dev-server address (e.g localhost) in this field var URL = ''; , save the Gulpfile and run

$ npm run watch

3. For building all the assets, run:

$ npm run build

Build all assets minified and without sourcemaps:

$ npm run production

4. To create a .zip file of your theme, run:

$ npm run package

Running this command will build and minify the theme's assets and place a .zip archive of the theme in the packaged directory. This excludes the developer files/directories from your theme like node_modules, assets/components, etc. to keep the theme lightweight for transferring the theme to a staging or production server.

Styles

Please note that you must run npm run build or npm run watch in your terminal for the styles to be copied and concatenated. See the Gulpfile.js for details

Scripts

Please note that you must run npm run build or npm run watch in your terminal for the scripts to be copied and concatenated. See Gulpfile.js for details

The main styles and scripts generated by the build

Version control on these files are turned off because they are automatically generated as part of the build process.

Check For WordPress Coding Standards

Foundation comes with everything you need to run tests that will check your theme for WordPress Coding Standards. To enable this feature you'll need to install PHP Codesniffer, along with the WordPress Coding Standards set of "Sniffs". You'll need to have Composer To install both run the following:

$ composer create-project wp-coding-standards/wpcs:dev-master --no-dev

When prompted to remove existing VCS, answer Yes by typing Y.

Once you have installed the packages, you can check your entire theme by running:

$ npm run phpcs

If there are errors that Code Sniffer can fix automatically, run the following command to fix them:

$ npm run phpcbf

Demo

Unit Testing With Travis-CI

FoundationPress is completely ready to be deployed to and tested by Travis-CI for WordPress Coding Standards and best practices. All you need to do to activate the test is sign up and follow the instructions to point Travis-CI towards your repo. Just don't forget to update the status badge to point to your repositories unit test. Travis-CI

UI toolkits for rapid prototyping

Tutorials

Documentation

Showcase

Credit goes to all the brilliant designers and developers out there. Have you made a site that should be on this list? Please let me know

Contributing

Here are ways to get involved:

  1. Star the project!
  2. Answer questions that come through GitHub issues
  3. Report a bug that you find
  4. Share a theme you've built on top of FoundationPress
  5. Tweet and blog your experience of FoundationPress.

Pull Requests

Pull requests are highly appreciated. Please follow these guidelines:

  1. Solve a problem. Features are great, but even better is cleaning-up and fixing issues in the code that you discover
  2. Make sure that your code is bug-free and does not introduce new bugs
  3. Create a pull request
  4. Verify that all the Travis-CI build checks have passed

Comments from Stanley

Main Commands

npm run watch        # default gulp task
npm run build        # gulp build
npm run production   # gulp --production
npm run package      # gulp package --production

What happens when npm run build

First clean javascript and css Delete assets/javascript/foundation.js Delete assets/stylesheets/foundation.css Delete assets/stylesheets/foundation.css.map

Run copy task Copy fontawesome from assets/components/fontawesome/fonts/**/*.* to assets/fonts

Build sass From assets/scss/foundation.scss and assets/components to assets/stylesheets

Build javascript PATHS.javascript including assets/javascript/custom/*.js concatenated to assets/javascript/foundation.js

Linting Only lint assets/javascript/custom/*.js

What happens when npm run watch

Run gulp build  
Run browser-sync  (pipe all php and asset/imgs )
Run the rest of the default task (sass and js log change and compilation, inside sass and js will pipe to browser sync)