From 73a46205a09824efcfc98b787c066cb0a0017e9c Mon Sep 17 00:00:00 2001 From: Lucas Sloan Date: Wed, 15 Mar 2017 16:39:47 -0700 Subject: [PATCH] build(tsc-wrapped): update tsickle to version 0.21.6 Update tsickle to version 0.21.6 which fixes a bug where input source maps which specified filenames differently than the names supplied to tsc didn't get composed with tsc's source maps. Also adds a test that the bug was fixed. --- npm-shrinkwrap.clean.json | 2 +- npm-shrinkwrap.json | 6 +-- tools/@angular/tsc-wrapped/test/main.spec.ts | 39 +++++++++++++++++++- 3 files changed, 42 insertions(+), 5 deletions(-) diff --git a/npm-shrinkwrap.clean.json b/npm-shrinkwrap.clean.json index b36162f51c..544435968b 100644 --- a/npm-shrinkwrap.clean.json +++ b/npm-shrinkwrap.clean.json @@ -6156,7 +6156,7 @@ } }, "tsickle": { - "version": "0.21.5", + "version": "0.21.6", "dev": true }, "tslint": { diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index b4c4a22d6d..6c9f754608 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -9002,9 +9002,9 @@ } }, "tsickle": { - "version": "0.21.5", - "from": "tsickle@0.21.5", - "resolved": "https://registry.npmjs.org/tsickle/-/tsickle-0.21.5.tgz", + "version": "0.21.6", + "from": "tsickle@0.21.6", + "resolved": "https://registry.npmjs.org/tsickle/-/tsickle-0.21.6.tgz", "dev": true }, "tslint": { diff --git a/tools/@angular/tsc-wrapped/test/main.spec.ts b/tools/@angular/tsc-wrapped/test/main.spec.ts index b6132885a0..4b15d2b6c1 100644 --- a/tools/@angular/tsc-wrapped/test/main.spec.ts +++ b/tools/@angular/tsc-wrapped/test/main.spec.ts @@ -284,8 +284,45 @@ describe('tsc-wrapped', () => { // Provide a file called test.ts that has an inline source map // which says that it was transpiled from a file other_test.ts // with exactly the same content. + const inputSourceMap = + `{"version":3,"sources":["other_test.ts"],"names":[],"mappings":"AAAA,MAAM,EAAE,EAAE,CAAC","file":"../test.ts","sourceRoot":""}`; + const encodedSourceMap = new Buffer(inputSourceMap, 'utf8').toString('base64'); write('test.ts', `const x = 3; -//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIm90aGVyX3Rlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsTUFBTSxFQUFFLEVBQUUsQ0FBQyIsImZpbGUiOiIuLi90ZXN0LnRzIiwic291cmNlUm9vdCI6IiJ9`); +//# sourceMappingURL=data:application/json;base64,${encodedSourceMap}`); + + main(basePath, {basePath}) + .then(() => { + const out = readOut('js.map'); + expect(out).toContain('"sources":["other_test.ts"]'); + done(); + }) + .catch(e => done.fail(e)); + }); + + it(`should accept input source maps that don't match the file name`, (done) => { + write('tsconfig.json', `{ + "compilerOptions": { + "experimentalDecorators": true, + "types": [], + "outDir": "built", + "declaration": true, + "moduleResolution": "node", + "target": "es2015", + "sourceMap": true + }, + "angularCompilerOptions": { + "annotateForClosureCompiler": true + }, + "files": ["test.ts"] + }`); + // Provide a file called test.ts that has an inline source map + // which says that it was transpiled from a file other_test.ts + // with exactly the same content. + const inputSourceMap = + `{"version":3,"sources":["other_test.ts"],"names":[],"mappings":"AAAA,MAAM,EAAE,EAAE,CAAC","file":"test.ts","sourceRoot":""}`; + const encodedSourceMap = new Buffer(inputSourceMap, 'utf8').toString('base64'); + write('test.ts', `const x = 3; +//# sourceMappingURL=data:application/json;base64,${encodedSourceMap}`); main(basePath, {basePath}) .then(() => {