-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(ui-grid): revert build tasks to rely on grunt
- Loading branch information
1 parent
261012b
commit 19475ea
Showing
24 changed files
with
1,153 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
const getDirectories = p => fs.readdirSync(p).filter(f => fs.statSync(path.join(p, f)).isDirectory()); | ||
const getLanguages = p => fs.readdirSync(p).filter(f => fs.statSync(path.join(p, f)).isFile()); | ||
const getTemplateDirectories = p => fs.readdirSync(p) | ||
.filter(f => fs.statSync(path.join(p, f)).isDirectory() && fs.existsSync(path.join(p, f, 'src/templates'))); | ||
const templateDirectories = getTemplateDirectories('packages/'); | ||
|
||
function getFiles() { | ||
const files = { | ||
'<%= dist %>/release/<%= pkg.name %>.js': ['packages/core/src/js/bootstrap.js', 'packages/*/src/js/**/*.js', '.tmp/template.js'], | ||
'packages/core/js/<%= pkg.name %>.core.js': ['src/js/core/bootstrap.js', 'packages/core/src/js/**/*.js', '.tmp/template-core.js'] | ||
}; | ||
const packages = getDirectories('packages/'); | ||
|
||
packages.forEach((feat) => { | ||
if (feat === 'i18n') { | ||
const languages = getLanguages('packages/i18n/src/js/'); | ||
|
||
files['packages/i18n/js/<%= pkg.name %>.language.all.js'] = languages.map((lang) => `packages/i18n/src/js/${lang}`); | ||
|
||
languages.forEach((lang) => { | ||
files[`packages/i18n/js/<%= pkg.name %>.language.${lang}`] = [`packages/i18n/src/js/${lang}`]; | ||
}); | ||
} else if (feat !== 'core') { | ||
let src = [`packages/${feat}/src/js/**/*.js`]; | ||
|
||
if (templateDirectories.includes(feat)) { | ||
src.push(`.tmp/template-${feat}.js`); | ||
} | ||
|
||
files[`packages/${feat}/js/<%= pkg.name %>.${feat}.js`] = src; | ||
} | ||
}); | ||
|
||
return files; | ||
} | ||
|
||
module.exports = { | ||
options: { | ||
banner: '<%= banner %>', | ||
stripBanners: true | ||
}, | ||
dist: { | ||
files: getFiles() | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
const getDirectories = p => fs.readdirSync(p) | ||
.filter(f => fs.statSync(path.join(p, f)).isDirectory() && fs.existsSync(path.join(p, f, 'less'))); | ||
|
||
function filterCoreLessFiles(filepath) { | ||
return filepath === 'packages/core/less/main.less' || !filepath.includes('packages/core/less/'); | ||
} | ||
|
||
function getFiles(compress) { | ||
const suffix = compress ? 'min.css' : 'css'; | ||
const files = [ | ||
{ | ||
src: ['packages/core/less/main.less', 'packages/*/less/**/*.less', '.tmp/font/ui-grid-codes.css'], | ||
dest: `dist/release/<%= pkg.name %>.${suffix}`, | ||
filter: filterCoreLessFiles | ||
} | ||
]; | ||
const packages = getDirectories('packages/'); | ||
|
||
packages.forEach((feat) => { | ||
if (feat !== 'core') { | ||
files.push({ | ||
src: `packages/${feat}/less/*.less`, | ||
dest: `packages/${feat}/css/<%= pkg.name %>.${feat}.${suffix}`, | ||
filter: filterCoreLessFiles | ||
}); | ||
} | ||
}); | ||
|
||
return files; | ||
} | ||
|
||
module.exports = { | ||
core: { | ||
options: { | ||
banner: '<%= banner %>', | ||
modifyVars: { | ||
'font-path': '../fonts/' | ||
} | ||
}, | ||
files: [{ | ||
src: 'packages/core/less/main.less', | ||
dest: 'packages/core/css/<%= pkg.name %>.core.css' | ||
}] | ||
}, | ||
core_min: { | ||
options: { | ||
banner: '<%= banner %>', | ||
modifyVars: { | ||
'font-path': '../fonts/' | ||
}, | ||
compress: true | ||
}, | ||
files: [{ | ||
src: 'packages/core/less/main.less', | ||
dest: 'packages/core/css/<%= pkg.name %>.core.min.css' | ||
}] | ||
}, | ||
dist: { | ||
options: { | ||
banner: '<%= banner %>' | ||
}, | ||
files: getFiles() | ||
}, | ||
min: { | ||
options: { | ||
banner: '<%= banner %>', | ||
compress: true | ||
}, | ||
files: getFiles(true) | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
module.exports = { | ||
less_dist: { | ||
options: { | ||
patterns: [ | ||
{ | ||
match: /..\/..\/core\/less\//g, | ||
replace: './' | ||
} | ||
] | ||
}, | ||
files: [ | ||
{ | ||
expand: true, | ||
src: '<%= dist %>/release/less/*.less', | ||
dest: './' | ||
} | ||
] | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
const concat = require('./concat'); | ||
|
||
function getFiles() { | ||
const files = {}; | ||
const sources = Object.keys(concat.dist.files); | ||
|
||
sources.forEach((srcFile) => { | ||
files[srcFile.replace('.js', '.min.js')] = srcFile; | ||
}); | ||
|
||
return files; | ||
} | ||
|
||
module.exports = { | ||
options: { | ||
banner: '<%= banner %>' | ||
}, | ||
concat: { | ||
files: getFiles() | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.