Skip to content

Commit

Permalink
Ts generator system types (hyperledger-archives#1393)
Browse files Browse the repository at this point in the history
* Changed names of types in system namespace etc

* Fixes for tests

* Fixes for angular generator with system types

* Fixed dependendies, CTO and ACL file as well as ensuring that test failures fail the build

* Reject if connection error
  • Loading branch information
dselman authored Jun 27, 2017
1 parent cfd62e3 commit 025b38c
Show file tree
Hide file tree
Showing 5 changed files with 206 additions and 204 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,16 @@ class TypescriptVisitor {
visitModelFile(modelFile, parameters) {
parameters.fileWriter.openFile(modelFile.getNamespace() + '.ts');

// TODO (DCS) don't yet understand namespaces...
// if this is not the system model file we have to import the system types
// so that they can be extended
if( !modelFile.isSystemModelFile() ) {
const systemTypes = modelFile.getModelManager().getSystemTypes();

for(let n=0; n < systemTypes.length; n++) {
const systemType = systemTypes[n];
parameters.fileWriter.writeLine(0, 'import {' + systemType.getName() + '} from \'./org.hyperledger.composer.system\';');
}
}
parameters.fileWriter.writeLine(0, '// export namespace ' + modelFile.getNamespace() + '{');

modelFile.getAllDeclarations().forEach((decl) => {
Expand Down
Loading

0 comments on commit 025b38c

Please sign in to comment.