@imfusion/web-ui 0.10.1-dev.11.g9f5bc06e → 0.10.1-dev.13.g0d178239

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -34,6 +34,16 @@
34
34
  `defaultOptions`, where it blocked invalidation refetches.
35
35
  - `imf-web-ui-conventions` puts a route's own views, forms, hooks, and tests in a `-<file-name>/` folder beside the route
36
36
  file, and reserves `partials/` for parts that more than one route uses.
37
+ - `imf-web-ui-conventions` lifts a value into a custom property on the component's root only when it repeats within that
38
+ stylesheet or a state or variant changes several descendants. A value that only recurs across files stays a literal in
39
+ each, and a shared component owns it when those files show one design element.
40
+ - `imf-web-ui-conventions` exempts TanStack options factories (`queryOptions`, `mutationOptions`) from the explicit return
41
+ type on exported functions, since spelling it out loses the typed query key.
42
+ - `imf-web-ui-conventions` keeps the Git hooks in `.vite-hooks/` and installs the Vite+ dispatcher with `vp config` from
43
+ `git:config`.
44
+ - CI and verification — Nikolaus Brunner <brunner@imfusion.com>
45
+ - The Git hooks live in `.vite-hooks/` and run through the Vite+ hook dispatcher, which `npm run git:config` installs.
46
+ Existing clones and worktrees rerun `npm run git:config`; until then their hooks do not run.
37
47
  - Components ([WEBSDK-247](https://imfusion.atlassian.net/browse/WEBSDK-247)) — Nikolaus Brunner <brunner@imfusion.com>
38
48
  - The AppShell navbar drawer, `Code`, and `ImageDisplayOptions` scroll in a `ScrollArea`, with its overlay thumb and edge
39
49
  fades.
package/README.md CHANGED
@@ -65,8 +65,10 @@ npm install
65
65
  npm run git:config
66
66
  ```
67
67
 
68
- `git:config` sets the tracked hooks path, enables rebase pulls, and requires fast-forward merges. Every checkout and worktree
69
- needs its own `node_modules`; the hooks stop with "run npm ci" without one.
68
+ The hooks are tracked in `.vite-hooks/`. `git:config` installs the Vite+ hook dispatcher into the git-ignored
69
+ `.vite-hooks/_/` and points the hooks path at it, enables rebase pulls, and requires fast-forward merges. Every checkout and
70
+ worktree needs its own `node_modules` and dispatcher, so run `npm ci` and `npm run git:config` in each; without the
71
+ dispatcher the hooks do not run at all.
70
72
 
71
73
  The pre-commit hook runs `vp staged` against the staged state: it lints and format-checks the repository, checks that every
72
74
  generated `*.gen.*` file matches its sources (`npm run verify:generated`), and runs the pinned-dependency, Knip, type-check,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@imfusion/web-ui",
3
- "version": "0.10.1-dev.11.g9f5bc06e",
3
+ "version": "0.10.1-dev.13.g0d178239",
4
4
  "description": "The official Web UI component library for ImFusion web apps",
5
5
  "author": "ImFusion GmbH",
6
6
  "homepage": "https://imfusion.com",
@@ -95,7 +95,7 @@
95
95
  "skills:eval:compare": "tsx src/llms/evals/runner/compare.ts",
96
96
  "skills:eval:affected": "tsx src/llms/evals/runner/affected.ts",
97
97
  "skills:eval:report": "tsx src/llms/evals/runner/report.ts",
98
- "git:config": "git config core.hooksPath .githooks && git config pull.rebase true && git config merge.ff only"
98
+ "git:config": "git config core.hooksPath .vite-hooks/_ && vp config --no-agent && git config pull.rebase true && git config merge.ff only"
99
99
  },
100
100
  "peerDependencies": {
101
101
  "@imfusion/sdk": "*",
@@ -7,12 +7,15 @@ Use the repository's tracked configuration and keep verification scopes clear.
7
7
  Run once in a clone:
8
8
 
9
9
  ```sh
10
- git config core.hooksPath .githooks
10
+ git config core.hooksPath .vite-hooks/_
11
+ vp config --no-agent
11
12
  git config pull.rebase true
12
13
  git config merge.ff only
13
14
  ```
14
15
 
15
- The hooks are tracked in `.githooks/`. Check both the Git setting and the directory; a missing hook path fails silently.
16
+ Vite+ manages the hooks. The hook scripts are tracked in `.vite-hooks/`; `vp config` installs the dispatcher into the
17
+ git-ignored `.vite-hooks/_/`. `vp config` leaves a `core.hooksPath` that points elsewhere alone, so set it first. Every clone
18
+ and worktree needs its own dispatcher. Check both with `vp hooks status`; a missing dispatcher skips the hooks silently.
16
19
 
17
20
  ## Verify scopes
18
21
 
@@ -9,7 +9,9 @@ Use native CSS and Web UI's public seams. The library's CSS Modules and token na
9
9
  - Nest states, pseudo-elements, and child selectors under the root.
10
10
  - Write declarations before nested rules; browsers before Chrome 130, Firefox 132, and Safari 18 move later ones above them.
11
11
  - Do not nest under a selector list whose selectors differ in specificity. The nested rule takes the highest one.
12
- - Lift repeated values into custom properties, especially when a state or variant changes several descendants.
12
+ - Lift a value into a custom property on the component's root when it repeats within that stylesheet, or when a state or
13
+ variant changes several descendants. A value that only recurs across files stays a literal in each; when those files show
14
+ one design element, a shared component owns it. Never define component values on `:root`.
13
15
  - Keep structurally different rules explicit; not every repeated value needs an abstraction.
14
16
 
15
17
  ```css
@@ -49,7 +49,7 @@ from `vite-plus/test`. It needs Node `^22.22.1 || ^24.11 || >=26` and Git 2.32 o
49
49
  `vp <command>` is a built-in; `vp run <script>` runs a package script.
50
50
 
51
51
  Move an existing Vite, Vitest, ESLint, or Prettier project with `vp migrate --no-hooks` (`vp help migrate` lists its
52
- options), then check the result against this topic. The hook lives in `.githooks/`, as `git.md` describes.
52
+ options), then check the result against this topic. The hook lives in `.vite-hooks/`, as `git.md` describes.
53
53
 
54
54
  ## Oxfmt
55
55
 
@@ -106,7 +106,7 @@ Use strict TypeScript with bundler module resolution, `verbatimModuleSyntax`, un
106
106
 
107
107
  ## Pre-commit checks
108
108
 
109
- `.githooks/pre-commit` runs `vp staged --hide-unstaged --fail-on-changes --revert --diff-filter=ACMRD` with `set -e`. Those
109
+ `.vite-hooks/pre-commit` runs `vp staged --hide-unstaged --fail-on-changes --revert --diff-filter=ACMRD` with `set -e`. Those
110
110
  flags make the checks see only the staged state, include deletion-only commits, fail the commit when a check would change a
111
111
  file, and restore the tree afterwards, so the hook never rewrites or stages files. The `staged` block in `vite.config.ts` is
112
112
  a function returning path-free commands such as `npm run --silent verify:lint`, so each project-wide check runs once. Use
@@ -6,6 +6,8 @@ Prefer pure functions, immutable values, and side effects at the edges.
6
6
 
7
7
  - Do not use `any`. Accept `unknown` at an untrusted boundary and narrow it.
8
8
  - Infer local values; give exported functions explicit return types.
9
+ - TanStack options factories (`queryOptions`, `mutationOptions`, and similar) return their helper's inferred type. Spelling
10
+ it out loses the typed query key (`DataTag`) or repeats the helper's own generics.
9
11
  - Model states directly instead of filling a nullable value later.
10
12
  - Derive types from their source. Use `z.infer` for schemas and `React.ComponentProps` for Web UI components.
11
13
  - Avoid `as`. Keep an assertion only at an untyped third-party boundary where it is the honest boundary.