shadscan-vue 0.1.1 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/index.js +14 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.2](https://github.com/vinayakkulkarni/shadscan-vue/compare/v0.1.1...v0.1.2) (2026-07-26)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* **rules:** detect the destructured useMagicKeys hotkey binding ([175fd5e](https://github.com/vinayakkulkarni/shadscan-vue/commit/175fd5e89549e2c91677b6a48974bc20c8b168d5))
|
|
9
|
+
* **rules:** exempt icon-module icons and clarify the command-menu message ([904f76d](https://github.com/vinayakkulkarni/shadscan-vue/commit/904f76d3dfd7cc270cec65d6945c9a82cccb3455))
|
|
10
|
+
|
|
3
11
|
## [0.1.1](https://github.com/vinayakkulkarni/shadscan-vue/compare/v0.1.0...v0.1.1) (2026-07-25)
|
|
4
12
|
|
|
5
13
|
|
package/dist/index.js
CHANGED
|
@@ -1777,7 +1777,7 @@ const K_KEY_PATTERN = /\.key\s*===\s*['"]k['"]|key\s*===\s*['"]k['"]/iu;
|
|
|
1777
1777
|
const PREVENT_DEFAULT_PATTERN = /preventDefault\s*\(/u;
|
|
1778
1778
|
const TOGGLE_PATTERN = /\.value\s*=|=\s*!|toggle|open\s*=|\bset[A-Z]/u;
|
|
1779
1779
|
const KEYDOWN_PATTERN = /keydown/u;
|
|
1780
|
-
const MAGIC_KEYS_CMD_K_PATTERN = /useMagicKeys[\s\S]*?(?:Meta|Cmd|Ctrl|Control)\s*\+\s*
|
|
1780
|
+
const MAGIC_KEYS_CMD_K_PATTERN = /useMagicKeys[\s\S]*?(?:(?:Meta|Cmd|Ctrl|Control)\s*\+\s*K|\b(?:meta|cmd|ctrl|control)_k\b)/iu;
|
|
1781
1781
|
const WATCH_PATTERN = /\bwatch\s*\(/u;
|
|
1782
1782
|
const isSourceFile$2 = (file) => file.kind === "vue" || file.kind === "ts" || file.kind === "js";
|
|
1783
1783
|
const detectKeydownFlow = (text) => KEYDOWN_PATTERN.test(text) && MODIFIER_PATTERN$1.test(text) && K_KEY_PATTERN.test(text) && PREVENT_DEFAULT_PATTERN.test(text) && TOGGLE_PATTERN.test(text);
|
|
@@ -1852,9 +1852,9 @@ const commandMenuPresent = {
|
|
|
1852
1852
|
}]);
|
|
1853
1853
|
if (files.find((file) => templateHasAllParts(file)) !== void 0) return result.pass();
|
|
1854
1854
|
return result.fail([{
|
|
1855
|
-
message: "
|
|
1855
|
+
message: "The command module is installed but no template assembles it into a command menu.",
|
|
1856
1856
|
evidence: [],
|
|
1857
|
-
remediation: "Ensure a single template renders CommandDialog, CommandInput, CommandEmpty, and at least one CommandItem together."
|
|
1857
|
+
remediation: "Ensure a single template renders CommandDialog, CommandInput, CommandEmpty, and at least one CommandItem together. A hand-rolled palette misses the keyboard and labelling behaviour these parts provide."
|
|
1858
1858
|
}]);
|
|
1859
1859
|
}
|
|
1860
1860
|
};
|
|
@@ -3195,6 +3195,14 @@ const BUTTON_TAGS = /* @__PURE__ */ new Set([
|
|
|
3195
3195
|
"RouterLink",
|
|
3196
3196
|
"router-link"
|
|
3197
3197
|
]);
|
|
3198
|
+
/**
|
|
3199
|
+
* @nuxt/icon applies `{ "aria-hidden": true }` to every icon it renders (its
|
|
3200
|
+
* documented `attrs` default), so its `<Icon>` and `<NuxtIcon>` components are
|
|
3201
|
+
* already decorative without the author writing the attribute. Auditing them
|
|
3202
|
+
* reports a failure that cannot be acted on.
|
|
3203
|
+
*/
|
|
3204
|
+
const NUXT_ICON_MODULE = "@nuxt/icon";
|
|
3205
|
+
const NUXT_ICON_TAGS = /* @__PURE__ */ new Set(["icon", "nuxt-icon"]);
|
|
3198
3206
|
const buttonIconsHaveDataIcon = {
|
|
3199
3207
|
id: "button-icons-have-data-icon",
|
|
3200
3208
|
title: "Icons inside controls are marked decorative",
|
|
@@ -3208,12 +3216,14 @@ const buttonIconsHaveDataIcon = {
|
|
|
3208
3216
|
"vite-vue",
|
|
3209
3217
|
"generic-vue"
|
|
3210
3218
|
],
|
|
3211
|
-
run: async ({ sources, result }) => {
|
|
3219
|
+
run: async ({ sources, discovery, result }) => {
|
|
3212
3220
|
const files = await sources();
|
|
3213
3221
|
const findings = [];
|
|
3214
3222
|
let evaluated = 0;
|
|
3223
|
+
const iconModuleHidesIcons = discovery.dependencies[NUXT_ICON_MODULE] !== void 0;
|
|
3215
3224
|
forEachElement(files, (element, file, ancestors) => {
|
|
3216
3225
|
if (!isIconTag(element.tag)) return;
|
|
3226
|
+
if (iconModuleHidesIcons && NUXT_ICON_TAGS.has(pascalToKebab(element.tag))) return;
|
|
3217
3227
|
if (!ancestors.some((ancestor) => BUTTON_TAGS.has(ancestor.tag))) return;
|
|
3218
3228
|
evaluated += 1;
|
|
3219
3229
|
const ariaHidden = findAttribute(element, "aria-hidden");
|