bpmn-moddle 5.1.4 → 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,17 +1,25 @@
1
1
  {
2
2
  "name": "bpmn-moddle",
3
- "version": "5.1.4",
3
+ "version": "6.0.0",
4
4
  "description": "A moddle wrapper for BPMN 2.0",
5
5
  "scripts": {
6
- "all": "run-s lint test",
6
+ "all": "run-s lint test distro",
7
7
  "lint": "eslint .",
8
8
  "dev": "npm test -- --watch",
9
- "test": "mocha -r esm --reporter=spec --recursive test"
9
+ "test": "mocha -r esm --reporter=spec --recursive test/spec test/integration test/adapter",
10
+ "distro": "run-s build test:build",
11
+ "build": "rollup -c",
12
+ "test:build": "mocha --reporter=spec --recursive test/distro",
13
+ "prepublishOnly": "run-s distro"
10
14
  },
11
15
  "repository": {
12
16
  "type": "git",
13
17
  "url": "https://github.com/bpmn-io/bpmn-moddle"
14
18
  },
19
+ "main": "dist/index.js",
20
+ "module": "dist/index.esm.js",
21
+ "umd:main": "dist/bpmn-moddle.umd.js",
22
+ "source": "lib/index.js",
15
23
  "keywords": [
16
24
  "bpmn",
17
25
  "moddle",
@@ -20,7 +28,7 @@
20
28
  ],
21
29
  "author": {
22
30
  "name": "Nico Rehwaldt",
23
- "url": "https://github.com/Nikku"
31
+ "url": "https://github.com/nikku"
24
32
  },
25
33
  "contributors": [
26
34
  {
@@ -37,12 +45,17 @@
37
45
  "eslint-plugin-bpmn-io": "^0.4.1",
38
46
  "esm": "^3.0.15",
39
47
  "mocha": "^4.0.1",
40
- "npm-run-all": "^4.1.2",
48
+ "npm-run-all": "^4.1.5",
49
+ "rollup": "^1.17.0",
50
+ "rollup-plugin-commonjs": "^10.0.1",
51
+ "rollup-plugin-json": "^4.0.0",
52
+ "rollup-plugin-node-resolve": "^5.2.0",
53
+ "rollup-plugin-terser": "^5.1.1",
41
54
  "xsd-schema-validator": "^0.5.0"
42
55
  },
43
56
  "dependencies": {
44
57
  "min-dash": "^3.0.0",
45
- "moddle": "^4.1.0",
46
- "moddle-xml": "^7.2.3"
58
+ "moddle": "^5.0.1",
59
+ "moddle-xml": "^8.0.1"
47
60
  }
48
61
  }
@@ -1388,7 +1388,7 @@
1388
1388
  "type": "String"
1389
1389
  },
1390
1390
  {
1391
- "name": "participantRefs",
1391
+ "name": "participantRef",
1392
1392
  "type": "Participant",
1393
1393
  "isMany": true,
1394
1394
  "isReference": true
@@ -2061,7 +2061,7 @@
2061
2061
  ],
2062
2062
  "properties": [
2063
2063
  {
2064
- "name": "participantRefs",
2064
+ "name": "participantRef",
2065
2065
  "type": "Participant",
2066
2066
  "isMany": true,
2067
2067
  "isReference": true
@@ -2135,8 +2135,8 @@
2135
2135
  {
2136
2136
  "name": "Choreography",
2137
2137
  "superClass": [
2138
- "FlowElementsContainer",
2139
- "Collaboration"
2138
+ "Collaboration",
2139
+ "FlowElementsContainer"
2140
2140
  ]
2141
2141
  },
2142
2142
  {
@@ -2468,10 +2468,8 @@
2468
2468
  },
2469
2469
  {
2470
2470
  "name": "loopMaximum",
2471
- "type": "Expression",
2472
- "xml": {
2473
- "serialize": "xsi:type"
2474
- }
2471
+ "type": "Integer",
2472
+ "isAttr": true
2475
2473
  }
2476
2474
  ]
2477
2475
  },
