Commit 87a901f
committed
feat(dlx): unify .dlx-metadata.json schema across TypeScript and C++
Standardize metadata format for cached binaries to match socket-lib's
canonical DlxMetadata schema.
TypeScript changes (packages/cli/src/utils/dlx/binary.mts):
- Update DlxMetadata interface to match socket-lib canonical schema
- Add comprehensive documentation with examples for both download and
decompression use cases
- Update writeMetadata() to include cache_key and size parameters
- Modify listDlxCache() to read from unified source.url field
- Reference socket-lib as canonical schema documentation
C++ changes (packages/node-smol-builder/additions/tools/socket_macho_decompress.cc):
- Restructure metadata output to use unified schema format
- Add platform/arch detection with preprocessor directives
- Move compression-specific data to extra object (compressed_size,
compression_algorithm, compression_ratio)
- Convert timestamp to milliseconds for JavaScript compatibility
- Add source.type and source.path fields for decompression tracking
Unified schema structure:
- Core fields: version, cache_key, timestamp, checksum, checksum_algorithm,
platform, arch, size, source
- Extra fields: Implementation-specific data (compression metrics for C++)
References socket-lib's exported DlxMetadata interface as canonical source.1 parent de7f728 commit 87a901f
File tree
2 files changed
+131
-19
lines changed- packages
- cli/src/utils/dlx
- node-smol-builder/additions/tools
2 files changed
+131
-19
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
44 | 103 | | |
45 | 104 | | |
| 105 | + | |
| 106 | + | |
46 | 107 | | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
51 | 119 | | |
52 | 120 | | |
53 | 121 | | |
| |||
101 | 169 | | |
102 | 170 | | |
103 | 171 | | |
104 | | - | |
| 172 | + | |
105 | 173 | | |
106 | 174 | | |
107 | 175 | | |
| |||
179 | 247 | | |
180 | 248 | | |
181 | 249 | | |
| 250 | + | |
182 | 251 | | |
183 | 252 | | |
| 253 | + | |
184 | 254 | | |
185 | 255 | | |
186 | | - | |
187 | | - | |
188 | | - | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
189 | 259 | | |
| 260 | + | |
| 261 | + | |
190 | 262 | | |
191 | 263 | | |
192 | | - | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
193 | 269 | | |
194 | 270 | | |
195 | 271 | | |
| |||
319 | 395 | | |
320 | 396 | | |
321 | 397 | | |
322 | | - | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
323 | 402 | | |
324 | 403 | | |
325 | 404 | | |
| |||
392 | 471 | | |
393 | 472 | | |
394 | 473 | | |
395 | | - | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
396 | 481 | | |
397 | 482 | | |
398 | 483 | | |
| |||
408 | 493 | | |
409 | 494 | | |
410 | 495 | | |
411 | | - | |
| 496 | + | |
412 | 497 | | |
413 | 498 | | |
414 | 499 | | |
| |||
Lines changed: 33 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
461 | 461 | | |
462 | 462 | | |
463 | 463 | | |
464 | | - | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
465 | 469 | | |
466 | 470 | | |
467 | | - | |
468 | | - | |
| 471 | + | |
469 | 472 | | |
| 473 | + | |
470 | 474 | | |
471 | 475 | | |
472 | | - | |
473 | | - | |
474 | | - | |
| 476 | + | |
| 477 | + | |
| 478 | + | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
475 | 502 | | |
476 | 503 | | |
477 | 504 | | |
| |||
0 commit comments