Skip to content

Greet new terminals in the dev container, and restart the backend - #32

Open
Decipher wants to merge 1 commit into
feature/2-export-foundationfrom
feature/devcontainer-welcome
Open

Greet new terminals in the dev container, and restart the backend#32
Decipher wants to merge 1 commit into
feature/2-export-foundationfrom
feature/devcontainer-welcome

Conversation

@Decipher

@Decipher Decipher commented Sep 4, 2026

Copy link
Copy Markdown
Member

Stacked on #31.

Summary

Open a terminal in the dev container and nothing greets you. This ports the
mechanism from the druxt.js contributor dev container (gitlab.local MR !47) so
it does.

Why nothing printed

The splash and the next-steps block do exist: scripts/postinstall.mjs prints
both. They just never reach a person.

postinstall runs from npm install, which this container runs inside
postCreateCommand, so its output goes to the container creation log. A
postAttachCommand would be no better: its output goes to whatever launched the
container, and DevPod prints that to its own CLI log, outside the container
entirely.

The shell's own rc file is the only place that reliably reaches someone who has
just opened a terminal.

Changes

  • .devcontainer/WELCOME.txt, the greeting: what is running, what ports are
    forwarded, and the handful of commands worth knowing.
  • post-create.sh appends a hook to both ~/.bashrc and ~/.zshrc. Both,
    because the base image ships bash and zsh and which one a terminal opens
    depends on the client. On every interactive shell rather than once, because a
    one-shot marker gets spent by whichever shell the editor opens first, which is
    rarely the one the user is looking at. It also prints the guide at the end of
    post-create, for anyone watching the creation log.
  • .devcontainer/post-start.sh and a postStartCommand. The container had
    no start hook at all, so stopping and resuming it left the frontend pointing
    at a backend that was no longer listening. That looks like a broken install
    rather than a stopped process. It skips with a pointer when the site was never
    provisioned, so one broken create does not also fail every start.
  • Codespaces opens the guide as a file on first attach.

SPLASH in scripts/lib.mjs stays as it is: setup.mjs and postinstall.mjs
both use it, and they are still the right place for it when someone runs setup
by hand.

Test plan

  • devpod up github.com/druxt/quickstart-druxt-serverless@feature/devcontainer-welcome --id qds-pr32 --ide openvscode
  • Opening a terminal prints the guide
  • Opening a second terminal prints it again
  • Stopping and resuming the container leaves the backend serving on 8888

@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: 37f02c9f-2f15-49b8-a3bc-e3e5ca5637f7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

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