From ceb42820bb01fab51720d32fb68e2e46c76002ae Mon Sep 17 00:00:00 2001 From: Joe Chung Date: Tue, 6 Feb 2018 16:12:13 -0800 Subject: [PATCH] Updates readme, license files and rename script.js, replace jquery 3.3.1 slim w/ normal --- LICENSE | 2 +- README.md | 24 +++++++------------ init.sh | 14 +++++------ .../themes/gj-boilerplate/inc/assets.php | 2 +- .../js/src/{script.js => scripts.js} | 0 5 files changed, 18 insertions(+), 24 deletions(-) rename public/content/themes/gj-boilerplate/js/src/{script.js => scripts.js} (100%) diff --git a/LICENSE b/LICENSE index 6dbd7da..1663021 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2013-2015 Gunn-Jerkens +Copyright (c) 2013-2018 Gunn-Jerkens Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index 4b64642..2d57269 100755 --- a/README.md +++ b/README.md @@ -91,19 +91,18 @@ The wp directory is a submodule and should not be modified in any way, the content directory houses themes and plugins. The Shared directory is where all uploaded files (via the WordPress backend) are stored. -### grunt -wp-boilerplate uses Grunt to compress Javascript files and run Compass. Run +### webpack +wp-boilerplate uses Webpack to compress Javascript files and compile Sass to CSS. Run `npm install` from the root directory to install node dependencies, then run -`grunt` to watch for changes in `js/src` and `style/sass` in the theme -directory. +`npm run watch` to watch for changes in `js` files and `scss` files. -To compile a dev environment (Live Reload, Concatenated JS, Watch): +To compile a dev environment (concatenated js, watch): -`grunt dev -v` +`npm run start` To compile a production build (Uglify JS): -`grunt -v` +`npm run build` ## features ### multi-environment handling in wp-config @@ -141,10 +140,8 @@ images from an upstream environment. ### included javascript [Modernizr](http://modernizr.com/) [Bootstrap](http://getbootstrap.com) -[jQuery Placeholder](https://github.com/mathiasbynens/jquery-placeholder) -[jQuery imagesLoaded](https://github.com/desandro/imagesloaded) -All javascript (with exception of Modernizr, Respond, and jQuery (CDN) is compiled by Grunt into a 'main.js' file included in the footer. Bootstrap is included as a group of js files for easy customization && removal. Due to bootstrap files requiring a certain order in their compile they are called verbosely in the `Gruntfile.js` and need to be removed from that file if you are removing them from the project. Alternatively you can include Bootstrap via CDN if you uncomment it in the assets.php folder && make sure to remove it from your compiled JS. +The entry javascript file can be found in 'public/content/themes/gj-boilerplate/js/src/scripts.js'. Webpack will only compile files that are imports (or dependencies) in this file. To include Bootstrap javascript files, uncomment it in 'scripts.js' to include in this project. ### included Google Tag Manager integration Option to add your `GTM ID` in GJ Options. A GTM custom event named `formSubmitted` also fires when the form is submitted successfully so you can track conversions on the ajax form submit. @@ -153,7 +150,7 @@ Option to add your `GTM ID` in GJ Options. A GTM custom event named `formSubmitt [Bootstrap](http://getbootstrap.com) is included as an scss file, to use uncomment it in the screen.scss file. It import alls the individual scss files, delete at will for a customized Bootstrap build. ``` -/* Bootstrap v3.3.4 */ +/* Bootstrap v4.0.0 */ //@import "bootstrap"; ``` @@ -162,12 +159,9 @@ Option to add your `GTM ID` in GJ Options. A GTM custom event named `formSubmitt ``` // Font Awesome stylesheet -// wp_enqueue_style('font-awesome', 'http://netdna.bootstrapcdn.com/font-awesome/4.6.3/css/font-awesome.css', false, null, false); +// wp_enqueue_style('font-awesome', 'http://netdna.bootstrapcdn.com/font-awesome/5.0.6/css/font-awesome.css', false, null, false); ``` -### default compass configuration -Includes default configuration for SASS/Compass, which comes highly recommended. - ## dependencies [node](http://nodejs.org) ``` diff --git a/init.sh b/init.sh index d5442ae..eccc288 100755 --- a/init.sh +++ b/init.sh @@ -99,15 +99,15 @@ binconfig="bin/config.sh" # Development Configs -read -p "What is the local hostname? (e.g., example.test) " hostname_test -read -p "What is the local database name? (e.g., database_test) " db_test +read -p "What is the local hostname? (e.g., example.test) " hostname_dev +read -p "What is the local database name? (e.g., database_dev) " db_dev if [[ $type = "initial" ]]; then - sed -i.bak s/{hostname_test}/$hostname_test/g $wpconfig || true - sed -i.bak s/{db_test}/$db_test/g $wpconfig || true + sed -i.bak s/{hostname_dev}/$hostname_dev/g $wpconfig || true + sed -i.bak s/{db_dev}/$db_dev/g $wpconfig || true fi -sed -i.bak s/{db_test}/$db_test/g $binconfig || true +sed -i.bak s/{db_dev}/$db_dev/g $binconfig || true # Staging Configs @@ -173,12 +173,12 @@ then if [[ $REPLY =~ ^[Yy](es)?$ ]] then - mysql -uroot -e "CREATE DATABASE $db_test COLLATE utf8_general_ci" || true + mysql -uroot -e "CREATE DATABASE $db_dev COLLATE utf8_general_ci" || true read -p "Would you like to import a sql file? (y/N) " if [[ $REPLY =~ ^[Yy](es)?$ ]] then read -p "Where is the file located? (e.g., /home/user/sql/example.sql) " sql - mysql -uroot $db_test < $sql || true + mysql -uroot $db_dev < $sql || true if [[ $type = "initial" ]]; then read -p "What is the table prefix?" table sed -i.bak s/gj_/$table/g $wpconfig || true diff --git a/public/content/themes/gj-boilerplate/inc/assets.php b/public/content/themes/gj-boilerplate/inc/assets.php index 06aee6b..71d7eed 100755 --- a/public/content/themes/gj-boilerplate/inc/assets.php +++ b/public/content/themes/gj-boilerplate/inc/assets.php @@ -9,7 +9,7 @@ function enqueue_scripts() // Libraries wp_deregister_script('jquery'); - wp_enqueue_script('jquery', 'https://code.jquery.com/jquery-3.2.1.slim.min.js', false, null, true); + wp_enqueue_script('jquery', 'https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js', false, null, true); $main = '/js/main.js'; $mainFilePath = get_template_directory() . $main; diff --git a/public/content/themes/gj-boilerplate/js/src/script.js b/public/content/themes/gj-boilerplate/js/src/scripts.js similarity index 100% rename from public/content/themes/gj-boilerplate/js/src/script.js rename to public/content/themes/gj-boilerplate/js/src/scripts.js