Skip to content

Commit 6b292af

Browse files
author
alfredpichard
committed
🧐(frontend) report grommet components
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.
1 parent 49c6181 commit 6b292af

File tree

5 files changed

+147
-5
lines changed

5 files changed

+147
-5
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ Versioning](https://semver.org/spec/v2.0.0.html).
1313
- Create a default playlist for new shibboleth user
1414
- Lifecycle rule on source bucket to expire uploaded
1515
object after 21 days.
16+
- Report grommet components in the frontend.
1617

1718
### Changed
1819

react-scanner.config.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports = {
2+
crawlFrom: "./src/frontend/",
3+
includeSubComponents: true,
4+
exclude: [/^(.*)node_modules([\s\S]*)$/],
5+
importedFrom: /^(.*)grommet([\s\S]*)$/,
6+
processors: [["count-components", { outputTo: "./report.json" }]],
7+
};

report.json

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"Box": 560,
3+
"Text": 153,
4+
"Button": 90,
5+
"Heading": 47,
6+
"Paragraph": 42,
7+
"TextInput": 21,
8+
"Stack": 18,
9+
"FormField": 17,
10+
"Spinner": 17,
11+
"Tab": 15,
12+
"Select": 12,
13+
"Form": 10,
14+
"Grid": 10,
15+
"CheckBox": 9,
16+
"ThemeContext.Extend": 9,
17+
"Image": 8,
18+
"Alert": 7,
19+
"AddCircle": 6,
20+
"Grommet": 6,
21+
"Tabs": 6,
22+
"TextArea": 6,
23+
"Anchor": 5,
24+
"Layer": 5,
25+
"Clock": 3,
26+
"DropButton": 3,
27+
"FormView": 3,
28+
"Hide": 3,
29+
"Meter": 3,
30+
"Pagination": 3,
31+
"CardBody": 2,
32+
"Collapsible": 2,
33+
"Document": 2,
34+
"DocumentStore": 2,
35+
"Footer": 2,
36+
"FormClose": 2,
37+
"Schedule": 2,
38+
"StatusGoodSmall": 2,
39+
"CardFooter": 1,
40+
"CardHeader": 1,
41+
"CircleAlert": 1,
42+
"Clear": 1,
43+
"DateInput": 1,
44+
"DocumentText": 1,
45+
"Facebook": 1,
46+
"Filter": 1,
47+
"FormCheckmark": 1,
48+
"FormRefresh": 1,
49+
"FormSchedule": 1,
50+
"Github": 1,
51+
"InProgress": 1,
52+
"Linkedin": 1,
53+
"Mail": 1,
54+
"Menu": 1,
55+
"Nav": 1,
56+
"RadioButton": 1,
57+
"ResponsiveContext.Provider": 1,
58+
"Search": 1,
59+
"SettingsOption": 1,
60+
"StatusGood": 1,
61+
"TextWrap": 1,
62+
"Tip": 1,
63+
"Trash": 1,
64+
"Twitter": 1
65+
}

src/frontend/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@
6767
},
6868
"dependencies": {
6969
"cljs-merge": "1.1.1",
70+
"react-scanner": "^1.1.0",
7071
"yargs": "17.7.2"
7172
}
7273
}

src/frontend/yarn.lock

Lines changed: 73 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4555,6 +4555,11 @@
45554555
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.39.tgz#e177e699ee1b8c22d23174caaa7422644389509f"
45564556
integrity sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==
45574557

4558+
"@types/estree@^0.0.45":
4559+
version "0.0.45"
4560+
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.45.tgz#e9387572998e5ecdac221950dab3e8c3b16af884"
4561+
integrity sha512-jnqIUKDUqJbDIUxm0Uj7bnlMnRm1T/eZ9N+AVMqhPgzrba2GhGG5o/jCTwmdPK709nEZsGoMzXEDUjcXHa3W0g==
4562+
45584563
"@types/estree@^0.0.51":
45594564
version "0.0.51"
45604565
resolved "https://registry.yarnpkg.com/@types/estree/-/estree-0.0.51.tgz#cfd70924a25a3fd32b218e5e420e6897e1ac4f40"
@@ -5171,6 +5176,11 @@
51715176
debug "^4.3.4"
51725177
tsutils "^3.21.0"
51735178

5179+
"@typescript-eslint/[email protected]":
5180+
version "5.20.0"
5181+
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.20.0.tgz#fa39c3c2aa786568302318f1cb51fcf64258c20c"
5182+
integrity sha512-+d8wprF9GyvPwtoB4CxBAR/s0rpP25XKgnOvMf/gMXYDvlUC3rPFHupdTQ/ow9vn7UDe5rX02ovGYQbv/IUCbg==
5183+
51745184
"@typescript-eslint/[email protected]":
51755185
version "5.38.0"
51765186
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.38.0.tgz#8cd15825e4874354e31800dcac321d07548b8a5f"
@@ -5196,6 +5206,19 @@
51965206
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.61.0.tgz#e99ff11b5792d791554abab0f0370936d8ca50c0"
51975207
integrity sha512-ldyueo58KjngXpzloHUog/h9REmHl59G1b3a5Sng1GfBo14BkS3ZbMEb3693gnP1k//97lh7bKsp6/V/0v1veQ==
51985208

