Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions .changeset/discriminated-ui-state.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/is-array.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/status-matching.md

This file was deleted.

5 changes: 0 additions & 5 deletions .changeset/ts7-oxlint-oxfmt.md

This file was deleted.

16 changes: 16 additions & 0 deletions packages/ui-state/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,21 @@
# @bearstudio/ui-state

## 2.0.0

### Major Changes

- Make `getUiState` a discriminated union of `set()` results. `is()` narrows, `match` data is per-status, and `exhaustive()` is a type error to call while statuses remain. Callers of 1.1.0 that read `state` without narrowing will fail typecheck.

### Minor Changes

- Allow `is()` to take an array of statuses, like `when` and `match`. It still narrows the discriminated union to the listed variants.
- Allow `getUiState` to take a status string so `.match().exhaustive()` works without a `set()` callback. A wide `string` is a type error, since it cannot be matched exhaustively.

### Patch Changes

- Upgrade TypeScript to 7.0.2 and replace ESLint/Prettier with oxlint/oxfmt. No public API changes.
- Point published `exports.types` at `./dist/index.d.ts`. `.npmignore` strips `src/`, so the previous `./src/index.ts` path 404'd for consumers under bundler/NodeNext.

## 1.1.0

### Minor Changes
Expand Down
14 changes: 12 additions & 2 deletions packages/ui-state/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@bearstudio/ui-state",
"version": "1.1.0",
"version": "2.0.0",
"description": "A lightweight utility library to easily manage UI display states such as loading, error or any custom-defined state",
"keywords": [
"pattern",
Expand All @@ -25,11 +25,21 @@
"exports": {
".": {
"types": "./src/index.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs",
"default": "./dist/index.js"
}
},
"publishConfig": {
"access": "public"
"access": "public",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"require": "./dist/index.cjs",
"default": "./dist/index.js"
}
}
},
"scripts": {
"dev": "tsup src/index.ts --format esm,cjs --watch",
Expand Down
Loading