Skip to content

Commit 9f300e8

Browse files
committed
refactor(tools): rename tool/ to tools/
Move the developer scripts directory to the plural tools/, matching the existing test/ mirror layout, and update every reference: the makefile integration-test target, .gitignore aggregator note, the integration_test comment, the AGENTS.md l10n pointer, and the in-file usage strings of arb.dart and gen_all_test.dart.
1 parent 17de50d commit 9f300e8

7 files changed

Lines changed: 20 additions & 18 deletions

File tree

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ CLAUDE.md
115115
# sentry-native build artifacts pulled by sentry_flutter on Linux
116116
.sentry-native/
117117

118-
# Generated integration-test aggregator (see tool/gen_all_test.dart)
118+
# Generated integration-test aggregator (see tools/gen_all_test.dart)
119119
integration_test/all_test.dart
120120

121121
# Generated swap debug log export (written during test runs)

AGENTS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ Workflow when you need a widget:
171171
3. **If genuinely new and reused by ≥ 2 features**, put it in `lib/core/widgets/<category>/` from the start — that *is* growing the UI Kit.
172172
4. **If used by exactly one feature**, it lives in `<feature>/ui/widgets/` — but write it composable enough to be promoted later (no hardcoded colors, no hardcoded text, take callbacks not bloc refs).
173173
5. **Widgets never live under `adapters/`, `frameworks/`, `domain/`, or `application/`.** UI goes in `ui/` or `lib/core/widgets/`. Full stop.
174-
6. **No hardcoded user-facing strings.** Always `context.loc.<key>` — the `BuildContext` extension (`build_context_x.dart`) that wraps `AppLocalizations.of(context)`; it is the dominant convention (≈2564 uses vs 3 raw `AppLocalizations.of`). Manage keys in [`localization/`](localization/) with [`tool/arb.dart`](tool/README.md) (`fvm dart run tool/arb.dart help`) — don't hand-edit the `.arb` files — then run `make translations`. A duplicated literal across screens means a missing l10n key.
174+
6. **No hardcoded user-facing strings.** Always `context.loc.<key>` — the `BuildContext` extension (`build_context_x.dart`) that wraps `AppLocalizations.of(context)`; it is the dominant convention (≈2564 uses vs 3 raw `AppLocalizations.of`). Manage keys in [`localization/`](localization/) with [`tools/arb.dart`](tools/README.md) (`fvm dart run tools/arb.dart help`) — don't hand-edit the `.arb` files — then run `make translations`. A duplicated literal across screens means a missing l10n key.
175175
7. **Theme tokens only** — colors, spacing, typography pulled from the theme. See rule #10 above.
176176

177177
When you spot a duplicate of an existing core widget in feature code, flag it in the PR description as a follow-up cleanup. Don't silently leave it. Don't fix unrelated duplicates in the same PR either — that breaks atomic commits.

