From aad097e0ddefa81ab3b7b27ce445ef623f41941c Mon Sep 17 00:00:00 2001 From: njl07 Date: Mon, 20 Nov 2017 14:48:05 +0100 Subject: [PATCH] release(version): v1.1.0 --- README.md | 8 ++- package.json | 17 +++--- src/module/logger.module.ts | 2 +- tools/files.json | 7 +-- tools/packaging.ts | 63 +++---------------- tsconfig.build.json | 4 +- tsconfig.json | 3 +- yarn.lock | 117 +++++++++++++++++++++++------------- 8 files changed, 106 insertions(+), 115 deletions(-) diff --git a/README.md b/README.md index e906032..cb7e476 100644 --- a/README.md +++ b/README.md @@ -59,8 +59,8 @@ $ yarn add @hapiness/core @hapiness/logger rxjs ```javascript "dependencies": { - "@hapiness/core": "^1.1.1", - "@hapiness/logger": "^1.0.0", + "@hapiness/core": "^1.2.2", + "@hapiness/logger": "^1.1.0", "rxjs": "^5.5.2", //... } @@ -137,6 +137,10 @@ To set up your development environment: ## Change History +* v1.1.0 (2017-11-20) + * Latest packages' versions. + * Documentation. + * Change packaging process. * v1.0.0 (2017-10-26) * Create LoggerModule * Logger extension diff --git a/package.json b/package.json index 7ae2e9a..68b20b0 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "@hapiness/logger", - "version": "1.0.0", + "version": "1.1.0", "description": "Hapiness module for logging", - "main": "index.js", + "main": "commonjs/index.js", "types": "index.d.ts", "private": false, "scripts": { @@ -67,32 +67,31 @@ }, "homepage": "https://github.com/hapinessjs/logger-module#readme", "dependencies": { - "@types/chalk": "^0.4.31", - "@types/node": "^8.0.47", + "@types/node": "^8.0.53", "chalk": "^2.3.0", "debug": "^3.1.0" }, "devDependencies": { - "@hapiness/core": "^1.1.1", - "@types/fs-extra": "^4.0.2", + "@hapiness/core": "^1.2.2", + "@types/fs-extra": "^4.0.5", "coveralls": "^3.0.0", "fs-extra": "^4.0.2", "intercept-stdout": "^0.1.2", "istanbul": "^1.1.0-alpha.1", "mocha": "^4.0.1", - "mocha-typescript": "^1.1.11", + "mocha-typescript": "^1.1.12", "rimraf": "^2.6.2", "rxjs": "^5.5.2", "ts-node": "^3.3.0", "tslint": "^5.8.0", - "typescript": "^2.5.3", + "typescript": "^2.6.1", "unit.js": "^2.0.0" }, "engines": { "node": ">=7.0.0" }, "peerDependencies": { - "@hapiness/core": "^1.1.1", + "@hapiness/core": "^1.2.2", "rxjs": "^5.5.2" } } diff --git a/src/module/logger.module.ts b/src/module/logger.module.ts index 25b609f..dd62e1c 100644 --- a/src/module/logger.module.ts +++ b/src/module/logger.module.ts @@ -4,7 +4,7 @@ import { AccessLogs } from './logger.lifecycle'; import { LOGGER_CONFIG, LoggerConfig } from './logger.config'; @HapinessModule({ - version: '1.0.0-rc.7', + version: '1.1.0', declarations: [ AccessLogs ], providers: [ LoggerService ], exports: [ LoggerService ] diff --git a/tools/files.json b/tools/files.json index df131bf..841ca5a 100644 --- a/tools/files.json +++ b/tools/files.json @@ -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" } ] \ No newline at end of file diff --git a/tools/packaging.ts b/tools/packaging.ts index ac657d5..e76daab 100644 --- a/tools/packaging.ts +++ b/tools/packaging.ts @@ -9,8 +9,6 @@ import * as fs from 'fs-extra'; */ interface FileObject { name: string; - remove?: boolean; - externals?: boolean; } /** @@ -41,11 +39,10 @@ class Packaging { * Function to copy one file * * @param file {string} - * @param externals {boolean} * - * @return {Observable} + * @return {Observable} */ - private _copy(file: string, externals?: boolean): Observable { + private _copy(file: string): Observable { // copy package.json if (file.indexOf('package.json') !== -1) { return this._copyAndCleanupPackageJson(file); @@ -53,16 +50,12 @@ class Packaging { // copy other files return > 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); } @@ -78,52 +71,12 @@ class Packaging { }); } - /** - * Function to remove original file - * - * @param file {string} - * @param remove {boolean} - * - * @return {Observable} - * - * @private - */ - private _remove(file: string, remove?: boolean): Observable { - // remove original files - return > 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} + * @return {Observable} * * @private */ @@ -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)); } } diff --git a/tsconfig.build.json b/tsconfig.build.json index e84d726..900b296 100644 --- a/tsconfig.build.json +++ b/tsconfig.build.json @@ -1,9 +1,9 @@ { "extends": "./tsconfig.json", "compilerOptions": { - "module": "commonjs", - "outDir": ".", + "outDir": "./dist/commonjs", "rootDir": "./src", + "declarationDir": "./dist", "types": [ "node", "chalk" diff --git a/tsconfig.json b/tsconfig.json index 1404d2e..5dbcacc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,11 +1,12 @@ { "compilerOptions": { "target": "es2015", - "module": "umd", + "module": "commonjs", "moduleResolution": "node", "declaration": true, "noImplicitAny": false, "sourceMap": true, + "inlineSources": true, "emitDecoratorMetadata": true, "experimentalDecorators": true, "outDir": "./tmp", diff --git a/yarn.lock b/yarn.lock index f1624a9..126dc65 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,43 +2,40 @@ # yarn lockfile v1 -"@hapiness/core@^1.1.1": - version "1.1.1" - resolved "https://registry.yarnpkg.com/@hapiness/core/-/core-1.1.1.tgz#6657e29bf7a8cdcba04912c62da26b8a6e8b6221" +"@hapiness/core@^1.2.2": + version "1.2.2" + resolved "https://registry.yarnpkg.com/@hapiness/core/-/core-1.2.2.tgz#3fbc377aacdafa43be871485e983707b75e72155" dependencies: - "@types/hapi" "^16.1.10" + "@types/hapi" "^16.1.11" "@types/hoek" "^4.1.3" - "@types/joi" "^10.4.4" - "@types/node" "^8.0.46" + "@types/joi" "^13.0.0" + "@types/node" "^8.0.53" "@types/websocket" "^0.0.34" debug "^3.1.0" hapi "^16.6.2" + injection-js "^2.2.0" reflect-metadata "^0.1.10" websocket "^1.0.25" "@types/boom@*": - version "4.3.7" - resolved "https://registry.yarnpkg.com/@types/boom/-/boom-4.3.7.tgz#2771d7b1fd7df70c6860ed30ec6752feaca9f3de" + version "4.3.8" + resolved "https://registry.yarnpkg.com/@types/boom/-/boom-4.3.8.tgz#73acac4aa33d78b030a7797f4a74b4dfb058d418" "@types/catbox@*": - version "7.1.3" - resolved "https://registry.yarnpkg.com/@types/catbox/-/catbox-7.1.3.tgz#895ee7d335fda7e5af688b21e8b9b5e84e30dd39" + version "7.1.4" + resolved "https://registry.yarnpkg.com/@types/catbox/-/catbox-7.1.4.tgz#03f6a1631d698b6f0fed7edbd0c690f8600904bc" dependencies: "@types/boom" "*" -"@types/chalk@^0.4.31": - version "0.4.31" - resolved "https://registry.yarnpkg.com/@types/chalk/-/chalk-0.4.31.tgz#a31d74241a6b1edbb973cf36d97a2896834a51f9" - -"@types/fs-extra@^4.0.2": - version "4.0.3" - resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-4.0.3.tgz#87343b1ab99415b61817ac894ed622355a0ebf67" +"@types/fs-extra@^4.0.5": + version "4.0.5" + resolved "https://registry.yarnpkg.com/@types/fs-extra/-/fs-extra-4.0.5.tgz#8aa6033c0e87c653b09a6711686916864b48ec9e" dependencies: "@types/node" "*" -"@types/hapi@^16.1.10": - version "16.1.10" - resolved "https://registry.yarnpkg.com/@types/hapi/-/hapi-16.1.10.tgz#7fab660b199aeebc5f5393b4aeb1b6e926162734" +"@types/hapi@^16.1.11": + version "16.1.11" + resolved "https://registry.yarnpkg.com/@types/hapi/-/hapi-16.1.11.tgz#a9b8fe6eee2f8cefb94f4f447d3c23a2b2c308cf" dependencies: "@types/boom" "*" "@types/catbox" "*" @@ -52,9 +49,9 @@ version "4.1.3" resolved "https://registry.yarnpkg.com/@types/hoek/-/hoek-4.1.3.tgz#d1982d48fb0d2a0e5d7e9d91838264d8e428d337" -"@types/joi@*", "@types/joi@^10.4.4": - version "10.4.4" - resolved "https://registry.yarnpkg.com/@types/joi/-/joi-10.4.4.tgz#f437d223269ea46ce3313e32bc3d34d01ec74421" +"@types/joi@*", "@types/joi@^13.0.0": + version "13.0.0" + resolved "https://registry.yarnpkg.com/@types/joi/-/joi-13.0.0.tgz#63c066d901e87f464fa075d02bf2f390344241fc" "@types/mime-db@*": version "1.27.0" @@ -66,9 +63,9 @@ dependencies: "@types/mime-db" "*" -"@types/node@*", "@types/node@^8.0.46", "@types/node@^8.0.47": - version "8.0.47" - resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.47.tgz#968e596f91acd59069054558a00708c445ca30c2" +"@types/node@*", "@types/node@^8.0.53": + version "8.0.53" + resolved "https://registry.yarnpkg.com/@types/node/-/node-8.0.53.tgz#396b35af826fa66aad472c8cb7b8d5e277f4e6d8" "@types/podium@*": version "1.0.0" @@ -172,8 +169,8 @@ async@1.x, async@^1.4.0: resolved "https://registry.yarnpkg.com/async/-/async-1.5.2.tgz#ec6a61ae56480c0c3cb241c95618e20892f9672a" async@^2.1.4: - version "2.5.0" - resolved "https://registry.yarnpkg.com/async/-/async-2.5.0.tgz#843190fd6b7357a0b9e1c956edddd5ec8462b54d" + version "2.6.0" + resolved "https://registry.yarnpkg.com/async/-/async-2.6.0.tgz#61a29abb6fcc026fea77e56d1c6ec53a795951f4" dependencies: lodash "^4.14.0" @@ -392,8 +389,8 @@ code-point-at@^1.0.0: resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77" color-convert@^1.9.0: - version "1.9.0" - resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.0.tgz#1accf97dd739b983bf994d56fec8f95853641b7a" + version "1.9.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.1.tgz#c1261107aeb2f294ebffec9ed9ecad529a6097ed" dependencies: color-name "^1.1.1" @@ -453,6 +450,14 @@ coveralls@^3.0.0: minimist "^1.2.0" request "^2.79.0" +cross-spawn@^5.1.0: + version "5.1.0" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-5.1.0.tgz#e8bd0efee58fcff6f8f94510a0a554bbfa235449" + dependencies: + lru-cache "^4.0.1" + shebang-command "^1.2.0" + which "^1.2.9" + cryptiles@3.x.x, cryptiles@^3.1.2: version "3.1.2" resolved "https://registry.yarnpkg.com/cryptiles/-/cryptiles-3.1.2.tgz#a89fbb220f5ce25ec56e8c4aa8a4fd7b5b0d29fe" @@ -758,6 +763,10 @@ inherits@2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.1.tgz#b17d08d326b4423e568eff719f91b0b1cbdf69f1" +injection-js@^2.2.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/injection-js/-/injection-js-2.2.1.tgz#a8d6a085b2f0b8d8650f6f4487f6abb8cc0d67ce" + intercept-stdout@^0.1.2: version "0.1.2" resolved "https://registry.yarnpkg.com/intercept-stdout/-/intercept-stdout-0.1.2.tgz#126abf1fae6c509a428a98c61a631559042ae9fd" @@ -1077,6 +1086,13 @@ loose-envify@^1.0.0: dependencies: js-tokens "^3.0.0" +lru-cache@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-4.1.1.tgz#622e32e82488b49279114a4f9ecf45e7cd6bba55" + dependencies: + pseudomap "^1.0.2" + yallist "^2.1.2" + make-error@^1.1.1: version "1.3.0" resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.0.tgz#52ad3a339ccf10ce62b4040b708fe707244b8b96" @@ -1138,11 +1154,12 @@ mkdirp@0.5.1, mkdirp@0.5.x, mkdirp@^0.5.1: dependencies: minimist "0.0.8" -mocha-typescript@^1.1.11: - version "1.1.11" - resolved "https://registry.yarnpkg.com/mocha-typescript/-/mocha-typescript-1.1.11.tgz#8fc357b72968ee66a2d86cc88c3fc24d06ed4198" +mocha-typescript@^1.1.12: + version "1.1.12" + resolved "https://registry.yarnpkg.com/mocha-typescript/-/mocha-typescript-1.1.12.tgz#ff389bc2349677ecfc32c45cf0865993d82a2a17" dependencies: chalk "^1.1.3" + cross-spawn "^5.1.0" yargs "^6.5.0" mocha@^4.0.1: @@ -1171,8 +1188,8 @@ must@^0.12.0: kindof ">= 1.0.0 < 2" nan@^2.3.3: - version "2.7.0" - resolved "https://registry.yarnpkg.com/nan/-/nan-2.7.0.tgz#d95bf721ec877e08db276ed3fc6eb78f9083ad46" + version "2.8.0" + resolved "https://registry.yarnpkg.com/nan/-/nan-2.8.0.tgz#ed715f3fe9de02b57a5e6252d90a96675e1f085a" nigel@2.x.x: version "2.0.2" @@ -1295,6 +1312,10 @@ podium@^1.3.0: items "2.x.x" joi "10.x.x" +pseudomap@^1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3" + punycode@2.x.x: version "2.1.0" resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d" @@ -1436,6 +1457,16 @@ set-blocking@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" +shebang-command@^1.2.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-1.2.0.tgz#44aac65b695b03398968c39f363fee5deafdf1ea" + dependencies: + shebang-regex "^1.0.0" + +shebang-regex@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-1.0.0.tgz#da42f49740c0b42db2ca9728571cb190c98efea3" + shot@^3.4.2: version "3.4.2" resolved "https://registry.yarnpkg.com/shot/-/shot-3.4.2.tgz#1e5c3f6f2b26649adc42f7eb350214a5a0291d67" @@ -1699,8 +1730,8 @@ tslint@^5.8.0: tsutils "^2.12.1" tsutils@^2.12.1: - version "2.12.1" - resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.12.1.tgz#f4d95ce3391c8971e46e54c4cf0edb0a21dd5b24" + version "2.12.2" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-2.12.2.tgz#ad58a4865d17ec3ddb6631b6ca53be14a5656ff3" dependencies: tslib "^1.7.1" @@ -1720,9 +1751,9 @@ typedarray-to-buffer@^3.1.2: dependencies: is-typedarray "^1.0.0" -typescript@^2.5.3: - version "2.5.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.5.3.tgz#df3dcdc38f3beb800d4bc322646b04a3f6ca7f0d" +typescript@^2.6.1: + version "2.6.1" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.6.1.tgz#ef39cdea27abac0b500242d6726ab90e0c846631" uglify-js@^2.6: version "2.8.29" @@ -1803,7 +1834,7 @@ which-module@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/which-module/-/which-module-1.0.0.tgz#bba63ca861948994ff307736089e3b96026c2a4f" -which@^1.1.1: +which@^1.1.1, which@^1.2.9: version "1.3.0" resolved "https://registry.yarnpkg.com/which/-/which-1.3.0.tgz#ff04bdfc010ee547d780bec38e1ac1c2777d253a" dependencies: @@ -1851,6 +1882,10 @@ yaeti@^0.0.6: version "0.0.6" resolved "https://registry.yarnpkg.com/yaeti/-/yaeti-0.0.6.tgz#f26f484d72684cf42bedfb76970aa1608fbf9577" +yallist@^2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-2.1.2.tgz#1c11f9218f076089a47dd512f93c6699a6a81d52" + yargs-parser@^4.2.0: version "4.2.1" resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-4.2.1.tgz#29cceac0dc4f03c6c87b4a9f217dd18c9f74871c"