Skip to content

JSDocs plugin setup wizard #1259

@matejchalk

Description

@matejchalk

User story

Our setup wizard should be able to configure a basic working version of each of our official plugins. Each plugin may prompt for its own specific configuration options and infer smart defaults from the user's repo. The resulting configuration code adds the plugin to the user's config and sets up some basic categories.

This issue is about @code-pushup/jsdocs-plugin specifically.

Output example

import jsDocsPlugin from '@code-pushup/jsdocs-plugin';
import type { CoreConfig } from '@code-pushup/models';

const config: CoreConfig = {
  plugins: [
    jsDocsPlugin([
      'packages/*/src/**/*.ts',
      '!**/node_modules',
      '!**/*.test.ts',
    ]),
  ],
  categories: [
    {
      slug: 'docs',
      title: 'Documentation',
      description: 'Measures how much of your code is **documented**.',
      refs: [
        {
          type: 'group',
          plugin: 'jsdocs',
          slug: 'documentation-coverage',
          weight: 1,
        },
      ],
    },
  ],

};

export default config;

Acceptance criteria

  • The JSDocs plugin is unselected by default.
  • The user is prompted (or provides a CLI argument) for a list of patterns, representing source code that should have documentation annotations.
    • The default patterns are ['src/**/*.ts', 'src/**/*.js', '!**/node_modules'].
  • The user should confirm (via prompt or CLI argument) if they want to also generate basic categories.
    • The default answer is yes (create the categories).
    • If confirmed, 1 category is created - Documentation (from documentation-coverage group).
    • If denied, no categories are created.
  • All of the above logic lives in @code-pushup/jsdocs-plugin. The core of the setup wizard in @code-pushup/create-cli orchestrates plugin selection and generation, but doesn't know any specifics about individual plugins.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions