@tnotesjs/core 0.1.0
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.
Potentially problematic release.
This version of @tnotesjs/core might be problematic. Click here for more details.
- package/README.md +105 -0
- package/dist/chunk-K3X5OP3N.js +1532 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.js +4199 -0
- package/dist/index.d.ts +138 -0
- package/dist/index.js +9 -0
- package/package.json +74 -0
- package/types/config.ts +61 -0
- package/types/index.ts +11 -0
- package/types/note.ts +33 -0
- package/vitepress/assets/icons/icon__check.svg +3 -0
- package/vitepress/assets/icons/icon__clipboard.svg +8 -0
- package/vitepress/assets/icons/icon__close.svg +1 -0
- package/vitepress/assets/icons/icon__collapse.svg +1 -0
- package/vitepress/assets/icons/icon__confirm.svg +1 -0
- package/vitepress/assets/icons/icon__copy.svg +4 -0
- package/vitepress/assets/icons/icon__focus.svg +1 -0
- package/vitepress/assets/icons/icon__fold.svg +3 -0
- package/vitepress/assets/icons/icon__folder.svg +1 -0
- package/vitepress/assets/icons/icon__fullscreen.svg +1 -0
- package/vitepress/assets/icons/icon__fullscreen_exit.svg +1 -0
- package/vitepress/assets/icons/icon__github.svg +4 -0
- package/vitepress/assets/icons/icon__mindmap.svg +1 -0
- package/vitepress/assets/icons/icon__next.svg +1 -0
- package/vitepress/assets/icons/icon__number_gray.svg +1 -0
- package/vitepress/assets/icons/icon__number_purple.svg +1 -0
- package/vitepress/assets/icons/icon__prev.svg +1 -0
- package/vitepress/assets/icons/icon__restore.svg +1 -0
- package/vitepress/assets/icons/icon__rotate.svg +4 -0
- package/vitepress/assets/icons/icon__search.svg +1 -0
- package/vitepress/assets/icons/icon__sidebar_collapsed.svg +1 -0
- package/vitepress/assets/icons/icon__sidebar_opened.svg +1 -0
- package/vitepress/assets/icons/icon__totop.svg +6 -0
- package/vitepress/assets/icons/icon__vscode.svg +6 -0
- package/vitepress/assets/icons/icon__zoom_fit.svg +1 -0
- package/vitepress/assets/icons/icon__zoom_in.svg +1 -0
- package/vitepress/assets/icons/icon__zoom_out.svg +1 -0
- package/vitepress/assets/icons/icon__zoom_reset.svg +1 -0
- package/vitepress/assets/icons/index.ts +38 -0
- package/vitepress/components/BilibiliOutsidePlayer/BilibiliOutsidePlayer.vue +20 -0
- package/vitepress/components/CodeBlockFullscreen/CodeBlockFullscreen.vue +373 -0
- package/vitepress/components/CodeBlockFullscreen/index.ts +115 -0
- package/vitepress/components/CodeBlockFullscreen/styles.css +64 -0
- package/vitepress/components/Discussions/Discussions.module.scss +32 -0
- package/vitepress/components/Discussions/Discussions.vue +211 -0
- package/vitepress/components/EnWordList/EnWordList.module.scss +124 -0
- package/vitepress/components/EnWordList/EnWordList.vue +543 -0
- package/vitepress/components/EnWordList/RightClickMenu.module.scss +22 -0
- package/vitepress/components/EnWordList/RightClickMenu.vue +66 -0
- package/vitepress/components/Footprints/Footprints.module.scss +93 -0
- package/vitepress/components/Footprints/Footprints.vue +377 -0
- package/vitepress/components/Layout/AboutModal.module.scss +233 -0
- package/vitepress/components/Layout/AboutModal.vue +105 -0
- package/vitepress/components/Layout/AboutPanel.vue +266 -0
- package/vitepress/components/Layout/ContentCollapse.vue +603 -0
- package/vitepress/components/Layout/CustomSidebar.vue +605 -0
- package/vitepress/components/Layout/DocBeforeControls.vue +139 -0
- package/vitepress/components/Layout/DocFooter.vue +225 -0
- package/vitepress/components/Layout/ImagePreview.module.scss +201 -0
- package/vitepress/components/Layout/ImagePreview.vue +281 -0
- package/vitepress/components/Layout/Layout.module.scss +661 -0
- package/vitepress/components/Layout/Layout.vue +542 -0
- package/vitepress/components/Layout/NoteStatus.vue +140 -0
- package/vitepress/components/Layout/SidebarItems.vue +263 -0
- package/vitepress/components/Layout/SidebarNavBefore.vue +92 -0
- package/vitepress/components/Layout/Swiper.vue +167 -0
- package/vitepress/components/Layout/ToggleFullContent.module.scss +11 -0
- package/vitepress/components/Layout/ToggleFullContent.vue +34 -0
- package/vitepress/components/Layout/ToggleSidebar.module.scss +11 -0
- package/vitepress/components/Layout/ToggleSidebar.vue +35 -0
- package/vitepress/components/Layout/composables/useCollapseControl.ts +88 -0
- package/vitepress/components/Layout/composables/useNoteConfig.ts +121 -0
- package/vitepress/components/Layout/composables/useNoteSave.ts +173 -0
- package/vitepress/components/Layout/composables/useNoteValidation.ts +85 -0
- package/vitepress/components/Layout/composables/useRedirect.ts +110 -0
- package/vitepress/components/Layout/composables/useVSCodeIntegration.ts +85 -0
- package/vitepress/components/Layout/homeReadme.data.ts +124 -0
- package/vitepress/components/LoadingPage/LoadingPage.vue +192 -0
- package/vitepress/components/MarkMap/MarkMap.module.scss +159 -0
- package/vitepress/components/MarkMap/MarkMap.vue +404 -0
- package/vitepress/components/Mermaid/Mermaid.module.scss +275 -0
- package/vitepress/components/Mermaid/Mermaid.vue +364 -0
- package/vitepress/components/NotesTable/NotesTable.module.scss +77 -0
- package/vitepress/components/NotesTable/NotesTable.vue +98 -0
- package/vitepress/components/NotesTable/README.md +67 -0
- package/vitepress/components/Settings/Settings.module.scss +433 -0
- package/vitepress/components/Settings/Settings.vue +306 -0
- package/vitepress/components/SidebarCard/MindMapView.vue +483 -0
- package/vitepress/components/SidebarCard/NotesTrendChart.vue +108 -0
- package/vitepress/components/SidebarCard/SidebarCard.vue +948 -0
- package/vitepress/components/Tooltip/Tooltip.vue +70 -0
- package/vitepress/components/constants.ts +91 -0
- package/vitepress/components/notesConfig.data.ts +73 -0
- package/vitepress/components/sidebar.data.ts +59 -0
- package/vitepress/components/tnotes-config.data.ts +21 -0
- package/vitepress/components/utils.ts +26 -0
- package/vitepress/config/index.ts +126 -0
- package/vitepress/configs/constants.ts +26 -0
- package/vitepress/configs/head.config.ts +25 -0
- package/vitepress/configs/index.ts +9 -0
- package/vitepress/configs/markdown-it.d.ts +23 -0
- package/vitepress/configs/markdown.config.ts +366 -0
- package/vitepress/configs/theme.config.ts +108 -0
- package/vitepress/plugins/buildProgressPlugin.ts +390 -0
- package/vitepress/plugins/getNoteByConfigIdPlugin.ts +107 -0
- package/vitepress/plugins/renameNotePlugin.ts +60 -0
- package/vitepress/plugins/updateConfigPlugin.ts +63 -0
- package/vitepress/theme/index.ts +95 -0
- package/vitepress/theme/styles/base.scss +50 -0
- package/vitepress/theme/styles/components/404.scss +31 -0
- package/vitepress/theme/styles/components/collapse.scss +175 -0
- package/vitepress/theme/styles/components/markmap.scss +101 -0
- package/vitepress/theme/styles/components/swiper.scss +255 -0
- package/vitepress/theme/styles/index.scss +25 -0
- package/vitepress/theme/styles/layout.scss +62 -0
- package/vitepress/theme/styles/utilities.scss +39 -0
- package/vitepress/theme/styles/vitepress-override.scss +25 -0
package/README.md
ADDED
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
# TNotes.core
|
|
2
|
+
|
|
3
|
+
TNotes 知识库系统的核心共享脚本,通过 Git Submodule 被所有 [TNotes.xxx](https://github.com/orgs/tnotesjs/repositories) 知识库引用。
|
|
4
|
+
|
|
5
|
+
## 简介
|
|
6
|
+
|
|
7
|
+
TNotes.core 包含了 TNotes 知识库系统的 CLI 命令、VitePress 主题/插件、服务层、工具函数等核心代码。各 TNotes.xxx 仓库不再各自拷贝脚本,而是统一以 Git Submodule 的形式引用本仓库,挂载到 `.vitepress/tnotes/` 路径下。
|
|
8
|
+
|
|
9
|
+
## 目录结构
|
|
10
|
+
|
|
11
|
+
```
|
|
12
|
+
TNotes.core/
|
|
13
|
+
├── commands/ # CLI 命令(dev、build、push、update 等)
|
|
14
|
+
├── config/ # 配置管理(ConfigManager、默认配置、模板)
|
|
15
|
+
├── core/ # 核心模块(GitManager、NoteManager、ReadmeGenerator 等)
|
|
16
|
+
├── services/ # 服务层(file-watcher、git、note、readme、vitepress 等)
|
|
17
|
+
├── types/ # TypeScript 类型定义
|
|
18
|
+
├── utils/ # 工具函数(日志、文件操作、Markdown 解析、校验等)
|
|
19
|
+
├── vitepress/ # VitePress 主题、组件、插件、样式
|
|
20
|
+
│ ├── components/ # 自定义 Vue 组件
|
|
21
|
+
│ ├── configs/ # VitePress 配置
|
|
22
|
+
│ ├── plugins/ # VitePress 插件
|
|
23
|
+
│ └── theme/ # 主题入口与样式
|
|
24
|
+
└── index.ts # 入口文件
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## 使用方式
|
|
28
|
+
|
|
29
|
+
### 在现有 TNotes.xxx 仓库中添加
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
# 1. 删除旧的脚本目录
|
|
33
|
+
rm -rf .vitepress/tnotes
|
|
34
|
+
|
|
35
|
+
# 2. 添加 submodule
|
|
36
|
+
git submodule add https://github.com/tnotesjs/TNotes.core.git .vitepress/tnotes
|
|
37
|
+
|
|
38
|
+
# 3. 提交变更
|
|
39
|
+
git add .gitmodules .vitepress/tnotes
|
|
40
|
+
git commit -m "chore: migrate to TNotes.core submodule"
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### 克隆含 submodule 的仓库
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# 方式一:克隆时一并拉取
|
|
47
|
+
git clone --recurse-submodules https://github.com/tnotesjs/TNotes.xxx.git
|
|
48
|
+
|
|
49
|
+
# 方式二:克隆后手动初始化
|
|
50
|
+
git clone https://github.com/tnotesjs/TNotes.xxx.git
|
|
51
|
+
cd TNotes.xxx
|
|
52
|
+
git submodule update --init
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 更新 submodule 到最新版本
|
|
56
|
+
|
|
57
|
+
```bash
|
|
58
|
+
cd .vitepress/tnotes
|
|
59
|
+
git pull origin main
|
|
60
|
+
cd ../..
|
|
61
|
+
git add .vitepress/tnotes
|
|
62
|
+
git commit -m "chore: update TNotes.core"
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## 开发工作流
|
|
66
|
+
|
|
67
|
+
你可以在任意 TNotes.xxx 仓库中直接编辑 `.vitepress/tnotes/` 下的文件,改动会即时生效(VitePress HMR)。编辑完成后:
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# 1. 在 submodule 内提交并推送
|
|
71
|
+
cd .vitepress/tnotes
|
|
72
|
+
git add -A && git commit -m "feat: your change" && git push
|
|
73
|
+
|
|
74
|
+
# 2. 回到父仓库,更新 submodule 指针
|
|
75
|
+
cd ../..
|
|
76
|
+
git add .vitepress/tnotes && git commit -m "chore: update TNotes.core"
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
其它 TNotes.xxx 仓库要同步这次改动:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
cd .vitepress/tnotes && git pull origin main && cd ../..
|
|
83
|
+
git add .vitepress/tnotes && git commit -m "chore: update TNotes.core"
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
## CI/CD
|
|
87
|
+
|
|
88
|
+
各仓库的 GitHub Actions 部署工作流(`deploy.yml`)需要在 checkout 步骤中启用 submodule 拉取:
|
|
89
|
+
|
|
90
|
+
```yaml
|
|
91
|
+
- uses: actions/checkout@v4
|
|
92
|
+
with:
|
|
93
|
+
fetch-depth: 0
|
|
94
|
+
submodules: true
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## 版本管理
|
|
98
|
+
|
|
99
|
+
- 版本号遵循 [Semantic Versioning](https://semver.org/lang/zh-CN/)
|
|
100
|
+
- 变更记录见 [CHANGELOG.md](./CHANGELOG.md)
|
|
101
|
+
- 每个版本通过 Git Tag 标记(如 `v1.0.0`)
|
|
102
|
+
|
|
103
|
+
## 许可证
|
|
104
|
+
|
|
105
|
+
MIT
|