Skip to content

Commit

Permalink
Merge branch 'main' into remove-loadingindicator-react
Browse files Browse the repository at this point in the history
  • Loading branch information
jamigibbs authored Oct 19, 2023
2 parents c53ab1d + 4549f8f commit 5c73488
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 462 deletions.
2 changes: 2 additions & 0 deletions packages/design-system-dashboard-cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ If you supply search terms, it'll filter the result.

![filtered result](./img/filtered-result.png)

If you supply the string `uswds` as a search term, it'll return all web component and react binding usages where the uswds prop is being used.

**Note:** Search terms are case sensitive!

Search terms may be regex.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,6 @@ <h1><a href="index.html">All files</a> write-react-owners-to-csv.js</h1>
&nbsp;
const componentsToKeep = [
'AlertBox',
'Checkbox',
'ExpandingGroup',
'IconSearch',
'LoadingIndicator',
Expand Down
33 changes: 24 additions & 9 deletions packages/design-system-dashboard-cli/src/find-ds-components.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,9 @@ function findUsedReactComponents(vwModules, regexPattern) {
* Search vets-website and the content build for design system components.
*
* @param searchStrings {string[]} - The components to display usage for
*
* Passing in the string 'uswds' will output a list of all web components and
* web component react bindings where the uswds prop is used
*/
function findComponents(searchStrings) {
const vwModules = readAllModules(`${repos['vets-website']}/src`);
Expand All @@ -163,18 +166,30 @@ function findComponents(searchStrings) {
);

const wcTagRegex = /<(va-[^\s>]+)/gms;
const vwWebComponents = search(vwModules, wcTagRegex);
const contentBuildWC = search(contentTemplates, wcTagRegex);
const wcUswds3Regex = /<(Va[^\s]+|va-[^\s]+)(\s|\n)[^>]*?uswds/gms;

const vwComponents = [
...usedReactComponents,
...vwWebComponents,
...usedReactBindings,
];
let vwWebComponents;
let contentBuildWC;
let vwComponents;

const data = tallyResults(vwComponents, contentBuildWC);
if (searchStrings?.includes('uswds')) {
vwWebComponents = search(vwModules, wcUswds3Regex);
contentBuildWC = search(contentTemplates, wcUswds3Regex);
vwComponents = [...vwWebComponents];
} else {
vwWebComponents = search(vwModules, wcTagRegex);
contentBuildWC = search(contentTemplates, wcTagRegex);
vwComponents = [
...usedReactComponents,
...vwWebComponents,
...usedReactBindings,
];
}

return filterSearchedComponents(data, searchStrings);
const data = tallyResults(vwComponents, contentBuildWC);
return searchStrings?.includes('uswds')
? data
: filterSearchedComponents(data, searchStrings);
}

if (require.main === module) {
Expand Down
2 changes: 2 additions & 0 deletions packages/design-system-dashboard-cli/src/search-files.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ function readAllModules(rootDir) {
`${rootDir}/**/_mock-form/**`,
`${rootDir}/**/*.unit.@(js|jsx)`,
`${rootDir}/**/*.spec.@(js|jsx)`,
`${rootDir}/**/ds-playground/**`,
`${rootDir}/**/ds-v3-playground/**`,
],
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const today = require('./today');
const componentsToKeep = [
'AlertBox',
'Breadcrumbs',
'Checkbox',
'ExpandingGroup',
'IconSearch',
'Modal',
Expand Down
2 changes: 0 additions & 2 deletions packages/react-components/index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import AlertBox, { ALERT_TYPE } from './AlertBox';
import Breadcrumbs from './Breadcrumbs';
import Checkbox from './Checkbox';
import ExpandingGroup from './ExpandingGroup';
import IconBase from './IconBase';
import IconSearch from './IconSearch';
Expand All @@ -14,7 +13,6 @@ export {
AlertBox,
ALERT_TYPE,
Breadcrumbs,
Checkbox,
ExpandingGroup,
IconBase,
IconSearch,
Expand Down
170 changes: 0 additions & 170 deletions packages/react-components/src/components/Checkbox/Checkbox.jsx

This file was deleted.

73 changes: 0 additions & 73 deletions packages/react-components/src/components/Checkbox/Checkbox.mdx

This file was deleted.

Loading

0 comments on commit 5c73488

Please sign in to comment.