integration_test/coins_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import 'package:flutter_test/flutter_test.dart';
3333
// wallet's real UTXOs and asserts the confirmations/labels fields the view
3434
// renders. Needs a funded testnet wallet → skipped when absent.
3535
//
36-
// Run via `make integration-test` (auto-aggregated by tool/gen_all_test.dart).
36+
// Run via `make integration-test` (auto-aggregated by tools/gen_all_test.dart).
3737
Future<void> main({bool isInitialized = false}) async {
3838
TestWidgetsFlutterBinding.ensureInitialized();
3939
if (!isInitialized) await Bull.init();

makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -278,11 +278,11 @@ unit-test:
278278
# invocation, so running this one file builds + launches once for the whole
279279
# suite (instead of failing every file but the first, as `flutter test
280280
# integration_test/` does). all_test.dart is a generated, gitignored artifact —
281-
# tool/gen_all_test.dart regenerates it from disk below, so adding a test file
281+
# tools/gen_all_test.dart regenerates it from disk below, so adding a test file
282282
# needs no manual wiring.
283283
integration-test:
284284
@echo "🧪 integration tests"
285-
@fvm dart run tool/gen_all_test.dart
285+
@fvm dart run tools/gen_all_test.dart
286286
@fvm flutter test integration_test/all_test.dart --reporter=expanded
287287

288288
# Build & render the bull_ui design-system catalogue (Widgetbook) locally in the

tool/README.md renamed to tools/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# tool/
1+
# tools/
22

33
Developer scripts for this repo. Run everything through `fvm` (see `AGENTS.md`).
44
Each script is documented in its own section below.
@@ -11,7 +11,7 @@ other key stays byte-for-byte unchanged and JSON never breaks. It refuses to edi
1111
a file that doesn't match the expected 2-space-per-top-level-key layout.
1212

1313
```
14-
fvm dart run tool/arb.dart <command>
14+
fvm dart run tools/arb.dart <command>
1515
```
1616

1717
Read:
@@ -40,7 +40,7 @@ after a bare `--`.
4040

4141
After any write command (`add`, `set`, `set-meta`, `rename`, `delete`), run
4242
`make translations` to regenerate the Dart localizations — each changes either
43-
the key set or a generated string. Run `fvm dart run tool/arb.dart help` for the
43+
the key set or a generated string. Run `fvm dart run tools/arb.dart help` for the
4444
full reference.
4545

4646
> First run is slow (cold package build hooks); subsequent runs are sub-second.

tool/arb.dart renamed to tools/arb.dart

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// validates this invariant before mutating and refuses to touch a file that
1414
// breaks it.
1515
//
16-
// Run `dart run tool/arb.dart help` for usage.
16+
// Run `dart run tools/arb.dart help` for usage.
1717

1818
import 'dart:convert';
1919
import 'dart:io';
@@ -994,7 +994,7 @@ void _printUsage() {
994994
print(r'''
995995
arb.dart — manage the .arb localization files under localization/
996996
997-
Usage: dart run tool/arb.dart <command> [args]
997+
Usage: dart run tools/arb.dart <command> [args]
998998
999999
Read commands:
10001000
get KEY [--locale L]
@@ -1041,13 +1041,13 @@ A value that looks like an option (e.g. the literal "--list") can be passed
10411041
after a bare `--`: `set KEY LOCALE -- --list`.
10421042
10431043
Examples:
1044-
dart run tool/arb.dart get exchangeTestnetBasicAuthTitle
1045-
dart run tool/arb.dart check exchangeTestnetBasicAuthTitle
1046-
dart run tool/arb.dart missing --locale fr --list
1047-
dart run tool/arb.dart dead --list
1048-
dart run tool/arb.dart add myNewKey \
1044+
dart run tools/arb.dart get exchangeTestnetBasicAuthTitle
1045+
dart run tools/arb.dart check exchangeTestnetBasicAuthTitle
1046+
dart run tools/arb.dart missing --locale fr --list
1047+
dart run tools/arb.dart dead --list
1048+
dart run tools/arb.dart add myNewKey \
10491049
--translations '{"en":"Hello","fr":"Bonjour"}' \
10501050
--description "A greeting"
1051-
dart run tool/arb.dart delete myNewKey
1051+
dart run tools/arb.dart delete myNewKey
10521052
''');
10531053
}
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// The output is a generated build artifact: it is gitignored and regenerated on
99
// every `make integration-test`. Do not commit or hand-edit it.
1010
//
11-
// Run via: fvm dart run tool/gen_all_test.dart
11+
// Run via: fvm dart run tools/gen_all_test.dart
1212
import 'dart:io';
1313

1414
// Files matching *_test.dart that must NOT be aggregated: the generated file
@@ -38,7 +38,9 @@ void main() {
3838
};
3939

4040
final b = StringBuffer()
41-
..writeln('// GENERATED by tool/gen_all_test.dart — do not edit or commit.')
41+
..writeln(
42+
'// GENERATED by tools/gen_all_test.dart — do not edit or commit.',
43+
)
4244
..writeln('// Regenerated on every `make integration-test`.')
4345
..writeln("import 'package:bb_mobile/main.dart';")
4446
..writeln("import 'package:flutter_test/flutter_test.dart';");

0 commit comments

Comments
 (0)