diff --git a/CHANGELOG.md b/CHANGELOG.md index 9605a2a..5c1d2d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [1.1.1] - 2025-11-15 +### Changed +- Evaluate `__can__` guards before business expressions when merging into `v-if` / `v-else-if` branches to keep short-circuit order predictable. + ## [1.1.0] - 2025-11-15 ### Added - Automatically mirror `v-can` guards across `v-else-if` / `v-else` branches and surface the inferred expression in documentation and fixtures. @@ -35,6 +39,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - English README describing usage, playground, and contribution guide. - Roadmap and release prep guidance. +[1.1.1]: https://github.com/eduvia-app/nuxt-can/releases/tag/v1.1.1 [1.1.0]: https://github.com/eduvia-app/nuxt-can/releases/tag/v1.1.0 [1.0.1]: https://github.com/eduvia-app/nuxt-can/releases/tag/v1.0.1 [1.0.0]: https://github.com/eduvia-app/nuxt-can/releases/tag/v1.0.0 diff --git a/README.md b/README.md index 8ae4619..229f88a 100644 --- a/README.md +++ b/README.md @@ -73,7 +73,7 @@ Now you can write directives that stay type-safe: ```vue - +
Access denied
``` @@ -101,10 +101,10 @@ Once the first branch of a conditional chain carries `v-can`, the transformer au Transforms into: ```vue -Acces refuse
``` diff --git a/package.json b/package.json index 852e81b..d2ba789 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@eduvia-app/nuxt-can", - "version": "1.1.0", + "version": "1.1.1", "description": "Nuxt directives (`v-can`, `v-cannot`) to layer permissions without touching business v-ifs.", "author": "EduviaDenied
`) - expect(code).toContain(`v-if="(ready) && __can__('employee', 'view')"`) - expect(code).toContain(`v-else-if="(later) && __can__('employee', 'view')"`) + expect(code).toContain(`v-if="__can__('employee', 'view') && (ready)"`) + expect(code).toContain(`v-else-if="__can__('employee', 'view') && (later)"`) expect(code).toContain(`v-else-if="__can__('employee', 'view')"`) expect(code).toContain(`v-if="!(__can__('employee', 'view'))"`) })