20 Commits

Author SHA1 Message Date
4c59d38971 1.0.17 2022-03-25 14:17:13 +01:00
385acfd951 fix(core): update 2022-03-25 14:17:13 +01:00
97eba85337 1.0.16 2022-01-28 17:59:07 +01:00
61936bbdd1 fix(core): update 2022-01-28 17:59:06 +01:00
4ab1b917a9 1.0.15 2022-01-28 17:40:12 +01:00
f299cff4c9 fix(core): update 2022-01-28 17:40:12 +01:00
a6e262bbae 1.0.14 2022-01-24 05:13:21 +01:00
8a8200ca8a fix(core): update 2022-01-24 05:13:19 +01:00
e7785cc31b 1.0.13 2022-01-24 05:11:56 +01:00
63610b66bc fix(core): update 2022-01-24 05:11:55 +01:00
d8d382b2fb 1.0.12 2022-01-24 04:52:41 +01:00
7c8a2eeaeb fix(core): update 2022-01-24 04:52:39 +01:00
a34e8f571d 1.0.11 2021-09-27 13:51:00 +02:00
2bf398cf97 fix(core): update 2021-09-27 13:50:59 +02:00
315bbffac2 1.0.10 2021-09-27 12:27:21 +02:00
52e77d1c3e fix(core): update 2021-09-27 12:27:20 +02:00
9ac1fdbb63 1.0.9 2020-12-21 12:07:35 +00:00
ac43f63daf fix(core): update 2020-12-21 12:07:34 +00:00
c8ce7942d5 1.0.8 2020-12-21 12:07:18 +00:00
336351b98a fix(core): update 2020-12-21 12:07:18 +00:00
10 changed files with 15032 additions and 7931 deletions

View File

@@ -36,6 +36,7 @@ auditProductionDependencies:
- npmci command npm audit --audit-level=high --only=prod --production
tags:
- docker
allow_failure: true
auditDevDependencies:
image: registry.gitlab.com/hosttoday/ht-docker-node:npmci

22881
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,29 +1,28 @@
{
"name": "@designestate/dees-comms",
"version": "1.0.7",
"version": "1.0.17",
"private": false,
"description": "a comms module for communicating within the DOM",
"main": "dist_ts/index.js",
"typings": "dist_ts/index.d.ts",
"type": "module",
"author": "Lossless GmbH",
"license": "MIT",
"scripts": {
"test": "(tstest test/ --web)",
"build": "(tsbuild --web)"
"build": "(tsbuild --web --allowimplicitany && tsbundle npm)"
},
"devDependencies": {
"@gitzone/tsbuild": "^2.1.25",
"@gitzone/tsbundle": "^1.0.78",
"@gitzone/tstest": "^1.0.52",
"@pushrocks/tapbundle": "^3.2.9",
"@types/node": "^14.11.5",
"tslint": "^6.1.3",
"tslint-config-prettier": "^1.15.0"
"@gitzone/tsbuild": "^2.1.61",
"@gitzone/tsbundle": "^1.0.101",
"@gitzone/tstest": "^1.0.70",
"@pushrocks/tapbundle": "^5.0.3",
"@types/node": "^17.0.23"
},
"dependencies": {
"@apiglobal/typedrequest": "^1.0.53",
"@apiglobal/typedrequest": "^2.0.0",
"@apiglobal/typedrequest-interfaces": "^1.0.15",
"broadcast-channel": "^3.2.0"
"broadcast-channel": "^3.7.0"
},
"files": [
"ts/**/*",

View File

@@ -1,18 +1,18 @@
import { expect, tap } from '@pushrocks/tapbundle';
import * as deesComms from '../ts/index';
import * as deesComms from '../ts/index.js';
let deesCommsTest: deesComms.DeesComms;
tap.test('first test', async (tools) => {
deesCommsTest = new deesComms.DeesComms();
deesCommsTest.createTypedHandler<any>('test', async (requestData) => {
return {'hitheretoo': 'greetings'};
return { hitheretoo: `greetings to ${requestData.hithere}` };
});
// lets fire a request
const typedrequest = deesCommsTest.createTypedRequest<any>('test');
const result = await typedrequest.fire({
'hithere': 'hello'
hithere: 'hello',
});
console.log(JSON.stringify(result));
});

View File

@@ -1,5 +1,5 @@
import { TypedRequest } from '@apiglobal/typedrequest';
import * as plugins from './dees-comms.plugins';
import * as plugins from './dees-comms.plugins.js';
let BroadcastChannel = globalThis.BroadcastChannel;
if (!BroadcastChannel) {
@@ -13,6 +13,12 @@ export class DeesComms {
// sending messages
private postChannel = new BroadcastChannel('dees-comms');
public typedrouter = new plugins.typedrequest.TypedRouter();
public typedtarget = new plugins.typedrequest.TypedTarget({
postMethodWithTypedRouter: async (messageArg) => {
this.postMessage(messageArg);
},
typedRouterRef: this.typedrouter,
});
private subscriptionChannel = new BroadcastChannel('dees-comms');
@@ -33,13 +39,7 @@ export class DeesComms {
public createTypedRequest<T extends plugins.typedrequestInterfaces.ITypedRequest>(
methodName: T['method']
): TypedRequest<T> {
const typedrequest = new plugins.typedrequest.TypedRequest(
async (messageArg) => {
this.postMessage(messageArg);
},
methodName,
this.typedrouter
);
const typedrequest = new plugins.typedrequest.TypedRequest(this.typedtarget, methodName);
return typedrequest;
}
@@ -59,6 +59,8 @@ export class DeesComms {
methodArg: T['method'],
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)
);
}
}

View File

@@ -1,4 +1,4 @@
import * as plugins from './dees-comms.plugins';
import * as plugins from './dees-comms.plugins.js';
/**
* a message that can be sent

View File

@@ -4,9 +4,9 @@ import * as typedrequest from '@apiglobal/typedrequest';
export { typedrequestInterfaces, typedrequest };
// thirdparty scope
// third party scope
import { BroadcastChannel as BroadCastChannelPolyfill } from 'broadcast-channel';
export {
BroadCastChannelPolyfill
};
}

View File

@@ -1 +1 @@
export * from './dees-comms.classes.deescomms';
export * from './dees-comms.classes.deescomms.js';

9
tsconfig.json Normal file
View File

@@ -0,0 +1,9 @@
{
"compilerOptions": {
"experimentalDecorators": true,
"useDefineForClassFields": false,
"target": "ES2022",
"module": "ES2022",
"moduleResolution": "nodenext"
}
}

View File

@@ -1,17 +0,0 @@
{
"extends": ["tslint:latest", "tslint-config-prettier"],
"rules": {
"semicolon": [true, "always"],
"no-console": false,
"ordered-imports": false,
"object-literal-sort-keys": false,
"member-ordering": {
"options":{
"order": [
"static-method"
]
}
}
},
"defaultSeverity": "warning"
}