Skip to content

fix(deploy): copy changelog/ into the production image#51

Merged
vivek7405 merged 1 commit into
mainfrom
fix/changelog-deploy
May 21, 2026
Merged

fix(deploy): copy changelog/ into the production image#51
vivek7405 merged 1 commit into
mainfrom
fix/changelog-deploy

Conversation

@vivek7405
Copy link
Copy Markdown
Collaborator

Summary

https://webjs.dev/changelog rendered "No entries yet." because the production Dockerfile only copies packages, examples, website, and docs into the image. website/app/changelog/page.ts reads <repo>/changelog/<pkg>/*.md at SSR time, so on the deployed image the directory simply didn't exist and readdir() returned an empty list.

Add COPY changelog ./changelog to 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, __dirname is /app/website/app/changelog and we never copied /app/changelog, so the path didn't resolve.

Test plan

  • Local SSR still renders the entries (unchanged code path).
  • After this PR merges and Railway rebuilds the image, https://webjs.dev/changelog should show the per-package per-version entries.

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 vivek7405 merged commit 5ca82d5 into main May 21, 2026
@vivek7405 vivek7405 deleted the fix/changelog-deploy branch May 21, 2026 13:44
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.
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.
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant