Skip to content

Commit 2dbf156

Browse files
committed
Merge remote-tracking branch 'upstream/main' into mongodb-sf7
2 parents 83aaf9f + 3edba75 commit 2dbf156

File tree

97 files changed

+3137
-16060
lines changed

Some content is hidden

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

97 files changed

+3137
-16060
lines changed

.devcontainer/devcontainer.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,13 @@
55
"ghcr.io/shyim/devcontainers-features/php:0": {
66
"version": "8.1"
77
},
8-
"ghcr.io/devcontainers/features/node:1": {
9-
"version": "lts"
10-
}
118
},
129
"updateContentCommand": {
1310
"composer install": ["composer", "install"],
14-
"yarn": ["yarn"]
11+
"importmap:install": ["symfony", "console", "importmap:install"]
1512
},
1613
"postAttachCommand": {
1714
"server": "symfony server:start",
18-
"yarn": ["yarn", "watch"]
15+
"sass build": ["symfony", "console", "sass:build", "-w"]
1916
}
2017
}

.github/workflows/lint.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ jobs:
3030
runs-on: ubuntu-latest
3131
strategy:
3232
matrix:
33-
php-version: ['8.1']
33+
php-version: ['8.2']
3434

3535
steps:
3636
- name: "Checkout code"
@@ -52,11 +52,11 @@ jobs:
5252
uses: actions/cache@v3
5353
with:
5454
path: ${{ steps.composer-cache.outputs.dir }}
55-
key: ${{ runner.os }}-${{ matrix.php-version }}-composer-${{ hashFiles('composer.lock') }}
56-
restore-keys: ${{ runner.os }}-${{ matrix.php-version }}-composer-
55+
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
56+
restore-keys: ${{ runner.os }}-composer-
5757

58-
- name: "Composer install"
59-
run: composer install --no-interaction --no-progress
58+
- name: "Install dependencies"
59+
run: composer install --ansi --no-interaction --no-progress
6060

6161
- name: Install PHPUnit
6262
id: install

.github/workflows/tests.yaml

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ env:
1010
fail-fast: true
1111
PHPUNIT_FLAGS: "-v"
1212
SYMFONY_PHPUNIT_DIR: "$HOME/symfony-bridge/.phpunit"
13-
SYMFONY_DEPRECATIONS_HELPER: 7
13+
SYMFONY_DEPRECATIONS_HELPER: 0
1414

1515
permissions:
1616
contents: read
@@ -24,12 +24,12 @@ jobs:
2424
strategy:
2525
matrix:
2626
operating-system: ['ubuntu-latest']
27-
php-version: ['8.1']
27+
php-version: ['8.2', '8.3']
2828
include:
2929
- operating-system: 'macos-latest'
30-
php-version: '8.1'
30+
php-version: '8.2'
3131
- operating-system: 'windows-latest'
32-
php-version: '8.1'
32+
php-version: '8.2'
3333

3434
steps:
3535
- name: "Checkout code"
@@ -39,7 +39,7 @@ jobs:
3939
uses: shivammathur/setup-php@v2
4040
with:
4141
coverage: "none"
42-
extensions: "intl, mbstring, pdo_sqlite"
42+
extensions: "intl, mbstring, pdo_sqlite, zip"
4343
php-version: ${{ matrix.php-version }}
4444
tools: composer:v2
4545

@@ -55,11 +55,14 @@ jobs:
5555
uses: actions/cache@v3
5656
with:
5757
path: ${{ steps.composer-cache.outputs.dir }}
58-
key: ${{ runner.os }}-${{ matrix.php-version }}-composer-${{ hashFiles('composer.json') }}
59-
restore-keys: ${{ runner.os }}-${{ matrix.php-version }}-composer-
58+
key: ${{ runner.os }}-composer-${{ hashFiles('composer.lock') }}
59+
restore-keys: ${{ runner.os }}-composer-
6060

6161
- name: "Install dependencies"
62-
run: composer install --no-interaction --no-progress
62+
run: composer install --ansi --no-interaction --no-progress
63+
64+
- name: "Build Sass"
65+
run: php bin/console sass:build
6366

6467
- name: "Install PHPUnit"
6568
run: vendor/bin/simple-phpunit install

.gitignore

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
.phpunit.result.cache
1818
/phpunit.xml
1919
###< symfony/phpunit-bridge ###
20-
###> symfony/webpack-encore-bundle ###
21-
/node_modules/
22-
npm-debug.log
23-
yarn-error.log
24-
###< symfony/webpack-encore-bundle ###
20+
21+
###> symfony/asset-mapper ###
22+
/public/assets/
23+
/assets/vendor
24+
###< symfony/asset-mapper ###

.php-cs-fixer.dist.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
// exclude files generated by Symfony Flex recipes
1919
->notPath('bin/console')
2020
->notPath('public/index.php')
21+
->notPath('importmap.php')
2122
;
2223

2324
return (new PhpCsFixer\Config())

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ You can also learn about these practices in [the official Symfony Book][5].
99
Requirements
1010
------------
1111

12-
* PHP 8.1.0 or higher;
12+
* PHP 8.2.0 or higher;
1313
* PDO-SQLite PHP extension enabled;
1414
* and the [usual Symfony application requirements][2].
1515

assets/admin.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
1-
import './styles/admin.scss';
1+
import './styles/admin.css';
22
import 'typeahead.js';
33
import Bloodhound from "bloodhound-js";
4+
import './js/jquery_global.js';
5+
import $ from 'jquery';
46
import 'bootstrap-tagsinput';
7+
import './styles/bootstrap-tagsinput.css';
58

