kaimon-cli 0.1.41 → 0.1.44
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/README.md +56 -0
- package/dist/__tests__/commands/pull.test.d.ts +2 -0
- package/dist/__tests__/commands/pull.test.d.ts.map +1 -0
- package/dist/__tests__/commands/pull.test.js +182 -0
- package/dist/__tests__/commands/pull.test.js.map +1 -0
- package/dist/__tests__/commands/push.test.d.ts +2 -0
- package/dist/__tests__/commands/push.test.d.ts.map +1 -0
- package/dist/__tests__/commands/push.test.js +255 -0
- package/dist/__tests__/commands/push.test.js.map +1 -0
- package/dist/__tests__/helpers.d.ts +49 -0
- package/dist/__tests__/helpers.d.ts.map +1 -0
- package/dist/__tests__/helpers.js +151 -0
- package/dist/__tests__/helpers.js.map +1 -0
- package/dist/__tests__/integration/full-workflow.test.d.ts +2 -0
- package/dist/__tests__/integration/full-workflow.test.d.ts.map +1 -0
- package/dist/__tests__/integration/full-workflow.test.js +213 -0
- package/dist/__tests__/integration/full-workflow.test.js.map +1 -0
- package/dist/__tests__/setup.d.ts +2 -0
- package/dist/__tests__/setup.d.ts.map +1 -0
- package/dist/__tests__/setup.js +24 -0
- package/dist/__tests__/setup.js.map +1 -0
- package/dist/__tests__/unit/utils/config.test.d.ts +2 -0
- package/dist/__tests__/unit/utils/config.test.d.ts.map +1 -0
- package/dist/__tests__/unit/utils/config.test.js +171 -0
- package/dist/__tests__/unit/utils/config.test.js.map +1 -0
- package/dist/__tests__/unit/utils/frontmatter.test.d.ts +2 -0
- package/dist/__tests__/unit/utils/frontmatter.test.d.ts.map +1 -0
- package/dist/__tests__/unit/utils/frontmatter.test.js +231 -0
- package/dist/__tests__/unit/utils/frontmatter.test.js.map +1 -0
- package/dist/__tests__/unit/utils/markdown.test.d.ts +2 -0
- package/dist/__tests__/unit/utils/markdown.test.d.ts.map +1 -0
- package/dist/__tests__/unit/utils/markdown.test.js +296 -0
- package/dist/__tests__/unit/utils/markdown.test.js.map +1 -0
- package/dist/__tests__/unit/utils/projectConfig.test.d.ts +2 -0
- package/dist/__tests__/unit/utils/projectConfig.test.d.ts.map +1 -0
- package/dist/__tests__/unit/utils/projectConfig.test.js +160 -0
- package/dist/__tests__/unit/utils/projectConfig.test.js.map +1 -0
- package/dist/__tests__/unit/utils/requireAuth.test.d.ts +2 -0
- package/dist/__tests__/unit/utils/requireAuth.test.d.ts.map +1 -0
- package/dist/__tests__/unit/utils/requireAuth.test.js +96 -0
- package/dist/__tests__/unit/utils/requireAuth.test.js.map +1 -0
- package/dist/__tests__/unit/utils/tokenRefresh.test.d.ts +2 -0
- package/dist/__tests__/unit/utils/tokenRefresh.test.d.ts.map +1 -0
- package/dist/__tests__/unit/utils/tokenRefresh.test.js +170 -0
- package/dist/__tests__/unit/utils/tokenRefresh.test.js.map +1 -0
- package/dist/__tests__/unit/utils/versionCheck.test.d.ts +2 -0
- package/dist/__tests__/unit/utils/versionCheck.test.d.ts.map +1 -0
- package/dist/__tests__/unit/utils/versionCheck.test.js +105 -0
- package/dist/__tests__/unit/utils/versionCheck.test.js.map +1 -0
- package/dist/commands/pull.d.ts.map +1 -1
- package/dist/commands/pull.js +2 -1
- package/dist/commands/pull.js.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -1
- package/dist/utils/frontmatter.d.ts +28 -0
- package/dist/utils/frontmatter.d.ts.map +1 -0
- package/dist/utils/frontmatter.js +79 -0
- package/dist/utils/frontmatter.js.map +1 -0
- package/dist/utils/projectConfig.d.ts.map +1 -1
- package/dist/utils/projectConfig.js +9 -1
- package/dist/utils/projectConfig.js.map +1 -1
- package/dist/utils/pushOperations.d.ts.map +1 -1
- package/dist/utils/pushOperations.js +242 -19
- package/dist/utils/pushOperations.js.map +1 -1
- package/dist/utils/syncOperations.d.ts +2 -1
- package/dist/utils/syncOperations.d.ts.map +1 -1
- package/dist/utils/syncOperations.js +153 -43
- package/dist/utils/syncOperations.js.map +1 -1
- package/dist/utils/versionCheck.d.ts +6 -0
- package/dist/utils/versionCheck.d.ts.map +1 -0
- package/dist/utils/versionCheck.js +61 -0
- package/dist/utils/versionCheck.js.map +1 -0
- package/package.json +2 -1
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { parseFrontmatter, generateFrontmatter, combineFrontmatterAndMarkdown } from '../../../utils/frontmatter.js';
|
|
3
|
+
describe('frontmatter.ts', () => {
|
|
4
|
+
describe('parseFrontmatter', () => {
|
|
5
|
+
it('should parse valid frontmatter', () => {
|
|
6
|
+
const content = `---
|
|
7
|
+
title: "Test Document"
|
|
8
|
+
kaimon_id: "doc-123"
|
|
9
|
+
created_at: "2024-01-01T00:00:00Z"
|
|
10
|
+
updated_at: "2024-01-02T00:00:00Z"
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
# Test Document
|
|
14
|
+
|
|
15
|
+
Content here.`;
|
|
16
|
+
const result = parseFrontmatter(content);
|
|
17
|
+
expect(result.hasFrontmatter).toBe(true);
|
|
18
|
+
expect(result.frontmatter).toEqual({
|
|
19
|
+
title: 'Test Document',
|
|
20
|
+
kaimon_id: 'doc-123',
|
|
21
|
+
created_at: '2024-01-01T00:00:00Z',
|
|
22
|
+
updated_at: '2024-01-02T00:00:00Z'
|
|
23
|
+
});
|
|
24
|
+
expect(result.markdown).toBe('# Test Document\n\nContent here.');
|
|
25
|
+
});
|
|
26
|
+
it('should handle content without frontmatter', () => {
|
|
27
|
+
const content = '# Just a heading\n\nSome content.';
|
|
28
|
+
const result = parseFrontmatter(content);
|
|
29
|
+
expect(result.hasFrontmatter).toBe(false);
|
|
30
|
+
expect(result.frontmatter).toEqual({});
|
|
31
|
+
expect(result.markdown).toBe(content);
|
|
32
|
+
});
|
|
33
|
+
it('should handle unclosed frontmatter', () => {
|
|
34
|
+
const content = `---
|
|
35
|
+
title: "Test"
|
|
36
|
+
# Missing closing ---
|
|
37
|
+
Content here.`;
|
|
38
|
+
const result = parseFrontmatter(content);
|
|
39
|
+
expect(result.hasFrontmatter).toBe(false);
|
|
40
|
+
expect(result.frontmatter).toEqual({});
|
|
41
|
+
expect(result.markdown).toBe(content);
|
|
42
|
+
});
|
|
43
|
+
it('should strip quotes from values', () => {
|
|
44
|
+
const content = `---
|
|
45
|
+
title: "Quoted Value"
|
|
46
|
+
author: 'Single Quoted'
|
|
47
|
+
year: 2024
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
Content`;
|
|
51
|
+
const result = parseFrontmatter(content);
|
|
52
|
+
expect(result.frontmatter.title).toBe('Quoted Value');
|
|
53
|
+
expect(result.frontmatter.author).toBe('Single Quoted');
|
|
54
|
+
expect(result.frontmatter.year).toBe('2024');
|
|
55
|
+
});
|
|
56
|
+
it('should handle values without quotes', () => {
|
|
57
|
+
const content = `---
|
|
58
|
+
title: Unquoted Value
|
|
59
|
+
count: 42
|
|
60
|
+
---
|
|
61
|
+
|
|
62
|
+
Content`;
|
|
63
|
+
const result = parseFrontmatter(content);
|
|
64
|
+
expect(result.frontmatter.title).toBe('Unquoted Value');
|
|
65
|
+
expect(result.frontmatter.count).toBe('42');
|
|
66
|
+
});
|
|
67
|
+
it('should preserve custom fields', () => {
|
|
68
|
+
const content = `---
|
|
69
|
+
title: "Test"
|
|
70
|
+
custom_field: "Custom Value"
|
|
71
|
+
another: "Another"
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
Content`;
|
|
75
|
+
const result = parseFrontmatter(content);
|
|
76
|
+
expect(result.frontmatter.custom_field).toBe('Custom Value');
|
|
77
|
+
expect(result.frontmatter.another).toBe('Another');
|
|
78
|
+
});
|
|
79
|
+
it('should handle empty frontmatter', () => {
|
|
80
|
+
const content = `---
|
|
81
|
+
---
|
|
82
|
+
|
|
83
|
+
Content`;
|
|
84
|
+
const result = parseFrontmatter(content);
|
|
85
|
+
expect(result.hasFrontmatter).toBe(true);
|
|
86
|
+
expect(result.frontmatter).toEqual({});
|
|
87
|
+
expect(result.markdown).toBe('Content');
|
|
88
|
+
});
|
|
89
|
+
it('should trim markdown content', () => {
|
|
90
|
+
const content = `---
|
|
91
|
+
title: "Test"
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
# Heading
|
|
96
|
+
|
|
97
|
+
Content`;
|
|
98
|
+
const result = parseFrontmatter(content);
|
|
99
|
+
expect(result.markdown).toBe('# Heading\n\nContent');
|
|
100
|
+
});
|
|
101
|
+
it('should handle frontmatter with special characters', () => {
|
|
102
|
+
const content = `---
|
|
103
|
+
title: "Document: With Special & Characters!"
|
|
104
|
+
path: "/docs/test.md"
|
|
105
|
+
---
|
|
106
|
+
|
|
107
|
+
Content`;
|
|
108
|
+
const result = parseFrontmatter(content);
|
|
109
|
+
expect(result.frontmatter.title).toBe('Document: With Special & Characters!');
|
|
110
|
+
expect(result.frontmatter.path).toBe('/docs/test.md');
|
|
111
|
+
});
|
|
112
|
+
});
|
|
113
|
+
describe('generateFrontmatter', () => {
|
|
114
|
+
it('should generate frontmatter in correct order', () => {
|
|
115
|
+
const frontmatter = {
|
|
116
|
+
title: 'Test Document',
|
|
117
|
+
kaimon_id: 'doc-123',
|
|
118
|
+
created_at: '2024-01-01T00:00:00Z',
|
|
119
|
+
updated_at: '2024-01-02T00:00:00Z'
|
|
120
|
+
};
|
|
121
|
+
const result = generateFrontmatter(frontmatter);
|
|
122
|
+
expect(result).toBe(`---
|
|
123
|
+
title: "Test Document"
|
|
124
|
+
kaimon_id: "doc-123"
|
|
125
|
+
created_at: "2024-01-01T00:00:00Z"
|
|
126
|
+
updated_at: "2024-01-02T00:00:00Z"
|
|
127
|
+
---`);
|
|
128
|
+
});
|
|
129
|
+
it('should maintain field order regardless of input order', () => {
|
|
130
|
+
const frontmatter = {
|
|
131
|
+
updated_at: '2024-01-02T00:00:00Z',
|
|
132
|
+
kaimon_id: 'doc-123',
|
|
133
|
+
title: 'Test Document',
|
|
134
|
+
created_at: '2024-01-01T00:00:00Z'
|
|
135
|
+
};
|
|
136
|
+
const result = generateFrontmatter(frontmatter);
|
|
137
|
+
const lines = result.split('\n');
|
|
138
|
+
expect(lines[1]).toContain('title:');
|
|
139
|
+
expect(lines[2]).toContain('kaimon_id:');
|
|
140
|
+
expect(lines[3]).toContain('created_at:');
|
|
141
|
+
expect(lines[4]).toContain('updated_at:');
|
|
142
|
+
});
|
|
143
|
+
it('should handle partial frontmatter', () => {
|
|
144
|
+
const frontmatter = {
|
|
145
|
+
title: 'Test Document',
|
|
146
|
+
kaimon_id: 'doc-123'
|
|
147
|
+
};
|
|
148
|
+
const result = generateFrontmatter(frontmatter);
|
|
149
|
+
expect(result).toBe(`---
|
|
150
|
+
title: "Test Document"
|
|
151
|
+
kaimon_id: "doc-123"
|
|
152
|
+
---`);
|
|
153
|
+
});
|
|
154
|
+
it('should include custom fields after standard fields', () => {
|
|
155
|
+
const frontmatter = {
|
|
156
|
+
title: 'Test',
|
|
157
|
+
custom_field: 'Custom Value',
|
|
158
|
+
kaimon_id: 'doc-123',
|
|
159
|
+
another: 'Another'
|
|
160
|
+
};
|
|
161
|
+
const result = generateFrontmatter(frontmatter);
|
|
162
|
+
const lines = result.split('\n');
|
|
163
|
+
expect(lines[1]).toContain('title:');
|
|
164
|
+
expect(lines[2]).toContain('kaimon_id:');
|
|
165
|
+
expect(lines[3]).toContain('custom_field:');
|
|
166
|
+
expect(lines[4]).toContain('another:');
|
|
167
|
+
});
|
|
168
|
+
it('should quote all values', () => {
|
|
169
|
+
const frontmatter = {
|
|
170
|
+
title: 'Test',
|
|
171
|
+
count: 42
|
|
172
|
+
};
|
|
173
|
+
const result = generateFrontmatter(frontmatter);
|
|
174
|
+
expect(result).toContain('title: "Test"');
|
|
175
|
+
expect(result).toContain('count: "42"');
|
|
176
|
+
});
|
|
177
|
+
});
|
|
178
|
+
describe('combineFrontmatterAndMarkdown', () => {
|
|
179
|
+
it('should combine frontmatter and markdown correctly', () => {
|
|
180
|
+
const frontmatter = {
|
|
181
|
+
title: 'Test Document',
|
|
182
|
+
kaimon_id: 'doc-123'
|
|
183
|
+
};
|
|
184
|
+
const markdown = '# Test Document\n\nContent here.';
|
|
185
|
+
const result = combineFrontmatterAndMarkdown(frontmatter, markdown);
|
|
186
|
+
expect(result).toBe(`---
|
|
187
|
+
title: "Test Document"
|
|
188
|
+
kaimon_id: "doc-123"
|
|
189
|
+
---
|
|
190
|
+
|
|
191
|
+
# Test Document
|
|
192
|
+
|
|
193
|
+
Content here.`);
|
|
194
|
+
});
|
|
195
|
+
it('should add blank line between frontmatter and markdown', () => {
|
|
196
|
+
const frontmatter = { title: 'Test' };
|
|
197
|
+
const markdown = 'Content';
|
|
198
|
+
const result = combineFrontmatterAndMarkdown(frontmatter, markdown);
|
|
199
|
+
// Should have two newlines between closing --- and content
|
|
200
|
+
expect(result).toContain('---\n\nContent');
|
|
201
|
+
});
|
|
202
|
+
it('should handle empty markdown', () => {
|
|
203
|
+
const frontmatter = { title: 'Test' };
|
|
204
|
+
const markdown = '';
|
|
205
|
+
const result = combineFrontmatterAndMarkdown(frontmatter, markdown);
|
|
206
|
+
expect(result).toContain('---\n');
|
|
207
|
+
expect(result.endsWith('---\n\n')).toBe(true);
|
|
208
|
+
});
|
|
209
|
+
});
|
|
210
|
+
describe('round-trip consistency', () => {
|
|
211
|
+
it('should maintain data through parse and generate cycle', () => {
|
|
212
|
+
const original = `---
|
|
213
|
+
title: "Test Document"
|
|
214
|
+
kaimon_id: "doc-123"
|
|
215
|
+
created_at: "2024-01-01T00:00:00Z"
|
|
216
|
+
updated_at: "2024-01-02T00:00:00Z"
|
|
217
|
+
---
|
|
218
|
+
|
|
219
|
+
# Test Document
|
|
220
|
+
|
|
221
|
+
Content here.`;
|
|
222
|
+
const { frontmatter, markdown } = parseFrontmatter(original);
|
|
223
|
+
const regenerated = combineFrontmatterAndMarkdown(frontmatter, markdown);
|
|
224
|
+
// Parse again to verify
|
|
225
|
+
const { frontmatter: frontmatter2, markdown: markdown2 } = parseFrontmatter(regenerated);
|
|
226
|
+
expect(frontmatter2).toEqual(frontmatter);
|
|
227
|
+
expect(markdown2).toBe(markdown);
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
});
|
|
231
|
+
//# sourceMappingURL=frontmatter.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"frontmatter.test.js","sourceRoot":"","sources":["../../../../src/__tests__/unit/utils/frontmatter.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,gBAAgB,EAChB,mBAAmB,EACnB,6BAA6B,EAC9B,MAAM,+BAA+B,CAAC;AAEvC,QAAQ,CAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,QAAQ,CAAC,kBAAkB,EAAE,GAAG,EAAE;QAChC,EAAE,CAAC,gCAAgC,EAAE,GAAG,EAAE;YACxC,MAAM,OAAO,GAAG;;;;;;;;;cASR,CAAC;YAET,MAAM,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;YAEzC,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACzC,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,OAAO,CAAC;gBACjC,KAAK,EAAE,eAAe;gBACtB,SAAS,EAAE,SAAS;gBACpB,UAAU,EAAE,sBAAsB;gBAClC,UAAU,EAAE,sBAAsB;aACnC,CAAC,CAAC;YACH,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;QACnE,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;YACnD,MAAM,OAAO,GAAG,mCAAmC,CAAC;YAEpD,MAAM,MAAM,GAAG,gBAAgB,CAAC,OAAO,CAAC,CAAC;YAEzC,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC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C;YAClC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAChD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,QAAQ,CAAC,wBAAwB,EAAE,GAAG,EAAE;QACtC,EAAE,CAAC,uDAAuD,EAAE,GAAG,EAAE;YAC/D,MAAM,QAAQ,GAAG;;;;;;;;;cAST,CAAC;YAET,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;YAC7D,MAAM,WAAW,GAAG,6BAA6B,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC;YAEzE,wBAAwB;YACxB,MAAM,EAAE,WAAW,EAAE,YAAY,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,gBAAgB,CAAC,WAAW,CAAC,CAAC;YAEzF,MAAM,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;YAC1C,MAAM,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACnC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.test.d.ts","sourceRoot":"","sources":["../../../../src/__tests__/unit/utils/markdown.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,296 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest';
|
|
2
|
+
import { blocknoteToMarkdown, markdownToBlocknote } from '../../../utils/markdown.js';
|
|
3
|
+
describe('markdown.ts', () => {
|
|
4
|
+
describe('blocknoteToMarkdown', () => {
|
|
5
|
+
it('should convert headings with correct levels', () => {
|
|
6
|
+
const blocks = [
|
|
7
|
+
{ type: 'heading', props: { level: 1 }, content: [{ type: 'text', text: 'Heading 1' }] },
|
|
8
|
+
{ type: 'heading', props: { level: 2 }, content: [{ type: 'text', text: 'Heading 2' }] },
|
|
9
|
+
{ type: 'heading', props: { level: 3 }, content: [{ type: 'text', text: 'Heading 3' }] }
|
|
10
|
+
];
|
|
11
|
+
const result = blocknoteToMarkdown(blocks);
|
|
12
|
+
expect(result).toBe('# Heading 1\n\n## Heading 2\n\n### Heading 3');
|
|
13
|
+
});
|
|
14
|
+
it('should convert paragraphs', () => {
|
|
15
|
+
const blocks = [
|
|
16
|
+
{ type: 'paragraph', content: [{ type: 'text', text: 'First paragraph' }] },
|
|
17
|
+
{ type: 'paragraph', content: [{ type: 'text', text: 'Second paragraph' }] }
|
|
18
|
+
];
|
|
19
|
+
const result = blocknoteToMarkdown(blocks);
|
|
20
|
+
expect(result).toBe('First paragraph\n\nSecond paragraph');
|
|
21
|
+
});
|
|
22
|
+
it('should convert bullet lists', () => {
|
|
23
|
+
const blocks = [
|
|
24
|
+
{ type: 'bulletListItem', content: [{ type: 'text', text: 'First item' }] },
|
|
25
|
+
{ type: 'bulletListItem', content: [{ type: 'text', text: 'Second item' }] },
|
|
26
|
+
{ type: 'bulletListItem', content: [{ type: 'text', text: 'Third item' }] }
|
|
27
|
+
];
|
|
28
|
+
const result = blocknoteToMarkdown(blocks);
|
|
29
|
+
expect(result).toBe('- First item\n- Second item\n- Third item');
|
|
30
|
+
});
|
|
31
|
+
it('should convert numbered lists with sequential numbering', () => {
|
|
32
|
+
const blocks = [
|
|
33
|
+
{ type: 'numberedListItem', props: { start: 1 }, content: [{ type: 'text', text: 'First' }] },
|
|
34
|
+
{ type: 'numberedListItem', props: { start: 2 }, content: [{ type: 'text', text: 'Second' }] },
|
|
35
|
+
{ type: 'numberedListItem', props: { start: 3 }, content: [{ type: 'text', text: 'Third' }] }
|
|
36
|
+
];
|
|
37
|
+
const result = blocknoteToMarkdown(blocks);
|
|
38
|
+
expect(result).toBe('1. First\n2. Second\n3. Third');
|
|
39
|
+
});
|
|
40
|
+
it('should convert check list items', () => {
|
|
41
|
+
const blocks = [
|
|
42
|
+
{ type: 'checkListItem', props: { checked: true }, content: [{ type: 'text', text: 'Done' }] },
|
|
43
|
+
{ type: 'checkListItem', props: { checked: false }, content: [{ type: 'text', text: 'Todo' }] }
|
|
44
|
+
];
|
|
45
|
+
const result = blocknoteToMarkdown(blocks);
|
|
46
|
+
expect(result).toBe('- [x] Done\n- [ ] Todo');
|
|
47
|
+
});
|
|
48
|
+
it('should convert code blocks with language', () => {
|
|
49
|
+
const blocks = [
|
|
50
|
+
{
|
|
51
|
+
type: 'codeBlock',
|
|
52
|
+
props: { language: 'javascript' },
|
|
53
|
+
content: [{ type: 'text', text: 'const x = 42;' }]
|
|
54
|
+
}
|
|
55
|
+
];
|
|
56
|
+
const result = blocknoteToMarkdown(blocks);
|
|
57
|
+
expect(result).toBe('```javascript\nconst x = 42;\n```');
|
|
58
|
+
});
|
|
59
|
+
it('should convert code blocks without language', () => {
|
|
60
|
+
const blocks = [
|
|
61
|
+
{
|
|
62
|
+
type: 'codeBlock',
|
|
63
|
+
props: {},
|
|
64
|
+
content: [{ type: 'text', text: 'plain code' }]
|
|
65
|
+
}
|
|
66
|
+
];
|
|
67
|
+
const result = blocknoteToMarkdown(blocks);
|
|
68
|
+
expect(result).toBe('```\nplain code\n```');
|
|
69
|
+
});
|
|
70
|
+
it('should convert images', () => {
|
|
71
|
+
const blocks = [
|
|
72
|
+
{
|
|
73
|
+
type: 'image',
|
|
74
|
+
props: { url: 'https://example.com/image.png', caption: 'Test Image' },
|
|
75
|
+
content: []
|
|
76
|
+
}
|
|
77
|
+
];
|
|
78
|
+
const result = blocknoteToMarkdown(blocks);
|
|
79
|
+
expect(result).toBe('');
|
|
80
|
+
});
|
|
81
|
+
it('should handle bold text', () => {
|
|
82
|
+
const blocks = [
|
|
83
|
+
{
|
|
84
|
+
type: 'paragraph',
|
|
85
|
+
content: [
|
|
86
|
+
{ type: 'text', text: 'Normal ' },
|
|
87
|
+
{ type: 'text', text: 'bold', styles: { bold: true } },
|
|
88
|
+
{ type: 'text', text: ' text' }
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
];
|
|
92
|
+
const result = blocknoteToMarkdown(blocks);
|
|
93
|
+
expect(result).toBe('Normal **bold** text');
|
|
94
|
+
});
|
|
95
|
+
it('should handle italic text', () => {
|
|
96
|
+
const blocks = [
|
|
97
|
+
{
|
|
98
|
+
type: 'paragraph',
|
|
99
|
+
content: [
|
|
100
|
+
{ type: 'text', text: 'Normal ' },
|
|
101
|
+
{ type: 'text', text: 'italic', styles: { italic: true } },
|
|
102
|
+
{ type: 'text', text: ' text' }
|
|
103
|
+
]
|
|
104
|
+
}
|
|
105
|
+
];
|
|
106
|
+
const result = blocknoteToMarkdown(blocks);
|
|
107
|
+
expect(result).toBe('Normal *italic* text');
|
|
108
|
+
});
|
|
109
|
+
it('should handle inline code', () => {
|
|
110
|
+
const blocks = [
|
|
111
|
+
{
|
|
112
|
+
type: 'paragraph',
|
|
113
|
+
content: [
|
|
114
|
+
{ type: 'text', text: 'Use ' },
|
|
115
|
+
{ type: 'text', text: 'const', styles: { code: true } },
|
|
116
|
+
{ type: 'text', text: ' keyword' }
|
|
117
|
+
]
|
|
118
|
+
}
|
|
119
|
+
];
|
|
120
|
+
const result = blocknoteToMarkdown(blocks);
|
|
121
|
+
expect(result).toBe('Use `const` keyword');
|
|
122
|
+
});
|
|
123
|
+
it('should handle strikethrough text', () => {
|
|
124
|
+
const blocks = [
|
|
125
|
+
{
|
|
126
|
+
type: 'paragraph',
|
|
127
|
+
content: [
|
|
128
|
+
{ type: 'text', text: 'Normal ' },
|
|
129
|
+
{ type: 'text', text: 'struck', styles: { strike: true } },
|
|
130
|
+
{ type: 'text', text: ' text' }
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
];
|
|
134
|
+
const result = blocknoteToMarkdown(blocks);
|
|
135
|
+
expect(result).toBe('Normal ~~struck~~ text');
|
|
136
|
+
});
|
|
137
|
+
it('should handle empty blocks', () => {
|
|
138
|
+
const blocks = [
|
|
139
|
+
{ type: 'paragraph', content: [] }
|
|
140
|
+
];
|
|
141
|
+
const result = blocknoteToMarkdown(blocks);
|
|
142
|
+
expect(result).toBe('');
|
|
143
|
+
});
|
|
144
|
+
it('should handle mixed content', () => {
|
|
145
|
+
const blocks = [
|
|
146
|
+
{ type: 'heading', props: { level: 1 }, content: [{ type: 'text', text: 'Title' }] },
|
|
147
|
+
{ type: 'paragraph', content: [{ type: 'text', text: 'Intro paragraph' }] },
|
|
148
|
+
{ type: 'bulletListItem', content: [{ type: 'text', text: 'Item 1' }] },
|
|
149
|
+
{ type: 'bulletListItem', content: [{ type: 'text', text: 'Item 2' }] }
|
|
150
|
+
];
|
|
151
|
+
const result = blocknoteToMarkdown(blocks);
|
|
152
|
+
expect(result).toContain('# Title');
|
|
153
|
+
expect(result).toContain('Intro paragraph');
|
|
154
|
+
expect(result).toContain('- Item 1');
|
|
155
|
+
expect(result).toContain('- Item 2');
|
|
156
|
+
});
|
|
157
|
+
it('should return empty string for invalid input', () => {
|
|
158
|
+
expect(blocknoteToMarkdown(null)).toBe('');
|
|
159
|
+
expect(blocknoteToMarkdown(undefined)).toBe('');
|
|
160
|
+
expect(blocknoteToMarkdown('not an array')).toBe('');
|
|
161
|
+
});
|
|
162
|
+
});
|
|
163
|
+
describe('markdownToBlocknote', () => {
|
|
164
|
+
it('should parse headings', () => {
|
|
165
|
+
const markdown = '# Heading 1\n## Heading 2\n### Heading 3';
|
|
166
|
+
const blocks = markdownToBlocknote(markdown);
|
|
167
|
+
expect(blocks).toHaveLength(3);
|
|
168
|
+
expect(blocks[0]).toMatchObject({
|
|
169
|
+
type: 'heading',
|
|
170
|
+
props: { level: 1 },
|
|
171
|
+
content: [{ type: 'text', text: 'Heading 1' }]
|
|
172
|
+
});
|
|
173
|
+
expect(blocks[1]).toMatchObject({
|
|
174
|
+
type: 'heading',
|
|
175
|
+
props: { level: 2 },
|
|
176
|
+
content: [{ type: 'text', text: 'Heading 2' }]
|
|
177
|
+
});
|
|
178
|
+
});
|
|
179
|
+
it('should parse bullet lists', () => {
|
|
180
|
+
const markdown = '- First item\n- Second item\n- Third item';
|
|
181
|
+
const blocks = markdownToBlocknote(markdown);
|
|
182
|
+
expect(blocks).toHaveLength(3);
|
|
183
|
+
expect(blocks[0]).toMatchObject({
|
|
184
|
+
type: 'bulletListItem',
|
|
185
|
+
content: [{ type: 'text', text: 'First item' }]
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
it('should parse numbered lists', () => {
|
|
189
|
+
const markdown = '1. First\n2. Second\n3. Third';
|
|
190
|
+
const blocks = markdownToBlocknote(markdown);
|
|
191
|
+
expect(blocks).toHaveLength(3);
|
|
192
|
+
expect(blocks[0]).toMatchObject({
|
|
193
|
+
type: 'numberedListItem',
|
|
194
|
+
props: { start: 1 },
|
|
195
|
+
content: [{ type: 'text', text: 'First' }]
|
|
196
|
+
});
|
|
197
|
+
expect(blocks[1]).toMatchObject({
|
|
198
|
+
type: 'numberedListItem',
|
|
199
|
+
props: { start: 2 },
|
|
200
|
+
content: [{ type: 'text', text: 'Second' }]
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
it('should parse code blocks', () => {
|
|
204
|
+
const markdown = '```javascript\nconst x = 42;\n```';
|
|
205
|
+
const blocks = markdownToBlocknote(markdown);
|
|
206
|
+
expect(blocks).toHaveLength(1);
|
|
207
|
+
expect(blocks[0]).toMatchObject({
|
|
208
|
+
type: 'codeBlock',
|
|
209
|
+
props: { language: 'javascript' },
|
|
210
|
+
content: [{ type: 'text', text: 'const x = 42;' }]
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
it('should parse paragraphs', () => {
|
|
214
|
+
const markdown = 'First paragraph\n\nSecond paragraph';
|
|
215
|
+
const blocks = markdownToBlocknote(markdown);
|
|
216
|
+
expect(blocks).toHaveLength(2);
|
|
217
|
+
expect(blocks[0]).toMatchObject({
|
|
218
|
+
type: 'paragraph',
|
|
219
|
+
content: [{ type: 'text', text: 'First paragraph' }]
|
|
220
|
+
});
|
|
221
|
+
expect(blocks[1]).toMatchObject({
|
|
222
|
+
type: 'paragraph',
|
|
223
|
+
content: [{ type: 'text', text: 'Second paragraph' }]
|
|
224
|
+
});
|
|
225
|
+
});
|
|
226
|
+
it('should handle multi-line paragraphs', () => {
|
|
227
|
+
const markdown = 'Line 1\nLine 2\nLine 3\n\nNew paragraph';
|
|
228
|
+
const blocks = markdownToBlocknote(markdown);
|
|
229
|
+
expect(blocks).toHaveLength(2);
|
|
230
|
+
expect(blocks[0].content[0].text).toBe('Line 1\nLine 2\nLine 3');
|
|
231
|
+
});
|
|
232
|
+
it('should handle empty input', () => {
|
|
233
|
+
const blocks = markdownToBlocknote('');
|
|
234
|
+
expect(blocks).toEqual([]);
|
|
235
|
+
});
|
|
236
|
+
it('should handle mixed content', () => {
|
|
237
|
+
const markdown = `# Title
|
|
238
|
+
|
|
239
|
+
Intro paragraph
|
|
240
|
+
|
|
241
|
+
- Item 1
|
|
242
|
+
- Item 2
|
|
243
|
+
|
|
244
|
+
\`\`\`python
|
|
245
|
+
print("hello")
|
|
246
|
+
\`\`\`
|
|
247
|
+
|
|
248
|
+
Final paragraph`;
|
|
249
|
+
const blocks = markdownToBlocknote(markdown);
|
|
250
|
+
expect(blocks.length).toBeGreaterThan(0);
|
|
251
|
+
expect(blocks.find(b => b.type === 'heading')).toBeDefined();
|
|
252
|
+
expect(blocks.find(b => b.type === 'bulletListItem')).toBeDefined();
|
|
253
|
+
expect(blocks.find(b => b.type === 'codeBlock')).toBeDefined();
|
|
254
|
+
expect(blocks.filter(b => b.type === 'paragraph').length).toBeGreaterThan(0);
|
|
255
|
+
});
|
|
256
|
+
});
|
|
257
|
+
describe('round-trip conversion', () => {
|
|
258
|
+
it('should maintain heading structure', () => {
|
|
259
|
+
const original = [
|
|
260
|
+
{ type: 'heading', props: { level: 1 }, content: [{ type: 'text', text: 'Title' }] },
|
|
261
|
+
{ type: 'heading', props: { level: 2 }, content: [{ type: 'text', text: 'Subtitle' }] }
|
|
262
|
+
];
|
|
263
|
+
const markdown = blocknoteToMarkdown(original);
|
|
264
|
+
const converted = markdownToBlocknote(markdown);
|
|
265
|
+
expect(converted[0].type).toBe('heading');
|
|
266
|
+
expect(converted[0].props.level).toBe(1);
|
|
267
|
+
expect(converted[1].type).toBe('heading');
|
|
268
|
+
expect(converted[1].props.level).toBe(2);
|
|
269
|
+
});
|
|
270
|
+
it('should maintain list structure', () => {
|
|
271
|
+
const original = [
|
|
272
|
+
{ type: 'bulletListItem', content: [{ type: 'text', text: 'Item 1' }] },
|
|
273
|
+
{ type: 'bulletListItem', content: [{ type: 'text', text: 'Item 2' }] }
|
|
274
|
+
];
|
|
275
|
+
const markdown = blocknoteToMarkdown(original);
|
|
276
|
+
const converted = markdownToBlocknote(markdown);
|
|
277
|
+
expect(converted.every(b => b.type === 'bulletListItem')).toBe(true);
|
|
278
|
+
expect(converted).toHaveLength(2);
|
|
279
|
+
});
|
|
280
|
+
it('should maintain code blocks', () => {
|
|
281
|
+
const original = [
|
|
282
|
+
{
|
|
283
|
+
type: 'codeBlock',
|
|
284
|
+
props: { language: 'typescript' },
|
|
285
|
+
content: [{ type: 'text', text: 'const x: number = 42;' }]
|
|
286
|
+
}
|
|
287
|
+
];
|
|
288
|
+
const markdown = blocknoteToMarkdown(original);
|
|
289
|
+
const converted = markdownToBlocknote(markdown);
|
|
290
|
+
expect(converted[0].type).toBe('codeBlock');
|
|
291
|
+
expect(converted[0].props.language).toBe('typescript');
|
|
292
|
+
expect(converted[0].content[0].text).toContain('const x: number = 42;');
|
|
293
|
+
});
|
|
294
|
+
});
|
|
295
|
+
});
|
|
296
|
+
//# sourceMappingURL=markdown.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown.test.js","sourceRoot":"","sources":["../../../../src/__tests__/unit/utils/markdown.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,O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