client/gruntfile.js
author rougeronj
Wed, 03 Jun 2015 17:27:46 +0200
changeset 471 e0c7be5dc02c
parent 444 19f0b7803aed
child 468 364c367df7fc
child 476 7e9495eb3cb0
permissions -rw-r--r--
Add a router to handle fragment identifier Set up a listener of the router in the scene to update it Start Backbone.history (eventlistener of the router) when all the project is loaded Include router.js to all the test file
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
295
bcac9ea07d04 add simple-persist in grunt connect
ymh <ymh.work@gmail.com>
parents: 294
diff changeset
     1
var simplePersist = require('./data/simple-persist');
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
module.exports = function(grunt) {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
  'use strict';
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
  var renkan_src = [
425
823e8f1d26f7 generate template before laoding the main
rougeronj
parents: 423
diff changeset
     8
      'dist/js/templates.js',
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
      'js/main.js',
444
19f0b7803aed add schema version + dataloaders to ensure data migrations + small correction for php server exmple + a readme for the php server example
ymh <ymh.work@gmail.com>
parents: 442
diff changeset
    10
      'js/dataloader.js',
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
      'js/models.js',
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
      'js/defaults.js',
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
      'js/i18n.js',
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
      'js/full-json.js',
320
154b121a43f1 enhance save on click (snapshot mode) and update django app
cavaliet
parents: 297
diff changeset
    15
      'js/save-once.js',
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
      'js/ldtjson-bin.js',
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
      'js/list-bin.js',
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
      'js/wikipedia-bin.js',
423
4f0b6f345564 add grunt-contrib-watch and a watch task to detect modification of js/css/html and launch the corresping task to build the application again
rougeronj
parents: 421
diff changeset
    19
      'dist/js/paper-renderer.js',
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
  ];
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
  var renkan_banner = grunt.file.read('js/header.js').toString() +
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
      '\n/*! <%= pkg.name %> - v<%= pkg.version %> - Copyright © IRI ' +
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
      '<%= grunt.template.today("yyyy") %> */\n\n';
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    26
  // Project configuration.
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    27
  grunt.initConfig({
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    28
    pkg: grunt.file.readJSON('package.json'),
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    29
    requirejs: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    30
      renderer: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    31
        options: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    32
          baseUrl: "js/",
294
d9247696a257 rename build-renderer in main-renderer
ymh <ymh.work@gmail.com>
parents: 293
diff changeset
    33
          name: "main-renderer",
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    34
          out: "dist/js/paper-renderer.js",
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    35
          optimize: "none",
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    36
          beautify: true,
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    37
          paths: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    38
            requtils: "require-utils",
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    39
            jquery: "empty:",
297
7de2652f7ee8 SaveAs project client side
ymh <ymh.work@gmail.com>
parents: 295
diff changeset
    40
            underscore: "empty:",
7de2652f7ee8 SaveAs project client side
ymh <ymh.work@gmail.com>
parents: 295
diff changeset
    41
            filesaver: "empty:"
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    42
          }
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    43
        }
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    44
      }
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    45
    },
