Skip to content

Reduce internal logging, simplify action APIs, and dependency/packaging tidy (v4.4.x series)

Choose a tag to compare

released this 10 Oct 02:40
· 53 commits to working since this release

This release consolidates a large set of maintenance, API simplification, and packaging changes. The primary goals were to reduce noisy internal logging in operation wrappers, simplify action/allAction APIs (remove the affected-items tuple plumbing), and tidy dependency and packaging metadata so versioning and lockfiles are consistent. Many test updates and linting/config changes were included to keep the test suite and developer tooling aligned with the simplified runtime surface. The functional behavior of core operations (hooks, validation, underlying toWrap calls, and error handling) is preserved where noted — the bulk of changes are removals of logging, API surface cleanup, dependency bumps, and testing/tooling adjustments.

New Features

  • None intended. This release focuses on removal of logging, API simplification, packaging, and developer tooling adjustments rather than adding new runtime features.

Improvements

  • Remove verbose internal logging across operation wrappers

    • Stripped numerous logger.default / logger.* debug statements from operation wrapper code paths while preserving behavior. Files affected:
      • src/Operations.ts — removed duplicate and surrounding log blocks while keeping the operations construction and spreads intact.
      • src/ops/create.ts — removed create flow logging (pre/post hooks, validation, underlying call) while keeping the pre/post-hook execution, validation, and underlying creation call.
      • src/ops/update.ts — removed update flow logging but retained pre/post hooks, validation, underlying update call, and error handling.
      • src/ops/remove.ts — removed remove flow logging; removal still throws RemoveError when no item is returned and still runs pre/post hooks.
    • Rationale and impact: reduces noisy/duplicative logging inside library internals and narrows the public logging surface consumers must mock or stub. No runtime behavioral changes to hooks, validation, or error flow are introduced by these removals.
  • Simplify action / allAction API and remove affected-items tuple return shape

    • Action and allAction call/return types and wrapper plumbing were simplified: methods now return a value or an array of values (V | V[]) instead of previous tuple forms that included affected-item lists (e.g. [V, affected[]]).
    • Files changed: src/ops/action.ts, src/ops/allAction.ts, src/Operations.ts and related wrapper modules, src/Options.ts.
    • Tests were updated to expect direct results rather than the older tuple form.
    • Impact: callers of action/allAction should expect and use the direct result type. Any consumer code that previously relied on the affected-items tuple will need to be adapted.
  • Safer spreads and wrapper tidy in Operations construction

    • When composing finders/actions/facets/allActions/allFacets the code now guards spreads against undefined with patterns like { ...(toWrap.foo || {}), ...(options.foo || {}) } to avoid runtime errors when one side is missing.
    • The operations object construction was centralized (const operations = {} as Operations<...>) and ordering/assignment was clarified.
    • Duplicate wiring/log blocks were removed to make the construction clearer and less error-prone.

Packaging and dependency changes

  • Remove hard-coded duplicate version entries from package.json

    • Duplicate "version" fields were removed from package.json so version management can be handled externally or via tooling. This prevents conflicting inline version values from being committed.
    • Several commits progressively removed various hard-coded version lines (4.4.37..4.4.45-dev.0 etc.) — result is package.json without duplicated version keys.
  • Dependency bumps and lockfile synchronization

    • Runtime dependency updates in package.json across multiple commits to keep in sync with Fjell package releases (examples across the series):
      • @fjell/core updated through the 4.4.x series
      • @fjell/logging updated through the 4.4.x series
      • @fjell/registry bumped to ^4.4.40 in this release tree
    • package-lock.json entries were updated to match these bumps and to refresh resolved tarball URLs and integrity hashes for reproducible installs.
    • One change pinned esbuild to patch 0.25.9 (changed devDependency from "^0.25.8" to "0.25.9") to ensure consistent esbuild behavior across environments.

