Client API v4.4.37 — affected-items tuple, Utilities/allAction simplification, dependency bumps
This release publishes v4.4.37 and bundles a broad set of changes focused on three themes: (1) formalizing the "affected-items" return shape in the client API types and docs, (2) simplifying internal path-building and action handling logic (Utilities and allAction), and (3) routine patch bumps plus CI/tooling and lint/test adjustments. The changes include API surface/type updates, behaviour simplifications (removal of historical Express workaround and extra fallbacks), a number of package patch bumps to keep dependency versions aligned, and workflow/linting updates that affect development and CI.
New Features
- Formalized "Affected Items" API return shape
- Client API functions that perform actions now return a tuple [primaryResult, affectedItems] where the second element is an array of keys (PriKey | ComKey | LocKeyArray) (see: src/ClientApi.ts, src/CItemAPI.ts, src/PItemAPI.ts).
- Operation modules updated to support the tuple return shape (src/ops/action.ts, src/ops/allAction.ts).
- Documentation updated to describe the affected-items feature and show usage and examples (docs/public/api-reference.md).
- Tests adjusted to reflect the tuple-based responses.
Improvements
-
Simplify Utilities path construction logic
- Consolidated and simplified the path-building logic in src/Utilities.ts to remove duplicated branches, variable shadowing, and redundant fallback code.
- The new flow determines key/keyType in a single branch, finds an appropriate pathName (with singular/plural/case handling), and builds nextBase consistently (fewer early returns and reduced logging noise).
- Change is scoped to src/Utilities.ts and aims to preserve behaviour while making the code path deterministic and easier to maintain.
-
Simplify allAction API surface and response handling
- Simplified factory signature for getAllActionOperation in src/ops/allAction.ts: removed outer wrapper parameters and destructured response directly into [items, affectedItems].
- Removed special-case handling and warning for Express-style empty-object ("{}") responses — the module now assumes server responses are normalized and uses returned shapes directly.
- Tests updated to match the simplified behavior; unnecessary test-level exceptions were removed where appropriate.
-
Clean up package.json formatting and version lifecycle handling
- Normalized package.json EOF and surrounding formatting across multiple commits.
- Version transitions: bumped published version to 4.4.37 and updated transient dev-cycle versions (e.g., 4.4.37-dev.0 -> 4.4.37). The package.json version field was normalized (removed dev suffix on release commits).
Dependency and Lockfile Updates
-
Runtime dependency patch bumps (package.json + package-lock.json)
- @fjell/core: bumped to ^4.4.43 (lockfile entries normalized)
- @fjell/registry: bumped to ^4.4.43
- @fjell/http-api and @fjell/logging were repeatedly kept current in earlier related commits; lockfile entries were normalized to reflect consistent resolved tarballs and integrity checksums.
- deepmerge remains unchanged.
-
Lockfile normalization
- package-lock.json entries for multiple @fjell/* packages were tidied: duplicate lines removed, resolved tarball URLs and integrity fields updated so installs are deterministic.
CI / Workflow / Build Tooling
-
Publish workflow simplified
- Removed separate build job from .github/workflows/npm-publish.yml; the publish job was decoupled from a prior dedicated build job (publish-npm no longer depends on build).
- This reduces the automated pre-publish build/test/codecov steps in the current workflow.
-
esbuild pinning and CI reproducibility
- esbuild pinned to exact 0.25.9 in relevant packages and npm overrides added to force a single esbuild version across the monorepo.
- GitHub Actions updated to prefer npm ci for reproducible installs to avoid esbuild version mismatch errors in CI.
Linting and Precommit Changes
-
ESLint and test lint rule changes
- Removed a test-specific ESLint override that relaxed "no-undefined" from eslint.config.mjs; several tests had file-level disabled comments removed to align with stricter linting.
- Added file-level exception for one simplified factory where explicit undefined use is intentional (src/ops/allAction.ts).
-
Precommit script removal
- Deleted the "precommit" script from package.json (stops running clean/lint/build/test chain automatically on precommit).
Refactoring and Code Cleanup
- Utilities and allAction simplification (refactor)
- src/Utilities.ts: consolidated matching/fallback logic and removed duplicated branches and debug/log branches while preserving intended behavior.
- src/ops/allAction.ts: removed Express-specific fallback and simplified response destructuring.
Bug Fixes
-
Deterministic lockfile and package entries
- Fixed duplicated/inconsistent dependency lines in package-lock.json for multiple @fjell packages and updated integrity/resolved metadata so installs/CI are deterministic.
-
esbuild CI failure mitigation
- Force consistent esbuild version across packages and update CI to use npm ci, addressing prior esbuild mismatch and build failures.
Testing Improvements
- Unit tests updated and expanded
- Tests for allAction were added/updated to cover: normal tuple responses, edge-case handling for empty-object scenarios (explicitly verifying behaviour after removing the Express workaround), and array responses.
- Tests across API modules adjusted to match the new tuple-based return type (affected-items included).
Documentation Updates
- API reference updated
- docs/public/api-reference.md now documents the affected-items tuple return value, with signatures, examples, and guidance on processing affected item keys.
Breaking Changes and Compatibility Notes
-
API return shape extended — update callers
- Action/allAction functions now return [primaryResult, affectedItems]. Call sites that previously expected a single value need to be updated to destructure the tuple. This is a functional change to the TypeScript types and runtime response handling.
- Tests and client code should be audited to ensure they handle the tuple shape; tests in this release were updated accordingly.
-
Removal of Express empty-object workaround
- Previously, allAction had special-case conversion of "{}" responses into a tuple ([[], []]) and logged warnings. That conversion has been removed: server responses are assumed normalized. If any integration depends on the old conversion, update the server or client to return the normalized tuple shape.
Developer Experience
-
Reduced noisy precommit hooks
- Removing the precommit script reduces local precommit checks; CI remains the authoritative source for checks in the current workflow.
-
Cleaner code paths and types
- Utilities and ops refactors reduce cognitive overhead for contributors working on path building and action flow.
Migration Guidance
-
Update code that calls action/allAction
- Where code previously used a single return value from action/allAction, update to destructure the tuple: const [result, affectedItems] = await action(...)
- Adjust TypeScript types for any local wrappers or helpers that typed the older single-value return.
-
Review integration tests / server responses
- Ensure any integration servers return the normalized tuple shape for actions. The client no longer performs Express-specific fallbacks for empty-object responses.
Files and Components Affected (high level)
- src/Utilities.ts — path-building logic simplified and consolidated
- src/ops/allAction.ts, src/ops/action.ts — signatures and response handling updated; Express workaround removed
- src/ClientApi.ts, src/CItemAPI.ts, src/PItemAPI.ts — TypeScript types updated to include affected-items tuple
- docs/public/api-reference.md — updated API docs describing the affected-items tuple
- package.json, package-lock.json — version bump to 4.4.37, runtime dependency patch bumps, formatting/EOF normalization
- .github/workflows/npm-publish.yml — build job removed; publish job simplified
- ESLint config and tests — stricter lint rules applied; file-level exceptions trimmed/added where necessary
Notes
- The behavioral intent behind Utilities and allAction remains unchanged where it impacts consumers; the primary goals were to reduce duplicated logic and to make the client assume normalized server responses (so the client is no longer compensating for older Express-specific quirks).
- Consumers must update to the tuple return shape where applicable; this is the most visible change for integrators.
If you maintain integrations or local wrappers around action/allAction, scan for any code that expects a single return value and adjust it to destructure the [primaryResult, affectedItems] tuple. For CI or local builds that previously failed due to esbuild versions, ensure npm ci is used (or that overrides are present) so the pinned esbuild 0.25.9 is enforced.