Skip to content

Commit

Permalink
use grunt for js/css/etc CalderaWP#855
Browse files Browse the repository at this point in the history
  • Loading branch information
Shelob9 committed Nov 18, 2016
1 parent ec4e165 commit e076acf
Show file tree
Hide file tree
Showing 3,819 changed files with 524,516 additions and 2,906 deletions.
The diff you're trying to view is too large. We only load the first 3000 changed files.
5 changes: 4 additions & 1 deletion .distignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,7 @@ tests
phpunit.xml.dist
screenshot-1.png
screenshot-2.png
screenshot-3.png
screenshot-3.png
node_modules
Gruntfile.js
package.json
124 changes: 124 additions & 0 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
module.exports = function (grunt) {


// Project configuration.
grunt.initConfig({
pkg : grunt.file.readJSON( 'package.json' ),

replace: {
core: {
src: [ 'caldera-core.php' ],
overwrite: true,
replacements: [{
from: /Version:\s*(.*)/,
to: "Version: <%= pkg.version %>"
}, {
from: /define\(\s*'CFCORE_VER',\s*'(.*)'\s*\);/,
to: "define( 'CFCORE_VER', '<%= pkg.version %>' );"
}]
},
version_reamdme_txt: {
src: [ 'readme.txt' ],
overwrite: true,
replacements: [{
from: /Stable tag: (.*)/,
to: "Stable tag: <%= pkg.version %>"
}]

},

},
uglify: {
core: {
files: [{
expand: true,
cwd: 'assets/js',
src: '*.js',
dest: 'assets/build/js/',
ext: '.min.js'
}]
},
},
cssmin: {
core: {
files: [{
expand: true,
cwd: 'assets/css',
src: ['*.css', '!*.min.css'],
dest: 'assets/build/css',
ext: '.min.css'
}]
}
},
concat: {
options: {
separator: ' ',
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %> */',
},
front_css: {
src: [
'assets/build/css/caldera-grid.min.css',
'assets/build/css/caldera-alert.min.css',
'assets/build/css/caldera-form.min.css'
],
dest: 'assets/build/css/caldera-forms-front.min.css'
}
},
watch: {
scripts: {
files: ['assets/js/src/**.js'],
tasks: ['default'],
options: {
spawn: false
}
}
},
copy: {
fonts: {
expand: true,
cwd: 'assets/css/fonts/',
src: '*',
dest: 'assets/build/css/fonts/',
flatten: true,
filter: 'isFile'
},
i18n: {
expand: true,
cwd: 'assets/js/i18n/',
src: '*',
dest: 'assets/build/js/i18n/',
flatten: true,
filter: 'isFile'
},
images: {
expand: true,
cwd: 'assets/images',
src: '*',
dest: 'assets/build/images',
flatten: true,
filter: 'isFile'
}
}

});

//load modules
grunt.loadNpmTasks( 'grunt-text-replace' );
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-cssmin');

//register default task
grunt.registerTask( 'default', [
'uglify',
'cssmin',
'concat',
'copy'
] );
grunt.registerTask( 'version_number', [ 'replace' ] );


};
1 change: 1 addition & 0 deletions assets/build/css/admin.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions assets/build/css/caldera-alert.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions assets/build/css/caldera-form.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions assets/build/css/caldera-forms-front.min.css

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions assets/build/css/caldera-grid.min.css

Large diffs are not rendered by default.

File renamed without changes.
1 change: 1 addition & 0 deletions assets/build/css/dashicon.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions assets/build/css/editor-grid.min.css

Large diffs are not rendered by default.

File renamed without changes.
Binary file added assets/build/css/fonts/caldera-forms.eot
Binary file not shown.
24 changes: 24 additions & 0 deletions assets/build/css/fonts/caldera-forms.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/build/css/fonts/caldera-forms.ttf
Binary file not shown.
Binary file added assets/build/css/fonts/caldera-forms.woff
Binary file not shown.
Binary file added assets/build/css/fonts/cf-raty.eot
Binary file not shown.
23 changes: 23 additions & 0 deletions assets/build/css/fonts/cf-raty.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/build/css/fonts/cf-raty.ttf
Binary file not shown.
Binary file added assets/build/css/fonts/cf-raty.woff
Binary file not shown.
Binary file added assets/build/css/fonts/icon.eot
Binary file not shown.
Loading

0 comments on commit e076acf

Please sign in to comment.