Skip to content

Commit

Permalink
Merge pull request #31 from smartive/develop
Browse files Browse the repository at this point in the history
Release 2017-11-06
  • Loading branch information
buehler committed Nov 6, 2017
2 parents 24baa8b + 1fa3145 commit 2a5d29a
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 42 deletions.
18 changes: 18 additions & 0 deletions .appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: "{build} - {branch}"
skip_tags: true
skip_branch_with_pr: true

environment:
matrix:
- nodejs_version: "8"
- nodejs_version: "7"
- nodejs_version: "6"

install:
- ps: Install-Product node $env:nodejs_version
- npm install

test_script:
- npm test

build: off
52 changes: 34 additions & 18 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,25 +1,41 @@
language: node_js

cache:
directories:
- node_modules
stages:
- name: test
if: tag IS blank
- name: deploy
if: branch = master

notifications:
email: false

node_js:
- '8'
- '6'
env:
- BUILD_LEADER_ID=5

before_script:
- npm prune

after_success:
- npm install coveralls@^2.11.9 && cat ./coverage/lcov.info | coveralls
- npm i
- npm run build
- npm run semantic-release

branches:
except:
- /^v\d+\.\d+\.\d+$/
jobs:
include:
- stage: test
node_js: '8'
after_success:
- npm install coveralls@^2.11.9 && cat ./coverage/lcov.info | coveralls
- stage: test
node_js: '7'
after_success:
- npm install coveralls@^2.11.9 && cat ./coverage/lcov.info | coveralls
- stage: test
node_js: '6'
after_success:
- npm install coveralls@^2.11.9 && cat ./coverage/lcov.info | coveralls
- stage: deploy
node_js: '8'
script: npm run typedoc
deploy:
provider: pages
skip_cleanup: true
github_token: $GH_TOKEN
local_dir: ./docs
- stage: deploy
node_js: '8'
before_script: npm run build
script: echo "Deploy with semantic release"
after_success: npm run semantic-release
15 changes: 11 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
# proc-that

proc(ess)-that - easy extendable etl tool for nodejs written in typescript.

Basically instantiate the `Etl` class and add extractors (which pull data from a datasource), transformers (which process the extracted data) and loaders (they load the results into a sink).

A basic, hypothetic example could be: "Load data from a JSON array, snake_case all properties and store those objects into a mongoDB."

The package is written in `typescript` but can be used in plain javascript as well.
The package is written in `typescript` but can be used in plain javascript as well.

##### A bunch of badges

