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
13 changes: 6 additions & 7 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@ RUN \
&& apk add \
git \
git-zsh-completion \
sudo \
shadow \
zsh \
zsh-completions \
&& echo node ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/node \
&& chmod 0440 /etc/sudoers.d/node \
&& chsh -s /bin/zsh node \
&& sed -i '/^node:/s|/bin/ash|/bin/zsh|' /etc/passwd \
&& corepack enable \
&& mkdir -p /workspaces/fluidd/node_modules /workspaces/fluidd/.pnpm-store \
&& chown -R node:node /workspaces/fluidd \
&& rm -f /etc/apk/cache/* /root/.cache

Comment thread
pedrolamas marked this conversation as resolved.
USER node
WORKDIR /workspaces/fluidd

RUN \
sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)"
RUN sh -c "$(wget https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh -O -)" "" --unattended
Comment thread
pedrolamas marked this conversation as resolved.
20 changes: 18 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,19 @@
"service": "fluidd",
"workspaceFolder": "/workspaces/fluidd",
"forwardPorts": [7125, 8080],
"portsAttributes": {
"7125": {
"label": "Moonraker",
"onAutoForward": "silent"
},
"8080": {
"label": "mjpg-streamer",
"onAutoForward": "silent"
}
},
"features": {
},
"postCreateCommand": "npm ci && npm run bootstrap",
"postCreateCommand": "pnpm i --frozen-lockfile && pnpm run bootstrap",
"customizations": {
"vscode": {
"extensions": [
Expand All @@ -29,7 +39,13 @@
},
"i18n-ally.localesPaths": [
"src/locales"
]
],
"terminal.integrated.defaultProfile.linux": "zsh",
"terminal.integrated.profiles.linux": {
"zsh": {
"path": "/bin/zsh"
}
}
}
}
},
Expand Down
6 changes: 6 additions & 0 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,15 @@ services:
context: ./
volumes:
- ..:/workspaces/fluidd/:cached
- node-modules:/workspaces/fluidd/node_modules
- pnpm-store:/workspaces/fluidd/.pnpm-store
Comment thread
pedrolamas marked this conversation as resolved.
command: sleep infinity
Comment thread
pedrolamas marked this conversation as resolved.
network_mode: service:klipper-simulavr

klipper-simulavr:
image: ei99070/docker-klipper-simulavr:latest
restart: unless-stopped

volumes:
node-modules:
pnpm-store:
19 changes: 12 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,35 +20,40 @@ jobs:
- name: Checkout
uses: actions/checkout@v6

- name: Setup pnpm
uses: pnpm/action-setup@v6
with:
run_install: false

- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 24
cache: 'npm'
cache: 'pnpm'

- name: Install dependencies
run: |
npm ci
pnpm i --frozen-lockfile

- name: Run lint
run: |
npm run lint -- --no-fix
pnpm run lint --no-fix
Comment thread
pedrolamas marked this conversation as resolved.

- name: Run type check
run: |
npm run type-check
pnpm run type-check

- name: Run tests
run: |
npm run test:unit
pnpm run test:unit

- name: Run circular references check
run: |
npm run circular-check
pnpm run circular-check

- name: Build
run: |
npm run build
pnpm run build

- name: Upload fluidd.zip
uses: actions/upload-artifact@v7
Expand Down
19 changes: 12 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,35 +13,40 @@ jobs:
- name: Checkout
uses: actions/checkout@v6

- name: Setup pnpm
uses: pnpm/action-setup@v6
with:
run_install: false

- name: Setup Node
uses: actions/setup-node@v6
with:
node-version: 24
cache: 'npm'
cache: 'pnpm'

- name: Install dependencies
run: |
npm ci
pnpm i --frozen-lockfile

- name: Run lint
run: |
npm run lint -- --no-fix
pnpm run lint --no-fix
Comment thread
pedrolamas marked this conversation as resolved.

- name: Run type check
run: |
npm run type-check
pnpm run type-check

- name: Run tests
run: |
npm run test:unit
pnpm run test:unit

- name: Run circular references check
run: |
npm run circular-check
pnpm run circular-check

- name: Build
run: |
npm run build
pnpm run build

- name: Create Artifact
run: |
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.DS_Store
node_modules
.pnpm-store
/dist
/dev-dist

Expand Down
18 changes: 8 additions & 10 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
FILES_TO_LINT=$(git diff --cached --name-only --diff-filter=ACMR | grep -iE "\.(js|mjs|ts|vue)$" || true)

if [ -n "$FILES_TO_LINT" ]; then
npx --no eslint -- --max-warnings 0 $FILES_TO_LINT
fi

FILES_TO_OPTIMIZE_SVG=$(git diff --cached --name-only --diff-filter=ACMR | grep -iE "^src\/globals\.ts$|\.(vue|svg)$" || true)

if [ -n "$FILES_TO_OPTIMIZE_SVG" ]; then
node tools/svgo.mjs $FILES_TO_OPTIMIZE_SVG
git diff --cached --name-only --diff-filter=ACMR -z \
| grep -izE '\.(js|mjs|ts|vue)$' \
| xargs -0 -r pnpm exec eslint --max-warnings 0

if git diff --cached --name-only --diff-filter=ACMR | grep -iqE '^src/globals\.ts$|\.(vue|svg)$'; then
git diff --cached --name-only --diff-filter=ACMR -z \
| grep -izE '^src/globals\.ts$|\.(vue|svg)$' \
| xargs -0 -r node tools/svgo.mjs
Comment thread
pedrolamas marked this conversation as resolved.
Comment thread
pedrolamas marked this conversation as resolved.
Comment thread
pedrolamas marked this conversation as resolved.

git update-index --again
fi
20 changes: 10 additions & 10 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,35 +3,35 @@
"tasks": [
{
"label": "Serve",
"type": "npm",
"script": "serve",
"type": "shell",
"command": "pnpm run dev",
"problemMatcher": [
Comment thread
pedrolamas marked this conversation as resolved.
"$vite"
],
"isBackground": true
},
{
"label": "Build",
"type": "npm",
"script": "build",
"type": "shell",
"command": "pnpm run build",
"problemMatcher": []
},
{
"label": "Type check",
"type": "npm",
"script": "type-check",
"type": "shell",
"command": "pnpm run type-check",
"problemMatcher": []
},
{
"label": "Circular reference check",
"type": "npm",
"script": "circular-check",
"type": "shell",
"command": "pnpm run circular-check",
"problemMatcher": []
},
{
"label": "Lint",
"type": "npm",
"script": "lint",
"type": "shell",
"command": "pnpm run lint",
"problemMatcher": []
}
]
Expand Down
26 changes: 13 additions & 13 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,22 +70,22 @@ export default class PrinterWidget extends Mixins(StateMixin) {
- **`unplugin-vue-components/rolldown`** — auto-imports components from `src/components/common|layout|ui`
- **`sass-embedded`** — SCSS preprocessor (variables auto-injected via `@/scss/variables`)
- **vitest v4** — unit test runner (jsdom environment)
- **`commit-and-tag-version`** — release versioning (`npm run release`)
- **`commit-and-tag-version`** — release versioning (`pnpm run release`)
- **ESLint flat config** (`eslint.config.mjs`) — enforced at dev time via `vite-plugin-checker` with `useFlatConfig: true`
- **`vite-plugin-checker`** — runs vue-tsc and ESLint during dev (disabled at build time)
- **`skott`** — circular dependency detection (`npm run circular-check`)
- **`skott`** — circular dependency detection (`pnpm run circular-check`)
- **ES2020 lib target** (`tsconfig.app.json`) — no ES2021+ built-ins without polyfills

### Essential Commands

```bash
npm run bootstrap # Install git hooks (after clone)
npm run dev # Start development server (port 8080)
npm run build # Production build
npm run type-check # TypeScript validation (vue-tsc)
npm run lint # ESLint with Vue/TS rules
npm run test # Vitest unit tests
npm run circular-check # Check for circular dependencies
pnpm run bootstrap # Install git hooks (after clone)
pnpm run dev # Start development server (port 8080)
pnpm run build # Production build
pnpm run type-check # TypeScript validation (vue-tsc)
pnpm run lint # ESLint with Vue/TS rules
pnpm run test # Vitest unit tests
pnpm run circular-check # Check for circular dependencies
```

### File Organization
Expand Down Expand Up @@ -174,7 +174,7 @@ src/

## Code Style

- Source must pass linting with **zero warnings and zero type errors** — run `npm run lint` and `npm run type-check` before committing
- Source must pass linting with **zero warnings and zero type errors** — run `pnpm run lint` and `pnpm run type-check` before committing
- Vue class-style components with `vue-property-decorator` (`@Component`, `@Prop`, `@VModel`, `Mixins()`)
- ESLint enforced: `neostandard` + `pluginVue.configs['flat/vue2-recommended']` + `pluginRegexp` + `@vue/eslint-config-typescript`
- `.editorconfig` rules: 2 spaces, LF line endings, UTF-8, trim trailing whitespace, max line 100 (code)
Expand Down Expand Up @@ -204,7 +204,7 @@ src/
- **PR branches** must be off a branch other than `develop` or `master`
- **Clean develop** preferred: squash and rebase feature branches prior to merge
- **CHANGELOG visibility**: only `feat`, `fix`, `perf`, `refactor` appear in `CHANGELOG.md` (configured in `.versionrc.json`)
- **CI pipeline order**: `npm ci` → `lint --no-fix` → `type-check` → `test:unit` → `circular-check` → `build`
- **CI pipeline order**: `pnpm i --frozen-lockfile` → `lint --no-fix` → `type-check` → `test:unit` → `circular-check` → `build`
Comment thread
pedrolamas marked this conversation as resolved.

## Common Gotchas

Expand All @@ -225,7 +225,7 @@ src/
## Dev Container

- VSCode Dev Container (`.devcontainer/`) bundles a `docker-klipper-simulavr` container — real Klipper/Moonraker simulation on port 7125, Fluidd on port 8080
- `postCreateCommand` runs `npm ci && npm run bootstrap` automatically
- `postCreateCommand` runs `pnpm i --frozen-lockfile && pnpm run bootstrap` automatically

## Documentation Site

Expand All @@ -238,7 +238,7 @@ src/
- Lint: `markdownlint --config docs/.markdownlint.json docs/docs/`
- Install: `cd docs && python3 -m venv .venv && source .venv/bin/activate && pip install -r requirements.txt`
- Build: `cd docs && zensical build --clean`
- Serve: `cd docs && zensical serve` or `npm run serve:docs` (localhost:8000)
- Serve: `cd docs && zensical serve` or `pnpm run serve:docs` (localhost:8000)
- Deploy: GitHub Actions (`.github/workflows/docs.yml`) — builds on push to `master`, uploads Pages artifact via `actions/upload-pages-artifact`, deploys via `actions/deploy-pages`

### Documentation Structure
Expand Down
13 changes: 7 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ tour of the codebase, see the

- Read the [Development guide](https://docs.fluidd.xyz/development/) — it covers the
Dev Container, running Fluidd locally, and a quick architecture overview.
- After cloning, run `npm ci && npm run bootstrap` to install dependencies and set up
the Git hooks that pre-validate your commits.
- After cloning, run `pnpm i --frozen-lockfile && pnpm run bootstrap` to install dependencies and set up
the Git hooks that pre-validate your commits. If you don't have pnpm yet, run `corepack enable`
first — see the [Development guide](https://docs.fluidd.xyz/development/) for details.

## Branching and pull requests

Expand Down Expand Up @@ -50,12 +51,12 @@ Source must pass linting and type-checking with **zero warnings and zero type er
Before pushing, run:

```bash
npm run lint
npm run type-check
npm run test
pnpm run lint
pnpm run type-check
pnpm run test
```

CI runs the same checks (plus `npm run circular-check` and a production build) on
CI runs the same checks (plus `pnpm run circular-check` and a production build) on
every pull request.

## Translations
Expand Down
24 changes: 20 additions & 4 deletions docs/docs/development.md
Original file line number Diff line number Diff line change
Expand Up @@ -168,20 +168,36 @@ Check that Node.js was installed properly:

```bash
node --version
npm --version
```

### Enable pnpm

Fluidd uses [pnpm](https://pnpm.io/) as its package manager. The required version
is pinned in `package.json` via the `packageManager` field, and
[Corepack](https://nodejs.org/api/corepack.html) (bundled with Node.js) will
install and run that exact version automatically — just enable it once:

```bash
corepack enable
```

Verify that pnpm resolves correctly:

```bash
pnpm --version
```

### Install dependencies

```bash
cd .../path/to/fluidd
npm ci
pnpm i --frozen-lockfile
```

### Run a local development server

```bash
npm run dev
pnpm run dev
```

Browse to [http://localhost:8080/](http://localhost:8080/) and type in the URL
Expand All @@ -190,7 +206,7 @@ of your Moonraker instance, e.g. `http://192.168.0.101:7125`.
### Run unit tests

```bash
npm run test
pnpm run test
```

## Running the documentation site locally
Expand Down
Loading