5209+
"@typescript-eslint/[email protected]":
5210+
version "5.20.0"
5211+
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.20.0.tgz#ab73686ab18c8781bbf249c9459a55dc9417d6b0"
5212+
integrity sha512-36xLjP/+bXusLMrT9fMMYy1KJAGgHhlER2TqpUVDYUQg4w0q/NW/sg4UGAgVwAqb8V4zYg43KMUpM8vV2lve6w==
5213+
dependencies:
5214+
"@typescript-eslint/types" "5.20.0"
5215+
"@typescript-eslint/visitor-keys" "5.20.0"
5216+
debug "^4.3.2"
5217+
globby "^11.0.4"
5218+
is-glob "^4.0.3"
5219+
semver "^7.3.5"
5220+
tsutils "^3.21.0"
5221+
51995222
"@typescript-eslint/[email protected]":
52005223
version "5.38.0"
52015224
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.38.0.tgz#89f86b2279815c6fb7f57d68cf9b813f0dc25d98"
@@ -5329,6 +5352,14 @@
53295352
eslint-scope "^5.1.1"
53305353
semver "^7.3.7"
53315354

5355+
"@typescript-eslint/[email protected]":
5356+
version "5.20.0"
5357+
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.20.0.tgz#70236b5c6b67fbaf8b2f58bf3414b76c1e826c2a"
5358+
integrity sha512-1flRpNF+0CAQkMNlTJ6L/Z5jiODG/e5+7mk6XwtPOUS3UrTz3UOiAg9jG2VtKsWI6rZQfy4C6a232QNRZTRGlg==
5359+
dependencies:
5360+
"@typescript-eslint/types" "5.20.0"
5361+
eslint-visitor-keys "^3.0.0"
5362+
53325363
"@typescript-eslint/[email protected]":
53335364
version "5.38.0"
53345365
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.38.0.tgz#60591ca3bf78aa12b25002c0993d067c00887e34"
@@ -6029,6 +6060,13 @@ ast-types-flow@^0.0.7:
60296060
resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad"
60306061
integrity sha512-eBvWn1lvIApYMhzQMsu9ciLfkBY499mFZlNqG+/9WR7PVlroQw0vG30cOQQbaKz3sCEc44TAOu2ykzqXSNnwag==
60316062

6063+
6064+
version "1.1.1"
6065+
resolved "https://registry.yarnpkg.com/astray/-/astray-1.1.1.tgz#ca3cc638395efa5d5083019d9f5d70e60f9cf684"
6066+
integrity sha512-LizvbENqdc8tdvrms/YyYoTtlr43INJni4YZSFr8nNdfOgafi82Hcrfhjm0MdwLhRFBrDhRwtH/0fnntlESxsQ==
6067+
optionalDependencies:
6068+
"@types/estree" "^0.0.45"
6069+
60326070
astring@^1.8.0:
60336071
version "1.8.3"
60346072
resolved "https://registry.yarnpkg.com/astring/-/astring-1.8.3.tgz#1a0ae738c7cc558f8e5ddc8e3120636f5cebcb85"
@@ -8129,7 +8167,7 @@ dir-glob@^3.0.1:
81298167
dependencies:
81308168
path-type "^4.0.0"
81318169

8132-
dlv@^1.1.3:
8170+
dlv@1.1.3, dlv@^1.1.3:
81338171
version "1.1.3"
81348172
resolved "https://registry.yarnpkg.com/dlv/-/dlv-1.1.3.tgz#5c198a8a11453596e751494d49874bc7732f2e79"
81358173
integrity sha512-+HlytyjlPKnIG8XuRG8WvmBP8xs8P71y+SKKS6ZXWoEgLuePxtDoUEiH7WkdePWrQ5JBpE6aoVqfZfJUQkjXwA==
@@ -8283,6 +8321,11 @@ dotenv@^10.0.0:
82838321
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-10.0.0.tgz#3d4227b8fb95f81096cdd2b66653fb2c7085ba81"
82848322
integrity sha512-rlBi9d8jpv9Sf1klPjNfFAuWDjKLwTIJJ/VxtoTwIR6hnZxcEOQCZg2oIL3MWBYw5GpUDKOEnND7LXTbIpQ03Q==
82858323

