@brnshkr/config 0.0.1-beta.1 → 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 +50 -3
- package/conf/tsconfig.json +1 -0
- package/dist/eslint/index.mjs +8 -0
- package/dist/shared.mjs +1 -1
- package/dist/stylelint/index.mjs +12 -8
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -336,6 +336,15 @@ cp -v ./vendor/brnshkr/config/conf/phpstan.php.example ./conf/phpstan.php \
|
|
|
336
336
|
&& cp -v ./vendor/brnshkr/config/conf/phpstan.dist.php.example ./conf/phpstan.dist.php
|
|
337
337
|
```
|
|
338
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
|
|
346
|
+
```
|
|
347
|
+
|
|
339
348
|
<!-- omit in toc -->
|
|
340
349
|
##### Makefile
|
|
341
350
|
|
|
@@ -363,6 +372,9 @@ cp -v ./vendor/brnshkr/config/conf/php-cs-fixer.php.example ./conf/php-cs-fixer.
|
|
|
363
372
|
&& cp -v ./vendor/brnshkr/config/conf/phpstan.php.example ./conf/phpstan.php \
|
|
364
373
|
&& cp -v ./vendor/brnshkr/config/conf/phpstan.php.example ./conf/phpstan.php.example \
|
|
365
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 \
|
|
366
378
|
&& cp -v ./vendor/brnshkr/config/conf/Makefile.example ./Makefile \
|
|
367
379
|
&& cp -v ./vendor/brnshkr/config/conf/.gitignore.example ./.gitignore
|
|
368
380
|
```
|
|
@@ -418,6 +430,21 @@ use Brnshkr\Config\PhpStan;
|
|
|
418
430
|
return PhpStan::getConfig(/* customize */);
|
|
419
431
|
```
|
|
420
432
|
|
|
433
|
+
<!-- omit in toc -->
|
|
434
|
+
##### Twig CS Fixer
|
|
435
|
+
|
|
436
|
+
```php
|
|
437
|
+
// ./twig-cs-fixer.dist.php
|
|
438
|
+
|
|
439
|
+
<?php
|
|
440
|
+
|
|
441
|
+
declare(strict_types=1);
|
|
442
|
+
|
|
443
|
+
use Brnshkr\Config\TwigCsFixer;
|
|
444
|
+
|
|
445
|
+
return TwigCsFixer::getConfig(/* customize */);
|
|
446
|
+
```
|
|
447
|
+
|
|
421
448
|
<p align="right"><a href="#top" title="Back to top"> ⬆ </a></p>
|
|
422
449
|
|
|
423
450
|
### 👀 Usage
|
|
@@ -458,6 +485,15 @@ Example call, adjust as needed
|
|
|
458
485
|
php ./vendor/bin/phpstan analyze --configuration ./conf/phpstan.php -vv --memory-limit=-1
|
|
459
486
|
```
|
|
460
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
|
|
495
|
+
```
|
|
496
|
+
|
|
461
497
|
<!-- omit in toc -->
|
|
462
498
|
##### Option 2 — Run Helper Scripts (Make Only, @brnshkr Convention)
|
|
463
499
|
|
|
@@ -496,6 +532,15 @@ Expected configuration file: `./conf/phpstan.php`
|
|
|
496
532
|
make phpstan
|
|
497
533
|
```
|
|
498
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
|
+
|
|
499
544
|
<!-- omit in toc -->
|
|
500
545
|
#### IDE Setup
|
|
501
546
|
|
|
@@ -528,7 +573,8 @@ Install dependencies and setup project tooling with the following commands and a
|
|
|
528
573
|
composer install \
|
|
529
574
|
&& cp -v ./conf/php-cs-fixer.php.example ./conf/php-cs-fixer.php \
|
|
530
575
|
&& cp -v ./conf/rector.php.example ./conf/rector.php \
|
|
531
|
-
&& cp -v ./conf/phpstan.php.example ./conf/phpstan.php
|
|
576
|
+
&& cp -v ./conf/phpstan.php.example ./conf/phpstan.php \
|
|
577
|
+
&& cp -v ./conf/twig-cs-fixer.php.example ./conf/twig-cs-fixer.php
|
|
532
578
|
```
|
|
533
579
|
|
|
534
580
|
<!-- omit in toc -->
|
|
@@ -551,7 +597,7 @@ Here are some frequently used examples (see `make help` for the complete list):
|
|
|
551
597
|
- `make phpstan` — Run PHPStan static analysis
|
|
552
598
|
- `make test` — Run PHPUnit test suite
|
|
553
599
|
- `make test-update` — Run PHPUnit test suite and update snapshots
|
|
554
|
-
- `make check` — Run Rector, PHP-CS-Fixer, PHPStan and PHPUnit
|
|
600
|
+
- `make check` — Run Rector, PHP-CS-Fixer, Twig-CS-Fixer, PHPStan and PHPUnit
|
|
555
601
|
|
|
556
602
|
## 🔨 TODOs / Roadmap
|
|
557
603
|
|
|
@@ -632,8 +678,9 @@ Distributed under the MIT License. See [LICENSE](./LICENSE) for more information
|
|
|
632
678
|
- [PHP](https://www.php.net)
|
|
633
679
|
- [PHPStan](https://github.com/phpstan/phpstan)
|
|
634
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)
|
|
635
683
|
- [GNU Make](https://www.gnu.org/software/make)
|
|
636
|
-
- [PHP Coding Standards Fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer)
|
|
637
684
|
- [Best-README-Template](https://github.com/othneildrew/Best-README-Template) by [othneildrew](https://github.com/othneildrew)
|
|
638
685
|
- [Choose an Open Source License](https://choosealicense.com)
|
|
639
686
|
- [Shields.io](https://shields.io)
|
package/conf/tsconfig.json
CHANGED
package/dist/eslint/index.mjs
CHANGED
|
@@ -354,6 +354,14 @@ const imports = async () => {
|
|
|
354
354
|
if (pluginImport) {
|
|
355
355
|
plugins["import"] = pluginImport;
|
|
356
356
|
settings["import-x/resolver-next"] = [pluginImport.createNodeResolver(), importResovlerTypescript === void 0 ? void 0 : importResovlerTypescript.createTypeScriptImportResolver({ bun: true })].filter(Boolean);
|
|
357
|
+
settings["import-x/core-modules"] = [
|
|
358
|
+
"bun",
|
|
359
|
+
"bun:bundle",
|
|
360
|
+
"bun:ffi",
|
|
361
|
+
"bun:jsc",
|
|
362
|
+
"bun:sqlite",
|
|
363
|
+
"bun:test"
|
|
364
|
+
];
|
|
357
365
|
const pluginImportTsRules = isModuleEnabled(MODULES.typescript) ? renameRules(pluginImport.flatConfigs.typescript.rules, { "import-x": "import" }) : {};
|
|
358
366
|
pluginImportRules = {
|
|
359
367
|
...renameRules(pluginImport.flatConfigs.recommended.rules, { "import-x": "import" }),
|
package/dist/shared.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { isPackageExists } from "local-pkg";
|
|
2
2
|
//#region ../package.json
|
|
3
3
|
var name = "@brnshkr/config";
|
|
4
|
-
var version = "0.0.1-beta.
|
|
4
|
+
var version = "0.0.1-beta.2";
|
|
5
5
|
//#endregion
|
|
6
6
|
//#region ../src/js/shared/utils/package-json.ts
|
|
7
7
|
const packageOrganizationInternal = name.split("/").at(0)?.replace(/^@/v, "");
|
package/dist/stylelint/index.mjs
CHANGED
|
@@ -126,14 +126,18 @@ const defensive = () => {
|
|
|
126
126
|
return [{
|
|
127
127
|
plugins: STYLELINT_PACKAGES.STYLELINT_PLUGIN_DEFENSIVE_CSS,
|
|
128
128
|
extends: `${STYLELINT_PACKAGES.STYLELINT_PLUGIN_DEFENSIVE_CSS}/configs/strict`,
|
|
129
|
-
rules: {
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
129
|
+
rules: {
|
|
130
|
+
"defensive-css/require-custom-property-fallback": true,
|
|
131
|
+
"defensive-css/require-pure-selectors": [true, {
|
|
132
|
+
ignoreElements: [
|
|
133
|
+
"*",
|
|
134
|
+
"html",
|
|
135
|
+
"body"
|
|
136
|
+
],
|
|
137
|
+
ignoreAttributeSelectors: true,
|
|
138
|
+
strict: true
|
|
139
|
+
}]
|
|
140
|
+
}
|
|
137
141
|
}];
|
|
138
142
|
};
|
|
139
143
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://json.schemastore.org/package",
|
|
3
3
|
"name": "@brnshkr/config",
|
|
4
|
-
"version": "0.0.1-beta.
|
|
4
|
+
"version": "0.0.1-beta.2",
|
|
5
5
|
"description": "Centralized collection of configuration and tooling used across all @brnshkr projects",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"author": "Patrick Rupp",
|