# Migrate to Rolldown as the packages builder

100 files changed, +1250 −707 in date-fns/date-fns. The author left no usable description, so this brief describes structure only.

| | |
| --- | --- |
| Status | MERGED |
| Source | github:date-fns/date-fns#4211 |
| Original | https://github.com/date-fns/date-fns/pull/4211 |
| Workspace | Showcase |
| Tags | github, code, toml, typescript, json, sh |

## What it does

**The change is spread across 100 files in 5 areas, with no single file dominating.**

100 files changed across 5 areas of date-fns/date-fns, 1250 added and 707 removed.

The author left no description on this change, so nothing below comes from their account of it.

**Diagram: Where the change landed. Node size is not to scale; the line counts are exact.**

- date-fns (100 files, 1957 lines) [accent]
- Config (62 files, 1095 lines) [bad]
- Build & CI (7 files, 356 lines) [bad]
- Source (20 files, 333 lines) [accent]
- Docs (8 files, 110 lines) [neutral]
- Tests (3 files, 63 lines) [good]
- pnpm-lock.yaml (+92 −18) [neutral]
- date-fns -> Config
- date-fns -> Build & CI
- date-fns -> Source
- date-fns -> Docs
- date-fns -> Tests
- Config -> pnpm-lock.yaml : heaviest

- **Heaviest file.** pkgs/core/scripts/build/package.sh, +119 −168, which is 15% of the change.
- **Tests moved with it.** 3 test files changed alongside 20 source files.
- **Configuration touched.** pnpm-lock.yaml, mise.toml, pnpm-lock.yaml. Config changes are small in the diff and large in effect.
- **Spread.** 100 files, 1957 changed lines in total.

## How it works

**The largest single edit is in types.ts.**

Quoted verbatim from the diff. This is the biggest hunk by changed lines, which is where a reviewer's attention usually belongs first.

**Diagram: Source files matched to test files by filename. A name-based match, so treat it as a prompt to look rather than as proof.**

- NO TEST CHANGED (19)
  - test.ts (+20 −0) [bad]
  - test.ts (+20 −0) [bad]
  - test.js (+19 −0) [bad]
  - fp.ts (+0 −19) [bad]
  - test.cjs (+17 −0) [bad]
- TEST CHANGED TOO (1)
  - package.ts (+90 −0) [good]

```typescript
@@ -233,35 +233,35 @@ export namespace DateFnsDocs {
       text?: string;
     };
   }
-
-  /**
-   * The copy of TypeDoc ReflectionKind enum. We copy it here to avoid importing
-   * typedoc.
-   */
-  export enum ReflectionKind {
-    Project = 1,
-    Module = 2,
-    Namespace = 4,
-    Enum = 8,
-    EnumMember = 16,
-    Variable = 32,
-    Function = 64,
-    Class = 128,
-    Interface = 256,
-    Constructor = 512,
-    Property = 1024,
-    Method = 2048,
```

_pkgs/docs/src/types.ts, +32 −32. The largest hunk in the largest file._

## File map

**Every file this change touches, heaviest first.**

Role is inferred from the path and risk from the path and the line count. Neither was read from the code.

