diff --git a/.gitignore b/.gitignore index 04ac011..638aaa8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ -/assets/sass/*.css +*.css *.map -/OgreAlert -ogrealert.zip +ogre-alert.zip lib composer.lock vendor +package-lock.json +node_modules diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..9064f06 --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,35 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "Compile", + "type": "shell", + "command": "gulp", + "group": "build", + "presentation": { + "reveal": "silent", + "panel": "shared", + } + }, + { + "label": "Package", + "type": "shell", + "command": "gulp package", + "group": "build", + "presentation": { + "reveal": "silent", + "panel": "shared", + } + }, + { + "label": "Install", + "type": "shell", + "command": "make install", + "group": "build", + "presentation": { + "reveal": "silent", + "panel": "shared", + } + } + ] +} diff --git a/Makefile b/Makefile index 6eba3b2..2eb2fe8 100644 --- a/Makefile +++ b/Makefile @@ -1,34 +1,23 @@ -PACKAGE = OgreAlert -SLUG = ogrealert -DIR = ./$(PACKAGE) +all: install -all: $(SLUG).zip +reinstall: clean install -$(SLUG).zip: clean dir copy zip +clean: clean-composer clean-npm -dir: - mkdir $(DIR) +clean-composer: + rm -rf acf || true + rm -rf vendor/* || true + rm -rf lib/* || true + rm composer.lock || true + composer clearcache -copy: - cp -RT ./assets $(DIR)/assets - cp -RT ./inc $(DIR)/inc - cp -RT ./lib $(DIR)/lib - cp -RT ./templates $(DIR)/templates - cp -f ./* $(DIR) || true +clean-npm: + rm -rf node_modules/* || true + rm package-lock.json || true - rm $(DIR)/Makefile - rm $(DIR)/composer.json - rm $(DIR)/composer.lock - rm $(DIR)/$(SLUG).zip || true +install: + composer install + npm install - rm -r $(DIR)/assets/sass/lib - rm $(DIR)/assets/sass/*.scss - rm $(DIR)/assets/sass/*.map - -zip: - zip -r ./$(SLUG).zip $(DIR) - rm -r $(DIR) || true - -clean: - rm -r $(DIR) || true - rm ./$(SLUG).zip || true +package: install + gulp package diff --git a/composer.json b/composer.json index b7dc799..8c5a4ea 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "$schema": "https://getcomposer.org/schema.json", "name": "cleverogre/ogre-alert", - "version": "0.2.0", + "version": "0.2.1", "title": "OgreAlert", "description": "OgreAlert is a plugin developed by CleverOgre in Pensacola, Florida.", "author": "CleverOgre", diff --git a/gulpfile.js b/gulpfile.js new file mode 100644 index 0000000..cb945c6 --- /dev/null +++ b/gulpfile.js @@ -0,0 +1,84 @@ +const gulp = require('gulp'), + clean = require('gulp-clean'), + postcss = require('gulp-postcss'), + cssnano = require('cssnano'), + sass = require('gulp-sass')(require('sass')), + zip = require('gulp-zip').default; + +// Clean Tasks + +gulp.task('clean-style', () => { + return gulp.src('assets/css/*.css', { + read: false, + allowEmpty: true, + }).pipe(clean()); +}); + +gulp.task('clean-package', () => { + return gulp.src('ogrealert.zip', { + read: false, + allowEmpty: true, + }).pipe(clean()); +}); + +gulp.task( + 'clean', + gulp.series( + 'clean-style', + 'clean-package' + ) +); + +// Compile Tasks + +gulp.task('compile-style', () => { + return gulp.src([ + 'assets/sass/*.scss', + ]) + .pipe(sass().on('error', sass.logError)) + .pipe(postcss(cssnano())) + .pipe(gulp.dest('./assets/css/')); +}); + +gulp.task( + 'compile', + gulp.series( + 'compile-style' + ) +); + +// Package Tasks + +gulp.task('package-compress', () => { + return gulp.src([ + 'assets/css/*', + 'assets/js/*', + 'assets/*.png', + 'inc/**/*', + 'lib/**/*', + 'templates/**/*', + 'ogrealert.php', + 'readme.txt' + ], { base: './' }) + .pipe(zip('ogrealert.zip')) + .pipe(gulp.dest('./')); +}); + +gulp.task( + 'package', + gulp.series( + 'clean', + 'compile', + 'package-compress' + ) +); + +// Default Tasks + +gulp.task( + 'default', + gulp.series( + 'clean', + 'compile' + ) +); diff --git a/inc/display.php b/inc/display.php index 8f922a5..2a90981 100644 --- a/inc/display.php +++ b/inc/display.php @@ -38,7 +38,7 @@ class Display { } static function enqueue_scripts() { - wp_enqueue_style('ogrealert', \OgreAlert\Settings::get('dir') . 'assets/sass/style.css', [], \OgreAlert\Settings::get('version'), 'all'); + wp_enqueue_style('ogrealert', \OgreAlert\Settings::get('dir') . 'assets/css/style.css', [], \OgreAlert\Settings::get('version'), 'all'); wp_enqueue_script('ogrealert', \OgreAlert\Settings::get('dir') . 'assets/js/frontend.js', ['jquery'], \OgreAlert\Settings::get('version'), true); wp_localize_script('ogrealert', 'ogrealert', [ 'text_color' => \OgreAlert\Settings::get('message_text_color'), diff --git a/ogrealert.php b/ogrealert.php index 52d11f3..a4ddff9 100644 --- a/ogrealert.php +++ b/ogrealert.php @@ -3,7 +3,7 @@ Plugin Name: OgreAlert Plugin URI: https://plugins.cleverogre.com/plugin/ogrealert/ Description: OgreAlert is a plugin developed by CleverOgre in Pensacola, Florida. -Version: 0.2.0 +Version: 0.2.1 Author: CleverOgre Author URI: https://cleverogre.com/ Icon1x: https://plugins.cleverogre.com/plugin/ogrealert/?asset=icon-sm @@ -31,7 +31,7 @@ class Plugin { // Default Settings \OgreAlert\Settings::set('name', 'OgreAlert'); - \OgreAlert\Settings::set('version', '0.2.0'); + \OgreAlert\Settings::set('version', '0.2.1'); \OgreAlert\Settings::set('capability', 'edit_posts'); \OgreAlert\Settings::set('path', $path); \OgreAlert\Settings::set('dir', self::get_dir(__FILE__)); diff --git a/package.json b/package.json new file mode 100644 index 0000000..089955a --- /dev/null +++ b/package.json @@ -0,0 +1,33 @@ +{ + "$schema": "https://www.schemastore.org/package.json", + "name": "cleverogre/ogre-alert", + "version": "0.2.1", + "title": "OgreAlert", + "description": "OgreAlert is a plugin developed by CleverOgre in Pensacola, Florida.", + "author": "CleverOgre", + "license": "GPL-2.0+", + "keywords": [ + "WordPress", + "Plugin", + "Alert", + "Banner" + ], + "homepage": "https://cleverogre.com", + "engines": { + "node": ">=21.1.0", + "npm": ">=10.2.3" + }, + "devDependencies": { + "autoprefixer": "^10.4.21", + "cssnano": "^6.0.3", + "gulp": "^5.0.0", + "gulp-clean": "^0.4.0", + "gulp-cli": "^2.3.0", + "gulp-postcss": "^9.1.0", + "gulp-sass": "^5.1.0", + "gulp-zip": "^6.1.0", + "postcss": "^8.4.33", + "postcss-cli": "^11.0.0", + "sass": "^1.89.0" + } +} diff --git a/postcss.config.js b/postcss.config.js new file mode 100644 index 0000000..e8b4689 --- /dev/null +++ b/postcss.config.js @@ -0,0 +1,18 @@ +module.exports = { + plugins: [ + require('autoprefixer')({ + overrideBrowserslist: [ + "ie 10", + "> 0.3%", + "last 7 versions", + "Android >= 4", + "Firefox >= 20", + "iOS >= 8" + ], + flexbox: true + }), + require('cssnano')({ + preset: 'default', + }) + ] +}; diff --git a/readme.txt b/readme.txt index ac12699..b84fb73 100644 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Donate link: https://cleverogre.com/ Tags: development, warning, modal, dismissable Requires at least: 4.8.0 Tested up to: 5.7.1 -Stable tag: 0.2.0 +Stable tag: 0.2.1 License: GPLv2 or later License URI: https://www.gnu.org/licenses/gpl-2.0.html @@ -62,6 +62,12 @@ By default, the OgreAlert plugin will be able to update without an activated lic == Changelog == += 0.2.1 - 07-22-2025 = +* DEV: Added gulp sass compilation +* DEV: Removed Bourbon dependency +* DEV: Removed FontAwesome depedency +* DEV: Added CSS3 variables + = 0.2.0 - 07-22-2025 = * DEV: Updated plugin updater libraries.