Closed Marwes closed 8 months ago
Hello!
I've just added more detailed instructions on setting up this project to Contributing.md
. Check that file out for more info.
Closing this PR in as Contributing.md
has been added.
Thanks! Could you also explain how to package the mod so I can drop it into my mod folder to test things?
I tried running npm run test
but I get an error
npm run test -- --factorio-path="$HOME/GOG\ Games/Factorio/game/bin/x64/"
> bp100@0.1.0 pretest
> npm run clean && npm run build:test
> bp100@0.1.0 clean
> del-cli "src/**/*.lua" "src/**/*.map" "!**/*.def.lua"
> bp100@0.1.0 build:test
> npm run build:scripts && tstl
> bp100@0.1.0 build:scripts
> conc "npm:build:locale" "npm:build:gui-specs"
[build:locale] npm run build:locale exited with code 0
[build:gui-specs] npm run build:gui-specs exited with code 0
> bp100@0.1.0 test
> factorio-test run ./src --factorio-path=/home/markuswesterlind/GOG\ Games/Factorio/game/bin/x64/
Downloading factorio-test from mod portal...
Error: Not Found
at dR (/home/markuswesterlind/GOG Games/Factorio/game/mods/bp100/node_modules/factoriomod-debug/dist/fmtk.js:29:94748)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Es.findInstallSource (/home/markuswesterlind/GOG Games/Factorio/game/mods/bp100/node_modules/factoriomod-debug/dist/fmtk.js:29:96317)
at async Es.installMod (/home/markuswesterlind/GOG Games/Factorio/game/mods/bp100/node_modules/factoriomod-debug/dist/fmtk.js:29:96643)
at async Vg.<anonymous> (/home/markuswesterlind/GOG Games/Factorio/game/mods/bp100/node_modules/factoriomod-debug/dist/fmtk.js:457:4913)
at async Vg.parseAsync (/home/markuswesterlind/GOG Games/Factorio/game/mods/bp100/node_modules/factoriomod-debug/dist/fmtk.js:387:4063)
file:///home/markuswesterlind/GOG%20Games/Factorio/game/mods/bp100/node_modules/factorio-test-cli/run.js:234
reject(new Error(`Command exited with code ${code}`));
^
Error: Command exited with code 1
at ChildProcess.<anonymous> (file:///home/markuswesterlind/GOG%20Games/Factorio/game/mods/bp100/node_modules/factorio-test-cli/run.js:234:24)
at ChildProcess.emit (node:events:513:28)
at ChildProcess._handle.onexit (node:internal/child_process:293:12)
Node.js v19.9.0
Were you on on the "develop" branch? (The error looks like its failing to download the test mod; in the develop branch I've included it in git to avoid that issue)
Otherwise:
With vscode, you can run the "package mod" task to create a zip.
You can also symlink the src
folder to your mods folder as bp100
, and npm run watch
, to avoid having to re-copy.
npm run test
was supposed to do that (setup a data directory, with a mods folder with that symlink) so that the launch configurations in .vscode/launch.json
runs an isolated instance.
This let me compile and typecheck the project atleast, however it is not clear to me how to package it to a mod that can be run via factorio (help appreciated).