diff --git a/CHANGELOG.md b/CHANGELOG.md index b8ec0f79..b8ba4dda 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Change Log +## 0.9.0 + +- Added support for Heta standard v0.4.5. +- Fixed minor parser bugs. +- **SimbioExport**: Introduced the `ausAsNotes` option and added `aux` as UserData. +- **Component**: Added `xmlAnnotation` property for SBML Annotation. +- Fixed issues with `HetaCodeExport` related to the `aux` property. +- **API**: Made `Component` a subclass of `Top`. +- Enhanced error messages for JSON schema validation. +- **Builder API**: Now supports both backend and frontend. +- All file paths are now relative. +- Moved export statements to `platform.yml`. +- Replaced `platform.json` with `platform.yml`. +- **CLI**: Removed `--skip-export` and `--julia-only`, added the new `--export` option. + ## 0.8.7 - check and warn context without Switchers diff --git a/TODO.md b/TODO.md index 78360aa8..cc0f4652 100644 --- a/TODO.md +++ b/TODO.md @@ -42,6 +42,7 @@ ## ideas +- allow to use const expressions in `TimeSwitcher.start` and `TimeSwitcher.end` - support SBML's delay - AnyUnit for zero numbers - updating properties with `one::s1.assignments.start_ 5.5;` diff --git a/migrate-to-v0.9.md b/migrate-to-v0.9.md index fc4ee992..a3941bd6 100644 --- a/migrate-to-v0.9.md +++ b/migrate-to-v0.9.md @@ -1,90 +1,93 @@ -# Migrate from v0.8 to v0.9 -Heta compiler of **version 0.9** follows the [Heta standard](https://hetalang.github.io/#/specifications/) of **version 0.5.0**. +# Migration from v0.8 to v0.9 -To use the newer Heta compiler you should make some updates to the platform files. To see the other updates see [change log](./CHANGELOG). +The v0.9 release of Heta includes improvements in export flexibility, support for new formats, and better tooling for the declaration files. -See also [Migrate to v0.6](./migrate-to-v0.6), [Migrate to v0.7](./migrate-to-v0.7), [Migrate to v0.8](./migrate-to-v0.8). +The **v0.9** version of the Heta compiler adheres to the [Heta standard](https://hetalang.github.io/#/specifications/) **v0.5.0**. -## Changes in declaration (platform.json) file +To use the latest Heta compiler, you will need to update some platform files. For other updates, refer to the [changelog](./CHANGELOG). -The new version uses YAML format (instead of JSON) for declaration file. The new format is more flexible and allows to use comments and multiline strings. +You may also want to check the previous migration guides: [Migrate to v0.6](./migrate-to-v0.6), [Migrate to v0.7](./migrate-to-v0.7), and [Migrate to v0.8](./migrate-to-v0.8). -Users can use JSON format for declaration file without restrictions but default YAML files will be generated with `heta init`. +## Changes to the Declaration (platform.json) File -## Replacement of inline #export actions by export array in declaration +The new version uses the YAML format (instead of JSON) for the declaration file. YAML is more flexible, supporting comments and multiline strings. -The new version uses `export` array in declaration file to define the list of actions which should be exported. +You can still use JSON format for declaration files without restrictions, but YAML files will now be generated by default when using `heta init`. -Another option is to use `--export` property in CLI command. See details in [CLI documentation](./cli-references.md). +## Replacement of Inline `#export` Actions with an `export` Array in Declarations -The old inline export syntax will be supported in the current version (as depricated) but it will be removed in the future. +In this version, the `export` array is used in the declaration file to specify the list of actions to be exported. -## Update platforms to support new features +Alternatively, you can use the `--export` option in CLI commands. For more details, refer to the [CLI documentation](./cli-references.md). -1. **Check** that your platform can be build without errors in the current builder v0.8.x. +The old inline export syntax will be deprecated but supported in the current version. However, it will be removed in future versions. - *If you use Git you should commit the latest changes before updating formats.* +## Updating Platforms to Support New Features -1. Install the latest version of **Heta compiler**. +1. **Ensure** your platform builds without errors using the current v0.8.x builder. - ```bash - npm install -g heta-compiler - heta -v - # must be v0.9.0 or newer - ``` + *If you're using Git, it is recommended to commit the latest changes before updating the formats.* -1. If you use declaration file **platform.json** update the property to `builderVersion: ^0.9.0` and change file name to **platform.yml** (optional). +2. Install the latest version of the **Heta compiler**: - ```yml - # in platform.yml - { - "builderVersion": "^0.9.0", - "id": "my-platform", - "notes": "platform notes", - "version": "v0.1.0", - ... - } - ``` + ```bash + npm install -g heta-compiler + heta -v + # should return v0.9.0 or newer + ``` -1. Remove unnecessary properties from the declaration file if you used them before: +3. If you're using the **platform.json** declaration file, update the `builderVersion` property to `^0.9.0`, and optionally rename the file to **platform.yml**. + + ```yml + # in platform.yml + { + "builderVersion": "^0.9.0", + "id": "my-platform", + "notes": "platform notes", + "version": "v0.1.0", + ... + } + ``` + +4. Remove any unnecessary properties from the declaration file if you had used them previously: - - `options.skipExport`: use `export: []` instead - - `options.juliaOnly`: use `export: [{format: Julia}]` instead - -1. If you used command line options to supress export with `heta build --no-export` then you should use now `heta build --export ''`. - -If you used line options to build julia code only with `heta build --julia-only` then you should use now `heta build --export 'Julia'`. - -1. Remove all inline `#export` actions from the .heta files and add them to the `export` array in the declaration file. - -See details in [export formats](./export-formats.md) - - **Before** - ```hetas - // in index.heta - #export {format: DBSolve, filepath: model, powTransform: function}; - #export {format: SBML, version: L3V2}; - ``` - - **After** - ```yaml - # in platform.yml - ... - export: [ - {format: DBSolve, filepath: model, powTransform: function}, - {format: SBML, version: L3V2} - ] - ``` - - **Or After** - ```json - # in platform.json - ... - "export": [ - {"format": "DBSolve", "filepath": "model", "powTransform": "function"}, - {"format": "SBML", "version": "L3V2"} - ] - ``` - -1. Check building with `heta build` and make a commit if you use git. + - `options.skipExport`: replace with `export: []` + - `options.juliaOnly`: replace with `export: [{format: Julia}]` + +5. If you were using command line options to suppress export with `heta build --no-export`, now use `heta build --export ''`. + + If you previously used `heta build --julia-only` to build only Julia code, now use `heta build --export 'Julia'`. + +6. Remove all inline `#export` actions from your `.heta` files and move them to the `export` array in the declaration file. + + Refer to [export formats](./export-formats.md) for more details. + + **Before:** + ```heta + // in index.heta + #export {format: DBSolve, filepath: model, powTransform: function}; + #export {format: SBML, version: L3V2}; + ``` + + **After (YAML format):** + ```yaml + # in platform.yml + ... + export: [ + {format: DBSolve, filepath: model, powTransform: function}, + {format: SBML, version: L3V2} + ] + ``` + + **Or After (JSON format):** + ```json + # in platform.json + ... + "export": [ + {"format": "DBSolve", "filepath": "model", "powTransform": "function"}, + {"format": "SBML", "version": "L3V2"} + ] + ``` + +7. Test the build with `heta build`, and if you're using Git, make a commit. diff --git a/package-lock.json b/package-lock.json index 4ab5f691..17e4fd46 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "heta-compiler", - "version": "0.8.7", + "version": "0.9.0", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 160a739f..592cce2c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "heta-compiler", - "version": "0.8.7", + "version": "0.9.0", "description": "Programming platform for Quantitative Systems Pharmacology modeling in NodeJS", "main": "src/index.js", "scripts": {