diff --git a/packages/contract-cli/lib/options.js b/packages/contract-cli/lib/options.js index 0d757acfa43cf8e34f275a95252c8f2043a50b95..9b2316231c20d5ee2c526dc0354eb002da3cca4f 100644 --- a/packages/contract-cli/lib/options.js +++ b/packages/contract-cli/lib/options.js @@ -53,7 +53,7 @@ const defaultOptions = { resolverDir: createConfig(resolve(join(BASE_DIR, DEFAULT_RESOLVER_DIR)) , STRING_TYPE, {[ALIAS_KEY]: 'inDir'}), contractDir: createConfig(resolve(join(BASE_DIR, DEFAULT_CONTRACT_DIR)), STRING_TYPE, {[ALIAS_KEY]: 'outDir'}), // show or hide the description field in the public contract - contractWithDesc: createConfig(false, [BOOLEAN_TYPE]), + // contractWithDesc: createConfig(false, [BOOLEAN_TYPE]), @1.7.6 move to Koa // remove the old one and always create a new one - useful during development alwaysNew: createConfig(false, [BOOLEAN_TYPE]), // where to put the public method diff --git a/packages/contract-cli/lib/public-contract/index.js b/packages/contract-cli/lib/public-contract/index.js index a5d25c31d62929154dcd6b83373c9be9ce0692cf..0eb6e281b032251e1d8317b4ec7360fadc37b881 100644 --- a/packages/contract-cli/lib/public-contract/index.js +++ b/packages/contract-cli/lib/public-contract/index.js @@ -15,16 +15,17 @@ const cleanForPublic = (json, config) => { enableAuth, loginHandlerName, logoutHandlerName, - validatorHandlerName, - contractWithDesc + validatorHandlerName } = config; for (let type in json) { for (let fn in json[type]) { delete json[type][fn].file; // @1.7.4 remove the description to reduce the size of the contract - if (!contractWithDesc) { - delete json[type][fn].description; - } + // @ 1.7.6 this function move to the Koa instead + // because we want to keep the data in the file only remove it when serving up + // if (!contractWithDesc) { + // delete json[type][fn].description; + // } } } // also if there is a validator field then delete it diff --git a/packages/contract-cli/package.json b/packages/contract-cli/package.json index 3fb09a911979b64f940065f32c1839cb7c75be7a..4b75673f0d96cb5fbe24d62abd1600cee2bab626 100755 --- a/packages/contract-cli/package.json +++ b/packages/contract-cli/package.json @@ -1,6 +1,6 @@ { "name": "jsonql-contract", - "version": "1.7.5", + "version": "1.7.6", "description": "An command line tool to generate the contract.json for jsonql", "main": "index.js", "files": [ diff --git a/packages/contract-cli/tests/generator.test.js b/packages/contract-cli/tests/generator.test.js index 5e029d4e9930feed40bb6cb39c9b35a240e0633f..d3b73926446ab88b8cb72b39eb3f4eb3cf8b7401 100755 --- a/packages/contract-cli/tests/generator.test.js +++ b/packages/contract-cli/tests/generator.test.js @@ -78,7 +78,8 @@ test.serial('Should able to create a public-contract.json', async t => { // check if there is a description field in each t.falsy(json.query.anyoneCanGetThis.description, 'should not have a description in the public query') - t.falsy(json.query.privateFn.description, 'should not have a description in the private query') + // @1.7.6 the description field is kept in the file + // t.falsy(json.query.privateFn.description, 'should not have a description in the private query') }) test.serial('It should able to parse ES6 style resolvers automatically', async t => {