Skip to content

Latest commit

 

History

History
74 lines (54 loc) · 3.57 KB

File metadata and controls

74 lines (54 loc) · 3.57 KB

FarmData2 Key Commands and Shortcuts

Commands

Building a FarmData2 Module

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.

Watching a FarmData2 Module

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

Keyboard Shortcuts

A short guide to some essential Keyboard Shortcuts that can be used in the FarmData2 Development Environment.

Linux Terminal

Shortcut Action
Shift-Ctrl-C Copy
Shift-Ctrl-V Paste
Ctrl-C Terminate the running program in terminal

Browser / VSCodium / Etc.

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

Linux Terminal Commands

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

FarmData2 Development Environment Commands

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.

Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License All textual materials used in this repository are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License

GPL V3 or Later All executable code in this repository is licensed under the GNU General Public License Version 3 or later