Skip to content

Commit

Permalink
Merge branch 'bluerobotics:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickelectric authored Feb 4, 2025
2 parents 485c060 + 53aafb7 commit 6703f3e
Show file tree
Hide file tree
Showing 183 changed files with 18,613 additions and 2,819 deletions.
81 changes: 81 additions & 0 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
# Same as production
ARG VARIANT=22.04
FROM ubuntu:${VARIANT}

ARG USERNAME=dev
ARG USER_UID=1000
ARG USER_GID=$USER_UID

RUN apt-get update && apt-get install -y \
curl \
xvfb \
git \
nano \
unzip \
bash-completion \
less \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Create the user with the same UID/GID as host user
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& apt-get update \
&& apt-get install -y sudo \
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \
&& chmod 0440 /etc/sudoers.d/$USERNAME

# Set up NVM and Node.js
ENV NVM_DIR=/usr/local/nvm
ENV NODE_VERSION=v20.16.0
RUN mkdir -p /usr/local/nvm \
&& curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash \
&& . $NVM_DIR/nvm.sh \
&& nvm install $NODE_VERSION \
&& nvm alias default $NODE_VERSION \
&& nvm use default \
&& chown -R $USERNAME:$USERNAME $NVM_DIR
ENV NODE_PATH=/usr/local/nvm/versions/node/$NODE_VERSION/bin
ENV PATH=$NODE_PATH:$PATH

# Set up Bun
USER $USERNAME
WORKDIR /home/$USERNAME
RUN curl -fsSL https://bun.sh/install | bash
ENV BUN_PATH=/home/$USERNAME/.bun
ENV PATH=$BUN_PATH/bin:$PATH

# Set up bash
RUN echo 'export PS1="\[\e[01;32m\]\u\[\e[m\]:\[\e[01;34m\]\w\[\e[m\]\$ "' >> ~/.bashrc \
&& echo "export PATH=\"$BUN_PATH/bin:\$PATH\"" >> ~/.bashrc \
&& echo 'export NVM_DIR="/usr/local/nvm"' >> ~/.bashrc \
&& echo '[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"' >> ~/.bashrc

# Create workspace directory with correct permissions
USER root
RUN mkdir -p /workspace \
&& chown $USERNAME:$USERNAME /workspace

# Entrypoint script
COPY <<-"EOF" /usr/local/bin/entrypoint.sh
#!/bin/bash
if [ "$1" = "dev" ]; then
# If first argument is "dev", start the dev server with host binding
. ~/.bashrc && exec bun dev --host 0.0.0.0
else
# Otherwise, forward all arguments to bun
. ~/.bashrc && exec bun "$@"
fi
EOF

RUN chmod +x /usr/local/bin/entrypoint.sh

USER $USERNAME
WORKDIR /workspace
ENV CONTAINER=true