416
54a9de7e2b45 add grunt JST to compilate the templates
rougeronj
parents: 347
diff changeset
    46
    jst: {
54a9de7e2b45 add grunt JST to compilate the templates
rougeronj
parents: 347
diff changeset
    47
		compile: {
54a9de7e2b45 add grunt JST to compilate the templates
rougeronj
parents: 347
diff changeset
    48
			options: {
54a9de7e2b45 add grunt JST to compilate the templates
rougeronj
parents: 347
diff changeset
    49
				namespace: 'renkanJST',
54a9de7e2b45 add grunt JST to compilate the templates
rougeronj
parents: 347
diff changeset
    50
				//amd: true
54a9de7e2b45 add grunt JST to compilate the templates
rougeronj
parents: 347
diff changeset
    51
			},
54a9de7e2b45 add grunt JST to compilate the templates
rougeronj
parents: 347
diff changeset
    52
			files: {
421
6cf2ef158f9b update jst grunt to crawl inside the nested templates folders
rougeronj
parents: 416
diff changeset
    53
				"dist/js/templates.js": ["templates/**/*.html"]
416
54a9de7e2b45 add grunt JST to compilate the templates
rougeronj
parents: 347
diff changeset
    54
			}
54a9de7e2b45 add grunt JST to compilate the templates
rougeronj
parents: 347
diff changeset
    55
		}
54a9de7e2b45 add grunt JST to compilate the templates
rougeronj
parents: 347
diff changeset
    56
    },
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    57
    uglify: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    58
      options: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    59
        banner: renkan_banner,
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    60
        sourceMap: true,
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    61
        sourceMapIncludeSources: true
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    62
      },
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    63
      renkan: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    64
        files : {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    65
          'dist/js/renkan.min.js' : renkan_src
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    66
        }
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    67
      }
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    68
    },
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    69
    concat: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    70
      options: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    71
        banner: renkan_banner
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    72
      },
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    73
      renkan: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    74
        files : {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    75
          'dist/js/renkan.js' : renkan_src
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    76
        }
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    77
      }
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    78
    },
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    79
    clean: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    80
      options: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    81
        force: true
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    82
      },
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    83
      renderer: ["dist/js/paper-renderer.js"],
416
54a9de7e2b45 add grunt JST to compilate the templates
rougeronj
parents: 347
diff changeset
    84
      jst:["dist/js/templates.js"],
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    85
      renkan: ["dist/"],
345
cb5c0007c9f9 continue bower integration
ymh <ymh.work@gmail.com>
parents: 344
diff changeset
    86
      lib: ["lib/"],
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    87
    },
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    88
    cssmin: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    89
      options: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    90
        banner: renkan_banner
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    91
      },
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    92
      renkan: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    93
        expand: true,
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    94
        cwd: 'css/',
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    95
        src: ['*.css'],
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    96
        dest: 'dist/css',
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    97
        ext: '.min.css'
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    98
      }
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
    99
    },
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   100
    copy: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   101
      renkan: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   102
        files: [
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   103
          {expand: true, cwd: '', src: ['img/*'], dest: 'dist/', filter: 'isFile'},
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   104
          {expand: true, cwd: '', src: ['data/properties.json'], dest: 'dist/', filter: 'isFile'},
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   105
          {expand: true, cwd: '', src: ['lib/**'], dest: 'dist/'}
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   106
         ]
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   107
       },
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   108
       renkan_css: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   109
         options: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   110
           process: function (content, srcpath) {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   111
             return grunt.template.process(renkan_banner) + content;
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   112
           }
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   113
         },
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   114
         files: [{expand: true, cwd: '', src: ['css/*'], dest: 'dist/', filter: 'isFile'}]
342
2306317213a1 publish a new version of renkan in django server part and add a grunt target to do it
ymh <ymh.work@gmail.com>
parents: 320
diff changeset
   115
       },
2306317213a1 publish a new version of renkan in django server part and add a grunt target to do it
ymh <ymh.work@gmail.com>
parents: 320
diff changeset
   116
       renkan_server: {
347
7a5905153e66 extend copy-server task in grunt to copy lib folder to the right directory on the server
rougeronj
parents: 345
diff changeset
   117
         files: [
442
adb907bba956 add server php example
ymh <ymh.work@gmail.com>
parents: 425
diff changeset
   118
           {expand: true, cwd: 'dist', src: ['**', '!data/*', '!lib/**'], dest: '../server/python/django/renkanmanager/static/renkanmanager/lib/renkan/', filter: 'isFile'},
adb907bba956 add server php example
ymh <ymh.work@gmail.com>
parents: 425
diff changeset
   119
           {expand: true, cwd: 'dist/lib', src: ['**'], dest: '../server/python/django/renkanmanager/static/renkanmanager/lib/', filter: 'isFile'},
adb907bba956 add server php example
ymh <ymh.work@gmail.com>
parents: 425
diff changeset
   120
           {expand: true, cwd: 'dist', src: ['**', '!data/*', '!lib/**'], dest: '../server/php/basic/public_html/static/lib/renkan/', filter: 'isFile'},
adb907bba956 add server php example
ymh <ymh.work@gmail.com>
parents: 425
diff changeset
   121
           {expand: true, cwd: 'dist/lib', src: ['**'], dest: '../server/php/basic/public_html/static/lib/', filter: 'isFile'}
347
7a5905153e66 extend copy-server task in grunt to copy lib folder to the right directory on the server
rougeronj
parents: 345
diff changeset
   122
         ]
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   123
       }
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   124
    },
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   125
    jshint: {
293
fba23fde14ba Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents: 292
diff changeset
   126
      options: {
fba23fde14ba Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents: 292
diff changeset
   127
        curly: true,
fba23fde14ba Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents: 292
diff changeset
   128
        eqeqeq: true,
fba23fde14ba Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents: 292
diff changeset
   129
        eqnull: true,
fba23fde14ba Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents: 292
diff changeset
   130
        browser: true,
fba23fde14ba Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents: 292
diff changeset
   131
        globals: {
fba23fde14ba Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents: 292
diff changeset
   132
          jQuery: true
fba23fde14ba Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents: 292
diff changeset
   133
        },
fba23fde14ba Correct jshint errors and force it on build
ymh <ymh.work@gmail.com>
parents: 292
diff changeset
   134
      },
295
bcac9ea07d04 add simple-persist in grunt connect
ymh <ymh.work@gmail.com>
parents: 294
diff changeset
   135
      all: ['Gruntfile.js', 'js/**/*.js', 'data/simple-persist.js']
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   136
    },
344
e616c4fff297 start adding bower. remove and forget lib folder. this folder is now managed by grunt
ymh <ymh.work@gmail.com>
parents: 342
diff changeset
   137
    bower: {
e616c4fff297 start adding bower. remove and forget lib folder. this folder is now managed by grunt
ymh <ymh.work@gmail.com>
parents: 342
diff changeset
   138
        install: {
e616c4fff297 start adding bower. remove and forget lib folder. this folder is now managed by grunt
ymh <ymh.work@gmail.com>
parents: 342
diff changeset
   139
            options: {
e616c4fff297 start adding bower. remove and forget lib folder. this folder is now managed by grunt
ymh <ymh.work@gmail.com>
parents: 342
diff changeset
   140
                targetDir: './lib',
e616c4fff297 start adding bower. remove and forget lib folder. this folder is now managed by grunt
ymh <ymh.work@gmail.com>
parents: 342
diff changeset
   141
                layout: 'byComponent',
345
cb5c0007c9f9 continue bower integration
ymh <ymh.work@gmail.com>
parents: 344
diff changeset
   142
                install: true,
344
e616c4fff297 start adding bower. remove and forget lib folder. this folder is now managed by grunt
ymh <ymh.work@gmail.com>
parents: 342
diff changeset
   143
                verbose: false,
e616c4fff297 start adding bower. remove and forget lib folder. this folder is now managed by grunt
ymh <ymh.work@gmail.com>
parents: 342
diff changeset
   144
                cleanTargetDir: false,
e616c4fff297 start adding bower. remove and forget lib folder. this folder is now managed by grunt
ymh <ymh.work@gmail.com>
parents: 342
diff changeset
   145
                cleanBowerDir: false,
e616c4fff297 start adding bower. remove and forget lib folder. this folder is now managed by grunt
ymh <ymh.work@gmail.com>
parents: 342
diff changeset
   146
                bowerOptions: {}
e616c4fff297 start adding bower. remove and forget lib folder. this folder is now managed by grunt
ymh <ymh.work@gmail.com>
parents: 342
diff changeset
   147
            }
e616c4fff297 start adding bower. remove and forget lib folder. this folder is now managed by grunt
ymh <ymh.work@gmail.com>
parents: 342
diff changeset
   148
        }
e616c4fff297 start adding bower. remove and forget lib folder. this folder is now managed by grunt
ymh <ymh.work@gmail.com>
parents: 342
diff changeset
   149
    },
