From a8bc0188fbed8ab9ef3df44897b27961bdfd0f3c Mon Sep 17 00:00:00 2001 From: Phoscur Date: Sun, 10 Mar 2024 21:33:09 +0100 Subject: [PATCH] Sum sum HTMX! --- engine/README.md | 8 +++++--- src/app/app.element.ts | 2 +- src/main.ts | 4 ++++ vite.config.ts | 1 + 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/engine/README.md b/engine/README.md index c0c84d0..cfde873 100644 --- a/engine/README.md +++ b/engine/README.md @@ -1,10 +1,12 @@ ## Running unit tests -Run `nx test engine (--code-coverage|--watch)` to execute the unit tests via [Jest](https://jestjs.io). +Run `npm test` or `npm run test-engine` in the parent to develop - `nx test engine (--code-coverage|--watch)` executes the unit tests via `vitest`. # Engine centered around resources -Models resource flows between buildings in a factory, should be then usable on client- and serverside +2021: Models resource flows between buildings in a factory, should be usable on client- and serverside. + +Self-review 2024: I'm not sure why I'm so hesitant on merging Resource & Energy, it looks like a nice abstract class (I prefer avoiding inheritance though). It might have grown over a bit with type generics and should be simplified instead (less object-oriented...). I wish these weird `| 0 toInteger` arithmatics would not be needed (js has only floats :| webassembly?). ## Overview @@ -20,7 +22,7 @@ Already working: - Economy with Building as Prosumers -# Roadmap +# Roadmap pre-2024 - solve resource & energy calculations for each game tick ✔ - build a little idlegame: upgrade buildings (mines & stock) and tech diff --git a/src/app/app.element.ts b/src/app/app.element.ts index 28517df..64ed2ba 100644 --- a/src/app/app.element.ts +++ b/src/app/app.element.ts @@ -17,7 +17,7 @@ export class AppElement extends HTMLElement { -
+

{ + console.log('htmx:load', e); +}); diff --git a/vite.config.ts b/vite.config.ts index 1149bdc..34a370a 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -13,6 +13,7 @@ export default defineConfig({ }, preview: { + // this is still pretty useless, as it's missing a (mockup or hono) server port: 4300, host: 'localhost', },