# Verify installations
RUN . ~/.bashrc && bun --version && node --version

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD ["dev"]
30 changes: 30 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"name": "Cockpit Development",
"build": {
"dockerfile": "Dockerfile",
"args": {
"USERNAME": "dev",
"USER_UID": "1000",
"USER_GID": "1000"
}
},
"customizations": {
"vscode": {
"extensions": [
"dbaeumer.vscode-eslint",
"vue.volar",
"bradlc.vscode-tailwindcss",
"spencerwmiles.vscode-task-buttons"
],
"settings": {
"task.quickOpen.detail": true,
"task.quickOpen.skip": false,
"terminal.integrated.defaultProfile.linux": "bash"
}
}
},
"forwardPorts": [5173],
"postCreateCommand": "git submodule update --init --recursive && bun install && exit 0",
"remoteUser": "dev",
"updateRemoteUserUID": true
}
9 changes: 5 additions & 4 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module.exports = {
'jsdoc/newline-after-description': 'off',
'jsdoc/no-undefined-types': 'off',
'jsdoc/require-returns': ['error', { forceReturnsWithAsync: false }],
'max-len': ['error', { code: 120, ignoreUrls: true, ignoreComments: true }],
'max-len': ['error', { code: 180, ignoreUrls: true, ignoreComments: true }],
'no-alert': 'off',
'no-console': 'off',
'no-continue': 'off',
Expand Down Expand Up @@ -78,6 +78,7 @@ module.exports = {
'@typescript-eslint/no-useless-constructor': ['error'],
'@typescript-eslint/no-shadow': ['error'],
'@typescript-eslint/explicit-function-return-type': ['error', { allowExpressions: true }],
'@typescript-eslint/no-explicit-any': 'off',
'vue/no-unused-properties': [
'error',
{
Expand All @@ -92,10 +93,10 @@ module.exports = {
'vue/max-len': [
'error',
{
code: 120,
template: 120,
code: 180,
template: 180,
tabWidth: 4,
comments: 160,
comments: 180,
ignoreComments: true,
ignoreTrailingComments: true,
ignoreHTMLAttributeValues: true,
Expand Down
55 changes: 55 additions & 0 deletions .github/ISSUE_TEMPLATE/bugs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Report bug
description: Report a bug found
type: "Bug"
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to report an issue! Please fill out the following details so we can respond and act efficiently.
- type: textarea
attributes:
label: Bug description
description: Describe roughly what the bug is. For interface issues, please include relevant screenshots or recordings.
placeholder: |
Example: "Widgets underneath the top bar"
validations:
required: true

- type: textarea
attributes:
label: Steps to reproduce
description: Provide an example of how to replicate the bug.
placeholder: |
Example:
1. Click here
2. Click That
3. Put this here
4. And etc
validations:
required: true

- type: textarea
attributes:
label: Primary pain point(s)
description: What is this bug actively stopping you from doing? This is helpful for us to suggest temporary workarounds while the actual issue is being fixed.
placeholder: |
Example: "When the widget is obstructed I can't see the information I need."
validations:
required: false

- type: textarea
attributes:
label: Additional context
description: System logs, links to relevant forum discussions, etc.
validations:
required: false

- type: checkboxes
id: terms
attributes:
label: Prerequisites
description: Please confirm the following (and check the boxes) before submitting.
options:
- label: I have checked to make sure that a similar request has not already been filed or fixed.
required: true
36 changes: 36 additions & 0 deletions .github/ISSUE_TEMPLATE/ui-corrections.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Improve User Interface or Experience
description: Suggestion to improve UI/UX.
title: "frontend: "
labels: ["ui", "enhancement"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to suggest improvements to our interface! Please fill out the following details so we can respond and act efficiently.
- type: textarea
attributes:
label: Current behaviour
description: Describe what you see, why that is bad, and any issues it is causing.
placeholder: |
Example: "The small margins between the mini-widgets make it harder to distinguish between them, and looks unusual."
validations:
required: true

- type: textarea
attributes:
label: Expected or desired behaviour
description: Explain what you expect or would like to see instead, and why.
placeholder: |
Example: "An extra margin or space between them may help."
validations:
required: true

- type: checkboxes
id: terms
attributes:
label: Prerequisites
description: Please confirm the following (and check the boxes) before submitting.
options:
- label: I have checked to make sure that a similar request has not already been filed or fixed.
required: true
43 changes: 43 additions & 0 deletions .github/ISSUE_TEMPLATE/widget-idea.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Widget idea
description: Suggest/request a new type of widget
title: "widget: "
labels: ["widget-specific", "ui"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to report an issue! Please fill out the following details so we can respond and act efficiently.
- type: textarea
attributes:
label: Problem to solve
description: Describe why a new widget is needed, in detail.
placeholder: |
Example: "I want to visually track and compare data from multiple sensors over time."
validations:
required: true

- type: textarea
attributes:
label: Desired approach
description: Suggest specific functionality and/or interface ideas that you think should be included / considered. If possible, provide diagrams/sketches/images as interface references.
placeholder: |
A plotting widget with support for multiple variables could show the values over time, and allowing (optional) logarithmic scaling for the horizontal axis could focus attention on the most recent values.
validations:
required: true

- type: textarea
attributes:
label: Additional context
description: Links to similar widgets or interfaces in other software/games, relevant forum discussion threads, etc.
validations:
required: false

- type: checkboxes
id: terms
attributes:
label: Prerequisites
description: Please confirm the following (and check the boxes) before submitting.
options:
- label: I have checked to make sure that a similar request has not already been filed or fixed.
required: true
Loading

0 comments on commit 6703f3e

Please sign in to comment.