Skip to content

feat: replace Makefile with Node.js script for Docker Compose#382

Merged
dambrisco merged 3 commits intotrunkfrom
claude/npm-scripts-replace-makefile-4rImI
Feb 16, 2026
Merged

feat: replace Makefile with Node.js script for Docker Compose#382
dambrisco merged 3 commits intotrunkfrom
claude/npm-scripts-replace-makefile-4rImI

Conversation

@dambrisco
Copy link
Contributor

Summary

Replaced the Makefile-based Docker Compose workflow with a Node.js script (scripts/docker-run.js) and updated npm scripts. This simplifies the build and run process by removing the dependency on Make while maintaining the same functionality.

Key Changes

  • Removed Makefile: Deleted the Makefile that contained check, check_key, check_secret, build, and run targets
  • Added Node.js Docker runner: Created scripts/docker-run.js that handles environment variable setup and spawns the Docker Compose process
  • Updated npm scripts: Added docker:build and docker:run commands to package.json that replace the previous make build and make run commands
  • Enforced required environment variables: Modified src/config.ts to use a requireEnv() helper function that throws an error if STEAM_API_KEY or SECRET are missing, replacing the previous optional approach
  • Updated type definitions: Changed steam_api_key and secret types in src/types/config.ts from string | false to string to reflect the now-required nature of these variables
  • Removed type assertions: Cleaned up unnecessary as string type assertions in src/server.ts since these values are now guaranteed to be strings
  • Updated documentation: Modified README.md to reference the new npm commands instead of Make targets

Implementation Details

The new scripts/docker-run.js script:

  • Handles GitHub Codespaces host detection (same logic as the original Makefile)
  • Sets default values for PORT, POSTGRES_USER, and POSTGRES_PASSWORD
  • Passes all environment variables to the Docker Compose process
  • Properly exits with the Docker Compose process status code
  • Uses spawnSync with stdio: 'inherit' to maintain interactive output

This change improves the developer experience by using standard npm scripts instead of requiring Make to be installed.

https://claude.ai/code/session_01KMtyEw5EWgmYfYJgzL9rf9

Removes the Makefile and adds docker:build and docker:run npm scripts.
Codespaces host detection and docker compose invocation are handled by
a small Node.js helper with no new dependencies.

Moves STEAM_API_KEY and SECRET validation into src/config.ts via a
requireEnv helper, so any server invocation fails fast with a clear
error message. Narrows the steam_api_key and secret config types from
string | false to string and removes the corresponding as string casts
in server.ts.

https://claude.ai/code/session_01KMtyEw5EWgmYfYJgzL9rf9
The config factory calls requireEnv('STEAM_API_KEY') at load time, so
migrate-cli and seed-cli throw before connecting to the database when
the variable is absent. Set a fake value in CI where Steam auth is not
exercised.

https://claude.ai/code/session_01KMtyEw5EWgmYfYJgzL9rf9
@dambrisco dambrisco changed the title Replace Makefile with Node.js script for Docker Compose feat: replace Makefile with Node.js script for Docker Compose Feb 16, 2026
@dambrisco dambrisco merged commit 0495049 into trunk Feb 16, 2026
5 checks passed
@dambrisco dambrisco deleted the claude/npm-scripts-replace-makefile-4rImI branch February 16, 2026 00:24
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.

2 participants

Comments