Skip to content

Commit ea8baae

Browse files
committed
Release 1.2.4: UX Icons detection, Flex recipe, graceful icon fallback
1 parent fc95ce6 commit ea8baae

48 files changed

Lines changed: 1736 additions & 310 deletions

Some content is hidden

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

.coderabbit.yaml

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
2+
#
3+
# CodeRabbit configuration for nowo-tech/PasswordToggleBundle.
4+
# Requires the CodeRabbit GitHub App installed on nowo-tech/PasswordToggleBundle.
5+
# Manual review: comment `@coderabbitai review` on a pull request.
6+
7+
language: en-US
8+
9+
reviews:
10+
profile: chill
11+
request_changes_workflow: false
12+
high_level_summary: true
13+
review_status: true
14+
commit_status: true
15+
poem: false
16+
collapse_walkthrough: true
17+
sequence_diagrams: true
18+
changed_files_summary: true
19+
20+
auto_review:
21+
enabled: true
22+
auto_incremental_review: true
23+
auto_pause_after_reviewed_commits: 10
24+
drafts: false
25+
base_branches:
26+
- main
27+
- master
28+
ignore_title_keywords:
29+
- WIP
30+
- "[skip review]"
31+
32+
path_filters:
33+
- "!**/vendor/**"
34+
- "!**/coverage/**"
35+
- "!**/*.lock"
36+
- "!phpstan-baseline.neon"
37+
- "!.cursor/**"
38+
- "src/**"
39+
- "tests/**"
40+
- "docs/**"
41+
- "demo/**"
42+
- ".github/**"
43+
- "*.md"
44+
- "*.yaml"
45+
- "*.yml"
46+
- "Makefile"
47+
48+
path_instructions:
49+
- path: "src/**/*.php"
50+
instructions: |
51+
nowo-tech/password-toggle-bundle — Symfony bundle providing a password form type with toggle visibility feature
52+
Follow PSR-12 and `.php-cs-fixer.dist.php`. Prefer PHP 8 attributes over annotations.
53+
Respect PHP and Symfony ranges in `composer.json` when present. Preserve backward compatibility unless the PR explicitly breaks it.
54+
Use strict comparison (`===`) where appropriate. Keep changes minimal and consistent with existing patterns.
55+
Align with `composer cs-check`, `composer phpstan`, and `composer test` when those scripts exist.
56+
57+
- path: "tests/**/*.php"
58+
instructions: |
59+
PHPUnit tests for this package. Add or update tests for new behaviour.
60+
Match existing test structure (Unit vs Integration). Avoid trivial assertions.
61+
Ensure changes remain compatible with the CI matrix when one is defined.
62+
63+
- path: "docs/**/*.md"
64+
instructions: |
65+
User-facing documentation in English under `docs/`. Do not invent features, versions, or commands.
66+
For notable releases, keep CHANGELOG and UPGRADING aligned. Preserve document structure and tone.
67+
68+
- path: "demo/**/*.php"
69+
instructions: |
70+
Demo applications illustrate bundle usage — not production code.
71+
Keep demos aligned with supported PHP/Symfony versions in composer.json.
72+
73+
- path: ".github/workflows/**"
74+
instructions: |
75+
GitHub Actions workflows for this repository. Match existing workflow style (checkout@v6, matrix exclusions).
76+
Do not echo secrets. Pin third-party actions to major versions already used in this repo.
77+
78+
tools:
79+
phpstan:
80+
enabled: true
81+
phpcs:
82+
enabled: false
83+
phpmd:
84+
enabled: false
85+
yamllint:
86+
enabled: true
87+
hadolint:
88+
enabled: true
89+
gitleaks:
90+
enabled: true
91+
github-checks:
92+
enabled: true
93+
timeout_ms: 900000
94+
actionlint:
95+
enabled: true
96+
zizmor:
97+
enabled: true
98+
99+
knowledge_base:
100+
learnings:
101+
scope: auto
102+
pull_requests:
103+
scope: auto

