Skip to content
João Mário Lago edited this page Mar 11, 2024 · 21 revisions

Style-guide

Frontend

  1. Code-style
    • Code-style is defined on the eslint configuration file. What passes it is considered valid. New rules can/will come with time.
    • Exception to the rule above are variables names. While all other identifiers should follow the Google Javascript conventions, variables should use snake_case, to make them compatible with external APIs.
  2. Files-naming
    • Vue files use PascalCase while other files (e.g.: .ts) uses camel_case.

How to build

  1. Install docker

Build with buildx

  1. Install docker buildx
  2. Enable docker experimental features
  3. Create a node to for armv7 with the correct configuration
    • docker buildx create --use --platform=linux/arm/v7 --buildkitd-flags '--allow-insecure-entitlement network.host --allow-insecure-entitlement security.insecure' --name arm-builder
  4. Pull latest changes to avoid building everything from scratch
    • docker pull --platform linux/arm/v7 bluerobotics/blueos-core:master
  5. Go inside the core folder
  6. Build it
    • Be aware that crosscompiling the core image will take some time in a good computer.
    • docker buildx build --allow security.insecure --platform linux/arm/v7 . -t yourdockerhubuser/blueos-core:yournewtag --push --build-arg VITE_APP_GIT_DESCRIBE=$(git describe --long --always --dirty --all) --output type=registry --progress=plain

    You can replace yournewtag with $(git rev-parse --abbrev-ref HEAD) to create images based on your development branch name

Run the newly built image

  1. Navigate to http://blueos.local:8081 and the new tag should show in VersionChooser when using your remote name

Access docker terminal

You can access it via: sudo docker exec -it blueos-core /usr/bin/tmux

Frontend

  1. To develop the frontend first install yarn on your system.
  2. Go to the frontend folder with cd core/frontend
  3. Install the necessary packages with yarn install
  4. Now just do your changes and try them with yarn serve

You can also lint your code anytime with yarn lint

Know problems

Is know that qemu-arm-static version 5.2.0 has DNS problems, so git clone step may fail, for more information check this builx issue.

  • Check qemu-arch-extra