1.2.4 • Published 1 year ago

@amazeelabs/estimator v1.2.4

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

Amazeelabs Estimator

The @amazeelabs/estimator package allows to assess and monitor a projects complexity based on its GraphQL schema definitions and operations. It counts occurences of certain GraphQL features (type definitions, fields, queries, mutations, etc.) and calculates a complexity score based on these counts.

Then it connects to the Amazeelabs Dashboard, which allows track complexity over time and relate it to work time consumed on this project.

It also provides a command to predict the efforts needed to implement a new feature based on GraphQL changes.

Installation

npm install -g @amazeelabs/estimator

Configuration

Create configuration in a cosmiconfig compatible format.

// estimator.config.ts
export default {
  documents: [
    'packages/schema/src/fragments/**/*.{gql,graphql}',
    'packages/schema/src/operations/*.{gql,graphql}',
    'packages/schema/src/schema.graphql',
  ],
  storage: {
    id: process.env.JIRA_PROJECT_ID,
    token: process.env.DASHBOARD_ACCESS_TOKEN,
    api: 'https://dashboard.amazeelabs.com/api/estimator',
  },
};

Please consult the configuration schema for a full list of available options.

How it works

The estimator reads the GraphQL schema and operations from the provided documents and counts the occurences of certain features. It then calculates a complexity score based on these counts and a set of weights that can also be configured.