@dcaldeira/tooling 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/LICENSE +9 -0
  2. package/README.md +34 -3
  3. package/checks/a11y.mjs +206 -0
  4. package/checks/architecture.mjs +137 -0
  5. package/checks/audit.mjs +121 -0
  6. package/checks/bundle.mjs +126 -0
  7. package/checks/dependencies.mjs +277 -0
  8. package/checks/lint-scss.mjs +349 -0
  9. package/checks/package.mjs +30 -0
  10. package/checks/playwright-summary.mjs +53 -0
  11. package/checks/sass.mjs +67 -0
  12. package/checks/scan-secrets.mjs +58 -0
  13. package/checks/shared.mjs +86 -0
  14. package/checks/style-property-order.json +498 -0
  15. package/checks/translations.mjs +55 -0
  16. package/checks/visual-compare.mjs +148 -0
  17. package/checks/visual-report-html.mjs +470 -0
  18. package/checks/visual-report.mjs +13 -0
  19. package/config.schema.json +927 -0
  20. package/configs/eslint.mjs +27 -0
  21. package/configs/knip.json +11 -0
  22. package/configs/playwright.mjs +15 -0
  23. package/configs/prettier.mjs +1 -0
  24. package/configs/tsconfig.json +16 -0
  25. package/configs/vitest.mjs +16 -0
  26. package/package.json +105 -6
  27. package/release/evidence.mjs +62 -0
  28. package/release/finalize.mjs +65 -0
  29. package/release/gh.mjs +25 -0
  30. package/release/github.mjs +64 -0
  31. package/release/prepare.mjs +30 -0
  32. package/runner/browsers.mjs +73 -0
  33. package/runner/cache.mjs +121 -0
  34. package/runner/ci-plan.mjs +54 -0
  35. package/runner/cli.mjs +249 -0
  36. package/runner/config.mjs +148 -0
  37. package/runner/docs-install.mjs +93 -0
  38. package/runner/execute.mjs +286 -0
  39. package/runner/generate.mjs +122 -0
  40. package/runner/git.mjs +122 -0
  41. package/runner/graph.mjs +243 -0
  42. package/runner/index.mjs +4 -0
  43. package/runner/insights.mjs +313 -0
  44. package/runner/provision.mjs +53 -0
  45. package/runner/report.mjs +35 -0
  46. package/runner/serve-static.mjs +76 -0
  47. package/runner/setup.mjs +237 -0
  48. package/runner/summary.mjs +112 -0
  49. package/runner/watch.mjs +82 -0
  50. package/templates/ci.yml +25 -0
  51. package/templates/dependabot-merge.yml +13 -0
  52. package/templates/dependabot.yml +26 -0
  53. package/templates/pre-push +13 -0
  54. package/templates/release.yml +23 -0
