Skip to content

Commit 7f859e4

Browse files
committed
Initial implementation for generating manifest files.
1 parent ab260f7 commit 7f859e4

4 files changed

Lines changed: 295 additions & 0 deletions

File tree

build/core.json

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
{
2+
"core": {
3+
"description": "The core of jQuery UI, required for all interactions and widgets."
4+
},
5+
"datepicker": {
6+
"description": "A datepicker than can be toggled from a input or displayed inline.",
7+
"dependencies": [ "core" ],
8+
"keywords": [
9+
"form",
10+
"calendar",
11+
"date",
12+
"i18n"
13+
]
14+
},
15+
"effect": {
16+
"description": "Extends the internal jQuery effects, includes morphing, easing and is required by all other effects.",
17+
"keywords": [
18+
"animation",
19+
"show",
20+
"hide",
21+
"color",
22+
"class",
23+
"transition",
24+
"easing"
25+
]
26+
},
27+
"position": {
28+
"description": "A utility plugin for positioning elements relative to other elements.",
29+
"keywords": [
30+
"offset",
31+
"relative",
32+
"absolute",
33+
"fixed",
34+
"collision"
35+
]
36+
},
37+
"widget": {
38+
"description": "Provides a factory for creating stateful widgets with a common API.",
39+
"keywords": [
40+
"abstraction",
41+
"state",
42+
"factory"
43+
]
44+
}
45+
}

build/effects.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"blind": {
3+
"description": "Blinds the element."
4+
},
5+
"bounce": {
6+
"description": "Bounces an element horizontally or vertically n-times."
7+
},
8+
"clip": {
9+
"description": "Clips the element on and off like an old TV."
10+
},
11+
"drop": {
12+
"description": "A Drop out effect by moving the element in one direction and hiding it at the same time."
13+
},
14+
"explode": {
15+
"description": "The element explodes in all directions into n pieces. Also supports imploding again."
16+
},
17+
"fade": {
18+
"description": "Fades the element."
19+
},
20+
"fold": {
21+
"description": "Folds the element first horizontally and then vertically."
22+
},
23+
"highlight": {
24+
"description": "Highlights the background of the element in a defined color for a custom duration."
25+
},
26+
"pulsate": {
27+
"description": "The element pulsates n times by changing the opacity to zero and back."
28+
},
29+
"scale": {
30+
"description": "Grow or shrink any element and its content and restore it again."
31+
},
32+
"shake": {
33+
"description": "Shakes the element horizontally or vertically n times."
34+
},
35+
"slide": {
36+
"description": "The element slides in and out of the viewport."
37+
},
38+
"transfer": {
39+
"description": "Transfer effect from one element to another."
40+
}
41+
}

