diff --git a/lib/broccoli/broccoli-dest-copy.js b/lib/broccoli/broccoli-dest-copy.js index c315be791ca0..686cd55010f9 100644 --- a/lib/broccoli/broccoli-dest-copy.js +++ b/lib/broccoli/broccoli-dest-copy.js @@ -1,5 +1,6 @@ /// /// +"use strict"; var fs = require('fs'); var fse = require('fs-extra'); var path = require('path'); @@ -30,8 +31,7 @@ var DestCopy = (function () { }); }; return DestCopy; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = diffing_broccoli_plugin_1.wrapDiffingPlugin(DestCopy); - -//# sourceMappingURL=broccoli-dest-copy.js.map +}()); +exports.__esModule = true; +exports["default"] = diffing_broccoli_plugin_1.wrapDiffingPlugin(DestCopy); +//# sourceMappingURL=broccoli-dest-copy.js.map \ No newline at end of file diff --git a/lib/broccoli/broccoli-dest-copy.js.map b/lib/broccoli/broccoli-dest-copy.js.map index d7956090b571..dc9987c197ce 100644 --- a/lib/broccoli/broccoli-dest-copy.js.map +++ b/lib/broccoli/broccoli-dest-copy.js.map @@ -1 +1 @@ -{"version":3,"sources":["broccoli/broccoli-dest-copy.ts"],"names":["DestCopy","DestCopy.constructor","DestCopy.rebuild"],"mappings":"AAAA,kDAAkD;AAClD,0DAA0D;AAE1D,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AAC1B,IAAO,GAAG,WAAW,UAAU,CAAC,CAAC;AACjC,IAAO,IAAI,WAAW,MAAM,CAAC,CAAC;AAC9B,wCAAmE,2BAA2B,CAAC,CAAA;AAE/F;;;GAGG;AACH;IACEA,kBAAoBA,SAASA,EAAUA,SAASA,EAAUA,UAAkBA;QAAxDC,cAASA,GAATA,SAASA,CAAAA;QAAUA,cAASA,GAATA,SAASA,CAAAA;QAAUA,eAAUA,GAAVA,UAAUA,CAAQA;IAAGA,CAACA;IAGhFD,0BAAOA,GAAPA,UAAQA,QAAoBA;QAA5BE,iBAgBCA;QAfCA,QAAQA,CAACA,UAAUA,CAACA,MAAMA,CAACA,QAAQA,CAACA,YAAYA,CAACA;aAC5CA,OAAOA,CAACA,UAACA,eAAeA;YACvBA,IAAIA,YAAYA,GAAGA,IAAIA,CAACA,IAAIA,CAACA,KAAIA,CAACA,UAAUA,EAAEA,eAAeA,CAACA,CAACA;YAE/DA,IAAIA,WAAWA,GAAGA,IAAIA,CAACA,OAAOA,CAACA,YAAYA,CAACA,CAACA;YAC7CA,GAAGA,CAACA,UAAUA,CAACA,WAAWA,CAACA,CAACA;YAC5BA,GAAGA,CAACA,QAAQA,CAACA,IAAIA,CAACA,IAAIA,CAACA,KAAIA,CAACA,SAASA,EAAEA,eAAeA,CAACA,EAAEA,YAAYA,CAACA,CAACA;QACzEA,CAACA,CAACA,CAACA;QAEPA,QAAQA,CAACA,YAAYA,CAACA,OAAOA,CAACA,UAACA,eAAeA;YAC5CA,IAAIA,YAAYA,GAAGA,IAAIA,CAACA,IAAIA,CAACA,KAAIA,CAACA,UAAUA,EAAEA,eAAeA,CAACA,CAACA;YAE/DA,0EAA0EA;YAC1EA,EAAEA,CAACA,UAAUA,CAACA,YAAYA,CAACA,CAACA;QAC9BA,CAACA,CAACA,CAACA;IACLA,CAACA;IACHF,eAACA;AAADA,CArBA,AAqBCA,IAAA;AAED;kBAAe,2CAAiB,CAAC,QAAQ,CAAC,CAAC","file":"broccoli/broccoli-dest-copy.js","sourcesContent":["/// \n/// \n\nimport fs = require('fs');\nimport fse = require('fs-extra');\nimport path = require('path');\nimport {wrapDiffingPlugin, DiffingBroccoliPlugin, DiffResult} from './diffing-broccoli-plugin';\n\n/**\n * Intercepts each file as it is copied to the destination tempdir,\n * and tees a copy to the given path outside the tmp dir.\n */\nclass DestCopy implements DiffingBroccoliPlugin {\n constructor(private inputPath, private cachePath, private outputRoot: string) {}\n\n\n rebuild(treeDiff: DiffResult) {\n treeDiff.addedPaths.concat(treeDiff.changedPaths)\n .forEach((changedFilePath) => {\n var destFilePath = path.join(this.outputRoot, changedFilePath);\n\n var destDirPath = path.dirname(destFilePath);\n fse.mkdirsSync(destDirPath);\n fse.copySync(path.join(this.inputPath, changedFilePath), destFilePath);\n });\n\n treeDiff.removedPaths.forEach((removedFilePath) => {\n var destFilePath = path.join(this.outputRoot, removedFilePath);\n\n // TODO: what about obsolete directories? we are not cleaning those up yet\n fs.unlinkSync(destFilePath);\n });\n }\n}\n\nexport default wrapDiffingPlugin(DestCopy);\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"file":"broccoli-dest-copy.js","sourceRoot":"","sources":["broccoli-dest-copy.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,0DAA0D;;AAE1D,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AAC1B,IAAO,GAAG,WAAW,UAAU,CAAC,CAAC;AACjC,IAAO,IAAI,WAAW,MAAM,CAAC,CAAC;AAC9B,wCAAmE,2BAA2B,CAAC,CAAA;AAE/F;;;GAGG;AACH;IACE,kBAAoB,SAAS,EAAU,SAAS,EAAU,UAAkB;QAAxD,cAAS,GAAT,SAAS,CAAA;QAAU,cAAS,GAAT,SAAS,CAAA;QAAU,eAAU,GAAV,UAAU,CAAQ;IAAG,CAAC;IAGhF,0BAAO,GAAP,UAAQ,QAAoB;QAA5B,iBAgBC;QAfC,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC;aAC5C,OAAO,CAAC,UAAC,eAAe;YACvB,IAAI,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,KAAI,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;YAE/D,IAAI,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;YAC7C,GAAG,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;YAC5B,GAAG,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAI,CAAC,SAAS,EAAE,eAAe,CAAC,EAAE,YAAY,CAAC,CAAC;QACzE,CAAC,CAAC,CAAC;QAEP,QAAQ,CAAC,YAAY,CAAC,OAAO,CAAC,UAAC,eAAe;YAC5C,IAAI,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,KAAI,CAAC,UAAU,EAAE,eAAe,CAAC,CAAC;YAE/D,0EAA0E;YAC1E,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;IACL,CAAC;IACH,eAAC;AAAD,CAAC,AArBD,IAqBC;AAED;qBAAe,2CAAiB,CAAC,QAAQ,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/broccoli/broccoli-flatten.js b/lib/broccoli/broccoli-flatten.js index b722e622954e..9e5d34b71a22 100644 --- a/lib/broccoli/broccoli-flatten.js +++ b/lib/broccoli/broccoli-flatten.js @@ -1,3 +1,4 @@ +"use strict"; var fs = require('fs'); var fse = require('fs-extra'); var path = require('path'); @@ -43,9 +44,8 @@ var DiffingFlatten = (function () { }); }; return DiffingFlatten; -})(); +}()); exports.DiffingFlatten = DiffingFlatten; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = diffing_broccoli_plugin_1.wrapDiffingPlugin(DiffingFlatten); - -//# sourceMappingURL=broccoli-flatten.js.map +exports.__esModule = true; +exports["default"] = diffing_broccoli_plugin_1.wrapDiffingPlugin(DiffingFlatten); +//# sourceMappingURL=broccoli-flatten.js.map \ No newline at end of file diff --git a/lib/broccoli/broccoli-flatten.js.map b/lib/broccoli/broccoli-flatten.js.map index acc06d9e44c9..34a6eb84d2a9 100644 --- a/lib/broccoli/broccoli-flatten.js.map +++ b/lib/broccoli/broccoli-flatten.js.map @@ -1 +1 @@ -{"version":3,"sources":["broccoli/broccoli-flatten.ts"],"names":["DiffingFlatten","DiffingFlatten.constructor","DiffingFlatten.rebuild"],"mappings":"AAAA,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AAC1B,IAAO,GAAG,WAAW,UAAU,CAAC,CAAC;AACjC,IAAO,IAAI,WAAW,MAAM,CAAC,CAAC;AAC9B,wCAAmE,2BAA2B,CAAC,CAAA;AAC/F,IAAI,aAAa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A,YAAYA,CAACA,CAACA;YAC9CA,CAACA;YAACA,IAAIA,CAACA,CAACA;gBACNA,MAAMA,IAAIA,KAAKA,CAACA,sBAAmBA,IAAIA,CAACA,QAAQA,CAACA,eAAeA,CAACA,QAAIA;oBACrDA,qBAAkBA,eAAeA,OAAGA,CAACA,CAACA;YACxDA,CAACA;QACHA,CAACA,CAACA,CAACA;QAEHA,QAAQA,CAACA,YAAYA,CAACA,OAAOA,CAACA,UAACA,eAAeA;YAC5CA,IAAIA,YAAYA,GAAGA,IAAIA,CAACA,IAAIA,CAACA,KAAIA,CAACA,SAASA,EAAEA,IAAIA,CAACA,QAAQA,CAACA,eAAeA,CAACA,CAACA,CAACA;YAC7EA,EAAEA,CAACA,UAAUA,CAACA,YAAYA,CAACA,CAACA;QAC9BA,CAACA,CAACA,CAACA;IACLA,CAACA;IACHF,qBAACA;AAADA,CAnCA,AAmCCA,IAAA;AAnCY,sBAAc,iBAmC1B,CAAA;AAED;kBAAe,2CAAiB,CAAC,cAAc,CAAC,CAAC","file":"broccoli/broccoli-flatten.js","sourcesContent":["import fs = require('fs');\nimport fse = require('fs-extra');\nimport path = require('path');\nimport {wrapDiffingPlugin, DiffingBroccoliPlugin, DiffResult} from './diffing-broccoli-plugin';\nvar symlinkOrCopy = require('symlink-or-copy').sync;\n\nvar isWindows = process.platform === 'win32';\n\n\n/**\n * Intercepts each changed file and replaces its contents with\n * the associated changes.\n */\nexport class DiffingFlatten implements DiffingBroccoliPlugin {\n constructor(private inputPath, private cachePath, private options) {}\n\n\n rebuild(treeDiff: DiffResult) {\n let pathsToUpdate = treeDiff.addedPaths;\n\n // since we need to run on Windows as well we can't rely on symlinks being available,\n // which means that we need to respond to both added and changed paths\n if (isWindows) {\n pathsToUpdate = pathsToUpdate.concat(treeDiff.changedPaths);\n }\n\n pathsToUpdate.forEach((changedFilePath) => {\n var sourceFilePath = path.join(this.inputPath, changedFilePath);\n var destFilePath = path.join(this.cachePath, path.basename(changedFilePath));\n var destDirPath = path.dirname(destFilePath);\n\n if (!fs.existsSync(destDirPath)) {\n fse.mkdirpSync(destDirPath);\n }\n\n if (!fs.existsSync(destFilePath)) {\n symlinkOrCopy(sourceFilePath, destFilePath);\n } else {\n throw new Error(`Duplicate file '${path.basename(changedFilePath)}' ` +\n `found in path '${changedFilePath}'`);\n }\n });\n\n treeDiff.removedPaths.forEach((removedFilePath) => {\n var destFilePath = path.join(this.cachePath, path.basename(removedFilePath));\n fs.unlinkSync(destFilePath);\n });\n }\n}\n\nexport default wrapDiffingPlugin(DiffingFlatten);\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"file":"broccoli-flatten.js","sourceRoot":"","sources":["broccoli-flatten.ts"],"names":[],"mappings":";AAAA,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AAC1B,IAAO,GAAG,WAAW,UAAU,CAAC,CAAC;AACjC,IAAO,IAAI,WAAW,MAAM,CAAC,CAAC;AAC9B,wCAAmE,2BAA2B,CAAC,CAAA;AAC/F,IAAI,aAAa,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC;AAEpD,IAAI,SAAS,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC;AAG7C;;;GAGG;AACH;IACE,wBAAoB,SAAS,EAAU,SAAS,EAAU,OAAO;QAA7C,cAAS,GAAT,SAAS,CAAA;QAAU,cAAS,GAAT,SAAS,CAAA;QAAU,YAAO,GAAP,OAAO,CAAA;IAAG,CAAC;IAGrE,gCAAO,GAAP,UAAQ,QAAoB;QAA5B,iBA8BC;QA7BC,IAAI,aAAa,GAAG,QAAQ,CAAC,UAAU,CAAC;QAExC,qFAAqF;QACrF,sEAAsE;QACtE,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;YACd,aAAa,GAAG,aAAa,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;QAC9D,CAAC;QAED,aAAa,CAAC,OAAO,CAAC,UAAC,eAAe;YACpC,IAAI,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,KAAI,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;YAChE,IAAI,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,KAAI,CAAC,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC;YAC7E,IAAI,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;YAE7C,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;gBAChC,GAAG,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;YAC9B,CAAC;YAED,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;gBACjC,aAAa,CAAC,cAAc,EAAE,YAAY,CAAC,CAAC;YAC9C,CAAC;YAAC,IAAI,CAAC,CAAC;gBACN,MAAM,IAAI,KAAK,CAAC,sBAAmB,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,QAAI;oBACrD,qBAAkB,eAAe,OAAG,CAAC,CAAC;YACxD,CAAC;QACH,CAAC,CAAC,CAAC;QAEH,QAAQ,CAAC,YAAY,CAAC,OAAO,CAAC,UAAC,eAAe;YAC5C,IAAI,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,KAAI,CAAC,SAAS,EAAE,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC,CAAC;YAC7E,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;IACL,CAAC;IACH,qBAAC;AAAD,CAAC,AAnCD,IAmCC;AAnCY,sBAAc,iBAmC1B,CAAA;AAED;qBAAe,2CAAiB,CAAC,cAAc,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/broccoli/broccoli-merge-trees.js b/lib/broccoli/broccoli-merge-trees.js index 4e4470a50297..64c700442134 100644 --- a/lib/broccoli/broccoli-merge-trees.js +++ b/lib/broccoli/broccoli-merge-trees.js @@ -1,3 +1,4 @@ +"use strict"; var fs = require('fs'); var fse = require('fs-extra'); var path = require('path'); @@ -123,9 +124,8 @@ var MergeTrees = (function () { }); }; return MergeTrees; -})(); +}()); exports.MergeTrees = MergeTrees; -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = diffing_broccoli_plugin_1.wrapDiffingPlugin(MergeTrees); - -//# sourceMappingURL=broccoli-merge-trees.js.map +exports.__esModule = true; +exports["default"] = diffing_broccoli_plugin_1.wrapDiffingPlugin(MergeTrees); +//# sourceMappingURL=broccoli-merge-trees.js.map \ No newline at end of file diff --git a/lib/broccoli/broccoli-merge-trees.js.map b/lib/broccoli/broccoli-merge-trees.js.map index ba24235797bf..ad0f9477cbe9 100644 --- a/lib/broccoli/broccoli-merge-trees.js.map +++ b/lib/broccoli/broccoli-merge-trees.js.map @@ -1 +1 @@ -{"version":3,"sources":["broccoli/broccoli-merge-trees.ts"],"names":["outputFileSync","pathOverwrittenError","MergeTrees","MergeTrees.constructor","MergeTrees.rebuild"],"mappings":"AAAA,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AAC1B,IAAO,GAAG,WAAW,UAAU,CAAC,CAAC;AACjC,IAAO,IAAI,WAAW,MAAM,CAAC,CAAC;AAC9B,IAAI,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC;AACxD,wCAAmE,2BAA2B,CAAC,CAAA;AAE/F,IAAI,SAAS,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC;AAM7C,wBAAwB,UAAU,EAAE,QAAQ;IAC1CA,IAAIA,OAAOA,GAAGA,IAAIA,CAACA,OAAOA,CAACA,QAAQA,CAACA,CAACA;IACrCA,GAAGA,CAACA,UAAUA,CAACA,OAAOA,EAAEA,EAACA,EAAEA,EAAEA,EAAEA,EAACA,CAACA,CAACA;IAClCA,iBAAiBA,CAACA,UAAUA,EAAEA,QAAQA,CAACA,CAACA;AAC1C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YA;YACtBA,kCAAkCA;YAClCA,WAAWA,CAACA,IAAIA,CAACA,YAAYA,CAACA,CAACA;YAC/BA,OAAOA,CAACA,YAAYA,CAACA,GAAGA,IAAIA,CAACA;QAC/BA,CAACA,CAACA;QAEFA,EAAEA,CAACA,CAACA,IAAIA,CAACA,UAAUA,CAACA,CAACA,CAACA;YACpBA,IAAIA,CAACA,UAAUA,GAAGA,KAAKA,CAACA;YAExBA,sBAAsBA;YACtBA,SAASA,CAACA,OAAOA,EAAEA,CAACA,OAAOA,CAACA,UAACA,QAAoBA,EAAEA,KAAKA;gBACtDA,KAAKA,GAAGA,SAASA,CAACA,MAAMA,GAAGA,CAACA,GAAGA,KAAKA,CAACA;gBACrCA,QAAQA,CAACA,UAAUA,CAACA,OAAOA,CAACA,UAACA,WAAWA;oBACtCA,IAAIA,KAAKA,GAAGA,KAAIA,CAACA,SAASA,CAACA,WAAWA,CAACA,CAACA;oBACxCA,EAAEA,CAACA,CAACA,KAAKA,KAAKA,SAASA,CAACA,CAACA,CAACA;wBACxBA,KAAIA,CAACA,SAASA,CAACA,WAAWA,CAACA,GAAGA,CAACA,KAAKA,CAACA,CAACA;wBACtCA,WAAWA,CAACA,IAAIA,CAACA,WAAWA,CAACA,CAACA;oBAChCA,CAACA;oBAACA,IAAIA,CAACA,EAAEA,CAACA,CAACA,SAASA,CAACA,CAACA,CAACA;wBACrBA,8CAA8CA;wBAC9CA,KAAKA,CAACA,OAAOA,CAACA,KAAKA,CAACA,CAACA;oBACvBA,CAACA;oBAACA,IAAIA,CAACA,CAACA;wBACNA,MAAMA,oBAAoBA,CAACA,WAAWA,CAACA,CAACA;oBAC1CA,CAACA;gBACHA,CAACA,CAACA,CAACA;YACLA,CAACA,CAACA,CAACA;QAELA,CAACA;QAACA,IAAIA,CAACA,CAACA;YACNA,eAAeA;YACfA,SAASA,CAACA,OAAOA,EAAEA,CAACA,OAAOA,CAACA,UAACA,QAAoBA,EAAEA,KAAKA;gBACtDA,KAAKA,GAAGA,SAASA,CAACA,MAAMA,GAAGA,CAACA,GAAGA,KAAKA,CAACA;gBACrCA,EAAEA,CAACA,CAACA,QAAQA,CAACA,YAAYA,CAACA,CAACA,CAACA;oBAC1BA,QAAQA,CAACA,YAAYA,CAACA,OAAOA,CAACA,UAACA,WAAWA;wBACxCA,IAAIA,KAAKA,GAAGA,KAAIA,CAACA,SAASA,CAACA,WAAWA,CAACA,CAACA;wBACxCA,+BAA+BA;wBAC/BA,kCAAkCA;wBAClCA,EAAEA,CAACA,CAACA,KAAKA,CAACA,KAAKA,CAACA,MAAMA,GAAGA,CAACA,CAACA,KAAKA,KAAKA,CAACA,CAACA,CAACA;4BACtCA,aAAaA,CAACA,IAAIA,CAACA,IAAIA,CAACA,IAAIA,CAACA,KAAIA,CAACA,SAASA,EAAEA,WAAWA,CAACA,CAACA,CAACA;4BAC3DA,KAAKA,CAACA,GAAGA,EAAEA,CAACA;4BACZA,EAAEA,CAACA,CAACA,KAAKA,CAACA,MAAMA,KAAKA,CAACA,CAACA,CAACA,CAACA;gCACvBA,KAAIA,CAACA,SAASA,CAACA,WAAWA,CAACA,GAAGA,SAASA,CAACA;4BAC1CA,CAACA;4BAACA,IAAIA,CAACA,EAAEA,CAACA,CAACA,CAACA,OAAOA,CAACA,WAAWA,CAACA,CAACA,CAACA,CAACA;gCACjCA,EAAEA,CAACA,CAACA,KAAKA,CAACA,MAAMA,KAAKA,CAACA,IAAIA,CAACA,SAASA,CAACA,CAACA,CAACA;oCACrCA,MAAMA,oBAAoBA,CAACA,WAAWA,CAACA,CAACA;gCAC1CA,CAACA;gCACDA,IAAIA,CAACA,WAAWA,CAACA,CAACA;4BACpBA,CAACA;wBACHA,CAACA;oBACHA,CAACA,CAACA,CAACA;gBACLA,CAACA;gBAEDA,IAAIA,aAAaA,GAAGA,QAAQA,CAACA,UAAUA,CAACA;gBAExCA,EAAEA,CAACA,CAACA,SAASA,CAACA,CAACA,CAACA;oBACdA,aAAaA,GAAGA,aAAaA,CAACA,MAAMA,CAACA,QAAQA,CAACA,YAAYA,CAACA,CAACA;gBAC9DA,CAACA;gBAEDA,aAAaA,CAACA,OAAOA,CAACA,UAACA,WAAWA;oBAChCA,IAAIA,KAAKA,GAAGA,KAAIA,CAACA,SAASA,CAACA,WAAWA,CAACA,CAACA;oBACxCA,EAAEA,CAACA,CAACA,KAAKA,KAAKA,SAASA,CAACA,CAACA,CAACA;wBACxBA,iBAAiBA;wBACjBA,KAAIA,CAACA,SAASA,CAACA,WAAWA,CAACA,GAAGA,CAACA,KAAKA,CAACA,CAACA;wBACtCA,IAAIA,CAACA,WAAWA,CAACA,CAACA;oBACpBA,CAACA;oBAACA,IAAIA,CAACA,EAAEA,CAACA,CAACA,CAACA,QAAQA,CAACA,KAAKA,EAAEA,KAAKA,CAACA,CAACA,CAACA,CAACA;wBACnCA,KAAKA,CAACA,IAAIA,CAACA,KAAKA,CAACA,CAACA;wBAClBA,KAAKA,CAACA,IAAIA,CAACA,UAACA,CAACA,EAAEA,CAACA,IAAKA,OAAAA,CAACA,GAAGA,CAACA,EAALA,CAAKA,CAACA,CAACA;wBAC5BA,EAAEA,CAACA,CAACA,KAAKA,CAACA,MAAMA,GAAGA,CAACA,IAAIA,CAACA,SAASA,CAACA,CAACA,CAACA;4BACnCA,MAAMA,oBAAoBA,CAACA,WAAWA,CAACA,CAACA;wBAC1CA,CAACA;wBACDA,EAAEA,CAACA,CAACA,KAAKA,CAACA,KAAKA,CAACA,MAAMA,GAAGA,CAACA,CAACA,KAAKA,KAAKA,IAAIA,CAACA,OAAOA,CAACA,WAAWA,CAACA,CAACA,CAACA,CAACA;4BAC/DA,IAAIA,CAACA,WAAWA,CAACA,CAACA;wBACpBA,CAACA;oBACHA,CAACA;gBACHA,CAACA,CAACA,CAACA;YACLA,CAACA,CAACA,CAACA;QACLA,CAACA;QAEDA,aAAaA,CAACA,OAAOA,CAACA,UAACA,QAAQA,IAAKA,OAAAA,GAAGA,CAACA,UAAUA,CAACA,QAAQA,CAACA,EAAxBA,CAAwBA,CAACA,CAACA;QAC9DA,WAAWA,CAACA,OAAOA,CAACA,UAACA,WAAWA;YAC9BA,IAAIA,KAAKA,GAAGA,KAAIA,CAACA,SAASA,CAACA,WAAWA,CAACA,CAACA;YACxCA,IAAIA,QAAQA,GAAGA,IAAIA,CAACA,IAAIA,CAACA,KAAIA,CAACA,SAASA,EAAEA,WAAWA,CAACA,CAACA;YACtDA,IAAIA,WAAWA,GAAGA,KAAKA,CAACA,KAAKA,CAACA,MAAMA,GAAGA,CAACA,CAACA,CAACA;YAC1CA,IAAIA,eAAeA,GAAGA,KAAIA,CAACA,UAAUA,CAACA,WAAWA,CAACA,CAACA;YACnDA,IAAIA,UAAUA,GAAGA,IAAIA,CAACA,IAAIA,CAACA,eAAeA,EAAEA,WAAWA,CAACA,CAACA;YACzDA,EAAEA,CAACA,CAACA,KAAKA,CAACA,MAAMA,GAAGA,CAACA,CAACA,CAACA,CAACA;gBACrBA,GAAGA,CAACA,UAAUA,CAACA,QAAQA,CAACA,CAACA;YAC3BA,CAACA;YACDA,cAAcA,CAACA,UAAUA,EAAEA,QAAQA,CAACA,CAACA;QACvCA,CAACA,CAACA,CAACA;IACLA,CAACA;IACHF,iBAACA;AAADA,CA/GA,AA+GCA,IAAA;AA/GY,kBAAU,aA+GtB,CAAA;AAED;kBAAe,2CAAiB,CAAC,UAAU,CAAC,CAAC","file":"broccoli/broccoli-merge-trees.js","sourcesContent":["import fs = require('fs');\nimport fse = require('fs-extra');\nimport path = require('path');\nvar symlinkOrCopySync = require('symlink-or-copy').sync;\nimport {wrapDiffingPlugin, DiffingBroccoliPlugin, DiffResult} from './diffing-broccoli-plugin';\n\nvar isWindows = process.platform === 'win32';\n\ninterface MergeTreesOptions {\n overwrite?: boolean;\n}\n\nfunction outputFileSync(sourcePath, destPath) {\n let dirname = path.dirname(destPath);\n fse.mkdirsSync(dirname, {fs: fs});\n symlinkOrCopySync(sourcePath, destPath);\n}\n\nfunction pathOverwrittenError(path) {\n const msg = 'Either remove the duplicate or enable the \"overwrite\" option for this merge.';\n return new Error(`Duplicate path found while merging trees. Path: \"${path}\".\\n${msg}`);\n}\n\nexport class MergeTrees implements DiffingBroccoliPlugin {\n private pathCache: {[key: string]: number[]} = Object.create(null);\n public options: MergeTreesOptions;\n private firstBuild: boolean = true;\n\n constructor(public inputPaths: string[], public cachePath: string,\n options: MergeTreesOptions = {}) {\n this.options = options || {};\n }\n\n rebuild(treeDiffs: DiffResult[]) {\n let overwrite = this.options.overwrite;\n let pathsToEmit: string[] = [];\n let pathsToRemove: string[] = [];\n let emitted: {[key: string]: boolean} = Object.create(null);\n let contains = (cache, val) => {\n for (let i = 0, ii = cache.length; i < ii; ++i) {\n if (cache[i] === val) return true;\n }\n return false;\n };\n\n let emit = (relativePath) => {\n // ASSERT(!emitted[relativePath]);\n pathsToEmit.push(relativePath);\n emitted[relativePath] = true;\n };\n\n if (this.firstBuild) {\n this.firstBuild = false;\n\n // Build initial cache\n treeDiffs.reverse().forEach((treeDiff: DiffResult, index) => {\n index = treeDiffs.length - 1 - index;\n treeDiff.addedPaths.forEach((changedPath) => {\n let cache = this.pathCache[changedPath];\n if (cache === undefined) {\n this.pathCache[changedPath] = [index];\n pathsToEmit.push(changedPath);\n } else if (overwrite) {\n // ASSERT(contains(pathsToEmit, changedPath));\n cache.unshift(index);\n } else {\n throw pathOverwrittenError(changedPath);\n }\n });\n });\n\n } else {\n // Update cache\n treeDiffs.reverse().forEach((treeDiff: DiffResult, index) => {\n index = treeDiffs.length - 1 - index;\n if (treeDiff.removedPaths) {\n treeDiff.removedPaths.forEach((removedPath) => {\n let cache = this.pathCache[removedPath];\n // ASSERT(cache !== undefined);\n // ASSERT(contains(cache, index));\n if (cache[cache.length - 1] === index) {\n pathsToRemove.push(path.join(this.cachePath, removedPath));\n cache.pop();\n if (cache.length === 0) {\n this.pathCache[removedPath] = undefined;\n } else if (!emitted[removedPath]) {\n if (cache.length === 1 && !overwrite) {\n throw pathOverwrittenError(removedPath);\n }\n emit(removedPath);\n }\n }\n });\n }\n\n let pathsToUpdate = treeDiff.addedPaths;\n\n if (isWindows) {\n pathsToUpdate = pathsToUpdate.concat(treeDiff.changedPaths);\n }\n\n pathsToUpdate.forEach((changedPath) => {\n let cache = this.pathCache[changedPath];\n if (cache === undefined) {\n // File was added\n this.pathCache[changedPath] = [index];\n emit(changedPath);\n } else if (!contains(cache, index)) {\n cache.push(index);\n cache.sort((a, b) => a - b);\n if (cache.length > 1 && !overwrite) {\n throw pathOverwrittenError(changedPath);\n }\n if (cache[cache.length - 1] === index && !emitted[changedPath]) {\n emit(changedPath);\n }\n }\n });\n });\n }\n\n pathsToRemove.forEach((destPath) => fse.removeSync(destPath));\n pathsToEmit.forEach((emittedPath) => {\n let cache = this.pathCache[emittedPath];\n let destPath = path.join(this.cachePath, emittedPath);\n let sourceIndex = cache[cache.length - 1];\n let sourceInputPath = this.inputPaths[sourceIndex];\n let sourcePath = path.join(sourceInputPath, emittedPath);\n if (cache.length > 1) {\n fse.removeSync(destPath);\n }\n outputFileSync(sourcePath, destPath);\n });\n }\n}\n\nexport default wrapDiffingPlugin(MergeTrees);\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"file":"broccoli-merge-trees.js","sourceRoot":"","sources":["broccoli-merge-trees.ts"],"names":[],"mappings":";AAAA,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AAC1B,IAAO,GAAG,WAAW,UAAU,CAAC,CAAC;AACjC,IAAO,IAAI,WAAW,MAAM,CAAC,CAAC;AAC9B,IAAI,iBAAiB,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC;AACxD,wCAAmE,2BAA2B,CAAC,CAAA;AAE/F,IAAI,SAAS,GAAG,OAAO,CAAC,QAAQ,KAAK,OAAO,CAAC;AAM7C,wBAAwB,UAAU,EAAE,QAAQ;IAC1C,IAAI,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;IACrC,GAAG,CAAC,UAAU,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C,UAAU,CAAC,WAAW,CAAC,CAAC;YACnD,IAAI,UAAU,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE,WAAW,CAAC,CAAC;YACzD,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC;gBACrB,GAAG,CAAC,UAAU,CAAC,QAAQ,CAAC,CAAC;YAC3B,CAAC;YACD,cAAc,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;QACvC,CAAC,CAAC,CAAC;IACL,CAAC;IACH,iBAAC;AAAD,CAAC,AA/GD,IA+GC;AA/GY,kBAAU,aA+GtB,CAAA;AAED;qBAAe,2CAAiB,CAAC,UAAU,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/broccoli/broccoli-replace.js b/lib/broccoli/broccoli-replace.js index 10b529cc504e..9fde024bda65 100644 --- a/lib/broccoli/broccoli-replace.js +++ b/lib/broccoli/broccoli-replace.js @@ -1,3 +1,4 @@ +"use strict"; var fs = require('fs'); var fse = require('fs-extra'); var path = require('path'); @@ -55,8 +56,7 @@ var DiffingReplace = (function () { }); }; return DiffingReplace; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = diffing_broccoli_plugin_1.wrapDiffingPlugin(DiffingReplace); - -//# sourceMappingURL=broccoli-replace.js.map +}()); +exports.__esModule = true; +exports["default"] = diffing_broccoli_plugin_1.wrapDiffingPlugin(DiffingReplace); +//# sourceMappingURL=broccoli-replace.js.map \ No newline at end of file diff --git a/lib/broccoli/broccoli-replace.js.map b/lib/broccoli/broccoli-replace.js.map index 62c00cbf695c..6561a83f0a72 100644 --- a/lib/broccoli/broccoli-replace.js.map +++ b/lib/broccoli/broccoli-replace.js.map @@ -1 +1 @@ -{"version":3,"sources":["broccoli/broccoli-replace.ts"],"names":["DiffingReplace","DiffingReplace.constructor","DiffingReplace.rebuild"],"mappings":"AAAA,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AAC1B,IAAO,GAAG,WAAW,UAAU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A,IAAIA,CAACA,IAAIA,CAACA,KAAIA,CAACA,SAASA,EAAEA,eAAeA,CAACA,CAACA;YAC9DA,EAAEA,CAACA,UAAUA,CAACA,YAAYA,CAACA,CAACA;QAC9BA,CAACA,CAACA,CAACA;IACLA,CAACA;IACHF,qBAACA;AAADA,CA5CA,AA4CCA,IAAA;AAED;kBAAe,2CAAiB,CAAC,cAAc,CAAC,CAAC","file":"broccoli/broccoli-replace.js","sourcesContent":["import fs = require('fs');\nimport fse = require('fs-extra');\nimport path = require('path');\nimport {wrapDiffingPlugin, DiffingBroccoliPlugin, DiffResult} from './diffing-broccoli-plugin';\n\nvar minimatch = require('minimatch');\nvar FILE_ENCODING = {encoding: 'utf-8'};\n\n/**\n * Intercepts each changed file and replaces its contents with\n * the associated changes.\n */\nclass DiffingReplace implements DiffingBroccoliPlugin {\n constructor(private inputPath, private cachePath, private options) {}\n\n rebuild(treeDiff: DiffResult) {\n var patterns = this.options.patterns;\n var files = this.options.files;\n\n treeDiff.addedPaths.concat(treeDiff.changedPaths)\n .forEach((changedFilePath) => {\n var sourceFilePath = path.join(this.inputPath, changedFilePath);\n var destFilePath = path.join(this.cachePath, changedFilePath);\n var destDirPath = path.dirname(destFilePath);\n\n if (!fs.existsSync(destDirPath)) {\n fse.mkdirpSync(destDirPath);\n }\n\n var fileMatches = files.some((filePath) => minimatch(changedFilePath, filePath));\n if (fileMatches) {\n var content = fs.readFileSync(sourceFilePath, FILE_ENCODING);\n patterns.forEach((pattern) => {\n var replacement = pattern.replacement;\n if (typeof replacement === 'function') {\n replacement = function(content) {\n return pattern.replacement(content, changedFilePath);\n };\n }\n content = content.replace(pattern.match, replacement);\n });\n fs.writeFileSync(destFilePath, content, FILE_ENCODING);\n } else if (!fs.existsSync(destFilePath)) {\n try {\n fs.symlinkSync(sourceFilePath, destFilePath);\n } catch (e) {\n fs.writeFileSync(destFilePath, fs.readFileSync(sourceFilePath));\n }\n }\n });\n\n treeDiff.removedPaths.forEach((removedFilePath) => {\n var destFilePath = path.join(this.cachePath, removedFilePath);\n fs.unlinkSync(destFilePath);\n });\n }\n}\n\nexport default wrapDiffingPlugin(DiffingReplace);\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"file":"broccoli-replace.js","sourceRoot":"","sources":["broccoli-replace.ts"],"names":[],"mappings":";AAAA,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AAC1B,IAAO,GAAG,WAAW,UAAU,CAAC,CAAC;AACjC,IAAO,IAAI,WAAW,MAAM,CAAC,CAAC;AAC9B,wCAAmE,2BAA2B,CAAC,CAAA;AAE/F,IAAI,SAAS,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;AACrC,IAAI,aAAa,GAAG,EAAC,QAAQ,EAAE,OAAO,EAAC,CAAC;AAExC;;;GAGG;AACH;IACE,wBAAoB,SAAS,EAAU,SAAS,EAAU,OAAO;QAA7C,cAAS,GAAT,SAAS,CAAA;QAAU,cAAS,GAAT,SAAS,CAAA;QAAU,YAAO,GAAP,OAAO,CAAA;IAAG,CAAC;IAErE,gCAAO,GAAP,UAAQ,QAAoB;QAA5B,iBAwCC;QAvCC,IAAI,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC;QACrC,IAAI,KAAK,GAAG,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC;QAE/B,QAAQ,CAAC,UAAU,CAAC,MAAM,CAAC,QAAQ,CAAC,YAAY,CAAC;aAC5C,OAAO,CAAC,UAAC,eAAe;YACvB,IAAI,cAAc,GAAG,IAAI,CAAC,IAAI,CAAC,KAAI,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;YAChE,IAAI,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,KAAI,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;YAC9D,IAAI,WAAW,GAAG,IAAI,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;YAE7C,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,UAAU,CAAC,WAAW,CAAC,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,YAAY,CAAC,OAAO,CAAC,UAAC,eAAe;YAC5C,IAAI,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,KAAI,CAAC,SAAS,EAAE,eAAe,CAAC,CAAC;YAC9D,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;QAC9B,CAAC,CAAC,CAAC;IACL,CAAC;IACH,qBAAC;AAAD,CAAC,AA5CD,IA4CC;AAED;qBAAe,2CAAiB,CAAC,cAAc,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/broccoli/broccoli-tree-stabilizer.js b/lib/broccoli/broccoli-tree-stabilizer.js index d7de6f5634df..2dd177d2f5ed 100644 --- a/lib/broccoli/broccoli-tree-stabilizer.js +++ b/lib/broccoli/broccoli-tree-stabilizer.js @@ -1,5 +1,6 @@ /// /// +"use strict"; var fs = require('fs'); var symlinkOrCopy = require('symlink-or-copy'); /** @@ -28,11 +29,10 @@ var TreeStabilizer = (function () { }; TreeStabilizer.prototype.cleanup = function () { }; return TreeStabilizer; -})(); +}()); function stabilizeTree(inputTree) { return new TreeStabilizer(inputTree); } -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = stabilizeTree; - -//# sourceMappingURL=broccoli-tree-stabilizer.js.map +exports.__esModule = true; +exports["default"] = stabilizeTree; +//# sourceMappingURL=broccoli-tree-stabilizer.js.map \ No newline at end of file diff --git a/lib/broccoli/broccoli-tree-stabilizer.js.map b/lib/broccoli/broccoli-tree-stabilizer.js.map index 16a844e329d0..fd154bff28c8 100644 --- a/lib/broccoli/broccoli-tree-stabilizer.js.map +++ b/lib/broccoli/broccoli-tree-stabilizer.js.map @@ -1 +1 @@ -{"version":3,"sources":["broccoli/broccoli-tree-stabilizer.ts"],"names":["TreeStabilizer","TreeStabilizer.constructor","TreeStabilizer.rebuild","TreeStabilizer.cleanup","stabilizeTree"],"mappings":"AAAA,sCAAsC;AACtC,kDAAkD;AAElD,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AAC1B,IAAI,aAAa,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAG/C;;;;;;;;;;;;;GAaG;AACH;IAKEA,wBAAmBA,SAAuBA;QAAvBC,cAASA,GAATA,SAASA,CAAcA;IAAGA,CAACA;IAG9CD,gCAAOA,GAAPA;QACEE,EAAEA,CAACA,SAASA,CAACA,IAAIA,CAACA,UAAUA,CAACA,CAACA;QAE9BA,yFAAyFA;QACzFA,UAAUA;QACVA,aAAaA,CAACA,IAAIA,CAACA,IAAIA,CAACA,SAASA,EAAEA,IAAIA,CAACA,UAAUA,CAACA,CAACA;IACtDA,CAACA;IAGDF,gCAAOA,GAAPA,cAAWG,CAACA;IACdH,qBAACA;AAADA,CAlBA,AAkBCA,IAAA;AAGD,uBAAsC,SAAS;IAC7CI,MAAMA,CAACA,IAAIA,cAAcA,CAACA,SAASA,CAACA,CAACA;AACvCA,CAACA;AAFD;+BAEC,CAAA","file":"broccoli/broccoli-tree-stabilizer.js","sourcesContent":["/// \n/// \n\nimport fs = require('fs');\nlet symlinkOrCopy = require('symlink-or-copy');\n\n\n/**\n * Stabilizes the inputPath for the following plugins in the build tree.\n *\n * All broccoli plugins that inherit from `broccoli-writer` or `broccoli-filter` change their\n * outputPath during each rebuild.\n *\n * This means that all following plugins in the build tree can't rely on their inputPath being\n * immutable. This results in breakage of any plugin that is not expecting such behavior.\n *\n * For example all `DiffingBroccoliPlugin`s expect their inputPath to be stable.\n *\n * By inserting this plugin into the tree after any misbehaving plugin, we can stabilize the\n * inputPath for the following plugin in the tree and correct the surprising behavior.\n */\nclass TreeStabilizer implements BroccoliTree {\n inputPath: string;\n outputPath: string;\n\n\n constructor(public inputTree: BroccoliTree) {}\n\n\n rebuild() {\n fs.rmdirSync(this.outputPath);\n\n // TODO: investigate if we can use rename the directory instead to improve performance on\n // Windows\n symlinkOrCopy.sync(this.inputPath, this.outputPath);\n }\n\n\n cleanup() {}\n}\n\n\nexport default function stabilizeTree(inputTree) {\n return new TreeStabilizer(inputTree);\n}\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"file":"broccoli-tree-stabilizer.js","sourceRoot":"","sources":["broccoli-tree-stabilizer.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,kDAAkD;;AAElD,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AAC1B,IAAI,aAAa,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAG/C;;;;;;;;;;;;;GAaG;AACH;IAKE,wBAAmB,SAAuB;QAAvB,cAAS,GAAT,SAAS,CAAc;IAAG,CAAC;IAG9C,gCAAO,GAAP;QACE,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAE9B,yFAAyF;QACzF,UAAU;QACV,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACtD,CAAC;IAGD,gCAAO,GAAP,cAAW,CAAC;IACd,qBAAC;AAAD,CAAC,AAlBD,IAkBC;AAGD,uBAAsC,SAAS;IAC7C,MAAM,CAAC,IAAI,cAAc,CAAC,SAAS,CAAC,CAAC;AACvC,CAAC;AAFD;kCAEC,CAAA"} \ No newline at end of file diff --git a/lib/broccoli/broccoli-typescript.js b/lib/broccoli/broccoli-typescript.js index fdd45adadb1f..ba4d9016aec4 100644 --- a/lib/broccoli/broccoli-typescript.js +++ b/lib/broccoli/broccoli-typescript.js @@ -1,13 +1,30 @@ /// +"use strict"; var fs = require('fs'); var fse = require('fs-extra'); var path = require('path'); var ts = require('typescript'); var diffing_broccoli_plugin_1 = require('./diffing-broccoli-plugin'); -var notifier = require('node-notifier'); var FS_OPTS = { encoding: 'utf-8' }; +// Sub-directory where the @internal typing files (.d.ts) are stored +exports.INTERNAL_TYPINGS_PATH = 'internal_typings'; +// Monkey patch the TS compiler to be able to re-emit files with @internal symbols +var tsEmitInternal = false; +var originalEmitFiles = ts.emitFiles; +ts.emitFiles = function (resolver, host, targetSourceFile) { + if (tsEmitInternal) { + var orignalgetCompilerOptions_1 = host.getCompilerOptions; + host.getCompilerOptions = function () { + var options = clone(orignalgetCompilerOptions_1.call(host)); + options.stripInternal = false; + options.outDir = options.outDir + "/" + exports.INTERNAL_TYPINGS_PATH; + return options; + }; + } + return originalEmitFiles(resolver, host, targetSourceFile); +}; /** * Broccoli plugin that implements incremental Typescript compiler. * @@ -26,6 +43,9 @@ var DiffingTSCompiler = (function () { this.fileRegistry = Object.create(null); this.firstRun = true; this.previousRunFailed = false; + // Whether to generate the @internal typing files (they are only generated when `stripInternal` is + // true) + this.genInternalTypings = false; if (options.rootFilePaths) { this.rootFilePaths = options.rootFilePaths.splice(0); delete options.rootFilePaths; @@ -33,10 +53,18 @@ var DiffingTSCompiler = (function () { else { this.rootFilePaths = []; } + if (options.internalTypings) { + this.genInternalTypings = true; + delete options.internalTypings; + } // the conversion is a bit awkward, see https://github.com/Microsoft/TypeScript/issues/5276 // in 1.8 use convertCompilerOptionsFromJson this.tsOpts = ts.parseJsonConfigFileContent({ compilerOptions: options, files: [] }, null, null).options; + if (this.tsOpts.stripInternal === false) { + // @internal are included in the generated .d.ts, do not generate them separately + this.genInternalTypings = false; + } // TODO: the above turns rootDir set to './' into an empty string - looks like a tsc bug // check back when we upgrade to 1.7.x if (this.tsOpts.rootDir === '') { @@ -45,7 +73,6 @@ var DiffingTSCompiler = (function () { this.tsOpts.outDir = this.cachePath; this.tsServiceHost = new CustomLanguageServiceHost(this.tsOpts, this.rootFilePaths, this.fileRegistry, this.inputPath); this.tsService = ts.createLanguageService(this.tsServiceHost, ts.createDocumentRegistry()); - this.config = require(path.resolve(this.cachePath, '..', '..', 'package.json')); } DiffingTSCompiler.prototype.rebuild = function (treeDiff) { var _this = this; @@ -74,6 +101,7 @@ var DiffingTSCompiler = (function () { this.doFullBuild(); } else { + tsEmitInternal = false; pathsToEmit.forEach(function (tsFilePath) { var output = _this.tsService.getEmitOutput(tsFilePath); if (output.emitSkipped) { @@ -95,12 +123,28 @@ var DiffingTSCompiler = (function () { this.previousRunFailed = true; var error = new Error('Typescript found the following errors:\n' + errorMessages.join('\n')); error['showStack'] = false; - this.showNotification(errorMessages); throw error; } else if (this.previousRunFailed) { this.doFullBuild(); } + else if (this.genInternalTypings) { + // serialize the .d.ts files containing @internal symbols + tsEmitInternal = true; + pathsToEmit.forEach(function (tsFilePath) { + var output = _this.tsService.getEmitOutput(tsFilePath); + if (!output.emitSkipped) { + output.outputFiles.forEach(function (o) { + if (endsWith(o.name, '.d.ts')) { + var destDirPath = path.dirname(o.name); + fse.mkdirsSync(destDirPath); + fs.writeFileSync(o.name, _this.fixSourceMapSources(o.text), FS_OPTS); + } + }); + } + }); + tsEmitInternal = false; + } } }; DiffingTSCompiler.prototype.collectErrors = function (tsFilePath) { @@ -125,13 +169,25 @@ var DiffingTSCompiler = (function () { DiffingTSCompiler.prototype.doFullBuild = function () { var _this = this; var program = this.tsService.getProgram(); + tsEmitInternal = false; var emitResult = program.emit(undefined, function (absoluteFilePath, fileContent) { fse.mkdirsSync(path.dirname(absoluteFilePath)); fs.writeFileSync(absoluteFilePath, _this.fixSourceMapSources(fileContent), FS_OPTS); }); + if (this.genInternalTypings) { + // serialize the .d.ts files containing @internal symbols + tsEmitInternal = true; + program.emit(undefined, function (absoluteFilePath, fileContent) { + if (endsWith(absoluteFilePath, '.d.ts')) { + fse.mkdirsSync(path.dirname(absoluteFilePath)); + fs.writeFileSync(absoluteFilePath, fileContent, FS_OPTS); + } + }); + tsEmitInternal = false; + } if (emitResult.emitSkipped) { var allDiagnostics = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics); - var errorMessages = []; + var errorMessages_1 = []; allDiagnostics.forEach(function (diagnostic) { var pos = ''; if (diagnostic.file) { @@ -139,13 +195,12 @@ var DiffingTSCompiler = (function () { pos = diagnostic.file.fileName + " (" + (line + 1) + ", " + (character + 1) + "): "; } var message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\n'); - errorMessages.push(" " + pos + message); + errorMessages_1.push(" " + pos + message); }); - if (errorMessages.length) { + if (errorMessages_1.length) { this.previousRunFailed = true; - var error = new Error('Typescript found the following errors:\n' + errorMessages.join('\n')); + var error = new Error('Typescript found the following errors:\n' + errorMessages_1.join('\n')); error['showStack'] = false; - this.showNotification(errorMessages); throw error; } else { @@ -186,29 +241,17 @@ var DiffingTSCompiler = (function () { var absoluteDtsFilePath = path.join(this.cachePath, tsFilePath.replace(/\.ts$/, '.d.ts')); if (fs.existsSync(absoluteJsFilePath)) { fs.unlinkSync(absoluteJsFilePath); - fs.unlinkSync(absoluteMapFilePath); + if (fs.existsSync(absoluteMapFilePath)) { + // source map could be inline or not generated + fs.unlinkSync(absoluteMapFilePath); + } fs.unlinkSync(absoluteDtsFilePath); } }; - - DiffingTSCompiler.prototype.showNotification = function (errorMessages) { - if (!this.config['angular-cli'].notifications.enabled) { - return; - } - - notifier.notify({ - title: 'Build Errors: ' + errorMessages.length, - message: errorMessages.map(function (msg) { return msg.trim(); }).join('\n'), - icon: path.resolve(__dirname, '..', '..', 'assets', 'angular.png'), - sound: this.config['angular-cli'].notifications.playSound, - wait: false - }); - }; - DiffingTSCompiler.includeExtensions = ['.ts']; DiffingTSCompiler.excludeExtensions = ['.d.ts']; return DiffingTSCompiler; -})(); +}()); var CustomLanguageServiceHost = (function () { function CustomLanguageServiceHost(compilerOptions, fileNames, fileRegistry, treeInputPath) { this.compilerOptions = compilerOptions; @@ -268,8 +311,17 @@ var CustomLanguageServiceHost = (function () { return this.defaultLibFilePath; }; return CustomLanguageServiceHost; -})(); -Object.defineProperty(exports, "__esModule", { value: true }); -exports.default = diffing_broccoli_plugin_1.wrapDiffingPlugin(DiffingTSCompiler); - -//# sourceMappingURL=broccoli-typescript.js.map +}()); +exports.__esModule = true; +exports["default"] = diffing_broccoli_plugin_1.wrapDiffingPlugin(DiffingTSCompiler); +function clone(object) { + var result = {}; + for (var id in object) { + result[id] = object[id]; + } + return result; +} +function endsWith(str, substring) { + return str.indexOf(substring, str.length - substring.length) !== -1; +} +//# sourceMappingURL=broccoli-typescript.js.map \ No newline at end of file diff --git a/lib/broccoli/broccoli-typescript.js.map b/lib/broccoli/broccoli-typescript.js.map index dd501914e71f..b4427f9782bd 100644 --- a/lib/broccoli/broccoli-typescript.js.map +++ b/lib/broccoli/broccoli-typescript.js.map @@ -1 +1 @@ -{"version":3,"sources":["broccoli/broccoli-typescript.ts"],"names":["DiffingTSCompiler","DiffingTSCompiler.constructor","DiffingTSCompiler.rebuild","DiffingTSCompiler.collectErrors","DiffingTSCompiler.doFullBuild","DiffingTSCompiler.fixSourceMapSources","DiffingTSCompiler.removeOutputFor","CustomLanguageServiceHost","CustomLanguageServiceHost.constructor","CustomLanguageServiceHost.getScriptFileNames","CustomLanguageServiceHost.getScriptVersion","CustomLanguageServiceHost.getScriptSnapshot","CustomLanguageServiceHost.getCurrentDirectory","CustomLanguageServiceHost.getCompilationSettings","CustomLanguageServiceHost.getDefaultLibFileName"],"mappings":"AAAA,kDAAkD;AAElD,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AAC1B,IAAO,GAAG,WAAW,UAAU,CAAC,CAAC;AACjC,IAAO,IAAI,WAAW,MAAM,CAAC,CAAC;AAC9B,IAAY,EAAE,WAAM,YAAY,CAAC,CAAA;AACjC,wCAAmE,2BAA2B,CAAC,CAAA;AAK/F,IAAM,OAAO,GAAG;IACd,QAAQ,EAAE,OAAO;CAClB,CAAC;AAGF;;;;;;;;;GASG;AACH;IAYEA,2BAAmBA,SAAiBA,EAASA,SAAiBA,EAASA,OAAOA;QAA3DC,cAASA,GAATA,SAASA,CAAQA;QAASA,cAASA,GAATA,SAASA,CAAQA;QAASA,YAAOA,GAAPA,OAAOA,CAAAA;QAVtEA,iBAAYA,GAAiBA,MAAMA,CAACA,MAAMA,CAACA,IAAIA,CAACA,CAACA;QAIjDA,aAAQA,GAAYA,IAAIA,CAACA;QACzBA,sBAAiBA,GAAYA,KAAKA,CAACA;QAMzCA,EAAEA,CAACA,CAACA,OAAOA,CAACA,aAAaA,CAACA,CA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AAEA,CAACA;QAEvBA,QAAQA,CAACA,UAAUA,CAACA,MAAMA,CAACA,QAAQA,CAACA,YAAYA,CAACA;aAC5CA,OAAOA,CAACA,UAACA,UAAUA;YAClBA,EAAEA,CAACA,CAACA,CAACA,KAAIA,CAACA,YAAYA,CAACA,UAAUA,CAACA,CAACA,CAACA,CAACA;gBACnCA,KAAIA,CAACA,YAAYA,CAACA,UAAUA,CAACA,GAAGA,EAACA,OAAOA,EAAEA,CAACA,EAACA,CAACA;gBAC7CA,KAAIA,CAACA,aAAaA,CAACA,IAAIA,CAACA,UAAUA,CAACA,CAACA;YACtCA,CAACA;YAACA,IAAIA,CAACA,CAACA;gBACNA,KAAIA,CAACA,YAAYA,CAACA,UAAUA,CAACA,CAACA,OAAOA,EAAEA,CAACA;YAC1CA,CAACA;YAEDA,WAAWA,CAACA,IAAIA,CAACA,UAAUA,CAACA,CAACA;QAC/BA,CAACA,CAACA,CAACA;QAEPA,QAAQA,CAACA,YAAYA,CAACA,OAAOA,CAACA,UAACA,UAAUA;YACvCA,OAAOA,CAACA,GAAGA,CAACA,sBAAsBA,EAAEA,UAAUA,CAACA,CAACA;YAEhDA,KAAIA,CAACA,aAAaA,CAACA,MAAMA,CAACA,KAAIA,CAACA,aAAaA,CAACA,OAAOA,CAACA,UAAUA,CAACA,EAAEA,CAACA,CAACA,CAACA;YACrEA,KAAIA,CAACA,YAAYA,CAACA,UAAUA,CAACA,GAAGA,IAAIA,CAACA;YACrCA,KAAIA,CAACA,eAAeA,CAACA,UAAUA,CAACA,CAACA;QACnCA,CAACA,CAACA,CAACA;QAEHA,EAAEA,CAACA,CAACA,IAAIA,CAACA,QAAQA,CAACA,CAACA,CAACA;YAClBA,IAAIA,CAACA,QAAQA,GAAGA,KAAKA,CAACA;YACtBA,IAAIA,CAACA,WAAWA,EAAEA,CAACA;QACrBA,CAACA;QAACA,IAAIA,CAACA,CAACA;YACNA,WAAWA,CAACA,OAAOA,CAACA,UAACA,UAAUA;gBAC7BA,IAAIA,MAAMA,GAAGA,KAAIA,CAACA,SAASA,CAACA,aAAaA,CAACA,UAAUA,CAACA,CAACA;gBAEtDA,EAAEA,CAACA,CAACA,MAAMA,CAACA,WAAWA,CAACA,CAACA,CAACA;oBACvBA,IAAIA,UAAUA,GAAGA,KAAIA,CAACA,aAAaA,CAACA,UAAUA,CAACA,CAACA;oBAChDA,EAAEA,CAACA,CAACA,UAAUA,CAACA,CAACA,CAACA;wBACfA,eAAeA,CAACA,IAAIA,CAACA,UAAUA,CAACA,CAACA;wBACjCA,aAAaA,CAACA,IAAIA,CAACA,UAAUA,CAACA,CAACA;oBACjCA,CAACA;gBACHA,CAACA;gBAACA,IAAIA,CAACA,CAACA;oBACNA,MAAMA,CAACA,WAAWA,CAACA,OAAOA,CAACA,UAAAA,CAACA;wBAC1BA,IAAIA,WAAWA,GAAGA,IAAIA,CAACA,OAAOA,CAACA,CAACA,CAACA,IAAIA,CAACA,CAACA;wBACvCA,GAAGA,CAACA,UAAUA,CAACA,WAAWA,CAACA,CAACA;wBAC5BA,EAAEA,CAACA,aAAaA,CAACA,CAACA,CAACA,IAAIA,EAAEA,KAAIA,CAACA,mBAAmBA,CAACA,CAACA,CAACA,IAAIA,CAACA,EAAEA,OAAOA,CAACA,CAACA;oBACtEA,CAACA,CAACA,CAACA;gBACLA,CAACA;YACHA,CAACA,CAACA,CAACA;YAEHA,EAAEA,CAACA,CAACA,eAAeA,CAACA,MAAMA,CAACA,CAACA,CAACA;gBAC3BA,IAAIA,CAACA,iBAAiBA,GAAGA,IAAIA,CAACA;gBAC9BA,IAAIA,KAAKA,GACLA,IAAIA,KAAKA,CAACA,0CAA0CA,GAAGA,aAAaA,CAACA,IAAIA,CAACA,IAAIA,CAACA,CAACA,CAACA;gBACrFA,KAAKA,CAACA,WAAWA,CAACA,GAAGA,KAAKA,CAACA;gBAC3BA,MAAMA,KAAKA,CAACA;YACdA,CAACA;YAACA,IAAIA,CAACA,EAAEA,CAACA,CAACA,IAAIA,CAACA,i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A8BA;YACxEA,UAAUA,CAACA,KAAKA,CAACA,eAAeA,CAACA,CAACA,CAACA,CAACA;YAC7CA,kBAAkBA,GAAGA,IAAIA,CAACA,OAAOA,CAACA,UAAUA,CAACA,CAACA;QAChDA,CAACA;QAACA,IAAIA,CAACA,EAAEA,CAACA,CAACA,UAAUA,CAACA,KAAKA,CAACA,OAAOA,CAACA,CAACA,CAACA,CAACA;YACrCA,kBAAkBA,GAAGA,IAAIA,CAACA,OAAOA,CAACA,cAAcA,EAAEA,UAAUA,CAACA,CAACA;QAChEA,CAACA;QAACA,IAAIA,CAACA,CAACA;YACNA,kBAAkBA,GAAGA,IAAIA,CAACA,IAAIA,CAACA,IAAIA,CAACA,aAAaA,EAAEA,UAAUA,CAACA,CAACA;QACjEA,CAACA;QAGDA,EAAEA,CAACA,CAACA,CAACA,EAAEA,CAACA,UAAUA,CAACA,kBAAkBA,CAACA,CAACA,CAACA,CAACA;YACvCA,4FAA4FA;YAC5FA,+DAA+DA;YAC/DA,MAAMA,CAACA,SAASA,CAACA;QACnBA,CAACA;QACDA,MAAMA,CAACA,EAAEA,CAACA,cAAcA,CAACA,UAAUA,CAACA,EAAEA,CAACA,YAAYA,CAACA,kBAAkBA,EAAEA,OAAOA,CAACA,CAACA,CAACA;IACpFA,CAACA;IAGDJ,uDAAmBA,GAAnBA,cAAgCK,MAAMA,CAACA,IAAIA,CAACA,gBAAgBA,CAACA,CAACA,CAACA;IAE/DL,0DAAsBA,GAAtBA,cAA+CM,MAAMA,CAACA,IAAIA,CAACA,eAAeA,CAACA,CAACA,CAACA;IAE7EN,yDAAqBA,GAArBA,UAAsBA,OAA2BA;QAC/CO,uFAAuFA;QACvFA,MAAMA,CAACA,IAAIA,CAACA,kBAAkBA,CAACA;IACjCA,CAACA;IACHP,gCAACA;AAADA,CArEA,AAqECA,IAAA;AAGD;kBAAe,2CAAiB,CAAC,iBAAiB,CAAC,CAAC","file":"broccoli/broccoli-typescript.js","sourcesContent":["/// \n\nimport fs = require('fs');\nimport fse = require('fs-extra');\nimport path = require('path');\nimport * as ts from 'typescript';\nimport {wrapDiffingPlugin, DiffingBroccoliPlugin, DiffResult} from './diffing-broccoli-plugin';\n\n\ntype FileRegistry = ts.Map<{version: number}>;\n\nconst FS_OPTS = {\n encoding: 'utf-8'\n};\n\n\n/**\n * Broccoli plugin that implements incremental Typescript compiler.\n *\n * It instantiates a typescript compiler instance that keeps all the state about the project and\n * can re-emit only the files that actually changed.\n *\n * Limitations: only files that map directly to the changed source file via naming conventions are\n * re-emitted. This primarily affects code that uses `const enum`s, because changing the enum value\n * requires global emit, which can affect many files.\n */\nclass DiffingTSCompiler implements DiffingBroccoliPlugin {\n private tsOpts: ts.CompilerOptions;\n private fileRegistry: FileRegistry = Object.create(null);\n private rootFilePaths: string[];\n private tsServiceHost: ts.LanguageServiceHost;\n private tsService: ts.LanguageService;\n private firstRun: boolean = true;\n private previousRunFailed: boolean = false;\n\n static includeExtensions = ['.ts'];\n static excludeExtensions = ['.d.ts'];\n\n constructor(public inputPath: string, public cachePath: string, public options) {\n if (options.rootFilePaths) {\n this.rootFilePaths = options.rootFilePaths.splice(0);\n delete options.rootFilePaths;\n } else {\n this.rootFilePaths = [];\n }\n\n // the conversion is a bit awkward, see https://github.com/Microsoft/TypeScript/issues/5276\n // in 1.8 use convertCompilerOptionsFromJson\n this.tsOpts =\n ts.parseJsonConfigFileContent({compilerOptions: options, files: []}, null, null).options;\n\n // TODO: the above turns rootDir set to './' into an empty string - looks like a tsc bug\n // check back when we upgrade to 1.7.x\n if (this.tsOpts.rootDir === '') {\n this.tsOpts.rootDir = './';\n }\n this.tsOpts.outDir = this.cachePath;\n\n this.tsServiceHost = new CustomLanguageServiceHost(this.tsOpts, this.rootFilePaths,\n this.fileRegistry, this.inputPath);\n this.tsService = ts.createLanguageService(this.tsServiceHost, ts.createDocumentRegistry());\n }\n\n\n rebuild(treeDiff: DiffResult) {\n let pathsToEmit = [];\n let pathsWithErrors = [];\n let errorMessages = [];\n\n treeDiff.addedPaths.concat(treeDiff.changedPaths)\n .forEach((tsFilePath) => {\n if (!this.fileRegistry[tsFilePath]) {\n this.fileRegistry[tsFilePath] = {version: 0};\n this.rootFilePaths.push(tsFilePath);\n } else {\n this.fileRegistry[tsFilePath].version++;\n }\n\n pathsToEmit.push(tsFilePath);\n });\n\n treeDiff.removedPaths.forEach((tsFilePath) => {\n console.log('removing outputs for', tsFilePath);\n\n this.rootFilePaths.splice(this.rootFilePaths.indexOf(tsFilePath), 1);\n this.fileRegistry[tsFilePath] = null;\n this.removeOutputFor(tsFilePath);\n });\n\n if (this.firstRun) {\n this.firstRun = false;\n this.doFullBuild();\n } else {\n pathsToEmit.forEach((tsFilePath) => {\n let output = this.tsService.getEmitOutput(tsFilePath);\n\n if (output.emitSkipped) {\n let errorFound = this.collectErrors(tsFilePath);\n if (errorFound) {\n pathsWithErrors.push(tsFilePath);\n errorMessages.push(errorFound);\n }\n } else {\n output.outputFiles.forEach(o => {\n let destDirPath = path.dirname(o.name);\n fse.mkdirsSync(destDirPath);\n fs.writeFileSync(o.name, this.fixSourceMapSources(o.text), FS_OPTS);\n });\n }\n });\n\n if (pathsWithErrors.length) {\n this.previousRunFailed = true;\n var error =\n new Error('Typescript found the following errors:\\n' + errorMessages.join('\\n'));\n error['showStack'] = false;\n throw error;\n } else if (this.previousRunFailed) {\n this.doFullBuild();\n }\n }\n }\n\n\n private collectErrors(tsFilePath): String {\n let allDiagnostics = this.tsService.getCompilerOptionsDiagnostics()\n .concat(this.tsService.getSyntacticDiagnostics(tsFilePath))\n .concat(this.tsService.getSemanticDiagnostics(tsFilePath));\n let errors = [];\n\n allDiagnostics.forEach(diagnostic => {\n let message = ts.flattenDiagnosticMessageText(diagnostic.messageText, \"\\n\");\n if (diagnostic.file) {\n let {line, character} = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);\n errors.push(` ${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`);\n } else {\n errors.push(` Error: ${message}`);\n }\n });\n\n if (errors.length) {\n return errors.join('\\n');\n }\n }\n\n\n private doFullBuild() {\n let program = this.tsService.getProgram();\n let emitResult = program.emit(undefined, (absoluteFilePath, fileContent) => {\n fse.mkdirsSync(path.dirname(absoluteFilePath));\n fs.writeFileSync(absoluteFilePath, this.fixSourceMapSources(fileContent), FS_OPTS);\n });\n\n if (emitResult.emitSkipped) {\n let allDiagnostics = ts.getPreEmitDiagnostics(program).concat(emitResult.diagnostics);\n let errorMessages = [];\n\n allDiagnostics.forEach(diagnostic => {\n var pos = '';\n if (diagnostic.file) {\n var {line, character} = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);\n pos = `${diagnostic.file.fileName} (${line + 1}, ${character + 1}): `\n }\n var message = ts.flattenDiagnosticMessageText(diagnostic.messageText, '\\n');\n errorMessages.push(` ${pos}${message}`);\n });\n\n if (errorMessages.length) {\n this.previousRunFailed = true;\n var error =\n new Error('Typescript found the following errors:\\n' + errorMessages.join('\\n'));\n error['showStack'] = false;\n throw error;\n } else {\n this.previousRunFailed = false;\n }\n }\n }\n\n /**\n * There is a bug in TypeScript 1.6, where the sourceRoot and inlineSourceMap properties\n * are exclusive. This means that the sources property always contains relative paths\n * (e.g, ../../../../angular2/src/di/injector.ts).\n *\n * Here, we normalize the sources property and remove the ../../../\n *\n * This issue is fixed in https://github.com/Microsoft/TypeScript/pull/5620.\n * Once we switch to TypeScript 1.8, we can remove this method.\n */\n private fixSourceMapSources(content: string): string {\n try {\n const marker = \"//# sourceMappingURL=data:application/json;base64,\";\n const index = content.indexOf(marker);\n if (index == -1) return content;\n\n const base = content.substring(0, index + marker.length);\n const sourceMapBit =\n new Buffer(content.substring(index + marker.length), 'base64').toString(\"utf8\");\n const sourceMaps = JSON.parse(sourceMapBit);\n const source = sourceMaps.sources[0];\n sourceMaps.sources = [source.substring(source.lastIndexOf(\"../\") + 3)];\n return `${base}${new Buffer(JSON.stringify(sourceMaps)).toString('base64')}`;\n } catch (e) {\n return content;\n }\n }\n\n private removeOutputFor(tsFilePath: string) {\n let absoluteJsFilePath = path.join(this.cachePath, tsFilePath.replace(/\\.ts$/, '.js'));\n let absoluteMapFilePath = path.join(this.cachePath, tsFilePath.replace(/.ts$/, '.js.map'));\n let absoluteDtsFilePath = path.join(this.cachePath, tsFilePath.replace(/\\.ts$/, '.d.ts'));\n\n if (fs.existsSync(absoluteJsFilePath)) {\n fs.unlinkSync(absoluteJsFilePath);\n fs.unlinkSync(absoluteMapFilePath);\n fs.unlinkSync(absoluteDtsFilePath);\n }\n }\n}\n\n\nclass CustomLanguageServiceHost implements ts.LanguageServiceHost {\n private currentDirectory: string;\n private defaultLibFilePath: string;\n\n\n constructor(private compilerOptions: ts.CompilerOptions, private fileNames: string[],\n private fileRegistry: FileRegistry, private treeInputPath: string) {\n this.currentDirectory = process.cwd();\n this.defaultLibFilePath = ts.getDefaultLibFilePath(compilerOptions).replace(/\\\\/g, '/');\n }\n\n\n getScriptFileNames(): string[] { return this.fileNames; }\n\n\n getScriptVersion(fileName: string): string {\n return this.fileRegistry[fileName] && this.fileRegistry[fileName].version.toString();\n }\n\n\n /**\n * This method is called quite a bit to lookup 3 kinds of paths:\n * 1/ files in the fileRegistry\n * - these are the files in our project that we are watching for changes\n * - in the future we could add caching for these files and invalidate the cache when\n * the file is changed lazily during lookup\n * 2/ .d.ts and library files not in the fileRegistry\n * - these are not our files, they come from tsd or typescript itself\n * - these files change only rarely but since we need them very rarely, it's not worth the\n * cache invalidation hassle to cache them\n * 3/ bogus paths that typescript compiler tries to lookup during import resolution\n * - these paths are tricky to cache since files come and go and paths that was bogus in the\n * past might not be bogus later\n *\n * In the initial experiments the impact of this caching was insignificant (single digit %) and\n * not worth the potential issues with stale cache records.\n */\n getScriptSnapshot(tsFilePath: string): ts.IScriptSnapshot {\n let absoluteTsFilePath;\n\n if (tsFilePath == this.defaultLibFilePath || path.isAbsolute(tsFilePath)) {\n absoluteTsFilePath = tsFilePath;\n } else if (this.compilerOptions.moduleResolution === ts.ModuleResolutionKind.NodeJs &&\n tsFilePath.match(/^node_modules/)) {\n absoluteTsFilePath = path.resolve(tsFilePath);\n } else if (tsFilePath.match(/^rxjs/)) {\n absoluteTsFilePath = path.resolve('node_modules', tsFilePath);\n } else {\n absoluteTsFilePath = path.join(this.treeInputPath, tsFilePath);\n }\n\n\n if (!fs.existsSync(absoluteTsFilePath)) {\n // TypeScript seems to request lots of bogus paths during import path lookup and resolution,\n // so we we just return undefined when the path is not correct.\n return undefined;\n }\n return ts.ScriptSnapshot.fromString(fs.readFileSync(absoluteTsFilePath, FS_OPTS));\n }\n\n\n getCurrentDirectory(): string { return this.currentDirectory; }\n\n getCompilationSettings(): ts.CompilerOptions { return this.compilerOptions; }\n\n getDefaultLibFileName(options: ts.CompilerOptions): string {\n // ignore options argument, options should not change during the lifetime of the plugin\n return this.defaultLibFilePath;\n }\n}\n\n\nexport default wrapDiffingPlugin(DiffingTSCompiler);\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"file":"broccoli-typescript.js","sourceRoot":"","sources":["broccoli-typescript.ts"],"names":[],"mappings":"AAAA,kDAAkD;;AAElD,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AAC1B,IAAO,GAAG,WAAW,UAAU,CAAC,CAAC;AACjC,IAAO,IAAI,WAAW,MAAM,CAAC,CAAC;AAC9B,IAAY,EAAE,WAAM,YAAY,CAAC,CAAA;AACjC,wCAAmE,2BAA2B,CAAC,CAAA;AAK/F,IAAM,OAAO,GAAG;IACd,QAAQ,EAAE,OAAO;CAClB,CAAC;AAEF,oEAAoE;AACvD,6BAAqB,GAAW,kBAAkB,CAAC;AAEhE,kFAAkF;AAClF,IAAI,cAAc,GAAY,KAAK,CAAC;AAEpC,IAAM,iBAAiB,GAAmB,EAAG,CAAC,SAAS,CAAC;AAElD,EAAG,CAAC,SAAS,GAAG,UAAS,QAAa,EAAE,IAAS,EAAE,gBAAqB;IAC5E,EAAE,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC;QACnB,IAAM,2BA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A2B;QAC/C,uFAAuF;QACvF,MAAM,CAAC,IAAI,CAAC,kBAAkB,CAAC;IACjC,CAAC;IACH,gCAAC;AAAD,CAAC,AArED,IAqEC;AAED;qBAAe,2CAAiB,CAAC,iBAAiB,CAAC,CAAC;AAEpD,eAAkB,MAAS;IACzB,IAAM,MAAM,GAAQ,EAAE,CAAC;IACvB,GAAG,CAAC,CAAC,IAAM,EAAE,IAAI,MAAM,CAAC,CAAC,CAAC;QACxB,MAAM,CAAC,EAAE,CAAC,GAAS,MAAO,CAAC,EAAE,CAAC,CAAC;IACjC,CAAC;IACD,MAAM,CAAI,MAAM,CAAC;AACnB,CAAC;AAED,kBAAkB,GAAW,EAAE,SAAiB;IAC9C,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,MAAM,GAAG,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;AACtE,CAAC"} \ No newline at end of file diff --git a/lib/broccoli/diffing-broccoli-plugin.js b/lib/broccoli/diffing-broccoli-plugin.js index 9c0e2a234cbf..d8e2be13766c 100644 --- a/lib/broccoli/diffing-broccoli-plugin.js +++ b/lib/broccoli/diffing-broccoli-plugin.js @@ -1,6 +1,7 @@ /// /// /// +"use strict"; var fs = require('fs'); var tree_differ_1 = require('./tree-differ'); var broccoli_tree_stabilizer_1 = require('./broccoli-tree-stabilizer'); @@ -114,17 +115,17 @@ var DiffingPluginWrapper = (function () { }; DiffingPluginWrapper.prototype.init = function () { if (!this.initialized) { - var includeExtensions = this.pluginClass.includeExtensions || []; - var excludeExtensions = this.pluginClass.excludeExtensions || []; - var description = this.description; + var includeExtensions_1 = this.pluginClass.includeExtensions || []; + var excludeExtensions_1 = this.pluginClass.excludeExtensions || []; + var description_1 = this.description; this.initialized = true; if (this.inputPaths) { this.treeDiffers = - this.inputPaths.map(function (inputPath) { return new tree_differ_1.TreeDiffer(description, inputPath, includeExtensions, excludeExtensions); }); + this.inputPaths.map(function (inputPath) { return new tree_differ_1.TreeDiffer(description_1, inputPath, includeExtensions_1, excludeExtensions_1); }); } else if (this.inputPath) { this.treeDiffer = - new tree_differ_1.TreeDiffer(description, this.inputPath, includeExtensions, excludeExtensions); + new tree_differ_1.TreeDiffer(description_1, this.inputPath, includeExtensions_1, excludeExtensions_1); } this.wrappedPlugin = new this.pluginClass(this.inputPaths || this.inputPath, this.cachePath, this.wrappedPluginArguments[1]); } @@ -152,9 +153,8 @@ var DiffingPluginWrapper = (function () { // New-style/rebuild trees should always be stable. var isNewStyleTree = !!(tree['newStyleTree'] || typeof tree.rebuild === 'function' || tree['isReadAPICompatTree'] || tree.constructor['name'] === 'Funnel'); - return isNewStyleTree ? tree : broccoli_tree_stabilizer_1.default(tree); + return isNewStyleTree ? tree : broccoli_tree_stabilizer_1["default"](tree); }; return DiffingPluginWrapper; -})(); - -//# sourceMappingURL=diffing-broccoli-plugin.js.map +}()); +//# sourceMappingURL=diffing-broccoli-plugin.js.map \ No newline at end of file diff --git a/lib/broccoli/diffing-broccoli-plugin.js.map b/lib/broccoli/diffing-broccoli-plugin.js.map index 0e7a516ff629..40120655ee67 100644 --- a/lib/broccoli/diffing-broccoli-plugin.js.map +++ b/lib/broccoli/diffing-broccoli-plugin.js.map @@ -1 +1 @@ -{"version":3,"sources":["broccoli/diffing-broccoli-plugin.ts"],"names":["wrapDiffingPlugin","DiffingPluginWrapper","DiffingPluginWrapper.constructor","DiffingPluginWrapper.getDiffResult","DiffingPluginWrapper.maybeStoreDiffResult","DiffingPluginWrapper.rebuild","DiffingPluginWrapper.cleanup","DiffingPluginWrapper.relinkOutputAndCachePaths","DiffingPluginWrapper.init","DiffingPluginWrapper.stabilizeTrees","DiffingPluginWrapper.stabilizeTree"],"mappings":"AAAA,sCAAsC;AACtC,0DAA0D;AAC1D,kDAAkD;AAElD,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AAG1B,4BAAqC,eAAe,CAAC,CAAA;AACrD,yCAA0B,4BAA4B,CAAC,CAAA;AACv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AACA,CAACA;QAE9FA,MAAMA,CAACA,cAAcA,GAAGA,IAAIA,GAAGA,kCAAaA,CAACA,IAAIA,CAACA,CAACA;IACrDA,CAACA;IACHT,2BAACA;AAADA,CAtJA,AAsJCA,IAAA","file":"broccoli/diffing-broccoli-plugin.js","sourcesContent":["/// \n/// \n/// \n\nimport fs = require('fs');\nimport fse = require('fs-extra');\nimport path = require('path');\nimport {TreeDiffer, DiffResult} from './tree-differ';\nimport stabilizeTree from './broccoli-tree-stabilizer';\nlet symlinkOrCopy = require('symlink-or-copy');\n\n\nexport {DiffResult} from './tree-differ';\n\n\n/**\n * Makes writing diffing plugins easy.\n *\n * Factory method that takes a class that implements the DiffingBroccoliPlugin interface and returns\n * an instance of BroccoliTree.\n *\n * @param pluginClass\n * @returns {DiffingBroccoliPlugin}\n */\nexport function wrapDiffingPlugin(pluginClass): DiffingPluginWrapperFactory {\n return function() { return new DiffingPluginWrapper(pluginClass, arguments); };\n}\n\n\nexport interface DiffingBroccoliPlugin {\n rebuild(diff: (DiffResult | DiffResult[])): (Promise| DiffResult | void);\n cleanup ? () : void;\n}\n\n\ntype DiffingPluginWrapperFactory = (inputTrees: (BroccoliTree | BroccoliTree[]), options?) =>\n BroccoliTree;\n\n\nclass DiffingPluginWrapper implements BroccoliTree {\n treeDiffer: TreeDiffer = null;\n treeDiffers: TreeDiffer[] = null;\n initialized = false;\n wrappedPlugin: DiffingBroccoliPlugin = null;\n inputTree = null;\n inputTrees = null;\n description = null;\n\n // props monkey-patched by broccoli builder:\n inputPath = null;\n inputPaths = null;\n cachePath = null;\n outputPath = null;\n\n private diffResult: DiffResult = null;\n\n constructor(private pluginClass, private wrappedPluginArguments) {\n if (Array.isArray(wrappedPluginArguments[0])) {\n this.inputTrees = this.stabilizeTrees(wrappedPluginArguments[0]);\n } else {\n this.inputTree = this.stabilizeTree(wrappedPluginArguments[0]);\n }\n\n this.description = this.pluginClass.name;\n }\n\n private getDiffResult(): (DiffResult | DiffResult[]) {\n let returnOrCalculateDiffResult = (tree, index) => {\n // returnOrCalculateDiffResult will do one of two things:\n //\n // If `this.diffResult` is null, calculate a DiffResult using TreeDiffer\n // for the input tree.\n //\n // Otherwise, `this.diffResult` was produced from the output of the\n // inputTree's rebuild() method, and can be used without being checked.\n // Set `this.diffResult` to null and return the previously stored value.\n let diffResult = tree.diffResult;\n if (diffResult) return diffResult;\n let differ = index === false ? this.treeDiffer : this.treeDiffers[index];\n return differ.diffTree();\n };\n\n if (this.inputTrees) {\n return this.inputTrees.map(returnOrCalculateDiffResult);\n } else if (this.inputTree) {\n return returnOrCalculateDiffResult(this.inputTree, false);\n } else {\n throw new Error(\"Missing TreeDiffer\");\n }\n }\n\n private maybeStoreDiffResult(value: (DiffResult | void)) {\n if (!(value instanceof DiffResult)) value = null;\n this.diffResult = (value);\n }\n\n rebuild(): (Promise| void) {\n try {\n let firstRun = !this.initialized;\n this.init();\n\n let diffResult = this.getDiffResult();\n\n let result = this.wrappedPlugin.rebuild(diffResult);\n\n if (result) {\n let resultPromise = >(result);\n if (resultPromise.then) {\n // rebuild() -> Promise<>\n return resultPromise.then((result: (DiffResult | void)) => {\n this.maybeStoreDiffResult(result);\n this.relinkOutputAndCachePaths();\n });\n }\n }\n\n this.maybeStoreDiffResult(<(DiffResult | void)>(result));\n this.relinkOutputAndCachePaths();\n } catch (e) {\n e.message = `[${this.description}]: ${e.message}`;\n throw e;\n }\n }\n\n\n cleanup() {\n if (this.wrappedPlugin && this.wrappedPlugin.cleanup) {\n this.wrappedPlugin.cleanup();\n }\n }\n\n\n private relinkOutputAndCachePaths() {\n // just symlink the cache and output tree\n fs.rmdirSync(this.outputPath);\n symlinkOrCopy.sync(this.cachePath, this.outputPath);\n }\n\n\n private init() {\n if (!this.initialized) {\n let includeExtensions = this.pluginClass.includeExtensions || [];\n let excludeExtensions = this.pluginClass.excludeExtensions || [];\n let description = this.description;\n this.initialized = true;\n if (this.inputPaths) {\n this.treeDiffers =\n this.inputPaths.map((inputPath) => new TreeDiffer(\n description, inputPath, includeExtensions, excludeExtensions));\n } else if (this.inputPath) {\n this.treeDiffer =\n new TreeDiffer(description, this.inputPath, includeExtensions, excludeExtensions);\n }\n this.wrappedPlugin = new this.pluginClass(this.inputPaths || this.inputPath, this.cachePath,\n this.wrappedPluginArguments[1]);\n }\n }\n\n\n private stabilizeTrees(trees: BroccoliTree[]) {\n // Prevent extensions to prevent array from being mutated from the outside.\n // For-loop used to avoid re-allocating a new array.\n var stableTrees = [];\n for (let i = 0; i < trees.length; ++i) {\n // ignore null/undefined input tries in order to support conditional build pipelines\n if (trees[i]) {\n stableTrees.push(this.stabilizeTree(trees[i]));\n }\n }\n\n if (stableTrees.length === 0) {\n throw new Error('No input trees provided!');\n }\n\n return Object.freeze(stableTrees);\n }\n\n\n private stabilizeTree(tree: BroccoliTree) {\n // Ignore all DiffingPlugins as they are already stable, for others we don't know for sure\n // so we need to stabilize them.\n // Since it's not safe to use instanceof operator in node, we are checking the constructor.name.\n //\n // New-style/rebuild trees should always be stable.\n let isNewStyleTree = !!(tree['newStyleTree'] || typeof tree.rebuild === 'function' ||\n tree['isReadAPICompatTree'] || tree.constructor['name'] === 'Funnel');\n\n return isNewStyleTree ? tree : stabilizeTree(tree);\n }\n}\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"file":"diffing-broccoli-plugin.js","sourceRoot":"","sources":["diffing-broccoli-plugin.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,0DAA0D;AAC1D,kDAAkD;;AAElD,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AAG1B,4BAAqC,eAAe,CAAC,CAAA;AACrD,yCAA0B,4BAA4B,CAAC,CAAA;AACvD,IAAI,aAAa,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;AAG/C,4BAAyB,eAAe,CAAC;AAAjC,8CAAiC;AAGzC;;;;;;;;GAQG;AACH,2BAAkC,WAAW;IAC3C,MAAM,CAAC,cAAa,MAAM,CAAC,IAAI,oBAAoB,CAAC,W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AAK,CAAC,0BAA0B,CAAC,CAAC;QAC9C,CAAC;QAED,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;IACpC,CAAC;IAGO,4CAAa,GAArB,UAAsB,IAAkB;QACtC,0FAA0F;QAC1F,gCAAgC;QAChC,gGAAgG;QAChG,EAAE;QACF,mDAAmD;QACnD,IAAI,cAAc,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,OAAO,IAAI,CAAC,OAAO,KAAK,UAAU;YAC1D,IAAI,CAAC,qBAAqB,CAAC,IAAI,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,QAAQ,CAAC,CAAC;QAE9F,MAAM,CAAC,cAAc,GAAG,IAAI,GAAG,qCAAa,CAAC,IAAI,CAAC,CAAC;IACrD,CAAC;IACH,2BAAC;AAAD,CAAC,AAtJD,IAsJC"} \ No newline at end of file diff --git a/lib/broccoli/tree-differ.js b/lib/broccoli/tree-differ.js index 4f909e7aa7db..a79c825b3d2e 100644 --- a/lib/broccoli/tree-differ.js +++ b/lib/broccoli/tree-differ.js @@ -1,4 +1,5 @@ /// +"use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } @@ -103,7 +104,7 @@ var TreeDiffer = (function () { this.nextFingerprints = Object.create(null); }; return TreeDiffer; -})(); +}()); exports.TreeDiffer = TreeDiffer; var DiffResult = (function () { function DiffResult(label) { @@ -119,7 +120,7 @@ var DiffResult = (function () { return ''; }; return DiffResult; -})(); +}()); exports.DiffResult = DiffResult; var DirtyCheckingDiffResult = (function (_super) { __extends(DirtyCheckingDiffResult, _super); @@ -145,7 +146,7 @@ var DirtyCheckingDiffResult = (function (_super) { '')); }; return DirtyCheckingDiffResult; -})(DiffResult); +}(DiffResult)); function pad(value, length) { value = '' + value; var whitespaceLength = (value.length < length) ? length - value.length : 0; @@ -158,5 +159,4 @@ var FileStatus; FileStatus[FileStatus["Unchanged"] = 1] = "Unchanged"; FileStatus[FileStatus["Changed"] = 2] = "Changed"; })(FileStatus || (FileStatus = {})); - -//# sourceMappingURL=tree-differ.js.map +//# sourceMappingURL=tree-differ.js.map \ No newline at end of file diff --git a/lib/broccoli/tree-differ.js.map b/lib/broccoli/tree-differ.js.map index bbdef36a15c8..c24a31cdbb65 100644 --- a/lib/broccoli/tree-differ.js.map +++ b/lib/broccoli/tree-differ.js.map @@ -1 +1 @@ -{"version":3,"sources":["broccoli/tree-differ.ts"],"names":["tryStatSync","TreeDiffer","TreeDiffer.constructor","TreeDiffer.constructor.combine","TreeDiffer.diffTree","TreeDiffer.dirtyCheckPath","TreeDiffer.isFileDirty","TreeDiffer.detectDeletionsAndUpdateFingerprints","DiffResult","DiffResult.constructor","DiffResult.log","DiffResult.toString","DirtyCheckingDiffResult","DirtyCheckingDiffResult.constructor","DirtyCheckingDiffResult.toString","DirtyCheckingDiffResult.log","pad","FileStatus"],"mappings":"AAAA,kDAAkD;;;;;;AAElD,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AAC1B,IAAO,IAAI,WAAW,MAAM,CAAC,CAAC;AAG9B,qBAAqB,IAAI;IACvBA,IAAIA,CAACA;QACHA,MAAMA,CAACA,EAAEA,CAACA,QAAQA,CAACA,IAAIA,CAACA,CAACA;IAC3BA,CAAEA;IAAAA,KAAKA,CAACA,CAACA,CAACA,CAACA,CAACA,CAACA;QACXA,EAAEA,CAACA,CAACA,CAACA,CAACA,IAAIA,KAAKA,QAAQA,CAACA;YAACA,MAAMA,CAACA,IAAIA,CAACA;QACrCA,MAAMA,CAACA,CAACA;IACVA,CAACA;AACHA,CAACA;AAGD;IAOEC,oBAAoBA,KAAaA,EAAUA,QAAgBA,EAAEA,iBAA4BA,EAC7EA,iBAA4BA;QADpBC,UAAKA,GAALA,KAAKA,CAAQA;QAAUA,aAAQA,GAARA,QAAQA,CAAQA;QANnDA,iBAAYA,GAA4BA,MAAMA,CAACA,MAAMA,C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U,QAId","file":"broccoli/tree-differ.js","sourcesContent":["/// \n\nimport fs = require('fs');\nimport path = require('path');\n\n\nfunction tryStatSync(path) {\n try {\n return fs.statSync(path);\n } catch (e) {\n if (e.code === \"ENOENT\") return null;\n throw e;\n }\n}\n\n\nexport class TreeDiffer {\n private fingerprints: {[key: string]: string} = Object.create(null);\n private nextFingerprints: {[key: string]: string} = Object.create(null);\n private rootDirName: string;\n private include: RegExp = null;\n private exclude: RegExp = null;\n\n constructor(private label: string, private rootPath: string, includeExtensions?: string[],\n excludeExtensions?: string[]) {\n this.rootDirName = path.basename(rootPath);\n\n let buildRegexp = (arr) => new RegExp(`(${arr.reduce(combine, \"\")})$`, \"i\");\n\n this.include = (includeExtensions || []).length ? buildRegexp(includeExtensions) : null;\n this.exclude = (excludeExtensions || []).length ? buildRegexp(excludeExtensions) : null;\n\n function combine(prev, curr) {\n if (curr.charAt(0) !== \".\") {\n throw new Error(`Extension must begin with '.'. Was: '${curr}'`);\n }\n let kSpecialRegexpChars = /[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g;\n curr = '(' + curr.replace(kSpecialRegexpChars, '\\\\$&') + ')';\n return prev ? (prev + '|' + curr) : curr;\n }\n }\n\n\n public diffTree(): DiffResult {\n let result = new DirtyCheckingDiffResult(this.label, this.rootDirName);\n this.dirtyCheckPath(this.rootPath, result);\n this.detectDeletionsAndUpdateFingerprints(result);\n result.endTime = Date.now();\n return result;\n }\n\n\n private dirtyCheckPath(rootDir: string, result: DirtyCheckingDiffResult) {\n fs.readdirSync(rootDir).forEach((segment) => {\n let absolutePath = path.join(rootDir, segment);\n let pathStat = fs.lstatSync(absolutePath);\n if (pathStat.isSymbolicLink()) {\n pathStat = tryStatSync(absolutePath);\n if (pathStat === null) return;\n }\n\n if (pathStat.isDirectory()) {\n result.directoriesChecked++;\n this.dirtyCheckPath(absolutePath, result);\n } else {\n if (!(this.include && !absolutePath.match(this.include)) &&\n !(this.exclude && absolutePath.match(this.exclude))) {\n result.filesChecked++;\n let relativeFilePath = path.relative(this.rootPath, absolutePath);\n\n switch (this.isFileDirty(absolutePath, pathStat)) {\n case FileStatus.Added:\n result.addedPaths.push(relativeFilePath);\n break;\n case FileStatus.Changed:\n result.changedPaths.push(relativeFilePath);\n }\n }\n }\n });\n\n return result;\n }\n\n\n private isFileDirty(path: string, stat: fs.Stats): FileStatus {\n let oldFingerprint = this.fingerprints[path];\n let newFingerprint = `${stat.mtime.getTime()} # ${stat.size}`;\n\n this.nextFingerprints[path] = newFingerprint;\n\n if (oldFingerprint) {\n this.fingerprints[path] = null;\n\n if (oldFingerprint === newFingerprint) {\n // nothing changed\n return FileStatus.Unchanged;\n }\n\n return FileStatus.Changed;\n }\n\n return FileStatus.Added;\n }\n\n\n private detectDeletionsAndUpdateFingerprints(result: DiffResult) {\n for (let absolutePath in this.fingerprints) {\n if (!(this.include && !absolutePath.match(this.include)) &&\n !(this.exclude && absolutePath.match(this.exclude))) {\n if (this.fingerprints[absolutePath] !== null) {\n let relativePath = path.relative(this.rootPath, absolutePath);\n result.removedPaths.push(relativePath);\n }\n }\n }\n\n this.fingerprints = this.nextFingerprints;\n this.nextFingerprints = Object.create(null);\n }\n}\n\n\nexport class DiffResult {\n public addedPaths: string[] = [];\n public changedPaths: string[] = [];\n public removedPaths: string[] = [];\n\n constructor(public label: string = '') {}\n\n log(verbose: boolean): void {}\n\n toString(): string {\n // TODO(@caitp): more meaningful logging\n return '';\n }\n}\n\nclass DirtyCheckingDiffResult extends DiffResult {\n public filesChecked: number = 0;\n public directoriesChecked: number = 0;\n public startTime: number = Date.now();\n public endTime: number = null;\n\n constructor(label: string, public directoryName: string) { super(label); }\n\n toString() {\n return `${pad(this.label, 30)}, ${pad(this.endTime - this.startTime, 5)}ms, ` +\n `${pad(this.addedPaths.length + this.changedPaths.length + this.removedPaths.length, 5)} changes ` +\n `(files: ${pad(this.filesChecked, 5)}, dirs: ${pad(this.directoriesChecked, 4)})`;\n }\n\n log(verbose) {\n let prefixedPaths = this.addedPaths.map(p => `+ ${p}`)\n .concat(this.changedPaths.map(p => `* ${p}`))\n .concat(this.removedPaths.map(p => `- ${p}`));\n console.log(`Tree diff: ${this}` + ((verbose && prefixedPaths.length) ?\n ` [\\n ${prefixedPaths.join('\\n ')}\\n]` :\n ''));\n }\n}\n\n\nfunction pad(value, length) {\n value = '' + value;\n let whitespaceLength = (value.length < length) ? length - value.length : 0;\n whitespaceLength = whitespaceLength + 1;\n return new Array(whitespaceLength).join(' ') + value;\n}\n\n\nenum FileStatus {\n Added,\n Unchanged,\n Changed\n}\n"],"sourceRoot":"/source/"} \ No newline at end of file +{"version":3,"file":"tree-differ.js","sourceRoot":"","sources":["tree-differ.ts"],"names":[],"mappings":"AAAA,kDAAkD;;;;;;;AAElD,IAAO,EAAE,WAAW,IAAI,CAAC,CAAC;AAC1B,IAAO,IAAI,WAAW,MAAM,CAAC,CAAC;AAG9B,qBAAqB,IAAI;IACvB,IAAI,CAAC;QACH,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAE;IAAA,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;QACX,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,QAAQ,CAAC;YAAC,MAAM,CAAC,IAAI,CAAC;QACrC,MAAM,CAAC,CAAC;IACV,CAAC;AACH,CAAC;AAGD;IAOE,oBAAoB,KAAa,EAAU,QAAgB,EAAE,iBAA4B,EAC7E,iBAA4B;QADpB,UAAK,GAAL,KAAK,CAAQ;QAAU,aAAQ,GAAR,QAAQ,CAAQ;QANnD,iBAAY,GAA4B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAC5D,qBAAgB,GAA4B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;QAEhE,YAAO,GAAW,IAAI,CAAC;QACvB,YAAO,GAAW,IAAI,CAAC;QAI7B,IAAI,CAAC,WAAW,GAAG,IAAI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AC,CAAC;IAC3E,gBAAgB,GAAG,gBAAgB,GAAG,CAAC,CAAC;IACxC,MAAM,CAAC,IAAI,KAAK,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;AACvD,CAAC;AAGD,IAAK,UAIJ;AAJD,WAAK,UAAU;IACb,6CAAK,CAAA;IACL,qDAAS,CAAA;IACT,iDAAO,CAAA;AACT,CAAC,EAJI,UAAU,KAAV,UAAU,QAId"} \ No newline at end of file diff --git a/package.json b/package.json index 66e3af806de6..d183bc9c5983 100644 --- a/package.json +++ b/package.json @@ -29,10 +29,10 @@ }, "homepage": "https://github.com/angular/angular-cli", "dependencies": { - "broccoli": "^0.16.3", - "broccoli-concat": "0.0.13", - "broccoli-funnel": "^1.0.0", - "broccoli-merge-trees": "^1.0.0", + "broccoli": "^1.0.0-beta.6", + "broccoli-concat": "2.1.0", + "broccoli-funnel": "^1.0.1", + "broccoli-merge-trees": "^1.0.1", "broccoli-writer": "^0.1.1", "chalk": "^1.1.0", "ember-cli": "1.13.15", @@ -40,10 +40,11 @@ "fs-extra": "^0.18.4", "leek": "0.0.19", "lodash": "^3.10.0", + "multidep": "^2.0.0", "node-notifier": "^4.4.0", "resolve": "^1.0.0", - "silent-error": "^1.0.0", "shelljs": "^0.5.3", + "silent-error": "^1.0.0", "symlink-or-copy": "^1.0.1", "typescript": "~1.7.3", "typings": "^0.6.2"