From 83fbe759804359aac6cbfc187865853e6d26247b Mon Sep 17 00:00:00 2001 From: Peter Bacon Darwin Date: Wed, 4 Nov 2015 11:20:07 +0000 Subject: [PATCH] refact(api-builder): move into `tools` folder --- .../api-builder/angular.io-package/index.js | 8 +++++-- .../angular.io-package/mocks/mockPackage.js | 0 .../processors/addJadeDataDocsProcessor.js | 0 .../addJadeDataDocsProcessor.spec.js | 0 .../processors/extractDirectiveClasses.js | 0 .../extractDirectiveClasses.spec.js | 0 .../processors/filterUnwantedDecorators.js | 0 .../filterUnwantedDecorators.spec.js | 0 .../processors/matchUpDirectiveDecorators.js | 0 .../rendering/indentForMarkdown.js | 0 .../angular.io-package/rendering/toId.js | 0 .../angular.io-package/rendering/toId.spec.js | 0 .../rendering/trimBlankLines.js | 0 .../rendering/trimBlankLines.spec.js | 0 .../services/packageInfo.js | 0 .../services/renderMarkdown.js | 0 .../templates/app-data.template.html | 0 .../templates/class.template.html | 0 .../templates/directive.template.html | 0 .../templates/enum.template.html | 0 .../templates/function.template.html | 0 .../templates/jade-data.template.html | 0 .../templates/layout/base.template.html | 0 .../templates/lib/paramList.html | 0 .../templates/module.template.html | 0 .../templates/var.template.html | 0 .../api-builder/docs-package/index.js | 0 .../docs-package/mocks/importedSrc.ts | 0 .../docs-package/mocks/mockPackage.js | 0 .../api-builder/docs-package/mocks/testSrc.ts | 0 .../processors/checkUnbalancedBackTicks.js | 0 .../checkUnbalancedBackTicks.spec.js | 0 .../convertBackticksToCodeBlocks.js | 0 .../convertBackticksToCodeBlocks.spec.js | 0 .../convertPrivateClassesToInterfaces.js | 0 .../processors/createOverviewDump.js | 0 .../processors/extractDirectiveClasses.js | 0 .../extractDirectiveClasses.spec.js | 0 .../processors/extractTitleFromGuides.js | 0 .../processors/generateNavigationDoc.js | 0 .../api-builder/docs-package/readers/ngdoc.js | 0 .../docs-package/readers/ngdoc.spec.js | 0 .../templates/class.template.html | 0 .../templates/common.template.html | 0 .../templates/const.template.html | 0 .../templates/data-module.template.js | 0 .../templates/function.template.html | 0 .../templates/guide.template.html | 0 .../templates/interface.template.html | 0 .../templates/layout/base.template.html | 0 .../templates/lib/githubLinks.html | 0 .../docs-package/templates/lib/paramList.html | 0 .../templates/module.template.html | 0 .../templates/overview-dump.template.html | 0 .../templates/type-alias.template.html | 0 .../docs-package/templates/var.template.html | 0 .../api-builder/links-package/index.js | 0 .../links-package/inline-tag-defs/example.js | 0 .../inline-tag-defs/exampleTabs.js | 0 .../links-package/inline-tag-defs/link.js | 0 .../inline-tag-defs/linkDevGuide.js | 0 .../services/getApiFragmentFileName.js | 0 .../links-package/services/getLinkInfo.js | 0 .../links-package/services/parseArgString.js | 0 tools/api-builder/target-package/index.js | 9 +++++++ .../target-package/inline-tag-defs/target.js | 24 +++++++++++++++++++ .../inline-tag-defs/target.spec.js | 24 +++++++++++++++++++ .../api-builder/typescript-package/index.js | 0 .../typescript-package/mocks/mockPackage.js | 0 .../ignoreExportsMatching.ts | 0 .../mocks/readTypeScriptModules/interfaces.ts | 0 .../orderingOfMembers.ts | 0 .../readTypeScriptModules/privateModule.ts | 0 .../readTypeScriptModules/publicModule.ts | 0 .../mocks/tsParser/importedSrc.ts | 0 .../mocks/tsParser/testSrc.ts | 0 .../processors/readTypeScriptModules.js | 0 .../processors/readTypeScriptModules.spec.js | 0 .../convertPrivateClassesToInterfaces.js | 0 .../convertPrivateClassesToInterfaces.spec.js | 0 .../typescript-package/services/modules.js | 0 .../services/tsParser/createCompilerHost.js | 0 .../tsParser/createCompilerHost.spec.js | 0 .../services/tsParser/getContent.js | 0 .../services/tsParser/getExportDocType.js | 0 .../services/tsParser/getFileInfo.js | 0 .../services/tsParser/index.js | 0 .../services/tsParser/index.spec.js | 0 88 files changed, 63 insertions(+), 2 deletions(-) rename {public => tools}/api-builder/angular.io-package/index.js (91%) rename {public => tools}/api-builder/angular.io-package/mocks/mockPackage.js (100%) rename {public => tools}/api-builder/angular.io-package/processors/addJadeDataDocsProcessor.js (100%) rename {public => tools}/api-builder/angular.io-package/processors/addJadeDataDocsProcessor.spec.js (100%) rename {public => tools}/api-builder/angular.io-package/processors/extractDirectiveClasses.js (100%) rename {public => tools}/api-builder/angular.io-package/processors/extractDirectiveClasses.spec.js (100%) rename {public => tools}/api-builder/angular.io-package/processors/filterUnwantedDecorators.js (100%) rename {public => tools}/api-builder/angular.io-package/processors/filterUnwantedDecorators.spec.js (100%) rename {public => tools}/api-builder/angular.io-package/processors/matchUpDirectiveDecorators.js (100%) rename {public => tools}/api-builder/angular.io-package/rendering/indentForMarkdown.js (100%) rename {public => tools}/api-builder/angular.io-package/rendering/toId.js (100%) rename {public => tools}/api-builder/angular.io-package/rendering/toId.spec.js (100%) rename {public => tools}/api-builder/angular.io-package/rendering/trimBlankLines.js (100%) rename {public => tools}/api-builder/angular.io-package/rendering/trimBlankLines.spec.js (100%) rename {public => tools}/api-builder/angular.io-package/services/packageInfo.js (100%) rename {public => tools}/api-builder/angular.io-package/services/renderMarkdown.js (100%) rename {public => tools}/api-builder/angular.io-package/templates/app-data.template.html (100%) rename {public => tools}/api-builder/angular.io-package/templates/class.template.html (100%) rename {public => tools}/api-builder/angular.io-package/templates/directive.template.html (100%) rename {public => tools}/api-builder/angular.io-package/templates/enum.template.html (100%) rename {public => tools}/api-builder/angular.io-package/templates/function.template.html (100%) rename {public => tools}/api-builder/angular.io-package/templates/jade-data.template.html (100%) rename {public => tools}/api-builder/angular.io-package/templates/layout/base.template.html (100%) rename {public => tools}/api-builder/angular.io-package/templates/lib/paramList.html (100%) rename {public => tools}/api-builder/angular.io-package/templates/module.template.html (100%) rename {public => tools}/api-builder/angular.io-package/templates/var.template.html (100%) rename {public => tools}/api-builder/docs-package/index.js (100%) rename {public => tools}/api-builder/docs-package/mocks/importedSrc.ts (100%) rename {public => tools}/api-builder/docs-package/mocks/mockPackage.js (100%) rename {public => tools}/api-builder/docs-package/mocks/testSrc.ts (100%) rename {public => tools}/api-builder/docs-package/processors/checkUnbalancedBackTicks.js (100%) rename {public => tools}/api-builder/docs-package/processors/checkUnbalancedBackTicks.spec.js (100%) rename {public => tools}/api-builder/docs-package/processors/convertBackticksToCodeBlocks.js (100%) rename {public => tools}/api-builder/docs-package/processors/convertBackticksToCodeBlocks.spec.js (100%) rename {public => tools}/api-builder/docs-package/processors/convertPrivateClassesToInterfaces.js (100%) rename {public => tools}/api-builder/docs-package/processors/createOverviewDump.js (100%) rename {public => tools}/api-builder/docs-package/processors/extractDirectiveClasses.js (100%) rename {public => tools}/api-builder/docs-package/processors/extractDirectiveClasses.spec.js (100%) rename {public => tools}/api-builder/docs-package/processors/extractTitleFromGuides.js (100%) rename {public => tools}/api-builder/docs-package/processors/generateNavigationDoc.js (100%) rename {public => tools}/api-builder/docs-package/readers/ngdoc.js (100%) rename {public => tools}/api-builder/docs-package/readers/ngdoc.spec.js (100%) rename {public => tools}/api-builder/docs-package/templates/class.template.html (100%) rename {public => tools}/api-builder/docs-package/templates/common.template.html (100%) rename {public => tools}/api-builder/docs-package/templates/const.template.html (100%) rename {public => tools}/api-builder/docs-package/templates/data-module.template.js (100%) rename {public => tools}/api-builder/docs-package/templates/function.template.html (100%) rename {public => tools}/api-builder/docs-package/templates/guide.template.html (100%) rename {public => tools}/api-builder/docs-package/templates/interface.template.html (100%) rename {public => tools}/api-builder/docs-package/templates/layout/base.template.html (100%) rename {public => tools}/api-builder/docs-package/templates/lib/githubLinks.html (100%) rename {public => tools}/api-builder/docs-package/templates/lib/paramList.html (100%) rename {public => tools}/api-builder/docs-package/templates/module.template.html (100%) rename {public => tools}/api-builder/docs-package/templates/overview-dump.template.html (100%) rename {public => tools}/api-builder/docs-package/templates/type-alias.template.html (100%) rename {public => tools}/api-builder/docs-package/templates/var.template.html (100%) rename {public => tools}/api-builder/links-package/index.js (100%) rename {public => tools}/api-builder/links-package/inline-tag-defs/example.js (100%) rename {public => tools}/api-builder/links-package/inline-tag-defs/exampleTabs.js (100%) rename {public => tools}/api-builder/links-package/inline-tag-defs/link.js (100%) rename {public => tools}/api-builder/links-package/inline-tag-defs/linkDevGuide.js (100%) rename {public => tools}/api-builder/links-package/services/getApiFragmentFileName.js (100%) rename {public => tools}/api-builder/links-package/services/getLinkInfo.js (100%) rename {public => tools}/api-builder/links-package/services/parseArgString.js (100%) create mode 100644 tools/api-builder/target-package/index.js create mode 100644 tools/api-builder/target-package/inline-tag-defs/target.js create mode 100644 tools/api-builder/target-package/inline-tag-defs/target.spec.js rename {public => tools}/api-builder/typescript-package/index.js (100%) rename {public => tools}/api-builder/typescript-package/mocks/mockPackage.js (100%) rename {public => tools}/api-builder/typescript-package/mocks/readTypeScriptModules/ignoreExportsMatching.ts (100%) rename {public => tools}/api-builder/typescript-package/mocks/readTypeScriptModules/interfaces.ts (100%) rename {public => tools}/api-builder/typescript-package/mocks/readTypeScriptModules/orderingOfMembers.ts (100%) rename {public => tools}/api-builder/typescript-package/mocks/readTypeScriptModules/privateModule.ts (100%) rename {public => tools}/api-builder/typescript-package/mocks/readTypeScriptModules/publicModule.ts (100%) rename {public => tools}/api-builder/typescript-package/mocks/tsParser/importedSrc.ts (100%) rename {public => tools}/api-builder/typescript-package/mocks/tsParser/testSrc.ts (100%) rename {public => tools}/api-builder/typescript-package/processors/readTypeScriptModules.js (100%) rename {public => tools}/api-builder/typescript-package/processors/readTypeScriptModules.spec.js (100%) rename {public => tools}/api-builder/typescript-package/services/convertPrivateClassesToInterfaces.js (100%) rename {public => tools}/api-builder/typescript-package/services/convertPrivateClassesToInterfaces.spec.js (100%) rename {public => tools}/api-builder/typescript-package/services/modules.js (100%) rename {public => tools}/api-builder/typescript-package/services/tsParser/createCompilerHost.js (100%) rename {public => tools}/api-builder/typescript-package/services/tsParser/createCompilerHost.spec.js (100%) rename {public => tools}/api-builder/typescript-package/services/tsParser/getContent.js (100%) rename {public => tools}/api-builder/typescript-package/services/tsParser/getExportDocType.js (100%) rename {public => tools}/api-builder/typescript-package/services/tsParser/getFileInfo.js (100%) rename {public => tools}/api-builder/typescript-package/services/tsParser/index.js (100%) rename {public => tools}/api-builder/typescript-package/services/tsParser/index.spec.js (100%) diff --git a/public/api-builder/angular.io-package/index.js b/tools/api-builder/angular.io-package/index.js similarity index 91% rename from public/api-builder/angular.io-package/index.js rename to tools/api-builder/angular.io-package/index.js index 377ec17f15..ea63abbda8 100644 --- a/public/api-builder/angular.io-package/index.js +++ b/tools/api-builder/angular.io-package/index.js @@ -2,6 +2,10 @@ var path = require('canonical-path'); var Package = require('dgeni').Package; var basePackage = require('../docs-package'); +var PROJECT_PATH = path.resolve(__dirname, "../../.."); +var PUBLIC_PATH = path.resolve(PROJECT_PATH, 'public'); +var DOCS_PATH = path.resolve(PUBLIC_PATH, 'docs'); + module.exports = new Package('angular.io', [basePackage]) .factory(require('./services/renderMarkdown')) @@ -35,7 +39,7 @@ module.exports = new Package('angular.io', [basePackage]) ]; readTypeScriptModules.hidePrivateMembers = true; - readFilesProcessor.basePath = path.resolve(__dirname, "../../docs"); + readFilesProcessor.basePath = DOCS_PATH; writeFilesProcessor.outputFolder = 'js/latest/api'; }) @@ -76,7 +80,7 @@ module.exports = new Package('angular.io', [basePackage]) computePathsProcessor.pathTemplates.push({ docTypes: ['app-data'], - pathTemplate: '../../../../resources/js/app-data', + pathTemplate: path.resolve(PUBLIC_PATH, 'resources/js/app-data'), outputPathTemplate: '${path}.json' }); }) diff --git a/public/api-builder/angular.io-package/mocks/mockPackage.js b/tools/api-builder/angular.io-package/mocks/mockPackage.js similarity index 100% rename from public/api-builder/angular.io-package/mocks/mockPackage.js rename to tools/api-builder/angular.io-package/mocks/mockPackage.js diff --git a/public/api-builder/angular.io-package/processors/addJadeDataDocsProcessor.js b/tools/api-builder/angular.io-package/processors/addJadeDataDocsProcessor.js similarity index 100% rename from public/api-builder/angular.io-package/processors/addJadeDataDocsProcessor.js rename to tools/api-builder/angular.io-package/processors/addJadeDataDocsProcessor.js diff --git a/public/api-builder/angular.io-package/processors/addJadeDataDocsProcessor.spec.js b/tools/api-builder/angular.io-package/processors/addJadeDataDocsProcessor.spec.js similarity index 100% rename from public/api-builder/angular.io-package/processors/addJadeDataDocsProcessor.spec.js rename to tools/api-builder/angular.io-package/processors/addJadeDataDocsProcessor.spec.js diff --git a/public/api-builder/angular.io-package/processors/extractDirectiveClasses.js b/tools/api-builder/angular.io-package/processors/extractDirectiveClasses.js similarity index 100% rename from public/api-builder/angular.io-package/processors/extractDirectiveClasses.js rename to tools/api-builder/angular.io-package/processors/extractDirectiveClasses.js diff --git a/public/api-builder/angular.io-package/processors/extractDirectiveClasses.spec.js b/tools/api-builder/angular.io-package/processors/extractDirectiveClasses.spec.js similarity index 100% rename from public/api-builder/angular.io-package/processors/extractDirectiveClasses.spec.js rename to tools/api-builder/angular.io-package/processors/extractDirectiveClasses.spec.js diff --git a/public/api-builder/angular.io-package/processors/filterUnwantedDecorators.js b/tools/api-builder/angular.io-package/processors/filterUnwantedDecorators.js similarity index 100% rename from public/api-builder/angular.io-package/processors/filterUnwantedDecorators.js rename to tools/api-builder/angular.io-package/processors/filterUnwantedDecorators.js diff --git a/public/api-builder/angular.io-package/processors/filterUnwantedDecorators.spec.js b/tools/api-builder/angular.io-package/processors/filterUnwantedDecorators.spec.js similarity index 100% rename from public/api-builder/angular.io-package/processors/filterUnwantedDecorators.spec.js rename to tools/api-builder/angular.io-package/processors/filterUnwantedDecorators.spec.js diff --git a/public/api-builder/angular.io-package/processors/matchUpDirectiveDecorators.js b/tools/api-builder/angular.io-package/processors/matchUpDirectiveDecorators.js similarity index 100% rename from public/api-builder/angular.io-package/processors/matchUpDirectiveDecorators.js rename to tools/api-builder/angular.io-package/processors/matchUpDirectiveDecorators.js diff --git a/public/api-builder/angular.io-package/rendering/indentForMarkdown.js b/tools/api-builder/angular.io-package/rendering/indentForMarkdown.js similarity index 100% rename from public/api-builder/angular.io-package/rendering/indentForMarkdown.js rename to tools/api-builder/angular.io-package/rendering/indentForMarkdown.js diff --git a/public/api-builder/angular.io-package/rendering/toId.js b/tools/api-builder/angular.io-package/rendering/toId.js similarity index 100% rename from public/api-builder/angular.io-package/rendering/toId.js rename to tools/api-builder/angular.io-package/rendering/toId.js diff --git a/public/api-builder/angular.io-package/rendering/toId.spec.js b/tools/api-builder/angular.io-package/rendering/toId.spec.js similarity index 100% rename from public/api-builder/angular.io-package/rendering/toId.spec.js rename to tools/api-builder/angular.io-package/rendering/toId.spec.js diff --git a/public/api-builder/angular.io-package/rendering/trimBlankLines.js b/tools/api-builder/angular.io-package/rendering/trimBlankLines.js similarity index 100% rename from public/api-builder/angular.io-package/rendering/trimBlankLines.js rename to tools/api-builder/angular.io-package/rendering/trimBlankLines.js diff --git a/public/api-builder/angular.io-package/rendering/trimBlankLines.spec.js b/tools/api-builder/angular.io-package/rendering/trimBlankLines.spec.js similarity index 100% rename from public/api-builder/angular.io-package/rendering/trimBlankLines.spec.js rename to tools/api-builder/angular.io-package/rendering/trimBlankLines.spec.js diff --git a/public/api-builder/angular.io-package/services/packageInfo.js b/tools/api-builder/angular.io-package/services/packageInfo.js similarity index 100% rename from public/api-builder/angular.io-package/services/packageInfo.js rename to tools/api-builder/angular.io-package/services/packageInfo.js diff --git a/public/api-builder/angular.io-package/services/renderMarkdown.js b/tools/api-builder/angular.io-package/services/renderMarkdown.js similarity index 100% rename from public/api-builder/angular.io-package/services/renderMarkdown.js rename to tools/api-builder/angular.io-package/services/renderMarkdown.js diff --git a/public/api-builder/angular.io-package/templates/app-data.template.html b/tools/api-builder/angular.io-package/templates/app-data.template.html similarity index 100% rename from public/api-builder/angular.io-package/templates/app-data.template.html rename to tools/api-builder/angular.io-package/templates/app-data.template.html diff --git a/public/api-builder/angular.io-package/templates/class.template.html b/tools/api-builder/angular.io-package/templates/class.template.html similarity index 100% rename from public/api-builder/angular.io-package/templates/class.template.html rename to tools/api-builder/angular.io-package/templates/class.template.html diff --git a/public/api-builder/angular.io-package/templates/directive.template.html b/tools/api-builder/angular.io-package/templates/directive.template.html similarity index 100% rename from public/api-builder/angular.io-package/templates/directive.template.html rename to tools/api-builder/angular.io-package/templates/directive.template.html diff --git a/public/api-builder/angular.io-package/templates/enum.template.html b/tools/api-builder/angular.io-package/templates/enum.template.html similarity index 100% rename from public/api-builder/angular.io-package/templates/enum.template.html rename to tools/api-builder/angular.io-package/templates/enum.template.html diff --git a/public/api-builder/angular.io-package/templates/function.template.html b/tools/api-builder/angular.io-package/templates/function.template.html similarity index 100% rename from public/api-builder/angular.io-package/templates/function.template.html rename to tools/api-builder/angular.io-package/templates/function.template.html diff --git a/public/api-builder/angular.io-package/templates/jade-data.template.html b/tools/api-builder/angular.io-package/templates/jade-data.template.html similarity index 100% rename from public/api-builder/angular.io-package/templates/jade-data.template.html rename to tools/api-builder/angular.io-package/templates/jade-data.template.html diff --git a/public/api-builder/angular.io-package/templates/layout/base.template.html b/tools/api-builder/angular.io-package/templates/layout/base.template.html similarity index 100% rename from public/api-builder/angular.io-package/templates/layout/base.template.html rename to tools/api-builder/angular.io-package/templates/layout/base.template.html diff --git a/public/api-builder/angular.io-package/templates/lib/paramList.html b/tools/api-builder/angular.io-package/templates/lib/paramList.html similarity index 100% rename from public/api-builder/angular.io-package/templates/lib/paramList.html rename to tools/api-builder/angular.io-package/templates/lib/paramList.html diff --git a/public/api-builder/angular.io-package/templates/module.template.html b/tools/api-builder/angular.io-package/templates/module.template.html similarity index 100% rename from public/api-builder/angular.io-package/templates/module.template.html rename to tools/api-builder/angular.io-package/templates/module.template.html diff --git a/public/api-builder/angular.io-package/templates/var.template.html b/tools/api-builder/angular.io-package/templates/var.template.html similarity index 100% rename from public/api-builder/angular.io-package/templates/var.template.html rename to tools/api-builder/angular.io-package/templates/var.template.html diff --git a/public/api-builder/docs-package/index.js b/tools/api-builder/docs-package/index.js similarity index 100% rename from public/api-builder/docs-package/index.js rename to tools/api-builder/docs-package/index.js diff --git a/public/api-builder/docs-package/mocks/importedSrc.ts b/tools/api-builder/docs-package/mocks/importedSrc.ts similarity index 100% rename from public/api-builder/docs-package/mocks/importedSrc.ts rename to tools/api-builder/docs-package/mocks/importedSrc.ts diff --git a/public/api-builder/docs-package/mocks/mockPackage.js b/tools/api-builder/docs-package/mocks/mockPackage.js similarity index 100% rename from public/api-builder/docs-package/mocks/mockPackage.js rename to tools/api-builder/docs-package/mocks/mockPackage.js diff --git a/public/api-builder/docs-package/mocks/testSrc.ts b/tools/api-builder/docs-package/mocks/testSrc.ts similarity index 100% rename from public/api-builder/docs-package/mocks/testSrc.ts rename to tools/api-builder/docs-package/mocks/testSrc.ts diff --git a/public/api-builder/docs-package/processors/checkUnbalancedBackTicks.js b/tools/api-builder/docs-package/processors/checkUnbalancedBackTicks.js similarity index 100% rename from public/api-builder/docs-package/processors/checkUnbalancedBackTicks.js rename to tools/api-builder/docs-package/processors/checkUnbalancedBackTicks.js diff --git a/public/api-builder/docs-package/processors/checkUnbalancedBackTicks.spec.js b/tools/api-builder/docs-package/processors/checkUnbalancedBackTicks.spec.js similarity index 100% rename from public/api-builder/docs-package/processors/checkUnbalancedBackTicks.spec.js rename to tools/api-builder/docs-package/processors/checkUnbalancedBackTicks.spec.js diff --git a/public/api-builder/docs-package/processors/convertBackticksToCodeBlocks.js b/tools/api-builder/docs-package/processors/convertBackticksToCodeBlocks.js similarity index 100% rename from public/api-builder/docs-package/processors/convertBackticksToCodeBlocks.js rename to tools/api-builder/docs-package/processors/convertBackticksToCodeBlocks.js diff --git a/public/api-builder/docs-package/processors/convertBackticksToCodeBlocks.spec.js b/tools/api-builder/docs-package/processors/convertBackticksToCodeBlocks.spec.js similarity index 100% rename from public/api-builder/docs-package/processors/convertBackticksToCodeBlocks.spec.js rename to tools/api-builder/docs-package/processors/convertBackticksToCodeBlocks.spec.js diff --git a/public/api-builder/docs-package/processors/convertPrivateClassesToInterfaces.js b/tools/api-builder/docs-package/processors/convertPrivateClassesToInterfaces.js similarity index 100% rename from public/api-builder/docs-package/processors/convertPrivateClassesToInterfaces.js rename to tools/api-builder/docs-package/processors/convertPrivateClassesToInterfaces.js diff --git a/public/api-builder/docs-package/processors/createOverviewDump.js b/tools/api-builder/docs-package/processors/createOverviewDump.js similarity index 100% rename from public/api-builder/docs-package/processors/createOverviewDump.js rename to tools/api-builder/docs-package/processors/createOverviewDump.js diff --git a/public/api-builder/docs-package/processors/extractDirectiveClasses.js b/tools/api-builder/docs-package/processors/extractDirectiveClasses.js similarity index 100% rename from public/api-builder/docs-package/processors/extractDirectiveClasses.js rename to tools/api-builder/docs-package/processors/extractDirectiveClasses.js diff --git a/public/api-builder/docs-package/processors/extractDirectiveClasses.spec.js b/tools/api-builder/docs-package/processors/extractDirectiveClasses.spec.js similarity index 100% rename from public/api-builder/docs-package/processors/extractDirectiveClasses.spec.js rename to tools/api-builder/docs-package/processors/extractDirectiveClasses.spec.js diff --git a/public/api-builder/docs-package/processors/extractTitleFromGuides.js b/tools/api-builder/docs-package/processors/extractTitleFromGuides.js similarity index 100% rename from public/api-builder/docs-package/processors/extractTitleFromGuides.js rename to tools/api-builder/docs-package/processors/extractTitleFromGuides.js diff --git a/public/api-builder/docs-package/processors/generateNavigationDoc.js b/tools/api-builder/docs-package/processors/generateNavigationDoc.js similarity index 100% rename from public/api-builder/docs-package/processors/generateNavigationDoc.js rename to tools/api-builder/docs-package/processors/generateNavigationDoc.js diff --git a/public/api-builder/docs-package/readers/ngdoc.js b/tools/api-builder/docs-package/readers/ngdoc.js similarity index 100% rename from public/api-builder/docs-package/readers/ngdoc.js rename to tools/api-builder/docs-package/readers/ngdoc.js diff --git a/public/api-builder/docs-package/readers/ngdoc.spec.js b/tools/api-builder/docs-package/readers/ngdoc.spec.js similarity index 100% rename from public/api-builder/docs-package/readers/ngdoc.spec.js rename to tools/api-builder/docs-package/readers/ngdoc.spec.js diff --git a/public/api-builder/docs-package/templates/class.template.html b/tools/api-builder/docs-package/templates/class.template.html similarity index 100% rename from public/api-builder/docs-package/templates/class.template.html rename to tools/api-builder/docs-package/templates/class.template.html diff --git a/public/api-builder/docs-package/templates/common.template.html b/tools/api-builder/docs-package/templates/common.template.html similarity index 100% rename from public/api-builder/docs-package/templates/common.template.html rename to tools/api-builder/docs-package/templates/common.template.html diff --git a/public/api-builder/docs-package/templates/const.template.html b/tools/api-builder/docs-package/templates/const.template.html similarity index 100% rename from public/api-builder/docs-package/templates/const.template.html rename to tools/api-builder/docs-package/templates/const.template.html diff --git a/public/api-builder/docs-package/templates/data-module.template.js b/tools/api-builder/docs-package/templates/data-module.template.js similarity index 100% rename from public/api-builder/docs-package/templates/data-module.template.js rename to tools/api-builder/docs-package/templates/data-module.template.js diff --git a/public/api-builder/docs-package/templates/function.template.html b/tools/api-builder/docs-package/templates/function.template.html similarity index 100% rename from public/api-builder/docs-package/templates/function.template.html rename to tools/api-builder/docs-package/templates/function.template.html diff --git a/public/api-builder/docs-package/templates/guide.template.html b/tools/api-builder/docs-package/templates/guide.template.html similarity index 100% rename from public/api-builder/docs-package/templates/guide.template.html rename to tools/api-builder/docs-package/templates/guide.template.html diff --git a/public/api-builder/docs-package/templates/interface.template.html b/tools/api-builder/docs-package/templates/interface.template.html similarity index 100% rename from public/api-builder/docs-package/templates/interface.template.html rename to tools/api-builder/docs-package/templates/interface.template.html diff --git a/public/api-builder/docs-package/templates/layout/base.template.html b/tools/api-builder/docs-package/templates/layout/base.template.html similarity index 100% rename from public/api-builder/docs-package/templates/layout/base.template.html rename to tools/api-builder/docs-package/templates/layout/base.template.html diff --git a/public/api-builder/docs-package/templates/lib/githubLinks.html b/tools/api-builder/docs-package/templates/lib/githubLinks.html similarity index 100% rename from public/api-builder/docs-package/templates/lib/githubLinks.html rename to tools/api-builder/docs-package/templates/lib/githubLinks.html diff --git a/public/api-builder/docs-package/templates/lib/paramList.html b/tools/api-builder/docs-package/templates/lib/paramList.html similarity index 100% rename from public/api-builder/docs-package/templates/lib/paramList.html rename to tools/api-builder/docs-package/templates/lib/paramList.html diff --git a/public/api-builder/docs-package/templates/module.template.html b/tools/api-builder/docs-package/templates/module.template.html similarity index 100% rename from public/api-builder/docs-package/templates/module.template.html rename to tools/api-builder/docs-package/templates/module.template.html diff --git a/public/api-builder/docs-package/templates/overview-dump.template.html b/tools/api-builder/docs-package/templates/overview-dump.template.html similarity index 100% rename from public/api-builder/docs-package/templates/overview-dump.template.html rename to tools/api-builder/docs-package/templates/overview-dump.template.html diff --git a/public/api-builder/docs-package/templates/type-alias.template.html b/tools/api-builder/docs-package/templates/type-alias.template.html similarity index 100% rename from public/api-builder/docs-package/templates/type-alias.template.html rename to tools/api-builder/docs-package/templates/type-alias.template.html diff --git a/public/api-builder/docs-package/templates/var.template.html b/tools/api-builder/docs-package/templates/var.template.html similarity index 100% rename from public/api-builder/docs-package/templates/var.template.html rename to tools/api-builder/docs-package/templates/var.template.html diff --git a/public/api-builder/links-package/index.js b/tools/api-builder/links-package/index.js similarity index 100% rename from public/api-builder/links-package/index.js rename to tools/api-builder/links-package/index.js diff --git a/public/api-builder/links-package/inline-tag-defs/example.js b/tools/api-builder/links-package/inline-tag-defs/example.js similarity index 100% rename from public/api-builder/links-package/inline-tag-defs/example.js rename to tools/api-builder/links-package/inline-tag-defs/example.js diff --git a/public/api-builder/links-package/inline-tag-defs/exampleTabs.js b/tools/api-builder/links-package/inline-tag-defs/exampleTabs.js similarity index 100% rename from public/api-builder/links-package/inline-tag-defs/exampleTabs.js rename to tools/api-builder/links-package/inline-tag-defs/exampleTabs.js diff --git a/public/api-builder/links-package/inline-tag-defs/link.js b/tools/api-builder/links-package/inline-tag-defs/link.js similarity index 100% rename from public/api-builder/links-package/inline-tag-defs/link.js rename to tools/api-builder/links-package/inline-tag-defs/link.js diff --git a/public/api-builder/links-package/inline-tag-defs/linkDevGuide.js b/tools/api-builder/links-package/inline-tag-defs/linkDevGuide.js similarity index 100% rename from public/api-builder/links-package/inline-tag-defs/linkDevGuide.js rename to tools/api-builder/links-package/inline-tag-defs/linkDevGuide.js diff --git a/public/api-builder/links-package/services/getApiFragmentFileName.js b/tools/api-builder/links-package/services/getApiFragmentFileName.js similarity index 100% rename from public/api-builder/links-package/services/getApiFragmentFileName.js rename to tools/api-builder/links-package/services/getApiFragmentFileName.js diff --git a/public/api-builder/links-package/services/getLinkInfo.js b/tools/api-builder/links-package/services/getLinkInfo.js similarity index 100% rename from public/api-builder/links-package/services/getLinkInfo.js rename to tools/api-builder/links-package/services/getLinkInfo.js diff --git a/public/api-builder/links-package/services/parseArgString.js b/tools/api-builder/links-package/services/parseArgString.js similarity index 100% rename from public/api-builder/links-package/services/parseArgString.js rename to tools/api-builder/links-package/services/parseArgString.js diff --git a/tools/api-builder/target-package/index.js b/tools/api-builder/target-package/index.js new file mode 100644 index 0000000000..28230d8c07 --- /dev/null +++ b/tools/api-builder/target-package/index.js @@ -0,0 +1,9 @@ +var Package = require('dgeni').Package; + +module.exports = new Package('target', []) + +.factory(require('./inline-tag-defs/target')) + +.config(function(inlineTagProcessor, targetInlineTagDef) { + inlineTagProcessor.inlineTagDefinitions.push(targetInlineTagDef); +}); diff --git a/tools/api-builder/target-package/inline-tag-defs/target.js b/tools/api-builder/target-package/inline-tag-defs/target.js new file mode 100644 index 0000000000..99c74ee7ed --- /dev/null +++ b/tools/api-builder/target-package/inline-tag-defs/target.js @@ -0,0 +1,24 @@ +var _ = require('lodash'); + +/** + * @dgService + * @description + * Process inline `target` block tags + * (of the form `{@target environment1 environment2}...{@endtarget}`), + * filtering out the blocks that do not match the containing document's + * `targetEnvironments`. + */ +module.exports = function targetInlineTagDef() { + return { + name: 'target', + end: 'endtarget', + handler: function(doc, tagName, tagDescription) { + var targets = tagDescription && tagDescription.tag.split(' '); + if (!targets || !doc.targetEnvironments || + _.intersection(targets, doc.targetEnvironments).length) { + return tagDescription.content; + } + return ''; + } + }; +}; \ No newline at end of file diff --git a/tools/api-builder/target-package/inline-tag-defs/target.spec.js b/tools/api-builder/target-package/inline-tag-defs/target.spec.js new file mode 100644 index 0000000000..115665218b --- /dev/null +++ b/tools/api-builder/target-package/inline-tag-defs/target.spec.js @@ -0,0 +1,24 @@ +var targetFactory = require('./target'); + +describe('target inline-tag-def', function() { + it('should filter out content that does not match the doc.targetEnvironments', function() { + var doc, target, result; + + doc = { + targetEnvironments: ['js', 'es6'] + }; + + target = targetFactory(); + result = target.handler(doc, 'target', { + tag: 'es6 ts', + content: 'abc' + }); + expect(result).toEqual('abc'); + + result = target.handler(doc, 'target', { + tag: 'ts', + content: 'xyz' + }); + expect(result).toEqual(''); + }); +}); \ No newline at end of file diff --git a/public/api-builder/typescript-package/index.js b/tools/api-builder/typescript-package/index.js similarity index 100% rename from public/api-builder/typescript-package/index.js rename to tools/api-builder/typescript-package/index.js diff --git a/public/api-builder/typescript-package/mocks/mockPackage.js b/tools/api-builder/typescript-package/mocks/mockPackage.js similarity index 100% rename from public/api-builder/typescript-package/mocks/mockPackage.js rename to tools/api-builder/typescript-package/mocks/mockPackage.js diff --git a/public/api-builder/typescript-package/mocks/readTypeScriptModules/ignoreExportsMatching.ts b/tools/api-builder/typescript-package/mocks/readTypeScriptModules/ignoreExportsMatching.ts similarity index 100% rename from public/api-builder/typescript-package/mocks/readTypeScriptModules/ignoreExportsMatching.ts rename to tools/api-builder/typescript-package/mocks/readTypeScriptModules/ignoreExportsMatching.ts diff --git a/public/api-builder/typescript-package/mocks/readTypeScriptModules/interfaces.ts b/tools/api-builder/typescript-package/mocks/readTypeScriptModules/interfaces.ts similarity index 100% rename from public/api-builder/typescript-package/mocks/readTypeScriptModules/interfaces.ts rename to tools/api-builder/typescript-package/mocks/readTypeScriptModules/interfaces.ts diff --git a/public/api-builder/typescript-package/mocks/readTypeScriptModules/orderingOfMembers.ts b/tools/api-builder/typescript-package/mocks/readTypeScriptModules/orderingOfMembers.ts similarity index 100% rename from public/api-builder/typescript-package/mocks/readTypeScriptModules/orderingOfMembers.ts rename to tools/api-builder/typescript-package/mocks/readTypeScriptModules/orderingOfMembers.ts diff --git a/public/api-builder/typescript-package/mocks/readTypeScriptModules/privateModule.ts b/tools/api-builder/typescript-package/mocks/readTypeScriptModules/privateModule.ts similarity index 100% rename from public/api-builder/typescript-package/mocks/readTypeScriptModules/privateModule.ts rename to tools/api-builder/typescript-package/mocks/readTypeScriptModules/privateModule.ts diff --git a/public/api-builder/typescript-package/mocks/readTypeScriptModules/publicModule.ts b/tools/api-builder/typescript-package/mocks/readTypeScriptModules/publicModule.ts similarity index 100% rename from public/api-builder/typescript-package/mocks/readTypeScriptModules/publicModule.ts rename to tools/api-builder/typescript-package/mocks/readTypeScriptModules/publicModule.ts diff --git a/public/api-builder/typescript-package/mocks/tsParser/importedSrc.ts b/tools/api-builder/typescript-package/mocks/tsParser/importedSrc.ts similarity index 100% rename from public/api-builder/typescript-package/mocks/tsParser/importedSrc.ts rename to tools/api-builder/typescript-package/mocks/tsParser/importedSrc.ts diff --git a/public/api-builder/typescript-package/mocks/tsParser/testSrc.ts b/tools/api-builder/typescript-package/mocks/tsParser/testSrc.ts similarity index 100% rename from public/api-builder/typescript-package/mocks/tsParser/testSrc.ts rename to tools/api-builder/typescript-package/mocks/tsParser/testSrc.ts diff --git a/public/api-builder/typescript-package/processors/readTypeScriptModules.js b/tools/api-builder/typescript-package/processors/readTypeScriptModules.js similarity index 100% rename from public/api-builder/typescript-package/processors/readTypeScriptModules.js rename to tools/api-builder/typescript-package/processors/readTypeScriptModules.js diff --git a/public/api-builder/typescript-package/processors/readTypeScriptModules.spec.js b/tools/api-builder/typescript-package/processors/readTypeScriptModules.spec.js similarity index 100% rename from public/api-builder/typescript-package/processors/readTypeScriptModules.spec.js rename to tools/api-builder/typescript-package/processors/readTypeScriptModules.spec.js diff --git a/public/api-builder/typescript-package/services/convertPrivateClassesToInterfaces.js b/tools/api-builder/typescript-package/services/convertPrivateClassesToInterfaces.js similarity index 100% rename from public/api-builder/typescript-package/services/convertPrivateClassesToInterfaces.js rename to tools/api-builder/typescript-package/services/convertPrivateClassesToInterfaces.js diff --git a/public/api-builder/typescript-package/services/convertPrivateClassesToInterfaces.spec.js b/tools/api-builder/typescript-package/services/convertPrivateClassesToInterfaces.spec.js similarity index 100% rename from public/api-builder/typescript-package/services/convertPrivateClassesToInterfaces.spec.js rename to tools/api-builder/typescript-package/services/convertPrivateClassesToInterfaces.spec.js diff --git a/public/api-builder/typescript-package/services/modules.js b/tools/api-builder/typescript-package/services/modules.js similarity index 100% rename from public/api-builder/typescript-package/services/modules.js rename to tools/api-builder/typescript-package/services/modules.js diff --git a/public/api-builder/typescript-package/services/tsParser/createCompilerHost.js b/tools/api-builder/typescript-package/services/tsParser/createCompilerHost.js similarity index 100% rename from public/api-builder/typescript-package/services/tsParser/createCompilerHost.js rename to tools/api-builder/typescript-package/services/tsParser/createCompilerHost.js diff --git a/public/api-builder/typescript-package/services/tsParser/createCompilerHost.spec.js b/tools/api-builder/typescript-package/services/tsParser/createCompilerHost.spec.js similarity index 100% rename from public/api-builder/typescript-package/services/tsParser/createCompilerHost.spec.js rename to tools/api-builder/typescript-package/services/tsParser/createCompilerHost.spec.js diff --git a/public/api-builder/typescript-package/services/tsParser/getContent.js b/tools/api-builder/typescript-package/services/tsParser/getContent.js similarity index 100% rename from public/api-builder/typescript-package/services/tsParser/getContent.js rename to tools/api-builder/typescript-package/services/tsParser/getContent.js diff --git a/public/api-builder/typescript-package/services/tsParser/getExportDocType.js b/tools/api-builder/typescript-package/services/tsParser/getExportDocType.js similarity index 100% rename from public/api-builder/typescript-package/services/tsParser/getExportDocType.js rename to tools/api-builder/typescript-package/services/tsParser/getExportDocType.js diff --git a/public/api-builder/typescript-package/services/tsParser/getFileInfo.js b/tools/api-builder/typescript-package/services/tsParser/getFileInfo.js similarity index 100% rename from public/api-builder/typescript-package/services/tsParser/getFileInfo.js rename to tools/api-builder/typescript-package/services/tsParser/getFileInfo.js diff --git a/public/api-builder/typescript-package/services/tsParser/index.js b/tools/api-builder/typescript-package/services/tsParser/index.js similarity index 100% rename from public/api-builder/typescript-package/services/tsParser/index.js rename to tools/api-builder/typescript-package/services/tsParser/index.js diff --git a/public/api-builder/typescript-package/services/tsParser/index.spec.js b/tools/api-builder/typescript-package/services/tsParser/index.spec.js similarity index 100% rename from public/api-builder/typescript-package/services/tsParser/index.spec.js rename to tools/api-builder/typescript-package/services/tsParser/index.spec.js