Repository navigation
fix(postgrest-typegen): require Node 22.12 or newer - #214
Merged
Merged
Conversation
The package ships ES modules only and its `require` export condition resolves to one, which Node accepts without a flag from 22.12.0. Node 20 reached end of life in April 2026 and Node 21 was never an LTS line. postgres-meta, the one Node consumer, already runs on 22. Matches the range @supabase/typegen declares.
spydon
added a commit
that referenced
this pull request
Sep 25, 2026
…pull request It lives in #214 now, so release-please records it as a patch on postgrest-typegen instead of attributing this feature to that package.
|
Warning Review limit reachedNext included review available in 29 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Tr00d
approved these changes
Sep 25, 2026
spydon
added a commit
that referenced
this pull request
Sep 25, 2026
… consumers (#213) Follow-up to #211 (SDK-1955), preparing for the CLI adapter in SDK-1956. ## Summary - `@supabase/typegen` re-exports `introspect`, `Queryable`, `IntrospectOptions`, `GeneratorMetadata` and `GENERATOR_METADATA_VERSION` from `@supabase/postgrest-typegen`. The CLI can then depend on the registry alone: one dependency to bump when a language is added, and the document is always produced by the same `postgrest-typegen` version the in-process generators were built against. Depending on both packages directly would let a lockfile resolve two versions, introspecting with one and generating with the other. - `@supabase/typegen` now declares `engines.node` as `>=22.12.0`. It ships ES modules only and its `require` export condition resolves to one, the finding CodeRabbit raised on #211; 22.12.0 is the first Node 22 release that accepts that without a flag. Node 20 reached end of life in April 2026 and Node 21 was never an LTS line, so neither is worth keeping in the range. The same change for `@supabase/postgrest-typegen` is #214, kept separate so release-please records it as a patch on that package. The Supabase CLI is unaffected either way: it compiles with Bun and bundles both packages. - Two changes that prepare postgres-meta for dispatching its hosted `/generators/*` routes through the registry. The Swift option now accepts all four generator access levels (`internal`, `public`, `private`, `package`), since postgres-meta's route always did and extra choices change nothing for existing CLI users. `Host.spawn` is optional: a hosted service cannot run processes, so an out-of-process language asked to generate without one fails with a `SpawnUnavailableError` rather than the consumer stubbing a runner. - `postgrest-v9-compat` is gone as a registry option. It was the CLI's inverted name for the generator's `detectOneToOneRelationships`, only ever worked with `--db-url`, and targets PostgREST 9 from 2022; the CLI sniffs the local stack's PostgREST version itself and postgres-meta's route exposes the positive parameter. The option is now `detect-one-to-one-relationships`, a consumer option defaulting to `true`, so both consumers set it from what they know about the target and no user sees a 2022 compatibility switch. TypeScript therefore has no user flags; `swift-access-control` is the only one left in the registry. The CLI adapter (SDK-1956) keeps `--postgrest-v9-compat` as a deprecated alias that sets the option to `false`. ## Changes - `packages/typegen/src/index.ts`: the re-exports, with a comment stating why. - `packages/typegen/test/reexports.test.ts`: `introspect` is the same function `postgrest-typegen` exports and the document version matches. - `packages/typegen/README.md` and `CLAUDE.md`: the usage example imports `introspect` from `@supabase/typegen`, and the "Where it sits" section explains the single-dependency rule. - `packages/typegen/package.json`: engines range. - `packages/typegen/src/contract.ts`: the `Host` comment points at the re-exported `introspect()`; `spawn` is optional. - `packages/typegen/src/errors.ts` and `src/languages/external.ts`: `SpawnUnavailableError`. - `packages/typegen/src/languages/index.ts`: Swift choice list; `detect-one-to-one-relationships` replaces `postgrest-v9-compat`. ## Notes - The re-export is a plain pass-through; postgrest-typegen remains the implementation and its own release cadence is unchanged. - This PR touches only `packages/typegen`, so the squash commit lands in the typegen changelog alone.
spydon
pushed a commit
that referenced
this pull request
Sep 25, 2026
🤖 I have created a release *beep* *boop* --- ## [0.2.4](postgrest-typegen/v0.2.3...postgrest-typegen/v0.2.4) (2026-09-25) ### Bug Fixes * **postgrest-typegen:** require Node 22.12 or newer ([#214](#214)) ([c6de214](c6de214)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: supabase-releaser[bot] <223506987+supabase-releaser[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split out of #213 so release-please records it as a patch on postgrest-typegen rather than folding it into the typegen feature.
Summary
@supabase/postgrest-typegennow declaresengines.nodeas>=22.12.0, replacing>=20.0.0.requireexport condition resolves to one. Node acceptsrequire()of an ES module without a flag from 22.12.0; on earlier versions it throwsERR_REQUIRE_ESM, so the old range advertised support that did not work for CommonJS consumers. CodeRabbit raised this on feat(typegen): add language registry package so new languages need no CLI change #211 for@supabase/typegen, which already declares the same range..nvmrc. The Supabase CLI is unaffected: it compiles with Bun and bundles the package.Consequence
Anyone installing on Node 20 will now see an engines warning. That is a declared-support change on a published package, not a behavior change: nothing in the package differs between the two ranges.