From 171461e13568f43a81ab59215f721bd00de332d6 Mon Sep 17 00:00:00 2001 From: prdHugo <48803115+HugoPerard@users.noreply.github.com> Date: Fri, 28 Aug 2026 01:31:01 -0700 Subject: [PATCH 1/7] fix: publish types from dist, not src --- .changeset/publish-types.md | 5 +++++ packages/ui-state/package.json | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 .changeset/publish-types.md diff --git a/.changeset/publish-types.md b/.changeset/publish-types.md new file mode 100644 index 0000000..2aec625 --- /dev/null +++ b/.changeset/publish-types.md @@ -0,0 +1,5 @@ +--- +"@bearstudio/ui-state": patch +--- + +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. diff --git a/packages/ui-state/package.json b/packages/ui-state/package.json index a3394b2..c065459 100644 --- a/packages/ui-state/package.json +++ b/packages/ui-state/package.json @@ -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", From 4b9cbbdb57d14617023d087df8af3245b8d517e1 Mon Sep 17 00:00:00 2001 From: prdHugo <48803115+HugoPerard@users.noreply.github.com> Date: Fri, 28 Aug 2026 01:31:34 -0700 Subject: [PATCH 2/7] chore: release @bearstudio/ui-state 2.0.0 --- packages/ui-state/CHANGELOG.md | 16 ++++++++++++++++ packages/ui-state/package.json | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/packages/ui-state/CHANGELOG.md b/packages/ui-state/CHANGELOG.md index e6431b4..0e22cfb 100644 --- a/packages/ui-state/CHANGELOG.md +++ b/packages/ui-state/CHANGELOG.md @@ -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 diff --git a/packages/ui-state/package.json b/packages/ui-state/package.json index c065459..31a13a3 100644 --- a/packages/ui-state/package.json +++ b/packages/ui-state/package.json @@ -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", From 5c4e2918e255833bbf3cd1648b00c2f23e7a02ae Mon Sep 17 00:00:00 2001 From: prdHugo <48803115+HugoPerard@users.noreply.github.com> Date: Fri, 28 Aug 2026 01:31:46 -0700 Subject: [PATCH 3/7] chore: consume changesets for 2.0.0 --- .changeset/discriminated-ui-state.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 .changeset/discriminated-ui-state.md diff --git a/.changeset/discriminated-ui-state.md b/.changeset/discriminated-ui-state.md deleted file mode 100644 index e3e70a3..0000000 --- a/.changeset/discriminated-ui-state.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@bearstudio/ui-state": minor ---- - -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. From 9f9f3330ebd871351d93895630aecac0f19ba84f Mon Sep 17 00:00:00 2001 From: prdHugo <48803115+HugoPerard@users.noreply.github.com> Date: Fri, 28 Aug 2026 01:31:47 -0700 Subject: [PATCH 4/7] chore: consume changesets for 2.0.0 --- .changeset/status-matching.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 .changeset/status-matching.md diff --git a/.changeset/status-matching.md b/.changeset/status-matching.md deleted file mode 100644 index 1072a12..0000000 --- a/.changeset/status-matching.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@bearstudio/ui-state": minor ---- - -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. From 7f66744213bff0a907e065db15c2676880df275c Mon Sep 17 00:00:00 2001 From: prdHugo <48803115+HugoPerard@users.noreply.github.com> Date: Fri, 28 Aug 2026 01:31:54 -0700 Subject: [PATCH 5/7] chore: consume is-array changeset --- .changeset/is-array.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 .changeset/is-array.md diff --git a/.changeset/is-array.md b/.changeset/is-array.md deleted file mode 100644 index 7fab93d..0000000 --- a/.changeset/is-array.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@bearstudio/ui-state": minor ---- - -Allow `is()` to take an array of statuses, like `when` and `match`. It still narrows the discriminated union to the listed variants. From 269568f7a77701479defe8242c05594237cd9dd2 Mon Sep 17 00:00:00 2001 From: prdHugo <48803115+HugoPerard@users.noreply.github.com> Date: Fri, 28 Aug 2026 01:32:23 -0700 Subject: [PATCH 6/7] chore: consume ts7 changeset --- .changeset/ts7-oxlint-oxfmt.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 .changeset/ts7-oxlint-oxfmt.md diff --git a/.changeset/ts7-oxlint-oxfmt.md b/.changeset/ts7-oxlint-oxfmt.md deleted file mode 100644 index 7d3392a..0000000 --- a/.changeset/ts7-oxlint-oxfmt.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@bearstudio/ui-state": patch ---- - -Upgrade TypeScript to 7.0.2 and replace ESLint/Prettier with oxlint/oxfmt. No public API changes. From fbbabe3c3c8ca0c25f23cf247a6c270b44df694b Mon Sep 17 00:00:00 2001 From: prdHugo <48803115+HugoPerard@users.noreply.github.com> Date: Fri, 28 Aug 2026 01:32:29 -0700 Subject: [PATCH 7/7] chore: consume publish-types changeset --- .changeset/publish-types.md | 5 ----- 1 file changed, 5 deletions(-) delete mode 100644 .changeset/publish-types.md diff --git a/.changeset/publish-types.md b/.changeset/publish-types.md deleted file mode 100644 index 2aec625..0000000 --- a/.changeset/publish-types.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@bearstudio/ui-state": patch ---- - -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.