@jsenv/navi 0.27.80 → 0.27.82
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/jsenv_navi.js +16 -5
- package/dist/jsenv_navi.js.map +2 -2
- package/docs/AI_INSTRUCTIONS.md +31 -11
- package/package.json +1 -1
package/docs/AI_INSTRUCTIONS.md
CHANGED
|
@@ -1,12 +1,31 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @jsenv/navi — context for AI assistants
|
|
2
2
|
|
|
3
|
-
This file
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
the original source. Don't infer usage or edit behavior from reading it
|
|
7
|
-
directly; treat it as an implementation detail.
|
|
3
|
+
This file gives context for using `@jsenv/navi` as intended, useful whether
|
|
4
|
+
you're reading the source directly or the built `dist/jsenv_navi.js` (e.g.
|
|
5
|
+
inside `node_modules/@jsenv/navi/`).
|
|
8
6
|
|
|
9
|
-
|
|
7
|
+
`dist/jsenv_navi.js` is the bundled build of navi's actual source, not an
|
|
8
|
+
opaque blob — JSDoc comments on individual functions/exports are preserved
|
|
9
|
+
and carry real, useful information. What's lost in bundling is only
|
|
10
|
+
file-level comments and anything attached to an import/re-export statement
|
|
11
|
+
(the bundler only keeps a comment that sits directly above a declaration it
|
|
12
|
+
retains as-is).
|
|
13
|
+
|
|
14
|
+
## Library, but also a framework
|
|
15
|
+
|
|
16
|
+
Navi is a library in the sense that every export is independently usable —
|
|
17
|
+
pick just `stateSignal` or just `Table` if that's all you need, no
|
|
18
|
+
all-or-nothing adoption required.
|
|
19
|
+
|
|
20
|
+
But it's also meant as a framework: it provides low-level primitives for
|
|
21
|
+
things most apps otherwise reinvent inconsistently — routing, async data
|
|
22
|
+
lifecycle, CSS layering/design tokens, focus/keyboard handling, and more.
|
|
23
|
+
When building something Navi already has a primitive for, prefer that
|
|
24
|
+
primitive over a custom one, even if the custom one would be quicker to
|
|
25
|
+
write for this one case — the value of using Navi as a framework comes from
|
|
26
|
+
consistency across the app, not from any single call site.
|
|
27
|
+
|
|
28
|
+
## More context, if the JSDoc on what you're using isn't enough
|
|
10
29
|
|
|
11
30
|
- `README.md` (package root) — high-level overview of what Navi provides:
|
|
12
31
|
routing, actions, layout (`Box`), typography, icons, forms/validation,
|
|
@@ -17,8 +36,8 @@ directly; treat it as an implementation detail.
|
|
|
17
36
|
- `docs/MOBILE_LAYOUT_PITFALLS.md` — mobile-specific layout gotchas (viewport
|
|
18
37
|
units, virtual keyboard, safe areas).
|
|
19
38
|
- Source code on GitHub: https://github.com/jsenv/core/tree/main/packages/frontend/navi/src
|
|
20
|
-
—
|
|
21
|
-
|
|
39
|
+
— worth checking if the JSDoc on an export genuinely doesn't answer your
|
|
40
|
+
question.
|
|
22
41
|
|
|
23
42
|
## Key concepts to know before guessing an API
|
|
24
43
|
|
|
@@ -35,5 +54,6 @@ directly; treat it as an implementation detail.
|
|
|
35
54
|
prop to respond to interaction — this is the standard wiring, not
|
|
36
55
|
`onChange` + manual state.
|
|
37
56
|
|
|
38
|
-
If unsure which export solves a problem, check `README.md`
|
|
39
|
-
tree on GitHub
|
|
57
|
+
If unsure which export solves a problem, check `README.md` first — the
|
|
58
|
+
`src/` tree on GitHub is there too if a specific export's own JSDoc doesn't
|
|
59
|
+
cover what you need.
|