Skip to content

Commit f18e9e9

Browse files
nikkubarmac
authored andcommitted
chore: unify examples
* ensure every plug-in follows a similar structure * drop browserify + grunt legacy * sources in `src` bundles to `public` directory * `dev` and `all` scripts * use single `lint` task across all projects * use single instance of required configuration files (*ignore)
1 parent 7342d82 commit f18e9e9

File tree

151 files changed

+10668
-40497
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+10668
-40497
lines changed

.eslintignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
public
1+
public
2+
dist

.github/workflows/CI.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ jobs:
1919
- name: Install dependencies
2020
run: npm ci
2121
- name: Build examples
22-
run: npm run build:examples
22+
run: npm run build
2323
- name: Lint examples
24-
run: npm run lint:examples
24+
run: npm run lint

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
node_modules/
2+
public/
23
dist/
34
.idea
45
*.iml

bpmn-properties/.babelrc

Lines changed: 0 additions & 3 deletions
This file was deleted.

bpmn-properties/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

bpmn-properties/karma.conf.js

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
1+
// use puppeteer provided Chrome for testing
2+
process.env.CHROME_BIN = require('puppeteer').executablePath();
3+
4+
// configures browsers to run test against
5+
// any of [ 'ChromeHeadless', 'Chrome', 'Firefox', 'Safari' ]
6+
const browsers = (process.env.TEST_BROWSERS || 'ChromeHeadless').split(',');
7+
18
module.exports = function(karma) {
29
karma.set({
310

411
frameworks: [
5-
'browserify',
12+
'webpack',
613
'mocha',
714
'chai'
815
],
@@ -14,32 +21,25 @@ module.exports = function(karma) {
1421
reporters: [ 'dots' ],
1522

1623
preprocessors: {
17-
'test/spec/**/*Spec.js': [ 'browserify' ]
24+
'test/spec/**/*Spec.js': [ 'webpack' ]
1825
},
1926

20-
browsers: [ 'Chrome' ],
21-
22-
browserNoActivityTimeout: 30000,
27+
browsers,
2328

2429
singleRun: true,
2530
autoWatch: false,
2631

27-
// browserify configuration
28-
browserify: {
29-
debug: true,
30-
transform: [
31-
[ 'stringify', {
32-
global: true,
33-
extensions: [
34-
'.bpmn',
35-
'.xml',
36-
'.css'
37-
]
38-
} ],
39-
[ 'babelify', {
40-
global: true
41-
} ],
42-
]
32+
webpack: {
33+
mode: 'development',
34+
module: {
35+
rules: [
36+
{
37+
test: /\.css|\.bpmn$/,
38+
type: 'asset/source'
39+
}
40+
]
41+
},
42+
devtool: 'eval-source-map'
4343
}
4444
});
4545
};

bpmn-properties/package.json

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
"version": "0.0.0",
44
"description": "An example how to read and write custom BPMN 2.0 extensions",
55
"scripts": {
6-
"all": "run-s lint test",
7-
"lint": "eslint .",
6+
"all": "run-s test",
87
"dev": "npm test -- --auto-watch --no-single-run",
98
"test": "karma start"
109
},
@@ -27,30 +26,21 @@
2726
],
2827
"license": "MIT",
2928
"devDependencies": {
30-
"babel-core": "^6.26.0",
31-
"babel-preset-env": "^1.6.1",
32-
"babelify": "^10.0.0",
33-
"browserify": "^16.0.0",
3429
"chai": "^4.1.2",
35-
"eslint": "^8.25.0",
36-
"eslint-plugin-bpmn-io": "^1.0.0",
3730
"karma": "^6.0.0",
3831
"karma-browserify": "^8.0.0",
3932
"karma-chai": "^0.1.0",
4033
"karma-chrome-launcher": "^3.0.0",
4134
"karma-firefox-launcher": "^2.0.0",
42-
"karma-ie-launcher": "^1.0.0",
4335
"karma-mocha": "^2.0.0",
44-
"karma-phantomjs-launcher": "^1.0.0",
45-
"karma-safari-launcher": "^1.0.0",
36+
"karma-webpack": "^5.0.0",
4637
"mocha": "^10.0.0",
4738
"mocha-test-container-support": "^0.2.0",
4839
"npm-run-all": "^4.1.2",
49-
"stringify": "^5.0.0",
50-
"watchify": "^3.10.0"
40+
"puppeteer": "^21.5.2",
41+
"webpack": "^5.89.0"
5142
},
5243
"dependencies": {
53-
"bpmn-js": "^15.2.2",
54-
"inherits": "^2.0.1"
44+
"bpmn-js": "^15.2.2"
5545
}
5646
}

bundling/.gitignore

Lines changed: 0 additions & 3 deletions
This file was deleted.

bundling/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,13 @@
22
"name": "bpmn-js-example-commonjs",
33
"version": "0.0.0",
44
"description": "An example how to bundle an app using bpmn-js for the browser",
5-
"main": "src/app.js",
65
"scripts": {
7-
"all": "run-s bundle open",
6+
"all": "run-s build build:es5",
87
"build": "webpack",
98
"build:es5": "webpack --config webpack.es5.config.js",
109
"build:watch": "webpack -w",
1110
"open": "opn ./public/index.html",
12-
"dev": "npm run bundle:watch"
11+
"dev": "run-p bundle:watch open"
1312
},
1413
"repository": {
1514
"type": "git",

bundling/public/index.html renamed to bundling/src/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</style>
1414

1515
<!-- required viewer styles -->
16-
<link rel="stylesheet" href="https://unpkg.com/bpmn-js@9.0.1/dist/assets/bpmn-js.css">
16+
<link rel="stylesheet" href="https://unpkg.com/bpmn-js@15.0.1/dist/assets/bpmn-js.css">
1717

1818
<!--
1919
this is an example of how to use bpmn-js in a standalone application built with
@@ -28,6 +28,6 @@ <h1>Pizza Collaboration Viewer</h1>
2828

2929
<div id="canvas"></div>
3030

31-
<script src="./app.bundled.js"></script>
31+
<script src="./app.js"></script>
3232
</body>
3333
</html>

0 commit comments

Comments
 (0)