Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
28 changes: 28 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Something is wrong
description: A wrong position, a wrong number, or the page misbehaving.
labels: [bug]
body:
- type: textarea
id: what
attributes:
label: What happened
description: What you did, what you saw, and what you expected instead.
validations:
required: true
- type: input
id: plan
attributes:
label: Plan link
description: Copy the page address with the plan open. The whole plan is in the link.
placeholder: https://snare.starorg.tools/#...
- type: input
id: version
attributes:
label: Version
description: Shown in the footer under More, with the game build.
placeholder: v0.2.0 · game build 4.x
- type: input
id: browser
attributes:
label: Browser and device
placeholder: Firefox on Windows, Chrome on Android...
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: true
16 changes: 16 additions & 0 deletions .github/ISSUE_TEMPLATE/idea.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Idea
description: Something Snares should do, or do better.
labels: [enhancement]
body:
- type: textarea
id: idea
attributes:
label: The idea
description: What you want to do in the game that the planner does not help with yet.
validations:
required: true
- type: textarea
id: checked
attributes:
label: Seen in the game
description: If this rests on how the game behaves, say what you saw and in which build.
22 changes: 22 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
version: 2
updates:
- package-ecosystem: npm
directory: /
schedule:
interval: weekly
commit-message:
prefix: chore
include: scope
groups:
npm:
patterns: ["*"]
update-types: [minor, patch]
- package-ecosystem: github-actions
directory: /
schedule:
interval: weekly
commit-message:
prefix: ci
groups:
actions:
patterns: ["*"]
8 changes: 8 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<!-- Title: a conventional commit (feat: ..., fix: ..., docs: ...). It becomes the squashed commit and decides the next version. -->

## What and why

## Checked

- [ ] `npm test` and `npm run build` pass
- [ ] `docs/changelog.md` has an entry (anything a user would notice)
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI

on:
pull_request:
# Release PRs are opened by a workflow, which starts no other workflow; the release workflow asks for this run itself.
workflow_dispatch:

permissions:
contents: read

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

jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 24
cache: npm
- run: npm ci
- run: npm run typecheck
- run: npm test
- run: npx vite build
28 changes: 28 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: CodeQL

on:
push:
branches: [main]
pull_request:
schedule:
- cron: "23 5 * * 1"

permissions:
contents: read

jobs:
analyze:
# Code scanning on a private repo needs GitHub Code Security; runs once the repo is public.
if: ${{ !github.event.repository.private }}
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
steps:
- uses: actions/checkout@v7
- uses: github/codeql-action/init@v4
with:
languages: javascript-typescript,actions
build-mode: none
- uses: github/codeql-action/analyze@v4
13 changes: 5 additions & 8 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,32 @@ name: Deploy to GitHub Pages
on:
push:
branches: [main]
pull_request:
workflow_dispatch:

permissions:
contents: read

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

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 24
cache: npm
- run: npm ci
- run: npm test
- run: npm run build
- uses: actions/upload-pages-artifact@v3
if: github.event_name != 'pull_request'
- uses: actions/upload-pages-artifact@v5
with:
path: dist

deploy:
if: github.event_name != 'pull_request'
needs: build
runs-on: ubuntu-latest
permissions:
Expand All @@ -42,4 +39,4 @@ jobs:
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4
uses: actions/deploy-pages@v5
17 changes: 17 additions & 0 deletions .github/workflows/pr-title.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: PR title

on:
pull_request:
types: [opened, edited, reopened, synchronize]

permissions:
pull-requests: read

jobs:
conventional:
runs-on: ubuntu-latest
steps:
# Pull requests are squashed, so the title becomes the commit the next version is worked out from.
- uses: amannn/action-semantic-pull-request@v6
env:
GITHUB_TOKEN: ${{ github.token }}
29 changes: 29 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release

on:
push:
branches: [main]

permissions:
contents: read

concurrency:
group: release
cancel-in-progress: false

jobs:
release-please:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
actions: write
steps:
- id: release
uses: googleapis/release-please-action@v5
# A pull request opened with the workflow token starts no checks, and main requires them.
- if: steps.release.outputs.prs_created == 'true'
env:
GH_TOKEN: ${{ github.token }}
BRANCH: ${{ fromJSON(steps.release.outputs.pr).headBranchName }}
run: gh workflow run ci.yml --repo "$GITHUB_REPOSITORY" --ref "$BRANCH"
1 change: 1 addition & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ ".": "0.1.0" }
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,15 @@ sc-gamedata output directory.
One-time setup in the GitHub repo: Settings → Pages → Source: **GitHub Actions**.
The build uses relative asset paths, so it works under any repo name.

