Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v6 : Tests / Refactorisation #75

Merged
merged 19 commits into from
Nov 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/tests export-ignore
/phpunit.xml.dist export-ignore
.github export-ignore
.gitattributes export-ignore
.gitignore export-ignore
Expand Down
54 changes: 54 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: 🐛 Bug report
description: Create a report to help us improve
labels: ["bug"]
body:
- type: markdown
attributes:
value: |
Thanks for using this bundle and taking the time to fill out this bug report !
- type: input
id: vite-bundle-version
attributes:
label: vite-bundle version
description: composer show pentatrion/vite-bundle | grep versions
placeholder: x.y.z
validations:
required: true
- type: input
id: vite-plugin-symfony-version
attributes:
label: vite-plugin-symfony version
description: npm list vite-plugin-symfony
placeholder: x.y.z
validations:
required: true
- type: input
id: context
attributes:
label: Symfony version, PHP version, your OS (node version ?)
placeholder: "symfony 7.3, PHP 8.2, node 20.5, OS Linux"
- type: textarea
id: description
attributes:
label: Description
description: A clear and concise description of the problem
validations:
required: true
- type: textarea
id: how-to-reproduce
attributes:
label: How to reproduce
description: |
⚠️ This is the most important part of the report ⚠️
Without a way to easily reproduce your issue, there is little chance we will be able to help you and work on a fix.
Please, take the time to show us some code and/or config that is needed for others to reproduce the problem easily.
validations:
required: true
- type: textarea
id: possible-solution
attributes:
label: Possible Solution
description: |
Optional: only if you have suggestions on a fix/reason for the bug
Don't hesitate to create a pull request with your solution, it helps get faster feedback. You should open a pull request on the main symfony-vite-dev monorepo : https://github.com/lhapaipai/symfony-vite-dev.
This repository is a "subtree split": a read-only subset of that main repository.
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
blank_issues_enabled: true
17 changes: 17 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: 🚀 Feature Request
description: RFC and ideas for new features and improvements
body:
- type: textarea
id: description
attributes:
label: Description
description: A clear and concise description of the new feature
validations:
required: true
- type: textarea
id: example
attributes:
label: Example
description: |
A simple example of the new feature in action (include PHP code, YAML config, etc.)
If the new feature changes an existing feature, include a simple before/after comparison.
50 changes: 0 additions & 50 deletions .github/workflows/ci.yaml

This file was deleted.

4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,6 @@
/.local
/.idea
/vendor
/.php-cs-fixer.cache
/.php-cs-fixer.cache
/.phpunit.result.cache
/composer.lock
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Next

- make services privates.
- add tests for EntrypointRenderer, EntrypointsLookup and TagRenderer.
- add preload option (symfony/web-link)

## v5.0.1

- remove deprecated options
Expand Down
5 changes: 5 additions & 0 deletions MiGRATION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!--
```diff
- Pentatrion\ViteBundle\Asset\ViteAssetVersionStrategy
+ Pentatrion\ViteBundle\Asset\VersionStrategy\ViteAssetVersionStrategy
``` -->
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
This bundle helping you render all of the dynamic `script` and `link` tags needed.
Essentially, he provides two twig functions to load the correct scripts into your templates.

⚠️ This repository is a "subtree split": a read-only subset of that main repository [symfony-vite-dev](https://github.com/lhapaipai/symfony-vite-dev).

## Installation

Install the bundle with :
Expand Down Expand Up @@ -45,7 +47,6 @@ Add this twig functions in any template or base layout where you need to include
| ----------------------------------------------------------------------- | :------------------------ |
| [vite-bundle](https://github.com/lhapaipai/vite-bundle) | Symfony Bundle |
| [vite-plugin-symfony](https://github.com/lhapaipai/vite-plugin-symfony) | Vite plugin |
| [symfony-vite-docs](https://github.com/lhapaipai/symfony-vite-docs) | Documentation |
| [symfony-vite-dev](https://github.com/lhapaipai/symfony-vite-dev) | Package for contributors |

## License
Expand Down
19 changes: 19 additions & 0 deletions bin/phpunit
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env php
<?php

if (!ini_get('date.timezone')) {
ini_set('date.timezone', 'UTC');
}

if (is_file(dirname(__DIR__).'/vendor/phpunit/phpunit/phpunit')) {
define('PHPUNIT_COMPOSER_INSTALL', dirname(__DIR__).'/vendor/autoload.php');
require PHPUNIT_COMPOSER_INSTALL;
PHPUnit\TextUI\Command::main();
} else {
if (!is_file(dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php')) {
echo "Unable to find the `simple-phpunit.php` script in `vendor/symfony/phpunit-bridge/bin/`.\n";
exit(1);
}

require dirname(__DIR__).'/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php';
}
33 changes: 21 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,29 +17,38 @@
],
"require": {
"php": "^7.4 || ^8.0",
"symfony/asset": "^4.4 || ^5.0 || ^6.0",
"symfony/config": "^4.4 || ^5.0 || ^6.0",
"symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0",
"symfony/http-client": "^4.4 || ^5.0 || ^6.0",
"symfony/http-kernel": "^4.4 || ^5.0 || ^6.0",
"symfony/framework-bundle": "^4.4 || ^5.0 || ^6.0",
"symfony/twig-bundle": "^4.4 || ^5.0 || ^6.0"
"symfony/asset": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"symfony/config": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"symfony/dependency-injection": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"symfony/http-client": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"symfony/http-kernel": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"symfony/framework-bundle": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"symfony/twig-bundle": "^4.4 || ^5.0 || ^6.0 || ^7.0"
},
"autoload": {
"psr-4": {
"Pentatrion\\ViteBundle\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Pentatrion\\ViteBundle\\Tests\\": "tests/"
}
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.9",
"phpstan/phpstan": "^1.8"
"phpstan/phpstan": "^1.8",
"phpunit/phpunit": "^9.5",
"symfony/phpunit-bridge": "^4.4 || ^5.0 || ^6.0 || ^7.0",
"symfony/web-link": "^4.4 || ^5.0 || ^6.0 || ^7.0"
},
"scripts": {
"cs-fix": "php8.1 vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php",
"cs-fix": "php8.2 vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php",
"ci-check": [
"find -L . -path ./vendor -prune -o -type f -name '*.php' -print0 | xargs -0 -n 1 -P $(nproc) php -l",
"php8.1 vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --diff --dry-run --stop-on-violation --using-cache=no",
"php8.1 vendor/bin/phpstan analyse --configuration=phpstan.neon"
"find -L . -path ./vendor -prune -o -type f -name '*.php' -print0 | xargs -0 -n 1 -P $(nproc) php7.4 -l",
"find -L . -path ./vendor -prune -o -type f -name '*.php' -print0 | xargs -0 -n 1 -P $(nproc) php8.2 -l",
"php8.2 vendor/bin/php-cs-fixer fix --config=.php-cs-fixer.dist.php --diff --dry-run --stop-on-violation --using-cache=no",
"php8.2 vendor/bin/phpstan analyse --configuration=phpstan.neon"
]
}
}
Loading