Skip to content

Commit

Permalink
Merge pull request #4 from hapinessjs/next
Browse files Browse the repository at this point in the history
release(version): v1.0.0
  • Loading branch information
akanass authored Dec 14, 2017
2 parents 7a8100d + 2a21a16 commit 8ccc295
Show file tree
Hide file tree
Showing 12 changed files with 408 additions and 469 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
8.2.1
9.3.0
6 changes: 3 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
pretest:
@node ./node_modules/.bin/tslint -p ./tsconfig.json --type-check "./src/**/*.ts" "./test/**/*.ts" -e "./src/custom-typings/**/*.ts"
@node ./node_modules/.bin/tslint -p ./tsconfig.json "./src/**/*.ts" "./test/**/*.ts"
test:
@node ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha ./test
@node ./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha "./test/**/*.ts"
coveralls:
cat ./coverage/lcov.info | node ./node_modules/.bin/coveralls
tsc:
Expand All @@ -11,4 +11,4 @@ clean:
packaging:
@node ./node_modules/.bin/ts-node ./tools/packaging.ts

.PHONY: pretest test test-on-travis tsc clean packaging
.PHONY: pretest test coveralls tsc clean packaging
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,17 +53,18 @@
### `yarn` or `npm` it in your `package.json`

```bash
$ npm install --save @hapiness/minio
$ npm install --save @hapiness/core @hapiness/minio rxjs

or

$ yarn add @hapiness/minio
$ yarn add @hapiness/core @hapiness/minio rxjs
```

