Skip to content

fix(postgrest-typegen): require Node 22.12 or newer - #214

Merged
spydon merged 1 commit into
mainfrom
lukasklingsbo/postgrest-typegen-node-22
Sep 25, 2026
Merged

spydon merged 1 commit into
mainfrom
lukasklingsbo/postgrest-typegen-node-22

Conversation

@spydon

@spydon spydon commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

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-typegen now declares engines.node as >=22.12.0, replacing >=20.0.0.

  • The package ships ES modules only and its require export condition resolves to one. Node accepts require() of an ES module without a flag from 22.12.0; on earlier versions it throws ERR_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.
  • Node 20 reached end of life in April 2026 and Node 21 was never a long-term-support line, so neither is worth keeping in the range.
  • postgres-meta, the one consumer that runs this package under Node, is on Node 22 in its Dockerfile and .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.

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
spydon requested a review from a team as a code owner September 25, 2026 07:22
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.
@coderabbitai

coderabbitai Bot commented Sep 25, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 29 minutes.

Check out review usage here.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Advanced

Run ID: 7012458f-25bb-4bbc-ac53-1b113c009568

📥 Commits

Reviewing files that changed from the base of the PR and between 468306d and 84afae8.

📒 Files selected for processing (1)
  • packages/postgrest-typegen/package.json

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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
spydon merged commit c6de214 into main Sep 25, 2026
4 checks passed
@spydon
spydon deleted the lukasklingsbo/postgrest-typegen-node-22 branch September 25, 2026 07:46
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants