@materializecss/materialize 1.2.0 → 1.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (82) hide show
  1. package/Gruntfile.js +722 -712
  2. package/LICENSE +21 -21
  3. package/README.md +91 -91
  4. package/dist/css/materialize.css +78 -137
  5. package/dist/css/materialize.min.css +12 -12
  6. package/dist/js/materialize.js +1502 -1378
  7. package/dist/js/materialize.min.js +6 -6
  8. package/extras/noUiSlider/nouislider.css +403 -403
  9. package/extras/noUiSlider/nouislider.js +2147 -2147
  10. package/js/anime.min.js +34 -34
  11. package/js/autocomplete.js +479 -479
  12. package/js/buttons.js +354 -354
  13. package/js/cards.js +40 -40
  14. package/js/carousel.js +732 -732
  15. package/js/cash.js +960 -960
  16. package/js/characterCounter.js +136 -136
  17. package/js/chips.js +486 -486
  18. package/js/collapsible.js +275 -275
  19. package/js/component.js +44 -44
  20. package/js/datepicker.js +983 -983
  21. package/js/dropdown.js +669 -669
  22. package/js/forms.js +285 -285
  23. package/js/global.js +428 -428
  24. package/js/materialbox.js +453 -453
  25. package/js/modal.js +382 -382
  26. package/js/parallax.js +138 -138
  27. package/js/pushpin.js +148 -148
  28. package/js/range.js +263 -263
  29. package/js/scrollspy.js +295 -295
  30. package/js/select.js +391 -391
  31. package/js/sidenav.js +583 -583
  32. package/js/slider.js +497 -359
  33. package/js/tabs.js +402 -402
  34. package/js/tapTarget.js +315 -315
  35. package/js/timepicker.js +712 -712
  36. package/js/toasts.js +325 -325
  37. package/js/tooltip.js +320 -320
  38. package/js/waves.js +614 -614
  39. package/package.json +87 -84
  40. package/sass/components/_badges.scss +55 -55
  41. package/sass/components/_buttons.scss +322 -322
  42. package/sass/components/_cards.scss +195 -195
  43. package/sass/components/_carousel.scss +90 -90
  44. package/sass/components/_chips.scss +96 -96
  45. package/sass/components/_collapsible.scss +91 -91
  46. package/sass/components/_collection.scss +106 -106
  47. package/sass/components/_color-classes.scss +32 -32
  48. package/sass/components/_color-variables.scss +370 -370
  49. package/sass/components/_datepicker.scss +191 -191
  50. package/sass/components/_dropdown.scss +84 -84
  51. package/sass/components/_global.scss +646 -646
  52. package/sass/components/_grid.scss +158 -158
  53. package/sass/components/_icons-material-design.scss +5 -5
  54. package/sass/components/_materialbox.scss +42 -42
  55. package/sass/components/_modal.scss +97 -97
  56. package/sass/components/_navbar.scss +208 -208
  57. package/sass/components/_normalize.scss +447 -447
  58. package/sass/components/_preloader.scss +334 -334
  59. package/sass/components/_pulse.scss +34 -34
  60. package/sass/components/_sidenav.scss +214 -214
  61. package/sass/components/_slider.scss +100 -91
  62. package/sass/components/_table_of_contents.scss +33 -33
  63. package/sass/components/_tabs.scss +99 -99
  64. package/sass/components/_tapTarget.scss +103 -103
  65. package/sass/components/_timepicker.scss +199 -199
  66. package/sass/components/_toast.scss +58 -58
  67. package/sass/components/_tooltip.scss +32 -32
  68. package/sass/components/_transitions.scss +12 -12
  69. package/sass/components/_typography.scss +62 -62
  70. package/sass/components/_variables.scss +352 -352
  71. package/sass/components/_waves.scss +187 -187
  72. package/sass/components/forms/_checkboxes.scss +200 -200
  73. package/sass/components/forms/_file-input.scss +44 -44
  74. package/sass/components/forms/_forms.scss +22 -22
  75. package/sass/components/forms/_input-fields.scss +388 -388
  76. package/sass/components/forms/_radio-buttons.scss +115 -115
  77. package/sass/components/forms/_range.scss +161 -161
  78. package/sass/components/forms/_select.scss +199 -199
  79. package/sass/components/forms/_switches.scss +91 -91
  80. package/sass/materialize.scss +42 -42
  81. package/sass/_style.scss +0 -929
  82. package/sass/ghpages-materialize.scss +0 -7
