Repository navigation
Releases
Releases · gemstack-rb/gemstack
GemStack 0.4.3
bin/deploy/gemstack deploy: runs Kamal with the root.env.production.local,.env.production
and.envloaded (never.env.local), so.kamal/secretsresolves from the same.envas everything
else — Kamal doesn't read.envitself. Without arguments it deploys, refusing while there are
uncommitted changes (Kamal builds the last commit); other Kamal commands pass through
(bin/deploy setup,bin/deploy logs).gemstack generate deploywritesbin/deploy.gemstack updateupdates the deploy files too (Dockerfile,config/deploy.yml,.kamal/secrets,
bin/deploy…), the same way as the app's templates: unedited files are updated, edited ones can be
merged — starting from the exact template each was generated from, which.gemstack/generators.json
records — and files a release adds (bin/deploy) are created. Before, deploy files never got a
release's fixes aftergemstack generate deploy.gemstack generate deploy: the api role is the primary role, so it boots before the web role, whose
health check renders pages that call the API (the first deploy could fail before); the web role enables
kamal-proxy explicitly.config/deploy.ymlshows how to servewwwand the bare domain and to set the
SSH user,.kamal/secretshow to use GitHub's registry; the generator says to run
bundle lock --add-checksumswhenGemfile.locklists gem checksums. The deployment guide covers these
and adding your own settings.
GemStack 0.4.2
gemstack update: files you edited that the release also changed can be merged —[m]ergekeeps
your edits and applies the release's template changes on top (three-way,git merge-file), with conflict
markers only where both changed the same lines. Before, the choices were overwrite (losing your edits),
skip, diff or save asFILE.new.
GemStack 0.4.1
- One
.envfor the API and the frontend: the root one.frontend/lib/gemstack/root-env.cjsloads the
root.envfiles for Next.js (same order as the API, real environment first):next.config.tsrequires
it, sonext dev,next buildandnext startget the values wherever they run, and the standalone
server preloads it (npm run start:standalone, i.e.
node -r ./lib/gemstack/root-env.cjs .next/standalone/server.js). Before, a production build outside
gemstack devcompiledNEXT_PUBLIC_*values in as undefined, and the standalone server's server-side
code only saw real environment variables. The API now loads the root.envfiles in production too, when
present (real environment variables still win). The Docker image built bygemstack generate deploygets
the root.env'sNEXT_PUBLIC_*lines as a build secret fornext build(.kamal/secrets:
GEMSTACK_PUBLIC_ENV), never stored in the image, and its web command preloads the loader too. Existing
apps:gemstack updateadds the loader and updatesnext.config.tsandpackage.json; re-run
gemstack generate deployfor the Docker/Kamal part.
GemStack 0.4.0
Upgrading from 0.3.x: run gemstack update (it also updates the files gemstack new wrote). Apps that
added realtime: copy frontend/lib/gemstack/realtime.ts from a fresh gemstack add realtime for
WebSockets, realtime.send, presence and the offline status — the old client keeps working over
Server-Sent Events. Validation error messages now list the failures (the errors hash is unchanged).
- Model enums:
enum :status, %w[draft published archived], default: "draft"— a string column
limited to those values, validated, accepted only with those values by the request schema, typed
"draft" | "published" | "archived"in TypeScript and OpenAPI, withProduct.statuses,draft?,
published!and chainableProduct.published(prefix:for clashes). Generators take
status:enum:draft,published,archived(migration column, theenumline, a<select>in the form).
Schemas and fields takeenum:too. - Validation errors say what failed in their message — "Validation failed: price must be greater than 0" —
not only inerrors, and generated forms show the message when an error belongs to no field in the form
(e.g.errors.add(:base, …)); before, such errors left the form without any message. - Realtime runs over WebSockets.
gemstack add realtimegives one WebSocket per browser tab on
/api/realtime(same origin; the dev gateway and kamal-proxy route it with/api), carrying
subscriptions, broadcasts, browser → server messages (realtime.send→receivein
config/channels.rb, with replies), presence (channel "rooms:*", presence: true,usePresence,
GemStack::Realtime.present_on), connection identity (identify) and replay after reconnects. The
browser client reconnects with backoff, resubscribes and de-duplicates; Origins are checked and
messages are size- and rate-limited.GemStack.broadcast, channel rules and brokers are unchanged. - Server-Sent Events are a full second transport with the same features (
receivevia POST,
presence, identity, replay).config.realtime.transports(default[:websocket, :sse]) says what the
server accepts;NEXT_PUBLIC_GEMSTACK_REALTIME(auto— the default: WebSocket, falling back to SSE when
one can't be opened —websocketorsse) what the browser uses. App code is the same either way.
useRealtimeStatus()addsoffline(the browser lost its network),realtime.transportsays which one
is in use, and presence survives a reconnect withinconfig.realtime.presence_grace(3 s). Apps on the
oldrealtime.tskeep working; copy the new client to get the rest (docs/realtime.md). GemStack::Auth.user_from(request): the signed-in user outside controllers (session cookie or API
token), e.g. for realtime'sidentify.- Background jobs work from
gemstack new: apps with a database get the jobs table,gemstack new
migrates, andgemstack devruns a worker from the first run. Jobs still run only viaperform_later. - New apps include
gem "brotli", so responses are Brotli-compressed for browsers that accept it
(gzip otherwise; compression was already on by default). - PostgreSQL is the recommended production database:
config/database.yml, the Kamal config and
gemstack doctor --productionsay how to use it (DATABASE_URL). SQLite stays the development default. - GemStack now describes itself as "a fast, modular Ruby web application framework with a Next.js frontend"
(README, gem READMEs and the gem summary on rubygems.org).
GemStack 0.3.6
gemstack updateupdates the app's templates too. After moving the gems, it brings the files
gemstack newwrote (config,bin/, frontend setup, …) up to the new version, comparing your copy with
the old and the new version's templates: files the release didn't change are left alone, new files are
created, files you never edited are updated, and for files you edited you choose — overwrite, skip, see
the diff, or save the new version asFILE.new(never overwritten without asking; scripts get a list).
gemstack update --templates [--from VERSION] [--dry-run]runs that step alone. Apps record the
templates they're on in.gemstack/version(new apps from this release; older apps are compared with
the version in theirGemfile.lock).gemstack destroyreverses every generator: besides resources, models and controllers it now removes
jobs, policies, migrations (same safety rules: only pending, uncommitted ones unless
--remove-migrations) and the Kamal deploy files (gemstack destroy deploy, which also removes the
kamalGemfile line it added). Jobs and policies still named elsewhere in the app are refused; shared
files such asapplication_job.rband the jobs table migration are kept. Code from these generators is
tracked from this release on.
GemStack 0.3.5
gemstack generate deploynow sets up Kamal instead of docker compose and
Caddy: one production image for every process,config/deploy.ymlwith web, api and jobs roles
(kamal-proxy serves one origin, routes/apito Ruby and handles HTTPS with Let's Encrypt; zero-downtime
deploys), database and Redis accessories,.kamal/secrets(references only) andbin/docker-entrypoint
(migrations before the API starts). It no longer writescompose.yaml,CaddyfileorProcfile;
existing files are left alone. See deployment.gemstack doctorfails when.kamal/secretscontains a secret's value instead of a reference.- New apps'
next.config.tsbuilds Next.js's standalone server for the production image. - Add
gemstack update [VERSION]: moves the app to the latest GemStack release on rubygems.org (or
VERSION) — sets every GemStack gem in the Gemfile to~> VERSIONand runsbundle updatefor them
together; the Gemfile is restored if that fails. Apps on a GemStack checkout are told to update it.
GemStack 0.3.4
- Models support
delete_allon classes and filtered queries; it skips callbacks and validations and returns the number of rows deleted. - Add
destroy/dfor tracked models, controllers and resources, with preview, modified-file protection
and contract refresh. Automatically remove only pending, uncommitted migrations; retain applied or
committed history, with--remove-migrationsfor explicit removal of pending migrations. Reuse create
migrations on regeneration and print migration commands for new or changed fields.
GemStack 0.3.3
- Add the
gskexecutable alias, including app-local binstubs and matching help output. - Add
reload!to the console to reload application code without restarting the console.
GemStack 0.3.2
gemstackshows the real error when one of its dependencies can't be loaded, instead of saying the
gemstack gem is missing.
GemStack 0.3.1
- New GemStack logo: a ruby gem on a stack. New apps show it on their welcome page (light and dark
mode); the logo files are indocs/assets/logo/. - Docs: associations and eager loading in models: the Sequel equivalents of Rails'
includes,eager_loadandjoins, and how to catch N+1 queries.