@@ -17,6 +17,8 @@ export const shortName = "MTA";
1717export const repositoryUrl = "https://github.com/migtools/editor-extensions" ;
1818export const bugsUrl = "https://github.com/migtools/editor-extensions/issues" ;
1919export const homepageUrl = "https://developers.redhat.com/products/mta/overview" ;
20+ // export const fallbackAssetsUrl = "https://developers.redhat.com/content-gateway/rest/browse/pub/mta/8.0.1/"
21+ export const fallbackAssetsUrl = "https://download.devel.redhat.com/devel/candidates/middleware/migrationtoolkit/MTA-8.1.0.CR2/"
2022
2123// Extension name mapping: upstream → downstream
2224const NAME_MAP = {
@@ -333,8 +335,7 @@ function transformSourceCode() {
333335async function generateFallbackAssets ( pkg ) {
334336 console . log ( " 🔧 Generating fallback assets configuration..." ) ;
335337
336- const FALLBACK_ASSETS_URL =
337- "https://developers.redhat.com/content-gateway/rest/browse/pub/mta/8.0.0/" ;
338+ const FALLBACK_ASSETS_URL = fallbackAssetsUrl ;
338339
339340 const PLATFORM_MAPPING = {
340341 "linux-x64" : "linux-amd64" ,
@@ -357,18 +358,18 @@ async function generateFallbackAssets(pkg) {
357358 try {
358359 console . log ( ` Fetching from: ${ FALLBACK_ASSETS_URL } ` ) ;
359360
360- // Verify sha256sum.txt exists
361- console . log ( " 🔍 Verifying sha256sum.txt exists..." ) ;
361+ // Verify SHA256SUM exists
362+ console . log ( " 🔍 Verifying SHA256SUM exists..." ) ;
362363 try {
363- const sha256Response = await fetchText ( `${ FALLBACK_ASSETS_URL } sha256sum.txt ` ) ;
364+ const sha256Response = await fetchText ( `${ FALLBACK_ASSETS_URL } SHA256SUM ` ) ;
364365 if ( ! sha256Response || sha256Response . trim ( ) . length === 0 ) {
365- throw new Error ( "sha256sum.txt is empty" ) ;
366+ throw new Error ( "SHA256SUM is empty" ) ;
366367 }
367- console . log ( " ✅ sha256sum.txt found and not empty" ) ;
368+ console . log ( " ✅ SHA256SUM found and not empty" ) ;
368369 } catch ( sha256Error ) {
369- console . error ( ` ❌ Failed to fetch sha256sum.txt : ${ sha256Error . message } ` ) ;
370+ console . error ( ` ❌ Failed to fetch SHA256SUM : ${ sha256Error . message } ` ) ;
370371 console . error (
371- " ❌ Build failed: sha256sum.txt is required for secure asset downloads" ,
372+ " ❌ Build failed: SHA256SUM is required for secure asset downloads" ,
372373 ) ;
373374 process . exit ( 1 ) ;
374375 }
@@ -430,7 +431,7 @@ async function generateFallbackAssets(pkg) {
430431
431432 pkg . fallbackAssets = {
432433 baseUrl : FALLBACK_ASSETS_URL ,
433- sha256sumFile : "sha256sum.txt " ,
434+ sha256sumFile : "SHA256SUM " ,
434435 assets,
435436 } ;
436437
@@ -498,6 +499,35 @@ const isDirectExecution =
498499if ( isDirectExecution ) {
499500 console . log ( "🔄 Running MTA prebuild for multi-extension architecture...\n" ) ;
500501
502+ // 0. Set version across all workspaces BEFORE webpack runs
503+ // This ensures webpack's DefinePlugin bakes the correct MTA version
504+ // into EXTENSION_VERSION constants at compile time.
505+ console . log ( `📝 Setting version ${ extensionVersion } across all workspaces...` ) ;
506+ const workspacePaths = [
507+ "package.json" ,
508+ "extra-types/package.json" ,
509+ "shared/package.json" ,
510+ "webview-ui/package.json" ,
511+ "agentic/package.json" ,
512+ "vscode/core/package.json" ,
513+ "vscode/java/package.json" ,
514+ "vscode/javascript/package.json" ,
515+ "vscode/go/package.json" ,
516+ "vscode/csharp/package.json" ,
517+ "vscode/konveyor/package.json" ,
518+ ] ;
519+
520+ for ( const ws of workspacePaths ) {
521+ const fullPath = path . join ( __dirname , ".." , ws ) ;
522+ if ( fs . existsSync ( fullPath ) ) {
523+ const pkg = JSON . parse ( fs . readFileSync ( fullPath , "utf8" ) ) ;
524+ pkg . version = extensionVersion ;
525+ fs . writeFileSync ( fullPath , JSON . stringify ( pkg , null , 2 ) ) ;
526+ console . log ( ` ✅ ${ ws } ` ) ;
527+ }
528+ }
529+ console . log ( "" ) ;
530+
501531 // 1. Transform core extension
502532 console . log ( "📦 Branding core extension (vscode/core)..." ) ;
503533 let corePkg = readPackageJson ( "vscode/core/package.json" ) ;
0 commit comments