Skip to content

Commit

Permalink
🧐(frontend) report grommet components
Browse files Browse the repository at this point in the history
add a new config file for react-scanner to report the grommet
components in marsha frontend.
Ultimately, we would like to reduce the number of grommet components
that we use in marsha. This first step gives us a state of the art of
the current presence of it in our code.
  • Loading branch information
AlfredPichard committed Jul 6, 2023
1 parent 49c6181 commit 9673a47
Show file tree
Hide file tree
Showing 4 changed files with 146 additions and 5 deletions.
7 changes: 7 additions & 0 deletions react-scanner.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports = {
crawlFrom: "./src/frontend/",
includeSubComponents: true,
exclude: [/^(.*)node_modules([\s\S]*)$/],
importedFrom: /^(.*)grommet([\s\S]*)$/,
processors: [["count-components", { outputTo: "./report.json" }]],
};
65 changes: 65 additions & 0 deletions report.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
{
"Box": 560,
"Text": 153,
"Button": 90,
"Heading": 47,
"Paragraph": 42,
"TextInput": 21,
"Stack": 18,
"FormField": 17,
"Spinner": 17,
"Tab": 15,
"Select": 12,
"Form": 10,
"Grid": 10,
"CheckBox": 9,
"ThemeContext.Extend": 9,
"Image": 8,
"Alert": 7,
"AddCircle": 6,
"Grommet": 6,
"Tabs": 6,
"TextArea": 6,
"Anchor": 5,
"Layer": 5,
"Clock": 3,
"DropButton": 3,
"FormView": 3,
"Hide": 3,
"Meter": 3,
"Pagination": 3,
"CardBody": 2,
"Collapsible": 2,
"Document": 2,
"DocumentStore": 2,
"Footer": 2,
"FormClose": 2,
"Schedule": 2,
"StatusGoodSmall": 2,
"CardFooter": 1,
"CardHeader": 1,
"CircleAlert": 1,
"Clear": 1,
"DateInput": 1,
"DocumentText": 1,
"Facebook": 1,
"Filter": 1,
"FormCheckmark": 1,
"FormRefresh": 1,
"FormSchedule": 1,
"Github": 1,
"InProgress": 1,
"Linkedin": 1,
"Mail": 1,
"Menu": 1,
"Nav": 1,
"RadioButton": 1,
"ResponsiveContext.Provider": 1,
"Search": 1,
"SettingsOption": 1,
"StatusGood": 1,
"TextWrap": 1,
"Tip": 1,
"Trash": 1,
"Twitter": 1
}
1 change: 1 addition & 0 deletions src/frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
},
"dependencies": {
"cljs-merge": "1.1.1",
"react-scanner": "^1.1.0",
"yargs": "17.7.2"
}
}
78 changes: 73 additions & 5 deletions src/frontend/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4555,6 +4555,11 @@
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==

"@types/estree@^0.0.45":
version "0.0.45"
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.45.tgz#e9387572998e5ecdac221950dab3e8c3b16af884"
integrity sha512-jnqIUKDUqJbDIUxm0Uj7bnlMnRm1T/eZ9N+AVMqhPgzrba2GhGG5o/jCTwmdPK709nEZsGoMzXEDUjcXHa3W0g==

"@types/estree@^0.0.51":
version "0.0.51"
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.51.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40"
Expand Down Expand Up @@ -5171,6 +5176,11 @@
debug "^4.3.4"
tsutils "^3.21.0"

"@typescript-eslint/[email protected]":
version "5.20.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.20.0.tgz#fa39c3c2aa786568302318f1cb51fcf64258c20c"
integrity sha512-+d8wprF9GyvPwtoB4CxBAR/s0rpP25XKgnOvMf/gMXYDvlUC3rPFHupdTQ/ow9vn7UDe5rX02ovGYQbv/IUCbg==

