Skip to content

refactor(uniku)!: prepare v1 release candidate - #100

Open
jkomyno wants to merge 12 commits into
mainfrom
release/uniku-v1-rc.0
Open

refactor(uniku)!: prepare v1 release candidate#100
jkomyno wants to merge 12 commits into
mainfrom
release/uniku-v1-rc.0

Conversation

@jkomyno

@jkomyno jkomyno commented Jul 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • base the v1 candidate on the published uniku@0.6.0 migration release, where secs, seq, and Nanoid object-form size are deprecated with JSDoc pointing to their replacements
  • make uniku/cuid/v2 and cuidv2 the sole CUID v2 package and API surface
  • remove the deprecated option aliases in uniku@1.0.0-rc.1 without adding special rejection paths for retired keys
  • remove the now-unreachable CONFLICTING_OPTIONS value from the v1 error-code catalog
  • keep source, packed-consumer, migration, and generated API contracts aligned with the removals
  • preserve all identifier formats and existing persisted identifier data

Breaking changes

  • uniku/cuid2 and cuid2 are removed; use uniku/cuid/v2 and cuidv2
  • secs is removed from KSUID, ObjectID, and XID options; use millisecond-based msecs
  • seq is removed from UUID v7 and TypeID options; use counter
  • Nanoid object-form size is removed; use length (the positional nanoid(number) overload remains supported)

Verification

  • library: 454 tests passed (426 unit, 28 integration)
  • CLI: 229 tests passed
  • Cloudflare Workers: 57 tests passed
  • pnpm typecheck
  • pnpm lint:ci
  • pnpm build with docs prerendering, Publint, and Are the Types Wrong
  • pnpm examples:check
  • pnpm --filter uniku smoke:publish
  • generated API reference is up to date and contains no retired option fields

Release state

uniku@0.6.0 is published under latest as the final deprecation release. uniku@1.0.0-rc.0 is already published under rc; this PR now materializes uniku@1.0.0-rc.1 while keeping @uniku/cli at 0.7.0.

@pkg-pr-new

pkg-pr-new Bot commented Jul 27, 2026

Copy link
Copy Markdown

Open in StackBlitz

pnpm add https://pkg.pr.new/@uniku/cli@100
pnpm add https://pkg.pr.new/uniku@100

commit: d65d6ca

@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Benchmark Results

Generation

ID uniku npm/regex Comparison
ULID 3.3M ops/s 26K ops/s 128.7x faster ⚠️ ±10.6%
UUID v7 2.6M ops/s 391.2K ops/s 6.7x faster ⚠️ ±2.2%
CUID2 35.2K ops/s 5.6K ops/s 6.3x faster ⚠️ ±2.5%
TypeID 1.5M ops/s 460.8K ops/s 3.3x faster
TSID 4.7M ops/s 1.8M ops/s 2.6x faster
NanoID 7.9M ops/s 4.1M ops/s 1.9x faster
KSUID 305K ops/s 182K ops/s 1.7x faster ⚠️ ±2.1%
NanoID (10) 9.2M ops/s 6.5M ops/s 1.4x faster
XID 5.6M ops/s 4M ops/s 1.4x faster
ObjectID 3.7M ops/s 2.9M ops/s 1.3x faster
UUID v4 8.1M ops/s 6.6M ops/s 1.2x faster

Validation

ID uniku npm/regex Comparison
KSUID 6.3M ops/s 510.9K ops/s 12.3x faster
TSID 3.5M ops/s 1M ops/s 3.4x faster
TypeID 3.2M ops/s 1.2M ops/s 2.7x faster
XID 7.3M ops/s 2.9M ops/s 2.5x faster
UUID v7 6.6M ops/s 3.6M ops/s 1.8x faster
UUID v4 6.4M ops/s 3.6M ops/s 1.8x faster
CUID2 8.9M ops/s 9.7M ops/s npm 1.1x faster
ULID 7M ops/s 7.9M ops/s regex 1.1x faster
NanoID 8.8M ops/s 10.2M ops/s regex 1.2x faster
ObjectID 7.1M ops/s 8.3M ops/s npm 1.2x faster

Cold Start (Node)

Generator Process to exit (median / p95) Import + first ID (median / p95)
uuid/v4 32.9 ms / 38.0 ms 6.4 ms / 7.2 ms
uuid/v7 33.7 ms / 36.3 ms 7.0 ms / 7.1 ms
ulid 33.4 ms / 36.3 ms 6.8 ms / 6.9 ms
typeid 34.7 ms / 37.0 ms 7.8 ms / 7.9 ms
cuid/v2 42.2 ms / 43.8 ms 15.9 ms / 17.0 ms
nanoid 32.5 ms / 37.1 ms 6.3 ms / 6.4 ms
ksuid 35.1 ms / 37.5 ms 7.4 ms / 7.9 ms
objectid 34.3 ms / 37.9 ms 7.5 ms / 7.6 ms
tsid 32.9 ms / 36.2 ms 6.4 ms / 6.4 ms
xid 34.5 ms / 38.8 ms 7.6 ms / 7.8 ms

