Skip to content

Commit

Permalink
Merge branch '4.0-dev' into type-aware-config
Browse files Browse the repository at this point in the history
  • Loading branch information
wilsonge committed Jul 29, 2017
2 parents edc2fd9 + 8c9ed8e commit 2fc4eb9
Show file tree
Hide file tree
Showing 993 changed files with 6,553 additions and 10,012 deletions.
58 changes: 44 additions & 14 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
module.exports = function(grunt) {
var settings = grunt.file.readYAML('grunt-settings.yaml'),
path = require('path'),
preText = '{\n "name": "joomla-assets",\n "version": "4.0.0",\n "description": "External assets that Joomla is using",\n "dependencies": {\n ',
postText = ' },\n "license": "GPL-2.0+"\n}',
preText = `{
"name": "joomla-assets",
"version": "4.0.0",
"description": "External assets that Joomla is using",
"dependencies": {
`,
postText = `
},
"license": "GPL-2.0+"
}`,
name, tinyXml, codemirrorXml,
vendorsTxt = '',
vendorsArr = '',
xmlVersionStr = /(<version>)(\d+.\d+.\d+)(<\/version>)/;

// Loop to get some text for the packgage.json
for (name in settings.vendors) {
vendorsTxt += '"' + name + '": "' + settings.vendors[name].version + '",';
vendorsTxt += `
"` + name + '": "' + settings.vendors[name].version + `",`;
}

// Loop to get some text for the assets.php
for (name in settings.vendors) {
vendorsArr += '\'' + name + '\' => array(\'version\' => \'' + settings.vendors[name].version + '\',' + '\'dependencies\' => \'' + settings.vendors[name].dependencies + '\'),\n\t\t\t';
vendorsArr += `'` + name + `' => array('version' => '` + settings.vendors[name].version + `',` + `'dependencies' => '` + settings.vendors[name].dependencies + `'),`;
}

// Build the package.json and assets.php for all 3rd Party assets
grunt.file.write('build/assets_tmp/package.json', preText + vendorsTxt.substring(0, vendorsTxt.length - 1) + postText);
// grunt.file.write('build/assets_tmp.php', '<?php\ndefined(\'_JEXEC\') or die;\n\nabstract class ExternalAssets{\n\tpublic static function getCoreAssets() {\n\t\t return array(\n\t\t\t' + vendorsArr + '\n\t\t);\n\t}\n}\n');

// Project configuration.
grunt.initConfig({
Expand Down Expand Up @@ -59,6 +67,7 @@ module.exports = function(grunt) {
'media/vendor/flying-focus-a11y/*',
'media/vendor/diff/**',
'media/vendor/polyfills/**',
'media/vendor/masonry-layout/js/**',
],
expand: true,
options: {
Expand Down Expand Up @@ -193,6 +202,10 @@ module.exports = function(grunt) {
{ expand: true, cwd: '<%= folder.node_module %>diff/dist', src: ['*.js'], dest: 'media/vendor/diff/js/', filter: 'isFile'},
// XPath polyfill js files
{ expand: false, src: '<%= folder.node_module %>wicked-good-xpath/dist/wgxpath.install.js', dest: 'media/vendor/polyfills/js/polyfill-wgxpath.js', filter: 'isFile'},
// Masonry js files
{ expand: true, cwd: '<%= folder.node_module %>masonry-layout/dist', src: ['*.js'], dest: 'media/vendor/masonry/js/', filter: 'isFile'},
// Joomla UI custom elements js files
{ expand: true, cwd: '<%= folder.node_module %>joomla-ui-custom-elements/dist/js', src: ['*.js'], dest: 'media/system/webcomponents/', filter: 'isFile'},

// Licenses
{ src: ['<%= folder.node_module %>jquery/LICENSE.txt'], dest: 'media/vendor/jquery/LICENSE.txt'},
Expand All @@ -207,6 +220,14 @@ module.exports = function(grunt) {
{ src: ['<%= folder.node_module %>diff/LICENSE'], dest: 'media/vendor/diff/LICENSE'},
{ src: ['<%= folder.node_module %>wicked-good-xpath/LICENSE'], dest: 'media/vendor/polyfills/wicked-good-xpath-LICENSE'},
]
},
polyfills: {
files: [
// Joomla UI custom elements polyfills/loader
{ expand: true, cwd: '<%= folder.node_module %>joomla-ui-custom-elements/dist/polyfills', src: ['*.js'], dest: 'media/system/js/polyfills/webcomponents', filter: 'isFile'},
// Joomla UI custom elements js files
{ expand: true, cwd: '<%= folder.node_module %>joomla-ui-custom-elements/dist/js', src: ['*.js'], dest: 'media/system/webcomponents/', filter: 'isFile'},
]
}
},

Expand Down Expand Up @@ -235,7 +256,7 @@ module.exports = function(grunt) {
],
options: {
config: 'scss-lint.yml',
reporterOutput: 'scss-lint-report.xml',
reporterOutput: 'scss-lint-report.xml'
}
},

Expand All @@ -245,6 +266,16 @@ module.exports = function(grunt) {
files: [
{
src: [
/**
* EXCLUSIONS
*
* '<%= folder.puny %>/*.js', '!<%= folder.puny %>/*.min.js', // Uglifying punicode.js fails ES6!!!
*
* Please DO NOT MINIFY the webcomponents folder here!!! They're already minified!
* '<%= folder.system %>/polyfills/webcomponents/*.js', '!<%= folder.system %>/polyfills/webcomponents/*.min.js',
* '<%= folder.media %>/system/webcomponents/*.js', '!<%= folder.media %>/system/webcomponents/*.min.js',
*/

'<%= folder.system %>/*.js',
'!<%= folder.system %>/*.min.js',
'<%= folder.system %>/fields/*.js',
Expand Down Expand Up @@ -319,8 +350,6 @@ module.exports = function(grunt) {
'!<%= folder.media %>/plg_system_stats/js/*.min.js',
'<%= folder.media %>/plg_system_debug/js/*.js',
'!<%= folder.media %>/plg_system_debug/js/*.min.js',
// '<%= folder.puny %>/*.js', // Uglifying punicode.js fails!!!
// '!<%= folder.puny %>/*.min.js', // Uglifying punicode.js fails!!!
],
dest: '',
expand: true,
Expand Down Expand Up @@ -350,12 +379,12 @@ module.exports = function(grunt) {
processors: [
require('autoprefixer')({
browsers: [
'Chrome >= 58',
'Firefox >= 53',
'Edge >= 12',
'Explorer >= 11',
'Safari >= 10.1',
'Opera >= 44'
'Chrome >= ' + settings.Browsers.Chrome,
'Firefox >= ' + settings.Browsers.Firefox,
'Edge >= ' + settings.Browsers.Edge,
'Explorer >= ' + settings.Browsers.Explorer,
'Safari >= ' + settings.Browsers.Safari,
'Opera >= ' + settings.Browsers.Opera
]
})
],
Expand Down Expand Up @@ -452,6 +481,7 @@ module.exports = function(grunt) {
'sass:dist',
'clean:allMinJs',
'uglify:allJs',
'copy:polyfills',
'cssmin:allCss',
'postcss',
'cssmin:adminTemplate',
Expand Down
16 changes: 1 addition & 15 deletions administrator/components/com_admin/forms/profile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
name="name"
type="text"
label="COM_ADMIN_USER_HEADING_NAME"
description="COM_ADMIN_USER_FIELD_NAME_DESC"
required="true"
size="30"
/>
Expand All @@ -14,7 +13,6 @@
name="username"
type="text"
label="COM_ADMIN_USER_FIELD_USERNAME_LABEL"
description="COM_ADMIN_USER_FIELD_USERNAME_DESC"
required="true"
size="30"
/>
Expand All @@ -23,7 +21,6 @@
name="password2"
type="password"
label="JGLOBAL_PASSWORD"
description="COM_ADMIN_USER_FIELD_PASSWORD_DESC"
autocomplete="off"
class="validate-password"
field="password"
Expand All @@ -37,7 +34,6 @@
name="password"
type="password"
label="COM_ADMIN_USER_FIELD_PASSWORD2_LABEL"
description="COM_ADMIN_USER_FIELD_PASSWORD2_DESC"
autocomplete="off"
class="validate-password"
filter="raw"
Expand All @@ -49,7 +45,6 @@
name="email"
type="email"
label="JGLOBAL_EMAIL"
description="COM_ADMIN_USER_FIELD_EMAIL_DESC"
class="validate-email"
required="true"
size="30"
Expand All @@ -60,7 +55,6 @@
name="registerDate"
type="calendar"
label="COM_ADMIN_USER_FIELD_REGISTERDATE_LABEL"
description="COM_ADMIN_USER_FIELD_REGISTERDATE_DESC"
class="readonly"
readonly="true"
translateformat="true"
Expand All @@ -73,7 +67,6 @@
name="lastvisitDate"
type="calendar"
label="COM_ADMIN_USER_FIELD_LASTVISIT_LABEL"
description="COM_ADMIN_USER_FIELD_LASTVISIT_DESC"
class="readonly"
readonly="true"
translateformat="true"
Expand All @@ -86,7 +79,6 @@
name="id"
type="text"
label="JGLOBAL_FIELD_ID_LABEL"
description="JGLOBAL_FIELD_ID_DESC"
class="readonly"
default="0"
readonly="true"
Expand All @@ -104,7 +96,6 @@
name="admin_style"
type="templatestyle"
label="COM_ADMIN_USER_FIELD_BACKEND_TEMPLATE_LABEL"
description="COM_ADMIN_USER_FIELD_BACKEND_TEMPLATE_DESC"
client="administrator"
>
<option value="">JOPTION_USE_DEFAULT</option>
Expand All @@ -114,8 +105,7 @@
name="admin_language"
type="language"
label="COM_ADMIN_USER_FIELD_BACKEND_LANGUAGE_LABEL"
description="COM_ADMIN_USER_FIELD_BACKEND_LANGUAGE_DESC"
client="administrator"
client="administrator"
>
<option value="">JOPTION_USE_DEFAULT</option>
</field>
Expand All @@ -124,7 +114,6 @@
name="language"
type="language"
label="COM_ADMIN_USER_FIELD_FRONTEND_LANGUAGE_LABEL"
description="COM_ADMIN_USER_FIELD_FRONTEND_LANGUAGE_DESC"
client="site"
>
<option value="">JOPTION_USE_DEFAULT</option>
Expand All @@ -134,7 +123,6 @@
name="editor"
type="plugins"
label="COM_ADMIN_USER_FIELD_EDITOR_LABEL"
description="COM_ADMIN_USER_FIELD_EDITOR_DESC"
folder="editors"
>
<option value="">JOPTION_USE_DEFAULT</option>
Expand All @@ -144,7 +132,6 @@
name="helpsite"
type="helpsite"
label="COM_ADMIN_USER_FIELD_HELPSITE_LABEL"
description="COM_ADMIN_USER_FIELD_HELPSITE_DESC"
>
<option value="">JOPTION_USE_DEFAULT</option>
</field>
Expand All @@ -153,7 +140,6 @@
name="timezone"
type="timezone"
label="COM_ADMIN_USER_FIELD_TIMEZONE_LABEL"
description="COM_ADMIN_USER_FIELD_TIMEZONE_DESC"
>
<option value="">JOPTION_USE_DEFAULT</option>
</field>
Expand Down

0 comments on commit 2fc4eb9

Please sign in to comment.