Skip to content

Client API v4.4.27 — ESM build, test-tooling, and dependency updates

Choose a tag to compare

released this 18 Aug 22:31
· 54 commits to working since this release

This release publishes @fjell/client-api v4.4.27 and consolidates a set of changes made across the 4.4.x cycle. The primary themes are: transitioning the package metadata and build outputs to an ESM-first layout, updating runtime and linting dependencies to current patch/minor releases, simplifying the test and Vitest setup (including Node test polyfills), and small CI and docs tooling adjustments. The notes below describe each change, why it was made (when explicit in logs), and the expected impact on consumers and contributors.

Release summary

  • Version bump: package.json version moved from development pre-release (4.4.27-dev.0) to the released patch 4.4.27.
  • Dependency updates: multiple @fjell/* runtime and ESLint-related devDependencies were advanced to newer patch/minor versions to align with ecosystem releases.
  • Build / package metadata: package.json fields were migrated toward ESM-style outputs (module/exports mapping and types) and test/build configurations were aligned to produce ESM-compatible artifacts.
  • Test environment: Vitest configuration simplified and Node-friendly test globals (fetch, FormData, Blob, File) polyfilled via undici for reliability in Node-based tests.
  • CI and docs: test workflow triggers simplified and docs copy script made deterministic by calling a local script instead of npx.

Notable changes

New/Changed packaging and build metadata

  • package.json:
    • Released version set to 4.4.27 (transition from 4.4.27-dev.0 -> 4.4.27). This marks a released patch cycle for the client API package.
    • Migration toward ESM-style package layout: replaced CommonJS main/browser/type entries with module and an exports mapping; ensured types entry points at ./dist/index.d.ts (this aligns outputs with ESM and typed distribution expectations).
    • Ensure package.json ends with newline and consistent file formatting.

Impact: Consumers importing the package in ESM environments should observe consistent resolutions; TypeScript consumers get a clarified types entry. If tooling or consumers relied on main/browser fields, they should validate their import paths now that module/exports mappings are present.

Dependency updates

  • Runtime dependencies bumped (patch-level):

    • @fjell/core: ^4.4.37 -> ^4.4.38
    • @fjell/http-api: ^4.4.35 -> ^4.4.36
    • @fjell/logging: ^4.4.43 -> ^4.4.44
    • @fjell/registry: ^4.4.31 -> ^4.4.32
  • Dev tooling and linting updates:

    • @fjell/eslint-config: ^1.1.20 -> ^1.1.21
    • Added/ensured presence of @eslint/eslintrc and @eslint/js entries (keeps ESLint config parsing current).
    • Other dev deps observed updated in earlier commits: @eslint/js -> 9.33.0, @typescript-eslint plugins bumped (8.39.0), typescript minor bumps referenced in logs.

Why: These bumps keep the client package aligned with recent fixes/patches in core libraries and maintain consistent linting rules across the monorepo.

Impact: These updates should be non-breaking (patch/minor bumps). Consumers relying on strict pinned versions should test for compatibility; downstream projects using the same @fjell/* packages should prefer matching ranges to avoid duplicate package versions.

Test infra and Vitest changes

  • tests/setup.ts:

    • Added Node polyfills for fetch, FormData, Blob, and File using undici and node:buffer. This ensures the test environment provides web-like globals when running Node-based tests.
    • Removed a large global mock for @fjell/logging (previous global stub was removed), relying on more targeted mocks instead.
    • Enabled vitest fetch mocking via vitest-fetch-mock.
  • vitest.config.ts:

    • Simplified the config: added triple-slash reference types for Vitest, enabled globals: true, removed explicit environment/setupFiles/testTimeout/coverage provider clutter and many coverage include/exclude entries — the config is more concise and focuses on defaults.
    • Converted to a consistent export using defineConfig (formatting and structure improvement).

Why: These changes make test runs more reliable in Node by polyfilling web APIs and simplify the Vitest configuration to reduce maintenance overhead and configuration noise.

Impact: Tests executed in Node should now have consistent access to fetch and other web APIs. Projects that previously relied on the removed global logging stub should update their test mocks accordingly.

Compiler (tsconfig) changes

  • tsconfig.json updates:
    • Emit settings updated: sourceMap enabled, outDir set to dist, declaration: true, target/module set to ES2022.
    • Removed rootDir, esModuleInterop, and specific moduleResolution entries to simplify compiler options.
    • Exclude expanded to ignore examples, tests, dist, and node_modules so compilation focuses on source files.

Why: Aligns TypeScript output with ESM build targets and produces declarations for consumers.

Impact: Local builds will now output ES2022-targeted artifacts under dist and include .d.ts files. Consumers using older compilation targets should test accordingly.

Test runner and environment improvements

  • Replaced/adjusted devDependencies (per logs):
    • Removed jsdom and @types/node from devDependencies and added undici and vitest-fetch-mock to support Node-based web API polyfills and mocking.
    • Reworked dev dependency ordering/entries to better reflect runtime needs for tests.

Why: Move toward a Node-first test environment and remove heavy jsdom dependency in favor of smaller polyfills for required web APIs.

Impact: CI and local test runs may have smaller memory footprints and more deterministic behavior. If existing tests relied on jsdom-specific behavior, they may need updates or reintroduce jsdom where necessary.

CI and workflow adjustments

  • .github/workflows/test.yml:
    • Simplified test workflow triggers: removed push triggers for release/** and working, kept main and feature/** to limit CI runs and reduce unnecessary executions.
    • Dropped explicit pinned Node version in actions/setup-node to avoid hard pinning (allows runner default or external version control).

Why: Reduce CI noise and avoid accidental over-triggering; allow the environment to use a non-pinned Node version if appropriate.

Impact: Releases and working-branch pushes will no longer trigger the test workflow; maintainers should ensure required CI runs are still executed where needed (e.g., via main or feature branch pushes or manual runs).

Documentation tooling

  • docs/package.json:
    • copy-docs script changed from npx copy-docs to a direct node call: node node_modules/@fjell/docs-template/dist/scripts/copy-docs.js to avoid variance from npx resolution and ensure deterministic execution.

Why: Make docs copy operation deterministic and avoid depending on npx behavior across environments.

Impact: CI or local workflows that run docs scripts will now call the locally installed script directly; ensure npm install has been run before executing the script.

Miscellaneous housekeeping

  • Ensured package.json and docs/package.json end with newline where required and standardized whitespace/formatting in multiple commits.
  • Reordered/cleaned package.json scripts and dependency sections for readability.

Bug fixes

No explicit bug-tracking issue numbers are present in the commit log for this release. The changes labeled as fixes or improvements in the log primarily relate to build/test reliability and configuration correctness (for example, ensuring test globals are polyfilled, and adjusting Vitest config to avoid missing entries). Consumers should run the test suite against their integration points to detect regressions.

Breaking changes and migration notes

  • ESM/package entry migration: The shift to module + exports mapping and removal of main/browser may affect some bundlers or consumers that relied on legacy fields. Validate the package import paths in downstream projects.
  • Test environment: Tests that depended on a global mock for @fjell/logging (previous large global mock) must adapt to the new test setup where that global stub was removed.
  • Node version: The project dropped explicit Node pinning in CI workflow; if a consumer relies on a specific Node runtime for tests/builds, add explicit versioning in CI or a .nvmrc/engines field as needed.

Developer experience and contributor notes

  • Local development: the package now expects an ESM-targeted build (dist output, declarations). Running local builds should produce ES2022 output and .d.ts files for type consumers.
  • Tests: Node fetch/FormData/Blob/File polyfills are now provided via undici and vitest-fetch-mock is enabled; update or remove global test mocks that were replaced.
  • Linting: ESLint config bumps and additional ESLint packages added mean linting rules may have small changes; run the configured linter and adjust code where new rules are enforced.

Files/areas changed (quick reference)

  • package.json — version (-> 4.4.27), dependency bumps, ESM/package metadata changes, newline/formatting
  • tests/setup.ts — Node fetch/FormData/Blob/File polyfills, removed global @fjell/logging stub, enabled vitest fetch mocking
  • tsconfig.json — emit/output and compiler target adjustments, excludes
  • vitest.config.ts — simplified config, globals:true, defineConfig export
  • docs/package.json — replaced npx copy-docs with explicit node script
  • .github/workflows/test.yml — adjusted triggers and removed pinned Node version

If you maintain downstream integrations or CI that depend on specific package.json fields, bundler behaviors, or test globals, verify these areas after upgrading to v4.4.27. The changes are aimed at ESM alignment, test reliability in Node, and keeping runtime and linting dependencies current; but they can require small local updates where older conventions were relied upon.