Skip to content

Land architecture rules, CI, performance doc, site and README (supersedes #8–#11) - #12

Merged
mackoj merged 16 commits into
mainfrom
chore/land-rules-docs-site-readme
Nov 14, 2026
Merged

mackoj merged 16 commits into
mainfrom
chore/land-rules-docs-site-readme

Conversation

@mackoj

@mackoj mackoj commented Nov 14, 2026

Copy link
Copy Markdown
Owner

Lands the stacked #8, #9, #10 and #11 in one pull request, so main needs a single review. docs/readme-and-metadata held all four and merged into main without conflicts. This PR supersedes those four; they will be closed, and their branches kept.

What each superseded PR contained

  • Add architecture rules (swift-llm-check), simulator tests and CI #8, architecture rules, simulator tests and CI (chore/architecture-rules)
    • Architecture/: a test-only swift-llm-check package with seven rules, written down in CODING_STANDARDS.md: simulator-only sources, an import budget, @available on the package floor, public types declare availability, AnyView only in apply(to:), erased Any payloads name their type, and captions name their case. docs/architecture-rules.md is generated from the rules.
    • Fixes two violations: Locale+Identifier.swift sat outside the simulator guard, and LegibilityWeight declared @available(iOS 13.0, *).
    • Adds XCTest cases (simulator-only); the test target used to be empty.
    • Adds CI: a macOS host build with tests and the architecture rules, xcodebuild test on an iOS simulator, tvOS/watchOS/visionOS simulator builds, and actionlint and zizmor on the workflows.
    • Adds AGENTS.md and CLAUDE.md.
  • Document performance: no hot path, no benchmark package #9, performance doc (docs/performance): docs/performance.md explains why there is no benchmark package (the module is empty on the host) and gives p50 timings measured on a simulator. The library adds about 16 µs to a SwiftUI render of about 100 µs. No library change.
  • Add a GitHub Pages landing page #10, GitHub Pages site (docs/github-pages): site/index.html and .github/workflows/pages.yml. ReadmeTests compiles the site's code samples against the public API.
  • Rewrite the README and link the site and docs #11, README and metadata (docs/readme-and-metadata): a rewritten README with the CI badge and links to the site and docs, and an install snippet for 1.1.4. It fixes the .dynamicTypeSize(.xSmall) snippet, which did not compile, to .dynamicTypeSize(DynamicTypeSize.xSmall), and lists the supported values and the no-op cases.

New in this PR: swift-llm-check 0.5.0

  • Architecture/Package.swift now requires from: "0.5.0".
  • sources-are-simulator-only uses the built-in scope.topLevelStatements(notUnder: "targetEnvironment(simulator)"). The local codeOutsideSimulatorGuard and isSimulatorGuard are deleted, along with the two detector tests that only covered them.
  • The local firstDescendant(of:) is deleted in favour of the library's.
  • public-types-declare-availability uses Declaration.isPublic, so open declarations count too.
  • availability-names-the-package-floor still reads every @available attribute rather than Declaration.attributes("available"), which would miss declarations that Declaration does not model, such as subscripts.
  • Rule ids and texts are unchanged, so docs/architecture-rules.md is unchanged.

The library sources are not touched beyond what #8 already contained, so no release is needed.

Verified locally

  • swift build --build-tests and swift test on the host.
  • swift test --package-path Architecture: 14 tests pass.
  • xcodebuild test -scheme EnvironmentVariationPreview on an iPhone simulator: 8 tests pass.

Locale+Identifier.swift was the one file outside #if targetEnvironment(simulator),
so its 950-case enum compiled into device builds. LegibilityWeight's
CustomStringConvertible conformance named iOS 13 only.
Seven rules from CODING_STANDARDS.md: simulator-only sources, the import
budget, one availability floor, AnyView only in apply(to:), erased payloads
name their type, and captions name their case. Detector tests and the
generated docs/architecture-rules.md included.
The library compiles to nothing on the host, where package-benchmark runs.
Measured on an iPhone simulator instead: the library adds about 16 us to
a 100 us render of eight variations, so there is no hot path to improve.
The usage snippet wrote .dynamicTypeSize(.xSmall), which does not compile
because the payload is Any. Install from 1.1.4, link the site and docs,
list the supported values and the cases that are no-ops.
Xcode 16 enforces the iOS 14 deployment target, where DynamicTypeSize is
unavailable.
…oc, site, README

Lands #8, #9, #10 and #11 (stacked) in one merge.
…tDescendant

sources-are-simulator-only now reads scope.topLevelStatements(notUnder:
"targetEnvironment(simulator)") instead of a local copy, and the
description detector uses the library's firstDescendant(of:). The two
DetectorTests that only tested the removed guard detector go with it.
public-types-declare-availability uses Declaration.isPublic, so an open
type counts too. availabilityOffTheFloor keeps reading every @available
attribute rather than Declaration.attributes, which would miss
declarations Declaration does not model, such as subscripts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant