Permalink
Please sign in to comment.
Browse files
Packer: Support building 1.12.0 package
- Handle CSS dependencies from JS comments (based on jQuery Mobile); - Use node-packager, builder-amd, builder-jquery-css, and jquery-ui-themeroller to build UI 1.12.0 download package; - Cache support; Fixes #178 Fixes #255 Ref jquery/jquery-ui#1440
- Loading branch information...
Showing
with
627 additions
and 215 deletions.
- +1 −1 Gruntfile.js
- +69 −33 download.js
- +11 −42 lib/jquery-ui-files-1-12.js
- +320 −0 lib/package-1-12.js
- +0 −133 lib/packer-1-12-0.js
- +0 −1 lib/packer.js
- +4 −2 lib/util.js
- +6 −1 package.json
- +14 −0 server.js
- +1 −1 test/{jquery-ui.js → jquery-ui-1-11.js}
- +200 −0 test/package-1-12.0.js
- +1 −1 test/packer-1-11-1.js
102
download.js
| @@ -1,61 +1,30 @@ | ||
| -var commonFiles, componentFiles, flatten, glob, isDirectory, noDirectory, optional, testFiles, | ||
| - Docs = require( "./docs" ), | ||
| +var glob, noDirectory, | ||
| Files = require( "./files" ), | ||
| util = require( "./util" ); | ||
| -flatten = util.flatten; | ||
| glob = util.glob; | ||
| -isDirectory = util.isDirectory; | ||
| noDirectory = util.noDirectory; | ||
| -optional = util.optional; | ||
| - | ||
| -commonFiles = [ | ||
| - "AUTHORS.txt", | ||
| - "Gruntfile.js", | ||
| - "MIT-LICENSE.txt", | ||
| - "package.json", | ||
| - "README.md", | ||
| - "external/*", | ||
| - "demos/demos.css", | ||
| - "demos/images/*", | ||
| - "themes/base/all.css", | ||
| - "themes/base/base.css", | ||
| - "themes/base/theme.css", | ||
| - "themes/base/images/*" | ||
| -]; | ||
| -componentFiles = [ | ||
| - "ui/*.js", | ||
| - "themes/base/*" | ||
| -]; | ||
| -testFiles = [ | ||
| - "tests/**", | ||
| - "ui/.jshintrc" | ||
| -]; | ||
| /** | ||
| * JqueryUiFiles 1.12.0 | ||
| */ | ||
| function JqueryUiFiles_1_12_0( jqueryUi ) { | ||
| - var readFile, stripJqueryUiPath, | ||
| - path = require( "path" ); | ||
| + var files, readFile, stripJqueryUiPath; | ||
| readFile = this.readFile; | ||
| stripJqueryUiPath = this.stripJqueryUiPath; | ||
| - this.commonFiles = commonFiles.map(function( path ) { | ||
| - return glob( jqueryUi.path + path ).filter( noDirectory ).map( stripJqueryUiPath ).map( readFile ); | ||
| - }).reduce( flatten, Files() ); | ||
| - | ||
| - this.componentFiles = componentFiles.map(function( path ) { | ||
| - return glob( jqueryUi.path + path ).filter( noDirectory ).map( stripJqueryUiPath ).map( readFile ); | ||
| - }).reduce( flatten, Files() ); | ||
| - | ||
| - this.i18nFiles = Files( glob( jqueryUi.path + "ui/i18n/*" ).map( stripJqueryUiPath ).map( readFile ) ); | ||
| + glob( jqueryUi.path + "!(node_modules|build)" ).filter( noDirectory ).map( stripJqueryUiPath ).map( readFile ); | ||
| + glob( jqueryUi.path + "!(node_modules|build)/**" ).filter( noDirectory ).map( stripJqueryUiPath ).map( readFile ); | ||
| - this.jqueryCore = Files( glob( jqueryUi.path + "external/jquery/jquery.js" ).map( stripJqueryUiPath ).map( readFile ) ); | ||
| + this.componentFiles = Files( glob( jqueryUi.path + "ui/*.js" ).map( stripJqueryUiPath ).map( readFile ) ); | ||
| - // Auxiliary variables | ||
| - this.baseThemeCss = this.get( "themes/base/theme.css" ); | ||
| + // Convert {path:<path>, data:<data>} into {path: <data>}. | ||
| + files = this.cache; | ||
| + this.cache = Object.keys( files ).reduce(function( _files, filepath ) { | ||
| + _files[ filepath ] = files[ filepath ].data; | ||
| + return _files; | ||
| + }, {} ); | ||
| } | ||
| module.exports = JqueryUiFiles_1_12_0; |
Oops, something went wrong.
0 comments on commit
eda7d35