Skip to content

Latest commit

 

History

History
135 lines (90 loc) · 2.41 KB

DEVELOPMENT.md

File metadata and controls

135 lines (90 loc) · 2.41 KB

Prerequisites

  • Rust 1.77 (or newer)
  • NodeJS 20 (or newer) with pnpm 9 (or newer)
  • Ruby 3.3 (or newer)

You should be able to install these however you want. If you are looking for suggestions applicable to macOS...

Building

CSS and JS assets are bundled with the release binary in order to create the crate list HTML page. These assets are not normally checked into the repository and need to be built by the developer:

% cargo xtask assets --watch

Once this is running in one window, a normal build via Cargo will suffice:

% cargo build

Tests

Unit

This ensures internal invariants of the registry. It drives Margo as a library.

These tests are written in Rust and live in the margo binary. To run them:

% cargo test

Registry conformance

This ensures that the files created by Margo function as a valid Cargo registry. It drives Margo and Cargo as command line tools, much like a user would.

These tests are written in Rust and live in the conformance directory. To run them:

% cd conformance
% cargo run

UI

This ensures that the HTML output generated by Margo is usable and useful. It drives Margo and Cargo as command line tools, much like a user would.

These tests are written in Ruby and live in the integration-tests directory.

% cd integration-tests
% bundle exec rspec

Linting / Formatting

A number of tools are checked in CI.

Rust

% cargo fmt
% cargo clippy

TypeScript

% pnpm check

Ruby

% cd integration-tests
% bundle exec rubocop

CSS / Markdown / YAML

% pnpm fmt

Releasing

While assets are not usually checked in to the repository, they are temporarily checked in during a release so that they are part of the release package and can be tracked in history.

To create the proper sequence of commits and tags, you can prepare a release locally:

cargo xtask prepare-release 0.0.0

The commits and tag must be pushed manually afterwards.