Skip to content

Commit 986ef0b

Browse files
author
Amelia Wattenbeger
committed
separate excluded paths by commas
1 parent 51bffe6 commit 986ef0b

File tree

5 files changed

+11
-38
lines changed

5 files changed

+11
-38
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ Default: diagram.svg
1414

1515
## `excluded_paths`
1616

17-
A list of paths to exclude from the diagram.
17+
A list of paths to exclude from the diagram, separated by commas.
1818

19-
For example: dist
19+
For example: dist,node_modules
2020

21-
Default: ""
21+
Default: node_modules,bower_components,dist,out,build,eject,.next,.netlify,.yarn,.git,.vscode,package-lock.json,yarn.lock
2222

2323
## Example usage
2424

@@ -31,4 +31,5 @@ You'll need to run the `actions/checkout` Action beforehand, to check out the co
3131
uses: githubocto/repo-visualizer@main
3232
with:
3333
output_file: 'images/diagram.svg'
34+
excluded_paths: 'dist,node_modules'
3435
```

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ inputs:
66
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"
77
required: false
88
excluded_paths:
9-
description: "A list of paths to exclude from the diagram. For example: dist"
9+
description: "A list of paths to exclude from the diagram, separated by commas. For example: dist,node_modules"
1010
required: false
1111
runs:
1212
using: "node12"

index.js

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10158,22 +10158,7 @@ var processDir = async (rootPath, excludedPaths = []) => {
1015810158
console.log("no rootPath specified");
1015910159
return;
1016010160
}
10161-
const foldersToIgnore = [
10162-
"node_modules",
10163-
"bower_components",
10164-
"dist",
10165-
"out",
10166-
"build",
10167-
"eject",
10168-
".next",
10169-
".netlify",
10170-
".yarn",
10171-
".git",
10172-
".vscode",
10173-
"package-lock.json",
10174-
"yarn.lock",
10175-
...excludedPaths
10176-
];
10161+
const foldersToIgnore = excludedPaths;
1017710162
const fullPathFoldersToIgnore = foldersToIgnore.map((d) => `${rootPath}/${d}`);
1017810163
const getFileStats = async (path = "") => {
1017910164
const stats = await import_fs.default.statSync(path);
@@ -15073,7 +15058,8 @@ var main = async () => {
1507315058
1507415059
]);
1507515060
core.endGroup();
15076-
const excludedPaths = core.getInput("excluded_paths") || [];
15061+
const excludedPathsString = core.getInput("excluded_paths") || "node_modules,bower_components,dist,out,build,eject,.next,.netlify,.yarn,.git,.vscode,package-lock.json,yarn.lock";
15062+
const excludedPaths = excludedPathsString.split(",").map((str) => str.trim());
1507715063
const data = await processDir(`./`, excludedPaths);
1507815064
const componentCodeString = import_server.default.renderToStaticMarkup(/* @__PURE__ */ import_react3.default.createElement(Tree, {
1507915065
data

src/index.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ const main = async () => {
2323
core.endGroup()
2424

2525

26-
const excludedPaths = core.getInput("excluded_paths") || []
26+
const excludedPathsString = core.getInput("excluded_paths") || "node_modules,bower_components,dist,out,build,eject,.next,.netlify,.yarn,.git,.vscode,package-lock.json,yarn.lock"
27+
const excludedPaths = excludedPathsString.split(",").map(str => str.trim())
2728
const data = await processDir(`./`, excludedPaths);
2829

2930
const componentCodeString = ReactDOMServer.renderToStaticMarkup(

src/process-dir.js

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,7 @@ export const processDir = async (rootPath, excludedPaths = []) => {
66
return;
77
}
88

9-
const foldersToIgnore = [
10-
"node_modules",
11-
"bower_components",
12-
"dist",
13-
"out",
14-
"build",
15-
"eject",
16-
".next",
17-
".netlify",
18-
".yarn",
19-
".git",
20-
".vscode",
21-
"package-lock.json",
22-
"yarn.lock",
23-
...excludedPaths,
24-
];
9+
const foldersToIgnore = excludedPaths
2510
const fullPathFoldersToIgnore = foldersToIgnore.map((d) =>
2611
`${rootPath}/${d}`
2712
);

0 commit comments

Comments
 (0)