Commit d0d1a8f
Rewatch: restore backward compatibility for bsconfig.json (#8368)
* Rewatch: restore backward compatibility for bsconfig.json
Accept the legacy config file name and the old field aliases
(bs-dependencies, bs-dev-dependencies, bsc-flags) so existing
packages continue to build. Emit a deprecation warning on the
legacy field names pointing at the modern replacements.
Co-Authored-By: Claude <noreply@anthropic.com>
* Format
Co-Authored-By: Claude <noreply@anthropic.com>
* Rewatch: deprecation warning when bsconfig.json filename is used
Co-Authored-By: Claude <noreply@anthropic.com>
* Rewatch: fall back to bsconfig.json for package name lookup; update legacy-config test
read_package_name now also looks inside bsconfig.json if neither
package.json nor rescript.json carry the package name. The
warn_legacy_config build test is updated to assert the new behavior
(build succeeds + deprecation warning is printed).
Co-Authored-By: Claude <noreply@anthropic.com>
* Rewatch: surface bsconfig/bs-* deprecations for external packages too
External packages can't fix these themselves, so the warning now
fires for any package (local or external). For external packages we
also look up an issue tracker URL from bugs/repository in package.json
and include it so users can report the issue upstream.
Co-Authored-By: Claude <noreply@anthropic.com>
* Rewatch: sort packages alphabetically when logging config warnings; refresh snapshots
Sorting the package iteration makes the warning output stable across
runs (AHashMap iteration order is otherwise nondeterministic). Snapshot
files are updated to reflect both the new deprecation messages
(bs-dependencies/bs-dev-dependencies/bsc-flags for @testrepo/deprecated-config,
and for the external rescript-nodejs + sury packages plus the
bsconfig.json filename deprecation on rescript-nodejs) and the new
sorted order.
Co-Authored-By: Claude <noreply@anthropic.com>
* Rewatch: trigger full rebuild on bsconfig.json changes in watch mode
Previously watch mode only upgraded rescript.json changes to a full
rebuild. In a bsconfig-only project, editing config fields did not
trigger recompilation, so the running watcher kept stale build state
until restarted.
Co-Authored-By: Claude <noreply@anthropic.com>
* Rewatch: consolidate per-package deprecation warnings into one block
Previously each deprecated field/filename printed its own paragraph,
which was noisy (especially for packages with multiple legacy fields,
like rescript-nodejs). The issue-tracker URL was also repeated per
warning. Collapsed into a single block per package:
Package 'foo' uses deprecated config (support will be removed in a future version):
- field 'bs-dependencies' — use 'dependencies' instead
- filename 'bsconfig.json' — rename to 'rescript.json'
Please report this to the package maintainer: https://…/issues
Snapshots and the warn_legacy_config build test are updated to match.
Co-Authored-By: Claude <noreply@anthropic.com>
* Format warn_legacy_config/input.js per biome
Co-Authored-By: Claude <noreply@anthropic.com>
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent c6bf334 commit d0d1a8f
16 files changed
Lines changed: 480 additions & 72 deletions
File tree
- rewatch
- src
- build
- tests
- snapshots
- tests/build_tests/warn_legacy_config
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
483 | 483 | | |
484 | 484 | | |
485 | 485 | | |
486 | | - | |
487 | | - | |
| 486 | + | |
| 487 | + | |
| 488 | + | |
| 489 | + | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
488 | 501 | | |
489 | 502 | | |
490 | 503 | | |
| |||
501 | 514 | | |
502 | 515 | | |
503 | 516 | | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
504 | 555 | | |
505 | 556 | | |
506 | 557 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
251 | 251 | | |
252 | 252 | | |
253 | 253 | | |
254 | | - | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
255 | 261 | | |
256 | 262 | | |
257 | 263 | | |
| |||
451 | 457 | | |
452 | 458 | | |
453 | 459 | | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
454 | 464 | | |
455 | 465 | | |
456 | 466 | | |
457 | 467 | | |
458 | 468 | | |
459 | 469 | | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 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 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
460 | 506 | | |
461 | 507 | | |
462 | 508 | | |
| |||
1100 | 1146 | | |
1101 | 1147 | | |
1102 | 1148 | | |
1103 | | - | |
| 1149 | + | |
1104 | 1150 | | |
1105 | 1151 | | |
1106 | 1152 | | |
| |||
1235 | 1281 | | |
1236 | 1282 | | |
1237 | 1283 | | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
| 1302 | + | |
| 1303 | + | |
| 1304 | + | |
| 1305 | + | |
| 1306 | + | |
| 1307 | + | |
| 1308 | + | |
| 1309 | + | |
| 1310 | + | |
| 1311 | + | |
| 1312 | + | |
| 1313 | + | |
| 1314 | + | |
| 1315 | + | |
| 1316 | + | |
| 1317 | + | |
| 1318 | + | |
| 1319 | + | |
| 1320 | + | |
| 1321 | + | |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
1238 | 1357 | | |
0 commit comments