build/tasks/build.js

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,80 @@ module.exports = function( grunt ) {
22

33
var path = require( "path" );
44

5+
grunt.registerTask( "manifest", "Generate jquery.json manifest files", function() {
6+
var pkg = grunt.config( "pkg" ),
7+
base = {
8+
core: {
9+
name: "ui.{plugin}",
10+
title: "jQuery UI {Plugin}"
11+
},
12+
widgets: {
13+
name: "ui.{plugin}",
14+
title: "jQuery UI {Plugin}",
15+
dependencies: [ "core", "widget" ]
16+
},
17+
effects: {
18+
name: "ui.effect-{plugin}",
19+
title: "jQuery UI {Plugin} Effect",
20+
keywords: [ "effect", "show", "hide" ],
21+
// TODO: Will we have individual pages for 1.9?
22+
homepage: "http://jqueryui.com/effect/",
23+
// TODO: Will we have individual pages for 1.9?
24+
demo: "http://jqueryui.com/effect/",
25+
docs: "http://api.jqueryui.com/{plugin}-effect/",
26+
dependencies: [ "effect" ],
27+
file: "ui.effect-{plugin}"
28+
}
29+
};
30+
31+
Object.keys( base ).forEach(function( type ) {
32+
var baseManifest = base[ type ],
33+
plugins = grunt.file.readJSON( "build/" + type + ".json" );
34+
35+
Object.keys( plugins ).forEach(function( plugin ) {
36+
var manifest,
37+
data = plugins[ plugin ],
38+
name = plugin.charAt( 0 ).toUpperCase() + plugin.substr( 1 );
39+
40+
function replace( str ) {
41+
return str.replace( "{plugin}", plugin ).replace( "{Plugin}", name );
42+
}
43+
44+
manifest = {
45+
name: replace( baseManifest.name ),
46+
title: replace( baseManifest.title ),
47+
description: data.description,
48+
keywords: [ "ui", plugin ]
49+
.concat( baseManifest.keywords || [] )
50+
.concat( data.keywords || [] ),
51+
version: pkg.version,
52+
author: pkg.author,
53+
maintainers: pkg.maintainers,
54+
bugs: pkg.bugs,
55+
homepage: data.homepage || replace( baseManifest.homepage ||
56+
"http://jqueryui.com/{plugin}/" ),
57+
demo: data.demo || replace( baseManifest.demo ||
58+
"http://jqueryui.com/{plugin}/" ),
59+
docs: data.docs || replace( baseManifest.docs ||
60+
"http://api.jqueryui.com/{plugin}/" ),
61+
download: "http://jqueryui.com/download/",
62+
dependencies: {
63+
jquery: ">=1.6"
64+
}
65+
};
66+
67+
(baseManifest.dependencies || [])
68+
.concat(data.dependencies || [])
69+
.forEach(function( dependency ) {
70+
manifest.dependencies[ "ui." + dependency ] = pkg.version;
71+
});
72+
73+
grunt.file.write( replace( baseManifest.file || "ui.{plugin}" ) + ".jquery.json",
74+
JSON.stringify( manifest, null, "\t" ) );
75+
});
76+
});
77+
});
78+
579
grunt.registerMultiTask( "copy", "Copy files to destination folder and replace @VERSION with pkg.version", function() {
680
function replaceVersion( source ) {
781
return source.replace( /@VERSION/g, grunt.config( "pkg.version" ) );

build/widgets.json

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
{
2+
"accordion": {
3+
"dependencies": [],
4+
"description": "Collapsable content panels for displaying information in a limited amount of space.",
5+
"keywords": [
6+
"navigation",
7+
"panel",
8+
"collapse",
9+
"expand"
10+
]
11+
},
12+
"autocomplete": {
13+
"dependencies": [ "menu", "position" ],
14+
"description": "Provides a list of suggested words as the user is typing.",
15+
"keywords": [
16+
"form",
17+
"word",
18+
"predict",
19+
"suggest"
20+
]
21+
},
22+
"button": {
23+
"dependencies": [],
24+
"description": "Enhance your forms with themable buttons.",
25+
"keywords": [
26+
"form",
27+
"radio",
28+
"checkbox"
29+
]
30+
},
31+
"dialog": {
32+
"dependencies": [ "button", "draggable", "position", "resizable" ],
33+
"description": "Customizable dialog windows.",
34+
"keywords": [
35+
"modal",
36+
"alert",
37+
"popup"
38+
]
39+
},
40+
"draggable": {
41+
"dependencies": [ "mouse" ],
42+
"description": "Enable dragging functionality for any element.",
43+
"keywords": [
44+
"drag",
45+
"drop"
46+
]
47+
},
48+
"droppable": {
49+
"dependencies": [ "draggable", "mouse" ],
50+
"description": "Create drop targets for draggable elements.",
51+
"keywords": [
52+
"drag",
53+
"drop"
54+
]
55+
},
56+
"menu": {
57+
"dependencies": [ "position" ],
58+
"description": "Easily create nestable menus.",
59+
"keywords": [
60+
"dropdown",
61+
"flyout"
62+
]
63+
},
64+
"mouse": {
65+
"dependencies": [],
66+
"description": "An abstraction for any mouse-based interactions.",
67+
"keywords": [
68+
"abstraction"
69+
]
70+
},
71+
"progressbar": {
72+
"dependencies": [],
73+
"description": "A status indicator that can be used for a loading state and standard percentage indicators.",
74+
"keywords": [
75+
"determinate",
76+
"status"
77+
]
78+
},
79+
"resizable": {
80+
"dependencies": [ "mouse" ],
81+
"description": "Enable resize functioality for any element.",
82+
"keywords": [
83+
"resize"
84+
]
85+
},
86+
"selectable": {
87+
"dependencies": [ "mouse" ],
88+
"description": "Create groups of elements that can be selected with the mouse.",
89+
"keywords": [
90+
"selection"
91+
]
92+
},
93+
"slider": {
94+
"dependencies": [ "mouse" ],
95+
"description": "A flexible slider with ranges and accessibility via keyboard.",
96+
"keywords": [
97+
"form",
98+
"number",
99+
"range"
100+
]
101+
},
102+
"sortable": {
103+
"dependencies": [ "mouse" ],
104+
"description": "Sort items in a list using the mouse.",
105+
"keywords": [
106+
"sort",
107+
"list"
108+
]
109+
},
110+
"spinner": {
111+
"dependencies": [ "button" ],
112+
"description": "Easily input numbers via the keyboard or mouse.",
113+
"keywords": [
114+
"form",
115+
"number",
116+
"spinbutton",
117+
"stepper"
118+
]
119+
},
120+
"tabs": {
121+
"dependencies": [],
122+
"description": "Transforms a set of container elements into a tab structure.",
123+
"keywords": [
124+
"navigation",
125+
"panel",
126+
"collapse",
127+
"expand"
128+
]
129+
},
130+
"tooltip": {
131+
"dependencies": [ "position" ],
132+
"description": "Show additional information for any element on hover or focus.",
133+
"keywords": []
134+
}
135+
}

0 commit comments

Comments
 (0)