Repository navigation
Migrate to GTKX 1.6, fix unit conversion, add home-use limits - #1
Merged
Merged
Conversation
The pinned @gtkx/react 0.11.1 depends on @gtkx/ffi, which has been removed from npm, so dependencies could no longer install. - Port the app to GTKX 1.6: generated @gtkx/gi/@gtkx/jsx bindings, gtkx.config.ts, and gtkx dev/build/codegen/deploy. Preferences and About become AdwPreferencesDialog/AdwAboutDialog, the header menu is a GMenu driven by window actions, and the inputs are AdwSpinRows. - Replace the hand-written Flatpak manifest, native shim and SEA scripts with `gtkx deploy --target flatpak` (GNOME 50 runtime, since GTKX needs GTK 4.20). Update CI to Node 24. - Keep coffee weight in grams as the single source of truth so switching units converts the amounts losslessly instead of keeping the raw number (20 g used to become 20 oz). - Add per-method home-use limits (MAX_WATER_ML); the coffee limit is derived through the ratio so both rows always agree. - Remove leftover debug fetch() logging to 127.0.0.1:7242. - Exclude build/ from the dev watcher; the Flatpak build tree has symlink loops that ran the dev server out of memory. - Fix stale monorepo paths, untrack tsconfig.app.tsbuildinfo, and add CLAUDE.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
GitHub sets HOME=/github/home inside job containers, under a world-writable /github. The SWC native addon (used by gtkx codegen) refuses that as a cache root (ERR_SWC_NATIVE_CACHE), failing the typecheck step. Point XDG_CACHE_HOME and SWC_NATIVE_BINDING_CACHE at /root/.cache instead. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Port the release flow from tduarte/Scribe. Pushing a v* tag that matches package.json builds it with gtkx deploy, GPG-signs the OSTree repo (app commit, summary and appstream), and publishes it as a Flatpak repository on GitHub Pages with a .flatpakref, .flatpakrepo and landing page; the .flatpak bundle is attached to the GitHub release. - .github/workflows/release.yml, build-aux/publish-repo.sh, build-aux/pages/index.html - docs/RELEASING.md: one-time setup (signing key secret, Pages, v* tag deployment rule) and how to cut a release - Pin the Flatpak branch to "stable" in gtkx.config.ts - Refresh assets/Screenshot.png with the GTKX 1.6 UI Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gtkx codegen reads GTK's GIR files from the host, and the flatpak-github-actions container has none, so the typecheck failed with "GIR file Gtk-4.0.gir not found". Install the GNOME 50 Platform and SDK into the user installation that gtkx deploy builds from, and point codegen at the SDK's gir-1.0 through a new GTKX_GIR_PATH override in gtkx.config.ts (local development keeps the host default). Also disable rofiles-fuse, which CI containers often lack. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
pnpm installno longer works onmain. The pinned@gtkx/react@0.11.1depends on@gtkx/ffi, and every version of that package has been removed from npm. GTKX is now at 1.6, where@gtkx/ffibecame@gtkx/runtime, and the API changed enough that this is a port rather than a version bump.What changed
App (
src/app.tsx,src/utils/calculations.ts)@gtkx/gi/*,@gtkx/jsx/*) bygtkx codegen.AdwPreferencesDialogandAdwAboutDialoginstead of separate portaled windows.GMenudriven bywin.preferences/win.aboutactions.Ctrl+,is registered as an app accelerator.ComboRowthat shows the ratio as its subtitle. Coffee and water areAdwSpinRows.MAX_WATER_ML). The coffee maximum is derived from it through the ratio, so the two rows never clamp out of sync:fetch()calls that posted app state to127.0.0.1:7242.Tooling and packaging
gtkx.config.tsreplaces the app ID inpackage.json. The scripts are nowpnpm dev,typecheck,buildandbuild:flatpak.gtkx deploy --target flatpakgenerates the manifest, desktop entry and metainfo, and bundles Node. This replaces:flatpak/manifest and its@gtkx/nativewrapperscripts/bundle.ts,src/dev.tsxandtsconfig.app.jsondata/icons/in the hicolor layout.vite.config.tsexcludesbuild/from the dev watcher. The Flatpak build tree contains symlink loops that rangtkx devout of memory.pnpm build:flatpakin thegnome-50container.run-dev.shand the README.tsconfig.app.tsbuildinfois no longer tracked.CLAUDE.md.AGENTS.mdis generated bygtkx codegen, which recommends committing it.Flatpak releases (added later in this PR)
Ported the release flow from tduarte/Scribe. Pushing a
v*tag that matchespackage.json's version runs.github/workflows/release.yml, which:gtkx deploy;build-aux/publish-repo.sh;.flatpakref, a.flatpakrepoand a landing page;.flatpakbundle to the GitHub release.Tested locally with a throwaway key. Installing from the served
.flatpakrefinto a scratchFLATPAK_USER_DIRworked, withgpg-verify=trueandgpg-verify-summary=true, andflatpak updateandremote-lsworked against it. One-time setup is still needed before the first tag (seedocs/RELEASING.md):FLATPAK_GPG_PRIVATE_KEYsecret;v*tag rule to thegithub-pagesenvironment.The CI workflow also got a fix: SWC's native addon refused the container's world-writable
HOMEas its cache root, so caches now go under/root/.cache.Testing
pnpm typecheckandpnpm buildpass.pnpm build:flatpakbuiltbuild/out/io.github.tduarte.cafe-1.0.0-x86_64.flatpak(26 MiB) locally. The bundle has not been installed or run.Reviewer notes
key). This is deliberate: otherwise GTK can apply the new value before the new bounds, clamp it, and report it back as a user edit. The comments inapp.tsxand CLAUDE.md explain it.🤖 Generated with Claude Code