Commit Graph
8 Commits
Author SHA1 Message Date
Willie 578be7ebd9 chore(devcontainer): move docs server from port 3000 to 8888
Port 3000 collides with other local services, blocking the devcontainer from
starting. Move the Docusaurus docs server to 8888 across the docs script,
dev-servers orchestration, compose port mapping, and forwarded ports/labels.
2026-05-30 19:23:12 +08:00
Willie 7a6e78783b fix(build): separate host and devcontainer binary output paths
Devcontainer `make build` previously wrote a Linux binary to
`bin/skillshare` via the shared volume mount, overwriting the host's
macOS binary and causing `exec format error`.

Introduce a `BINARY` variable (Makefile) / `SKILLSHARE_BINARY` env var
(mise) so devcontainer builds to `/usr/local/bin/skillshare` while the
host keeps `bin/skillshare`. Also update `scripts/test.sh` to respect
a pre-set `SKILLSHARE_TEST_BINARY` instead of unconditionally
overwriting it.
2026-03-12 16:45:02 +08:00
Willie 474bf3e4c1 feat(devcontainer): standalone lifecycle without VS Code dependency
`make devc` now builds, initialises, and enters the devcontainer in one
step — no VS Code required. A unified `scripts/devc.sh` replaces the old
`devcontainer_shell.sh` with full lifecycle subcommands (up/shell/down/
restart/reset/status).

Key changes:
- Dockerfile Stage 2 copies node+pnpm from ui-builder (removes need for
  devcontainer feature, benefits sandbox playground too)
- profile.d scripts moved from setup.sh → start-dev.sh so they survive
  container recreation (down → up) without re-running full setup
- Volume-based sentinel (~/.devcontainer-initialized) lets devc.sh skip
  setup.sh when volumes persist, cutting restart to ~2s
- Go toolchain PATH added to profile.d (login shell was losing it)
- Makefile/mise.toml gain devc-up/-down/-restart/-reset/-status targets
- Website docs updated with terminal-first flow and CLI path in diagrams
2026-03-03 16:08:11 +08:00
Willie 13d9b82be7 fix: devcontainer token loading from .env and host env fallback
- Remove token vars from remoteEnv (localEnv overrides .env with empty)
- Pass host tokens via docker-compose environment as fallback
- Add profile.d script to source .devcontainer/.env in login shells
- Add sandbox token passthrough for GitLab/Bitbucket/generic tokens
- Add root .env to .gitignore
2026-02-22 15:13:10 +08:00
Willie 084d93bf94 feat(devcontainer): add credential-helper toggle and token forwarding
Add tooling for testing private repo auth inside the devcontainer:

- credential-helper script (on/off/status) with --eval mode to
  toggle both git credential helper and token env vars in one command
- remoteEnv forwards host token env vars (GITHUB_TOKEN, GITLAB_TOKEN,
  BITBUCKET_TOKEN, BITBUCKET_USERNAME, SKILLSHARE_GIT_TOKEN)
- docker-compose env_file for .devcontainer/.env (optional, gitignored)
- start-dev.sh auto-detects GITHUB_TOKEN from gh CLI on container start
- .env.example template for all supported tokens
- docker-sandbox.md documents token sources and private repo testing
2026-02-21 06:07:35 +08:00
Willie 595fe84c6b refactor(devcontainer): simplify dev server management
Replace dev-servers with self-contained `ui` and `docs` commands:
- `ui` / `ui -p`: build binary, start API (global/project) + Vite
- `ui stop`: stop API + Vite
- `docs` / `docs stop`: start/stop Docusaurus
- Remove `ui-p` script (merged into `ui -p`)
- Fix PID reuse false-positive in is_running() via /proc/cmdline
- Fix process tree cleanup in do_stop() (kill children before parent)
- Fix pkill pattern to match `skillshare-dev` binary name
- Update devcontainer.json port labels and ordering
- Update docker-sandbox.md to reflect new commands
2026-02-20 22:13:33 +08:00
Willie 1b5056d0ea refactor(docker): unify versions, consolidate init scripts, add sandbox-logs
- Add `make sandbox-logs` / `mise run sandbox:logs` convenience target
- Unify Docker build versions via ARG: Node 24, pnpm 10.28.0, Go 1.25.5
- Extract shared demo content to scripts/create-demo-content.sh, slim down
  setup.sh and sandbox_playground_up.sh from ~150 duplicated lines each
- Move devcontainer scripts (ui, ui-p, docs) to .devcontainer/bin/
  (source-controlled, survives make clean) with auto mode-switching
2026-02-20 12:22:02 +08:00
Willie 626f0f2240 feat(devcontainer): add Node.js 24, auto-start dev servers, and dev-servers manager
Enable full frontend development inside the devcontainer without
falling back to the host. Three dev servers (Go API :19420, Vite :5173,
Docusaurus :3000) start automatically via postStartCommand and can be
managed with the `dev-servers` CLI (start/stop/restart/status/logs).

Key changes:
- Add Node.js 24 + pnpm devcontainer feature
- Auto-install ui/ and website/ dependencies in setup.sh
- Add dev-servers.sh process manager with PID tracking
- Replace shell aliases with PATH scripts (ss, skillshare-ui, etc.)
- Set Vite server.host: true for container accessibility
- Make ui-dev Go server host configurable via SKILLSHARE_UI_HOST env var
- Forward ports 5173 and 3000 alongside 19420
- Harden setup.sh with environment guard and safe_cleanup helpers
- Update docker-sandbox.md with frontend development section
2026-02-20 04:12:34 +08:00