Skip to content

Commit

Permalink
Document how to build the code
Browse files Browse the repository at this point in the history
  • Loading branch information
shepmaster committed May 6, 2024
1 parent 14de1eb commit 1c91700
Showing 1 changed file with 109 additions and 0 deletions.
109 changes: 109 additions & 0 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
# 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...

- Rust via [rustup][]
- NodeJS via [Homebrew][]
- pnpm via [Homebrew][]
- Ruby via [RVM][]

[rustup]: https://rustup.rs
[Homebrew]: https://brew.sh
[RVM]: https://rvm.io

# 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

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

- [Rustfmt][]
- [Clippy][]

```
% cargo fmt
% cargo clippy
```

[Rustfmt]: https://github.com/rust-lang/rustfmt
[Clippy]: https://doc.rust-lang.org/clippy/

## TS / CSS / Markdown / YAML

- [TypeScript][]

```
% pnpm check
```

[TypeScript]: https://www.typescriptlang.org

## Ruby

- [RuboCop][]

```
% cd integration-tests
% bundle exec rubocop
```

[RuboCop]: https://github.com/rubocop/rubocop

## CSS / Markdown / YAML

- [Prettier][]

```
% pnpm fmt
```

[prettier]: https://prettier.io

0 comments on commit 1c91700

Please sign in to comment.