"@typescript-eslint/[email protected]":
version "5.38.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.38.0.tgz#8cd15825e4874354e31800dcac321d07548b8a5f"
Expand All @@ -5196,6 +5206,19 @@
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.61.0.tgz#e99ff11b5792d791554abab0f0370936d8ca50c0"
integrity sha512-ldyueo58KjngXpzloHUog/h9REmHl59G1b3a5Sng1GfBo14BkS3ZbMEb3693gnP1k//97lh7bKsp6/V/0v1veQ==

"@typescript-eslint/[email protected]":
version "5.20.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.20.0.tgz#ab73686ab18c8781bbf249c9459a55dc9417d6b0"
integrity sha512-36xLjP/+bXusLMrT9fMMYy1KJAGgHhlER2TqpUVDYUQg4w0q/NW/sg4UGAgVwAqb8V4zYg43KMUpM8vV2lve6w==
dependencies:
"@typescript-eslint/types" "5.20.0"
"@typescript-eslint/visitor-keys" "5.20.0"
debug "^4.3.2"
globby "^11.0.4"
is-glob "^4.0.3"
semver "^7.3.5"
tsutils "^3.21.0"

"@typescript-eslint/[email protected]":
version "5.38.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.38.0.tgz#89f86b2279815c6fb7f57d68cf9b813f0dc25d98"
Expand Down Expand Up @@ -5329,6 +5352,14 @@
eslint-scope "^5.1.1"
semver "^7.3.7"

"@typescript-eslint/[email protected]":
version "5.20.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.20.0.tgz#70236b5c6b67fbaf8b2f58bf3414b76c1e826c2a"
integrity sha512-1flRpNF+0CAQkMNlTJ6L/Z5jiODG/e5+7mk6XwtPOUS3UrTz3UOiAg9jG2VtKsWI6rZQfy4C6a232QNRZTRGlg==
dependencies:
"@typescript-eslint/types" "5.20.0"
eslint-visitor-keys "^3.0.0"

"@typescript-eslint/[email protected]":
version "5.38.0"
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.38.0.tgz#60591ca3bf78aa12b25002c0993d067c00887e34"
Expand Down Expand Up @@ -6029,6 +6060,13 @@ ast-types-flow@^0.0.7:
resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad"
integrity sha512-eBvWn1lvIApYMhzQMsu9ciLfkBY499mFZlNqG+/9WR7PVlroQw0vG30cOQQbaKz3sCEc44TAOu2ykzqXSNnwag==

[email protected]:
version "1.1.1"
resolved "https://registry.yarnpkg.com/astray/-/astray-1.1.1.tgz#ca3cc638395efa5d5083019d9f5d70e60f9cf684"
integrity sha512-LizvbENqdc8tdvrms/YyYoTtlr43INJni4YZSFr8nNdfOgafi82Hcrfhjm0MdwLhRFBrDhRwtH/0fnntlESxsQ==
optionalDependencies:
"@types/estree" "^0.0.45"

astring@^1.8.0:
version "1.8.3"
resolved "https://registry.yarnpkg.com/astring/-/astring-1.8.3.tgz#1a0ae738c7cc558f8e5ddc8e3120636f5cebcb85"
Expand Down Expand Up @@ -8129,7 +8167,7 @@ dir-glob@^3.0.1:
dependencies:
path-type "^4.0.0"

dlv@^1.1.3:
dlv@1.1.3, dlv@^1.1.3:
version "1.1.3"
resolved "https://registry.yarnpkg.com/dlv/-/dlv-1.1.3.tgz#5c198a8a11453596e751494d49874bc7732f2e79"
integrity sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==
Expand Down Expand Up @@ -8283,6 +8321,11 @@ dotenv@^10.0.0:
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81"
integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==

[email protected]:
version "3.1.2"
resolved "https://registry.yarnpkg.com/dset/-/dset-3.1.2.tgz#89c436ca6450398396dc6538ea00abc0c54cd45a"
integrity sha512-g/M9sqy3oHe477Ar4voQxWtaPIFw1jTdKZuomOjhCcBx9nHUNn0pu6NopuFFrTh/TRZIKEj+76vLWFu9BNKk+Q==

