<commit_before>"use strict";
module.exports = function (grunt) {

  var core = ["<%= pkg.name %>.js", "<%= pkg.name %>.production.js", "ext/**"];

  grunt.initConfig({
    pkg: grunt.file.readJSON("package.json"),
    meta: {
      banner: "/*\n *  <%= pkg.name %> v<%= pkg.version %>\n" +
      "<%= pkg.homepage ? ' *  ' + pkg.homepage + '\\n' : '' %>" +
      " *  \n" +
      " *  Copyright (c) <%= grunt.template.today('yyyy') %> <%= pkg.author.name %>;" +
      " Licensed <%= _.map(pkg.licenses, 'type').join(', ') %>\n */"
    },
    release: {},
    concat: {
      dist: {
        src: [
          "node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js",
          "node_modules/steal-systemjs/dist/system.src.js",
          "src/start.js",
          "src/normalize.js",
          "src/core.js",		// starts makeSteal
          "src/system-extension-ext.js",
          "src/system-extension-forward-slash.js",
          "src/system-extension-locate.js",
          "src/system-extension-contextual.js",
          "src/system-extension-script-module.js",
          "node_modules/system-trace/trace.js",
          "src/json/json.js",
          "src/config.js",
          "node_modules/steal-env/env.js",
          "src/startup.js",
          "src/import.js",
          "src/make-steal-end.js", // ends makeSteal
          "src/system-format-steal.js",
          "src/end.js"
        ],
        dest: "<%= pkg.name %>.js"
      },
      nodeMain: {
        src: [
          "src/start.js",
          "src/normalize.js",
          "src/core.js",		// starts makeSteal
          "src/system-extension-ext.js",
          "src/system-extension-forward-slash.js",
          "src/system-extension-locate.js",
          "src/system-extension-contextual.js",
          "src/system-extension-script-module.js",
          "node_modules/system-trace/trace.js",
          "src/json/json.js",
          "src/config.js",
          "node_modules/steal-env/env.js",
          "src/startup.js",
          "src/node-require.js",
          "src/import.js",
          "src/make-steal-end.js", // ends makeSteal
          "src/system-format-steal.js",
          "src/end.js"
        ],
        dest: "main.js"
      }
    },
    uglify: {
      options: {
        banner: "<%= meta.banner %>\n",
        compress: {
          drop_console: true
        }
      },
      dist: {
        options: {
          banner: "<%= meta.banner %>\n"
        },
        src: "<%= pkg.name %>.js",
        dest: "<%= pkg.name %>.production.js"
      }
    },
    copy: {
      // copy plugins that steal should contain
      extensions: {
        files: [
          {src: ["node_modules/steal-npm/npm.js"], dest: "ext/npm.js", filter: "isFile"},
          {src: ["node_modules/steal-npm/npm-extension.js"], dest: "ext/npm-extension.js", filter: "isFile"},
          {src: ["node_modules/steal-npm/npm-utils.js"], dest: "ext/npm-utils.js", filter: "isFile"},
          {src: ["node_modules/steal-npm/npm-crawl.js"], dest: "ext/npm-crawl.js", filter: "isFile"},
          {src: ["node_modules/steal-npm/npm-convert.js"], dest: "ext/npm-convert.js", filter: "isFile"},
          {src: ["node_modules/steal-npm/npm-load.js"], dest: "ext/npm-load.js", filter: "isFile"},
          {src: ["node_modules/steal-npm/semver.js"], dest: "ext/semver.js", filter: "isFile"},
          {src: ["node_modules/system-live-reload/live.js"], dest: "ext/live-reload.js", filter: "isFile"},
          {src: ["node_modules/traceur/bin/traceur.js"], dest: "ext/traceur.js", filter: "isFile"},
          {src: ["node_modules/traceur/bin/traceur-runtime.js"], dest: "ext/traceur-runtime.js", filter: "isFile"},
          {src: ["node_modules/system-bower/bower.js"], dest: "ext/bower.js", filter: "isFile"},
          {src: ["node_modules/babel-standalone/babel.js"], dest: "ext/babel.js", filter: "isFile"},
        ]
      },
      toTest: {
        files: [
          {expand: true, src: core, dest: "test/", filter: "isFile"},
          {expand: true, src: core, dest: "test/steal/", filter: "isFile"},
          {expand: true, src: core, dest: "test/bower_components/steal/", filter: "isFile"},
          {expand: true, src: core, dest: "test/npm/node_modules/steal/", filter: "isFile"},
          {expand: true, src: core, dest: "test/npm-deep/node_modules/steal/", filter: "isFile"},
          {expand: true, src: core, dest: "test/npm/bower/node_modules/steal/", filter: "isFile"},
          {expand: true, src: core, dest: "test/steal-module-script/node_modules/steal/", filter: "isFile"},
          {expand: true, src: core, dest: "test/bower/bower_components/steal/", filter: "isFile"},
          {expand: true, src: core, dest: "test/bower/npm/bower_components/steal/", filter: "isFile"},
          {expand: true, src: ["node_modules/jquery/**"], dest: "test/npm/", filter: "isFile"},
          {
            expand: true,
            cwd: "node_modules/system-bower/",
            src: ["*"],
            dest: "test/bower_components/system-bower/",
            filter: "isFile"
          },
          {
            expand: true,
            cwd: "node_modules/system-bower/",
            src: ["*"],
            dest: "test/bower/bower_components/system-bower/",
            filter: "isFile"
          },
          {
            expand: true,
            cwd: "node_modules/system-bower/",
            src: ["*"],
            dest: "test/bower/with_paths/bower_components/system-bower/",
            filter: "isFile"
          },
          {
            expand: true,
            cwd: "node_modules/system-bower/",
            src: ["*"],
            dest: "test/bower/as_config/vendor/system-bower/",
            filter: "isFile"
          }
        ]
      },

    },
    watch: {
      files: ["src/*.js", "node_modules/systemjs/dist/**"],
      tasks: "default"
    },
    jshint: {
      options: {
        jshintrc: ".jshintrc"
      },
      lib: ["src/**/*.js"]
    },
    testee: {
      windows: {
        options: {
          browsers: ["ie"]
        },
        src: ["test/test.html"]
      },
      tests: {
        options: {
          browsers: ["firefox"]
        },
        src: ["test/test.html", "test/unit_test.html"]
      }
    },
    simplemocha: {
      builders: {
        src: [
          "test/node_test.js",
          "test/steal_import/test.js"
        ]
      }
    }
  });

  grunt.loadNpmTasks("grunt-contrib-watch");
  grunt.loadNpmTasks("grunt-contrib-concat");
  grunt.loadNpmTasks("grunt-contrib-jshint");
  grunt.loadNpmTasks("grunt-contrib-uglify");
  grunt.loadNpmTasks("grunt-contrib-copy");
  grunt.loadNpmTasks("grunt-simple-mocha");
  grunt.loadNpmTasks("grunt-release");
  grunt.loadNpmTasks("testee");

  grunt.registerTask("test", ["build", "testee:tests", "simplemocha"]);
  grunt.registerTask("test-windows", ["build", /*"testee:windows",*/ "simplemocha"]);
  grunt.registerTask("build", [/*"jshint", */"concat", "uglify", "copy:extensions", "copy:toTest"]);
  grunt.registerTask("default", ["build"]);
};
<commit_msg>use tab indent<commit_after>"use strict";
module.exports = function (grunt) {

	var core = ["<%= pkg.name %>.js", "<%= pkg.name %>.production.js", "ext/**"];

	grunt.initConfig({
		pkg: grunt.file.readJSON("package.json"),
		meta: {
			banner: "/*\n *  <%= pkg.name %> v<%= pkg.version %>\n" +
			"<%= pkg.homepage ? ' *  ' + pkg.homepage + '\\n' : '' %>" +
			" *  \n" +
			" *  Copyright (c) <%= grunt.template.today('yyyy') %> <%= pkg.author.name %>;" +
			" Licensed <%= _.map(pkg.licenses, 'type').join(', ') %>\n */"
		},
		release: {},
		concat: {
			dist: {
				src: [
					"node_modules/steal-es6-module-loader/dist/es6-module-loader.src.js",
					"node_modules/steal-systemjs/dist/system.src.js",
					"src/start.js",
					"src/normalize.js",
					"src/core.js",		// starts makeSteal
					"src/system-extension-ext.js",
					"src/system-extension-forward-slash.js",
					"src/system-extension-locate.js",
					"src/system-extension-contextual.js",
					"src/system-extension-script-module.js",
					"node_modules/system-trace/trace.js",
					"src/json/json.js",
					"src/config.js",
					"node_modules/steal-env/env.js",
					"src/startup.js",
					"src/import.js",
					"src/make-steal-end.js", // ends makeSteal
					"src/system-format-steal.js",
					"src/end.js"
				],
				dest: "<%= pkg.name %>.js"
			},
			nodeMain: {
				src: [
					"src/start.js",
					"src/normalize.js",
					"src/core.js",		// starts makeSteal
					"src/system-extension-ext.js",
					"src/system-extension-forward-slash.js",
					"src/system-extension-locate.js",
					"src/system-extension-contextual.js",
					"src/system-extension-script-module.js",
					"node_modules/system-trace/trace.js",
					"src/json/json.js",
					"src/config.js",
					"node_modules/steal-env/env.js",
					"src/startup.js",
					"src/node-require.js",
					"src/import.js",
					"src/make-steal-end.js", // ends makeSteal
					"src/system-format-steal.js",
					"src/end.js"
				],
				dest: "main.js"
			}
		},
		uglify: {
			options: {
				banner: "<%= meta.banner %>\n",
				compress: {
					drop_console: true
				}
			},
			dist: {
				options: {
					banner: "<%= meta.banner %>\n"
				},
				src: "<%= pkg.name %>.js",
				dest: "<%= pkg.name %>.production.js"
			}
		},
		copy: {
			// copy plugins that steal should contain
			extensions: {
				files: [
					{src: ["node_modules/steal-npm/npm.js"], dest: "ext/npm.js", filter: "isFile"},
					{src: ["node_modules/steal-npm/npm-extension.js"], dest: "ext/npm-extension.js", filter: "isFile"},
					{src: ["node_modules/steal-npm/npm-utils.js"], dest: "ext/npm-utils.js", filter: "isFile"},
					{src: ["node_modules/steal-npm/npm-crawl.js"], dest: "ext/npm-crawl.js", filter: "isFile"},
					{src: ["node_modules/steal-npm/npm-convert.js"], dest: "ext/npm-convert.js", filter: "isFile"},
					{src: ["node_modules/steal-npm/npm-load.js"], dest: "ext/npm-load.js", filter: "isFile"},
					{src: ["node_modules/steal-npm/semver.js"], dest: "ext/semver.js", filter: "isFile"},
					{src: ["node_modules/system-live-reload/live.js"], dest: "ext/live-reload.js", filter: "isFile"},
					{src: ["node_modules/traceur/bin/traceur.js"], dest: "ext/traceur.js", filter: "isFile"},
					{src: ["node_modules/traceur/bin/traceur-runtime.js"], dest: "ext/traceur-runtime.js", filter: "isFile"},
					{src: ["node_modules/system-bower/bower.js"], dest: "ext/bower.js", filter: "isFile"},
					{src: ["node_modules/babel-standalone/babel.js"], dest: "ext/babel.js", filter: "isFile"},
				]
			},
			toTest: {
				files: [
					{expand: true, src: core, dest: "test/", filter: "isFile"},
					{expand: true, src: core, dest: "test/steal/", filter: "isFile"},
					{expand: true, src: core, dest: "test/bower_components/steal/", filter: "isFile"},
					{expand: true, src: core, dest: "test/npm/node_modules/steal/", filter: "isFile"},
					{expand: true, src: core, dest: "test/npm-deep/node_modules/steal/", filter: "isFile"},
					{expand: true, src: core, dest: "test/npm/bower/node_modules/steal/", filter: "isFile"},
					{expand: true, src: core, dest: "test/steal-module-script/node_modules/steal/", filter: "isFile"},
					{expand: true, src: core, dest: "test/bower/bower_components/steal/", filter: "isFile"},
					{expand: true, src: core, dest: "test/bower/npm/bower_components/steal/", filter: "isFile"},
					{expand: true, src: ["node_modules/jquery/**"], dest: "test/npm/", filter: "isFile"},
					{
						expand: true,
						cwd: "node_modules/system-bower/",
						src: ["*"],
						dest: "test/bower_components/system-bower/",
						filter: "isFile"
					},
					{
						expand: true,
						cwd: "node_modules/system-bower/",
						src: ["*"],
						dest: "test/bower/bower_components/system-bower/",
						filter: "isFile"
					},
					{
						expand: true,
						cwd: "node_modules/system-bower/",
						src: ["*"],
						dest: "test/bower/with_paths/bower_components/system-bower/",
						filter: "isFile"
					},
					{
						expand: true,
						cwd: "node_modules/system-bower/",
						src: ["*"],
						dest: "test/bower/as_config/vendor/system-bower/",
						filter: "isFile"
					}
				]
			},

		},
		watch: {
			files: ["src/*.js", "node_modules/systemjs/dist/**"],
			tasks: "default"
		},
		jshint: {
			options: {
				jshintrc: ".jshintrc"
			},
			lib: ["src/**/*.js"]
		},
		testee: {
			windows: {
				options: {
					browsers: ["ie"]
				},
				src: ["test/test.html"]
			},
			tests: {
				options: {
					browsers: ["firefox"]
				},
				src: ["test/test.html", "test/unit_test.html"]
			}
		},
		simplemocha: {
			builders: {
				src: [
					"test/node_test.js",
					"test/steal_import/test.js"
				]
			}
		}
	});

	grunt.loadNpmTasks("grunt-contrib-watch");
	grunt.loadNpmTasks("grunt-contrib-concat");
	grunt.loadNpmTasks("grunt-contrib-jshint");
	grunt.loadNpmTasks("grunt-contrib-uglify");
	grunt.loadNpmTasks("grunt-contrib-copy");
	grunt.loadNpmTasks("grunt-simple-mocha");
	grunt.loadNpmTasks("grunt-release");
	grunt.loadNpmTasks("testee");

	grunt.registerTask("test", ["build", "testee:tests", "simplemocha"]);
	grunt.registerTask("test-windows", ["build", /*"testee:windows",*/ "simplemocha"]);
	grunt.registerTask("build", [/*"jshint", */"concat", "uglify", "copy:extensions", "copy:toTest"]);
	grunt.registerTask("default", ["build"]);
};
<|endoftext|>


