Skip to content

Commit

Permalink
Feature: v3.0.0 (#1233)
Browse files Browse the repository at this point in the history
  • Loading branch information
emmercm authored Aug 30, 2024
2 parents fcf0793 + 7c15428 commit 79093af
Show file tree
Hide file tree
Showing 205 changed files with 6,177 additions and 3,075 deletions.
4 changes: 2 additions & 2 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"contexts": [
"ClassDeclaration",
// TODO(cemmer): require private methods as well
"MethodDefinition[accessibility!=private][key.name!=/^(get|set)[A-Z][a-zA-Z]+/]"
"MethodDefinition[accessibility!=private][key.name!=/^(get|set|with)[A-Z][a-zA-Z]+/]"
]
}],
"jsdoc/require-param": "off",
Expand Down Expand Up @@ -111,7 +111,7 @@
// TypeScript doesn't do a good job of reporting indexed values as potentially undefined, such as `[1,2,3][999]`
"unicorn/prefer-at": "error",
// Try to enforce early terminations of loops, rather than statements such as `.find(x=>x)[0]`
"unicorn/prefer-array-find": "error",
"unicorn/prefer-array-find": ["error", {"checkFromLast": false}],
"unicorn/prefer-array-flat": "error",
"unicorn/prefer-array-flat-map": "error",
"unicorn/prefer-includes": "error",
Expand Down
6 changes: 3 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Stop `core.autocrlf true`
*.lnx binary
*.nes binary
*.rom binary
test/fixtures/roms/** binary
*.cue text eol=lf
*.gdi text eol=crlf
24 changes: 12 additions & 12 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Welcome! If you're viewing this, it means that you are likely interested in contributing to the project. That's marvelous!

The following is a set of guidelines for contributing to `igir`. These guidelines are published in order to clarify expectations and reduce potential conflict of opinions.
The following is a set of guidelines for contributing to Igir. These guidelines are published in order to clarify expectations and reduce potential conflict of opinions.

## Feature requests & bug reports

Expand All @@ -16,7 +16,7 @@ If you are experiencing an issues, please submit a detailed [bug report](https:/

[GitHub discussions](https://github.com/emmercm/igir/discussions) are a great tool for a number of topics:

- Getting help with `igir` CLI syntax or usage
- Getting help with Igir CLI syntax or usage
- Clarifying support for specific features or scenarios
- Brainstorming new feature requests
- ...and more!
Expand All @@ -27,13 +27,13 @@ Discussions are intended to be low-pressure spaces for questions and collaborati

### Environment setup

First, you will want to check out `igir`'s source code from GitHub:
First, you will want to check out Igir's source code from GitHub:

```shell
git clone https://github.com/emmercm/igir.git
```

`igir` is written in TypeScript for the Node.js runtime. The current version of Node.js that `igir` uses is defined under the `"volta"` object in the `package.json` file. After [installing](https://docs.volta.sh/guide/getting-started), Volta will make sure you're always using the correct Node.js version.
Igir is written in TypeScript for the Node.js runtime. The current version of Node.js that Igir uses is defined under the `"volta"` object in the `package.json` file. After [installing](https://docs.volta.sh/guide/getting-started), Volta will make sure you're always using the correct Node.js version.

Third-party dependencies are managed and easily installed with npm:

Expand All @@ -51,7 +51,7 @@ npm pack

### Running code

A script has been defined for the `npm start` command to easily run `igir`:
A script has been defined for the `npm start` command to easily run Igir:

```shell
npm start -- [commands..] [options]
Expand All @@ -65,33 +65,33 @@ npm start -- report --dat *.dat --input ROMs/

### Code style

`igir` uses [ESLint](https://eslint.org/) as its linter and style enforcer. Rules have been specifically chosen to increase code consistency, safety, readability, and maintainability.
Igir uses [ESLint](https://eslint.org/) as its linter and style enforcer. Rules have been specifically chosen to increase code consistency, safety, readability, and maintainability.

All code changes must pass the existing ESLint rules. Discussions on adding, removing, and changing ESLint rules should happen outside of pull requests that contain code changes, in their own dedicated pull request or discussion thread (above).

### Automated tests

`igir` uses [Jest](https://jestjs.io/) as its testing framework, and it uses [Codecov](https://about.codecov.io/) to ensure a minimum amount of test coverage.
Igir uses [Jest](https://jestjs.io/) as its testing framework, and it uses [Codecov](https://about.codecov.io/) to ensure a minimum amount of test coverage.

All code changes must come with appropriate automated tests in order to prove correctness and to protect against future regressions.

### Docs

`igir` uses [MkDocs](https://www.mkdocs.org/) to turn Markdown files into a documentation website.
Igir uses [MkDocs](https://www.mkdocs.org/) to turn Markdown files into a documentation website.

Appropriate updates must be made to all relevant documentation pages if functionality is added, removed, or changed.

### Git commit messages

`igir` is configured to squash-merge all pull requests, such that only the pull request title ends up in the commit history of the main branch. This means that individual commit messages are less important, and it puts more emphasis on quality pull request titles & descriptions.
Igir is configured to squash-merge all pull requests, such that only the pull request title ends up in the commit history of the main branch. This means that individual commit messages are less important, and it puts more emphasis on quality pull request titles & descriptions.

That said, quality commit messages help future maintainers understand past intentions. Please use your best judgement on descriptive, clear, and concise commit messages.

### Pull request checklist

Here are steps that should be completed prior to submitting a pull request:

- [ ] Validate your change works as expected locally by running `igir` (not just the unit tests)
- [ ] Validate your change works as expected locally by running Igir (not just the unit tests)
- [ ] Unit tests have been added to cover your change
- [ ] `npm test` has been run locally for your change, to validate:
- Your added & changed tests are passing
Expand All @@ -113,8 +113,8 @@ To contribute code changes, you will need to:

## License

`igir` is licensed under [GNU General Public License v3.0](https://github.com/emmercm/igir/blob/main/LICENSE).
Igir is licensed under [GNU General Public License v3.0](https://github.com/emmercm/igir/blob/main/LICENSE).

✅ That means that `igir` can be used for free commercially, can be modified, can be distributed, and can be used for private use.
✅ That means that Igir can be used for free commercially, can be modified, can be distributed, and can be used for private use.

⚠️ But it also means that distribution of closed-source versions is _not_ allowed.
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ body:
attributes:
label: Paste the command
description: |
The exact `igir` command you ran when you experienced a bug.
The exact Igir command you ran when you experienced a bug.
Include the full `node`, `npm`, or `npx` command when not running the standalone `igir` executable.
validations:
Expand Down Expand Up @@ -53,12 +53,12 @@ body:
attributes:
label: DAT(s) used
description: |
Links to the DATs that were used for this `igir` command, if any.
Links to the DATs that were used for this Igir command, if any.
- type: input
attributes:
label: igir version
description: What version of `igir` are you running? This is visible in the output header.
description: What version of Igir are you running? This is visible in the output header.
validations:
required: true

Expand All @@ -68,7 +68,7 @@ body:
description: |
What version of Node.js are you running? This can be seen with the `node --version` command.
You can specify "N/A" when using a standalone version of `igir` (one downloaded from GitHub).
You can specify "N/A" when using a standalone version of Igir (one downloaded from GitHub).
validations:
required: true

Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ jobs:
- uses: actions/checkout@v4
- uses: volta-cli/action@v4
- run: npm ci
- run: |
sudo apt-get update
sudo apt-get install -y libsdl2-2.0-0 libsdl2-ttf-2.0-0
# Run test coverage
- run: npm run test:coverage
Expand Down
4 changes: 3 additions & 1 deletion .github/workflows/gh-automerge-rebase.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ on:
push:
branches:
- 'main'
- '*feature*'
- '**/*feature*'
schedule:
# Every hour
- cron: '0 * * * *'
Expand All @@ -26,7 +28,7 @@ jobs:
with:
# GitHub won't run workflows off of code commits+pushes from the `github-actions` user
token: ${{ secrets.PERSONAL_ACCESS_TOKEN }}
base: 'main'
base: ${{ github.head_ref || github.ref_name || 'main' }}
required_approval_count: 0
require_passed_checks: false
# Oldest pull request
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gh-first-interaction.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
pr-message: |
## :wave: Welcome
Thank you for your first pull request, @${{ github.event.pull_request.head.user.login }}! If you haven't yet, please familiarize yourself with `igir`'s [contribution guidelines](https://github.com/emmercm/igir/blob/main/.github/CONTRIBUTING.md).
Thank you for your first pull request, @${{ github.event.pull_request.head.user.login }}! If you haven't yet, please familiarize yourself with Igir's [contribution guidelines](https://github.com/emmercm/igir/blob/main/.github/CONTRIBUTING.md).
Some GitHub Actions CI workflows may not automatically run for you due to GitHub's [security best practices](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#controlling-changes-from-forks-to-workflows-in-public-repositories), so a maintainer may need to manually approve the workflows to run. As a result, it is important to make sure tests pass locally before submitting a pull request to help ensure a fast review. Thank you!
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: docker run --rm --volume "${PWD}:/workdir" ghcr.io/igorshubovych/markdownlint-cli:latest --disable MD013 MD033 MD046 -- "**/*.md"
- run: docker run --rm --volume "${PWD}:/workdir" ghcr.io/igorshubovych/markdownlint-cli:latest --disable MD013 MD033 MD041 MD046 -- "**/*.md"

build:
needs:
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/node-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ jobs:
- path-filter
if: ${{ needs.path-filter.outputs.changes == 'true' }}
runs-on: ${{ matrix.os }}-latest
timeout-minutes: 10
strategy:
matrix:
os: [ ubuntu, macos, windows ]
Expand All @@ -82,6 +83,13 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- if: ${{ matrix.os == 'macos' }}
run: brew install --overwrite sdl2
- if: ${{ matrix.os == 'ubuntu' }}
run: |
sudo apt-get update
sudo apt-get install -y libsdl2-2.0-0 libsdl2-ttf-2.0-0
# Test the source files
- run: npm run test:unit

Expand All @@ -90,6 +98,7 @@ jobs:
- path-filter
if: ${{ needs.path-filter.outputs.changes == 'true' }}
runs-on: ubuntu-latest
timeout-minutes: 10
strategy:
matrix:
node-version: [ lts, 18, 16.7.0 ]
Expand All @@ -102,6 +111,9 @@ jobs:
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: |
sudo apt-get update
sudo apt-get install -y libsdl2-2.0-0 libsdl2-ttf-2.0-0
# Test the built files
- run: npm run build
- run: ./test/endToEndTest.sh
Expand Down
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ dist
dist/
site/
*.bat
*.cache
*.cache*
*.sh
!test/*.sh

Expand All @@ -122,16 +122,21 @@ site/
*.bin
*.cd1
*.cd2
*.chd
*.col
*.cso
*.cue
*.dax
*.dvd
*.gb
*.gba
*.gbc
*.gcz
*.gdi
*.gg
*.ic1
*.img
*.iso
*.jar
*.lo
*.lyx
Expand All @@ -142,17 +147,21 @@ site/
*.pce
*.pk3
*.pup
*.raw
*.rom
*.rvz
*.sfc
*.smc
*.sms
*.szx
*.wad
*.wia
*.x1
*.x1t
*.zim
*.z64
*.zip
*.zso

# ROM pack excess
*.bmp
Expand Down
25 changes: 14 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,47 @@
<h1 align="center">🕹️ igir</h1>
<div align="center">
<img src="static/logo-dark.svg" height="200px" width="auto" alt="igir logo">
</div>
<br>

<p align="center"><b>Pronounced "eager," <code>igir</code> is a video game ROM collection manager to help filter, sort, patch, archive, and report on collections on any OS.</b></p>
<p align="center"><b>Pronounced "eager," Igir is a zero-setup ROM collection manager that sorts, filters, extracts or archives, patches, and reports on collections of any size on any OS.</b></p>

<p align="center">
<a href="https://igir.io/"><img alt="CLI: Windows,macOS,Linux" src="https://img.shields.io/badge/CLI-Windows%2C%20macOS%2C%20Linux-lightgrey?logo=windows-terminal"></a>
<a href="https://www.npmjs.com/package/igir"><img alt="npm: version" src="https://img.shields.io/npm/v/igir?color=%23cc3534&label=version&logo=npm&logoColor=white"></a>
<a href="https://www.npmjs.com/package/igir"><img alt="npm: downloads" src="https://img.shields.io/npm/dt/igir?color=%23cc3534&logo=npm&logoColor=white"></a>
<a href="https://github.com/emmercm/igir/releases"><img alt="GitHub: downloads" src="https://img.shields.io/github/downloads/emmercm/igir/total?color=%236e5494&logo=github&logoColor=white"></a>
<a href="https://github.com/emmercm/igir"><img alt="GitHub: stars" src="https://img.shields.io/github/stars/emmercm/igir?style=flat&logo=github&logoColor=white&color=%236e5494"></a>
<a href="https://github.com/emmercm/igir/discussions"><img alt="GitHub: discussions" src="https://img.shields.io/github/discussions/emmercm/igir?logo=github&logoColor=white"></a>
</p>
<p align="center">
<a href="https://snyk.io/test/npm/igir"><img alt="Snyk: vulnerabilities" src="https://snyk.io/test/npm/igir/badge.svg"></a>
<a href="https://codecov.io/gh/emmercm/igir"><img alt="codecov: coverage" src="https://img.shields.io/codecov/c/github/emmercm/igir?logo=codecov&logoColor=white"></a>
<a href="https://codeclimate.com/github/emmercm/igir/maintainability"><img alt="Code Climate: maintainability" src="https://img.shields.io/codeclimate/maintainability-percentage/emmercm/igir?logo=codeclimate&logoColor=white"></a>
<a href="https://github.com/emmercm/igir/blob/main/LICENSE"><img alt="license" src="https://img.shields.io/github/license/emmercm/igir?color=blue"></a>
<a href="https://github.com/emmercm/igir/blob/main/LICENSE"><img alt="license" src="https://img.shields.io/github/license/emmercm/igir?logo=data%3Aimage%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCA2NDAgNTEyIj48IS0tIUZvbnQgQXdlc29tZSBGcmVlIDYuNS4yIGJ5IEBmb250YXdlc29tZSAtIGh0dHBzOi8vZm9udGF3ZXNvbWUuY29tIExpY2Vuc2UgLSBodHRwczovL2ZvbnRhd2Vzb21lLmNvbS9saWNlbnNlL2ZyZWUgQ29weXJpZ2h0IDIwMjQgRm9udGljb25zLCBJbmMuLS0%2BPHBhdGggZD0iTTM4NCAzMkg1MTJjMTcuNyAwIDMyIDE0LjMgMzIgMzJzLTE0LjMgMzItMzIgMzJIMzk4LjRjLTUuMiAyNS44LTIyLjkgNDcuMS00Ni40IDU3LjNWNDQ4SDUxMmMxNy43IDAgMzIgMTQuMyAzMiAzMnMtMTQuMyAzMi0zMiAzMkgzMjAgMTI4Yy0xNy43IDAtMzItMTQuMy0zMi0zMnMxNC4zLTMyIDMyLTMySDI4OFYxNTMuM2MtMjMuNS0xMC4zLTQxLjItMzEuNi00Ni40LTU3LjNIMTI4Yy0xNy43IDAtMzItMTQuMy0zMi0zMnMxNC4zLTMyIDMyLTMySDI1NmMxNC42LTE5LjQgMzcuOC0zMiA2NC0zMnM0OS40IDEyLjYgNjQgMzJ6bTU1LjYgMjg4SDU4NC40TDUxMiAxOTUuOCA0MzkuNiAzMjB6TTUxMiA0MTZjLTYyLjkgMC0xMTUuMi0zNC0xMjYtNzguOWMtMi42LTExIDEtMjIuMyA2LjctMzIuMWw5NS4yLTE2My4yYzUtOC42IDE0LjItMTMuOCAyNC4xLTEzLjhzMTkuMSA1LjMgMjQuMSAxMy44bDk1LjIgMTYzLjJjNS43IDkuOCA5LjMgMjEuMSA2LjcgMzIuMUM2MjcuMiAzODIgNTc0LjkgNDE2IDUxMiA0MTZ6TTEyNi44IDE5NS44TDU0LjQgMzIwSDE5OS4zTDEyNi44IDE5NS44ek0uOSAzMzcuMWMtMi42LTExIDEtMjIuMyA2LjctMzIuMWw5NS4yLTE2My4yYzUtOC42IDE0LjItMTMuOCAyNC4xLTEzLjhzMTkuMSA1LjMgMjQuMSAxMy44bDk1LjIgMTYzLjJjNS43IDkuOCA5LjMgMjEuMSA2LjcgMzIuMUMyNDIgMzgyIDE4OS43IDQxNiAxMjYuOCA0MTZTMTEuNyAzODIgLjkgMzM3LjF6IiBzdHlsZT0iZmlsbDojZmZmZmZmIiAvPjwvc3ZnPg%3D%3D&color=blue"></a>
</p>

<p align="center"><i>See the <a href="https://igir.io/">project website</a> for complete documentation, installation & usage instructions, and examples!</i></p>

<br>

## What does `igir` do?
## What does Igir do?

A video of an example use case:

[![asciicast](https://asciinema.org/a/Sum1WBdZRsSTvbZvVuP5Ho1N9.svg)](https://asciinema.org/a/Sum1WBdZRsSTvbZvVuP5Ho1N9)
<a href="https://asciinema.org/a/bZHvtbqyQlRfkHIuZXxmtDbiU" target="_blank"><img src="https://asciinema.org/a/bZHvtbqyQlRfkHIuZXxmtDbiU.svg" alt="asciicast" style="width:100%" /></a>

With `igir` you can manage a ROM collection of any size:
With Igir you can manage a ROM collection of any size:

- 🔍 Scan for DATs, ROMs, and ROM patches - including those in archives (see [scanning](https://igir.io/input/file-scanning) & [archive docs](https://igir.io/input/reading-archives))
- 🔍 Scan for DATs, ROMs, and ROM patchesincluding those in archives (see [scanning](https://igir.io/input/file-scanning) & [archive docs](https://igir.io/input/reading-archives))
- 📂 Organize ROM files by console (see [DAT docs](https://igir.io/dats/overview))
- 🪄 Name ROM files consistently, including the right extension (see [DAT docs](https://igir.io/dats/overview))
- ✂️ Filter out duplicate ROMs, or ROMs in languages you don't understand (see [filtering docs](https://igir.io/roms/filtering-preferences))
- 🗜️ Extract or archive ROMs in mass (see [archive docs](https://igir.io/output/writing-archives))
- 🩹 Patch ROMs automatically in mass (see [scanning](https://igir.io/input/file-scanning) & [patching docs](https://igir.io/roms/patching))
- 🎩 Parse ROMs with headers, and optionally remove them (see [header docs](https://igir.io/roms/headers))
- 🎩 Parse ROMs with headers and optionally remove them (see [header docs](https://igir.io/roms/headers))
- ↔️ Build & re-build (un-merge, split, or merge) MAME ROM sets (see [arcade docs](https://igir.io/usage/arcade))
- 🔮 Report on what ROMs are present or missing for each console, and create fixdats for missing ROMs (see [reporting](https://igir.io/output/reporting) & [DAT docs](https://igir.io/dats/overview))
- 🔮 Report on what ROMs are present or missing for each console and create fixdats for missing ROMs (see [reporting](https://igir.io/output/reporting) & [DAT docs](https://igir.io/dats/overview))

## How do I run `igir`?
## How do I run Igir?

Either download the latest version for your OS from the [releases page](https://github.com/emmercm/igir/releases/latest), or if you have Node.js installed you can use [`npx`](https://docs.npmjs.com/cli/v9/commands/npx) to always run the latest version from the command line:

Expand Down
2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@ coverage:
patch: off
project:
default:
target: 94%
target: 93%
threshold: 1%
6 changes: 3 additions & 3 deletions docs/advanced/internals.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Internal Operations

Information about the inner workings of `igir`.
Information about the inner workings of Igir.

## Order of operations

`igir` runs these steps in the following order:
Igir runs these steps in the following order:

1. Scan each DAT input path for every file and parse them, if provided (`--dat <path>`)
2. Scan each ROM input path for every file (`--input <path>`)
Expand All @@ -24,6 +24,6 @@ Information about the inner workings of `igir`.
- Written ROMs are tested for accuracy, if specified (`test`)
- A "dir2dat" DAT is created, if specified (`dir2dat`) (see [dir2dat docs](../dats/dir2dat.md))
- A "fixdat" is created, if specified (`fixdat`) (see [fixdats docs](../dats/fixdats.md))
5. "Moved" input ROMs are deleted (`move`)
5. Leftover "moved" input ROMs are deleted (`move`)
6. Unknown files are recycled from the output directory, if specified (`clean`, see [cleaning docs](../output/cleaning.md))
7. An output report is written to the output directory, if specified (`report`, see [reporting docs](../output/reporting.md))
Loading

0 comments on commit 79093af

Please sign in to comment.