Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
60ae67a
Foundation and hosted Modrinth, Manifest source model
getBoolean Apr 29, 2026
4c3a5d5
update references to old fields
getBoolean Apr 29, 2026
7b7bc4a
formatting
getBoolean Apr 29, 2026
715d8b5
format
getBoolean Apr 29, 2026
48f7daf
Merge pull request #4 from getBoolean/task/curseforge-foundation
getBoolean Apr 29, 2026
19597ee
Implement curseforge api
getBoolean Apr 30, 2026
0958b3d
Use env variable for default download key, user supplied key for uplo…
getBoolean Apr 30, 2026
7f28555
Add new env vars to docs
getBoolean Apr 30, 2026
68e8fd7
Fix curseforge host env variable not used for interceptor
getBoolean Apr 30, 2026
81d773e
Merge pull request #5 from getBoolean/task/part-3-CurseforgeApiClient
getBoolean Apr 30, 2026
c1dabdd
Reorder files and implement part 4
getBoolean May 3, 2026
d2cd1e9
Complete peer search and preserve offline source locks
Nov 2, 2026
34509db
Complete CurseForge bridge graphs, CLI, and publishing
Nov 2, 2026
54068d6
Merge pull request #6 from getBoolean/task/part-4-CurseForgeBridgeRes…
getBoolean Nov 2, 2026
55b44dd
Protect runtime installation cleanup with its lock (U2)
Nov 2, 2026
74c3a55
Centralize manifest section transformations and include plugins (U1)
Nov 2, 2026
b1192be
Share entry constraint rendering and YAML version edits (U6)
Nov 2, 2026
1f37694
Prepare platform publication plans before uploading (U5)
Nov 2, 2026
3c6106d
Stream pack archives, hashes, and publication uploads (U7)
Nov 2, 2026
39fc1be
Simplify publication selection and hash each archive once
Nov 2, 2026
9caf852
Scope resolution identities and share dependency and metadata indexes…
Nov 2, 2026
ee8f2fe
Keep cold-cache edges on their source host and hide solver keys
Nov 2, 2026
4a4aebb
Reuse dependency labels and index graph identity lookups
Nov 2, 2026
1543823
fix(review): preserve lock aliases and reject ambiguous parents (#1 #2)
Nov 3, 2026
d566b0e
fix(review): isolate override targets and qualify dependency parents
Nov 3, 2026
d0d243b
Merge pull request #7 from getBoolean/refactor/maintainability
getBoolean Nov 3, 2026
f0ca9f6
Handle nullable CurseForge content types and unavailable files
getBoolean Nov 3, 2026
f4fbaca
Bound CurseForge file queries and preserve service errors
getBoolean Nov 3, 2026
ac08847
Require verified cached artifacts when CurseForge omits download URLs
getBoolean Nov 3, 2026
14c29b8
Validate final CurseForge relationships and persist offline metadata
getBoolean Nov 3, 2026
59b7936
Document verified CurseForge recovery and cover the archive workflow
getBoolean Nov 3, 2026
b55ccc6
fix(review): preserve peer recovery and protect metadata sidecars
getBoolean Nov 3, 2026
3b1e0c0
Serialize atomic metadata replacements across concurrent writers
getBoolean Nov 3, 2026
c7526df
Introduce extensible loader identities and trusted capabilities (U6)
getBoolean Nov 3, 2026
05571cc
Preserve concrete loader versions and recover online catalogs (U6)
getBoolean Nov 3, 2026
b64d602
fix(review): enforce loader capabilities and catalog contracts (U6)
getBoolean Nov 3, 2026
468571f
Build physical server distributions and publish parent-linked files (U7)
getBoolean Nov 3, 2026
d019ffe
Simplify server publication validation without changing outcomes (U7)
getBoolean Nov 3, 2026
37fe848
fix(review): protect publication state and private source files (U7)
getBoolean Nov 3, 2026
9a82d1e
Keep the CurseForge read key on its origin and close test gaps
getBoolean Nov 4, 2026
a236947
Apply dart format to files that drifted from the formatter
getBoolean Nov 4, 2026
77ee72a
Run format, analysis, and tests in CI on Linux and Windows
getBoolean Nov 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CI

on:
pull_request:
push:
branches: [main, story/curseforge]
workflow_dispatch:

permissions:
contents: read

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
analyze:
name: Format and analyze
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
with:
sdk: 3.13.4
- run: dart pub get
- name: Check formatting
run: dart format --output=none --set-exit-if-changed .
- name: Analyze
run: dart analyze --fatal-infos

test:
name: Test (${{ matrix.os }})
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest]
steps:
- uses: actions/checkout@v4
- uses: dart-lang/setup-dart@v1
with:
sdk: 3.13.4
- run: dart pub get
# Live-API tests are tagged `network` and excluded by dart_test.yaml.
- name: Test
run: dart test --reporter expanded
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
# Created by `dart pub`
.dart_tool/
/example/build
**/.gitrinth/publications/curseforge/
18 changes: 11 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -259,13 +259,17 @@ metadata fetches at a local fake server.