<commit_before>// Generated on 2015-08-11 using generator-angular 0.12.1
'use strict';

module.exports = function (grunt) {
    var modRewrite = require('connect-modrewrite'),
        appConfig = {
            src: 'src',
            dist: 'dist'
        };

    // Time how long tasks take. Can help when optimizing build times
    require('time-grunt')(grunt);

    // Automatically load required Grunt tasks
    require('jit-grunt')(grunt, {
        useminPrepare: 'grunt-usemin',
        ngtemplates: 'grunt-angular-templates',
        cdnify: 'grunt-google-cdn'
    });

    // Define the configuration for all the tasks
    grunt.initConfig({

        // Project settings
        waldenrainesdotcom: appConfig,

        // Watches files for changes and runs tasks based on the changed files
        watch: {
            bower: {
                files: ['bower.json'],
                tasks: ['wiredep']
            },
            js: {
                files: ['<%= waldenrainesdotcom.src %>/app/**/*.js'],
                tasks: ['newer:jshint:all'],
                options: {
                    livereload: '<%= connect.options.livereload %>'
                }
            },
            jsTest: {
                files: ['test/unit/**/*.js'],
                tasks: ['newer:jshint:test', 'karma']
            },
            compass: {
                files: ['<%= waldenrainesdotcom.src %>/styles/{,*/}*.{scss,sass}'],
                tasks: ['compass:server', 'autoprefixer:server']
            },
            gruntfile: {
                files: ['Gruntfile.js']
            },
            livereload: {
                options: {
                    livereload: '<%= connect.options.livereload %>'
                },
                files: [
                    '<%= waldenrainesdotcom.src %>/**/*.html',
                    '.tmp/styles/{,*/}*.css',
                    '<%= waldenrainesdotcom.src %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
                ]
            }
        },

        // The actual grunt server settings
        connect: {
            options: {
                port: 9000,
                // Change this to '0.0.0.0' to access the server from outside.
                hostname: 'localhost',
                livereload: 35729
            },
            livereload: {
                options: {
                    open: true,
                    middleware: function (connect) {
                        return [
                            require('grunt-connect-proxy/lib/utils').proxyRequest,
                            modRewrite(['^[^\\.]*$ /index.html [L]']),
                            connect.static('.tmp'),
                            connect().use(
                                '/bower_components',
                                connect.static('./bower_components')
                            ),
                            connect().use(
                                '/src/styles',
                                connect.static('./src/styles')
                            ),
                            connect.static(appConfig.src)
                        ];
                    }
                }
            },
            test: {
                options: {
                    port: 9001,
                    middleware: function (connect) {
                        return [
                            connect.static('.tmp'),
                            connect.static('test'),
                            connect().use(
                                '/bower_components',
                                connect.static('./bower_components')
                            ),
                            connect.static(appConfig.src)
                        ];
                    }
                }
            },
            dist: {
                options: {
                    open: true,
                    base: '<%= waldenrainesdotcom.dist %>'
                }
            }
        },

        // Make sure code styles are up to par and there are no obvious mistakes
        jshint: {
            options: {
                jshintrc: '.jshintrc',
                reporter: require('jshint-stylish')
            },
            all: {
                src: [
                    'Gruntfile.js',
                    '<%= waldenrainesdotcom.src %>/app/{,*/}*.js'
                ]
            },
            test: {
                options: {
                    jshintrc: 'test/.jshintrc'
                },
                src: ['test/unit/{,*/}*.js']
            }
        },

        // Empties folders to start fresh
        clean: {
            dist: {
                files: [{
                    dot: true,
                    src: [
                        '.tmp',
                        '<%= waldenrainesdotcom.dist %>/{,*/}*',
                        '!<%= waldenrainesdotcom.dist %>/.git{,*/}*'
                    ]
                }]
            },
            server: '.tmp'
        },

        // Add vendor prefixed styles
        autoprefixer: {
            options: {
                browsers: ['last 1 version']
            },
            server: {
                options: {
                    map: true,
                },
                files: [{
                    expand: true,
                    cwd: '.tmp/styles/',
                    src: '{,*/}*.css',
                    dest: '.tmp/styles/'
                }]
            },
            dist: {
                files: [{
                    expand: true,
                    cwd: '.tmp/styles/',
                    src: '{,*/}*.css',
                    dest: '.tmp/styles/'
                }]
            }
        },

        // Automatically inject Bower components into the app
        wiredep: {
            src: {
                src: ['<%= waldenrainesdotcom.src %>/index.html'],
                ignorePath:  /\.\.\//
            },
            test: {
                devDependencies: true,
                src: '<%= karma.unit.configFile %>',
                ignorePath:  /\.\.\//,
                fileTypes:{
                    js: {
                        block: /(([\s\t]*)\/{2}\s*?bower:\s*?(\S*))(\n|\r|.)*?(\/{2}\s*endbower)/gi,
                        detect: {
                            js: /'(.*\.js)'/gi
                        },
                        replace: {
                            js: '\'{{filePath}}\','
                        }
                    }
                }
            },
            sass: {
                src: ['<%= waldenrainesdotcom.src %>/styles/{,*/}*.{scss,sass}'],
                ignorePath: /(\.\.\/){1,2}bower_components\//
            }
        },

        // Compiles Sass to CSS and generates necessary files if requested
        compass: {
            options: {
                sassDir: '<%= waldenrainesdotcom.src %>/styles',
                cssDir: '.tmp/styles',
                generatedImagesDir: '.tmp/images/generated',
                imagesDir: '<%= waldenrainesdotcom.src %>/images',
                javascriptsDir: '<%= waldenrainesdotcom.src %>/app',
                fontsDir: '<%= waldenrainesdotcom.src %>/styles/fonts',
                importPath: './bower_components',
                httpImagesPath: '/images',
                httpGeneratedImagesPath: '/images/generated',
                httpFontsPath: '/styles/fonts',
                relativeAssets: false,
                assetCacheBuster: false,
                raw: 'Sass::Script::Number.precision = 10\n'
            },
            dist: {
                options: {
                    fontsPath: '<%= waldenrainesdotcom.dist %>/fonts',
                    generatedImagesDir: '<%= waldenrainesdotcom.dist %>/images/generated'
                }
            },
            server: {
                options: {
                    fontsPath: 'bower_components/font-awesome/fonts/',
                    sourcemap: true
                }
            }
        },

        // Renames files for browser caching purposes
        filerev: {
            dist: {
                src: [
                    '<%= waldenrainesdotcom.dist %>/scripts/{,*/}*.js',
                    '<%= waldenrainesdotcom.dist %>/styles/{,*/}*.css',
                    '<%= waldenrainesdotcom.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
                    '<%= waldenrainesdotcom.dist %>/public/{,*/}*',
                    '<%= waldenrainesdotcom.dist %>/styles/fonts/*'
                ]
            }
        },

        // Reads HTML for usemin blocks to enable smart builds that automatically
        // concat, minify and revision files. Creates configurations in memory so
        // additional tasks can operate on them
        useminPrepare: {
            html: '<%= waldenrainesdotcom.src %>/index.html',
            options: {
                dest: '<%= waldenrainesdotcom.dist %>',
                flow: {
                    html: {
                        steps: {
                            js: ['concat', 'uglifyjs'],
                            css: ['cssmin']
                        },
                        post: {}
                    }
                }
            }
        },

        // Performs rewrites based on filerev and the useminPrepare configuration
        usemin: {
            html: ['<%= waldenrainesdotcom.dist %>/{,*/}*.html'],
            css: ['<%= waldenrainesdotcom.dist %>/styles/{,*/}*.css'],
            js: ['<%= waldenrainesdotcom.dist %>/scripts/{,*/}*.js'],
            options: {
                assetsDirs: [
                    '<%= waldenrainesdotcom.dist %>',
                    '<%= waldenrainesdotcom.dist %>/images',
                    '<%= waldenrainesdotcom.dist %>/public',
                    '<%= waldenrainesdotcom.dist %>/styles'
                ],
                patterns: {
                    js: [
                        [/(images\/[^''""]*\.(png|jpg|jpeg|gif|webp|svg))/g, 'Replacing references to images'],
                        [/(public\/[^''""]*\.*)/g, 'Replacing references to public files']
                    ]
                }
            }
        },

        imagemin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= waldenrainesdotcom.src %>/images',
                    src: '{,*/}*.{png,jpg,jpeg,gif}',
                    dest: '<%= waldenrainesdotcom.dist %>/images'
                }]
            }
        },

        svgmin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= waldenrainesdotcom.src %>/images',
                    src: '{,*/}*.svg',
                    dest: '<%= waldenrainesdotcom.dist %>/images'
                }]
            }
        },

        htmlmin: {
            dist: {
                options: {
                    collapseWhitespace: true,
                    conservativeCollapse: true,
                    collapseBooleanAttributes: true,
                    removeCommentsFromCDATA: true
                },
                files: [{
                    expand: true,
                    cwd: '<%= waldenrainesdotcom.dist %>',
                    src: ['*.html'],
                    dest: '<%= waldenrainesdotcom.dist %>'
                }]
            }
        },

        ngtemplates: {
            dist: {
                options: {
                    module: 'waldenrainesdotcom',
                    htmlmin: '<%= htmlmin.dist.options %>',
                    usemin: 'scripts/scripts.js'
                },
                cwd: '<%= waldenrainesdotcom.src %>',
                src: 'app/views/**/*.html',
                dest: '.tmp/templateCache.js'
            }
        },

        // ng-annotate tries to make the code safe for minification automatically
        // by using the Angular long form for dependency injection.
        ngAnnotate: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '.tmp/concat/scripts',
                    src: '*.js',
                    dest: '.tmp/concat/scripts'
                }]
            }
        },

        // Replace Google CDN references
        cdnify: {
            dist: {
                html: ['<%= waldenrainesdotcom.dist %>/*.html']
            }
        },

        // Copies remaining files to places other tasks can use
        copy: {
            dist: {
                files: [{
                    expand: true,
                    dot: true,
                    cwd: '<%= waldenrainesdotcom.src %>',
                    dest: '<%= waldenrainesdotcom.dist %>',
                    src: [
                        '*.{ico,png,txt}',
                        '.htaccess',
                        '*.html',
                        'images/{,*/}*.{webp}',
                        'public/{,*/}*.*',
                        'styles/fonts/{,*/}*.*'
                    ]
                }, {
                    expand: true,
                    cwd: '.tmp/images',
                    dest: '<%= waldenrainesdotcom.dist %>/images',
                    src: ['generated/*']
                }, {
                    cwd: '.',
                    expand: true,
                    flatten: true,
                    src: [
                        'bower_components/font-awesome/fonts/*.{eot,otf,svg,ttf,woff,woff2}',
                        'bower_components/bootstrap/fonts/*.{eot,otf,svg,ttf,woff,woff2}',
                        'bower_components/leaflet.locatecontrol/src/font/*.{eot,otf,svg,ttf,woff,woff2}'
                    ],
                    dest: '<%= waldenrainesdotcom.dist %>/fonts'
                }]
            },
            styles: {
                expand: true,
                cwd: '<%= waldenrainesdotcom.src %>/styles',
                dest: '.tmp/styles/',
                src: '{,*/}*.css'
            }
        },

        // Run some tasks in parallel to speed up the build process
        concurrent: {
            server: [
                'compass:server'
            ],
            test: [
                'compass'
            ],
            dist: [
                'compass:dist',
                'imagemin',
                'svgmin'
            ]
        },

        // Test settings
        karma: {
            unit: {
                configFile: 'test/karma.conf.js',
                singleRun: true
            }
        }
    });

    grunt.registerTask('serve', 'Compile then start a connect web server', function (target) {
        if (target === 'dist') {
            return grunt.task.run(['build', 'connect:dist:keepalive']);
        }

        grunt.task.run([
            'clean:server',
            'wiredep',
            'concurrent:server',
            'autoprefixer:server',
            'connect:livereload',
            'watch'
        ]);
    });

    grunt.registerTask('server', 'DEPRECATED TASK. Use the "serve" task instead', function (target) {
        grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.');
        grunt.task.run(['serve:' + target]);
    });

    grunt.registerTask('test', [
        'clean:server',
        'wiredep',
        'concurrent:test',
        'autoprefixer',
        'connect:test',
        'karma'
    ]);

    grunt.registerTask('build', [
        'clean:dist',
        'wiredep',
        'useminPrepare',
        'concurrent:dist',
        'autoprefixer',
        'ngtemplates',
        'concat',
        'ngAnnotate',
        'copy:dist',
        'cdnify',
        'cssmin',
        'uglify',
        'filerev',
        'usemin',
        'htmlmin'
    ]);

    grunt.registerTask('default', [
        'newer:jshint',
        'test',
        'build'
    ]);
};
<commit_msg>Ensure all templates are processed by ngtemplates.<commit_after>// Generated on 2015-08-11 using generator-angular 0.12.1
'use strict';

