Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 19 additions & 19 deletions packages/command-tests/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -218,31 +218,31 @@ 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);
checkWidgetBundleFiles();
}

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.");
function checkWidgetBundleFiles() {
const stagingDir = join(workDir, "dist", "tmp", "widgets");
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(", ")}.`);
}
}

Expand Down
4 changes: 4 additions & 0 deletions packages/pluggable-widgets-tools/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down
4 changes: 2 additions & 2 deletions packages/pluggable-widgets-tools/configs/rollup.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -320,9 +320,9 @@ export default async args => {
clear({ targets: [outDir, mpkDir] }),
command([
() => {
cp(join(sourcePath, "src/**/*.xml"), outDir);
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);
}
}
]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@ export default async args => {
clear({ targets: [outDir, mpkDir] }),
command([
() => {
cp(join(sourcePath, "src/**/*.xml"), outDir);
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);
}
}
])
Expand Down
Loading