@flesh-and-blood/cards 4.0.47 → 4.0.49
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/README.md +5 -5
- package/dist/index.js +40 -34
- package/dist/index.mjs +40 -34
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@ objects are typed by [`@flesh-and-blood/types`](../types).
|
|
|
9
9
|
npm i @flesh-and-blood/cards @flesh-and-blood/types
|
|
10
10
|
```
|
|
11
11
|
|
|
12
|
-
Published as **dual ESM + CJS**. Note: the dataset is large (~12 MB)
|
|
12
|
+
Published as **dual ESM + CJS**. Note: the dataset is large (~12 MB), so many consumers load it at build
|
|
13
13
|
or server time rather than shipping it to the browser.
|
|
14
14
|
|
|
15
15
|
## Usage
|
|
@@ -25,20 +25,20 @@ cards.forEach((card: Card) => {
|
|
|
25
25
|
|
|
26
26
|
Card data is sourced from the amazing
|
|
27
27
|
[the-fab-cube/flesh-and-blood-cards](https://github.com/the-fab-cube/flesh-and-blood-cards) project by
|
|
28
|
-
[Tyler Luce](https://github.com/luceleaftea)
|
|
28
|
+
[Tyler Luce](https://github.com/luceleaftea): all credit to him; any errors are probably mine 😅.
|
|
29
29
|
|
|
30
30
|
## The data pipeline
|
|
31
31
|
|
|
32
|
-
`src/index.ts` is a **~12 MB generated file that is committed
|
|
32
|
+
`src/index.ts` is a **~12 MB generated file that is committed, never hand-edit it.** Regenerate
|
|
33
33
|
everything with `npm run full`, which runs end to end.
|
|
34
34
|
|
|
35
|
-
### transform
|
|
35
|
+
### transform: `scripts/index.ts`
|
|
36
36
|
|
|
37
37
|
Reads the source data, computes derived fields, and writes the output:
|
|
38
38
|
|
|
39
39
|
1. **Spoiled** cards from `scripts/Spoiled/*.csv` (Google Sheets exports, one per set), parsed/mapped by `scripts/Spoiled/{parser,mapper}.ts`.
|
|
40
40
|
2. **Released** cards from `scripts/Released/card.json` + `set.json` (sourced from the-fab-cube/flesh-and-blood-cards), parsed/mapped by `scripts/Released/{parser,mapper}.ts`.
|
|
41
|
-
3. **Combine & dedupe
|
|
41
|
+
3. **Combine & dedupe**: a card re-released in a new set merges its printings, sets, rarities, and legality, then compute derived fields (legality, meta, nicknames, shorthands, short name, TCGplayer info) via `scripts/Shared/*`.
|
|
42
42
|
4. `scripts/writer.ts` writes `src/index.ts` and `latest-set/index.ts`.
|
|
43
43
|
|
|
44
44
|
Fix data in the **source**, not the generated output. Overrides and edge cases live in
|