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

Move from yarn to bun #481

Merged
merged 6 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 16 additions & 18 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,19 @@ jobs:

- name: Install dependencies
run: |
sudo apt install -y xvfb yarn
sudo apt install -y xvfb

- name: Run yarn
- uses: oven-sh/setup-bun@v1
with:
bun-version: latest

- name: Run bun
run: |
yarn install --frozen-lockfile --network-timeout 300000
yarn lint
yarn typecheck
yarn build
xvfb-run --auto-servernum yarn test:ci
bun install --frozen-lockfile
bun run lint
bun run typecheck
bun run build
xvfb-run --auto-servernum bun test:ci

deploy-electron:
needs: test
Expand All @@ -44,27 +48,21 @@ jobs:
suffix: linux
extension: AppImage

- os: windows-latest
suffix: windows
extension: exe
Comment on lines -47 to -49
Copy link
Member

Choose a reason for hiding this comment

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

Was this remove intentional?

Copy link
Member Author

@patrickelectric patrickelectric Sep 15, 2023

Choose a reason for hiding this comment

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

Yes, bun does not have support officially for windows. We can add it back with yarn build. But I just want to avoid the extra logic right now inside the yml.

steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive

# Use node to install yarn in all OSs
- name: Install node
uses: actions/setup-node@v3
- uses: oven-sh/setup-bun@v1
with:
node-version: 16
bun-version: latest

- name: Build electron
run: |
npm install --global yarn
yarn install --frozen-lockfile --network-timeout 300000
yarn build
yarn deploy:electron
bun install --frozen-lockfile
bun run build
bun deploy:electron

- name: Upload Artifact
uses: actions/upload-artifact@v3
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Build frontend
FROM --platform=$BUILDPLATFORM node:16-buster-slim AS frontendBuilder
FROM --platform=$BUILDPLATFORM oven/bun AS frontendBuilder

RUN mkdir /frontend && ls /frontend
COPY . /frontend
RUN --mount=type=cache,target=/frontend/node_modules yarn --cwd /frontend install --network-timeout=300000
RUN --mount=type=cache,target=/frontend/node_modules yarn --cwd /frontend build
RUN bun install --cwd /frontend
RUN bun run --cwd /frontend build

FROM alpine:3.14

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@ An intuitive and customizable cross-platform ground control station for remote v
Cockpit is typically installed as an Electron application or BlueOS Extension, but for development purposes it is valuable to run it locally. To do so, you can install the dependencies with:

```
yarn install
bun install
```

and then run the server locally with:

```
yarn dev --host
bun run dev --host
```

Then you should see a prompt with the local IP and port that can be accessed through a browser, such as `localhost:5173`.
Binary file added bun.lockb
Binary file not shown.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"main": "dist/electron/main.js",
"scripts": {
"build": "vite build",
"build:serve": "yarn build && yarn serve",
"build:serve": "bun run build && bun run serve",
"coverage": "vitest --coverage",
"deploy:electron:dir": "electron-builder --dir",
"deploy:electron": "electron-builder --publish=never",
Expand Down Expand Up @@ -85,7 +85,7 @@
"vite-plugin-vuetify": "^1.0.0-alpha.16",
"vitest": "^0.20.3",
"vue-cli-plugin-vuetify": "~2.4.8",
"vue-tsc": "^1.0.9",
"vue-tsc": "1.0.9",
"vuetify-loader": "^2.0.0-alpha.0"
},
"prettier": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/widgets/ImageView.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
</div>
</v-card-text>
<v-card-actions>
<v-btn color="primary" text @click="widget.managerVars.configMenuOpen = false">Close</v-btn>
<v-btn color="primary" @click="widget.managerVars.configMenuOpen = false">Close</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
Expand Down