Skip to content

Commit 4f1c58d

Browse files
committed
Fix CI build by creating electron-types stub during build
1 parent ab7806d commit 4f1c58d

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

.github/workflows/auto-publish-pypi.yaml

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,37 @@ jobs:
9292
run: |
9393
echo "🔨 Building frontend..."
9494
# Temporarily exclude desktop-ui from workspace (it has unpublished dependencies)
95-
sed -i "s| - apps/\*\*| # - apps/** # Excluded for CI|" pnpm-workspace.yaml
95+
sed -i 's| - apps/\*\*| # - apps/** # Excluded for CI|' pnpm-workspace.yaml
96+
# Remove electron-types dependency from root package.json (it's not published to npm yet)
97+
sed -i '/"@hanzo-studio\/electron-types": "catalog:",/d' package.json
98+
# Create a stub for electron-types to satisfy TypeScript during build
99+
mkdir -p node_modules/@hanzo-studio/electron-types
100+
cat > node_modules/@hanzo-studio/electron-types/package.json << 'EOF'
101+
{
102+
"name": "@hanzo-studio/electron-types",
103+
"version": "0.5.5",
104+
"main": "index.js",
105+
"types": "index.d.ts"
106+
}
107+
EOF
108+
cat > node_modules/@hanzo-studio/electron-types/index.d.ts << 'EOF'
109+
// Stub types for CI build
110+
export enum DownloadStatus {
111+
Idle = 'idle',
112+
Downloading = 'downloading',
113+
Completed = 'completed',
114+
Failed = 'failed'
115+
}
116+
export interface DownloadState {
117+
status: DownloadStatus;
118+
progress?: number;
119+
error?: string;
120+
}
121+
export interface ElectronAPI {
122+
[key: string]: any;
123+
}
124+
EOF
125+
echo "export {}" > node_modules/@hanzo-studio/electron-types/index.js
96126
pnpm install --no-frozen-lockfile --ignore-scripts
97127
pnpm exec vite build
98128

0 commit comments

Comments
 (0)