- TypeScript 83.9%
- Vue 14.9%
- CSS 0.7%
- Shell 0.2%
- HTML 0.2%
- Other 0.1%
| cli | pnpm: update root and cli with 'pnpm update' | |
| common | ui: try making text smaller on small devices | |
| web | train: fix priority mode and implement 2 shuffle modes | |
| .eslintrc.cjs | eslint: move .eslintrc.cjs from web/ to . | |
| .gitignore | pnpm: update root and cli with 'pnpm update' | |
| dev.sh | pnpm: update root and cli with 'pnpm update' | |
| package.json | npm: run pnpm update vitest | |
| pnpm-lock.yaml | pnpm: update root and cli with 'pnpm update' | |
| pnpm-workspace.yaml | build: save some old existing files | |
| README.md | readme: improve cli package desc and conventions | |
| tsconfig.json | ts: add root tsconfig.json with strict=false, fix useless ?? operator | |
Frontend
This repository is a monorepos with everything related to the frontend part of Delibay (everything in JS/TS/Vue). This structure enables sharing common code like parsing logic, training Vue components, UI style, across the web interface, the vscode extension, the parser, ...
Structure
Here is the list of PNPM packages and their goal:
| Folder | Goal |
|---|---|
common |
Common code shared to other packages. Shared Vue components like ExoShow.vue, the parser logic like exos.ts, the basic UI like ui.css and logic like browsing.ts |
cli |
The CLI used to wrap parser logic for the backend and provide other actions to manage a Delibay course |
web |
The web interface deployed on app.delibay.org |
Conventions
- Every package is built with PNPM and has a
buildandtestcommand. Running these commands in the root will run them in all packages. - The
commonpackage is the only package used by other packages - packages must be independant so reusing code MUST not be done directly by escaping the folder like
import { something } from "../otherpackage/somefile.js"
Common code reuse
Components under common/components are styled with TailwindCSS and are built by the packages that use them. To configure these packages, this is not trivial, here is some notes for future setup.
In the VueJS entry point (generally main.ts), we import our own css and the builded common UI style.
import "./assets/main.css";
import "common/dist/ui.css";
In this case ./assets/main.css will contain the basic tailwind css as the common UI doesn't include it.
@tailwind base;
@tailwind components;
@tailwind utilities;
/** More custom style if needed */
This UI has to be built when files in common/ui/ have changed. Just use pnpm build or pnpm watch inside common.
As TailwindCSS classes used in our common components have to be picked by the package build, we still need to add this third line to tailwind.config.js to make it watch the correct vue files.
content: [
"./index.html",
"./src/**/*.{vue,js,ts,jsx,tsx}",
"./node_modules/common/**/*.vue",
],