module.exports = function (grunt) {
    var modRewrite = require('connect-modrewrite'),
        appConfig = {
            src: 'src',
            dist: 'dist'
        };

    // Time how long tasks take. Can help when optimizing build times
    require('time-grunt')(grunt);

    // Automatically load required Grunt tasks
    require('jit-grunt')(grunt, {
        useminPrepare: 'grunt-usemin',
        ngtemplates: 'grunt-angular-templates',
        cdnify: 'grunt-google-cdn'
    });

    // Define the configuration for all the tasks
    grunt.initConfig({

        // Project settings
        waldenrainesdotcom: appConfig,

        // Watches files for changes and runs tasks based on the changed files
        watch: {
            bower: {
                files: ['bower.json'],
                tasks: ['wiredep']
            },
            js: {
                files: ['<%= waldenrainesdotcom.src %>/app/**/*.js'],
                tasks: ['newer:jshint:all'],
                options: {
                    livereload: '<%= connect.options.livereload %>'
                }
            },
            jsTest: {
                files: ['test/unit/**/*.js'],
                tasks: ['newer:jshint:test', 'karma']
            },
            compass: {
                files: ['<%= waldenrainesdotcom.src %>/styles/**/*.{scss,sass}'],
                tasks: ['compass:server', 'autoprefixer:server']
            },
            gruntfile: {
                files: ['Gruntfile.js']
            },
            livereload: {
                options: {
                    livereload: '<%= connect.options.livereload %>'
                },
                files: [
                    '<%= waldenrainesdotcom.src %>/**/*.html',
                    '.tmp/styles/{,*/}*.css',
                    '<%= waldenrainesdotcom.src %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}'
                ]
            }
        },

        // The actual grunt server settings
        connect: {
            options: {
                port: 9000,
                // Change this to '0.0.0.0' to access the server from outside.
                hostname: 'localhost',
                livereload: 35729
            },
            livereload: {
                options: {
                    open: true,
                    middleware: function (connect) {
                        return [
                            require('grunt-connect-proxy/lib/utils').proxyRequest,
                            modRewrite(['^[^\\.]*$ /index.html [L]']),
                            connect.static('.tmp'),
                            connect().use(
                                '/bower_components',
                                connect.static('./bower_components')
                            ),
                            connect().use(
                                '/src/styles',
                                connect.static('./src/styles')
                            ),
                            connect.static(appConfig.src)
                        ];
                    }
                }
            },
            test: {
                options: {
                    port: 9001,
                    middleware: function (connect) {
                        return [
                            connect.static('.tmp'),
                            connect.static('test'),
                            connect().use(
                                '/bower_components',
                                connect.static('./bower_components')
                            ),
                            connect.static(appConfig.src)
                        ];
                    }
                }
            },
            dist: {
                options: {
                    open: true,
                    base: '<%= waldenrainesdotcom.dist %>'
                }
            }
        },

        // Make sure code styles are up to par and there are no obvious mistakes
        jshint: {
            options: {
                jshintrc: '.jshintrc',
                reporter: require('jshint-stylish')
            },
            all: {
                src: [
                    'Gruntfile.js',
                    '<%= waldenrainesdotcom.src %>/app/**/*.js'
                ]
            },
            test: {
                options: {
                    jshintrc: 'test/.jshintrc'
                },
                src: ['test/unit/**/*.js']
            }
        },

        // Empties folders to start fresh
        clean: {
            dist: {
                files: [{
                    dot: true,
                    src: [
                        '.tmp',
                        '<%= waldenrainesdotcom.dist %>/{,*/}*',
                        '!<%= waldenrainesdotcom.dist %>/.git{,*/}*'
                    ]
                }]
            },
            server: '.tmp'
        },

        // Add vendor prefixed styles
        autoprefixer: {
            options: {
                browsers: ['last 1 version']
            },
            server: {
                options: {
                    map: true,
                },
                files: [{
                    expand: true,
                    cwd: '.tmp/styles/',
                    src: '{,*/}*.css',
                    dest: '.tmp/styles/'
                }]
            },
            dist: {
                files: [{
                    expand: true,
                    cwd: '.tmp/styles/',
                    src: '{,*/}*.css',
                    dest: '.tmp/styles/'
                }]
            }
        },

        // Automatically inject Bower components into the app
        wiredep: {
            src: {
                src: ['<%= waldenrainesdotcom.src %>/index.html'],
                ignorePath:  /\.\.\//
            },
            test: {
                devDependencies: true,
                src: '<%= karma.unit.configFile %>',
                ignorePath:  /\.\.\//,
                fileTypes:{
                    js: {
                        block: /(([\s\t]*)\/{2}\s*?bower:\s*?(\S*))(\n|\r|.)*?(\/{2}\s*endbower)/gi,
                        detect: {
                            js: /'(.*\.js)'/gi
                        },
                        replace: {
                            js: '\'{{filePath}}\','
                        }
                    }
                }
            },
            sass: {
                src: ['<%= waldenrainesdotcom.src %>/styles/{,*/}*.{scss,sass}'],
                ignorePath: /(\.\.\/){1,2}bower_components\//
            }
        },

        // Compiles Sass to CSS and generates necessary files if requested
        compass: {
            options: {
                sassDir: '<%= waldenrainesdotcom.src %>/styles',
                cssDir: '.tmp/styles',
                generatedImagesDir: '.tmp/images/generated',
                imagesDir: '<%= waldenrainesdotcom.src %>/images',
                javascriptsDir: '<%= waldenrainesdotcom.src %>/app',
                fontsDir: '<%= waldenrainesdotcom.src %>/styles/fonts',
                importPath: './bower_components',
                httpImagesPath: '/images',
                httpGeneratedImagesPath: '/images/generated',
                httpFontsPath: '/styles/fonts',
                relativeAssets: false,
                assetCacheBuster: false,
                raw: 'Sass::Script::Number.precision = 10\n'
            },
            dist: {
                options: {
                    fontsPath: '<%= waldenrainesdotcom.dist %>/fonts',
                    generatedImagesDir: '<%= waldenrainesdotcom.dist %>/images/generated'
                }
            },
            server: {
                options: {
                    fontsPath: 'bower_components/font-awesome/fonts/',
                    sourcemap: true
                }
            }
        },

        // Renames files for browser caching purposes
        filerev: {
            dist: {
                src: [
                    '<%= waldenrainesdotcom.dist %>/scripts/{,*/}*.js',
                    '<%= waldenrainesdotcom.dist %>/styles/{,*/}*.css',
                    '<%= waldenrainesdotcom.dist %>/images/{,*/}*.{png,jpg,jpeg,gif,webp,svg}',
                    '<%= waldenrainesdotcom.dist %>/public/{,*/}*',
                    '<%= waldenrainesdotcom.dist %>/styles/fonts/*'
                ]
            }
        },

        // Reads HTML for usemin blocks to enable smart builds that automatically
        // concat, minify and revision files. Creates configurations in memory so
        // additional tasks can operate on them
        useminPrepare: {
            html: '<%= waldenrainesdotcom.src %>/index.html',
            options: {
                dest: '<%= waldenrainesdotcom.dist %>',
                flow: {
                    html: {
                        steps: {
                            js: ['concat', 'uglifyjs'],
                            css: ['cssmin']
                        },
                        post: {}
                    }
                }
            }
        },

        // Performs rewrites based on filerev and the useminPrepare configuration
        usemin: {
            html: ['<%= waldenrainesdotcom.dist %>/{,*/}*.html'],
            css: ['<%= waldenrainesdotcom.dist %>/styles/{,*/}*.css'],
            js: ['<%= waldenrainesdotcom.dist %>/scripts/{,*/}*.js'],
            options: {
                assetsDirs: [
                    '<%= waldenrainesdotcom.dist %>',
                    '<%= waldenrainesdotcom.dist %>/images',
                    '<%= waldenrainesdotcom.dist %>/public',
                    '<%= waldenrainesdotcom.dist %>/styles'
                ],
                patterns: {
                    js: [
                        [/(images\/[^''""]*\.(png|jpg|jpeg|gif|webp|svg))/g, 'Replacing references to images'],
                        [/(public\/[^''""]*\.*)/g, 'Replacing references to public files']
                    ]
                }
            }
        },

        imagemin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= waldenrainesdotcom.src %>/images',
                    src: '{,*/}*.{png,jpg,jpeg,gif}',
                    dest: '<%= waldenrainesdotcom.dist %>/images'
                }]
            }
        },

        svgmin: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '<%= waldenrainesdotcom.src %>/images',
                    src: '{,*/}*.svg',
                    dest: '<%= waldenrainesdotcom.dist %>/images'
                }]
            }
        },

        htmlmin: {
            dist: {
                options: {
                    collapseWhitespace: true,
                    conservativeCollapse: true,
                    collapseBooleanAttributes: true,
                    removeCommentsFromCDATA: true
                },
                files: [{
                    expand: true,
                    cwd: '<%= waldenrainesdotcom.dist %>',
                    src: ['*.html'],
                    dest: '<%= waldenrainesdotcom.dist %>'
                }]
            }
        },

        ngtemplates: {
            dist: {
                options: {
                    module: 'waldenrainesdotcom',
                    htmlmin: '<%= htmlmin.dist.options %>',
                    usemin: 'scripts/scripts.js'
                },
                cwd: '<%= waldenrainesdotcom.src %>',
                src: 'app/**/*.html',
                dest: '.tmp/templateCache.js'
            }
        },

        // ng-annotate tries to make the code safe for minification automatically
        // by using the Angular long form for dependency injection.
        ngAnnotate: {
            dist: {
                files: [{
                    expand: true,
                    cwd: '.tmp/concat/scripts',
                    src: '*.js',
                    dest: '.tmp/concat/scripts'
                }]
            }
        },

        // Replace Google CDN references
        cdnify: {
            dist: {
                html: ['<%= waldenrainesdotcom.dist %>/*.html']
            }
        },

        // Copies remaining files to places other tasks can use
        copy: {
            dist: {
                files: [{
                    expand: true,
                    dot: true,
                    cwd: '<%= waldenrainesdotcom.src %>',
                    dest: '<%= waldenrainesdotcom.dist %>',
                    src: [
                        '*.{ico,png,txt}',
                        '.htaccess',
                        '*.html',
                        'images/{,*/}*.{webp}',
                        'public/{,*/}*.*',
                        'styles/fonts/{,*/}*.*'
                    ]
                }, {
                    expand: true,
                    cwd: '.tmp/images',
                    dest: '<%= waldenrainesdotcom.dist %>/images',
                    src: ['generated/*']
                }, {
                    cwd: '.',
                    expand: true,
                    flatten: true,
                    src: [
                        'bower_components/font-awesome/fonts/*.{eot,otf,svg,ttf,woff,woff2}',
                        'bower_components/bootstrap/fonts/*.{eot,otf,svg,ttf,woff,woff2}',
                        'bower_components/leaflet.locatecontrol/src/font/*.{eot,otf,svg,ttf,woff,woff2}'
                    ],
                    dest: '<%= waldenrainesdotcom.dist %>/fonts'
                }]
            },
            styles: {
                expand: true,
                cwd: '<%= waldenrainesdotcom.src %>/styles',
                dest: '.tmp/styles/',
                src: '{,*/}*.css'
            }
        },

        // Run some tasks in parallel to speed up the build process
        concurrent: {
            server: [
                'compass:server'
            ],
            test: [
                'compass'
            ],
            dist: [
                'compass:dist',
                'imagemin',
                'svgmin'
            ]
        },

        // Test settings
        karma: {
            unit: {
                configFile: 'test/karma.conf.js',
                singleRun: true
            }
        }
    });

    grunt.registerTask('serve', 'Compile then start a connect web server', function (target) {
        if (target === 'dist') {
            return grunt.task.run(['build', 'connect:dist:keepalive']);
        }

        grunt.task.run([
            'clean:server',
            'wiredep',
            'concurrent:server',
            'autoprefixer:server',
            'connect:livereload',
            'watch'
        ]);
    });

    grunt.registerTask('server', 'DEPRECATED TASK. Use the "serve" task instead', function (target) {
        grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.');
        grunt.task.run(['serve:' + target]);
    });

    grunt.registerTask('test', [
        'clean:server',
        'wiredep',
        'concurrent:test',
        'autoprefixer',
        'connect:test',
        'karma'
    ]);

    grunt.registerTask('build', [
        'clean:dist',
        'wiredep',
        'useminPrepare',
        'concurrent:dist',
        'autoprefixer',
        'ngtemplates',
        'concat',
        'ngAnnotate',
        'copy:dist',
        'cdnify',
        'cssmin',
        'uglify',
        'filerev',
        'usemin',
        'htmlmin'
    ]);

    grunt.registerTask('default', [
        'newer:jshint',
        'test',
        'build'
    ]);
};
<|endoftext|>


