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
8 changes: 8 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@
/.rspec
/CLAUDE.md
/codedb.snapshot
/coverage/
/pkg/
/tmp/
/.bundle
/.worktrees/
.rspec_status

# Docs development files
/docs/.bundle
Expand All @@ -28,6 +34,8 @@
/docs/tmp/*
/docs/storage/*
/docs/spec/
/docs/.rspec
/docs/coverage/
/docs/.dockerignore
/docs/.kamal/
/docs/config/master.key
Expand Down
58 changes: 36 additions & 22 deletions docs/.dockerignore
Original file line number Diff line number Diff line change
@@ -1,43 +1,57 @@
# See https://docs.docker.com/engine/reference/builder/#dockerignore-file for more about ignoring files.
# docs-kit .dockerignore — keep the build context (and image layers) small.
# Gem-owned: `bin/rails g docs_kit:install` refreshes this on every run.
# See https://docs.docker.com/build/building/context/#dockerignore-files

# Ignore git directory.
# Git metadata — the app build never needs it (a released gem carries its files).
/.git/
/.gitignore
/.gitattributes

# Ignore bundler config.
# Bundler config (BUNDLE_* env in the Dockerfile drives the install instead).
/.bundle

# Ignore all environment files (except templates).
# Environment files and credentials — never bake secrets into an image.
/.env*
!/.env*.erb

# Ignore all default key files.
/config/master.key
/config/credentials/*.key

# Ignore all logfiles and tempfiles.
# Logs and tempfiles (keep the dirs, drop the contents).
/log/*
/tmp/*
!/log/.keep
/tmp/*
!/tmp/.keep

# Ignore pidfiles, but keep the directory.
/tmp/pids/*
!/tmp/pids/.keep

# Ignore storage (uploaded files in development and any SQLite databases).
/storage/*
!/storage/.keep
/tmp/storage/*
!/tmp/storage/.keep

# Ignore assets.
# JS deps + generated assets: `bun install` + `assets:precompile` rebuild them.
/node_modules/
/app/assets/builds/*
!/app/assets/builds/.keep
# Generated by bin/build-css — Tailwind resolves the gem @source globs at build.
/app/assets/stylesheets/tailwind.sources.css
/public/assets

# Vite Ruby
/public/vite*
# Vite uses dotenv and suggests to ignore local-only env files. See
# https://vitejs.dev/guide/env-and-mode.html#env-files
*.local
# Tests + coverage — not needed to run the site in production.
/spec/
/.rspec
/coverage/
/spec/examples.txt

# CI / deploy / Docker meta — not part of the runtime image.
/.github/
/.kamal/
/Dockerfile*
/.dockerignore

# Editor + AI-assistant configs.
/.claude/
/.cursor/
/.vscode/
/.idea/
/.ruby-lsp/
/.solargraph.yml

# Docs-kit's own tooling snapshots (harmless if absent in a consuming site).
/codedb.snapshot
/.worktrees/
3 changes: 0 additions & 3 deletions docs/.rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@ plugins:
- rubocop-rake
- rubocop-rspec
require:
- "./lib/rubocop/cop/docs_kit/render_component_preferred.rb"
- docs_kit/rubocop
DocsKit/RenderComponentPreferred:
Enabled: true
Include:
- app/**/*.rb
Exclude:
- lib/rubocop/cop/**/*.rb
AllCops:
TargetRubyVersion: 3.4
NewCops: enable
Expand Down
9 changes: 7 additions & 2 deletions docs/AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,16 @@ end
`Section("Title", description:)`, `Code(source, filename:)`,
`Header("Title", eyebrow:)`.
- **Wrappers that take no positional arg use lowercase page helpers** so a block
needs no parens: `md <<~'MD' … MD`, `prose { … }`, `example { |ex| … }`. (A bare
`DocsUI::Prose do` is a Ruby SyntaxError; the helpers sidestep it.)
needs no parens: `md <<~'MD' … MD`, `prose { … }`, `example { |ex| … }`,
`operation "operationId"`. (A bare `DocsUI::Prose do` is a Ruby SyntaxError; the
helpers sidestep it.)
- **Reference material has dedicated helpers** — reach for these before prose:
`DocsUI::PropTable`, `DocsUI::FieldTable`, `DocsUI::RequestExample`,
`DocsUI::Callout(:note | :tip | :warning)`.
- **OpenAPI-backed endpoints** (when `c.openapi` is set): `operation "createInvoice"`
renders a whole endpoint from the spec — badge, field/error tables, request tabs,
response — no hand-restatement. Append prose with a block; filter tabs with
`clients:`.

### Invariants — do not break

Expand Down
18 changes: 15 additions & 3 deletions docs/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,12 @@ COPY --link docs/ .
# Precompile bootsnap code for faster boot times
RUN bundle exec bootsnap precompile app/ lib/

# Precompiling assets for production without requiring secret RAILS_MASTER_KEY
RUN SECRET_KEY_BASE_DUMMY=1 bundle exec rails assets:precompile
# Precompiling assets for production without requiring secret RAILS_MASTER_KEY.
# Drop node_modules + the bun toolchain afterwards — only the built CSS is kept,
# so the final stage's COPY of /gem never carries the JS deps. tmp/cache stays:
# it holds the bootsnap cache precompiled above.
RUN SECRET_KEY_BASE_DUMMY=1 bundle exec rails assets:precompile && \
rm -rf node_modules /usr/local/bun


