aebabis / factorio-state-machine

MIT License
15 stars 8 forks source link

Way to run locally #33

Closed TokMor closed 2 years ago

TokMor commented 2 years ago

Hi,

Is there a way to run the code locally? I am setting up a rather complicated set of instructions, and my page runs out of memory when I try to generate the BP string. Text of my FSM can be found at https://pastebin.com/KQ6GrEMn

Any help is appreciated!

aebabis commented 2 years ago

Hi, @TokMor, it's been a while since I've worked on this. Since this is a node project, in theory you should be able to do npm install npm run dev

It's designed to run a development server and open the app in a browser tab. If it doesn't work, it's because the dependency versions are wrong. I'm happy to spend a little bit of time fixing that if you're still interested.

TokMor commented 2 years ago

Thanks, I'll give that a try. I'm working on a project to have this state machine control a recursive bluprinter to automatically expand a rail network. If you are interested in making additional changes to this I'd be happy to log some of the smaller things I'm seeing as issues if that would help.

Either way, I've made a good amount of headway on the project by breaking the big state machine into a bunch of smaller ones that communicate with each other. One big one though would certainly be preferable when it comes to management. Thanks for making this!

TokMor commented 2 years ago

image I get the following error when trying that I'm afraid

If you need the log let me know, I'd just prefer not to post it somewhere public since it has my name in it

aebabis commented 2 years ago

@TokMor I took the time to upgrade all the dependencies (went from Webpack 2 to Webpack 5). If you pull the latest code and run npm install again, it should be possible to run the development server (npm run dev). Please let me know if it works.

TokMor commented 2 years ago

It goes for a while, but I eventually get an error on the npm install step: image

aebabis commented 2 years ago

@TokMor I was just able to deploy the app to Heroku. IIRC, this deploy contains the fix that made the parser faster. Please try the live site and let me know.

If you're still interested in running locally, make sure you have a recent version of Node and NPM (within the last year should be fine), delete the repo, pull, and install again. My guess is that your local project is confused because of the old dependency management being broken.

TokMor commented 2 years ago

Thanks! the live version works way faster now and can handle far more complicated state machines which is great.

Still having issues getting the right version of npm and/or node to install, but with the better live version I should be just fine.

Thanks again for the help.

As I mentioned before there are a few small things that seem to be coming out wrong in the BPs, and while I've figured out workarounds for them I can let you know what they are if you're interested in doing more development on this project.

aebabis commented 2 years ago

@TokMor If you open a new issue with the code and expected behavior, I'd be happy to take a look. Cheers!