Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
224 commits
Select commit Hold shift + click to select a range
4c44832
Seperate Laser and Mill start codes
easytarget Feb 15, 2021
8a78f06
Pre-populate fill line distance with beam diameter
easytarget Feb 15, 2021
72bd3de
Allow more threads, improve info wording about this
easytarget Feb 15, 2021
458a055
Improved help info, allow empty Mill Start/End codes
easytarget Feb 16, 2021
41c25aa
Fix macro box resizing and make text monosapced
easytarget Feb 16, 2021
84fa7e2
Improve descriptions for options
easytarget Feb 16, 2021
8d24aca
Remove debug comment
easytarget Feb 16, 2021
00e5b16
Default toggle for burn white. Layout and help fixes for options sidebar
easytarget Feb 17, 2021
2e7d2a6
Out of bounds warning, fix for case of no gcode
easytarget Feb 17, 2021
dea66f1
Client side firmware detection options
easytarget Feb 18, 2021
d05113e
Out of bounds warning and checking, full fix and better feedback
easytarget Feb 18, 2021
d61a070
Fix opening Gcode in popup/new tab
easytarget Feb 19, 2021
c4147be
Fix opening Gcode in popup/new tab
easytarget Feb 19, 2021
09142d0
Better way to open Gcode in tab, using object level URI.
easytarget Feb 19, 2021
cbcb06b
New fields, statistics and ui confirmations
easytarget Feb 20, 2021
7e9258c
Filename DateTime substitutions, more help text changes
easytarget Feb 21, 2021
193543b
RapidZ setting for machine
easytarget Feb 22, 2021
ae6fd4f
Title for the Gcode viewer window.
easytarget Feb 22, 2021
16a7970
Make segment size default settable, cleanup the whitespace in setting…
easytarget Feb 24, 2021
f77a940
Fix huge popups with Gcode appearing when connecting to servers.
easytarget Feb 25, 2021
d8d7383
Open help links in new tabs.
easytarget Feb 25, 2021
89faf89
Improve connecting to active machine
easytarget Feb 25, 2021
0949c84
Better feedback to user when connecting to a running server
easytarget Feb 26, 2021
86bec40
Re-Arrange the connect menu items
easytarget Feb 26, 2021
d962f2a
Correct menu to show reset toggle for non usb connections
easytarget Feb 27, 2021
697308a
Do not quote QueryString when sent, improve feedback in console
easytarget Feb 27, 2021
cabafc8
typo
easytarget Feb 27, 2021
801218b
Improve machine connection panel, show status, expand panels only whe…
easytarget Feb 27, 2021
d4fb77c
Remove debug output
easytarget Feb 27, 2021
d6e785d
Align status indicators on tabs
easytarget Feb 27, 2021
8de4b21
Additional help for settings, re-arrange application settings more lo…
easytarget Feb 27, 2021
e15ba09
section name change
easytarget Feb 27, 2021
9420ead
Simplify description of how .json file templates work
easytarget Feb 27, 2021
d34588c
confirm disconnecting machine when busy
easytarget Feb 27, 2021
d614ff3
Disconnect/reconnect functionality
easytarget Feb 28, 2021
da2dca0
Add extension support o workspace saving
easytarget Mar 1, 2021
53fa8bf
Workspace filename setting
easytarget Mar 1, 2021
d0c9e50
Simulator GUI improvements
easytarget Mar 1, 2021
a816d10
Setting tweaks fr simulator and filam validation
easytarget Mar 1, 2021
f95e6ae
Better feedback from simulator, job time estimates!
easytarget Mar 2, 2021
1aad6df
Better logging
easytarget Mar 2, 2021
36d6907
Post Testing updates:
easytarget Mar 3, 2021
99fc11d
Machine setting for A Axis diameter. Yet more help and settings layou…
easytarget Mar 8, 2021
14bd68a
Discard simulator A axis diameter in favor of machine setting
easytarget Mar 8, 2021
b5d5595
Generate correct first move using A axis instead of Y for rotary rast…
easytarget Mar 8, 2021
939d8e8
Google groups no longer exists, new home on maker forums
easytarget Mar 9, 2021
131d471
Do not preface blower gcode with whitespace
easytarget Mar 9, 2021
4be2ee6
Fluid Gcode for Mill cuts (all types)
easytarget Mar 9, 2021
07d3429
Fluid control on lathe operations
easytarget Mar 10, 2021
b6d3af6
Reduce size of add file box for operations, note if op does not use f…
easytarget Mar 10, 2021
b6cdba4
Webcam stream stops properly when dismissed and does not reappear
easytarget Mar 10, 2021
fdb6f1b
Treat startheight as a number; avoids issues when value is 0.
easytarget Mar 10, 2021
84d141c
About screen, f/w info panels fixed
easytarget Mar 13, 2021
4ba6243
Remove unreferenced settings, make 'machine can mill' a thing.
easytarget Mar 13, 2021
bfc9dc9
Better logging of operations queue
easytarget Mar 13, 2021
0fea5d7
Show a laserweb logo when nothing else is defined for the machine
easytarget Mar 13, 2021
17c9c1e
Unused settings
easytarget Mar 16, 2021
30551e8
Improve logging when we connect
easytarget Mar 25, 2021
2594f87
Remove Webpack Dev Server, not used, not recommended for production, …
easytarget Mar 25, 2021
3431335
Unused functions, comms actually handled by src/components/com.js
easytarget Mar 25, 2021
52cd2ce
DXF import re-write
easytarget May 20, 2021
7d2f904
Bounds detection was broken..
easytarget May 20, 2021
311964d
Improve feedback when empty Gcode is generated
easytarget May 20, 2021
04743bd
Process DXF colors correctly
easytarget May 21, 2021
901af18
Vertical and reverse diagonal rastering
easytarget Jun 11, 2021
18d74af
Webcam limit connections, fix size/resize
easytarget Jan 2, 2022
9671115
help text
easytarget Jan 3, 2022
a3e6ef6
Simulator bar fix and zoom to gcode
easytarget Jan 3, 2022
6f006ea
New lw.comm-server version
easytarget Jan 4, 2022
4fbbbdd
add a new default connection type with no parameters
easytarget Jan 8, 2022
3abe8cc
Fix gcode zoom button
easytarget Jan 8, 2022
51cd649
Margin on doc and gcode zoom
easytarget Jan 8, 2022
eca3222
Extend allowed zoom range
easytarget Jan 8, 2022
02f73a6
Remove machine query and fw detection panel
easytarget Jan 8, 2022
eb10d39
Document size/position control: wider input boxes
easytarget Jan 8, 2022
5bcc0bd
UI work
easytarget Jan 9, 2022
76e6813
Gcode info panel
easytarget Jan 9, 2022
2fd1693
reset on connect box relocate
easytarget Jan 9, 2022
67c0f29
Swap to local machines db
easytarget Jan 9, 2022
aca7fbb
clearing and improve style
easytarget Jan 9, 2022
4291b28
Cleanup
easytarget Jan 9, 2022
b04f1a5
Analyser UI complete
easytarget Jan 9, 2022
905289d
fix
easytarget Jan 9, 2022
c8b72de
current package lock
easytarget Jan 9, 2022
50464a9
Use logos and machine descriptions in settings, not about
easytarget Jan 11, 2022
16010bd
errors in a machine profile
easytarget Jan 12, 2022
148f2c7
UI Fixes
easytarget Jan 12, 2022
138e66a
style for simulator bar
easytarget Jan 12, 2022
30e1cf2
fix message when simulation fails
easytarget Jan 12, 2022
907ca57
Add cleaned up generic machine templates
easytarget Jan 12, 2022
963eefe
Help text
easytarget Jan 12, 2022
b90d240
Settings defaults, text and default filename
easytarget Jan 12, 2022
1257841
Support better loading of gcode from other generators
easytarget Jan 14, 2022
fefd68f
Slight darkening of general background
easytarget Jan 14, 2022
bb22d5e
Progress details, better hnadling of reconnections
easytarget Jan 14, 2022
40c78be
highlight the machine details button/box
easytarget Jan 14, 2022
31ff7f2
bed and background color setting
easytarget Jan 15, 2022
31f91ba
default burnWhite to off
easytarget Jan 15, 2022
22ec1a7
Hide webcam toggle if not configured
easytarget Jan 15, 2022
7578672
simple dependency upgrade
easytarget Jan 15, 2022
a845257
Working towards hiding console etc
easytarget Jan 15, 2022
dd86c98
ShowHide lower panel
easytarget Jan 17, 2022
03cb8f2
remove debug logging
easytarget Jan 17, 2022
fd7af0a
ui tweak
easytarget Jan 19, 2022
534dd30
Protect agains grid size 0
easytarget Jan 19, 2022
4822c19
Prevent drag-n-drop into main window, be helpful
easytarget Jan 19, 2022
ba1ec69
typo
easytarget Jan 19, 2022
a71e5ff
default rotary diameter
easytarget Jan 21, 2022
39be8e6
Improve drag box
easytarget Jan 21, 2022
40e93bb
rename marlin generator to marlin-legacy, laser-feature support in co…
easytarget Jan 22, 2022
54ec041
unused deps
easytarget Jan 23, 2022
b0f2ba8
Fix color selector
easytarget Jan 23, 2022
c8d36b7
Silently ignore metadata in SVGs
easytarget Jan 23, 2022
7c9df2a
SVG import improvements
easytarget Jan 24, 2022
97a97a0
Fix fill from file, be helpful
easytarget Jan 24, 2022
83d3f98
better handling of some common svg tags that are skipped
easytarget Jan 24, 2022
58c2ce7
Fix glitched padding when setting value out of bounds
easytarget Jan 24, 2022
3c202fc
Add fill opacity setting
easytarget Jan 24, 2022
e8d70e8
Select document paths by color
easytarget Jan 25, 2022
6901ae1
shift modifier to select by fill
easytarget Jan 25, 2022
6ed6e37
Style fixups
easytarget Jan 25, 2022
681e39d
Change how we tag no-stroke paths
easytarget Jan 26, 2022
b814dd4
Simple dependency updates
easytarget Jan 26, 2022
08bb02f
fix load/save error with hex colors
easytarget Jan 26, 2022
e261eb6
dependencies, ajv to 6.x, schema change to material database
easytarget Jan 26, 2022
4e684bb
move to my fork temporarily
easytarget Jan 26, 2022
175dca6
minor dependencies
easytarget Jan 27, 2022
326ca29
uuid and fix more ajv stuff
easytarget Jan 27, 2022
c655ae7
vex to 4.x
easytarget Jan 27, 2022
67daf97
hide gcode buttons and slider when no code loaded
easytarget Jan 27, 2022
1cb7756
default material dbs to schema draft-7
easytarget Jan 27, 2022
433971e
More minor dependency uupdates
easytarget Jan 27, 2022
568bd2f
WebPack3 config
easytarget Jan 28, 2022
1e03b70
Webpack 4
easytarget Jan 28, 2022
2e6fe95
More dependencies
easytarget Jan 28, 2022
2793997
Fix png images after url-loader update
easytarget Jan 28, 2022
545d799
dependencies, again
easytarget Jan 29, 2022
11d0c43
WebPack 5
easytarget Jan 29, 2022
54fd090
small bugfix for running jobs reconnect
easytarget Jan 29, 2022
ea44287
React 16
easytarget Jan 30, 2022
6b7f19e
use <h5> to replace non-existant <heading> tag
easytarget Jan 31, 2022
3b99dfd
Fix Json material database spec/validator issues
easytarget Feb 1, 2022
8cd6d9b
Remove react-hot-loader (dev tool)
easytarget Feb 1, 2022
1f9c27a
better feedback for corrupt material db
easytarget Feb 1, 2022
f10cf31
loader-worker to 3.x
easytarget Feb 2, 2022
f8114e9
css-loader to 6.x
easytarget Feb 2, 2022
66f10ea
mark some react funtions UNSAFE
easytarget Feb 2, 2022
88c010f
get rid of warning in console and some syntax
easytarget Feb 3, 2022
f581e39
schema fixes
easytarget Feb 3, 2022
57285f1
first pass at about page link correction
easytarget Feb 3, 2022
5258d64
revert to react-select 1.x, make select boxes work properly again
easytarget Feb 9, 2022
7d0cac6
Modals can close again, vex was broken for material DB
easytarget Feb 9, 2022
977fff7
Remove react-codemod from packages, huge dependency hog'
easytarget Feb 9, 2022
18f99cc
Show machine moved, Grid axis color picker
easytarget Feb 12, 2022
9cba2d6
simulator bar, bigger thumb
easytarget Feb 12, 2022
8861110
Production builds, part1
easytarget Feb 12, 2022
712a285
revert generating zips
easytarget Feb 12, 2022
53097a9
Polish some stuff
easytarget Feb 13, 2022
5381899
auto-analyse, reset simbar
easytarget Feb 13, 2022
ea5dded
npm run webpack --watch
easytarget Feb 13, 2022
9cc5af5
Add a user defined Gcode comment header, with substitiutions
easytarget Feb 13, 2022
b44b092
webpack5 dev/prod config, devserver reinstated, remove last of jsdoc …
easytarget Feb 15, 2022
bee43ac
edits to about tab
easytarget Feb 15, 2022
cb7a4d9
about to rebase
easytarget Feb 15, 2022
19c6c74
merge mill-settings
easytarget Feb 15, 2022
2c5ef9e
back to main lw data repos
easytarget Feb 15, 2022
f7afbe4
Start a developer HowTo
easytarget Feb 15, 2022
7b0527b
about me
easytarget Feb 17, 2022
ef579a5
webpack --watch for dev build
easytarget Feb 17, 2022
a45562e
more frontend dev documentation
easytarget Feb 17, 2022
8ab9c80
More items
easytarget Feb 17, 2022
7ae7052
Added Laser Intensity and Laser Cuoff power to settings and raster ge…
Rabter1 Mar 27, 2022
80a9500
Added Laser Intensity support for vector gcode generator
Rabter1 Mar 27, 2022
28d3964
stop preventDefault warning on mouse wheel movement
easytarget Mar 31, 2022
68e700b
Build targets and re-add comm-server as module
easytarget Mar 31, 2022
54f8f9f
logfile is not needed
easytarget Mar 31, 2022
9879242
Dockerfile now builds, run fails
easytarget Mar 31, 2022
d26a900
Merge pull request #1 from Rabter1/feature/noLaserIntensity
easytarget Mar 31, 2022
42e7789
Docker updated
easytarget Apr 5, 2022
959a1ae
Dev notes
easytarget Apr 5, 2022
b473d76
Remove start-server target and use node directly
easytarget Apr 5, 2022
d5c32d4
not needed
easytarget Apr 5, 2022
79e0e42
Better structure, clean release build
easytarget Apr 6, 2022
c6a1cb0
Doc stuff
easytarget Apr 7, 2022
bd07388
rename laserIntensity to laserIntensityCtl
easytarget Apr 8, 2022
c1d6587
Remove intensity setting from operations, rename setting and change h…
easytarget Apr 8, 2022
d341006
Merge pull request #5 from easytarget-org/noLaserIntensity
easytarget Apr 8, 2022
bc507dc
Merge pull request #4 from easytarget-org/docker-dev-stuff
easytarget Apr 8, 2022
5be056e
fix moving operations
easytarget Nov 6, 2024
f69a17b
Migrate from npm to pnpm
joepie91 May 16, 2026
5afc583
Initial native module build setup
joepie91 May 16, 2026
0afc4d1
Merge branch 'easytarget' into dev-es6
joepie91 May 16, 2026
aa1edc8
Move build deps to devDependencies
joepie91 May 16, 2026
159a46a
Update webpack-cli and webpack-dev-server
joepie91 May 16, 2026
335ca5a
Update various Webpack and Babel plugins/tools
joepie91 May 16, 2026
2a823d7
Update to React 18
joepie91 May 16, 2026
9913115
HMR prep work
joepie91 May 16, 2026
929033b
Refactor: jog axes
joepie91 May 16, 2026
8dff7e8
Refactor: CAM file loading
joepie91 May 17, 2026
ab554a0
Set up ESLint for some basic error detection
joepie91 May 17, 2026
4600ac3
Temporarily suppress noisy errors from old react-bootstrap version
joepie91 May 17, 2026
59334cb
Fix scope bug in jogging probe
joepie91 May 17, 2026
5631df9
Update react-bootstrap to latest pre-breaking release
joepie91 May 17, 2026
7dce660
Update react-redux partway, to eliminate its childContextTypes errors…
joepie91 May 17, 2026
e8b2d4b
Remove dead binds in CAM
joepie91 May 17, 2026
4861c8b
Refactor: some CAM formatting
joepie91 May 17, 2026
e9ec072
Refactor: restrict JSX to .jsx files, and clean up imports a bit
joepie91 May 17, 2026
7d97baa
Refactor: Initial Redux hooks work
joepie91 May 17, 2026
c95c2db
Refactor: Remove some deeply intertwined findDOMNode use and prop inj…
joepie91 May 17, 2026
6b6cf81
Refactor: Eliminate deprecated findDOMNode use from Input
joepie91 May 17, 2026
7765e25
Refactor: About pane
joepie91 May 17, 2026
3f7fe60
Refactor: Various dead code removal and linter fixes
joepie91 May 17, 2026
174ad6b
Refactor: Operation code reduction
joepie91 May 18, 2026
ffd2c31
Refactor: Operation, split into multiple files
joepie91 May 18, 2026
a019c4c
Refactor: Automatic React import, dead import cleanup
joepie91 May 18, 2026
306fa89
Refactor: Port material-database to functional components
joepie91 May 20, 2026
e0d03c1
Setup Redux devtools
joepie91 May 20, 2026
acd3b93
Refactor: Untangle materials database modal structure
joepie91 May 20, 2026
e7e123f
Refactor: Make IconButton component for pane toolbars
joepie91 May 20, 2026
bd7c7e4
Refactor: Rework and simplify materials database CSS
joepie91 May 20, 2026
53617f1
Refactor: Convert more icon buttons to IconButton component
joepie91 May 20, 2026
769503b
Refactor: Move pane layout into modal components
joepie91 May 21, 2026
6e5b915
Refactor: Reorganize material-database imports
joepie91 May 21, 2026
de4438b
Refactor: Move state selection in materials-database closer to point …
joepie91 May 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
{
"plugins": ["transform-decorators-legacy"]
}
"plugins": [
["@babel/plugin-proposal-decorators", { "legacy": true }]
]
}
15 changes: 8 additions & 7 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
node_modules
npm-debug.log
node_modules/*
*.md
*.swp
*.log
*.yml
*.cmd
.*
!.babelrc
Dockerfile*
docker-compose*
.dockerignore
.git
.gitignore
README.md
LICENSE
.vscode
8 changes: 0 additions & 8 deletions .env

This file was deleted.

4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[submodule "src/data/lw.machines"]
path = src/data/lw.machines
url = https://github.com/LaserWeb/lw.machines
url = https://github.com/easytarget-org/lw.machines.git
[submodule "src/data/lw.materials"]
path = src/data/lw.materials
url = https://github.com/LaserWeb/lw.materials.git
url = https://github.com/easytarget-org/lw.materials.git
62 changes: 62 additions & 0 deletions DOCKER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# LaserWeb (4.1.x) Docker Builds

This guide assumes some familiarity with [Docker](https://www.docker.com/), if you are new to Docker please start at: https://docs.docker.com/get-started/

Docker user targets:
- release
- dev

## Dev (development snapshot)
You can run the current developement version of the app in Docker using the commands below.
- build development image:
```
docker build --target dev -t laserweb4:dev .
```
- run image:
```
docker run -it --device=/dev/ttyUSB0 --rm -p 8000:8000 laserweb4:dev
```
- connect to app: http://localhost:8000

## Release
You can run the current lw.comm-server version of the app in Docker using the commands below.

**Warning:** This will bundle the current (head) [lw.comm-server head](https://github.com/LaserWeb/lw.comm-server/) Git version + the LW app bundled with that, it *does not* build the latest LW app from this repo! Use the 'dev' target for that.

- build release image:
```
docker build --target release -t laserweb4:release .
```
- run image:
```
docker run -it --device=/dev/ttyUSB0 --rm -p 8000:8000 laserweb4:release
```
- connect to app: http://localhost:8000

## Options
- Change the `--device=` to point to the correct USB device if necesscary, eg `--device=/dev/ttyACM0` etc.
- To use a different port change the port mapping in the `docker run` command to `<port number>:8000` and adjust the url you connect to appropriately.

## Stopping
Stopping the running container can be tricky, it wont respond to conventional stop commands (ctrl-c, etc.)
Start a new shell and stop the attached container with `docker stop <uuid>`
To list running docker containers use: `docker ps`

## Run in background
If you add `-d` to the docker run command it will start the container in detached mode.
You can use `docker logs -f <uuid>` to follow the output of this.

## Clean build
If you plan to release the docker build it is suggested you clean the dist folder first to avoid bundling obsolete build artifacts:
`rm dist/* && git checkout dist`

## Allow hot plugging & selection of connected devices
**This is NOT recommended, since it involves running the container in `--privileged` mode, which is a [potential security risk](https://docs.docker.com/engine/reference/run/#runtime-privilege-and-linux-capabilities).**

_..you have been warned.._

- run image:
```
docker run -it -v /dev:/dev --rm -p 8000:8000 --cap-add=sys_nice --privileged laserweb4:dev (or relese)
```
- when you connect the app you should be able to see all USB devices in the selection list
59 changes: 40 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,36 +1,57 @@
#
# ---- Base Node ----
FROM node:10-alpine AS base
FROM node:16-bullseye AS base
# set working directory
WORKDIR /usr/src/app

# copy project file
COPY package*.json ./
# Set up Apt, install build tooling and udev
RUN apt update
RUN apt install -y build-essential udev
# Upgrade npm and set node options
RUN npm install -g npm
RUN npm set progress=false
# Set the port the container serves on
EXPOSE 8000
# copy app sources
COPY . .

#
# ---- comm-server ----
FROM base AS comm-server
# Run npm install and add nodemon + lw comm server from Git
# (Currently use --force to allow for broken deps, this should be removed once the dep tree is fixed
RUN npm install -g nodemon && npm install --force lw.comm-server@git+https://github.com/LaserWeb/lw.comm-server.git

# ---- Release ----
# This will use the git head version of lw.comm-server + the LW app version bundled with that.
# it DOES NOT build and serve the version of LaserWeb in this repo
#
FROM comm-server AS release
WORKDIR /usr/src/app
# define CMD
CMD [ "node", "node_modules/lw.comm-server/server.js"]

#
# ---- Dependencies ----
FROM base AS dependencies
RUN apk add --no-cache make gcc g++ python python3 linux-headers udev git
RUN git config --global url."https://github.com".insteadOf "ssh://git@github.com"
# install node packages
RUN npm set progress=false && npm config set depth 0
RUN npm ci
# Run npm install and add nodemon + lw comm server from Git
# (Currently use --force to allow for broken deps, this should be removed once the dep tree is fixed
# copy app sources
COPY . .
RUN npm -force install && npm install --force lw.comm-server@git+https://github.com/LaserWeb/lw.comm-server.git

#
# ---- Test ----
# run linters, setup and tests
FROM dependencies AS test
#RUN npm run lint && npm run setup && npm run test
RUN npm run test
# ---- Bash (helpful for debug) ----
FROM dependencies AS bash
WORKDIR /usr/src/app
# define CMD
CMD [ "bash" ]

#
# ---- Dev ----
FROM dependencies AS dev
RUN npm install && npm install -g nodemon
# copy production node_modules
COPY --from=dependencies /usr/src/app/node_modules node_modules
WORKDIR /usr/src/app
# Bundle the development build
RUN npm run bundle-dev
# Install into lw-comm-server
RUN rm -rfv node_modules/lw.comm-server/app/* && cp -prv dist/* node_modules/lw.comm-server/app/
# define CMD
CMD [ "npm", "run", "start-server" ]
CMD [ "node", "node_modules/lw.comm-server/server.js"]
153 changes: 153 additions & 0 deletions FRONTEND-DEVELOPMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
# LaserWeb4 Frontend Developers HowTo & Guide
This guide is aimed at anybody wishing to contribute to LaserWeb4 frontend development. It shows how to setup a development machine, and how to build the Fontend using webpack (+ webpack devserver).

The Frontend is highly integrated with the backend `lw.comm-server`, which serves the Frontend via HTTP and has firmware-aware routines for many control actions (jogging, etc).
* The frontend itself is delivered as a self-contained java webapp in a folder that is deployed into the comm-server, or run standalone.
* Building and deploying `lw.comm-server` is not covered here. (TODO: Link to relevant docs for this)

## Machine Prep
This is still a WIP!

For support please go to the MakerForums at: https://forum.makerforums.info/c/laserweb-cncweb/

### Supported systems
The basic requirement is Node >= 12, and npm >= 7.

However; the 'real' requirement is node 16; several of the modules we use sitll work with Node12, but no longer formally support it and can be expected to fail sometime in the future.

I use Fedora 35, node 16 and npm 8 on a fast laptop as my primary development environment, but I test and deploy my previews on a Pi 4 running Bullseye.

These Instructions should work for all Pi 3 and 4 models running the Buster and Bullseye releases. Also see the [wiki](https://github.com/LaserWeb/lw.comm-server/wiki/Manual-Installation-(RasPi)) page about Pi installation for more info and notes on how to run LaserWeb4 as a service.

## Raspbian/Debian Bullseye
This is nice and easy; node 12 is part of the RPI OS release.

pi@lwserver:~ $ uname -a
Linux lwserver.easytarget.org 5.10.63-v8+ #1488 SMP PREEMPT Thu Nov 18 16:16:16 GMT 2021 aarch64 GNU/Linux

pi@lwserver:~ $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye

pi@lwserver:~ $ sudo apt update
...
All packages are up to date.

### Install build tools, NodeJS and NPM on Bullseye
*Note: if you have previously followed instructions given here showing you how to install Node10 and hold to that version, you should unpin node with `sudo apt-mark unhold nodejs` and then remove the node repos with `sudo rm /etc/apt/sources.list.d/nodesource.list`*

pi@lwserver:~ $ sudo apt install build-essential nodejs npm
... lots of output, on my test system 180'ish small packages are installed.. should result in success

pi@lwserver:~ $ node -v
v12.22.5

pi@lwserver:~ $ npm -v
7.5.2

## Raspbian/Debian running Buster
Unfortunately, Node 12 is not part of the RPI OS release (Node 10 is the standard, but we are not compatible with that) and so we need to use node 12 from nodesource.org

pi@buster:~ $ uname -a
Linux buster.easytarget.org 5.10.63-v7+ #1496 SMP Wed Dec 1 15:58:11 GMT 2021 armv7l GNU/Linux

pi@buster:~ $ lsb_release -a
No LSB modules are available.
Distributor ID: Raspbian
Description: Raspbian GNU/Linux 10 (buster)
Release: 10
Codename: buster

pi@buster:~ $ sudo apt update
...
All packages are up to date.

### Install build tools, NodeJS and NPM on Buster
We will ensure some required tools are in place, then run the setup script from nodesource.com, once that is done we can install nodejs and npm using apt in the same manner as for bullseye

pi@buster:~ $ sudo apt install curl dirmngr apt-transport-https lsb-release ca-certificates
... it's quite liklely that these are already installed

pi@buster:~ $ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
... the script will run, and configure apt to use the node12 repositories

pi@buster:~ $ sudo apt install build-essential nodejs
... should only install a few packages and result in success

pi@buster:~ $ node -v
v12.22.8

pi@buster:~ $ npm -v
6.14.15

# Download the repos from GitHub
These repos are somewhat large, the clone operations may be slow

pi@lwserver:~ $ git clone https://github.com/LaserWeb/LaserWeb4.git
OR, if you have a GitHub account: git clone git@github.com:LaserWeb/LaserWeb4.git
Cloning into 'LaserWeb4'...

pi@lwserver:~ $ ls LaserWeb4/
dist docs jsdoc.json LICENSE.md package.json README.md webpack.config.js
Dockerfile git laserweb@0.4.0 logfile.txt package-lock.json src win.shell.cmd

pi@lwserver:~ $ cd LaserWeb4/
pi@lwserver:~/LaserWeb4 $ git branch
* dev-es6

Now we must initilise and update the LW4 submodules
pi@lwserver:~/LaserWeb4 $ git submodule init
Submodule 'src/data/lw.machines' (https://github.com/LaserWeb/lw.machines) registered for path 'src/data/lw.machines'
Submodule 'src/data/lw.materials' (https://github.com/LaserWeb/lw.materials.git) registered for path 'src/data/lw.materials'

pi@lwserver:~/LaserWeb4 $ git submodule update
Cloning into '/home/pi/LaserWeb/LaserWeb4/src/data/lw.machines'...
Cloning into '/home/pi/LaserWeb/LaserWeb4/src/data/lw.materials'...
Submodule path 'src/data/lw.machines': checked out '685d9de193400a7bcf35d921eda21e4bedfbdc7b'
Submodule path 'src/data/lw.materials': checked out 'dce9f9ae104030e192a9716f095988dc33c0c0cd'

## Build LaserWeb4 frontend
First we install laserweb4's dependencies

pi@lwserver:~ $ cd ~/LaserWeb4/

pi@lwserver:~/LaserWeb4 $ npm install

If you have failures here the first thing to do is 'reset' the package lock with `rm package-list.json` and trying again.

## Build and Generate a distribution (aka Bundle) the frontend build
The results end up in the `dist` folder of the repo

pi@lwserver:~/LaserWeb4 $ npm run bundle-dev

The results of the build will go into the `./dist` folder in the repo.
* You can serve them directly from there with `python3 -m http.server 8000` and connect to port 8000 in your browser
* You can 'clean' the `dist` folder with `cd dist && rm * && git checkout .` (TODO: npm run clean-dist)

## CI
WebPack allows handy ways of continuously integrating/building your local code.

pi@lwserver:~/LaserWeb4 $ npm run watch-dev

Will continually and quickly re-build LW4 to the `dist` folder but I prefer:

pi@lwserver:~/LaserWeb4 $ npm run start-dev

* This is great; it builds the app, then serves it on a local port (8080 by default)
* It then monitors the repo and fast re-builds as needed when you modify files
* The served app is restarted whenever it rebuilds, and errors get shown in the browser as well as the cli

## Production Builds
Production builds (`npm run bundle-prod`) are smaller & faster, but slower to compile, and lack debug mappings etc. They are intended to be used during releasing/deployment and are not of much interest here unless you are planning on releasing

# Notes:

## Not the end
I'm still working on this... I want to add an architecture overview, style and contributing guide. I intend to have a seperate 'releasing' guide that references this.

## Caveat for Pi3 model A (and Pi2's ?)
You can no longer build the frontend with a Pi3+ model A; with only 512Mb of memory it cannot compile without encountering out of memory errors.

17 changes: 7 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,7 @@ Releases are made available on https://github.com/LaserWeb/LaserWeb4-Binaries/
For more documentation, go to the [Wiki](https://github.com/LaserWeb/LaserWeb4/wiki) or our website https://laserweb.yurl.ch

## Docker

- run image:
```sh
docker run -device=/dev/ttyUSB0 -p 8000:8000 joesantos/laserweb:latest
```
- connect to app: http://localhost:8000
See the separate [Docker Guide](DOCKER.md).

### Development

Expand Down Expand Up @@ -51,11 +46,12 @@ Note: Ever changing. See the Issues tab above for details.
| Grbl > v1.1f (ATmega328) | Yes | Good | Great | Yes - improvements |
| Grbl-Mega (ATmega2560) | Yes | Good | Great | Yes - improvements |
| Grbl-LPC (LPC176x) | Yes | Great | Great | Yes - improvements |
| Grbl_ESP32 (ESP32) | Yes | Great | Great | Yes - improvements |
| Grbl_ESP32 (ESP32) | Yes | Great | Great | No - Superseded by FluuidNC |
| FluidNC (ESP32) | Yes | Great | Great | Yes - improvements |
| Smoothieware | Yes * | Okayish | Okayish | Yes - improvements |
| TinyG | Yes | Unknown | Good | Yes - improvements |
| Marlin | Yes | Unknown | No | Yes - improvements |
| MarlinKimbra | Yes | Unknown | No | Yes - improvements |
| Marlin | Yes | Unknown | No | Yes - improvements |
| MarlinKimbra | Yes | Unknown | No | Yes - improvements |
| Repetier | Yes | Unknown | No | Yes - improvements |
| RepRapFirmware | Yes | Unknown | Yes | Yes - improvements |

Expand All @@ -73,5 +69,6 @@ If you want to contribute, below are long standing community-requested enhanceme

## How to contribute ?

Details on [https://github.com/LaserWeb/LaserWeb4/wiki/How-to-Contribute](https://github.com/LaserWeb/LaserWeb4/wiki/How-to-Contribute)
To set up a development environment see the [Developer HowTo](FRONTEND-DEVELOPMENT.md) in the repo.
Further details are on [https://github.com/LaserWeb/LaserWeb4/wiki/How-to-Contribute](https://github.com/LaserWeb/LaserWeb4/wiki/How-to-Contribute)

Loading