package/Gruntfile.js CHANGED
@@ -1,712 +1,722 @@
1
- const sass = require('sass');
2
-
3
- module.exports = function(grunt) {
4
- const concatFile = 'temp/js/materialize_concat.js.map';
5
- const jsFiles = [
6
- 'js/cash.js',
7
- 'js/waves.js',
8
- 'js/component.js',
9
- 'js/global.js',
10
- 'js/anime.min.js',
11
- 'js/collapsible.js',
12
- 'js/dropdown.js',
13
- 'js/modal.js',
14
- 'js/materialbox.js',
15
- 'js/parallax.js',
16
- 'js/tabs.js',
17
- 'js/tooltip.js',
18
- 'js/toasts.js',
19
- 'js/sidenav.js',
20
- 'js/scrollspy.js',
21
- 'js/autocomplete.js',
22
- 'js/forms.js',
23
- 'js/slider.js',
24
- 'js/cards.js',
25
- 'js/chips.js',
26
- 'js/pushpin.js',
27
- 'js/buttons.js',
28
- 'js/datepicker.js',
29
- 'js/timepicker.js',
30
- 'js/characterCounter.js',
31
- 'js/carousel.js',
32
- 'js/tapTarget.js',
33
- 'js/select.js',
34
- 'js/range.js'
35
- ];
36
-
37
- // configure the tasks
38
- const config = {
39
- // Jasmine
40
- jasmine: {
41
- components: {
42
- src: ['bin/materialize.js'],
43
- options: {
44
- vendor: [
45
- 'node_modules/jquery/dist/jquery.min.js'
46
- ],
47
- styles: 'bin/materialize.css',
48
- specs: 'tests/spec/**/*Spec.js',
49
- helpers: 'tests/spec/helper.js',
50
- keepRunner: true,
51
- version: '3.8.0',
52
- page: {
53
- viewportSize: {
54
- width: 1400,
55
- height: 735
56
- }
57
- },
58
- sandboxArgs: {
59
- args: ['--headless', '--no-sandbox']
60
- },
61
- }
62
- }
63
- },
64
-
65
- // Sass
66
- sass: {
67
-
68
- // Global options
69
- options: {
70
- implementation: sass
71
- },
72
-
73
- // Task
74
- expanded: {
75
- // Target options
76
- options: {
77
- outputStyle: 'expanded',
78
- sourcemap: false
79
- },
80
- files: {
81
- 'dist/css/materialize.css': 'sass/materialize.scss'
82
- }
83
- },
84
-
85
- min: {
86
- options: {
87
- outputStyle: 'compressed',
88
- sourcemap: false
89
- },
90
- files: {
91
- 'dist/css/materialize.min.css': 'sass/materialize.scss'
92
- }
93
- },
94
-
95
- // Compile ghpages css
96
- gh: {
97
- options: {
98
- outputStyle: 'compressed',
99
- sourcemap: false
100
- },
101
- files: {
102
- 'docs/css/ghpages-materialize.css': 'sass/ghpages-materialize.scss'
103
- }
104
- },
105
-
106
- // Compile bin css
107
- bin: {
108
- options: {
109
- outputStyle: 'expanded',
110
- sourcemap: false
111
- },
112
- files: {
113
- 'bin/materialize.css': 'sass/materialize.scss'
114
- }
115
- }
116
- },
117
-
118
- // PostCss Autoprefixer
119
- postcss: {
120
- options: {
121
- processors: [
122
- require('autoprefixer')({
123
- browsers: [
124
- 'last 2 versions',
125
- 'Chrome >= 30',
126
- 'Firefox >= 30',
127
- 'ie >= 10',
128
- 'Safari >= 8'
129
- ]
130
- })
131
- ]
132
- },
133
- expanded: {
134
- src: 'dist/css/materialize.css'
135
- },
136
- min: {
137
- src: 'dist/css/materialize.min.css'
138
- },
139
- gh: {
140
- src: 'docs/css/ghpages-materialize.css'
141
- },
142
- bin: {
143
- src: 'bin/materialize.css'
144
- }
145
- },
146
-
147
- babel: {
148
- options: {
149
- sourceMap: false,
150
- plugins: [
151
- 'transform-es2015-arrow-functions',
152
- 'transform-es2015-block-scoping',
153
- 'transform-es2015-classes',
154
- 'transform-es2015-template-literals',
155
- 'transform-es2015-object-super',
156
- 'babel-plugin-transform-object-rest-spread'
157
- ]
158
- },
159
- bin: {
160
- options: {
161
- sourceMap: true
162
- },
163
- files: {
164
- 'bin/materialize.js': 'temp/js/materialize_concat.js'
165
- }
166
- },
167
- dist: {
168
- files: {
169
- 'dist/js/materialize.js': 'temp/js/materialize.js'
170
- }
171
- }
172
- },
173
-
174
- // Browser Sync integration
175
- browserSync: {
176
- bsFiles: ['bin/*', 'css/ghpages-materialize.css', '!**/node_modules/**/*'],
177
- options: {
178
- server: {
179
- baseDir: './' // make server from root dir
180
- },
181
- port: 8000,
182
- ui: {
183
- port: 8080,
184
- weinre: {
185
- port: 9090
186
- }
187
- },
188
- open: false
189
- }
190
- },
191
-
192
- // Concat
193
- concat: {
194
- options: {
195
- separator: ';'
196
- },
197
- dist: {
198
- // the files to concatenate
199
- src: jsFiles,
200
- // the location of the resulting JS file
201
- dest: 'temp/js/materialize.js'
202
- },
203
- temp: {
204
- // the files to concatenate
205
- options: {
206
- sourceMap: true,
207
- sourceMapStyle: 'link'
208
- },
209
- src: jsFiles,
210
- // the location of the resulting JS file
211
- dest: 'temp/js/materialize_concat.js'
212
- }
213
- },
214
-
215
- // Uglify
216
- uglify: {
217
- options: {
218
- // Use these options when debugging
219
- // mangle: false,
220
- // compress: false,
221
- // beautify: true
222
- },
223
- dist: {
224
- files: {
225
- 'dist/js/materialize.min.js': ['dist/js/materialize.js']
226
- }
227
- },
228
- bin: {
229
- files: {
230
- 'bin/materialize.min.js': ['bin/materialize.js']
231
- }
232
- },
233
- extras: {
234
- files: {
235
- 'extras/noUiSlider/nouislider.min.js': ['extras/noUiSlider/nouislider.js']
236
- }
237
- }
238
- },
239
-
240
- // Compress
241
- compress: {
242
- main: {
243
- options: {
244
- archive: 'bin/materialize.zip',
245
- level: 6
246
- },
247
- files: [
248
- { expand: true, cwd: 'dist/', src: ['**/*'], dest: 'materialize/' },
249
- { expand: true, cwd: './', src: ['LICENSE', 'README.md'], dest: 'materialize/' }
250
- ]
251
- },
252
-
253
- src: {
254
- options: {
255
- archive: 'bin/materialize-src.zip',
256
- level: 6
257
- },
258
- files: [
259
- { expand: true, cwd: 'sass/', src: ['materialize.scss'], dest: 'materialize-src/sass/' },
260
- { expand: true, cwd: 'sass/', src: ['components/**/*'], dest: 'materialize-src/sass/' },
261
- {
262
- expand: true,
263
- cwd: 'js/',
264
- src: [
265
- 'anime.min.js',
266
- 'cash.js',
267
- 'component.js',
268
- 'global.js',
269
- 'collapsible.js',
270
- 'dropdown.js',
271
- 'modal.js',
272
- 'materialbox.js',
273
- 'parallax.js',
274
- 'tabs.js',
275
- 'tooltip.js',
276
- 'waves.js',
277
- 'toasts.js',
278
- 'sidenav.js',
279
- 'scrollspy.js',
280
- 'autocomplete.js',
281
- 'forms.js',
282
- 'slider.js',
283
- 'cards.js',
284
- 'chips.js',
285
- 'pushpin.js',
286
- 'buttons.js',
287
- 'datepicker.js',
288
- 'timepicker.js',
289
- 'characterCounter.js',
290
- 'carousel.js',
291
- 'tapTarget.js',
292
- 'select.js',
293
- 'range.js'
294
- ],
295
- dest: 'materialize-src/js/'
296
- },
297
- { expand: true, cwd: 'dist/js/', src: ['**/*'], dest: 'materialize-src/js/bin/' },
298
- { expand: true, cwd: './', src: ['LICENSE', 'README.md'], dest: 'materialize-src/' }
299
- ]
300
- },
301
-
302
- starter_template: {
303
- options: {
304
- archive: 'templates/starter-template.zip',
305
- level: 6
306
- },
307
- files: [
308
- { expand: true, cwd: 'dist/', src: ['**/*'], dest: 'starter-template/' },
309
- {
310
- expand: true,
311
- cwd: 'templates/starter-template/',
312
- src: ['index.html', 'LICENSE'],
313
- dest: 'starter-template/'
314
- },
315
- {
316
- expand: true,
317
- cwd: 'templates/starter-template/css',
318
- src: ['style.css'],
319
- dest: 'starter-template/css'
320
- },
321
- {
322
- expand: true,
323
- cwd: 'templates/starter-template/js',
324
- src: ['init.js'],
325
- dest: 'starter-template/js'
326
- }
327
- ]
328
- },
329
-
330
- parallax_template: {
331
- options: {
332
- archive: 'templates/parallax-template.zip',
333
- level: 6
334
- },
335
- files: [
336
- { expand: true, cwd: 'dist/', src: ['**/*'], dest: 'parallax-template/' },
337
- {
338
- expand: true,
339
- cwd: 'templates/parallax-template/',
340
- src: ['index.html', 'LICENSE', 'background1.jpg', 'background2.jpg', 'background3.jpg'],
341
- dest: 'parallax-template/'
342
- },
343
- {
344
- expand: true,
345
- cwd: 'templates/parallax-template/css',
346
- src: ['style.css'],
347
- dest: 'parallax-template/css'
348
- },
349
- {
350
- expand: true,
351
- cwd: 'templates/parallax-template/js',
352
- src: ['init.js'],
353
- dest: 'parallax-template/js'
354
- }
355
- ]
356
- }
357
- },
358
-
359
- // Clean
360
- clean: {
361
- temp: {
362
- src: ['temp/']
363
- }
364
- },
365
-
366
- // Pug
367
- pug: {
368
- compile: {
369
- options: {
370
- pretty: true,
371
- data: {
372
- debug: false
373
- }
374
- },
375
- files: {
376
- 'docs/index.html': 'pug/index.pug',
377
- 'docs/icons.html': 'pug/icons.pug',
378
- 'docs/about.html': 'pug/about.pug',
379
- 'docs/sass.html': 'pug/sass.pug',
380
- 'docs/getting-started.html': 'pug/getting-started.pug',
381
- 'docs/mobile.html': 'pug/mobile.pug',
382
- 'docs/parallax.html': 'pug/parallax.pug',
383
- 'docs/parallax-demo.html': 'pug/parallax-demo.pug',
384
- 'docs/typography.html': 'pug/typography.pug',
385
- 'docs/color.html': 'pug/color.pug',
386
- 'docs/shadow.html': 'pug/shadow.pug',
387
- 'docs/grid.html': 'pug/grid.pug',
388
- 'docs/media-css.html': 'pug/media-css.pug',
389
- 'docs/table.html': 'pug/table.pug',
390
- 'docs/helpers.html': 'pug/helpers.pug',
391
- 'docs/buttons.html': 'pug/buttons.pug',
392
- 'docs/navbar.html': 'pug/navbar.pug',
393
- 'docs/cards.html': 'pug/cards.pug',
394
- 'docs/preloader.html': 'pug/preloader.pug',
395
- 'docs/collections.html': 'pug/collections.pug',
396
- 'docs/badges.html': 'pug/badges.pug',
397
- 'docs/footer.html': 'pug/footer.pug',
398
- 'docs/modals.html': 'pug/modals.pug',
399
- 'docs/dropdown.html': 'pug/dropdown.pug',
400
- 'docs/tabs.html': 'pug/tabs.pug',
401
- 'docs/toasts.html': 'pug/toasts.pug',
402
- 'docs/tooltips.html': 'pug/tooltips.pug',
403
- 'docs/sidenav.html': 'pug/sidenav.pug',
404
- 'docs/pushpin.html': 'pug/pushpin.pug',
405
- 'docs/waves.html': 'pug/waves.pug',
406
- 'docs/media.html': 'pug/media.pug',
407
- 'docs/collapsible.html': 'pug/collapsible.pug',
408
- 'docs/scrollspy.html': 'pug/scrollspy.pug',
409
- 'docs/fullscreen-slider-demo.html': 'pug/fullscreen-slider-demo.pug',
410
- 'docs/pagination.html': 'pug/pagination.pug',
411
- 'docs/breadcrumbs.html': 'pug/breadcrumbs.pug',
412
- 'docs/carousel.html': 'pug/carousel.pug',
413
- 'docs/feature-discovery.html': 'pug/feature-discovery.pug',
414
- 'docs/pulse.html': 'pug/pulse.pug',
415
- 'docs/pushpin-demo.html': 'pug/pushpin-demo.pug',
416
- 'docs/css-transitions.html': 'pug/css-transitions.pug',
417
- 'docs/404.html': 'pug/404.pug',
418
- 'docs/autocomplete.html': 'pug/autocomplete.pug',
419
- 'docs/checkboxes.html': 'pug/checkboxes.pug',
420
- 'docs/chips.html': 'pug/chips.pug',
421
- 'docs/pickers.html': 'pug/pickers.pug',
422
- 'docs/radio-buttons.html': 'pug/radio-buttons.pug',
423
- 'docs/range.html': 'pug/range.pug',
424
- 'docs/select.html': 'pug/select.pug',
425
- 'docs/switches.html': 'pug/switches.pug',
426
- 'docs/text-inputs.html': 'pug/text-inputs.pug',
427
- 'docs/floating-action-button.html': 'pug/floating-action-button.pug',
428
- 'docs/auto-init.html': 'pug/auto-init.pug'
429
- }
430
- }
431
- },
432
-
433
- // Watch Files
434
- watch: {
435
- pug: {
436
- files: ['pug/**/*'],
437
- tasks: ['pug_compile'],
438
- options: {
439
- interrupt: false,
440
- spawn: false
441
- }
442
- },
443
-
444
- js: {
445
- files: ['js/**/*', '!js/init.js'],
446
- tasks: ['js_compile'],
447
- options: {
448
- interrupt: false,
449
- spawn: false
450
- }
451
- },
452
-
453
- sass: {
454
- files: ['sass/**/*'],
455
- tasks: ['sass_compile'],
456
- options: {
457
- interrupt: false,
458
- spawn: false
459
- }
460
- }
461
- },
462
-
463
- // Concurrent
464
- concurrent: {
465
- options: {
466
- logConcurrentOutput: true,
467
- limit: 10
468
- },
469
- monitor: {
470
- tasks: [
471
- 'pug_compile',
472
- 'sass_compile',
473
- 'js_compile',
474
- 'watch:pug',
475
- 'watch:js',
476
- 'watch:sass',
477
- 'notify:watching',
478
- 'server'
479
- ]
480
- }
481
- },
482
-
483
- // Notifications
484
- notify: {
485
- watching: {
486
- options: {
487
- enabled: true,
488
- message: 'Watching Files!',
489
- title: 'Materialize', // defaults to the name in package.json, or will use project directory's name
490
- success: true, // whether successful grunt executions should be notified automatically
491
- duration: 1 // the duration of notification in seconds, for `notify-send only
492
- }
493
- },
494
-
495
- sass_compile: {
496
- options: {
497
- enabled: true,
498
- message: 'Sass Compiled!',
499
- title: 'Materialize',
500
- success: true,
501
- duration: 1
502
- }
503
- },
504
-
505
- js_compile: {
506
- options: {
507
- enabled: true,
508
- message: 'JS Compiled!',
509
- title: 'Materialize',
510
- success: true,
511
- duration: 1
512
- }
513
- },
514
-
515
- pug_compile: {
516
- options: {
517
- enabled: true,
518
- message: 'Pug Compiled!',
519
- title: 'Materialize',
520
- success: true,
521
- duration: 1
522
- }
523
- },
524
-
525
- server: {
526
- options: {
527
- enabled: true,
528
- message: 'Server Running!',
529
- title: 'Materialize',
530
- success: true,
531
- duration: 1
532
- }
533
- }
534
- },
535
-
536
- // Replace text to update the version string
537
- replace: {
538
- version: {
539
- src: ['bower.json', 'package.js', 'pug/**/*.html'],
540
- overwrite: true,
541
- replacements: [
542
- {
543
- from: grunt.option('oldver'),
544
- to: grunt.option('newver')
545
- }
546
- ]
547
- },
548
- package_json: {
549
- src: ['package.json'],
550
- overwrite: true,
551
- replacements: [
552
- {
553
- from: '"version": "' + grunt.option('oldver'),
554
- to: '"version": "' + grunt.option('newver')
555
- }
556
- ]
557
- },
558
- docs: {
559
- src: ['.gitignore'],
560
- overwrite: true,
561
- replacements: [
562
- {
563
- from: '/docs/*.html',
564
- to: ''
565
- }
566
- ]
567
- }
568
- },
569
-
570
- // Create Version Header for files
571
- usebanner: {
572
- release: {
573
- options: {
574
- position: 'top',
575
- banner:
576
- '/*!\n * Materialize v' +
577
- grunt.option('newver') +
578
- ' (https://materializecss.github.io/materialize)\n * Copyright 2014-2021 Materialize\n * MIT License (https://raw.githubusercontent.com/materializecss/materialize/master/LICENSE)\n */',
579
- linebreak: true
580
- },
581
- files: {
582
- src: ['dist/css/*.css', 'dist/js/*.js']
583
- }
584
- }
585
- },
586
-
587
- // Rename files
588
- rename: {
589
- rename_src: {
590
- src: 'bin/materialize-src' + '.zip',
591
- dest: 'bin/materialize-src-v' + grunt.option('newver') + '.zip',
592
- options: {
593
- ignore: true
594
- }
595
- },
596
- rename_compiled: {
597
- src: 'bin/materialize' + '.zip',
598
- dest: 'bin/materialize-v' + grunt.option('newver') + '.zip',
599
- options: {
600
- ignore: true
601
- }
602
- }
603
- },
604
-
605
- connect: {
606
- server: {
607
- options: {
608
- port: 9001,
609
- protocol: 'http',
610
- middleware: function(connect, options, middlewares) {
611
- middlewares.unshift(function(req, res, next){
612
- res.setHeader('Access-Control-Allow-Origin', '*');
613
- res.setHeader('Access-Control-Allow-Credentials', true);
614
- res.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept");
615
- res.setHeader('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS');
616
- next();
617
- });
618
- return middlewares;
619
- }
620
- }
621
- }
622
- },
623
-
624
- copy: {
625
- docs_js: {
626
- files: [
627
- {src: 'bin/materialize.js', dest: 'docs/js/materialize.js'},
628
- ]
629
- },
630
- docs_templates: {
631
- files: [
632
- {src: 'templates/**', dest: 'docs/'}
633
- ]
634
- }
635
- }
636
-
637
- };
638
-
639
- grunt.initConfig(config);
640
-
641
- // load the tasks
642
- // grunt.loadNpmTasks('grunt-gitinfo');
643
- grunt.loadNpmTasks('grunt-contrib-watch');
644
- grunt.loadNpmTasks('grunt-sass');
645
- grunt.loadNpmTasks('grunt-contrib-concat');
646
- grunt.loadNpmTasks('grunt-contrib-uglify');
647
- grunt.loadNpmTasks('grunt-contrib-compress');
648
- grunt.loadNpmTasks('grunt-contrib-clean');
649
- grunt.loadNpmTasks('grunt-contrib-pug');
650
- grunt.loadNpmTasks('grunt-concurrent');
651
- grunt.loadNpmTasks('grunt-notify');
652
- grunt.loadNpmTasks('grunt-text-replace');
653
- grunt.loadNpmTasks('grunt-banner');
654
- grunt.loadNpmTasks('grunt-rename-util');
655
- grunt.loadNpmTasks('grunt-browser-sync');
656
- grunt.loadNpmTasks('grunt-contrib-jasmine');
657
- grunt.loadNpmTasks('grunt-postcss');
658
- grunt.loadNpmTasks('grunt-babel');
659
- grunt.loadNpmTasks('grunt-contrib-connect');
660
- grunt.loadNpmTasks('grunt-contrib-copy');
661
-
662
- // define the tasks
663
- grunt.registerTask('release', [
664
- 'sass:expanded',
665
- 'sass:min',
666
- 'postcss:expanded',
667
- 'postcss:min',
668
- 'concat:dist',
669
- 'babel:dist',
670
- 'uglify:dist',
671
- 'uglify:extras',
672
- 'usebanner:release',
673
- 'compress:main',
674
- 'compress:src',
675
- 'compress:starter_template',
676
- 'compress:parallax_template',
677
- 'replace:version',
678
- 'replace:package_json',
679
- 'rename:rename_src',
680
- 'rename:rename_compiled',
681
- 'clean:temp'
682
- ]);
683
-
684
- grunt.task.registerTask('configureBabel', 'configures babel options', function() {
685
- config.babel.bin.options.inputSourceMap = grunt.file.readJSON(concatFile);
686
- });
687
-
688
- grunt.registerTask('pug_compile', ['pug', 'notify:pug_compile']);
689
- grunt.registerTask('js_compile', ['concat:temp', 'configureBabel', 'babel:bin', 'clean:temp', 'copy:docs_js']);
690
- grunt.registerTask('sass_compile', [
691
- 'sass:gh',
692
- 'sass:bin',
693
- 'postcss:gh',
694
- 'postcss:bin',
695
- 'notify:sass_compile'
696
- ]);
697
- grunt.registerTask('server', ['browserSync', 'notify:server']);
698
- grunt.registerTask('monitor', ['concurrent:monitor']);
699
- grunt.registerTask('test', ['js_compile', 'sass_compile', 'connect', 'jasmine']);
700
- grunt.registerTask('jas_test', ['connect', 'jasmine']);
701
- grunt.registerTask('test_repeat', function(){
702
- const tasks = ['connect'];
703
- const n = 30;
704
- for (let i = 0; i < n; i++) {
705
- tasks.push('jasmine');
706
- }
707
-
708
- grunt.task.run(tasks);
709
-
710
- });
711
- grunt.registerTask('docs', ['js_compile', 'copy:docs_js', 'copy:docs_templates', 'sass:gh', 'postcss:gh', 'pug', 'replace:docs']);
712
- };
1
+ const sass = require('sass');
2
+
3
+ module.exports = function(grunt) {
4
+ const concatFile = 'temp/js/materialize_concat.js.map';
5
+ const jsFiles = [
6
+ 'js/cash.js',
7
+ 'js/waves.js',
8
+ 'js/component.js',
9
+ 'js/global.js',
10
+ 'js/anime.min.js',
11
+ 'js/collapsible.js',
12
+ 'js/dropdown.js',
13
+ 'js/modal.js',
14
+ 'js/materialbox.js',
15
+ 'js/parallax.js',
16
+ 'js/tabs.js',
17
+ 'js/tooltip.js',
18
+ 'js/toasts.js',
19
+ 'js/sidenav.js',
20
+ 'js/scrollspy.js',
21
+ 'js/autocomplete.js',
22
+ 'js/forms.js',
23
+ 'js/slider.js',
24
+ 'js/cards.js',
25
+ 'js/chips.js',
26
+ 'js/pushpin.js',
27
+ 'js/buttons.js',
28
+ 'js/datepicker.js',
29
+ 'js/timepicker.js',
30
+ 'js/characterCounter.js',
31
+ 'js/carousel.js',
32
+ 'js/tapTarget.js',
33
+ 'js/select.js',
34
+ 'js/range.js'
35
+ ];
36
+
37
+ // configure the tasks
38
+ const config = {
39
+ // Jasmine
40
+ jasmine: {
41
+ components: {
42
+ src: ['bin/materialize.js'],
43
+ options: {
44
+ vendor: ['node_modules/jquery/dist/jquery.min.js'],
45
+ styles: 'bin/materialize.css',
46
+ specs: 'tests/spec/**/*Spec.js',
47
+ helpers: 'tests/spec/helper.js',
48
+ keepRunner: true,
49
+ version: '3.8.0',
50
+ page: {
51
+ viewportSize: {
52
+ width: 1400,
53
+ height: 735
54
+ }
55
+ },
56
+ sandboxArgs: {
57
+ args: ['--headless', '--no-sandbox']
58
+ }
59
+ }
60
+ }
61
+ },
62
+
63
+ // Sass
64
+ sass: {
65
+ // Global options
66
+ options: {
67
+ implementation: sass
68
+ },
69
+
70
+ // Task
71
+ expanded: {
72
+ // Target options
73
+ options: {
74
+ outputStyle: 'expanded',
75
+ sourcemap: false
76
+ },
77
+ files: {
78
+ 'dist/css/materialize.css': 'sass/materialize.scss'
79
+ }
80
+ },
81
+
82
+ min: {
83
+ options: {
84
+ outputStyle: 'compressed',
85
+ sourcemap: false
86
+ },
87
+ files: {
88
+ 'dist/css/materialize.min.css': 'sass/materialize.scss'
89
+ }
90
+ },
91
+
92
+ // Compile ghpages css
93
+ gh: {
94
+ options: {
95
+ outputStyle: 'compressed',
96
+ sourcemap: false
97
+ },
98
+ files: {
99
+ 'docs/css/ghpages-materialize.css': 'sass/ghpages-materialize.scss'
100
+ }
101
+ },
102
+
103
+ // Compile bin css
104
+ bin: {
105
+ options: {
106
+ outputStyle: 'expanded',
107
+ sourcemap: false
108
+ },
109
+ files: {
110
+ 'bin/materialize.css': 'sass/materialize.scss'
111
+ }
112
+ }
113
+ },
114
+
115
+ // PostCss Autoprefixer
116
+ postcss: {
117
+ options: {
118
+ processors: [
119
+ require('autoprefixer')({
120
+ browsers: [
121
+ 'last 2 versions',
122
+ 'Chrome >= 30',
123
+ 'Firefox >= 30',
124
+ 'ie >= 10',
125
+ 'Safari >= 8'
126
+ ]
127
+ })
128
+ ]
129
+ },
130
+ expanded: {
131
+ src: 'dist/css/materialize.css'
132
+ },
133
+ min: {
134
+ src: 'dist/css/materialize.min.css'
135
+ },
136
+ gh: {
137
+ src: 'docs/css/ghpages-materialize.css'
138
+ },
139
+ bin: {
140
+ src: 'bin/materialize.css'
141
+ }
142
+ },
143
+
144
+ babel: {
145
+ options: {
146
+ sourceMap: false,
147
+ plugins: [
148
+ 'transform-es2015-arrow-functions',
149
+ 'transform-es2015-block-scoping',
150
+ 'transform-es2015-classes',
151
+ 'transform-es2015-template-literals',
152
+ 'transform-es2015-object-super',
153
+ 'babel-plugin-transform-object-rest-spread'
154
+ ]
155
+ },
156
+ bin: {
157
+ options: {
158
+ sourceMap: true
159
+ },
160
+ files: {
161
+ 'bin/materialize.js': 'temp/js/materialize_concat.js'
162
+ }
163
+ },
164
+ dist: {
165
+ files: {
166
+ 'dist/js/materialize.js': 'temp/js/materialize.js'
167
+ }
168
+ }
169
+ },
170
+
171
+ // Browser Sync integration
172
+ browserSync: {
173
+ bsFiles: ['bin/*', 'css/ghpages-materialize.css', '!**/node_modules/**/*'],
174
+ options: {
175
+ server: {
176
+ baseDir: './' // make server from root dir
177
+ },
178
+ port: 8000,
179
+ ui: {
180
+ port: 8080,
181
+ weinre: {
182
+ port: 9090
183
+ }
184
+ },
185
+ open: false
186
+ }
187
+ },
188
+
189
+ // Concat
190
+ concat: {
191
+ options: {
192
+ separator: ';'
193
+ },
194
+ dist: {
195
+ // the files to concatenate
196
+ src: jsFiles,
197
+ // the location of the resulting JS file
198
+ dest: 'temp/js/materialize.js'
199
+ },
200
+ temp: {
201
+ // the files to concatenate
202
+ options: {
203
+ sourceMap: true,
204
+ sourceMapStyle: 'link'
205
+ },
206
+ src: jsFiles,
207
+ // the location of the resulting JS file
208
+ dest: 'temp/js/materialize_concat.js'
209
+ }
210
+ },
211
+
212
+ // Uglify
213
+ uglify: {
214
+ options: {
215
+ // Use these options when debugging
216
+ // mangle: false,
217
+ // compress: false,
218
+ // beautify: true
219
+ },
220
+ dist: {
221
+ files: {
222
+ 'dist/js/materialize.min.js': ['dist/js/materialize.js']
223
+ }
224
+ },
225
+ bin: {
226
+ files: {
227
+ 'bin/materialize.min.js': ['bin/materialize.js']
228
+ }
229
+ },
230
+ extras: {
231
+ files: {
232
+ 'extras/noUiSlider/nouislider.min.js': ['extras/noUiSlider/nouislider.js']
233
+ }
234
+ }
235
+ },
236
+
237
+ // Compress
238
+ compress: {
239
+ main: {
240
+ options: {
241
+ archive: 'bin/materialize.zip',
242
+ level: 6
243
+ },
244
+ files: [
245
+ { expand: true, cwd: 'dist/', src: ['**/*'], dest: 'materialize/' },
246
+ { expand: true, cwd: './', src: ['LICENSE', 'README.md'], dest: 'materialize/' }
247
+ ]
248
+ },
249
+
250
+ src: {
251
+ options: {
252
+ archive: 'bin/materialize-src.zip',
253
+ level: 6
254
+ },
255
+ files: [
256
+ { expand: true, cwd: 'sass/', src: ['materialize.scss'], dest: 'materialize-src/sass/' },
257
+ { expand: true, cwd: 'sass/', src: ['components/**/*'], dest: 'materialize-src/sass/' },
258
+ {
259
+ expand: true,
260
+ cwd: 'js/',
261
+ src: [
262
+ 'anime.min.js',
263
+ 'cash.js',
264
+ 'component.js',
265
+ 'global.js',
266
+ 'collapsible.js',
267
+ 'dropdown.js',
268
+ 'modal.js',
269
+ 'materialbox.js',
270
+ 'parallax.js',
271
+ 'tabs.js',
272
+ 'tooltip.js',
273
+ 'waves.js',
274
+ 'toasts.js',
275
+ 'sidenav.js',
276
+ 'scrollspy.js',
277
+ 'autocomplete.js',
278
+ 'forms.js',
279
+ 'slider.js',
280
+ 'cards.js',
281
+ 'chips.js',
282
+ 'pushpin.js',
283
+ 'buttons.js',
284
+ 'datepicker.js',
285
+ 'timepicker.js',
286
+ 'characterCounter.js',
287
+ 'carousel.js',
288
+ 'tapTarget.js',
289
+ 'select.js',
290
+ 'range.js'
291
+ ],
292
+ dest: 'materialize-src/js/'
293
+ },
294
+ { expand: true, cwd: 'dist/js/', src: ['**/*'], dest: 'materialize-src/js/bin/' },
295
+ { expand: true, cwd: './', src: ['LICENSE', 'README.md'], dest: 'materialize-src/' }
296
+ ]
297
+ },
298
+
299
+ starter_template: {
300
+ options: {
301
+ archive: 'templates/starter-template.zip',
302
+ level: 6
303
+ },
304
+ files: [
305
+ { expand: true, cwd: 'dist/', src: ['**/*'], dest: 'starter-template/' },
306
+ {
307
+ expand: true,
308
+ cwd: 'templates/starter-template/',
309
+ src: ['index.html', 'LICENSE'],
310
+ dest: 'starter-template/'
311
+ },
312
+ {
313
+ expand: true,
314
+ cwd: 'templates/starter-template/css',
315
+ src: ['style.css'],
316
+ dest: 'starter-template/css'
317
+ },
318
+ {
319
+ expand: true,
320
+ cwd: 'templates/starter-template/js',
321
+ src: ['init.js'],
322
+ dest: 'starter-template/js'
323
+ }
324
+ ]
325
+ },
326
+
327
+ parallax_template: {
328
+ options: {
329
+ archive: 'templates/parallax-template.zip',
330
+ level: 6
331
+ },
332
+ files: [
333
+ { expand: true, cwd: 'dist/', src: ['**/*'], dest: 'parallax-template/' },
334
+ {
335
+ expand: true,
336
+ cwd: 'templates/parallax-template/',
337
+ src: ['index.html', 'LICENSE', 'background1.jpg', 'background2.jpg', 'background3.jpg'],
338
+ dest: 'parallax-template/'
339
+ },
340
+ {
341
+ expand: true,
342
+ cwd: 'templates/parallax-template/css',
343
+ src: ['style.css'],
344
+ dest: 'parallax-template/css'
345
+ },
346
+ {
347
+ expand: true,
348
+ cwd: 'templates/parallax-template/js',
349
+ src: ['init.js'],
350
+ dest: 'parallax-template/js'
351
+ }
352
+ ]
353
+ }
354
+ },
355
+
356
+ // Clean
357
+ clean: {
358
+ temp: {
359
+ src: ['temp/']
360
+ }
361
+ },
362
+
363
+ // Pug
364
+ pug: {
365
+ compile: {
366
+ options: {
367
+ pretty: true,
368
+ data: {
369
+ debug: false
370
+ }
371
+ },
372
+ files: {
373
+ 'docs/index.html': 'pug/index.pug',
374
+ 'docs/icons.html': 'pug/icons.pug',
375
+ 'docs/about.html': 'pug/about.pug',
376
+ 'docs/sass.html': 'pug/sass.pug',
377
+ 'docs/getting-started.html': 'pug/getting-started.pug',
378
+ 'docs/mobile.html': 'pug/mobile.pug',
379
+ 'docs/parallax.html': 'pug/parallax.pug',
380
+ 'docs/parallax-demo.html': 'pug/parallax-demo.pug',
381
+ 'docs/typography.html': 'pug/typography.pug',
382
+ 'docs/color.html': 'pug/color.pug',
383
+ 'docs/shadow.html': 'pug/shadow.pug',
384
+ 'docs/grid.html': 'pug/grid.pug',
385
+ 'docs/media-css.html': 'pug/media-css.pug',
386
+ 'docs/table.html': 'pug/table.pug',
387
+ 'docs/helpers.html': 'pug/helpers.pug',
388
+ 'docs/buttons.html': 'pug/buttons.pug',
389
+ 'docs/navbar.html': 'pug/navbar.pug',
390
+ 'docs/cards.html': 'pug/cards.pug',
391
+ 'docs/preloader.html': 'pug/preloader.pug',
392
+ 'docs/collections.html': 'pug/collections.pug',
393
+ 'docs/badges.html': 'pug/badges.pug',
394
+ 'docs/footer.html': 'pug/footer.pug',
395
+ 'docs/modals.html': 'pug/modals.pug',
396
+ 'docs/dropdown.html': 'pug/dropdown.pug',
397
+ 'docs/tabs.html': 'pug/tabs.pug',
398
+ 'docs/toasts.html': 'pug/toasts.pug',
399
+ 'docs/tooltips.html': 'pug/tooltips.pug',
400
+ 'docs/sidenav.html': 'pug/sidenav.pug',
401
+ 'docs/pushpin.html': 'pug/pushpin.pug',
402
+ 'docs/waves.html': 'pug/waves.pug',
403
+ 'docs/media.html': 'pug/media.pug',
404
+ 'docs/collapsible.html': 'pug/collapsible.pug',
405
+ 'docs/scrollspy.html': 'pug/scrollspy.pug',
406
+ 'docs/fullscreen-slider-demo.html': 'pug/fullscreen-slider-demo.pug',
407
+ 'docs/pagination.html': 'pug/pagination.pug',
408
+ 'docs/breadcrumbs.html': 'pug/breadcrumbs.pug',
409
+ 'docs/carousel.html': 'pug/carousel.pug',
410
+ 'docs/feature-discovery.html': 'pug/feature-discovery.pug',
411
+ 'docs/pulse.html': 'pug/pulse.pug',
412
+ 'docs/pushpin-demo.html': 'pug/pushpin-demo.pug',
413
+ 'docs/css-transitions.html': 'pug/css-transitions.pug',
414
+ 'docs/404.html': 'pug/404.pug',
415
+ 'docs/autocomplete.html': 'pug/autocomplete.pug',
416
+ 'docs/checkboxes.html': 'pug/checkboxes.pug',
417
+ 'docs/chips.html': 'pug/chips.pug',
418
+ 'docs/pickers.html': 'pug/pickers.pug',
419
+ 'docs/radio-buttons.html': 'pug/radio-buttons.pug',
420
+ 'docs/range.html': 'pug/range.pug',
421
+ 'docs/select.html': 'pug/select.pug',
422
+ 'docs/switches.html': 'pug/switches.pug',
423
+ 'docs/text-inputs.html': 'pug/text-inputs.pug',
424
+ 'docs/floating-action-button.html': 'pug/floating-action-button.pug',
425
+ 'docs/auto-init.html': 'pug/auto-init.pug'
426
+ }
427
+ }
428
+ },
429
+
430
+ // Watch Files
431
+ watch: {
432
+ pug: {
433
+ files: ['pug/**/*'],
434
+ tasks: ['pug_compile'],
435
+ options: {
436
+ interrupt: false,
437
+ spawn: false
438
+ }
439
+ },
440
+
441
+ js: {
442
+ files: ['js/**/*', '!js/init.js'],
443
+ tasks: ['js_compile'],
444
+ options: {
445
+ interrupt: false,
446
+ spawn: false
447
+ }
448
+ },
449
+
450
+ sass: {
451
+ files: ['sass/**/*'],
452
+ tasks: ['sass_compile'],
453
+ options: {
454
+ interrupt: false,
455
+ spawn: false
456
+ }
457
+ }
458
+ },
459
+
460
+ // Concurrent
461
+ concurrent: {
462
+ options: {
463
+ logConcurrentOutput: true,
464
+ limit: 10
465
+ },
466
+ monitor: {
467
+ tasks: [
468
+ 'pug_compile',
469
+ 'sass_compile',
470
+ 'js_compile',
471
+ 'watch:pug',
472
+ 'watch:js',
473
+ 'watch:sass',
474
+ 'notify:watching',
475
+ 'server'
476
+ ]
477
+ }
478
+ },
479
+
480
+ // Notifications
481
+ notify: {
482
+ watching: {
483
+ options: {
484
+ enabled: true,
485
+ message: 'Watching Files!',
486
+ title: 'Materialize', // defaults to the name in package.json, or will use project directory's name
487
+ success: true, // whether successful grunt executions should be notified automatically
488
+ duration: 1 // the duration of notification in seconds, for `notify-send only
489
+ }
490
+ },
491
+
492
+ sass_compile: {
493
+ options: {
494
+ enabled: true,
495
+ message: 'Sass Compiled!',
496
+ title: 'Materialize',
497
+ success: true,
498
+ duration: 1
499
+ }
500
+ },
501
+
502
+ js_compile: {
503
+ options: {
504
+ enabled: true,
505
+ message: 'JS Compiled!',
506
+ title: 'Materialize',
507
+ success: true,
508
+ duration: 1
509
+ }
510
+ },
511
+
512
+ pug_compile: {
513
+ options: {
514
+ enabled: true,
515
+ message: 'Pug Compiled!',
516
+ title: 'Materialize',
517
+ success: true,
518
+ duration: 1
519
+ }
520
+ },
521
+
522
+ server: {
523
+ options: {
524
+ enabled: true,
525
+ message: 'Server Running!',
526
+ title: 'Materialize',
527
+ success: true,
528
+ duration: 1
529
+ }
530
+ }
531
+ },
532
+
533
+ // Replace text to update the version string
534
+ replace: {
535
+ version: {
536
+ src: ['bower.json', 'package.js', 'pug/**/*.html', 'pug/_navbar.pug', 'js/global.js'],
537
+ overwrite: true,
538
+ replacements: [
539
+ {
540
+ from: grunt.option('oldver'),
541
+ to: grunt.option('newver')
542
+ }
543
+ ]
544
+ },
545
+ package_json: {
546
+ src: ['package.json'],
547
+ overwrite: true,
548
+ replacements: [
549
+ {
550
+ from: '"version": "' + grunt.option('oldver'),
551
+ to: '"version": "' + grunt.option('newver')
552
+ }
553
+ ]
554
+ },
555
+ docs: {
556
+ src: ['.gitignore'],
557
+ overwrite: true,
558
+ replacements: [
559
+ {
560
+ from: '/docs/*.html',
561
+ to: ''
562
+ }
563
+ ]
564
+ }
565
+ },
566
+
567
+ // Create Version Header for files
568
+ usebanner: {
569
+ release: {
570
+ options: {
571
+ position: 'top',
572
+ banner:
573
+ '/*!\n * Materialize v' +
574
+ grunt.option('newver') +
575
+ ' (https://materializecss.github.io/materialize)\n * Copyright 2014-' +
576
+ new Date().getFullYear() +
577
+ ' Materialize\n * MIT License (https://raw.githubusercontent.com/materializecss/materialize/master/LICENSE)\n */',
578
+ linebreak: true
579
+ },
580
+ files: {
581
+ src: ['dist/css/*.css', 'dist/js/*.js']
582
+ }
583
+ }
584
+ },
585
+
586
+ // Rename files
587
+ rename: {
588
+ rename_src: {
589
+ src: 'bin/materialize-src' + '.zip',
590
+ dest: 'bin/materialize-src-v' + grunt.option('newver') + '.zip',
591
+ options: {
592
+ ignore: true
593
+ }
594
+ },
595
+ rename_compiled: {
596
+ src: 'bin/materialize' + '.zip',
597
+ dest: 'bin/materialize-v' + grunt.option('newver') + '.zip',
598
+ options: {
599
+ ignore: true
600
+ }
601
+ }
602
+ },
603
+
604
+ connect: {
605
+ server: {
606
+ options: {
607
+ port: 9001,
608
+ protocol: 'http',
609
+ middleware: function(connect, options, middlewares) {
610
+ middlewares.unshift(function(req, res, next) {
611
+ res.setHeader('Access-Control-Allow-Origin', '*');
612
+ res.setHeader('Access-Control-Allow-Credentials', true);
613
+ res.setHeader(
614
+ 'Access-Control-Allow-Headers',
615
+ 'Origin, X-Requested-With, Content-Type, Accept'
616
+ );
617
+ res.setHeader('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE,OPTIONS');
618
+ next();
619
+ });
620
+ return middlewares;
621
+ }
622
+ }
623
+ }
624
+ },
625
+
626
+ copy: {
627
+ docs_js: {
628
+ files: [{ src: 'bin/materialize.js', dest: 'docs/js/materialize.js' }]
629
+ },
630
+ docs_templates: {
631
+ files: [{ src: 'templates/**', dest: 'docs/' }]
632
+ }
633
+ }
634
+ };
635
+
636
+ grunt.initConfig(config);
637
+
638
+ // load the tasks
639
+ // grunt.loadNpmTasks('grunt-gitinfo');
640
+ grunt.loadNpmTasks('grunt-contrib-watch');
641
+ grunt.loadNpmTasks('grunt-sass');
642
+ grunt.loadNpmTasks('grunt-contrib-concat');
643
+ grunt.loadNpmTasks('grunt-contrib-uglify');
644
+ grunt.loadNpmTasks('grunt-contrib-compress');
645
+ grunt.loadNpmTasks('grunt-contrib-clean');
646
+ grunt.loadNpmTasks('grunt-contrib-pug');
647
+ grunt.loadNpmTasks('grunt-concurrent');
648
+ grunt.loadNpmTasks('grunt-notify');
649
+ grunt.loadNpmTasks('grunt-text-replace');
650
+ grunt.loadNpmTasks('grunt-banner');
651
+ grunt.loadNpmTasks('grunt-rename-util');
652
+ grunt.loadNpmTasks('grunt-browser-sync');
653
+ grunt.loadNpmTasks('grunt-contrib-jasmine');
654
+ grunt.loadNpmTasks('grunt-postcss');
655
+ grunt.loadNpmTasks('grunt-babel');
656
+ grunt.loadNpmTasks('grunt-contrib-connect');
657
+ grunt.loadNpmTasks('grunt-contrib-copy');
658
+
659
+ // define the tasks
660
+ grunt.registerTask('release', [
661
+ 'sass:expanded',
662
+ 'sass:min',
663
+ 'postcss:expanded',
664
+ 'postcss:min',
665
+ 'concat:dist',
666
+ 'babel:dist',
667
+ 'uglify:dist',
668
+ 'uglify:extras',
669
+ 'usebanner:release',
670
+ 'compress:main',
671
+ 'compress:src',
672
+ 'compress:starter_template',
673
+ 'compress:parallax_template',
674
+ 'replace:version',
675
+ 'replace:package_json',
676
+ 'rename:rename_src',
677
+ 'rename:rename_compiled',
678
+ 'clean:temp'
679
+ ]);
680
+
681
+ grunt.task.registerTask('configureBabel', 'configures babel options', function() {
682
+ config.babel.bin.options.inputSourceMap = grunt.file.readJSON(concatFile);
683
+ });
684
+
685
+ grunt.registerTask('pug_compile', ['pug', 'notify:pug_compile']);
686
+ grunt.registerTask('js_compile', [
687
+ 'concat:temp',
688
+ 'configureBabel',
689
+ 'babel:bin',
690
+ 'clean:temp',
691
+ 'copy:docs_js'
692
+ ]);
693
+ grunt.registerTask('sass_compile', [
694
+ 'sass:gh',
695
+ 'sass:bin',
696
+ 'postcss:gh',
697
+ 'postcss:bin',
698
+ 'notify:sass_compile'
699
+ ]);
700
+ grunt.registerTask('server', ['browserSync', 'notify:server']);
701
+ grunt.registerTask('monitor', ['concurrent:monitor']);
702
+ grunt.registerTask('test', ['js_compile', 'sass_compile', 'connect', 'jasmine']);
703
+ grunt.registerTask('jas_test', ['connect', 'jasmine']);
704
+ grunt.registerTask('test_repeat', function() {
705
+ const tasks = ['connect'];
706
+ const n = 30;
707
+ for (let i = 0; i < n; i++) {
708
+ tasks.push('jasmine');
709
+ }
710
+
711
+ grunt.task.run(tasks);
712
+ });
713
+ grunt.registerTask('docs', [
714
+ 'js_compile',
715
+ 'copy:docs_js',
716
+ 'copy:docs_templates',
717
+ 'sass:gh',
718
+ 'postcss:gh',
719
+ 'pug',
720
+ 'replace:docs'
721
+ ]);
722
+ };