Skip to content

feat(validations): adopt the richer error formatting from apify-client - #703

Merged
B4nan merged 2 commits into
masterfrom
fix/validations-formatter
Sep 7, 2026
Merged

feat(validations): adopt the richer error formatting from apify-client#703
B4nan merged 2 commits into
masterfrom
fix/validations-formatter

Conversation

@B4nan

@B4nan B4nan commented Sep 4, 2026

Copy link
Copy Markdown
Member

apify-client's vendored copy of this formatter grew several improvements the shared package lacked, and this brings them over so the client can drop its copy: messages cap at 10 issue lines with an "... and N more problems" tail (a failed dataset push otherwise renders every element), failed unions report only the deepest-failing arms, zod's self-contradictory sentences get corrected ("expected number, received number" for Infinity/NaN becomes "expected a finite number", similar for invalid Dates), bigints render with their n suffix, and parsing pins the English locale so messages stay stable under a global zod locale.

Message shapes stay as crawlee and the SDK pin them in tests. The package also gains a test suite (ported from both consumers); it had none. The changed messages are technically breaking, but the only consumers are crawlee v4, SDK v4 and client v3, all unreleased, so this ships as a non-breaking commit.

@B4nan B4nan added t-tooling Issues with this label are in the ownership of the tooling team. adhoc Ad-hoc unplanned task added during the sprint. labels Sep 4, 2026
@github-actions github-actions Bot added this to the 148th sprint - Tooling team milestone Sep 4, 2026
@github-actions github-actions Bot added the tested Temporary label used only programatically for some analytics. label Sep 4, 2026
@B4nan B4nan changed the title fix(validations): adopt the richer error formatting from apify-client feat(validations): adopt the richer error formatting from apify-client Sep 4, 2026
@B4nan
B4nan requested a review from vladfrangu September 4, 2026 14:30
@B4nan
B4nan merged commit cf69060 into master Sep 7, 2026
9 checks passed
@B4nan
B4nan deleted the fix/validations-formatter branch September 7, 2026 12:20
B4nan added a commit to apify/apify-sdk-js that referenced this pull request Sep 7, 2026
Bumps `@apify/validations` to 1.1.0 (the richer error formatting
upstreamed from apify-client in apify/apify-shared-js#703) and
`@apify/input_secrets` to 2.0.3, and unifies zod on a single 4.5.4
resolution. Without the zod dedupe the new validations resolves its own
newer zod instance next to the pinned one, and the two zod type
identities do not unify (this broke the build in the crawlee counterpart
PR).
B4nan added a commit to apify/apify-client-js that referenced this pull request Sep 7, 2026
Bumps the `@apify/*` shared packages to the new stable majors (ESM-only,
Node 22+, matching the v3 requirements): `consts`, `log` and `utilities`
to v3. Replaces the Renovate PRs (#1020, #1021, #1022) that target
master, where the ESM-only majors cannot land. The vendored zod error
formatter and its test suite moved to `@apify/validations`
(apify/apify-shared-js#703, released as 1.1.0), so this now depends on
it and re-exports `ArgumentValidationError` from there. The shared
formatter keeps all of the client's improvements and its message shapes
follow the crawlee style, which no client test pinned outside the moved
suite.
vdusek pushed a commit to apify/apify-client-js that referenced this pull request Sep 8, 2026
Bumps the `@apify/*` shared packages to the new stable majors (ESM-only,
Node 22+, matching the v3 requirements): `consts`, `log` and `utilities`
to v3. Replaces the Renovate PRs (#1020, #1021, #1022) that target
master, where the ESM-only majors cannot land. The vendored zod error
formatter and its test suite moved to `@apify/validations`
(apify/apify-shared-js#703, released as 1.1.0), so this now depends on
it and re-exports `ArgumentValidationError` from there. The shared
formatter keeps all of the client's improvements and its message shapes
follow the crawlee style, which no client test pinned outside the moved
suite.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants