Skip to content

Commit

Permalink
Merge pull request #11 from dgt41/fields-js
Browse files Browse the repository at this point in the history
Easy maintenance of 3rd libs (assets) part1
  • Loading branch information
C-Lodder authored Sep 23, 2016
2 parents ecb2bb2 + b393b80 commit 8b7f282
Show file tree
Hide file tree
Showing 31 changed files with 18,220 additions and 4,262 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
/.htaccess
/web.config
/.php_cs.cache
/dev/node_modules/**
/dev/assets/node_modules/**

# Test Related Files #
/phpunit.xml
Expand Down
125 changes: 125 additions & 0 deletions dev/Gruntfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
module.exports = function(grunt) {

// Project configuration.
grunt.initConfig({
folder : {
system : '../media/system/js',
fields : '../media/system/js/fields'
},
uglify: {
build: {
files: [
{
src: ['<%= folder.system %>/*.js','!<%= folder.system %>/*.min.js'],
dest: '',
expand: true,
ext: '.min.js'
},
{
src: ['<%= folder.fields %>/*.js','!<%= folder.fields %>/*.min.js'],
dest: '',
expand: true,
ext: '.min.js'
}
]
}
},
copy: {
transfer: {
files: [
{ // jQuery files
expand: true,
cwd: 'assets/node_modules/jquery/dist/',
src: ['**'],
dest: '../media/vendor/jquery/js/',
filter: 'isFile'
},
{ // jQuery migrate files
expand: true,
cwd: 'assets/node_modules/jquery-migrate/dist/',
src: ['**'],
dest: '../media/vendor/jquery/js/',
filter: 'isFile'
},
{ //Bootastrap js files
expand: true,
cwd: 'assets/node_modules/bootstrap/dist/js/',
src: ['**'],
dest: '../media/vendor/bootstrap/js/',
filter: 'isFile'
},
{ //Bootastrap scss files
expand: true,
cwd: 'assets/node_modules/bootstrap/scss/',
src: ['**'],
dest: '../media/vendor/bootstrap/scss/',
filter: 'isFile'
},
{ //Bootastrap css files
expand: true,
cwd: 'assets/node_modules/bootstrap/dist/css/',
src: ['**'],
dest: '../media/vendor/bootstrap/css/',
filter: 'isFile'
},
{ //Teether js files
expand: true,
cwd: 'assets/node_modules/tether/dist/js/',
src: ['**'],
dest: '../media/vendor/tether/js/',
filter: 'isFile'
},
{ //Font Awesome css files
expand: true,
cwd: 'assets/node_modules/font-awesome/css/',
src: ['**'],
dest: '../media/vendor/font-awesome/css/',
filter: 'isFile'
},
{ //Font Awesome scss files
expand: true,
cwd: 'assets/node_modules/font-awesome/scss/',
src: ['**'],
dest: '../media/vendor/font-awesome/scss/',
filter: 'isFile'
},
{ //Font Awesome fonts files
expand: true,
cwd: 'assets/node_modules/font-awesome/fonts/',
src: ['**'],
dest: '../media/vendor/font-awesome/fonts/',
filter: 'isFile'
},
// // Licenses
// { // jQuery files
// src: ['assets/node_modules/jquery/LICENSE.txt'],
// dest: '../media/vendor/jquery/'
// },
// { // Bootstrap files
// src: [
// 'assets/node_modules/bootstrap/LICENSE',
// ],
// dest: '../media/vendor/bootstrap/'
// },
// { // Bootstrap files
// src: [
// 'assets/node_modules/bootstrap/node_modules/tether/LICENSE',
// ],
// dest: '../media/vendor/tether/LICENSE',
// },
]
}
}
});

// Load required modules
grunt.loadNpmTasks('grunt-contrib-uglify');

grunt.loadNpmTasks('grunt-contrib-copy');

grunt.registerTask('default', ['build', 'transfer']);

grunt.registerTask('build', ['uglify']);

grunt.registerTask('transfer', ['copy']);
};
14 changes: 14 additions & 0 deletions dev/assets/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "joomla-assets",
"version": "4.0.0",
"description": "External assets that Joomla is using",
"dependencies": {
"jquery": "3.1.0",
"jquery-migrate": "3.0.0",
"bootstrap": "4.0.0-alpha.4",
"tether": "1.3.7",
"font-awesome": "4.6.3",
"tinymce": "4.4.3"
},
"license": "GPL-2.0+"
}
20 changes: 20 additions & 0 deletions dev/assets/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#### Developers Area

Install Node: https://nodejs.org/en/
Install Bower: `npm install -g bower`

### Folder: Static

Contains all the external sourced static assets that Joomla is using.

- Jquery: version 3
- Bootstrap version 4
- TinyMCE: version latest
- Code mirror version 5
- BS select version latest
- Punycode version latest


PLEASE UPDATE VERSION NUMBERS HERE AS WELL AS THE package.json!

@TODO: Add all the rest
13 changes: 13 additions & 0 deletions dev/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "joomla",
"version": "4.0.0",
"description": "Joomla CMS",
"dependencies": {
"grunt": "~0.4",
"grunt-contrib-uglify": "~1.0.1"
},
"license": "GPL-2.0+",
"devDependencies": {
"grunt-contrib-copy": "^1.0.0"
}
}
11 changes: 11 additions & 0 deletions dev/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#### Maintainer's Area

Install Node: https://nodejs.org/en/
Run: `npm install` in this folder
Run: `grunt` will minify all javscripts in system/js and copy the 3rd part libs to media/vedor/*

To do only the second just run `grunt copy`

Make sure that you have updated the assets/package.json and ran 'npm install' in the sub directory assets,
in order to update the libraries!!!
@TODO: Add more functionality (maybe)
2 changes: 1 addition & 1 deletion libraries/cms/html/bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ public static function framework($debug = null)
$debug = JDEBUG;
}

JHtml::_('script', 'vendor/bootstrap/tether.min.js', false, true, false, false, $debug);
JHtml::_('script', 'vendor/tether/tether.min.js', false, true, false, false, $debug);
JHtml::_('script', 'vendor/bootstrap/bootstrap.min.js', false, true, false, false, $debug);
static::$loaded[__METHOD__] = true;

Expand Down
Loading

0 comments on commit 8b7f282

Please sign in to comment.