diff --git a/package-lock.json b/package-lock.json index 54afdd99..257bd1f2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1003,7 +1003,7 @@ }, "node_modules/@electron/node-gyp": { "version": "10.2.0-electron.1", - "resolved": "git+ssh://git@github.com/electron/node-gyp.git#06b29aafb7708acef8b3669835c8a7857ebc92d2", + "resolved": "git+https://github.com/electron/node-gyp.git#06b29aafb7708acef8b3669835c8a7857ebc92d2", "integrity": "sha512-4MSBTT8y07YUDqf69/vSh80Hh791epYqGtWHO3zSKhYFwQg+gx9wi1PqbqP6YqC4WMsNxZ5l9oDmnWdK5pfCKQ==", "dev": true, "license": "MIT", diff --git a/package.json b/package.json index 2b421adf..5367c98a 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "libs/*" ], "scripts": { - "postinstall": "node -e \"const fs=require('fs');if(process.platform==='darwin'){['darwin-arm64','darwin-x64'].forEach(a=>{const p='node_modules/node-pty/prebuilds/'+a+'/spawn-helper';if(fs.existsSync(p))fs.chmodSync(p,0o755)})}\"", + "postinstall": "node -e \"const fs=require('fs');if(process.platform==='darwin'){['darwin-arm64','darwin-x64'].forEach(a=>{const p='node_modules/node-pty/prebuilds/'+a+'/spawn-helper';if(fs.existsSync(p))fs.chmodSync(p,0o755)})}\" && node scripts/fix-lockfile-urls.mjs", + "fix:lockfile": "node scripts/fix-lockfile-urls.mjs", "dev": "node init.mjs", "dev:web": "npm run dev:web --workspace=apps/ui", "dev:electron": "npm run dev:electron --workspace=apps/ui", diff --git a/scripts/fix-lockfile-urls.mjs b/scripts/fix-lockfile-urls.mjs new file mode 100755 index 00000000..4bcb144a --- /dev/null +++ b/scripts/fix-lockfile-urls.mjs @@ -0,0 +1,41 @@ +#!/usr/bin/env node + +/** + * Script to convert git+ssh:// URLs to git+https:// URLs in package-lock.json + * This ensures compatibility with CI/CD environments that don't support SSH. + */ + +import { readFileSync, writeFileSync } from 'fs'; +import { join } from 'path'; + +const lockfilePath = join(process.cwd(), 'package-lock.json'); + +try { + let content = readFileSync(lockfilePath, 'utf8'); + const originalContent = content; + + // Convert git+ssh://git@github.com/ to git+https://github.com/ + content = content.replace( + /git\+ssh:\/\/git@github\.com\//g, + 'git+https://github.com/' + ); + + // Also handle other potential git+ssh patterns (e.g., git+ssh://git@gitlab.com/) + content = content.replace( + /git\+ssh:\/\/git@([^/]+)\//g, + 'git+https://$1/' + ); + + if (content !== originalContent) { + writeFileSync(lockfilePath, content, 'utf8'); + console.log('✓ Fixed git+ssh:// URLs in package-lock.json'); + process.exit(0); + } else { + console.log('✓ No git+ssh:// URLs found in package-lock.json'); + process.exit(0); + } +} catch (error) { + console.error('Error fixing package-lock.json:', error.message); + process.exit(1); +} +