@agentshouse/mdmodel 0.1.0-alpha.3 → 0.1.0-alpha.5

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 (69) hide show
  1. package/README.md +74 -3
  2. package/dist/document.d.ts +2 -1
  3. package/dist/document.d.ts.map +1 -1
  4. package/dist/document.js +92 -4
  5. package/dist/document.js.map +1 -1
  6. package/dist/index.d.ts +2 -2
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js +1 -1
  9. package/dist/index.js.map +1 -1
  10. package/dist/links.d.ts +7 -1
  11. package/dist/links.d.ts.map +1 -1
  12. package/dist/links.js +259 -48
  13. package/dist/links.js.map +1 -1
  14. package/dist/paths.d.ts +1 -0
  15. package/dist/paths.d.ts.map +1 -1
  16. package/dist/paths.js +5 -0
  17. package/dist/paths.js.map +1 -1
  18. package/dist/types.d.ts +13 -0
  19. package/dist/types.d.ts.map +1 -1
  20. package/dist/types.js.map +1 -1
  21. package/dist/validate.js +3 -3
  22. package/dist/validate.js.map +1 -1
  23. package/dist/version.d.ts +1 -1
  24. package/dist/version.js +1 -1
  25. package/dist/version.js.map +1 -1
  26. package/dist/yaml.d.ts +1 -0
  27. package/dist/yaml.d.ts.map +1 -1
  28. package/dist/yaml.js +5 -3
  29. package/dist/yaml.js.map +1 -1
  30. package/fixtures/README.md +18 -0
  31. package/fixtures/cases/bracketed-link-definition/context.json +1 -0
  32. package/fixtures/cases/bracketed-link-definition/expected.json +1 -0
  33. package/fixtures/cases/bracketed-link-definition/library/item.md +10 -0
  34. package/fixtures/cases/bracketed-link-definition/library/types/task.md +7 -0
  35. package/fixtures/cases/duplicate-link-definition/context.json +1 -0
  36. package/fixtures/cases/duplicate-link-definition/expected.json +1 -0
  37. package/fixtures/cases/duplicate-link-definition/library/item.md +11 -0
  38. package/fixtures/cases/duplicate-link-definition/library/types/task.md +7 -0
  39. package/fixtures/cases/fenced-link-definition/context.json +1 -0
  40. package/fixtures/cases/fenced-link-definition/expected.json +1 -0
  41. package/fixtures/cases/fenced-link-definition/library/item.md +12 -0
  42. package/fixtures/cases/fenced-link-definition/library/types/task.md +7 -0
  43. package/fixtures/cases/interrupted-link-definition/context.json +1 -0
  44. package/fixtures/cases/interrupted-link-definition/expected.json +1 -0
  45. package/fixtures/cases/interrupted-link-definition/library/notes/draft.md +8 -0
  46. package/fixtures/cases/interrupted-link-definition/library/types/note.md +3 -0
  47. package/fixtures/cases/long-fence-link-definition/context.json +1 -0
  48. package/fixtures/cases/long-fence-link-definition/expected.json +1 -0
  49. package/fixtures/cases/long-fence-link-definition/library/notes/draft.md +9 -0
  50. package/fixtures/cases/long-fence-link-definition/library/types/note.md +3 -0
  51. package/fixtures/cases/paragraph-link-definition/context.json +5 -0
  52. package/fixtures/cases/paragraph-link-definition/expected.json +1 -0
  53. package/fixtures/cases/paragraph-link-definition/library/notes/draft.md +10 -0
  54. package/fixtures/cases/paragraph-link-definition/library/types/note.md +3 -0
  55. package/fixtures/cases/quoted-link-definition/context.json +1 -0
  56. package/fixtures/cases/quoted-link-definition/expected.json +6 -0
  57. package/fixtures/cases/quoted-link-definition/library/notes/draft.md +7 -0
  58. package/fixtures/cases/quoted-link-definition/library/types/note.md +3 -0
  59. package/fixtures/cases/truncated-link-definition/context.json +1 -0
  60. package/fixtures/cases/truncated-link-definition/expected.json +6 -0
  61. package/fixtures/cases/truncated-link-definition/library/notes/draft.md +7 -0
  62. package/fixtures/cases/truncated-link-definition/library/notes/other.md +5 -0
  63. package/fixtures/cases/truncated-link-definition/library/types/note.md +3 -0
  64. package/fixtures/cases/wide-item-fence-link/context.json +1 -0
  65. package/fixtures/cases/wide-item-fence-link/expected.json +1 -0
  66. package/fixtures/cases/wide-item-fence-link/library/notes/draft.md +7 -0
  67. package/fixtures/cases/wide-item-fence-link/library/types/note.md +3 -0
  68. package/fixtures/preamble.json +107 -0
  69. package/package.json +1 -1
