Skip to content

Commit d6e5e8c

Browse files
authored
docs: generalized config set (#4606)
1 parent d490918 commit d6e5e8c

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

showcases/patternhub/scripts/generate-test-table.js

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
import FS from 'node:fs';
22
import { getComponentName } from './utils.js';
33

4+
// If you want to hide components from the test table, add it to the unlistedComponents array.
5+
const unlistedComponents = new Set([
6+
'page',
7+
'custom-select-form-field',
8+
'custom-select-dropdown'
9+
]);
10+
const unlistedSubComponentsPrefixes = new Set(['-list', '-panel', '-item']);
11+
412
const webTypesPath = './../../output/stencil/dist/web-types.json';
513

614
const generateTestTable = () => {
@@ -22,14 +30,10 @@ const generateTestTable = () => {
2230
for (const { name } of elements) {
2331
const componentName = getComponentName(name);
2432
if (
25-
[
26-
'page',
27-
'custom-select-form-field',
28-
'custom-select-dropdown'
29-
].includes(componentName) ||
30-
componentName.endsWith('-list') ||
31-
componentName.endsWith('-panel') ||
32-
componentName.endsWith('-item')
33+
unlistedComponents.has(componentName) ||
34+
[...unlistedSubComponentsPrefixes].some((suffix) =>
35+
componentName.endsWith(suffix)
36+
)
3337
) {
3438
// We don't want to add something like accordion-item
3539
continue;

0 commit comments

Comments
 (0)