# Final stage for app image
Expand Down Expand Up @@ -89,4 +93,12 @@ ENTRYPOINT ["/gem/docs/bin/docker-entrypoint"]

EXPOSE 3000
VOLUME /data
CMD ["./bin/rails", "server"]
# Thruster fronts Puma (HTTP caching + compression + X-Sendfile). It listens on
# HTTP_PORT and proxies to Puma on TARGET_PORT (it sets PORT for the child, which
# config/puma.rb reads). HTTP_PORT MUST be the port traffic is routed to (Kamal's
# `app_port: 3000` in config/deploy.yml, the EXPOSE above) — Thruster's default
# is 80, which the non-root user can't reliably bind AND which kamal-proxy would
# never route to, silently bypassing Thruster straight into Puma.
ENV HTTP_PORT="3000" \
TARGET_PORT="3001"
CMD ["./bin/thrust", "./bin/rails", "server"]
12 changes: 8 additions & 4 deletions docs/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,20 @@ gem "turbo-rails"
gem "daisyui", path: ".."
# Shared docs-site chrome (Shell/Sidebar/Code/Page/...) — the single place the
# layout/design lives, shared with the phlex-reactive docs site. Configured
# per-site via DocsKit.configure (config/initializers/docs_kit.rb). Referenced
# from GitHub (not a local path) so the Docker build — whose context is THIS repo
# — can resolve it; the gem lives in a sibling repo, outside the build context.
gem "docs-kit", github: "mhenrixon/docs-kit", require: "docs_kit"
# per-site via DocsKit.configure (config/initializers/docs_kit.rb). Now pulled
# from RubyGems as a released gem — the old GitHub ref existed only because the
# sibling repo sat outside the Docker build context, which no longer applies.
gem "docs-kit", "~> 1.0.3", require: "docs_kit"
gem "method_source"
gem "phlex-rails"
gem "phlex-reactive"
gem "rails_icons", "~> 1.1"
gem "rouge"

# HTTP/2 proxy in front of Puma in the container (compression, static-asset
# caching, X-Sendfile). Invoked via bin/thrust in the Dockerfile CMD.
gem "thruster", require: false

# Database & Performance
gem "friendly_id"
gem "litestack", ">= 0.4.5", github: "oldmoe/litestack"
Expand Down
32 changes: 15 additions & 17 deletions docs/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
GIT
remote: https://github.com/mhenrixon/docs-kit.git
revision: 82d76a761cf21f1380f71eccdbbae49fe8c1ad6f
specs:
docs-kit (0.1.0)
commonmarker (~> 2.0)
daisyui (>= 1.2)
nokogiri (>= 1.15)
phlex-rails (>= 2.0, < 3)
rails_icons (~> 1.1)
rouge (>= 4.0)
zeitwerk (~> 2.6)

GIT
remote: https://github.com/oldmoe/litestack.git
revision: e598e1b1f0d46f45df1e2c6213ff9b136b63d9bf
Expand Down Expand Up @@ -149,6 +136,14 @@ GEM
diff-lcs (1.6.2)
dockerfile-rails (1.7.10)
rails (>= 3.0.0)
docs-kit (1.0.3)
commonmarker (~> 2.0)
daisyui (>= 1.2, < 2)
nokogiri (>= 1.15, < 2)
phlex-rails (>= 2.0, < 3)
rails_icons (~> 1.1)
rouge (>= 4.0, < 5)
zeitwerk (~> 2.6)
dotenv (3.2.0)
drb (2.2.3)
ed25519 (1.4.0)
Expand Down Expand Up @@ -360,8 +355,7 @@ GEM
regexp_parser (2.11.3)
reline (0.6.3)
io-console (~> 0.5)
rouge (5.0.0)
strscan (~> 3.1)
rouge (4.7.0)
rspec-core (3.13.6)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.5)
Expand Down Expand Up @@ -427,8 +421,11 @@ GEM
ostruct
stimulus-rails (1.3.4)
railties (>= 6.0.0)
strscan (3.1.8)
thor (1.5.0)
thruster (0.1.22-aarch64-linux)
thruster (0.1.22-arm64-darwin)
thruster (0.1.22-x86_64-darwin)
thruster (0.1.22-x86_64-linux)
tilt (2.6.1)
timeout (0.6.1)
tsort (0.2.0)
Expand Down Expand Up @@ -472,7 +469,7 @@ DEPENDENCIES
daisyui!
debug
dockerfile-rails
docs-kit!
docs-kit (~> 1.0.3)
dotenv
factory_bot_rails
faker
Expand Down Expand Up @@ -502,6 +499,7 @@ DEPENDENCIES
ruby-vips
sqlite3
stimulus-rails
thruster
turbo-rails
tzinfo-data
web-console
Expand Down
5 changes: 5 additions & 0 deletions docs/bin/thrust
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env ruby
require "rubygems"
require "bundler/setup"

load Gem.bin_path("thruster", "thrust")
Loading
Loading