Skip to content

Commit ac2b513

Browse files
Release 2.0.3: Symfony assets package for bundle CSS
Register the nowo_password_toggle asset package for AssetMapper-friendly Twig URLs and document the recommended asset() syntax. Co-authored-by: Cursor <cursoragent@cursor.com>
1 parent 85de679 commit ac2b513

10 files changed

Lines changed: 76 additions & 20 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ The bundle includes CSS/SCSS styles for the toggle button. You can use them by:
161161
### Option 1: Include the CSS file
162162

163163
```html
164-
<link rel="stylesheet" href="{{ asset('bundles/nowopasswordtoggle/css/toggle_password.css') }}">
164+
<link rel="stylesheet" href="{{ asset('css/toggle_password.css', 'nowo_password_toggle') }}">
165165
```
166166

167167
### Option 2: Use the SCSS file

composer.lock

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

docs/CHANGELOG.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## Table of contents
99

1010
- [[Unreleased]](#unreleased)
11+
- [[2.0.3] - 2026-07-13](#203---2026-07-13)
1112
- [[2.0.2] - 2026-07-09](#202---2026-07-09)
1213
- [[2.0.1] - 2026-07-09](#201---2026-07-09)
1314
- [[2.0.0] - 2026-07-02](#200---2026-07-02)
@@ -28,6 +29,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2829

2930
## [Unreleased]
3031

32+
## [2.0.3] - 2026-07-13
33+
34+
### Added
35+
36+
- **Symfony assets package**: `NowoPasswordToggleExtension` prepends `framework.assets.packages.nowo_password_toggle` (`base_path`: `/bundles/nowopasswordtoggle`) so Twig can reference bundle CSS with `asset('css/toggle_password.css', 'nowo_password_toggle')` (AssetMapper-friendly).
37+
38+
### Changed
39+
40+
- **Documentation**: README, [`INSTALLATION.md`](INSTALLATION.md), and [`USAGE.md`](USAGE.md) recommend the named asset package instead of the legacy `bundles/nowopasswordtoggle/...` path; INSTALLATION adds optional CSS publish steps and an AssetMapper note.
41+
3142
## [2.0.2] - 2026-07-09
3243

3344
### Added

docs/INSTALLATION.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,20 @@ return [
8080

8181
4. **Create configuration** (optional). Create `config/packages/nowo_password_toggle.yaml` with your preferred defaults. See [CONFIGURATION.md](CONFIGURATION.md) for all options.
8282

83+
5. **Publish optional CSS** (if you use the legacy stylesheet instead of your own styles):
84+
85+
```bash
86+
php bin/console assets:install
87+
```
88+
89+
```twig
90+
<link rel="stylesheet" href="{{ asset('css/toggle_password.css', 'nowo_password_toggle') }}">
91+
```
92+
93+
### AssetMapper
94+
95+
If your app uses [Symfony AssetMapper](https://symfony.com/doc/current/frontend/asset_mapper.html), the bundle registers the `nowo_password_toggle` asset package. Run `assets:install` once so `css/toggle_password.css` is published to `public/bundles/nowopasswordtoggle/`.
96+
8397
## Missing icon packages (runtime behaviour)
8498

8599
If `symfony/ux-icons` or `symfony/http-client` is not installed:

docs/RELEASE.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
4. Commit all changes, create an annotated tag (e.g. `v1.2.10`), and push branch and tag. The release workflow will create the GitHub Release with the changelog.
77
5. Publish the package to Packagist if applicable (usually automatic when the tag is pushed).
88

9-
## Example for v2.0.2
9+
## Example for v2.0.3
1010

1111
```bash
12-
git add docs/CHANGELOG.md docs/UPGRADING.md docs/RELEASE.md README.md
12+
git add docs/CHANGELOG.md docs/UPGRADING.md docs/RELEASE.md README.md docs/INSTALLATION.md docs/USAGE.md src/DependencyInjection/NowoPasswordToggleExtension.php tests/Unit/DependencyInjection/NowoPasswordToggleExtensionTest.php
1313
git status # review
14-
git commit -m "Release 2.0.2: GitHub Spec Kit baseline and dev dependency updates"
15-
git tag -a v2.0.2 -m "Release 2.0.2: GitHub Spec Kit baseline and dev dependency updates"
14+
git commit -m "Release 2.0.3: Symfony assets package for bundle CSS"
15+
git tag -a v2.0.3 -m "Release 2.0.3: Symfony assets package for bundle CSS"
1616
git push origin main
17-
git push origin v2.0.2
17+
git push origin v2.0.3
1818
```

docs/SECURITY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212

1313
| Version | Supported |
1414
| ------- | ------------------ |
15-
| 1.x | :white_check_mark: |
15+
| 2.x | :white_check_mark: |
16+
| 1.x | :white_check_mark: (security fixes only) |
1617

1718
## Reporting a Vulnerability
1819

docs/UPGRADING.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
This document describes how to upgrade between major versions of Password Toggle Bundle.
44

5+
## 2.0.3
6+
7+
- **Optional (AssetMapper / named assets):** prefer `asset('css/toggle_password.css', 'nowo_password_toggle')` in Twig instead of `asset('bundles/nowopasswordtoggle/css/toggle_password.css')`. Run `php bin/console assets:install` once so the CSS is published under `public/bundles/nowopasswordtoggle/`. The legacy path still works for classic asset setups.
8+
- **No PHP or YAML config changes.**
9+
510
## 2.0.2
611

712
- **No application upgrade steps.** Repository and maintainer tooling only (Spec Kit, baseline specs, dev dependency bumps, demo Docker `intl` extension).

docs/USAGE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ With **UX Icons 3.x**, this command scans Twig templates for `ux_icon()` usage (
7272
## Styling
7373

7474
- **Option 1:** Include the bundle CSS:
75-
`<link rel="stylesheet" href="{{ asset('bundles/nowopasswordtoggle/css/toggle_password.css') }}">`
75+
`<link rel="stylesheet" href="{{ asset('css/toggle_password.css', 'nowo_password_toggle') }}">`
7676
- **Option 2:** Import the SCSS in your build (Webpack Encore, Vite, etc.):
7777
`@import '@nowo-tech/password-toggle-bundle/src/Resources/public/css/toggle_password.scss';`
7878
- **Option 3:** Style the classes yourself: `.input-group-text.cursor-pointer`, `.form-password-toggle`, etc.

src/DependencyInjection/NowoPasswordToggleExtension.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,18 @@ public function load(array $configs, ContainerBuilder $container): void
5656

5757
public function prepend(ContainerBuilder $container): void
5858
{
59+
if ($container->hasExtension('framework')) {
60+
$container->prependExtensionConfig('framework', [
61+
'assets' => [
62+
'packages' => [
63+
'nowo_password_toggle' => [
64+
'base_path' => '/bundles/nowopasswordtoggle',
65+
],
66+
],
67+
],
68+
]);
69+
}
70+
5971
if (!$container->hasExtension('monolog')) {
6072
return;
6173
}

tests/Unit/DependencyInjection/NowoPasswordToggleExtensionTest.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,19 @@ public function testPrependIsNoOpWithoutMonolog(): void
131131
$this->assertFalse($container->hasExtension('monolog'));
132132
}
133133

134+
public function testPrependConfiguresAssets(): void
135+
{
136+
$container = new ContainerBuilder();
137+
$container->registerExtension(new \Symfony\Bundle\FrameworkBundle\DependencyInjection\FrameworkExtension());
138+
139+
$this->extension->prepend($container);
140+
141+
$this->assertSame(
142+
'/bundles/nowopasswordtoggle',
143+
$container->getExtensionConfig('framework')[0]['assets']['packages']['nowo_password_toggle']['base_path'],
144+
);
145+
}
146+
134147
public function testLoadWiresMonologLoggerWhenMonologExtensionPresent(): void
135148
{
136149
$container = new ContainerBuilder();

0 commit comments

Comments
 (0)