Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(vocab): add imports for typescript generation #657

Merged
merged 1 commit into from
Jun 7, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15,038 changes: 11,478 additions & 3,560 deletions package-lock.json

Large diffs are not rendered by default.

14,199 changes: 195 additions & 14,004 deletions packages/concerto-core/package-lock.json

Large diffs are not rendered by default.

2,091 changes: 385 additions & 1,706 deletions packages/concerto-cto/package-lock.json

Large diffs are not rendered by default.

303 changes: 303 additions & 0 deletions packages/concerto-types/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/concerto-types/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
"license": "Apache-2.0",
"devDependencies": {
"@accordproject/concerto-core": "3.8.1",
"@accordproject/concerto-metamodel": "3.7.0",
"@accordproject/concerto-tools": "3.7.0",
"@accordproject/concerto-metamodel": "3.8.0",
"@accordproject/concerto-codegen": "3.14.0",
"@accordproject/concerto-util": "3.8.1",
"eslint": "8.2.0",
"license-check-and-add": "2.3.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/concerto-types/scripts/codegen.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const { CodeGen: { TypescriptVisitor }} = require('@accordproject/concerto-tools');
const { CodeGen: { TypescriptVisitor }} = require('@accordproject/concerto-codegen');
const { MetaModelUtil: {metaModelCto} } = require('@accordproject/concerto-metamodel');
const { ModelLoader } = require('@accordproject/concerto-core');
const { FileWriter } = require('@accordproject/concerto-util');
Expand Down
9 changes: 9 additions & 0 deletions packages/concerto-vocabulary/lib/vocabulary.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@

'use strict';

// Types needed for TypeScript generation.
/* eslint-disable no-unused-vars */
/* istanbul ignore next */
if (global === undefined) {
const VocabularyManager = require('./vocabularymanager');
const { ModelFile } = require('@accordproject/concerto-core');
}
/* eslint-enable no-unused-vars */

/**
* A vocabulary for a concerto model
* @class
Expand Down
8 changes: 8 additions & 0 deletions packages/concerto-vocabulary/lib/vocabularymanager.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,14 @@ const YAML = require('yaml');
const { MetaModelNamespace } = require('@accordproject/concerto-metamodel');
const Vocabulary = require('./vocabulary');

// Types needed for TypeScript generation.
/* eslint-disable no-unused-vars */
/* istanbul ignore next */
if (global === undefined) {
const { ModelManager } = require('@accordproject/concerto-core');
}
/* eslint-enable no-unused-vars */

/**
* Converts a camel case string to a sentence
* @param {string} text input
Expand Down
3 changes: 2 additions & 1 deletion packages/concerto-vocabulary/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
"author": "accordproject.org",
"license": "Apache-2.0",
"devDependencies": {
"@accordproject/concerto-core": "3.8.1",
"chai": "4.3.6",
"chai-as-promised": "7.1.1",
"chai-things": "0.2.0",
Expand All @@ -49,7 +50,7 @@
"typescript": "4.6.3"
},
"dependencies": {
"@accordproject/concerto-metamodel": "3.7.0",
"@accordproject/concerto-metamodel": "3.8.0",
"yaml": "2.2.2"
},
"browserslist": "> 0.25%, not dead",
Expand Down
2 changes: 2 additions & 0 deletions packages/concerto-vocabulary/types/lib/vocabulary.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,5 @@ declare class Vocabulary {
*/
toJSON(): any;
}
import VocabularyManager = require("./vocabularymanager");
import { ModelFile } from "@accordproject/concerto-core";
Original file line number Diff line number Diff line change
Expand Up @@ -117,3 +117,4 @@ declare class VocabularyManager {
validate(modelManager: ModelManager): any;
}
import Vocabulary = require("./vocabulary");
import { ModelManager } from "@accordproject/concerto-core";