Skip to content

jasp-stats-modules/modules-app

Repository files navigation

Welcome to JASP stats modules web app!

License Checked with Biome Deploy to GitHub Pages Code quality Tests FAIR checklist badge Research Software Directory Badge DOI Test coverage (unit) Test coverage (browser)

Usage

A web application hosted at https://module-library.jasp-stats.org/ that allows you to search/filter all the available JASP modules and install them.

Screenshot of the app

The web application is designed to be opened from inside JASP desktop application, but it can also be used as a standalone web application.

The JASP desktop application tells the web application which version/architecture it is and which modules are installed by using a Qt WebChannel.

Search parameters

In a standalone web application you can tell the web application which version/architecture it is and which modules are installed by using search parameters (?key=val) in the URL.

  • v: the version of the JASP desktop application for example 0.95.0-release.0
  • a: the architecture of the JASP desktop application for example Windows_x86-64
  • i: installed modules. A JSON object with the module id (repository name) as keys and their versions as values. The object has to be URL encoded. For example, {"jaspEquivalenceTTests":"0.95.0-release.0","jaspTTests":"0.94.0-release.0"} becomes %7B%22EjaspEquivalenceTTests%22%3A%220.95.0-release.0%22%2C%22T-Tests%22%3A%220.94.0-release.0%22%7D.
  • u: List of modules that can be uninstalled. As a JSON array, it has to be URL encoded. For example, ["jaspTTests","jaspRegression"] becomes %5B%22jaspTTests%22%2C%22jaspRegression%22%5D.
  • p: show pre-releases initially. Use true to show pre-releases and use false to hide them initially.
  • c: URL for the list of modules aka index.json. When not set uses index.json (public/index.json in local development or on deployed site uses https://jasp-stats-modules.github.io/modules-app/index.json). If URL is not a relative path aka other server then make sure correct CORS headers are returned on server that hosts index.json.
  • t: Theme. Use dark for dark theme, light for light theme, and system to match system theme (default).
  • l: Language. Use en for English (default). For example use nl for Dutch.
  • f: Font name. Use the name of a font installed on your system. For example use SansSerif. Besides OS fonts also FreeSans, Fira Code and Fira Code Retina fonts are available.
  • s: Search term to filter modules. For example ?s=test will show modules that mention "test" in their name, description, maintainer or id. See info panel in app for more search term examples.

A full URL could look like https://jasp-stats-modules.github.io/modules-app/?a=Windows_x86-64&v=0.95.0-release.0&i=%5B%22jaspTTests%22%2C%22jaspRegression%22%5D&p=0.

Update list of modules

The list of modules that the web application knows about can be updated by running the GitHub workflow at https://github.com/jasp-stats-modules/modules-app/actions/workflows/deploy.yml . Use the "Run workflow" button to trigger the workflow manually.

How it works

To get a list of available JASP modules, it does the following with the help of the src/scrape.ts script:

  1. Fetches the git submodules of HEAD of main branch of the https://github.com/jasp-stats-modules/modules-registry repository.
    • the directory in which a submodule is located is called the channel
    • to see translations of channel names, ensure there is a corresponding entry in src/App.content.tsx
  2. For each submodule parses
    1. the English title and description from inst/Description.qml file
    2. translations of title and description from po/QML-<lang>.po files, where <lang> is the language code (for example, nl for Dutch)
    3. homepage URL from the Website field in DESCRIPTION file; if missing/invalid or pointing to jasp-stats.org, it falls back to the GitHub parent repository URL (or submodule repository URL if parent is unavailable)
    4. icon from the icon field in inst/Description.qml, resolved from inst/icons; icons are optimized and then embedded as data URLs
  3. For each submodule fetches its releases
    1. Fetches data for the latest 20 releases, for each repository using GitHub GraphQL API
    2. Filter the first 20 release assets per release ending with .JASPModule extension
    3. Looks in release description for the JASP version range the module is compatible with. The version range is specified in front matter header as for example:
      ---
      jasp: '>=0.95.0-release.0'
      ---
    4. Split releases into latest release for each JASP version range and latest pre release.
    5. If the latest release does not have assets for all platforms it tries to find an older release with the missing assets.
    6. If no releases are found in first 20 releases with all assets, then it pages to next page of releases and repeats the process until a covering release is found or there are no more releases.
  4. Saves data in public/index.json for the web application to use

If you want to scrape modules from an additional branch (e.g., beta) you can trigger the deploy workflow manually and specify the branch and output catalog file path. You can then view that catalog with https://module-library.jasp-stats.org/?c=<catalog path without public/>.

Getting Started

To run this application locally, follow these steps:

# Install dependencies
pnpm install
export GITHUB_TOKEN=<your personal fine grained access token, only access to public repositories is needed and no other permissions>
# Scrape a list of JASP module and their release assets from HEAD of main branch of https://github.com/jasp-stats-modules/modules-registry/ and save as public/index.json
pnpm scrape
# Optionally: To scrape modules HEAD of beta branch to beta.json
# pnpm run scrape beta public/beta.json
# Start the development server
pnpm start  

Application will be running at http://localhost:3000 (unless stated otherwise).

Contributing

Contributions are welcome! Please read the contributing guidelines for more information and developer instructions.

About

A web application that allows you to search/filter all the available JASP modules and install them.

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Contributors