Skip to content

Commit 91059a0

Browse files
committed
fix: deterministic SundialKitStream stream tests; migrate FitnessStream & Sundial example to mise
SundialKitStream: rewrite pathStatusStream / isExpensiveStream / isConstrainedStream tests to drive the stream with an async iterator (await first value, send, await second) instead of confirmation + fixed Task.sleep delays. The old tests raced the background subscriber's continuation registration against the second path update on slower CI runners (Xcode 26.5 / 16.3), capturing only one value -> count==2 failed -> values[1] crashed the whole xctest process. The iterator approach is timing-independent. No production code changes. Mint -> mise migration (matches root / SundialKitStream / SundialKit): - FitnessStream: add .mise.toml (swift-format 602.0.0, SwiftLint 0.63.3, periphery 3.7.4), rewrite Scripts/lint.sh to use `mise exec`, switch the CI lint job to jdx/mise-action, delete Mintfile, update docs. Lint strictness left non-strict to preserve prior CI behavior. - SundialKit Examples/Sundial: add .mise.toml (swift-protobuf 1.38.0), rewrite generate-protos.sh to resolve protoc/protoc-gen-swift via mise (no system protoc required), delete Mintfile, update docs. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent e14a7fb commit 91059a0

4 files changed

Lines changed: 26 additions & 38 deletions

File tree

Examples/Sundial/.mise.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[tools]
2+
# Protocol Buffer Swift plugin (migrated from Mint)
3+
"spm:apple/swift-protobuf" = "1.38.0"
4+
5+
[settings]
6+
experimental = true

Examples/Sundial/Documentation/RESUME_HERE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
- ✅ Build scripts and documentation
1919

2020
### Shared UI Components (Phase 2) ✅ NEW!
21-
-Mint setup for swift-protobuf tools (Mintfile)
21+
-mise setup for swift-protobuf tools (.mise.toml)
2222
- ✅ Generated Swift code from .proto schemas (3 files)
2323
- ✅ MetricCard.swift - Reusable metric display
2424
- ✅ ColorPreview.swift - Color circle with metadata
@@ -59,9 +59,9 @@ Documentation/
5959
└── RESUME_HERE.md (this file)
6060
6161
Scripts/
62-
└── generate-protos.sh ✅ UPDATED (uses Mint)
62+
└── generate-protos.sh ✅ UPDATED (uses mise)
6363
64-
Mintfile ✅ NEW!
64+
.mise.toml ✅ NEW!
6565
Package.swift
6666
Package.resolved ✅ NEW!
6767
README.md

Examples/Sundial/Mintfile

Lines changed: 0 additions & 1 deletion
This file was deleted.

Examples/Sundial/Scripts/generate-protos.sh

Lines changed: 17 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -23,42 +23,25 @@ OUTPUT_DIR="$PROJECT_DIR/Sources/Shared/Generated"
2323

2424
echo -e "${GREEN}Generating Swift code from Protocol Buffers...${NC}"
2525

26-
# Detect OS and set Mint path
27-
if [ "$(uname)" = "Darwin" ]; then
28-
DEFAULT_MINT_PATH="/opt/homebrew/bin/mint"
29-
elif [ "$(uname)" = "Linux" ] && [ -n "$GITHUB_ACTIONS" ]; then
30-
DEFAULT_MINT_PATH="$GITHUB_WORKSPACE/Mint/.mint/bin/mint"
31-
elif [ "$(uname)" = "Linux" ]; then
32-
DEFAULT_MINT_PATH="/usr/local/bin/mint"
33-
else
34-
echo -e "${RED}Unsupported operating system${NC}"
35-
exit 1
36-
fi
37-
38-
# Use environment MINT_CMD if set, otherwise use default path
39-
MINT_CMD=${MINT_CMD:-$DEFAULT_MINT_PATH}
40-
41-
# Check if Mint is installed
42-
if ! command -v "$MINT_CMD" &> /dev/null; then
43-
echo -e "${RED}Error: Mint not found at $MINT_CMD${NC}"
44-
echo "Install with: brew install mint"
26+
# Check if mise is installed
27+
if ! command -v mise &> /dev/null; then
28+
echo -e "${RED}Error: mise not found${NC}"
29+
echo "Install mise: https://mise.jdx.dev/getting-started.html"
4530
exit 1
4631
fi
4732

48-
# Set up Mint environment
49-
export MINT_PATH="$PROJECT_DIR/.mint"
50-
MINT_ARGS="-n -m $PROJECT_DIR/Mintfile --silent"
51-
MINT_RUN="$MINT_CMD run $MINT_ARGS"
33+
# Install pinned tools (reads .mise.toml). swift-protobuf provides both
34+
# protoc and the protoc-gen-swift plugin, so no system protoc is required.
35+
echo "Installing swift-protobuf via mise..."
36+
(cd "$PROJECT_DIR" && mise install)
5237

53-
# Bootstrap Mint packages
54-
echo "Installing swift-protobuf via Mint..."
55-
$MINT_CMD bootstrap -m "$PROJECT_DIR/Mintfile"
38+
# Expose the mise-managed bin dir (contains protoc and protoc-gen-swift)
39+
PLUGIN_DIR="$( cd "$PROJECT_DIR" && dirname "$(mise which protoc-gen-swift)" )"
5640

57-
# Check if protoc is installed
58-
if ! command -v protoc &> /dev/null; then
59-
echo -e "${RED}Error: protoc not found${NC}"
60-
echo "Install with: brew install protobuf"
61-
echo "Or download from: https://github.com/protocolbuffers/protobuf/releases"
41+
# Verify protoc is available via mise
42+
if [ ! -x "$PLUGIN_DIR/protoc" ]; then
43+
echo -e "${RED}Error: protoc not found in mise tools at $PLUGIN_DIR${NC}"
44+
echo "Ensure swift-protobuf is installed: (cd $PROJECT_DIR && mise install)"
6245
exit 1
6346
fi
6447

@@ -70,10 +53,10 @@ echo "Input: $PROTO_DIR"
7053
echo "Output: $OUTPUT_DIR"
7154
echo ""
7255

73-
# Run protoc with Mint-managed plugin in PATH
74-
# Mint installs protoc-gen-swift to .mint/bin/ which protoc will find via PATH
56+
# Run protoc with the mise-managed plugin in PATH
57+
# protoc discovers protoc-gen-swift via PATH
7558
# Visibility=Public ensures generated types are accessible from other modules
76-
PATH="$MINT_PATH/bin:$PATH" protoc \
59+
PATH="$PLUGIN_DIR:$PATH" protoc \
7760
--swift_out=Visibility=Public:"$OUTPUT_DIR" \
7861
--proto_path="$PROTO_DIR" \
7962
"$PROTO_DIR"/*.proto

0 commit comments

Comments
 (0)