Since everything is dockerised. All commands should be run through docker-compose. Remember to run these within the projects working directory.
To run a command;
docker-compose run --service-ports sg {command-goes-here}
docker-compose run sg npm install --save {package-name} - Install a new packagedocker-compose run sg npm install --save @types/{package-name} - Save new typescript typesdocker-compose run --service-ports sg npm start - Complete a build from start to finish & make available at http://127.0.0.1:8080/When you wish to run StaticGenie NPM commands. Use the following command:
docker-compose run --service-ports sg npm run {commands-below}.
Common / Dev
start - runs all the build scripts in order and finishes by hosting them via a build in web server (start here)server - Creates a server that serves your ./www directory (generated by StaticGenie) - For dev/test purposes onlytest - @TODO - Compile and tests the javascript (although this isn’t working yet)Runners
build:fresh - Removes files generated from the previous run. Ensures everything is clean and no previous artifacts left behindbuild:typescript - Converts the typescript to javascriptbuild:pages - Builds your web pagesbuild:assets - Copies over any supporting assets .css, .js, .jpg etc from /theme/assets to the /www/assets directorybuild:clean - Cleans up any temporary artifacts such as compiled typescript ready for the next buildbuild:optimise - @TODO - Will perform optimisations like CSS/JS minification, etcIn the event the docs aren’t up to date and/or a command isn’t doing what you want it to. You can check the commands by opening /package.json to see/modify the StaticGenie commands.
Trying to access the built in server via http://127.0.0.1:8080/ times out.
You have likely missed the --service-ports part of the docker-compose run command. Without it the adhock command to the docker container won’t open/map ports. The full command should look like: docker-compose run --service-ports sg npm run {npm-command-here}