<commit_before># Creating a build provider

## Service API

Another package may provide build information to the `build`-package by implementing its service API.
The package should integrate via the service API. This is typically done in `package.json`:

```javascript
{
  "providedServices": {
    "builder": {
      "description": "Description of the build configurations this package gives",
      "versions": {
        "2.0.0": "providingFunction"
      }
    }
  }
},
```

The `build`-package will then call `providingFunction` when activated and expects an
ES6 class in return. The next section describes in detail how that class is
expected to operate.

## The provider implementation
```javascript
class MyBuildProvider {

  constructor(cwd) {
    // OPTIONAL: setup here
    // cwd is the project root this provider will operate in, so store `cwd` in `this`.
  }

  destructor() {
    // OPTIONAL: tear down here.
    // destructor is not part of ES6. This is called by `build` like any
    // other method before deactivating.
    return 'void';
  }

  getNiceName() {
    // REQUIRED: return a nice readable name of this provider.
    return 'string';
  }

  isEligible() {
    // REQUIRED: Perform operations to determine if this build provider can
    // build the project in `cwd` (which was specified in `constructor`).
    return 'boolean';
  }

  settings() {<commit_msg>Document providing array of builders<commit_after># Creating a build provider

## Service API

Another package may provide build information to the `build`-package by implementing its service API.
The package should integrate via the service API. This is typically done in `package.json`:

```javascript
{
  "providedServices": {
    "builder": {
      "description": "Description of the build configurations this package gives",
      "versions": {
        "2.0.0": "providingFunction"
      }
    }
  }
},
```

The `build`-package will then call `providingFunction` when activated and expects an
ES6 class or an array of classes in return. The next section describes in detail how that class is
expected to operate.

## The provider implementation
```javascript
class MyBuildProvider {

  constructor(cwd) {
    // OPTIONAL: setup here
    // cwd is the project root this provider will operate in, so store `cwd` in `this`.
  }

  destructor() {
    // OPTIONAL: tear down here.
    // destructor is not part of ES6. This is called by `build` like any
    // other method before deactivating.
    return 'void';
  }

  getNiceName() {
    // REQUIRED: return a nice readable name of this provider.
    return 'string';
  }

  isEligible() {
    // REQUIRED: Perform operations to determine if this build provider can
    // build the project in `cwd` (which was specified in `constructor`).
    return 'boolean';
  }

  settings() {
{'fraction_non_alphanumeric': 0.09355067328136074, 'fraction_numerical': 0.003543586109142452, 'mean_word_length': 3.188427299703264, 'pattern_counts': {'":': 10, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7614835', 'n_tokens_mistral': 797, 'n_tokens_neox': 763, 'n_words': 335}