### Locations & credentials

| Variable | Used by | Purpose |
|-------------------------|---------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `GITRINTH_CACHE` | every command | Override the cache root. Defaults to `<home>/.gitrinth/cache`. |
| `GITRINTH_CONFIG` | every command | Override the user config file path. `--config` wins. |
| `GITRINTH_MODRINTH_URL` | every command | Override the default Modrinth API base URL. Used to point at a self-hosted labrinth instance for the default host. |
| `GITRINTH_TOKEN` | every command | Override the stored Modrinth PAT for the *default* host. Sent bare (no `Bearer` prefix). Other hosts always use the token stored via `gitrinth modrinth token add`. |
| `HOME` / `USERPROFILE` | every command | Resolves the default cache root and user config path. `USERPROFILE` is consulted on Windows; `HOME` everywhere else. |
| Variable | Used by | Purpose |
|-----------------------------------------------|--------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `GITRINTH_CACHE` | every command | Override the cache root. Defaults to `<home>/.gitrinth/cache`. |
| `GITRINTH_CONFIG` | every command | Override the user config file path. `--config` wins. |
| `GITRINTH_MODRINTH_URL` | every command | Override the default Modrinth API base URL. Used to point at a self-hosted labrinth instance for the default host. |
| `GITRINTH_TOKEN` | every command | Override the stored Modrinth PAT for the *default* host. Sent bare (no `Bearer` prefix). Other hosts always use the token stored via `gitrinth modrinth token add`. |
| `GITRINTH_CURSEFORGE_URL` | every command | Override the CurseForge download API base URL. Defaults to `https://api.curseforge.com`. |
| `GITRINTH_CURSEFORGE_TOKEN` | every command | Override the default CurseForge download API key. This is separate from the publish key stored by `gitrinth token add curseforge.com`. |
| `GITRINTH_CURSEFORGE_DEFAULT_API_KEY_B64` | build-time | Base64-encoded default CurseForge download API key embedded into official builds. |
| `GITRINTH_CURSEFORGE_UPLOAD_TOKEN` | `publish` | Override the stored CurseForge publish key. Falls back to the key stored by `gitrinth token add curseforge.com`. |
| `HOME` / `USERPROFILE` | every command | Resolves the default cache root and user config path. `USERPROFILE` is consulted on Windows; `HOME` everywhere else. |

### Java runtime

Expand Down
184 changes: 156 additions & 28 deletions assets/schema/mods.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ required:
- version
- description
- loader
- mc-version
- mc_version

properties:

Expand Down Expand Up @@ -119,12 +119,31 @@ properties:
description: Server-side compatibility.

publish_to:
description: |
URL of the Modrinth-compatible server `gitrinth publish` uploads
to. Omit (or set `null`) to publish to modrinth.com. Set to
`none` to disable publishing.
type: [ string, "null" ]
format: uri
description: Publish targets; omitted/null follows enabled gitrinth platforms.
oneOf:
- type: "null"
- enum: [none, modrinth, curseforge]
- type: array
minItems: 1
uniqueItems: true
items:
enum: [modrinth, curseforge]
- type: object
minProperties: 1
additionalProperties: false
properties:
modrinth:
oneOf:
- type: "null"
- type: string
pattern: '^https?://[^/]+.*$'
- type: object
maxProperties: 0
curseforge:
oneOf:
- type: "null"
- type: object
maxProperties: 0

loader:
type: object
Expand All @@ -151,7 +170,7 @@ properties:
Mod loader the modpack targets, optionally with a version tag
in docker-image style: `<loader>` or `<loader>:<tag>`.

