dsh-skill-hub 0.3.10 → 0.3.12
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/CONTRIBUTING.md +31 -3
- package/README.md +1 -1
- package/README.zh.md +1 -1
- package/lib/client.js +1440 -1335
- package/lib/client.js.map +1 -1
- package/lib/index.js +818 -761
- package/lib/types/client/api.d.ts +1 -5
- package/lib/types/client/locales/common.d.ts +1 -3
- package/lib/types/client/locales/market.d.ts +13 -5
- package/lib/types/client/locales/settings.d.ts +0 -2
- package/lib/types/client/locales/skills.d.ts +11 -13
- package/lib/types/client/locales.d.ts +25 -23
- package/lib/types/client/panel/CollectionCard.d.ts +52 -0
- package/lib/types/client/panel/GroupSummary.d.ts +13 -4
- package/lib/types/client/panel/GroupSwitchButton.d.ts +24 -0
- package/lib/types/client/panel/PanelDialogs.d.ts +49 -0
- package/lib/types/client/panel/ProjectTree.d.ts +31 -0
- package/lib/types/client/panel/ReorderButtons.d.ts +15 -0
- package/lib/types/client/panel/SkillDetailView.d.ts +0 -1
- package/lib/types/client/panel/SkillHubPanel.d.ts +5 -4
- package/lib/types/client/panel/SkillRow.d.ts +23 -5
- package/lib/types/client/panel/hooks/shared.d.ts +6 -0
- package/lib/types/client/panel/hooks/useCatalogFlow.d.ts +1 -1
- package/lib/types/client/panel/hooks/useGroupFlow.d.ts +1 -2
- package/lib/types/client/panel/hooks/useMarketFlow.d.ts +11 -10
- package/lib/types/client/panel/hooks/useRepoImportFlow.d.ts +38 -0
- package/lib/types/client/panel/hooks/useSourceFlow.d.ts +1 -1
- package/lib/types/client/panel/useDragReorder.d.ts +34 -0
- package/lib/types/client/panel/useSkillHub.d.ts +1 -3
- package/lib/types/client/settings-card.d.ts +29 -39
- package/lib/types/concurrency.d.ts +6 -0
- package/lib/types/error-text.d.ts +10 -0
- package/lib/types/provider.d.ts +7 -0
- package/lib/types/repo/api.d.ts +36 -0
- package/lib/types/repo/discovery.d.ts +51 -0
- package/lib/types/repo/github-client.d.ts +0 -1
- package/lib/types/repo/install.d.ts +28 -0
- package/lib/types/repo/types.d.ts +22 -0
- package/lib/types/repo.d.ts +9 -120
- package/lib/types/routes/catalog-data.d.ts +31 -0
- package/lib/types/routes/collection.d.ts +13 -0
- package/lib/types/routes/deps.d.ts +70 -0
- package/lib/types/routes/helpers.d.ts +10 -110
- package/lib/types/routes/http.d.ts +39 -0
- package/lib/types/routes/route-state.d.ts +0 -2
- package/lib/types/skillfs/frontmatter.d.ts +20 -0
- package/lib/types/skillfs/paths.d.ts +7 -0
- package/lib/types/skillfs/scan.d.ts +40 -0
- package/lib/types/skillfs.d.ts +4 -64
- package/lib/types/stats/persistence.d.ts +48 -0
- package/lib/types/stats/scan.d.ts +52 -0
- package/lib/types/stats.d.ts +5 -84
- package/package.json +35 -29
- package/src/client/SkillHubSettingsCard.tsx +40 -98
- package/src/client/api.ts +0 -15
- package/src/client/locales/common.ts +2 -6
- package/src/client/locales/market.ts +25 -9
- package/src/client/locales/settings.ts +0 -4
- package/src/client/locales/skills.ts +22 -26
- package/src/client/panel/CollectionCard.tsx +125 -0
- package/src/client/panel/GroupSummary.tsx +16 -6
- package/src/client/panel/GroupSwitchButton.tsx +40 -0
- package/src/client/panel/MarketSourceRow.tsx +1 -1
- package/src/client/panel/PanelDialogs.tsx +161 -0
- package/src/client/panel/ProjectTree.tsx +106 -0
- package/src/client/panel/ReorderButtons.tsx +42 -0
- package/src/client/panel/RepoScanCard.tsx +21 -11
- package/src/client/panel/ScenesView.tsx +51 -26
- package/src/client/panel/SkillDetailView.tsx +1 -3
- package/src/client/panel/SkillHubPanel.tsx +99 -123
- package/src/client/panel/SkillRow.tsx +36 -17
- package/src/client/panel/SourcesView.tsx +103 -174
- package/src/client/panel/hooks/shared.ts +18 -0
- package/src/client/panel/hooks/useCatalogFlow.ts +14 -33
- package/src/client/panel/hooks/useGroupFlow.ts +8 -53
- package/src/client/panel/hooks/useMarketFlow.ts +26 -202
- package/src/client/panel/hooks/useMetaFlow.ts +2 -2
- package/src/client/panel/hooks/useRepoImportFlow.ts +197 -0
- package/src/client/panel/hooks/useSourceFlow.ts +11 -36
- package/src/client/panel/panel.module.css +121 -75
- package/src/client/panel/useDragReorder.ts +54 -0
- package/src/client/panel/useSkillHub.ts +12 -7
- package/src/client/settings-card.module.css +1 -1
- package/src/client/settings-card.tsx +52 -83
- package/src/concurrency.test.ts +33 -0
- package/src/concurrency.ts +19 -0
- package/src/error-text.test.ts +64 -0
- package/src/error-text.ts +52 -0
- package/src/index.ts +7 -7
- package/src/provider.test.ts +16 -0
- package/src/provider.ts +21 -2
- package/src/repo/api.ts +125 -0
- package/src/repo/discovery.ts +201 -0
- package/src/repo/github-client.ts +5 -10
- package/src/repo/install.ts +150 -0
- package/src/repo/types.ts +25 -0
- package/src/repo.ts +30 -503
- package/src/routes/catalog-data.ts +230 -0
- package/src/routes/catalog.ts +49 -46
- package/src/routes/collection.ts +36 -0
- package/src/routes/config.ts +2 -0
- package/src/routes/deps.ts +100 -0
- package/src/routes/groups.ts +15 -21
- package/src/routes/helpers.test.ts +57 -0
- package/src/routes/helpers.ts +43 -424
- package/src/routes/http.ts +119 -0
- package/src/routes/market.ts +10 -14
- package/src/routes/repo-import.ts +10 -12
- package/src/routes/route-state.test.ts +82 -0
- package/src/routes/route-state.ts +11 -6
- package/src/routes/sources.ts +18 -36
- package/src/routes.test.ts +40 -0
- package/src/skillfs/frontmatter.ts +179 -0
- package/src/skillfs/paths.ts +40 -0
- package/src/skillfs/scan.ts +175 -0
- package/src/skillfs.ts +11 -373
- package/src/stats/persistence.ts +85 -0
- package/src/stats/scan.ts +271 -0
- package/src/stats.test.ts +26 -0
- package/src/stats.ts +20 -363
- package/src/update.ts +8 -42
package/CONTRIBUTING.md
CHANGED
|
@@ -9,20 +9,48 @@ Thanks for considering a contribution to **dsh-skill-hub**. This project is a
|
|
|
9
9
|
|
|
10
10
|
Please keep both halves on official APIs — no dsh source patches.
|
|
11
11
|
|
|
12
|
+
## Layout
|
|
13
|
+
|
|
14
|
+
```
|
|
15
|
+
src/index.ts cordis plugin entry (config schema, settings namespace, stats wiring)
|
|
16
|
+
src/routes.ts route-family aggregator (wraps every domain handler in the shared fences)
|
|
17
|
+
src/routes/ one file per domain + shared layers:
|
|
18
|
+
http.ts (fences/JSON/error mapping), deps.ts (route deps + writable-skill
|
|
19
|
+
resolution), catalog-data.ts (catalog/detail assembly), collection.ts
|
|
20
|
+
(origin collections), route-state.ts (throttles + import-job table),
|
|
21
|
+
helpers.ts (barrel)
|
|
22
|
+
src/store.ts sidecar store barrel (paths / migrate / store)
|
|
23
|
+
src/skillfs.ts writable-root file ops + barrel (skillfs/paths.ts, frontmatter.ts, scan.ts)
|
|
24
|
+
src/repo.ts GitHub repo helpers barrel (repo/types.ts, discovery.ts, api.ts, install.ts,
|
|
25
|
+
github-client.ts = shared request layer)
|
|
26
|
+
src/stats.ts session-log statistics reader + barrel (stats/persistence.ts, stats/scan.ts)
|
|
27
|
+
src/provider.ts the hub's own ctx.skills provider (global layer)
|
|
28
|
+
src/protocol.ts wire contract barrel (protocol/<domain>.ts)
|
|
29
|
+
src/concurrency.ts bounded-concurrency map
|
|
30
|
+
src/error-text.ts unknown → one-line error text
|
|
31
|
+
src/client/index.tsx browser-half entry (slots + locale registration)
|
|
32
|
+
src/client/api.ts the panel's only data access path
|
|
33
|
+
src/client/panel/ panel shell, views, dialogs, hooks/ (one hook per domain + aggregator)
|
|
34
|
+
src/client/locales/ dictionaries by view (common/skills/market/sources/detail/settings)
|
|
35
|
+
```
|
|
36
|
+
|
|
12
37
|
## Development setup
|
|
13
38
|
|
|
14
39
|
```bash
|
|
15
40
|
npm install
|
|
16
41
|
npm run typecheck # tsc --noEmit
|
|
17
|
-
npm test # vitest (
|
|
42
|
+
npm test # vitest (217 tests across 13 suites)
|
|
18
43
|
npm run build # tsc declarations + tsdown bundles (lib/index.js + lib/client.js)
|
|
19
44
|
```
|
|
20
45
|
|
|
21
46
|
## Before opening a pull request
|
|
22
47
|
|
|
23
48
|
1. **Typecheck** — `npm run typecheck` must pass.
|
|
24
|
-
2. **Tests** — `npm test` must pass; add/adjust tests for any behavior change.
|
|
25
|
-
`src/*.test.ts` and mirror the real
|
|
49
|
+
2. **Tests** — `npm test` must pass; add/adjust tests for any behavior change. Suites sit next to the
|
|
50
|
+
code they cover (`src/*.test.ts`, `src/routes/*.test.ts`) and mirror the real
|
|
51
|
+
route/store/filesystem/provider behavior. The browser half has no component-test harness
|
|
52
|
+
(vitest runs in the node environment); keep browser changes mechanical and verify them in the
|
|
53
|
+
live GUI.
|
|
26
54
|
3. **Build** — `npm run build` must produce `lib/index.js` and `lib/client.js`.
|
|
27
55
|
4. **Keep the diff focused** — one logical change per PR, with a clear title and description.
|
|
28
56
|
5. **Documentation** — update `README.md` (including the embedded Chinese collapsible section) when
|
package/README.md
CHANGED
|
@@ -24,7 +24,7 @@ dsh plugin --profile web add dsh-skill-hub
|
|
|
24
24
|
# restart dsh web → Settings → 技能 → Market → scan → import
|
|
25
25
|
```
|
|
26
26
|
|
|
27
|
-
Requires `Node ^22.19 || >=24` + dsh web (`0.1.
|
|
27
|
+
Requires `Node ^22.19 || >=24` + dsh web (`0.1.5-rc.2`, `0.1.x` forward compatible).
|
|
28
28
|
|
|
29
29
|
## Features
|
|
30
30
|
|
package/README.zh.md
CHANGED