Skip to content
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
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,11 @@ yarn-error.log
phpstan.neon
###< phpstan/phpstan ###
.phpunit.cache

###> symfony/asset-mapper ###
/public/assets/
/assets/vendor/
###< symfony/asset-mapper ###

.twig-cs-fixer.cache
.playwright-mcp
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- [#81](https://github.com/itk-dev/devops_itksites/pull/81) 5564: Asset Mapper migration
- Add Symfony Asset Mapper bundle and importmap

## [1.11.0] - 2026-05-19

- [#78](https://github.com/itk-dev/devops_itksites/pull/78)
Expand Down
9 changes: 9 additions & 0 deletions assets/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/*
* Welcome to your app's main JavaScript file!
*
* This file will be included onto the page via the importmap() Twig function,
* which should already be in your base.html.twig.
*/
import "./styles/app.css";

console.log("This log comes from assets/app.js - welcome to AssetMapper! 🎉");
28 changes: 28 additions & 0 deletions assets/styles/app.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
:root {
--body-max-width: 100%;
--sidebar-bg: #fff;
/* make the base font size smaller */
--button-primary-bg: rgb(0, 123, 166);
--pagination-active-bg: rgb(0, 123, 166);
--link-color: rgb(0, 123, 166);
--sidebar-menu-active-item-color: rgb(0, 123, 166);
--badge-boolean-true-bg: rgb(0, 123, 166);
--badge-boolean-false-bg: rgb(228, 73, 48);
--badge-boolean-false-color: var(--white);
--sidebar-menu-color: rgb(66, 66, 66);
--text-color-dark: rgb(66, 66, 66);
--bs-danger-rgb: 228, 73, 48;
}

/* Grouped dropdown group styling for index pages */
.dropdown-menu {
.btn-danger i,
.text-danger i {
color: var(--button-invisible-danger-color);
}

a.btn-danger:hover,
a.text-danger:hover {
background: var(--button-invisible-danger-hover-hover-bg);
}
}
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"phpstan/phpdoc-parser": "^2.0",
"symfony/amqp-messenger": "^8.0",
"symfony/asset": "^8.0",
"symfony/asset-mapper": "~8.0.0",
"symfony/browser-kit": "^8.0",
"symfony/console": "^8.0",
"symfony/doctrine-messenger": "^8.0",
Expand Down Expand Up @@ -111,7 +112,8 @@
],
"auto-scripts": {
"cache:clear": "symfony-cmd",
"assets:install %PUBLIC_DIR%": "symfony-cmd"
"assets:install %PUBLIC_DIR%": "symfony-cmd",
"importmap:install": "symfony-cmd"
},
"coding-standards-apply": [
"vendor/bin/php-cs-fixer fix"
Expand Down
83 changes: 82 additions & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions config/packages/asset_mapper.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
framework:
asset_mapper:
# The paths to make available to the asset mapper.
paths:
- assets/
missing_import_mode: strict

when@prod:
framework:
asset_mapper:
missing_import_mode: warn
2 changes: 1 addition & 1 deletion config/reference.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@
* }>,
* },
* asset_mapper?: bool|array{ // Asset Mapper configuration
* enabled?: bool|Param, // Default: false
* enabled?: bool|Param, // Default: true
* paths?: string|array<string, scalar|Param|null>,
* excluded_patterns?: list<scalar|Param|null>,
* exclude_dotfiles?: bool|Param, // If true, any files starting with "." will be excluded from the asset mapper. // Default: true
Expand Down
19 changes: 19 additions & 0 deletions importmap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?php

/**
* Returns the importmap for this application.
*
* - "path" is a path inside the asset mapper system. Use the
* "debug:asset-map" command to see the full list of paths.
*
* - "entrypoint" (JavaScript only) set to true for any module that will
* be used as an "entrypoint" (and passed to the importmap() Twig function).
*
* The "importmap:require" command can be used to add new entries to this file.
*/
return [
'app' => [
'path' => './assets/app.js',
'entrypoint' => true,
],
];
27 changes: 0 additions & 27 deletions psalm.xml

This file was deleted.

15 changes: 0 additions & 15 deletions public/css/admin.css

This file was deleted.

15 changes: 15 additions & 0 deletions symfony.lock
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,21 @@
"symfony/asset": {
"version": "v6.0.3"
},
"symfony/asset-mapper": {
"version": "7.3",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "main",
"version": "6.4",
"ref": "5ad1308aa756d58f999ffbe1540d1189f5d7d14a"
},
"files": [
"assets/app.js",
"assets/styles/app.css",
"config/packages/asset_mapper.yaml",
"importmap.php"
]
},
"symfony/browser-kit": {
"version": "v6.0.3"
},
Expand Down
Loading