From 71a63b645956be5f0c44f45f60bebc7a2e7e0d37 Mon Sep 17 00:00:00 2001 From: "Ali.Haydar.Sumer" Date: Mon, 22 Jun 2026 13:34:57 +0200 Subject: [PATCH 1/4] Use relative globs so widget xmls are copied on Windows --- packages/pluggable-widgets-tools/configs/rollup.config.mjs | 5 +++-- .../pluggable-widgets-tools/configs/rollup.config.native.mjs | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/packages/pluggable-widgets-tools/configs/rollup.config.mjs b/packages/pluggable-widgets-tools/configs/rollup.config.mjs index 4998ce2d..b6015387 100644 --- a/packages/pluggable-widgets-tools/configs/rollup.config.mjs +++ b/packages/pluggable-widgets-tools/configs/rollup.config.mjs @@ -320,9 +320,10 @@ export default async args => { clear({ targets: [outDir, mpkDir] }), command([ () => { - cp(join(sourcePath, "src/**/*.xml"), outDir); + // Re-target join(widgetRoot,...) after PR #182. + cp("src/**/*.xml", outDir); if (existsSync(`src/${widgetName}.icon.png`) || existsSync(`src/${widgetName}.tile.png`)) { - cp(join(sourcePath, `src/${widgetName}.@(tile|icon)?(.dark).png`), outDir); + cp(`src/${widgetName}.@(tile|icon)?(.dark).png`, outDir); } } ]), diff --git a/packages/pluggable-widgets-tools/configs/rollup.config.native.mjs b/packages/pluggable-widgets-tools/configs/rollup.config.native.mjs index 72316abb..f8171edc 100644 --- a/packages/pluggable-widgets-tools/configs/rollup.config.native.mjs +++ b/packages/pluggable-widgets-tools/configs/rollup.config.native.mjs @@ -257,9 +257,10 @@ export default async args => { clear({ targets: [outDir, mpkDir] }), command([ () => { - cp(join(sourcePath, "src/**/*.xml"), outDir); + // Re-target join(widgetRoot,...) after PR #182. + cp("src/**/*.xml", outDir); if (existsSync(`src/${widgetName}.icon.png`) || existsSync(`src/${widgetName}.tile.png`)) { - cp(join(sourcePath, `src/${widgetName}.@(tile|icon)?(.dark).png`), outDir); + cp(`src/${widgetName}.@(tile|icon)?(.dark).png`, outDir); } } ]) From c3d2d6550ea6b2036f6217a4cdb67ea2b99d0b4d Mon Sep 17 00:00:00 2001 From: "Ali.Haydar.Sumer" Date: Mon, 22 Jun 2026 13:35:43 +0200 Subject: [PATCH 2/4] Assert xmls are present in the bundle --- packages/command-tests/commands.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/packages/command-tests/commands.js b/packages/command-tests/commands.js index 236e5bf7..b5da6a21 100644 --- a/packages/command-tests/commands.js +++ b/packages/command-tests/commands.js @@ -228,6 +228,7 @@ async function main() { ) { throw new Error("Expected mpk file to be generated, but it wasn't."); } + checkWidgetBundleFiles(); } async function testRelease() { @@ -244,6 +245,18 @@ async function main() { ) { throw new Error("Expected mpk file to be generated, but it wasn't."); } + checkWidgetBundleFiles(); + } + + function checkWidgetBundleFiles() { + // XML files copied into the staging dir before zipping; missing here means a broken mpk. + const stagingDir = join(workDir, "dist", "tmp", "widgets"); + const missing = ["package.xml", `${widgetPackageJson.widgetName}.xml`].filter( + f => !existsSync(join(stagingDir, f)) + ); + if (missing.length) { + throw new Error(`Expected widget bundle files in mpk, but missing: ${missing.join(", ")}.`); + } } async function checkDependenciesFiles(isNative, boilerplate, version) { From 0807b2da7e9ead0c9f9db044eaac198b9c154681 Mon Sep 17 00:00:00 2001 From: "Ali.Haydar.Sumer" Date: Mon, 22 Jun 2026 13:36:06 +0200 Subject: [PATCH 3/4] Update the change log --- packages/pluggable-widgets-tools/CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/pluggable-widgets-tools/CHANGELOG.md b/packages/pluggable-widgets-tools/CHANGELOG.md index 91c7297b..aa700345 100644 --- a/packages/pluggable-widgets-tools/CHANGELOG.md +++ b/packages/pluggable-widgets-tools/CHANGELOG.md @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), ## [Unreleased] +### Fixed + +- We fixed an issue on Windows where the generated `.mpk` was missing the widget's `.xml` files and icon/tile PNGs. + ### Changed - We replaced `ts-jest` with `@swc/jest` as the Jest transform (3–5× faster for TSX-heavy test suites) and switched the test runner from `jest-jasmine2` to `jest-circus`. From f651e9023e0a19ebef1b92a96e5d0eac26c53ec0 Mon Sep 17 00:00:00 2001 From: "Ali.Haydar.Sumer" Date: Tue, 23 Jun 2026 14:12:50 +0200 Subject: [PATCH 4/4] Review: Refactor mpk assertion --- packages/command-tests/commands.js | 35 ++++++------------- .../configs/rollup.config.mjs | 1 - .../configs/rollup.config.native.mjs | 1 - 3 files changed, 11 insertions(+), 26 deletions(-) diff --git a/packages/command-tests/commands.js b/packages/command-tests/commands.js index b5da6a21..adfeeeb0 100644 --- a/packages/command-tests/commands.js +++ b/packages/command-tests/commands.js @@ -218,42 +218,29 @@ async function main() { async function testBuild() { await execAsync("npm run build", workDir, logger); - if ( - !existsSync( - join( - workDir, - `/dist/${widgetPackageJson.version}/${widgetPackageJson.packagePath}.${widgetPackageJson.widgetName}.mpk` - ) - ) - ) { - throw new Error("Expected mpk file to be generated, but it wasn't."); - } checkWidgetBundleFiles(); } async function testRelease() { rm("-rf", join(workDir, "dist")); await execAsync("npm run release", workDir, logger); - - if ( - !existsSync( - join( - workDir, - `/dist/${widgetPackageJson.version}/${widgetPackageJson.packagePath}.${widgetPackageJson.widgetName}.mpk` - ) - ) - ) { - throw new Error("Expected mpk file to be generated, but it wasn't."); - } checkWidgetBundleFiles(); } function checkWidgetBundleFiles() { - // XML files copied into the staging dir before zipping; missing here means a broken mpk. const stagingDir = join(workDir, "dist", "tmp", "widgets"); - const missing = ["package.xml", `${widgetPackageJson.widgetName}.xml`].filter( - f => !existsSync(join(stagingDir, f)) + const mpkFile = join( + workDir, + "dist", + widgetPackageJson.version, + `${widgetPackageJson.packagePath}.${widgetPackageJson.widgetName}.mpk` ); + const requiredFiles = [ + mpkFile, + join(stagingDir, "package.xml"), + join(stagingDir, `${widgetPackageJson.widgetName}.xml`) + ]; + const missing = requiredFiles.filter(f => !existsSync(f)); if (missing.length) { throw new Error(`Expected widget bundle files in mpk, but missing: ${missing.join(", ")}.`); } diff --git a/packages/pluggable-widgets-tools/configs/rollup.config.mjs b/packages/pluggable-widgets-tools/configs/rollup.config.mjs index b6015387..4f584b9f 100644 --- a/packages/pluggable-widgets-tools/configs/rollup.config.mjs +++ b/packages/pluggable-widgets-tools/configs/rollup.config.mjs @@ -320,7 +320,6 @@ export default async args => { clear({ targets: [outDir, mpkDir] }), command([ () => { - // Re-target join(widgetRoot,...) after PR #182. cp("src/**/*.xml", outDir); if (existsSync(`src/${widgetName}.icon.png`) || existsSync(`src/${widgetName}.tile.png`)) { cp(`src/${widgetName}.@(tile|icon)?(.dark).png`, outDir); diff --git a/packages/pluggable-widgets-tools/configs/rollup.config.native.mjs b/packages/pluggable-widgets-tools/configs/rollup.config.native.mjs index f8171edc..f864e3b9 100644 --- a/packages/pluggable-widgets-tools/configs/rollup.config.native.mjs +++ b/packages/pluggable-widgets-tools/configs/rollup.config.native.mjs @@ -257,7 +257,6 @@ export default async args => { clear({ targets: [outDir, mpkDir] }), command([ () => { - // Re-target join(widgetRoot,...) after PR #182. cp("src/**/*.xml", outDir); if (existsSync(`src/${widgetName}.icon.png`) || existsSync(`src/${widgetName}.tile.png`)) { cp(`src/${widgetName}.@(tile|icon)?(.dark).png`, outDir);