Skip to content

Commit

Permalink
Prep for v5.5.1
Browse files Browse the repository at this point in the history
  • Loading branch information
nycdotnet committed May 15, 2016
1 parent 4a81b1f commit de61ab8
Show file tree
Hide file tree
Showing 29 changed files with 1,034 additions and 351 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Releases

## vNext

## v5.5.1
* CHORE: Internal grunt-ts compiler now upgraded to v5.5.0 / TypeScript 1.8.9.
* CHORE: Grunt-ts itself now compiles cleanly with `--forceConsistentCasingInFileNames`, `--noFallthroughCasesInSwitch`, and `--noImplicitReturns` enabled.
* DOCS: Completed documentation for new v5.5 (TypeScript 1.8) features.

## v5.5.0
* FEAT: Support TypeScript 1.8+
* FIX: "Visual Studio config issue: {} when src contains nested arrays". Thanks very much to first-time contributor @davidparsson for the PR! (#353)
Expand Down
6 changes: 5 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ module.exports = function (grunt) {
comments: true,
sourceMap: true,
verbose: true,
fast: 'always'
fast: 'always',
forceConsistentCasingInFileNames: true,
noFallthroughCasesInSwitch: true,
noImplicitReturns: true,
pretty: true
},
build: {
src: ['tasks/**/*.ts']
Expand Down
206 changes: 197 additions & 9 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"author": "basarat",
"name": "grunt-ts",
"description": "Compile and manage your TypeScript project",
"version": "5.5.0",
"version": "5.5.1",
"homepage": "https://github.com/TypeStrong/grunt-ts",
"repository": {
"type": "git",
Expand Down
32 changes: 17 additions & 15 deletions tasks-internal/modules/amdLoader.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

41 changes: 21 additions & 20 deletions tasks-internal/modules/amdLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,26 @@ export function getReferencesInOrder(referenceFile: string, referencePath: strin
export function updateAmdLoader(referenceFile: string, files: IReferences, loaderFile: string,
loaderPath: string, outDir: string, newLine = utils.eol) {

let commonPath: string;
const makeRelativeToOutDir = function(files: string[]) {
files = _.map(files, (file) => {
// Remove common path and replace with absolute outDir
file = file.replace(commonPath, outDir);

// remove extension '.ts' / '.tsx':
file = file.substr(0, file.lastIndexOf('.'));

// Make relative to amd loader
file = utils.makeRelativePath(loaderPath, file);

// Prepend "./" to prevent "basePath" requirejs setting from interferring:
file = './' + file;

return file;
});
return files;
};

// Read the original file if it exists
if (fs.existsSync(referenceFile)) {
grunt.log.verbose.writeln('Generating amdloader from reference file ' + referenceFile);
Expand Down Expand Up @@ -145,32 +165,13 @@ export function updateAmdLoader(referenceFile: string, files: IReferences, loade
// Finally: outDir path + remainder section
if (outDir) {
// Find common path
var commonPath = utils.findCommonPath(files.before.concat(files.generated.concat(files.unordered.concat(files.after))), pathSeperator);
commonPath = utils.findCommonPath(files.before.concat(files.generated.concat(files.unordered.concat(files.after))), pathSeperator);
grunt.log.verbose.writeln('Found common path: ' + commonPath);

// Make sure outDir is absolute:
outDir = path.resolve(outDir);
grunt.log.verbose.writeln('Using outDir: ' + outDir);

function makeRelativeToOutDir(files: string[]) {
files = _.map(files, (file) => {
// Remove common path and replace with absolute outDir
file = file.replace(commonPath, outDir);

// remove ts extension '.ts':
file = file.substr(0, file.length - 3);

// Make relative to amd loader
file = utils.makeRelativePath(loaderPath, file);

// Prepend "./" to prevent "basePath" requirejs setting from interferring:
file = './' + file;

return file;
});
return files;
}

grunt.log.verbose.writeln('Making files relative to outDir...');
files.before = makeRelativeToOutDir(files.before);
files.generated = makeRelativeToOutDir(files.generated);
Expand Down
1 change: 1 addition & 0 deletions tasks-internal/modules/cacheUtils.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

112 changes: 91 additions & 21 deletions tasks-internal/modules/compile.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit de61ab8

Please sign in to comment.