Comparison vs Main

Benchmark Baseline Current Change
tests/bench/compat.bench.ts > Validation > NanoID > uniku 9.6M ops/s 8.8M ops/s ⚪ -7.7% (+/-15.5% RME)
tests/bench/compat.bench.ts > Validation > CUID2 > uniku 9.4M ops/s 8.9M ops/s ⚪ -5.9% (+/-11.0% RME)
tests/bench/compat.bench.ts > Validation > ULID > uniku 7.3M ops/s 7M ops/s ⚪ -4.5% (+/-8.5% RME)
tests/bench/compat.bench.ts > Validation > UUID v7 > uniku 6.9M ops/s 6.6M ops/s ⚪ -4.2% (+/-10.5% RME)
tests/bench/compat.bench.ts > Validation > UUID v4 > uniku 6.7M ops/s 6.4M ops/s ⚪ -4.0% (+/-11.0% RME)
tests/bench/compat.bench.ts > Validation > TypeID > uniku 3.3M ops/s 3.2M ops/s ⚪ -3.8% (+/-20.0% RME)
tests/bench/compat.bench.ts > Generation > UUID v7 > uniku 2.7M ops/s 2.6M ops/s ⚪ -3.6% (+/-4.2% RME)
tests/bench/compat.bench.ts > Generation > KSUID > uniku 294.7K ops/s 305K ops/s ⚪ +3.5% (+/-8.0% RME)
tests/bench/compat.bench.ts > Validation > KSUID > uniku 6.5M ops/s 6.3M ops/s ⚪ -3.2% (+/-18.9% RME)
tests/bench/compat.bench.ts > Generation > CUID2 > uniku 34.2K ops/s 35.2K ops/s ⚪ +2.8% (+/-7.4% RME)
tests/bench/compat.bench.ts > Generation > XID > uniku 5.7M ops/s 5.6M ops/s ⚪ -2.2% (+/-10.0% RME)
tests/bench/compat.bench.ts > Generation > TypeID > uniku 1.5M ops/s 1.5M ops/s ⚪ -2.1% (+/-7.4% RME)
tests/bench/compat.bench.ts > Generation > NanoID > uniku 7.7M ops/s 7.9M ops/s ⚪ +2.1% (+/-8.6% RME)
tests/bench/compat.bench.ts > Validation > ObjectID > uniku 7.3M ops/s 7.1M ops/s ⚪ -1.8% (+/-13.2% RME)
tests/bench/compat.bench.ts > Validation > XID > uniku 7.4M ops/s 7.3M ops/s ⚪ -1.8% (+/-12.7% RME)
tests/bench/compat.bench.ts > Validation > TSID > uniku 3.4M ops/s 3.5M ops/s ⚪ +1.3% (+/-3.5% RME)
tests/bench/compat.bench.ts > Generation > TSID > uniku 4.6M ops/s 4.7M ops/s ⚪ +1.1% (+/-3.9% RME)
tests/bench/compat.bench.ts > Generation > UUID v4 > uniku 8.2M ops/s 8.1M ops/s ⚪ -1.1% (+/-7.4% RME)
tests/bench/compat.bench.ts > Generation > ULID > uniku 3.4M ops/s 3.3M ops/s ⚪ -0.9% (+/-19.4% RME)
tests/bench/compat.bench.ts > Generation > ObjectID > uniku 3.7M ops/s 3.7M ops/s ⚪ +0.8% (+/-9.0% RME)
tests/bench/compat.bench.ts > Generation > NanoID (10) > uniku 9.2M ops/s 9.2M ops/s ⚪ -0.2% (+/-8.4% RME)
tests/bench/compat.bench.ts > Generation > TSID > npm 2.1M ops/s 1.8M ops/s ℹ️ -13.8% (+/-8.1% RME) (ref)
tests/bench/compat.bench.ts > Validation > CUID2 > npm 10.7M ops/s 9.7M ops/s ℹ️ -9.5% (+/-31.3% RME) (ref)
tests/bench/compat.bench.ts > Validation > NanoID > regex 11.1M ops/s 10.2M ops/s ℹ️ -8.7% (+/-12.5% RME) (ref)
tests/bench/compat.bench.ts > Validation > XID > npm 3.1M ops/s 2.9M ops/s ℹ️ -7.8% (+/-9.8% RME) (ref)
tests/bench/compat.bench.ts > Validation > ObjectID > npm 9M ops/s 8.3M ops/s ℹ️ -7.8% (+/-13.8% RME) (ref)
tests/bench/compat.bench.ts > Generation > ObjectID > npm 3.1M ops/s 2.9M ops/s ℹ️ -5.8% (+/-13.4% RME) (ref)
tests/bench/compat.bench.ts > Validation > UUID v7 > npm 3.8M ops/s 3.6M ops/s ℹ️ -5.1% (+/-5.9% RME) (ref)
tests/bench/compat.bench.ts > Validation > UUID v4 > npm 3.8M ops/s 3.6M ops/s ℹ️ -4.6% (+/-9.5% RME) (ref)
tests/bench/compat.bench.ts > Generation > XID > npm 4.2M ops/s 4M ops/s ℹ️ -4.1% (+/-9.0% RME) (ref)
tests/bench/compat.bench.ts > Generation > TypeID > npm 478.7K ops/s 460.8K ops/s ℹ️ -3.7% (+/-12.9% RME) (ref)
tests/bench/compat.bench.ts > Generation > CUID2 > npm 5.4K ops/s 5.6K ops/s ℹ️ +3.5% (+/-15.2% RME) (ref)
tests/bench/compat.bench.ts > Validation > ULID > regex 8.1M ops/s 7.9M ops/s ℹ️ -2.3% (+/-3.7% RME) (ref)
tests/bench/compat.bench.ts > Generation > UUID v7 > npm 382.7K ops/s 391.2K ops/s ℹ️ +2.2% (+/-18.0% RME) (ref)
tests/bench/compat.bench.ts > Generation > ULID > npm 25.5K ops/s 26K ops/s ℹ️ +2.0% (+/-26.1% RME) (ref)
tests/bench/compat.bench.ts > Generation > KSUID > npm 179.2K ops/s 182K ops/s ℹ️ +1.6% (+/-12.2% RME) (ref)
tests/bench/compat.bench.ts > Generation > UUID v4 > npm 6.7M ops/s 6.6M ops/s ℹ️ -1.3% (+/-8.4% RME) (ref)
tests/bench/compat.bench.ts > Generation > NanoID (10) > npm 6.5M ops/s 6.5M ops/s ℹ️ +1.0% (+/-6.4% RME) (ref)
tests/bench/compat.bench.ts > Validation > KSUID > npm 515.4K ops/s 510.9K ops/s ℹ️ -0.9% (+/-25.6% RME) (ref)
tests/bench/compat.bench.ts > Generation > NanoID > npm 4M ops/s 4.1M ops/s ℹ️ +0.8% (+/-8.2% RME) (ref)
tests/bench/compat.bench.ts > Validation > TypeID > npm 1.2M ops/s 1.2M ops/s ℹ️ +0.7% (+/-51.6% RME) (ref)
tests/bench/compat.bench.ts > Validation > TSID > npm 1M ops/s 1M ops/s ℹ️ -0.7% (+/-20.5% RME) (ref)

