Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add frontend build #24

Merged
merged 6 commits into from
Oct 7, 2024

Conversation

RaulTrombin
Copy link
Member

@RaulTrombin RaulTrombin commented Sep 23, 2024

This PR adds a front-end project to the repository.
The project was built with Bun, along with Vue, Vuetify, and TailwindCSS.

The built front-end is embedded in the release binaries on CI.

image

@RaulTrombin RaulTrombin force-pushed the add_frontend_build branch 2 times, most recently from a313cc7 to 8fdcb53 Compare September 24, 2024 21:26
@RaulTrombin
Copy link
Member Author

@patrickelectric Moved these components to a post-pull request.

uses: actions/[email protected]
with:
name: dist
path: ./ping-viewer-next-frontend/dist
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if I follow, we are already building it with build.rs

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently we don't, only if the feature flag is enabled, so users only need to set npm/bun/front-end stuff if they want it.

The frontend is built only a single time and shared to the next actions to embeed it.

We have the flags:
build-frontend [embed-frontend]
and
embed-frontend itself

if this features isn't requested, it will only embed the simple .html on src/server/rest/

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not following. Why are we building this in a different step ?
And why are we not building it with build.rs on the step that we are downloading it ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not following. Why are we building this in a different step ? And why are we not building it with build.rs on the step that we are downloading it ?

To users choose if they want to setup the frontend related features on computer or not.
Also had issues to build the frontend on specific targets such armv7/aarch64 using Vue/Bun , and even we'll need to set an special container to cross compiling it inside.

So the built frontend is just embeded on the build steps.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tested here, and a simple curl -fsSL https://bun.sh/install | bash should work.
Btw, we use bun in cockpit.

@@ -0,0 +1,5 @@
[*.{js,jsx,ts,tsx,vue}]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unnecessary

@@ -0,0 +1,22 @@
.DS_Store
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you minize this file to use only what we need ?

@@ -0,0 +1,79 @@
# Vuetify (Default)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unnecessary


<script setup>
import { ref } from "vue";
import WebsocketClient from "../widgets/WebsocketClient.vue";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use path alias like @

const isCollapsed = ref(false);

const components = {
WebsocketClient,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use 4 spaces as the other parts of the project ?

@@ -0,0 +1,5 @@
# Pages
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary


// Plugins
import vuetify from "./vuetify";
// import router from '@/router'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lost code

@RaulTrombin RaulTrombin force-pushed the add_frontend_build branch 2 times, most recently from 182236a to ac97025 Compare October 3, 2024 13:51
@@ -0,0 +1,4 @@
indent_style = space
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is unnecessary

@patrickelectric
Copy link
Member

@RaulTrombin needs rebase

Copy link
Member

@patrickelectric patrickelectric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove the folder node_modules

@RaulTrombin RaulTrombin merged commit 7ab0cbb into bluerobotics:master Oct 7, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants