poi-plugin-item-improvement2-beta 1.0.23 → 1.0.26
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/CHANGELOG.md +107 -0
- package/README.md +20 -0
- package/REFACTOR_NOTES.md +25 -29
- package/assets/icon/71.png +0 -0
- package/assets/main.css +36 -0
- package/i18n/en-US.json +15 -1
- package/i18n/ja-JP.json +15 -7
- package/i18n/zh-CN.json +15 -6
- package/i18n/zh-TW.json +15 -6
- package/index.js +0 -3
- package/package.json +18 -4
- package/scripts/publish-beta.js +163 -0
- package/tests/improvement-data.test.js +111 -5
- package/views/changelog-modal.js +50 -0
- package/views/changelog.js +60 -0
- package/views/data-package.js +80 -0
- package/views/improvement-data-source.js +19 -235
- package/views/item-info-area.js +51 -28
- package/views/useitem-icon.js +9 -8
- package/assets/db/improvement-detail.nedb +0 -372
- package/assets/db/improvement-list.json +0 -15425
- package/assets/icon/100.png +0 -0
- package/assets/icon/104.png +0 -0
- package/assets/icon/145.png +0 -0
- package/assets/icon/150.png +0 -0
- package/assets/icon/2.png +0 -0
- package/assets/icon/241.png +0 -0
- package/assets/icon/57.png +0 -0
- package/assets/icon/70.png +0 -0
- package/assets/icon/75.png +0 -0
- package/assets/icon/77.png +0 -0
- package/assets/icon/78.png +0 -0
- package/assets/icon/91.png +0 -0
- package/assets/icon/92.png +0 -0
- package/assets/icon/94.png +0 -0
- package/assets/icon/95.png +0 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to `poi-plugin-item-improvement2-beta` are documented here.
|
|
4
|
+
|
|
5
|
+
## [Unreleased]
|
|
6
|
+
|
|
7
|
+
### Planned
|
|
8
|
+
|
|
9
|
+
- Add consumer views for equipment acquisition sources and special ship bonuses from `@sakura2333/kancolle-data`.
|
|
10
|
+
- Remove the remaining local compatibility icon after the shared data package contains it.
|
|
11
|
+
|
|
12
|
+
## [1.0.26] - 2026-06-28
|
|
13
|
+
|
|
14
|
+
### Fixed
|
|
15
|
+
|
|
16
|
+
- Ensured the local use-item 71 compatibility PNG is explicitly included in official and beta npm packages.
|
|
17
|
+
- Re-encoded the unchanged icon pixels so Git patches and repository updates physically carry the binary asset instead of relying on an existing working-tree copy.
|
|
18
|
+
|
|
19
|
+
### Changed
|
|
20
|
+
|
|
21
|
+
- Added an explicit npm `files` allowlist covering runtime JavaScript, localized resources, styles, and all icon assets.
|
|
22
|
+
|
|
23
|
+
### Validation
|
|
24
|
+
|
|
25
|
+
- Added a package dry-run assertion that fails when `assets/icon/71.png` is absent from the npm tarball file list.
|
|
26
|
+
- Added PNG signature validation for the compatibility icon.
|
|
27
|
+
|
|
28
|
+
## [1.0.25] - 2026-06-28
|
|
29
|
+
|
|
30
|
+
### Changed
|
|
31
|
+
|
|
32
|
+
- Rewrote the in-app release notes to describe user-visible behavior instead of npm, schema, repository, and packaging implementation details.
|
|
33
|
+
- Added localized user-facing release-note copy for Simplified Chinese, Traditional Chinese, Japanese, and English.
|
|
34
|
+
- Kept detailed engineering changes in this repository `CHANGELOG.md` for development and release auditing.
|
|
35
|
+
|
|
36
|
+
### Validation
|
|
37
|
+
|
|
38
|
+
- Added coverage that every in-app changelog key exists in all supported locales.
|
|
39
|
+
- Added coverage preventing technical package terminology from leaking back into the Simplified Chinese in-app release notes.
|
|
40
|
+
|
|
41
|
+
## [1.0.24] - 2026-06-28
|
|
42
|
+
|
|
43
|
+
### Changed
|
|
44
|
+
|
|
45
|
+
- Relaxed the shared data dependency from exact `0.1.0` to the compatible `^0.1.0` range.
|
|
46
|
+
- New plugin installs and dependency refreshes can now consume automatically published `0.1.x` data-only patch releases without requiring a plugin release for every dataset refresh.
|
|
47
|
+
|
|
48
|
+
### Compatibility
|
|
49
|
+
|
|
50
|
+
- Data package minor/schema releases remain blocked until the plugin explicitly updates its supported dependency range and schema checks.
|
|
51
|
+
- Existing installed plugins still need their dependency installation to be refreshed before npm can resolve a newer data patch.
|
|
52
|
+
|
|
53
|
+
## [1.0.23] - 2026-06-28
|
|
54
|
+
|
|
55
|
+
### Added
|
|
56
|
+
|
|
57
|
+
- Added the versioned `@sakura2333/kancolle-data@0.1.0` runtime dependency.
|
|
58
|
+
- Added a data-package adapter that exposes improvement list/detail paths and validates the supported improvement schema.
|
|
59
|
+
- Added shared use-item icon lookup through the data package.
|
|
60
|
+
|
|
61
|
+
### Changed
|
|
62
|
+
|
|
63
|
+
- Moved improvement list data, improvement detail data, and most use-item PNG assets out of the plugin package.
|
|
64
|
+
- Removed runtime GitHub data synchronization; all required data is installed locally by npm.
|
|
65
|
+
- Changed official and beta builds to consume the same versioned data package.
|
|
66
|
+
- Reduced the plugin tarball from the historical embedded-data size to a lightweight code package.
|
|
67
|
+
- Kept the local `71.png` and generic SVG as temporary compatibility assets.
|
|
68
|
+
|
|
69
|
+
### Fixed
|
|
70
|
+
|
|
71
|
+
- Fixed plugin startup being dependent on GitHub Raw availability and network conditions.
|
|
72
|
+
- Fixed data and PNG updates requiring duplicate copies in the Spider and plugin repositories.
|
|
73
|
+
|
|
74
|
+
### Compatibility
|
|
75
|
+
|
|
76
|
+
- Requires `@sakura2333/kancolle-data` with a supported improvement schema.
|
|
77
|
+
- Publish the data package before publishing a plugin version that depends on it.
|
|
78
|
+
|
|
79
|
+
## [1.0.22] - 2026-06-28
|
|
80
|
+
|
|
81
|
+
### Added
|
|
82
|
+
|
|
83
|
+
- Added a localized release-notes dialog shown once after a version change.
|
|
84
|
+
- Added a toolbar entry for reopening the release notes manually.
|
|
85
|
+
- Added `publish:beta` and `publish:beta:dry-run` scripts.
|
|
86
|
+
|
|
87
|
+
### Changed
|
|
88
|
+
|
|
89
|
+
- Beta publishing temporarily changes package and runtime namespaces to `poi-plugin-item-improvement2-beta-beta` and always restores the working tree afterward.
|
|
90
|
+
|
|
91
|
+
## [1.0.21] - 2026-06-28
|
|
92
|
+
|
|
93
|
+
### Added
|
|
94
|
+
|
|
95
|
+
- Added separate list and detail data projections.
|
|
96
|
+
- Added support for multiple independent improvement recipe routes.
|
|
97
|
+
- Added the Tamanami Kai Ni assistant-specific material route.
|
|
98
|
+
|
|
99
|
+
### Changed
|
|
100
|
+
|
|
101
|
+
- Changed the detail UI to render one table per complete recipe route.
|
|
102
|
+
- Unified list and detail assistant presentation through normalized view models.
|
|
103
|
+
|
|
104
|
+
### Fixed
|
|
105
|
+
|
|
106
|
+
- Fixed routes with different materials, costs, or upgrade targets sharing the first route's table header.
|
|
107
|
+
- Fixed the default route and Tamanami Kai Ni route being merged back together in the UI.
|
package/README.md
CHANGED
|
@@ -5,3 +5,23 @@ Put the folder into /path/to/poi/resources/app/plugins.
|
|
|
5
5
|
|
|
6
6
|
#### Data source
|
|
7
7
|
The plugin makes use of equipment improvement data from [Akashi List](https://akashi-list.me/).
|
|
8
|
+
|
|
9
|
+
## Publishing the beta package
|
|
10
|
+
|
|
11
|
+
The beta package uses a separate npm package name while keeping the source tree on the official namespace.
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npm run publish:beta:dry-run
|
|
15
|
+
npm run publish:beta
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
`publish:beta` temporarily replaces every runtime occurrence of
|
|
19
|
+
`poi-plugin-item-improvement2-beta` with `poi-plugin-item-improvement2-beta-beta`, runs
|
|
20
|
+
`npm publish`, and restores the original files even when publishing fails.
|
|
21
|
+
Arguments after `--` are forwarded to `npm publish`.
|
|
22
|
+
|
|
23
|
+
## Data package
|
|
24
|
+
|
|
25
|
+
Improvement data and use-item PNG assets are supplied by the versioned npm dependency
|
|
26
|
+
`@sakura2333/kancolle-data`. The plugin no longer downloads data from GitHub at runtime.
|
|
27
|
+
Publish the data package before publishing a plugin version that depends on it.
|
package/REFACTOR_NOTES.md
CHANGED
|
@@ -1,47 +1,43 @@
|
|
|
1
|
-
# Data
|
|
1
|
+
# Data package and route-aware UI
|
|
2
2
|
|
|
3
|
-
## Runtime
|
|
3
|
+
## Runtime data
|
|
4
4
|
|
|
5
|
-
The plugin consumes
|
|
5
|
+
The plugin consumes the versioned npm dependency `@sakura2333/kancolle-data`:
|
|
6
6
|
|
|
7
|
-
- `
|
|
8
|
-
- `
|
|
7
|
+
- `improvement/list.json`: compact all + seven-day list projection.
|
|
8
|
+
- `improvement/detail.nedb`: full equipment detail and recipe routes.
|
|
9
|
+
- `assets/useitems/*.png`: shared use-item icons.
|
|
10
|
+
|
|
11
|
+
The plugin no longer downloads GitHub files at runtime and no longer carries duplicate
|
|
12
|
+
improvement datasets. `assets/icon/useitem.svg` remains the generic fallback; the legacy
|
|
13
|
+
`71.png` is temporarily retained until it is present in the data package.
|
|
9
14
|
|
|
10
15
|
## Responsibility boundary
|
|
11
16
|
|
|
12
|
-
- Spider
|
|
17
|
+
- Spider collects and validates sources, normalizes assistant IDs, splits concrete recipes,
|
|
18
|
+
and publishes `@sakura2333/kancolle-data`.
|
|
19
|
+
- The data package exposes stable local paths and dataset manifests.
|
|
20
|
+
- The plugin reads the installed package, validates the supported improvement schema, and
|
|
21
|
+
maps the data into UI view models.
|
|
13
22
|
- The list page reads backend-provided `[itemId, assistantTexts]` rows.
|
|
14
23
|
- The detail page displays every `improvementList[]` entry as one independent route.
|
|
15
|
-
- Wiki source text remains the default assistant display, so compact expressions are
|
|
16
|
-
not unexpectedly expanded in the UI.
|
|
17
24
|
|
|
18
25
|
## Multiple route support
|
|
19
26
|
|
|
20
|
-
`DetailRow` renders one table per improvement route. Each table uses its own
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
- stage costs;
|
|
24
|
-
- consumables;
|
|
25
|
-
- MAX target;
|
|
26
|
-
- assistant schedule.
|
|
27
|
+
`DetailRow` renders one table per improvement route. Each table uses its own base resources,
|
|
28
|
+
stage costs, consumables, MAX target, and assistant schedule. This supports assistant-specific
|
|
29
|
+
recipes such as the `玉波改二` route for `12.7cm連装砲D型改二`.
|
|
27
30
|
|
|
28
|
-
|
|
29
|
-
`12.7cm連装砲D型改二`, and also prevents future routes with different base resources
|
|
30
|
-
or update targets from sharing the first route's table header.
|
|
31
|
+
## Publish order
|
|
31
32
|
|
|
32
|
-
|
|
33
|
+
1. Build and publish `@sakura2333/kancolle-data` from the Spider repository.
|
|
34
|
+
2. Install development dependencies for this plugin.
|
|
35
|
+
3. Run tests and publish the official or beta plugin.
|
|
33
36
|
|
|
34
37
|
```bash
|
|
35
38
|
npm ci --include=dev
|
|
36
39
|
npm test
|
|
37
|
-
npm
|
|
40
|
+
npm publish
|
|
41
|
+
# or
|
|
42
|
+
npm run publish:beta
|
|
38
43
|
```
|
|
39
|
-
|
|
40
|
-
## Route-aware detail UI (1.0.21)
|
|
41
|
-
|
|
42
|
-
- Each backend `improvementList` route renders as a separate detail table.
|
|
43
|
-
- Every table uses its own base resources, stage costs, consumables and update
|
|
44
|
-
target; it no longer borrows the first route's header or recipe.
|
|
45
|
-
- Assistant-specific routes such as 玉波改二 are shown independently from the
|
|
46
|
-
default route.
|
|
47
|
-
- The bundled schema-v3 detail fixture is covered by tests for item 267.
|
package/assets/icon/71.png
CHANGED
|
Binary file
|
package/assets/main.css
CHANGED
|
@@ -195,3 +195,39 @@
|
|
|
195
195
|
.improvement-route-table + .improvement-route-table {
|
|
196
196
|
margin-top: 8px;
|
|
197
197
|
}
|
|
198
|
+
|
|
199
|
+
#item-improvement .improvement-toolbar {
|
|
200
|
+
display: flex;
|
|
201
|
+
align-items: center;
|
|
202
|
+
width: 100%;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
#item-improvement .improvement-toolbar .main-nav {
|
|
206
|
+
flex: 1;
|
|
207
|
+
min-width: 0;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
#item-improvement .changelog-button {
|
|
211
|
+
flex: 0 0 auto;
|
|
212
|
+
margin-left: 8px;
|
|
213
|
+
white-space: nowrap;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
.improvement-changelog-version + .improvement-changelog-version {
|
|
217
|
+
border-top: 1px solid rgba(127, 127, 127, 0.25);
|
|
218
|
+
margin-top: 16px;
|
|
219
|
+
padding-top: 12px;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
.improvement-changelog-version h4 {
|
|
223
|
+
margin-top: 0;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
.improvement-changelog-version ul {
|
|
227
|
+
margin-bottom: 0;
|
|
228
|
+
padding-left: 22px;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
.improvement-changelog-version li + li {
|
|
232
|
+
margin-top: 6px;
|
|
233
|
+
}
|
package/i18n/en-US.json
CHANGED
|
@@ -44,5 +44,19 @@
|
|
|
44
44
|
"New equipment plan": "New equipment plan",
|
|
45
45
|
"Expand only non-empty categories": "Expand only non-empty categories",
|
|
46
46
|
"Starcraft": "Starcraft",
|
|
47
|
-
"Your personal planner for crafting stars": "Your personal planner for crafting stars"
|
|
47
|
+
"Your personal planner for crafting stars": "Your personal planner for crafting stars",
|
|
48
|
+
"What's New": "What's New",
|
|
49
|
+
"Release Notes": "Release Notes",
|
|
50
|
+
"Close": "Close",
|
|
51
|
+
"changelog_1_0_26_useitem_icon": "Fixed a missing material icon after installation so the affected item now displays correctly.",
|
|
52
|
+
"changelog_1_0_25_user_focused": "Release notes now focus on visible features and usability, while implementation details stay out of the in-app dialog.",
|
|
53
|
+
"changelog_1_0_24_compatible_data_updates": "Compatible improvement-data updates can now be picked up when the plugin is installed or updated, reducing the need for frequent plugin releases.",
|
|
54
|
+
"changelog_1_0_23_offline_ready": "Improvement data and material icons are now installed with the plugin, so startup no longer waits for an online sync.",
|
|
55
|
+
"changelog_1_0_23_network_resilience": "The improvement view remains available when the network is unstable or temporarily offline.",
|
|
56
|
+
"changelog_1_0_23_consistent_data": "Stable and test releases now use the same improvement data for more consistent results.",
|
|
57
|
+
"changelog_1_0_22_auto_notes": "The plugin now shows the latest changes once after an update.",
|
|
58
|
+
"changelog_1_0_22_reopen_notes": "A What’s New button was added to the toolbar so release notes can be reopened at any time.",
|
|
59
|
+
"changelog_1_0_21_stable_data": "Improvement information now loads and updates more reliably.",
|
|
60
|
+
"changelog_1_0_21_separate_routes": "Improvement routes with different materials, costs, or upgrade targets are now shown in separate tables.",
|
|
61
|
+
"changelog_1_0_21_tamanami_route": "Added Tamanami Kai Ni’s dedicated material route and kept it separate from the normal route."
|
|
48
62
|
}
|
package/i18n/ja-JP.json
CHANGED
|
@@ -27,16 +27,13 @@
|
|
|
27
27
|
"upgrade": "更新",
|
|
28
28
|
"Equipment": "装備",
|
|
29
29
|
"All": "全ての装備",
|
|
30
|
-
|
|
31
30
|
"Content": "内容",
|
|
32
31
|
"View": "ビュー",
|
|
33
|
-
|
|
34
32
|
"Default": "デフォルト",
|
|
35
33
|
"Expand All": "すべて展開",
|
|
36
34
|
"Collapse All": "すべて格納",
|
|
37
35
|
"View Mode": "ビューモード",
|
|
38
36
|
"Export as Image": "画像として保存",
|
|
39
|
-
|
|
40
37
|
"Owned": "保有",
|
|
41
38
|
"Add": "作成",
|
|
42
39
|
"Remove": "削除",
|
|
@@ -44,11 +41,22 @@
|
|
|
44
41
|
"Invalid": "無効",
|
|
45
42
|
"Infinity": "無上限",
|
|
46
43
|
"Available": " (利用可能: %d)",
|
|
47
|
-
|
|
48
|
-
|
|
49
44
|
"New equipment plan": "新しい改修計画",
|
|
50
45
|
"Expand only non-empty categories": "改修計画がある装備種類だけを展開",
|
|
51
|
-
|
|
52
46
|
"Starcraft": "スタークラフト",
|
|
53
|
-
"Your personal planner for crafting stars": "装備改修計画"
|
|
47
|
+
"Your personal planner for crafting stars": "装備改修計画",
|
|
48
|
+
"What's New": "更新履歴",
|
|
49
|
+
"Release Notes": "更新履歴",
|
|
50
|
+
"Close": "閉じる",
|
|
51
|
+
"changelog_1_0_26_useitem_icon": "インストール後に一部の資材アイコンが欠ける問題を修正し、正しく表示されるようになりました。",
|
|
52
|
+
"changelog_1_0_25_user_focused": "更新履歴を機能変更と使い勝手の内容に整理し、開発やデータ構造の詳細は表示しないようにしました。",
|
|
53
|
+
"changelog_1_0_24_compatible_data_updates": "プラグインのインストールや更新時に互換性のある新しい改修データを取得できるようになり、データ更新のたびにプラグインを更新する必要が減りました。",
|
|
54
|
+
"changelog_1_0_23_offline_ready": "改修データと資材アイコンをプラグインと一緒にインストールするようにし、起動時のオンライン同期待ちをなくしました。",
|
|
55
|
+
"changelog_1_0_23_network_resilience": "通信が不安定な場合や一時的にオフラインの場合でも、改修画面を利用できます。",
|
|
56
|
+
"changelog_1_0_23_consistent_data": "正式版とテスト版で同じ改修データを使用し、表示内容を統一しました。",
|
|
57
|
+
"changelog_1_0_22_auto_notes": "プラグイン更新後に、そのバージョンの変更内容を一度だけ自動表示するようにしました。",
|
|
58
|
+
"changelog_1_0_22_reopen_notes": "ツールバーに「更新履歴」ボタンを追加し、いつでも変更内容を確認できるようにしました。",
|
|
59
|
+
"changelog_1_0_21_stable_data": "改修情報の読み込みと更新をより安定させました。",
|
|
60
|
+
"changelog_1_0_21_separate_routes": "必要装備、資材、更新先が異なる改修ルートを別々の表で表示するようにしました。",
|
|
61
|
+
"changelog_1_0_21_tamanami_route": "玉波改二専用の改修素材ルートを追加し、通常ルートと混在しないようにしました。"
|
|
54
62
|
}
|
package/i18n/zh-CN.json
CHANGED
|
@@ -27,16 +27,13 @@
|
|
|
27
27
|
"upgrade": "升级",
|
|
28
28
|
"Equipment": "装备",
|
|
29
29
|
"All": "全部装备",
|
|
30
|
-
|
|
31
30
|
"Content": "内容",
|
|
32
31
|
"View": "浏览",
|
|
33
|
-
|
|
34
32
|
"Default": "默认",
|
|
35
33
|
"Expand All": "全部展开",
|
|
36
34
|
"Collapse All": "全部折叠",
|
|
37
35
|
"View Mode": "浏览模式",
|
|
38
36
|
"Export as Image": "导出图片",
|
|
39
|
-
|
|
40
37
|
"Owned": "持有",
|
|
41
38
|
"Add": "添加",
|
|
42
39
|
"Remove": "删除",
|
|
@@ -44,10 +41,22 @@
|
|
|
44
41
|
"Invalid": "无效",
|
|
45
42
|
"Infinity": "不设上限",
|
|
46
43
|
"Available": " (可用: %d)",
|
|
47
|
-
|
|
48
44
|
"New equipment plan": "新建装备计划",
|
|
49
45
|
"Expand only non-empty categories": "仅展开内容非空的装备类别",
|
|
50
|
-
|
|
51
46
|
"Starcraft": "星级争霸",
|
|
52
|
-
"Your personal planner for crafting stars": "装备改修规划书"
|
|
47
|
+
"Your personal planner for crafting stars": "装备改修规划书",
|
|
48
|
+
"What's New": "更新日志",
|
|
49
|
+
"Release Notes": "更新日志",
|
|
50
|
+
"Close": "关闭",
|
|
51
|
+
"changelog_1_0_26_useitem_icon": "修复部分资材图标在安装后的插件中缺失,相关资材现在可以正常显示。",
|
|
52
|
+
"changelog_1_0_25_user_focused": "更新日志现在只展示功能变化和使用体验,开发与数据结构细节不再打扰日常使用。",
|
|
53
|
+
"changelog_1_0_24_compatible_data_updates": "改修资料会在安装或更新插件时获取兼容的新版本,后续资料更新不必频繁升级插件。",
|
|
54
|
+
"changelog_1_0_23_offline_ready": "改修资料和资材图标现在会随插件一起安装,启动时无需再等待在线同步。",
|
|
55
|
+
"changelog_1_0_23_network_resilience": "网络不稳定或暂时离线时,改修页面仍可正常使用。",
|
|
56
|
+
"changelog_1_0_23_consistent_data": "正式版与测试版共用同一套改修资料,显示结果更加一致。",
|
|
57
|
+
"changelog_1_0_22_auto_notes": "插件更新后会自动展示一次本次版本变化。",
|
|
58
|
+
"changelog_1_0_22_reopen_notes": "工具栏新增“更新日志”按钮,可随时回看版本变化。",
|
|
59
|
+
"changelog_1_0_21_stable_data": "改修信息的加载和更新更加稳定。",
|
|
60
|
+
"changelog_1_0_21_separate_routes": "材料、资材或升级目标不同的改修路线现在会分表展示。",
|
|
61
|
+
"changelog_1_0_21_tamanami_route": "补充玉波改二专属的改修材料路线,避免与普通路线混在一起。"
|
|
53
62
|
}
|
package/i18n/zh-TW.json
CHANGED
|
@@ -27,16 +27,13 @@
|
|
|
27
27
|
"upgrade": "升級",
|
|
28
28
|
"Equipment": "装備",
|
|
29
29
|
"All": "全部装備",
|
|
30
|
-
|
|
31
30
|
"Content": "內容",
|
|
32
31
|
"View": "瀏覽",
|
|
33
|
-
|
|
34
32
|
"Default": "默認",
|
|
35
33
|
"Expand All": "全部展開",
|
|
36
34
|
"Collapse All": "全部摺疊",
|
|
37
35
|
"View Mode": "瀏覽模式",
|
|
38
36
|
"Export as Image": "導出圖片",
|
|
39
|
-
|
|
40
37
|
"Owned": "持有",
|
|
41
38
|
"Add": "添加",
|
|
42
39
|
"Remove": "刪除",
|
|
@@ -44,10 +41,22 @@
|
|
|
44
41
|
"Invalid": "無效",
|
|
45
42
|
"Infinity": "不設上限",
|
|
46
43
|
"Available": " (可用: %d)",
|
|
47
|
-
|
|
48
44
|
"New equipment plan": "新建裝備計劃",
|
|
49
45
|
"Expand only non-empty categories": "僅展開內容非空的裝備類別",
|
|
50
|
-
|
|
51
46
|
"Starcraft": "星海爭霸",
|
|
52
|
-
"Your personal planner for crafting stars": "裝備改修規劃書"
|
|
47
|
+
"Your personal planner for crafting stars": "裝備改修規劃書",
|
|
48
|
+
"What's New": "更新日誌",
|
|
49
|
+
"Release Notes": "更新日誌",
|
|
50
|
+
"Close": "關閉",
|
|
51
|
+
"changelog_1_0_26_useitem_icon": "修正部分資材圖示在安裝後的插件中缺失,相關資材現在可以正常顯示。",
|
|
52
|
+
"changelog_1_0_25_user_focused": "更新日誌現在只顯示功能變化與使用體驗,開發及資料結構細節不再干擾日常使用。",
|
|
53
|
+
"changelog_1_0_24_compatible_data_updates": "改修資料會在安裝或更新外掛時取得相容的新版本,後續資料更新不必頻繁升級外掛。",
|
|
54
|
+
"changelog_1_0_23_offline_ready": "改修資料與資材圖示現在會隨外掛一同安裝,啟動時不必再等待線上同步。",
|
|
55
|
+
"changelog_1_0_23_network_resilience": "網路不穩定或暫時離線時,改修頁面仍可正常使用。",
|
|
56
|
+
"changelog_1_0_23_consistent_data": "正式版與測試版共用同一套改修資料,顯示結果更加一致。",
|
|
57
|
+
"changelog_1_0_22_auto_notes": "外掛更新後會自動顯示一次本次版本變更。",
|
|
58
|
+
"changelog_1_0_22_reopen_notes": "工具列新增「更新日誌」按鈕,可隨時回看版本變更。",
|
|
59
|
+
"changelog_1_0_21_stable_data": "改修資訊的載入與更新更加穩定。",
|
|
60
|
+
"changelog_1_0_21_separate_routes": "材料、資材或升級目標不同的改修路線現在會分表顯示。",
|
|
61
|
+
"changelog_1_0_21_tamanami_route": "補充玉波改二專屬的改修材料路線,避免與一般路線混在一起。"
|
|
53
62
|
}
|
package/index.js
CHANGED
|
@@ -5,12 +5,9 @@ exports.windowOptions = exports.reactClass = exports.windowMode = void 0;
|
|
|
5
5
|
|
|
6
6
|
var _itemInfoArea = require("./views/item-info-area");
|
|
7
7
|
|
|
8
|
-
var _improvementDataSource = require("./views/improvement-data-source");
|
|
9
|
-
|
|
10
8
|
const {
|
|
11
9
|
config
|
|
12
10
|
} = window;
|
|
13
|
-
(0, _improvementDataSource.startImprovementDataSync)();
|
|
14
11
|
const windowMode = true;
|
|
15
12
|
exports.windowMode = windowMode;
|
|
16
13
|
const reactClass = _itemInfoArea.ItemInfoArea;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "poi-plugin-item-improvement2-beta",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.26",
|
|
4
4
|
"description": "use new data source",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -8,7 +8,9 @@
|
|
|
8
8
|
"test": "npm run prepack && node tests/improvement-data.test.js",
|
|
9
9
|
"postpack": "npm run clean:js",
|
|
10
10
|
"clean:js": "find ./views -name '*.js' -type f -delete && rm -f ./index.js",
|
|
11
|
-
"posttest": "npm run clean:js"
|
|
11
|
+
"posttest": "npm run clean:js",
|
|
12
|
+
"publish:beta": "node scripts/publish-beta.js",
|
|
13
|
+
"publish:beta:dry-run": "npm run publish:beta -- --dry-run"
|
|
12
14
|
},
|
|
13
15
|
"repository": {
|
|
14
16
|
"type": "git",
|
|
@@ -31,7 +33,8 @@
|
|
|
31
33
|
"homepage": "https://github.com/sakura2333/plugin-item-improvement#readme",
|
|
32
34
|
"dependencies": {
|
|
33
35
|
"dom-to-image": "^2.6.0",
|
|
34
|
-
"react-numeric-input": "^2.2.3"
|
|
36
|
+
"react-numeric-input": "^2.2.3",
|
|
37
|
+
"@sakura2333/kancolle-data": "^0.1.0"
|
|
35
38
|
},
|
|
36
39
|
"devDependencies": {
|
|
37
40
|
"babel-eslint": "^10.0.1",
|
|
@@ -54,5 +57,16 @@
|
|
|
54
57
|
"8.0.99": "5.0.6",
|
|
55
58
|
"8.3.0": "6.0.1"
|
|
56
59
|
}
|
|
57
|
-
}
|
|
60
|
+
},
|
|
61
|
+
"files": [
|
|
62
|
+
"index.js",
|
|
63
|
+
"views/**/*.js",
|
|
64
|
+
"assets/**/*",
|
|
65
|
+
"i18n/*.json",
|
|
66
|
+
"scripts/publish-beta.js",
|
|
67
|
+
"tests/improvement-data.test.js",
|
|
68
|
+
"CHANGELOG.md",
|
|
69
|
+
"README.md",
|
|
70
|
+
"REFACTOR_NOTES.md"
|
|
71
|
+
]
|
|
58
72
|
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
'use strict'
|
|
4
|
+
|
|
5
|
+
const fs = require('fs')
|
|
6
|
+
const path = require('path')
|
|
7
|
+
const { spawn } = require('child_process')
|
|
8
|
+
|
|
9
|
+
const ROOT = path.resolve(__dirname, '..')
|
|
10
|
+
const OFFICIAL_NAME = 'poi-plugin-item-improvement2'
|
|
11
|
+
const BETA_NAME = 'poi-plugin-item-improvement2-beta'
|
|
12
|
+
const SELF_PATH = path.resolve(__filename)
|
|
13
|
+
const SKIP_DIRECTORIES = new Set(['.git', 'node_modules'])
|
|
14
|
+
const MAX_TEXT_FILE_SIZE = 5 * 1024 * 1024
|
|
15
|
+
|
|
16
|
+
function isProbablyText(buffer) {
|
|
17
|
+
return !buffer.includes(0)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function collectFiles(directory, output = []) {
|
|
21
|
+
for (const entry of fs.readdirSync(directory, { withFileTypes: true })) {
|
|
22
|
+
if (entry.isDirectory() && SKIP_DIRECTORIES.has(entry.name)) continue
|
|
23
|
+
|
|
24
|
+
const absolutePath = path.join(directory, entry.name)
|
|
25
|
+
if (entry.isDirectory()) {
|
|
26
|
+
collectFiles(absolutePath, output)
|
|
27
|
+
} else if (entry.isFile()) {
|
|
28
|
+
output.push(absolutePath)
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
return output
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
function buildReplacementPlan() {
|
|
35
|
+
const replacements = []
|
|
36
|
+
|
|
37
|
+
for (const filePath of collectFiles(ROOT)) {
|
|
38
|
+
if (path.resolve(filePath) === SELF_PATH) continue
|
|
39
|
+
|
|
40
|
+
const stat = fs.statSync(filePath)
|
|
41
|
+
if (stat.size > MAX_TEXT_FILE_SIZE) continue
|
|
42
|
+
|
|
43
|
+
const original = fs.readFileSync(filePath)
|
|
44
|
+
if (!isProbablyText(original)) continue
|
|
45
|
+
|
|
46
|
+
const originalText = original.toString('utf8')
|
|
47
|
+
if (!originalText.includes(OFFICIAL_NAME)) continue
|
|
48
|
+
|
|
49
|
+
const betaText = originalText.split(OFFICIAL_NAME).join(BETA_NAME)
|
|
50
|
+
replacements.push({
|
|
51
|
+
filePath,
|
|
52
|
+
original,
|
|
53
|
+
replacement: Buffer.from(betaText, 'utf8'),
|
|
54
|
+
})
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return replacements
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function assertOfficialWorkspace() {
|
|
61
|
+
const packageJsonPath = path.join(ROOT, 'package.json')
|
|
62
|
+
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'))
|
|
63
|
+
|
|
64
|
+
if (packageJson.name !== OFFICIAL_NAME) {
|
|
65
|
+
throw new Error(
|
|
66
|
+
`Expected package.json name to be ${OFFICIAL_NAME}, got ${packageJson.name}`
|
|
67
|
+
)
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
function applyReplacementPlan(plan) {
|
|
72
|
+
for (const entry of plan) {
|
|
73
|
+
fs.writeFileSync(entry.filePath, entry.replacement)
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function restoreReplacementPlan(plan) {
|
|
78
|
+
for (const entry of plan) {
|
|
79
|
+
fs.writeFileSync(entry.filePath, entry.original)
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function relative(filePath) {
|
|
84
|
+
return path.relative(ROOT, filePath) || '.'
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
function runNpmPublish(args) {
|
|
88
|
+
const npmCommand = process.platform === 'win32' ? 'npm.cmd' : 'npm'
|
|
89
|
+
|
|
90
|
+
return new Promise((resolve, reject) => {
|
|
91
|
+
const child = spawn(npmCommand, ['publish', ...args], {
|
|
92
|
+
cwd: ROOT,
|
|
93
|
+
env: process.env,
|
|
94
|
+
stdio: 'inherit',
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
const forwardSignal = signal => {
|
|
98
|
+
if (!child.killed) child.kill(signal)
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
process.once('SIGINT', forwardSignal)
|
|
102
|
+
process.once('SIGTERM', forwardSignal)
|
|
103
|
+
|
|
104
|
+
child.once('error', error => {
|
|
105
|
+
process.removeListener('SIGINT', forwardSignal)
|
|
106
|
+
process.removeListener('SIGTERM', forwardSignal)
|
|
107
|
+
reject(error)
|
|
108
|
+
})
|
|
109
|
+
|
|
110
|
+
child.once('exit', (code, signal) => {
|
|
111
|
+
process.removeListener('SIGINT', forwardSignal)
|
|
112
|
+
process.removeListener('SIGTERM', forwardSignal)
|
|
113
|
+
|
|
114
|
+
if (signal) {
|
|
115
|
+
reject(new Error(`npm publish terminated by ${signal}`))
|
|
116
|
+
} else {
|
|
117
|
+
resolve(code == null ? 1 : code)
|
|
118
|
+
}
|
|
119
|
+
})
|
|
120
|
+
})
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
async function main() {
|
|
124
|
+
assertOfficialWorkspace()
|
|
125
|
+
|
|
126
|
+
const plan = buildReplacementPlan()
|
|
127
|
+
if (plan.length === 0) {
|
|
128
|
+
throw new Error(`No occurrences of ${OFFICIAL_NAME} were found`)
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
console.log(`Temporarily switching package namespace:`)
|
|
132
|
+
console.log(` ${OFFICIAL_NAME} -> ${BETA_NAME}`)
|
|
133
|
+
console.log('Changed files:')
|
|
134
|
+
for (const entry of plan) {
|
|
135
|
+
console.log(` - ${relative(entry.filePath)}`)
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
let exitCode = 1
|
|
139
|
+
applyReplacementPlan(plan)
|
|
140
|
+
|
|
141
|
+
try {
|
|
142
|
+
const betaPackage = JSON.parse(
|
|
143
|
+
fs.readFileSync(path.join(ROOT, 'package.json'), 'utf8')
|
|
144
|
+
)
|
|
145
|
+
if (betaPackage.name !== BETA_NAME) {
|
|
146
|
+
throw new Error('Temporary beta package-name replacement failed')
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
exitCode = await runNpmPublish(process.argv.slice(2))
|
|
150
|
+
} finally {
|
|
151
|
+
restoreReplacementPlan(plan)
|
|
152
|
+
console.log(`Restored workspace namespace to ${OFFICIAL_NAME}`)
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
if (exitCode !== 0) {
|
|
156
|
+
throw new Error(`npm publish exited with code ${exitCode}`)
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
main().catch(error => {
|
|
161
|
+
console.error(`[publish:beta] ${error.message}`)
|
|
162
|
+
process.exitCode = 1
|
|
163
|
+
})
|