Releases: palcarazm/bs-darkmode-toggle
Releases · palcarazm/bs-darkmode-toggle
v1.0.0
ℹ️ What's Changed
🆕 Added
- Native Button Layout - Added a new layout option that creates a native Bootstrap 5 button instead of the bootstrap-toggle slider component, reducing external dependencies and bundle size.
- implements #61 by @palcarazm in 8239220.
- SVG Icons for Toggle - Replaced default text labels with SVG icons (sun/moon) using CSS mask-image technique, including built-in variants for light/dark mode.
- implements #67 by @palcarazm in 5bedb20.
- Local Storage Support - Replaced cookie-only persistence with a flexible storage system supporting multiple providers (cookie, localStorage, none).
- implements #62 by @palcarazm in 73d81aa.
- System Color Scheme Preference - Implemented automatic detection of the user's operating system color scheme preference as a fallback when no saved state exists.
- implements #59 by @palcarazm in ca96ec8.
- Extended Bootstrap 5 Button Styles - Extended the
styleoption to support all Bootstrap 5 button variants (solid and outline).- implements #58 by @palcarazm in 3229c8d.
🔁 Changed
- Complete TypeScript Rewrite - Rewrote the entire library in TypeScript with a modular architecture for better maintainability and type safety.
- implements #46 by @palcarazm in 5bc9ca5.
- Refactored Test Architecture - Restructured the test app and Cypress E2E tests into a modular, maintainable architecture using Page Object pattern.
- Related to #61 by @palcarazm in e9057bd.
- Updated Build Target - Changed TypeScript target from ES5 to ES2016 for modern browser support.
- Related to #52 by @palcarazm in 52b8f76.
✅ Fixed
- SonarQube Issues - Fixed multiple code quality issues including unsafe type checks, incorrect DOM access patterns, and accessibility concerns.
- jQuery Initialization Error - Fixed an error where the jQuery plugin failed to load correctly in some environments.
- by @palcarazm in 6efbfa5.
- Double Change Event - Fixed an issue where the change event was fired twice on action performed.
- by @palcarazm in 293718f.
- CWE-79 and CWE-116 - Fixed Cross-Site Scripting (XSS) vulnerabilities by refactoring sanitization of data-attributes and options.
- by @palcarazm in 48255a9.
🆙 Dependencies management, CI/CD and Others
- Dependency updates:
typescriptfrom5.9.3to6.0.2@rollup/plugin-terserfrom0.4.4to1.0.0cypress-plugin-tabfrom1.0.5to2.0.0@types/jqueryfrom3.5.34to4.0.0jqueryfrom3.6.3to3.7.0dompurifyfrom2.4.1to3.0.3bootstrapfrom5.3.0-alpha1to5.3.0-alpha3bootstrap5-togglefrom5.0.4to5.0.6cypressfrom12.2.0to12.12.0gruntfrom1.5.3to1.6.1
- GitHub Actions updates:
actions/upload-artifactfrom6to7actions/download-artifactfrom7to8cypress-io/github-actionfrom7.1.2to7.1.9SonarSource/sonarqube-scan-actionfrom7.0.0to7.1.0
- CI/CD improvements:
- Updated docs deployment to trigger on version tags or manually.
- Added Sonar coverage exclusion patterns for config files.
- Refactored Gruntfile and Rollup configurations for better build process.
- Added PostCSS build pipeline to process and minify CSS.
- Updated GitHub workflows, issue templates, and PR templates.
Full Changelog: v1.0.0-rc1...v1.0.0
v1.0.0-rc1
ℹ️ What's Changed
🆕 Added
- New CI/CD pipeline with parallel build, unit tests, e2e tests, and coverage reporting (Coveralls, SonarCloud, CodeQL).
- by @palcarazm
- in commits across
.github/workflows/ci.yml
- New issue templates for bug reports and feature requests.
- by @palcarazm
- in
.github/ISSUE_TEMPLATE/01-BUG_REPORT.ymland02-FEATURE_REQUEST.yml
- New pull request template.
- by @palcarazm
- in
.github/PULL_REQUEST_TEMPLATE.md
- Integrated Dependabot for NPM and GitHub Actions with grouped updates.
- by @palcarazm
- in
.github/dependabot.yml
- Added Git hooks with Husky for linting, building, and testing on commit/push.
- by @palcarazm
- in
.husky/
- Full TypeScript rewrite of the core plugin logic.
- by @palcarazm
- in
src/main/ts/
- Unit tests with Jest for all core modules (StateReducer, OptionResolver, DOMBuilder, CookieManager, Tools).
- by @palcarazm
- in
src/test/ts/
- End-to-end tests with Cypress using a custom test application.
- by @palcarazm
- in
cypress/andtest/
- Official documentation site with GitHub Pages deployment.
- by @palcarazm
- in
docs/
- New build system using Rollup and Grunt tasks for TypeScript compilation and bundling.
- by @palcarazm
- in
rollup.config.jsandGruntfile.cjs
- Added ESLint and Commitlint for code and commit message consistency.
- by @palcarazm
- in
eslint.config.jsandcommitlint.config.js
- SonarCloud project configuration for static analysis.
- by @palcarazm
- in
sonar-project.properties
🔁 Changed
- Migrated from JavaScript to TypeScript for better maintainability and type safety.
- by @palcarazm
- in
src/main/ts/
- Replaced UglifyJS with Rollup & Terser for minification.
- by @palcarazm
- in
rollup.config.jsandGruntfile.cjs
- Default labels changed from sun/moon SVGs to plain text ("Light"/"Dark").
- by @palcarazm
- in
src/main/ts/core/OptionResolver.tsandREADME.md
- Improved sanitization logic for labels and attributes to prevent XSS.
- by @palcarazm
- in
src/main/ts/core/Tools.ts
- Updated Bootstrap peer dependency to
>=5.3.0 <6.- by @palcarazm
- in
package.json
- Updated jQuery optional dependency to
^4.0.0.- by @palcarazm
- in
package.json
- Refactored state management into a dedicated
StateReducerclass.- by @palcarazm
- in
src/main/ts/core/StateReducer.ts
- Refactored cookie handling into a
CookieManagerclass.- by @palcarazm
- in
src/main/ts/core/CookieManager.ts
- Refactored DOM manipulation into a
DOMBuilderclass.- by @palcarazm
- in
src/main/ts/core/DOMBuilder.ts
- Updated test application to use new test structure and remove DOMPurify dependency.
- by @palcarazm
- in
test/
✅ Fixed
- Fixed issue where cookie was not being properly deleted when denied.
- by @palcarazm
- in
src/main/ts/DarkModeToggle.tsandsrc/main/ts/core/CookieManager.ts
- Fixed event propagation so change event fires correctly from the toggle element.
- by @palcarazm
- in
src/main/ts/DarkModeToggle.ts
- Fixed silent mode for
light,dark, andtogglemethods to prevent event triggering.- by @palcarazm
- in
src/main/ts/DarkModeToggle.ts
- Fixed XSS vulnerability in label rendering by implementing HTML sanitization.
- by @palcarazm
- in
src/main/ts/core/Tools.ts
- Fixed data attribute naming to use kebab-case (e.g.,
data-light-labelinstead ofdata-lightLabel).- by @palcarazm
- in
src/main/ts/core/OptionResolver.tsandtest/
- Fixed root element not updating correctly when custom root is specified.
- by @palcarazm
- in
src/main/ts/core/DOMBuilder.ts
🆙 Bump
- Updated Node.js versions in CI to 22.x and 24.x.
- Updated GitHub Actions to latest versions (
checkout@v6,setup-node@v6,upload-artifact@v7, etc.). - Updated Cypress to
^15.8.1. - Updated Jest to
^30.2.0. - Updated TypeScript to
^5.9.3. - Updated various dev dependencies including ESLint, Rollup, and Grunt plugins.
- Updated Bootstrap to
5.3.8in documentation. - Updated FontAwesome to
7.2.0in documentation.
Full Changelog: v1.0.0-alpha2...v1.0.0-rc1
v1.0.0-alpha2
What's Changed
Initial release
Full Changelog: https://github.com/palcarazm/bs-darkmode-toggle/commits/v1.0.0-alpha2