Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(plugin-doc-coverage): add doc-coverage-plugin to analyze documentation in ts/js projects #896

Open
wants to merge 39 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
bf1775d
feat(plugin-doc-coverage): add mvp version of a plugin doc coverage b…
aramirezj Dec 17, 2024
b07eb8a
feat: change from compodoc to typedoc
aramirezj Dec 17, 2024
0de6d3f
feat(plugin-doc-coverage): change to use ts-morph instead of typedoc.…
aramirezj Dec 18, 2024
164a86a
feat: doc-processer give coverage by type of property. Some tests enh…
aramirezj Dec 18, 2024
3fe6e3b
feat(plugin-doc-coverage): improve code fragmentation, tests and mode…
aramirezj Dec 20, 2024
40c8daa
test(plugin-doc-coverage): finish remaining tests, add format to cove…
aramirezj Dec 20, 2024
47486c8
feat(plugin-doc-coverage): add skipAudits options to the plugin, crea…
aramirezj Dec 20, 2024
f21fbe2
chore(plugin-doc-coverage): fix linter problems
aramirezj Dec 20, 2024
4fb478e
fix: return code-pushup config to original state
aramirezj Dec 20, 2024
feefa0a
feat(plugin-doc-coverage): add support for variable statement to be d…
aramirezj Dec 21, 2024
1a5a614
chore(plugin-doc-coverage): remove unused file and update readme file
aramirezj Dec 21, 2024
8909855
Update packages/plugin-doc-coverage/src/lib/constants.ts
aramirezj Dec 22, 2024
b8cdf77
Update packages/plugin-doc-coverage/package.json
aramirezj Dec 22, 2024
24ab2e0
chore(plugin-doc-coverage): from Michael comments, remakes some tests…
aramirezj Dec 22, 2024
6c83208
chore(plugin-doc-coverage): remove extra line
aramirezj Dec 22, 2024
8c2d274
chore: put back plugin config
aramirezj Dec 22, 2024
a70c03b
chore: fix plugin config, remove unused snapshot
aramirezj Dec 22, 2024
6be3803
chore(plugin-doc-coverage): stuff of the pr and rename file
aramirezj Dec 22, 2024
2f29728
Update code-pushup.config.ts
aramirezj Dec 23, 2024
adec386
Update packages/plugin-doc-coverage/src/lib/doc-coverage-plugin.unit.…
aramirezj Dec 23, 2024
47cff4b
Update packages/plugin-doc-coverage/src/lib/runner/doc-processer.inte…
aramirezj Dec 23, 2024
c644029
Update packages/plugin-doc-coverage/src/lib/constants.ts
aramirezj Dec 23, 2024
09d9eb0
Update packages/plugin-doc-coverage/src/lib/constants.ts
aramirezj Dec 23, 2024
3901955
Update packages/plugin-doc-coverage/src/lib/constants.ts
aramirezj Dec 23, 2024
11ad4bb
Update packages/plugin-doc-coverage/src/lib/constants.ts
aramirezj Dec 23, 2024
19d43a5
Update packages/plugin-doc-coverage/src/lib/constants.ts
aramirezj Dec 23, 2024
49e5b56
Update packages/plugin-doc-coverage/README.md
aramirezj Dec 23, 2024
54d1621
Update packages/plugin-doc-coverage/README.md
aramirezj Dec 23, 2024
b3105ae
Update packages/plugin-doc-coverage/src/lib/constants.ts
aramirezj Dec 23, 2024
89893a0
Update packages/plugin-doc-coverage/src/lib/constants.ts
aramirezj Dec 23, 2024
97d32bf
Update packages/plugin-doc-coverage/src/lib/config.unit.test.ts
aramirezj Dec 23, 2024
79b6a02
Update packages/plugin-doc-coverage/src/lib/config.unit.test.ts
aramirezj Dec 23, 2024
fd3bd5e
chore(plugin-doc-coverage): add js files for integration test, remove…
aramirezj Dec 23, 2024
0ecc193
chore: run nx format
aramirezj Dec 23, 2024
7e0acbd
chore(plugin-doc-coverage): improve readme and audits
aramirezj Dec 23, 2024
24468cc
chore(plugin-doc-coverage): remove unused async
aramirezj Dec 23, 2024
ef77df0
chore(plugin-doc-coverage): fix tests, fully remove unnecessary await
aramirezj Dec 23, 2024
b09aa57
chore: fix scope of sourceGlob
aramirezj Dec 23, 2024
b9f5333
fix: mock word
aramirezj Dec 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,210 changes: 1,210 additions & 0 deletions code-pushup.config.bundled_oq2x2csd2at.mjs

Large diffs are not rendered by default.

11 changes: 11 additions & 0 deletions code-pushup.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import 'dotenv/config';
import { z } from 'zod';
import {
coverageCoreConfigNx,
docCoverageCoreConfig,
eslintCoreConfigNx,
jsPackagesCoreConfig,
lighthouseCoreConfig,
Expand Down Expand Up @@ -39,4 +40,14 @@ export default mergeConfigs(
'https://github.com/code-pushup/cli?tab=readme-ov-file#code-pushup-cli/',
),
await eslintCoreConfigNx(),
await docCoverageCoreConfig({
sourceGlob: [
'packages/**/src/**/*.ts',
'!**/*.spec.ts',
'!**/*.test.ts',
aramirezj marked this conversation as resolved.
Show resolved Hide resolved
'!**/implementation/**',
'!**/internal/**',
],
skipAudits: ['methods-coverage'],
}),
);
35 changes: 35 additions & 0 deletions code-pushup.preset.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ import type {
import coveragePlugin, {
getNxCoveragePaths,
} from './packages/plugin-coverage/src/index.js';
import docCoveragePlugin, {
DocCoveragePluginConfig,
} from './packages/plugin-doc-coverage/src/index.js';
import {
PLUGIN_SLUG,
groups,
} from './packages/plugin-doc-coverage/src/lib/constants.js';
import { filterGroupsByOnlyAudits } from './packages/plugin-doc-coverage/src/lib/utils.js';
import eslintPlugin, {
eslintConfigFromAllNxProjects,
eslintConfigFromNxProject,
Expand Down Expand Up @@ -82,6 +90,24 @@ export const eslintCategories: CategoryConfig[] = [
},
];

export function getDocCoverageCategories(
config: DocCoveragePluginConfig,
): CategoryConfig[] {
return [
{
slug: 'doc-coverage-cat',
title: 'Documentation coverage',
description: 'Measures how much of your code is **documented**.',
refs: filterGroupsByOnlyAudits(groups, config).map(group => ({
weight: 1,
type: 'group',
plugin: PLUGIN_SLUG,
slug: group.slug,
})),
},
];
}

export const coverageCategories: CategoryConfig[] = [
{
slug: 'code-coverage',
Expand Down Expand Up @@ -114,6 +140,15 @@ export const lighthouseCoreConfig = async (
};
};

export const docCoverageCoreConfig = async (
config: DocCoveragePluginConfig,
): Promise<CoreConfig> => {
return {
plugins: [await docCoveragePlugin(config)],
categories: getDocCoverageCategories(config),
};
};

export const eslintCoreConfigNx = async (
projectName?: string,
): Promise<CoreConfig> => {
Expand Down
80 changes: 80 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"parse-lcov": "^1.0.4",
"semver": "^7.6.3",
"simple-git": "^3.26.0",
"ts-morph": "^24.0.0",
"tslib": "^2.6.2",
"vscode-material-icons": "^0.1.1",
"yaml": "^2.5.1",
Expand Down
Loading
Loading