@brnshkr/config 0.0.1-alpha.9 → 0.0.1-beta.2
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.
- package/README.md +92 -36
- package/conf/tsconfig.json +4 -7
- package/dist/eslint/index.d.mts +1351 -1643
- package/dist/eslint/index.mjs +255 -176
- package/dist/scripts/eslint.mjs +2 -4
- package/dist/scripts/stylelint.mjs +2 -4
- package/dist/shared.mjs +79 -240
- package/dist/stylelint/index.d.mts +3 -3
- package/dist/stylelint/index.mjs +103 -67
- package/package.json +80 -96
package/README.md
CHANGED
|
@@ -18,7 +18,7 @@ _[☄️ Bug Reports / Feature Requests »][issues-url]_
|
|
|
18
18
|
<!-- omit in toc -->
|
|
19
19
|
## Table of Contents
|
|
20
20
|
|
|
21
|
-
<!-- NOTICE:
|
|
21
|
+
<!-- NOTICE: GitHub strips emojis in anchors, but multi-codepoint characters may leave invisible remnants, causing anchors to differ and require URL encoding. -->
|
|
22
22
|
- [👋 About the Project](#-about-the-project)
|
|
23
23
|
- [☕ JS](#-js)
|
|
24
24
|
- [🧰 Prerequisites](#-prerequisites)
|
|
@@ -58,7 +58,7 @@ _[☄️ Bug Reports / Feature Requests »][issues-url]_
|
|
|
58
58
|
|
|
59
59
|
### 🧰 Prerequisites
|
|
60
60
|
|
|
61
|
-
- Node.js >= v24 or Bun >=
|
|
61
|
+
- Node.js >= v24 or Bun >= v1.3 (Older versions may work, but are untested)
|
|
62
62
|
- Any JavaScript package manager (Bun, Yarn, PNPM, NPM)
|
|
63
63
|
|
|
64
64
|
<p align="right"><a href="#top" title="Back to top"> ⬆ </a></p>
|
|
@@ -69,28 +69,28 @@ _[☄️ Bug Reports / Feature Requests »][issues-url]_
|
|
|
69
69
|
#### Bun
|
|
70
70
|
|
|
71
71
|
```sh
|
|
72
|
-
bun a -D @brnshkr/config
|
|
72
|
+
bun a -D -E @brnshkr/config
|
|
73
73
|
```
|
|
74
74
|
|
|
75
75
|
<!-- omit in toc -->
|
|
76
76
|
#### Yarn
|
|
77
77
|
|
|
78
78
|
```sh
|
|
79
|
-
yarn add -D @brnshkr/config
|
|
79
|
+
yarn add -D -E @brnshkr/config
|
|
80
80
|
```
|
|
81
81
|
|
|
82
82
|
<!-- omit in toc -->
|
|
83
83
|
#### PNPM
|
|
84
84
|
|
|
85
85
|
```sh
|
|
86
|
-
pnpm add -D @brnshkr/config
|
|
86
|
+
pnpm add -D -E @brnshkr/config
|
|
87
87
|
```
|
|
88
88
|
|
|
89
89
|
<!-- omit in toc -->
|
|
90
90
|
#### NPM
|
|
91
91
|
|
|
92
92
|
```sh
|
|
93
|
-
npm i -D @brnshkr/config
|
|
93
|
+
npm i -D -E @brnshkr/config
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
This repository currently only provides one way to integrate configuration files (An automatic setup is planned, See [🔨 TODOs / Roadmap](#-todos--roadmap)):
|
|
@@ -313,8 +313,9 @@ You can then copy the specific configs to your project:
|
|
|
313
313
|
##### PHP CS Fixer
|
|
314
314
|
|
|
315
315
|
```sh
|
|
316
|
-
cp -v ./vendor/brnshkr/config/conf
|
|
317
|
-
&& cp -v ./vendor/brnshkr/config/conf
|
|
316
|
+
cp -v ./vendor/brnshkr/config/conf/php-cs-fixer.php.example ./conf/php-cs-fixer.php \
|
|
317
|
+
&& cp -v ./vendor/brnshkr/config/conf/php-cs-fixer.php.example ./conf/php-cs-fixer.php.example \
|
|
318
|
+
&& cp -v ./vendor/brnshkr/config/conf/php-cs-fixer.dist.php.example ./conf/php-cs-fixer.dist.php
|
|
318
319
|
```
|
|
319
320
|
|
|
320
321
|
<!-- omit in toc -->
|
|
@@ -322,6 +323,7 @@ cp -v ./vendor/brnshkr/config/conf/.php-cs-fixer.php.example ./conf/.php-cs-fixe
|
|
|
322
323
|
|
|
323
324
|
```sh
|
|
324
325
|
cp -v ./vendor/brnshkr/config/conf/rector.php.example ./conf/rector.php \
|
|
326
|
+
&& cp -v ./vendor/brnshkr/config/conf/rector.php.example ./conf/rector.php.example \
|
|
325
327
|
&& cp -v ./vendor/brnshkr/config/conf/rector.dist.php.example ./conf/rector.dist.php
|
|
326
328
|
```
|
|
327
329
|
|
|
@@ -329,8 +331,18 @@ cp -v ./vendor/brnshkr/config/conf/rector.php.example ./conf/rector.php \
|
|
|
329
331
|
##### PHPStan
|
|
330
332
|
|
|
331
333
|
```sh
|
|
332
|
-
cp -v ./vendor/brnshkr/config/conf/phpstan.
|
|
333
|
-
&& cp -v ./vendor/brnshkr/config/conf/phpstan.
|
|
334
|
+
cp -v ./vendor/brnshkr/config/conf/phpstan.php.example ./conf/phpstan.php \
|
|
335
|
+
&& cp -v ./vendor/brnshkr/config/conf/phpstan.php.example ./conf/phpstan.php.example \
|
|
336
|
+
&& cp -v ./vendor/brnshkr/config/conf/phpstan.dist.php.example ./conf/phpstan.dist.php
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
<!-- omit in toc -->
|
|
340
|
+
##### Twig CS Fixer
|
|
341
|
+
|
|
342
|
+
```sh
|
|
343
|
+
cp -v ./vendor/brnshkr/config/conf/twig-cs-fixer.php.example ./conf/twig-cs-fixer.php \
|
|
344
|
+
&& cp -v ./vendor/brnshkr/config/conf/twig-cs-fixer.php.example ./conf/twig-cs-fixer.php.example \
|
|
345
|
+
&& cp -v ./vendor/brnshkr/config/conf/twig-cs-fixer.dist.php.example ./conf/twig-cs-fixer.dist.php
|
|
334
346
|
```
|
|
335
347
|
|
|
336
348
|
<!-- omit in toc -->
|
|
@@ -351,12 +363,18 @@ cp -v ./vendor/brnshkr/config/conf/.gitignore.example ./.gitignore
|
|
|
351
363
|
##### All
|
|
352
364
|
|
|
353
365
|
```sh
|
|
354
|
-
cp -v ./vendor/brnshkr/config/conf
|
|
355
|
-
&& cp -v ./vendor/brnshkr/config/conf
|
|
366
|
+
cp -v ./vendor/brnshkr/config/conf/php-cs-fixer.php.example ./conf/php-cs-fixer.php \
|
|
367
|
+
&& cp -v ./vendor/brnshkr/config/conf/php-cs-fixer.php.example ./conf/php-cs-fixer.php.example \
|
|
368
|
+
&& cp -v ./vendor/brnshkr/config/conf/php-cs-fixer.dist.php.example ./conf/php-cs-fixer.dist.php \
|
|
356
369
|
&& cp -v ./vendor/brnshkr/config/conf/rector.php.example ./conf/rector.php \
|
|
370
|
+
&& cp -v ./vendor/brnshkr/config/conf/rector.php.example ./conf/rector.php.example \
|
|
357
371
|
&& cp -v ./vendor/brnshkr/config/conf/rector.dist.php.example ./conf/rector.dist.php \
|
|
358
|
-
&& cp -v ./vendor/brnshkr/config/conf/phpstan.
|
|
359
|
-
&& cp -v ./vendor/brnshkr/config/conf/phpstan.
|
|
372
|
+
&& cp -v ./vendor/brnshkr/config/conf/phpstan.php.example ./conf/phpstan.php \
|
|
373
|
+
&& cp -v ./vendor/brnshkr/config/conf/phpstan.php.example ./conf/phpstan.php.example \
|
|
374
|
+
&& cp -v ./vendor/brnshkr/config/conf/phpstan.dist.php.example ./conf/phpstan.dist.php \
|
|
375
|
+
&& cp -v ./vendor/brnshkr/config/conf/twig-cs-fixer.php.example ./conf/twig-cs-fixer.php \
|
|
376
|
+
&& cp -v ./vendor/brnshkr/config/conf/twig-cs-fixer.php.example ./conf/twig-cs-fixer.php.example \
|
|
377
|
+
&& cp -v ./vendor/brnshkr/config/conf/twig-cs-fixer.dist.php.example ./conf/twig-cs-fixer.dist.php \
|
|
360
378
|
&& cp -v ./vendor/brnshkr/config/conf/Makefile.example ./Makefile \
|
|
361
379
|
&& cp -v ./vendor/brnshkr/config/conf/.gitignore.example ./.gitignore
|
|
362
380
|
```
|
|
@@ -371,42 +389,60 @@ Take a look at the function signatures for exact details.
|
|
|
371
389
|
##### PHP CS Fixer
|
|
372
390
|
|
|
373
391
|
```php
|
|
374
|
-
//
|
|
392
|
+
// ./php-cs-fixer.dist.php
|
|
375
393
|
|
|
376
394
|
<?php
|
|
377
395
|
|
|
378
396
|
declare(strict_types=1);
|
|
379
397
|
|
|
380
|
-
use Brnshkr\Config\
|
|
398
|
+
use Brnshkr\Config\PhpCsFixer;
|
|
381
399
|
|
|
382
|
-
return
|
|
400
|
+
return PhpCsFixer::getConfig(/* customize */);
|
|
383
401
|
```
|
|
384
402
|
|
|
385
403
|
<!-- omit in toc -->
|
|
386
404
|
##### Rector
|
|
387
405
|
|
|
388
406
|
```php
|
|
389
|
-
// ./rector.php
|
|
407
|
+
// ./rector.dist.php
|
|
390
408
|
|
|
391
409
|
<?php
|
|
392
410
|
|
|
393
411
|
declare(strict_types=1);
|
|
394
412
|
|
|
395
|
-
use Brnshkr\Config\
|
|
413
|
+
use Brnshkr\Config\Rector;
|
|
396
414
|
|
|
397
|
-
return
|
|
415
|
+
return Rector::getConfig(/* customize */);
|
|
398
416
|
```
|
|
399
417
|
|
|
400
418
|
<!-- omit in toc -->
|
|
401
419
|
##### PHPStan
|
|
402
420
|
|
|
403
|
-
```
|
|
404
|
-
|
|
421
|
+
```php
|
|
422
|
+
// ./phpstan.dist.php
|
|
423
|
+
|
|
424
|
+
<?php
|
|
425
|
+
|
|
426
|
+
declare(strict_types=1);
|
|
427
|
+
|
|
428
|
+
use Brnshkr\Config\PhpStan;
|
|
429
|
+
|
|
430
|
+
return PhpStan::getConfig(/* customize */);
|
|
431
|
+
```
|
|
432
|
+
|
|
433
|
+
<!-- omit in toc -->
|
|
434
|
+
##### Twig CS Fixer
|
|
435
|
+
|
|
436
|
+
```php
|
|
437
|
+
// ./twig-cs-fixer.dist.php
|
|
438
|
+
|
|
439
|
+
<?php
|
|
405
440
|
|
|
406
|
-
|
|
407
|
-
- '%currentWorkingDirectory%/vendor/brnshkr/config/conf/phpstan.dist.neon'
|
|
441
|
+
declare(strict_types=1);
|
|
408
442
|
|
|
409
|
-
|
|
443
|
+
use Brnshkr\Config\TwigCsFixer;
|
|
444
|
+
|
|
445
|
+
return TwigCsFixer::getConfig(/* customize */);
|
|
410
446
|
```
|
|
411
447
|
|
|
412
448
|
<p align="right"><a href="#top" title="Back to top"> ⬆ </a></p>
|
|
@@ -428,7 +464,7 @@ A few possible ways are listed below:
|
|
|
428
464
|
Example call, adjust as needed
|
|
429
465
|
|
|
430
466
|
```sh
|
|
431
|
-
php ./vendor/bin/php-cs-fixer fix
|
|
467
|
+
php ./vendor/bin/php-cs-fixer fix --config ./conf/php-cs-fixer.php -v --show-progress=dots
|
|
432
468
|
```
|
|
433
469
|
|
|
434
470
|
<!-- omit in toc -->
|
|
@@ -437,7 +473,7 @@ php ./vendor/bin/php-cs-fixer fix -v --show-progress=dots --config ./conf/.php-c
|
|
|
437
473
|
Example call, adjust as needed
|
|
438
474
|
|
|
439
475
|
```sh
|
|
440
|
-
php ./vendor/bin/rector process --config ./conf/rector.php
|
|
476
|
+
php ./vendor/bin/rector process --config ./conf/rector.php --memory-limit=-1
|
|
441
477
|
```
|
|
442
478
|
|
|
443
479
|
<!-- omit in toc -->
|
|
@@ -446,7 +482,16 @@ php ./vendor/bin/rector process --config ./conf/rector.php
|
|
|
446
482
|
Example call, adjust as needed
|
|
447
483
|
|
|
448
484
|
```sh
|
|
449
|
-
php ./vendor/bin/phpstan analyze --
|
|
485
|
+
php ./vendor/bin/phpstan analyze --configuration ./conf/phpstan.php -vv --memory-limit=-1
|
|
486
|
+
```
|
|
487
|
+
|
|
488
|
+
<!-- omit in toc -->
|
|
489
|
+
###### Twig CS Fixer
|
|
490
|
+
|
|
491
|
+
Example call, adjust as needed
|
|
492
|
+
|
|
493
|
+
```sh
|
|
494
|
+
php ./vendor/bin/twig-cs-fixer fix --config ./conf/twig-cs-fixer.php -v
|
|
450
495
|
```
|
|
451
496
|
|
|
452
497
|
<!-- omit in toc -->
|
|
@@ -463,7 +508,7 @@ include ./vendor/brnshkr/config/conf/Makefile
|
|
|
463
508
|
<!-- omit in toc -->
|
|
464
509
|
###### PHP CS Fixer
|
|
465
510
|
|
|
466
|
-
Expected configuration file: `./conf
|
|
511
|
+
Expected configuration file: `./conf/php-cs-fixer.php`
|
|
467
512
|
|
|
468
513
|
```sh
|
|
469
514
|
make php-cs-fixer
|
|
@@ -481,12 +526,21 @@ make rector
|
|
|
481
526
|
<!-- omit in toc -->
|
|
482
527
|
###### PHPStan
|
|
483
528
|
|
|
484
|
-
Expected configuration file: `./conf/phpstan.
|
|
529
|
+
Expected configuration file: `./conf/phpstan.php`
|
|
485
530
|
|
|
486
531
|
```sh
|
|
487
532
|
make phpstan
|
|
488
533
|
```
|
|
489
534
|
|
|
535
|
+
<!-- omit in toc -->
|
|
536
|
+
###### Twig CS Fixer
|
|
537
|
+
|
|
538
|
+
Expected configuration file: `./conf/twig-cs-fixer.php`
|
|
539
|
+
|
|
540
|
+
```sh
|
|
541
|
+
make twig-cs-fixer
|
|
542
|
+
```
|
|
543
|
+
|
|
490
544
|
<!-- omit in toc -->
|
|
491
545
|
#### IDE Setup
|
|
492
546
|
|
|
@@ -517,9 +571,10 @@ Install dependencies and setup project tooling with the following commands and a
|
|
|
517
571
|
|
|
518
572
|
```sh
|
|
519
573
|
composer install \
|
|
520
|
-
&& cp -v ./conf
|
|
574
|
+
&& cp -v ./conf/php-cs-fixer.php.example ./conf/php-cs-fixer.php \
|
|
521
575
|
&& cp -v ./conf/rector.php.example ./conf/rector.php \
|
|
522
|
-
&& cp -v ./conf/phpstan.
|
|
576
|
+
&& cp -v ./conf/phpstan.php.example ./conf/phpstan.php \
|
|
577
|
+
&& cp -v ./conf/twig-cs-fixer.php.example ./conf/twig-cs-fixer.php
|
|
523
578
|
```
|
|
524
579
|
|
|
525
580
|
<!-- omit in toc -->
|
|
@@ -542,7 +597,7 @@ Here are some frequently used examples (see `make help` for the complete list):
|
|
|
542
597
|
- `make phpstan` — Run PHPStan static analysis
|
|
543
598
|
- `make test` — Run PHPUnit test suite
|
|
544
599
|
- `make test-update` — Run PHPUnit test suite and update snapshots
|
|
545
|
-
- `make check` — Run Rector, PHP-CS-Fixer, PHPStan and PHPUnit
|
|
600
|
+
- `make check` — Run Rector, PHP-CS-Fixer, Twig-CS-Fixer, PHPStan and PHPUnit
|
|
546
601
|
|
|
547
602
|
## 🔨 TODOs / Roadmap
|
|
548
603
|
|
|
@@ -623,8 +678,9 @@ Distributed under the MIT License. See [LICENSE](./LICENSE) for more information
|
|
|
623
678
|
- [PHP](https://www.php.net)
|
|
624
679
|
- [PHPStan](https://github.com/phpstan/phpstan)
|
|
625
680
|
- [Rector](https://github.com/rectorphp/rector)
|
|
681
|
+
- [PHP-CS-Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer)
|
|
682
|
+
- [Twig-CS-Fixer](https://github.com/VincentLanglet/Twig-CS-Fixer)
|
|
626
683
|
- [GNU Make](https://www.gnu.org/software/make)
|
|
627
|
-
- [PHP Coding Standards Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer)
|
|
628
684
|
- [Best-README-Template](https://github.com/othneildrew/Best-README-Template) by [othneildrew](https://github.com/othneildrew)
|
|
629
685
|
- [Choose an Open Source License](https://choosealicense.com)
|
|
630
686
|
- [Shields.io](https://shields.io)
|
|
@@ -659,6 +715,6 @@ Distributed under the MIT License. See [LICENSE](./LICENSE) for more information
|
|
|
659
715
|
[issues-url]: https://github.com/brnshkr/config/issues
|
|
660
716
|
[issues-shield-url]: https://img.shields.io/github/issues/brnshkr/config.svg?label=🚨%20issues&style=flat-square&labelColor=%237f399d&color=%23a5097e
|
|
661
717
|
|
|
662
|
-
<!-- NOTICE: Only use
|
|
718
|
+
<!-- NOTICE: Only use packagist version here since both packages are versioned in sync -->
|
|
663
719
|
[release-url]: https://github.com/brnshkr/config/releases
|
|
664
|
-
[release-shield-url]: https://img.shields.io/
|
|
720
|
+
[release-shield-url]: https://img.shields.io/packagist/v/brnshkr/config?style=flat-square&label=📦%20npm%2Fpackagist&labelColor=7f399d&color=%23a5097e
|
package/conf/tsconfig.json
CHANGED
|
@@ -32,16 +32,15 @@
|
|
|
32
32
|
],
|
|
33
33
|
"compilerOptions": {
|
|
34
34
|
// Language and Environment
|
|
35
|
-
"lib": ["ESNext", "DOM"
|
|
35
|
+
"lib": ["ESNext", "DOM"],
|
|
36
36
|
"moduleDetection": "force",
|
|
37
|
-
"target": "esnext",
|
|
38
37
|
|
|
39
38
|
// Modules
|
|
40
39
|
"allowImportingTsExtensions": true,
|
|
41
|
-
"module": "
|
|
40
|
+
"module": "preserve",
|
|
42
41
|
"moduleResolution": "bundler",
|
|
43
|
-
"noUncheckedSideEffectImports": true,
|
|
44
42
|
"resolveJsonModule": true,
|
|
43
|
+
"types": ["bun"],
|
|
45
44
|
|
|
46
45
|
// Emit
|
|
47
46
|
"noEmit": true,
|
|
@@ -55,7 +54,6 @@
|
|
|
55
54
|
"checkJs": true,
|
|
56
55
|
|
|
57
56
|
// Interop Constraints
|
|
58
|
-
"esModuleInterop": true,
|
|
59
57
|
"forceConsistentCasingInFileNames": true,
|
|
60
58
|
"verbatimModuleSyntax": true,
|
|
61
59
|
|
|
@@ -68,7 +66,6 @@
|
|
|
68
66
|
"noPropertyAccessFromIndexSignature": true,
|
|
69
67
|
"noUncheckedIndexedAccess": true,
|
|
70
68
|
"noUnusedLocals": true,
|
|
71
|
-
"noUnusedParameters": true
|
|
72
|
-
"strict": true
|
|
69
|
+
"noUnusedParameters": true
|
|
73
70
|
}
|
|
74
71
|
}
|