<commit_before>#!/usr/bin/env node

/*!
 * Sequomics® [v1.0.0]
 * ______________________________________________________________
 * Grunt, http://gruntjs.com/
 * The JavaScript Task Runner.
 * ______________________________________________________________
 * Architecture and Code Handcrafted by Prabhat Kumar.
 * Architectuur en Code handgemaakt door Prabhat Kumar.
 * @author    : Prabhat Kumar [http://prabhatkumar.org/]
 * @copyright : Sequømics Corporation [http://sequomics.com/]
 * ______________________________________________________________
 * @date      : 20-Jan-2016
 * @license   : Apache, version 2.0
 * @require   : Node.js®
 * @require   : NPM
 * ______________________________________________________________
 *
 * --/The Heart of Build System/-- of "Sequomics®".
 * ______________________________________________________________
 */

// # Usage: $ node -v
// # Usage: $ npm -v

// =========================
// Grunt Module(s) Required.
// =========================
// main module.
// @require   : grunt
// @require   : grunt-cli

// BUILD MODULE
// ============
// @require   : assemble

// Note: To import project metadata into the -/Grunt/- config.
// @require   : bower.json
// @require   : package.json
// @require   : _config.yml

// ====================================
// Grunt Task Registration through API.
// ====================================
<commit_msg>Initial commit<commit_after>#!/usr/bin/env node

/*!
 * Sequomics® [v1.0.0]
 * ______________________________________________________________
 * Grunt, http://gruntjs.com/
 * The JavaScript Task Runner.
 * ______________________________________________________________
 * Architecture and Code Handcrafted by Prabhat Kumar.
 * Architectuur en Code handgemaakt door Prabhat Kumar.
 * @author    : Prabhat Kumar [http://prabhatkumar.org/]
 * @copyright : Sequømics Corporation [http://sequomics.com/]
 * ______________________________________________________________
 * @date      : 20-Jan-2016
 * @license   : Apache, version 2.0
 * @require   : Node.js®
 * @require   : NPM
 * ______________________________________________________________
 *
 * --/The Heart of Build System/-- of "Sequomics®".
 * ______________________________________________________________
 */

// # Usage: $ node -v
// # Usage: $ npm -v

// =========================
// Grunt Module(s) Required.
// =========================
// main module.
// @require   : grunt
// @require   : grunt-cli

// BUILD MODULE
// ============
// @require   : assemble

// Note: To import project metadata into the -/Grunt/- config.
// @require   : bower.json
// @require   : package.json
// @require   : _config.yml

// ====================================
// Grunt Task Registration through API.
// ====================================
// @method    : grunt.loadNpmTasks(pluginName)
// @method    : grunt.registerTask(task-name)
<|endoftext|>


<commit_before>/**!
Gruntfile to perform wwt webclient less compilation,
script concatenation/minification, and component updates
(using grunt bower:install)

Once you have run npm install and npm update
and bower is installed (npm install -g bower)
run grunt watch

**/