package/index.js DELETED
@@ -1,3 +0,0 @@
1
- export {
2
- default
3
- } from './lib/simple';
@@ -1,86 +0,0 @@
1
- import {
2
- isString,
3
- isFunction,
4
- assign
5
- } from 'min-dash';
6
-
7
- import Moddle from 'moddle';
8
-
9
- import {
10
- Reader,
11
- Writer
12
- } from 'moddle-xml';
13
-
14
-
15
- /**
16
- * A sub class of {@link Moddle} with support for import and export of BPMN 2.0 xml files.
17
- *
18
- * @class BpmnModdle
19
- * @extends Moddle
20
- *
21
- * @param {Object|Array} packages to use for instantiating the model
22
- * @param {Object} [options] additional options to pass over
23
- */
24
- export default function BpmnModdle(packages, options) {
25
- Moddle.call(this, packages, options);
26
- }
27
-
28
- BpmnModdle.prototype = Object.create(Moddle.prototype);
29
-
30
-
31
- /**
32
- * Instantiates a BPMN model tree from a given xml string.
33
- *
34
- * @param {String} xmlStr
35
- * @param {String} [typeName='bpmn:Definitions'] name of the root element
36
- * @param {Object} [options] options to pass to the underlying reader
37
- * @param {Function} done callback that is invoked with (err, result, parseContext)
38
- * once the import completes
39
- */
40
- BpmnModdle.prototype.fromXML = function(xmlStr, typeName, options, done) {
41
-
42
- if (!isString(typeName)) {
43
- done = options;
44
- options = typeName;
45
- typeName = 'bpmn:Definitions';
46
- }
47
-
48
- if (isFunction(options)) {
49
- done = options;
50
- options = {};
51
- }
52
-
53
- var reader = new Reader(assign({ model: this, lax: true }, options));
54
- var rootHandler = reader.handler(typeName);
55
-
56
- reader.fromXML(xmlStr, rootHandler, done);
57
- };
58
-
59
-
60
- /**
61
- * Serializes a BPMN 2.0 object tree to XML.
62
- *
63
- * @param {String} element the root element, typically an instance of `bpmn:Definitions`
64
- * @param {Object} [options] to pass to the underlying writer
65
- * @param {Function} done callback invoked with (err, xmlStr) once the import completes
66
- */
67
- BpmnModdle.prototype.toXML = function(element, options, done) {
68
-
69
- if (isFunction(options)) {
70
- done = options;
71
- options = {};
72
- }
73
-
74
- var writer = new Writer(options);
75
-
76
- var result;
77
- var err;
78
-
79
- try {
80
- result = writer.toXML(element);
81
- } catch (e) {
82
- err = e;
83
- }
84
-
85
- return done(err, result);
86
- };
package/lib/simple.js DELETED
@@ -1,25 +0,0 @@
1
- import {
2
- assign
3
- } from 'min-dash';
4
-
5
- import BpmnModdle from './bpmn-moddle';
6
-
7
- import BpmnPackage from '../resources/bpmn/json/bpmn.json';
8
- import BpmnDiPackage from '../resources/bpmn/json/bpmndi.json';
9
- import DcPackage from '../resources/bpmn/json/dc.json';
10
- import DiPackage from '../resources/bpmn/json/di.json';
11
- import BiocPackage from '../resources/bpmn-io/json/bioc.json';
12
-
13
- var packages = {
14
- bpmn: BpmnPackage,
15
- bpmndi: BpmnDiPackage,
16
- dc: DcPackage,
17
- di: DiPackage,
18
- bioc: BiocPackage
19
- };
20
-
21
- export default function(additionalPackages, options) {
22
- var pks = assign({}, packages, additionalPackages);
23
-
24
- return new BpmnModdle(pks, options);
25
- }