feat(devex): add a unified just command surface
- Command surface: - add a root `Justfile` with namespaced `api`, `ui`, and `release` modules so humans and agents can use the same entrypoints from the repo root - add project-local Justfiles for `booklore-api`, `booklore-ui`, and `tools/release` so each area remains self-contained and can still be driven from inside its own directory - standardize local developer workflows around `just check`, `just test`, `just api run`, `just ui dev`, `just db-up`, and `just image-build` - Workflow integration: - update the reusable test suite workflow to install `just` and run backend and frontend CI steps through the Justfiles instead of hardcoded shell commands - update the semantic-release workflows to install `just` and invoke release tooling via `just release install`, `just release preview`, and `just release run` - keep the Docker image publication workflows on the native Docker actions while moving the project-command logic into the canonical command surface - Documentation: - split backend and frontend implementation guidance into `booklore-api/README.md`, `booklore-api/CONTRIBUTING.md`, `booklore-ui/README.md`, and `booklore-ui/CONTRIBUTING.md` - simplify the top-level `README.md` and `CONTRIBUTING.md` so they stay focused on overview, policy, and navigation while pointing to component-specific guides for deeper detail - align contributor-facing examples on the `just` interface instead of mixing ad hoc Gradle, npm, Docker, and Compose commands - Developer environment: - add `mise.toml` to pin the expected Java and Node toolchain versions for local work - switch the development Compose defaults from the old Booklore database values to Grimmory-oriented defaults - keep the command layout ready for a future API/UI split without forcing that packaging change yet
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
# Contributing to Grimmory UI
|
||||
|
||||
This document covers frontend-specific development and review expectations for `booklore-ui`.
|
||||
|
||||
For repository-wide contribution policy, branch strategy, PR requirements, and release semantics, start with [../CONTRIBUTING.md](../CONTRIBUTING.md).
|
||||
|
||||
## Preferred Command Surface
|
||||
|
||||
Use [`Justfile`](Justfile) when possible:
|
||||
|
||||
```bash
|
||||
just # List frontend recipes
|
||||
just install # Install or update dependencies for local development
|
||||
just install-ci # Install dependencies exactly as CI does
|
||||
just dev # Start the local dev server
|
||||
just test # Run frontend tests
|
||||
just check # Run the standard local verification pass
|
||||
just lint # Run the frontend linter
|
||||
just build # Build the production bundle
|
||||
```
|
||||
|
||||
From the repository root, the same recipes are available through the `ui` namespace:
|
||||
|
||||
```bash
|
||||
just ui install
|
||||
just ui install-ci
|
||||
just ui dev
|
||||
just ui test
|
||||
just ui check
|
||||
just ui lint
|
||||
```
|
||||
|
||||
## Frontend Conventions
|
||||
|
||||
- Follow the Angular style guide.
|
||||
- All components are standalone. Do not add NgModules.
|
||||
- Use `inject()` for dependency injection instead of constructor injection.
|
||||
- Prefer PrimeNG components and project styling patterns over custom one-off UI primitives.
|
||||
- Use SCSS for styling and keep the visual language consistent with the existing application.
|
||||
- Use Transloco for user-facing strings. New strings belong under `src/i18n/`.
|
||||
- Keep UI changes responsive for desktop and mobile layouts.
|
||||
- Tests should use Vitest, not Karma or Jasmine.
|
||||
|
||||
## i18n and UI Copy
|
||||
|
||||
- Update all relevant locale files when adding or renaming translation keys.
|
||||
- Keep translation-key changes separate from bulk JSON reformatting whenever practical.
|
||||
- Prefer Grimmory naming for UI-visible labels and keys, while preserving compatibility shims only when they are still required by existing backend or migration behavior.
|
||||
|
||||
## Validation Before Opening a PR
|
||||
|
||||
Run the frontend checks locally before sending a PR:
|
||||
|
||||
```bash
|
||||
just install
|
||||
just check
|
||||
```
|
||||
|
||||
If your change affects layout, responsive behavior, or interaction design, also run the full stack locally and capture screenshots or a short screen recording for the PR.
|
||||
|
||||
If you specifically want to mirror the stricter CI dependency policy, run:
|
||||
|
||||
```bash
|
||||
just install-ci
|
||||
just ci-check
|
||||
```
|
||||
@@ -0,0 +1,61 @@
|
||||
set shell := ["bash", "-eu", "-o", "pipefail", "-c"]
|
||||
|
||||
npm := "npm"
|
||||
|
||||
# Show the frontend recipes available in this directory.
|
||||
help:
|
||||
@just --list
|
||||
|
||||
# Install or update frontend dependencies for local development.
|
||||
install:
|
||||
{{ npm }} install
|
||||
|
||||
# Install the frontend dependencies exactly as CI does.
|
||||
install-ci:
|
||||
{{ npm }} ci
|
||||
|
||||
# Run the Angular development server.
|
||||
dev:
|
||||
{{ npm }} run dev
|
||||
|
||||
# Run the Angular development server with the default `start` script.
|
||||
start:
|
||||
{{ npm }} start
|
||||
|
||||
# Build the production frontend bundle.
|
||||
build:
|
||||
{{ npm }} run build
|
||||
|
||||
# Build the frontend continuously in development mode.
|
||||
watch:
|
||||
{{ npm }} run watch
|
||||
|
||||
# Run the frontend test suite.
|
||||
test:
|
||||
{{ npm }} test
|
||||
|
||||
# Run the frontend tests with a coverage report.
|
||||
coverage:
|
||||
npx ng test --coverage
|
||||
|
||||
# Run the frontend linter.
|
||||
lint:
|
||||
{{ npm }} run lint
|
||||
|
||||
# Check the installed dependency tree.
|
||||
deps:
|
||||
{{ npm }} ls --depth=0
|
||||
|
||||
# Run a local dependency audit without forcing a CI-specific severity threshold.
|
||||
audit:
|
||||
{{ npm }} audit
|
||||
|
||||
# Run the stricter dependency audit used in CI.
|
||||
audit-ci:
|
||||
{{ npm }} audit --audit-level=critical
|
||||
|
||||
# Run the standard local frontend verification pass.
|
||||
check: deps lint test
|
||||
|
||||
# Run the frontend CI-style verification sequence from a clean install.
|
||||
ci-check: install-ci audit-ci deps lint test
|
||||
+49
-34
@@ -1,59 +1,74 @@
|
||||
# Grimmory
|
||||
# Grimmory UI
|
||||
|
||||
This project was generated using [Angular CLI](https://github.com/angular/angular-cli) version 19.0.2.
|
||||
The `booklore-ui` project is the Angular frontend for Grimmory. It owns the browser application, component styling, client-side routing, stateful UI interactions, and the compiled bundle that is packaged into the current production image.
|
||||
|
||||
## Development server
|
||||
## Stack
|
||||
|
||||
To start a local development server, run:
|
||||
- Angular 21
|
||||
- TypeScript
|
||||
- PrimeNG + PrimeIcons
|
||||
- Transloco for i18n
|
||||
- Vitest for unit tests
|
||||
- Angular ESLint
|
||||
|
||||
## Local Command Surface
|
||||
|
||||
Use [`Justfile`](Justfile) when possible. It is the primary frontend command surface for both humans and agents.
|
||||
|
||||
```bash
|
||||
ng serve
|
||||
just # List frontend recipes
|
||||
just install # Install or update dependencies for local development
|
||||
just install-ci # Install dependencies exactly as CI does
|
||||
just dev # Start the Angular dev server
|
||||
just test # Run the frontend test suite
|
||||
just check # Run the standard local verification pass
|
||||
just lint # Run the frontend linter
|
||||
just build # Build the production bundle
|
||||
```
|
||||
|
||||
Once the server is running, open your browser and navigate to `http://localhost:4200/`. The application will automatically reload whenever you modify any of the source files.
|
||||
|
||||
## Code scaffolding
|
||||
|
||||
Angular CLI includes powerful code scaffolding tools. To generate a new component, run:
|
||||
The repository root exposes the same recipes through the `ui` namespace:
|
||||
|
||||
```bash
|
||||
ng generate component component-name
|
||||
just ui install
|
||||
just ui install-ci
|
||||
just ui dev
|
||||
just ui test
|
||||
just ui check
|
||||
just ui lint
|
||||
```
|
||||
|
||||
For a complete list of available schematics (such as `components`, `directives`, or `pipes`), run:
|
||||
## Running Locally
|
||||
|
||||
```bash
|
||||
ng generate --help
|
||||
cd booklore-ui
|
||||
just install
|
||||
just dev
|
||||
```
|
||||
|
||||
## Building
|
||||
The development server runs on port `4200` by default.
|
||||
|
||||
To build the project run:
|
||||
## Build and Test
|
||||
|
||||
```bash
|
||||
ng build
|
||||
just build
|
||||
just check
|
||||
just test
|
||||
just coverage
|
||||
just lint
|
||||
```
|
||||
|
||||
This will compile your project and store the build artifacts in the `dist/` directory. By default, the production build optimizes your application for performance and speed.
|
||||
The production output is written to `dist/grimmory/` and is consumed by the backend packaging flow when building the all-in-one production image.
|
||||
|
||||
## Running unit tests
|
||||
Use `just ci-check` when you want the stricter CI-style flow from a clean install, including the severity-gated audit step.
|
||||
|
||||
To execute unit tests with the [Karma](https://karma-runner.github.io) test runner, use the following command:
|
||||
## UI-Specific Notes
|
||||
|
||||
```bash
|
||||
ng test
|
||||
```
|
||||
- This project uses standalone Angular components.
|
||||
- Dependency injection should use `inject()`.
|
||||
- Styling uses SCSS.
|
||||
- UI strings live in `src/i18n/`.
|
||||
- The current production bundle is still packaged into the backend jar during the root Docker build.
|
||||
|
||||
## Running end-to-end tests
|
||||
## More Detail
|
||||
|
||||
For end-to-end (e2e) testing, run:
|
||||
|
||||
```bash
|
||||
ng e2e
|
||||
```
|
||||
|
||||
Angular CLI does not come with an end-to-end testing framework by default. You can choose one that suits your needs.
|
||||
|
||||
## Additional Resources
|
||||
|
||||
For more information on using the Angular CLI, including detailed command references, visit the [Angular CLI Overview and Command Reference](https://angular.dev/tools/cli) page.
|
||||
Frontend-specific contributor rules and conventions live in [CONTRIBUTING.md](CONTRIBUTING.md).
|
||||
|
||||
Reference in New Issue
Block a user