@brnshkr/config 0.0.1-alpha.8 → 0.0.1-beta.1
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 +46 -32
- package/conf/tsconfig.json +3 -7
- package/dist/eslint/index.d.mts +1351 -1643
- package/dist/eslint/index.mjs +247 -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 +98 -66
- package/package.json +93 -109
package/README.md
CHANGED
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
[![Stars][stars-shield-url]][stars-url]
|
|
9
9
|
[![Forks][forks-shield-url]][forks-url]
|
|
10
10
|
[![Issues][issues-shield-url]][issues-url]
|
|
11
|
+
[![Release][release-shield-url]][release-url]
|
|
11
12
|
</h1>
|
|
12
13
|
|
|
13
14
|
Centralized collection of configuration and tooling used across all [@brnshkr][@brnshkr-organization-url] projects.
|
|
@@ -17,7 +18,7 @@ _[☄️ Bug Reports / Feature Requests »][issues-url]_
|
|
|
17
18
|
<!-- omit in toc -->
|
|
18
19
|
## Table of Contents
|
|
19
20
|
|
|
20
|
-
<!-- NOTICE:
|
|
21
|
+
<!-- NOTICE: GitHub strips emojis in anchors, but multi-codepoint characters may leave invisible remnants, causing anchors to differ and require URL encoding. -->
|
|
21
22
|
- [👋 About the Project](#-about-the-project)
|
|
22
23
|
- [☕ JS](#-js)
|
|
23
24
|
- [🧰 Prerequisites](#-prerequisites)
|
|
@@ -57,7 +58,7 @@ _[☄️ Bug Reports / Feature Requests »][issues-url]_
|
|
|
57
58
|
|
|
58
59
|
### 🧰 Prerequisites
|
|
59
60
|
|
|
60
|
-
- Node.js >= v24 or Bun >=
|
|
61
|
+
- Node.js >= v24 or Bun >= v1.3 (Older versions may work, but are untested)
|
|
61
62
|
- Any JavaScript package manager (Bun, Yarn, PNPM, NPM)
|
|
62
63
|
|
|
63
64
|
<p align="right"><a href="#top" title="Back to top"> ⬆ </a></p>
|
|
@@ -68,28 +69,28 @@ _[☄️ Bug Reports / Feature Requests »][issues-url]_
|
|
|
68
69
|
#### Bun
|
|
69
70
|
|
|
70
71
|
```sh
|
|
71
|
-
bun a -D @brnshkr/config
|
|
72
|
+
bun a -D -E @brnshkr/config
|
|
72
73
|
```
|
|
73
74
|
|
|
74
75
|
<!-- omit in toc -->
|
|
75
76
|
#### Yarn
|
|
76
77
|
|
|
77
78
|
```sh
|
|
78
|
-
yarn add -D @brnshkr/config
|
|
79
|
+
yarn add -D -E @brnshkr/config
|
|
79
80
|
```
|
|
80
81
|
|
|
81
82
|
<!-- omit in toc -->
|
|
82
83
|
#### PNPM
|
|
83
84
|
|
|
84
85
|
```sh
|
|
85
|
-
pnpm add -D @brnshkr/config
|
|
86
|
+
pnpm add -D -E @brnshkr/config
|
|
86
87
|
```
|
|
87
88
|
|
|
88
89
|
<!-- omit in toc -->
|
|
89
90
|
#### NPM
|
|
90
91
|
|
|
91
92
|
```sh
|
|
92
|
-
npm i -D @brnshkr/config
|
|
93
|
+
npm i -D -E @brnshkr/config
|
|
93
94
|
```
|
|
94
95
|
|
|
95
96
|
This repository currently only provides one way to integrate configuration files (An automatic setup is planned, See [🔨 TODOs / Roadmap](#-todos--roadmap)):
|
|
@@ -312,8 +313,9 @@ You can then copy the specific configs to your project:
|
|
|
312
313
|
##### PHP CS Fixer
|
|
313
314
|
|
|
314
315
|
```sh
|
|
315
|
-
cp -v ./vendor/brnshkr/config/conf
|
|
316
|
-
&& 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
|
|
317
319
|
```
|
|
318
320
|
|
|
319
321
|
<!-- omit in toc -->
|
|
@@ -321,6 +323,7 @@ cp -v ./vendor/brnshkr/config/conf/.php-cs-fixer.php.example ./conf/.php-cs-fixe
|
|
|
321
323
|
|
|
322
324
|
```sh
|
|
323
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 \
|
|
324
327
|
&& cp -v ./vendor/brnshkr/config/conf/rector.dist.php.example ./conf/rector.dist.php
|
|
325
328
|
```
|
|
326
329
|
|
|
@@ -328,8 +331,9 @@ cp -v ./vendor/brnshkr/config/conf/rector.php.example ./conf/rector.php \
|
|
|
328
331
|
##### PHPStan
|
|
329
332
|
|
|
330
333
|
```sh
|
|
331
|
-
cp -v ./vendor/brnshkr/config/conf/phpstan.
|
|
332
|
-
&& 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
|
|
333
337
|
```
|
|
334
338
|
|
|
335
339
|
<!-- omit in toc -->
|
|
@@ -350,12 +354,15 @@ cp -v ./vendor/brnshkr/config/conf/.gitignore.example ./.gitignore
|
|
|
350
354
|
##### All
|
|
351
355
|
|
|
352
356
|
```sh
|
|
353
|
-
cp -v ./vendor/brnshkr/config/conf
|
|
354
|
-
&& cp -v ./vendor/brnshkr/config/conf
|
|
357
|
+
cp -v ./vendor/brnshkr/config/conf/php-cs-fixer.php.example ./conf/php-cs-fixer.php \
|
|
358
|
+
&& cp -v ./vendor/brnshkr/config/conf/php-cs-fixer.php.example ./conf/php-cs-fixer.php.example \
|
|
359
|
+
&& cp -v ./vendor/brnshkr/config/conf/php-cs-fixer.dist.php.example ./conf/php-cs-fixer.dist.php \
|
|
355
360
|
&& cp -v ./vendor/brnshkr/config/conf/rector.php.example ./conf/rector.php \
|
|
361
|
+
&& cp -v ./vendor/brnshkr/config/conf/rector.php.example ./conf/rector.php.example \
|
|
356
362
|
&& cp -v ./vendor/brnshkr/config/conf/rector.dist.php.example ./conf/rector.dist.php \
|
|
357
|
-
&& cp -v ./vendor/brnshkr/config/conf/phpstan.
|
|
358
|
-
&& cp -v ./vendor/brnshkr/config/conf/phpstan.
|
|
363
|
+
&& cp -v ./vendor/brnshkr/config/conf/phpstan.php.example ./conf/phpstan.php \
|
|
364
|
+
&& cp -v ./vendor/brnshkr/config/conf/phpstan.php.example ./conf/phpstan.php.example \
|
|
365
|
+
&& cp -v ./vendor/brnshkr/config/conf/phpstan.dist.php.example ./conf/phpstan.dist.php \
|
|
359
366
|
&& cp -v ./vendor/brnshkr/config/conf/Makefile.example ./Makefile \
|
|
360
367
|
&& cp -v ./vendor/brnshkr/config/conf/.gitignore.example ./.gitignore
|
|
361
368
|
```
|
|
@@ -370,42 +377,45 @@ Take a look at the function signatures for exact details.
|
|
|
370
377
|
##### PHP CS Fixer
|
|
371
378
|
|
|
372
379
|
```php
|
|
373
|
-
//
|
|
380
|
+
// ./php-cs-fixer.dist.php
|
|
374
381
|
|
|
375
382
|
<?php
|
|
376
383
|
|
|
377
384
|
declare(strict_types=1);
|
|
378
385
|
|
|
379
|
-
use Brnshkr\Config\
|
|
386
|
+
use Brnshkr\Config\PhpCsFixer;
|
|
380
387
|
|
|
381
|
-
return
|
|
388
|
+
return PhpCsFixer::getConfig(/* customize */);
|
|
382
389
|
```
|
|
383
390
|
|
|
384
391
|
<!-- omit in toc -->
|
|
385
392
|
##### Rector
|
|
386
393
|
|
|
387
394
|
```php
|
|
388
|
-
// ./rector.php
|
|
395
|
+
// ./rector.dist.php
|
|
389
396
|
|
|
390
397
|
<?php
|
|
391
398
|
|
|
392
399
|
declare(strict_types=1);
|
|
393
400
|
|
|
394
|
-
use Brnshkr\Config\
|
|
401
|
+
use Brnshkr\Config\Rector;
|
|
395
402
|
|
|
396
|
-
return
|
|
403
|
+
return Rector::getConfig(/* customize */);
|
|
397
404
|
```
|
|
398
405
|
|
|
399
406
|
<!-- omit in toc -->
|
|
400
407
|
##### PHPStan
|
|
401
408
|
|
|
402
|
-
```
|
|
403
|
-
|
|
409
|
+
```php
|
|
410
|
+
// ./phpstan.dist.php
|
|
411
|
+
|
|
412
|
+
<?php
|
|
404
413
|
|
|
405
|
-
|
|
406
|
-
|
|
414
|
+
declare(strict_types=1);
|
|
415
|
+
|
|
416
|
+
use Brnshkr\Config\PhpStan;
|
|
407
417
|
|
|
408
|
-
|
|
418
|
+
return PhpStan::getConfig(/* customize */);
|
|
409
419
|
```
|
|
410
420
|
|
|
411
421
|
<p align="right"><a href="#top" title="Back to top"> ⬆ </a></p>
|
|
@@ -427,7 +437,7 @@ A few possible ways are listed below:
|
|
|
427
437
|
Example call, adjust as needed
|
|
428
438
|
|
|
429
439
|
```sh
|
|
430
|
-
php ./vendor/bin/php-cs-fixer fix
|
|
440
|
+
php ./vendor/bin/php-cs-fixer fix --config ./conf/php-cs-fixer.php -v --show-progress=dots
|
|
431
441
|
```
|
|
432
442
|
|
|
433
443
|
<!-- omit in toc -->
|
|
@@ -436,7 +446,7 @@ php ./vendor/bin/php-cs-fixer fix -v --show-progress=dots --config ./conf/.php-c
|
|
|
436
446
|
Example call, adjust as needed
|
|
437
447
|
|
|
438
448
|
```sh
|
|
439
|
-
php ./vendor/bin/rector process --config ./conf/rector.php
|
|
449
|
+
php ./vendor/bin/rector process --config ./conf/rector.php --memory-limit=-1
|
|
440
450
|
```
|
|
441
451
|
|
|
442
452
|
<!-- omit in toc -->
|
|
@@ -445,7 +455,7 @@ php ./vendor/bin/rector process --config ./conf/rector.php
|
|
|
445
455
|
Example call, adjust as needed
|
|
446
456
|
|
|
447
457
|
```sh
|
|
448
|
-
php ./vendor/bin/phpstan analyze --
|
|
458
|
+
php ./vendor/bin/phpstan analyze --configuration ./conf/phpstan.php -vv --memory-limit=-1
|
|
449
459
|
```
|
|
450
460
|
|
|
451
461
|
<!-- omit in toc -->
|
|
@@ -462,7 +472,7 @@ include ./vendor/brnshkr/config/conf/Makefile
|
|
|
462
472
|
<!-- omit in toc -->
|
|
463
473
|
###### PHP CS Fixer
|
|
464
474
|
|
|
465
|
-
Expected configuration file: `./conf
|
|
475
|
+
Expected configuration file: `./conf/php-cs-fixer.php`
|
|
466
476
|
|
|
467
477
|
```sh
|
|
468
478
|
make php-cs-fixer
|
|
@@ -480,7 +490,7 @@ make rector
|
|
|
480
490
|
<!-- omit in toc -->
|
|
481
491
|
###### PHPStan
|
|
482
492
|
|
|
483
|
-
Expected configuration file: `./conf/phpstan.
|
|
493
|
+
Expected configuration file: `./conf/phpstan.php`
|
|
484
494
|
|
|
485
495
|
```sh
|
|
486
496
|
make phpstan
|
|
@@ -516,9 +526,9 @@ Install dependencies and setup project tooling with the following commands and a
|
|
|
516
526
|
|
|
517
527
|
```sh
|
|
518
528
|
composer install \
|
|
519
|
-
&& cp -v ./conf
|
|
529
|
+
&& cp -v ./conf/php-cs-fixer.php.example ./conf/php-cs-fixer.php \
|
|
520
530
|
&& cp -v ./conf/rector.php.example ./conf/rector.php \
|
|
521
|
-
&& cp -v ./conf/phpstan.
|
|
531
|
+
&& cp -v ./conf/phpstan.php.example ./conf/phpstan.php
|
|
522
532
|
```
|
|
523
533
|
|
|
524
534
|
<!-- omit in toc -->
|
|
@@ -657,3 +667,7 @@ Distributed under the MIT License. See [LICENSE](./LICENSE) for more information
|
|
|
657
667
|
|
|
658
668
|
[issues-url]: https://github.com/brnshkr/config/issues
|
|
659
669
|
[issues-shield-url]: https://img.shields.io/github/issues/brnshkr/config.svg?label=🚨%20issues&style=flat-square&labelColor=%237f399d&color=%23a5097e
|
|
670
|
+
|
|
671
|
+
<!-- NOTICE: Only use packagist version here since both packages are versioned in sync -->
|
|
672
|
+
[release-url]: https://github.com/brnshkr/config/releases
|
|
673
|
+
[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,14 @@
|
|
|
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": "esnext",
|
|
42
40
|
"moduleResolution": "bundler",
|
|
43
|
-
"noUncheckedSideEffectImports": true,
|
|
44
41
|
"resolveJsonModule": true,
|
|
42
|
+
"types": ["bun"],
|
|
45
43
|
|
|
46
44
|
// Emit
|
|
47
45
|
"noEmit": true,
|
|
@@ -55,7 +53,6 @@
|
|
|
55
53
|
"checkJs": true,
|
|
56
54
|
|
|
57
55
|
// Interop Constraints
|
|
58
|
-
"esModuleInterop": true,
|
|
59
56
|
"forceConsistentCasingInFileNames": true,
|
|
60
57
|
"verbatimModuleSyntax": true,
|
|
61
58
|
|
|
@@ -68,7 +65,6 @@
|
|
|
68
65
|
"noPropertyAccessFromIndexSignature": true,
|
|
69
66
|
"noUncheckedIndexedAccess": true,
|
|
70
67
|
"noUnusedLocals": true,
|
|
71
|
-
"noUnusedParameters": true
|
|
72
|
-
"strict": true
|
|
68
|
+
"noUnusedParameters": true
|
|
73
69
|
}
|
|
74
70
|
}
|