@tnotesjs/core 0.5.0 → 0.6.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.
Files changed (36) hide show
  1. package/dist/chunk-3R7QSABB.cjs +502 -0
  2. package/dist/chunk-CZXRQPFJ.js +11 -0
  3. package/dist/{chunk-XCWFZLER.js → chunk-DUTS75WQ.js} +27 -493
  4. package/dist/chunk-HXED7KVT.cjs +11 -0
  5. package/dist/chunk-IHFUHB4J.cjs +176 -0
  6. package/dist/chunk-MZIXIY2Y.cjs +216 -0
  7. package/dist/chunk-TJ4527KA.cjs +5264 -0
  8. package/dist/chunk-U6IBLREL.js +502 -0
  9. package/dist/chunk-UNFSW5C2.js +176 -0
  10. package/dist/cli/index.cjs +936 -0
  11. package/dist/cli/index.d.cts +2 -0
  12. package/dist/cli/index.d.ts +2 -0
  13. package/dist/cli/index.js +9 -6
  14. package/dist/index.cjs +8 -0
  15. package/dist/index.d.cts +56 -0
  16. package/dist/index.d.ts +56 -0
  17. package/dist/markdown/index.cjs +82 -0
  18. package/dist/markdown/index.d.cts +36 -0
  19. package/dist/markdown/index.d.ts +36 -0
  20. package/dist/markdown/index.js +82 -0
  21. package/dist/note-oGm44Rw8.d.cts +84 -0
  22. package/dist/note-oGm44Rw8.d.ts +84 -0
  23. package/dist/types-CpsEy8lA.d.cts +221 -0
  24. package/dist/types-CwBWwNVv.d.ts +221 -0
  25. package/dist/vitepress/config/index.cjs +1669 -0
  26. package/dist/vitepress/config/index.d.cts +12 -0
  27. package/dist/vitepress/config/index.d.ts +12 -0
  28. package/dist/vitepress/config/index.js +10 -4
  29. package/dist/workspace/index.cjs +1207 -0
  30. package/dist/workspace/index.d.cts +14 -0
  31. package/dist/workspace/index.d.ts +14 -0
  32. package/dist/workspace/index.js +1207 -0
  33. package/package.json +14 -1
  34. package/vitepress/components/Settings/Settings.vue +3 -3
  35. package/vitepress/components/SidebarCard/SidebarCard.vue +3 -3
  36. package/vitepress/plugins/localSearchReindexLogic.ts +11 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tnotesjs/core",
3
- "version": "0.5.0",
3
+ "version": "0.6.0",
4
4
  "description": "TNotes 知识库核心框架 —— 基于 VitePress 的笔记管理系统",
5
5
  "type": "module",
6
6
  "packageManager": "pnpm@10.17.1",
