# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [1.2.0] - 2020-12-10

### Removed

- The `mysql` type is removed from `additionalTypes` in `registry-parser.js`, which means example config file snippets will not be generated automatically from the `mariadb` type object in a registry file source. A separate `mysql` object is required in that registry file to produce configuration snippets. Related: the `mysql` type has been added to a `ignoreTypesInTable` variable, which keeps duplicate images with differing supported versions from both showing up in the supported table (since they point to the same page in docs anyway).

## [1.1.1] - 2019-10-11

### Added

- Additional YAML files are generated for `Runtimes`, each for another attribute of `.platform.app.yaml` files:
  - `<runtime_image>.web.app.yaml`
  - `<runtime_image>.hooks.app.yaml`
  - `<runtime_image>.build.app.yaml`
  - `<runtime_image>.dependencies.app.yaml`

## [1.1.0] - 2019-09-25

### Added

- A block is added to `makeImageInstances()` that filters service and runtime images into the object properties `services` and `runtimes`, respectively, which are subsets of `images`.
- Two methods were added, `makeSupportedVersionsTables()` and `makeSupportedVersionTable(imageGroup)`. The first generates two files - `<saveDir>/tables/runtimes_supported.md` and `<saveDir>/tables/services_supported.md` - by calling the second for the `imageGroup`s `"runtimes"` and `"services"`. These two files contain markdown formatted tables that contain the supported versions for all runtimes and all services, respectively, links to their documentation, and their type. "Additional types" (e.g. `mysql`, `redis-persistent`) are not included in in these tables, only their primary types (e.g. `mariadb`, `redis`), so as not to generate duplicates. The table is sorted alphabetically by type. As an example, the testing registry in `test/testdata/valid.json` includes 8 services, and generates the following table in `test/testdata/tables/services_supported.md` after excluding the two `additionalTypes`:

  | **Service** | **`type`** | **Supported `version`** |
  |----------------------------------|---------------|-------------------------|
  | [Elasticsearch](/configuration/services/elasticsearch.html) | `elasticsearch` | 6.5, 7.2 |
  | [Kafka](/configuration/services/kafka.html) | `kafka` | 2.1, 2.2 |
  | [MariaDB](/configuration/services/mysql.html) | `mariadb` | 10.0, 10.1, 10.2 |
  | [Network Storage](/configuration/services/network-storage.html) | `network-storage` | 1.0 |
  | [Redis](/configuration/services/redis.html) | `redis` | 3.2, 4.0, 5.0 |
  | [Varnish](/configuration/services/varnish.html) | `varnish` | 5.6, 6.0 |

  The purpose of this change was to enable DevRel to include these tables directly within the documentation, as is done in the [Getting Started guides](https://docs.platform.sh/gettingstarted/own-code/service-configuration.html) for services and runtimes, without having a separate section that needed to be updated each time a new image was released. For example, including the table above with Gitbook on the page linked (`src/gettingstarted/own-code/service-configuration.md`) is done with the following:

  ```
  {% include "../../registry/images/tables/service_supported.md" %}
  ```
  Hugo has similar `include` shortcodes, so when we migrate to Hugo this command can be substituted to the same effect.
- `makeSupportedVersionsTables()` is called by `write()` only when not supplied with an individual image type (when configuration files for each image in the Registry are generated).

### Changed

- Testing instances are renamed `registry` to match examples in the README.
- There are **breaking changes** to how generated subdirectories are created when `saveDir` is specified to a `RegistryParser` instance.
- If no `saveDir` is given, and it is instead inferred from the location of `registrySource`, the behavior has not changed.
- The logic around `deriveSaveLocations()` and `ensureSaveLocations()` has been changed. Because these "Supported Versions" tables have little to do with the generated configuration YAML files, they do not save to the same `<saveDir>/examples/` subdirectory, but instead to their own subdirectory `<saveDir>/tables/`.
- Previously, if the `saveDir` parameter was given to a `RegistryParser` instance, that `saveDir` would take the place of the `examples` subdirectory, and each `commented`, `snippet`, and `full` examples directory would be generated directly within it. Now, in order to support the `tables` save location, supplying a `saveDir` does not make this same assumption, and both `examples` and `tables` are generated within it.

## [1.0.4] - 2019-09-09

### Changed

- The relationship and service name for `redis-persistent` are updated to match new naming convention for Platform.sh documentation.

## [1.0.3] - 2019-09-09

### Added

- `CHANGELOG.md` added.
- Runtime type definition includes quotes around string.

## [1.0.2] - 2019-09-03

### Added

- Yaml generation functions for making a copy of `registry.json` in a `registry.yaml` file during `write()`.

## [1.0.1] - 2019-08-30

### Removed

- Removed testing block in `registry-parser.js` that prevented imports.

## [1.0.0] - 2019-08-30

### Changed

- Migrated from GitHub initial project.
- Major refactor around Image, Runtime, Service and Special Case classes.
- Individual image instances are accessible through `registry.images['elasticsearch']` after `RegistryParser` is instantiated as `registry`.
