From 7036825c43877a6ad29923302e8474ebab803dc4 Mon Sep 17 00:00:00 2001 From: Noah Date: Fri, 30 Oct 2026 06:15:34 +0100 Subject: [PATCH 1/4] [legacy] add explicit return types to the dom utils JSR rejects functions without a return type in the public API (slow types). The types are the ones tsc inferred, the generated d.ts is unchanged. Co-Authored-By: Claude Opus 5.5 --- chuchi-legacy/src/dom/utils.ts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/chuchi-legacy/src/dom/utils.ts b/chuchi-legacy/src/dom/utils.ts index 61f9f8b..f7dd63b 100644 --- a/chuchi-legacy/src/dom/utils.ts +++ b/chuchi-legacy/src/dom/utils.ts @@ -1,5 +1,5 @@ // create element -export function c(el: any, attrs: Record = {}) { +export function c(el: any, attrs: Record = {}): any { el = document.createElement(el); Object.entries(attrs).forEach(([key, val]) => { switch (key) { @@ -30,7 +30,7 @@ export class CustomEl { } // append child -export function a(to: Element, ...els: any[]) { +export function a(to: Element, ...els: any[]): Element { els.forEach(el => { if (!el) return; @@ -64,13 +64,13 @@ export function ct(to: Element, className: string, cond: boolean = null) { } // returns { x, y } -export function offset(el: Element) { +export function offset(el: Element): { x: number; y: number } { const { left, top } = el.getBoundingClientRect(); return { x: left, y: top }; } // left right is ignored -export function inViewY(el: Element) { +export function inViewY(el: Element): boolean { const wHeight = window.innerHeight; const { top, bottom } = el.getBoundingClientRect(); @@ -79,12 +79,12 @@ export function inViewY(el: Element) { } // name --my-var -export function cssVar(name: string, el: Element = null) { +export function cssVar(name: string, el: Element = null): string { if (!el) el = document.documentElement; return getComputedStyle(el).getPropertyValue(name); } -export function fontSize(el: Element = null) { +export function fontSize(el: Element = null): number { if (!el) el = document.documentElement; return parseFloat(getComputedStyle(el).fontSize); } From 885d65f7f2a71ed7145400a87361158458628272 Mon Sep 17 00:00:00 2001 From: Noah Date: Fri, 30 Oct 2026 06:15:34 +0100 Subject: [PATCH 2/4] Publish chuchi 0.1.7, chuchi-utils 0.1.7, chuchi-core 0.1.6, chuchi-legacy 1.1.1 Bumps package.json and jsr.json of every package to the same version, the publish job checks both against the tag. chuchi-core and chuchi-legacy were behind on JSR (0.1.1 and 1.0.2) and get their first JSR release. The JSR exports of chuchi gain ./api and ./cookies and those of chuchi-legacy ./dom/Context2d and ./dom/utils, like in package.json. CHANGELOG.md lists the changes, including the breaking cookie change in chuchi: set defaults to Path=/ now. Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 46 ++++++++++++++++++++++++++++++++++++++ chuchi-core/jsr.json | 2 +- chuchi-core/package.json | 2 +- chuchi-legacy/jsr.json | 6 +++-- chuchi-legacy/package.json | 2 +- chuchi-utils/jsr.json | 2 +- chuchi-utils/package.json | 2 +- chuchi/jsr.json | 6 +++-- chuchi/package.json | 2 +- package-lock.json | 8 +++---- 10 files changed, 64 insertions(+), 14 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..6a8ec45 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,46 @@ +# Changelog + +## chuchi 0.1.7 + +### Breaking + +- Cookies set with `set` without a `path` now default to `Path=/` (like + crelte). Before, the browser used the directory of the current page, so a + cookie set on `/account/settings` was only sent for `/account/*`. Pass + `path` explicitly to keep the old behaviour. +- `remove(name, opts)` takes the `path` and `domain` the cookie was set with. + A cookie that was set on another path than `/` must be removed with that + path. + +### Fixes + +- `ServerCookies.get` returns the value set during the request, also without + `maxAge`, and `null` after `remove`. +- `SsrCache` stores its entries in a `Map`, keys like `constructor` work. +- The router keeps saving scroll positions after a quick navigation. +- Links to the current page with a hash scroll to the target instead of + loading the page again. +- Same host links with a path starting with `//` no longer throw. +- Clicks on links with `download` or non http links are not intercepted. +- JSR exports `./api` and `./cookies`. + +## chuchi-utils 0.1.7 + +- `range` returns the right values (`range(0, 10, 2)` was broken and + `range(-5, 5, 2)` threw). A step of 0 or below returns `[]`. +- `searchScore` measures the right distance correctly, exact matches rank + better. +- Removing a `SlotArray` slot twice no longer hands out the slot twice. + +## chuchi-core 0.1.6 + +- `GraphQl.request` throws `NotOk` with the status for responses that are not + json and no longer modifies the passed headers. +- `ApiError.fromJson` no longer crashes on `null`, numbers or `{}`. +- First release on JSR (`@chuchi/core`). + +## chuchi-legacy 1.1.1 + +- `inViewY` is true for elements taller than the viewport. +- First release on JSR (`@chuchi/legacy`), including `./dom/Context2d` and + `./dom/utils`. diff --git a/chuchi-core/jsr.json b/chuchi-core/jsr.json index f1db4f8..a7374a2 100644 --- a/chuchi-core/jsr.json +++ b/chuchi-core/jsr.json @@ -1,6 +1,6 @@ { "name": "@chuchi/core", - "version": "0.1.1", + "version": "0.1.6", "license": "MIT or Apache-2.0", "exports": { "./api/Api": "./src/api/Api.ts", diff --git a/chuchi-core/package.json b/chuchi-core/package.json index 7305182..72cd2bc 100644 --- a/chuchi-core/package.json +++ b/chuchi-core/package.json @@ -1,6 +1,6 @@ { "name": "chuchi-core", - "version": "0.1.5", + "version": "0.1.6", "author": "Sören Meier ", "type": "module", "scripts": { diff --git a/chuchi-legacy/jsr.json b/chuchi-legacy/jsr.json index e4eb49f..41d3592 100644 --- a/chuchi-legacy/jsr.json +++ b/chuchi-legacy/jsr.json @@ -1,12 +1,14 @@ { "name": "@chuchi/legacy", - "version": "1.0.2", + "version": "1.1.1", "license": "MIT or Apache-2.0", "exports": { "./time/Date": "./src/time/Date.ts", "./time/DateTime": "./src/time/DateTime.ts", "./time/DateTimeRange": "./src/time/DateTimeRange.ts", "./time/Duration": "./src/time/Duration.ts", - "./time/localization": "./src/time/localization.ts" + "./time/localization": "./src/time/localization.ts", + "./dom/Context2d": "./src/dom/Context2d.ts", + "./dom/utils": "./src/dom/utils.ts" } } diff --git a/chuchi-legacy/package.json b/chuchi-legacy/package.json index dbaef98..1517688 100644 --- a/chuchi-legacy/package.json +++ b/chuchi-legacy/package.json @@ -1,6 +1,6 @@ { "name": "chuchi-legacy", - "version": "1.1.0", + "version": "1.1.1", "author": "Sören Meier ", "type": "module", "scripts": { diff --git a/chuchi-utils/jsr.json b/chuchi-utils/jsr.json index 0661dfa..ccdef2c 100644 --- a/chuchi-utils/jsr.json +++ b/chuchi-utils/jsr.json @@ -1,6 +1,6 @@ { "name": "@chuchi/utils", - "version": "0.1.6", + "version": "0.1.7", "license": "MIT or Apache-2.0", "exports": { ".": "./src/index.ts", diff --git a/chuchi-utils/package.json b/chuchi-utils/package.json index b15c646..fd38705 100644 --- a/chuchi-utils/package.json +++ b/chuchi-utils/package.json @@ -1,6 +1,6 @@ { "name": "chuchi-utils", - "version": "0.1.6", + "version": "0.1.7", "author": "Sören Meier ", "type": "module", "scripts": { diff --git a/chuchi/jsr.json b/chuchi/jsr.json index b66c350..00f9110 100644 --- a/chuchi/jsr.json +++ b/chuchi/jsr.json @@ -1,10 +1,12 @@ { "name": "@chuchi/chuchi", - "version": "0.1.6", + "version": "0.1.7", "license": "MIT or Apache-2.0", "exports": { ".": "./src/index.ts", "./ssr": "./src/ssr/index.ts", - "./stores": "./src/stores/index.ts" + "./stores": "./src/stores/index.ts", + "./api": "./src/api.ts", + "./cookies": "./src/cookies/index.ts" } } diff --git a/chuchi/package.json b/chuchi/package.json index d3337a6..f433751 100644 --- a/chuchi/package.json +++ b/chuchi/package.json @@ -1,6 +1,6 @@ { "name": "chuchi", - "version": "0.1.6", + "version": "0.1.7", "author": "Sören Meier ", "type": "module", "scripts": { diff --git a/package-lock.json b/package-lock.json index 4988023..4a27fa8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -25,7 +25,7 @@ } }, "chuchi": { - "version": "0.1.6", + "version": "0.1.7", "license": "MIT or Apache-2.0", "dependencies": { "chuchi-core": "^0.1.0", @@ -37,7 +37,7 @@ } }, "chuchi-core": { - "version": "0.1.5", + "version": "0.1.6", "license": "MIT or Apache-2.0", "dependencies": { "chuchi-utils": "^0.1.0" @@ -48,7 +48,7 @@ } }, "chuchi-legacy": { - "version": "1.1.0", + "version": "1.1.1", "license": "MIT or Apache-2.0", "dependencies": { "chuchi-utils": "^0.1.0" @@ -59,7 +59,7 @@ } }, "chuchi-utils": { - "version": "0.1.6", + "version": "0.1.7", "license": "MIT or Apache-2.0", "devDependencies": { "tslib": "^2.6.2", From 288397190fc315d5bab1c6b5d15b03d06efc0bdc Mon Sep 17 00:00:00 2001 From: Noah Date: Fri, 30 Oct 2026 06:15:44 +0100 Subject: [PATCH 3/4] ci: publish to npm with Trusted Publishing only Trusted Publishing is set up for all four packages. The NPM_TOKEN secret is from 2024 and most likely revoked with npm's classic tokens, so it is no longer passed, like in meierlabs-seo. Co-Authored-By: Claude Opus 5.5 --- .github/workflows/publish.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index 7e5d4dc..bf04628 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -11,7 +11,7 @@ jobs: permissions: contents: read # Allow reading the repository content - id-token: write # Required for provenance and JSR authentication + id-token: write # Required for Trusted Publishing, provenance and JSR container: image: node:24 @@ -101,8 +101,6 @@ jobs: echo "Stable release detected. Publishing to latest tag." npm publish --provenance fi - env: - NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # fallback if Trusted Publishing is not set up - name: Publish to JSR run: | From 256a165d8f18c2c9c580b281e83473722c95da92 Mon Sep 17 00:00:00 2001 From: Noah Date: Fri, 30 Oct 2026 06:18:22 +0100 Subject: [PATCH 4/4] Shorten the changelog Co-Authored-By: Claude Opus 5.5 --- CHANGELOG.md | 40 +++++++--------------------------------- 1 file changed, 7 insertions(+), 33 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a8ec45..f9021a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,45 +2,19 @@ ## chuchi 0.1.7 -### Breaking - -- Cookies set with `set` without a `path` now default to `Path=/` (like - crelte). Before, the browser used the directory of the current page, so a - cookie set on `/account/settings` was only sent for `/account/*`. Pass - `path` explicitly to keep the old behaviour. -- `remove(name, opts)` takes the `path` and `domain` the cookie was set with. - A cookie that was set on another path than `/` must be removed with that - path. - -### Fixes - -- `ServerCookies.get` returns the value set during the request, also without - `maxAge`, and `null` after `remove`. -- `SsrCache` stores its entries in a `Map`, keys like `constructor` work. -- The router keeps saving scroll positions after a quick navigation. -- Links to the current page with a hash scroll to the target instead of - loading the page again. -- Same host links with a path starting with `//` no longer throw. -- Clicks on links with `download` or non http links are not intercepted. -- JSR exports `./api` and `./cookies`. +- **Breaking:** cookies default to `Path=/`, remove them with the path they + were set with (`remove(name, { path })`). +- Fixes for cookies, `SsrCache`, scroll restoration, hash links and `//` + paths in the router. ## chuchi-utils 0.1.7 -- `range` returns the right values (`range(0, 10, 2)` was broken and - `range(-5, 5, 2)` threw). A step of 0 or below returns `[]`. -- `searchScore` measures the right distance correctly, exact matches rank - better. -- Removing a `SlotArray` slot twice no longer hands out the slot twice. +- Fixes for `range`, `searchScore` and `SlotArray.remove`. ## chuchi-core 0.1.6 -- `GraphQl.request` throws `NotOk` with the status for responses that are not - json and no longer modifies the passed headers. -- `ApiError.fromJson` no longer crashes on `null`, numbers or `{}`. -- First release on JSR (`@chuchi/core`). +- Better errors for non-json responses, first JSR release. ## chuchi-legacy 1.1.1 -- `inViewY` is true for elements taller than the viewport. -- First release on JSR (`@chuchi/legacy`), including `./dom/Context2d` and - `./dom/utils`. +- `inViewY` fix, first JSR release.