Harvest Module
Tier 1 - Harvest: the Wire-driven inventory of what the author exported. No mapping decisions live here; the tier's invariant is that every export of the entry module appears exactly once, aliases followed to their origin.
Functions and values
| Function or value |
Description
|
|
Documentation for every harvested export, from the checker rather than the syntax tree so merged declarations already read as one.
|
|
The entry module's exports, each followed through `getAliasedSymbol` to its origin so that re-exports and default-export aliases land on the declaring symbol. A global type library (`@cloudflare/workers-types`, `@types/*` that declare no module) has no module symbol at all. That is not an error and not an escape: the pass advances with nothing, and `harvest-globals` picks the file's ambient declarations up instead.
|
|
The entry package's ambient global declarations, for a package that declares no module at all. Asking the checker for the symbols in scope at the top of the entry file returns the whole global environment - three thousand names for `@cloudflare/workers-types`, two thirds of them `lib.dom.d.ts` - so the result is filtered to the symbols the package itself declares, by the same O7 placement the resolve tier groups types with. An ambient module declaration (`declare module "cloudflare:email"`) arrives here too, under a symbol name that is its quoted specifier. Its exports are harvested under `FromAmbientModule`: the types are declared beside the package's globals, and the values carry the specifier's own import. Runs only when `harvest-exports` found nothing: a package with a module symbol may also augment the global scope, and folding those globals into its exports would emit names the package does not export.
|
|
Fixes the output order: source order of the first declaration, then export name as the tiebreak. Exports with no declaration handle sort last.
|
|
The tier's pass list, in execution order.
|