Skip to content

Commit

Permalink
[v10] Remove building native deps from yarn build-term (#1108)
Browse files Browse the repository at this point in the history
Calling `electron-builder install-app-deps` during `yarn
build-and-package-term` is unnecessary as `electron-builder build`
already does that.

The only time where you'd need to run `electron-builder
install-app-deps` is when you just cloned the repo and would like to run
the dev version of the app without building the prod version.
  • Loading branch information
ravicious authored Aug 17, 2022
1 parent 7c26c0f commit f514c1e
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
1 change: 1 addition & 0 deletions web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"tdd": "jest --watch",
"package-term": "yarn workspace @gravitational/teleterm package",
"build-term": "yarn workspace @gravitational/teleterm build",
"build-native-deps-for-term": "yarn workspace @gravitational/teleterm build-native-deps",
"build-and-package-term": "yarn build-term && yarn package-term",
"start-term": "yarn workspace @gravitational/teleterm start",
"start-teleport": "yarn workspace @gravitational/teleport start",
Expand Down
22 changes: 14 additions & 8 deletions web/packages/teleterm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,28 +30,34 @@ Prepare Webapps repo
$ git clone https://github.com/gravitational/webapps.git
$ cd webapps
$ yarn install
$ yarn build-term
$ yarn package-term
$ yarn build-and-package-term
```

The installable file can be found in `/webapps/packages/teleterm/build/release/`

### Development

**Make sure to run `yarn build-term` first** (as described above) before attempting to launch the
app in the development mode. That's because Electron is running its own version of Node. That
command will fetch native packages that were built for that specific version of Node.
**Make sure to run `yarn build-native-deps-for-term` first** before attempting to launch the app in
development mode. That's because Electron is running its own version of Node. That command will
fetch or build native packages that were made for that specific version of Node.

To launch `teleterm` in the development mode:
```sh
$ cd webapps

$ yarn install
$ yarn build-native-deps-for-term
```

To launch `teleterm` in development mode:

```sh
$ cd webapps

## TELETERM_TSH_PATH is the environment variable that points to local tsh binary
## TELETERM_TSH_PATH has to point to a tsh binary, typically from the teleport repo.
$ TELETERM_TSH_PATH=$PWD/../teleport/build/tsh yarn start-term
```

For quick restarts, that restarts all processes and `tsh` daemon, press `F6`.
For a quick restart which restarts all processes and the `tsh` daemon, press `F6`.

### Tips

Expand Down
4 changes: 2 additions & 2 deletions web/packages/teleterm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
"start": "webpack serve --config webpack.renderer.dev.config.js --progress",
"start-main": "webpack build --config webpack.main.config.js --mode=development --progress --watch",
"start-electron": "electron build/app/dist/main/main.js",
"build": "yarn build-natives && yarn build-main && yarn build-renderer",
"build": "yarn build-main && yarn build-renderer",
"build-main": "webpack build --config webpack.main.config.js --progress --mode=production",
"build-renderer": "webpack build --config webpack.renderer.prod.config.js --progress",
"build-natives": "electron-builder install-app-deps",
"build-native-deps": "electron-builder install-app-deps",
"package": "electron-builder build --publish never -c.extraMetadata.name=teleconnect",
"generate-grpc-shared": "npx -y --target_arch=x64 [email protected] [email protected] -- grpc_tools_node_protoc -I=src/sharedProcess/api/proto --ts_out=service=grpc-node,mode=grpc-js:src/sharedProcess/api/protogen --grpc_out=grpc_js:src/sharedProcess/api/protogen --js_out=import_style=commonjs,binary:src/sharedProcess/api/protogen src/sharedProcess/api/proto/*.proto"
},
Expand Down

0 comments on commit f514c1e

Please sign in to comment.