diff --git a/gulpfile.js b/gulpfile.js index 675fe9a1e8..69fbf826fc 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -123,7 +123,6 @@ gulp.task('git-changed-examples', ['shred-full'], function(){ gulp.task('build-api-docs', function() { - var fs = require('fs-extra'); if (!fs.existsSync('../angular')) { throw new Error('build-api-docs task requires the angular2 repo to be at ' + path.resolve('../angular')); } diff --git a/public/api-builder/angular.io-package/index.js b/public/api-builder/angular.io-package/index.js index 90ebbda1f5..cdfeb02b12 100644 --- a/public/api-builder/angular.io-package/index.js +++ b/public/api-builder/angular.io-package/index.js @@ -12,7 +12,8 @@ module.exports = new Package('angular.io', [basePackage]) .processor(require('./processors/addJadeDataDocsProcessor')) // MIGRATION: added this processor .processor(require('./processors/fixOutputPathProcessor')) - // overrides base packageInfo and returns the one for the 'angular/angular' repo. +// MIGRATION: added packageInfo to point to angular/angular repo +// overrides base packageInfo and returns the one for the 'angular/angular' repo. .factory(require('./services/packageInfo')) // Configure rendering @@ -22,15 +23,17 @@ module.exports = new Package('angular.io', [basePackage]) .unshift(path.resolve(__dirname, 'templates')); }) -.config(function(writeFilesProcessor) { +.config(function(writeFilesProcessor, readFilesProcessor) { + // MIGRATION: HACK - readFileProcessor.basePath set to point to a local repo location + // because the docs-package-processor will + // have previously set it to point to angular/angular repo. + // needed because the writeFilesProcessor uses the readFilesProcessor's basePath. + readFilesProcessor.basePath = path.resolve(__dirname, "../../docs"); writeFilesProcessor.outputFolder = 'js/latest/api'; }) .config(function(readFilesProcessor, generateNavigationDoc, createOverviewDump) { // Clear out unwanted processors - // MIGRATION: HACK - added basePath to point to a local repo location because the docs-package-processor will - // have previously set it to point to angular/angular repo. - readFilesProcessor.basePath = path.resolve(__dirname, "../../docs"); readFilesProcessor.$enabled = false; generateNavigationDoc.$enabled = false; createOverviewDump.$enabled = false; diff --git a/public/api-builder/angular.io-package/services/packageInfo.js b/public/api-builder/angular.io-package/services/packageInfo.js index 1cd06db3c0..e3e8764687 100644 --- a/public/api-builder/angular.io-package/services/packageInfo.js +++ b/public/api-builder/angular.io-package/services/packageInfo.js @@ -9,6 +9,6 @@ var path = require('canonical-path'); */ module.exports = function packageInfo() { - var topLevelPackageJson= path.join('../angular','package.json'); - return JSON.parse(fs.readFileSync(topLevelPackageJson), 'UTF-8'); + var angularPackageJson= path.join('../angular','package.json'); + return JSON.parse(fs.readFileSync(angularPackageJson), 'UTF-8'); } \ No newline at end of file