Tonel file format writer and reader implementation for VA Smalltalk
<p align="center">
<h1 align="center">Tonel Tools for VAST Platform (VA Smalltalk)</h1>
<p align="center">
Providing git-friendly file format support to VAST
<!---
<br>
<a href="docs/"><strong>Explore the docs »</strong></a>
<br>
-->
</p>
</p>
## ⚠️ NOTICE: This repository is deprecated ⚠️
As of VAST 14.1.0, this repository is no longer actively maintained. While the code remains available in **read-only mode**, all ongoing development and maintenance of Tonel Tools in VAST will continue **internally** at Instantiations.
### Why is this change happening?
Most users of Tonel Tools in VAST report issues and request features directly through **Instantiations' Support Portal**. To stay aligned with this workflow, our team has had to duplicate tasks between this public repository and our internal systems, leading to unnecessary overhead and reduced efficiency.
In addition, external code contributions via pull requests have been rare, which makes this public repository an **additional layer** that doesn't align with our optimized internal development process.
### What does this mean for users?
- Development of Tonel Tools will continue internally at Instantiations.
- Updates and improvements will be reflected in the VAST release README.
- Bug fixes and enhancements will be delivered as part of regular VAST updates.
- All relevant documentation will be integrated to the official VAST documentation.
- If you encounter issues, have feature requests or like to contribute code, feel free to reach out to us through Instantiations' [VAST Support Portal](https://vast-support.instantiations.com/).
The latest public version of Tonel Tools corresponds to the release included in **VAST 14.1.0**.
We believe this change will allow us to serve our customers more efficiently while continuing to support and evolve the tools that matter to them.
Thank you for your understanding and continued support!
<hr></hr>
## Introduction
[Tonel](https://github.com/pharo-vcs/tonel) is a text-based file format used to store Smalltalk source code on disk, and was designed from scratch to be version control system (VCS) friendly. It is widely accepted by the Smalltalk community at this point, so Instantiations saw an opportunity to enhance ENVY (the standard VCS in VAST) by adding Tonel support for greater functionality and flexibility.
Development on Tonel Tools for VAST began in September 2019, and official support started when it shipped as a feature within VAST Platform 2021 (10.0.0) in March 2021.
Open source projects using Tonel for VAST can be found in the [VAST Community Hub](https://github.com/vast-community-hub) or in [Instantiations' GitHub respositories](https://github.com/instantiations).
## License
- The code is licensed under [MIT](LICENSE).
- The documentation is licensed under [CC BY-SA 4.0](http://creativecommons.org/licenses/by-sa/4.0/).
## Installation
We continue to improve the Tonel support by fixing bugs and adding new features to it, if you want to use the latest version you can do it by downloading the latest version in this repository into the latest version of VAST.
### Installing in VAST 2022 / 2023 / 2024 / 2025
Tonel comes as a Feature inside the product. That means it can be easily installed from the `Transcript` -> `Load/Unload Features...`. You will find two features you can install: `ST: Tonel Support` and `ST:Tonel Support, Testing`.
### Installing in VAST 2021
#### Loading the feature
Since there were significant changes in the codebase, the update must be split in sub steps, and do intermediate updates.
- Load Tonel VAST Features using `Transcript` -> `Load/Unload Features...`. There you will find two features you can install: `ST: Tonel Support` and `ST:Tonel Support, Testing`.
- Clone this repository locally using your preferred git tool.
#### Update to intermediate version
- Checkout the commit tagged as `v1.4.2`
- Open Configurations Maps Browser
- Right click in the `All names` list, select `Import` -> `Load Configuration Maps from Tonel repository...`
- Select the `.project` file of the directory you cloned in the step above
- Select `ENVY/Image Tonel` and/or `Test ENVY/Image Tonel`
You might get an error during the update, since Tonel is modifying itself as it gets loaded.
If that happens, retry the import.
### Update to latest version
- Checkout the latest commit (master branch)
- Open Application Manager
- Right click in the Applications list, select `Import/Export` -> `Load Applications from Tonel packages...`
- Select the `.project` file of the directory you cloned in the step above
- Select `TonelSystemExtensions` and import it
- Open Configurations Maps Browser
- Right click in the `All names` list, select `Import` -> `Load Configuration Maps from Tonel repository...`
- Select the `.project` file of the directory you cloned in the step above
- Select `ENVY/Image Tonel` and/or `Test ENVY/Image Tonel`
### Installing in VAST 9.2.x
- Clone this repository locally
- [Download VAST](https://www.instantiations.com/products/vasmalltalk/download.html) from Instantiations website.
- If you're using 9.2.1 checkout the [v1.1.0 tag](https://github.com/instantiations/tonel-vast/releases/tag/v1.1.0)
- If you're using 9.2.2 checkout the [v1.2.0 tag](https://github.com/instantiations/tonel-vast/releases/tag/v1.2.0)
- From the Configuration Map Browser, do an `Import` -> `All Most Recent Versions...` -> and select the `envy/Tonel.dat` located in the root folder of your local repository clone.
- Select the map `Tonel` (and optionally `Test Tonel` if you want to run its SUnit tests) and do a `Load With Required Maps` the latest version of it.
- Optionally run the SUnit tests included in the map `Test Tonel` to ensure correct installation. One easy way is to right-click on the `Test Tonel` map name in the Name pane (as opposed to version pane ) and then select `Test Loaded Applications`.
- Explore the [documentation](docs/).
## Quick Start
### Using GUI menus
#### Applications
You can load individual Tonel packages as Applications or export VAST Applications as Tonel packages via Application Manager's `Import/Export`.

When loading apps using this GUI the _loader_ will attempt to detect whether the files are in a Git repository, and if a git repository is detected it will configure itself to use [git versioning](docs/strategies.md), otherwise it will use the default settings (or leave all editions open without version).
#### Configuration Maps
You can also export and load Configuration Maps together with their applications from the Configuration Maps Browser.
##### Exporting
Select the Configuration Maps you want to export in the names list, and then open the contextual menu and choose `Export`, and then `Export Configuration Maps to Tonel`.

This will ask you which version of the config maps you want to export (only one version per map is allowed), where do you want to store it, as well as a few other settings.
##### Loading
To load a Configuration Map in a Tonel repository into VAST, you have to choose the `Import` option in the names list, and then `Load Configuration Maps from Tonel...`.

Once you select the available Configuration Maps, they will be loaded together with their required maps. If a required map is within the Tonel repository, then this map version will take precedence over the version specified.
### Programmatically
As with the GUI options, you can also export independent Applications or whole Configuration Maps to Tonel.
#### Applications
```smalltalk
"Exporting to Tonel"
TonelWriter new
clearSourcesDirectory; "deletes everything in the target directory"
writeProjectIncluding: (Array with: MyAppCore)
into: (CfsPath named: 'my-tonel-demos').
```
```smalltalk
"Loading from Tonel"
(TonelLoader readFromPath: (CfsPath named: 'my-tonel-demos'))
loadApplicationNamed: 'MyAppCore'.
"or you can load by Tonel package name"
(TonelLoader readFromPath: (CfsPath named: 'my-tonel-demos'))
loadApplicationsForPackagesNamed: #('MyApp-Core' 'MyApp-Tests').
```
#### Configuration Maps
```smalltalk
"Exporting to Tonel"
TonelWriter new
addLatestConfigurationMapNamed: 'My Tonel Demo';
addLatestConfigurationMapNamed: 'My Tonel Demo Tests';
addApplicationsFromConfigurationMaps;
writeProjectInto: (CfsPath named: 'my-tonel-demos').
```
```smalltalk
"Loading from Tonel"
(TonelLoader readFromPath: (CfsPath named: 'my-tonel-demos')) loadAllMapsWithRequiredMaps.
```
#### More options
You can specify other options like versioning, prerequisite resolution, and others using the different strategies for each case, read the [strategies documentation](docs/strategies.md) to learn more about them.
## VAST Specific features
Since Tonel wasn't designed with VAST use in mind, some features are not supported by the spec and we needed to extend it to support them.
You can read [document of VAST specific features](docs/vastspecific.md) to know more about them.
## Compatibility Recommendations
If you want to make your code fully compatible and interoperable with other Smalltalk dialects there is a specific document with the [recommendations for compatibility](docs/compatibility.md).
## Shared Pools
VAST's way of declaring and/or initializing Shared Pools is different from other Smalltalk dialects, and to explain how this work with Tonel, there is a specific document explaining [how VAST Tonel handles shared pools](docs/sharedpools.md).
## Versioning and prerequisites
Read the [versioning, prerequisites and base editions strategies documentation](docs/strategies.md) to learn how to configure the loader to work interactively, unattended, read the version from a git repository, etc.
## Configuration Maps
Although dependency management is outside of the sco