module.exports = function(grunt) {
    'use strict';

    // Force use of Unix newlines
    grunt.util.linefeed = '\n';

    RegExp.quote = function(string) {
        return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&');
    };

    // Project configuration.
    grunt.initConfig({
        deployLoc: '../../wwtmvc5/WWTMVC5/webclient/',
        pkg: grunt.file.readJSON('package.json'),
        banner: '/**\n' +
            '* WorldWide Telescope Web Client\n' +
            '* Copyright 2014-2015 Microsoft Research\n' +
            '* Developed by Jonathan Fay and Ron Gilchrist\n' +
            '* Licensed under <%= pkg.license.type %> (<%= pkg.license.url %>)\n' +
            '**/\n',

        // Task configuration.
        clean: {
            deployLoc: '<%=deployLoc%>'
        },
        concat: {
            options: {
                banner: '<%= banner %>'
            },
            webclient: {
                src: [
                    'ext/jquery.js',
                    'ext/bootstrap.js',
                    'ext/angular.js',
                    'ext/angular-touch.js',
                    'ext/angular-route.js',
                    'ext/angular-animate.js',
                    'ext/angular-cookies.js',
                    'ext/angular-strap.js',
                    'ext/angular-strap.tpl.js',
                    'ext/intro.js',
                    'ext/angular-intro.js',
                    'app.js',
                    'directives/Scroll.js',
                    'directives/Localize.js',
                    'directives/ContextMenu.js',
                    'factories/appstate.js',
                    'factories/localization.js',
                    'factories/FinderScope.js',
                    'factories/ThumbList.js',
                    'factories/Util.js',
                    'factories/UILibrary.js',
                    'factories/SearchUtil.js',
                    'factories/Skyball.js',
                    'factories/HashManager.js',
                    'dataproxy/Places.js',
                    'dataproxy/Tours.js',
                    'dataproxy/SearchData.js',
                    'dataproxy/Astrometry.js',
                    'controllers/ContextPanelController.js',
                    'controllers/MainController.js',
                    'controllers/IntroController.js',
                    'controllers/MobileNavController.js',
                    'controllers/LayerManagerController.js',
                    'controllers/tabs/AdsController.js',
                    'controllers/tabs/ExploreController.js',
                    'controllers/tabs/SearchController.js',
                    'controllers/tabs/SettingsController.js',
                    'controllers/tabs/ViewController.js',
                    'controllers/tabs/ToursController.js',
                    'controllers/modals/ShareController.js',
                    'controllers/modals/OpenItemController.js',
                    'controllers/modals/ObservingTimeController.js',
                    'controls/move.js',
                    'controls/util.js'
                ],
                dest: 'wwtwebclient.js'
            },
            sdk: {
                src: [
                    'sdk/ss.js',
                    'sdk/wwtlib.js'
                ],
                dest: 'sdk/wwtsdk.js'
            },
            oldsdk: {
                src: [
                    'sdk/old/mscorlib.debug.js',
                    'sdk/old/wwtlib.debug.js'
                ],
                dest: 'sdk/old/wwtlib_full.js'
            }
        },
        //remove the AMD dependancy from scriptsharp output
        replace: {
            wwtlib: {
                src: ['sdk/wwtlib.js'],
                dest: 'sdk/wwtlib.js',
                replacements: [
                    {
                        from: "define('wwtlib', ['ss'], function(ss) {",
                        to: 'window.wwtlib = function(){'
                    }, {
                        from: 'return $exports;\n});',
                        to: 'return $exports;\n}();'
                    }
                ]
            }
        },

        uglify: {
            options: {
                preserveComments: 'some',
                banner: '<%= banner %>'
            },
            webclient: {
                src: '<%= concat.webclient.dest %>',
                dest: 'wwtwebclient.min.js'
            },
            searchData: {
                src: 'searchdataraw.js',
                dest: 'searchdata.min.js'
            },
            sdk: {
                src: '<%= concat.sdk.dest %>',
                dest: 'sdk/wwtsdk.min.js'
            },
            oldsdk: {
                src: '<%= concat.oldsdk.dest %>',
                dest: 'sdk/old/wwtlib_full.min.js'
            }
        },
        less: {
            compileCore: {
                options: {
                    strictMath: true,
                    sourceMap: true,
                    outputSourceFiles: true,
                    sourceMapURL: 'webclient.css.map',
                    sourceMapFilename: 'css/webclient.css.map'
                },
                src: 'css/webclient.less',
                dest: 'css/webclient.css'
            }
        },
        autoprefixer: {
            options: {
                browsers: [
                    "Android 2.3",
                    "Android >= 4",
                    "Chrome >= 20",
                    "Firefox >= 24",
                    "Explorer >= 10",
                    "iOS >= 6",
                    "Opera >= 12",
                    "Safari >= 6"
                ]
            },
            core: {
                options: {
                    map: true
                },
                src: 'css/webclient.css'
            }
        },
        cssmin: {
            options: {
                compatibility: 'ie10',
                keepSpecialComments: '*',
                noAdvanced: true
            },
            minifyCore: {
                src: 'css/webclient.css',
                dest: 'css/webclient.min.css'
            }
        },
        csscomb: {
            options: {
                config: 'bootstrap/less/.csscomb.json'
            },
            dist: {
                expand: true,
                cwd: 'css/',
                src: ['*.css', '!*.min.css'],
                dest: 'css/'
            }
        },
        copy: {
            vendor: {
                files: [
                    {
                        expand: true,
                        flatten: true,
                        src: 'bower_components/jquery/dist/jquery.js',
                        dest: 'ext/'
                    }, {
                        dest: 'ext/',
                        expand: true,
                        flatten: true,
                        src: 'bower_components/bootstrap/dist/js/bootstrap.js'
                    }, {
                        dest: 'ext/',
                        expand: true,
                        flatten: true,
                        src: 'bower_components/angular/angular.js'
                    },
                    {
                        dest: 'ext/',
                        expand: true,
                        flatten: true,
                        src: 'bower_components/angular-touch/angular-touch.js'
                    },
                    {
                        dest: 'ext/',
                        expand: true,
                        flatten: true,
                        src: 'bower_components/angular-route/angular-route.js'
                    },
                    {
                        dest: 'ext/',
                        expand: true,
                        flatten: true,
                        src: 'bower_components/angular-animate/angular-animate.js'
                    },{
                        dest: 'ext/',
                        expand: true,
                        flatten: true,
                        src: 'bower_components/angular-cookies/angular-cookies.js'
                    }, {
                        dest: 'ext/',
                        expand: true,
                        flatten: true,
                        src: 'bower_components/angular-strap/dist/angular-strap.js'
                    }, {
                        dest: 'ext/',
                        expand: true,
                        flatten: true,
                        src: 'bower_components/angular-strap/dist/angular-strap.tpl.js'
                    }, {
                        cwd: 'bower_components/bootstrap/less/',
                        src: '**/*',
                        dest: 'bootstrap/less/',
                        expand: true
                    }
                ]
            },
            webclient: {
                files: [
                    {
                        cwd: 'App_Data/',
                        src: '**/*',
                        dest: '<%= deployLoc %>App_Data/',
                        expand: true
                    }, {
                        cwd: 'Bin/',
                        src: '**/*',
                        dest: '<%= deployLoc %>Bin/',
                        expand: true
                    }, {
                        cwd: 'clientbin/',
                        src: '**/*',
                        dest: '<%= deployLoc %>clientbin/',
                        expand: true
                    }, {
                        cwd: 'controllers/',
                        src: '**/*',
                        dest: '<%= deployLoc %>controllers/',
                        expand: true
                    }, {
                        cwd: 'controls/',
                        src: '**',
                        dest: '<%= deployLoc %>controls/',
                        expand: true
                    }, {
                        cwd: 'css/',
                        src: '*.css',
                        dest: '<%= deployLoc %>css/',
                        expand: true
                    }, {
                        cwd: 'css/',
                        src: '*.map',
                        dest: '<%= deployLoc %>css/',
                        expand: true
                    }, {
                        cwd: 'dataproxy/',
                        src: '**',
                        dest: '<%= deployLoc %>dataproxy/',
                        expand: true
                    }, {
                        cwd: 'directives/',
                        src: '**',
                        dest: '<%= deployLoc %>directives/',
                        expand: true
                    }, {
                        cwd: 'ext/',
                        src: '**/*',
                        dest: '<%= deployLoc %>ext/',
                        expand: true
                    }, {
                        cwd: 'factories/',
                        src: '**/*',
                        dest: '<%= deployLoc %>factories/',
                        expand: true
                    }, {
                        cwd: 'images/',
                        src: '**/*',
                        dest: '<%= deployLoc %>images/',
                        expand: true
                    }, {
                        cwd: 'sdk/',
                        src: '*.js',
                        dest: '<%= deployLoc %>sdk/',
                        expand: true
                    }, {
                        cwd: 'sdk/',
                        src: '*.aspx',
                        dest: '<%= deployLoc %>sdk/',
                        expand: true
                    }, {
                        cwd: 'views/',
                        src: '**/*',
                        dest: '<%= deployLoc %>views/',
                        expand: true
                    }, {
                        cwd: '',
                        src: ['*.jpg', '*.png', '*.asax', '*.cs', '*.aspx', '*.ico', '*.js', '*.xap', '*.xml', '*.wtml'],
                        dest: '<%= deployLoc %>',
                        expand: true
                    }
                ]
            }
        },
        watch: {
            sdk: {
                files: 'sdk/wwtlib.js',
                tasks: ['sdk', 'deploy']
            },

            // call out only the directories to watch prevents
            // watch from watching recursive node_modules folders e.g.: '../**/*.js'
            scripts: {
                files: [
                    'controllers/**/*.js',
                    'controllers/*.js',
                    'controls/*.js',
                    'directives/*.js',
                    'dataproxy/*.js',
                    'factories/*.js',
                    'app.js'],
                tasks: ['dist-js', 'deploy']
            },
            vendor: { // will be triggered by 'bower install' when it finds updates
                files: [
                    'bower_components/jquery/dist/jquery.js',
                    'bower_components/bootstrap/dist/js/bootstrap.js',
                    'bower_components/angular/angular.js',
                    'bower_components/angular-strap/dist/angular-strap.js'
                ],
                tasks: ['vendor']
            },

            html: {
                files: [
                    'views/**/*.html',
                    'Default.aspx'
                ],
                tasks: ['deploy']
            },
            less: {
                files: 'css/*.less',
                tasks: ['dist-css', 'deploy']
            }
        },
        bower: {
            install: {
                options: {
                    targetDir:'bower_components',
                    install: true,
                    verbose: true,
                    cleanTargetDir: false,
                    cleanBowerDir: false,
                    bowerOptions: {}
                }
            }
        }
    });

    // Dependencies
    require('load-grunt-tasks')(grunt, { scope: 'devDependencies' });

    // JS concatenation and minification
    grunt.registerTask('dist-js', ['concat:webclient', 'uglify:webclient']);

    // Takes HTML5SDK generated script and packages into single usable lib. (scriptsharp v0.8).
    grunt.registerTask('sdk', ['replace:wwtlib', 'concat:sdk', 'uglify:sdk']);

    // Minify the generated search data (rare - internal only)
    grunt.registerTask('dist-searchdata', ['uglify:searchData']);

    // CSS  (csscomb seems like too much, so commented out for now)
    grunt.registerTask('dist-css', ['less:compileCore', 'autoprefixer:core', /*'csscomb:dist',*/'cssmin:minifyCore']);

    // Vendor JS libs
    grunt.registerTask('vendor', ['copy:vendor','dist-js','dist-css','deploy']);

    // Deploy to wwt web site (internal only)
    grunt.registerTask('deploy', ['copy:webclient']);

    // uncomment out the below task and comment out the above task to run locally
    //grunt.registerTask('deploy', []);
};
<commit_msg>changed banner text<commit_after>/**!
Gruntfile to perform wwt webclient less compilation,
script concatenation/minification, and component updates
(using grunt bower:install)

Once you have run npm install and npm update
and bower is installed (npm install -g bower)
run grunt watch

**/