@@ -10,9 +10,21 @@
10
10
  "exports": {
11
11
  ".": {
12
12
  "types": "./dist/index.d.ts",
13
+ "require": "./dist/index.cjs",
13
14
  "import": "./dist/index.js"
14
15
  },
16
+ "./workspace": {
17
+ "types": "./dist/workspace/index.d.ts",
18
+ "require": "./dist/workspace/index.cjs",
19
+ "import": "./dist/workspace/index.js"
20
+ },
21
+ "./markdown": {
22
+ "types": "./dist/markdown/index.d.ts",
23
+ "require": "./dist/markdown/index.cjs",
24
+ "import": "./dist/markdown/index.js"
25
+ },
15
26
  "./vitepress/config": {
27
+ "require": "./dist/vitepress/config/index.cjs",
16
28
  "import": "./dist/vitepress/config/index.js"
17
29
  },
18
30
  "./vitepress/theme": {
@@ -59,6 +71,7 @@
59
71
  "marked": "^15.0.11",
60
72
  "mermaid": "^11.5.0",
61
73
  "minisearch": "^7.2.0",
74
+ "prettier": "^3.6.2",
62
75
  "sass-embedded": "^1.90.0",
63
76
  "swiper": "^11.2.1",
64
77
  "uuid": "^11.1.0",
@@ -180,6 +180,7 @@ vitepress/components/Settings/Settings.vue
180
180
  <script setup lang="ts">
181
181
  import { ref, computed, onMounted } from 'vue'
182
182
 
183
+ import { useLocalIde } from '../composables/useLocalIde'
183
184
  import {
184
185
  NOTES_DIR_KEY,
185
186
  LOCAL_IDE_KEY,
@@ -188,14 +189,13 @@ import {
188
189
  SIDEBAR_UNDONE_PREFIX_KEY,
189
190
  CONTENT_WIDTH_MODE_KEY,
190
191
  } from '../constants'
191
- import { useLocalIde } from '../composables/useLocalIde'
192
+ // @ts-expect-error - VitePress Data Loader
193
+ import { data as tnotesConfig } from '../tnotes-config.data'
192
194
  import {
193
195
  DEFAULT_LOCAL_IDE,
194
196
  normalizeLocalIde,
195
197
  type LocalIdeId,
196
198
  } from '../utils/vscodePaths'
197
- // @ts-expect-error - VitePress Data Loader
198
- import { data as tnotesConfig } from '../tnotes-config.data'
199
199
 
200
200
  type ContentWidthMode = 'wide' | 'standard'
201
201
 
@@ -6,6 +6,8 @@
6
6
  import { useData } from 'vitepress'
7
7
  import { ref, computed, watch } from 'vue'
8
8
 
9
+ import FolderTreeItems from './FolderTreeItems.vue'
10
+ import NotesTrendChart from './NotesTrendChart.vue'
9
11
  import {
10
12
  icon__fold,
11
13
  icon__github,
@@ -14,10 +16,8 @@ import {
14
16
  icon__number_gray,
15
17
  icon__number_purple,
16
18
  } from '../../assets/icons'
17
- import { NOTES_DIR_KEY, REPO_NAME, AUTHOR, ROOT_ITEM } from '../constants.ts'
18
19
  import { useLocalIde } from '../composables/useLocalIde'
19
- import FolderTreeItems from './FolderTreeItems.vue'
20
- import NotesTrendChart from './NotesTrendChart.vue'
20
+ import { NOTES_DIR_KEY, REPO_NAME, AUTHOR, ROOT_ITEM } from '../constants.ts'
21
21
  import { useSettingsDialog } from '../Settings/composables/useSettingsDialog'
22
22
  import { data as sidebarConfig } from '../sidebar.data'
23
23
  import {
@@ -34,11 +34,19 @@ export function getDocIdFromFile(input: {
34
34
  rewrites?: Record<string, string>
35
35
  absoluteOrRelativeFile: string
36
36
  }): string {
37
- const absoluteFile = path.isAbsolute(input.absoluteOrRelativeFile)
37
+ // A knowledge base can be indexed on a different host platform in tests,
38
+ // build workers or cached metadata. Select the path implementation from the
39
+ // value instead of assuming the current Node.js platform.
40
+ const pathApi = /^[a-zA-Z]:[\\/]/.test(
41
+ input.absoluteOrRelativeFile || input.srcDir,
42
+ )
43
+ ? path.win32
44
+ : path
45
+ const absoluteFile = pathApi.isAbsolute(input.absoluteOrRelativeFile)
38
46
  ? input.absoluteOrRelativeFile
39
- : path.join(input.srcDir, input.absoluteOrRelativeFile)
47
+ : pathApi.join(input.srcDir, input.absoluteOrRelativeFile)
40
48
 
41
- let relFile = slash(path.relative(input.srcDir, absoluteFile))
49
+ let relFile = slash(pathApi.relative(input.srcDir, absoluteFile))
42
50
  if (input.rewrites?.[relFile]) {
43
51
  relFile = input.rewrites[relFile]
44
52
  }