@vanillaes/jsdown 0.1.1 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  <h1 align="center">JSDown</h1>
4
4
 
5
- <div align="center">📜 Markdown Doc Generator for JSDoc 📜</div>
5
+ <div align="center">📜 Markdown Documentation Generator for JSDoc 📜</div>
6
6
 
7
7
  <br />
8
8
 
@@ -18,6 +18,8 @@
18
18
 
19
19
  - **No Configuration**
20
20
  - Feed it JSDoc types and it spits out Markdown
21
+ - The following are ignored by default: `node_modules/`, `coverage/`, `vendor/`, `*.spec.js`, `*.min.js`, and hidden files.
22
+
21
23
 
22
24
  ## jsdown
23
25
 
@@ -25,7 +27,7 @@
25
27
 
26
28
  `jsdown [...options] [files...]`
27
29
 
28
- - `[files]` - File(s) to lint (default `**/!(*.spec|index).js`)
30
+ - `[files]` - File(s) to lint (default `**/!(index).js`)
29
31
 
30
32
  ### Usage
31
33
 
package/bin/jsdown.js CHANGED
@@ -1,19 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
  import { createDocs } from '../src/index.js'
3
3
  import { Command } from 'commander'
4
+ import { readPackageJSON } from '@vanillaes/esmtk'
4
5
 
5
- import { createRequire } from 'node:module'
6
- const require = createRequire(import.meta.url)
7
- const pkg = require('../package.json')
8
-
6
+ const pkg = await readPackageJSON()
9
7
  const program = new Command()
10
8
  .name('jsdown')
11
9
  .description('Markdown Doc Generator for JSDoc')
12
10
  .version(pkg.version, '-v, --version')
13
11
 
14
12
  program
15
- .description('Lint file(s) matching the provided pattern (default *.spec.js)')
16
- .argument('[files]', 'file(s) to lint', '**/!(*.spec|index).js')
13
+ .description('Generate markdown documentation from JSDoc types')
14
+ .argument('[files]', 'file(s) to document', '**/!(index).js')
17
15
  .action((files, options) => {
18
16
  createDocs(files, options)
19
17
  })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@vanillaes/jsdown",
3
- "version": "0.1.1",
4
- "description": "Markdown Doc Generator for JSDoc",
3
+ "version": "0.1.2",
4
+ "description": "Markdown Documentation Generator for JSDoc",
5
5
  "keywords": [
6
6
  "ecmascript",
7
7
  "esm",
@@ -22,9 +22,9 @@
22
22
  ".": "./src/index.js"
23
23
  },
24
24
  "scripts": {
25
+ "jsdown": "node ./bin/jsdown.js",
25
26
  "test": "esmtk test",
26
27
  "lint": "esmtk lint",
27
- "type": "esmtk type",
28
28
  "typings": "esmtk typings",
29
29
  "clean": "esmtk clean --typings",
30
30
  "preview": "esmtk preview",
@@ -32,7 +32,7 @@
32
32
  "postversion": "git push --follow-tags"
33
33
  },
34
34
  "dependencies": {
35
- "@vanillaes/esmtk": "^1.8.0",
35
+ "@vanillaes/esmtk": "^1.8.2",
36
36
  "commander": "^14.0.3",
37
37
  "doctrine": "^3.0.0",
38
38
  "lodash-es": "^4.18.1"
package/src/jsdown.js CHANGED
@@ -9,7 +9,9 @@ import { basename, dirname, join } from 'node:path'
9
9
  * @param {object} options 'jsdown' options
10
10
  */
11
11
  export async function createDocs (files, options = {}) {
12
- const sources = await match(files)
12
+ const defaultIgnores = ['node_modules/', 'coverage/', 'vendor/', '**/*.spec.js', '**/*.min.js', '.*']
13
+ const ignore = [...defaultIgnores].join(',')
14
+ const sources = await match(files, process.cwd(), ignore)
13
15
  sources.forEach(file => createDoc(file))
14
16
  }
15
17