##// END OF EJS Templates
grunt: switching to webcomponents-lite
lisaq -
r728:ad65ce3e default
parent child Browse files
Show More
@@ -1,187 +1,187 b''
1 module.exports = function(grunt) {
1 module.exports = function(grunt) {
2 grunt.initConfig({
2 grunt.initConfig({
3
3
4 dirs: {
4 dirs: {
5 css: "rhodecode/public/css",
5 css: "rhodecode/public/css",
6 js: {
6 js: {
7 "src": "rhodecode/public/js/src",
7 "src": "rhodecode/public/js/src",
8 "dest": "rhodecode/public/js"
8 "dest": "rhodecode/public/js"
9 }
9 }
10 },
10 },
11 copy: {
11 copy: {
12 main: {
12 main: {
13 expand: true,
13 expand: true,
14 cwd: 'bower_components',
14 cwd: 'bower_components',
15 src: 'webcomponentsjs/**',
15 src: 'webcomponentsjs/webcomponents-lite.js',
16 dest: '<%= dirs.js.dest %>/vendors',
16 dest: '<%= dirs.js.dest %>/vendors',
17 },
17 },
18 },
18 },
19 concat: {
19 concat: {
20 polymercss:{
20 polymercss:{
21 src: [
21 src: [
22 // Base libraries
22 // Base libraries
23 '<%= dirs.js.src %>/components/root-styles-prefix.html',
23 '<%= dirs.js.src %>/components/root-styles-prefix.html',
24 '<%= dirs.css %>/style-polymer.css',
24 '<%= dirs.css %>/style-polymer.css',
25 '<%= dirs.js.src %>/components/root-styles-suffix.html'
25 '<%= dirs.js.src %>/components/root-styles-suffix.html'
26 ],
26 ],
27 dest: '<%= dirs.js.dest %>/src/components/root-styles.gen.html',
27 dest: '<%= dirs.js.dest %>/src/components/root-styles.gen.html',
28 nonull: true
28 nonull: true
29 },
29 },
30 dist: {
30 dist: {
31 src: [
31 src: [
32 // Base libraries
32 // Base libraries
33 '<%= dirs.js.src %>/jquery-1.11.1.min.js',
33 '<%= dirs.js.src %>/jquery-1.11.1.min.js',
34 '<%= dirs.js.src %>/logging.js',
34 '<%= dirs.js.src %>/logging.js',
35 '<%= dirs.js.src %>/bootstrap.js',
35 '<%= dirs.js.src %>/bootstrap.js',
36 '<%= dirs.js.src %>/mousetrap.js',
36 '<%= dirs.js.src %>/mousetrap.js',
37 '<%= dirs.js.src %>/moment.js',
37 '<%= dirs.js.src %>/moment.js',
38 '<%= dirs.js.src %>/appenlight-client-0.4.1.min.js',
38 '<%= dirs.js.src %>/appenlight-client-0.4.1.min.js',
39 '<%= dirs.js.src %>/i18n_utils.js',
39 '<%= dirs.js.src %>/i18n_utils.js',
40 '<%= dirs.js.src %>/deform.js',
40 '<%= dirs.js.src %>/deform.js',
41
41
42 // Plugins
42 // Plugins
43 '<%= dirs.js.src %>/plugins/jquery.pjax.js',
43 '<%= dirs.js.src %>/plugins/jquery.pjax.js',
44 '<%= dirs.js.src %>/plugins/jquery.dataTables.js',
44 '<%= dirs.js.src %>/plugins/jquery.dataTables.js',
45 '<%= dirs.js.src %>/plugins/flavoured_checkbox.js',
45 '<%= dirs.js.src %>/plugins/flavoured_checkbox.js',
46 '<%= dirs.js.src %>/plugins/jquery.auto-grow-input.js',
46 '<%= dirs.js.src %>/plugins/jquery.auto-grow-input.js',
47 '<%= dirs.js.src %>/plugins/jquery.autocomplete.js',
47 '<%= dirs.js.src %>/plugins/jquery.autocomplete.js',
48 '<%= dirs.js.src %>/plugins/jquery.debounce.js',
48 '<%= dirs.js.src %>/plugins/jquery.debounce.js',
49 '<%= dirs.js.src %>/plugins/jquery.mark.js',
49 '<%= dirs.js.src %>/plugins/jquery.mark.js',
50 '<%= dirs.js.src %>/plugins/jquery.timeago.js',
50 '<%= dirs.js.src %>/plugins/jquery.timeago.js',
51 '<%= dirs.js.src %>/plugins/jquery.timeago-extension.js',
51 '<%= dirs.js.src %>/plugins/jquery.timeago-extension.js',
52
52
53 // Select2
53 // Select2
54 '<%= dirs.js.src %>/select2/select2.js',
54 '<%= dirs.js.src %>/select2/select2.js',
55
55
56 // Code-mirror
56 // Code-mirror
57 '<%= dirs.js.src %>/codemirror/codemirror.js',
57 '<%= dirs.js.src %>/codemirror/codemirror.js',
58 '<%= dirs.js.src %>/codemirror/codemirror_loadmode.js',
58 '<%= dirs.js.src %>/codemirror/codemirror_loadmode.js',
59 '<%= dirs.js.src %>/codemirror/codemirror_hint.js',
59 '<%= dirs.js.src %>/codemirror/codemirror_hint.js',
60 '<%= dirs.js.src %>/codemirror/codemirror_overlay.js',
60 '<%= dirs.js.src %>/codemirror/codemirror_overlay.js',
61 '<%= dirs.js.src %>/codemirror/codemirror_placeholder.js',
61 '<%= dirs.js.src %>/codemirror/codemirror_placeholder.js',
62 // TODO: mikhail: this is an exception. Since the code mirror modes
62 // TODO: mikhail: this is an exception. Since the code mirror modes
63 // are loaded "on the fly", we need to keep them in a public folder
63 // are loaded "on the fly", we need to keep them in a public folder
64 '<%= dirs.js.dest %>/mode/meta.js',
64 '<%= dirs.js.dest %>/mode/meta.js',
65 '<%= dirs.js.dest %>/mode/meta_ext.js',
65 '<%= dirs.js.dest %>/mode/meta_ext.js',
66 '<%= dirs.js.dest %>/rhodecode/i18n/select2/translations.js',
66 '<%= dirs.js.dest %>/rhodecode/i18n/select2/translations.js',
67
67
68 // Rhodecode utilities
68 // Rhodecode utilities
69 '<%= dirs.js.src %>/rhodecode/utils/array.js',
69 '<%= dirs.js.src %>/rhodecode/utils/array.js',
70 '<%= dirs.js.src %>/rhodecode/utils/string.js',
70 '<%= dirs.js.src %>/rhodecode/utils/string.js',
71 '<%= dirs.js.src %>/rhodecode/utils/pyroutes.js',
71 '<%= dirs.js.src %>/rhodecode/utils/pyroutes.js',
72 '<%= dirs.js.src %>/rhodecode/utils/ajax.js',
72 '<%= dirs.js.src %>/rhodecode/utils/ajax.js',
73 '<%= dirs.js.src %>/rhodecode/utils/autocomplete.js',
73 '<%= dirs.js.src %>/rhodecode/utils/autocomplete.js',
74 '<%= dirs.js.src %>/rhodecode/utils/colorgenerator.js',
74 '<%= dirs.js.src %>/rhodecode/utils/colorgenerator.js',
75 '<%= dirs.js.src %>/rhodecode/utils/ie.js',
75 '<%= dirs.js.src %>/rhodecode/utils/ie.js',
76 '<%= dirs.js.src %>/rhodecode/utils/os.js',
76 '<%= dirs.js.src %>/rhodecode/utils/os.js',
77 '<%= dirs.js.src %>/rhodecode/utils/topics.js',
77 '<%= dirs.js.src %>/rhodecode/utils/topics.js',
78
78
79 // Rhodecode widgets
79 // Rhodecode widgets
80 '<%= dirs.js.src %>/rhodecode/widgets/multiselect.js',
80 '<%= dirs.js.src %>/rhodecode/widgets/multiselect.js',
81
81
82 // Rhodecode components
82 // Rhodecode components
83 '<%= dirs.js.src %>/rhodecode/init.js',
83 '<%= dirs.js.src %>/rhodecode/init.js',
84 '<%= dirs.js.src %>/rhodecode/connection_controller.js',
84 '<%= dirs.js.src %>/rhodecode/connection_controller.js',
85 '<%= dirs.js.src %>/rhodecode/codemirror.js',
85 '<%= dirs.js.src %>/rhodecode/codemirror.js',
86 '<%= dirs.js.src %>/rhodecode/comments.js',
86 '<%= dirs.js.src %>/rhodecode/comments.js',
87 '<%= dirs.js.src %>/rhodecode/constants.js',
87 '<%= dirs.js.src %>/rhodecode/constants.js',
88 '<%= dirs.js.src %>/rhodecode/files.js',
88 '<%= dirs.js.src %>/rhodecode/files.js',
89 '<%= dirs.js.src %>/rhodecode/followers.js',
89 '<%= dirs.js.src %>/rhodecode/followers.js',
90 '<%= dirs.js.src %>/rhodecode/menus.js',
90 '<%= dirs.js.src %>/rhodecode/menus.js',
91 '<%= dirs.js.src %>/rhodecode/notifications.js',
91 '<%= dirs.js.src %>/rhodecode/notifications.js',
92 '<%= dirs.js.src %>/rhodecode/permissions.js',
92 '<%= dirs.js.src %>/rhodecode/permissions.js',
93 '<%= dirs.js.src %>/rhodecode/pjax.js',
93 '<%= dirs.js.src %>/rhodecode/pjax.js',
94 '<%= dirs.js.src %>/rhodecode/pullrequests.js',
94 '<%= dirs.js.src %>/rhodecode/pullrequests.js',
95 '<%= dirs.js.src %>/rhodecode/settings.js',
95 '<%= dirs.js.src %>/rhodecode/settings.js',
96 '<%= dirs.js.src %>/rhodecode/select2_widgets.js',
96 '<%= dirs.js.src %>/rhodecode/select2_widgets.js',
97 '<%= dirs.js.src %>/rhodecode/tooltips.js',
97 '<%= dirs.js.src %>/rhodecode/tooltips.js',
98 '<%= dirs.js.src %>/rhodecode/users.js',
98 '<%= dirs.js.src %>/rhodecode/users.js',
99 '<%= dirs.js.src %>/rhodecode/utils/notifications.js',
99 '<%= dirs.js.src %>/rhodecode/utils/notifications.js',
100 '<%= dirs.js.src %>/rhodecode/appenlight.js',
100 '<%= dirs.js.src %>/rhodecode/appenlight.js',
101
101
102 // Rhodecode main module
102 // Rhodecode main module
103 '<%= dirs.js.src %>/rhodecode.js'
103 '<%= dirs.js.src %>/rhodecode.js'
104 ],
104 ],
105 dest: '<%= dirs.js.dest %>/scripts.js',
105 dest: '<%= dirs.js.dest %>/scripts.js',
106 nonull: true
106 nonull: true
107 }
107 }
108 },
108 },
109
109
110 less: {
110 less: {
111 development: {
111 development: {
112 options: {
112 options: {
113 compress: false,
113 compress: false,
114 yuicompress: false,
114 yuicompress: false,
115 optimization: 0
115 optimization: 0
116 },
116 },
117 files: {
117 files: {
118 "<%= dirs.css %>/style.css": "<%= dirs.css %>/main.less",
118 "<%= dirs.css %>/style.css": "<%= dirs.css %>/main.less",
119 "<%= dirs.css %>/style-polymer.css": "<%= dirs.css %>/polymer.less"
119 "<%= dirs.css %>/style-polymer.css": "<%= dirs.css %>/polymer.less"
120 }
120 }
121 },
121 },
122 production: {
122 production: {
123 options: {
123 options: {
124 compress: true,
124 compress: true,
125 yuicompress: true,
125 yuicompress: true,
126 optimization: 2
126 optimization: 2
127 },
127 },
128 files: {
128 files: {
129 "<%= dirs.css %>/style.css": "<%= dirs.css %>/main.less",
129 "<%= dirs.css %>/style.css": "<%= dirs.css %>/main.less",
130 "<%= dirs.css %>/style-polymer.css": "<%= dirs.css %>/polymer.less"
130 "<%= dirs.css %>/style-polymer.css": "<%= dirs.css %>/polymer.less"
131 }
131 }
132 },
132 },
133 components: {
133 components: {
134 files: [{
134 files: [{
135 cwd: '<%= dirs.js.src %>/components/',
135 cwd: '<%= dirs.js.src %>/components/',
136 dest: '<%= dirs.js.src %>/components/',
136 dest: '<%= dirs.js.src %>/components/',
137 src: ['**/*.less'],
137 src: ['**/*.less'],
138 expand: true,
138 expand: true,
139 ext: '.css'
139 ext: '.css'
140 }]
140 }]
141 }
141 }
142 },
142 },
143
143
144 watch: {
144 watch: {
145 less: {
145 less: {
146 files: ["<%= dirs.css %>/**/*.less"],
146 files: ["<%= dirs.css %>/**/*.less"],
147 tasks: ["less:development", 'less:components', 'concat:polymercss', "vulcanize"]
147 tasks: ["less:development", 'less:components', 'concat:polymercss', "vulcanize"]
148 },
148 },
149 js: {
149 js: {
150 files: ["<%= dirs.js.src %>/**/*.js", "<%= dirs.js.src %>/components/**/*.html"],
150 files: ["<%= dirs.js.src %>/**/*.js", "<%= dirs.js.src %>/components/**/*.html"],
151 tasks: ['less:components', 'concat:polymercss', "vulcanize", "concat:dist"]
151 tasks: ['less:components', 'concat:polymercss', "vulcanize", "concat:dist"]
152 }
152 }
153 },
153 },
154
154
155 jshint: {
155 jshint: {
156 rhodecode: {
156 rhodecode: {
157 src: '<%= dirs.js.src %>/rhodecode/**/*.js',
157 src: '<%= dirs.js.src %>/rhodecode/**/*.js',
158 options: {
158 options: {
159 jshintrc: '.jshintrc'
159 jshintrc: '.jshintrc'
160 }
160 }
161 }
161 }
162 },
162 },
163 vulcanize: {
163 vulcanize: {
164 default: {
164 default: {
165 options: {
165 options: {
166 abspath: '',
166 abspath: '',
167 inlineScripts: true,
167 inlineScripts: true,
168 inlineCss: true,
168 inlineCss: true,
169 stripComments: true
169 stripComments: true
170 },
170 },
171 files: {
171 files: {
172 '<%= dirs.js.dest %>/rhodecode-components.html': '<%= dirs.js.src %>/components/shared-components.html'
172 '<%= dirs.js.dest %>/rhodecode-components.html': '<%= dirs.js.src %>/components/shared-components.html'
173 }
173 }
174 }
174 }
175 }
175 }
176 });
176 });
177
177
178 grunt.loadNpmTasks('grunt-contrib-less');
178 grunt.loadNpmTasks('grunt-contrib-less');
179 grunt.loadNpmTasks('grunt-contrib-concat');
179 grunt.loadNpmTasks('grunt-contrib-concat');
180 grunt.loadNpmTasks('grunt-contrib-watch');
180 grunt.loadNpmTasks('grunt-contrib-watch');
181 grunt.loadNpmTasks('grunt-contrib-jshint');
181 grunt.loadNpmTasks('grunt-contrib-jshint');
182 grunt.loadNpmTasks('grunt-vulcanize');
182 grunt.loadNpmTasks('grunt-vulcanize');
183 grunt.loadNpmTasks('grunt-crisper');
183 grunt.loadNpmTasks('grunt-crisper');
184 grunt.loadNpmTasks('grunt-contrib-copy');
184 grunt.loadNpmTasks('grunt-contrib-copy');
185
185
186 grunt.registerTask('default', ['less:production', 'less:components', 'concat:polymercss', 'copy','vulcanize', 'concat:dist']);
186 grunt.registerTask('default', ['less:production', 'less:components', 'concat:polymercss', 'copy','vulcanize', 'concat:dist']);
187 };
187 };
General Comments 0
You need to be logged in to leave comments. Login now