Git Product home page Git Product logo

boson's Introduction

boson

boson is a prototype GUI meant to expand and eventually replace STUI. It uses the following libraries and frameworks:

Development

boson uses the Electron Forge boilerplate with the vite-typescript template. First, install the dependencies with yarn (use of npm may be possible but is not tested; please do not commit the package-lock.json file). Note that this workflow is tested with yarn 4.1.0+ and node 21 on macOS Sonoma. It may not work in other systems.

yarn install

You can run the application in development mode with

yarn start

To package the app for distribution do

yarn package

and to publish it to GitHub as a draft release, do

yarn publish

The packaging script will try to code sign and notarise your macOS binaries, for which you need to have set $APPLE_ID and $APPLE_ID_PASS to an email and app-specific password that can be used to notarize boson. In general you don't need to worry about notarising since the CI workflow will do it for you, but note that if you try to distribute a non-notarised app most users won't be able to run it without disabling Gatekeeper.

Continuous Integration

The GitHub workflow publish.yml will build and notarise the application (currently only macOS binaries are produced) in three circumstances:

  • When a new tag is pushed.
  • When the workflow is manually initiated as a workflow dispatch.

For new tags the workflow will create a new draft release and publish the artifacts there. The user needs to manually edit the release notes and publish the release, which will in turn trigger the auto uploader to download the new version.

boson's People

Contributors

albireox avatar ryski2 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

boson's Issues

Track scripts running

Right now if a user runs a HAL script other users don't see the progress. When a macro is running, select it in the dropdown menu and disable it.

Consider replacing `electron-store` with `lowdb`

electron-store doesn't seem to be in development anymore, and we have seem some weird errors that we cannot completely reproduce.

lowdb seems like a popular alternative, but seems to be missing options like migrations.

Start/end commands do now appear in log

Add the CommandStarted and CommandDone from STUI, for all users. Maybe show them in a bubble or with a different colour. Maybe group replies hierarchically?

Build and release `boson` in Windows and Linux

Using the albireox-upgrade-electron-28 branch I tried to run boson in development mode in xubuntu. I had some initial success, which required installing certain dependencies to make yarn install complete without errors. It seems at least some of these are needed

sudo apt install libpixman-1-dev
sudo apt install libcairo2 libcairo2-dev
brew install pkg-config cairo pango libpng jpeg giflib librsvg

in addition to Node 21 and yarn (npm install -g yarn). But then yarn start raises

> start:renderer
> cross-env NODE_ENV=development NODE_OPTIONS="--no-warnings --loader esbuild-register/loader -r esbuild-register" webpack serve --config ./.erb/configs/webpack.config.renderer.dev.ts

Starting preload.js builder...
Starting Main Process...
<i> [webpack-dev-server] Project is running at:
<i> [webpack-dev-server] Loopback: http://localhost:1212/
<i> [webpack-dev-server] On Your Network (IPv4): http://172.16.175.136:1212/
<i> [webpack-dev-server] Content not from webpack is served from '/home/gallegoj/code/boson/public' directory
<i> [webpack-dev-server] 404s will fallback to '/index.html'

> start:main
> cross-env NODE_ENV=development NODE_OPTIONS="--no-warnings --loader esbuild-register/loader -r esbuild-register" electronmon .


> start:preload
> cross-env NODE_ENV=development NODE_OPTIONS="--no-warnings --loader esbuild-register/loader -r esbuild-register" webpack --config ./.erb/configs/webpack.config.preload.dev.ts