Bundle Impact

Import Minified + gzipped
uniku/uuid/v4 ~1.2 KB
uniku/uuid/v7 ~1.6 KB
uniku/ulid ~1.9 KB
uniku/typeid ~2.8 KB
uniku/cuid/v2 ~1.0 KB*
uniku/nanoid ~1.2 KB
uniku/ksuid ~1.4 KB
uniku/objectid ~1.5 KB
uniku/tsid ~1.6 KB
uniku/xid ~2.0 KB
uniku/errors ~432 B
uniku/generators ~101 B

*Excludes external dependencies (e.g., @noble/hashes)

Generated by workflow run 31753469792

@github-actions

github-actions Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

🚀 View the docs preview at https://jkomyno.github.io/uniku/pr-preview/pr-100/

Built by workflow run 31753470056.

@jkomyno
jkomyno force-pushed the release/uniku-v1-rc.0 branch from 9e0baf4 to d0ce298 Compare August 13, 2026 01:20
Collapse the per-file accumulators threaded through seven transform
functions into a single MigrationContext, and gather the import,
call-expression, and string-literal node lists once per file instead of
re-walking the tree in each pass. The cuidv2 collision scan is memoized
so it still runs only for files importing the legacy module.

Extract the duplicated legacy-CUID binding rewrite shared by the static
and dynamic import paths, hoist the transparent-wrapper kind sets to
module constants, and share the "references in this file" traversal.

In the integration test, delegate parseAuditOutput to findAuditRecords
and extract the repeated workflow invocation. In cuid/v2.ts, use the
package's isIntegerInRange helper for the length check.

No behavior change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant