Skip to content
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
7 changes: 4 additions & 3 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
FROM ubuntu:22.04

RUN apt update && apt install -y git sudo unzip curl

RUN apt update && apt install -y --no-install-recommends ca-certificates git sudo unzip curl
RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \
&& apt-get install -y --no-install-recommends nodejs \
&& rm -rf /var/lib/apt/lists/*
ARG USERNAME=vscode
ARG USER_UID=1000
ARG USER_GID=$USER_UID
Expand All @@ -16,7 +18,6 @@ RUN mkdir -p /home/$USERNAME/workspace
WORKDIR /home/$USERNAME/workspace

RUN curl -fsSL https://bun.com/install | bash

RUN echo 'export BUN_INSTALL="$HOME/.bun"' >> ~/.bashrc
RUN echo 'export PATH="$BUN_INSTALL/bin:$PATH"' >> ~/.bashrc

Expand Down
34 changes: 21 additions & 13 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,20 +1,28 @@
{
"name": "Webdev Container",
"remoteUser": "vscode",
"image": "agrobotappliedai/webdev-containers:latest",
"customizations": {
"settings": {
"terminal.integrated.shell.linux": "bash"
}
"name": "Webdev Container",
"remoteUser": "vscode",
"image": "agrobotappliedai/webdev-containers:latest",
"customizations": {
"settings": {
"terminal.integrated.shell.linux": "bash"
},
"workspaceFolder": "/home/vscode/workspace",
"workspaceMount": "source=.,target=/home/vscode/workspace,type=bind,consistency=cached",
"updateRemoteUserUID": false,
"mounts": [],
"vscode": {
"extensions": [
"oxc.oxc-vscode",
"astro-build.astro-vscode",
"esbenp.prettier-vscode",
"dbaeumer.vscode-eslint"
]
}
},
"workspaceFolder": "/home/vscode/workspace",
"workspaceMount": "source=.,target=/home/vscode/workspace,type=bind,consistency=cached",
"updateRemoteUserUID": false,
"mounts": [],
"runArgs": [
"--net=host",
"-it",
"--rm"
],
"postAttachCommand": "bun install --frozen-lockfile"
}
"postAttachCommand": "bun install --frozen-lockfile"
}
3 changes: 1 addition & 2 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@
"dist/**",
"node_modules/**",
"README.md",
"global.css",
"*.yaml",
"*.yml",
"*.json"
]
}
}
3 changes: 1 addition & 2 deletions .oxlintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@
"dist/**",
"node_modules/**",
"README.md",
"global.css",
"*.yaml",
"*.yml",
"*.json"
]
}
}
11 changes: 11 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"plugins": ["prettier-plugin-astro", "prettier-plugin-tailwindcss"],
"overrides": [
{
"files": "*.astro",
"options": {
"parser": "astro"
}
}
]
}
9 changes: 0 additions & 9 deletions .vscode/extensions.json

This file was deleted.

16 changes: 16 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"typescript.inlayHints.parameterNames.enabled": "all",
"oxc.fmt.configPath": ".oxfmtrc.json",
"editor.defaultFormatter": "oxc.oxc-vscode",
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "file",
"oxc.enable": true,
"[astro]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"prettier.requireConfig": true,
"eslint.validate": [
"astro",
]
}

36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
# WebDev-Website
# WebDev-Website

## Development

### Pre-requisites

- Install Docker [(Confluence Guide)](https://ubcagrobotappliedai.atlassian.net/wiki/spaces/SysArch/pages/95649821/Docker+Pre-requisites)
- Use the built-in devcontainer configuration [(Confluence Guide)](https://ubcagrobotappliedai.atlassian.net/wiki/spaces/SysArch/pages/55771137/VSCode+Dev+Containers+Guide)

### Local Development

To run the live-reload server locally:

```bash
bun run dev
```

### Commiting

The process of submitting changes to this repository are as follows:

1. Make a branch and link it to the issue you are working on from the [board](https://github.com/UBCAgroBot/ubcagrobot.github.io/issues)

2. Run the following commands before commiting your changes to the git branch:

```bash
bun run fmt
bun run lint
```

3. Make code changes and commit using [convential commit](https://www.conventionalcommits.org/en/v1.0.0/) style. For example, if you made a change to the projects page to fix a bug then your commit may look like the following:

```bash
bug(projects): Change thing to fix x issue.
```
471 changes: 461 additions & 10 deletions bun.lock

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import eslintPluginAstro from "eslint-plugin-astro";

export default [
...eslintPluginAstro.configs.recommended,
...eslintPluginAstro.configs["jsx-a11y-recommended"],
];
8 changes: 6 additions & 2 deletions lefthook.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
assert_lefthook_installed: true
colors: false

pre-commit:
jobs:
- name: format
run: bun run fmt
stage_fixed: true

- name: lint
run: bun run lint
stage_fixed: true
Expand All @@ -20,9 +21,12 @@ pre-push:
jobs:
- name: check fmt
run: bun run fmt:check
fail_text: "Format check failed, run `bun run fmt`"

- name: check lint
run: bun run lint:check
fail_text: "Lint check failed, run `bun run lint`"

- name: check build
run: bun run build:check
run: bun run build:check
failt_text: "Build check failed, run `bun run build:check`"
17 changes: 12 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
"dev": "astro dev --open",
"build": "astro build",
"build:check": "astro check",
"lint": "oxlint --fix",
"lint:check": "oxlint --quiet",
"fmt": "oxfmt --write",
"fmt:check": "oxfmt --check"
"lint": "oxlint --fix && eslint \"**/*.astro\" --fix",
"lint:check": "oxlint --quiet && eslint \"**/*.astro\"",
"fmt": "oxfmt --write . && prettier \"**/*.astro\" --write --log-level warn",
"fmt:check": "oxfmt --check && prettier \"**/*.astro\" --check --log-level warn"
},
"prepare": "lefthook install",
"dependencies": {
Expand All @@ -23,9 +23,16 @@
},
"devDependencies": {
"@astrojs/check": "^0.9.6",
"@typescript-eslint/parser": "^8.54.0",
"eslint": "^9.39.2",
"eslint-plugin-astro": "^1.5.0",
"eslint-plugin-jsx-a11y": "^6.10.2",
"lefthook": "^2.0.16",
"oxfmt": "^0.27.0",
"oxlint": "^1.42.0",
"prettier": "^3.8.1",
"prettier-plugin-astro": "^0.14.1",
"prettier-plugin-tailwindcss": "^0.7.2",
"typescript": "^5.9.3"
}
}
}
Loading