Skip to content

Commit

Permalink
fix: correct distributed asset path
Browse files Browse the repository at this point in the history
Closes #1976
  • Loading branch information
nikku authored and barmac committed Oct 18, 2023
1 parent 0f79949 commit 3d813de
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tasks/build-distro.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ async function run() {
fs.mkdirSync(dest, { recursive: true });

console.log('copy bpmn-font to ' + dest + '/bpmn-font');
await cp(resolve('bpmn-font', '/dist/{font,css}/**'), dest + '/assets/bpmn-font');
await cp(resolve('bpmn-font', '/dist/css/**'), dest + '/assets/bpmn-font/css');
await cp(resolve('bpmn-font', '/dist/font/**'), dest + '/assets/bpmn-font/font');

console.log('copy diagram-js.css to ' + dest);
await cp(resolve('diagram-js', '/assets/**'), dest + '/assets');
Expand Down
26 changes: 26 additions & 0 deletions tasks/test-distro.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
import { execaSync as exec } from 'execa';

import assert from 'node:assert';
import fs from 'node:fs';

var failures = 0;

function runTest(variant, env) {
Expand All @@ -26,6 +29,27 @@ function runTest(variant, env) {
}
}

function verifyAssets() {

const assets = [
'bpmn-font/css/bpmn-embedded.css',
'bpmn-font/font/bpmn.woff',
'bpmn-js.css',
'diagram-js.css'
];

for (const asset of assets) {
try {
assert.ok(fs.existsSync('dist/assets/' + asset), `${asset} missing`);
} catch (e) {
console.error('[TEST] ASSET ' + asset);
console.error(e);

failures++;
}
}
}

function test() {

runTest('bpmn-modeler', 'development');
Expand All @@ -37,6 +61,8 @@ function test() {
runTest('bpmn-viewer', 'development');
runTest('bpmn-viewer', 'production');

verifyAssets();

if (failures) {
process.exit(1);
}
Expand Down

0 comments on commit 3d813de

Please sign in to comment.