@@ -19,81 +19,8 @@ function expandFiles( files ) {
19
19
}
20
20
21
21
grunt . registerTask ( "manifest" , "Generate jquery.json manifest files" , function ( ) {
22
- var pkg = grunt . config ( "pkg" ) ,
23
- base = {
24
- core : {
25
- name : "ui.{plugin}" ,
26
- title : "jQuery UI {Plugin}"
27
- } ,
28
- widget : {
29
- name : "ui.{plugin}" ,
30
- title : "jQuery UI {Plugin}" ,
31
- dependencies : [ "core" , "widget" ]
32
- } ,
33
- interaction : {
34
- name : "ui.{plugin}" ,
35
- title : "jQuery UI {Plugin}" ,
36
- dependencies : [ "core" , "widget" , "mouse" ]
37
- } ,
38
- effect : {
39
- name : "ui.effect-{plugin}" ,
40
- title : "jQuery UI {Plugin} Effect" ,
41
- keywords : [ "effect" , "show" , "hide" ] ,
42
- homepage : "http://jqueryui.com/effect/" ,
43
- demo : "http://jqueryui.com/effect/" ,
44
- docs : "http://api.jqueryui.com/{plugin}-effect/" ,
45
- dependencies : [ "effect" ]
46
- }
47
- } ;
48
-
49
- Object . keys ( base ) . forEach ( function ( type ) {
50
- var baseManifest = base [ type ] ,
51
- plugins = grunt . file . readJSON ( "build/" + type + ".json" ) ;
52
-
53
- Object . keys ( plugins ) . forEach ( function ( plugin ) {
54
- var manifest ,
55
- data = plugins [ plugin ] ,
56
- name = plugin . charAt ( 0 ) . toUpperCase ( ) + plugin . substr ( 1 ) ;
57
-
58
- function replace ( str ) {
59
- return str . replace ( "{plugin}" , plugin ) . replace ( "{Plugin}" , name ) ;
60
- }
61
-
62
- manifest = {
63
- name : data . name || replace ( baseManifest . name ) ,
64
- title : data . title || replace ( baseManifest . title ) ,
65
- description : data . description ,
66
- keywords : [ "ui" , plugin ]
67
- . concat ( baseManifest . keywords || [ ] )
68
- . concat ( data . keywords || [ ] ) ,
69
- version : pkg . version ,
70
- author : pkg . author ,
71
- maintainers : pkg . maintainers ,
72
- licenses : pkg . licenses ,
73
- bugs : pkg . bugs ,
74
- homepage : data . homepage || replace ( baseManifest . homepage ||
75
- "http://jqueryui.com/{plugin}/" ) ,
76
- demo : data . demo || replace ( baseManifest . demo ||
77
- "http://jqueryui.com/{plugin}/" ) ,
78
- docs : data . docs || replace ( baseManifest . docs ||
79
- "http://api.jqueryui.com/{plugin}/" ) ,
80
- download : "http://jqueryui.com/download/" ,
81
- dependencies : {
82
- jquery : ">=1.6"
83
- } ,
84
- // custom
85
- category : data . category || type
86
- } ;
87
-
88
- ( baseManifest . dependencies || [ ] )
89
- . concat ( data . dependencies || [ ] )
90
- . forEach ( function ( dependency ) {
91
- manifest . dependencies [ "ui." + dependency ] = pkg . version ;
92
- } ) ;
93
-
94
- grunt . file . write ( manifest . name + ".jquery.json" ,
95
- JSON . stringify ( manifest , null , "\t" ) + "\n" ) ;
96
- } ) ;
22
+ require ( "../manifest" ) ( ) . forEach ( function ( manifest ) {
23
+ grunt . file . write ( manifest . name + ".jquery.json" , JSON . stringify ( manifest , null , "\t" ) + "\n" ) ;
97
24
} ) ;
98
25
} ) ;
99
26
0 commit comments