@tnotesjs/core 0.6.1 → 0.7.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 (42) hide show
  1. package/config/templates.ts +0 -5
  2. package/dist/{chunk-5F5RJ2HV.cjs → chunk-7FEANCT6.cjs} +16 -7
  3. package/dist/chunk-AGVER5MX.cjs +1746 -0
  4. package/dist/{chunk-TJ4527KA.cjs → chunk-BL22KD4V.cjs} +324 -950
  5. package/dist/{chunk-56PKXCOX.js → chunk-GWG75A5M.js} +13 -4
  6. package/dist/{chunk-DUTS75WQ.js → chunk-XNO3PCEH.js} +374 -1000
  7. package/dist/chunk-ZEQS64PE.js +1746 -0
  8. package/dist/cli/index.cjs +76 -155
  9. package/dist/cli/index.js +10 -89
  10. package/dist/markdown/index.cjs +2 -3
  11. package/dist/markdown/index.d.cts +1 -1
  12. package/dist/markdown/index.d.ts +1 -1
  13. package/dist/markdown/index.js +1 -2
  14. package/dist/{types-CwBWwNVv.d.ts → types-C_d0fFeD.d.ts} +8 -1
  15. package/dist/{types-CpsEy8lA.d.cts → types-MRBGgJTX.d.cts} +8 -1
  16. package/dist/vitepress/config/index.cjs +200 -132
  17. package/dist/vitepress/config/index.js +187 -119
  18. package/dist/workspace/index.cjs +4 -1202
  19. package/dist/workspace/index.d.cts +2 -2
  20. package/dist/workspace/index.d.ts +2 -2
  21. package/dist/workspace/index.js +4 -1202
  22. package/package.json +1 -1
  23. package/services/file-watcher/folderChangeHandler.ts +19 -15
  24. package/services/file-watcher/globalUpdateCoordinator.ts +21 -27
  25. package/services/file-watcher/service.ts +1 -6
  26. package/services/index.ts +0 -1
  27. package/services/note/service.ts +4 -6
  28. package/services/readme/service.ts +11 -18
  29. package/services/reconcileToc.ts +20 -0
  30. package/utils/index.ts +0 -9
  31. package/{services/toc → utils}/moveTocInside.test.ts +1 -1
  32. package/vitepress/components/constants.ts +2 -2
  33. package/vitepress/components/sidebar.data.ts +8 -5
  34. package/vitepress/plugins/sidebarStructurePlugin.ts +242 -145
  35. package/dist/chunk-3R7QSABB.cjs +0 -502
  36. package/dist/chunk-CZXRQPFJ.js +0 -11
  37. package/dist/chunk-HXED7KVT.cjs +0 -11
  38. package/dist/chunk-U6IBLREL.js +0 -502
  39. package/services/toc/index.ts +0 -5
  40. package/services/toc/service.ts +0 -759
  41. package/utils/migrateReadmeToToc.test.ts +0 -111
  42. package/utils/migrateReadmeToToc.ts +0 -135
@@ -1,11 +1,19 @@
1
- import {
2
- generateAnchor
3
- } from "./chunk-CZXRQPFJ.js";
1
+ // utils/generateAnchor.ts
2
+ import GithubSlugger from "github-slugger";
3
+ var slugger = new GithubSlugger();
4
+ var generateAnchor = (label) => {
5
+ slugger.reset();
6
+ return slugger.slug(label);
7
+ };
4
8
 
5
9
  // markdown/noteFormatter.ts
6
- import { format as prettierFormat } from "prettier";
7
10
  var NOTE_TOC_START_TAG = "<!-- region:toc -->";
8
11
  var NOTE_TOC_END_TAG = "<!-- endregion:toc -->";
12
+ async function prettierFormat(content, options) {
13
+ const module = await import("prettier");
14
+ const prettier = module.default ?? module;
15
+ return prettier.format(content, options);
16
+ }
9
17
  function generatedNoteTitle(input) {
10
18
  const dirName = `${input.noteIndex}. ${input.title}`;
11
19
  const encodedDirName = encodeURIComponent(dirName);
@@ -170,6 +178,7 @@ async function formatTNotesNote(input) {
170
178
  }
171
179
 
172
180
  export {
181
+ generateAnchor,
173
182
  NOTE_TOC_START_TAG,
174
183
  NOTE_TOC_END_TAG,
175
184
  formatTNotesNote