Skip to content

Generate config file in setup wizard #1243

@matejchalk

Description

@matejchalk

User story

Generating code-pushup.config.{js,mjs,ts} file is a basic requirement of the setup wizard.

Outputs

JavaScript (ESM)

/** @type {import('@code-pushup/models').CoreConfig} */
export default {
  plugins: [
    // ...
  ],
};

TypeScript

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

const config: CoreConfig = {
  plugins: [
    // ...
  ],
};

export default config;

Acceptance criteria

  • The user can select whether to use JavaScript or TypeScript for their config file(s).
  • The default option is inferred from the file system. If a tsconfig.json or tsconfig.*.json is present in the root directory, then TypeScript is the default, otherwise it's JavaScript.
  • If JavaScript is selected, then the .js extension should only be used if the root package.json (if any) contains "type": "module". Otherwise, the .mjs extension should be used.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions