Skip to content

Commit

Permalink
Merge pull request #3 from Himenon/feat/create-api
Browse files Browse the repository at this point in the history
feat: create api
  • Loading branch information
Himenon authored Oct 23, 2020
2 parents b4e872b + b90c64b commit 8d32b73
Show file tree
Hide file tree
Showing 14 changed files with 2,139 additions and 1,876 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ module.exports = {
"@typescript-eslint/no-floating-promises": 2,
"@typescript-eslint/triple-slash-reference": [2, { path: "never", types: "never", lib: "never" }],
"@typescript-eslint/no-unnecessary-qualifier": 2,
"@typescript-eslint/no-unnecessary-condition": [2, { ignoreRhs: true }],
"@typescript-eslint/unified-signatures": 2,
"no-undef": 0,
"no-redeclare": 0,
Expand Down
69 changes: 35 additions & 34 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
"run:index": "yarn ts ./src/index.ts",
"server": "node ./lib/server.js",
"start": "yarn develop",
"test": "yarn cruiser && yarn test:jest",
"test": "yarn cruiser",
"test:ci": "yarn test",
"test:jest": "jest -c ./jest.config.js",
"test:watch": "yarn test:jest --watch",
Expand All @@ -73,40 +73,41 @@
}
},
"dependencies": {
"chalk": "^3.0.0",
"commander": "^4.1.1",
"glob": "^7.1.6",
"is-invalid-path": "^1.0.2"
"@himenon/graph": "0.1.0",
"chalk": "4.1.0",
"commander": "6.1.0",
"glob": "7.1.6",
"is-invalid-path": "1.0.2"
},
"devDependencies": {
"@commitlint/cli": "^8.3.5",
"@commitlint/config-conventional": "^8.3.4",
"@types/chalk": "^2.2.0",
"@types/commander": "^2.12.2",
"@types/glob": "^7.1.1",
"@types/jest": "^25.1.2",
"@types/node": "^13.7.1",
"@typescript-eslint/eslint-plugin": "^2.20.0",
"@typescript-eslint/parser": "^2.20.0",
"conventional-changelog-angular-all": "^1.7.0",
"dependency-cruiser": "^7.2.0",
"eslint": "^6.8.0",
"eslint-plugin-import": "^2.20.1",
"eslint-plugin-prettier": "^3.1.2",
"eslint-plugin-react": "^7.18.3",
"eslint-plugin-react-hooks": "^2.4.0",
"generate-changelog": "^1.8.0",
"husky": "^4.2.3",
"jest": "^25.1.0",
"jest-cli": "^25.1.0",
"lerna": "^3.20.2",
"lint-staged": "^10.0.7",
"prettier": "^1.19.1",
"rimraf": "^3.0.2",
"sort-package-json": "^1.39.1",
"ts-jest": "^25.2.0",
"ts-node": "^8.6.2",
"type-fest": "^0.10.0",
"typescript": "^3.7.5"
"@commitlint/cli": "11.0.0",
"@commitlint/config-conventional": "11.0.0",
"@types/chalk": "2.2.0",
"@types/commander": "2.12.2",
"@types/glob": "7.1.3",
"@types/jest": "26.0.15",
"@types/node": "14.14.2",
"@typescript-eslint/eslint-plugin": "4.5.0",
"@typescript-eslint/parser": "4.5.0",
"conventional-changelog-angular-all": "1.7.0",
"dependency-cruiser": "9.15.1",
"eslint": "7.11.0",
"eslint-plugin-import": "2.22.1",
"eslint-plugin-prettier": "3.1.4",
"eslint-plugin-react": "7.21.5",
"eslint-plugin-react-hooks": "4.2.0",
"generate-changelog": "1.8.0",
"husky": "4.3.0",
"jest": "26.6.0",
"jest-cli": "26.6.0",
"lerna": "3.22.1",
"lint-staged": "10.4.2",
"prettier": "2.1.2",
"rimraf": "3.0.2",
"sort-package-json": "1.46.1",
"ts-jest": "26.4.1",
"ts-node": "9.0.0",
"type-fest": "0.18.0",
"typescript": "4.0.3"
}
}
2 changes: 1 addition & 1 deletion src/Generator/Template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export const generateTopologicalSortGraph = (cluster1: string, orderedList: stri
graph [splines=ortho, nodesep=0.8];
node [shape=box];
${cluster1}
{ rank=same; ${orderedList.map(n => `"${n}"`).join("; ")}; } // cluster作成後似記述する必要がある
{ rank=same; ${orderedList.map((n) => `"${n}"`).join("; ")}; } // cluster作成後似記述する必要がある
}
`;

Expand Down
6 changes: 3 additions & 3 deletions src/Generator/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as os from "os";
import * as Graph from "../Graph";
import * as Graph from "@himenon/graph";
import * as Template from "./Template";

export const generateDotSource = (graph: Graph.Type, orderedList: string[], graphType: "tree" | "topological-sort") => {
Expand All @@ -11,15 +11,15 @@ export const generateDotSource = (graph: Graph.Type, orderedList: string[], grap
if (!targets) {
return [];
}
return targets.map(target => {
return targets.map((target) => {
return ` "${source}" -> "${target}"`;
});
})
.reduce<string[]>((total, current) => {
return total.concat(current);
}, [])
.join(";" + os.EOL) + ";"
: nodes.map(node => ` "${node};"`).join(os.EOL);
: nodes.map((node) => ` "${node};"`).join(os.EOL);

if (graphType === "tree") {
return Template.generateTreeDiagram(nonOrderedCluster);
Expand Down
244 changes: 0 additions & 244 deletions src/Graph.ts

This file was deleted.

Loading

0 comments on commit 8d32b73

Please sign in to comment.