Skip to content

Implement pure CLJC Sqids and prepare 1.1.0#10

Open
robhanlon22 wants to merge 1 commit intomainfrom
v1.1.0
Open

Implement pure CLJC Sqids and prepare 1.1.0#10
robhanlon22 wants to merge 1 commit intomainfrom
v1.1.0

Conversation

@robhanlon22
Copy link
Collaborator

@robhanlon22 robhanlon22 commented Mar 4, 2026

Summary

  • Replace the previous sqids-java / sqids-javascript bridge with a pure in-repo CLJC Sqids implementation.
  • Keep the public API stable at org.sqids.clojure/{sqids,encode,decode} while moving internal code to total, non-throwing result envelopes. Only the public entrypoints throw.
  • Split the implementation into focused namespaces for alphabet, block_list, encoding, decoding, init, results, platform helpers, and cross-namespace invariants.
  • Move generator-heavy spec support into mirrored org.sqids.clojure.generators/* namespaces so the runtime files stay readable.
  • Support arbitrary JVM bigint round-trips where the old wrapper path was constrained by foreign implementations.
  • Move the bundled blocklist to resources/org/sqids/clojure/blocklist.json and add a Babashka bin/update-blocklist script to refresh it.

Testing, Specs, and Parity

  • Replace the old split test runner path with Kaocha as the single entrypoint via bin/kaocha.
  • Configure JVM, CLJS, and generative clojure.spec.test.check suites in tests.edn.
  • Colocate implementation-owned specs with their namespaces, and move the cross-namespace encode / decode fdefs into org.sqids.clojure.invariants so they can express stronger round-trip properties without cyclic implementation dependencies.
  • Enforce 100% coverage and emit HTML, LCOV, Codecov JSON, and JUnit XML outputs.
  • Add a parity harness and CI job against sqids/sqids-spec to compare reference outputs with this implementation.

Tooling and CI

  • Add strict clj-kondo configuration and local wrappers for clj-kondo, cljstyle, and Kaocha.
  • Switch pre-commit and CI hooks away from Docker-based formatters/lints toward local/system hooks (clj-kondo, cljstyle, shfmt, shellcheck, prettier, markdownlint-cli2).
  • Update GitHub Actions to use DeLaGuardo/setup-clojure, upload coverage/JUnit artifacts, and run the new parity job.

Documentation

  • Update README.md, CHANGELOG.md, and AGENTS.md to reflect the current architecture, commands, invariants, and contributor workflow.

Validation

  • bin/kaocha (169 tests, 962 assertions, 0 failures, 100% forms / 100% lines)
  • pre-commit run --all-files

@robhanlon22 robhanlon22 force-pushed the v1.1.0 branch 10 times, most recently from bc79a1b to 8344854 Compare March 7, 2026 23:05
@robhanlon22 robhanlon22 requested a review from 4kimov March 7, 2026 23:09
@robhanlon22 robhanlon22 force-pushed the v1.1.0 branch 5 times, most recently from 75712a2 to ec7eca4 Compare March 8, 2026 05:11
This replaces the prior sqids-java/sqids-javascript integration with a native
Clojure/ClojureScript implementation while keeping the public API stable. The
algorithm now lives in focused CLJC namespaces for alphabet, block-list,
encoding, decoding, initialization, results, and platform helpers, with the
bundled blocklist moved to resources and refreshed by a Babashka updater.

Internally, encode/decode now flow through a total result-based core so
validation and error handling are explicit and testable across platforms. Only
`org.sqids.clojure/{sqids,encode,decode}` throw. Cross-namespace encode/decode
fdefs live in `org.sqids.clojure.invariants`, which allows a stronger
encode-side round-trip property without creating implementation cycles.
Generator-heavy spec support also moved into mirrored
`org.sqids.clojure.generators/*` namespaces to keep runtime files readable.

Tooling and CI were modernized around Kaocha as the single test entrypoint,
100% coverage enforcement, machine-readable coverage outputs, JUnit artifacts,
and a parity harness plus CI job against `sqids-spec`. The repo now uses local
wrappers for clj-kondo and cljstyle, stricter lint policy, markdownlint and
prettier hooks, and refreshed AGENTS/README guidance for the current workflow.
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