module.exports = function(grunt) {
    'use strict';

    // Force use of Unix newlines
    grunt.util.linefeed = '\n';

    RegExp.quote = function(string) {
        return string.replace(/[-\\^$*+?.()|[\]{}]/g, '\\$&');
    };

    // Project configuration.
    grunt.initConfig({
        deployLoc: '../../wwtmvc5/WWTMVC5/webclient/',
        pkg: grunt.file.readJSON('package.json'),
        banner: '/**\n' +
            '* WorldWide Telescope Web Client\n' +
            '* Copyright 2014-2015 Microsoft Research\n' +
            '* Licensed under <%= pkg.license.type %> (<%= pkg.license.url %>)\n' +
            '**/\n',

        // Task configuration.
        clean: {
            deployLoc: '<%=deployLoc%>'
        },
        concat: {
            options: {
                banner: '<%= banner %>'
            },
            webclient: {
                src: [
                    'ext/jquery.js',
                    'ext/bootstrap.js',
                    'ext/angular.js',
                    'ext/angular-touch.js',
                    'ext/angular-route.js',
                    'ext/angular-animate.js',
                    'ext/angular-cookies.js',
                    'ext/angular-strap.js',
                    'ext/angular-strap.tpl.js',
                    'ext/intro.js',
                    'ext/angular-intro.js',
                    'app.js',
                    'directives/Scroll.js',
                    'directives/Localize.js',
                    'directives/ContextMenu.js',
                    'factories/appstate.js',
                    'factories/localization.js',
                    'factories/FinderScope.js',
                    'factories/ThumbList.js',
                    'factories/Util.js',
                    'factories/UILibrary.js',
                    'factories/SearchUtil.js',
                    'factories/Skyball.js',
                    'factories/HashManager.js',
                    'dataproxy/Places.js',
                    'dataproxy/Tours.js',
                    'dataproxy/SearchData.js',
                    'dataproxy/Astrometry.js',
                    'controllers/ContextPanelController.js',
                    'controllers/MainController.js',
                    'controllers/IntroController.js',
                    'controllers/MobileNavController.js',
                    'controllers/LayerManagerController.js',
                    'controllers/tabs/AdsController.js',
                    'controllers/tabs/ExploreController.js',
                    'controllers/tabs/SearchController.js',
                    'controllers/tabs/SettingsController.js',
                    'controllers/tabs/ViewController.js',
                    'controllers/tabs/ToursController.js',
                    'controllers/modals/ShareController.js',
                    'controllers/modals/OpenItemController.js',
                    'controllers/modals/ObservingTimeController.js',
                    'controls/move.js',
                    'controls/util.js'
                ],
                dest: 'wwtwebclient.js'
            },
            sdk: {
                src: [
                    'sdk/ss.js',
                    'sdk/wwtlib.js'
                ],
                dest: 'sdk/wwtsdk.js'
            },
            oldsdk: {
                src: [
                    'sdk/old/mscorlib.debug.js',
                    'sdk/old/wwtlib.debug.js'
                ],
                dest: 'sdk/old/wwtlib_full.js'
            }
        },
        //remove the AMD dependancy from scriptsharp output
        replace: {
            wwtlib: {
                src: ['sdk/wwtlib.js'],
                dest: 'sdk/wwtlib.js',
                replacements: [
                    {
                        from: "define('wwtlib', ['ss'], function(ss) {",
                        to: 'window.wwtlib = function(){'
                    }, {
                        from: 'return $exports;\n});',
                        to: 'return $exports;\n}();'
                    }
                ]
            }
        },

        uglify: {
            options: {
                preserveComments: 'some',
                banner: '<%= banner %>'
            },
            webclient: {
                src: '<%= concat.webclient.dest %>',
                dest: 'wwtwebclient.min.js'
            },
            searchData: {
                src: 'searchdataraw.js',
                dest: 'searchdata.min.js'
            },
            sdk: {
                src: '<%= concat.sdk.dest %>',
                dest: 'sdk/wwtsdk.min.js'
            },
            oldsdk: {
                src: '<%= concat.oldsdk.dest %>',
                dest: 'sdk/old/wwtlib_full.min.js'
            }
        },
        less: {
            compileCore: {
                options: {
                    strictMath: true,
                    sourceMap: true,
                    outputSourceFiles: true,
                    sourceMapURL: 'webclient.css.map',
                    sourceMapFilename: 'css/webclient.css.map'
                },
                src: 'css/webclient.less',
                dest: 'css/webclient.css'
            }
        },
        autoprefixer: {
            options: {
                browsers: [
                    "Android 2.3",
                    "Android >= 4",
                    "Chrome >= 20",
                    "Firefox >= 24",
                    "Explorer >= 10",
                    "iOS >= 6",
                    "Opera >= 12",
                    "Safari >= 6"
                ]
            },
            core: {
                options: {
                    map: true
                },
                src: 'css/webclient.css'
            }
        },
        cssmin: {
            options: {
                compatibility: 'ie10',
                keepSpecialComments: '*',
                noAdvanced: true
            },
            minifyCore: {
                src: 'css/webclient.css',
                dest: 'css/webclient.min.css'
            }
        },
        csscomb: {
            options: {
                config: 'bootstrap/less/.csscomb.json'
            },
            dist: {
                expand: true,
                cwd: 'css/',
                src: ['*.css', '!*.min.css'],
                dest: 'css/'
            }
        },
        copy: {
            vendor: {
                files: [
                    {
                        expand: true,
                        flatten: true,
                        src: 'bower_components/jquery/dist/jquery.js',
                        dest: 'ext/'
                    }, {
                        dest: 'ext/',
                        expand: true,
                        flatten: true,
                        src: 'bower_components/bootstrap/dist/js/bootstrap.js'
                    }, {
                        dest: 'ext/',
                        expand: true,
                        flatten: true,
                        src: 'bower_components/angular/angular.js'
                    },
                    {
                        dest: 'ext/',
                        expand: true,
                        flatten: true,
                        src: 'bower_components/angular-touch/angular-touch.js'
                    },
                    {
                        dest: 'ext/',
                        expand: true,
                        flatten: true,
                        src: 'bower_components/angular-route/angular-route.js'
                    },
                    {
                        dest: 'ext/',
                        expand: true,
                        flatten: true,
                        src: 'bower_components/angular-animate/angular-animate.js'
                    },{
                        dest: 'ext/',
                        expand: true,
                        flatten: true,
                        src: 'bower_components/angular-cookies/angular-cookies.js'
                    }, {
                        dest: 'ext/',
                        expand: true,
                        flatten: true,
                        src: 'bower_components/angular-strap/dist/angular-strap.js'
                    }, {
                        dest: 'ext/',
                        expand: true,
                        flatten: true,
                        src: 'bower_components/angular-strap/dist/angular-strap.tpl.js'
                    }, {
                        cwd: 'bower_components/bootstrap/less/',
                        src: '**/*',
                        dest: 'bootstrap/less/',
                        expand: true
                    }
                ]
            },
            webclient: {
                files: [
                    {
                        cwd: 'App_Data/',
                        src: '**/*',
                        dest: '<%= deployLoc %>App_Data/',
                        expand: true
                    }, {
                        cwd: 'Bin/',
                        src: '**/*',
                        dest: '<%= deployLoc %>Bin/',
                        expand: true
                    }, {
                        cwd: 'clientbin/',
                        src: '**/*',
                        dest: '<%= deployLoc %>clientbin/',
                        expand: true
                    }, {
                        cwd: 'controllers/',
                        src: '**/*',
                        dest: '<%= deployLoc %>controllers/',
                        expand: true
                    }, {
                        cwd: 'controls/',
                        src: '**',
                        dest: '<%= deployLoc %>controls/',
                        expand: true
                    }, {
                        cwd: 'css/',
                        src: '*.css',
                        dest: '<%= deployLoc %>css/',
                        expand: true
                    }, {
                        cwd: 'css/',
                        src: '*.map',
                        dest: '<%= deployLoc %>css/',
                        expand: true
                    }, {
                        cwd: 'dataproxy/',
                        src: '**',
                        dest: '<%= deployLoc %>dataproxy/',
                        expand: true
                    }, {
                        cwd: 'directives/',
                        src: '**',
                        dest: '<%= deployLoc %>directives/',
                        expand: true
                    }, {
                        cwd: 'ext/',
                        src: '**/*',
                        dest: '<%= deployLoc %>ext/',
                        expand: true
                    }, {
                        cwd: 'factories/',
                        src: '**/*',
                        dest: '<%= deployLoc %>factories/',
                        expand: true
                    }, {
                        cwd: 'images/',
                        src: '**/*',
                        dest: '<%= deployLoc %>images/',
                        expand: true
                    }, {
                        cwd: 'sdk/',
                        src: '*.js',
                        dest: '<%= deployLoc %>sdk/',
                        expand: true
                    }, {
                        cwd: 'sdk/',
                        src: '*.aspx',
                        dest: '<%= deployLoc %>sdk/',
                        expand: true
                    }, {
                        cwd: 'views/',
                        src: '**/*',
                        dest: '<%= deployLoc %>views/',
                        expand: true
                    }, {
                        cwd: '',
                        src: ['*.jpg', '*.png', '*.asax', '*.cs', '*.aspx', '*.ico', '*.js', '*.xap', '*.xml', '*.wtml'],
                        dest: '<%= deployLoc %>',
                        expand: true
                    }
                ]
            }
        },
        watch: {
            sdk: {
                files: 'sdk/wwtlib.js',
                tasks: ['sdk', 'deploy']
            },

            // call out only the directories to watch prevents
            // watch from watching recursive node_modules folders e.g.: '../**/*.js'
            scripts: {
                files: [
                    'controllers/**/*.js',
                    'controllers/*.js',
                    'controls/*.js',
                    'directives/*.js',
                    'dataproxy/*.js',
                    'factories/*.js',
                    'app.js'],
                tasks: ['dist-js', 'deploy']
            },
            vendor: { // will be triggered by 'bower install' when it finds updates
                files: [
                    'bower_components/jquery/dist/jquery.js',
                    'bower_components/bootstrap/dist/js/bootstrap.js',
                    'bower_components/angular/angular.js',
                    'bower_components/angular-strap/dist/angular-strap.js'
                ],
                tasks: ['vendor']
            },

            html: {
                files: [
                    'views/**/*.html',
                    'Default.aspx'
                ],
                tasks: ['deploy']
            },
            less: {
                files: 'css/*.less',
                tasks: ['dist-css', 'deploy']
            }
        },
        bower: {
            install: {
                options: {
                    targetDir:'bower_components',
                    install: true,
                    verbose: true,
                    cleanTargetDir: false,
                    cleanBowerDir: false,
                    bowerOptions: {}
                }
            }
        }
    });

    // Dependencies
    require('load-grunt-tasks')(grunt, { scope: 'devDependencies' });

    // JS concatenation and minification
    grunt.registerTask('dist-js', ['concat:webclient', 'uglify:webclient']);

    // Takes HTML5SDK generated script and packages into single usable lib. (scriptsharp v0.8).
    grunt.registerTask('sdk', ['replace:wwtlib', 'concat:sdk', 'uglify:sdk']);

    // Minify the generated search data (rare - internal only)
    grunt.registerTask('dist-searchdata', ['uglify:searchData']);

    // CSS  (csscomb seems like too much, so commented out for now)
    grunt.registerTask('dist-css', ['less:compileCore', 'autoprefixer:core', /*'csscomb:dist',*/'cssmin:minifyCore']);

    // Vendor JS libs
    grunt.registerTask('vendor', ['copy:vendor','dist-js','dist-css','deploy']);

    // Deploy to wwt web site (internal only)
    grunt.registerTask('deploy', ['copy:webclient']);

    // uncomment out the below task and comment out the above task to run locally
    //grunt.registerTask('deploy', []);
};
<|endoftext|>


