Files
boos e0a5f57793 feat(desktop): embed BoosAPI Desktop client as a subproject
Vendor the rebranded BoosAPI Desktop client (Tauri + Vue) into metapi as
a monorepo subdirectory under desktop/. Source only — node_modules,
dist, Cargo target and the upstream .git history are excluded.

desktop/ keeps its own independent Cargo workspace (desktop/src-tauri
with crates/*); it is not part of the backend boosapi crate, so a
`cargo check` at the metapi root still compiles only the backend. Build
the desktop app from desktop/src-tauri per desktop/README.md.

Note: app icons are still placeholder assets pending the final BoosAPI
logo. The updater signing keys live outside the repo and are not
included.
2026-06-22 11:32:57 +08:00

57 lines
1.7 KiB
JavaScript

const fs = require('node:fs')
const { createRequire } = require('node:module')
const path = require('node:path')
const process = require('node:process')
const repoRoot = process.cwd()
const packageJsonPaths = [
path.join(repoRoot, 'package.json'),
...fs.readdirSync(path.join(repoRoot, 'packages'), { withFileTypes: true })
.filter(entry => entry.isDirectory())
.map(entry => path.join(repoRoot, 'packages', entry.name, 'package.json'))
.filter(file => fs.existsSync(file)),
]
let hasError = false
for (const packageJsonPath of packageJsonPaths) {
const pkg = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'))
const peerDependencies = pkg.peerDependencies || {}
const peerDependenciesMeta = pkg.peerDependenciesMeta || {}
const peerNames = Object.keys(peerDependencies)
if (peerNames.length === 0)
continue
const packageDir = path.dirname(packageJsonPath)
const requireFromPackage = createRequire(path.join(packageDir, 'package.json'))
console.log(`\n${pkg.name}`)
for (const peerName of peerNames) {
const isOptional = !!peerDependenciesMeta[peerName]?.optional
try {
const resolvedPackageJson = requireFromPackage.resolve(`${peerName}/package.json`)
const installedPackageJson = JSON.parse(fs.readFileSync(resolvedPackageJson, 'utf8'))
console.log(` OK ${peerName}@${installedPackageJson.version}${isOptional ? ' (optional)' : ''}`)
}
catch {
if (isOptional) {
console.log(` MISS ${peerName} (optional)`)
continue
}
hasError = true
console.error(` FAIL ${peerName} is required but not installed`)
}
}
}
if (hasError) {
console.error('\nPeer dependency check failed.')
process.exit(1)
}
console.log('\nPeer dependency check passed.')