Developer experience and tooling

  • Tests and mocking adjustments

    • tests/Operations.test.ts updated: the mocked @fjell/logging module now includes a default: vi.fn() export to match the trimmed logging surface.
    • New and expanded tests were added or tidied in earlier commits (e.g. tests/Library.test.ts and example-based tests under tests/examples/*). Many tests were cleaned up to remove redundant eslint disables and to centralize mocks.
    • Tests that previously expected the affected-items tuple return were updated to the simplified return values.
  • ESLint and lint rule adjustments

    • Removed a test-specific ESLint override (no-undefined) so tests follow the project's standard lint rules.
    • Several files (Operations.ts variants) had "/* eslint-disable indent */" added to avoid lint failures introduced by formatting changes.
    • Dev tooling: @fjell/eslint-config and new @eslint packages were added/updated in devDependencies as part of maintaining consistent linting across the repo.
  • CI/workflow changes

    • Removed a separate CI build job so the publish job no longer depends on that job. (file: .github/workflows/npm-publish.yml)
    • Rationale: simplify the workflow dependency graph and avoid redundant build job steps in CI.
  • Coverage and vitest configuration

    • Removed duplicate branch coverage thresholds from vitest.config.ts to avoid ambiguity in coverage enforcement.

Bug Fixes

  • Tests aligned to logging surface changes
    • Fixes to tests that previously relied on many logger methods are present so unit tests run with the narrowed logger mock shape. This reduces test flakiness related to logger mocking mismatches.

Refactoring and code cleanup

  • Remove duplicate logging blocks and tidy operations wiring

    • Many duplicated debug/logging blocks were removed, and the wrapOperations wiring and returns were simplified. The underlying behavior — how wrappers call toWrap methods, run pre/post hooks and validations, and propagate errors — remains unchanged.
  • Wrapper signature tidies

    • Some wrapper function signatures were streamlined (e.g., wrapAllActionOperation parameters simplified) to make the code easier to maintain and reduce unnecessary parameters being forwarded.

Documentation Updates

  • Not specific documentation files were changed in the provided diffs, but tests and API surface changes imply updating consumer documentation where action/allAction return shapes are described and in any developer guides that reference internal logging behavior.

Breaking Changes

  • Action/allAction return type change (semantic breaking change for callers)
    • The API removal of the affected-items tuple is a behavioral change: where callers previously used a returned tuple [result, affectedItems], they must now rely on the direct result value (V or V[]). Update calling code accordingly.
    • This is the most notable breaking point in this release and should be verified when upgrading client code.

Deprecations

  • No formal deprecation annotations were added; however, the affected-items tuple form for action/allAction is effectively removed and should be treated as deprecated/removed.

Performance Enhancements

  • No direct performance-focused changes were made; logging removal can slightly reduce I/O and overhead in hot paths but no benchmarks were added.

Security Updates

  • No changes explicitly addressing security vulnerabilities were included in the diffs.

Developer Experience

  • Narrowed public logging surface and test mocks

    • Tests and consumers now have a smaller, clearer set of logging exports to mock or depend on. This reduces accidental coupling to internal debug logs.
  • Tooling alignment

    • ESLint and vitest configs cleaned up; esbuild pinned; package-lock synchronized for reproducible installs.

Testing Improvements

  • Tests modernized and stricter linting enforcement
    • Removed ad-hoc "no-undefined" overrides, centralized mocks, and added example-based tests to exercise common usage patterns.
    • Adjustments to tests reflect API simplifications and narrower logger surface.

Files/areas to review when upgrading

  • Call sites that use action/allAction return values — update code to use the new direct result shape instead of an (result, affectedItems) tuple.
  • Any code that parsed or relied on internal logger output from the wrappers should be updated: many internal logger.default/debug calls have been removed.
  • CI workflows relying on the removed build job should be updated if they expected that job to run.
  • Consumers that pinned esbuild or relied on implicit caret ranges may need to adjust pinning expectations due to the esbuild pin to 0.25.9.

Additional notes

  • Functional behaviour retained: Pre/post hooks, validation steps, underlying toWrap operation calls, and thrown errors (RemoveError, UpdateError, etc.) were preserved; the changes are intentionally limited to logging removal and API simplification except where packaging or tooling edits were needed.
  • Because this release is a large maintenance release composed of many incremental commits, a careful review of consumer code (especially around action/allAction usage and any reliance on internal logger behavior) is recommended before upgrading in production.

If you maintain code that depended on the previous tuple return from action/allAction, update the call sites to handle the direct return values. If tests fail after upgrading, review test mocks for @fjell/logging and the updated expectations for action/allAction results.