browsh/SETUP_DEV_LINUX.md

80 lines
1.4 KiB
Markdown
Raw Permalink Normal View History

2018-08-31 16:57:42 +00:00
# How to setup the build environment for browsh on a generic Linux system
2023-12-10 09:37:36 +00:00
Install Go, Node.js, and Firefox using your system's package manager.
**Browsh requires Version 57 or higher.**
Now you should be able to call the *go* and *node* binaries:
2023-12-09 21:15:51 +00:00
```shell
go version
node --version
```
2023-12-10 09:37:36 +00:00
## Install webpack, webpack-cli, & web-ext
2023-12-09 21:15:51 +00:00
```shell
2023-12-10 09:37:36 +00:00
npm install -g webpack webpack-cli web-ext
```
## Cloning the browsh repository
It's assumed that you already have *git* installed.
Run this anywhere you want:
2023-12-09 21:15:51 +00:00
```shell
git clone https://github.com/browsh-org/browsh.git
```
## Setting up the build environment in the cloned repository
2023-12-09 21:15:51 +00:00
### Setting up dependencies
2023-12-09 21:15:51 +00:00
```shell
browsh=/path/to/browsh
cd "$browsh/webext"
npm run get-gobindata
npm install
npm run build
diff -u <(echo -n) <(gofmt -d ./)
./node_modules/.bin/prettier --list-different "{src,test}/**/*.js"
```
2023-12-09 21:15:51 +00:00
### Building browsh
2023-12-09 21:15:51 +00:00
```shell
cd "$browsh/interfacer"
go build -o browsh src/main.go
```
### Building the web extension
2023-12-09 21:15:51 +00:00
In `$browsh/webext`:
2023-12-09 21:15:51 +00:00
```shell
webpack --watch
```
2018-08-31 16:57:42 +00:00
This will continuously watch for changes made to the web extension and rebuild it.
## Run firefox and the webextension
2023-12-09 21:15:51 +00:00
In `$browsh/webext/dist`:
2023-12-09 21:15:51 +00:00
```shell
web-ext run --verbose --firefox path/to/firefox
```
## Run browsh
2023-12-09 21:15:51 +00:00
```shell
cd "$browsh/interfacer"
go run ./cmd/browsh --firefox.use-existing --debug
```
Or after building:
2023-12-09 21:15:51 +00:00
```shell
./browsh --firefox.use-existing --debug
```