Skip to content

armgit / cra

Public Imported from GitHub
0

The open-source Arc replacement for macOS. Spaces, pinned tabs, split view, Little Windows and Arc's shortcuts on Chromium, with your Arc sidebar imported in one go.

A justfile: `just` lists the development scripts, one recipe per script (#169)

Victora4a6086770c3
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index e128e65..47b2a21 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -23,10 +23,13 @@ the shape before you spend the time.
git clone https://github.com/VictorKildahl/cra.git
cd cra
- scripts/build.sh # first run fetches CEF
- scripts/dev.sh # debug CraDev.app, rebuilds + relaunches on save
+ scripts/build.sh # fetches CEF on first run, builds build/Cra.app
+ scripts/build.sh debug # debug build
+ scripts/dev.sh # dev loop: debug CraDev.app, rebuilds + relaunches on save
-You need macOS 14+ on Apple silicon, Xcode 16+ and CMake (`brew install cmake`).
+You need macOS 14+ on Apple silicon, Xcode 16+ and CMake (`brew install cmake`). With
+[just](https://just.systems) (`brew install just`), `just` lists every script with what it
+does, and `just build debug` runs `scripts/build.sh debug`.
[docs/development.md](docs/development.md) has the code layout, the `cra://` scripting
hooks and how to run a test instance next to your daily Cra.
diff --git a/docs/development.md b/docs/development.md
index 8636f74..ecaeef4 100644
--- a/docs/development.md
+++ b/docs/development.md
@@ -8,8 +8,14 @@ Notes for working on the code. How to send a change is in
scripts/build.sh # fetches CEF on first run, builds build/Cra.app
scripts/build.sh debug # debug build
- scripts/run.sh # build if needed, then open (--rebuild forces a build)
+ scripts/run.sh # build if needed, then open; --rebuild [debug] forces a build
scripts/dev.sh # dev loop: debug CraDev.app, rebuilds + relaunches on save (~4 s)
+ scripts/dev.sh --once # build and launch CraDev.app once, logs in this terminal
+
+`just` lists all of the scripts below with what each does (`brew install just`; the
+[justfile](../justfile) is one recipe per script). A recipe passes its arguments on, so
+`just build debug` runs `scripts/build.sh debug`. CI calls the scripts directly, and so can
+you.
Requirements: macOS 14+ on Apple silicon, Xcode 16+, CMake (`brew install cmake`), about
1 GB of disk for CEF and the build products.
@@ -61,9 +67,11 @@ the save panel.
scripts/test.sh core # only Packages/CraCore
Tests/smoke-launch.sh # launches build/Cra.app three times, about 30 s
scripts/scenario.sh all # user journeys in build/Cra.app, about 6 minutes
- scripts/coverage.py # line coverage, and the changed-lines gate
+ scripts/scenario.sh sleep-tabs # one of them (Tests/Scenarios/<name>.scenario)
+ scripts/coverage.py # line coverage, and the changed-lines gate against origin/main
+ scripts/coverage.py --base <ref> # the same against another base (CI passes the PR's)
scripts/fuzz.sh # mutated importer fixtures under AddressSanitizer
- scripts/mutate.py # mutation testing of the pure code, minutes
+ scripts/mutate.py [word] # mutation testing of the pure code, minutes; a word limits it
[testing.md](testing.md) has the rules, the layers, the gates and how to write a scenario.
diff --git a/justfile b/justfile
new file mode 100644
index 0000000..9f1b97d
--- /dev/null
+++ b/justfile
@@ -0,0 +1,107 @@
+# The development commands in one list: `just` prints it (brew install just).
+# Each recipe runs one script in scripts/ or Tests/ and passes its arguments on, so
+# `just build debug` is `scripts/build.sh debug`. The scripts' header comments have the
+# details, and the scripts work the same without just.
+
+set positional-arguments
+set shell := ["bash", "-euo", "pipefail", "-c"]
+
+[private]
+default:
+ @{{just_executable()}} --justfile {{quote(justfile())}} --list --unsorted
+
+# Downloads the pinned CEF and Sparkle into vendor/ (build does this too)
+[group('build')]
+fetch:
+ scripts/fetch-cef.sh
+ scripts/fetch-sparkle.sh
+
+# Builds build/Cra.app; `debug` for a debug build
+[group('build')]
+build *args:
+ scripts/build.sh "$@"
+
+# Opens build/Cra.app, building it if missing: [--rebuild [debug] [app arguments…]]
+[group('build')]
+run *args:
+ scripts/run.sh "$@"
+
+# Dev loop: debug CraDev.app, rebuilt and relaunched on save; --once builds and launches once
+[group('build')]
+dev *args:
+ scripts/dev.sh "$@"
+
+# What CI runs on every pull request, in seconds, no CEF needed; `core` for CraCore only
+[group('test')]
+test *args:
+ scripts/test.sh "$@"
+
+# Cra's own lint rules (part of test); --update-baseline lowers Tests/lint-baseline.txt
+[group('test')]
+lint *args:
+ scripts/lint.py "$@"
+
+# Launches build/Cra.app (or the app given) three times with crash checks, about 30 s
+[group('test')]
+smoke *args:
+ Tests/smoke-launch.sh "$@"
+
+# A user journey from Tests/Scenarios in build/Cra.app, or `all` (about 6 minutes)
+[group('test')]
+scenario name:
+ scripts/scenario.sh "$@"
+
+# Line coverage and the changed-lines gate; --base <ref> (default origin/main)
+[group('test')]
+coverage *args:
+ scripts/coverage.py "$@"
+
+# The importer parsers on mutated fixtures, under AddressSanitizer
+[group('test')]
+fuzz:
+ scripts/fuzz.sh
+
+# Mutation testing of the pure code, minutes; a word limits it to matching files
+[group('test')]
+mutate *args:
+ scripts/mutate.py "$@"
+
+# Sparkle end to end on a local feed, next to your Cra: [manual|idle|again|stop]
+[group('test')]
+test-update *args:
+ scripts/test-update.sh "$@"
+
+# Packages build/Cra.app (or the app given) into build/dist: DMG, zip, checksums
+[group('release')]
+package *args:
+ scripts/package.sh "$@"
+
+# Writes build/dist/appcast.xml: [Cra.zip] [Cra.app] [release-notes.html]
+[group('release')]
+appcast *args:
+ scripts/appcast.sh "$@"
+
+# Build, sign, notarize, package and appcast as <version>; tags run this in CI
+[group('release')]
+release version:
+ CRA_VERSION="$1" scripts/release.sh
+
+# Is a newer stable CEF out? Prints only; the daily workflow opens the issue
+[group('cef')]
+check-cef-update:
+ scripts/check-cef-update.sh --dry-run
+
+# Builds the pinned CEF from source with H.264/AAC and scripts/cef-patches (~80 GB, hours)
+[group('cef')]
+build-cef:
+ scripts/build-cef.sh
+
+# Uploads that build as the pre-release cef-<version>-codecsN
+[group('cef')]
+publish-cef:
+ scripts/publish-cef.sh
+
+# Moves Cra to <cef_version>: build, publish, pin, rebuild
+[group('cef')]
+update-cef cef_version:
+ scripts/update-cef.sh "$1"