KFNEXUS / KFNEXUS.github.io

GNU Lesser General Public License v3.0
3 stars 6 forks source link

Split `data.json` source into separate modules #38

Closed FND closed 6 years ago

FND commented 6 years ago

As discussed in #37, src/data/data.json had grown to >24k lines, making it rather unwieldy. This PR splits that one big JSON file into a bunch of smaller JavaScript modules.

I'm not sure whether creating a separate directory for ships and ship classes is overkill - thoughts?

NB:

Important: As far as I can tell, the generated staw-utopia/data/data.json remains unchanged. However, I am not sure I fully understand the previous process (in particular, whether/how grunt-utopia-data was being used at all), so please double-check that the results are correct.

Note that the removal of grunt-utopia-data means getting started is as simple as running npm install; npm install -g grunt-cli; grunt from the project root - which means we can greatly simplify the instructions on the wiki.

FND commented 6 years ago

Upon reflection, I've concluded that the separate ships directory was, in fact, overkill - so I've changed this PR to just use ships.js and ship_classes.js alongside the other modules.

@CrazyVulcan @jsterner73: I realize the description above might be a bit much to digest at once (not intended as a seasonal pun), so let me know if anything needs clarification.

I'd like to get this merged ASAP, to avoid having to manually port further changes from the master branch. No pressure though (seriously; there are more important things in life).

CrazyVulcan commented 6 years ago

Ok everything seems fine for now but I just tried to do a test update and the console spit back this error.

Running "build-data" task ERROR: { Error: spawn npm ENOENT at exports._errnoException (util.js:1020:11) at Process.ChildProcess._handle.onexit (internal/child_process.js:197:32) at onErrorNT (internal/child_process.js:376:16) at _combinedTickCallback (internal/process/next_tick.js:80:11) at process._tickCallback (internal/process/next_tick.js:104:9) at Module.runMain (module.js:606:11) at run (bootstrap_node.js:389:7) at startup (bootstrap_node.js:149:9) at bootstrap_node.js:502:3 code: 'ENOENT', errno: 'ENOENT', syscall: 'spawn npm', path: 'npm', spawnargs: [ 'run', 'data' ] } Warning: Task "build-data" failed. Use --force to continue.

FND commented 6 years ago

My apologies, @CrazyVulcan, that's a Windows-specific issue. Should be fixed with #40.