Developer Guide

If you are planning significant changes, open an issue first. The ColPrac guidelines are recommended. For Julia package development basics, see:

One-Time Local Setup

This procedure is required only once. Install Git and Julia on your local machine before starting.

  1. Fork the repository on GitHub.
  2. Clone the forked repository. Replace xxxxxx with your GitHub username.
    git clone https://github.com/xxxxxx/FewBody.jl.git
    cd FewBody.jl
  3. Install development tools: Revise.jl and Runic.jl.
    julia --startup-file=no -e 'import Pkg; Pkg.add("Revise")'
    julia --project=@runic --startup-file=no -e 'using Pkg; Pkg.add("Runic")'

Daily Development Flow

This is the typical workflow for making changes.

  1. Create a branch for your changes. Replace xxx with the issue number (e.g. issue/123).
    cd FewBody.jl
    git switch -c issue/xxx
  2. Start an interactive session with Revise.jl.
    julia --startup-file=no -i -e 'using Revise; import Pkg; Pkg.activate("."); using FewBody'
  3. Change the source code:
    • When making new functions or updating docstrings, refer to Documenter: Adding docstrings.
    • If you need a new dependency, use julia --project=. --startup-file=no -e 'import Pkg; Pkg.add("SomePackage"); Pkg.resolve(); Pkg.instantiate()'. Replace SomePackage with the actual package name.
  4. Format the source code with Runic.jl.
    julia --project=@runic --startup-file=no -e 'using Runic; exit(Runic.main(ARGS))' -- --inplace .
  5. Run the tests. It will take a few minutes.
    julia --project=. --startup-file=no -e 'using Pkg; Pkg.test()'
  6. Build the documentation locally. HTML files (docs/build/*.html) will be generated. Check them with Chrome or any other web browsers.
    julia --project=docs --startup-file=no -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate();'
    julia --project=docs --startup-file=no -e 'include("docs/make.jl")'
  7. Commit and push the changes (after steps 4–6 succeed).
    git add "path/to/changed/file"
    git commit -m "commit message"
    git push origin issue/xxx
  8. Submit a pull request on GitHub.

Versioning and Registering (for Maintainers)

This project follows Semantic Versioning and the ColPrac version increment guidelines. When bumping the version, update:

Keep the version values synchronized, and set the citation date to the release date.

To register this package in the General registry, install Registrator and use it via the GitHub App.