{"id":22447623,"url":"https://github.com/mattms/fsharp-game-jam-2021","last_synced_at":"2025-03-27T11:27:22.447Z","repository":{"id":145868085,"uuid":"394106884","full_name":"MattMS/fsharp-game-jam-2021","owner":"MattMS","description":null,"archived":false,"fork":false,"pushed_at":"2021-08-09T03:54:03.000Z","size":22,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-01T16:11:20.525Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"F#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MattMS.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-08-09T01:13:00.000Z","updated_at":"2021-09-28T23:43:41.000Z","dependencies_parsed_at":null,"dependency_job_id":"735f1376-2586-4e70-ba56-7add7c863efd","html_url":"https://github.com/MattMS/fsharp-game-jam-2021","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattMS%2Ffsharp-game-jam-2021","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattMS%2Ffsharp-game-jam-2021/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattMS%2Ffsharp-game-jam-2021/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MattMS%2Ffsharp-game-jam-2021/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MattMS","download_url":"https://codeload.github.com/MattMS/fsharp-game-jam-2021/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245835088,"owners_count":20680143,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-06T04:17:56.219Z","updated_at":"2025-03-27T11:27:22.441Z","avatar_url":"https://github.com/MattMS.png","language":"F#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# JAM (Just Another Milking) game in F#\n\nThis was developed for the [F# Game Jam 2021](https://itch.io/jam/fsharp-jam).\n\nWhile I was not successful in developing a working game within the time limit,\nI decided to post this work anyway as I think it shows off some of the nice F# tooling that is available.\n\n## Inspiration\n\nWhile reading a [thread on the theme](https://itch.io/jam/fsharp-jam/topic/1543840/theme-alternate-history),\nI was inspired by the [final suggestion from Vorotato](https://itch.io/post/4116094):\n\n\u003e Western cowboys but they ranch cats for their fur.\n\nI was reminded that removing fur is not the same as shearing, so I decided to go with milking instead.\n\n## Features\n\n### Mostly working\n\n- Intriguing introduction story\n- Browser code from F# using Fable and Rollup\n- Unit tests with Fuchu\n- Light and dark themes based on system preference.\n\n### Slightly working\n\n- Feed your cat\n- Sleep\n\n### Totally missing\n\n- Any story beyond the introduction\n- Milk your cat\n- Buy and sell cats/milk/food\n- Get more cats\n\n## How to build\n\nIn the `MattMS.CatGame.Browser` folder, run `dotnet fable` to build the EcmaScript with Fable.\n\nIn the project root, run `npm run build` to compile the Pug and Stylus code, and bundle the EcmaScript for the browser.\n\nThe \"editor choices\" section at the end of this document suggests a development approach,\nwith file watchers for source code changes.\n\n## How to test\n\nIn `MattMS.CatGame.Tests`, run `dotnet run` to test the code.\n\nThere is very limited test coverage, as tests were only added when I was having trouble with the code.\n\n## Why this tech?\n\nI have used most of these libraries/tools before (except Rollup and Sutil), but I do not get to use them in my day job.\n\nIt is a small project, without multiple developer preferences, so I can fall back to the standard HTML page approach.\n\nI very much like the graceful degredation approach that websites are meant to follow.\nUnfortunately, I did make the choice of requiring CSS, otherwise I would have needed many more pages for each screen of the story.\nI hope that wrapping each story \"page\" in an `article` tag can bring me some forgiveness.\n\n## .NET library/tool choices\n\nMy currently installed version of .NET SDK is 5.0.301.\n\n### Fable\n\n[Fable](https://fable.io/) is used to convert F# code into EcmaScript code that can be bundled for the browser.\nMy decision to use it was based on familiarity of using it before.\n\n### Fuchu\n\nI chose to use Fuchu for testing due to how quick it is to get started.\nThe tests can be written in a .NET Console application, so there is no need to worry about test runners.\n\n- [Fuchu @ GitHub](https://github.com/mausch/Fuchu)\n\n### Sutil\n\nI have used (and really enjoyed using) [Elmish](https://elmish.github.io/elmish/) before,\nbut I am not a fan of React so I decided to try something different this time.\nI am quite curious about [Svelte](https://svelte.dev/) and was very happy to learn about [Sutil](https://sutil.dev/).\n\n## Node tool choices\n\nAll of these were used on Node 14.17.3 with npm 6.14.13, running on Windows 10 Home.\n\n### Concurrently\n\nAlthough not strictly necessary, I decided to use Concurrently to simplify my npm scripts.\n\n- [concurrently @ npm](https://www.npmjs.com/package/concurrently)\n\nI did have `npm-run-all`, for the sequential execution, but that does not matter now that there are no dependencies from the Pug templates.\n\n```\n\"build\": \"run-s build-styles build-scripts build-pages\",\n```\n\n- [npm-run-all @ GitHub](https://github.com/mysticatea/npm-run-all)\n- [npm-run-all @ npm](https://www.npmjs.com/package/npm-run-all)\n\n### Pug\n\n[Pug](https://pugjs.org/) templates are used to generate the HTML.\n\n- [Pug @ GitHub](https://github.com/pugjs/pug)\n- [Pug CLI @ GitHub](https://github.com/pugjs/pug-cli)\n- [Includes @ Pug docs](https://pugjs.org/language/includes.html)\n- [Inheritance @ Pug docs](https://pugjs.org/language/inheritance.html)\n\n### Rollup\n\n[Rollup](https://rollupjs.org/) turned out to be a pretty cool project for bundling up the EcmaScript generated by Fable.\n\nI have used Browserify, Parcel, and WebPack on other projects, so I decided to give Rollup a go this time.\nI was pleasantly surprised at being able to configure it entirely in my npm scripts.\n\n- [Rollup @ GitHub](https://github.com/rollup/rollup)\n- [rollup @ npm](https://www.npmjs.com/package/rollup)\n\n### Stylus\n\n[Stylus](https://stylus-lang.com/) is used to generate the CSS.\n\n- [CLI @ Stylus docs](https://stylus-lang.com/docs/executable.html)\n\n### Uglify\n\nUglify is used to minify the code that is generated by Rollup.\n\nNot sure how I feel about the 3 different name styles: \"UglifyJS\" (GitHub), \"uglify-js\" (npm), and \"uglifyjs\" (command).\n\n- [UglifyJS @ GitHub](https://github.com/mishoo/UglifyJS)\n- [uglify-js @ npm](https://www.npmjs.com/package/uglify-js)\n\n## Editor choices\n\nThis was mostly written in VS Code, using the Ionide extension.\nI made heavy use of the `npm scripts` in the Explorer, and the Terminal for using Fable.\n\nEssentially this involved 2 terminal sessions:\n\n- `dotnet fable watch`\n- `npm run watch`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattms%2Ffsharp-game-jam-2021","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmattms%2Ffsharp-game-jam-2021","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmattms%2Ffsharp-game-jam-2021/lists"}