|
3 | 3 | import fs from "fs"; |
4 | 4 | import path from "path"; |
5 | 5 | import { fileURLToPath } from "url"; |
6 | | -import { extensionName, extensionShortName } from "./prebuild.js"; |
| 6 | +import { extensionName, extensionShortName, extensionVersion } from "./prebuild.js"; |
7 | 7 |
|
8 | 8 | const __dirname = path.dirname(fileURLToPath(import.meta.url)); |
9 | 9 |
|
| 10 | +console.log(`🔍 Running postbuild for ${extensionName}...`); |
| 11 | + |
| 12 | +// First, update all workspace versions |
| 13 | +console.log(`📝 Updating all package.json versions to ${extensionVersion}...`); |
| 14 | + |
| 15 | +const workspaces = [ |
| 16 | + "../package.json", |
| 17 | + "../extra-types/package.json", |
| 18 | + "../shared/package.json", |
| 19 | + "../webview-ui/package.json", |
| 20 | + "../agentic/package.json", |
| 21 | + "../vscode/package.json", |
| 22 | +]; |
| 23 | + |
| 24 | +for (const workspacePath of workspaces) { |
| 25 | + const fullPath = path.join(__dirname, workspacePath); |
| 26 | + if (fs.existsSync(fullPath)) { |
| 27 | + const workspacePackage = JSON.parse(fs.readFileSync(fullPath, "utf8")); |
| 28 | + workspacePackage.version = extensionVersion; |
| 29 | + fs.writeFileSync(fullPath, JSON.stringify(workspacePackage, null, 2)); |
| 30 | + console.log(` ✅ Updated ${workspacePath}`); |
| 31 | + } |
| 32 | +} |
| 33 | + |
| 34 | +console.log(`📝 Version updates complete!`); |
| 35 | + |
10 | 36 | console.log(`🔍 Running postbuild verification for ${extensionName}...`); |
11 | 37 |
|
12 | 38 | // Read the final package.json to verify branding was applied |
@@ -226,7 +252,7 @@ console.log("🔍 Verifying README..."); |
226 | 252 | const readmePath = path.join(__dirname, "../vscode/README.md"); |
227 | 253 | if (fs.existsSync(readmePath)) { |
228 | 254 | const readmeContent = fs.readFileSync(readmePath, "utf8"); |
229 | | - if (readmeContent.includes("Developer Lightspeed for Migration Toolkit for Applications")) { |
| 255 | + if (readmeContent.includes("Developer Lightspeed for migration toolkit")) { |
230 | 256 | console.log(` ✅ README contains proper branding`); |
231 | 257 | } else { |
232 | 258 | errors.push("README does not contain proper branding"); |
|
0 commit comments