bpmnlint 8.1.0 → 8.2.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/README.md CHANGED
@@ -37,7 +37,7 @@ Validate your diagrams via the commandline:
37
37
 
38
38
  Our [documentation](https://github.com/bpmn-io/bpmnlint/tree/master/docs/rules#rules) lists all currenty implemented rules, the [`./rules` folder](https://github.com/bpmn-io/bpmnlint/tree/master/rules) contains each rules implementation.
39
39
 
40
- Do you miss a rule that should be included? [Propose a new rule](https://github.com/bpmn-io/bpmnlint/issues/new?template=NEW_RULE.md).
40
+ Do you miss a rule that should be included? [Propose a new rule](https://github.com/bpmn-io/bpmnlint/issues/new?assignees=&labels=rules&template=NEW_RULE.md).
41
41
 
42
42
 
43
43
  ## Configuration
@@ -62,6 +62,63 @@ Add or customize rules using the `rules` block:
62
62
  ```
63
63
 
64
64
 
65
+ ## API
66
+
67
+ Invoke the tool directly from [NodeJS](https://nodejs.org/en):
68
+
69
+ ```javascript
70
+ import Linter from 'bpmnlint';
71
+ import NodeResolver from 'bpmnlint/lib/resolver/node-resolver';
72
+
73
+ import BpmnModdle from 'bpmn-moddle';
74
+
75
+ const linter = new Linter({
76
+ config: {
77
+ extends: 'bpmnlint:recommended'
78
+ },
79
+ resolver: new NodeResolver()
80
+ });
81
+
82
+ const xmlStr = `
83
+ <?xml version="1.0" encoding="UTF-8"?>
84
+ <bpmn:definitions xmlns:bpmn="http://www.omg.org/spec/BPMN/20100524/MODEL"
85
+ id="definitions"
86
+ targetNamespace="http://bpmn.io/schema/bpmn">
87
+ <bpmn:process id="process" />
88
+ </bpmn:definitions>
89
+ `;
90
+
91
+ const {
92
+ rootElement: definitions
93
+ } = await moddle.fromXML(xmlStr);
94
+
95
+ const reports = linter.lint(definitions);
96
+
97
+ // {
98
+ // "end-event-required": [
99
+ // {
100
+ // "id": "process",
101
+ // "message": "Process is missing end event"
102
+ // }
103
+ // ],
104
+ // ...
105
+ // }
106
+ ```
107
+
108
+ For browser usage include your [linting configuration](#configuration) using your favorite bundler plug-in ([Rollup](https://www.npmjs.com/package/rollup-plugin-bpmnlint), [Webpack](https://www.npmjs.com/package/bpmnlint-loader)).
109
+
110
+
111
+ ## Writing a Plug-in
112
+
113
+ Create your first plug-in using the [plugin creator](https://github.com/nikku/create-bpmnlint-plugin):
114
+
115
+ ```sh
116
+ npm init bpmnlint-plugin {PLUGIN_NAME}
117
+ ```
118
+
119
+ Checkout the [bpmnlint-plugin-example](https://github.com/bpmn-io/bpmnlint-plugin-example) for details on how to define, test, and consume custom lint rules. Use the [bpmnlint playground](https://github.com/bpmn-io/bpmnlint-playground) to implement new rules with quick visual feedback.
120
+
121
+
65
122
  ## Visual Feedback
66
123
 
67
124
  Integrate the linter via [bpmn-js-bpmnlint](https://github.com/bpmn-io/bpmn-js-bpmnlint) into [bpmn-js](https://github.com/bpmn-io/bpmn-js) and get direct feedback during modeling.
@@ -69,13 +126,12 @@ Integrate the linter via [bpmn-js-bpmnlint](https://github.com/bpmn-io/bpmn-js-b
69
126
  To try out visual validation, checkout the [bpmnlint playground](https://github.com/bpmn-io/bpmnlint-playground).
70
127
 
71
128
 
72
- ## Writing / Consuming Custom Rules
73
-
74
- Use the [bpmnlint playground](https://github.com/bpmn-io/bpmnlint-playground) to implement new rules with quick visual feedback.
75
-
76
- Create your first plug-in using the [plugin creator](https://github.com/nikku/create-bpmnlint-plugin).
129
+ ## Related
77
130
 
78
- Checkout the [bpmnlint-plugin-example](https://github.com/bpmn-io/bpmnlint-plugin-example) for details on how to define, test, and consume custom lint rules.
131
+ * [bpmnlint-plugin-example](https://github.com/bpmn-io/bpmnlint-plugin-example) - an example plug-in
132
+ * [bpmnlint-playground](https://github.com/bpmn-io/bpmnlint-playground) - a playground to implement new rules with quick visual feedback
133
+ * [bpmnlint-generate-docs-images](https://github.com/bpmn-io/bpmnlint-generate-docs-images) - Generate images for your bpmnlint documentation
134
+ * [bpmn-js-bpmnlint](https://github.com/bpmn-io/bpmn-js-bpmnlint) - integration into [bpmn-js](https://github.com/bpmn-io/bpmn-js)
79
135
 
80
136
 
81
137
  ## License
@@ -16,6 +16,6 @@ module.exports = {
16
16
  'single-event-definition': 'error',
17
17
  'start-event-required': 'error',
18
18
  'sub-process-blank-start-event': 'error',
19
- 'superfluous-gateway': 'warning'
19
+ 'superfluous-gateway': 'warn'
20
20
  }
21
21
  };
package/lib/linter.js CHANGED
@@ -3,7 +3,8 @@ const testRule = require('./test-rule');
3
3
  const categoryMap = {
4
4
  0: 'off',
5
5
  1: 'warn',
6
- 2: 'error'
6
+ 2: 'error',
7
+ 3: 'info'
7
8
  };
8
9
 
9
10
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bpmnlint",
3
3
  "description": "Validate your BPMN diagrams based on configurable lint rules",
4
- "version": "8.1.0",
4
+ "version": "8.2.0",
5
5
  "main": "lib/index.js",
6
6
  "keywords": [
7
7
  "bpmnlint",
@@ -31,7 +31,8 @@
31
31
  "lint": "eslint .",
32
32
  "dev": "npm test -- --watch",
33
33
  "test": "mocha -r esm --exclude 'test/integration/cli/**' 'test/**/*.js'",
34
- "test-coverage": "nyc --reporter=lcov --reporter=html npm test"
34
+ "test-coverage": "nyc --reporter=lcov --reporter=html npm test",
35
+ "generate-docs-images": "npx @bpmn-io/bpmnlint-generate-docs-images ."
35
36
  },
36
37
  "bin": {
37
38
  "bpmnlint": "./bin/bpmnlint.js"