Skip to content

Commit 4928cba

Browse files
authored
Merge pull request #319 from Roaders/main
Update build process / refine adaptor interface
2 parents 305c314 + 7bb7397 commit 4928cba

40 files changed

+5605
-848
lines changed

.editorconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
trim_trailing_whitespace = true
8+
indent_style = space
9+
indent_size = 2
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.{yml,yaml}]
15+
indent_size = 2
16+
17+
[*.ts]
18+
indent_size = 2

.gitattributes

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Auto-detect text files and normalize
2+
* text=auto
3+
4+
# Force LF for common text files
5+
*.js text eol=lf
6+
*.cjs text eol=lf
7+
*.mjs text eol=lf
8+
*.ts text eol=lf
9+
*.tsx text eol=lf
10+
*.jsx text eol=lf
11+
*.json text eol=lf
12+
*.html text eol=lf
13+
*.css text eol=lf
14+
*.scss text eol=lf
15+
*.md text eol=lf
16+
*.yml text eol=lf
17+
*.yaml text eol=lf
18+
*.sh text eol=lf
19+
20+
# Binary files
21+
*.png binary
22+
*.jpg binary
23+
*.jpeg binary
24+
*.gif binary
25+
*.ico binary
26+
*.pdf binary
27+
*.zip binary
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Build with latest dependencies
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
workflow_dispatch:
9+
10+
jobs:
11+
build:
12+
runs-on: ubuntu-latest
13+
14+
strategy:
15+
matrix:
16+
node-version: [20.x, 22.x, 24.x]
17+
18+
steps:
19+
- uses: actions/checkout@v5
20+
- name: Use Node.js ${{ matrix.node-version }}
21+
uses: actions/setup-node@v6
22+
with:
23+
node-version: ${{ matrix.node-version }}
24+
- run: npm ci
25+
- run: npm uninstall rxjs @morgan-stanley/needle uuid
26+
- run: npm install rxjs@^7 @morgan-stanley/needle@^0 uuid@^13
27+
- run: npm ls @morgan-stanley/needle uuid rxjs
28+
- run: npm run build:release

.github/workflows/build.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,5 @@ jobs:
2121
uses: actions/setup-node@v6
2222
with:
2323
node-version: ${{ matrix.node-version }}
24-
- run: npm install
25-
- run: npm run build-release
26-
- run: npm run lint
27-
- run: npm run test
24+
- run: npm ci
25+
- run: npm run build:release

.github/workflows/release.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ jobs:
2727
node-version: '24'
2828

2929
- name: Install node modules and verify build
30-
run: npm install && npm run build-release
31-
32-
- name: Lint and test
33-
run: npm run lint && npm run test
30+
run: npm ci && npm run build:release
3431

3532
- name: Publish
3633
run: npm publish --provenance --access public

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ reports/
66
*.tgz
77
npm-debug.log
88
npm
9-
/package-lock.json
9+
coverage/

CHANGELOG.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on Keep a Changelog and this project follows [Semantic Versioning](https://semver.org/).
6+
7+
## [2.0.0] - 2025-11-21
8+
9+
### Breaking
10+
11+
- remove `rsvp` support from `IMessageBroker`
12+
- renamed all `RSVP` interfaces
13+
- tightened interfaces for definition of messaging channels for `IMessageBroker` and `IMessageBrokerAdapter`
14+
- removed `initialize` from `IMessageBrokerAdapter`
15+
- moved library to ESM
16+
17+
### Added
18+
- Added `createMessage` function to `IMessageBroker`
19+
- message broker now calls `connect` and `disconnect` on registered adapters
20+
- added `ResponseBroker` in place of old rsvp functionality:
21+
22+
```ts
23+
24+
interface IMyAppResponseChannels {
25+
channelOne: {
26+
payload: MyCustomPayloadOne;
27+
response: MyCustomResponseOne;
28+
}
29+
channelTwo: {
30+
payload: MyCustomPayloadTwo;
31+
response: MyCustomResponseTwo;
32+
}
33+
}
34+
35+
const responseBroker = new ResponseBroker<IMyAppResponseChannels>();
36+
37+
// listen for response requests
38+
39+
responseBroker.registerResponder("channelOne", (payload: MyCustomPayloadOne) => {
40+
const response: MyCustomResponseOne = generateResponse();
41+
42+
return response;
43+
});
44+
45+
// collate responses from multiple registered responders
46+
47+
const payload: MyCustomPayloadOne = generatePayload();
48+
49+
const result: ResponseReply<MyCustomResponseOne>[] = responseBroker.collate("channelOne", payload);
50+
51+
```
52+
53+

eslint.config.js

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

eslint.config.ts

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import eslint from '@eslint/js';
2+
import { defineConfig } from 'eslint/config';
3+
import prettierPlugin from 'eslint-plugin-prettier';
4+
import simpleImportSort from 'eslint-plugin-simple-import-sort';
5+
import unusedImports from 'eslint-plugin-unused-imports';
6+
import tseslint from 'typescript-eslint';
7+
8+
const prettierConfig = {
9+
trailingComma: 'all',
10+
tabWidth: 4,
11+
singleQuote: true,
12+
printWidth: 120,
13+
};
14+
15+
export default defineConfig(
16+
{
17+
ignores: ['**/dist/', '**/reports/', '**/docs/', '**/site/'],
18+
},
19+
eslint.configs.recommended,
20+
tseslint.configs.recommended,
21+
22+
{
23+
plugins: {
24+
prettier: prettierPlugin,
25+
'simple-import-sort': simpleImportSort,
26+
'unused-imports': unusedImports,
27+
},
28+
29+
rules: {
30+
'@typescript-eslint/explicit-module-boundary-types': 'off',
31+
'@typescript-eslint/no-explicit-any': 'off',
32+
'@typescript-eslint/no-unused-vars': 'off',
33+
'@typescript-eslint/no-this-alias': 'off',
34+
'simple-import-sort/imports': 'error',
35+
'unused-imports/no-unused-imports': 'error',
36+
'prettier/prettier': ['error', prettierConfig],
37+
},
38+
},
39+
);

0 commit comments

Comments
 (0)