build(shared): removed dependencies to core package
MODIFY
lerna.json
lerna.json
{
"lerna": "2.11.0",
"packages": [
- "example",
"packages/*"
],
"version": "1.0.0-rc.1"

MODIFY
packages/@shared/package.json
packages/@shared/package.json
"bugs": {
"url": "https://github.com/marblejs/marble/issues"
},
- "homepage": "https://github.com/marblejs/marble#readme",
- "peerDependencies": {
- "@marblejs/core": "^1.0.0-rc.1"
- },
- "devDependencies": {
- "@marblejs/core": "^1.0.0-rc.1"
- }
+ "homepage": "https://github.com/marblejs/marble#readme"
}

MODIFY
packages/@shared/src/files/fileReader.helper.spec.ts
packages/@shared/src/files/fileReader.helper.spec.ts
@@ -22,9 +22,9 @@ describe('File reader', () => {
fail('Exceptions should be thrown');
done();
},
- error => {
+ (error: Error) => {
expect(error).toBeDefined();
- expect(error.message).toBe('File not found');
+ expect(error.message.includes('ENOENT, no such file or directory')).toBe(true);
done();
}
);

MODIFY
packages/@shared/src/files/fileReader.helper.ts
packages/@shared/src/files/fileReader.helper.ts
import * as fs from 'fs';
import * as path from 'path';
import { Observable } from 'rxjs';
-import { HttpError, HttpStatus } from '@marblejs/core';
export const readFile = (basePath: string) => (dir: string) =>
new Observable<Buffer>(subscriber => {
@@ -9,8 +8,7 @@ export const readFile = (basePath: string) => (dir: string) =>
fs.readFile(pathname, (err, file) => {
if (err && err.code === 'ENOENT') {
- const error = new HttpError('File not found', HttpStatus.NOT_FOUND);
- subscriber.error(error);
+ subscriber.error(err);
}
subscriber.next(file);
subscriber.complete();

MODIFY
packages/@shared/src/testing/marbles.helper.ts
packages/@shared/src/testing/marbles.helper.ts
import { Observable, OperatorFunction, from } from 'rxjs';
import { TestScheduler } from 'rxjs/testing';
-import { Effect, HttpRequest, HttpResponse } from '@marblejs/core';
type MarbleFlow = [string, object];
-type MarbleDependencies = { response: HttpResponse; error?: Error };
+type MarbleDependencies = { response: any; error?: Error };
export namespace Marbles {
const deepEquals = (actual, expected) => expect(actual).toEqual(expected);
@@ -29,17 +28,17 @@ export namespace Marbles {
scheduler.flush();
};
- export const assertEffect = <T>(
- effect: Effect<T>,
+ export const assertEffect = (
+ effect: (...args: any[]) => Observable<any>,
marbleflow: [MarbleFlow, MarbleFlow],
- depts: MarbleDependencies = { response: {} as HttpResponse },
+ depts: MarbleDependencies = { response: {} },
) => {
const [initStream, initValues] = marbleflow[0];
const [expectedStream, expectedValues] = marbleflow[1];
const scheduler = createTestScheduler();
const observable = scheduler.createColdObservable(initStream, initValues);
- const effectStream = from(observable) as Observable<HttpRequest>;
+ const effectStream = from(observable) as Observable<any>;
scheduler
.expectObservable(effect(effectStream, depts.response, depts.error))

MODIFY
packages/core/package.json
packages/core/package.json
"version": "1.0.0-rc.1",
"description": "Reactive Node APIs made easy",
"main": "./dist/index.js",
- "types": "./dist/index.d.ts",
+ "types": "./dist/core/src/index.d.ts",
"scripts": {
"start": "yarn watch",
"watch": "webpack -w",

MODIFY
packages/core/src/index.ts
packages/core/src/index.ts
@@ -7,4 +7,4 @@ export * from './router/router.interface';
export * from './http.interface';
export * from './http.listener';
export * from './operators';
-export { compose, Maybe, ContentType } from '@shared';
+export { compose, Maybe, ContentType } from '../../@shared/src';

build(shared): removed dependencies to core package