Skip to content

Commit

Permalink
Sum sum HTMX!
Browse files Browse the repository at this point in the history
  • Loading branch information
Phoscur committed Mar 10, 2024
1 parent 6a62164 commit a8bc018
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
8 changes: 5 additions & 3 deletions engine/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/app/app.element.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class AppElement extends HTMLElement {
</div>
<!-- HERO -->
<div id="hero" class="rounded">
<div id="hero" class="rounded" hx-get="/sum" hx-swap="outerHTML">
<div class="text-container">
<h2>
<svg
Expand Down
4 changes: 4 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
import './app/app.element';
import htmx from 'htmx.org';
htmx.on('htmx:load', (e: Event) => {
console.log('htmx:load', e);
});
1 change: 1 addition & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
Expand Down

0 comments on commit a8bc018

Please sign in to comment.