Skip to content

Commit efbef32

Browse files
authored
Merge branch 'symfony:2.x' into svelte-4-support
2 parents 6ceb80f + 77b916a commit efbef32

File tree

673 files changed

+16818
-16395
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

673 files changed

+16818
-16395
lines changed

.github/workflows/doctor-rst.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ name: RST Linter
22

33
on:
44
push:
5+
paths-ignore:
6+
- 'ux.symfony.com/**'
57
pull_request:
8+
paths-ignore:
9+
- 'ux.symfony.com/**'
610

711
jobs:
812
doctor-rst:
@@ -16,7 +20,7 @@ jobs:
1620
run: mkdir .cache
1721

1822
- name: Extract base branch name
19-
run: echo "##[set-output name=branch;]$(echo ${GITHUB_BASE_REF:=${GITHUB_REF##*/}})"
23+
run: echo "branch=$(echo ${GITHUB_BASE_REF:=${GITHUB_REF##*/}})" >> $GITHUB_OUTPUT
2024
id: extract_base_branch
2125

2226
- name: Cache DOCtor-RST

.github/workflows/test-turbo.yml

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,18 @@ name: Symfony UX Turbo
22

33
on:
44
push:
5+
paths:
6+
- 'src/Turbo/**'
57
pull_request:
8+
paths:
9+
- 'src/Turbo/**'
610

711
jobs:
812
phpstan:
913
runs-on: ubuntu-latest
1014
steps:
1115
- name: Checkout
12-
uses: actions/checkout@v2
16+
uses: actions/checkout@v3
1317

1418
- name: Setup PHP
1519
uses: shivammathur/setup-php@v2
@@ -34,8 +38,12 @@ jobs:
3438
strategy:
3539
fail-fast: false
3640
matrix:
37-
php-version: ['8.1']
38-
dependency-version: ['lowest', 'highest']
41+
php-version: ['8.1', '8.2']
42+
include:
43+
- php-version: '8.1'
44+
dependency-version: 'lowest'
45+
- php-version: '8.2'
46+
dependency-version: 'highest'
3947

4048
services:
4149
mercure:
@@ -52,7 +60,7 @@ jobs:
5260

5361
steps:
5462
- name: Checkout
55-
uses: actions/checkout@v2
63+
uses: actions/checkout@v3
5664

5765
- name: Setup PHP
5866
uses: shivammathur/setup-php@v2
@@ -69,7 +77,7 @@ jobs:
6977
id: yarn-cache-dir-path
7078
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
7179

72-
- uses: actions/cache@v2
80+
- uses: actions/cache@v3
7381
id: yarn-cache
7482
with:
7583
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -92,3 +100,5 @@ jobs:
92100
- name: Run tests
93101
working-directory: src/Turbo
94102
run: vendor/bin/simple-phpunit
103+
env:
104+
SYMFONY_DEPRECATIONS_HELPER: 'max[self]=1'

.github/workflows/test.yaml

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,17 @@ name: Symfony UX
22

33
on:
44
push:
5+
paths-ignore:
6+
- 'ux.symfony.com/**'
57
pull_request:
8+
paths-ignore:
9+
- 'ux.symfony.com/**'
610