8324+
8325+
version "3.1.2"
8326+
resolved "https://registry.yarnpkg.com/dset/-/dset-3.1.2.tgz#89c436ca6450398396dc6538ea00abc0c54cd45a"
8327+
integrity sha512-g/M9sqy3oHe477Ar4voQxWtaPIFw1jTdKZuomOjhCcBx9nHUNn0pu6NopuFFrTh/TRZIKEj+76vLWFu9BNKk+Q==
8328+
82868329
duplexer@^0.1.2:
82878330
version "0.1.2"
82888331
resolved "https://registry.yarnpkg.com/duplexer/-/duplexer-0.1.2.tgz#3abe43aef3835f8ae077d136ddce0f276b0400e6"
@@ -8775,7 +8818,7 @@ eslint-visitor-keys@^2.0.0, eslint-visitor-keys@^2.1.0:
87758818
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303"
87768819
integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==
87778820

8778-
eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1:
8821+
eslint-visitor-keys@^3.0.0, eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1:
87798822
version "3.4.1"
87808823
resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz#c22c48f48942d08ca824cc526211ae400478a994"
87818824
integrity sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA==
@@ -9127,6 +9170,11 @@ fd-slicer@~1.1.0:
91279170
dependencies:
91289171
pend "~1.2.0"
91299172

9173+
9174+
version "5.2.0"
9175+
resolved "https://registry.yarnpkg.com/fdir/-/fdir-5.2.0.tgz#5b3d6ae282f8bc0ef48bf913d46f9e08496304ea"
9176+
integrity sha512-skyI2Laxtj9GYzmktPgY6DT8uswXq+VoxH26SskykvEhTSbi7tRM/787uZt/p8maxrQCJdzC90zX1btbxiJ6lw==
9177+
91309178
91319179
version "9.11.0"
91329180
resolved "https://registry.yarnpkg.com/fetch-mock/-/fetch-mock-9.11.0.tgz#371c6fb7d45584d2ae4a18ee6824e7ad4b637a3f"
@@ -10371,6 +10419,11 @@ is-plain-obj@^4.0.0:
1037110419
resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-4.1.0.tgz#d65025edec3657ce032fd7db63c97883eaed71f0"
1037210420
integrity sha512-+Pgi+vMuUNkJyExiMBt5IlFoMyKnr5zhJ4Uspz58WOhBF5QoIZkFyNHIbBAtHwzVAgk5RtndVNsDRN61/mmDqg==
1037310421

10422+
10423+
version "5.0.0"
10424+
resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-5.0.0.tgz#4427f50ab3429e9025ea7d52e9043a9ef4159344"
10425+
integrity sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==
10426+
1037410427
is-plain-object@^2.0.4:
1037510428
version "2.0.4"
1037610429
resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677"
@@ -13187,7 +13240,7 @@ picocolors@^1.0.0:
1318713240
resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c"
1318813241
integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ==
1318913242

13190-
picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.2.3, picomatch@^2.3.1:
13243+
picomatch@2.3.1, picomatch@^2.0.4, picomatch@^2.2.1, picomatch@^2.2.2, picomatch@^2.2.3, picomatch@^2.3.1:
1319113244
version "2.3.1"
1319213245
resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42"
1319313246
integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==
@@ -14338,6 +14391,21 @@ [email protected]:
1433814391
dependencies:
1433914392
history "^5.1.0"
1434014393

14394+
react-scanner@^1.1.0:
14395+
version "1.1.0"
14396+
resolved "https://registry.yarnpkg.com/react-scanner/-/react-scanner-1.1.0.tgz#6246a8ef2ac18e77de0f78b70f03d77adc1bdea6"
14397+
integrity sha512-27G8K1TJ4FUp9+Ix5mkwhWnFdoIwYj95Ffwom0gWh3V+7zds1SRfbbRzi89EXMtZj9IiLhgEyBOBy/k6IysGNg==
14398+
dependencies:
14399+
"@typescript-eslint/typescript-estree" "5.20.0"
14400+
astray "1.1.1"
14401+
dlv "1.1.3"
14402+
dset "3.1.2"
14403+
fdir "5.2.0"
14404+
is-plain-object "5.0.0"
14405+
picomatch "2.3.1"
14406+
sade "1.8.1"
14407+
typescript "4.6.3"
14408+
1434114409
1434214410
version "5.0.1"
1434314411
resolved "https://registry.yarnpkg.com/react-scripts/-/react-scripts-5.0.1.tgz#6285dbd65a8ba6e49ca8d651ce30645a6d980003"
@@ -14846,7 +14914,7 @@ rw@1:
1484614914
resolved "https://registry.yarnpkg.com/rw/-/rw-1.3.3.tgz#3f862dfa91ab766b14885ef4d01124bfda074fb4"
1484714915
integrity sha512-PdhdWy89SiZogBLaw42zdeqtRJ//zFd2PgQavcICDUgJT5oW10QCRKbJ6bg4r0/UY2M6BWd5tkxuGFRvCkgfHQ==
1484814916

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

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

0 commit comments

Comments
 (0)