@code-pushup/jsdocs-plugin 0.125.0 → 0.126.1
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/package.json +3 -3
- package/src/index.d.ts +1 -0
- package/src/index.js +1 -0
- package/src/index.js.map +1 -1
- package/src/lib/binding.d.ts +38 -0
- package/src/lib/binding.js +68 -0
- package/src/lib/binding.js.map +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@code-pushup/jsdocs-plugin",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.126.1",
|
|
4
4
|
"description": "Code PushUp plugin for tracking documentation coverage 📚",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/code-pushup/cli/tree/main/packages/plugin-jsdocs#readme",
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
},
|
|
36
36
|
"type": "module",
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@code-pushup/models": "0.
|
|
39
|
-
"@code-pushup/utils": "0.
|
|
38
|
+
"@code-pushup/models": "0.126.1",
|
|
39
|
+
"@code-pushup/utils": "0.126.1",
|
|
40
40
|
"zod": "^4.2.1",
|
|
41
41
|
"ts-morph": "^24.0.0"
|
|
42
42
|
},
|
package/src/index.d.ts
CHANGED
package/src/index.js
CHANGED
package/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,eAAe,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC;AAEtD,eAAe,YAAY,CAAC;AAC5B,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { PluginAnswer } from '@code-pushup/models';
|
|
2
|
+
export declare const jsDocsSetupBinding: {
|
|
3
|
+
slug: string;
|
|
4
|
+
title: string;
|
|
5
|
+
packageName: string;
|
|
6
|
+
prompts: () => Promise<({
|
|
7
|
+
key: string;
|
|
8
|
+
message: string;
|
|
9
|
+
type: "input";
|
|
10
|
+
default: string;
|
|
11
|
+
} | {
|
|
12
|
+
key: string;
|
|
13
|
+
message: string;
|
|
14
|
+
type: "confirm";
|
|
15
|
+
default: true;
|
|
16
|
+
})[]>;
|
|
17
|
+
generateConfig: (answers: Record<string, PluginAnswer>) => {
|
|
18
|
+
categories?: {
|
|
19
|
+
slug: string;
|
|
20
|
+
refs: {
|
|
21
|
+
slug: string;
|
|
22
|
+
weight: number;
|
|
23
|
+
type: "audit" | "group";
|
|
24
|
+
plugin: string;
|
|
25
|
+
}[];
|
|
26
|
+
title: string;
|
|
27
|
+
description?: string | undefined;
|
|
28
|
+
docsUrl?: string | undefined;
|
|
29
|
+
isSkipped?: boolean | undefined;
|
|
30
|
+
scoreTarget?: number | undefined;
|
|
31
|
+
}[] | undefined;
|
|
32
|
+
imports: {
|
|
33
|
+
moduleSpecifier: string;
|
|
34
|
+
defaultImport: string;
|
|
35
|
+
}[];
|
|
36
|
+
pluginInit: string[];
|
|
37
|
+
};
|
|
38
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';
|
|
2
|
+
import { answerBoolean, answerNonEmptyArray, singleQuote, } from '@code-pushup/utils';
|
|
3
|
+
import { PLUGIN_SLUG, PLUGIN_TITLE } from './constants.js';
|
|
4
|
+
const { name: PACKAGE_NAME } = createRequire(import.meta.url)('../../package.json');
|
|
5
|
+
const DEFAULT_PATTERNS = [
|
|
6
|
+
'src/**/*.ts',
|
|
7
|
+
'src/**/*.js',
|
|
8
|
+
'!**/node_modules',
|
|
9
|
+
];
|
|
10
|
+
const CATEGORY = {
|
|
11
|
+
slug: 'docs',
|
|
12
|
+
title: 'Documentation',
|
|
13
|
+
description: 'Measures how much of your code is **documented**.',
|
|
14
|
+
refs: [
|
|
15
|
+
{
|
|
16
|
+
type: 'group',
|
|
17
|
+
plugin: PLUGIN_SLUG,
|
|
18
|
+
slug: 'documentation-coverage',
|
|
19
|
+
weight: 1,
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
};
|
|
23
|
+
export const jsDocsSetupBinding = {
|
|
24
|
+
slug: PLUGIN_SLUG,
|
|
25
|
+
title: PLUGIN_TITLE,
|
|
26
|
+
packageName: PACKAGE_NAME,
|
|
27
|
+
prompts: async () => [
|
|
28
|
+
{
|
|
29
|
+
key: 'jsdocs.patterns',
|
|
30
|
+
message: 'Source file patterns (comma-separated)',
|
|
31
|
+
type: 'input',
|
|
32
|
+
default: DEFAULT_PATTERNS.join(', '),
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
key: 'jsdocs.categories',
|
|
36
|
+
message: 'Add JSDocs categories?',
|
|
37
|
+
type: 'confirm',
|
|
38
|
+
default: true,
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
generateConfig: (answers) => {
|
|
42
|
+
const options = parseAnswers(answers);
|
|
43
|
+
return {
|
|
44
|
+
imports: [
|
|
45
|
+
{ moduleSpecifier: PACKAGE_NAME, defaultImport: 'jsDocsPlugin' },
|
|
46
|
+
],
|
|
47
|
+
pluginInit: formatPluginInit(options.patterns),
|
|
48
|
+
...(options.categories ? { categories: [CATEGORY] } : {}),
|
|
49
|
+
};
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
function parseAnswers(answers) {
|
|
53
|
+
return {
|
|
54
|
+
patterns: answerNonEmptyArray(answers, 'jsdocs.patterns', DEFAULT_PATTERNS[0]),
|
|
55
|
+
categories: answerBoolean(answers, 'jsdocs.categories'),
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
function formatPluginInit([first, ...rest]) {
|
|
59
|
+
if (rest.length === 0) {
|
|
60
|
+
return [`jsDocsPlugin(${singleQuote(first)}),`];
|
|
61
|
+
}
|
|
62
|
+
return [
|
|
63
|
+
'jsDocsPlugin([',
|
|
64
|
+
...[first, ...rest].map(p => ` ${singleQuote(p)},`),
|
|
65
|
+
']),',
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=binding.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"binding.js","sourceRoot":"","sources":["../../../src/lib/binding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAM5C,OAAO,EACL,aAAa,EACb,mBAAmB,EACnB,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAE3D,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAC3D,oBAAoB,CACkB,CAAC;AAEzC,MAAM,gBAAgB,GAA0B;IAC9C,aAAa;IACb,aAAa;IACb,kBAAkB;CACnB,CAAC;AAEF,MAAM,QAAQ,GAAmB;IAC/B,IAAI,EAAE,MAAM;IACZ,KAAK,EAAE,eAAe;IACtB,WAAW,EAAE,mDAAmD;IAChE,IAAI,EAAE;QACJ;YACE,IAAI,EAAE,OAAO;YACb,MAAM,EAAE,WAAW;YACnB,IAAI,EAAE,wBAAwB;YAC9B,MAAM,EAAE,CAAC;SACV;KACF;CACF,CAAC;AAOF,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,YAAY;IACnB,WAAW,EAAE,YAAY;IACzB,OAAO,EAAE,KAAK,IAAI,EAAE,CAAC;QACnB;YACE,GAAG,EAAE,iBAAiB;YACtB,OAAO,EAAE,wCAAwC;YACjD,IAAI,EAAE,OAAO;YACb,OAA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