.github/workflows/ci.yml

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,26 @@ jobs:
1616
matrix:
1717
os: [ubuntu-latest]
1818
php: ['8.1', '8.2', '8.3', '8.4', '8.5']
19-
symfony: ['6.4', '7.0', '8.0']
19+
symfony: ['6.4', '7.0', '7.4', '8.0', '8.1']
2020
exclude:
21-
# PHP 8.1 doesn't support Symfony 7.0+ (requires PHP 8.2+) and Symfony 8.0 (requires PHP 8.4+)
21+
# PHP 8.1 doesn't support Symfony 7.0+ (requires PHP 8.2+) and Symfony 8.0, 8.1 (requires PHP 8.4+)
2222
- php: '8.1'
2323
symfony: '7.0'
24+
- php: '8.1'
25+
symfony: '7.4'
2426
- php: '8.1'
2527
symfony: '8.0'
26-
# PHP 8.2 and 8.3 don't support Symfony 8.0 (requires PHP 8.4+)
28+
- php: '8.1'
29+
symfony: '8.1'
30+
# PHP 8.2 and 8.3 don't support Symfony 8.0, 8.1 (requires PHP 8.4+)
2731
- php: '8.2'
2832
symfony: '8.0'
33+
- php: '8.2'
34+
symfony: '8.1'
2935
- php: '8.3'
3036
symfony: '8.0'
37+
- php: '8.3'
38+
symfony: '8.1'
3139

3240
steps:
3341
- name: Checkout code

.github/workflows/coderabbit.yml

