Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ src/pages/protocol/tips/tip-*
# Test scratch files
guides/tmp/

# Bundle analysis
.bundle-baseline.json
stats.json
lighthouse-*.json

# Playwright
playwright-report/
test-results/
Expand Down
17 changes: 10 additions & 7 deletions e2e/no-raw-mermaid.test.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { expect, test } from '@playwright/test'
import { readdirSync, readFileSync, statSync } from 'node:fs'
import { readdirSync, readFileSync } from 'node:fs'
import { dirname, join } from 'node:path'
import { fileURLToPath } from 'node:url'
import { expect, test } from '@playwright/test'

const __dirname = dirname(fileURLToPath(import.meta.url))

Expand All @@ -26,13 +26,16 @@ test('no raw ```mermaid code blocks in MDX files', () => {
for (const file of mdxFiles) {
const content = readFileSync(file, 'utf-8')
if (/^```mermaid\s*$/m.test(content)) {
const relative = file.replace(join(__dirname, '..') + '/', '')
const relative = file.replace(`${join(__dirname, '..')}/`, '')
violations.push(relative)
}
}

expect(violations, [
'Found raw ```mermaid code blocks. Use <StaticMermaidDiagram> instead:',
...violations.map((f) => ` - ${f}`),
].join('\n')).toHaveLength(0)
expect(
violations,
[
'Found raw ```mermaid code blocks. Use <StaticMermaidDiagram> instead:',
...violations.map((f) => ` - ${f}`),
].join('\n'),
).toHaveLength(0)
})
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,12 @@
"check": "biome check --write --unsafe .",
"check:types": "tsgo --project tsconfig.json --noEmit",
"preview": "node dist/preview.js",
"test:e2e": "playwright test"
"test:e2e": "playwright test",
"bundle:analyze": "node --experimental-strip-types scripts/bundle-diff.ts --skip-build",
"bundle:diff": "node --experimental-strip-types scripts/bundle-diff.ts",
"bundle:save": "node --experimental-strip-types scripts/bundle-diff.ts --save",
"lighthouse": "node --experimental-strip-types scripts/lighthouse.ts",
"lighthouse:mobile": "node --experimental-strip-types scripts/lighthouse.ts --mobile"
},
"dependencies": {
"@iconify-json/lucide": "^1.2.86",
Expand Down
Loading
Loading