File tree Expand file tree Collapse file tree 6 files changed +28
-8
lines changed Expand file tree Collapse file tree 6 files changed +28
-8
lines changed Original file line number Diff line number Diff line change @@ -6,7 +6,19 @@ A GitHub Action that creates an SVG diagram of your repo.
6
6
7
7
## ` output_file `
8
8
9
- A path (relative to the root of your repo) to where you would like the diagram to live. For example: images/diagram.svg. Default: diagram.svg
9
+ A path (relative to the root of your repo) to where you would like the diagram to live.
10
+
11
+ For example: images/diagram.svg
12
+
13
+ Default: diagram.svg
14
+
15
+ ## ` excluded_paths `
16
+
17
+ A list of paths to exclude from the diagram.
18
+
19
+ For example: dist
20
+
21
+ Default: ""
10
22
11
23
## Example usage
12
24
Original file line number Diff line number Diff line change 5
5
output_file :
6
6
description : " A path (relative to the root of your repo) to where you would like the diagram to live. For example: images/diagram.svg. Default: diagram.svg"
7
7
required : false
8
+ excluded_paths :
9
+ description : " A list of paths to exclude from the diagram. For example: dist"
10
+ required : false
8
11
runs :
9
12
using : " node12"
10
13
main : " index.js"
Original file line number Diff line number Diff line change @@ -10153,7 +10153,7 @@ var import_fs2 = __toModule(require("fs"));
10153
10153
10154
10154
// src/process-dir.js
10155
10155
var import_fs = __toModule(require("fs"));
10156
- var processDir = async (rootPath) => {
10156
+ var processDir = async (rootPath, excludedPaths = [] ) => {
10157
10157
if (!rootPath) {
10158
10158
console.log("no rootPath specified");
10159
10159
return;
@@ -10171,7 +10171,8 @@ var processDir = async (rootPath) => {
10171
10171
".git",
10172
10172
".vscode",
10173
10173
"package-lock.json",
10174
- "yarn.lock"
10174
+ "yarn.lock",
10175
+ ...excludedPaths
10175
10176
];
10176
10177
const fullPathFoldersToIgnore = foldersToIgnore.map((d) => `${rootPath}/${d}`);
10177
10178
const getFileStats = async (path = "") => {
@@ -15072,7 +15073,8 @@ var main = async () => {
15072
15073
15073
15074
]);
15074
15075
core.endGroup();
15075
- const data = await processDir(`./`);
15076
+ const excludedPaths = core.getInput("excluded_paths") || [];
15077
+ const data = await processDir(`./`, excludedPaths);
15076
15078
const componentCodeString = import_server.default.renderToStaticMarkup(/* @__PURE__ */ import_react3.default.createElement(Tree, {
15077
15079
data
15078
15080
}));
Original file line number Diff line number Diff line change 8
8
pack ,
9
9
scaleLinear ,
10
10
timeDay ,
11
- timeFormat ,
12
11
} from "d3" ;
13
12
import { FileType } from "./types" ;
14
13
import countBy from "lodash/countBy" ;
Original file line number Diff line number Diff line change @@ -23,9 +23,12 @@ const main = async () => {
23
23
core . endGroup ( )
24
24
25
25
26
- const data = await processDir ( `./` ) ;
26
+ const excludedPaths = core . getInput ( "excluded_paths" ) || [ ]
27
+ const data = await processDir ( `./` , excludedPaths ) ;
27
28
28
- const componentCodeString = ReactDOMServer . renderToStaticMarkup ( < Tree data = { data } /> ) ;
29
+ const componentCodeString = ReactDOMServer . renderToStaticMarkup (
30
+ < Tree data = { data } />
31
+ ) ;
29
32
30
33
const outputFile = core . getInput ( "output_file" ) || "./diagram.svg"
31
34
Original file line number Diff line number Diff line change 1
1
import fs from "fs" ;
2
2
3
- export const processDir = async ( rootPath ) => {
3
+ export const processDir = async ( rootPath , excludedPaths = [ ] ) => {
4
4
if ( ! rootPath ) {
5
5
console . log ( "no rootPath specified" ) ;
6
6
return ;
@@ -20,6 +20,7 @@ export const processDir = async (rootPath) => {
20
20
".vscode" ,
21
21
"package-lock.json" ,
22
22
"yarn.lock" ,
23
+ ...excludedPaths ,
23
24
] ;
24
25
const fullPathFoldersToIgnore = foldersToIgnore . map ( ( d ) =>
25
26
`${ rootPath } /${ d } `
You can’t perform that action at this time.
0 commit comments