Skip to content

Commit 1abda67

Browse files
authored
Release/5.0.0 (#159)
* Remove package lock * remove package json * Add new package json * Add yarn lock, dependencies for gulp tasks * Rewrite gulp file for fresh start * Initial rewrite of gulp tasks and file * Add babel rc, small tweaks * Add more gulp adjustments * Fix build and linting problems * Update JS enqueue * Add browserslist * Add stream to JS * Run eslint fix * Fix global lint styles * Fix spacing issues * Add bowser implementation, update theme js output (#156) * Remove compiled files * Remove old package.json * Add version updating and release scripts (#157) * Add version updating * Add release scripts * Add prettier functionality (#158)
1 parent 53bb652 commit 1abda67

20 files changed

+7956
-11705
lines changed

.babelrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"presets": ["@babel/preset-env"]
3+
}
4+

.browserslistrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
last 2 version
2+
> 1%
3+
maintained node versions
4+
not dead

.editorconfig

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,5 @@ end_of_line = lf
88
indent_size = 2
99
indent_style = space
1010
insert_final_newline = true
11-
trim_trailing_whitespace = true
11+
trim_trailing_whitespace = true
12+
quote_type = double

.eslintignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
node_modules/**/*.js

.eslintrc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
"env": {
33
"browser": true,
44
"jquery": true,
5+
"node": true,
6+
"es6": true,
57
},
68
"globals": {
79
"bowser": true
@@ -43,7 +45,7 @@
4345
"array-bracket-spacing": [1,"always",{"singleValue":true,"objectsInArrays":true,"arraysInArrays":true}],
4446
"camelcase": [1,{"properties":"always"}],
4547
"comma-spacing": [1,{"after":true}],
46-
"indent": [1,"tab"],
47-
"quotes": [1,"single","avoid-escape"]
48+
"indent": ["error", 2],
49+
"quotes": [1,"double","avoid-escape"]
4850
}
4951
}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
**/*/.DS_Store
33
node_modules/
44
bower_components/
5+
*.log
6+
error_log

assets/css/.gitkeep

Whitespace-only changes.

assets/js/dist/.gitkeep

Whitespace-only changes.

assets/js/font-awesome.config.js

Lines changed: 0 additions & 1 deletion
This file was deleted.

assets/js/src/theme.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
const Bowser = require("bowser");
2+
3+
window.FontAwesomeConfig = { searchPseudoElements: true };
4+
5+
jQuery( document ).ready(function( $ ) {
6+
// Inside of this function, $() will work as an alias for jQuery()
7+
// and other libraries also using $ will not be accessible under this shortcut
8+
// https://codex.wordpress.org/Function_Reference/wp_enqueue_script#jQuery_noConflict_Wrappers
9+
10+
// Touch Device Detection
11+
var isTouchDevice = "ontouchstart" in document.documentElement;
12+
if( isTouchDevice ) {
13+
$("body").removeClass("no-touch");
14+
}
15+
16+
// Browser detection via Bowser (https://github.com/lancedikson/bowser) - add detection as needed
17+
const userBrowser = Bowser.getParser(window.navigator.userAgent);
18+
const browser = userBrowser.getBrowser();
19+
20+
if( browser.name === "Internet Explorer" && browser.version == "11.0" ) {
21+
$("body").addClass("ie-11");
22+
} else if ( bowser.safari ) {
23+
$("body").addClass("safari");
24+
}
25+
26+
});

assets/js/theme.js

Lines changed: 0 additions & 19 deletions
This file was deleted.

functions.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
<?php
22

3-
define( 'THEME_VERSION', '0.0.1' );
3+
$NPM_PACKAGE = file_get_contents(get_template_directory() . '/package.json');
4+
$NPM_PACKAGE = json_decode($NPM_PACKAGE, true);
5+
$THEME_VERSION = $NPM_PACKAGE['theme_version'];
6+
7+
define( 'THEME_VERSION', $THEME_VERSION );
48

59
/**
610
* Load tweaks

0 commit comments

Comments
 (0)