Skip to content

Commit 27837bc

Browse files
turegjorupclaude
andcommitted
feat: migrate to Symfony Asset Mapper, drop psalm.xml and admin.css
- Add symfony/asset-mapper bundle with importmap and recipe files - Remove unused psalm.xml (project relies on PHPStan) - Remove obsolete public/css/admin.css Carved out of the closed PR #60 dependency-update scope as a focused PR. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 2144dd2 commit 27837bc

12 files changed

Lines changed: 177 additions & 45 deletions

File tree

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,11 @@ yarn-error.log
3030
phpstan.neon
3131
###< phpstan/phpstan ###
3232
.phpunit.cache
33+
34+
###> symfony/asset-mapper ###
35+
/public/assets/
36+
/assets/vendor/
37+
###< symfony/asset-mapper ###
38+
3339
.twig-cs-fixer.cache
3440
.playwright-mcp

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## [Unreleased]
99

10+
- [#81](https://github.com/itk-dev/devops_itksites/pull/81) 5564: Asset Mapper migration
11+
- Add Symfony Asset Mapper bundle and importmap
12+
1013
## [1.11.0] - 2026-05-19
1114

1215
- [#78](https://github.com/itk-dev/devops_itksites/pull/78)

assets/app.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/*
2+
* Welcome to your app's main JavaScript file!
3+
*
4+
* This file will be included onto the page via the importmap() Twig function,
5+
* which should already be in your base.html.twig.
6+
*/
7+
import "./styles/app.css";
8+
9+
console.log("This log comes from assets/app.js - welcome to AssetMapper! 🎉");

assets/styles/app.css

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
:root {
2+
--body-max-width: 100%;
3+
--sidebar-bg: #fff;
4+
/* make the base font size smaller */
5+
--button-primary-bg: rgb(0, 123, 166);
6+
--pagination-active-bg: rgb(0, 123, 166);
7+
--link-color: rgb(0, 123, 166);
8+
--sidebar-menu-active-item-color: rgb(0, 123, 166);
9+
--badge-boolean-true-bg: rgb(0, 123, 166);
10+
--badge-boolean-false-bg: rgb(228, 73, 48);
11+
--badge-boolean-false-color: var(--white);
12+
--sidebar-menu-color: rgb(66, 66, 66);
13+
--text-color-dark: rgb(66, 66, 66);
14+
--bs-danger-rgb: 228, 73, 48;
15+
}
16+
17+
/* Grouped dropdown group styling for index pages */
18+
.dropdown-menu {
19+
.btn-danger i,
20+
.text-danger i {
21+
color: var(--button-invisible-danger-color);
22+
}
23+
24+
a.btn-danger:hover,
25+
a.text-danger:hover {
26+
background: var(--button-invisible-danger-hover-hover-bg);
27+
}
28+
}

composer.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
"phpstan/phpdoc-parser": "^2.0",
2222
"symfony/amqp-messenger": "^8.0",
2323
"symfony/asset": "^8.0",
24+
"symfony/asset-mapper": "~8.0.0",
2425
"symfony/browser-kit": "^8.0",
2526
"symfony/console": "^8.0",
2627
"symfony/doctrine-messenger": "^8.0",
@@ -111,7 +112,8 @@
111112
],
112113
"auto-scripts": {
113114
"cache:clear": "symfony-cmd",
114-
"assets:install %PUBLIC_DIR%": "symfony-cmd"
115+
"assets:install %PUBLIC_DIR%": "symfony-cmd",
116+
"importmap:install": "symfony-cmd"
115117
},
116118
"coding-standards-apply": [
117119
"vendor/bin/php-cs-fixer fix"

composer.lock

Lines changed: 82 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/packages/asset_mapper.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
framework:
2+
asset_mapper:
3+
# The paths to make available to the asset mapper.
4+
paths:
5+
- assets/
6+
missing_import_mode: strict
7+
8+
when@prod:
9+
framework:
10+
asset_mapper:
11+
missing_import_mode: warn

config/reference.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@
280280
* }>,
281281
* },
282282
* asset_mapper?: bool|array{ // Asset Mapper configuration
283-
* enabled?: bool|Param, // Default: false
283+
* enabled?: bool|Param, // Default: true
284284
* paths?: string|array<string, scalar|Param|null>,
285285
* excluded_patterns?: list<scalar|Param|null>,
286286
* exclude_dotfiles?: bool|Param, // If true, any files starting with "." will be excluded from the asset mapper. // Default: true

importmap.php

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?php
2+
3+
/**
4+
* Returns the importmap for this application.
5+
*
6+
* - "path" is a path inside the asset mapper system. Use the
7+
* "debug:asset-map" command to see the full list of paths.
8+
*
9+
* - "entrypoint" (JavaScript only) set to true for any module that will
10+
* be used as an "entrypoint" (and passed to the importmap() Twig function).
11+
*
12+
* The "importmap:require" command can be used to add new entries to this file.
13+
*/
14+
return [
15+
'app' => [
16+
'path' => './assets/app.js',
17+
'entrypoint' => true,
18+
],
19+
];

psalm.xml

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

0 commit comments

Comments
 (0)