forked from boos/BoosAPI
e0a5f57793
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.
52 lines
1.3 KiB
JavaScript
52 lines
1.3 KiB
JavaScript
import fs from 'node:fs'
|
|
import path from 'node:path'
|
|
import dts from 'rollup-plugin-dts'
|
|
|
|
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 the build first to emit declarations before running build:dts.',
|
|
)
|
|
}
|
|
|
|
const inputPath = preferredExists ? preferredInput : fallbackInput
|
|
|
|
export default [
|
|
{
|
|
input: inputPath,
|
|
plugins: [
|
|
{
|
|
name: 'normalize-vue-demi-imports',
|
|
transform(code, id) {
|
|
if (!id.endsWith('.d.ts'))
|
|
return null
|
|
const rewritten = code
|
|
.replace(/from\s+['"](?:\.\.\/)+vue-demi['"]/g, 'from \'vue-demi\'')
|
|
.replace(/import\(\s*['"](?:\.\.\/)+vue-demi['"]\s*\)/g, 'import(\'vue-demi\')')
|
|
if (rewritten === code)
|
|
return null
|
|
return { code: rewritten, map: null }
|
|
},
|
|
},
|
|
dts({
|
|
respectExternal: false,
|
|
}),
|
|
],
|
|
external: [
|
|
/^stream-markdown-parser(?:\/.*)?$/,
|
|
/^vue-demi(?:\/.*)?$/,
|
|
],
|
|
output: [
|
|
{
|
|
file: 'dist/index.d.ts',
|
|
format: 'es',
|
|
},
|
|
],
|
|
},
|
|
]
|