@@ -0,0 +1,927 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "title": "Repository tooling",
4
+ "type": "object",
5
+ "additionalProperties": false,
6
+ "required": [
7
+ "schemaVersion"
8
+ ],
9
+ "properties": {
10
+ "$schema": {
11
+ "type": "string"
12
+ },
13
+ "schemaVersion": {
14
+ "const": 1
15
+ },
16
+ "paths": {
17
+ "type": "object",
18
+ "additionalProperties": false,
19
+ "properties": {
20
+ "docs": {
21
+ "type": "array",
22
+ "items": {
23
+ "type": "string"
24
+ }
25
+ },
26
+ "styles": {
27
+ "type": "array",
28
+ "items": {
29
+ "type": "string"
30
+ }
31
+ },
32
+ "translations": {
33
+ "type": "array",
34
+ "items": {
35
+ "type": "string"
36
+ }
37
+ },
38
+ "app": {
39
+ "type": "array",
40
+ "items": {
41
+ "type": "string"
42
+ }
43
+ },
44
+ "database": {
45
+ "type": "array",
46
+ "items": {
47
+ "type": "string"
48
+ }
49
+ },
50
+ "functions": {
51
+ "type": "array",
52
+ "items": {
53
+ "type": "string"
54
+ }
55
+ },
56
+ "workflows": {
57
+ "type": "array",
58
+ "items": {
59
+ "type": "string"
60
+ }
61
+ },
62
+ "tooling": {
63
+ "type": "array",
64
+ "items": {
65
+ "type": "string"
66
+ }
67
+ },
68
+ "dependencies": {
69
+ "type": "array",
70
+ "items": {
71
+ "type": "string"
72
+ }
73
+ }
74
+ }
75
+ },
76
+ "checks": {
77
+ "type": "object",
78
+ "propertyNames": {
79
+ "pattern": "^[a-z][a-z0-9-]*$"
80
+ },
81
+ "additionalProperties": {
82
+ "oneOf": [
83
+ {
84
+ "const": false
85
+ },
86
+ {
87
+ "type": "object",
88
+ "additionalProperties": false,
89
+ "properties": {
90
+ "command": {
91
+ "oneOf": [
92
+ {
93
+ "type": "string",
94
+ "minLength": 1
95
+ },
96
+ {
97
+ "type": "array",
98
+ "minItems": 1,
99
+ "items": {
100
+ "type": "string",
101
+ "minLength": 1
102
+ }
103
+ }
104
+ ]
105
+ },
106
+ "devCommand": {
107
+ "oneOf": [
108
+ {
109
+ "type": "string",
110
+ "minLength": 1
111
+ },
112
+ {
113
+ "type": "array",
114
+ "minItems": 1,
115
+ "items": {
116
+ "type": "string",
117
+ "minLength": 1
118
+ }
119
+ }
120
+ ]
121
+ },
122
+ "groups": {
123
+ "type": "array",
124
+ "items": {
125
+ "enum": [
126
+ "docs",
127
+ "styles",
128
+ "translations",
129
+ "app",
130
+ "database",
131
+ "functions",
132
+ "workflows",
133
+ "tooling",
134
+ "dependencies",
135
+ "unknown"
136
+ ]
137
+ }
138
+ },
139
+ "profiles": {
140
+ "type": "array",
141
+ "items": {
142
+ "enum": [
143
+ "dev",
144
+ "push",
145
+ "ci"
146
+ ]
147
+ }
148
+ },
149
+ "dependsOn": {
150
+ "type": "array",
151
+ "items": {
152
+ "type": "string"
153
+ }
154
+ },
155
+ "cwd": {
156
+ "type": "string"
157
+ },
158
+ "tools": {
159
+ "type": "array",
160
+ "items": {
161
+ "type": "string"
162
+ }
163
+ },
164
+ "platforms": {
165
+ "type": "array",
166
+ "items": {
167
+ "enum": [
168
+ "linux",
169
+ "win32",
170
+ "darwin",
171
+ "aix",
172
+ "freebsd",
173
+ "openbsd",
174
+ "sunos",
175
+ "android"
176
+ ]
177
+ }
178
+ },
179
+ "devFiles": {
180
+ "type": "array",
181
+ "items": {
182
+ "type": "string"
183
+ }
184
+ },
185
+ "devAllCommand": {
186
+ "oneOf": [
187
+ {
188
+ "type": "string",
189
+ "minLength": 1
190
+ },
191
+ {
192
+ "type": "array",
193
+ "minItems": 1,
194
+ "items": {
195
+ "type": "string",
196
+ "minLength": 1
197
+ }
198
+ }
199
+ ]
200
+ },
201
+ "resources": {
202
+ "type": "array",
203
+ "items": {
204
+ "type": "string",
205
+ "minLength": 1
206
+ }
207
+ },
208
+ "workspaces": {
209
+ "type": "array",
210
+ "items": {
211
+ "type": "string",
212
+ "minLength": 1
213
+ }
214
+ },
215
+ "cache": {
216
+ "oneOf": [
217
+ {
218
+ "type": "boolean"
219
+ },
220
+ {
221
+ "type": "object",
222
+ "additionalProperties": false,
223
+ "required": [
224
+ "inputs"
225
+ ],
226
+ "properties": {
227
+ "inputs": {
228
+ "type": "array",
229
+ "items": {
230
+ "type": "string",
231
+ "minLength": 1
232
+ },
233
+ "minItems": 1
234
+ }
235
+ }
236
+ }
237
+ ]
238
+ },
239
+ "extends": {
240
+ "enum": [
241
+ "format",
242
+ "lint",
243
+ "styles",
244
+ "types",
245
+ "unit",
246
+ "translations",
247
+ "build",
248
+ "size",
249
+ "deadcode",
250
+ "security",
251
+ "e2e",
252
+ "visual",
253
+ "lighthouse",
254
+ "workflows",
255
+ "architecture",
256
+ "a11y",
257
+ "dependency-consistency",
258
+ "sass"
259
+ ]
260
+ }
261
+ }
262
+ }
263
+ ]
264
+ }
265
+ },
266
+ "environment": {
267
+ "type": "array",
268
+ "items": {
269
+ "type": "string"
270
+ }
271
+ },
272
+ "translations": {
273
+ "type": "object",
274
+ "required": [
275
+ "directory",
276
+ "source"
277
+ ],
278
+ "additionalProperties": false,
279
+ "properties": {
280
+ "directory": {
281
+ "type": "string",
282
+ "minLength": 1
283
+ },
284
+ "source": {
285
+ "type": "string",
286
+ "minLength": 1
287
+ },
288
+ "pluralExceptions": {
289
+ "type": "array",
290
+ "items": {
291
+ "type": "string"
292
+ }
293
+ }
294
+ }
295
+ },
296
+ "styles": {
297
+ "type": "object",
298
+ "additionalProperties": false,
299
+ "properties": {
300
+ "source": {
301
+ "type": "string",
302
+ "minLength": 1
303
+ },
304
+ "maxDepth": {
305
+ "type": "integer",
306
+ "minimum": 1
307
+ },
308
+ "maxSpecificity": {
309
+ "type": "array",
310
+ "minItems": 3,
311
+ "maxItems": 3,
312
+ "items": {
313
+ "type": "integer",
314
+ "minimum": 0
315
+ }
316
+ },
317
+ "preset": {
318
+ "enum": [
319
+ "standard",
320
+ "rookie"
321
+ ]
322
+ },
323
+ "rules": {
324
+ "type": "object",
325
+ "additionalProperties": false,
326
+ "properties": {
327
+ "bem": {
328
+ "type": "boolean"
329
+ },
330
+ "componentName": {
331
+ "type": "boolean"
332
+ },
333
+ "palette": {
334
+ "type": "boolean"
335
+ }
336
+ }
337
+ },
338
+ "colourTokenPaths": {
339
+ "type": "array",
340
+ "items": {
341
+ "type": "string",
342
+ "minLength": 1
343
+ }
344
+ }
345
+ }
346
+ },
347
+ "budgets": {
348
+ "type": "object",
349
+ "additionalProperties": false,
350
+ "properties": {
351
+ "bundle": {
352
+ "type": "object",
353
+ "required": [
354
+ "dist",
355
+ "initialKB",
356
+ "chunkKB"
357
+ ],
358
+ "additionalProperties": false,
359
+ "properties": {
360
+ "dist": {
361
+ "type": "string",
362
+ "minLength": 1
363
+ },
364
+ "initialKB": {
365
+ "type": "number",
366
+ "exclusiveMinimum": 0
367
+ },
368
+ "chunkKB": {
369
+ "type": "number",
370
+ "exclusiveMinimum": 0
371
+ },
372
+ "vendors": {
373
+ "type": "array",
374
+ "items": {
375
+ "type": "array",
376
+ "minItems": 3,
377
+ "maxItems": 3,
378
+ "prefixItems": [
379
+ {
380
+ "type": "string",
381
+ "minLength": 1
382
+ },
383
+ {
384
+ "type": "string",
385
+ "minLength": 1
386
+ },
387
+ {
388
+ "type": "number",
389
+ "exclusiveMinimum": 0
390
+ }
391
+ ]
392
+ }
393
+ }
394
+ }
395
+ }
396
+ }
397
+ },
398
+ "release": {
399
+ "type": "object",
400
+ "additionalProperties": false,
401
+ "required": [
402
+ "prepare",
403
+ "files"
404
+ ],
405
+ "properties": {
406
+ "prepare": {
407
+ "type": "array",
408
+ "minItems": 1,
409
+ "items": {
410
+ "type": "string"
411
+ }
412
+ },
413
+ "files": {
414
+ "type": "array",
415
+ "items": {
416
+ "type": "string"
417
+ }
418
+ }
419
+ }
420
+ },
421
+ "inputs": {
422
+ "type": "array",
423
+ "items": {
424
+ "type": "string"
425
+ }
426
+ },
427
+ "execution": {
428
+ "type": "object",
429
+ "additionalProperties": false,
430
+ "properties": {
431
+ "concurrency": {
432
+ "type": "integer",
433
+ "minimum": 1,
434
+ "maximum": 16
435
+ },
436
+ "typeScriptBuildInfo": {
437
+ "type": "array",
438
+ "items": {
439
+ "type": "string",
440
+ "minLength": 1
441
+ }
442
+ },
443
+ "checkCache": {
444
+ "type": "boolean"
445
+ }
446
+ }
447
+ },
448
+ "workspaces": {
449
+ "type": "object",
450
+ "propertyNames": {
451
+ "pattern": "^[a-z][a-z0-9-]*$"
452
+ },
453
+ "additionalProperties": {
454
+ "type": "object",
455
+ "additionalProperties": false,
456
+ "required": [
457
+ "paths"
458
+ ],
459
+ "properties": {
460
+ "paths": {
461
+ "type": "array",
462
+ "items": {
463
+ "type": "string",
464
+ "minLength": 1
465
+ },
466
+ "minItems": 1
467
+ },
468
+ "dependsOn": {
469
+ "type": "array",
470
+ "items": {
471
+ "type": "string",
472
+ "minLength": 1
473
+ }
474
+ }
475
+ }
476
+ }
477
+ },
478
+ "architecture": {
479
+ "type": "object",
480
+ "additionalProperties": false,
481
+ "properties": {
482
+ "include": {
483
+ "type": "array",
484
+ "items": {
485
+ "type": "string",
486
+ "minLength": 1
487
+ }
488
+ },
489
+ "exclude": {
490
+ "type": "array",
491
+ "items": {
492
+ "type": "string",
493
+ "minLength": 1
494
+ }
495
+ },
496
+ "tsconfig": {
497
+ "type": "string",
498
+ "minLength": 1
499
+ },
500
+ "cycles": {
501
+ "type": "boolean"
502
+ },
503
+ "layers": {
504
+ "type": "array",
505
+ "items": {
506
+ "type": "object",
507
+ "additionalProperties": false,
508
+ "properties": {
509
+ "name": {
510
+ "type": "string",
511
+ "minLength": 1
512
+ },
513
+ "paths": {
514
+ "type": "array",
515
+ "items": {
516
+ "type": "string",
517
+ "minLength": 1
518
+ },
519
+ "minItems": 1
520
+ },
521
+ "allow": {
522
+ "type": "array",
523
+ "items": {
524
+ "type": "string",
525
+ "minLength": 1
526
+ }
527
+ }
528
+ },
529
+ "required": [
530
+ "name",
531
+ "paths",
532
+ "allow"
533
+ ]
534
+ }
535
+ },
536
+ "modules": {
537
+ "type": "array",
538
+ "items": {
539
+ "type": "object",
540
+ "additionalProperties": false,
541
+ "properties": {
542
+ "name": {
543
+ "type": "string",
544
+ "minLength": 1
545
+ },
546
+ "root": {
547
+ "type": "string",
548
+ "minLength": 1
549
+ },
550
+ "public": {
551
+ "type": "array",
552
+ "items": {
553
+ "type": "string",
554
+ "minLength": 1
555
+ },
556
+ "minItems": 1
557
+ }
558
+ },
559
+ "required": [
560
+ "name",
561
+ "root",
562
+ "public"
563
+ ]
564
+ }
565
+ }
566
+ }
567
+ },
568
+ "dependencyConsistency": {
569
+ "type": "object",
570
+ "additionalProperties": false,
571
+ "properties": {
572
+ "manifests": {
573
+ "type": "array",
574
+ "items": {
575
+ "type": "string",
576
+ "minLength": 1
577
+ },
578
+ "minItems": 1
579
+ },
580
+ "include": {
581
+ "type": "array",
582
+ "items": {
583
+ "type": "string",
584
+ "minLength": 1
585
+ }
586
+ },
587
+ "exclude": {
588
+ "type": "array",
589
+ "items": {
590
+ "type": "string",
591
+ "minLength": 1
592
+ }
593
+ },
594
+ "strict": {
595
+ "type": "array",
596
+ "items": {
597
+ "type": "string",
598
+ "minLength": 1
599
+ }
600
+ },
601
+ "ignore": {
602
+ "type": "array",
603
+ "items": {
604
+ "type": "string",
605
+ "minLength": 1
606
+ }
607
+ },
608
+ "singleVersion": {
609
+ "type": "array",
610
+ "items": {
611
+ "type": "string",
612
+ "minLength": 1
613
+ }
614
+ },
615
+ "expected": {
616
+ "type": "object",
617
+ "additionalProperties": {
618
+ "type": "string",
619
+ "minLength": 1
620
+ }
621
+ },
622
+ "checkImports": {
623
+ "type": "boolean"
624
+ }
625
+ }
626
+ },
627
+ "generators": {
628
+ "type": "object",
629
+ "additionalProperties": false,
630
+ "properties": {
631
+ "components": {
632
+ "type": "string",
633
+ "minLength": 1
634
+ },
635
+ "hooks": {
636
+ "type": "string",
637
+ "minLength": 1
638
+ },
639
+ "designSystem": {
640
+ "type": "object",
641
+ "additionalProperties": false,
642
+ "properties": {
643
+ "package": {
644
+ "type": "string",
645
+ "minLength": 1,
646
+ "pattern": "^(?:@[a-z0-9][a-z0-9._-]*/)?[a-z0-9][a-z0-9._-]*$"
647
+ },
648
+ "component": {
649
+ "type": "string",
650
+ "minLength": 1,
651
+ "pattern": "^[A-Z][A-Za-z0-9]*$"
652
+ }
653
+ },
654
+ "required": [
655
+ "package",
656
+ "component"
657
+ ]
658
+ }
659
+ }
660
+ },
661
+ "a11y": {
662
+ "type": "object",
663
+ "additionalProperties": false,
664
+ "properties": {
665
+ "baseURL": {
666
+ "type": "string",
667
+ "minLength": 1
668
+ },
669
+ "routes": {
670
+ "type": "array",
671
+ "minItems": 1,
672
+ "items": {
673
+ "type": "object",
674
+ "additionalProperties": false,
675
+ "properties": {
676
+ "path": {
677
+ "type": "string",
678
+ "minLength": 1,
679
+ "pattern": "^/(?!/)"
680
+ },
681
+ "name": {
682
+ "type": "string",
683
+ "minLength": 1
684
+ },
685
+ "waitFor": {
686
+ "type": "string",
687
+ "minLength": 1
688
+ },
689
+ "include": {
690
+ "type": "array",
691
+ "items": {
692
+ "type": "string",
693
+ "minLength": 1
694
+ }
695
+ },
696
+ "exclude": {
697
+ "type": "array",
698
+ "items": {
699
+ "type": "string",
700
+ "minLength": 1
701
+ }
702
+ },
703
+ "actions": {
704
+ "type": "array",
705
+ "items": {
706
+ "type": "object",
707
+ "additionalProperties": false,
708
+ "properties": {
709
+ "type": {
710
+ "enum": [
711
+ "click",
712
+ "fill",
713
+ "press"
714
+ ]
715
+ },
716
+ "selector": {
717
+ "type": "string",
718
+ "minLength": 1
719
+ },
720
+ "value": {
721
+ "type": "string"
722
+ }
723
+ },
724
+ "required": [
725
+ "type",
726
+ "selector"
727
+ ]
728
+ }
729
+ }
730
+ },
731
+ "required": [
732
+ "path"
733
+ ]
734
+ }
735
+ },
736
+ "tags": {
737
+ "type": "array",
738
+ "items": {
739
+ "type": "string",
740
+ "minLength": 1
741
+ },
742
+ "minItems": 1
743
+ },
744
+ "failImpacts": {
745
+ "type": "array",
746
+ "items": {
747
+ "enum": [
748
+ "minor",
749
+ "moderate",
750
+ "serious",
751
+ "critical"
752
+ ]
753
+ }
754
+ },
755
+ "viewports": {
756
+ "type": "array",
757
+ "minItems": 1,
758
+ "items": {
759
+ "type": "object",
760
+ "additionalProperties": false,
761
+ "properties": {
762
+ "name": {
763
+ "type": "string",
764
+ "minLength": 1,
765
+ "pattern": "^[a-zA-Z0-9_-]+$"
766
+ },
767
+ "width": {
768
+ "type": "integer",
769
+ "minimum": 1,
770
+ "maximum": 10000
771
+ },
772
+ "height": {
773
+ "type": "integer",
774
+ "minimum": 1,
775
+ "maximum": 10000
776
+ }
777
+ },
778
+ "required": [
779
+ "name",
780
+ "width",
781
+ "height"
782
+ ]
783
+ }
784
+ },
785
+ "storageState": {
786
+ "type": "string",
787
+ "minLength": 1
788
+ },
789
+ "executablePath": {
790
+ "type": "string",
791
+ "minLength": 1
792
+ },
793
+ "timeout": {
794
+ "type": "integer",
795
+ "minimum": 100,
796
+ "maximum": 120000
797
+ },
798
+ "server": {
799
+ "type": "object",
800
+ "additionalProperties": false,
801
+ "properties": {
802
+ "command": {
803
+ "type": "array",
804
+ "items": {
805
+ "type": "string",
806
+ "minLength": 1
807
+ },
808
+ "minItems": 1
809
+ },
810
+ "cwd": {
811
+ "type": "string",
812
+ "minLength": 1
813
+ },
814
+ "url": {
815
+ "type": "string",
816
+ "minLength": 1
817
+ },
818
+ "timeout": {
819
+ "type": "integer",
820
+ "minimum": 100,
821
+ "maximum": 120000
822
+ }
823
+ },
824
+ "required": [
825
+ "command"
826
+ ]
827
+ }
828
+ },
829
+ "required": [
830
+ "baseURL",
831
+ "routes"
832
+ ]
833
+ },
834
+ "reporting": {
835
+ "type": "object",
836
+ "additionalProperties": false,
837
+ "properties": {
838
+ "coverage": {
839
+ "type": "array",
840
+ "items": {
841
+ "type": "string",
842
+ "minLength": 1
843
+ }
844
+ },
845
+ "unit": {
846
+ "type": "array",
847
+ "items": {
848
+ "type": "string",
849
+ "minLength": 1
850
+ }
851
+ },
852
+ "playwright": {
853
+ "type": "array",
854
+ "items": {
855
+ "type": "string",
856
+ "minLength": 1
857
+ }
858
+ },
859
+ "slowTestMilliseconds": {
860
+ "type": "number",
861
+ "minimum": 0
862
+ }
863
+ }
864
+ },
865
+ "history": {
866
+ "type": "object",
867
+ "additionalProperties": false,
868
+ "properties": {
869
+ "enabled": {
870
+ "type": "boolean"
871
+ },
872
+ "limit": {
873
+ "type": "integer",
874
+ "minimum": 1,
875
+ "maximum": 1000
876
+ },
877
+ "regressionPercent": {
878
+ "type": "number",
879
+ "minimum": 0
880
+ }
881
+ }
882
+ },
883
+ "sass": {
884
+ "type": "object",
885
+ "additionalProperties": false,
886
+ "required": [
887
+ "entrypoints"
888
+ ],
889
+ "properties": {
890
+ "source": {
891
+ "type": "string",
892
+ "minLength": 1
893
+ },
894
+ "entrypoints": {
895
+ "type": "array",
896
+ "minItems": 1,
897
+ "items": {
898
+ "type": "string",
899
+ "minLength": 1
900
+ }
901
+ },
902
+ "include": {
903
+ "type": "array",
904
+ "minItems": 1,
905
+ "items": {
906
+ "type": "string",
907
+ "minLength": 1
908
+ }
909
+ },
910
+ "exclude": {
911
+ "type": "array",
912
+ "items": {
913
+ "type": "string",
914
+ "minLength": 1
915
+ }
916
+ },
917
+ "importantExceptions": {
918
+ "type": "array",
919
+ "items": {
920
+ "type": "string",
921
+ "minLength": 1
922
+ }
923
+ }
924
+ }
925
+ }
926
+ }
927
+ }