Skip to content

Commit 2371a97

Browse files
authored
Merge pull request #20 from lupodevelop/major/2.0.0
Major/2.0.0
2 parents 014d28d + 36e184d commit 2371a97

27 files changed

Lines changed: 1214 additions & 595 deletions

CHANGELOG.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,54 @@
22

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

5+
## [2.0.0] - 2026-01-24
6+
7+
### Major Release — Unified API
8+
9+
This release completes the migration to a **single-module architecture**, providing a simpler, more intuitive API while maintaining all existing functionality.
10+
11+
### Breaking Changes
12+
13+
- **Module consolidation**: `str/core`, `str/extra`, and `str/tokenize` are now internal. Import `import str` instead.
14+
- **Removed deprecated public APIs** from `str/core`, `str/extra`, and `str/tokenize`.
15+
- **Type re-exports**: `SearchStrategy` and `FillPosition` types are now exported directly from `str`.
16+
17+
### Added
18+
19+
- **Unified entry point**: All functions are now accessible via `import str`.
20+
- **New `str/advanced` module** for power users who need fine-grained control:
21+
- `build_kmp_maps/1` — Build KMP prefix/lookup maps for a pattern.
22+
- `kmp_search_all_with_maps/3` — KMP search with pre-built maps.
23+
- `kmp_index_of_with_maps/4` — KMP index with pre-built maps.
24+
- `kmp_index_of/2`, `kmp_search_all/2` — Direct KMP algorithm access.
25+
- `sliding_index_of/2`, `sliding_search_all/2` — Direct sliding-window access.
26+
- `choose_search_strategy/2` — Expose the library's heuristic chooser.
27+
- **Alias functions** for clarity:
28+
- `index_of_simple/2` — Explicit simple/stable implementation.
29+
- `count_simple/3` — Explicit simple/stable implementation.
30+
- **Re-exported types** from main module:
31+
- `str.SearchStrategy` with constructors `str.Kmp`, `str.Sliding`.
32+
- `str.FillPosition` with constructors `str.Left`, `str.Right`, `str.Both`.
33+
34+
### Changed
35+
36+
- **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.
37+
- **Internal restructure**: Implementation details moved to `str/internal/*` modules.
38+
- **Improved documentation**: Module-level docs with comprehensive examples.
39+
40+
### Deprecated
41+
42+
- **`str/core`, `str/extra`, `str/tokenize`**: These modules are now internal. All public APIs have been moved to `str` or `str/advanced`.
43+
44+
### Notes
45+
46+
- Zero OTP dependencies maintained.
47+
- Grapheme-aware behavior unchanged.
48+
49+
Contributed by: Daniele (`lupodevelop`)
50+
51+
---
52+
553
## [1.3.0] - 2026-01-09
654
### Deprecated
755
- Deprecated public APIs in internal modules (`str/core`, `str/extra`, and `str/tokenize`) in

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
<p align="center">
1212
<a href="https://hex.pm/packages/str"><img src="https://img.shields.io/hexpm/v/str" alt="Package Version"></a>
1313
<a href="https://hexdocs.pm/str/"><img src="https://img.shields.io/badge/hex-docs-ffaff3" alt="Hex Docs"></a>
14+
<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>
1415
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
1516
</p>
1617

gleam.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name = "str"
2-
version = "1.3.0"
2+
version = "2.0.0"
33

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

0 commit comments

Comments
 (0)