duplexer@^0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6"
Expand Down Expand Up @@ -8775,7 +8818,7 @@ eslint-visitor-keys@^2.0.0, eslint-visitor-keys@^2.1.0:
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303"
integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==

eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1:
eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1:
version "3.4.1"
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz#c22c48f48942d08ca824cc526211ae400478a994"
integrity sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==
Expand Down Expand Up @@ -9127,6 +9170,11 @@ fd-slicer@~1.1.0:
dependencies:
pend "~1.2.0"

[email protected]:
version "5.2.0"
resolved "https://registry.yarnpkg.com/fdir/-/fdir-5.2.0.tgz#5b3d6ae282f8bc0ef48bf913d46f9e08496304ea"
integrity sha512-skyI2Laxtj9GYzmktPgY6DT8uswXq+VoxH26SskykvEhTSbi7tRM/787uZt/p8maxrQCJdzC90zX1btbxiJ6lw==

[email protected]:
version "9.11.0"
resolved "https://registry.yarnpkg.com/fetch-mock/-/fetch-mock-9.11.0.tgz#371c6fb7d45584d2ae4a18ee6824e7ad4b637a3f"
Expand Down Expand Up @@ -10371,6 +10419,11 @@ is-plain-obj@^4.0.0:
resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-4.1.0.tgz#d65025edec3657ce032fd7db63c97883eaed71f0"
integrity sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==

[email protected]:
version "5.0.0"
resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344"
integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==

is-plain-object@^2.0.4:
version "2.0.4"
resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677"
Expand Down Expand Up @@ -13187,7 +13240,7 @@ picocolors@^1.0.0:
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c"
integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==

picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.2.3, picomatch@^2.3.1:
picomatch@2.3.1, picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.2.3, picomatch@^2.3.1:
version "2.3.1"
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
Expand Down Expand Up @@ -14338,6 +14391,21 @@ [email protected]:
dependencies:
history "^5.1.0"

react-scanner@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/react-scanner/-/react-scanner-1.1.0.tgz#6246a8ef2ac18e77de0f78b70f03d77adc1bdea6"
integrity sha512-27G8K1TJ4FUp9+Ix5mkwhWnFdoIwYj95Ffwom0gWh3V+7zds1SRfbbRzi89EXMtZj9IiLhgEyBOBy/k6IysGNg==
dependencies:
"@typescript-eslint/typescript-estree" "5.20.0"
astray "1.1.1"
dlv "1.1.3"
dset "3.1.2"
fdir "5.2.0"
is-plain-object "5.0.0"
picomatch "2.3.1"
sade "1.8.1"
typescript "4.6.3"

[email protected]:
version "5.0.1"
resolved "https://registry.yarnpkg.com/react-scripts/-/react-scripts-5.0.1.tgz#6285dbd65a8ba6e49ca8d651ce30645a6d980003"
Expand Down Expand Up @@ -14846,7 +14914,7 @@ rw@1:
resolved "https://registry.yarnpkg.com/rw/-/rw-1.3.3.tgz#3f862dfa91ab766b14885ef4d01124bfda074fb4"
integrity sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==

sade@^1.7.3:
sade@1.8.1, sade@^1.7.3:
version "1.8.1"
resolved "https://registry.yarnpkg.com/sade/-/sade-1.8.1.tgz#0a78e81d658d394887be57d2a409bf703a3b2701"
integrity sha512-xal3CZX1Xlo/k4ApwCFrHVACi9fBqJ7V+mwhBsuf/1IOKbBy098Fex+Wa/5QMubw09pSZ/u8EY8PWgevJsXp1A==
Expand Down Expand Up @@ -16061,7 +16129,7 @@ typedarray@^0.0.6:
resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
integrity sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==

typescript@*, [email protected], typescript@^4.0, "typescript@^4.7 || 5":
typescript@*, typescript@4.6.3, typescript@4.9.5, typescript@^4.0, "typescript@^4.7 || 5":
version "4.9.5"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.5.tgz#095979f9bcc0d09da324d58d03ce8f8374cbe65a"
integrity sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==
Expand Down

0 comments on commit 9673a47

Please sign in to comment.