Skip to content

Commit 4cd60f2

Browse files
vegedclaude
andcommitted
feat: add JSDoc generation, fix JSDoc annotations
- Add jsdoc.config.json and `npm run docs` script - Add docs CI job (generates JSDoc, uploads as artifact) - Remove redundant bare `@exports` tags (16 files) - Fix invalid type expressions: `{?...X}` → `{...X}`, `{Array[Function]}` → `{Array.<Function>}` - Add docs/, test-results/ to .gitignore - Exclude docs/ from ESLint Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4acaec5 commit 4cd60f2

File tree

37 files changed

+62
-38
lines changed

37 files changed

+62
-38
lines changed

.github/workflows/ci.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,18 @@ jobs:
5858
with:
5959
name: dist
6060
path: dist/
61+
62+
docs:
63+
runs-on: ubuntu-latest
64+
steps:
65+
- uses: actions/checkout@v4
66+
- uses: actions/setup-node@v4
67+
with:
68+
node-version: 22
69+
cache: npm
70+
- run: npm ci
71+
- run: npm run docs
72+
- uses: actions/upload-artifact@v4
73+
with:
74+
name: jsdoc
75+
path: docs/jsdoc/

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ coverage.json
1717
!*.bundles/*/*.bemjson.js
1818

1919
/dist
20+
/docs/jsdoc
21+
/test-results
2022
/*desktop.docs
2123
/*touch.docs
2224
/*.examples

common.blocks/cookie/cookie.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @description Inspired from $.cookie plugin by Klaus Hartl (stilbuero.de)
44
*/
55

6-
export default /** @exports */{
6+
export default {
77
/**
88
* Returns cookie by given name
99
* @param {String} name

common.blocks/dom/dom.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var EDITABLE_INPUT_TYPES = {
1919
week : true
2020
};
2121

22-
export default /** @exports */{
22+
export default {
2323
/**
2424
* Checks whether a DOM elem is in a context
2525
* @param {jQuery} ctx DOM elem where check is being performed

common.blocks/events/__channels/events__channels.vanilla.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ var undef,
1010
export default
1111
/**
1212
* Returns/destroys a named communication channel
13-
* @exports
1413
* @param {String} [id='default'] Channel ID
1514
* @param {Boolean} [drop=false] Destroy the channel
1615
* @returns {events:Emitter|undefined} Communication channel

common.blocks/events/__observable/_type/events__observable_type_bem-dom.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import observable from 'bem:events__observable';
88
export default
99
/**
1010
* Creates new observable with BEM DOM entity support
11-
* @exports
1211
* @param {i-bem-dom:Block|i-bem-dom:Elem|events:Emitter} bemEntity
1312
* @returns {Observable}
1413
*/

common.blocks/events/__observable/events__observable.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ var Observable = inherit(/** @lends Observable.prototype */{
5858
export default
5959
/**
6060
* Creates new observable
61-
* @exports
6261
* @param {events:Emitter} emitter
6362
* @returns {Observable}
6463
*/

common.blocks/functions/__debounce/functions__debounce.vanilla.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
export default
66
/**
77
* Debounces given function
8-
* @exports
98
* @param {Function} fn function to debounce
109
* @param {Number} timeout debounce interval
1110
* @param {Boolean} [invokeAsap=false] invoke before first interval

common.blocks/functions/__throttle/functions__throttle.vanilla.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
export default
66
/**
77
* Throttle given function
8-
* @exports
98
* @param {Function} fn function to throttle
109
* @param {Number} timeout throttle interval
1110
* @param {Boolean} [invokeAsap=true] invoke before first interval

common.blocks/functions/functions.vanilla.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* @description A set of helpers to work with JavaScript functions
44
*/
55

6-
export default /** @exports */{
6+
export default {
77
/**
88
* Checks whether a given object is function
99
* @param {*} obj

0 commit comments

Comments
 (0)