Skip to content

Commit cef649d

Browse files
techniqclaude
andauthored
fix(docs): Skip *.webgl.svelte layer variants when generating APIs and catalogs (#115)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
1 parent a767657 commit cef649d

3 files changed

Lines changed: 9 additions & 4 deletions

File tree

‎.changeset/skip-webgl-variants.md‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@layerstack/docs': patch
3+
---
4+
5+
fix: Skip `*.webgl.svelte` layer variants (as `*.svg.svelte`, `*.canvas.svelte`, and `*.html.svelte` are) when generating component APIs and example catalogs

‎packages/docs/src/lib/node/component-api.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ import ts from 'typescript';
4646
/**
4747
* Get all canonical .svelte files in a directory (recursively).
4848
*
49-
* Skips per-layer variants (`*.svg.svelte`, `*.canvas.svelte`, `*.html.svelte`)
49+
* Skips per-layer variants (`*.svg.svelte`, `*.canvas.svelte`, `*.html.svelte`, `*.webgl.svelte`)
5050
* and the shared base impl (`*.base.svelte`) — the canonical `<Name>.svelte`
5151
* delegator re-exports the public Props type, which is what docs reference.
5252
*/
@@ -59,7 +59,7 @@ export function getSvelteFiles(dir) {
5959
// Recursively scan subdirectories (charts, layers, tooltip)
6060
files.push(...getSvelteFiles(fullPath));
6161
} else if (entry.isFile() && entry.name.endsWith('.svelte')) {
62-
if (/\.(svg|canvas|html|base)\.svelte$/.test(entry.name)) continue;
62+
if (/\.(svg|canvas|html|webgl|base)\.svelte$/.test(entry.name)) continue;
6363
files.push(fullPath);
6464
}
6565
}

‎packages/docs/src/lib/node/example-catalog.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ let EXAMPLES_DIR = '';
2727
/**
2828
* Get all canonical component files from the components directory (recursively).
2929
*
30-
* Skips per-layer variants (`*.svg.svelte`, `*.canvas.svelte`, `*.html.svelte`)
30+
* Skips per-layer variants (`*.svg.svelte`, `*.canvas.svelte`, `*.html.svelte`, `*.webgl.svelte`)
3131
* and the shared base impl (`*.base.svelte`) — only the canonical
3232
* `<Name>.svelte` is treated as a public component.
3333
*/
@@ -37,7 +37,7 @@ function getComponents(dir) {
3737
for (const entry of entries) {
3838
const fullPath = path.join(dir, entry.name);
3939
if (entry.isFile() && entry.name.endsWith('.svelte')) {
40-
if (/\.(svg|canvas|html|base)\.svelte$/.test(entry.name)) continue;
40+
if (/\.(svg|canvas|html|webgl|base)\.svelte$/.test(entry.name)) continue;
4141
// Remove .svelte extension to get component name
4242
const componentName = entry.name.replace('.svelte', '');
4343
components.push(componentName);

0 commit comments

Comments
 (0)