fixing the package locks to not use ssh

This commit is contained in:
Cody Seibert
2025-12-19 14:45:23 -05:00
parent 1ad3b1739b
commit 2b02db8ae3
3 changed files with 44 additions and 2 deletions

2
package-lock.json generated
View File

@@ -1003,7 +1003,7 @@
}, },
"node_modules/@electron/node-gyp": { "node_modules/@electron/node-gyp": {
"version": "10.2.0-electron.1", "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==", "integrity": "sha512-4MSBTT8y07YUDqf69/vSh80Hh791epYqGtWHO3zSKhYFwQg+gx9wi1PqbqP6YqC4WMsNxZ5l9oDmnWdK5pfCKQ==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",

View File

@@ -7,7 +7,8 @@
"libs/*" "libs/*"
], ],
"scripts": { "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": "node init.mjs",
"dev:web": "npm run dev:web --workspace=apps/ui", "dev:web": "npm run dev:web --workspace=apps/ui",
"dev:electron": "npm run dev:electron --workspace=apps/ui", "dev:electron": "npm run dev:electron --workspace=apps/ui",

41
scripts/fix-lockfile-urls.mjs Executable file
View File

@@ -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);
}