GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Tags · brzzdev/BrzzUtils
Tags
1.11.2chore(just): add Release and iOS build recipes (#117) ## Summary Adds Release and iOS build recipes, both sharing one private `xcodebuild build` invocation. ```diff +release_derived_data := ".build/release" +scheme := "BrzzUtils-Package" -build: - xcodebuild build -scheme BrzzUtils-Package -destination "platform=macOS" | xcbeautify +build: (build-for "platform=macOS") + +[private] +build-for destination *args: + xcodebuild build -scheme {{ scheme }} -destination {{ destination }} {{ args }} | xcbeautify + +build-ios: (build-for "generic/platform=iOS") + +build-release: (build-for "platform=macOS" "-configuration" "Release" "-derivedDataPath" release_derived_data) + echo <repo>/.build/release/Build/Products/Release ``` - `build-release` pins DerivedData at `.build/release` (gitignored), so the Release object files, `BrzzUtils.o` included, have a stable path, which it prints. - `build-ios` targets a generic iOS device, so it needs no simulator, booted or named. - `build` takes no arguments, so `just build lint` still runs both recipes. - `test` and `test-ios` use the `scheme` variable too; their expanded commands are unchanged. Closes #114 ## Evidence With no simulator booted: - **Before:** no recipe; a Release or iOS build meant calling `xcodebuild` by hand. **After:** ``` just build → exit 0 just build-ios → exit 0 just build-release → exit 0, prints …/.build/release/Build/Products/Release (BrzzUtils.o present there) ``` - With a deliberate type error in a source file, each of the three exits 65, and `build-release` prints no path. - No new warnings: the only one is xcodebuild's "Using the first of multiple matching destinations", which `just build` printed before; `build-ios` prints none. - `just test` passes; `git status` stays clean after the builds. ## Merge Danger **Door:** two-way **Blast Radius:** local Only the `justfile` changes; CI calls `xcodebuild` directly and runs only `just lint`. Running `swift build -c release` in the same checkout also writes `.build/release` (as a symlink), so mixing the two there can clash; the path was kept deliberately. 1.11.1chore: drop the @available attributes the 27 floor made redundant (#93) ## Summary With the floor at 27 on every declared platform, the availability attributes and SwiftLint's targets now match `Package.swift`. ```diff # .swiftlint.yml deployment_target: - iOS_deployment_target: 16.0 - macOS_deployment_target: 13.0 - tvOS_deployment_target: 17.0 - watchOS_deployment_target: 10.0 + iOS_deployment_target: 27.0 + macOS_deployment_target: 27.0 + tvOS_deployment_target: 27.0 + watchOS_deployment_target: 27.0 ``` ```diff // Ext+Mutex.swift (×2), Ext+UncheckedSendable.swift (×1) -@available(macOS 15.0, iOS 18.0, watchOS 11.0, tvOS 18.0, visionOS 2.0, *) +@available(visionOS 2.0, *) ``` **Why visionOS stays:** visionOS isn't a declared platform, so SwiftPM builds it from its default floor of 1.0. Deleting the attribute outright turns that into a compile error rather than a silent change, so the visionOS constraint is kept. The linter accepts it. No docs change: ADR 0001 already records the floor. ## Evidence - **Before (attribute deleted):** `swiftc -typecheck -target arm64-apple-xros1.0-simulator` fails with: ``` error: 'Mutex' is only available in visionOS 2.0 or newer error: 'Failure' is only available in visionOS 2.0 or newer ``` **After (`@available(visionOS 2.0, *)`):** typechecks clean for xros 1.0, 2.0 and 27.0 and for ios, ios-macabi, macos, tvos and watchos 27. On those 27 targets, members such as `decrease()` are callable unguarded, so the public API is unchanged on every declared platform. - **Before (lint targets at 27, old attributes):** `just lint` reports 12 `deployment_target` violations (as measured in #92). **After:** `just lint`: `Found 0 violations, 0 serious in 47 files`. `just build`, `just test` and `just test-ios` all succeed with no compiler warnings. ## Merge Danger **Door:** two-way **Blast Radius:** none There's no API or behaviour change on any declared platform or on visionOS, so this ships as a patch release. Closes #92 1.11.0fix(snapshot): pin Dynamic Type on the UIKit trait, not only the envi… …ronment (#91) ## Summary The UIKit `assertSnapshotWithLocale` set Dynamic Type only in the SwiftUI environment. UIKit chrome reads the `preferredContentSizeCategory` trait instead, and the `.iPhone13` preset pins that trait to `.medium`. The helper now merges the requested category into a copy of the config's traits, which SnapshotTesting applies to each capture from the parent container (`setOverrideTraitCollection(_:forChild:)`). It doesn't use `traitOverrides` on the hosting controller. The public signature is unchanged. ```diff assertSnapshotWithLocale(on: config, dynamicTypeSize:, …) rootView = view.environment(\.colorScheme).dynamicTypeSize(size) + config.traits = config.traits.modifyingTraits { + $0.preferredContentSizeCategory = UIContentSizeCategory(size) + } assertSnapshot(of: UIHostingController(rootView), as: .imageWithLocale(on: config, …)) ``` Along with the fix: - **Platforms:** every platform moves to `.v27` (`swift-tools-version: 6.4`), which turns on `treatAllWarnings(as: .error)`. - **`just test-ios`:** a new recipe that runs on a pinned iPhone 18 Pro / iOS 27.0 simulator. - **CI:** both legs run on `runs-on: xcode-27` with Xcode `"27.0"` and the same simulator. The image is macOS 27.0 with Xcode 27.0 (27A266a). That is the same Xcode build used locally. The runner-images README lists the image as a **public preview**. - **Doc comments** now match swift-snapshot-testing 1.19.6. Each capture builds a fresh `Window` and sets traits parent-for-child. Nothing in the library sets `overrideUserInterfaceStyle`, so the old reason for having no `traits:` parameter, a leak through a shared window, was false. The decision stays. The new reason is that every rendering axis is a named parameter encoded in the reference filename. - **New iOS tests** in `UIKitSnapshotTests`: - `contentSizeCategoryTrait` records the hosting controller's effective trait in `layoutSubviews` while it is attached to SnapshotTesting's window, and expects `.accessibilityLarge`. - `pushedBackButton(run:)` has 12 cases that all check one committed reference. `.snapshots` gives each case a fresh counter, so every case resolves `.1`. Warnings surfaced by the bump: - **Introduced by this change:** none. - **Pre-existing, now fixed:** `UIWindow.init()`, deprecated in iOS 26, in `Ext+ASWebAuthenticationSession`. The presentation anchor now comes from a window scene, chosen in order: a foreground-active one, then a foreground-inactive one, then any connected scene. It uses that scene's key window, or a new `UIWindow(windowScene:)`. Without any connected scene it calls `preconditionFailure`. Before, it returned a window with no scene, which couldn't present anything either. - **Left alone on purpose:** `.swiftlint.yml`'s `deployment_target` still lists the old OSes. Raising it flags the redundant `@available` attributes, and removing those is the follow-up. - **ADR 0001:** its "floor stays at iOS 16 / macOS 13" consequence now notes the move. ## Evidence **Failure not reproduced; mechanism unconfirmed.** Everything below ran on one setup: the same Mac, Xcode 27.0 (27A266a), the iPhone 18 Pro / iOS 27.0 simulator and the same committed reference. Each run is a separate `just test-ios -only-testing:BrzzTestUtilsTests/UIKitSnapshotTests`. | | `contentSizeCategoryTrait` | `pushedBackButton` (12 cases per run) | | --- | --- | --- | | **Before** (fix neutralised), 12 runs | failed 12/12 (trait ≠ `.accessibilityLarge`) | matched reference 144/144 | | **After** (fix), 12 runs | passed 12/12 | matched reference 144/144 | - **Trait:** without the fix, the hosting controller's trait disagrees with the environment every time. - **Chevron:** the flaky chevron from brzzdev/SimpleF1#407 did not appear without the fix. In this setup SwiftUI's bridging always reached the chevron before capture. This PR doesn't claim to have fixed that flake. It removes the disagreement that is assumed to cause it. - **Hung runs:** three of the unfixed runs hung inside xcodebuild before building started, and were re-run. The hang also happened once with the fix applied, so it is unrelated to the change. The committed `pushedBackButton_dark_accessibility2` reference shows the pushed screen with an enlarged chevron: **40×69 px**, against **32×56 px** in a throwaway `.large` capture. It's dark because the chevron is drawn for a glass platter that layer rendering leaves out, so on a light bar it is all but invisible. <img src="https://github.com/brzzdev/BrzzUtils/blob/88e5c96/Tests/BrzzTestUtilsTests/__Snapshots__/UIKitSnapshotTests/pushedBackButton_dark_accessibility2.1.en_GB.png?raw=true" width="240" alt="Pushed screen at accessibility2 with an enlarged back chevron"> Final revision: `just build`, `just test` (the AppKit references are unchanged and pass), `just test-ios` and `just lint` are all green, with no warnings. ## Merge Danger **Door:** two-way. Each part reverts cleanly. **Blast Radius:** consumers. - **Platform floor:** any consumer below the 27 OSes can no longer resolve this version. This stays on v1 by the maintainer's decision. - **Default size:** at the default `.large`, the trait under `.iPhone13` changes from `.medium` to `.large`. UIKit content that reads the trait directly, such as `preferredFont` or `UIFontMetrics` inside a representable, will render differently and need re-recording. A grep of SimpleF1, SimpleTrackerForTrakt and SimpleTrackerForAniList found no such code. - **Pushed accessibility references:** these may now always record the enlarged chevron. - **App extensions:** `UIApplication.shared` in the auth extension isn't extension-safe. `Ext+UIApplication` already uses it, so this adds no new exposure. - **CI:** the job depends on the `xcode-27` preview image. Follow-ups: - Remove the redundant `@available` attributes and raise the lint deployment targets to 27. - In SimpleF1, drop the `SnapshotNavigationStack(.pushed)` workaround (brzzdev/SimpleF1#408). Closes #90 1.10.4refactor(date): format iso via ISO8601DateFormatter's class method (#87) ## Summary `.iso` formats through `ISO8601DateFormatter`'s class method instead of building and configuring a formatter instance on every call. The output is unchanged. ```diff case .iso: - let formatter = ISO8601DateFormatter() - formatter.formatOptions = [<five options>] - formatter.timeZone = timeZone - return formatter.string(from: self) + return ISO8601DateFormatter.string(from: self, timeZone: timeZone, formatOptions: [<same five options>]) ``` The issue first suggested `Date.ISO8601FormatStyle`, but it truncates fractional seconds where `ISO8601DateFormatter` rounds to the nearest millisecond. A code comment records why it isn't used. No performance gain is claimed, because none was measured. ## Evidence A characterisation test went in first (`e67f3c3`) and passed against the old formatter. It still passes after the switch with every expected string unchanged: ```text isoFollowsTimeZone epoch, GMT → 1970-01-01 00:00:00.000 1_773_666_000, Asia/Kolkata → 2026-03-16 18:30:00.000 isoRoundsToNearestMillisecond (GMT) 1_773_666_000.123 → 2026-03-16 13:00:00.123 (truncation gives .122) 1_773_666_000.9996 → 2026-03-16 13:00:01.000 (truncation gives 00.999) ``` - **Before:** all 4 cases pass on the old formatter. **After:** all 4 pass on the class method. Full suite: `** TEST SUCCEEDED **`. Lint: `0 violations`. ## Merge Danger **Door:** two-way **Blast Radius:** none `Date.formatted(style:)` keeps its signature, and the tests pin the output byte for byte, including rounding. Closes #86 1.10.3fix(date): dayMonthTime follows the locale's hour cycle (#83) ## Summary `Date.formatted(style: .dayMonthTime)` uses the injected locale's hour cycle instead of a hard-coded 24-hour `HH`. ```diff case .dayMonthTime: - DateFormatter(locale, timeZone) - .setLocalizedDateFormatFromTemplate("dd/MM HH:mm") + Date.FormatStyle(locale, calendar: locale.calendar, timeZone) + .day(.twoDigits).month(.twoDigits).hour().minute() ``` - The output stays zero-padded in en_US: `03/16, 1:00 PM`. That matches the `.twoDigits` chain the issue suggests and the old `dd/MM` template, though the issue's prose example says `3/16`. - The calendar still comes from the locale, as it did with the old `DateFormatter`. - `FormatStyle` caches its ICU formatter, so the `DateFormatter` that used to be built on every call is gone. `.dayMonth` still builds one per call; that could be a follow-up. Closes #82 ## Evidence `ExtDateTests.dayMonthTimeFollowsLocaleHourCycle`, run in UTC at 16 Mar 2026 13:00: - **Before:** en_US fails: `"03/16, 13:00"` ≠ `"03/16, 1:00 PM"` **After:** en_GB `16/03, 13:00` and en_US `03/16, 1:00 PM` both pass (ICU puts a U+202F narrow no-break space before `PM`) `just test`, `just build` and `just lint` all pass, with no warnings and 0 violations. ## Merge Danger **Door:** two-way **Blast Radius:** display Consumers in 12-hour locales (SimpleF1's schedule rows) switch from `13:00` to `1:00 PM`. Their output also gains the narrow no-break space before `PM`, which matters for any consumer that compares the string exactly. 1.10.2fix(spm): declare the IssueReporting product (#68) ## What changed `BrzzUtils` now declares the `IssueReporting` product that dependency macro expansions reference. The direct package edge uses the compatibility identity already present through `swift-dependencies` 1.16.0, avoiding duplicate target names while the 1.12 compatibility shim remains untagged. ## Why Build systems that link each package product as a dynamic framework cannot resolve the generated `IssueReporting` symbols from transitive dependencies alone. ## Things to look out for The old `xctest-dynamic-overlay` URL is intentional. Adding `swift-issue-reporting` 2.x beside `swift-dependencies` 1.16.0 currently fails because both package identities declare `IssueReporting` and `IssueReportingTestSupport` targets. The consuming app now links past the former BrzzUtils failure, but its hosted test topology exposes separate undeclared products elsewhere in that app's graph. ## Related Refs brzzdev/SimpleTrackerForAniList#392 ## Test plan - [x] Run `swift test` (22 tests) - [x] Confirm the consuming dynamic-framework build no longer reports undefined `IssueReporting` symbols from `BrzzUtils` 1.10.1docs: add the MIT licence (#66) The package has shipped without stated terms, which by default means all rights reserved — not what a public utility package intends. It also has a concrete downstream cost: SimpleRandom's `scripts/generate-licences.swift` walks the full transitive graph and **fails rather than guesses**, so `BrzzUtils` with no licence file blocks its Acknowledgements screen from being generated at all. That is what surfaced this. MIT for the reason most of the surrounding graph picked it: this is a small utility library, and permissive terms are what keep depending on it from being a decision. Stock MIT text, so a consumer classifying by hallmarks recognises it without a special case. After this merges I'll cut a patch tag so SimpleRandom can resolve to a version that carries the file. 1.9.0fix(LoadingState)!: reload without content after .failed, rename .fir… …stLoad (#60) Two changes to `LoadingState`, both about the same confusion: the state that means *nothing is on screen* was named for *when* it happens rather than *what it is*, and the transition into it was wrong. ## The transition (#59) `setLoading(true)` sent `.failed` to `.refreshing`. Those say different things to a view: `.refreshing` means *there is content on screen and it is being updated*, the other means *there is nothing yet*. Loading out of `.failed` is always the second kind, so `.refreshing` was the wrong destination — a retry arrived in the loaded branch with empty content, which reads as "no results" unless the view adds a spinner branch to catch it. What licenses the change is the invariant that `.failed` is only ever entered when there was nothing to show — a refresh that fails over an already-loaded list leaves it on screen. SimpleF1 enforces that on all seven screens as of brzzdev/SimpleF1#59, #117, #121 and #122. The guard on the no-content case and the `.loaded`/`.refreshing` behaviour are unchanged, and `setLoading` still never re-enters `.failed`. ## The rename (#61) `.firstLoad` → `.loadingWithoutContent`. The two loading cases are distinguished by whether there's content on screen, not by ordinality — `LoadStateView` in the consumers branches on exactly that — so `.firstLoad` was the odd one out in an enum where every other case names a condition. `.loadingWithoutContent` over the shorter `.loading` deliberately: `.loading` sits one letter from `.loaded` and both are assignable, so `state.loadingState = .loaded` and `= .loading` would both compile and mean opposite things. Verbosity is the cheaper trade. Raised by a Codex review on this PR. ## Notes The doc comment documented the behaviour being removed, including the "assign `.firstLoad` explicitly" workaround instruction, so it's rewritten. The existing test asserted the old `.failed → .refreshing` transition; it now covers the new one and picks up the `.refreshing → .refreshing` case it was missing. `just build` and `just test` pass with no `warning:` lines. Source-breaking, but consumers pin `from:` ranges and this lands as `1.9.0`, so nothing picks it up until each repo opts in. ## Consumer follow-ups Two consumers reference the renamed case — SimpleF1 (34 sites) and SimpleTrackerForAniList (37). The other five depend on BrzzUtils but never touch `LoadingState`, so they need a version bump at most. **SimpleTrackerForAniList needs a fix before it bumps** (brzzdev/SimpleTrackerForAniList#302): `LoadStateView.swift:60` only shows the failure when `isEmpty`, but `MediaListFeature.swift:254` and `SocialFeature.swift:126` call `fail(message:)` unconditionally — so `.failed` can sit there with content behind it, and after this change the next refresh would blank it to a full-screen spinner. It needs the `isEmpty` guard SimpleF1 already has. SimpleF1 gets the payoff: the four spinner branches and the `DriverDetailReducer` workaround that exist only to cover the old transition can go. Closes #59 Closes #61 PreviousNext
|
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |