Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 20 additions & 11 deletions .github/workflows/build-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,37 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '16.x'
- run: npm install
- run: npx prettier . --check --config .prettierrc.json
node-version: '20.x'
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 9
- run: pnpm install
- run: pnpm prettier . --check --config .prettierrc.json

process:
name: Process
needs: lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '20.x'
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
node-version: '16.x'
- run: npm install
version: 9
- run: pnpm install
- run: node process.mjs
- name: Upload artifact
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: generated-lookups
path: output
Expand All @@ -49,9 +57,10 @@ jobs:
steps:
- name: Set current date as env variable
run: echo "NOW=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: generated-lookups
path: .
- uses: 'marvinpinto/action-automatic-releases@latest'
with:
repo_token: '${{ secrets.GITHUB_TOKEN }}'
Expand Down
127 changes: 127 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
# CLAUDE.md

This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.

## Project Overview

This repository maintains a comprehensive dataset of Apple device model identifiers mapped to human-readable names and metadata. It serves as the data source for TelemetryDeck's device detection system.

## Core Architecture

### Data Structure

- **Source Data**: Individual JSON files in `dataset/` directory organized by device type:
- `iphones.json` - iPhone models
- `ipads.json` - iPad models
- `macs.json` - Mac models
- `appletvs.json` - Apple TV models
- `wearables.json` - Apple Watch and AirPods
- `other.json` - Other Apple devices

- **Data Schema**: Each device entry contains:
```json
{
"ModelIdentifier": {
"deviceType": "Desktop|Laptop|Phone|Tablet|Set-Top Box|Wearable|Headset",
"processorFamily": "Apple M1|Intel Core i5|A15|etc",
"processorType": "Apple Silicon|Intel",
"readableName": "Human readable device name",
"systemFirstRelease": "First OS release version",
"systemLastRelease": "Last supported OS version"
}
}
```

### Processing Pipeline

- **Input**: Multiple JSON files in `dataset/`
- **Processor**: `process.mjs` script that merges all datasets and extracts individual lookup tables
- **Output**: Generated files in `output/` directory for each metadata field:
- `readableName.json` - Model ID → readable name mapping
- `deviceType.json` - Model ID → device type mapping
- `processorType.json` - Model ID → processor type mapping
- `processorFamily.json` - Model ID → processor family mapping
- `systemFirstRelease.json` - Model ID → first release mapping
- `systemLastRelease.json` - Model ID → last release mapping

## Development Commands

### Code Formatting

```bash
pnpm prettier . --check --config .prettierrc.json # Check formatting
pnpm prettier . --write --config .prettierrc.json # Fix formatting
```

### Data Processing

```bash
node process.mjs # Generate lookup tables from dataset files
```

### Package Management

```bash
pnpm install # Install dependencies (uses pnpm)
```

## CI/CD Pipeline

The GitHub Actions workflow (`build-pr.yml`) automatically:

1. **Lint**: Runs Prettier formatting checks
2. **Process**: Executes `process.mjs` to generate output files
3. **Release**: Creates automatic releases with generated JSON files (main branch only)

## Code Style

- Uses Prettier with custom configuration (`.prettierrc.json`)
- JSON files are automatically sorted recursively
- 4-space indentation, single quotes, no semicolons
- ES modules (`.mjs` extension for Node.js scripts)

## Data Sources for Updates

**Primary Sources:**

- **Apple Newsroom** - https://www.apple.com/newsroom/ (official announcements and device names)
- **adamawolf GitHub gist** - https://gist.github.com/adamawolf/3048717 (most up-to-date model identifiers like iPhone18,1)
- **AppleDB** - https://appledb.dev/ (comprehensive device database with SoC info)
- **EveryMac.com** - https://everymac.com/ (detailed technical specifications and processor families)

**Data Update Process:**
When asked to update data or check for updates:

1. **Cross-reference sources** - Check adamawolf GitHub gist and AppleDB for new model identifiers
2. **Verify official names** - Confirm device names and specs with Apple Newsroom
3. **Get technical details** - Use EveryMac.com for processor families and device classifications
4. **Update dataset files** in priority order:
- `dataset/iphones.json` (highest priority)
- `dataset/ipads.json`
- `dataset/macs.json`
- `dataset/wearables.json`
- `dataset/appletvs.json`
- `dataset/other.json`
5. **Process and format**:

