From 45ab3339586b41a5e0cabc9829cc7c8fae52c65a Mon Sep 17 00:00:00 2001 From: Josh Goldberg Date: Fri, 12 Jun 2015 21:43:18 -0400 Subject: [PATCH] Cleaned up builds with preprocess: one output file --- Gruntfile.js | 16 +++++++++++++++- Source/StringFilr.d.ts | 14 ++++++++++---- Source/StringFilr.ts | 9 ++++----- package.json | 25 ++++++++++++------------- 4 files changed, 41 insertions(+), 23 deletions(-) diff --git a/Gruntfile.js b/Gruntfile.js index b2d8643..09663ff 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -21,11 +21,17 @@ module.exports = function (grunt) { "dest": "<%= meta.paths.source %>/<%= pkg.name %>.js" } }, + "clean": ["<%= meta.paths.dist %>"], "copy": { "default": { "files": [{ "src": "<%= meta.paths.source %>/<%= pkg.name %>.ts", "dest": "<%= meta.paths.dist %>/<%= pkg.name %>-<%= pkg.version %>.ts" + }, { + "src": "<%= meta.paths.source %>/References/*.ts", + "dest": "<%= meta.paths.dist %>/", + "expand": true, + "flatten": true }, { "src": "README.md", "dest": "<%= meta.paths.dist %>/" @@ -51,17 +57,25 @@ module.exports = function (grunt) { } } }, + "preprocess": { + "dist": { + "src": "<%= meta.paths.dist %>/<%= pkg.name %>-<%= pkg.version %>.ts", + "dest": "<%= meta.paths.dist %>/<%= pkg.name %>-<%= pkg.version %>.ts" + } + }, "mocha_phantomjs": { "all": ["Tests/*.html"] } }); + grunt.loadNpmTasks("grunt-contrib-clean"); grunt.loadNpmTasks("grunt-contrib-copy"); grunt.loadNpmTasks("grunt-contrib-uglify"); grunt.loadNpmTasks("grunt-mocha-phantomjs"); + grunt.loadNpmTasks("grunt-preprocess"); grunt.loadNpmTasks("grunt-tslint"); grunt.loadNpmTasks("grunt-typescript"); grunt.registerTask("default", [ - "tslint", "typescript", "copy", "uglify", "mocha_phantomjs" + "tslint", "typescript", "clean", "copy", "uglify", "preprocess", "mocha_phantomjs" ]); }; \ No newline at end of file diff --git a/Source/StringFilr.d.ts b/Source/StringFilr.d.ts index d6fe0f3..e6be8ff 100644 --- a/Source/StringFilr.d.ts +++ b/Source/StringFilr.d.ts @@ -1,13 +1,19 @@ declare module StringFilr { export interface IStringFilrSettings { - // An Object containing data stored as children of sub-Objects. + /** + * An Object containing data stored as children of sub-Objects. + */ library: any; - // A String to use as a default key to rescue on, if provided. + /** + * A String to use as a default key to rescue on, if provided. + */ normal?: string; - // Whether it's ok for the library to have Objects that don't contain the - // normal key (by default, false). + /** + * Whether it's ok for the library to have Objects that don't contain the + * normal key (by default, false). + */ requireNormalKey?: boolean; } diff --git a/Source/StringFilr.ts b/Source/StringFilr.ts index 086a5ab..9a5a17d 100644 --- a/Source/StringFilr.ts +++ b/Source/StringFilr.ts @@ -1,4 +1,8 @@ +// @ifdef INCLUDE_DEFINITIONS /// +// @endif + +// @include ../Source/StringFilr.d.ts module StringFilr { "use strict"; @@ -8,8 +12,6 @@ module StringFilr { * names. You can think of the internal "library" Object as a tree structure, * such that you can pass in a listing (in any order) of the path to data for * retrieval. - * - * @author "Josh Goldberg" */ export class StringFilr implements IStringFilr { // The library of data. @@ -25,9 +27,6 @@ module StringFilr { private requireNormalKey: boolean; /** - * Resets the StringFilr. - * - * @constructor * @param {IStringFilrSettings} settings */ constructor(settings: IStringFilrSettings) { diff --git a/package.json b/package.json index 0fc56f8..e86a39f 100644 --- a/package.json +++ b/package.json @@ -13,21 +13,20 @@ "bugs": { "url": "https://github.com/FullScreenShenanigans/StringFilr/issues" }, - "licenses": [ - { - "type": "MIT", - "url": "https://github.com/FullScreenShenanigans/StringFilr/blob/master/LICENSE.txt" - } - ], + "license": "MIT", "dependencies": { - "chai": "2.2.X", - "grunt": "0.4.X", - "grunt-cli": "0.1.X", - "grunt-contrib-copy": "0.8.X", - "grunt-contrib-uglify": "0.8.X", - "grunt-mocha-phantomjs": "0.6.X", + "chai": "~2.2.X", + "grunt-contrib-clean": "~0.6.0", + "grunt": "~0.4.X", + "grunt-cli": "~0.1.X", + "grunt-contrib-copy": "~0.8.X", + "grunt-contrib-uglify": "~0.8.X", + "grunt-mocha-phantomjs": "~0.6.X", "grunt-tslint": "2.0.X", "grunt-typescript": "0.6.X", - "mocha": "~2.2.X" + "mocha": "~2.2.X", + "grunt-preprocess": "~4.1.X", + "tslint": "~2.0.X", + "typescript": "~1.4.X" } } \ No newline at end of file