Repository navigation
Expand file tree
/
Copy pathJUSTFILE
More file actions
73 lines (59 loc) · 3.15 KB
/
Copy pathJUSTFILE
File metadata and controls
73 lines (59 loc) · 3.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
set shell := ["bash", "-euo", "pipefail", "-c"]
set positional-arguments
# Each project owns a module; its recipes run in that project's directory.
# Every module file repeats the shell and positional-arguments settings, which
# modules do not inherit.
mod mod 'bazaarplusplus-mod/mod.just'
mod installer 'bazaarplusplus-installer/installer.just'
mod site 'bazaarplusplus-site/site.just'
mod server 'bazaarplusplus-server/server.just'
mod analyzer 'bazaarplusplus-analyzer/analyzer.just'
mod release 'release/release.just'
# Root tooling owns its dependencies and formatting configuration.
root_js := "package.json package-lock.json .prettierrc.json release.mjs 'release/**/*.{mjs,ts,json}' 'scripts/**/*.mjs'"
# `just --fmt` does not descend into modules, so format each file explicitly.
just_files := "JUSTFILE bazaarplusplus-mod/mod.just bazaarplusplus-installer/installer.just bazaarplusplus-site/site.just bazaarplusplus-server/server.just bazaarplusplus-analyzer/analyzer.just release/release.just"
# List commands without building or publishing anything.
default:
@{{ quote(just_executable()) }} --list --list-submodules
# Check all projects without signing, publishing, or deploying to the game.
[group('workspace')]
check: commands-check release::check mod::check installer::check site::check server::check analyzer::check
# Run all project tests without publishing data or deploying to the game.
[group('workspace')]
test: commands-check release::test mod::test installer::test site::test server::test analyzer::test
# Format every project in place, then re-project release files.
[group('workspace')]
fmt: && mod::fmt installer::fmt site::fmt server::fmt analyzer::fmt release::sync
for file in {{ just_files }}; do {{ quote(just_executable()) }} --justfile "$file" --fmt; done
npm exec -- prettier --config .prettierrc.json --write {{ root_js }}
# Install the workspace Git hooks (requires root npm dependencies).
[group('workspace')]
hooks-install:
node scripts/install-hooks.mjs
# Connect shared local configuration, install locked dependencies and Git hooks.
[group('workspace')]
setup *args:
node scripts/workspace.mjs setup "$@"
# Inventory local prerequisites without printing secret values or publishing.
[group('workspace')]
doctor:
node scripts/workspace.mjs doctor
# Run an explicit command with one configuration profile, from the repo root.
[group('workspace')]
with-config profile +args:
node scripts/workspace.mjs run "$1" -- "${@:2}"
# List, by name only, which GitHub secrets and variables exist and which have a local value.
[group('workspace')]
secrets-check *args:
node scripts/workspace.mjs secrets check "$@"
# Copy every locally present GitHub secret and variable through gh; [--dependabot] [--prune].
[group('workspace')]
secrets-sync *args:
node scripts/workspace.mjs secrets push "$@"
# Check formatting and exercise command routing with isolated tool stubs.
[group('workspace')]
commands-check:
for file in {{ just_files }}; do {{ quote(just_executable()) }} --justfile "$file" --fmt --check; done
npm exec -- prettier --config .prettierrc.json --check {{ root_js }}
node --test scripts/just.test.mjs scripts/workspace.test.mjs