When changes are made to code in one of the FarmData2 modules it must be rebuilt in order to see the changes in the running farmOS instance. To rebuild the fd2_school module use the command:
npm run build:school
If you do not see the expected changes after rebuilding a module, reload the page containing the changed code in the browser while holding the "Shift" key. This will discard the cached version of the page and load the new page.
The other modules that can be rebuilt are fd2 and examples.
When you are working on a module you can use the build command above after each change, or you can run a watcher. A watcher monitors the files in the module for changes and automatically rebuilds the module when any file changes. To start a watcher on the school module use the command:
npm run watch:school
A short guide to some essential Keyboard Shortcuts that can be used in the FarmData2 Development Environment.
| Shortcut | Action |
|---|---|
Shift-Ctrl-C |
Copy |
Shift-Ctrl-V |
Paste |
Ctrl-C |
Terminate the running program in terminal |
| Shortcut | Action |
|---|---|
Ctrl-C |
Copy |
Ctrl-V |
Paste |
Ctrl-S |
Save |
Ctrl-Shift-I |
Auto format text/code in VSCodium |
Ctrl-Shift-I |
Open the Developer Tools in Firefox |
Alt-z or Cmd-z |
Toggle word wrap in VSCodium |
Ctrl-/ |
Toggle comment for current/selected lines in VSCodium |
| Command | Action |
|---|---|
ls |
List current directory contents |
cd <dir> |
Change into <dir> |
mkdir <dir> |
Create new directory <dir> in the current directory |
rm <file> |
Delete file <file> |
rmdir <dir> |
Delete directory <dir> - must be empty |
| Command | Action |
|---|---|
installDB.bash |
Install the correct version of the sample database. |
npm run build:school |
Rebuild the FD2 School module. |
npm run watch:school |
Run a watcher that rebuilds the FD2 school module any time there is a change to one of its files. |
npm run docs:gen |
Rebuild the FD2 documentation. |
npm run docs:view |
Start the documentation server and open the docs in Firefox. |
npm run printlog |
Display the JSON structures for farmOS taxonomy terms, logs and assets. |
reinstallFD2Module.bash |
Reinstall the FarmData2 module into farmOS. |
test.bash --e2e --school --live --gui |
Run the tests in the school module in the Cypress Test Runner. |