- Loader: one of `forge`, `fabric`, `neoforge`, or `vanilla`.
- Loader: a lowercase registered identity (built-ins include Forge, Fabric, NeoForge, Quilt, and vanilla).
- Tag (optional): `stable` (default — latest stable loader),
`latest` (newest of any stability), or a concrete version
string (e.g. `0.17.3`). Resolved against Modrinth at `get`
Expand All @@ -170,17 +189,14 @@ properties:
server-binary selection.
oneOf:
- type: string
pattern: ^(forge|fabric|neoforge)(:[^:\s][^:]*)?$
pattern: ^(?!vanilla(?::|$))[a-z][a-z0-9_-]*(:[^:\s][^:]*)?$
- const: vanilla
shaders:
description: |
Shader loader. Required when the `shaders` section has
entries; otherwise omit.
enum:
- iris
- optifine
- canvas
- vanilla
type: string
pattern: ^[a-z][a-z0-9_-]*$
plugins:
description: |
Plugin loader. Required when the `plugins:` section has
Expand All @@ -192,9 +208,9 @@ properties:
SpongeVanilla. The resolved variant and concrete version are
stored in `mods.lock`.
type: string
pattern: ^(bukkit|folia|paper|spigot|sponge)(:[^:\s][^:]*)?$
pattern: ^[a-z][a-z0-9_-]*(:[^:\s][^:]*)?$

mc-version:
mc_version:
type: string
description: |
Exact Minecraft version, e.g. "1.21.1". No ranges or wildcards.
Expand All @@ -204,15 +220,45 @@ properties:
compatibility, and server-binary selection alongside `loader`.
pattern: ^[A-Za-z0-9][A-Za-z0-9._+-]*$

tooling:
modrinth_host:
type: [ string, "null" ]
format: uri
description: |
Pack-level default base URL for the Modrinth source kind. When
set, every Modrinth-source entry that does not declare its own
`modrinth_host:` resolves against this URL instead of
`https://api.modrinth.com/v2`.

gitrinth:
type: [ object, "null" ]
description: Tooling version constraints.
description: |
Tooling configuration for gitrinth itself. Holds the semver
constraint on the running gitrinth CLI (`gitrinth.version`) and
the platform default toggles (`gitrinth.modrinth`,
`gitrinth.curseforge`) that decide which sources participate by
default.
additionalProperties: false
properties:
gitrinth:
version:
type: [ string, "null" ]
description: Semver range for the gitrinth CLI (e.g. "^1.0.0", ">=1.0.0 <2.0.0").
minLength: 1
modrinth:
description: |
Whether Modrinth participates by default for entries that do
not restrict their `sources:` set. Defaults to `enabled`.
enum:
- enabled
- disabled
curseforge:
description: |
Whether CurseForge participates by default for entries that
do not restrict their `sources:` set. Defaults to `disabled`.
Explicit `sources: curseforge` or `cf:<slug>` opts an entry
into CurseForge regardless of this toggle.
enum:
- enabled
- disabled

mods:
description: |
Expand Down Expand Up @@ -336,17 +382,21 @@ $defs:
modDependency:
description: |
Mod dependency. Short form: a version constraint (from default
Modrinth). Long form: object with at most one source (`hosted`,
`url`, `path`) and optional `version`.
Modrinth). Long form: object with at most one of `url:` / `path:`
and optional `version`. `modrinth_host:` may co-exist with the
Modrinth source kind (`modrinth:` or no source override) but is
mutually exclusive with `url:` / `path:`.
oneOf:
- $ref: "#/$defs/modVersion"
- $ref: "#/$defs/modSource"

