Simplified Vitest config, test setup relocation, package.json cleanup, and dependency bumps (v4.4.35)
This release focuses on simplifying the test setup and configuration (Vitest), tidying package metadata/exports, and aligning runtime dependencies. The primary goal was to reduce custom test wiring and configuration complexity, make test setup reusable from a dedicated path, and update package metadata and the @fjell/logging runtime dependency. The release also finalizes the published package version to 4.4.35.
New in this release
- Final package version set to 4.4.35 in package.json.
- Vitest test setup file renamed and moved to tests/setup.ts and re-wired into the configuration.
- Vitest configuration simplified: removed custom path aliasing and complex coverage thresholds, enabled globals and typings reference.
- package.json cleaned up: added "type": "module", simplified exports/exports-browser fields, and bumped @fjell/logging dependency to ^4.4.43.
New Features
- tests/setup.ts
- Moved fetch mock creation and initialization into a consolidated test setup file at tests/setup.ts (renamed from vitest.setup.ts).
- Ensures fetchMocker.enableMocks() is present and properly terminated in the new file.
- This provides a single place for global test runtime setup used across test files.
Improvements
-
Vitest configuration (vitest.config.ts)
- Added a triple-slash reference for Vitest types:
/// <reference types="vitest" />to provide type information to editors and TypeScript-aware tools. - Enabled Vitest globals via
globals: trueso tests can use global helpers without repeated imports. - Removed custom __dirname resolution and path alias for
@fjell/http-api(previous alias using node:url and node:path). This simplifies module resolution and avoids fragile runtime aliasing in the test environment. - Removed multiple bespoke coverage configuration blocks (per-metric thresholds and checkCoverage) and the explicit coverage exclude list. The configuration now relies on Vitest defaults or project-level tooling instead of an extensive per-release coverage policy in this config file.
- Removed explicit
testTimeoutoverride; tests use default timeout behavior unless overridden elsewhere. - Updated setupFiles reference to point to the new
./tests/setup.tspath.
- Added a triple-slash reference for Vitest types:
-
package.json metadata and exports
- Set
typetomoduleto clarify module semantics for consumers and tooling. - Simplified
exportsfield. The package now explicitly exposestypesandimportpaths under the package root, and removed the previous separate./browserentry. This reduces duplication and clarifies published entry points. - Tidied
module/browser/exportsfields and removed a standalonebrowserentry that duplicated the main import target. - Updated dependency version for
@fjell/loggingfrom an earlier 4.4.x range to^4.4.43. - Minor formatting and newline normalization across package.json for consistent file layout.
- Set
Bug Fixes
- Fixed missing newline/termination issues in test setup and config files
- Ensured
fetchMocker.enableMocks();lines are present and terminated correctly after moving the setup file. - Corrected trailing newline inconsistencies in several modified files to align with repository formatting expectations.
- Ensured
Refactoring
-
Test setup relocation and code cleanup
- Renamed
vitest.setup.tstotests/setup.tsand updated references in the Vitest config. - Consolidated fetch mocking initialization into the new setup file to centralize global test mocking behavior.
- Renamed
-
Simplified vitest.config.ts structure
- Removed custom path alias resolution logic that relied on
fileURLToPath/dirname/resolve. Tests now depend on standard module resolution. - Eliminated advanced coverage threshold and exclusion configuration from the Vitest config to reduce maintenance complexity. Coverage behavior should now be driven by CI or a dedicated coverage config if needed.
- Removed custom path alias resolution logic that relied on
Developer Experience
-
Easier test configuration and maintenance
- With globals enabled and the standardized setup file, test files can be simpler (fewer per-test imports) and test initialization is centralized.
- Removing custom aliasing in the test config reduces surprises when running tests in different environments (local, CI, or alternate Node versions).
-
Cleaner package metadata for downstream consumers
- Adding
type: "module"and streamliningexportsclarifies package entry points for bundlers and modern Node environments.
- Adding
Dependency updates
-
Runtime dependency:
@fjell/loggingbumped to ^4.4.43 (was ^4.4.41 in this release step). This updates the logging runtime to the newer patch/minor series.
-
Development / lint tooling notes (context from prior commits)
- Several earlier commits in the branch history adjusted
@fjell/eslint-configin devDependencies to align lint rules; verify dev tooling in your environment if lint or build steps changed behavior.
- Several earlier commits in the branch history adjusted
Breaking Changes
- Path alias removal in Vitest
- Tests (and any code relying on the local alias) must use normal module resolution/import paths instead of the removed
@fjell/http-apialias previously provided in the vitest config. If any local test code imported using that alias, update imports to relative paths or restore an equivalent alias in a separate tooling/config layer.
- Tests (and any code relying on the local alias) must use normal module resolution/import paths instead of the removed
Notes and migration guidance
- If CI or local test runners relied on the previous Vitest coverage configuration (thresholds, includes/excludes), reintroduce desired coverage rules in a dedicated coverage configuration or CI step; they were intentionally removed here to simplify the vitest.config.ts file.
- If any code or tests imported the package via the old path alias, update those imports to standard relative imports or configure aliases in your editor/build toolchain as needed.
- The package
typeis nowmodule. Consumers using CommonJS require interop considerations when importing this package; verify consuming projects are prepared for ES module semantics.
Files changed (high-level)
-
package.json
- Version set to 4.4.35
- Added
type: "module" - Tidied
exportsand removed duplicate browser entry - Bumped
@fjell/loggingto ^4.4.43 - Formatting/newline adjustments
-
vitest.setup.ts → tests/setup.ts (rename + content normalization)
- Moved and fixed fetch mock enablement line
-
vitest.config.ts
- Rewritten/simplified: added types reference, enabled globals, removed alias / __dirname code, removed complex coverage and timeout settings, updated setupFiles path
If specific tests or CI jobs start failing after this change, check for two common causes:
- Imports that previously relied on the removed
@fjell/http-apialias — convert to relative imports or add an alias in your toolchain. - Coverage or timeout expectations previously enforced by the Vitest config — re-add dedicated coverage checks in CI or a separate config file if those checks are required.
For more granular details, inspect the updated files: package.json, tests/setup.ts, and vitest.config.ts.