Skip to content

Commit 521ffe4

Browse files
authored
0.3.0. (#9)
1 parent 9b271d2 commit 521ffe4

Some content is hidden

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

48 files changed

+531
-378
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ on:
33
push:
44
branches:
55
- main
6+
- develop
67
jobs:
78
build:
89
name: Build

.gitignore

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1+
.yarn/
12
build/
23
node_modules/
34
coverage/
45
.vscode/
5-
designer.js
6-
designer.d.ts
7-
designer.js.map
8-
6+
lib/
7+
dist/

CHANGELOG.md

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,43 @@
11
## 0.3.0
22

3-
This version introduces component extensions. By this it's possible to create own components. Breaking changes:
4-
5-
* Static method `Designer.utils.getParents()` is deleted. You should use the `getStepParents()` method from the `Designer` class. Example: `designer.getStepParents(needleStep)`
6-
* The `ComponentType` is not an enum anymore. It's type (`string`). This change doesn't affect serialized JSONs.
3+
This version introduces new build formats (ESM, UMD) of the package.
4+
5+
🤩 For more advanced use cases we prepared **the paid pro package**. The package is in the early stage. Currently it contains advanced components for steps. [Here](https://github.com/nocode-js/sequential-workflow-designer-pro-demo) you can find more information and examples.
6+
7+
#### Breaking Changes
8+
9+
* Default export of the `Designer` class is removed. Now you should import directly the `Designer` class.
10+
```ts
11+
import { Designer } from 'sequential-workflow-designer';
12+
Designer.create(/* ... */);
13+
```
14+
15+
This affects CDN usage too.
16+
17+
```html
18+
<script src="https://cdn.jsdelivr.net/..."></script>
19+
<script>
20+
sequentialWorkflowDesigner.Designer.create(/* ... */);
21+
</script>
22+
```
23+
* The package now contains two type of build: ESM and UMD. ESM build is located in the `lib` folder. UMD build is located in the `dist` folder. That means the URL to the CDN is also changed.
24+
25+
```html
26+
<script src="https://cdn.jsdelivr.net/.../dist/index.umd.js"></script>
27+
```
28+
* Static method `Designer.utils.nextId()` is deleted. You should use the `next()` from the `Uid` class. Example:
29+
30+
```ts
31+
import { Uid } from 'sequential-workflow-designer';
32+
Uid.next();
33+
```
34+
35+
* Static method `Designer.utils.getParents()` is deleted. You should use the `getStepParents()` method from the `Designer` class. Example:
36+
37+
```ts
38+
designer.getStepParents(needleStep);
39+
```
40+
* The `ComponentType` is not an enum anymore. It's a type (`string`). This change doesn't affect serialized JSONs.
741

842
## 0.2.3
943

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2022 Bartlomiej Tadych
3+
Copyright (c) 2022 N4NO.com
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
66

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Sequential Workflow Designer
44

5-
[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fb4rtaz%2Fsequential-workflow-designer%2Fbadge%3Fref%3Dmain&style=flat-square)](https://actions-badge.atrox.dev/b4rtaz/sequential-workflow-designer/goto?ref=main) [![License: MIT](https://img.shields.io/github/license/mashape/apistatus.svg)](/LICENSE) [![View this project on NPM](https://img.shields.io/npm/v/sequential-workflow-designer.svg)](https://npmjs.org/package/sequential-workflow-designer) [![Twitter: b4rtaz](https://img.shields.io/twitter/follow/b4rtaz.svg?style=social)](https://twitter.com/b4rtaz)
5+
[![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Fb4rtaz%2Fsequential-workflow-designer%2Fbadge%3Fref%3Dmain&style=flat-square)](https://actions-badge.atrox.dev/b4rtaz/sequential-workflow-designer/goto?ref=main) [![License: MIT](https://img.shields.io/github/license/mashape/apistatus.svg)](/LICENSE) [![View this project on NPM](https://img.shields.io/npm/v/sequential-workflow-designer.svg)](https://npmjs.org/package/sequential-workflow-designer)
66

77
Sequential workflow designer with no dependencies for web. It's written in pure TypeScript and uses SVG for rendering. This designer is not associated with any workflow engine. It's full generic. You may create any kind application by this, from graphical programming languages to workflow designers.
88

@@ -37,7 +37,7 @@ Install this package by [NPM](https://www.npmjs.com/) command:
3737
To import the package:
3838

3939
```ts
40-
import Designer from 'sequential-workflow-designer';
40+
import { Designer } from 'sequential-workflow-designer';
4141
```
4242

4343
If you use [css-loader](https://webpack.js.org/loaders/css-loader/) or similar, you can add CSS files to your boundle:
@@ -62,24 +62,24 @@ Add the below code to your head section in HTML document.
6262
```html
6363
<head>
6464
...
65-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.2.3/css/designer.css" rel="stylesheet">
66-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.2.3/css/designer-light.css" rel="stylesheet">
67-
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.2.3/css/designer-dark.css" rel="stylesheet">
68-
<script src="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.2.3/lib/designer.js"></script>
65+
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.3.0/css/designer.css" rel="stylesheet">
66+
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.3.0/css/designer-light.css" rel="stylesheet">
67+
<link href="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.3.0/css/designer-dark.css" rel="stylesheet">
68+
<script src="https://cdn.jsdelivr.net/npm/sequential-workflow-designer@0.3.0/dist/index.umd.js"></script>
6969
```
7070

7171
Call the designer by:
7272

7373
```js
74-
sequentialWorkflowDesigner.create(placeholder, definition, configuration);
74+
sequentialWorkflowDesigner.Designer.create(placeholder, definition, configuration);
7575
```
7676

7777
## 🎬 Usage
7878

7979
Check [examples](/examples) directory.
8080

8181
```ts
82-
import Designer from 'sequential-workflow-designer';
82+
import { Designer } from 'sequential-workflow-designer';
8383

8484
const placeholder = document.getElementById('placeholder');
8585

designer/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
README.md
2+
LICENSE

designer/package.json

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
{
22
"name": "sequential-workflow-designer",
3-
"version": "0.2.3",
4-
"main": "./lib/designer.js",
5-
"types": "./lib/designer.d.ts",
3+
"version": "0.3.0",
4+
"main": "./lib/index.mjs",
5+
"types": "./lib/index.d.ts",
66
"repository": {
77
"type": "git",
8-
"url": "https://github.com/b4rtaz/sequential-workflow-designer.git"
8+
"url": "https://github.com/nocode-js/sequential-workflow-designer.git"
99
},
1010
"files": [
1111
"lib/",
12+
"dist/",
1213
"css/"
1314
],
1415
"publishConfig": {
1516
"registry": "https://registry.npmjs.org/"
1617
},
1718
"scripts": {
19+
"prepare": "cp ../LICENSE LICENSE && cp ../README.md README.md",
1820
"start": "rollup -c --watch",
1921
"start:clean": "rm -rf lib && rm -rf build && npm run start",
2022
"build": "rollup -c",
@@ -24,23 +26,23 @@
2426
"prettier": "prettier --check ./src",
2527
"prettier:fix": "prettier --write ./src"
2628
},
27-
"author": "b4rtaz",
29+
"author": "N4NO.com",
2830
"license": "MIT",
2931
"devDependencies": {
30-
"@types/jasmine": "^4.0.3",
31-
"@typescript-eslint/eslint-plugin": "^5.40.0",
32-
"@typescript-eslint/parser": "^5.40.0",
33-
"eslint": "^8.25.0",
34-
"karma": "^6.3.20",
32+
"@types/jasmine": "^4.3.1",
33+
"@typescript-eslint/eslint-plugin": "^5.47.0",
34+
"@typescript-eslint/parser": "^5.47.0",
35+
"eslint": "^8.30.0",
36+
"karma": "^6.4.1",
3537
"karma-chrome-launcher": "^3.1.1",
36-
"karma-jasmine": "^5.0.1",
37-
"karma-spec-reporter": "^0.0.34",
38+
"karma-jasmine": "^5.1.0",
39+
"karma-spec-reporter": "^0.0.36",
3840
"karma-typescript": "^5.5.3",
39-
"prettier": "^2.6.2",
40-
"rollup": "^2.75.3",
41-
"rollup-plugin-dts": "^4.2.2",
41+
"prettier": "^2.8.1",
42+
"rollup": "^3.7.5",
43+
"rollup-plugin-dts": "^5.0.0",
4244
"rollup-plugin-typescript2": "^0.34.1",
43-
"typescript": "^4.8.4"
45+
"typescript": "^4.9.4"
4446
},
4547
"keywords": [
4648
"workflow",

designer/rollup.config.js

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

designer/rollup.config.mjs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import dts from 'rollup-plugin-dts';
2+
import typescript from 'rollup-plugin-typescript2';
3+
4+
const ts = typescript({
5+
useTsconfigDeclarationDir: true
6+
});
7+
8+
export default [
9+
{
10+
input: './src/index.ts',
11+
plugins: [ts],
12+
output: [
13+
{
14+
file: './lib/index.mjs',
15+
format: 'es'
16+
}
17+
]
18+
},
19+
{
20+
input: './src/index.ts',
21+
plugins: [ts],
22+
output: [
23+
{
24+
file: './dist/index.umd.js',
25+
format: 'umd',
26+
name: 'sequentialWorkflowDesigner'
27+
}
28+
]
29+
},
30+
{
31+
input: './build/index.d.ts',
32+
output: [
33+
{
34+
file: './lib/index.d.ts',
35+
format: 'es'
36+
}
37+
],
38+
plugins: [dts()],
39+
}
40+
];

designer/src/core/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export * from './dom';
2+
export * from './vector';
3+
export * from './uid';

0 commit comments

Comments
 (0)