Skip to content

Commit 617972e

Browse files
authored
Add latest devices announced at Apple September Event + document update strategy for Claude (#5)
* Initialize CLAUDE.md via /init command * Document for Claude Code how to update data properly * Update all device mappings + add verification instructions for Claude * Update actions to make GitHub Actions CI happy
1 parent 3850e8f commit 617972e

File tree

8 files changed

+329
-29
lines changed

8 files changed

+329
-29
lines changed

.github/workflows/build-pr.yml

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -14,29 +14,37 @@ jobs:
1414
runs-on: ubuntu-latest
1515
steps:
1616
- name: Checkout
17-
uses: actions/checkout@v3
17+
uses: actions/checkout@v4
1818
- name: Setup Node
19-
uses: actions/setup-node@v3
19+
uses: actions/setup-node@v4
2020
with:
21-
node-version: '16.x'
22-
- run: npm install
23-
- run: npx prettier . --check --config .prettierrc.json
21+
node-version: '20.x'
22+
- name: Setup pnpm
23+
uses: pnpm/action-setup@v4
24+
with:
25+
version: 9
26+
- run: pnpm install
27+
- run: pnpm prettier . --check --config .prettierrc.json
2428

2529
process:
2630
name: Process
2731
needs: lint
2832
runs-on: ubuntu-latest
2933
steps:
3034
- name: Checkout
31-
uses: actions/checkout@v3
35+
uses: actions/checkout@v4
3236
- name: Setup Node
33-
uses: actions/setup-node@v3
37+
uses: actions/setup-node@v4
38+
with:
39+
node-version: '20.x'
40+
- name: Setup pnpm
41+
uses: pnpm/action-setup@v4
3442
with:
35-
node-version: '16.x'
36-
- run: npm install
43+
version: 9
44+
- run: pnpm install
3745
- run: node process.mjs
3846
- name: Upload artifact
39-
uses: actions/upload-artifact@v3
47+
uses: actions/upload-artifact@v4
4048
with:
4149
name: generated-lookups
4250
path: output
@@ -49,9 +57,10 @@ jobs:
4957
steps:
5058
- name: Set current date as env variable
5159
run: echo "NOW=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
52-
- uses: actions/download-artifact@v3
60+
- uses: actions/download-artifact@v4
5361
with:
5462
name: generated-lookups
63+
path: .
5564
- uses: 'marvinpinto/action-automatic-releases@latest'
5665
with:
5766
repo_token: '${{ secrets.GITHUB_TOKEN }}'

CLAUDE.md

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Project Overview
6+
7+
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.
8+
9+
## Core Architecture
10+
11+
### Data Structure
12+
13+
- **Source Data**: Individual JSON files in `dataset/` directory organized by device type:
14+
- `iphones.json` - iPhone models
15+
- `ipads.json` - iPad models
16+
- `macs.json` - Mac models
17+
- `appletvs.json` - Apple TV models
18+
- `wearables.json` - Apple Watch and AirPods
19+
- `other.json` - Other Apple devices
20+
21+
- **Data Schema**: Each device entry contains:
22+
```json
23+
{
24+
"ModelIdentifier": {
25+
"deviceType": "Desktop|Laptop|Phone|Tablet|Set-Top Box|Wearable|Headset",
26+
"processorFamily": "Apple M1|Intel Core i5|A15|etc",
27+
"processorType": "Apple Silicon|Intel",
28+
"readableName": "Human readable device name",
29+
"systemFirstRelease": "First OS release version",
30+
"systemLastRelease": "Last supported OS version"
31+
}
32+
}
33+
```
34+
35+
### Processing Pipeline
36+
37+
- **Input**: Multiple JSON files in `dataset/`
38+
- **Processor**: `process.mjs` script that merges all datasets and extracts individual lookup tables
39+
- **Output**: Generated files in `output/` directory for each metadata field:
40+
- `readableName.json` - Model ID → readable name mapping
41+
- `deviceType.json` - Model ID → device type mapping
42+
- `processorType.json` - Model ID → processor type mapping
43+
- `processorFamily.json` - Model ID → processor family mapping
44+
- `systemFirstRelease.json` - Model ID → first release mapping
45+
- `systemLastRelease.json` - Model ID → last release mapping
46+
47+
## Development Commands
48+
49+
### Code Formatting
50+
51+
```bash
52+
pnpm prettier . --check --config .prettierrc.json # Check formatting
53+
pnpm prettier . --write --config .prettierrc.json # Fix formatting
54+
```
55+
56+
### Data Processing
57+
58+
```bash
59+
node process.mjs # Generate lookup tables from dataset files
60+
```
61+
62+
### Package Management
63+
64+
```bash
65+
pnpm install # Install dependencies (uses pnpm)
66+
```
67+
68+
## CI/CD Pipeline
69+
70+
The GitHub Actions workflow (`build-pr.yml`) automatically:
71+
72+
1. **Lint**: Runs Prettier formatting checks
73+
2. **Process**: Executes `process.mjs` to generate output files
74+
3. **Release**: Creates automatic releases with generated JSON files (main branch only)
75+
76+
## Code Style
77+
78+
- Uses Prettier with custom configuration (`.prettierrc.json`)
79+
- JSON files are automatically sorted recursively
80+
- 4-space indentation, single quotes, no semicolons
81+
- ES modules (`.mjs` extension for Node.js scripts)
82+
83+
## Data Sources for Updates
84+
85+
**Primary Sources:**
86+
87+
- **Apple Newsroom** - https://www.apple.com/newsroom/ (official announcements and device names)
88+
- **adamawolf GitHub gist** - https://gist.github.com/adamawolf/3048717 (most up-to-date model identifiers like iPhone18,1)
89+
- **AppleDB** - https://appledb.dev/ (comprehensive device database with SoC info)
90+
- **EveryMac.com** - https://everymac.com/ (detailed technical specifications and processor families)
91+
92+
**Data Update Process:**
93+
When asked to update data or check for updates:
94+
95+
1. **Cross-reference sources** - Check adamawolf GitHub gist and AppleDB for new model identifiers
96+
2. **Verify official names** - Confirm device names and specs with Apple Newsroom
97+
3. **Get technical details** - Use EveryMac.com for processor families and device classifications
98+
4. **Update dataset files** in priority order:
99+
- `dataset/iphones.json` (highest priority)
100+
- `dataset/ipads.json`
101+
- `dataset/macs.json`
102+
- `dataset/wearables.json`
103+
- `dataset/appletvs.json`
104+
- `dataset/other.json`
105+
5. **Process and format**:
106+
107+
```bash
108+
node process.mjs
109+
pnpm prettier . --write --config .prettierrc.json
110+
```
111+
112+
6. **Verify changes and quality control**:
113+
114+
```bash
115+
git status # Check which files were modified
116+
git diff --name-status # See summary of all changes
117+
git diff dataset/ # Review all dataset changes in detail
118+
git diff --stat # Get statistical summary of changes
119+
```
120+
121+
- **Review all changes carefully** - Ensure only intended additions/modifications were made
122+
- **Verify no devices were accidentally removed** - Check that existing entries are preserved
123+
- **Double-check technical accuracy** - Confirm processor families, device types, and naming conventions
124+
- **Cross-reference with 3rd source** - Optionally verify new entries with EveryMac.com or Apple Support docs
125+
- **Validate data consistency** - Ensure new entries follow the same schema and naming patterns as existing data
126+
127+
Always confirm at least 2 sources agree on device information before adding entries.

dataset/appletvs.json

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
11
{
2+
"AppleTV11,1": {
3+
"deviceType": "Set-Top Box",
4+
"processorFamily": "A12",
5+
"readableName": "Apple TV 4K (2nd generation)"
6+
},
7+
"AppleTV14,1": {
8+
"deviceType": "Set-Top Box",
9+
"processorFamily": "A15",
10+
"readableName": "Apple TV 4K (3rd generation)"
11+
},
212
"AppleTV2,1": {
313
"deviceType": "Set-Top Box",
414
"processorFamily": "S5L8930",
@@ -22,6 +32,6 @@
2232
"AppleTV6,2": {
2333
"deviceType": "Set-Top Box",
2434
"processorFamily": "A10X",
25-
"readableName": "Apple TV 4K"
35+
"readableName": "Apple TV 4K (1st generation)"
2636
}
2737
}

dataset/ipads.json

Lines changed: 61 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,31 @@
119119
"processorFamily": "A15 Bionic",
120120
"readableName": "iPad mini (6th generation) (WiFi)"
121121
},
122+
"iPad14,10": {
123+
"deviceType": "Tablet",
124+
"processorFamily": "M2",
125+
"readableName": "iPad Air 13-inch (6th generation) (WiFi+Cellular)"
126+
},
127+
"iPad14,11": {
128+
"deviceType": "Tablet",
129+
"processorFamily": "M2",
130+
"readableName": "iPad Air 11-inch (6th generation) (WiFi)"
131+
},
132+
"iPad14,12": {
133+
"deviceType": "Tablet",
134+
"processorFamily": "M2",
135+
"readableName": "iPad Air 11-inch (6th generation) (WiFi+Cellular)"
136+
},
137+
"iPad14,13": {
138+
"deviceType": "Tablet",
139+
"processorFamily": "M2",
140+
"readableName": "iPad Air 13-inch (6th generation) (WiFi)"
141+
},
142+
"iPad14,14": {
143+
"deviceType": "Tablet",
144+
"processorFamily": "M2",
145+
"readableName": "iPad Air 13-inch (6th generation) (WiFi+Cellular)"
146+
},
122147
"iPad14,2": {
123148
"deviceType": "Tablet",
124149
"processorFamily": "A15 Bionic",
@@ -141,9 +166,44 @@
141166
},
142167
"iPad14,6": {
143168
"deviceType": "Tablet",
144-
"processorFamily": "",
169+
"processorFamily": "M2",
145170
"readableName": "iPad Pro 12.9-inch (6th generation) (WiFi+Cellular)"
146171
},
172+
"iPad14,7": {
173+
"deviceType": "Tablet",
174+
"processorFamily": "M2",
175+
"readableName": "iPad Air 11-inch (6th generation) (WiFi)"
176+
},
177+
"iPad14,8": {
178+
"deviceType": "Tablet",
179+
"processorFamily": "M2",
180+
"readableName": "iPad Air 11-inch (6th generation) (WiFi+Cellular)"
181+
},
182+
"iPad14,9": {
183+
"deviceType": "Tablet",
184+
"processorFamily": "M2",
185+
"readableName": "iPad Air 13-inch (6th generation) (WiFi)"
186+
},
187+
"iPad16,3": {
188+
"deviceType": "Tablet",
189+
"processorFamily": "M4",
190+
"readableName": "iPad Pro 11-inch (5th generation) (WiFi)"
191+
},
192+
"iPad16,4": {
193+
"deviceType": "Tablet",
194+
"processorFamily": "M4",
195+
"readableName": "iPad Pro 11-inch (5th generation) (WiFi+Cellular)"
196+
},
197+
"iPad16,5": {
198+
"deviceType": "Tablet",
199+
"processorFamily": "M4",
200+
"readableName": "iPad Pro 13-inch (5th generation) (WiFi)"
201+
},
202+
"iPad16,6": {
203+
"deviceType": "Tablet",
204+
"processorFamily": "M4",
205+
"readableName": "iPad Pro 13-inch (5th generation) (WiFi+Cellular)"
206+
},
147207
"iPad2,1": {
148208
"deviceType": "Tablet",
149209
"processorFamily": "A5",

dataset/iphones.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,11 @@
149149
"processorFamily": "A16",
150150
"readableName": "iPhone 15"
151151
},
152+
"iPhone15,5": {
153+
"deviceType": "Phone",
154+
"processorFamily": "A16",
155+
"readableName": "iPhone 15 Plus"
156+
},
152157
"iPhone16,1": {
153158
"deviceType": "Phone",
154159
"processorFamily": "A17 Pro",

dataset/macs.json

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,90 @@
157157
"readableName": "MacBook Pro (16-inch, Nov 2023)",
158158
"systemFirstRelease": "12.2"
159159
},
160+
"Mac16,1": {
161+
"deviceType": "Laptop",
162+
"processorFamily": "M4",
163+
"processorType": "Apple Silicon",
164+
"readableName": "MacBook Pro (14-inch, Nov 2024)",
165+
"systemFirstRelease": "15.0"
166+
},
167+
"Mac16,10": {
168+
"deviceType": "Desktop",
169+
"processorFamily": "M4",
170+
"processorType": "Apple Silicon",
171+
"readableName": "Mac mini (2024)",
172+
"systemFirstRelease": "15.0"
173+
},
174+
"Mac16,11": {
175+
"deviceType": "Desktop",
176+
"processorFamily": "M4 Pro",
177+
"processorType": "Apple Silicon",
178+
"readableName": "Mac mini (2024)",
179+
"systemFirstRelease": "15.0"
180+
},
181+
"Mac16,12": {
182+
"deviceType": "Laptop",
183+
"processorFamily": "M4",
184+
"processorType": "Apple Silicon",
185+
"readableName": "MacBook Air (13-inch, M4, 2025)",
186+
"systemFirstRelease": "15.0"
187+
},
188+
"Mac16,13": {
189+
"deviceType": "Laptop",
190+
"processorFamily": "M4",
191+
"processorType": "Apple Silicon",
192+
"readableName": "MacBook Air (15-inch, M4, 2025)",
193+
"systemFirstRelease": "15.0"
194+
},
195+
"Mac16,2": {
196+
"deviceType": "Desktop",
197+
"processorFamily": "M4",
198+
"processorType": "Apple Silicon",
199+
"readableName": "iMac (24-inch, 2024)",
200+
"systemFirstRelease": "15.0"
201+
},
202+
"Mac16,3": {
203+
"deviceType": "Desktop",
204+
"processorFamily": "M4",
205+
"processorType": "Apple Silicon",
206+
"readableName": "iMac (24-inch, 2024)",
207+
"systemFirstRelease": "15.0"
208+
},
209+
"Mac16,5": {
210+
"deviceType": "Laptop",
211+
"processorFamily": "M4 Max",
212+
"processorType": "Apple Silicon",
213+
"readableName": "MacBook Pro (16-inch, Nov 2024)",
214+
"systemFirstRelease": "15.0"
215+
},
216+
"Mac16,6": {
217+
"deviceType": "Laptop",
218+
"processorFamily": "M4 Pro",
219+
"processorType": "Apple Silicon",
220+
"readableName": "MacBook Pro (14-inch, Nov 2024)",
221+
"systemFirstRelease": "15.0"
222+
},
223+
"Mac16,7": {
224+
"deviceType": "Laptop",
225+
"processorFamily": "M4 Pro",
226+
"processorType": "Apple Silicon",
227+
"readableName": "MacBook Pro (16-inch, Nov 2024)",
228+
"systemFirstRelease": "15.0"
229+
},
230+
"Mac16,8": {
231+
"deviceType": "Laptop",
232+
"processorFamily": "M4 Max",
233+
"processorType": "Apple Silicon",
234+
"readableName": "MacBook Pro (14-inch, Nov 2024)",
235+
"systemFirstRelease": "15.0"
236+
},
237+
"Mac16,9": {
238+
"deviceType": "Desktop",
239+
"processorFamily": "M4 Max",
240+
"processorType": "Apple Silicon",
241+
"readableName": "Mac Studio (2025)",
242+
"systemFirstRelease": "15.0"
243+
},
160244
"MacBook10,1": {
161245
"deviceType": "Laptop",
162246
"processorType": "Intel",

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"devDependencies": {
3-
"prettier": "^3.1.0",
3+
"prettier": "^3.6.2",
44
"prettier-plugin-sort-json": "^3.1.0"
55
}
66
}

0 commit comments

Comments
 (0)