feat(messaging): package bilerplate
ADD
packages/messaging/README.md
+<p align="center">
+ <a href="https://marblejs.com">
+ <img src="https://github.com/marblejs/marble/blob/master/assets/img/logo.png?raw=true" width="200" alt="Marble.js logo"/>
+ </a>
+</p>
+
+# @marblejs/messaging
+
+A messaging module for [Marble.js](https://github.com/marblejs/marble).
+
+## Installation
+
+```
+$ npm i @marblejs/messaging
+```
+Requires `@marblejs/core` to be installed.
+
+## Documentation
+
+For the latest updates, documentation, change log, and release information visit [docs.marblejs.com](https://docs.marblejs.com) and follow [@marble_js](https://twitter.com/marble_js) on Twitter.
+
+License: MIT

ADD
packages/messaging/src/client/.gitkeep
packages/messaging/src/client/.gitkeep
ADD
packages/messaging/src/effects/.gitkeep
packages/messaging/src/effects/.gitkeep
ADD
packages/messaging/src/index.tsx
+export { messagingListener } from './listener/messaging.listener';

ADD
packages/messaging/src/listener/messaging.listener.tsx
+import { reader, ContextReader } from '@marblejs/core';
+import { Transport } from '../server/server.interface';
+
+export interface MessagingListenerConfig {
+ effects?: any[];
+ middlewares?: any[];
+ transport?: Transport;
+}
+
+export const messagingListener = (config: MessagingListenerConfig = {}) => {
+ const { effects = [], middlewares = [], transport = Transport.TCP } = config;
+
+ return (): ContextReader => reader.map(ask => {
+ return {}; // @TODO
+ });
+};

ADD
packages/messaging/src/server/server.interface.tsx
+import { Observable } from 'rxjs';
+
+export enum Transport {
+ TCP,
+ NATS,
+ RABBITMQ,
+ REDIS,
+ MQTT,
+ GRPC,
+}
+
+export interface TransportServer {
+ listen: () => any;
+ close: () => any;
+ sendMessage: <T>(msg: T, channel: any) => Observable<any>;
+ handleMessage: <T>(msg: T) => Observable<any>;
+}

ADD
packages/messaging/tsconfig.json
+{
+ "extends": "../../tsconfig.json",
+ "compilerOptions": {
+ "outDir": "./dist/",
+ "declaration": true,
+ "typeRoots": ["../../node_modules/@types"]
+ },
+ "include": ["src/**/*.ts"],
+}

feat(messaging): package bilerplate