```bash
node process.mjs
pnpm prettier . --write --config .prettierrc.json
```

6. **Verify changes and quality control**:

```bash
git status # Check which files were modified
git diff --name-status # See summary of all changes
git diff dataset/ # Review all dataset changes in detail
git diff --stat # Get statistical summary of changes
```

- **Review all changes carefully** - Ensure only intended additions/modifications were made
- **Verify no devices were accidentally removed** - Check that existing entries are preserved
- **Double-check technical accuracy** - Confirm processor families, device types, and naming conventions
- **Cross-reference with 3rd source** - Optionally verify new entries with EveryMac.com or Apple Support docs
- **Validate data consistency** - Ensure new entries follow the same schema and naming patterns as existing data

Always confirm at least 2 sources agree on device information before adding entries.
12 changes: 11 additions & 1 deletion dataset/appletvs.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,14 @@
{
"AppleTV11,1": {
"deviceType": "Set-Top Box",
"processorFamily": "A12",
"readableName": "Apple TV 4K (2nd generation)"
},
"AppleTV14,1": {
"deviceType": "Set-Top Box",
"processorFamily": "A15",
"readableName": "Apple TV 4K (3rd generation)"
},
"AppleTV2,1": {
"deviceType": "Set-Top Box",
"processorFamily": "S5L8930",
Expand All @@ -22,6 +32,6 @@
"AppleTV6,2": {
"deviceType": "Set-Top Box",
"processorFamily": "A10X",
"readableName": "Apple TV 4K"
"readableName": "Apple TV 4K (1st generation)"
}
}
62 changes: 61 additions & 1 deletion dataset/ipads.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,31 @@
"processorFamily": "A15 Bionic",
"readableName": "iPad mini (6th generation) (WiFi)"
},
"iPad14,10": {
"deviceType": "Tablet",
"processorFamily": "M2",
"readableName": "iPad Air 13-inch (6th generation) (WiFi+Cellular)"
},
"iPad14,11": {
"deviceType": "Tablet",
"processorFamily": "M2",
"readableName": "iPad Air 11-inch (6th generation) (WiFi)"
},
"iPad14,12": {
"deviceType": "Tablet",
"processorFamily": "M2",
"readableName": "iPad Air 11-inch (6th generation) (WiFi+Cellular)"
},
"iPad14,13": {
"deviceType": "Tablet",
"processorFamily": "M2",
"readableName": "iPad Air 13-inch (6th generation) (WiFi)"
},
"iPad14,14": {
"deviceType": "Tablet",
"processorFamily": "M2",
"readableName": "iPad Air 13-inch (6th generation) (WiFi+Cellular)"
},
"iPad14,2": {
"deviceType": "Tablet",
"processorFamily": "A15 Bionic",
Expand All @@ -141,9 +166,44 @@
},
"iPad14,6": {
"deviceType": "Tablet",
"processorFamily": "",
"processorFamily": "M2",
"readableName": "iPad Pro 12.9-inch (6th generation) (WiFi+Cellular)"
},
"iPad14,7": {
"deviceType": "Tablet",
"processorFamily": "M2",
"readableName": "iPad Air 11-inch (6th generation) (WiFi)"
},
"iPad14,8": {
"deviceType": "Tablet",
"processorFamily": "M2",
"readableName": "iPad Air 11-inch (6th generation) (WiFi+Cellular)"
},
"iPad14,9": {
"deviceType": "Tablet",
"processorFamily": "M2",
"readableName": "iPad Air 13-inch (6th generation) (WiFi)"
},
"iPad16,3": {
"deviceType": "Tablet",
"processorFamily": "M4",
"readableName": "iPad Pro 11-inch (5th generation) (WiFi)"
},
"iPad16,4": {
"deviceType": "Tablet",
"processorFamily": "M4",
"readableName": "iPad Pro 11-inch (5th generation) (WiFi+Cellular)"
},
"iPad16,5": {
"deviceType": "Tablet",
"processorFamily": "M4",
"readableName": "iPad Pro 13-inch (5th generation) (WiFi)"
},
"iPad16,6": {
"deviceType": "Tablet",
"processorFamily": "M4",
"readableName": "iPad Pro 13-inch (5th generation) (WiFi+Cellular)"
},
"iPad2,1": {
"deviceType": "Tablet",
"processorFamily": "A5",
Expand Down
5 changes: 5 additions & 0 deletions dataset/iphones.json
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,11 @@
"processorFamily": "A16",
"readableName": "iPhone 15"
},
"iPhone15,5": {
"deviceType": "Phone",
"processorFamily": "A16",
"readableName": "iPhone 15 Plus"
},
"iPhone16,1": {
"deviceType": "Phone",
"processorFamily": "A17 Pro",
Expand Down
84 changes: 84 additions & 0 deletions dataset/macs.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,90 @@
"readableName": "MacBook Pro (16-inch, Nov 2023)",
"systemFirstRelease": "12.2"
},
"Mac16,1": {
"deviceType": "Laptop",
"processorFamily": "M4",
"processorType": "Apple Silicon",
"readableName": "MacBook Pro (14-inch, Nov 2024)",
"systemFirstRelease": "15.0"
},
"Mac16,10": {
"deviceType": "Desktop",
"processorFamily": "M4",
"processorType": "Apple Silicon",
"readableName": "Mac mini (2024)",
"systemFirstRelease": "15.0"
},
"Mac16,11": {
"deviceType": "Desktop",
"processorFamily": "M4 Pro",
"processorType": "Apple Silicon",
"readableName": "Mac mini (2024)",
"systemFirstRelease": "15.0"
},
"Mac16,12": {
"deviceType": "Laptop",
"processorFamily": "M4",
"processorType": "Apple Silicon",
"readableName": "MacBook Air (13-inch, M4, 2025)",
"systemFirstRelease": "15.0"
},
"Mac16,13": {
"deviceType": "Laptop",
"processorFamily": "M4",
"processorType": "Apple Silicon",
"readableName": "MacBook Air (15-inch, M4, 2025)",
"systemFirstRelease": "15.0"
},
"Mac16,2": {
"deviceType": "Desktop",
"processorFamily": "M4",
"processorType": "Apple Silicon",
"readableName": "iMac (24-inch, 2024)",
"systemFirstRelease": "15.0"
},
"Mac16,3": {
"deviceType": "Desktop",
"processorFamily": "M4",
"processorType": "Apple Silicon",
"readableName": "iMac (24-inch, 2024)",
"systemFirstRelease": "15.0"
},
"Mac16,5": {
"deviceType": "Laptop",
"processorFamily": "M4 Max",
"processorType": "Apple Silicon",
"readableName": "MacBook Pro (16-inch, Nov 2024)",
"systemFirstRelease": "15.0"
},
"Mac16,6": {
"deviceType": "Laptop",
"processorFamily": "M4 Pro",
"processorType": "Apple Silicon",
"readableName": "MacBook Pro (14-inch, Nov 2024)",
"systemFirstRelease": "15.0"
},
"Mac16,7": {
"deviceType": "Laptop",
"processorFamily": "M4 Pro",
"processorType": "Apple Silicon",
"readableName": "MacBook Pro (16-inch, Nov 2024)",
"systemFirstRelease": "15.0"
},
"Mac16,8": {
"deviceType": "Laptop",
"processorFamily": "M4 Max",
"processorType": "Apple Silicon",
"readableName": "MacBook Pro (14-inch, Nov 2024)",
"systemFirstRelease": "15.0"
},
"Mac16,9": {
"deviceType": "Desktop",
"processorFamily": "M4 Max",
"processorType": "Apple Silicon",
"readableName": "Mac Studio (2025)",
"systemFirstRelease": "15.0"
},
"MacBook10,1": {
"deviceType": "Laptop",
"processorType": "Intel",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"devDependencies": {
"prettier": "^3.1.0",
"prettier": "^3.6.2",
"prettier-plugin-sort-json": "^3.1.0"
}
}
Loading