69
$(function() {
710
// Bootstrap-tagsinput initialization

assets/app.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
import './styles/app.scss';
2+
import '@fortawesome/fontawesome-free/css/all.css';
3+
import '@fortawesome/fontawesome-free/css/v4-shims.css';
4+
import 'highlight.js/styles/github-dark-dimmed.css';
5+
import 'lato-font/css/lato-font.css';
26

37
// loads the Bootstrap plugins
48
import 'bootstrap/js/dist/alert';
@@ -15,6 +19,6 @@ import './js/highlight.js';
1519
import './js/doclinks.js';
1620

1721
// start the Stimulus application
18-
import './bootstrap';
22+
import './bootstrap.js';
1923

20-
import './js/flatpicker';
24+
import './js/flatpicker.js';

assets/bootstrap.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
1-
import { startStimulusApp } from '@symfony/stimulus-bridge';
1+
import { startStimulusApp } from '@symfony/stimulus-bundle';
22

3-
// Registers Stimulus controllers from controllers.json and in the controllers/ directory
4-
export const app = startStimulusApp(require.context(
5-
'@symfony/stimulus-bridge/lazy-controller-loader!./controllers',
6-
true,
7-
/\.[jt]sx?$/
8-
));
3+
const app = startStimulusApp();
94

105
// register any custom, 3rd party controllers here
116
// app.register('some_controller_name', SomeImportedController);

assets/js/doclinks.js

Lines changed: 27 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,54 @@
11
'use strict';
22

33
// Wraps some elements in anchor tags referencing to the Symfony documentation
4-
$(function() {
5-
var $modal = $('#sourceCodeModal');
6-
var $controllerCode = $modal.find('code.php');
7-
var $templateCode = $modal.find('code.twig');
4+
document.addEventListener('DOMContentLoaded', function() {
5+
const modalElt = document.querySelector('#sourceCodeModal');
6+
if (!modalElt) {
7+
return;
8+
}
9+
const controllerCode = modalElt.querySelector('code.php');
10+
const templateCode = modalElt.querySelector('code.twig');
811

912
function anchor(url, content) {
1013
return '<a class="doclink" target="_blank" href="' + url + '">' + content + '</a>';
11-
};
14+
}
1215

1316
function wrap(content, links) {
1417
return content.replace(
1518
new RegExp(Object.keys(links).join('|'), 'g'),
1619
token => anchor(links[token], token)
1720
);
18-
};
21+
}
1922

20-
// Wraps links to the Symfony documentation
21-
$modal.find('.hljs-comment').each(function() {
22-
$(this).html($(this).html().replace(/https:\/\/symfony.com\/doc\/[\w/.#-]+/g, function(url) {
23-
return anchor(url, url);
24-
}));
23+
// Wrap Symfony Doc urls in comments
24+
modalElt.querySelectorAll('.hljs-comment').forEach((commentElt) => {
25+
commentElt.innerHTML = commentElt.innerHTML.replace(/https:\/\/symfony.com\/[\w/.#-]+/g, (url) => anchor(url, url));
2526
});
2627

27-
// Wraps Symfony's attributes
28-
var attributes = {
29-
'Cache': 'https://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/cache.html',
30-
'IsGranted': 'https://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/security.html#isgranted',
31-
'ParamConverter': 'https://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/converters.html',
32-
'Route': 'https://symfony.com/doc/current/routing.html#creating-routes-as-attributes-or-annotations',
33-
'Security': 'https://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/annotations/security.html#security'
28+
// Wraps Symfony PHP attributes in code
29+
const attributes = {
30+
'Cache': 'https://symfony.com/doc/current/http_cache.html#http-cache-expiration-intro',
31+
'Route': 'https://symfony.com/doc/current/routing.html#creating-routes-as-attributes',
32+
'IsGranted': 'https://symfony.com/doc/current/security.html#security-securing-controller-annotations'
3433
};
35-
36-
$controllerCode.find('.hljs-meta').each(function() {
37-
var src = $(this).text();
38-
39-
$(this).html(wrap(src, attributes));
34+
controllerCode.querySelectorAll('.hljs-meta').forEach((elt) => {
35+
elt.innerHTML = wrap(elt.textContent, attributes);
4036
});
4137

4238
// Wraps Twig's tags
43-
$templateCode.find('.hljs-template-tag + .hljs-name').each(function() {
44-
var tag = $(this).text();
45-
39+
templateCode.querySelectorAll('.hljs-template-tag + .hljs-name').forEach((elt) => {
40+
const tag = elt.textContent;
4641
if ('else' === tag || tag.match(/^end/)) {
4742
return;
4843
}
49-
50-
var url = 'https://twig.symfony.com/doc/3.x/tags/' + tag + '.html#' + tag;
51-
52-
$(this).html(anchor(url, tag));
44+
const url = 'https://twig.symfony.com/doc/3.x/tags/' + tag + '.html#' + tag;
45+
elt.innerHTML = anchor(url, tag);
5346
});
5447

5548
// Wraps Twig's functions
56-
$templateCode.find('.hljs-template-variable > .hljs-name').each(function() {
57-
var func = $(this).text();
58-
59-
var url = 'https://twig.symfony.com/doc/3.x/functions/' + func + '.html#' + func;
60-
61-
$(this).html(anchor(url, func));
49+
templateCode.querySelectorAll('.hljs-template-variable > .hljs-name').forEach((elt) => {
50+
const func = elt.textContent;
51+
const url = 'https://twig.symfony.com/doc/3.x/functions/' + func + '.html#' + func;
52+
elt.innerHTML = anchor(url, func);
6253
});
6354
});

0 commit comments

Comments
 (0)