You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`npm run lint`| Does a check with [ESLint](./.eslintrc)|
12
+
|`npm run types`| Generates type definitions from JSDoc and does a typecheck |
13
+
14
+
## 🚚 Continuous deployment
15
+
16
+
This repo [uses conventional commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) to automate releases with [Semantic Release][semantic-release].
|`fix: update a non-development dependency`| Patch. Bugfix release, updates for runtime dependencies. |
23
+
|`feat: added a new option Foo`| Minor. New feature release. |
24
+
|`refactor: removed a deprecated option Bar`<br><br>`BREAKING CHANGE: The Bar option has been removed.`| Major. Breaking release, like removing an option.<br /> (Note that the `BREAKING CHANGE: ` token must be in the footer of the commit) |
When making larger changes that needs thorough testing or modules widely used, you can create a `next` release. Here is how:
32
+
33
+
1. Create a branch `next` if one does not exist
34
+
2. Make changes (or push whatever changes you have on a different branch onto `next`)
35
+
3. When you are done, commit your changes with semantic-release in mind
36
+
4. The workflows will run and publish a new version on the format: `major.minor.patch-next.<nextversion>
37
+
Where `next version` is incremented each time you push a feat, fix or patch to the branch.
38
+
39
+
### GitHub Actions
40
+
41
+
GitHub Actions workflows:
42
+
43
+
-[Build and test pull requests](./.github/workflows/pull-request.yml)
44
+
-[Build and release changes on `main`](./.github/workflows/release.yml)
45
+
46
+
You'll find the workflow logs and results in the Actions tab.
47
+
48
+
## On MessageBus
49
+
50
+
MessageBus uses a global singleton to coordinate message passing between different instances. This is something you need to be aware of, for instance, if writing unit tests. See [MessageBus.test.js](test/MessageBus.test.js) for an example.
Get the latest event for a channel and topic combination.
118
123
@@ -123,7 +128,7 @@ This method takes the following arguments:
123
128
| channel |`null`|`string`|`true`| Name of the channel |
124
129
| topic |`null`|`string`|`true`| Name of the topic |
125
130
126
-
#### .log(channel, topic)
131
+
#### `.log(channel, topic)`
127
132
128
133
Returns an array of the 10 latest events for a channel and topic combination.
129
134
The array is ordered such that the the latest/newest events is at the front of the array.
@@ -140,33 +145,7 @@ Example:
140
145
```javascript
141
146
constevents=messageBus.log('channel', 'topic');
142
147
143
-
events.forEach(event=> {
148
+
events.forEach((event)=> {
144
149
console.log(event.payload);
145
150
});
146
151
```
147
-
148
-
### Implementation
149
-
150
-
MessageBus uses a global singleton to coordinate message passing between different instances. This is something you need to be aware of, for instance, if writing unit tests. See [MessageBus.test.js](test/MessageBus.test.js) for an example.
151
-
152
-
## License
153
-
154
-
Copyright (c) 2019 FINN.no
155
-
156
-
Permission is hereby granted, free of charge, to any person obtaining a copy
157
-
of this software and associated documentation files (the "Software"), to deal
158
-
in the Software without restriction, including without limitation the rights
159
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
160
-
copies of the Software, and to permit persons to whom the Software is
161
-
furnished to do so, subject to the following conditions:
162
-
163
-
The above copyright notice and this permission notice shall be included in all
164
-
copies or substantial portions of the Software.
165
-
166
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
167
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
168
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
169
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
170
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
171
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
0 commit comments