Skip to content

v0.3.0 - #6

Merged
josher8a merged 36 commits into
masterfrom
refactor
Mar 7, 2026
Merged

josher8a merged 36 commits into
masterfrom
refactor

Conversation

@josher8a

@josher8a josher8a commented Mar 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • ReScript v12 upgrade — migrate to ReScript v12 stable, removing Object.magic, leveraging native optionals, and cleaning up the Undefinable module in favor of built-in
    language features
  • Dual CJS/ESM publishing — add tsup build pipeline and barrel index.ts for proper dual-format package output
  • AttributeName collision fix — use injective escaping (___, -_dash_) in AttributeName.toString to prevent name collisions; validate reserved expression characters
    ([, ], #, :)
  • AttributeValue type inlining — define attributeValue as a ReScript record type instead of importing an opaque external, improving type safety and portability
  • Path parser optimization — replace recursive splitWhen with String.search regex for cleaner, faster attribute path parsing
  • CI & release infra — add GitHub Actions workflow, CHANGELOG.md, prerelease publishing under next dist-tag
  • Test improvements — add isValueEqual edge cases, SS/NS length check, expression assertion coverage; simplify ConditionExpression specs
  • Deduplicate type exports via barrel file; flatten maker modules for simpler API surface

Test plan

  • npm test passes all existing and new specs
  • npm run build produces valid CJS and ESM outputs
  • Verify AttributeName.toString escaping is injective (no collisions between - and _ names)
  • Confirm examples compile and run against the updated API
  • CI workflow runs successfully on push

josher8a and others added 30 commits November 1, 2025 03:32
isValueEqual for SS and NS types only checked subset inclusion
(every x in y) without verifying equal length, so {SS: ["a","b"]}
was incorrectly considered equal to {SS: ["a","b","c"]}.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add types, exports, files fields to package.json
- Fix README to use AWS SDK v3 imports and package import path
- Migrate all commented-out ConditionExpression tests to current API
  (25 new tests: between, inList, attributeExists, attributeNotExists,
  attributeType, beginsWith, contains, toContains, not, size, and/or,
  plus full Condition.build serialization output)
- Fix AttributePath.spec.ts error assertions with actual message matchers

Test count: 43 -> 68

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace console.log with expect() assertions on all generated
expression strings, attribute names, and attribute values including
alias collision handling with _ suffixes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reject names containing `[`, `]`, `#`, and `:` in addition to spaces
and dots, and include the offending name in the error message.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
ReScript now compiles to ESM, tsup bundles into both CJS and ESM
formats. Added namespace config, optional rescript peer dependency,
and explicit files whitelist. Removed stale jest config and .npmignore.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…isions

`_` → `__`, `-` → `_dash_` so that names like `foo_bar` and `foo-bar`
no longer produce the same expression placeholder.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Cross-type comparisons, nested M/L with mixed types, deeply nested
structures, different key counts/lengths, and addValue alias collision
handling (reuse, suffix, chained suffixes).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove @Gentype from alias modules (C, K, U, P), keep it on canonical
modules (Condition, KeyCondition, Update, Projection). Add src/index.ts
barrel that re-exports all types and modules with short-name aliases.
Update tsup entry and package.json exports to use the barrel.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Reconstructed from git tags (v0.0.1 through v0.2.0) plus unreleased
refactor branch work.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Set tsup target to node18 and add engines.node >= 18
- Add node 18 to CI test matrix
- Tighten rescript peerDep to >=12.2.0, align examples to ^12.2.0
- Update spec imports from ./Brushless.bs to ./index
- Document minimum Node.js version in CHANGELOG

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
josher8a and others added 6 commits March 7, 2026 17:10
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Bump brushless dep, replace AWS SDK v2 with v3 (convertToAttr),
rename bsconfig.json to rescript.json, drop jest stack, and
expose src/* subpath export for ReScript consumers.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add KeyCondition.spec.ts with 20 tests covering all SK condition
  variants, build output, and register accumulation
- Make `sk` optional in `keyCondition` type (omit sk for pk-only queries)
- Deprecate `Any` variant using `@as(undefined)` for backwards compat
- All 101 tests pass

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Exercise all 9 overloaded operators (==, !=, <, <=, >, >=, &&, ||, !)
with runtime assertions on built expression output. Also covers Size
and AttributePath operands.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@josher8a
josher8a marked this pull request as ready for review March 7, 2026 23:00
@josher8a
josher8a merged commit b92571d into master Mar 7, 2026
6 checks passed
josher8a added a commit that referenced this pull request Mar 8, 2026
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