<commit_before>export default {
  prototypeBy: 'На основе',
  name: 'Название',
  type: 'Тип',
  isNull: 'Null',
  defaultValue: 'Значение по умолчанию',
  typeName: {
    stringControlType: 'Строка',
    numberControlType: 'Число',
    boolControlType: 'Чекбокс',
    dateControlType: 'Дата/время',
    fileControlType: 'Файл',
    drowdownControlType: 'Выпадающий список',
    lookupControlType: 'Лукап',
  }
};
<commit_msg>Fix translations<commit_after>export default {
  prototypeBy: 'На основе',
  name: 'Название',
  type: 'Тип',
  isNull: 'Null',
  defaultValue: 'Значение по умолчанию',
  typeName: {
    stringControlType: 'string',
    boolControlType: 'bool',
    charControlType: 'char',
    guidControlType: 'guid',
    decimalControlType: 'decimal',
    doubleControlType: 'double',
    floatControlType: 'float',
    sbyteControlType: 'sbyte',
    shortControlType: 'short',
    byteControlType: 'byte',
    intControlType: 'int',
    longControlType: 'long',
    uintControlType: 'uint',
    ushortControlType: 'ushort',
    ulongControlType: 'ulong',
    dateControlType: 'Дата/время',
    fileControlType: 'Файл',
    drowdownControlType: 'dropdown',
    lookupControlType: 'lookup',
  }
};
<|endoftext|>


<commit_before>module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    kendoVersion: '2013.1.319',
    pkg: grunt.file.readJSON('package.json'),
    filename: 'kiui',
    commons: {
      banner: '/*\n' +
              ' * <%= pkg.name %> v<%= pkg.version %> (https://github.com/redaemn/KiUI)\n' +
              ' * <%= grunt.template.today("yyyy-mm-dd") %>\n' +
              ' * Author: <%= pkg.author %>\n' +
              ' */\n'
    },
    concat: {
      dist: {
        options: {
          banner: '<%= commons.banner %>'
        },
        src: ['src/**/*.js'],
        dest: 'dist/<%= filename %>-<%= pkg.version %>.js'
      }
    },
    uglify: {
      dist:{
        options: {
          banner: '<%= commons.banner %>'
        },
        src:['dist/<%= filename %>-<%= pkg.version %>.js'],
        dest:'dist/<%= filename %>-<%= pkg.version %>.min.js'
      }
    },
    jshint: {
      dist: ['Gruntfile.js','src/**/*.js'],
      demoSite: ['demo/**/*.js']
    },
    karma: {
      singleRun: {
        configFile: 'karma.conf.js',
        singleRun: true
      },
      coverage: {
        configFile: 'karma.conf.js',
        singleRun: true,
        preprocessors: {
          'src/**/*.js': 'coverage'
        },
        reporters: ['progress', 'coverage'],
        coverageReporter: {
          type : 'html',
          dir : 'coverage/'
        }
      },
      watch: {
        configFile: 'karma.conf.js',
        autoWatch: true
      }
    },
    copy: {
      demoSite: {
        options: {
          processContent: grunt.template.process
        },
        files: [{
          expand: true,
          cwd: "misc/demoSite",
          src: ["*"],
          dest: "dist/"
        }]
      }
    },
    demoSite: {
      // will be filled by the 'demoSite' task
      features: {}
    }
  });

  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-karma');
  grunt.loadNpmTasks('grunt-contrib-copy');

  /****************************************
   * Default task
   ****************************************/

  grunt.registerTask('default', ['jshint:dist', 'karma:singleRun', 'concat:dist', 'uglify:dist']);

  /****************************************
   * Demo Site Task
   ****************************************/

  grunt.registerTask('demoSite', 'Build the demo site, based on the current sources', function() {
    var features = {};

    function camelCaseToSpace(text) {
      return text.replace(/[A-Z]/g, function(match) {
        return(' ' + match);
      });
    }

    function ucwords(text) {
      return text.replace(/^([a-z])|\s+([a-z])/g, function ($1) {
        return $1.toUpperCase();
      });
    }

    function updateFeatures(file) {
                    // group/feature/fileName
      var matches = /^([^\/]+)\/([^\/]+)\//g.exec(file),
        group = matches[1],
        groupDisplayName = ucwords(camelCaseToSpace(group)),
        feature = matches[2],
        featureDisplayName = ucwords(camelCaseToSpace(feature)),
        fileContent = grunt.file.read("demo/" + file),
        groupDescriptor = {
          displayName: groupDisplayName,
          features: {}
        },
        featureDescriptor = {
          displayName: featureDisplayName,
          html: "",
          js: "",
          readme: ""
        };

      if (!features[group]) {
        features[group] = groupDescriptor;
      }
      else {
        groupDescriptor = features[group];
      }

      if (!groupDescriptor.features[feature]) {
        groupDescriptor.features[feature] = featureDescriptor;
      }
      else {
        featureDescriptor = groupDescriptor.features[feature];
      }

      if (/demo\.js$/.test(file)) {
        featureDescriptor.js = fileContent;
      }
      else if (/demo\.html$/.test(file)) {
        featureDescriptor.html = fileContent;
      }
      else if (/readme\.html$/.test(file)) {
        featureDescriptor.readme = fileContent;
      }
    }

    grunt.file.expand({
      filter: 'isFile',
      cwd: "demo/"
    }, '**/*').forEach(updateFeatures);

    grunt.log.writeln(JSON.stringify(features));
    grunt.config('demoSite.features', features);

    grunt.task.run(['jshint:demoSite', 'copy:demoSite']);
  });
};
<commit_msg>chore(grunt): remove debug log and add operation info log<commit_after>module.exports = function(grunt) {

  // Project configuration.
  grunt.initConfig({
    kendoVersion: '2013.1.319',
    pkg: grunt.file.readJSON('package.json'),
    filename: 'kiui',
    commons: {
      banner: '/*\n' +
              ' * <%= pkg.name %> v<%= pkg.version %> (https://github.com/redaemn/KiUI)\n' +
              ' * <%= grunt.template.today("yyyy-mm-dd") %>\n' +
              ' * Author: <%= pkg.author %>\n' +
              ' */\n'
    },
    concat: {
      dist: {
        options: {
          banner: '<%= commons.banner %>'
        },
        src: ['src/**/*.js'],
        dest: 'dist/<%= filename %>-<%= pkg.version %>.js'
      }
    },
    uglify: {
      dist:{
        options: {
          banner: '<%= commons.banner %>'
        },
        src:['dist/<%= filename %>-<%= pkg.version %>.js'],
        dest:'dist/<%= filename %>-<%= pkg.version %>.min.js'
      }
    },
    jshint: {
      dist: ['Gruntfile.js','src/**/*.js'],
      demoSite: ['demo/**/*.js']
    },
    karma: {
      singleRun: {
        configFile: 'karma.conf.js',
        singleRun: true
      },
      coverage: {
        configFile: 'karma.conf.js',
        singleRun: true,
        preprocessors: {
          'src/**/*.js': 'coverage'
        },
        reporters: ['progress', 'coverage'],
        coverageReporter: {
          type : 'html',
          dir : 'coverage/'
        }
      },
      watch: {
        configFile: 'karma.conf.js',
        autoWatch: true
      }
    },
    copy: {
      demoSite: {
        options: {
          processContent: grunt.template.process
        },
        files: [{
          expand: true,
          cwd: "misc/demoSite",
          src: ["*"],
          dest: "dist/"
        }]
      }
    },
    demoSite: {
      // will be filled by the 'demoSite' task
      features: {}
    }
  });

  grunt.loadNpmTasks('grunt-contrib-concat');
  grunt.loadNpmTasks('grunt-contrib-jshint');
  grunt.loadNpmTasks('grunt-contrib-uglify');
  grunt.loadNpmTasks('grunt-karma');
  grunt.loadNpmTasks('grunt-contrib-copy');

  /****************************************
   * Default task
   ****************************************/

  grunt.registerTask('default', ['jshint:dist', 'karma:singleRun', 'concat:dist', 'uglify:dist']);

  /****************************************
   * Demo Site Task
   ****************************************/

  grunt.registerTask('demoSite', 'Build the demo site, based on the current sources', function() {
    var features = {};

    function camelCaseToSpace(text) {
      return text.replace(/[A-Z]/g, function(match) {
        return(' ' + match);
      });
    }

    function ucwords(text) {
      return text.replace(/^([a-z])|\s+([a-z])/g, function ($1) {
        return $1.toUpperCase();
      });
    }

    function updateFeatures(file) {
                    // group/feature/fileName
      var matches = /^([^\/]+)\/([^\/]+)\//g.exec(file),
        group = matches[1],
        groupDisplayName = ucwords(camelCaseToSpace(group)),
        feature = matches[2],
        featureDisplayName = ucwords(camelCaseToSpace(feature)),
        fileContent = grunt.file.read("demo/" + file),
        groupDescriptor = {
          displayName: groupDisplayName,
          features: {}
        },
        featureDescriptor = {
          displayName: featureDisplayName,
          html: "",
          js: "",
          readme: ""
        };

      if (!features[group]) {
        features[group] = groupDescriptor;
      }
      else {
        groupDescriptor = features[group];
      }

      if (!groupDescriptor.features[feature]) {
        groupDescriptor.features[feature] = featureDescriptor;
      }
      else {
        featureDescriptor = groupDescriptor.features[feature];
      }

      if (/demo\.js$/.test(file)) {
        featureDescriptor.js = fileContent;
      }
      else if (/demo\.html$/.test(file)) {
        featureDescriptor.html = fileContent;
      }
      else if (/readme\.html$/.test(file)) {
        featureDescriptor.readme = fileContent;
      }
    }

    grunt.file.expand({
      filter: 'isFile',
      cwd: "demo/"
    }, '**/*').forEach(updateFeatures);

    grunt.config('demoSite.features', features);

    grunt.task.run(['jshint:demoSite', 'copy:demoSite']);

    grunt.log.writeln("Demo Site correctly created!");
  });
};
<|endoftext|>


