feat(cli): add @videojs/cli docs command for LLM-friendly installation (#1214)

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Darius Cepulis
2026-04-14 11:07:49 -05:00
committed by GitHub
co-authored by Claude Opus 4.6
parent 9681515446
commit 24b8b77c8a
49 changed files with 2061 additions and 460 deletions
@@ -0,0 +1,65 @@
import { describe, expect, it } from 'vitest';
import { replaceMarker } from '../replace.js';
describe('replaceMarker', () => {
it('replaces content between markers', () => {
const markdown = `# Title
<!-- cli:replace test -->
old content here
<!-- /cli:replace test -->
## Footer`;
const result = replaceMarker(markdown, 'test', 'new content');
expect(result).toBe(`# Title
new content
## Footer`);
});
it('returns unchanged markdown when marker not found', () => {
const markdown = '# Title\n\nSome content';
const result = replaceMarker(markdown, 'missing', 'replacement');
expect(result).toBe(markdown);
});
it('preserves content before and after markers', () => {
const markdown = `before
<!-- cli:replace id -->
middle
<!-- /cli:replace id -->
after`;
const result = replaceMarker(markdown, 'id', 'replaced');
expect(result).toContain('before');
expect(result).toContain('after');
expect(result).toContain('replaced');
expect(result).not.toContain('middle');
});
it('treats $ patterns in replacement literally', () => {
const markdown = `start
<!-- cli:replace test -->
old
<!-- /cli:replace test -->
end`;
const result = replaceMarker(markdown, 'test', 'https://example.com/video.php?id=$1&ref=$&');
expect(result).toContain('https://example.com/video.php?id=$1&ref=$&');
});
it('handles multiline content between markers', () => {
const markdown = `start
<!-- cli:replace multi -->
line 1
line 2
line 3
<!-- /cli:replace multi -->
end`;
const result = replaceMarker(markdown, 'multi', 'single line');
expect(result).toBe('start\nsingle line\nend');
});
});