423
4f0b6f345564 add grunt-contrib-watch and a watch task to detect modification of js/css/html and launch the corresping task to build the application again
rougeronj
parents: 421
diff changeset
   150
    watch: {
4f0b6f345564 add grunt-contrib-watch and a watch task to detect modification of js/css/html and launch the corresping task to build the application again
rougeronj
parents: 421
diff changeset
   151
    	css:{
4f0b6f345564 add grunt-contrib-watch and a watch task to detect modification of js/css/html and launch the corresping task to build the application again
rougeronj
parents: 421
diff changeset
   152
    		files: ['css/**/*.css'],
442
adb907bba956 add server php example
ymh <ymh.work@gmail.com>
parents: 425
diff changeset
   153
    		tasks: ['cssmin', 'copy:renkan_css'],
423
4f0b6f345564 add grunt-contrib-watch and a watch task to detect modification of js/css/html and launch the corresping task to build the application again
rougeronj
parents: 421
diff changeset
   154
    	},
4f0b6f345564 add grunt-contrib-watch and a watch task to detect modification of js/css/html and launch the corresping task to build the application again
rougeronj
parents: 421
diff changeset
   155
    	js:{
4f0b6f345564 add grunt-contrib-watch and a watch task to detect modification of js/css/html and launch the corresping task to build the application again
rougeronj
parents: 421
diff changeset
   156
    		files: ['js/**/*.js', 'templates/**/*.html'],
4f0b6f345564 add grunt-contrib-watch and a watch task to detect modification of js/css/html and launch the corresping task to build the application again
rougeronj
parents: 421
diff changeset
   157
    		tasks: ['jshint', 'requirejs', 'jst', 'concat', 'uglify', 'copy:renkan', 'clean:renderer'],
4f0b6f345564 add grunt-contrib-watch and a watch task to detect modification of js/css/html and launch the corresping task to build the application again
rougeronj
parents: 421
diff changeset
   158
    	},
4f0b6f345564 add grunt-contrib-watch and a watch task to detect modification of js/css/html and launch the corresping task to build the application again
rougeronj
parents: 421
diff changeset
   159
    	lib:{
4f0b6f345564 add grunt-contrib-watch and a watch task to detect modification of js/css/html and launch the corresping task to build the application again
rougeronj
parents: 421
diff changeset
   160
    		files: ['bower.json'],
4f0b6f345564 add grunt-contrib-watch and a watch task to detect modification of js/css/html and launch the corresping task to build the application again
rougeronj
parents: 421
diff changeset
   161
    		tasks: ['bower:install', 'copy:renkan'],
4f0b6f345564 add grunt-contrib-watch and a watch task to detect modification of js/css/html and launch the corresping task to build the application again
rougeronj
parents: 421
diff changeset
   162
    	},
4f0b6f345564 add grunt-contrib-watch and a watch task to detect modification of js/css/html and launch the corresping task to build the application again
rougeronj
parents: 421
diff changeset
   163
    	options: {
4f0b6f345564 add grunt-contrib-watch and a watch task to detect modification of js/css/html and launch the corresping task to build the application again
rougeronj
parents: 421
diff changeset
   164
    		interrupt: true,
4f0b6f345564 add grunt-contrib-watch and a watch task to detect modification of js/css/html and launch the corresping task to build the application again
rougeronj
parents: 421
diff changeset
   165
    	},
4f0b6f345564 add grunt-contrib-watch and a watch task to detect modification of js/css/html and launch the corresping task to build the application again
rougeronj
parents: 421
diff changeset
   166
    },
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   167
    connect: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   168
        server: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   169
          options: {
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   170
            port: 9001,
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   171
            base: '.',
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   172
            useAvailablePort: true,
295
bcac9ea07d04 add simple-persist in grunt connect
ymh <ymh.work@gmail.com>
parents: 294
diff changeset
   173
            debug: true,
bcac9ea07d04 add simple-persist in grunt connect
ymh <ymh.work@gmail.com>
parents: 294
diff changeset
   174
            middleware: function(connect, options, middlewares) {
bcac9ea07d04 add simple-persist in grunt connect
ymh <ymh.work@gmail.com>
parents: 294
diff changeset
   175
              middlewares.push(simplePersist.middleware);
bcac9ea07d04 add simple-persist in grunt connect
ymh <ymh.work@gmail.com>
parents: 294
diff changeset
   176
              return middlewares;
bcac9ea07d04 add simple-persist in grunt connect
ymh <ymh.work@gmail.com>
parents: 294
diff changeset
   177
            }
bcac9ea07d04 add simple-persist in grunt connect
ymh <ymh.work@gmail.com>
parents: 294
diff changeset
   178
          },
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   179
        }
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   180
    }
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   181
  });
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   182
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   183
  // Load the plugin that provides the "uglify" task.
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   184
  grunt.loadNpmTasks('grunt-contrib-requirejs');
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   185
  grunt.loadNpmTasks('grunt-contrib-uglify');
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   186
  grunt.loadNpmTasks('grunt-contrib-concat');
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   187
  grunt.loadNpmTasks('grunt-contrib-clean');
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   188
  grunt.loadNpmTasks('grunt-contrib-cssmin');
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   189
  grunt.loadNpmTasks('grunt-contrib-copy');
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   190
  grunt.loadNpmTasks('grunt-contrib-jshint');
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   191
  grunt.loadNpmTasks('grunt-contrib-connect');
