Move panel plugins under panels

This commit is contained in:
David Heinemeier Hansson
2026-05-25 14:47:08 +02:00
parent e6d990e31d
commit 10898aea16
31 changed files with 45 additions and 27 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ set -euo pipefail
source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh"
run_node_test <<'JS'
const audio = requireFromRoot('shell/plugins/audio/Model.js')
const audio = requireFromRoot('shell/plugins/panels/audio/Model.js')
assert(audio.isPlaybackStream({ isStream: true, isSink: true }), 'audio detects sink-backed playback streams')
assert(audio.isPlaybackStream({ isStream: true, type: 'Stream/Output/Audio' }), 'audio detects typed playback streams')
+1 -1
View File
@@ -5,7 +5,7 @@ set -euo pipefail
source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh"
run_node_test <<'JS'
const bluetooth = requireFromRoot('shell/plugins/bluetooth/Model.js')
const bluetooth = requireFromRoot('shell/plugins/panels/bluetooth/Model.js')
assert(bluetooth.isUuidLike('0000110b-0000-1000-8000-00805f9b34fb'), 'bluetooth detects UUID-like names')
assert(bluetooth.isAddressLike('AA:BB:CC:DD:EE:FF'), 'bluetooth detects address-like names')
+1 -1
View File
@@ -5,7 +5,7 @@ set -euo pipefail
source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh"
run_node_test <<'JS'
const monitor = requireFromRoot('shell/plugins/monitor/Model.js')
const monitor = requireFromRoot('shell/plugins/panels/monitor/Model.js')
assertEqual(monitor.clampBrightness(0), 1, 'monitor clamps minimum brightness')
assertEqual(monitor.clampBrightness(101), 100, 'monitor clamps maximum brightness')
+1 -1
View File
@@ -5,7 +5,7 @@ set -euo pipefail
source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh"
run_node_test <<'JS'
const network = requireFromRoot('shell/plugins/network/Model.js')
const network = requireFromRoot('shell/plugins/panels/network/Model.js')
assertDeepEqual(
network.parseNetworkStatus('wifi\tCafe WiFi\t78\t5200\n'),
+13 -8
View File
@@ -59,24 +59,29 @@ function assertSafeEntryPoint(manifest, manifestPath, key, value) {
const manifests = walk(pluginsDir)
const manifestPaths = manifests.map(relativeFromPlugins)
const manifestSet = new Set(manifestPaths)
const groupedPluginRoots = new Set(['panels', 'services'])
assert(manifests.length > 0, 'plugin manifests are present')
for (const entry of fs.readdirSync(pluginsDir, { withFileTypes: true })) {
if (!entry.isDirectory() || entry.name === 'services') continue
if (!entry.isDirectory() || groupedPluginRoots.has(entry.name)) continue
check(
manifestSet.has(`${entry.name}/manifest.json`),
`top-level plugin ${entry.name} must have a manifest`
)
}
const serviceRoot = path.join(pluginsDir, 'services')
for (const entry of fs.readdirSync(serviceRoot, { withFileTypes: true })) {
if (!entry.isDirectory()) continue
check(
manifestSet.has(`services/${entry.name}/manifest.json`),
`service plugin ${entry.name} must have a manifest`
)
for (const groupName of groupedPluginRoots) {
const groupRoot = path.join(pluginsDir, groupName)
if (!fs.existsSync(groupRoot)) continue
for (const entry of fs.readdirSync(groupRoot, { withFileTypes: true })) {
if (!entry.isDirectory()) continue
check(
manifestSet.has(`${groupName}/${entry.name}/manifest.json`),
`${groupName} plugin ${entry.name} must have a manifest`
)
}
}
for (const manifestPath of manifestPaths) {
+1 -1
View File
@@ -5,7 +5,7 @@ set -euo pipefail
source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh"
run_node_test <<'JS'
const power = requireFromRoot('shell/plugins/power/Model.js')
const power = requireFromRoot('shell/plugins/panels/power/Model.js')
const states = { Charging: 1, Discharging: 2, FullyCharged: 3, PendingCharge: 4 }
assertEqual(power.selectProfileIndex(0, 1, ['balanced', 'performance']), 1, 'power advances profile selection')
+1 -1
View File
@@ -5,7 +5,7 @@ set -euo pipefail
source "$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)/base-test.sh"
run_node_test <<'JS'
const weather = requireFromRoot('shell/plugins/weather/Model.js')
const weather = requireFromRoot('shell/plugins/panels/weather/Model.js')
assertDeepEqual(
weather.parseWeatherStatus('{"text":"☀","class":"sunny"}'),