Skip to content

Commit 9a8719f

Browse files
Merge pull request #13 from hipstersmoothie/more-debug
add docgen:docs debugging
2 parents b2c8852 + 57da91b commit 9a8719f

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

readme.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,15 @@ If you want to see how this plugins is including and excluding modules set the `
5555
- `DEBUG=docgen:*` - All logs
5656
- `DEBUG=docgen:include` - Included modules
5757
- `DEBUG=docgen:exclude` - Excluded modules
58+
- `DEBUG=docgen:docs` - Generated docs
5859

5960
```bash
6061
DEBUG=docgen:* npm run storybook
6162
```
6263

64+
> Another great way of debugging your generated docs is to use a `debugger` statement in your component source file.
65+
> If you turn off source maps you will be able to see the code that this package generates.
66+
6367
## Prior Art
6468

6569
- [sn-client](https://github.com/SenseNet/sn-client/) - Inspired by this custom webpack plugin

src/plugin.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import match from "micromatch";
88

99
const debugExclude = createDebug("docgen:exclude");
1010
const debugInclude = createDebug("docgen:include");
11+
const debugDocs = createDebug("docgen:docs");
1112

1213
interface TypescriptOptions {
1314
/**
@@ -101,6 +102,8 @@ function processModule(
101102
...loaderOptions,
102103
}).substring(webpackModule.userRequest.length);
103104

105+
debugDocs(docs);
106+
104107
// eslint-disable-next-line no-underscore-dangle
105108
let source = webpackModule._source._value;
106109
source += `\n${docs}\n`;

0 commit comments

Comments
 (0)