chore(build): Add WebWorker bundle.

Closes #3207

Closes #3881
This commit is contained in:
Jason Teplitz
2015-08-27 10:39:39 -07:00
parent be07390859
commit 3468f7cfd5
19 changed files with 111 additions and 1840 deletions

View File

@ -39,6 +39,8 @@ module.exports = new Package('angular-v2-docs', [jsdocPackage, nunjucksPackage,
readFilesProcessor.basePath = path.resolve(__dirname, '../..');
readTypeScriptModules.sourceFiles = [
'angular2/angular2.ts',
'angular2/web_worker/worker.ts',
'angular2/web_worker/ui.ts',
'angular2/router.ts',
'angular2/http.ts'
];
@ -48,24 +50,38 @@ module.exports = new Package('angular-v2-docs', [jsdocPackage, nunjucksPackage,
{
id: 'angular2/angular2',
references: ['../es6-promise/es6-promise.d.ts', '../rx/rx.d.ts'],
namespace: 'ng',
modules: {
'angular2/angular2': 'angular2/angular2',
'angular2/angular2': {
namespace: 'ng',
id: 'angular2/angular2'
},
'angular2/web_worker/worker': {
namespace: 'ngWorker',
id: 'angular2/web_worker/worker'
},
'angular2/web_worker/ui': {
namespace: 'ngUi',
id: 'angular2/web_worker/ui'
}
}
},
{
id: 'angular2/router',
namespace: 'ngRouter',
references: ['./angular2.d.ts'],
modules: {
'angular2/router': 'angular2/router'
'angular2/router': {
namespace: 'ngRouter',
id: 'angular2/router'
}
}
},
{
id: 'angular2/http',
namespace: 'ngHttp',
modules: {
'angular2/http':'angular2/http'
'angular2/http': {
namespace: 'ngHttp',
id: 'angular2/http'
}
}
}
];
@ -109,4 +125,4 @@ module.exports = new Package('angular-v2-docs', [jsdocPackage, nunjucksPackage,
'${ doc.docType }.template.html',
'common.template.html'
];
});
});

View File

@ -32,11 +32,11 @@ module.exports = function createTypeDefinitionFile(log) {
outputPath: docPath,
// A type definition may include a number of top level modules
// And those modules could be aliased (such as 'angular2/angular2.api' -> 'angular2/angular2')
moduleDocs: _.transform(def.modules, function(moduleDocs, id, alias) {
moduleDocs[id] = {
moduleDocs: _.transform(def.modules, function(moduleDocs, props, alias) {
moduleDocs[props.id] = {
id: alias,
doc: null,
namespace: def.namespace,
namespace: props.namespace,
references: def.references
};
})

View File

@ -14,7 +14,12 @@ describe('createTypeDefinitionFile processor', function() {
// Initialize the processor
processor.typeDefinitions = [{
id: 'angular2/angular2',
modules: { 'angular2/angular2': 'angular2/angular2' }
modules: {
'angular2/angular2': {
id: 'angular2/angular2',
namespace: 'ng'
}
}
}];
});
@ -45,4 +50,4 @@ describe('createTypeDefinitionFile processor', function() {
});
});
});
});

View File

@ -5,7 +5,8 @@ interface List<T> extends Array<T> {}
interface Map<K,V> {}
interface StringMap<K,V> extends Map<K,V> {}
declare module ng {
{% for alias, module in doc.moduleDocs %}
declare module {$ module.namespace $} {
// See https://github.com/Microsoft/TypeScript/issues/1168
class BaseException /* extends Error */ {
message: string;
@ -14,4 +15,5 @@ declare module ng {
}
interface InjectableReference {}
}
{% endfor %}
{% endblock %}