Skip to content

Commit c62f844

Browse files
chore(project): initial commit
related to CAM-4058
0 parents  commit c62f844

24 files changed

+1495
-0
lines changed

.gitignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
node_modules/
2+
bower_components/
3+
tmp/
4+
docs/api/
5+
dist/
6+
.idea
7+
*.iml
8+
.DS_Store
9+
npm-debug.log

.jshintrc

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"browser": true,
3+
"node": true,
4+
"strict": true,
5+
"unused": "vars",
6+
"maxlen": 120,
7+
"globals": {
8+
"describe": false,
9+
"it": false,
10+
"expect": true,
11+
"beforeEach": true,
12+
"afterEach": true,
13+
"console": true,
14+
"spyOn": true,
15+
"jasmine": true
16+
}
17+
}

CONTRIBUTING.md

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# How to contribute
2+
3+
We love you to contribute to this project by filing bugs, helping others on the [issue tracker](https://github.com/bpmn-io/bpmn-js/issues), by contributing features/bug fixes through pull requests or by helping out in our [forums](https://forum.bpmn.io/).
4+
5+
6+
## Creating issues
7+
8+
We use our [issue tracker](https://github.com/bpmn-io/bpmn-js/issues) for project communication.
9+
When using the issue tracker:
10+
11+
* Be descriptive when creating an issue (what, where, when and how does a problem pop up)?
12+
* Attach steps to reproduce (if applicable)
13+
* Attach code samples, configuration options or stack traces that may indicate a problem
14+
* Be helpful and respect others when commenting
15+
16+
Create a pull request if you would like to have an in-depth discussion about some piece of code.
17+
18+
19+
## Setting up the project locally
20+
21+
The project development runs on top of the [diagram-js](https://github.com/bpmn-io/diagram-js) master branch. The following code snippet sets up both libraries linking diagram-js to bpmn-js.
22+
23+
mkdir bpmn.io
24+
cd bpmn.io
25+
26+
git clone [email protected]:bpmn-io/diagram-js.git
27+
(cd diagram-js && npm i)
28+
29+
git clone [email protected]:bpmn-io/bpmn-js.git
30+
(cd bpmn-js && npm install && npm link ../diagram-js)
31+
32+
// Run the test suite
33+
grunt
34+
35+
// Running the test suite with every file change
36+
TEST_BROWSERS=(Chrome|Firefox|IE) grunt auto-test
37+
38+
39+
## Creating pull requests
40+
41+
We use pull requests for feature discussion and bug fixes. If you are not yet familiar on how to create a pull request, [read this great guide](https://gun.io/blog/how-to-github-fork-branch-and-pull-request).
42+
43+
Some things that make it easier for us to accept your pull requests
44+
45+
* The code adheres to our conventions
46+
* spaces instead of tabs
47+
* single-quotes
48+
* ...
49+
* The code is tested
50+
* The `grunt` build passes (executes tests + linting)
51+
* The work is combined into a single commit
52+
* The commit messages adhere to our [guideline](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y)
53+
54+
55+
We'd be glad to assist you if you do not get these things right in the first place.

Gruntfile.js

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
'use strict';
2+
3+
module.exports = function(grunt) {
4+
5+
require('load-grunt-tasks')(grunt);
6+
require('time-grunt')(grunt);
7+
8+
/* global process */
9+
10+
// configures browsers to run test against
11+
// any of [ 'PhantomJS', 'Chrome', 'Firefox', 'IE']
12+
var TEST_BROWSERS = ((process.env.TEST_BROWSERS || '').replace(/^\s+|\s+$/, '') || 'PhantomJS').split(/\s*,\s*/g);
13+
14+
// project configuration
15+
grunt.initConfig({
16+
17+
pkg: grunt.file.readJSON('package.json'),
18+
19+
config: {
20+
sources: 'lib',
21+
tests: 'test',
22+
dist: '../bower-bpmn-js/dist'
23+
},
24+
25+
jshint: {
26+
src: [
27+
['<%=config.sources %>']
28+
],
29+
options: {
30+
jshintrc: true
31+
}
32+
},
33+
34+
release: {
35+
options: {
36+
tagName: 'v<%= version %>',
37+
commitMessage: 'chore(project): release v<%= version %>',
38+
tagMessage: 'chore(project): tag v<%= version %>'
39+
}
40+
},
41+
42+
karma: {
43+
options: {
44+
configFile: '<%= config.tests %>/config/karma.unit.js'
45+
},
46+
single: {
47+
singleRun: true,
48+
autoWatch: false,
49+
50+
browsers: TEST_BROWSERS
51+
},
52+
unit: {
53+
browsers: TEST_BROWSERS
54+
}
55+
},
56+
57+
jsdoc: {
58+
dist: {
59+
src: [ '<%= config.sources %>/**/*.js' ],
60+
options: {
61+
destination: 'docs/api',
62+
plugins: [ 'plugins/markdown' ]
63+
}
64+
}
65+
}
66+
});
67+
// tasks
68+
69+
grunt.registerTask('test', [ 'karma:single' ]);
70+
71+
grunt.registerTask('auto-test', [ 'karma:unit' ]);
72+
73+
grunt.registerTask('build', [ 'bundle' ]);
74+
75+
grunt.registerTask('default', [ 'jshint', 'test', 'build', 'jsdoc' ]);
76+
};

LICENSE

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
Copyright (c) 2015 camunda services GmbH
2+
3+
Permission is hereby granted, free of charge, to any person obtaining a copy of
4+
this software and associated documentation files (the "Software"), to deal in the
5+
Software without restriction, including without limitation the rights to use, copy,
6+
modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
7+
and to permit persons to whom the Software is furnished to do so, subject to the
8+
following conditions:
9+
10+
The above copyright notice and this permission notice shall be included in all
11+
copies or substantial portions of the Software.
12+
13+
The source code responsible for displaying the bpmn.io logo (two green cogwheels in
14+
a box) that links back to http://bpmn.io as part of rendered diagrams MUST NOT be
15+
removed or changed.
16+
17+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
18+
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
19+
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
21+
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
22+
OR OTHER DEALINGS IN THE SOFTWARE.

README.md

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# dmn-js - DMN for the web
2+
3+
[dmn-js](https://github.com/dmn-io/dmn-js) is a DMN modeling and rendering toolkit.
4+
5+
6+
> the project is still in an early stage. Documentation may be missing and examples may be broken.
7+
8+
9+
## Usage
10+
11+
```javascript
12+
var DmnViewer = require('dmn-js');
13+
14+
var xml; // my DMN xml
15+
var viewer = new DmnViewer({ container: 'body' });
16+
17+
viewer.importXML(xml, function(err) {
18+
19+
if (err) {
20+
console.log('error rendering', err);
21+
} else {
22+
console.log('rendered');
23+
}
24+
});
25+
```
26+
27+
## Resources
28+
29+
* [Issues](https://github.com/dmn-io/dmn-js/issues)
30+
31+
## Tools
32+
33+
dmn-js builds on top of a few additional powerful tools
34+
35+
* [dmn-moddle](https://github.com/dmn-io/dmn-moddle): Read / write support for DMN XML in the browsers
36+
* [table-js](https://github.com/dmn-io/table-js): Table rendering and editing toolkit
37+
38+
39+
## Building the Project
40+
41+
As long as the project is in alpha stage, you must make sure you setup the whole development environment, including a number of [project dependencies](https://github.com/dmn-io) according to [our development setup](https://github.com/dmn-io/dmn-js/blob/master/docs/project/SETUP.md).
42+
43+
44+
## License
45+
46+
Use under the terms of the [bpmn-js license](http://bpmn.io/license).

docs/project/COMMIT_MESSAGES.md

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
# Commit Messages
2+
3+
Contributors should adhere to our [commit message guidelines](https://docs.google.com/document/d/1QrDFcIiPjSLDn3EL15IJygNPiHORgU1_OOAqWjiDU5Y/edit?pli=1).
4+
5+
The goal is to achive better readability of the projects commit log and eventually use the log as a low level change tracker.
6+
7+
```plain
8+
feat(context-pad): add delete button
9+
fix(modeling): assign valid semantic ids
10+
fix(Viewer): correctly fire imported event
11+
fix(core): handle missing DMNTable during import
12+
```
13+
14+
It is important for [semantic versioning](http://semver.org/) during releases and for project change tracking.
15+
16+
17+
## General Syntax
18+
19+
```plain
20+
<what>(<component>): <present-tense-description>
21+
22+
<longer-description>
23+
24+
Closes #<issue-number>
25+
26+
[BREAKING CHANGE:
27+
28+
* migration notes ]
29+
```
30+
31+
32+
## Hints
33+
34+
Consider the following hints when writing commit messages
35+
36+
* Classify what you did
37+
38+
* `fix` commit fixes a bug, patches the project
39+
* `feat` commit adds a feature, increases the minor version
40+
* `docs` commit improves or adds documentation
41+
* `refactor` commit cleans up mess in a non-api-breaking manner
42+
43+
* State the module your change applies to
44+
45+
* `viewer` commit changes viewer code
46+
* `context-pad` commit alters context pad
47+
* `modeling/DmnFactory` commit fixes a specific bug in the `DmnFactory` (use in rare important cases only)
48+
* use lower case for modules, camelCase for files (according to file names)
49+
50+
* beware of public api (everything that has been blogged about on the [camunda team blog](http://blog.camunda.org/))
51+
52+
* mark breaking public api via `BREAKING CHANGE: ...`
53+
54+
* try not to swallow bug fixes (`fix`) in feature commits (`feat`). People may wait for a fixes forever.
55+
56+
57+
## Examples
58+
59+
```plain
60+
feat(modeler): add create table option
61+
62+
This commit adds the ability to create a new table in the modeler via
63+
64+
Modeler#createTable(done)
65+
66+
Related to #12
67+
```
68+
69+
70+
```plain
71+
fix(modeling): generate valid semantic ids
72+
73+
IDs in XML documents must not start with a number as per XML spec.
74+
75+
This commit changes our id generation behavior to use semantic ids that
76+
are prefixed with the elements type (never starts with a number):
77+
78+
Before: asdas123se8as
79+
Now: Rule_asdas123se8as
80+
81+
Closes #108
82+
```

docs/project/SETUP.md

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# Project Setup
2+
3+
This document describes the necessary steps to setup a `dmn-js` development environment.
4+
5+
Make sure you have [git](http://git-scm.com/), [NodeJS](nodejs.org) and [npm](https://www.npmjs.org/doc/cli/npm.html) installed before you continue.
6+
7+
8+
### Get Project + Dependencies
9+
10+
The following projects from the [dmn-io](https://github.com/dmn-io) and [bpmn-io](https://github.com/bpmn-io) projects on GitHub
11+
12+
* [dmn-js](https://github.com/dmn-io/dmn-js)
13+
* [table-js](https://github.com/dmn-io/table-js)
14+
* [dmn-moddle](https://github.com/dmn-io/dmn-moddle)
15+
* [moddle](https://github.com/bpmn-io/moddle)
16+
* [moddle-xml](https://github.com/bpmn-io/moddle-xml)
17+
18+
and clone them into a common directory via
19+
20+
```
21+
git clone [email protected]:bpmn-io/PROJECT_NAME.git
22+
```
23+
24+
or
25+
26+
```
27+
git clone [email protected]:dmn-io/PROJECT_NAME.git
28+
```
29+
30+
31+
### Link Projects
32+
33+
[Link dependent projects](http://blog.nodejs.org/2011/04/06/npm-1-0-link/) between each other to pick up changes immediately.
34+
35+
```
36+
.
37+
├─dmn-js
38+
│ └─node_modules
39+
│ ├─table-js <link>
40+
│ ├─moddle <link>
41+
│ └─dmn-moddle <link>
42+
├─dmn-moddle
43+
│ └─node_modules
44+
│ ├─moddle <link>
45+
│ └─moddle-xml <link>
46+
├─table-js
47+
├─moddle
48+
└─moddle-xml
49+
└─node_modules
50+
└─moddle <link>
51+
```
52+
53+
#### On Linux
54+
55+
Use [npm-link](https://www.npmjs.org/doc/link.html) or `ln -s <target> <link>`.
56+
57+
#### On Windows
58+
59+
Use `mklink /d <link> <target>` [(docs)](http://technet.microsoft.com/en-us/library/cc753194.aspx).
60+
61+
62+
### Install Dependencies
63+
64+
Execute `npm install` on each of the projects to grab their dependencies.
65+
66+
67+
### Verify Things are O.K.
68+
69+
Execute `grunt` on each project. Things should be fine.

index.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = require('./lib/Viewer');

0 commit comments

Comments
 (0)