fix: declare @nrfcloud/validate-with-typebox as a runtime dependency - #71
Merged
Conversation
1.4.4 is the current release. The previous pin, 1.4.3, was the latest at the time the dependency was switched from JSR to NPM, and was superseded before that change was released.
Member
Author
|
Non-significant change, no PR review required. |
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.
Declares
@nrfcloud/validate-with-typeboxas a runtime dependency, and bumps@nrfcloud/problem-detailto 1.4.4.The bug
problemResponse.ts,validateInput.tsandvalidateResponse.tsall import@nrfcloud/validate-with-typebox, but it was declared as a devDependency.So the published package does not pull it in, and consumers that do not
independently have it in their tree fail at import time:
This did not surface on JSR. JSR's NPM compatibility build derives the dependency
list from the actual imports, so it published
@jsr/nrfcloud__validate-with-typeboxas a runtime dependency no matter how itwas declared here — you can still see it in the published
@jsr/nrfcloud__lambda-helpers@1.0.28metadata. The NPM build publishes the declared dependencies verbatim, so the
mis-declaration became a real defect in 1.0.29.
How it was found
account-service-nextbuilds its Lambda layers from an explicit subset ofdependencies. Its
cognitoAuthLayerlists@nrfcloud/lambda-helpersbut not@nrfcloud/validate-with-typebox, so the authorizer Lambdas could not resolveit, failed to initialise, and API Gateway answered every authorized request with
AuthorizerConfigurationException— a 500 that surfaced as a failing BDD test.I audited all six of the migrated libraries for the same class of problem; this
is the only one affected.
Verified locally
The type check, tests and build pass, and
npm cireinstalls from theregenerated lock file. Reproducing the
cognitoAuthLayerbuild with thisversion installs
@nrfcloud/validate-with-typeboxtransitively, and anauthorizer-style ESM import of
@nrfcloud/lambda-helpersagainst that layersucceeds.