]> source.dussan.org Git - jquery-ui.git/commitdiff
Initial implementation for generating manifest files.
authorScott González <scott.gonzalez@gmail.com>
Fri, 6 Jul 2012 00:11:52 +0000 (20:11 -0400)
committerScott González <scott.gonzalez@gmail.com>
Fri, 6 Jul 2012 00:11:52 +0000 (20:11 -0400)
build/core.json [new file with mode: 0644]
build/effects.json [new file with mode: 0644]
build/tasks/build.js
build/widgets.json [new file with mode: 0644]

diff --git a/build/core.json b/build/core.json
new file mode 100644 (file)
index 0000000..e50a57b
--- /dev/null
@@ -0,0 +1,45 @@
+{
+       "core": {
+               "description": "The core of jQuery UI, required for all interactions and widgets."
+       },
+       "datepicker": {
+               "description": "A datepicker than can be toggled from a input or displayed inline.",
+               "dependencies": [ "core" ],
+               "keywords": [
+                       "form",
+                       "calendar",
+                       "date",
+                       "i18n"
+               ]
+       },
+       "effect": {
+               "description": "Extends the internal jQuery effects, includes morphing, easing and is required by all other effects.",
+               "keywords": [
+                       "animation",
+                       "show",
+                       "hide",
+                       "color",
+                       "class",
+                       "transition",
+                       "easing"
+               ]
+       },
+       "position": {
+               "description": "A utility plugin for positioning elements relative to other elements.",
+               "keywords": [
+                       "offset",
+                       "relative",
+                       "absolute",
+                       "fixed",
+                       "collision"
+               ]
+       },
+       "widget": {
+               "description": "Provides a factory for creating stateful widgets with a common API.",
+               "keywords": [
+                       "abstraction",
+                       "state",
+                       "factory"
+               ]
+       }
+}
diff --git a/build/effects.json b/build/effects.json
new file mode 100644 (file)
index 0000000..ef69ef8
--- /dev/null
@@ -0,0 +1,41 @@
+{
+       "blind": {
+               "description": "Blinds the element."
+       },
+       "bounce": {
+               "description": "Bounces an element horizontally or vertically n-times."
+       },
+       "clip": {
+               "description": "Clips the element on and off like an old TV."
+       },
+       "drop": {
+               "description": "A Drop out effect by moving the element in one direction and hiding it at the same time."
+       },
+       "explode": {
+               "description": "The element explodes in all directions into n pieces. Also supports imploding again."
+       },
+       "fade": {
+               "description": "Fades the element."
+       },
+       "fold": {
+               "description": "Folds the element first horizontally and then vertically."
+       },
+       "highlight": {
+               "description": "Highlights the background of the element in a defined color for a custom duration."
+       },
+       "pulsate": {
+               "description": "The element pulsates n times by changing the opacity to zero and back."
+       },
+       "scale": {
+               "description": "Grow or shrink any element and its content and restore it again."
+       },
+       "shake": {
+               "description": "Shakes the element horizontally or vertically n times."
+       },
+       "slide": {
+               "description": "The element slides in and out of the viewport."
+       },
+       "transfer": {
+               "description": "Transfer effect from one element to another."
+       }
+}
index 06a4b98a2743f277e96f561a29cfed8bd784e507..aeacc232d2c323784b922944c93aeb609b769b36 100644 (file)
@@ -2,6 +2,80 @@ module.exports = function( grunt ) {
 
 var path = require( "path" );
 
+grunt.registerTask( "manifest", "Generate jquery.json manifest files", function() {
+       var pkg = grunt.config( "pkg" ),
+               base = {
+                       core: {
+                               name: "ui.{plugin}",
+                               title: "jQuery UI {Plugin}"
+                       },
+                       widgets: {
+                               name: "ui.{plugin}",
+                               title: "jQuery UI {Plugin}",
+                               dependencies: [ "core", "widget" ]
+                       },
+                       effects: {
+                               name: "ui.effect-{plugin}",
+                               title: "jQuery UI {Plugin} Effect",
+                               keywords: [ "effect", "show", "hide" ],
+                               // TODO: Will we have individual pages for 1.9?
+                               homepage: "http://jqueryui.com/effect/",
+                               // TODO: Will we have individual pages for 1.9?
+                               demo: "http://jqueryui.com/effect/",
+                               docs: "http://api.jqueryui.com/{plugin}-effect/",
+                               dependencies: [ "effect" ],
+                               file: "ui.effect-{plugin}"
+                       }
+               };
+
+       Object.keys( base ).forEach(function( type ) {
+               var baseManifest = base[ type ],
+                       plugins = grunt.file.readJSON( "build/" + type + ".json" );
+
+               Object.keys( plugins ).forEach(function( plugin ) {
+                       var manifest,
+                               data = plugins[ plugin ],
+                               name = plugin.charAt( 0 ).toUpperCase() + plugin.substr( 1 );
+
+                       function replace( str ) {
+                               return str.replace( "{plugin}", plugin ).replace( "{Plugin}", name );
+                       }
+
+                       manifest = {
+                               name: replace( baseManifest.name ),
+                               title: replace( baseManifest.title ),
+                               description: data.description,
+                               keywords: [ "ui", plugin ]
+                                       .concat( baseManifest.keywords || [] )
+                                       .concat( data.keywords || [] ),
+                               version: pkg.version,
+                               author: pkg.author,
+                               maintainers: pkg.maintainers,
+                               bugs: pkg.bugs,
+                               homepage: data.homepage || replace( baseManifest.homepage ||
+                                       "http://jqueryui.com/{plugin}/" ),
+                               demo: data.demo || replace( baseManifest.demo ||
+                                       "http://jqueryui.com/{plugin}/" ),
+                               docs: data.docs || replace( baseManifest.docs ||
+                                       "http://api.jqueryui.com/{plugin}/" ),
+                               download: "http://jqueryui.com/download/",
+                               dependencies: {
+                                       jquery: ">=1.6"
+                               }
+                       };
+
+                       (baseManifest.dependencies || [])
+                               .concat(data.dependencies || [])
+                               .forEach(function( dependency ) {
+                                       manifest.dependencies[ "ui." + dependency ] = pkg.version;
+                               });
+
+                       grunt.file.write( replace( baseManifest.file || "ui.{plugin}" ) + ".jquery.json",
+                               JSON.stringify( manifest, null, "\t" ) );
+               });
+       });
+});
+
 grunt.registerMultiTask( "copy", "Copy files to destination folder and replace @VERSION with pkg.version", function() {
        function replaceVersion( source ) {
                return source.replace( /@VERSION/g, grunt.config( "pkg.version" ) );
diff --git a/build/widgets.json b/build/widgets.json
new file mode 100644 (file)
index 0000000..e39b046
--- /dev/null
@@ -0,0 +1,135 @@
+{
+       "accordion": {
+               "dependencies": [],
+               "description": "Collapsable content panels for displaying information in a limited amount of space.",
+               "keywords": [
+                       "navigation",
+                       "panel",
+                       "collapse",
+                       "expand"
+               ]
+       },
+       "autocomplete": {
+               "dependencies": [ "menu", "position" ],
+               "description": "Provides a list of suggested words as the user is typing.",
+               "keywords": [
+                       "form",
+                       "word",
+                       "predict",
+                       "suggest"
+               ]
+       },
+       "button": {
+               "dependencies": [],
+               "description": "Enhance your forms with themable buttons.",
+               "keywords": [
+                       "form",
+                       "radio",
+                       "checkbox"
+               ]
+       },
+       "dialog": {
+               "dependencies": [ "button", "draggable", "position", "resizable" ],
+               "description": "Customizable dialog windows.",
+               "keywords": [
+                       "modal",
+                       "alert",
+                       "popup"
+               ]
+       },
+       "draggable": {
+               "dependencies": [ "mouse" ],
+               "description": "Enable dragging functionality for any element.",
+               "keywords": [
+                       "drag",
+                       "drop"
+               ]
+       },
+       "droppable": {
+               "dependencies": [ "draggable", "mouse" ],
+               "description": "Create drop targets for draggable elements.",
+               "keywords": [
+                       "drag",
+                       "drop"
+               ]
+       },
+       "menu": {
+               "dependencies": [ "position" ],
+               "description": "Easily create nestable menus.",
+               "keywords": [
+                       "dropdown",
+                       "flyout"
+               ]
+       },
+       "mouse": {
+               "dependencies": [],
+               "description": "An abstraction for any mouse-based interactions.",
+               "keywords": [
+                       "abstraction"
+               ]
+       },
+       "progressbar": {
+               "dependencies": [],
+               "description": "A status indicator that can be used for a loading state and standard percentage indicators.",
+               "keywords": [
+                       "determinate",
+                       "status"
+               ]
+       },
+       "resizable": {
+               "dependencies": [ "mouse" ],
+               "description": "Enable resize functioality for any element.",
+               "keywords": [
+                       "resize"
+               ]
+       },
+       "selectable": {
+               "dependencies": [ "mouse" ],
+               "description": "Create groups of elements that can be selected with the mouse.",
+               "keywords": [
+                       "selection"
+               ]
+       },
+       "slider": {
+               "dependencies": [ "mouse" ],
+               "description": "A flexible slider with ranges and accessibility via keyboard.",
+               "keywords": [
+                       "form",
+                       "number",
+                       "range"
+               ]
+       },
+       "sortable": {
+               "dependencies": [ "mouse" ],
+               "description": "Sort items in a list using the mouse.",
+               "keywords": [
+                       "sort",
+                       "list"
+               ]
+       },
+       "spinner": {
+               "dependencies": [ "button" ],
+               "description": "Easily input numbers via the keyboard or mouse.",
+               "keywords": [
+                       "form",
+                       "number",
+                       "spinbutton",
+                       "stepper"
+               ]
+       },
+       "tabs": {
+               "dependencies": [],
+               "description": "Transforms a set of container elements into a tab structure.",
+               "keywords": [
+                       "navigation",
+                       "panel",
+                       "collapse",
+                       "expand"
+               ]
+       },
+       "tooltip": {
+               "dependencies": [ "position" ],
+               "description": "Show additional information for any element on hover or focus.",
+               "keywords": []
+       }
+}