711
jobs:
812
coding-style-php:
913
runs-on: ubuntu-latest
1014
steps:
11-
- uses: actions/checkout@master
15+
- uses: actions/checkout@v3
1216
- uses: shivammathur/setup-php@v2
1317
with:
1418
php-version: '8.1'
@@ -20,11 +24,11 @@ jobs:
2024
name: JavaScript Coding Style
2125
runs-on: ubuntu-latest
2226
steps:
23-
- uses: actions/checkout@master
27+
- uses: actions/checkout@v3
2428
- name: Get yarn cache directory path
2529
id: yarn-cache-dir-path
2630
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
27-
- uses: actions/cache@v2
31+
- uses: actions/cache@v3
2832
id: yarn-cache
2933
with:
3034
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -39,11 +43,11 @@ jobs:
3943
name: Check for UnBuilt JS Dist Files
4044
runs-on: ubuntu-latest
4145
steps:
42-
- uses: actions/checkout@master
46+
- uses: actions/checkout@v3
4347
- name: Get yarn cache directory path
4448
id: yarn-cache-dir-path
4549
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
46-
- uses: actions/cache@v2
50+
- uses: actions/cache@v3
4751
id: yarn-cache
4852
with:
4953
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
@@ -86,8 +90,12 @@ jobs:
8690
strategy:
8791
fail-fast: false
8892
matrix:
89-
php-version: ['8.1']
90-
dependency-version: ['lowest', 'highest']
93+
php-version: ['8.1', '8.2']
94+
include:
95+
- php-version: '8.1'
96+
dependency-version: 'lowest'
97+
- php-version: '8.2'
98+
dependency-version: 'highest'
9199
component: ${{ fromJson(needs.tests-php-components.outputs.components )}}
92100
exclude:
93101
- component: Swup # has no tests
@@ -124,11 +132,11 @@ jobs:
124132
tests-js:
125133
runs-on: ubuntu-latest
126134
steps:
127-
- uses: actions/checkout@master
135+
- uses: actions/checkout@v3
128136
- name: Get yarn cache directory path
129137
id: yarn-cache-dir-path
130138
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
131-
- uses: actions/cache@v2
139+
- uses: actions/cache@v3
132140
id: yarn-cache
133141
with:
134142
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}

.github/workflows/ux.symfony.com.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ name: ux.symfony.com
22

33
on:
44
push:
5+
paths:
6+
- 'ux.symfony.com/**'
57
pull_request:
8+
paths:
9+
- 'ux.symfony.com/**'
610

711
jobs:
812
tests:
@@ -24,5 +28,8 @@ jobs:
2428
with:
2529
working-directory: ux.symfony.com
2630

31+
- name: Build Sass assets
32+
run: php bin/console sass:build
33+
2734
- name: Tests
2835
run: vendor/bin/phpunit

.php-cs-fixer.dist.php

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,33 @@
11
<?php
22

3+
/*
4+
* This file is part of the Symfony package.
5+
*
6+
* (c) Fabien Potencier <[email protected]>
7+
*
8+
* For the full copyright and license information, please view the LICENSE
9+
* file that was distributed with this source code.
10+
*/
11+
312
if (!file_exists(__DIR__.'/src')) {
413
exit(0);
514
}
615

