Skip to content

Commit 8b2de15

Browse files
authored
Merge pull request #2 from flow-build/feature/DAT-386
Feature/DAT-386
2 parents bfd2476 + f8f2f54 commit 8b2de15

Some content is hidden

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

43 files changed

+2959
-1192
lines changed

.eslintrc.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,16 @@
3131
"rules": {
3232
"prettier/prettier": "error",
3333
"linebreak-style": ["error", "unix"],
34-
"max-len": ["error", { "code": 80, "ignoreUrls": true }],
34+
"max-len": [
35+
"error",
36+
{
37+
"code": 80,
38+
"ignoreStrings": true,
39+
"ignoreComments": true,
40+
"ignoreRegExpLiterals": true,
41+
"ignorePattern": "^\\s*\\w+\\s*\\(.*\\).+;$"
42+
}
43+
],
3544
"import-helpers/order-imports": [
3645
"error",
3746
{

.github/workflows/main.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,16 @@ jobs:
77
runs-on: ${{ matrix.os }}
88
strategy:
99
matrix:
10-
node: ['10.x', '12.x', '14.x']
10+
node: ['18.x']
1111
os: [ubuntu-latest, windows-latest, macOS-latest]
1212

1313
steps:
1414
- name: Checkout repo
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@v3
16+
with:
17+
fetch-depth: 0
18+
ref: ${{github.event.pull_request.head.ref}}
19+
repository: ${{github.event.pull_request.head.repo.full_name}}
1620

1721
- name: Use Node ${{ matrix.node }}
1822
uses: actions/setup-node@v1
@@ -25,8 +29,5 @@ jobs:
2529
- name: Lint
2630
run: yarn lint
2731

28-
- name: Test
29-
run: yarn test --ci --coverage --maxWorkers=2
30-
3132
- name: Build
3233
run: yarn build

.github/workflows/size.yml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,26 @@ name: size
22
on: [pull_request]
33
jobs:
44
size:
5-
runs-on: ubuntu-latest
5+
name: Verify size limit, on Node ${{ matrix.node }} and ${{ matrix.os }}
6+
runs-on: ${{ matrix.os }}
7+
strategy:
8+
matrix:
9+
node: ['18.x']
10+
os: [ubuntu-latest, windows-latest, macOS-latest]
611
env:
712
CI_JOB_NUMBER: 1
813
steps:
9-
- uses: actions/checkout@v1
14+
- uses: actions/checkout@v3
15+
with:
16+
fetch-depth: 0
17+
ref: ${{github.event.pull_request.head.ref}}
18+
repository: ${{github.event.pull_request.head.repo.full_name}}
19+
20+
- name: Use Node ${{ matrix.node }}
21+
uses: actions/setup-node@v1
22+
with:
23+
node-version: ${{ matrix.node }}
24+
1025
- uses: andresz1/size-limit-action@v1
1126
with:
1227
github_token: ${{ secrets.GITHUB_TOKEN }}

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
node_modules
44
.cache
55
dist
6+
esbuild-why*.html
7+
.npmrc

.npmrc

Whitespace-only changes.
File renamed without changes.

app/examples/Basic/Basic.tsx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import * as React from 'react';
2+
import { Provider } from 'react-redux';
3+
4+
import { WorkflowManager, WorkflowManagerConfig } from '../../../dist';
5+
import { Child } from './Child';
6+
import { store } from './store';
7+
8+
WorkflowManagerConfig.setStore(store);
9+
10+
export const Basic: React.FC = () => {
11+
return (
12+
<Provider store={store}>
13+
<WorkflowManager
14+
brokerUrl="ws://broker.mqttdashboard.com:8000/mqtt"
15+
options={{
16+
clientId: `clientId-${Math.random().toString(36).substring(2, 9)}`,
17+
keepalive: 60,
18+
}}
19+
>
20+
<Child />
21+
</WorkflowManager>
22+
</Provider>
23+
);
24+
};

app/examples/Basic/Child.tsx

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import * as React from 'react';
2+
3+
import { useMqtt, useSubscribe } from '../../../dist';
4+
import { processTopic, actorTopic } from './constants';
5+
6+
export const Child: React.FC = () => {
7+
const { status, error } = useMqtt();
8+
const subscribe = useSubscribe();
9+
10+
React.useEffect(() => {
11+
if (status === 'connected') subscribe([processTopic, actorTopic]);
12+
}, [subscribe, status]);
13+
14+
return (
15+
<main>
16+
<h1>This is a basic example</h1>
17+
<p>
18+
<b>Mqtt status: </b>
19+
{status}
20+
</p>
21+
<p>
22+
<b>Error: </b>
23+
{String(error)}
24+
</p>
25+
</main>
26+
);
27+
};

app/examples/Basic/constants.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
export const processTopic =
2+
'/process/7179b2f3-5236-4917-8164-f02fc43cfb07/am/create';
3+
export const actorTopic =
4+
'/actor/ed3772f4-200a-41bf-907d-4e4581236daf/am/create';

app/examples/Basic/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export * from './Basic';

0 commit comments

Comments
 (0)