clarity-theme 0.1.0 → 0.1.2
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/LICENSE +20 -20
- package/README.md +70 -4
- package/README.zh-CN.md +67 -4
- package/nuxt.config.ts +217 -214
- package/package.json +35 -37
- package/{app → src}/app.config.ts +110 -110
- package/{app → src}/app.vue +5 -5
- package/{app → src}/components/blog/BlogAside.vue +25 -25
- package/{app → src}/components/blog/BlogFooter.vue +25 -25
- package/{app → src}/components/blog/BlogHeader.global.vue +48 -48
- package/{app → src}/components/blog/BlogPanel.vue +43 -43
- package/{app → src}/components/blog/BlogSidebar.vue +53 -53
- package/{app → src}/components/blog/BlogWidget.vue +42 -42
- package/{app → src}/components/blog/Mask.vue +25 -25
- package/{app → src}/components/blog/SkipToContent.vue +9 -9
- package/{app → src}/components/blog/ThemeToggle.vue +22 -22
- package/{app → src}/components/content/Badge.vue +45 -45
- package/{app → src}/components/content/Blur.vue +14 -14
- package/{app → src}/components/content/CardList.vue +8 -8
- package/{app → src}/components/content/Chat.vue +41 -41
- package/{app → src}/components/content/Copy.vue +71 -71
- package/{app → src}/components/content/EmojiClock.vue +49 -49
- package/{app → src}/components/content/FeedCard.vue +96 -96
- package/{app → src}/components/content/FeedGroup.vue +61 -61
- package/{app → src}/components/content/Folding.vue +19 -19
- package/{app → src}/components/content/Key.vue +143 -143
- package/{app → src}/components/content/LinkBanner.vue +27 -27
- package/{app → src}/components/content/LinkCard.vue +28 -28
- package/{app → src}/components/content/MdTitle.vue +8 -8
- package/{app → src}/components/content/Mermaid.vue +99 -99
- package/{app → src}/components/content/MusicScore.vue +63 -63
- package/{app → src}/components/content/Pic.vue +49 -49
- package/{app → src}/components/content/Poetry.vue +27 -27
- package/{app → src}/components/content/ProseA.vue +24 -24
- package/{app → src}/components/content/ProseCode.vue +16 -16
- package/{app → src}/components/content/ProsePre.vue +117 -117
- package/{app → src}/components/content/ProseTable.vue +23 -23
- package/{app → src}/components/content/Quote.vue +21 -21
- package/{app → src}/components/content/Tab.vue +32 -32
- package/{app → src}/components/content/Timeline.vue +33 -33
- package/{app → src}/components/content/Tip.vue +40 -40
- package/{app → src}/components/content/VideoEmbed.vue +112 -112
- package/{app → src}/components/partial/Button.vue +36 -36
- package/{app → src}/components/partial/DlGroup.vue +31 -31
- package/{app → src}/components/partial/Dropdown.vue +21 -21
- package/{app → src}/components/partial/Error.vue +39 -39
- package/{app → src}/components/partial/Expand.vue +26 -26
- package/{app → src}/components/partial/IconNavList.vue +24 -24
- package/{app → src}/components/partial/Pagination.vue +62 -62
- package/{app → src}/components/partial/RadioGroup.vue +30 -30
- package/{app → src}/components/partial/Secret.vue +11 -11
- package/{app → src}/components/partial/Slider.vue +48 -48
- package/{app → src}/components/partial/Toggle.vue +17 -17
- package/{app → src}/components/popover/Lightbox.vue +44 -44
- package/{app → src}/components/popover/Search.vue +143 -143
- package/{app → src}/components/popover/SearchItem.vue +28 -28
- package/{app → src}/components/post/Archive.vue +40 -40
- package/{app → src}/components/post/Article.vue +49 -49
- package/{app → src}/components/post/Comment.vue +119 -119
- package/{app → src}/components/post/Excerpt.vue +40 -40
- package/{app → src}/components/post/OrderToggle.vue +70 -70
- package/{app → src}/components/post/PostFooter.vue +52 -52
- package/{app → src}/components/post/PostHeader.vue +66 -66
- package/{app → src}/components/post/PostSurround.vue +51 -51
- package/{app → src}/components/post/Slide.vue +85 -85
- package/{app → src}/components/util/Date.vue +62 -62
- package/{app → src}/components/util/HydrateSafe.vue +10 -10
- package/{app → src}/components/util/Img.vue +38 -38
- package/{app → src}/components/util/Link.vue +11 -11
- package/{app → src}/components/widget/BlogLog.vue +23 -23
- package/{app → src}/components/widget/BlogStats.vue +38 -38
- package/{app → src}/components/widget/BlogTech.vue +57 -57
- package/{app → src}/components/widget/Empty.vue +3 -3
- package/{app → src}/components/widget/Toc.vue +67 -67
- package/{app → src}/composables/useArticle.ts +115 -115
- package/{app → src}/composables/useAvoid.ts +87 -87
- package/{app → src}/composables/useCopy.ts +21 -21
- package/{app → src}/composables/usePagination.ts +70 -70
- package/{app → src}/composables/useShiki.ts +129 -129
- package/{app → src}/composables/useToc.ts +57 -57
- package/{app → src}/composables/useWidgets.ts +56 -56
- package/{config → src/config}/app.ts +62 -62
- package/{config → src/config}/content.ts +75 -75
- package/{config → src/config}/define.ts +3 -3
- package/src/config/feeds.empty.ts +6 -0
- package/{config → src/config}/index.ts +1 -1
- package/{config → src/config}/schema.ts +89 -89
- package/{app → src}/error.vue +31 -31
- package/{img → src/img}/index.ts +2 -2
- package/{app → src}/layouts/default.vue +25 -25
- package/{modules → src/modules}/clarity-config/index.ts +168 -162
- package/src/modules/clarity-source-layout/index.ts +78 -0
- package/{app → src}/pages/[...slug].vue +59 -59
- package/{app → src}/pages/archive.vue +129 -129
- package/{app → src}/pages/index.vue +76 -76
- package/{app → src}/pages/link.vue +62 -62
- package/{app → src}/pages/preview.vue +46 -46
- package/{app → src}/plugins/easter-egg.ts +23 -23
- package/{app → src}/plugins/init.ts +6 -6
- package/{app → src}/plugins/tippy.ts +22 -22
- package/{public → src/public}/assets/atom.css +274 -274
- package/{public → src/public}/assets/atom.xsl +109 -109
- package/{remark-plugins → src/remark-plugins}/rehype-meta-slots.ts +58 -58
- package/{remark-plugins → src/remark-plugins}/remark-code-component.ts +41 -41
- package/{server → src/server}/api/stats.get.ts +84 -83
- package/{server → src/server}/routes/atom.xml.get.ts +85 -85
- package/{server → src/server}/routes/subscriptions.opml.get.ts +64 -64
- package/{shared → src/shared}/utils/clarity.ts +24 -24
- package/{shared → src/shared}/utils/icon.ts +218 -218
- package/{shared → src/shared}/utils/link.ts +52 -52
- package/{shared → src/shared}/utils/str.ts +88 -88
- package/{shared → src/shared}/utils/time.ts +115 -115
- package/{app → src}/shiki.config.ts +8 -8
- package/{app → src}/stores/layout.ts +34 -34
- package/{app → src}/stores/search.ts +37 -37
- package/{app → src}/types/article.ts +16 -16
- package/src/types/feed.ts +1 -0
- package/{app → src}/types/index.ts +14 -14
- package/{app → src}/types/nav.ts +11 -11
- package/{app → src}/utils/anim.ts +37 -37
- package/{app → src}/utils/img.ts +83 -83
- package/app/types/feed.ts +0 -1
- package/config/feeds.empty.ts +0 -4
- package/{app → src}/assets/css/_variable.scss +0 -0
- package/{app → src}/assets/css/animation.scss +0 -0
- package/{app → src}/assets/css/article.scss +0 -0
- package/{app → src}/assets/css/color.scss +0 -0
- package/{app → src}/assets/css/font.scss +0 -0
- package/{app → src}/assets/css/main.scss +0 -0
- package/{app → src}/assets/css/reusable.scss +0 -0
- package/{app → src}/assets/icons/solar-rewind-back-bold-duotone.svg +0 -0
- package/{app → src}/assets/icons/solar-rewind-forward-bold-duotone.svg +0 -0
- package/{app → src}/components/content/Alert.vue +0 -0
- package/{config → src/config}/content.d.mts +0 -0
- package/{config → src/config}/content.mjs +0 -0
- package/{config → src/config}/define.mjs +0 -0
- package/{config → src/config}/feed.ts +0 -0
- package/{config → src/config}/index.d.mts +0 -0
- package/{config → src/config}/index.mjs +0 -0
- package/{config → src/config}/public.ts +1 -1
- package/{config → src/config}/schema.d.mts +0 -0
- package/{config → src/config}/schema.mjs +0 -0
- package/{config → src/config}/server.ts +1 -1
- /package/{img → src/img}/index.d.mts +0 -0
- /package/{img → src/img}/index.mjs +0 -0
- /package/{modules → src/modules}/clarity-config/anti-mirror-client.ts +0 -0
- /package/{public → src/public}/fonts/AlimamaFangYuanTi.woff2 +0 -0
- /package/{remark-plugins → src/remark-plugins}/rehype-meta-slots.d.mts +0 -0
- /package/{remark-plugins → src/remark-plugins}/rehype-meta-slots.mjs +0 -0
- /package/{remark-plugins → src/remark-plugins}/remark-code-component.d.mts +0 -0
- /package/{remark-plugins → src/remark-plugins}/remark-code-component.mjs +0 -0
- /package/{server → src/server}/utils/clarity.ts +0 -0
- /package/{shared → src/shared}/types/content.ts +0 -0
- /package/{app → src}/types/modal.ts +0 -0
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 Zhilu
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Zhilu
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
21
|
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -25,14 +25,24 @@ Clarity Theme is a reusable **Nuxt 4 Layer blog theme** extracted from [L33Z22L1
|
|
|
25
25
|
| Nuxt peer | `^4.5.2` |
|
|
26
26
|
| Vue peer | `^3.5.42` |
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
Clarity is available from the npm registry as `clarity-theme`. It is part of your application runtime (the Nuxt build and static generation load the Layer directly), so install it as a regular dependency rather than a development dependency; a production install must still be able to resolve it.
|
|
29
29
|
|
|
30
30
|
## Installation
|
|
31
31
|
|
|
32
|
+
```bash
|
|
33
|
+
pnpm add clarity-theme
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Git commit installation (development fallback)
|
|
37
|
+
|
|
38
|
+
For unreleased commits, local debugging, or reviewing a specific change before it is published, install directly from GitHub instead:
|
|
39
|
+
|
|
32
40
|
```bash
|
|
33
41
|
pnpm add github:iicemeta/clarity-theme#<commit>
|
|
34
42
|
```
|
|
35
43
|
|
|
44
|
+
This path is intended for development only. Released sites should consume the published npm version so installs are reproducible and covered by the release verification matrix.
|
|
45
|
+
|
|
36
46
|
## Quick Start
|
|
37
47
|
|
|
38
48
|
### 1. Extend the Layer
|
|
@@ -83,7 +93,9 @@ Place articles under `content/posts/` and other Content pages under `content/`.
|
|
|
83
93
|
// feeds.ts
|
|
84
94
|
import type { FeedGroup } from 'clarity-theme/config'
|
|
85
95
|
|
|
86
|
-
|
|
96
|
+
const feeds: FeedGroup[] = []
|
|
97
|
+
|
|
98
|
+
export default feeds
|
|
87
99
|
```
|
|
88
100
|
|
|
89
101
|
Without this file, the friend page and OPML output use empty data and the build logs a warning.
|
|
@@ -229,8 +241,61 @@ All documents are also available in 简体中文 as sibling `*.zh-CN.md` files.
|
|
|
229
241
|
| [Patches](./docs/PATCHES.md) | Consumer patch ownership and current conclusions |
|
|
230
242
|
| [Release audit](./docs/RELEASE-AUDIT.md) | Pre-closing engineering audit and remaining release gates |
|
|
231
243
|
| [Release checklist](./docs/RELEASE-CHECKLIST.md) | Exact final checks, remaining blockers, and verification evidence |
|
|
244
|
+
| [Publishing](./docs/PUBLISHING.md) | Versioning, tags, GitHub Releases, OIDC publishing, provenance, and rollback policy |
|
|
245
|
+
| [Changelog](./CHANGELOG.md) | Consumer-facing release history |
|
|
232
246
|
| [Extraction history](./docs/history/2026-09-layer-extraction.md) | Historical phases and one-time differential validation |
|
|
233
247
|
|
|
248
|
+
## Repository Layout
|
|
249
|
+
|
|
250
|
+
The repository root is the engineering layer; all Theme runtime source lives
|
|
251
|
+
under `src/`:
|
|
252
|
+
|
|
253
|
+
```
|
|
254
|
+
clarity-theme/
|
|
255
|
+
├─ src/ # Theme runtime source (Layer srcDir)
|
|
256
|
+
│ ├─ assets/ components/ composables/ layouts/ middleware/
|
|
257
|
+
│ ├─ pages/ plugins/ stores/ types/ utils/
|
|
258
|
+
│ ├─ app.config.ts app.vue error.vue shiki.config.ts
|
|
259
|
+
│ ├─ config/ # config API sources (npm ./config ./content ./schema)
|
|
260
|
+
│ ├─ img/ # img API sources (npm ./img)
|
|
261
|
+
│ ├─ modules/ # source-layout bootstrap + clarity-config modules
|
|
262
|
+
│ ├─ public/ server/ shared/ remark-plugins/
|
|
263
|
+
├─ skills/ # Agent workflow skills (not part of the npm package)
|
|
264
|
+
├─ docs/ # Human documentation
|
|
265
|
+
├─ playground/ # Workspace-linked development consumer
|
|
266
|
+
├─ scripts/ tests/ # Verification and tooling
|
|
267
|
+
└─ nuxt.config.ts, package.json, sync-manifest.json, …
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
`nuxt.config.ts` stays at the package root. Its first module,
|
|
271
|
+
`src/modules/clarity-source-layout`, applies the `src/` directory metadata to
|
|
272
|
+
the Clarity layer only; static `srcDir`/`serverDir`/`dir.*` values are not
|
|
273
|
+
used because c12 would merge them into consumer root config. npm, Git-commit,
|
|
274
|
+
and local-directory installs therefore resolve the same layout without
|
|
275
|
+
overriding a consumer's own application directories.
|
|
276
|
+
|
|
277
|
+
The npm package, the Agent skill, and the docs are three separate concerns:
|
|
278
|
+
|
|
279
|
+
- **`clarity-theme` (npm package)** — the runtime Nuxt Layer installed with
|
|
280
|
+
`extends: ['clarity-theme']`. Its `files` field ships only `src/` plus the
|
|
281
|
+
root entry files; dev assets never enter the tarball.
|
|
282
|
+
- **`skills/migrate-blog-v3-to-clarity`** — the canonical Agent workflow for
|
|
283
|
+
migrating an existing blog-v3 project. It is versioned with the repository
|
|
284
|
+
but intentionally **not** bundled into the npm package.
|
|
285
|
+
- **`docs/`** — human-readable documentation mirrored in English and Chinese.
|
|
286
|
+
|
|
287
|
+
### Installing the migration skill
|
|
288
|
+
|
|
289
|
+
```bash
|
|
290
|
+
npx skills add iicemeta/clarity-theme --list # discover available skills
|
|
291
|
+
npx skills add iicemeta/clarity-theme --skill migrate-blog-v3-to-clarity
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
For development, `npx skills add ./skills --list` discovers the local copy.
|
|
295
|
+
To migrate a blog-v3 site with an Agent, ask it to use the
|
|
296
|
+
`migrate-blog-v3-to-clarity` skill; the human walkthrough remains
|
|
297
|
+
[Migration](./docs/MIGRATION.md).
|
|
298
|
+
|
|
234
299
|
## Development
|
|
235
300
|
|
|
236
301
|
```bash
|
|
@@ -246,6 +311,7 @@ pnpm test:migration
|
|
|
246
311
|
pnpm test:contract
|
|
247
312
|
pnpm test:consumer
|
|
248
313
|
pnpm test:compatibility
|
|
314
|
+
pnpm pack --dry-run # inspect the npm tarball without writing it
|
|
249
315
|
```
|
|
250
316
|
|
|
251
317
|
CI derives Node and pnpm versions from package metadata. It runs lint/typecheck/verify/sync/migration/contract/peers on the fixed Node matrix, then playground generate, real consumer acceptance, and rendering compatibility on the primary Node version. A separate weekly workflow only detects and reports upstream drift.
|
|
@@ -267,9 +333,9 @@ The weekly workflow only detects and reports drift. It never applies, commits, o
|
|
|
267
333
|
|
|
268
334
|
## Release Status
|
|
269
335
|
|
|
270
|
-
Clarity Theme is a **v0.1.
|
|
336
|
+
Clarity Theme is a **v0.1.2 gated npm release**. The Layer/package boundary, validated configuration, Content factory, rendering pipeline, server outputs, playground, real-consumer acceptance, compatibility matrix, three-layer CI, upstream-sync baseline, release gate, and OIDC publish workflow are implemented. See the [release checklist](./docs/RELEASE-CHECKLIST.md) for the exact remaining manual publication steps.
|
|
271
337
|
|
|
272
|
-
The
|
|
338
|
+
The v0.1.0 correctness gates from [Roadmap](./docs/ROADMAP.md) are resolved: server/client configuration is split, feature-off routes return 404 at runtime, anti-mirror navigation is verified in a real browser, the no-op random-permalink field is removed, and multi-pattern stats are covered by a regression test. Remaining deferred items are recorded in the roadmap and release notes.
|
|
273
339
|
|
|
274
340
|
## License
|
|
275
341
|
|
package/README.zh-CN.md
CHANGED
|
@@ -25,14 +25,24 @@ Clarity Theme 是一个从 [L33Z22L11/blog-v3](https://github.com/L33Z22L11/blog
|
|
|
25
25
|
| Nuxt peer | `^4.5.2` |
|
|
26
26
|
| Vue peer | `^3.5.42` |
|
|
27
27
|
|
|
28
|
-
|
|
28
|
+
Clarity 已通过 npm 注册表以 `clarity-theme` 分发。它属于应用运行时的一部分(Nuxt 构建与静态生成会直接加载 Layer),因此请将其安装为常规依赖(dependency),而不是开发依赖(devDependency);生产环境安装也必须能解析到它。
|
|
29
29
|
|
|
30
30
|
## 安装
|
|
31
31
|
|
|
32
|
+
```bash
|
|
33
|
+
pnpm add clarity-theme
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
### Git commit 安装(开发回退方式)
|
|
37
|
+
|
|
38
|
+
如需使用未发布的 commit、本地调试,或在发布前审查某个具体变更,可以直接从 GitHub 安装:
|
|
39
|
+
|
|
32
40
|
```bash
|
|
33
41
|
pnpm add github:iicemeta/clarity-theme#<commit>
|
|
34
42
|
```
|
|
35
43
|
|
|
44
|
+
该方式仅用于开发场景。正式站点应使用已发布的 npm 版本,以保证安装可复现并被发布验证矩阵覆盖。
|
|
45
|
+
|
|
36
46
|
## 快速开始
|
|
37
47
|
|
|
38
48
|
### 1. 继承 Layer
|
|
@@ -83,7 +93,9 @@ export default createClarityContentConfig(clarityConfig)
|
|
|
83
93
|
// feeds.ts
|
|
84
94
|
import type { FeedGroup } from 'clarity-theme/config'
|
|
85
95
|
|
|
86
|
-
|
|
96
|
+
const feeds: FeedGroup[] = []
|
|
97
|
+
|
|
98
|
+
export default feeds
|
|
87
99
|
```
|
|
88
100
|
|
|
89
101
|
如果没有这个文件,友链页面和 OPML 输出会使用空数据,并且构建时会记录一条警告。
|
|
@@ -250,8 +262,58 @@ UI 分组、同路径组件覆盖、CSS 覆盖、服务端/路由自定义与 Sh
|
|
|
250
262
|
| [补丁说明](./docs/PATCHES.zh-CN.md) | 使用方补丁归属与当前结论 |
|
|
251
263
|
| [发布审计](./docs/RELEASE-AUDIT.zh-CN.md) | 收尾前工程审计与剩余发布门槛 |
|
|
252
264
|
| [发布清单](./docs/RELEASE-CHECKLIST.zh-CN.md) | 确切的最终检查、剩余阻塞项与验证证据 |
|
|
265
|
+
| [发布指南](./docs/PUBLISHING.zh-CN.md) | 版本管理、tag、GitHub Release、OIDC 发布、provenance 与回滚策略 |
|
|
266
|
+
| [更新日志](./CHANGELOG.md) | 面向使用者的发布历史 |
|
|
253
267
|
| [抽取历史](./docs/history/2026-09-layer-extraction.zh-CN.md) | 历史阶段与一次性差分验证 |
|
|
254
268
|
|
|
269
|
+
## 仓库结构
|
|
270
|
+
|
|
271
|
+
仓库根目录是工程管理层;Theme 的全部运行时源码统一放在 `src/`:
|
|
272
|
+
|
|
273
|
+
```
|
|
274
|
+
clarity-theme/
|
|
275
|
+
├─ src/ # Theme 运行时源码(Layer srcDir)
|
|
276
|
+
│ ├─ assets/ components/ composables/ layouts/ middleware/
|
|
277
|
+
│ ├─ pages/ plugins/ stores/ types/ utils/
|
|
278
|
+
│ ├─ app.config.ts app.vue error.vue shiki.config.ts
|
|
279
|
+
│ ├─ config/ # config API 源码(npm ./config ./content ./schema)
|
|
280
|
+
│ ├─ img/ # img API 源码(npm ./img)
|
|
281
|
+
│ ├─ modules/ # source-layout 引导模块 + clarity-config 模块
|
|
282
|
+
│ ├─ public/ server/ shared/ remark-plugins/
|
|
283
|
+
├─ skills/ # Agent 工作流 Skill(不进入 npm 包)
|
|
284
|
+
├─ docs/ # 人工文档
|
|
285
|
+
├─ playground/ # workspace 链接的开发用消费项目
|
|
286
|
+
├─ scripts/ tests/ # 验证与工具脚本
|
|
287
|
+
└─ nuxt.config.ts、package.json、sync-manifest.json、…
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
`nuxt.config.ts` 保留在包根目录。它最先加载的
|
|
291
|
+
`src/modules/clarity-source-layout` 只为 Clarity 自身 layer 应用 `src/`
|
|
292
|
+
目录元数据;不静态声明 `srcDir`/`serverDir`/`dir.*`,是因为 c12 会把它们
|
|
293
|
+
合并进未显式覆盖这些键的 consumer root 配置。因此 npm 安装、Git commit
|
|
294
|
+
安装与本地目录安装解析到同一份布局,同时不会覆盖 consumer 自己的
|
|
295
|
+
应用目录。
|
|
296
|
+
|
|
297
|
+
npm 包、Agent Skill 与文档三者职责分离:
|
|
298
|
+
|
|
299
|
+
- **`clarity-theme`(npm 包)** — 运行时 Nuxt Layer,通过
|
|
300
|
+
`extends: ['clarity-theme']` 使用。`files` 只发布 `src/` 与根入口文件,
|
|
301
|
+
开发资产不会进入 tarball。
|
|
302
|
+
- **`skills/migrate-blog-v3-to-clarity`** — 迁移既有 blog-v3 项目的
|
|
303
|
+
Agent 工作流 Skill。它与仓库一起版本化,但**刻意不**打进 npm 包。
|
|
304
|
+
- **`docs/`** — 中英双语的人工文档。
|
|
305
|
+
|
|
306
|
+
### 安装迁移 Skill
|
|
307
|
+
|
|
308
|
+
```bash
|
|
309
|
+
npx skills add iicemeta/clarity-theme --list # 发现可用 Skill
|
|
310
|
+
npx skills add iicemeta/clarity-theme --skill migrate-blog-v3-to-clarity
|
|
311
|
+
```
|
|
312
|
+
|
|
313
|
+
开发环境可用 `npx skills add ./skills --list` 发现本地副本。让 Agent 迁移
|
|
314
|
+
blog-v3 站点时,请让它使用 `migrate-blog-v3-to-clarity` Skill;人工流程
|
|
315
|
+
见[迁移指南](./docs/MIGRATION.zh-CN.md)。
|
|
316
|
+
|
|
255
317
|
## 开发
|
|
256
318
|
|
|
257
319
|
```bash
|
|
@@ -267,6 +329,7 @@ pnpm test:migration
|
|
|
267
329
|
pnpm test:contract
|
|
268
330
|
pnpm test:consumer
|
|
269
331
|
pnpm test:compatibility
|
|
332
|
+
pnpm pack --dry-run # 不落盘检查 npm tarball
|
|
270
333
|
```
|
|
271
334
|
|
|
272
335
|
CI 从包元数据推导 Node 与 pnpm 版本。它先在固定的 Node 矩阵上运行 lint/typecheck/verify/sync/migration/contract/peers,再在主 Node 版本上运行 playground 生成、真实消费者验收与渲染兼容性。另有一个每周工作流只检测并报告上游漂移。
|
|
@@ -288,9 +351,9 @@ pnpm sync:verify # 重新运行主题纯度与基线检查
|
|
|
288
351
|
|
|
289
352
|
## 发布状态
|
|
290
353
|
|
|
291
|
-
Clarity Theme 是一个 **v0.1.
|
|
354
|
+
Clarity Theme 是一个 **v0.1.2 门禁 npm 发布版本**。Layer/包边界、已校验配置、Content 工厂、渲染管线、服务端输出、playground、真实消费者验收、兼容性矩阵、三层 CI、上游同步基线、发布门禁与 OIDC 发布工作流均已实现。剩余的人工发布步骤见[发布检查清单](./docs/RELEASE-CHECKLIST.zh-CN.md)。
|
|
292
355
|
|
|
293
|
-
|
|
356
|
+
[路线图](./docs/ROADMAP.zh-CN.md)中的 v0.1.0 正确性门禁已解决:服务端/客户端配置已拆分、功能关闭路由在运行时返回 404、反镜像导航已在真实浏览器中验证、no-op 随机固定链接字段已移除,多模式统计已增加回归测试。其余推迟事项记录在路线图与发布说明中。
|
|
294
357
|
|
|
295
358
|
## 许可证
|
|
296
359
|
|