Skip to content
This repository has been archived by the owner on Mar 8, 2020. It is now read-only.

Commit

Permalink
Sanitise dependencies (#3798)
Browse files Browse the repository at this point in the history
* add in peer dependencies for composer-common

Signed-off-by: Matthew B White <[email protected]>

* add composer-commmon to dev dependencies for testing

Signed-off-by: Matthew B White <[email protected]>

* updates

Signed-off-by: Matthew B White <[email protected]>

* merges and ensure up-to- 0.19.3

Signed-off-by: Matthew B White <[email protected]>

* fix wrong dependancy, and fail integration tests fast

Signed-off-by: Matthew B White <[email protected]>
  • Loading branch information
mbwhite authored Apr 27, 2018
1 parent 3f07488 commit 02ea0e0
Show file tree
Hide file tree
Showing 16 changed files with 55 additions and 37 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,4 +80,4 @@
}
}
}
}
}
11 changes: 0 additions & 11 deletions packages/composer-common/lib/codegen/javascriptparser.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
'use strict';

const doctrine = require('doctrine');
// const esprima = require('esprima'); see comment in getExample fn
const acorn = require('acorn');

/**
Expand Down Expand Up @@ -548,16 +547,6 @@ class JavaScriptParser {
result = tags[0].description;
}

// Currently esprima seems to have a problem with the async await code.
// TODO: Investigate if this can be handled
// try {
// // Pass as a function so that return statements are valid
// let program = 'function testSyntax() {' + result + '}';
// esprima.parse(program);
// } catch (e) {
// throw Error('Malformed JSDoc Comment. Invalid @example tag: ' + comment);
// }

return result;
}
}
Expand Down
5 changes: 3 additions & 2 deletions packages/composer-common/lib/serializer/instancegenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@
const ClassDeclaration = require('../introspect/classdeclaration');
const EnumDeclaration = require('../introspect/enumdeclaration');
const Field = require('../introspect/field');
const leftPad = require('left-pad');
// const leftPad = require('left-pad');
const padStart = require('lodash.padstart');
const ModelUtil = require('../modelutil');
const RelationshipDeclaration = require('../introspect/relationshipdeclaration');
const Util = require('../util');
Expand Down Expand Up @@ -218,7 +219,7 @@ class InstanceGenerator {
*/
generateRandomId(classDeclaration) {
let id = Math.round(Math.random() * 9999).toString();
id = leftPad(id, 4, '0');
id = padStart(id, 4, '0');
return id;
}