[electronmon] waiting for a change to restart it
App threw an error during load
TypeError: Invalid Version: 0.0
    at new SemVer (/home/gallegoj/code/boson/node_modules/semver/classes/semver.js:38:13)
    at compare (/home/gallegoj/code/boson/node_modules/semver/functions/compare.js:3:32)
    at Object.eq (/home/gallegoj/code/boson/node_modules/semver/functions/eq.js:2:29)
    at ElectronStore._migrate (/home/gallegoj/code/boson/node_modules/conf/dist/source/index.js:432:78)
    at new Conf (/home/gallegoj/code/boson/node_modules/conf/dist/source/index.js:150:18)
    at new ElectronStore (/home/gallegoj/code/boson/node_modules/electron-store/index.js:69:3)
    at Object.<anonymous> (/home/gallegoj/code/boson/src/main/store/store.ts:16:15)
    at Module._compile (node:internal/modules/cjs/loader:1271:14)
    at Module._compile (/home/gallegoj/code/boson/node_modules/esbuild-register/dist/node.js:2258:26)
    at Module._extensions..js (node:internal/modules/cjs/loader:1326:10)
[electronmon] uncaught exception occured
[electronmon] waiting for any change to restart the app
boson encountered an error
TypeError: Invalid Version: 0.0
    at new SemVer (/home/gallegoj/code/boson/node_modules/semver/classes/semver.js:38:13)
    at compare (/home/gallegoj/code/boson/node_modules/semver/functions/compare.js:3:32)
    at Object.eq (/home/gallegoj/code/boson/node_modules/semver/functions/eq.js:2:29)
    at ElectronStore._migrate (/home/gallegoj/code/boson/node_modules/conf/dist/source/index.js:432:78)
    at new Conf (/home/gallegoj/code/boson/node_modules/conf/dist/source/index.js:150:18)
    at new ElectronStore (/home/gallegoj/code/boson/node_modules/electron-store/index.js:69:3)
    at Object.<anonymous> (/home/gallegoj/code/boson/src/main/store/store.ts:16:15)
    at Module._compile (node:internal/modules/cjs/loader:1271:14)
    at Module._compile (/home/gallegoj/code/boson/node_modules/esbuild-register/dist/node.js:2258:26)
    at Module._extensions..js (node:internal/modules/cjs/loader:1326:10)
[electronmon] ignoring exit with code 1
^C<i> [webpack-dev-server] Gracefully shutting down. To force exit, press ^C again. Please wait...

