poi-plugin-item-improvement2-beta 1.0.20 → 1.0.22
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/REFACTOR_NOTES.md +21 -38
- package/assets/db/{items.nedb → improvement-detail.nedb} +372 -372
- package/assets/db/improvement-list.json +15425 -0
- package/index.js +2 -2
- package/package.json +4 -3
- package/tests/improvement-data.test.js +38 -0
- package/views/improvement-data-source.js +282 -0
- package/views/improvement-data.js +41 -3
- package/views/item-info-area.js +7 -7
- package/views/selectors.js +16 -9
- package/assets/db/arsenal_all.nedb +0 -372
- package/assets/db/arsenal_weekday.nedb +0 -7
- package/views/nedb-data.js +0 -217
package/REFACTOR_NOTES.md
CHANGED
|
@@ -1,52 +1,35 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Data projection refactor
|
|
2
2
|
|
|
3
|
-
##
|
|
4
|
-
|
|
5
|
-
- Spider parses Wiki-specific ship expressions and emits ship IDs.
|
|
6
|
-
- Poi joins those IDs with the local `$ships` master data.
|
|
7
|
-
- UI/detail/TXT consumers use the same normalized assistant view model.
|
|
8
|
-
- `shipWeek.text` is retained only as source/fallback text.
|
|
9
|
-
|
|
10
|
-
## Normalized fields
|
|
11
|
-
|
|
12
|
-
Each improvement now has `assistantList`. Each assistant contains:
|
|
3
|
+
## Runtime files
|
|
13
4
|
|
|
14
|
-
|
|
15
|
-
- `shipIds`: normalized positive IDs.
|
|
16
|
-
- `ships`: local master-data records (`canonicalName`, `displayName`).
|
|
17
|
-
- `displayText`: the single presentation value consumed by UI/export code.
|
|
18
|
-
- `week`, `days`, `fullWeek`: normalized schedule fields.
|
|
19
|
-
- `identity`: stable deduplication key.
|
|
20
|
-
- `idsComplete`: whether IDs are authoritative for presentation.
|
|
5
|
+
The plugin now consumes exactly two backend projections:
|
|
21
6
|
|
|
22
|
-
|
|
7
|
+
- `assets/db/improvement-list.json`: compact all + seven-day list data.
|
|
8
|
+
- `assets/db/improvement-detail.nedb`: full equipment detail records.
|
|
23
9
|
|
|
24
|
-
|
|
10
|
+
The old `arsenal_all.nedb`, `arsenal_weekday.nedb`, and `items.nedb` runtime split has
|
|
11
|
+
been removed.
|
|
25
12
|
|
|
26
|
-
|
|
27
|
-
`夕張改二/特/丁`. To avoid losing information, a single ID replaces source text only when:
|
|
28
|
-
|
|
29
|
-
- Spider explicitly marks it with `idsComplete: true`, `resolved: true`, or
|
|
30
|
-
`parseStatus: "resolved"`; or
|
|
31
|
-
- the source text exactly matches the local canonical ship name; or
|
|
32
|
-
- multiple IDs are present; or
|
|
33
|
-
- no source text exists.
|
|
13
|
+
## Responsibility boundary
|
|
34
14
|
|
|
35
|
-
|
|
36
|
-
|
|
15
|
+
- Spider parses Wiki rules and owns list aggregation.
|
|
16
|
+
- The list page reads backend-provided `[itemId, assistantTexts]` rows directly.
|
|
17
|
+
- The detail page reads the detail NeDB records.
|
|
18
|
+
- Spider already emits `shipIdList` and `assistantShipIdsByDay`, but this plugin version
|
|
19
|
+
deliberately does not consume them yet.
|
|
20
|
+
- Detail presentation continues to use the legacy anchor `id` and source `text`, so an
|
|
21
|
+
irregular description such as `夕張改二/特/丁` is not reduced to one anchor ship.
|
|
37
22
|
|
|
38
|
-
##
|
|
23
|
+
## Data source
|
|
39
24
|
|
|
40
|
-
|
|
41
|
-
|
|
25
|
+
`views/improvement-data-source.es` loads, validates, downloads, and replaces the two
|
|
26
|
+
files as one dataset. `selectors.es` only joins the detail records with Poi master data
|
|
27
|
+
and attaches the backend list summary.
|
|
42
28
|
|
|
43
29
|
## Verification
|
|
44
30
|
|
|
45
|
-
Run:
|
|
46
|
-
|
|
47
31
|
```bash
|
|
32
|
+
npm ci --include=dev
|
|
48
33
|
npm test
|
|
34
|
+
npm pack --dry-run
|
|
49
35
|
```
|
|
50
|
-
|
|
51
|
-
This transpiles the plugin, runs the assistant normalization tests, and removes generated
|
|
52
|
-
JavaScript files afterward.
|