344
e616c4fff297 start adding bower. remove and forget lib folder. this folder is now managed by grunt
ymh <ymh.work@gmail.com>
parents: 342
diff changeset
   192
  grunt.loadNpmTasks('grunt-bower-task');
416
54a9de7e2b45 add grunt JST to compilate the templates
rougeronj
parents: 347
diff changeset
   193
  grunt.loadNpmTasks('grunt-contrib-jst');
423
4f0b6f345564 add grunt-contrib-watch and a watch task to detect modification of js/css/html and launch the corresping task to build the application again
rougeronj
parents: 421
diff changeset
   194
  grunt.loadNpmTasks('grunt-contrib-watch');
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   195
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   196
  // Default task(s).
416
54a9de7e2b45 add grunt JST to compilate the templates
rougeronj
parents: 347
diff changeset
   197
  grunt.registerTask('default', ['jshint', 'requirejs', 'jst', 'concat', 'uglify', 'cssmin', 'bower:install', 'copy:renkan', 'copy:renkan_css', 'clean:renderer', 'clean:jst']);
342
2306317213a1 publish a new version of renkan in django server part and add a grunt target to do it
ymh <ymh.work@gmail.com>
parents: 320
diff changeset
   198
  grunt.registerTask('copy-server', 'copy files to server part', function(){
2306317213a1 publish a new version of renkan in django server part and add a grunt target to do it
ymh <ymh.work@gmail.com>
parents: 320
diff changeset
   199
      grunt.task.run(['copy:renkan_server']);
2306317213a1 publish a new version of renkan in django server part and add a grunt target to do it
ymh <ymh.work@gmail.com>
parents: 320
diff changeset
   200
  });
423
4f0b6f345564 add grunt-contrib-watch and a watch task to detect modification of js/css/html and launch the corresping task to build the application again
rougeronj
parents: 421
diff changeset
   201
  grunt.registerTask('dev', [ 'jshint', 'requirejs', 'jst', 'concat', 'uglify', 'cssmin', 'bower:install', 'copy:renkan', 'copy:renkan_css', 'clean:renderer', 'connect:server', 'watch']);
290
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   202
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   203
8a6eb26ac87f move client build to Grunt and relocate it into client folder. Adjust server to work with the new build.
ymh <ymh.work@gmail.com>
parents:
diff changeset
   204
};