Skip to content

Commit

Permalink
added prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
naddison36 committed Dec 2, 2020
1 parent f176b89 commit 2683a9c
Show file tree
Hide file tree
Showing 24 changed files with 795 additions and 619 deletions.
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"singleQuote": true,
"semi": false,
"tabWidth": 4
}
2 changes: 1 addition & 1 deletion lib/contractFilter.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { WeightedDiGraph } from 'js-graph-algorithms';
import { UmlClass } from "./umlClass";
import { UmlClass } from './umlClass';
export declare const classesConnectedToBaseContracts: (umlClasses: UmlClass[], baseContractNames: string[]) => UmlClass[];
export declare const classesConnectedToBaseContract: (umlClasses: UmlClass[], baseContractName: string, graph: WeightedDiGraph) => {
[contractName: string]: UmlClass;
Expand Down
4 changes: 2 additions & 2 deletions lib/contractFilter.js

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

10 changes: 5 additions & 5 deletions lib/converter.js

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

2 changes: 1 addition & 1 deletion lib/dotGenerator.d.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
import { UmlClass } from "./umlClass";
import { UmlClass } from './umlClass';
export declare const dotUmlClass: (umlClass: UmlClass) => string;
19 changes: 10 additions & 9 deletions lib/dotGenerator.js

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

4 changes: 2 additions & 2 deletions lib/fileParser.js

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

50 changes: 30 additions & 20 deletions lib/parser.js

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

6 changes: 3 additions & 3 deletions lib/sol2uml.js

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

3 changes: 2 additions & 1 deletion lib/umlClass.js

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

6 changes: 6 additions & 0 deletions package-lock.json

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

3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
"buildSol": "cd ./src/contracts && solc **/*.sol",
"build": "tsc --build ./tsconfig.json",
"clean": "tsc --build --clean ./tsconfig.json",
"prettier": "prettier --write \"src/**/*.ts\"",
"prettier:check": "prettier --check \"src/**/*.ts\"",
"test": "npx jest"
},
"preferGlobal": true,
Expand All @@ -33,6 +35,7 @@
"@types/verror": "^1.10.4",
"jest": "^26.6.3",
"openzeppelin-solidity": "2.5.1",
"prettier": "^2.2.1",
"ts-jest": "^26.4.4",
"typescript": "^4.1.2"
},
Expand Down
19 changes: 9 additions & 10 deletions src/ts/__tests__/converter.test.ts
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@


import { readFile } from 'fs'
import { convertUmlClassesToSvg, convertDot2Svg, EtherscanParser, writeSVG } from '../index'
import {
convertUmlClassesToSvg,
convertDot2Svg,
EtherscanParser,
writeSVG,
} from '../index'

const etherDelta = '0x8d12A197cB00D4747a1fe03395095ce2A5CC6819'
const etherscanKey = 'HPD85TXCG1HW3N5G6JJXK1A7EE5K86CYBJ'

describe('Converter', () => {

test('generateFilesFromUmlClasses a valid dot to svg', (done) => {

readFile('./src/ts/__tests__/SomeImpl.dot', (err, dotBuf) => {
if (err) {
throw err;
throw err
}

const dotString = dotBuf.toString('utf8')
Expand All @@ -21,17 +22,15 @@ describe('Converter', () => {
expect(svg.length).toBeGreaterThan(2000)

done()
});
})
})

test('writeSVG with invalid dot', () => {

const dot = ''
writeSVG(dot, 'converterTest')
})

test('Parse EtherDelta from Etherscan and convert to svg string', async() => {

test('Parse EtherDelta from Etherscan and convert to svg string', async () => {
const etherscan = new EtherscanParser(etherscanKey)

const umlClasses = await etherscan.getUmlClasses(etherDelta)
Expand Down
Loading

0 comments on commit 2683a9c

Please sign in to comment.