Lines changed: 145 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,145 @@
1+
# CodeRabbit integration for pull requests and pushes to main.
2+
#
3+
# 1. GitHub App (recommended): install https://github.com/apps/coderabbitai on nowo-tech/PasswordToggleBundle.
4+
# Reviews pull requests automatically (no workflow required).
5+
# 2. CLI job (optional): set repository secret CODERABBIT_API_KEY (Agentic API key from CodeRabbit dashboard).
6+
#
7+
# Triggers:
8+
# - pull_request → CLI review of the PR diff
9+
# - push to main/master → CLI review of the pushed commits (no PR required)
10+
# - workflow_run (after CI on a PR) → posts @coderabbitai review for the GitHub App
11+
12+
name: CodeRabbit
13+
14+
on:
15+
pull_request:
16+
branches: [main, master]
17+
types: [opened, synchronize, reopened]
18+
19+
push:
20+
branches: [main, master]
21+
22+
workflow_run:
23+
workflows: [CI]
24+
types: [completed]
25+
26+
workflow_dispatch:
27+
28+
permissions:
29+
contents: read
30+
pull-requests: write
31+
32+
concurrency:
33+
group: coderabbit-${{ github.event.pull_request.number || github.event.workflow_run.id || github.sha }}
34+
cancel-in-progress: true
35+
36+
jobs:
37+
cli-review:
38+
name: CodeRabbit CLI
39+
if: github.event_name == 'pull_request' || github.event_name == 'push' || github.event_name == 'workflow_dispatch'
40+
runs-on: ubuntu-latest
41+
42+
steps:
43+
- name: Checkout
44+
uses: actions/checkout@v6
45+
with:
46+
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
47+
fetch-depth: 0
48+
49+
- name: Install CodeRabbit CLI
50+
run: curl -fsSL https://cli.coderabbit.ai/install.sh | sh
51+
52+
- name: Run CodeRabbit CLI review
53+
env:
54+
CODERABBIT_API_KEY: ${{ secrets.CODERABBIT_API_KEY }}
55+
run: |
56+
if [ -z "$CODERABBIT_API_KEY" ]; then
57+
echo "::warning::CODERABBIT_API_KEY is not set. Skipping CLI review."
58+
echo "Add an Agentic API key secret, or rely on the CodeRabbit GitHub App for PR reviews."
59+
exit 0
60+
fi
61+
62+
coderabbit auth login --api-key "$CODERABBIT_API_KEY"
63+
64+
if [ "${{ github.event_name }}" = "pull_request" ]; then
65+
BASE="${{ github.event.pull_request.base.ref }}"
66+
elif [ "${{ github.event_name }}" = "push" ]; then
67+
BEFORE="${{ github.event.before }}"
68+
if [ "$BEFORE" = "0000000000000000000000000000000000000000" ]; then
69+
echo "Initial push to branch — reviewing against HEAD~1."
70+
BASE="HEAD~1"
71+
else
72+
BASE="$BEFORE"
73+
fi
74+
else
75+
BASE="main"
76+
fi
77+
78+
echo "Reviewing changes against base: $BASE"
79+
coderabbit review --plain --base "$BASE"
80+
81+
request-review-after-ci:
82+
name: Request CodeRabbit review after CI
83+
if: >
84+
github.event_name == 'workflow_run' &&
85+
github.event.workflow_run.conclusion == 'success' &&
86+
github.event.workflow_run.event == 'pull_request'
87+
runs-on: ubuntu-latest
88+
89+
steps:
90+
- name: Request CodeRabbit review on PR
91+
uses: actions/github-script@v7
92+
with:
93+
script: |
94+
const run = context.payload.workflow_run;
95+
const pulls = run.pull_requests ?? [];
96+
97+
if (pulls.length === 0) {
98+
core.info('No pull request linked to this CI workflow run.');
99+
return;
100+
}
101+
102+
const prNumber = pulls[0].number;
103+
const { owner, repo } = context.repo;
104+
105+
const comments = await github.paginate(github.rest.issues.listComments, {
106+
owner,
107+
repo,
108+
issue_number: prNumber,
109+
per_page: 100,
110+
});
111+
112+
const alreadyRequested = comments.some((comment) =>
113+
comment.body?.includes('@coderabbitai review') &&
114+
comment.user?.login === 'github-actions[bot]'
115+
);
116+
117+
if (alreadyRequested) {
118+
core.info(`CodeRabbit review already requested on PR #${prNumber}.`);
119+
return;
120+
}
121+
122+
await github.rest.issues.createComment({
123+
owner,
124+
repo,
125+
issue_number: prNumber,
126+
body: '@coderabbitai review',
127+
});
128+
129+
core.info(`Requested CodeRabbit review on PR #${prNumber} after CI success.`);
130+
131+
workflow-run-skipped:
132+
name: CodeRabbit (no PR to review)
133+
if: >
134+
github.event_name == 'workflow_run' &&
135+
github.event.workflow_run.event != 'pull_request'
136+
runs-on: ubuntu-latest
137+
138+
steps:
139+
- name: Explain skipped review
140+
run: |
141+
echo "CI completed on a push to main — there is no pull request for CodeRabbit to review."
142+
echo "Open a PR to trigger PR reviews, or rely on the cli-review job on push (requires CODERABBIT_API_KEY)."
143+
144+
# Maintainer: Héctor Franco Aceituno (@HecFranco)
145+
# Organization: nowo-tech (https://github.com/nowo-tech)
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Default configuration for Password Toggle Bundle
2+
# This configuration will be used as defaults for all PasswordType instances
3+
# unless overridden when using the form type directly.
4+
5+
nowo_password_toggle:
6+
toggle: true
7+
visible_icon: 'tabler:eye-off'
8+
hidden_icon: 'tabler:eye'
9+
visible_label: 'Show'
10+
hidden_label: 'Hide'
11+
button_classes: ['input-group-text', 'cursor-pointer']
12+
toggle_container_classes: ['form-password-toggle']
13+
use_toggle_form_theme: true
14+
always_empty: true
15+
trim: false
16+
invalid_message: 'The password is invalid.'
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ux_icons:
2+
iconify:
3+
enabled: true
4+
ignore_not_found: '%kernel.debug%'
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"bundles": {
3+
"Nowo\\PasswordToggleBundle\\NowoPasswordToggleBundle": ["all"]
4+
},
5+
"copy-from-recipe": {
6+
"config/": "%CONFIG_DIR%/",
7+
"assets/": "%PROJECT_DIR%/assets/"
8+
},
9+
"require": {
10+
"symfony/ux-icons": "^2.0 || ^3.0",
11+
"symfony/http-client": "^6.0 || ^7.0 || ^8.0"
12+
}
13+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
Password Toggle Bundle has been installed.
2+
3+
* Configuration: config/packages/nowo_password_toggle.yaml
4+
* UX Icons: config/packages/ux_icons.yaml
5+
* Tabler icons copied to assets/icons/tabler/ (eye.svg, eye-off.svg)
6+
7+
Next steps:
8+
9+
1. Lock icons for production / offline use:
10+
php bin/console ux:icons:lock tabler:eye tabler:eye-off
11+
12+
2. Add the form theme in config/packages/twig.yaml if not already present:
13+
form_themes:
14+
- '@NowoPasswordToggleBundle/Form/toggle_password_widget.html.twig'
15+
16+
Without Symfony Flex, install dependencies manually:
17+
18+
composer require symfony/ux-icons symfony/http-client
19+
php bin/console ux:icons:lock tabler:eye tabler:eye-off
20+
21+
The default widget uses ux_icon(); without these packages icons are omitted (toggle still works).
Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)