| File | Role | Change | Risk |
| --- | --- | --- | --- |
| `pkgs/core/scripts/build/package.sh` | application code | modified, patch unavailable (generated or vendored file) | high |
| `pkgs/core/examples/pnpm-lock.yaml` | application code | modified, patch unavailable (generated or vendored file) | high |
| `pkgs/dev/src/build/package.ts` | application code | added, patch unavailable (generated or vendored file) | medium |
| `pkgs/core/mise.toml` | application code | modified, +77 −5 | medium |
| `pkgs/tz/examples/pnpm-lock.yaml` | application code | added, patch unavailable (generated or vendored file) | high |
| `pkgs/utc/examples/pnpm-lock.yaml` | application code | added, patch unavailable (generated or vendored file) | high |
| `pkgs/docs/src/types.ts` | application code | modified, +32 −32 | medium |
| `pkgs/core/babel.config.json` | application code | removed, +0 −62 | medium |
| `pkgs/tz/babel.config.json` | application code | removed, +0 −53 | medium |
| `pkgs/utc/babel.config.json` | application code | removed, +0 −53 | medium |
| `pkgs/core/scripts/test/smoke.sh` | test coverage | removed, +0 −40 | low |
| `pkgs/tz/examples/cts/tsconfig.json` | application code | added, +29 −0 | low |
| `pkgs/utc/examples/cts/tsconfig.json` | application code | added, +29 −0 | low |
| `pkgs/tz/examples/ts/tsconfig.json` | application code | added, +28 −0 | low |
| `pkgs/core/examples/webpack/mise.toml` | application code | added, +27 −0 | low |
| `pkgs/core/examples/rollup/mise.toml` | application code | added, +26 −0 | low |
| `pkgs/tz/mise.toml` | application code | modified, +22 −0 | low |
| `pkgs/core/scripts/build/modularized.ts` | application code | modified, patch unavailable (generated or vendored file) | low |
| `pkgs/core/examples/typescript/package.json` | application code | removed, +0 −21 | low |
| `pkgs/core/scripts/test/types.sh` | test coverage | removed, +0 −21 | low |
| `pkgs/core/examples/cts/test.ts` | test coverage | added, +20 −0 | low |
| `pkgs/core/examples/ts/test.ts` | test coverage | added, +20 −0 | low |
| `pkgs/core/examples/esm/test.js` | test coverage | added, +19 −0 | low |
| `pkgs/core/examples/typescript/fp.ts` | application code | removed, +0 −19 | low |

## Receipts

**Where each number above comes from.**

All of it is arithmetic over the file list and the check results, so it can be recomputed from the source.

- **Claim.** Repeated block: 6 occurrences.
  - Evidence: [tasks.test]
depends = ["install", "types"]
run = "node test.ts"
  - Where: pkgs/core/examples/cts/mise.toml
- **Claim.** 100 files changed, +1250 −707.
  - Evidence: pkgs/core/mise.toml (+77 −5); pkgs/docs/src/types.ts (+32 −32); pkgs/core/babel.config.json (+0 −62)
  - Where: https://github.com/date-fns/date-fns/pull/4211
- **Claim.** package.sh carries 15% of the changed lines.
  - Evidence: 287 of 1957 changed lines
  - Where: pkgs/core/scripts/build/package.sh
- **Claim.** It arrived as 1 commit.
  - Evidence: Migrate to Rolldown as the packages builder
  - Where: commit 41e4f64
- **Claim.** CI reports 0 failing of 10.
  - Evidence: tests
  - Where: CI check: tests

## Where to attack

**What the shape of this diff suggests looking at first.**

These come from structure alone: which areas were touched, what was not touched alongside them, and what CI says. None of them is a judgement about the code.

- **Configuration changed** (high)
  - pkgs/core/examples/pnpm-lock.yaml, pkgs/core/mise.toml, pkgs/tz/examples/pnpm-lock.yaml changed. A config edit is usually a handful of lines and decides behaviour for an entire environment, so diff size is a poor guide to its blast radius.
  - Mitigation: Check what reads each of these values, and in which environments they differ.
- **10 files have no visible patch** (low)
  - package.sh, pnpm-lock.yaml, package.ts could not be retrieved, so nothing in this brief accounts for their contents.
  - Mitigation: Open these directly in the source.

## Merge order

**A reading order for the review, not a deployment plan.**

Ordered by how expensive each part is to get wrong, which is a structural property rather than an informed one.

1. **Review the configuration changes.** pnpm-lock.yaml, mise.toml, pnpm-lock.yaml. Smallest diff, widest effect.
2. **Then package.sh.** The largest single file in the change, +119 −168.
3. **Finish with the tests.** 3 test files changed. Reading them last tells you what the author believed they were changing.

## What this brief could not check

- No language model read this change. Every statement here is computed from file paths, line counts, and CI status, so it describes the shape of the diff and not what the diff means.
- 10 patch(es) were not retrieved, so any file among them is described by its stat line only.
