Commit 58a7c4d
authored
Add Node 24 support and refactor version-to-archive mapping (#1373)
* Add Node 24 support and refactor version-to-archive mapping
Refactors Node version management to use a tuple array mapping versions to nix archive hashes, similar to the Swift and Go providers. This makes it easier to maintain and add new Node versions.
- Add Node 24 support with specific nix archive (23f9169c4ccce521379e602cc82ed873a1f1b52b)
- Remove Node 23 (was unreachable due to LTS filtering)
- Add Node 22-specific nix archive (e6f23dc08d3624daab7094b701aa3954923c6bbb)
- Update Bun nixpkgs archive to 31fb21469e34b6b5c7be77b9a35bae43d0c598e9
- Refactor AVAILABLE_NODE_VERSIONS from array to tuple array with archive hashes
- Replace if/else chain in get_nix_archive() with lookup function
- Add version_number_to_archive() helper function
- Add pnpm 10 support (lockfileVersion 9.0)
- Add node-24-pnpm-10 example
* lint fix
* Fix pnpm version detection to respect packageManager field
Both pnpm 9 and 10 use lockfileVersion '9.0', making them
indistinguishable by lockfile alone. This fix prioritizes the
packageManager field in package.json when determining which pnpm
version to use.
Changes:
- Parse packageManager field (e.g., "[email protected]") to extract version
- Map parsed version to appropriate nix package (pnpm-9_x, pnpm-10_x)
- Fall back to lockfile detection only when packageManager is absent
- Default lockfileVersion '9.0' to pnpm-9_x (when introduced)
- Add packageManager field to node-24-pnpm-10 example for pnpm 10
- Update test snapshots
This ensures pnpm 10 is only used when explicitly specified in the
packageManager field, fixing the node-pnpm-corepack example which
was incorrectly using pnpm-10_x instead of pnpm-9_x.
* Fix clippy and dead_code warnings
- Remove unused PackageJsonNx and PackageJsonNxTargets structs
- Simplify pnpm lockfile detection by removing redundant else-if branch1 parent 1234b3b commit 58a7c4d
File tree
13 files changed
+199
-44
lines changed- examples/node-24-pnpm-10
- node_modules
- src
- nixpacks/plan
- providers/node
- tests/snapshots
13 files changed
+199
-44
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 25 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
53 | | - | |
| 53 | + | |
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
| 29 | + | |
34 | 30 | | |
35 | 31 | | |
36 | | - | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
37 | 43 | | |
38 | 44 | | |
39 | 45 | | |
| |||
502 | 508 | | |
503 | 509 | | |
504 | 510 | | |
505 | | - | |
506 | 511 | | |
507 | | - | |
508 | | - | |
509 | | - | |
510 | | - | |
511 | | - | |
512 | | - | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
513 | 515 | | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
514 | 532 | | |
515 | 533 | | |
516 | 534 | | |
| |||
529 | 547 | | |
530 | 548 | | |
531 | 549 | | |
532 | | - | |
533 | | - | |
534 | | - | |
535 | | - | |
536 | | - | |
537 | | - | |
538 | | - | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
539 | 576 | | |
540 | | - | |
541 | | - | |
| 577 | + | |
| 578 | + | |
542 | 579 | | |
543 | 580 | | |
544 | 581 | | |
| |||
647 | 684 | | |
648 | 685 | | |
649 | 686 | | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
650 | 701 | | |
651 | 702 | | |
652 | 703 | | |
| |||
682 | 733 | | |
683 | 734 | | |
684 | 735 | | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
685 | 743 | | |
686 | | - | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
687 | 749 | | |
688 | 750 | | |
689 | 751 | | |
| |||
698 | 760 | | |
699 | 761 | | |
700 | 762 | | |
701 | | - | |
702 | | - | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
703 | 766 | | |
704 | 767 | | |
705 | 768 | | |
706 | 769 | | |
707 | 770 | | |
708 | 771 | | |
709 | 772 | | |
710 | | - | |
| 773 | + | |
711 | 774 | | |
712 | 775 | | |
713 | 776 | | |
| |||
799 | 862 | | |
800 | 863 | | |
801 | 864 | | |
802 | | - | |
| 865 | + | |
803 | 866 | | |
804 | 867 | | |
805 | 868 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | 48 | | |
59 | 49 | | |
60 | 50 | | |
| |||
Lines changed: 55 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
0 commit comments