mirror of
https://github.com/NotAShelf/nix-evaluator-stats.git
synced 2026-04-26 20:07:37 +00:00
packages/core: revise readme; elaborate on supported Nix impls
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: Ibff4509c97cc205854ecab05320618f06a6a6964
This commit is contained in:
parent
5482cd9df1
commit
55f6a43dc2
1 changed files with 16 additions and 6 deletions
|
|
@ -1,7 +1,11 @@
|
|||
# @ns/core
|
||||
|
||||
Core types and parsing logic for Nix evaluator statistics. This package is
|
||||
framework-agnostic and can be used in any JavaScript/TypeScript environment.
|
||||
Core types, parsing logic for Nix evaluator statistics, and various bits from
|
||||
the web component that the CLI may interact with in the future. The `@ns/core`
|
||||
package contains the truly "generic" logic that can be used around the
|
||||
workspace, or even outside it. This package is framework-agnostic and can be
|
||||
used in any JavaScript/TypeScript environment. Which is to say that you can use
|
||||
it to make your own statistics viewer without doing any heavy lifting.
|
||||
|
||||
## Usage
|
||||
|
||||
|
|
@ -20,8 +24,14 @@ const change = calculateChange(stats.nrThunks, previousStats.nrThunks);
|
|||
console.log(`Thunks changed by ${change.percent.toFixed(2)}%`);
|
||||
```
|
||||
|
||||
## Version Compatibility
|
||||
## Nix Version/Implementation Compatibility
|
||||
|
||||
The parser handles different Nix implementations (Nix, Lix, Snix, etc.) by
|
||||
checking for field existence in the raw JSON, since not all implementations
|
||||
expose the same statistics.
|
||||
There are currently 4 competing implementations of Nix, and only two of those
|
||||
are considered first-class. The parser handles different implementations the
|
||||
best it can by checking the field existence in the raw JSON, but it is not able
|
||||
to handle new fields. It is unfortunate that not all implementations expose the
|
||||
same statistics.
|
||||
|
||||
Worth noting that besides Lix and Nix, there are and will likely be more
|
||||
implementations. If you want _yours_ to be supported as a first class citizen,
|
||||
please submit a pull request.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue