@deslop/coding-standards 0.1.1088 → 0.1.1090

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/dist/install.js CHANGED
@@ -25485,7 +25485,7 @@ const runWith = (command, config) => {
25485
25485
  };
25486
25486
  //#endregion
25487
25487
  //#region package.json
25488
- var version = "0.1.1088";
25488
+ var version = "0.1.1090";
25489
25489
  //#endregion
25490
25490
  //#region src/install.ts
25491
25491
  const cli = pipe(make("deslop-coding-standards", {}, fnUntraced(function* () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deslop/coding-standards",
3
- "version": "0.1.1088",
3
+ "version": "0.1.1090",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/MP281X/deslop",
@@ -15,7 +15,7 @@ description: 'Use before editing a .tsx, .css or .html file, before building, mo
15
15
  - **One meaning.** Each element adds information, a distinct action or a relationship. One action has one control in one place. No heading, summary, badge or text restates what the screen already shows. Keyboard shortcuts and screen-reader labels are not repetition.
16
16
  - **Zero clicks.** What the task needs is visible: the important value, warning and next action never sit behind a menu, tab, hover or expand. Each frequent action is one click; a choice the app can make is not asked.
17
17
  - **Current work first.** The first viewport shows real content and the next action; completed work recedes without hiding.
18
- - **Range.** When the reference and the Taste rows leave the structure open, compare 2–3 structurally different solutions on the same data, including one with fewer controls; build only the chosen one. A website or a new kind of piece starts from three concepts that differ in structure or metaphor, not palette.
18
+ - **Range.** When the reference and the Taste rows leave the structure open, compare 2–3 structurally different solutions on the same data, including one with fewer controls. Present the survivors per orchestrator's Gate and build only the one the user chooses. A website or a new kind of piece starts from three concepts that differ in structure or metaphor, not palette.
19
19
  - **States.** List each screen's reachable states (empty, loading, partial, error, success, long content) before code. Never re-add an element the user removed or rename a visible term without a request.
20
20
 
21
21
  ## Hierarchy
@@ -34,6 +34,7 @@ Blur a capture: the primary content and next action still stand out.
34
34
  - **iOS.** The same shadcn look, carried by native iOS elements: the mobile theme's tokens for color, radius and type on SwiftUI primitives through `@expo/ui` (navigation, toolbars, search, lists, menus, swipe actions, sheets, SF Symbols) with their system sizes and behavior. Glass for controls and navigation, never content. Never draw a custom system control.
35
35
  - **Surfaces** take color, shadow and radius from the theme's tokens only, group by proximity before borders and give each edge one border owner.
36
36
  - **Flat.** Never a gradient, glow or blurred shadow, anywhere: screens, pages, videos and images use flat theme colors and even 1 px borders, never a colored stripe on one side.
37
+ - **Isometric figures.** A flat 3D figure that explains an idea follows `references/isometric.md`: a real machine, many small parts, four tones, painter's order, checked at 4× and in dark mode.
37
38
 
38
39
  - **Type.** The theme's semantic styles, at most five sizes per screen, prose 45–75 characters, tabular figures for changing numbers, middle truncation when the end distinguishes names.
39
40
  - **Alignment.** Few edges; headers share columns with rows; equivalent controls share size, icon style and hit target. Squashed icon: `shrink-0`. Vanishing trailing action: `min-w-0` on content. Empty optional slots render no orphan separators.
@@ -0,0 +1,70 @@
1
+ # Isometric and flat 3D figures
2
+
3
+ For an explanatory figure that shows one idea as a physical object in an isometric view. The source is the anatomy skill (MIT, https://github.com/wheresryan22/anatomy, commit e948829). Before a figure, read its `SKILL.md` ("The one idea that matters", "Craft rules", Workflow), `references/craft.md` (sections 2, 4, 5, 7) and `references/verify.md`. This file keeps the rules that carry to this repo and the repo rules that override the source.
4
+
5
+ ## The object is the explanation
6
+
7
+ - Invent a real machine whose working is the concept. Say in one sentence what moves and what the motion means (`SKILL.md`, Workflow step 3).
8
+ - Too abstract: "stacked plates, floating slabs or labelled boxes" (`SKILL.md`). Layers are allowed only with a working mechanism: drawers, trays in a rack, plates on guide pillars, cards in a holder (`craft.md`, "Abstract stacks").
9
+ - Too flat and bland: one slab with lines has no volume and no parts.
10
+ - Truth first (Workflow step 2): the readout, the motion and the caption all come from one model.
11
+ - Parts list before geometry (Workflow step 4): 40–80 parts for a Figure, 80–150 for a Hero. An Epic: propose a Hero, and build the Epic only when the user chooses it (`SKILL.md`, Workflow step 1).
12
+ - Two looks: at 1× one clear machine; at 4× something true in every region. Check at 4× last and add the missing real parts (`SKILL.md`, "Check it last").
13
+
14
+ ## Tones and lines
15
+
16
+ - Four side tones by facing plus a lighter top, from `extrude` (`SKILL.md`, "Let the kit shade"). Use `flat` only for floors and inlays thinner than one unit.
17
+ - Tone hierarchy is separate from facing: base `lo`, structure `mid`, the subject `hi`, exactly one `lit` (`craft.md`, section 4). Monochrome unless colour is the subject.
18
+ - Curved surfaces are smooth-shaded, never a staircase of flat tone blocks (`SKILL.md`, "Curved surfaces shade smoothly"). A texture that must end stops on a real edge (`verify.md`, "No abrupt texture ends"). Fades are not used here: they need the gradient that Flat bans (design's Build, Flat).
19
+ - Every line ends on a face, another line or a terminal dot (`SKILL.md`, "Lines resolve"). Exempt: `free` rule lines that stand for printed text, a needle's tail and a pointer's tip (`verify.md`, "Line ends").
20
+ - Text a machine displays fits its window at its widest string and is clipped to it (`verify.md`, Checklist).
21
+
22
+ ## Painter's order and pass-through
23
+
24
+ - Draw back to front, bottom to top. A part that wraps another is split into a back half and a front half (`craft.md`, section 5).
25
+ - A vertical part through a horizontal one is drawn in two segments, below and above, with the block painted between them. A full ring over a cylinder that continues shows its back half: use the front arc only (`verify.md`, "Common faults").
26
+ - Nothing passes through anything. The audit's `clearance`, `through` and `sunk` lines prove it when `kit/audit.mjs` runs (see Verify).
27
+
28
+ ## Projection
29
+
30
+ The kit's `iso()` at azimuth 45°, elevation 30°, z up. `k = scale × √1.6` (the kit's `UNIT`):
31
+
32
+ ```ts
33
+ const k = scale * Math.sqrt(1.6)
34
+ const project = ([x, y, z]: readonly [number, number, number], [ox, oy]: readonly [number, number]) => [
35
+ ox + (x - y) * Math.SQRT1_2 * k,
36
+ oy + ((x + y) * Math.SQRT1_2 * 0.5 - z * (Math.sqrt(3) / 2)) * k
37
+ ]
38
+ // project([1, 0, 0], [10, 20]) at scale 1 → [10.894, 20.447], the kit's iso() with origin [10, 20]
39
+ // visible sides: +x on the right, +y on the left, top
40
+ ```
41
+
42
+ Fit once over the largest state: `fitProjection(points, width, height, { pad })` (`kit/iso-kit.mjs`) returns `{ origin, scale, azimuth, elevation }`. Pass that origin and scale to `project`, so the figure never rescales while it moves.
43
+
44
+ ## Motion
45
+
46
+ From `references/motion.md` (the source's rules, which this repo follows):
47
+
48
+ - Time-based: `dt` from `requestAnimationFrame`, clamped to 1/30 s. Pointer and keyboard set a target; the part eases to it, never snaps.
49
+ - One loop per figure; write `setAttribute` and `textContent` through refs, never a React render per frame.
50
+ - Stop offscreen: `IntersectionObserver` with `rootMargin: "120px 0px"`, reading `entries[entries.length - 1]`.
51
+ - Idle tour (interactive figures only): after about 1.4 s; pause on hover, focus or press; resume about 3.6 s after the last interaction. On an explanatory page the design skill's Pages rule governs instead: motion plays, stops on its final state and replays on request.
52
+ - Reduced motion: no tour, no flow or pulse, jump to targets. The figure still responds to input.
53
+ - Keyboard: focusable root, arrows step, Home and End go to the extremes, Space or Enter presses, Escape releases. `aria-valuetext` says the state in words. Focus ring: `outline: 1px solid` with `outline-offset: 6px`.
54
+
55
+ The repo's motion limits in the design skill (Build, "Motion") also apply.
56
+
57
+ ## Verify
58
+
59
+ Capture each of these and read every PNG (`verify.md`, "Capture"):
60
+
61
+ - Each resting state: assembled and apart, the sliding extremes, hover, focus, and intermediate frames during motion (`--times`, `--hover`, `--key`, `--reduced`).
62
+ - Desktop at 1×, phone at 390 px, and a 4× close-up of every junction in both themes.
63
+ - Dark-mode invariant: in both themes each top face is lighter than every side. A top mixed from the foreground goes dark in dark mode, which inverted the tones in this repo's first figure. `verify.md` says "Sides shaded and tops lighter".
64
+ - Geometry: `node build.mjs --audit` ends `audit passed` and `node scripts/lines.mjs page.html` prints `line ends: 0` (`verify.md`, "Audit" and "Line ends"). Both need `kit/` and `scripts/` from `/tmp/repos/anatomy`, which this repo does not vendor. Without them the figure is visually inspected only: the PR says the geometry and line checks are unproved, never that the figure is proven.
65
+
66
+ ## Repo rules that override the source
67
+
68
+ - Figure tones are theme tokens in `packages/components-web/src/theme.css` (design's Build, Theme).
69
+ - A card with `Fig n`, title, hint and readout (`SKILL.md`, Workflow step 8) frames a standalone explanatory figure only; AGENTS.md's "pages add no cards" governs pages.
70
+ - Flat (design's Build, Flat) applies to every figure, including the source's blurred halo under the base, which is not used here.