[![Build Status](https://travis-ci.org/smartive/proc-that.svg?maxAge=3600)](https://travis-ci.org/smartive/proc-that) [![npm](https://img.shields.io/npm/v/proc-that.svg?maxAge=3600)](https://www.npmjs.com/package/proc-that) [![Coverage status](https://img.shields.io/coveralls/smartive/proc-that.svg?maxAge=3600)](https://coveralls.io/github/smartive/proc-that) [![license](https://img.shields.io/github/license/smartive/proc-that.svg?maxAge=2592000)](https://github.com/smartive/proc-that)
[![Build Status](https://travis-ci.org/smartive/proc-that.svg?maxAge=3600)](https://travis-ci.org/smartive/proc-that)
[![Build Status](https://ci.appveyor.com/api/projects/status/wm7ydpf62e9518h8?svg=true)](https://ci.appveyor.com/project/buehler/proc-that)
[![npm](https://img.shields.io/npm/v/proc-that.svg?maxAge=3600)](https://www.npmjs.com/package/proc-that)
[![Coverage status](https://img.shields.io/coveralls/smartive/proc-that.svg?maxAge=3600)](https://coveralls.io/github/smartive/proc-that)
[![license](https://img.shields.io/github/license/smartive/proc-that.svg?maxAge=2592000)](https://github.com/smartive/proc-that)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![Greenkeeper badge](https://badges.greenkeeper.io/smartive/proc-that.svg)](https://greenkeeper.io/)

## Usage

Expand All @@ -30,13 +37,13 @@ Below is a list if extractors and loaders that are already implemented. Feel fre

## Extractors

Name | Description | Link
Name | Description | Link
--------------------------------|--------------------------------------------------|-------------------------------------------------------
`proc-that-rest-extractor` | Extract objects from GET requests | https://github.com/smartive/proc-that-rest-extractor

## Loaders

Name | Description | Link
Name | Description | Link
--------------------------------|--------------------------------------------------|-------------------------------------------------------
`proc-that-elastic-loader` | Load transformed objects into elasticsearch | https://github.com/smartive/proc-that-elastic-loader

Expand Down
27 changes: 15 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,16 @@
"version": "0.0.0-development",
"description": "proc(ess)-that - easy extendable etl tool for nodejs written in typesript",
"main": "index.js",
"typings": "index.d.js",
"scripts": {
"clean": "del-cli ./build ./coverage",
"build": "npm run clean && tsc -p ./config/tsconfig.build.json",
"develop": "npm run clean && tsc -p .",
"lint": "tslint -c ./tslint.json -p ./config/tsconfig.build.json",
"test": "npm run lint && npm run clean && jest -c ./jest.json",
"test:watch": "npm run clean && jest -c ./jest.json --watch",
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
"typedoc": "del-cli ./docs && typedoc --ignoreCompilerErrors --out ./docs --mode file --tsconfig ./config/tsconfig.build.json ./src/",
"semantic-release": "semantic-release"
},
"keywords": [
"etl",
Expand All @@ -28,19 +30,20 @@
"author": "Christoph Bühler <[email protected]>",
"license": "MIT",
"devDependencies": {
"@types/jest": "^20.0.5",
"@types/jest": "^21.1.5",
"del-cli": "^1.1.0",
"jest": "^20.0.4",
"ts-jest": "^20.0.7",
"tslint": "^5.5.0",
"tslint-config-airbnb": "^5.2.1",
"tsutils": "^2.8.0",
"typescript": "^2.4.2",
"semantic-release": "^6.3.6"
"jest": "^21.2.1",
"semantic-release": "^9.0.0",
"ts-jest": "^21.1.4",
"tslint": "^5.8.0",
"tslint-config-airbnb": "^5.3.0",
"tsutils": "^2.12.2",
"typedoc": "^0.9.0",
"typescript": "^2.6.1"
},
"dependencies": {
"@types/node": "^8.0.17",
"rxjs": "^5.4.2",
"tslib": "^1.7.1"
"@types/node": "^8.0.47",
"rxjs": "^5.5.2",
"tslib": "^1.8.0"
}
}
7 changes: 7 additions & 0 deletions src/loaders/ConsoleLoader.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@ import { Observable } from 'rxjs';

import { Loader } from '../interfaces/Loader';

/**
* Loader that outputs everything to the console.
*
* @export
* @class ConsoleLoader
* @implements {Loader}
*/
export class ConsoleLoader implements Loader {
public write(object: any): Observable<any> {
console.log(object);
Expand Down
21 changes: 13 additions & 8 deletions test/JsonExtractor.spec.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { join } from 'path';

import { JsonExtractor } from '../src';

describe('JsonExtractor', () => {
Expand All @@ -10,16 +12,16 @@ describe('JsonExtractor', () => {
it('should get correct path', () => {
const ext = new JsonExtractor('hello');
const anyExt: any = ext;
const result = process.cwd() + '/hello';
const result = join(process.cwd(), 'hello');
expect(anyExt.filePath).toBe(result);
});

it('should receive a json object', (done) => {
const ext = new JsonExtractor('./test/.testdata/json-extractor.object.json');
ext.read().subscribe((obj) => {
expect(obj).toMatchObject({
"foo": "bar",
"hello": "world"
foo: 'bar',
hello: 'world',
});
done();
});
Expand All @@ -36,11 +38,14 @@ describe('JsonExtractor', () => {

it('should throw on not found file', (done) => {
const ext = new JsonExtractor('404.json');
ext.read().subscribe(() => {
done(new Error('did not throw'));
}, () => {
done();
});
ext.read().subscribe(
() => {
done(new Error('did not throw'));
},
() => {
done();
},
);
});

});
2 changes: 2 additions & 0 deletions tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
]
}
],
"no-boolean-literal-compare": false,
"strict-boolean-expressions": false,
"no-increment-decrement": false,
"no-trailing-whitespace": [
true,
Expand Down

0 comments on commit 2a5d29a

Please sign in to comment.