<commit_before># Opus

## What Does it Do?

Opus copies files from composer packages into your root package / project.

## How Does it Work?

Packages provide installation maps for supporting frameworks which tell Opus which files to copy from the source package and where to copy them in the project root.

## Why Do I Need It?

Opus allows for framework modules or asset libraries to be bundled together.  For example, if you have a CMS which has plugins, your plugins are likely in PHP, but they may also require additional CSS or Javascript files which need to be copied somewhere in the project.

Additionally, some pluggable components require extra steps where the user must "configure" the plugin by copying and pasting some bootstrap PHP into a file in a plugin dirctory or something similar.  Opus can copy the plugin file instead, and then the user can edit only if it's necessary to customize.

## Enabling Opus in Your Framework, CMS, or Project's `composer.json` File

_NOTE: Opus will use the `name` property in the `composer.json` to determine which installation map to use from supporting packages._

```json
"require": {
	"imarc/opus": "*"
},
"extra": {
	"opus": {
		"enabled": true
	}
}
```

## Telling Opus What Framework Your Project Uses

_NOTE: This only has to be done if the `name` in your project's `composer.json` does not match the supporting framework._

```json
"extra": {
	"opus": {
		"options": {
			"framework": "<framework>"
		}
	}
}
```

## Opus Packages

There are two types of Opus packages:

1) Standard Packages
2) Integration Package

### Standard Packages

A standard package is a regular composer package which has been configured to support one or more frameworks by providing one or more installation maps keyed by the framework name.

It has the following information added to the `composer.json`:

```json
"type": "opus-package",
"extra": {
	"opus": {
		"<framework>": {
			"<source>": "<destination>",
			...<commit_msg>Minor list fix<commit_after># Opus

## What Does it Do?

Opus copies files from composer packages into your root package / project.

## How Does it Work?

Packages provide installation maps for supporting frameworks which tell Opus which files to copy from the source package and where to copy them in the project root.

## Why Do I Need It?

Opus allows for framework modules or asset libraries to be bundled together.  For example, if you have a CMS which has plugins, your plugins are likely in PHP, but they may also require additional CSS or Javascript files which need to be copied somewhere in the project.

Additionally, some pluggable components require extra steps where the user must "configure" the plugin by copying and pasting some bootstrap PHP into a file in a plugin dirctory or something similar.  Opus can copy the plugin file instead, and then the user can edit only if it's necessary to customize.

## Enabling Opus in Your Framework, CMS, or Project's `composer.json` File

_NOTE: Opus will use the `name` property in the `composer.json` to determine which installation map to use from supporting packages._

```json
"require": {
	"imarc/opus": "*"
},
"extra": {
	"opus": {
		"enabled": true
	}
}
```

## Telling Opus What Framework Your Project Uses

_NOTE: This only has to be done if the `name` in your project's `composer.json` does not match the supporting framework._

```json
"extra": {
	"opus": {
		"options": {
			"framework": "<framework>"
		}
	}
}
```

## Opus Packages

There are two types of Opus packages:

1. Standard Packages
2. Integration Package

### Standard Packages

A standard package is a regular composer package which has been configured to support one or more frameworks by providing one or more installation maps keyed by the framework name.

It has the following information added to the `composer.json`:

```json
"type": "opus-package",
"extra": {
	"opus": {
		"<framework>": {
			"<source>": "<destination>",
			...
{'fraction_non_alphanumeric': 0.08284625158831004, 'fraction_numerical': 0.0010165184243964421, 'mean_word_length': 4.227091633466135, 'pattern_counts': {'":': 28, '<': 11, '<?xml version=': 0, '>': 11, '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': '7330178', 'n_tokens_mistral': 1130, 'n_tokens_neox': 1049, 'n_words': 570}