Skip to content
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,54 @@

All notable changes to this project are documented in this file.

## [2.0.0] - 2026-01-24

### Major Release — Unified API

This release completes the migration to a **single-module architecture**, providing a simpler, more intuitive API while maintaining all existing functionality.

### Breaking Changes

- **Module consolidation**: `str/core`, `str/extra`, and `str/tokenize` are now internal. Import `import str` instead.
- **Removed deprecated public APIs** from `str/core`, `str/extra`, and `str/tokenize`.
- **Type re-exports**: `SearchStrategy` and `FillPosition` types are now exported directly from `str`.

### Added

- **Unified entry point**: All functions are now accessible via `import str`.
- **New `str/advanced` module** for power users who need fine-grained control:
- `build_kmp_maps/1` — Build KMP prefix/lookup maps for a pattern.
- `kmp_search_all_with_maps/3` — KMP search with pre-built maps.
- `kmp_index_of_with_maps/4` — KMP index with pre-built maps.
- `kmp_index_of/2`, `kmp_search_all/2` — Direct KMP algorithm access.
- `sliding_index_of/2`, `sliding_search_all/2` — Direct sliding-window access.
- `choose_search_strategy/2` — Expose the library's heuristic chooser.
- **Alias functions** for clarity:
- `index_of_simple/2` — Explicit simple/stable implementation.
- `count_simple/3` — Explicit simple/stable implementation.
- **Re-exported types** from main module:
- `str.SearchStrategy` with constructors `str.Kmp`, `str.Sliding`.
- `str.FillPosition` with constructors `str.Left`, `str.Right`, `str.Both`.

### Changed

- **Default search behavior**: `index_of/2` and `count/3` remain simple/stable implementations. Use `index_of_auto/2` and `count_auto/3` for heuristic-based auto-optimization.
- **Internal restructure**: Implementation details moved to `str/internal/*` modules.
- **Improved documentation**: Module-level docs with comprehensive examples.

### Deprecated

- **`str/core`, `str/extra`, `str/tokenize`**: These modules are now internal. All public APIs have been moved to `str` or `str/advanced`.

### Notes

- Zero OTP dependencies maintained.
- Grapheme-aware behavior unchanged.

Contributed by: Daniele (`lupodevelop`)

---

## [1.3.0] - 2026-01-09
### Deprecated
- Deprecated public APIs in internal modules (`str/core`, `str/extra`, and `str/tokenize`) in
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<p align="center">
<a href="https://hex.pm/packages/str"><img src="https://img.shields.io/hexpm/v/str" alt="Package Version"></a>
<a href="https://hexdocs.pm/str/"><img src="https://img.shields.io/badge/hex-docs-ffaff3" alt="Hex Docs"></a>
<a href="https://github.com/lupodevelop/str/actions"><img src="https://img.shields.io/github/workflow/status/lupodevelop/str/CI?label=ci&logo=github" alt="CI"></a>
Copy link

Copilot AI Jan 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CI badge URL references a CI workflow (github/workflow/status/.../CI), but the only workflow defined in .github/workflows/ci.yml is named test, so this badge is unlikely to display the correct status. Consider updating the badge to target the existing test workflow (or renaming the workflow to match the badge) using the current Shields.io GitHub Actions endpoint.

Suggested change
<a href="https://github.com/lupodevelop/str/actions"><img src="https://img.shields.io/github/workflow/status/lupodevelop/str/CI?label=ci&logo=github" alt="CI"></a>
<a href="https://github.com/lupodevelop/str/actions"><img src="https://img.shields.io/github/actions/workflow/status/lupodevelop/str/ci.yml?branch=main&label=ci&logo=github" alt="CI"></a>

Copilot uses AI. Check for mistakes.
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
</p>

Expand Down
2 changes: 1 addition & 1 deletion gleam.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = "str"
version = "1.3.0"
version = "2.0.0"

# Project metadata (fill or replace placeholders before publishing)
description = "Unicode-aware string utilities for Gleam: grapheme-safe operations, pragmatic ASCII transliteration, and slug generation."
Expand Down
Loading