So this really points to needing to get rid of electron-store (see #31).

Regardless, we should try to get boson to at least build in Linux, ideally also Windows, and be able to develop/run from source at least in Linux, and have some clear instructions about how to install in Ubuntu.

Potential issue with react-pdf

Right now after running yarn package, if one does yarn start we get

The DLL files are missing. Sit back while we build them for you with "npm run build-dll"
[webpack-cli] Failed to load '/Users/gallegoj/Documents/Code/sdss5/boson/.erb/configs/webpack.config.renderer.dev.ts' config
[webpack-cli] Error: Command failed: npm run postinstall
    at checkExecSyncError (node:child_process:885:11)
    at execSync (node:child_process:957:15)
    at Object.<anonymous> (/Users/gallegoj/Documents/Code/sdss5/boson/.erb/configs/webpack.config.renderer.dev.ts:39:11)
    at Module._compile (node:internal/modules/cjs/loader:1255:14)
    at Module.m._compile (/Users/gallegoj/Documents/Code/sdss5/boson/node_modules/ts-node/src/index.ts:1618:23)
    at Module._extensions..js (node:internal/modules/cjs/loader:1309:10)
    at Object.require.extensions.<computed> [as .ts] (/Users/gallegoj/Documents/Code/sdss5/boson/node_modules/ts-node/src/index.ts:1621:12)
    at Module.load (node:internal/modules/cjs/loader:1113:32)
    at Function.Module._load (node:internal/modules/cjs/loader:960:12) {
  status: 1,
  signal: null,
  output: [
    null,
    <Buffer 0a 3e 20 70 6f 73 74 69 6e 73 74 61 6c 6c 0a 3e 20 74 73 2d 6e 6f 64 65 20 2e 65 72 62 2f 73 63 72 69 70 74 73 2f 63 68 65 63 6b 2d 6e 61 74 69 76 65 ... 723 more bytes>,
    <Buffer >
  ],
  pid: 80678,
  stdout: <Buffer 0a 3e 20 70 6f 73 74 69 6e 73 74 61 6c 6c 0a 3e 20 74 73 2d 6e 6f 64 65 20 2e 65 72 62 2f 73 63 72 69 70 74 73 2f 63 68 65 63 6b 2d 6e 61 74 69 76 65 ... 723 more bytes>,
  stderr: <Buffer >
}

Running yarn postinstall by itself produces

 Webpack does not work with native dependencies.
react-pdf is a native dependency and should be installed inside of the "./release/app" folder.
 First, uninstall the packages from "./package.json":
npm uninstall your-package
 Then, instead of installing the package to the root "./package.json":
npm install your-package
 Install the package to "./release/app/package.json"
cd ./release/app && npm install your-package
 Read more about native dependencies at:
https://electron-react-boilerplate.js.org/docs/adding-dependencies/#module-structure

which seems to indicate that react-pdf should be moved to release/app, but then neither the development or production would work.

Modifying postinstall in package.json and removing the ts-node .erb/scripts/check-native-dep.js seems to fix the issue, but I'm not sure whether this would break something else, so for now I haven't committed that change.

Improve auto update

The auto update design should look more like the standard macOS experience. I don't think there's a package to do that.

When an update is available retrieve and show the change log

image

Keep a list of skipped versions and do not offer the update for those except when checking for updates manually.

If no update is available, show something like.

image

(although the current dialog is not bad).

When installing an update, show a dialog with a progress bar and the option to cancel. When the download is complete, change the button to install and restart.

Automatically check for new version when Boson starts and then every 6 hours.

Review security risks

We are currently forcing code signing in PRs by forcing CSC_FOR_PULL_REQUEST: true in the publish.yml workflow. This raises the warning

There are serious security concerns with CSC_FOR_PULL_REQUEST=true (see the  CircleCI documentation (https://circleci.com/docs/1.0/fork-pr-builds/) for details)

Additionally I disabled Yarn's hardened mode with YARN_ENABLE_HARDENED_MODE: 0 which warns


➤ YN0000: Yarn detected that the current workflow is executed from a public pull request. For safety the hardened mode has been enabled.
➤ YN0000: It will prevent malicious lockfile manipulations, in exchange for a slower install time. You can opt-out if necessary; check our documentation for more details.

We should evaluate what's the actual risk here.

Implement sound framework

Observers have requested having some form of sounds feedback in Boson. PR #28 tracks this implementation.

Needed features are:

  • Allow to play sounds on certain events (error message, exposure completed, exposure failed, etc.)
  • Create a library of sounds, both sound effects and live/generated voice that can be used for sound events.
  • Allow three modes of operation: on in which all the defined sound events play a sounds, minimal in which only certain events play a sound (and always sound effects, not voices), and off where no sounds are played.
  • Add a quick muted option with a shortcut to temporarily disable sounds (this is different from the off mode).
  • Assign sounds to sound events and allow to change in configuration file.

More advanced features, not critical at the beginning are:

  • In Preferences, allow users to select what sound effect / sound file is played on each sound event.
  • Allow users to use sound files from their host system.
  • Use text-to-speech to allow users to define sound effects from text (see here).

Snapshots header looks weird when size is small

When the size of the window is small the header of the snapshots looses the search box and other buttons because neither the file name or the slider are resizable.

  • Make the slider disappear if the window is too small.
  • Allow ellipsis in the configuration name.

Track running commands in CommandButton

The CommabdButton components should be able to track if its command is running (maybe not always, but at least as an option). To do this it would need to monitor running tron commands and if the actor + verb match, then act as if the command is running (greyed out, spinning circle) and allow to stop the command.

This probably requires the main process sending notifications when the status of a running command changes and CommandButton listening to thoses events.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.