Expand Down
6 changes: 3 additions & 3 deletions packages/composer-common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,16 @@
"dependencies": {
"acorn": "5.1.2",
"axios": "0.17.1",
"commander": "2.9.0",
"comment-parser": "0.4.0",
"config": "1.24.0",
"debug": "2.6.2",
"doctrine": "2.0.0",
"fs-extra": "1.0.0",
"js-yaml": "3.10.0",
"jsrsasign": "8.0.3",
"jszip": "3.1.3",
"left-pad": "1.1.3",
"lodash": "4.17.4",
"lodash.clonedeep": "4.5.0",
"lodash.padstart": "4.5.0",
"lorem-ipsum": "1.0.4",
"minimatch": "3.0.3",
"mkdirp": "0.5.1",
Expand Down
7 changes: 5 additions & 2 deletions packages/composer-connector-hlfv1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,10 @@
}
}
},
"peerDependencies": {
"composer-common": "0.19.3"
},
"dependencies": {
"composer-common": "0.19.3",
"fabric-ca-client": "1.1.0",
"fabric-client": "1.1.0",
"fs-extra": "1.0.0",
Expand All @@ -83,7 +85,8 @@
"license-check-and-add": "2.3.1",
"mocha": "3.4.2",
"nyc": "11.1.0",
"sinon": "2.3.8"
"sinon": "2.3.8",
"composer-common": "0.19.3"
},
"nyc": {
"exclude": [
Expand Down
7 changes: 5 additions & 2 deletions packages/composer-connector-proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,13 @@
"proxyquire": "1.7.11",
"serializerr": "1.0.3",
"sinon": "2.3.8",
"watchify": "3.7.0"
"watchify": "3.7.0",
"composer-common": "0.19.3"
},
"peerDependencies": {
"composer-common": "0.19.3"
},
"dependencies": {
"composer-common": "0.19.3",
"socket.io-client": "1.7.3"
},
"nyc": {
Expand Down
5 changes: 4 additions & 1 deletion packages/composer-connector-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,18 @@
}
}
},
"peerDependencies": {
"composer-common": "0.19.3"
},
"dependencies": {
"composer-common": "0.19.3",
"composer-connector-hlfv1": "0.19.3",
"serializerr": "1.0.3",
"socket.io": "1.7.3",
"uuid": "3.0.1",
"yargs": "10.0.3"
},
"devDependencies": {
"composer-common": "0.19.3",
"chai": "3.5.0",
"composer-connector-embedded": "0.19.3",
"eslint": "3.17.1",
Expand Down
7 changes: 5 additions & 2 deletions packages/composer-connector-web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,13 @@
"mocha": "3.4.2",
"sinon": "2.3.8",
"transform-loader": "0.2.4",
"watchify": "3.7.0"
"watchify": "3.7.0",
"composer-common": "0.19.3"
},
"peerDependencies": {
"composer-common": "0.19.3"
},
"dependencies": {
"composer-common": "0.19.3",
"composer-runtime": "0.19.3",
"composer-runtime-web": "0.19.3",
"uuid": "3.0.1"
Expand Down
3 changes: 2 additions & 1 deletion packages/composer-documentation/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@
"_configs",
"_template",
"bin/opus",
"test/testfile.md"
"test/testfile.md",
"_tmp"
],
"file_type_method": "EXCLUDE",
"file_types": [
Expand Down
4 changes: 3 additions & 1 deletion packages/composer-runtime-embedded/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,10 @@
}
}
},
"peerDependencies": {
"composer-common": "0.19.3"
},
"dependencies": {
"composer-common": "0.19.3",
"composer-runtime": "0.19.3",
"composer-runtime-pouchdb": "0.19.3",
"debug": "2.6.2",
Expand Down
7 changes: 5 additions & 2 deletions packages/composer-runtime-hlfv1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@
"license-check-and-add": "2.3.1",
"mocha": "3.4.2",
"nyc": "11.1.0",
"sinon": "2.3.8"
"sinon": "2.3.8",
"composer-common": "0.19.3"
},
"license-check-and-add-config": {
"folder": ".",
Expand Down Expand Up @@ -87,8 +88,10 @@
}
}
},
"peerDependencies": {
"composer-common": "0.19.3"
},
"dependencies": {
"composer-common": "0.19.3",
"composer-runtime": "0.19.3",
"fabric-shim": "1.1.0",
"jsrsasign": "8.0.3",
Expand Down
8 changes: 6 additions & 2 deletions packages/composer-runtime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,8 @@
"mocha": "3.4.2",
"nyc": "11.1.0",
"sinon": "2.3.8",
"uglifyify": "3.0.4"
"uglifyify": "3.0.4",
"composer-common": "0.19.3"
},
"license-check-and-add-config": {
"folder": ".",
Expand Down Expand Up @@ -83,8 +84,11 @@
}
}
},
"peerDependencies": {
"composer-common": "0.19.3"
},
"dependencies": {
"composer-common": "0.19.3",
"debug": "2.6.2",
"fast-json-patch": "1.1.8",
"request": "2.81.0",
"request-promise-any": "1.0.5",
Expand Down
6 changes: 3 additions & 3 deletions packages/composer-tests-integration/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
"postlicchk": "npm run lint",
"lint": "eslint .",
"test": "exit 0",
"test-tagged": "cucumber-js --tags @cli-generate",
"test-inner": "cucumber-js --tags 'not @cli-report'",
"test-inner-nohsm": "cucumber-js --tags 'not @hsm'",
"test-tagged": "cucumber-js --fail-fast --tags @cli-generate",
"test-inner": "cucumber-js --fail-fast --tags 'not @cli-report'",
"test-inner-nohsm": "cucumber-js --fail-fast --tags 'not @hsm'",
"setup": "npm run pretest && npm run lint && npm run start_verdaccio && node ./scripts/npm_serve",
"int-test": "npm run setup && npm run test-inner && npm run stop_verdaccio",
"int-test-nohsm": "npm run setup && npm run test-inner-nohsm && npm run stop_verdaccio"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ rm -rf ./tutorial-network # business network created from generator in dev
rm -f ./networkadmin.card
rm -f ./composer-report-*

# remove anything already there
docker kill $(docker ps -q) && docker rm $(docker ps -qa) --force


rm -rf ${HOME}/.npmrc
if [ "${DOCKER_FILE}" != "" ]; then
cd ../composer-runtime-hlfv1
Expand Down
4 changes: 3 additions & 1 deletion packages/composer-wallet-filesystem/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,10 @@
}
}
},
"peerDependencies": {
"composer-common": "0.19.3"
},
"dependencies": {
"composer-common": "0.19.3",
"mkdirp": "0.5.1",
"rimraf": "2.5.4"
},
Expand Down
6 changes: 3 additions & 3 deletions packages/composer-wallet-inmemory/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@
}
}
},
"peerDependencies": {
"composer-common": "0.19.3"
},
"dependencies": {
"composer-common": "0.19.3",
"mkdirp": "0.5.1",
"rimraf": "2.5.4"
},
"nyc": {
"exclude": [
Expand Down

0 comments on commit 02ea0e0

Please sign in to comment.