modSource:
type: object
description: |
Long-form mod dependency. At most one of `hosted`, `url`, `path`.
`url` and `path` make the modpack non-publishable to Modrinth.
Long-form mod dependency. At most one of `url`, `path`.
`modrinth_host:` is a host override on the Modrinth source kind
and is mutually exclusive with `url`/`path`. `url` and `path`
make the modpack non-publishable to Modrinth.
additionalProperties: false
properties:
version:
Expand Down Expand Up @@ -378,12 +428,66 @@ $defs:
- required
- optional
- unsupported
accepts-mc:
accepts_mc:
$ref: "#/$defs/acceptsMc"
hosted:
modrinth:
type: string
description: |
Modrinth project slug for this entry, when it differs from
the section-map key. The section-map key is treated as the
local identifier; this field overrides the slug used to
query the Modrinth source.
minLength: 1
curseforge:
type: string
description: |
CurseForge project slug or numeric project ID for this
entry. CurseForge resolution itself ships in a later part
of the bridge — the field is parsed today so manifests
can be authored ahead of resolver support.
minLength: 1
sources:
description: |
Restrict this entry's resolution to a subset of platforms.
Accepts a single platform name or a list of unique platform
names from `{modrinth, curseforge}`. When omitted, the entry
falls back to the `gitrinth.modrinth` / `gitrinth.curseforge`
defaults.
oneOf:
- type: string
enum: [ modrinth, curseforge ]
- type: array
items:
type: string
enum: [ modrinth, curseforge ]
uniqueItems: true
minItems: 1
modrinth_host:
type: string
format: uri
description: Base URL of a Modrinth-compatible server.
description: |
Per-entry override for the Modrinth source kind's base URL.
Co-exists with the Modrinth source — the entry still speaks
the Modrinth API, just against a different host.
hash_scan_depth:
type: integer
minimum: 0
description: |
When both Modrinth and CurseForge participate for this entry,
how many additional version pairs beyond the newest pair to
scan looking for a SHA1 match before failing. `0` disables
the scan; the default is `10`. Mutually exclusive with a
single-element `sources:`.
no_cross_platform_search:
type: boolean
description: Disable cross-platform search fallback for this entry.
allow_hash_mismatch:
type: boolean
description: |
When both Modrinth and CurseForge participate for this entry
and no SHA1 match is found within the scan window, accept the
mismatch and lock the newest pair instead of failing.
Mutually exclusive with a single-element `sources:`.
url:
type: string
format: uri
Expand All @@ -394,11 +498,35 @@ $defs:
minLength: 1
allOf:
- not:
required: [ hosted, url ]
required: [ modrinth_host, url ]
- not:
required: [ hosted, path ]
required: [ modrinth_host, path ]
- not:
required: [ url, path ]
# `hash_scan_depth` / `allow_hash_mismatch` only make sense when
# both platforms participate. A single-element `sources:` already
# pins the entry to one platform, so combining the fields is a
# parse-time error.
- not:
allOf:
- required: [ hash_scan_depth ]
- properties:
sources:
oneOf:
- type: string
- type: array
maxItems: 1
required: [ sources ]
- not:
allOf:
- required: [ allow_hash_mismatch ]
- properties:
sources:
oneOf:
- type: string
- type: array
maxItems: 1
required: [ sources ]

modMap:
type: object
Expand Down
11 changes: 6 additions & 5 deletions assets/schema/project-overrides.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ properties:
project_overrides:
description: |
Map of Modrinth project slug to mod dependency (short or long
form). Pins a version, flips per-side install state, or
redirects an entry to an alternate source (`hosted`, `url`,
`path`). An entry here forces its version to be used regardless
of other mods' constraints or `incompatible:` declarations.
Same shape as `project_overrides` in mods.yaml.
form). Pins a version, flips per-side install state, redirects
the Modrinth source to a labrinth deployment via
`modrinth_host`, or swaps it out for a `url:` / `path:` source.
An entry here forces its version to be used regardless of other
mods' constraints or `incompatible:` declarations. Same shape
as `project_overrides` in mods.yaml.
oneOf:
- type: "null"
- $ref: https://gitrinth.dev/schemas/mods.schema.yaml#/$defs/modMap
6 changes: 3 additions & 3 deletions assets/template/mods.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ description: {{description}}

loader:
{{loader-block}}
mc-version: {{mc-version}}
mc_version: {{mc_version}}

tooling:
gitrinth: ">={{gitrinth-version}} <{{gitrinth-next-major}}"
gitrinth:
version: ">={{gitrinth-version}} <{{gitrinth-next-major}}"

mods:
globalpacks: stable
Expand Down
3 changes: 2 additions & 1 deletion build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,5 @@ targets:
retrofit_generator:
enabled: true
generate_for:
- lib/src/service/modrinth_api.dart
- lib/src/service/modrinth/modrinth_api.dart
- lib/src/service/curseforge/curseforge_api.dart
Loading
Loading