Skip to content
This repository has been archived by the owner on May 10, 2021. It is now read-only.

Commit

Permalink
release(version): v1.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
akanass committed Nov 20, 2017
1 parent 964bc43 commit c8f944e
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 141 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Quick start project to create a [Hapiness](https://github.com/hapinessjs/hapines

## Starter

Download this [starter](https://github.com/hapinessjs/quick-start/releases/tag/v1.1.0) and change `hapinessjs/quick-start` and `@hapiness/quick-start`, according **your module name and repository**, in these files:
Download this [starter](https://github.com/hapinessjs/quick-start/releases/tag/v1.2.0) and change `hapinessjs/quick-start` and `@hapiness/quick-start`, according **your module name and repository**, in these files:
* `package.json`
* `README.md`

Expand Down Expand Up @@ -242,6 +242,10 @@ Packaging will be created inside `dist` folder. You must to **publish only the c

## Change History

* v1.1.0 (2017-11-20)
* Latest packages' versions.
* Documentation.
* Change packaging process.
* v1.1.0 (2017-11-14)
* Create `quick-start` **application**.
* Create **tests** for each component.
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@hapiness/quick-start",
"version": "1.1.0",
"version": "1.2.0",
"description": "Quick start project to create a Hapiness application with all its features",
"main": "index.js",
"private": false,
Expand Down Expand Up @@ -69,13 +69,13 @@
},
"homepage": "https://github.com/hapinessjs/quick-start#readme",
"dependencies": {
"@hapiness/biim": "^1.3.2",
"@hapiness/config": "^1.0.0",
"@hapiness/core": "^1.1.1",
"@hapiness/http": "^1.0.0",
"@hapiness/logger": "^1.0.0",
"@hapiness/swag": "^1.0.0",
"@types/node": "^8.0.51",
"@hapiness/biim": "^1.4.0",
"@hapiness/config": "^1.1.0",
"@hapiness/core": "^1.2.0",
"@hapiness/http": "^1.1.0",
"@hapiness/logger": "^1.1.0",
"@hapiness/swag": "^1.1.0",
"@types/node": "^8.0.53",
"debug": "^3.1.0",
"rxjs": "^5.5.2"
},
Expand All @@ -91,7 +91,7 @@
"rimraf": "^2.6.2",
"ts-node": "^3.3.0",
"tslint": "^5.8.0",
"typescript": "^2.5.3",
"typescript": "^2.6.1",
"unit.js": "^2.0.0"
},
"engines": {
Expand Down
2 changes: 1 addition & 1 deletion src/application.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { GetHelloWorldRoute } from './routes';
import { DownloadModule } from './modules';

@HapinessModule({
version: '1.0.0',
version: '1.2.0',
imports: [
LoggerModule,
DownloadModule,
Expand Down
11 changes: 1 addition & 10 deletions tools/files.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,5 @@
{ "name":"README.md" },
{ "name":"LICENSE.md" },
{ "name":"package.json" },
{ "name":"src" },
{ "name":"config" },
{ "name":"index.js", "remove":true },
{ "name":"index.js.map", "remove":true },
{ "name":"application.module.js", "remove":true },
{ "name":"application.module.js.map", "remove":true },
{ "name":"libraries", "remove":true },
{ "name":"modules", "remove":true },
{ "name":"routes", "remove":true },
{ "name":"services", "remove":true }
{ "name":"config"}
]
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
2 changes: 1 addition & 1 deletion tsconfig.build.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"extends": "./tsconfig.dev.json",
"compilerOptions": {
"outDir": "."
"outDir": "./dist"
}
}
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"declaration": false,
"noImplicitAny": false,
"sourceMap": true,
"inlineSources": true,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"outDir": "./tmp",
Expand Down

0 comments on commit c8f944e

Please sign in to comment.