16+
$fileHeaderComment = <<<'EOF'
17+
This file is part of the Symfony package.
18+
19+
(c) Fabien Potencier <[email protected]>
20+
21+
For the full copyright and license information, please view the LICENSE
22+
file that was distributed with this source code.
23+
EOF;
24+
725
return (new PhpCsFixer\Config())
826
->setRules([
27+
'@PHPUnit75Migration:risky' => true,
928
'@Symfony' => true,
1029
'@Symfony:risky' => true,
11-
'@PHPUnit75Migration:risky' => true,
12-
'php_unit_dedicate_assert' => ['target' => '5.6'],
13-
'array_syntax' => ['syntax' => 'short'],
14-
'fopen_flags' => false,
15-
'protected_to_private' => false,
16-
'native_constant_invocation' => true,
17-
'combine_nested_dirname' => true,
18-
'list_syntax' => ['syntax' => 'short'],
19-
'ordered_imports' => [
20-
'imports_order' => ['const', 'class', 'function'],
21-
],
30+
'header_comment' => ['header' => $fileHeaderComment],
2231
])
2332
->setRiskyAllowed(true)
2433
->setFinder(
@@ -28,6 +37,5 @@
2837
->notPath('#/Fixtures/#')
2938
->notPath('#/app/var/#')
3039
->notPath('#/var/cache/#')
31-
->notPath('Turbo/Attribute/Broadcast.php') // Need https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/4702
3240
)
3341
;

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ or with [AssetMapper](https://symfony.com/doc/current/frontend/asset_mapper.html
2222
## Resources
2323

2424
- [Install Symfony UX](https://symfony.com/doc/current/frontend/ux.html).
25-
- [List of UX Packages](https://symfony.com/doc/current/frontend/ux.html#ux-packages-list).
25+
- [List of UX Packages](https://symfony.com/bundles/StimulusBundle/current/index.html#the-ux-packages).
2626
- [Symfony UX Official Demo](https://ux.symfony.com).
2727
- Watch the [Stimulus Screencast on SymfonyCasts](https://symfonycasts.com/screencast/stimulus).
2828

bin/run-vitest-all.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
# Get all workspace names
4+
workspaces=$(yarn workspaces info | grep -o '@symfony/[^"]*')
5+
6+
# Flag to track if any test fails
7+
all_tests_passed=true
8+
9+
for workspace in $workspaces; do
10+
echo "Running tests in $workspace..."
11+
12+
# Run the tests and if they fail, set the flag to false
13+
yarn workspace $workspace run vitest --run || { echo "$workspace failed"; all_tests_passed=false; }
14+
done
15+
16+
# Check the flag at the end and exit with code 1 if any test failed
17+
if [ "$all_tests_passed" = false ]; then
18+
echo "Some tests failed."
19+
exit 1
20+
else
21+
echo "All tests passed!"
22+
exit 0
23+
fi

composer.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
{
22
"name": "symfony/ux",
33
"license": "MIT",
4+
"keywords": [
5+
"dev"
6+
],
47
"require-dev": {
5-
"symfony/filesystem": "^5.2|^6.0",
6-
"symfony/finder": "^5.4|^6.0",
8+
"symfony/filesystem": "^5.2|^6.0|^7.0",
9+
"symfony/finder": "^5.4|^6.0|^7.0",
710
"php-cs-fixer/shim": "^3.13"
811
}
912
}

jest.config.js

Lines changed: 0 additions & 12 deletions
This file was deleted.

package.json

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
],
66
"scripts": {
77
"build": "node bin/build_javascript.js && node bin/build_styles.js",
8-
"test": "yarn workspaces run jest",
8+
"test": "bin/run-vitest-all.sh",
99
"lint": "yarn workspaces run eslint src test",
1010
"format": "prettier src/*/assets/src/*.ts src/*/assets/test/*.js {,src/*/}*.{json,md} --write",
1111
"check-lint": "yarn lint --no-fix",
@@ -22,16 +22,14 @@
2222
"@symfony/stimulus-testing": "^2.0.1",
2323
"@typescript-eslint/eslint-plugin": "^5.2.0",
2424
"@typescript-eslint/parser": "^5.2.0",
25-
"babel-jest": "^27.3.1",
2625
"clean-css-cli": "^5.6.2",
2726
"eslint": "^8.1.0",
2827
"eslint-config-prettier": "^8.0.0",
29-
"eslint-plugin-jest": "^25.2.2",
30-
"jest": "^27.3.1",
3128
"prettier": "^2.2.1",
3229
"rollup": "^3.7.0",
3330
"tslib": "^2.3.1",
34-
"typescript": "^4.4.4"
31+
"typescript": "^4.4.4",
32+
"vitest": "^0.34.6"
3533
},
3634
"eslintConfig": {
3735
"root": true,
@@ -61,9 +59,6 @@
6159
{
6260
"files": [
6361
"src/*/assets/test/**/*.ts"
64-
],
65-
"extends": [
66-
"plugin:jest/recommended"
6762
]
6863
}
6964
]
@@ -72,7 +67,7 @@
7267
"printWidth": 120,
7368
"trailingComma": "es5",
7469
"tabWidth": 4,
75-
"jsxBracketSameLine": true,
70+
"bracketSameLine": true,
7671
"singleQuote": true
7772
}
7873
}

src/Autocomplete/.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,5 @@
44
/phpunit.xml.dist export-ignore
55
/assets/.gitignore export-ignore
66
/assets/src/**/*.ts export-ignore
7-
/assets/jest.config.js export-ignore
87
/assets/test export-ignore
98
/tests export-ignore

src/Autocomplete/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGELOG
22

3+
## 2.13.0
4+
5+
- Add new BaseEntityAutocompleteType
6+
37
## 2.9.0
48

59
- Add support for symfony/asset-mapper

src/Autocomplete/assets/jest.config.js

Lines changed: 0 additions & 5 deletions
This file was deleted.

src/Autocomplete/assets/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
},
3030
"devDependencies": {
3131
"@hotwired/stimulus": "^3.0.0",
32-
"fetch-mock-jest": "^1.5.1",
33-
"tom-select": "^2.2.2"
32+
"tom-select": "^2.2.2",
33+
"vitest-fetch-mock": "^0.2.2"
3434
}
3535
}

0 commit comments

Comments
 (0)