<commit_before>/**
  @module ember-flexberry-designer
*/

import Ember from 'ember';

/**
  An object that defines any primitive on the UML diagram.

  @class FdUmlPrimitive
  @extends Ember.Object
*/
export default Ember.Object.extend({

  /**
    The object that describes the primitive.

    @property primitive
    @type Object
  */
  primitive: undefined,

  /**
    The unique identifier of the primitive.

    @property id
    @type String
  */
  id: Ember.computed.readOnly('primitive.$id'),

  /**
    The unique identifier of the object.

    @property repositoryObject
    @type String
  */
  repositoryObject: Ember.computed.readOnly('primitive.RepositoryObject'),

  /**
    Returns the string representation of the primitive.

    @method toString
    @return {String} A string representation of the primitive.
  */
  toString() {
    return JSON.stringify(this.get('primitive'));
  },

  /**
    Returns an object for the JointJS diagram model.

    @method JointJS
    @return {joint.shapes} Object for the JointJS diagram model.
  */
  JointJS() {
    throw new Error('Not implemented.');
  },
});
<commit_msg>Feature fd-uml-primitive object method for convert to JSON primitive<commit_after>/**
  @module ember-flexberry-designer
*/

import Ember from 'ember';

/**
  An object that defines any primitive on the UML diagram.

  @class FdUmlPrimitive
  @extends Ember.Object
*/
export default Ember.Object.extend({

  /**
    The object that describes the primitive.

    @property primitive
    @type Object
  */
  primitive: undefined,

  /**
    The unique identifier of the primitive.

    @property id
    @type String
  */
  id: Ember.computed.readOnly('primitive.$id'),

  /**
    The unique identifier of the object.

    @property repositoryObject
    @type String
  */
  repositoryObject: Ember.computed.readOnly('primitive.RepositoryObject'),

  /**
    Returns the string representation of the primitive.

    @method toString
    @return {String} A string representation of the primitive.
  */
  toString() {
    return JSON.stringify(this.get('primitive'));
  },

  /**
    Returns the object to convert to the JSON.

    @method toJSON
    @return {Object} A object to convert to the JSON.
  */
  toJSON() {
    return this.get('primitive');
  },

  /**
    Returns an object for the JointJS diagram model.

    @method JointJS
    @return {joint.shapes} Object for the JointJS diagram model.
  */
  JointJS() {
    throw new Error('Not implemented.');
  },
});
<|endoftext|>


<commit_before>'use strict';

module.exports = function (grunt) {
  // Load all grunt tasks
  require('load-grunt-tasks')(grunt);
  // Show elapsed time at the end
  require('time-grunt')(grunt);

  // Project configuration.
  grunt.initConfig({
    // Metadata.
    pkg: grunt.file.readJSON('package.json'),
    banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
      '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
      '<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
      '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
      ' Licensed MIT */\n',
    // Task configuration.
    clean: {
      files: ['dist']
    },
    concat: {
      options: {
        banner: '<%= banner %>',
        stripBanners: true
      },
      dist: {
        src: ['src/<%= pkg.name %>.js'],
        dest: 'dist/jquery.<%= pkg.name %>.js'
      }
    },
    uglify: {
      options: {
        banner: '<%= banner %>'
      },
      dist: {
        src: '<%= concat.dist.dest %>',
        dest: 'dist/jquery.<%= pkg.name %>.min.js'
      }
    },
    qunit: {
      all: {
        options: {
          urls: ['', '-1edge', '-2edge'].map(function (version) {
            return 'http://localhost:9000/test/<%= pkg.name %>' + version + '.html';
          })
        }
      }
    },
    jshint: {
      options: {
        reporter: require('jshint-stylish')
      },
      gruntfile: {
        options: {
          jshintrc: '.jshintrc'
        },
        src: 'Gruntfile.js'
      },
      src: {
        options: {
          jshintrc: 'src/.jshintrc'
        },
        src: ['src/**/*.js']
      },
      test: {
        options: {
          jshintrc: 'test/.jshintrc'
        },
        src: ['test/**/*.js']
      }
    },
    watch: {
      gruntfile: {
        files: '<%= jshint.gruntfile.src %>',
        tasks: ['jshint:gruntfile']
      },
      src: {
        files: '<%= jshint.src.src %>',
        tasks: ['jshint:src', 'qunit']
      },
      test: {
        files: '<%= jshint.test.src %>',
        tasks: ['jshint:test', 'qunit']
      }
    },
    connect: {
      server: {
        options: {
          hostname: '*',
          port: 9000
        }
      }
    },
    bump: {
      options: {
        files: ['package.json', 'bower.json', '<%= pkg.name %>.jquery.json'],
        updateConfigs: ['pkg'],
        commitFiles: ['package.json', 'bower.json', '<%= pkg.name %>.jquery.json', 'dist/jquery.<%= pkg.name %>.js', 'dist/jquery.<%= pkg.name %>.min.js', 'CHANGELOG.md'],
        pushTo: ['origin']
      }
    },
    changelog: {
      options: {

      }
    }
  });

  // Default task.
  grunt.registerTask('default', ['jshint', 'connect', 'qunit', 'clean', 'concat', 'uglify']);
  grunt.registerTask('server', function () {
    grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.');
    grunt.task.run(['serve']);
  });
  grunt.registerTask('serve', ['connect', 'watch']);
  grunt.registerTask('test', ['jshint', 'connect', 'qunit']);

  grunt.registerTask('release', 'Alias for "bump-only", "changelog", and "bump-commit" tasks.', function (versionType) {
    grunt.task.run('bump-only' + (versionType ? ':' + versionType : ''));
    grunt.task.run('default');
    grunt.task.run('changelog');
    grunt.task.run('bump-commit');
  });
};
<commit_msg>fix(Gruntfile.js): run QUnit on local files to avoid timeouts<commit_after>'use strict';

module.exports = function (grunt) {
  // Load all grunt tasks
  require('load-grunt-tasks')(grunt);
  // Show elapsed time at the end
  require('time-grunt')(grunt);

  // Project configuration.
  grunt.initConfig({
    // Metadata.
    pkg: grunt.file.readJSON('package.json'),
    banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
      '<%= grunt.template.today("yyyy-mm-dd") %>\n' +
      '<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' +
      '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %>;' +
      ' Licensed MIT */\n',
    // Task configuration.
    clean: {
      files: ['dist']
    },
    concat: {
      options: {
        banner: '<%= banner %>',
        stripBanners: true
      },
      dist: {
        src: ['src/<%= pkg.name %>.js'],
        dest: 'dist/jquery.<%= pkg.name %>.js'
      }
    },
    uglify: {
      options: {
        banner: '<%= banner %>'
      },
      dist: {
        src: '<%= concat.dist.dest %>',
        dest: 'dist/jquery.<%= pkg.name %>.min.js'
      }
    },
    qunit: {
      all: {
        src: ['', '-1edge', '-2edge'].map(function (version) {
          return 'test/takeout' + version + '.html';
        })
      }
    },
    jshint: {
      options: {
        reporter: require('jshint-stylish')
      },
      gruntfile: {
        options: {
          jshintrc: '.jshintrc'
        },
        src: 'Gruntfile.js'
      },
      src: {
        options: {
          jshintrc: 'src/.jshintrc'
        },
        src: ['src/**/*.js']
      },
      test: {
        options: {
          jshintrc: 'test/.jshintrc'
        },
        src: ['test/**/*.js']
      }
    },
    watch: {
      gruntfile: {
        files: '<%= jshint.gruntfile.src %>',
        tasks: ['jshint:gruntfile']
      },
      src: {
        files: '<%= jshint.src.src %>',
        tasks: ['jshint:src', 'qunit']
      },
      test: {
        files: '<%= jshint.test.src %>',
        tasks: ['jshint:test', 'qunit']
      }
    },
    connect: {
      server: {
        options: {
          hostname: '*',
          port: 9000
        }
      }
    },
    bump: {
      options: {
        files: ['package.json', 'bower.json', '<%= pkg.name %>.jquery.json'],
        updateConfigs: ['pkg'],
        commitFiles: ['package.json', 'bower.json', '<%= pkg.name %>.jquery.json', 'dist/jquery.<%= pkg.name %>.js', 'dist/jquery.<%= pkg.name %>.min.js', 'CHANGELOG.md'],
        pushTo: ['origin']
      }
    },
    changelog: {
      options: {

      }
    }
  });

  // Default task.
  grunt.registerTask('default', ['jshint', 'qunit', 'clean', 'concat', 'uglify']);
  grunt.registerTask('server', function () {
    grunt.log.warn('The `server` task has been deprecated. Use `grunt serve` to start a server.');
    grunt.task.run(['serve']);
  });
  grunt.registerTask('serve', ['connect', 'watch']);
  grunt.registerTask('test', ['jshint', 'qunit']);

  grunt.registerTask('release', 'Alias for "bump-only", "changelog", and "bump-commit" tasks.', function (versionType) {
    grunt.task.run('bump-only' + (versionType ? ':' + versionType : ''));
    grunt.task.run('default');
    grunt.task.run('changelog');
    grunt.task.run('bump-commit');
  });
};
<|endoftext|>