@frigear-nu/menu 0.0.11 → 0.1.0

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/dist/module.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@frigear-nu/menu",
3
3
  "configKey": "menus",
4
- "version": "0.0.11",
4
+ "version": "0.1.0",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.3",
7
7
  "unbuild": "unknown"
@@ -31,7 +31,8 @@ export declare function matchesMenuGroup(group: string, prefix: string): boolean
31
31
  /**
32
32
  * Resolves every item addressed by a parsed menu path out of that menu's groups - a single
33
33
  * group's items for a plain path, or every matching group's items (flattened, unsorted) for a
34
- * wildcard path.
34
+ * wildcard path. Wildcard reads set each item's `group` to the group it was found in, so a view
35
+ * can split one read back into its groups (items pushed by runtime sources carry no `group`).
35
36
  */
36
37
  export declare function collectMenuItems(groups: Record<string, MenuItem[]> | undefined, parsed: ParsedMenuPath): MenuItem[];
37
38
  export declare function sortByOrder(items: MenuItem[]): MenuItem[];
@@ -16,7 +16,7 @@ export function collectMenuItems(groups, parsed) {
16
16
  if (!parsed.wildcard) return groups[parsed.group] ?? [];
17
17
  const matched = [];
18
18
  for (const [group, items] of Object.entries(groups)) {
19
- if (matchesMenuGroup(group, parsed.group)) matched.push(...items);
19
+ if (matchesMenuGroup(group, parsed.group)) matched.push(...items.map((item) => ({ ...item, group })));
20
20
  }
21
21
  return matched;
22
22
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@frigear-nu/menu",
3
- "version": "0.0.11",
3
+ "version": "0.1.0",
4
4
  "description": "Named, shareable navigation menus - modules contribute items (extendMenu / a runtime/menus.ts source) and/or Nuxt Content, consumers read them via useMenu and render them however they like.",
5
5
  "homepage": "https://docs.frigear.dev/modules/menu",
6
6
  "repository": {
@@ -30,22 +30,22 @@
30
30
  "playground"
31
31
  ],
32
32
  "dependencies": {
33
- "@nuxt/kit": "^4.6.0",
34
- "@frigear-nu/module-kit": "1.0.1",
33
+ "@nuxt/kit": "^4.6.1",
34
+ "@frigear-nu/module-kit": "1.1.0",
35
35
  "zod": "^4.6.5"
36
36
  },
37
37
  "devDependencies": {
38
38
  "@nuxt/devtools": "^3.4.2",
39
39
  "@nuxt/eslint-config": "^1.17.0",
40
40
  "@nuxt/module-builder": "^1.0.3",
41
- "@nuxt/schema": "^4.6.0",
41
+ "@nuxt/schema": "^4.6.1",
42
42
  "@nuxt/test-utils": "^4.3.2",
43
- "@types/node": "latest",
43
+ "@types/node": "^26.6.5",
44
44
  "changelogen": "^0.6.2",
45
- "eslint": "^10.10.0",
45
+ "eslint": "^10.12.0",
46
46
  "nuxt": "^4.6.1",
47
47
  "typescript": "^6.0.3",
48
- "vitest": "^5.0.1",
48
+ "vitest": "^5.0.2",
49
49
  "vue-tsc": "^3.3.11"
50
50
  },
51
51
  "scripts": {