GruntFile.coffee 3.8 KB

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