IronswornCompanion icon indicating copy to clipboard operation
IronswornCompanion copied to clipboard

Build instructions?

Open mtwomey opened this issue 2 years ago • 7 comments

I'm wondering if you might consider providing some high-level build instructions. I'd like to serve this (to myself) locally for use when I'm offline. I'm running into NPM module conflicts with node18 when building on Mac.

mtwomey avatar May 07 '22 21:05 mtwomey

I got this worked out and tweaked for offline use. See https://github.com/mtwomey/IronswornCompanion/blob/offline/docs/build.md

This is a really awesome app. Not only the Ironsworn Companion, but it's such an excellent example of a well written React SPA. I learned a ton digging through it.

Happy to do a PR if you wan't to include anything I've done, just lmk.

mtwomey avatar May 08 '22 23:05 mtwomey

Hi @mtwomey thanks for your feedback. Unfortunately, sadly it is no longer an example of a well written React SPA, as React has moved away from class based coding in favor of functional programming. Personally, I welcome the change, but I have no desire to change this to functional as it would be a hellish project. I am glad you learned from this. This was my first react app so the code is a bit scrappy in places, but it just spawned out of nothing, I only set out to make a simple character sheet with a dice roller... And it just snowballed. I am extremely busy at the moment as I had to job while I finish my Ph.D. So I am now working full time (job) + part time (phd) and its kind of crazy. This all took over to the point where I basically had to down tool on this project and still have yet to play Ironsworn (its become a bit of a meme now).

Thus, if you wish to create PRs I would be more than grateful! I am very passionate about this project, despite not having the time to either develop or play.

If you wish to make your first PR the docs you have created I would be happy to include them. They would make a great addition to the app

gcoulby avatar May 09 '22 13:05 gcoulby

Sounds like you have your hand full! Ha ha ha on the never actually playing. I am regularly guilty of spending endless amounts of time "getting ready" to do a thing. Reading, researching, buying, discussing, coding tools, making play aids, ...etc. And then I never actually do the thing. So I completely understand where you're coming from. In fact, I also have yet to play Ironsworn. I spent half a day getting your companion app ready to use offline - on off change that I ever am offline lol. That's because I have this fantasy vision of going out camping or something off the grid in solitude and then I'd also be able to do a few things at night like play Ironsworn and use this companion app offline. It will likely never happen. But I have fun in the "prep", so I don't beat myself up about it anymore.

Ok - so I did a PR for a smaller version of the doc with just the instructions to build on Mac (because the full doc I started references changes I made to packages.json which will probably conflict with your Win build env). If you want to create an branch called offline, I can do a PR of my full offline branch into it (if you want). That will give you a build that has things like imgur all yanked into the repo so it's all webpacked together and can run offline. Up to you on that. I plan to continue tweaking things from an offline perspecitve.

I'm also thinking about getting the dataforged (starforge) data in there as well, but probably next.

mtwomey avatar May 10 '22 01:05 mtwomey

I have created a branch called offline. I was just looking at the OSX, build. It might be worth exploring a docker build, then the environment would be the same on all platforms.

I toyed with the idea of Starforged Companion and made a start on the aesthetics, but at the time the game was still way to alpha to even attempt it. Dataforged is still changing regularly and the amount of work involved in creating something like this is too much if there are big changes in the pipeline.

When you mention Imgur? what specifically are you referring too. I am aware the icons are online, but most of the graphics are included in the repo. Either way happy for you to attempt an offline version and I know many in the community that would appreciate it for things like train journeys and campfire adventures.

gcoulby avatar May 10 '22 07:05 gcoulby

That's a great idea on the docker build. I've thought about doing that for work actually - but now we're running nearly entirely AWS lambdas for everything. However we do have a couple of SPAs we serve from S3 that might benefit from a docker build env, so this is a double bonus to explore this concept. Ok, I'll check into this.

My reference to imgur is mainly the documentation markdown file (the one that's both the repo README.md and also gets rendered into the app). As I am new to the companion app, I've been looking at that page in the app a lot. There were about 30 or so imgur images (screen grabs mostly) in there. I pulled them off imgur and put them in an img directory in the public folder and updated the build script in packages.json to do the replacements when copying README.md into the src folder.

mtwomey avatar May 11 '22 04:05 mtwomey

@gcoulby If you're interested - here is my take on a docker-build approach: https://github.com/mtwomey/IronswornCompanion/blob/docker-build/docs/build.md

This is what I'm using now. I'd be interested in your thoughts and / or if you'd like to adopt it or something similar.

Everything "node" is done inside the docker - but using the same source directly so that you can edit / use your IDE as you were before (it just mounts its own directory into the docker). I created shell scrips in a scripts directory to make invocation easier - all you would need is equivalent batch files.

One of my goals in this was to allow full building, running, testing inside the docker in such a way that you wouldn't even need NodeJS installed at all.

mtwomey avatar May 15 '22 02:05 mtwomey

Dataforged is still changing regularly and the amount of work involved in creating something like this is too much if there are big changes in the pipeline.

it's relatively stable now that 1.0.x is out on npm. aside from proper package versioning, it also has TS typings and a documentation site, so dealing with (or simply avoiding) breaking changes should be much easier.

FWIW, a mostly-dataforged-compatible datasworn is a WIP, in case that has any bearing on migration. an (unstable) preview of that data is currently included in dataforged but not documented in the readme (it's exported as the ironsworn object).

rsek avatar May 16 '22 20:05 rsek