vivth 1.0.3 → 1.0.5
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 +8 -6
- package/bun.lock +1 -1
- package/index.mjs +1 -1
- package/package.json +1 -1
- package/src/class/QChannel.mjs +5 -5
- package/src/doc/JSautoDOC.mjs +17 -12
- package/src/types/AnyButUndefined.mjs +0 -1
- package/types/src/class/QChannel.d.mts +5 -5
- package/types/src/doc/JSautoDOC.d.mts +6 -4
package/README.md
CHANGED
|
@@ -901,7 +901,7 @@ npm i vivth
|
|
|
901
901
|
|
|
902
902
|
```js
|
|
903
903
|
/**
|
|
904
|
-
* @template {
|
|
904
|
+
* @template {AnyButUndefined} T
|
|
905
905
|
*/
|
|
906
906
|
```
|
|
907
907
|
|
|
@@ -910,7 +910,7 @@ npm i vivth
|
|
|
910
910
|
|
|
911
911
|
```js
|
|
912
912
|
/**
|
|
913
|
-
* @param {Map<
|
|
913
|
+
* @param {Map<AnyButUndefined, [Promise<any>, {}]>} uniqueMap
|
|
914
914
|
* @returns {typeof QChannel}
|
|
915
915
|
* - usefull for Queue primitive on multiple library but single reference, like the Web by making the `Map` on `window` object;
|
|
916
916
|
*/
|
|
@@ -1676,10 +1676,12 @@ npm i vivth
|
|
|
1676
1676
|
- this autodocumenter uses [chokidar](https://npmjs.com/package/chokidar) under the hood;
|
|
1677
1677
|
- this class also is used to generate this `README.md`;
|
|
1678
1678
|
- behaviours:
|
|
1679
|
-
>1)
|
|
1680
|
-
|
|
1681
|
-
>
|
|
1682
|
-
>
|
|
1679
|
+
>1) add `"at"noautodoc` on self closing jsdoc comment to opt out from generating documentation on said file;
|
|
1680
|
+
>>- auto export must follows the following rules, and there's no way to override;
|
|
1681
|
+
>2) export all named exported 'const'|'function'|'async function'|'class', alphanumeric name, started with Capital letter, same name with fileName on `options.pahts.file`;
|
|
1682
|
+
>3) declare typedef of existing typedef with alphanumeric name, started with Capital letter, same name with fileName, and have no valid export like on point <sup>1</sup> on `options.pahts.file`;
|
|
1683
|
+
>4) create `README.md` based on, `options.paths.dir` and `README.src.md`;
|
|
1684
|
+
>5) extract `"at"description` jsdoc:
|
|
1683
1685
|
>>- on static/prop that have depths, all of children should have `"at"static`/`"at"instance` `nameOfImmediateParent`, same block but before `"at"description` comment line;
|
|
1684
1686
|
>>- `"at"description` are treated as plain `markdown`;
|
|
1685
1687
|
>>- first `"at"${string}` after `"at"description` until `"at"example` will be treated as `javascript` comment block on the `markdown`;
|
package/bun.lock
CHANGED
package/index.mjs
CHANGED
package/package.json
CHANGED
package/src/class/QChannel.mjs
CHANGED
|
@@ -6,18 +6,18 @@ import { TryAsync } from '../function/TryAsync.mjs';
|
|
|
6
6
|
/**
|
|
7
7
|
* @description
|
|
8
8
|
* - class for `Queue` handling;
|
|
9
|
-
* @template {
|
|
9
|
+
* @template {AnyButUndefined} T
|
|
10
10
|
*/
|
|
11
11
|
export class QChannel {
|
|
12
12
|
/**
|
|
13
|
-
* @typedef {import('../types/AnyButUndefined.mjs').AnyButUndefined}
|
|
13
|
+
* @typedef {import('../types/AnyButUndefined.mjs').AnyButUndefined} AnyButUndefined
|
|
14
14
|
* @typedef {import('../types/QCBReturn.mjs').QCBReturn} QCBReturn
|
|
15
15
|
* @typedef {import('../types/QCBFIFOReturn.mjs').QCBFIFOReturn} QCBFIFOReturn
|
|
16
16
|
*/
|
|
17
17
|
/**
|
|
18
18
|
* @description
|
|
19
19
|
* - to modify `MapReference`
|
|
20
|
-
* @param {Map<
|
|
20
|
+
* @param {Map<AnyButUndefined, [Promise<any>, {}]>} uniqueMap
|
|
21
21
|
* @returns {typeof QChannel}
|
|
22
22
|
* - usefull for Queue primitive on multiple library but single reference, like the Web by making the `Map` on `window` object;
|
|
23
23
|
*/
|
|
@@ -26,13 +26,13 @@ export class QChannel {
|
|
|
26
26
|
return QChannel;
|
|
27
27
|
};
|
|
28
28
|
/**
|
|
29
|
-
* @type {Map<
|
|
29
|
+
* @type {Map<AnyButUndefined, [Promise<any>, {}]>}
|
|
30
30
|
*/
|
|
31
31
|
static #uniquePromiser = new Map();
|
|
32
32
|
/**
|
|
33
33
|
* - ensures that each id has only one task running at a time.
|
|
34
34
|
* - calls with the same id will wait for the previous call to finish.
|
|
35
|
-
* @param {
|
|
35
|
+
* @param {AnyButUndefined} id
|
|
36
36
|
* @returns {Promise<QCBReturn>} Resolves when it's safe to proceed for the given id, returning a cleanup function
|
|
37
37
|
*/
|
|
38
38
|
static #uniqueCB = async (id) => {
|
package/src/doc/JSautoDOC.mjs
CHANGED
|
@@ -37,10 +37,12 @@ const acceptableExt = new Set(['.mjs', '.mts', '.ts']);
|
|
|
37
37
|
* - this autodocumenter uses [chokidar](https://npmjs.com/package/chokidar) under the hood;
|
|
38
38
|
* - this class also is used to generate this `README.md`;
|
|
39
39
|
* - behaviours:
|
|
40
|
-
* >1)
|
|
41
|
-
*
|
|
42
|
-
* >
|
|
43
|
-
* >
|
|
40
|
+
* >1) add `"at"noautodoc` on self closing jsdoc comment to opt out from generating documentation on said file;
|
|
41
|
+
* >>- auto export must follows the following rules, and there's no way to override;
|
|
42
|
+
* >2) export all named exported 'const'|'function'|'async function'|'class', alphanumeric name, started with Capital letter, same name with fileName on `options.pahts.file`;
|
|
43
|
+
* >3) declare typedef of existing typedef with alphanumeric name, started with Capital letter, same name with fileName, and have no valid export like on point <sup>1</sup> on `options.pahts.file`;
|
|
44
|
+
* >4) create `README.md` based on, `options.paths.dir` and `README.src.md`;
|
|
45
|
+
* >5) extract `"at"description` jsdoc:
|
|
44
46
|
* >>- on static/prop that have depths, all of children should have `"at"static`/`"at"instance` `nameOfImmediateParent`, same block but before `"at"description` comment line;
|
|
45
47
|
* >>- `"at"description` are treated as plain `markdown`;
|
|
46
48
|
* >>- first `"at"${string}` after `"at"description` until `"at"example` will be treated as `javascript` comment block on the `markdown`;
|
|
@@ -226,7 +228,7 @@ export class JSautoDOC {
|
|
|
226
228
|
* @returns {string}
|
|
227
229
|
*/
|
|
228
230
|
#generateJSDOCFromstring = (string) => {
|
|
229
|
-
return `\n/**\n * automatically generated by \`vivth.
|
|
231
|
+
return `\n/**\n * automatically generated by \`vivth.JSautoDOC\`\n * @copyright\n${string.replace(
|
|
230
232
|
/^/gm,
|
|
231
233
|
' * '
|
|
232
234
|
)}\n */\n`;
|
|
@@ -250,6 +252,7 @@ export class JSautoDOC {
|
|
|
250
252
|
for await (const path_ of filepaths) {
|
|
251
253
|
const {
|
|
252
254
|
documented,
|
|
255
|
+
content,
|
|
253
256
|
hasValidExportObject,
|
|
254
257
|
path: { relative: relativePath },
|
|
255
258
|
baseName: { noExt },
|
|
@@ -272,13 +275,15 @@ export class JSautoDOC {
|
|
|
272
275
|
});
|
|
273
276
|
if (!error && typedefString) {
|
|
274
277
|
mjsTypes.push(typedefString.module);
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
278
|
+
if (!/\/\*\*[\s\*]*?@noautodoc[\s\*]*?\*\//.test(await content.string())) {
|
|
279
|
+
const nameVarID = noExt.toLowerCase();
|
|
280
|
+
tableOfContent.push(`[${noExt}](#${nameVarID})`);
|
|
281
|
+
apiDocuments.push(
|
|
282
|
+
`<h2 id="${nameVarID}">${noExt}</h2>\n\n- jsdoc types:\n\n\`\`\`js\n${
|
|
283
|
+
typedefString.readme
|
|
284
|
+
}\n\`\`\`\n*) <sub>[go to ${this.#tableOfContentTitle}](#${tableID})</sub>`
|
|
285
|
+
);
|
|
286
|
+
}
|
|
282
287
|
}
|
|
283
288
|
readme.forEach((ref) => {
|
|
284
289
|
const {
|
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @description
|
|
3
3
|
* - class for `Queue` handling;
|
|
4
|
-
* @template {
|
|
4
|
+
* @template {AnyButUndefined} T
|
|
5
5
|
*/
|
|
6
6
|
export class QChannel<T extends import("../types/AnyButUndefined.mjs").AnyButUndefined> {
|
|
7
7
|
/**
|
|
8
|
-
* @typedef {import('../types/AnyButUndefined.mjs').AnyButUndefined}
|
|
8
|
+
* @typedef {import('../types/AnyButUndefined.mjs').AnyButUndefined} AnyButUndefined
|
|
9
9
|
* @typedef {import('../types/QCBReturn.mjs').QCBReturn} QCBReturn
|
|
10
10
|
* @typedef {import('../types/QCBFIFOReturn.mjs').QCBFIFOReturn} QCBFIFOReturn
|
|
11
11
|
*/
|
|
12
12
|
/**
|
|
13
13
|
* @description
|
|
14
14
|
* - to modify `MapReference`
|
|
15
|
-
* @param {Map<
|
|
15
|
+
* @param {Map<AnyButUndefined, [Promise<any>, {}]>} uniqueMap
|
|
16
16
|
* @returns {typeof QChannel}
|
|
17
17
|
* - usefull for Queue primitive on multiple library but single reference, like the Web by making the `Map` on `window` object;
|
|
18
18
|
*/
|
|
19
19
|
static makeQClass: (uniqueMap: Map<import("../types/AnyButUndefined.mjs").AnyButUndefined, [Promise<any>, {}]>) => typeof QChannel;
|
|
20
20
|
/**
|
|
21
|
-
* @type {Map<
|
|
21
|
+
* @type {Map<AnyButUndefined, [Promise<any>, {}]>}
|
|
22
22
|
*/
|
|
23
23
|
static #uniquePromiser: Map<import("../types/AnyButUndefined.mjs").AnyButUndefined, [Promise<any>, {}]>;
|
|
24
24
|
/**
|
|
25
25
|
* - ensures that each id has only one task running at a time.
|
|
26
26
|
* - calls with the same id will wait for the previous call to finish.
|
|
27
|
-
* @param {
|
|
27
|
+
* @param {AnyButUndefined} id
|
|
28
28
|
* @returns {Promise<QCBReturn>} Resolves when it's safe to proceed for the given id, returning a cleanup function
|
|
29
29
|
*/
|
|
30
30
|
static #uniqueCB: (id: import("../types/AnyButUndefined.mjs").AnyButUndefined) => Promise<import("../types/QCBReturn.mjs").QCBReturn>;
|
|
@@ -4,10 +4,12 @@
|
|
|
4
4
|
* - this autodocumenter uses [chokidar](https://npmjs.com/package/chokidar) under the hood;
|
|
5
5
|
* - this class also is used to generate this `README.md`;
|
|
6
6
|
* - behaviours:
|
|
7
|
-
* >1)
|
|
8
|
-
*
|
|
9
|
-
* >
|
|
10
|
-
* >
|
|
7
|
+
* >1) add `"at"noautodoc` on self closing jsdoc comment to opt out from generating documentation on said file;
|
|
8
|
+
* >>- auto export must follows the following rules, and there's no way to override;
|
|
9
|
+
* >2) export all named exported 'const'|'function'|'async function'|'class', alphanumeric name, started with Capital letter, same name with fileName on `options.pahts.file`;
|
|
10
|
+
* >3) declare typedef of existing typedef with alphanumeric name, started with Capital letter, same name with fileName, and have no valid export like on point <sup>1</sup> on `options.pahts.file`;
|
|
11
|
+
* >4) create `README.md` based on, `options.paths.dir` and `README.src.md`;
|
|
12
|
+
* >5) extract `"at"description` jsdoc:
|
|
11
13
|
* >>- on static/prop that have depths, all of children should have `"at"static`/`"at"instance` `nameOfImmediateParent`, same block but before `"at"description` comment line;
|
|
12
14
|
* >>- `"at"description` are treated as plain `markdown`;
|
|
13
15
|
* >>- first `"at"${string}` after `"at"description` until `"at"example` will be treated as `javascript` comment block on the `markdown`;
|