mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-30 06:12:03 +00:00
fixing the package locks to not use ssh
This commit is contained in:
2
package-lock.json
generated
2
package-lock.json
generated
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
41
scripts/fix-lockfile-urls.mjs
Executable file
41
scripts/fix-lockfile-urls.mjs
Executable 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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user