feat: replace Makefile with Node.js script for Docker Compose#382
Merged
feat: replace Makefile with Node.js script for Docker Compose#382
Conversation
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
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
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
check,check_key,check_secret,build, andruntargetsscripts/docker-run.jsthat handles environment variable setup and spawns the Docker Compose processdocker:buildanddocker:runcommands topackage.jsonthat replace the previousmake buildandmake runcommandssrc/config.tsto use arequireEnv()helper function that throws an error ifSTEAM_API_KEYorSECRETare missing, replacing the previous optional approachsteam_api_keyandsecrettypes insrc/types/config.tsfromstring | falsetostringto reflect the now-required nature of these variablesas stringtype assertions insrc/server.tssince these values are now guaranteed to be stringsImplementation Details
The new
scripts/docker-run.jsscript:PORT,POSTGRES_USER, andPOSTGRES_PASSWORDspawnSyncwithstdio: 'inherit'to maintain interactive outputThis change improves the developer experience by using standard npm scripts instead of requiring Make to be installed.
https://claude.ai/code/session_01KMtyEw5EWgmYfYJgzL9rf9