Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webpack: ES6 import + const + let #95

Open
wants to merge 29 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
6261de5
Fix typo (change DECK_DEFINITONS to DECK_DEFINITIONS)
wmakley Oct 13, 2019
830a6cf
add .editorconfig
wmakley Oct 13, 2019
643fea4
apparently the line endings are crlf
wmakley Oct 13, 2019
59177cf
ignore .idea
wmakley Oct 13, 2019
b2b71aa
make crlf the default only for .js and .html
wmakley Oct 13, 2019
7c62505
fix implicit global variable
wmakley Oct 13, 2019
8ce3eb8
Merge branch 'fix-typo'
wmakley Oct 13, 2019
7c3cee2
fix implicit global variable
wmakley Oct 13, 2019
713d2e6
fix more implicit globals
wmakley Oct 13, 2019
aeca11f
Merge branch 'minor-bug-fixes'
wmakley Oct 13, 2019
d32ffe6
WIP initial webpack implementation
wmakley Oct 13, 2019
50dbbce
fix implicit global variables
wmakley Oct 13, 2019
ab6cb21
avoid variable re-declaration
wmakley Oct 13, 2019
33e2dd2
shift does not take any arguments
wmakley Oct 13, 2019
73b9aef
Merge branch 'minor-bug-fixes'
wmakley Oct 13, 2019
ad971bc
fix more implicit variable re-declaration
wmakley Oct 13, 2019
4b9f3b7
fix typo
wmakley Oct 13, 2019
c4c9114
replace all == with === to avoid accidental type coercion
wmakley Oct 14, 2019
fc5105d
zIndex property is a string, so let's be explicit about the type coer…
wmakley Oct 14, 2019
f10c3ac
Merge branch 'minor-bug-fixes'
wmakley Oct 14, 2019
e6ad42b
Merge branch 'opinionated-bug-fixes'
wmakley Oct 14, 2019
478c4b8
Merge branch 'master' into ES6
wmakley Oct 14, 2019
1a9b05b
completely rework app to use webpack, const/let, and ES6 modules and …
wmakley Oct 14, 2019
7f025f4
set license to MIT (for what it's worth)
wmakley Oct 16, 2019
70cd07e
allow serving index.html via webpack-dev-server
wmakley Oct 20, 2019
32779df
fix image references
wmakley Oct 25, 2019
4219e81
attempt to improve PWA features and add a service worker
wmakley Oct 25, 2019
fab727a
add all images to service worker precached assets
wmakley Oct 26, 2019
bf4f128
add http-server for testing PWA functionality
wmakley Oct 26, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
root = true

[*]
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = lf

[{*.js,*.html}]
end_of_line = crlf

[package.json]
indent_size = 2
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
_config.yml
app.manifest
web.config
web.config
.idea
node_modules
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
# Gloomy Companion

## About the fork

I want to add the following features:

1. Sort monster decks by initiative.
2. Sort player icons in between the monster decks.

In the process I ended up implementing webpack and ES6 and fixing small bugs.

## Original intro

This is a web-app for managing the monster ability decks in the board game [Gloomhaven](https://boardgamegeek.com/boardgame/174430/gloomhaven)

You can run it from the web directly on <https://johreh.github.io/gloomycompanion/>.

You can also download it and run it locally without internet connection. Click __Clone or download__ above, then __Download ZIP__. Unpack the ZIP and start the app by opening `index.html`.

If you want to add new cards, you need to update [`cards.js`](cards.js). The decks has the following syntax:
If you want to add new cards, you need to update [`cards.js`](src/cards.js). The decks have the following syntax:

```json
```javascript
{ name: "Name of monster"
, cards:
[ [false, "42", "* First line", "** sub-line 1", "** sub-line 2", "* Second line"]
Expand All @@ -19,7 +30,7 @@ If you want to add new cards, you need to update [`cards.js`](cards.js). The dec

The value in the first column is `true` if the deck shall be reshuffled after that card, `false` otherwise. The second colum is card initiative value. The following values is the card text, one row per column.

A single `*` means a top-level action. Double asterisk `**` means it modifies the previous action. Commonly used text snippets can be expanded using macros. E.g. `%move%` expands to the text _Move_ followed by the move icon, `%immobilize%` expands to _IMMOBILIZE_ followed by the immobilization icon. The list of available macros can be seen in [`macros.js`](macros.js).
A single `*` means a top-level action. Double asterisk `**` means it modifies the previous action. Commonly used text snippets can be expanded using macros. E.g. `%move%` expands to the text _Move_ followed by the move icon, `%immobilize%` expands to _IMMOBILIZE_ followed by the immobilization icon. The list of available macros can be seen in [`macros.js`](src/macros.js).

## Development

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
11 changes: 2 additions & 9 deletions index.html → dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,9 @@
<meta name="apple-mobile-web-app-title" content="Gloomy Companion" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<script type="text/javascript" src="util.js"></script>
<script type="text/javascript" src="cards.js"></script>
<script type="text/javascript" src="scenarios.js"></script>
<script type="text/javascript" src="macros.js"></script>
<script type="text/javascript" src="modifiers.js"></script>
<script type="text/javascript" src="monster_stats.js"></script>
<script type="text/javascript" src="logic.js"></script>
<script type="text/javascript" src="ui.js"></script>
<script type="text/javascript" src="main.js"></script>
</head>
<body onload="init(); init_ui();">
<body>
<div class="panecontainer">
<div id="settingspane" class="pane expanded">
<ul class="tabcontainer">
Expand Down
1 change: 1 addition & 0 deletions dist/main.js

Large diffs are not rendered by default.

File renamed without changes.
4 changes: 3 additions & 1 deletion gen-manifest.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
#!/bin/sh
#
# TODO: not updated for webpack

cat << EOF > app.manifest
CACHE MANIFEST
Expand All @@ -12,5 +14,5 @@ git ls-tree --full-tree -r --name-only HEAD | grep -v \
-e app.manifest \
-e gen-manifest.sh \
-e README.md \
| sort >> app.manifest
| sort >> dist/app.manifest

Loading