GruntFile.coffee 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. module.exports = (grunt) ->
  2. grunt.initConfig
  3. pkg: grunt.file.readJSON "package/lungo/component.json"
  4. meta:
  5. file: 'lungo'
  6. temp: "build",
  7. package: "package",
  8. plugins: "src/plugins",
  9. # BETA
  10. # endpoint: "example/components",
  11. # version: ".brownie",
  12. # RELEASE
  13. endpoint: "package",
  14. version: "",
  15. banner: '/* <%= pkg.name %> v<%= pkg.version %> - <%= grunt.template.today("yyyy/m/d") %>\n' +
  16. ' <%= pkg.homepage %>\n' +
  17. ' Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>' +
  18. ' - Licensed <%= _.pluck(pkg.license, "type").join(", ") %> */\n'
  19. source:
  20. coffee: [
  21. 'src/Lungo.coffee',
  22. 'src/modules/Lungo.Attributes.coffee',
  23. 'src/modules/Lungo.Cache.coffee',
  24. 'src/modules/Lungo.Constants.coffee',
  25. 'src/modules/Lungo.Core.coffee',
  26. 'src/modules/Lungo.Dom.coffee',
  27. 'src/modules/Lungo.Events.coffee',
  28. 'src/modules/Lungo.Fallback.coffee',
  29. 'src/modules/Lungo.Init.coffee',
  30. 'src/modules/Lungo.Notification.coffee',
  31. 'src/modules/Lungo.Resource.coffee',
  32. 'src/modules/Lungo.Scroll.coffee',
  33. 'src/modules/Lungo.Service.coffee',
  34. 'src/modules/Lungo.Router.Phone.coffee',
  35. 'src/modules/Lungo.Router.Tablet.coffee',
  36. 'src/modules/Lungo.Aside.coffee',
  37. 'src/modules/Lungo.Section.coffee',
  38. 'src/modules/Lungo.Article.coffee',
  39. 'src/boot/*.coffee',
  40. 'src/element/*.coffee']
  41. stylus: [
  42. 'src/stylesheets/lungo.base.styl',
  43. 'src/stylesheets/lungo.layout.styl',
  44. 'src/stylesheets/lungo.layout.*.styl',
  45. 'src/stylesheets/lungo.widget.styl',
  46. 'src/stylesheets/lungo.widget.*.styl',
  47. 'src/stylesheets/lungo.media.*.styl',
  48. 'src/stylesheets/lungo.animation.styl',
  49. 'src/stylesheets/lungo.animation.*.styl']
  50. theme: [
  51. 'src/stylesheets/theme/theme.*.styl']
  52. icons: [
  53. 'src/stylesheets/lungo.icon**.styl']
  54. calendar:
  55. coffee: 'src/plugins/calendar/**.coffee'
  56. stylus: 'src/plugins/calendar/**.styl'
  57. coffee:
  58. core: files: '<%=meta.temp%>/<%=meta.file%>.debug.js': '<%= source.coffee %>'
  59. calendar: files: 'package/lungo.calendar/lungo.calendar.js': '<%= source.calendar.coffee %>'
  60. uglify:
  61. options: compress: false, banner: "<%= meta.banner %>"
  62. engine: files: '<%=meta.endpoint%>/<%=meta.file%><%=meta.version%>/<%=meta.file%>.js': '<%=meta.temp%>/<%=meta.file%>.debug.js'
  63. stylus:
  64. core:
  65. options: compress: true, import: [ '__init']
  66. files: '<%=meta.endpoint%>/<%=meta.file%><%=meta.version%>/<%=meta.file%>.css': '<%=source.stylus%>'
  67. theme:
  68. options: compress: false, import: [ '__init']
  69. files: '<%=meta.endpoint%>/<%=meta.file%><%=meta.version%>/<%=meta.file%>.theme.css': '<%=source.theme%>'
  70. icons:
  71. files: '<%=meta.package%>/<%=meta.file%>.icon/<%=meta.file%>.icon.css': '<%=source.icons%>'
  72. calendar:
  73. files: 'package/lungo.calendar/lungo.calendar.css': '<%=source.calendar.stylus%>'
  74. copy:
  75. theme:
  76. expand: true, flatten: true, src: '<%=source.theme%>', dest: '<%=meta.package%>/<%=meta.file%>.theme/'
  77. icon:
  78. expand: false, flatten: true, src: '<%=meta.package%>/<%=meta.file%>.icon/<%=meta.file%>.icon.css', dest: '<%=meta.endpoint%>/<%=meta.file%><%=meta.version%>/<%=meta.file%>.icon.css'
  79. watch:
  80. coffee:
  81. files: ['<%= source.coffee %>']
  82. tasks: ["coffee:core"]
  83. stylus:
  84. files: ['<%= source.stylus %>', 'src/stylesheets/__init.styl',]
  85. tasks: ["stylus:core"]
  86. theme:
  87. files: ['<%= source.theme %>']
  88. tasks: ["stylus:theme"]
  89. calendar:
  90. files: ['<%= source.calendar.coffee %>','<%= source.calendar.stylus %>']
  91. tasks: ["coffee:calendar", "stylus:calendar"]
  92. grunt.loadNpmTasks "grunt-contrib-coffee"
  93. grunt.loadNpmTasks "grunt-contrib-concat"
  94. grunt.loadNpmTasks "grunt-contrib-uglify"
  95. grunt.loadNpmTasks "grunt-contrib-stylus"
  96. grunt.loadNpmTasks "grunt-contrib-copy"
  97. grunt.loadNpmTasks "grunt-contrib-watch"
  98. grunt.registerTask "default", ["coffee", "uglify", "stylus", "copy"]