Update dependency @crossplane-org/function-sdk-typescript to ^0.7.0 - #22
Open
renovate[bot] wants to merge 1 commit into
Open
Update dependency @crossplane-org/function-sdk-typescript to ^0.7.0#22renovate[bot] wants to merge 1 commit into
renovate[bot] wants to merge 1 commit into
Conversation
renovate
Bot
force-pushed
the
renovate/crossplane-org-function-sdk-typescript-0.x
branch
from
August 29, 2026 08:28
51954cb to
5494baf
Compare
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.
This PR contains the following updates:
^0.5.0→^0.7.0Release Notes
crossplane/function-sdk-typescript (@crossplane-org/function-sdk-typescript)
v0.7.0Compare Source
v0.7.0 -
serve(), a one-call function entrypointA function should not have to assemble a gRPC server to run. This release adds
serve(), which turns a function's entrypoint into a single call, andComposeFunction, which lets composition logic be a plain function rather than aclass implementing an interface.
This is a minor release: it only adds API. Nothing was removed or changed, so
FunctionHandlerimplementations and hand-built servers keep working exactly asthey did in v0.6.0.
Installation
What's Changed
serve()— the whole entrypointPreviously every function shipped its own copy of the same
main.ts: parse flags(usually with
commander, a dependency the SDK does not provide), build a pinologger, construct a
FunctionRunner, create a server, start it, and wire upsignal handlers. Roughly sixty lines, identical in every function, and a place for
functions to drift apart on flag names and shutdown behaviour.
That is now one call:
serve()parses the standard flags, builds a logger from--debug, starts thegRPC server, and shuts down cleanly on
SIGINTandSIGTERM. It accepts either aComposeFunctionor aFunctionHandler, so existing handlers can be passeddirectly.
Every function served this way accepts the same flags, with
--help:Flags come from
node:util'sparseArgs, so there is no new runtime dependency.An unrecognised flag prints the message and a pointer to
--help, then exits 2,rather than surfacing as a stack trace through Node's internals.
serve()takes an options object for the cases the defaults do not cover —namefor the program name in
--help,argv,logger, andserverOptionsoverridesapplied on top of the parsed flags. These mostly matter in tests.
ComposeFunction— composition logic as a plain functionA function can now be written as a function:
The response is handed in already initialised from the request, so there is no
call to
to()to forget. Its type,ComposeResponse, is aRunFunctionResponsewhose
desiredis guaranteed present —rsp.desired.resources[name]needs nonon-null assertion, even though the protobuf schema marks
desiredoptional.Returning the response is required by the signature, so forgetting is a compile
error rather than an empty response at runtime.
FunctionHandleris unchanged and still the right choice when a function needsthe full interface.
fromCompose()adapts aComposeFunctionto it.One thing worth knowing: for every function after the first in a pipeline, the
request already carries desired state, and
rsp.desiredis then the same objectas
req.desired, not a copy. This is inherited fromto()and is usuallyharmless — a function reads observed state and writes desired state — but do not
rely on
req.desiredstill holding what the previous function left once you havestarted writing.
New exports
serve(fn, opts?)fromCompose(compose)parseArgs(argv)— the standard flags, for functions that add flags of their ownhelpText(name)DEFAULT_ADDRESS,DEFAULT_TLS_SERVER_CERTS_DIRComposeFunction,ComposeResponse,ServeOptionsDocumentation
README.mdandUSAGE.mdnow lead withserve()andComposeFunction. Theprevious hand-rolled entrypoint — which used
commander, never an SDK dependency— has moved to a "Building the Server Yourself" section for functions that need
to own their process.
Breaking Changes
None.
Upgrading
npm install @crossplane-org/function-sdk-typescript@0.7.0is enough; nothingelse has to change. To adopt
serve(), replace the body of yourmain.tswithserve(myHandler)— it accepts your existingFunctionHandler— and dropcommanderfrom your dependencies if it was only there for flag parsing.Full Changelog: crossplane/function-sdk-typescript@v0.6.0...v0.7.0
v0.6.0Compare Source
v0.6.0 - Dependency Modernization and
fromModel()FixA maintenance release. There are no new SDK features; this release picks up two dependency majors, fixes
fromModel()so it works with generated model classes, and hardens protobuf decoding.This is a minor rather than a patch release because
kubernetes-models4 → 5 moves@kubernetes-models/basefrom 5 to 6, which is visible to consumers.Installation
What's Changed
fromModel()accepts any model with atoJSON()methodfromModel()previously constrained its argument'stoJSON()to returnRecord<string, unknown>:@kubernetes-models/basedeclarestoJSON(): unknown, so model classes generated from CRDs — including thecrossplane-modelspackage the Crossplane CLI generates for your project's schemas — did not satisfy that constraint and failed to type-check. The signature is now widened:Passing a generated model now works directly:
See the Breaking Changes section below if you were passing an explicit type argument.
kubernetes-models 5 (
@kubernetes-models/base6)The
kubernetes-modelsdependency moves from^4.5.1to^5.0.0, which brings@kubernetes-models/basefrom 5 to 6. This is the change that makes this release a minor rather than a patch.It also aligns the SDK with what the Crossplane CLI's generated
crossplane-modelspackage pins, so projects using both end up with a single copy of@kubernetes-models/baserather than one hoisted and one nested.If you pass typed models to
fromModel(), bump your ownkubernetes-modelsdependency to^5.0.0.Protobuf decoding hardening
The generated protobuf code was regenerated with
ts-proto2.12.1, which adds two robustness improvements to the decode path used for everyRunFunctionRequest:protobuf decode recursion limit exceededbeyond 100 levels, instead of exhausting the stack.Object.definePropertyrather than direct property assignment.These are upstream generator changes; no SDK API is affected.
ts-deepmerge 8
ts-deepmergemoves from^7.0.3to^8.0.0. Its return types are tighter, which let three internal casts be removed. The merge semantics ofupdate()are unchanged — arrays are still replaced by default, and{ mergeArrays: true }still concatenates.Build toolchain: TypeScript 7
The SDK now builds with TypeScript 7, the native compiler. This is build-time only and requires no change from consumers.
Because TypeScript 7 no longer exposes the JavaScript compiler API that
typescript-eslint's type-aware rules depend on, the repository installs both compilers side by side: TypeScript 7 as@typescript/native(providingtsc), and TypeScript 6 aliased astypescript(providingtsc6). This arrangement is temporary and will be removed oncetypescript-eslintsupports TypeScript 7.Verified against the published package:
@crossplane-org/function-sdk-typescript@0.6.0type-checks and runs in a clean project on TypeScript 5.9.3 withskipLibCheck: false.Other maintenance
@eslint/js10, with rethrown errors now preserving the original via{ cause }flattedupdated to address a vulnerabilityRequirements
kubernetes-models^5.0.0, if you pass typed models tofromModel()Breaking Changes
Two narrow ones. Most functions will need no changes at all.
1.
fromModel()no longer takes a type parameter.The generic was removed when the signature was widened. An explicit type argument is now an error:
Calls that relied on inference — which is nearly all of them — are unaffected.
2.
kubernetes-models4 → 5.If your function passes typed models to
fromModel(), update your dependency to^5.0.0. Staying on 4.x leaves you with two copies of@kubernetes-models/baseand can produce type mismatches at thefromModel()boundary.Migration Guide
kubernetes-models, update it to^5.0.0:fromModel()calls.No other changes are required. Your TypeScript version does not need to change.
Documentation
📖 README.md - Complete documentation
📖 USAGE.md - Usage guide
Full Changelog
Full Changelog: crossplane/function-sdk-typescript@v0.5.0...v0.6.0
Pull Requests
Commits
ce7c3a6)9c3b9fe)ad569e7)8efb047)16836f3)70d4145)4ec2940)dcdbfb4)29c1a6e)bf776fc)0e5564b)f6bfb0d)Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.