Skip to content

Commit

Permalink
Merge pull request #28 from hydrosquall/cameron.yick/feature/ignore-f…
Browse files Browse the repository at this point in the history
…iles-and-folders

feature: add support for ignoring filepaths via micromatch globs
  • Loading branch information
Wattenberger authored Aug 17, 2021
2 parents acf10f6 + cd955d0 commit 0cd1a63
Show file tree
Hide file tree
Showing 14 changed files with 5,466 additions and 81 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: JS - Unit Tests

on: push

jobs:

run-tests:
name: Unit Tests
runs-on: ubuntu-latest

steps:
- name: Check out Git repository
uses: actions/checkout@v2

- name: Set up Node.js
uses: actions/setup-node@v1
with:
node-version: 14

- name: Install dependencies with caching
uses: bahmutov/npm-install@v1

- name: Check types
run: |
yarn run typecheck
- name: Run unit tests
run: |
yarn run test
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
node_modules
node_modules
Empty file added .npmignore
Empty file.
22 changes: 18 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,33 @@ Default: diagram.svg

## `excluded_paths`

A list of paths to exclude from the diagram, separated by commas.
A list of paths to folders to exclude from the diagram, separated by commas.

For example: dist,node_modules

Default: node_modules,bower_components,dist,out,build,eject,.next,.netlify,.yarn,.vscode,package-lock.json,yarn.lock

## `excluded_globs`

A semicolon-delimited array of file [globs](https://globster.xyz/) to exclude from the diagram, using [micromatch](https://github.com/micromatch/micromatch) syntax. Provided as an array.

For example:

```yaml
excluded_globs: 'frontend/*.spec.js;**/*.{png,jpg};**/!(*.module).ts'
# Guide:
# - 'frontend/*.spec.js' # exclude frontend tests
# - '**/*.{png,ico,md}' # all png, ico, md files in any directory
# - '**/!(*.module).ts' # all TS files except module files
```

## `root_path`

The directory (and its children) that you want to visualize in the diagram.
The directory (and its children) that you want to visualize in the diagram, relative to the repository root.

For example: `./src/`
For example: `src/`

Default: `./`
Default: `''` (current directory)

## `max_depth`

Expand Down
5 changes: 4 additions & 1 deletion action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,11 @@ inputs:
excluded_paths:
description: "A list of paths to exclude from the diagram, separated by commas. For example: dist,node_modules"
required: false
excluded_globs:
description: "A list of micromatch globs to exclude from the diagram, separated by semicolons. For example: **/*.png;docs/**/*.{png,ico}"
required: false
root_path:
description: "The directory (and its children) that you want to visualize in the diagram. Default: ./"
description: 'The directory (and its children) that you want to visualize in the diagram. Default: "" (repository root directory)'
required: false
max_depth:
description: "The maximum number of nested folders to show files within. Default: 9"
Expand Down
Loading

0 comments on commit 0cd1a63

Please sign in to comment.