## Contributing and releases

- Bugs and ideas: [open an issue](https://github.com/voidput/snares/issues/new/choose). The site footer links there too.
- `main` is protected: changes land by pull request, squashed, once the `check` job (typecheck, tests, build) is green. Org admins can bypass.
- Pull request titles are conventional commits (`feat: ...`, `fix: ...`, `docs: ...`); the title becomes the commit.
- Versions follow semver and are cut by [release-please](https://github.com/googleapis/release-please): it keeps a release pull request open that bumps `package.json` and writes `CHANGELOG.md` from the commits (`fix` → patch, `feat` → minor, `!` → breaking; before 1.0 a breaking change bumps the minor). Merging it tags `vX.Y.Z` and publishes a GitHub Release. The footer shows the version and commit the page was built from.
- `docs/changelog.md` stays the hand-written record of what changed for users; `CHANGELOG.md` is generated.
- Other workflows: `ci.yml` (pull requests), `pr-title.yml`, `codeql.yml`, and Dependabot for npm and actions, weekly.

## How the position is found

Ships in quantum fly a straight line to the centre of their destination, so
Expand Down
12 changes: 11 additions & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,21 @@
---
title: Changelog
tags: [changelog]
updated: 2026-11-14
updated: 2026-11-15
---

# Changelog

## 2026-11-15 — Issue link, versions and a protected main

Type: Added. Effort: L2.

- Footer: **Patreon** link beside Coffee (StarOrg.tools page), same tip-link terms ([decision](decisions/star-citizen-fankit-compliance.md)).
- Footer: **Report** opens the GitHub issue chooser (bug and idea forms); the About panel repeats it, links the source, and shows the Snares version and commit ([README](../README.md)).
- Versions: semver through release-please. Conventional commits drive a release pull request that bumps `package.json` and writes `CHANGELOG.md`; merging it tags `vX.Y.Z` and publishes a GitHub Release. Baseline tag `v0.1.0`.
- `main` is protected by a ruleset: no force-push, no deletion, pull request with a green `check` job, squash only. Org admins can bypass.
- Workflows: `ci.yml` (typecheck, tests, build on pull requests), `release.yml`, `pr-title.yml`, `codeql.yml`; Dependabot weekly for npm and actions. Actions moved to current majors (Node 20 warnings gone). `pages.yml` now runs on `main` only.

## 2026-11-14 — A map with depth

Type: Added. Effort: L2.
Expand Down
2 changes: 1 addition & 1 deletion docs/decisions/star-citizen-fankit-compliance.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Snares is a public Star Citizen fan site built on data read from the game's file

## Tip link and referral code

The page carries a Buy Me a Coffee link and an RSI referral code, as Bindscape and StarOrg.tools do. Recorded honestly, as there: the agreement allows no compensation *for access or use*. A voluntary tip that buys nothing is outside that wording but is the grey edge of "non-commercial", and CIG may see it differently. If asked, remove the tip link first. The referral code uses CIG's own programme.
The page carries Buy Me a Coffee and Patreon links and an RSI referral code, as Bindscape and StarOrg.tools do. Recorded honestly, as there: the agreement allows no compensation *for access or use*. A voluntary tip that buys nothing is outside that wording but is the grey edge of "non-commercial", and CIG may see it differently. If asked, remove the tip links first. The referral code uses CIG's own programme.

## Consequences

Expand Down
11 changes: 11 additions & 0 deletions release-please-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json",
"include-component-in-tag": false,
"bump-minor-pre-major": true,
"packages": {
".": {
"release-type": "node",
"changelog-path": "CHANGELOG.md"
}
}
}
2 changes: 1 addition & 1 deletion src/components/Policies.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ export function PrivacyPolicy() {

<h4>Links that leave the site</h4>
<p>
Coffee opens Buy Me a Coffee and Enlist opens robertsspaceindustries.com, each in a new tab. Nothing is sent to
Coffee opens Buy Me a Coffee, Patreon opens patreon.com, and Enlist opens robertsspaceindustries.com, each in a new tab. Nothing is sent to
them until you click, and what happens there falls under their policies.
</p>

Expand Down
34 changes: 30 additions & 4 deletions src/components/SiteFooter.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// The site footer, after RSI+'s: one slim always-visible row (Fankit mark, the "unofficial"
// line, game build, Coffee, More) and a panel that unfolds upward with the full trademark
// line, game build, Coffee, Patreon, More) and a panel that unfolds upward with the full trademark
// notice and the referral code.
//
// Star Citizen Fankit compliance (docs/decisions/star-citizen-fankit-compliance.md).
Expand All @@ -8,12 +8,12 @@
// sits in the bar at 40px, full opacity, with no filter, shadow or other effect;
// - a trademark notice of at least 10pt: the bar carries one line at 14px, and the
// full disclaimer is one click away in the panel, also at 14px.
import { Check, ChevronDown, ChevronUp, Coffee, Copy, ExternalLink, ShieldCheck } from "lucide-react";
import { Bug, Check, ChevronDown, ChevronUp, Coffee, Copy, ExternalLink, Heart, ShieldCheck } from "lucide-react";
import { useEffect, useRef, useState } from "react";

import { DISCLAIMER, MARK_ALT, MARK_SIZE, NOTICE_SIZE, SHORT_NOTICE } from "../brand/fankit";
import brandMark from "../brand/MadeByTheCommunity_White.png";
import { BUYMEACOFFEE_URL, enlistUrl, REFERRAL } from "../lib/support";
import { APP_VERSION, BUYMEACOFFEE_URL, enlistUrl, ISSUES_URL, PATREON_URL, REFERRAL, REPO_URL } from "../lib/support";
import { PrivacyPolicy, Terms } from "./Policies";

type View = "about" | "privacy" | "terms";
Expand Down Expand Up @@ -85,6 +85,17 @@ export function SiteFooter({ build, extracted }: { build: string; extracted?: st
(build {build}) for planning only. No game code, art or audio is included. Free to use: no paid features, no
ads, no accounts, no tracking.
</p>
<p>
Snares <span className="footer-version">{APP_VERSION}</span>. Found something wrong, or want it to do more?{" "}
<a className="footer-inline" href={ISSUES_URL} target="_blank" rel="noopener noreferrer">
Open an issue on GitHub <ExternalLink size={12} aria-hidden />
</a>{" "}
(needs a GitHub account). The{" "}
<a className="footer-inline" href={REPO_URL} target="_blank" rel="noopener noreferrer">
source <ExternalLink size={12} aria-hidden />
</a>{" "}
is there too.
</p>
</div>
<div className="footer-referral">
<span className="footer-label">Referral code</span>
Expand Down Expand Up @@ -118,13 +129,28 @@ export function SiteFooter({ build, extracted }: { build: string; extracted?: st
<p className="footer-notice" style={{ fontSize: NOTICE_SIZE }}>
{SHORT_NOTICE}
</p>
<span className="footer-build" title={extracted ? `Game data extracted ${extracted.slice(0, 10)}` : undefined}>
<span
className="footer-build"
title={`Snares ${APP_VERSION}${extracted ? ` · game data extracted ${extracted.slice(0, 10)}` : ""}`}
>
game build {build}
</span>
<span className="footer-actions">
<a className="footer-action coffee" href={BUYMEACOFFEE_URL} target="_blank" rel="noopener noreferrer">
<Coffee size={14} aria-hidden /> Coffee
</a>
<a className="footer-action patreon" href={PATREON_URL} target="_blank" rel="noopener noreferrer">
<Heart size={14} aria-hidden /> Patreon
</a>
<a
className="footer-action"
href={ISSUES_URL}
target="_blank"
rel="noopener noreferrer"
title="Report a problem or suggest something, on GitHub"
>
<Bug size={14} aria-hidden /> Report
</a>
<button
className="footer-action"
aria-expanded={view === "privacy"}
Expand Down
3 changes: 3 additions & 0 deletions src/globals.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/** Set by the build (vite.config.ts): the package version and the short commit hash. */
declare const __APP_VERSION__: string;
declare const __APP_COMMIT__: string;
18 changes: 18 additions & 0 deletions src/lib/support.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { describe, expect, it } from "vitest";

import { ISSUES_URL, PATREON_URL, versionLabel } from "./support";

describe("support links", () => {
it("labels a release, with the commit when known", () => {
expect(versionLabel("0.2.0", "")).toBe("v0.2.0");
expect(versionLabel("0.2.0", "1edb521")).toBe("v0.2.0 · 1edb521");
});

it("sends reports to the issue chooser", () => {
expect(ISSUES_URL).toBe("https://github.com/voidput/snares/issues/new/choose");
});

it("links the StarOrg.tools Patreon", () => {
expect(PATREON_URL).toBe("https://www.patreon.com/cw/StarOrgTools");
});
});
Loading
Loading