```javascript
"dependencies": {
"@hapiness/core": "^1.0.0-rc.7",
"@hapiness/minio": "^1.0.0-rc.7",
"@hapiness/core": "^1.3.0",
"@hapiness/minio": "^1.0.0",
"rxjs": "^5.5.5"
//...
}
//...
Expand Down Expand Up @@ -300,19 +301,18 @@ To set up your development environment:

## Change History

* v1.0.0-rc.7 (2017-09-12)
* v1.0.0 (2017-12-14)
* `MinIO` module implementation
* Related tests
* Documentation
* Version related to core version

[Back to top](#table-of-contents)

## Maintainers

<table>
<tr>
<td colspan="4" align="center"><a href="https://www.tadaweb.com"><img src="https://www.tadaweb.com/opengraph.jpg" width="117" alt="tadaweb" /></a></td>
<td colspan="4" align="center"><a href="https://www.tadaweb.com"><img src="http://bit.ly/2xHQkTi" width="117" alt="tadaweb" /></a></td>
</tr>
<tr>
<td align="center"><a href="https://github.com/Juneil"><img src="https://avatars3.githubusercontent.com/u/6546204?v=3&s=117" width="117"/></a></td>
Expand Down
32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "@hapiness/minio",
"version": "1.0.0-rc.7",
"version": "1.0.0",
"description": "Hapiness module for minio",
"main": "index.js",
"main": "commonjs/index.js",
"types": "index.d.ts",
"private": false,
"scripts": {
Expand Down Expand Up @@ -70,28 +70,28 @@
},
"homepage": "https://github.com/hapinessjs/minio-module#readme",
"dependencies": {
"@types/node": "^8.0.28",
"debug": "^3.0.1",
"minio": "^3.2.0"
"@types/node": "^8.5.1",
"debug": "^3.1.0",
"minio": "^3.2.3"
},
"devDependencies": {
"@hapiness/core": "1.0.0-rc.7",
"@types/fs-extra": "^4.0.2",
"coveralls": "^2.13.1",
"fs-extra": "^4.0.1",
"@hapiness/core": "^1.3.0",
"@types/fs-extra": "^5.0.0",
"coveralls": "^3.0.0",
"fs-extra": "^5.0.0",
"istanbul": "^1.1.0-alpha.1",
"mocha": "^3.5.3",
"mocha-typescript": "^1.1.8",
"mocha": "^4.0.1",
"mocha-typescript": "^1.1.12",
"rimraf": "^2.6.2",
"rxjs": "^5.4.3",
"rxjs": "^5.5.5",
"ts-node": "^3.3.0",
"tslint": "^5.7.0",
"typescript": "^2.5.2",
"tslint": "^5.8.0",
"typescript": "^2.6.2",
"unit.js": "^2.0.0"
},
"peerDependencies": {
"@hapiness/core": "1.0.0-rc.7",
"rxjs": "^5.4.3"
"@hapiness/core": "^1.3.0",
"rxjs": "^5.5.5"
},
"engines": {
"node": ">=8.2.1"
Expand Down
2 changes: 1 addition & 1 deletion src/module/minio.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { HapinessModule } from '@hapiness/core';
import { MinioService } from './services';

@HapinessModule({
version: '1.0.0-rc.7',
version: '1.0.0',
declarations: [],
providers: [],
exports: [MinioService]
Expand Down
3 changes: 1 addition & 2 deletions test/integration/minio.module.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { test, suite } from 'mocha-typescript';
*/
import * as unit from 'unit.js';

import { Hapiness, HapinessModule, OnStart, HttpServerExt } from '@hapiness/core';
import { Hapiness, HapinessModule, OnStart } from '@hapiness/core';

import { MinioExt, MinioModule, MinioService } from '../../src';

Expand Down Expand Up @@ -90,7 +90,6 @@ export class MinioModuleIntegrationTest {
}

Hapiness.bootstrap(MinioModuleTest, [
HttpServerExt.setConfig({ host: '0.0.0.0', port: 1234 }),
MinioExt.setConfig(
{
connection: {
Expand Down
2 changes: 1 addition & 1 deletion test/mocha.opts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
--report lcovonly
--reporter spec
--recursive
--compilers ts:ts-node/register
--require ts-node/register
--throw-deprecation
--colors
7 changes: 1 addition & 6 deletions tools/files.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
[
{ "name":"README.md" },
{ "name":"LICENSE.md" },
{ "name":"package.json" },
{ "name":"src" },
{ "name":"index.js", "remove":true },
{ "name":"index.js.map", "remove":true },
{ "name":"index.d.ts", "remove":true },
{ "name":"module", "remove":true }
{ "name":"package.json" }
]
63 changes: 10 additions & 53 deletions tools/packaging.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ import * as fs from 'fs-extra';
*/
interface FileObject {
name: string;
remove?: boolean;
externals?: boolean;
}

/**
Expand Down Expand Up @@ -41,28 +39,23 @@ class Packaging {
* Function to copy one file
*
* @param file {string}
* @param externals {boolean}
*
* @return {Observable<R>}
* @return {Observable<any>}
*/
private _copy(file: string, externals?: boolean): Observable<any> {
private _copy(file: string): Observable<any> {
// copy package.json
if (file.indexOf('package.json') !== -1) {
return this._copyAndCleanupPackageJson(file);
}

// copy other files
return <Observable<any>> Observable.create((observer) => {
let fileDest = file;
if (externals && file.indexOf('src/') !== -1) {
fileDest = file.split('src/').pop();
}
fs.stat(`${this._srcPath}${file}`, (error, stats) => {
if (error) {
console.error('doesn\'t exist on copy =>', error.message);
}
if (stats && (stats.isFile() || stats.isDirectory())) {
fs.copy(`${this._srcPath}${file}`, `${this._destPath}${fileDest}`, (err) => {
fs.copy(`${this._srcPath}${file}`, `${this._destPath}${file}`, (err) => {
if (err) {
console.error('copy failed =>', err.message);
}
Expand All @@ -78,52 +71,12 @@ class Packaging {
});
}

/**
* Function to remove original file
*
* @param file {string}
* @param remove {boolean}
*
* @return {Observable<any>}
*
* @private
*/
private _remove(file: string, remove?: boolean): Observable<any> {
// remove original files
return <Observable<any>> Observable.create((observer) => {
if (remove) {
fs.stat(`${this._srcPath}${file}`, (error, stats) => {
if (error) {
console.error('doesn\'t exist on remove =>', error.message);
}

if (stats && (stats.isFile() || stats.isDirectory())) {
fs.remove(`${this._srcPath}${file}`, (err) => {
if (err) {
console.error('remove failed =>', err.message);
}

observer.next();
observer.complete();
});
} else {
observer.next();
observer.complete();
}
});
} else {
observer.next();
observer.complete();
}
});
}

/**
* Function to cleanup package.json and _copy it to dist directory
*
* @param file {string}
*
* @return {Observable<R>}
* @return {Observable<any>}
*
* @private
*/
Expand Down Expand Up @@ -171,8 +124,12 @@ class Packaging {
* Function that _copy all files in dist directory
*/
process() {
Observable.forkJoin(this._files.map((fileObject: FileObject) => this._copy(fileObject.name, fileObject.externals)
.flatMap(_ => this._remove(fileObject.name, fileObject.remove)))).subscribe(null, error => console.error(error));
Observable.forkJoin(
this._files.map(
(fileObject: FileObject) => this._copy(fileObject.name)
)
)
.subscribe(null, error => console.error(error));
}
}

Expand Down
5 changes: 3 additions & 2 deletions tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"outDir": ".",
"outDir": "./dist/commonjs",
"rootDir": "./src",
"declarationDir": "./dist",
"types": [
"node"
]
Expand All @@ -13,4 +14,4 @@
"test",
"tools"
]
}
}
7 changes: 4 additions & 3 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
{
"compilerOptions": {
"target": "es2015",
"module": "umd",
"module": "commonjs",
"moduleResolution": "node",
"declaration": true,
"noImplicitAny": false,
"noUnusedLocals": true,
"sourceMap": true,
"inlineSources": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"noUnusedLocals": true,
"outDir": "./tmp",
"rootDir": ".",
"skipLibCheck": true,
Expand All @@ -29,4 +30,4 @@
"dist",
"tmp"
]
}
}
Loading

0 comments on commit 8ccc295

Please sign in to comment.