mirror of
https://github.com/Comfy-Org/ComfyUI_frontend.git
synced 2026-07-17 01:07:56 +00:00
## Summary Backports #12857 to core/1.45 so the Desktop bridge types package and publish workflow are available for the host telemetry stack. ## Changes - **What**: Adds the @comfyorg/comfyui-desktop-bridge-types workspace package, publish workflow, generated types dependency handling, and Desktop bridge remote-mode type usage. - **Dependencies**: Adds the frontend app dependency on @comfyorg/comfyui-desktop-bridge-types via workspace:*. ## Review Focus Cherry-pick conflict was limited to pnpm-workspace.yaml; resolved by keeping the core/1.45 overrides block unchanged because #12857 only changed a comment on main for preexisting security overrides. Validation: pnpm typecheck via commit hook; pnpm test:unit src/platform/missingModel/missingModelDownload.test.ts.
45 lines
1.1 KiB
JavaScript
45 lines
1.1 KiB
JavaScript
import fs from 'fs'
|
|
import path from 'path'
|
|
|
|
const mainPackage = JSON.parse(fs.readFileSync('./package.json', 'utf8'))
|
|
const desktopBridgeTypesPackage = JSON.parse(
|
|
fs.readFileSync(
|
|
'./packages/comfyui-desktop-bridge-types/package.json',
|
|
'utf8'
|
|
)
|
|
)
|
|
|
|
// Create the types-only package.json
|
|
const typesPackage = {
|
|
name: `${mainPackage.name}-types`,
|
|
version: mainPackage.version,
|
|
types: './index.d.ts',
|
|
files: ['index.d.ts'],
|
|
publishConfig: {
|
|
access: 'public'
|
|
},
|
|
repository: mainPackage.repository,
|
|
homepage: mainPackage.homepage,
|
|
description: `TypeScript definitions for ${mainPackage.name}`,
|
|
license: mainPackage.license,
|
|
dependencies: {
|
|
'@comfyorg/comfyui-desktop-bridge-types': desktopBridgeTypesPackage.version
|
|
},
|
|
peerDependencies: {
|
|
vue: mainPackage.dependencies.vue,
|
|
zod: mainPackage.dependencies.zod
|
|
}
|
|
}
|
|
|
|
// Ensure dist directory exists
|
|
const distDir = './dist'
|
|
if (!fs.existsSync(distDir)) {
|
|
fs.mkdirSync(distDir, { recursive: true })
|
|
}
|
|
|
|
// Write the new package.json to the dist directory
|
|
fs.writeFileSync(
|
|
path.join(distDir, 'package.json'),
|
|
JSON.stringify(typesPackage, null, 2)
|
|
)
|