Skip to content

Commit 31b1b57

Browse files
author
rubenvdlinde
committed
Merge pull request 'feat(nav): move config page to settings foldout (buildManifest)' (#60) from feat/settings-foldout-via-shared-buildmanifest into development
2 parents 5a226c0 + bc6573e commit 31b1b57

4 files changed

Lines changed: 20 additions & 32 deletions

File tree

‎package-lock.json‎

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"dependencies": {
3131
"@babel/core": "^7.29.0",
3232
"@codemirror/lang-json": "^6.0.0",
33-
"@conduction/nextcloud-vue": "^1.0.0-beta.125",
33+
"@conduction/nextcloud-vue": "1.0.0-beta.135",
3434
"@fortawesome/fontawesome-svg-core": "^6.5.2",
3535
"@fortawesome/free-solid-svg-icons": "^6.5.2",
3636
"@nextcloud/axios": "^2.5.0",

‎src/main.js‎

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,13 @@ import {
2121
registerTranslations,
2222
useAppManifest,
2323
resolveManifestSentinels,
24+
buildManifest,
2425
} from '@conduction/nextcloud-vue'
2526
import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip.js'
2627
import pinia from './pinia.js'
2728
import App from './App.vue'
2829
import bundledManifest from './manifest.json'
30+
import menuLayout from './menu-layout.json'
2931
import customComponents from './customComponents.js'
3032
import registry from './registry.js'
3133
import { 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, /\.json$/)
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, /\.json$/)
77+
const fragments = fragmentCtx.keys().sort().map((key) => fragmentCtx(key))
78+
const mergedManifest = buildManifest(bundledManifest, fragments, menuLayout)
10179

10280
tryLoadTranslations()
10381

‎src/menu-layout.json‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"_meta": {
3+
"description": "settings-foldout layout"
4+
},
5+
"relocations": {},
6+
"removals": [],
7+
"settingsSection": [
8+
"SettingsMenu"
9+
]
10+
}

0 commit comments

Comments
 (0)