Skip to content

Commit

Permalink
add top-level comment explaining the versions.ts wrapper module
Browse files Browse the repository at this point in the history
  • Loading branch information
David Herman committed Dec 9, 2023
1 parent 71158aa commit 168540d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkgs/create-neon/src/versions.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
// This whole module is a bummer but was the best I could figure out since:
// - Using @sindresorhus packages like 'chalk' and 'execa' forces a project to use Node's native ESM support.
// - This means the tsconfig must generate a modern format like es2022.
// - When generating ESM, TS doesn't support importing JSON files with static typing without import assertions.
// - Import assertions are not yet stable in Node, and produce an instability warning.
//
// So for the time being, this module simply implements the static typing explicitly.
// If and when TS adds back and way to infer the static types when importing a JSON file
// and generates a stable format that Node doesn't complain about, we can eliminate this
// boilerplate wrapper module.

import { createRequire } from 'module';

export type Versions = {
Expand Down

0 comments on commit 168540d

Please sign in to comment.