Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Capevace committed Apr 5, 2022
0 parents commit 161e7a1
Show file tree
Hide file tree
Showing 25 changed files with 2,663 additions and 0 deletions.
28 changes: 28 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
language: php

matrix:
include:
- php: '7.2'
env: SNIFF=1
- php: '7.1'
env: SNIFF=1
allow_failures:
- php: '5.6'
env: SNIFF=1
- php: '7.0'
env: SNIFF=1
- php: 'nightly'
env: SNIFF=1

before_install:
- if [[ "$SNIFF" == "1" ]]; then export PHPCS_DIR=$PWD/vendor/bin; fi
- if [[ "$SNIFF" == "1" ]]; then export SNIFFS_DIR=$PWD/vendor/wp-coding-standards/wpcs; fi
- composer install
- composer update
- ./vendor/bin/phpcs --config-set installed_paths $SNIFFS_DIR
- ./vendor/bin/phpcs -i
- if [[ "$SNIFF" == "1" ]]; then ./vendor/bin/phpcs --config-set installed_paths $SNIFFS_DIR; fi

script:
- export SNIFFS_IGNORE=*/node/*,*/vendor/*,*Gruntfile.js*,*.min.js*,*.min.css*,*.less*
- if [[ "$SNIFF" == "1" ]]; then ./vendor/bin/phpcs -p . --standard=WordPress --ignore=$SNIFFS_IGNORE; fi
96 changes: 96 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
/* jshint node:true */
module.exports = function( grunt ){
'use strict';

grunt.initConfig({
// setting folder templates
dirs: {
css: 'assets/css',
less: 'assets/css',
js: 'assets/js'
},

// Compile all .less files.
less: {
compile: {
options: {
// These paths are searched for @imports
paths: ['<%= less.css %>/']
},
files: [{
expand: true,
cwd: '<%= dirs.css %>/',
src: [
'*.less',
'!mixins.less'
],
dest: '<%= dirs.css %>/',
ext: '.css'
}]
}
},

// Minify all .css files.
cssmin: {
minify: {
expand: true,
cwd: '<%= dirs.css %>/',
src: ['*.css'],
dest: '<%= dirs.css %>/',
ext: '.css'
}
},

// Minify .js files.
uglify: {
options: {
preserveComments: 'some'
},
jsfiles: {
files: [{
expand: true,
cwd: '<%= dirs.js %>/',
src: [
'*.js',
'!*.min.js',
'!Gruntfile.js',
],
dest: '<%= dirs.js %>/',
ext: '.min.js'
}]
}
},

// Watch changes for assets
watch: {
less: {
files: [
'<%= dirs.less %>/*.less',
],
tasks: ['less', 'cssmin'],
},
js: {
files: [
'<%= dirs.js %>/*js',
'!<%= dirs.js %>/*.min.js'
],
tasks: ['uglify']
}
},

});

// Load NPM tasks to be used here
grunt.loadNpmTasks( 'grunt-contrib-less' );
grunt.loadNpmTasks( 'grunt-contrib-cssmin' );
grunt.loadNpmTasks( 'grunt-contrib-uglify' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );

// Register tasks
grunt.registerTask( 'default', [
'less',
'cssmin',
'uglify'
]);

};
Loading

0 comments on commit 161e7a1

Please sign in to comment.