@materializecss/materialize 1.1.0-alpha → 1.2.0

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