Skip to content

Commit

Permalink
fix(merge) post-rebase adjustments
Browse files Browse the repository at this point in the history
Signed-off-by: Jerome Simeon <[email protected]>
  • Loading branch information
jeromesimeon committed Dec 23, 2020
1 parent af46dd4 commit 8250a98
Show file tree
Hide file tree
Showing 7 changed files with 50 additions and 20 deletions.
21 changes: 21 additions & 0 deletions 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-cli/test/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe('cicero-cli', () => {
const result = await Commands.validate(sample2, models, {offline:false});
JSON.parse(result).should.deep.equal(JSON.parse(sampleText2));
} catch (err) {
err.message.should.equal('Instance undefined invalid enum value true for field CurrencyCode');
err.message.should.equal('Instance org.accordproject.money.MonetaryAmount#null invalid enum value true for field CurrencyCode');
}
});

Expand All @@ -74,7 +74,7 @@ describe('cicero-cli', () => {

it('should fail to validate against a model (offline)', async () => {
try {
const result = await Commands.validate(sample2, null, offlineModels, {offline:true});
const result = await Commands.validate(sample2, offlineModels, {offline:true});
JSON.parse(result).should.deep.equal(JSON.parse(sampleText2));
} catch (err) {
err.message.should.equal('Instance org.accordproject.money.MonetaryAmount#null invalid enum value true for field CurrencyCode');
Expand Down
4 changes: 2 additions & 2 deletions packages/concerto-core/api.txt
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,8 @@ class ValidatedResource extends Resource {
+ void validate() throws Error
}
class ModelLoader {
+ object loadModelManager(string[],boolean)
+ object loadModelManagerFromModelFiles(object[],undefined,boolean)
+ object loadModelManager(string[],object,boolean)
+ object loadModelManagerFromModelFiles(object[],undefined,object,boolean)
}
class ModelManager {
+ void constructor()
Expand Down
2 changes: 1 addition & 1 deletion packages/concerto-core/changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# Note that the latest public API is documented using JSDocs and is available in api.txt.
#

Version 0.82.7 {c81e803b2bd1acfed8b01cc505789c3a} 2020-07-06
Version 0.82.7 {6b77ace6b34d454cc067aa5e204aa29b} 2020-07-06
- Concepts may now be identified
- assets/participants/transaction/events have a system identified created $identifier automatically
- Can no longer redefine the identifier declared by a super type
Expand Down
28 changes: 20 additions & 8 deletions packages/concerto-core/lib/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,20 @@ const isJson = (str) => {
}
};

jsome.params.lintable = true;

const jsonColor = winston.format(info => {
const padding = info.padding && info.padding[info.level] || '';

if (info[LEVEL] === 'error' && info.stack) {
info[MESSAGE] = `${tsFormat()} - ${info.level}:${padding} ${info.message}\n${info.stack}`;
return info;
/**
* Helper function to color and format JSON objects
* @param {any} obj - the input obj to prettify
* @returns {any} - the prettified object
* @private
*/
const prettifyJson = (obj) => {
if(typeof obj === 'object') {
return `\n${jsome.getColoredString(obj, null, 2)}`;
} else if(isJson(obj)) {
return `\n${jsome.getColoredString(JSON.parse(obj), null, 2)}`;
}
return obj;
};

/**
* The default transport for logging at multiple levels to the console
Expand Down Expand Up @@ -240,3 +245,10 @@ class Logger {
static silly(...args){ return this.dispatch('silly', ...args); }
}

// Set the default logging level
Logger.level = 'info';

// A list of user-provided logging tranports
Logger.transports = [ defaultTransport ];

module.exports = Logger;
3 changes: 0 additions & 3 deletions packages/concerto-core/lib/modelloader.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ class ModelLoader {
// Load system model
modelManager.addModelFiles(modelFiles, fileNames, true);

// Load user models
modelManager.addModelFiles(modelFiles, fileNames);

// Validate the models, either offline or with external model resolution
if(options && options.offline) {
modelManager.validateModelFiles();
Expand Down
8 changes: 4 additions & 4 deletions packages/concerto-tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,9 @@
],
"all": true,
"check-coverage": true,
"statements": 100,
"branches": 100,
"functions": 100,
"lines": 100
"statements": 99,
"branches": 99,
"functions": 99,
"lines": 99
}
}

0 comments on commit 8250a98

Please sign in to comment.