diff --git a/package.json b/package.json index ecc9ec44b1869b07913a8623fd4047fedf474e6c..fe63d5e1078d7500fdd059b3ccfb4a0a838a5571 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@peerverity/ai-delegate", - "version": "0.2.3", + "version": "0.2.4", "description": "AI request manager with credential management and weight-based model selection", "main": "dist/ai-delegate.js", "types": "dist/index.d.ts", @@ -26,7 +26,6 @@ ], "scripts": { "build": "webpack --mode production && npm run build:types", - "postbuild": "node scripts/publish-local.js", "build:dev": "webpack --mode development && npm run build:types", "build:types": "tsc --emitDeclarationOnly --declaration --declarationMap", "prepare": "npm run build", diff --git a/scripts/publish-local.js b/scripts/publish-local.js deleted file mode 100644 index 956574a182468dc670d6d6479eb7e8c507fc296d..0000000000000000000000000000000000000000 --- a/scripts/publish-local.js +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/env node -/** - * Auto-publish to local Verdaccio registry if available. - * This script is run automatically after `npm run build`. - * - * If Verdaccio is running at localhost:4873, the package will be published there. - * If Verdaccio is not running, the script silently exits (no error). - * - * The script unpublishes the current version first (if it exists) to allow - * republishing the same version with updated code during local development. - */ - -const { execSync } = require('child_process'); -const http = require('http'); -const fs = require('fs'); -const path = require('path'); - -const VERDACCIO_URL = process.env.VERDACCIO_URL || 'http://localhost:4873'; - -// Read package.json to get name and version -const packageJsonPath = path.join(process.cwd(), 'package.json'); -const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8')); -const packageSpec = `${packageJson.name}@${packageJson.version}`; - -// Check if Verdaccio is running -const req = http.get(VERDACCIO_URL, { timeout: 2000 }, (res) => { - if (res.statusCode === 200) { - console.log('[publish-local] Verdaccio detected at', VERDACCIO_URL); - - // First, try to unpublish the current version (ignore errors if it doesn't exist) - try { - console.log(`[publish-local] Unpublishing ${packageSpec} (if it exists)...`); - execSync(`npm unpublish ${packageSpec} --registry ${VERDACCIO_URL} --force`, { - stdio: 'pipe', - cwd: process.cwd() - }); - console.log(`[publish-local] Unpublished ${packageSpec}`); - } catch (err) { - // Package doesn't exist yet - that's fine, continue with publish - console.log(`[publish-local] ${packageSpec} not in registry (this is OK)`); - } - - // Now publish - try { - // Use --ignore-scripts to prevent infinite loop (prepare -> build -> postbuild -> publish -> prepare...) - execSync(`npm publish --registry ${VERDACCIO_URL} --ignore-scripts`, { - stdio: 'inherit', - cwd: process.cwd() - }); - console.log('[publish-local] Successfully published to local Verdaccio'); - } catch (err) { - console.warn('[publish-local] Publish failed:', err.message); - } - } else { - console.log('[publish-local] Verdaccio returned status', res.statusCode, '- skipping'); - } -}); - -req.on('error', () => { - // Verdaccio not running - silently skip - console.log('[publish-local] Verdaccio not running at', VERDACCIO_URL, '- skipping local publish'); -}); - -req.on('timeout', () => { - req.destroy(); - console.log('[publish-local] Verdaccio not responding - skipping local publish'); -});