@@ -0,0 +1,107 @@
1
+ [
2
+ {
3
+ "name": "CRLF frontmatter and H2 closing syntax",
4
+ "source": "---\r\ntype: note\r\ntitle: \"Kept\" # syntax\r\n---\r\n\r\n# Title\r\nIntro.\r\n\r\n## Body ###\r\nKept.\r\n",
5
+ "preamble": "\r\n# Title\r\nIntro.\r\n\r\n",
6
+ "value": "\r\nNew intro.\r\n\r\n",
7
+ "expected": "---\r\ntype: note\r\ntitle: \"Kept\" # syntax\r\n---\r\n\r\nNew intro.\r\n\r\n## Body ###\r\nKept.\r\n"
8
+ },
9
+ {
10
+ "name": "untyped document without sections",
11
+ "source": "# Title\nAll body text.",
12
+ "preamble": "# Title\nAll body text.",
13
+ "value": "Replaced without final newline.",
14
+ "expected": "Replaced without final newline."
15
+ },
16
+ {
17
+ "name": "typed document without sections",
18
+ "source": "---\ntype: note\n---\n# Title\nAll body text.",
19
+ "preamble": "# Title\nAll body text.",
20
+ "value": "New body.\n",
21
+ "expected": "---\ntype: note\n---\nNew body.\n"
22
+ },
23
+ {
24
+ "name": "empty document",
25
+ "source": "",
26
+ "preamble": "",
27
+ "value": "First text.\n",
28
+ "expected": "First text.\n"
29
+ },
30
+ {
31
+ "name": "frontmatter only",
32
+ "source": "---\ntype: note\n---\n",
33
+ "preamble": "",
34
+ "value": "First text.\n",
35
+ "expected": "---\ntype: note\n---\nFirst text.\n"
36
+ },
37
+ {
38
+ "name": "frontmatter delimiter at EOF",
39
+ "source": "---\ntype: note\n---",
40
+ "preamble": "",
41
+ "value": "\nFirst text.",
42
+ "expected": "---\ntype: note\n---\nFirst text."
43
+ },
44
+ {
45
+ "name": "section starts at offset zero",
46
+ "source": "## Body\nKept.\n",
47
+ "preamble": "",
48
+ "value": "Intro.\n\n",
49
+ "expected": "Intro.\n\n## Body\nKept.\n"
50
+ },
51
+ {
52
+ "name": "section immediately after frontmatter",
53
+ "source": "---\ntype: note\n---\n## Body\nKept.\n",
54
+ "preamble": "",
55
+ "value": "Intro.\n",
56
+ "expected": "---\ntype: note\n---\nIntro.\n## Body\nKept.\n"
57
+ },
58
+ {
59
+ "name": "backtick fence hides a heading",
60
+ "source": "```md\n## Example\n```\n\n## Body\nKept.\n",
61
+ "preamble": "```md\n## Example\n```\n\n",
62
+ "value": "Example removed.\n",
63
+ "expected": "Example removed.\n## Body\nKept.\n"
64
+ },
65
+ {
66
+ "name": "tilde fence hides a heading",
67
+ "source": " ~~~md\n## Example\n ~~~\n\n## Body\nKept.",
68
+ "preamble": " ~~~md\n## Example\n ~~~\n\n",
69
+ "value": "Example removed.\n",
70
+ "expected": "Example removed.\n## Body\nKept."
71
+ },
72
+ {
73
+ "name": "unclosed fence carries the entire body",
74
+ "source": "---\ntype: note\n---\n```\n## Example\n",
75
+ "preamble": "```\n## Example\n",
76
+ "value": "Plain replacement.\n",
77
+ "expected": "---\ntype: note\n---\nPlain replacement.\n"
78
+ },
79
+ {
80
+ "name": "existing section parser ignores other heading forms",
81
+ "source": "# Title\n### Subheading\n> ## Quoted\n ## Indented\nSetext\n------\n\n## Actual ##\nKept.\n",
82
+ "preamble": "# Title\n### Subheading\n> ## Quoted\n ## Indented\nSetext\n------\n\n",
83
+ "value": "Intro.\n",
84
+ "expected": "Intro.\n## Actual ##\nKept.\n"
85
+ },
86
+ {
87
+ "name": "Unicode and mixed newlines",
88
+ "source": "---\r\ntype: note\r\n---\r\n🙂 Вступ\r\n\n## Body\nKept.\r\n",
89
+ "preamble": "🙂 Вступ\r\n\n",
90
+ "value": "Новий 🙂\n\n",
91
+ "expected": "---\r\ntype: note\r\n---\r\nНовий 🙂\n\n## Body\nKept.\r\n"
92
+ },
93
+ {
94
+ "name": "heading at EOF and empty replacement",
95
+ "source": "Intro.\n\n## Body",
96
+ "preamble": "Intro.\n\n",
97
+ "value": "",
98
+ "expected": "## Body"
99
+ },
100
+ {
101
+ "name": "Runtime moved export link",
102
+ "source": "---\ntype: note\ntitle: Filed note\n---\n\nFiled beside [the export](../data/export.csv).\n\n## Body\n\nThe destination above sits outside every section.\n",
103
+ "preamble": "\nFiled beside [the export](../data/export.csv).\n\n",
104
+ "value": "\nFiled beside [the export](../files/export.csv).\n\n",
105
+ "expected": "---\ntype: note\ntitle: Filed note\n---\n\nFiled beside [the export](../files/export.csv).\n\n## Body\n\nThe destination above sits outside every section.\n"
106
+ }
107
+ ]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentshouse/mdmodel",
3
- "version": "0.1.0-alpha.3",
3
+ "version": "0.1.0-alpha.5",
4
4
  "description": "MD Type language, parser, validator, structured change application, Markdown syntax profile, and conformance fixtures",
5
5
  "license": "MIT",
6
6
  "type": "module",