solidity-docgen
Advanced tools
Comparing version 0.3.4 to 0.3.5
"use strict"; | ||
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; | ||
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); | ||
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; | ||
return c > 3 && r && Object.defineProperty(target, key, r), r; | ||
}; | ||
var __importDefault = (this && this.__importDefault) || function (mod) { | ||
@@ -9,2 +15,3 @@ return (mod && mod.__esModule) ? mod : { "default": mod }; | ||
const execall_1 = __importDefault(require("execall")); | ||
const memoize_1 = require("./memoize"); | ||
const handlebars_1 = require("./handlebars"); | ||
@@ -35,2 +42,5 @@ class SoliditySource { | ||
} | ||
__decorate([ | ||
memoize_1.memoize | ||
], SoliditySource.prototype, "file", null); | ||
exports.SoliditySource = SoliditySource; | ||
@@ -48,2 +58,5 @@ class SolidityFile { | ||
} | ||
__decorate([ | ||
memoize_1.memoize | ||
], SolidityFile.prototype, "contracts", null); | ||
class SolidityContract { | ||
@@ -82,2 +95,13 @@ constructor(source, file, astNode) { | ||
} | ||
get inheritedItems() { | ||
const functions = lodash_1.groupBy(this.functions, f => f.contract.astId); | ||
const events = lodash_1.groupBy(this.events, f => f.contract.astId); | ||
const modifiers = lodash_1.groupBy(this.modifiers, f => f.contract.astId); | ||
return this.inheritance.map(contract => ({ | ||
contract, | ||
functions: functions[contract.astId], | ||
events: events[contract.astId], | ||
modifiers: modifiers[contract.astId], | ||
})); | ||
} | ||
get events() { | ||
@@ -109,2 +133,11 @@ return lodash_1.uniqBy(lodash_1.flatten(this.inheritance.map(c => c.ownEvents)), f => f.signature); | ||
} | ||
__decorate([ | ||
memoize_1.memoize | ||
], SolidityContract.prototype, "ownFunctions", null); | ||
__decorate([ | ||
memoize_1.memoize | ||
], SolidityContract.prototype, "ownEvents", null); | ||
__decorate([ | ||
memoize_1.memoize | ||
], SolidityContract.prototype, "ownModifiers", null); | ||
exports.SolidityContract = SolidityContract; | ||
@@ -137,2 +170,5 @@ class SolidityContractItem { | ||
} | ||
__decorate([ | ||
memoize_1.memoize | ||
], SolidityContractItem.prototype, "args", null); | ||
class SolidityFunction extends SolidityContractItem { | ||
@@ -155,2 +191,5 @@ constructor(contract, astNode) { | ||
} | ||
__decorate([ | ||
memoize_1.memoize | ||
], SolidityFunction.prototype, "outputs", null); | ||
class SolidityEvent extends SolidityContractItem { | ||
@@ -157,0 +196,0 @@ constructor(contract, astNode) { |
@@ -74,2 +74,18 @@ "use strict"; | ||
}); | ||
ava_1.default('grouped inherited items', t => { | ||
const solcOutput = new solc_1.SolcOutputBuilder() | ||
.file('Foo.sol') | ||
.contract('Foo') | ||
.function('foo-test') | ||
.contract('Bar') | ||
.function('bar-test') | ||
.contract('Child', 'Foo', 'Bar'); | ||
const source = buildSource(solcOutput); | ||
const child = source.contracts[2]; | ||
t.is(child.name, 'Child'); | ||
const items = child.inheritedItems; | ||
t.is(items.length, 3); | ||
t.is(items[1].contract.name, 'Foo'); | ||
t.is(items[1].functions[0].name, 'foo-test'); | ||
}); | ||
//# sourceMappingURL=solidity.test.js.map |
{ | ||
"name": "solidity-docgen", | ||
"version": "0.3.4", | ||
"version": "0.3.5", | ||
"description": "Solidity API documentation automatic generator.", | ||
@@ -16,2 +16,3 @@ "bin": { | ||
"build:watch": "tsc --watch", | ||
"coverage": "nyc --reporter=lcov npm test", | ||
"test": "tsc && ava", | ||
@@ -28,3 +29,3 @@ "test:watch": "concurrently -krs first -n ava,tsc 'ava --watch' 'tsc --watch --preserveWatchOutput'", | ||
"fs-extra": "^8.1.0", | ||
"globby": "^9.2.0", | ||
"globby": "^10.0.1", | ||
"handlebars": "^4.4.0", | ||
@@ -35,6 +36,6 @@ "json5": "^2.1.0", | ||
"semver": "^6.3.0", | ||
"solc": "^0.5.12", | ||
"typescript": "^3.6.3" | ||
"solc": "^0.5.12" | ||
}, | ||
"devDependencies": { | ||
"@istanbuljs/nyc-config-typescript": "^0.1.3", | ||
"@types/fs-extra": "^8.0.0", | ||
@@ -47,3 +48,7 @@ "@types/json5": "0.0.30", | ||
"ava": "^2.4.0", | ||
"concurrently": "^4.1.2" | ||
"code-style": "github:OpenZeppelin/code-style", | ||
"codecov": "^3.6.1", | ||
"concurrently": "^5.0.0", | ||
"nyc": "^14.1.1", | ||
"typescript": "^3.6.3" | ||
}, | ||
@@ -50,0 +55,0 @@ "keywords": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
246326
13
32
1123
0
13
+ Addedglobby@10.0.2(transitive)
- Removedtypescript@^3.6.3
- Removed@mrmlnc/readdir-enhanced@2.2.1(transitive)
- Removed@nodelib/fs.stat@1.1.3(transitive)
- Removedarr-diff@4.0.0(transitive)
- Removedarr-flatten@1.1.0(transitive)
- Removedarr-union@3.1.0(transitive)
- Removedarray-union@1.0.2(transitive)
- Removedarray-uniq@1.0.3(transitive)
- Removedarray-unique@0.3.2(transitive)
- Removedassign-symbols@1.0.0(transitive)
- Removedatob@2.1.2(transitive)
- Removedbase@0.11.2(transitive)
- Removedbraces@2.3.2(transitive)
- Removedcache-base@1.0.1(transitive)
- Removedcall-me-maybe@1.0.2(transitive)
- Removedclass-utils@0.3.6(transitive)
- Removedcollection-visit@1.0.0(transitive)
- Removedcomponent-emitter@1.3.1(transitive)
- Removedcopy-descriptor@0.1.1(transitive)
- Removeddebug@2.6.9(transitive)
- Removeddecode-uri-component@0.2.2(transitive)
- Removeddefine-property@0.2.51.0.02.0.2(transitive)
- Removeddir-glob@2.2.2(transitive)
- Removedexpand-brackets@2.1.4(transitive)
- Removedextend-shallow@2.0.13.0.2(transitive)
- Removedextglob@2.0.4(transitive)
- Removedfast-glob@2.2.7(transitive)
- Removedfill-range@4.0.0(transitive)
- Removedfor-in@1.0.2(transitive)
- Removedfragment-cache@0.2.1(transitive)
- Removedfunction-bind@1.1.2(transitive)
- Removedget-value@2.0.6(transitive)
- Removedglob-parent@3.1.0(transitive)
- Removedglob-to-regexp@0.3.0(transitive)
- Removedglobby@9.2.0(transitive)
- Removedhas-value@0.3.11.0.0(transitive)
- Removedhas-values@0.1.41.0.0(transitive)
- Removedhasown@2.0.2(transitive)
- Removedignore@4.0.6(transitive)
- Removedis-accessor-descriptor@1.0.1(transitive)
- Removedis-buffer@1.1.6(transitive)
- Removedis-data-descriptor@1.0.1(transitive)
- Removedis-descriptor@0.1.71.0.3(transitive)
- Removedis-extendable@0.1.11.0.1(transitive)
- Removedis-glob@3.1.0(transitive)
- Removedis-number@3.0.0(transitive)
- Removedis-plain-object@2.0.4(transitive)
- Removedis-windows@1.0.2(transitive)
- Removedisarray@1.0.0(transitive)
- Removedisobject@2.1.03.0.1(transitive)
- Removedkind-of@3.2.24.0.06.0.3(transitive)
- Removedmap-cache@0.2.2(transitive)
- Removedmap-visit@1.0.0(transitive)
- Removedmicromatch@3.1.10(transitive)
- Removedmixin-deep@1.3.2(transitive)
- Removedms@2.0.0(transitive)
- Removednanomatch@1.2.13(transitive)
- Removedobject-copy@0.1.0(transitive)
- Removedobject-visit@1.0.1(transitive)
- Removedobject.pick@1.3.0(transitive)
- Removedpascalcase@0.1.1(transitive)
- Removedpath-dirname@1.0.2(transitive)
- Removedpath-type@3.0.0(transitive)
- Removedpify@3.0.0(transitive)
- Removedposix-character-classes@0.1.1(transitive)
- Removedregex-not@1.0.2(transitive)
- Removedrepeat-element@1.1.4(transitive)
- Removedrepeat-string@1.6.1(transitive)
- Removedresolve-url@0.2.1(transitive)
- Removedret@0.1.15(transitive)
- Removedsafe-regex@1.1.0(transitive)
- Removedset-value@2.0.1(transitive)
- Removedslash@2.0.0(transitive)
- Removedsnapdragon@0.8.2(transitive)
- Removedsnapdragon-node@2.1.1(transitive)
- Removedsnapdragon-util@3.0.1(transitive)
- Removedsource-map@0.5.7(transitive)
- Removedsource-map-resolve@0.5.3(transitive)
- Removedsource-map-url@0.4.1(transitive)
- Removedsplit-string@3.1.0(transitive)
- Removedstatic-extend@0.1.2(transitive)
- Removedto-object-path@0.3.0(transitive)
- Removedto-regex@3.0.2(transitive)
- Removedto-regex-range@2.1.1(transitive)
- Removedtypescript@3.9.10(transitive)
- Removedunion-value@1.0.1(transitive)
- Removedunset-value@1.0.0(transitive)
- Removedurix@0.1.0(transitive)
- Removeduse@3.1.1(transitive)
Updatedglobby@^10.0.1