@@ -21,11 +21,13 @@ import {
2121 registerTranslations ,
2222 useAppManifest ,
2323 resolveManifestSentinels ,
24+ buildManifest ,
2425} from '@conduction/nextcloud-vue'
2526import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip.js'
2627import pinia from './pinia.js'
2728import App from './App.vue'
2829import bundledManifest from './manifest.json'
30+ import menuLayout from './menu-layout.json'
2931import customComponents from './customComponents.js'
3032import registry from './registry.js'
3133import { routesFromManifest } from './router.js'
@@ -71,33 +73,9 @@ function tryLoadTranslations() {
7173 }
7274}
7375
74- /**
75- * ADR-037: merge modular manifest fragments from src/manifest.d/*.json onto the
76- * bundled base manifest. Each OpenSpec change drops its own fragment (pages/menu)
77- * instead of editing the monolith src/manifest.json, so concurrent builds touch
78- * disjoint files. `pages` and `menu` arrays are concatenated.
79- *
80- * @param {object } base The bundled base manifest.
81- * @return {object } The manifest with all fragment pages/menu appended.
82- */
83- function mergeManifestFragments ( base ) {
84- const merged = { ...base , pages : [ ...( base . pages || [ ] ) ] , menu : [ ...( base . menu || [ ] ) ] }
85- // require.context is resolved at build time; src/manifest.d/ must exist (it
86- // ships with a _placeholder.json). It is a no-op when no real fragments exist.
87- const ctx = require . context ( './manifest.d/' , false , / \. j s o n $ / )
88- ctx . keys ( ) . sort ( ) . forEach ( ( key ) => {
89- const frag = ctx ( key )
90- if ( Array . isArray ( frag . pages ) ) {
91- merged . pages . push ( ...frag . pages )
92- }
93- if ( Array . isArray ( frag . menu ) ) {
94- merged . menu . push ( ...frag . menu )
95- }
96- } )
97- return merged
98- }
99-
100- const mergedManifest = mergeManifestFragments ( bundledManifest )
76+ const fragmentCtx = require . context ( './manifest.d/' , false , / \. j s o n $ / )
77+ const fragments = fragmentCtx . keys ( ) . sort ( ) . map ( ( key ) => fragmentCtx ( key ) )
78+ const mergedManifest = buildManifest ( bundledManifest , fragments , menuLayout )
10179
10280tryLoadTranslations ( )
10381
0 commit comments