Repository navigation
Update dependency @crossplane-org/function-sdk-typescript to ^0.8.0 - #22
Open
renovate[bot] wants to merge 1 commit into
Open
renovate[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
renovate
Bot
force-pushed
the
renovate/crossplane-org-function-sdk-typescript-0.x
branch
from
October 8, 2026 20:48
5494baf to
498b352
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.8.0Release Notes
crossplane/function-sdk-typescript (@crossplane-org/function-sdk-typescript)
v0.8.0Compare Source
v0.8.0 - Update Response Helpers
This is a breaking release. See Migrating below -- the fix is
mechanical.
Overview
Previous to v0.8.0 the helper functions returned inconsistent values: In v0.8.0 they return nothing.
fatalRunFunctionResponsenormalwarningsetDesiredCompositeStatusRunFunctionResponsesetDesiredComposedResourcesRunFunctionResponsesetContextKeyRunFunctionResponseInstallation
What's Changed
Response helpers return
voidThese nine helpers previously returned the response and now return nothing:
fatalsetDesiredComposedResourcessetDesiredResourcessetDesiredCompositeResourcesetDesiredCompositeStatussetContextKeysetOutputrequireSchemarequireResourcenormalandwarningalready returned nothing; their signatures now say soexplicitly rather than leaving it inferred.
Unchanged:
to(req, ttl?)still builds and returns a response, andupdate(src, tgt)andupdateDesiredComposedResources(cds, res)still return resources andresource maps. Those operate on resources, not on a response.
Why this shape
Under the class-based
FunctionHandler,rspwas a local, sorsp = setDesiredCompositeStatus({ rsp, status })hid the ambiguity -- reassigning alocal is harmless whether or not the value is new. With
ComposeFunction(addedin v0.7.0)
rspis a parameter, and respecting the declared contract meantintroducing a variable that existed only because the signature was ambiguous:
For comparison, the Go SDK's
response.SetContextKey(rsp, key, v)and the PythonSDK's
response.set_output(rsp, output) -> Nonehave always worked this way.Generated protobuf files no longer carry a version stamp
scripts/protoc-gen.shnow strips the// versions:header block that ts-protowrites into each generated file (#46).
That block recorded ts-proto's own version and protoc's, so every dependency bump
rewrote three comment lines in each generated file, the
protobuf-checkCI job sawchanges under
src, and the pull request went red until someone regenerated andcommitted. The generated code itself was identical. Output now depends only on the
.protoinput and the generator flags, which is what the check is meant to police.The
// Code generated by protoc-gen-ts_proto. DO NOT EDIT.and// source:linesare untouched, and the versions stay recorded in
package.jsonand the workflow'sprotoc pin.
For consumers this is a comment-only difference in the shipped files. No generated
type, message or service changed.
Dependency updates
Direct dependencies moved as follows (#45):
pinots-proto@types/nodeeslinttypescript-eslintvitest@vitest/coverage-v8pinois the only runtime dependency in that list; the rest are build and testtooling. Regenerating the protos under ts-proto 2.13.0 produces no diff.
Migrating
Drop the assignment to
rsp. The helper already mutated the response you passed it, sothe behavior is unchanged:
let rsp = to(req)can usually becomeconst rsp = to(req)afterwards, sincenothing reassigns it any more.
Chained or nested calls need restructuring rather than a token deletion:
A warning for JavaScript callers
TypeScript callers get a compile error on every
rsp = setX(...)line(
Type 'void' is not assignable to type 'RunFunctionResponse'), which makes themigration self-checking.
Plain JavaScript callers get no error.
rspsilently becomesundefined,and the failure surfaces later -- either as
Cannot read properties of undefinedon the next helper call, or as a response that never reaches Crossplane. If you
consume this SDK from JavaScript, grep for
= setDesired,= setContextKey,= setOutput,= require, and= fatal(before upgrading.Not Changed
to()still assignsreq.desiredinto the response rather than copying it, sorsp.desired === req.desiredwhen the request has desired state, and writesthrough
rsp.desiredare visible onreq.desired. This is pre-existing, and theGo SDK's
response.Toaliases in exactly the same way. It is documented andpinned with a test rather than changed.
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.