fix(deploy): copy changelog/ into the production image#51
Merged
Conversation
webjs.dev/changelog renders "No entries yet." in production because the page reads `<repo>/changelog/<pkg>/*.md` at SSR time and the production Dockerfile copies only packages, examples, website, and docs into the image. Add COPY changelog ./changelog so the deployed website resolves the same tree it does locally. No code change in the page itself: readdir() still silently returns [] when the directory is missing, which keeps the local dev story intact for contributors who clone without the changelog/ folder.
2 tasks
vivek7405
added a commit
that referenced
this pull request
May 21, 2026
) Trigger commit: PR #51 (Dockerfile fix that copies the changelog/ tree into the production image) merged to main but the website service did not auto-deploy from it, because the only changed file sits at the repo root and the website's Railway service has watch paths restricted to website/**. The fix never reached webjs.dev. Add a Layout-section note recording the coupling between website/app/changelog/page.ts and the repo-root changelog/ tree plus the Dockerfile COPY that ships it. The note is genuinely useful agent context; the side effect is that it forces a fresh auto-deploy from main HEAD, which pulls in the Dockerfile change and finally renders the entries on https://webjs.dev/changelog.
3 tasks
vivek7405
added a commit
that referenced
this pull request
May 21, 2026
…ocs (#53) * chore(deploy): config-as-code railway.json with cross-service watchPatterns Add a repo-root railway.json that captures the build (DOCKERFILE builder, Dockerfile path) and a deploy restart policy. The watchPatterns field is explicitly set to ["**/*"] so every commit to main triggers a redeploy of every service. Background: the 4 Railway services (@webjskit/website, /docs, /ui-website, @webjskit-examples/blog) all build from the same repo and the same Dockerfile, but each had its own dashboard-set watch-path filter scoped to its own subdir. A root-level change (e.g. Dockerfile, package.json, changelog/) did not trigger the services whose subdir was untouched, which is how PR #51 (a Dockerfile-only fix) reached only ui-website and left webjs.dev/changelog broken until #52. Note: Railway dashboard-set values take precedence over config-as-code. After this merges, clear "Watch Paths" in the dashboard for each of the 4 services (Service → Settings → Source → Watch Paths → clear the list, save), so railway.json takes over. Once that is done, future cross-service infra changes (Dockerfile, compose.yaml, root package.json, etc.) trigger redeploys for all four services automatically. * chore(deploy): drop the global watchPatterns from railway.json Per-service watch paths cannot be expressed in a single repo-root railway.json (the file applies to every service that points at it and there is no per-service override in the JSON shape). Drop the **/* pattern from the file and move the per-service tables into the PR description for paste-into-dashboard use. The remaining build + deploy fields stay because they really are shared by all four services.
vivek7405
added a commit
that referenced
this pull request
May 21, 2026
webjs.dev/changelog renders "No entries yet." in production because the page reads `<repo>/changelog/<pkg>/*.md` at SSR time and the production Dockerfile copies only packages, examples, website, and docs into the image. Add COPY changelog ./changelog so the deployed website resolves the same tree it does locally. No code change in the page itself: readdir() still silently returns [] when the directory is missing, which keeps the local dev story intact for contributors who clone without the changelog/ folder.
vivek7405
added a commit
that referenced
this pull request
May 21, 2026
) Trigger commit: PR #51 (Dockerfile fix that copies the changelog/ tree into the production image) merged to main but the website service did not auto-deploy from it, because the only changed file sits at the repo root and the website's Railway service has watch paths restricted to website/**. The fix never reached webjs.dev. Add a Layout-section note recording the coupling between website/app/changelog/page.ts and the repo-root changelog/ tree plus the Dockerfile COPY that ships it. The note is genuinely useful agent context; the side effect is that it forces a fresh auto-deploy from main HEAD, which pulls in the Dockerfile change and finally renders the entries on https://webjs.dev/changelog.
vivek7405
added a commit
that referenced
this pull request
May 21, 2026
…ocs (#53) * chore(deploy): config-as-code railway.json with cross-service watchPatterns Add a repo-root railway.json that captures the build (DOCKERFILE builder, Dockerfile path) and a deploy restart policy. The watchPatterns field is explicitly set to ["**/*"] so every commit to main triggers a redeploy of every service. Background: the 4 Railway services (@webjskit/website, /docs, /ui-website, @webjskit-examples/blog) all build from the same repo and the same Dockerfile, but each had its own dashboard-set watch-path filter scoped to its own subdir. A root-level change (e.g. Dockerfile, package.json, changelog/) did not trigger the services whose subdir was untouched, which is how PR #51 (a Dockerfile-only fix) reached only ui-website and left webjs.dev/changelog broken until #52. Note: Railway dashboard-set values take precedence over config-as-code. After this merges, clear "Watch Paths" in the dashboard for each of the 4 services (Service → Settings → Source → Watch Paths → clear the list, save), so railway.json takes over. Once that is done, future cross-service infra changes (Dockerfile, compose.yaml, root package.json, etc.) trigger redeploys for all four services automatically. * chore(deploy): drop the global watchPatterns from railway.json Per-service watch paths cannot be expressed in a single repo-root railway.json (the file applies to every service that points at it and there is no per-service override in the JSON shape). Drop the **/* pattern from the file and move the per-service tables into the PR description for paste-into-dashboard use. The remaining build + deploy fields stay because they really are shared by all four services.
4 tasks
vivek7405
added a commit
that referenced
this pull request
May 22, 2026
The /blog route on webjs.dev rendered "No posts yet." because the production Docker image was not shipping the blog/ tree. website/app/blog/page.ts and website/app/blog/[slug]/page.ts both read blog/<slug>.md at SSR time (via modules/blog/queries/list-posts.server.ts and get-post.server.ts). The queries resolve REPO_ROOT/blog/, which exists in dev but not in the deployed image. The Dockerfile already had a precedent for this pattern: a `COPY changelog ./changelog` line (added in PR #51) for the identical situation with the changelog tree. Added a matching `COPY blog ./blog` line right after, with a comment that points at the modules/blog/ query so the next person who wonders why the file is being copied finds the answer. After this lands, the Railway watchPattern `/blog/**` (already in the service config) will trigger a redeploy on any blog/*.md change, and the rebuilt image will include the new content.
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.
Summary
https://webjs.dev/changelogrendered "No entries yet." because the productionDockerfileonly copiespackages,examples,website, anddocsinto the image.website/app/changelog/page.tsreads<repo>/changelog/<pkg>/*.mdat SSR time, so on the deployed image the directory simply didn't exist andreaddir()returned an empty list.Add
COPY changelog ./changelogto the Dockerfile so the deployed website resolves the same tree it does locally.Why this happened only in production
Locally, the website runs from inside the repo so
resolve(__dirname, '..', '..', '..', 'changelog')finds the real directory. In the image,__dirnameis/app/website/app/changelogand we never copied/app/changelog, so the path didn't resolve.Test plan