Skip to content

v2.0.0

Choose a tag to compare

@ShadAhm ShadAhm released this 12 Sep 11:27
· 76 commits to master since this release
2ff3f96

First release published to npm — all three packages are live under the @kerusiweb scope:

npm install @kerusiweb/core @kerusiweb/angular   # Angular
npm install @kerusiweb/core @kerusiweb/react     # React

Breaking

  1. The Angular package is renamed ngx-kerusi-seatmap → @kerusiweb/angular,
    joining @kerusiweb/core and @kerusiweb/react under one scope. The ngx-
    prefix is Angular's convention for unscoped packages, where it exists to
    signal the framework in npm's flat namespace; a scope plus a framework
    segment already says the same thing, which is why every current
    multi-framework family names its bindings this way. No version of either
    name was ever published to npm, so there is no migration path to document —
    nothing depends on the old name.

    The import changes accordingly:

    -import { KerusiSeatmapComponent } from 'ngx-kerusi-seatmap';
    +import { KerusiSeatmapComponent } from '@kerusiweb/angular';

Changed

  1. The repository is renamed ngx-kerusi-seatmap → kerusiweb, and the
    demos move to shadahm.github.io/kerusiweb/. GitHub redirects the old URLs.
    The repo is no longer an Angular library that grew a React port; it is a
    seat-map renderer with framework bindings, and the name, the docs and the
    scripts now say so.

  2. Nothing in the workspace privileges one framework. projects/ now reads
    core/, angular/, react/, angular-demo/, react-demo/. Every npm
    script names its framework (start:angular, build:react, test:angular),
    and the bare start / build / test scripts — all of which meant Angular
    — are gone. @angular/* moved from the workspace root's dependencies to
    its devDependencies, alongside react, and the root tsconfig.json is
    framework-neutral: angularCompilerOptions moved into a new
    tsconfig.angular.json that only the Angular binding and demo extend, so
    core and the React binding no longer inherit them.

  3. Both demos deploy. GitHub Pages now serves a landing page linking to the
    Angular demo at /angular/ and the React demo at /react/, rather than
    giving the root to Angular alone.

  4. docs/kerusi.md is framework-neutral, and the conformance report is
    attributed to @kerusiweb/core, where the validator actually lives. Added
    CONTRIBUTING.md, issue templates and a PR template, each asking which
    package a report concerns.

Fixed

  1. Every package now ships its licence text. All three declared
    "license": "MIT" while the only LICENSE file sat at the repository root,
    which npm does not include in a workspace package's tarball — so each one
    would have published an MIT claim with nothing behind it. @kerusiweb/core,
    @kerusiweb/angular and @kerusiweb/react each carry a copy now.

  2. @kerusiweb/angular declares publishConfig.access: "public", as the
    other two packages already did. Scoped packages default to restricted
    access, which a free npm organisation cannot host, so publishing it would
    have failed until --access public was passed by hand.

Added

  1. A React binding, @kerusiweb/react. Same components, same props, same
    SVG as the Angular package: <KerusiSeatmap>, <KerusiSection>,
    <KerusiLegend>, plus useKerusiState in place of KerusiStateStore. Its
    test suite is the Angular component spec's assertions run against
    React-rendered DOM, and for the same documents the two bindings emit
    byte-identical markup.

    React translations of the Angular surface, where they could not be
    mechanical: [(selection)] becomes the controlled/uncontrolled pair
    (selection + onSelectionChange, or defaultSelection); validate="throw"
    throws during render so an error boundary catches it; focus moves through a
    ref map rather than a querySelectorAll scan; and a repeated live-region
    message is made distinct with a zero-width space in a single commit, rather
    than the clear-then-microtask React would batch away.

    Styles ship as one @kerusiweb/react/styles.css the consumer imports, since
    React has no equivalent of Angular's view-encapsulated component CSS. Colours
    stay bound inline in both bindings, so the three theming tiers
    (--kerusi-* stylesheet property → the colors prop → the library default)
    behave identically.

    The package is built by tsc alone, with no bundler, and declares react
    and @kerusiweb/core as peers.

  2. projects/react-demo/ — a Vite React demo showing the same five venues
    as the Angular one. The venue documents moved to projects/demo-scenarios/
    so both demos render the same fixtures rather than two copies drifting apart.
    The published GitHub Pages site remains the Angular demo.

  3. Three functions promoted into @kerusiweb/core, each of which the React
    binding would otherwise have retyped verbatim from the Angular one:
    isRtlLocale (view/rtl.ts), heldSeats (kerusi/kerusi-state.ts — core
    already exported the HeldSeat type with nothing producing it), and
    resolveColors (view/kerusi-seatmap-colors.ts). All three are additive;
    the Angular binding now calls them instead of its own copies.

Changed

  1. The framework-agnostic core is now its own package, @kerusiweb/core.
    The Kerusi document types, the conformance validator, the price/locale/row
    resolution, the render model and its geometry, and the colour, ARIA and
    selection helpers all moved out of the Angular library into
    projects/core/. @kerusiweb/angular is now the Angular binding alone —
    three components and the signal-backed KerusiStateStore — and declares
    @kerusiweb/core as a peer dependency.

    The split was mostly already there: only four files imported @angular/core
    and none imported RxJS. The one genuinely mixed file was
    kerusi-state-store.ts, whose pure delta-ordering and hold-expiry functions
    are now @kerusiweb/core's kerusi-state, with the signal wrapper left
    behind in the Angular package. No logic changed. See
    docs/architecture.md for what belongs where.

    Core compiles under strict with no framework, no DOM and no any, tests
    under plain Vitest, and — because it is "type": "module" with explicit
    import extensions — loads in Node ESM without a bundler, so validation can
    run server-side or in a build step.

Breaking

  • Install both packages: npm install @kerusiweb/core @kerusiweb/angular.

  • Imports move. Everything except KerusiSeatmapComponent,
    KerusiSectionComponent, KerusiLegendComponent, KerusiStateStore and the
    component I/O types (SeatDisallowed, SeatInteraction,
    SectionRenderOptions, ValidationMode) now comes from @kerusiweb/core:

    import { KerusiSeatmapComponent } from '@kerusiweb/angular';
    import type { KerusiMap, KerusiState } from '@kerusiweb/core';

    No symbol was renamed, removed or changed in behaviour — only its package.