Client API 4.4.33 — dependency bumps, API tuple types, linting and tooling cleanup
This release (4.4.33) collects a large set of changes across dependency updates, API shape/type changes, test/tooling adjustments, linting strictness, CI/publish workflow simplification, and internal refactors that simplify path-building and operation surface areas. The release is focused on stabilizing patch versions for Fjell runtime packages, formalizing an "affected-items" tuple in action APIs, removing legacy or special-case workarounds, and simplifying developer tooling and CI for faster, more deterministic publishes.
New Features
- Formalized affected-items tuples for actions
- API types and runtime now expose action/allAction returns as a tuple: [primaryResult, affectedItems].
- Type updates applied to Client API entry points and operation modules: src/ClientApi.ts, src/CItemAPI.ts, src/PItemAPI.ts, src/ops/action.ts, src/ops/allAction.ts.
- Tests and documentation updated to reflect the tuple shape (tests/AItemAPI.test.ts, tests/PItemAPI.test.ts, and docs/public/api-reference.md). The docs include examples and guidance on how to handle the second tuple element (affected items).
- Rationale: surfaces items indirectly affected by operations so callers can inspect side effects programmatically.
Improvements
-
Dependency patch bumps and lockfile normalization
- Bumped runtime dependencies in package.json to newer patch releases:
- @fjell/core: ^4.4.41 -> ^4.4.42
- @fjell/http-api: ^4.4.38 -> ^4.4.39
- @fjell/logging: ^4.4.46 -> ^4.4.47
- @fjell/registry: ^4.4.36 -> ^4.4.39
- package-lock.json normalized to reflect bumped patches, updated resolved tarballs and integrity entries so npm ci produces deterministic installs.
- devDependency bump for @fjell/eslint-config: ^1.1.24 -> ^1.1.25.
- Added/ensured eslint tooling entries: @eslint/eslintrc (^3.3.1) and @eslint/js (^9.33.0) in devDependencies.
- Impact: keep runtime and linting dependencies current and deterministic across CI and local installs.
- Bumped runtime dependencies in package.json to newer patch releases:
-
ESM build and test-target improvements (context from earlier changes retained)
- Project moved to ESM-style package fields (module/exports mapping, types to ./dist/index.d.ts) and compiler options adjusted for ES2022 output, declarations, and source maps (tsconfig updates referenced in prior commits).
- Vitest and test environment adjusted to provide Node fetch/FormData/Blob/File polyfills and use vitest-fetch-mock for controlled fetch mocking (tests/setup.ts changes referenced in the log).
- These changes reduce friction running tests in Node environments and align outputs with ESM expectations.
Bug Fixes
-
Remove Express empty-object workaround in allAction
- Removed special-case conversion logic that transformed server responses equal to {} into [[], []] and related warning logging.
- getAllActionOperation (src/ops/allAction.ts) now directly destructures the response into [items, affectedItems] and relies on server-normalized shapes.
- Tests updated to reflect the new behavior and to cover normal tuple responses and edge cases (tests/ops/allAction.test.ts).
- Impact: simpler code path, fewer transformations; callers should expect the server to return the shape described in the docs.
-
Simplified Utilities.addPath logic (path building)
- Collapsed complex matching branches that attempted to reconcile LocKey/PriKey order, fallback path-name selection, and duplicated recursive calls.
- Removed variable shadowing and extra logging within the addPath branch to produce a single clearer path handling flow (src/Utilities.ts).
- Impact: reduced complexity and potential bugs in path composition. Review usages that relied on prior fallback behavior in unusual input orders.
-
Tests: removed file-level no-undefined exceptions
- Deleted test-level "/* eslint-disable no-undefined */" occurrences from tests/http/HttpWrapper.test.ts and tests/ops/errorHandling.test.ts.
- Corresponding ESLint override for tests (relaxed no-undefined) was removed from eslint.config.mjs.
- Impact: tests now conform to stricter linting rules — if tests intentionally relied on undefined usage, they must explicitly allow/handle it.
Refactoring and Cleanup
-
Remove precommit script and related precommit behavior
- The precommit script that ran clean/lint/build/test on precommit was removed from package.json. The prepublishOnly script remains to run clean and build before publishing.
- Impact: local commits will no longer run the full precommit chain; CI and publish paths should be used for gating builds/tests.
-
CI/publish workflow simplification
- .github/workflows/npm-publish.yml: the separate build job was removed. The publish-npm job no longer depends on a build job and now runs independently on ubuntu-latest with a checkout step.
- Rationale and impact: publish workflow is now decoupled from an explicit build job; consumers relying on the prior build job being present in the workflow should use CI to run tests/builds before publishing.
Linting and Developer Experience
- ESLint: remove test-specific no-undefined exception
- Deleted the test override that allowed undefined in test files from eslint.config.mjs; tests were updated to comply (see tests/http/HttpWrapper.test.ts and tests/ops/errorHandling.test.ts).
- Added or ensured presence of @eslint/eslintrc and @eslint/js in devDependencies.
- Impact: stricter linting enforcement in tests — improves consistency but may require test adjustments where undefined was previously used liberally.
Documentation Updates
- API reference updated for affected-items tuples
- docs/public/api-reference.md updated to document the new tuple return values for action, allAction and location-aware variants, including examples and guidance for handling affected items.
- Developers should consult the updated page when migrating code that previously expected single-value returns.
Developer/Testing Changes
- Test polyfills and configuration adjustments (background changes)
- Node fetch/FormData/Blob/File polyfills were added to tests/setup.ts; vitest config simplified to use globals and adjusted coverage settings. These support running tests under Node without browser globals.
- Tests were updated across the suite to reflect API tuple returns and to remove obsolete edge-case assertions.
Breaking Changes and Migration Notes
-
API return shape change — action/allAction now return tuple [primaryResult, affectedItems]
- This is the most user-visible change. Code that previously expected a single-return value from action and allAction must be updated to destructure or index into the returned tuple.
- Example migration: const [result, affected] = await api.action(...);
- Refer to docs/public/api-reference.md for examples and recommended handling.
-
Linting enforcement stricter in tests
- Removal of test-level no-undefined exception means tests that relied on that exception must be modified (either avoid undefined usage or add local eslint allowances).
-
Precommit script removed
- Local development workflows that relied on the precommit script should run lint/build/test explicitly or configure a separate local pre-commit hook.
-
CI publish behavior changed
- The GitHub Actions publish workflow no longer runs a separate build job before publish. Ensure CI pipelines run required checks (build/test) prior to creating a release or publishing packages.
Files and Components Affected (high level)
- package.json — version bumped to 4.4.33, dependency and devDependency updates, precommit removed, prepublishOnly retained.
- package-lock.json — normalized and updated to reflect patched Fjell package versions and integrity metadata.
- src/ClientApi.ts, src/CItemAPI.ts, src/PItemAPI.ts — Type updates for affected-items tuple support.
- src/ops/action.ts, src/ops/allAction.ts — runtime adjustments to return/destructure tuple and removal of Express-specific workarounds.
- src/Utilities.ts — simplified addPath/path-building logic.
- eslint.config.mjs — removed test-level relaxed rule for no-undefined.
- tests/ — multiple tests updated to match new API shapes and stricter linting; specific examples include tests/ops/allAction.test.ts, tests/AItemAPI.test.ts, tests/PItemAPI.test.ts, tests/http/HttpWrapper.test.ts, tests/ops/errorHandling.test.ts.
- docs/public/api-reference.md — documented affected-items tuple behavior and examples.
- .github/workflows/npm-publish.yml — build job removed, publish job simplified.
Notes and Recommendations for Consumers
- Update any code that calls action/allAction to handle the new [primaryResult, affectedItems] tuple.
- If test suites previously used undefined in tests, update those tests to avoid undefined or add focused eslint-disable comments where justified.
- CI pipelines should be reviewed to ensure the required build/test steps still run prior to publishing since the workflow no longer enforces a separate build job before publish.
- Lockfile and dependency bumps are intended to be safe patch updates, but confirm that any pinned versions in downstream projects remain compatible.
If you rely on any of the removed special-case behaviors (Express {} -> [[], []] conversion or the previous addPath fallback matching), review the relevant modules (src/ops/allAction.ts and src/Utilities.ts) and adjust callers to the new, simpler behaviors documented in the updated API reference.
Change log highlights (selected commits)
- Bumped package version to 4.4.33 and normalized package.json format
- Bumped runtime + dev dependency patches and normalized package-lock entries
- Removed test-level no-undefined rule and updated tests for stricter linting
- Deleted precommit script and simplified npm publish workflow
- Simplified Utilities.addPath logic to reduce complexity and duplicated branches
- Removed Express empty-object workaround from allAction and updated tests and docs to use tuple return shapes
For details on individual changes, consult the modified files listed above and the updated API reference in docs/public/api-reference.md.