Skip to content

Commit

Permalink
fix: explicitly expose dist exports
Browse files Browse the repository at this point in the history
Closes #57
  • Loading branch information
barmac committed Jan 29, 2024
1 parent c351b31 commit 43b87ff
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"./core": {
"import": "./dist/core.esm.js",
"require": "./dist/core.js"
}
},
"./dist/assets/*.css": "./dist/assets/*.css",
"./dist/*.js": "./dist/*.js"
},
"scripts": {
"all": "run-s lint test distro",
Expand All @@ -24,7 +26,7 @@
"lint": "eslint .",
"dev": "npm test -- --auto-watch --no-single-run",
"test": "karma start karma.config.js",
"test:build": "mocha --reporter=spec --recursive test/distro",
"test:build": "mocha --reporter=spec --recursive test/distro/*.spec.js",
"start": "cross-env SINGLE_START=cloud-templates npm run dev",
"start:templates": "cross-env SINGLE_START=templates npm run dev",
"prepare": "run-s bundle"
Expand Down
15 changes: 14 additions & 1 deletion test/distro/distroSpec.js → test/distro/distro.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ const fs = require('fs'),

const DIST_DIR = path.join(__dirname, '../../dist');

const EXPORTS = [
'bpmn-js-element-templates',
'bpmn-js-element-templates/core',
'bpmn-js-element-templates/dist/assets/element-templates.css',
'bpmn-js-element-templates/dist/bpmn-js-element-templates.umd.js'
];

describe('modules', function() {

it('should expose CJS bundle', verifyExists('index.js'));
Expand All @@ -16,8 +23,14 @@ describe('modules', function() {

describe('assets', function() {

it('should expose element templates styles', verifyExists('assets/element-templates.css'));
EXPORTS.forEach(function(asset) {

it(`should expose "${asset}"`, function() {

expect(() => require.resolve(asset)).not.to.throw();
});

});
});

function verifyExists(relativePath) {
Expand Down

0 comments on commit 43b87ff

Please sign in to comment.