forked from sverweij/dependency-cruiser
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature(bin): adds a tool to wrap svg output by graphviz in html (sve…
…rweij#266) (This was already available in the internal `utl` tools folder, but that isn't distributed to the package registries)
- Loading branch information
Showing
13 changed files
with
2,513 additions
and
2,380 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
#!/usr/bin/env node | ||
|
||
const wrap = require("../src/cli/tools/wrap-stream-in-html"); | ||
/* | ||
* Wrap some html & css around the stuff passed in stdin, so it becomes a bit more | ||
* interactive to use. Tailored to svg's generated by graphviz dot. | ||
*/ | ||
|
||
wrap(process.stdin).then(pOutput => process.stdout.write(pOutput)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
312 changes: 165 additions & 147 deletions
312
doc/real-world-samples/dependency-cruiser-dir-graph.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2,103 changes: 1,066 additions & 1,037 deletions
2,103
doc/real-world-samples/dependency-cruiser-without-node_modules.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2,072 changes: 1,050 additions & 1,022 deletions
2,072
docs/dependency-cruiser-dependency-graph.html
Large diffs are not rendered by default.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
const fs = require("fs"); | ||
const chai = require("chai"); | ||
const wrapStreamInHTML = require("../../../src/cli/tools/wrap-stream-in-html"); | ||
|
||
const expect = chai.expect; | ||
|
||
describe("wrap-stream-in-html", () => { | ||
const lStream = fs.createReadStream("package.json"); | ||
|
||
it("Wraps the contens of a stream in html with some preloaded css", async () => { | ||
const lResultHTML = await wrapStreamInHTML(lStream); | ||
|
||
expect(lResultHTML).to.contain("<html"); | ||
expect(lResultHTML).to.contain("<style>"); | ||
expect(lResultHTML).to.contain('"name": "dependency-cruiser"'); | ||
expect(lResultHTML).to.contain("</html"); | ||
}); | ||
}); |