Skip to content

Latest commit

 

History

History
93 lines (64 loc) · 3.42 KB

migrate-to-v0.9.md

File metadata and controls

93 lines (64 loc) · 3.42 KB

Migration from v0.8 to v0.9

The v0.9 release of Heta includes improvements in export flexibility, support for new formats, and better tooling for the declaration files.

The v0.9 version of the Heta compiler adheres to the Heta standard v0.5.0.

To use the latest Heta compiler, you will need to update some platform files. For other updates, refer to the changelog.

You may also want to check the previous migration guides: Migrate to v0.6, Migrate to v0.7, and Migrate to v0.8.

Changes to the Declaration (platform.json) File

The new version uses the YAML format (instead of JSON) for the declaration file. YAML is more flexible, supporting comments and multiline strings.

You can still use JSON format for declaration files without restrictions, but YAML files will now be generated by default when using heta init.

Replacement of Inline #export Actions with an export Array in Declarations

In this version, the export array is used in the declaration file to specify the list of actions to be exported.

Alternatively, you can use the --export option in CLI commands. For more details, refer to the CLI documentation.

The old inline export syntax will be deprecated but supported in the current version. However, it will be removed in future versions.

Updating Platforms to Support New Features

  1. Ensure your platform builds without errors using the current v0.8.x builder.

    If you're using Git, it is recommended to commit the latest changes before updating the formats.

  2. Install the latest version of the Heta compiler:

    npm install -g heta-compiler
    heta -v
    # should return v0.9.0 or newer
  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.

    # 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: 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 for more details.

    Before:

    // in index.heta
    #export {format: DBSolve, filepath: model, powTransform: function};
    #export {format: SBML, version: L3V2};
    

    After (YAML format):

    # in platform.yml
    ...
    export: [
        {format: DBSolve, filepath: model, powTransform: function},
        {format: SBML, version: L3V2}
    ]

    Or After (JSON format):

    # 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.