Compilation Guide
Compilation Steps
Section titled “Compilation Steps”Setup development tools
Section titled “Setup development tools”1 - Install current nodejs LTS (currently using v16.14.2)
node -vv20.8.0
npm -v10.2.02 - Download all necessary packages in ESP3D-WEBUI directory (repository root)
npm installStart dev server
Section titled “Start dev server”in ESP3D-WEBUI directory (repository root)
npm run dev-<system>-<firmware>- where
<system>iscnc(CNC system, laser, spindle..) ,printer(3D printer),sand(Sand Table) - where
<firmware>is :grbl,grblhalforcncmarlin,marlin-embedded(esp3dlib),repetier,smoothiewareforprintergrblforsand
will open http://localhost:8088 which display the webUI using a local test server
Build index.html.gz to /dist folder
Section titled “Build index.html.gz to /dist folder”in ESP3D-WEBUI directory (repository root)
npm run buildallWill generate production version for each target and firmware in dist directory
to build specific index.html.gz
npm run <system>-<firmware>- where
<system>iscnc(CNC system, laser, spindle..) ,printer(3D printer),sand(Sand Table) - where
<firmware>is :grbl,grblhalforcncmarlin,marlin-embedded(esp3dlib),repetier,smoothiewareforprintergrblforsand
Code Formating
Section titled “Code Formating”How to do code formating?
Section titled “How to do code formating?”.js/.css/.scss/.json files of embedded directory
Section titled “.js/.css/.scss/.json files of embedded directory”The code must be formatted using the prettier tool. The configuration style is .prettierrc present in the root directory. The configuration file is as follows:
{ "printWidth": 80, "tabWidth": 4, "useTabs": false, "semi": false, "singleQuote": false, "trailingComma": "es5", "bracketSpacing": true, "bracketSameLine": false, "arrowParens": "always", "requirePragma": false, "insertPragma": false, "proseWrap": "preserve", "overrides": [ { "files": "*.js", "options": { "parser": "babel" } }, {"files": "*.css", "options": { "parser": "css" } }, {"files": "*.scss", "options": { "parser": "scss" } }, {"files": "*.json", "options": { "printWidth": 120, } } ]}The tool can be added as extension in vscode, and installed using :
npx install -G prettierPrettier will format one active file at once per request or during saving process according your vscode settings.
A python script is also available in the repository, in directory tools: format_sources.py, this script can be used to format all files of the directories config and src, and all subdirectories at once.
When to do code formating?
Section titled “When to do code formating?”Before any pull request or before submit any code, the code must be formatted. The CI will check the code formatting, and will eventually fail if the code is not formatted correctly.