Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 4ab1b917a9 | |||
| f299cff4c9 | |||
| a6e262bbae | |||
| 8a8200ca8a | |||
| e7785cc31b | |||
| 63610b66bc | |||
| d8d382b2fb | |||
| 7c8a2eeaeb | |||
| a34e8f571d | |||
| 2bf398cf97 | |||
| 315bbffac2 | |||
| 52e77d1c3e | |||
| 9ac1fdbb63 | |||
| ac43f63daf |
@@ -36,6 +36,7 @@ auditProductionDependencies:
|
|||||||
- npmci command npm audit --audit-level=high --only=prod --production
|
- npmci command npm audit --audit-level=high --only=prod --production
|
||||||
tags:
|
tags:
|
||||||
- docker
|
- docker
|
||||||
|
allow_failure: true
|
||||||
|
|
||||||
auditDevDependencies:
|
auditDevDependencies:
|
||||||
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci
|
||||||
|
|||||||
23605
package-lock.json
generated
23605
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
18
package.json
18
package.json
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@designestate/dees-comms",
|
"name": "@designestate/dees-comms",
|
||||||
"version": "1.0.8",
|
"version": "1.0.15",
|
||||||
"private": false,
|
"private": false,
|
||||||
"description": "a comms module for communicating within the DOM",
|
"description": "a comms module for communicating within the DOM",
|
||||||
"main": "dist_ts/index.js",
|
"main": "dist_ts/index.js",
|
||||||
@@ -9,21 +9,21 @@
|
|||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "(tstest test/ --web)",
|
"test": "(tstest test/ --web)",
|
||||||
"build": "(tsbuild --web)"
|
"build": "(tsbuild --web && tsbundle npm)"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@gitzone/tsbuild": "^2.1.25",
|
"@gitzone/tsbuild": "^2.1.29",
|
||||||
"@gitzone/tsbundle": "^1.0.78",
|
"@gitzone/tsbundle": "^1.0.89",
|
||||||
"@gitzone/tstest": "^1.0.52",
|
"@gitzone/tstest": "^1.0.60",
|
||||||
"@pushrocks/tapbundle": "^3.2.9",
|
"@pushrocks/tapbundle": "^4.0.0",
|
||||||
"@types/node": "^14.14.14",
|
"@types/node": "^17.0.10",
|
||||||
"tslint": "^6.1.3",
|
"tslint": "^6.1.3",
|
||||||
"tslint-config-prettier": "^1.15.0"
|
"tslint-config-prettier": "^1.15.0"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apiglobal/typedrequest": "^1.0.56",
|
"@apiglobal/typedrequest": "^1.0.65",
|
||||||
"@apiglobal/typedrequest-interfaces": "^1.0.15",
|
"@apiglobal/typedrequest-interfaces": "^1.0.15",
|
||||||
"broadcast-channel": "^3.3.0"
|
"broadcast-channel": "^4.9.0"
|
||||||
},
|
},
|
||||||
"files": [
|
"files": [
|
||||||
"ts/**/*",
|
"ts/**/*",
|
||||||
|
|||||||
@@ -6,13 +6,13 @@ let deesCommsTest: deesComms.DeesComms;
|
|||||||
tap.test('first test', async (tools) => {
|
tap.test('first test', async (tools) => {
|
||||||
deesCommsTest = new deesComms.DeesComms();
|
deesCommsTest = new deesComms.DeesComms();
|
||||||
deesCommsTest.createTypedHandler<any>('test', async (requestData) => {
|
deesCommsTest.createTypedHandler<any>('test', async (requestData) => {
|
||||||
return {'hitheretoo': `greetings to ${requestData.hithere}`};
|
return { hitheretoo: `greetings to ${requestData.hithere}` };
|
||||||
});
|
});
|
||||||
|
|
||||||
// lets fire a request
|
// lets fire a request
|
||||||
const typedrequest = deesCommsTest.createTypedRequest<any>('test');
|
const typedrequest = deesCommsTest.createTypedRequest<any>('test');
|
||||||
const result = await typedrequest.fire({
|
const result = await typedrequest.fire({
|
||||||
'hithere': 'hello'
|
hithere: 'hello',
|
||||||
});
|
});
|
||||||
console.log(JSON.stringify(result));
|
console.log(JSON.stringify(result));
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -17,8 +17,8 @@ export class DeesComms {
|
|||||||
postMethodWithTypedRouter: async (messageArg) => {
|
postMethodWithTypedRouter: async (messageArg) => {
|
||||||
this.postMessage(messageArg);
|
this.postMessage(messageArg);
|
||||||
},
|
},
|
||||||
typedRouterRef: this.typedrouter
|
typedRouterRef: this.typedrouter,
|
||||||
})
|
});
|
||||||
|
|
||||||
private subscriptionChannel = new BroadcastChannel('dees-comms');
|
private subscriptionChannel = new BroadcastChannel('dees-comms');
|
||||||
|
|
||||||
@@ -39,10 +39,7 @@ export class DeesComms {
|
|||||||
public createTypedRequest<T extends plugins.typedrequestInterfaces.ITypedRequest>(
|
public createTypedRequest<T extends plugins.typedrequestInterfaces.ITypedRequest>(
|
||||||
methodName: T['method']
|
methodName: T['method']
|
||||||
): TypedRequest<T> {
|
): TypedRequest<T> {
|
||||||
const typedrequest = new plugins.typedrequest.TypedRequest(
|
const typedrequest = new plugins.typedrequest.TypedRequest(this.typedtarget, methodName);
|
||||||
this.typedtarget,
|
|
||||||
methodName
|
|
||||||
);
|
|
||||||
return typedrequest;
|
return typedrequest;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,6 +59,8 @@ export class DeesComms {
|
|||||||
methodArg: T['method'],
|
methodArg: T['method'],
|
||||||
handlerFunction: plugins.typedrequest.THandlerFunction<T>
|
handlerFunction: plugins.typedrequest.THandlerFunction<T>
|
||||||
) {
|
) {
|
||||||
this.typedrouter.addTypedHandler(new plugins.typedrequest.TypedHandler<T>(methodArg, handlerFunction));
|
this.typedrouter.addTypedHandler(
|
||||||
|
new plugins.typedrequest.TypedHandler<T>(methodArg, handlerFunction)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,9 +4,9 @@ import * as typedrequest from '@apiglobal/typedrequest';
|
|||||||
|
|
||||||
export { typedrequestInterfaces, typedrequest };
|
export { typedrequestInterfaces, typedrequest };
|
||||||
|
|
||||||
// thirdparty scope
|
// third party scope
|
||||||
import { BroadcastChannel as BroadCastChannelPolyfill } from 'broadcast-channel';
|
import { BroadcastChannel as BroadCastChannelPolyfill } from 'broadcast-channel';
|
||||||
|
|
||||||
export {
|
export {
|
||||||
BroadCastChannelPolyfill
|
BroadCastChannelPolyfill
|
||||||
};
|
}
|
||||||
@@ -1 +1 @@
|
|||||||
export * from './dees-comms.classes.deescomms';
|
export * from './dees-comms.classes.deescomms';
|
||||||
|
|||||||
Reference in New Issue
Block a user