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

46 lines
1.5 KiB
JavaScript

import fs from 'node:fs'
import path from 'node:path'
import dts from 'rollup-plugin-dts'
// Bundle the generated declaration entry into a single dist/index.d.ts.
// Treat workspace deps as external so we don't try to resolve them during
// bundling (the consumer will have their own types for those packages).
// If the expected Vite output entry (./dist/types/exports.d.ts) is missing
// fall back to an existing `dist/index.d.ts` so the build doesn't fail in
// environments where declarations were previously emitted differently.
const fallbackInput = './dist/index.d.ts'
const preferredInput = './dist/types/exports.d.ts'
const preferredExists = fs.existsSync(path.resolve(preferredInput))
const fallbackExists = fs.existsSync(path.resolve(fallbackInput))
if (!preferredExists && !fallbackExists) {
throw new Error(
'No declaration entry found. Run `pnpm run build` (which emits declarations) or otherwise ensure one of `./dist/types/exports.d.ts` or `./dist/index.d.ts` exists before running `build:dts`.',
)
}
const inputPath = preferredExists ? preferredInput : fallbackInput
export default [
{
// Prefer the Vite emitted declarations under dist/types if present
input: inputPath,
plugins: [
dts({
// Inline local type imports to ensure named interfaces are bundled
respectExternal: false,
}),
],
external: [
/^stream-markdown-parser(?:\/.*)?$/,
],
output: [
{
file: 'dist/index.d.ts',
format: 'es',
},
],
},
]