Commit c70e536
Emit intersection type in shopify.d.ts when target re-exports ShopifyGlobal
The CLI-generated shopify.d.ts now types the `shopify` binding as
`Api & ShopifyGlobal` for UI extension targets whose .d.ts re-exports
a type named `ShopifyGlobal`. Detection is AST-based via the typescript
compiler API (already a dependency), matching on the public export name
`ShopifyGlobal` so the CLI does not need to know about specific surfaces
or targets.
Targets that do not re-export `ShopifyGlobal` emit byte-identical output
to main. Existing consumers who access the target API via `shopify.*`
are unaffected. Net effect: host-level APIs like `shopify.addEventListener`
now type-check automatically for opt-in targets (e.g. POS background
extensions) without any CLI release coordination when new targets opt in.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent a61a9f2 commit c70e536
3 files changed
Lines changed: 166 additions & 17 deletions
File tree
- .changeset
- packages/app/src/cli/models/extensions/specifications
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 72 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
166 | 166 | | |
167 | 167 | | |
168 | 168 | | |
169 | | - | |
170 | | - | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
171 | 175 | | |
172 | | - | |
173 | | - | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
174 | 184 | | |
175 | | - | |
176 | | - | |
177 | | - | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
178 | 203 | | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
179 | 207 | | |
180 | | - | |
181 | | - | |
182 | | - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
183 | 233 | | |
184 | 234 | | |
185 | | - | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
186 | 238 | | |
187 | 239 | | |
188 | 240 | | |
| |||
193 | 245 | | |
194 | 246 | | |
195 | 247 | | |
196 | | - | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
197 | 252 | | |
198 | 253 | | |
199 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
200 | 258 | | |
201 | 259 | | |
202 | | - | |
203 | 260 | | |
204 | 261 | | |
205 | 262 | | |
| |||
209 | 266 | | |
210 | 267 | | |
211 | 268 | | |
212 | | - | |
| 269 | + | |
213 | 270 | | |
214 | 271 | | |
215 | 272 | | |
| |||
224 | 281 | | |
225 | 282 | | |
226 | 283 | | |
227 | | - | |
228 | 284 | | |
229 | 285 | | |
230 | 286 | | |
| |||
Lines changed: 89 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1177 | 1177 | | |
1178 | 1178 | | |
1179 | 1179 | | |
| 1180 | + | |
1180 | 1181 | | |
1181 | 1182 | | |
1182 | 1183 | | |
1183 | 1184 | | |
1184 | 1185 | | |
1185 | 1186 | | |
| 1187 | + | |
1186 | 1188 | | |
1187 | 1189 | | |
1188 | 1190 | | |
| |||
1197 | 1199 | | |
1198 | 1200 | | |
1199 | 1201 | | |
1200 | | - | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
1201 | 1207 | | |
1202 | 1208 | | |
1203 | 1209 | | |
| |||
1367 | 1373 | | |
1368 | 1374 | | |
1369 | 1375 | | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
| 1397 | + | |
| 1398 | + | |
| 1399 | + | |
| 1400 | + | |
| 1401 | + | |
| 1402 | + | |
| 1403 | + | |
| 1404 | + | |
| 1405 | + | |
| 1406 | + | |
| 1407 | + | |
| 1408 | + | |
| 1409 | + | |
| 1410 | + | |
| 1411 | + | |
| 1412 | + | |
| 1413 | + | |
| 1414 | + | |
| 1415 | + | |
| 1416 | + | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
1370 | 1458 | | |
1371 | 1459 | | |
1372 | 1460 | | |
| |||
0 commit comments