Skip to content

Commit

Permalink
remove unused devDependency and update dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
restuwahyu13 committed Feb 5, 2021
1 parent efa9378 commit f1d3704
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 106 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ COPY package*.json \
config.ts \
jest.config.ts \
Makefile ./
COPY ./ /app
COPY . ./
RUN apk add make \
&& make install

## BUILD STAGE TWO

FROM streambox-collection
COPY --from=streambox-collection ./ /app
WORKDIR /app
COPY --from=streambox-collection ./ /usr/src/app
WORKDIR /usr/src/app
RUN make build
94 changes: 4 additions & 90 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "streambox-collection",
"version": "0.0.5",
"version": "0.0.6",
"description": "streambox-collection is a lightweight utility as a wrapper for displaying objects, arrays, strings, and number formats to clients using data streams.",
"main": "./dist/index.js",
"module": "./esm/index.js",
Expand All @@ -14,7 +14,6 @@
"compiler:esm": "npm run clean:esm && tsc --outDir esm --module es6 --pretty",
"compiler:cjs": "npm run clean:cjs && tsc --pretty",
"build": "npm run compiler:cjs && npm run compiler:esm",
"start": "ts-node index.ts",
"test": "jest",
"test:coverage": "jest --coverage",
"test:watch": "jest --watchAll",
Expand All @@ -23,7 +22,10 @@
"format": "prettier src/**/*.{ts,spec.ts,test.ts} --write",
"lint:fix": "npm run format && npm run lint"
},
"author": "Restu Wahyu Saputra <[email protected]>",
"author": {
"name": "Restu Wahyu Saputra",
"email": "[email protected]"
},
"repository": {
"url": "git+https://github.com/restuwahyu13/streambox-collection.git"
},
Expand All @@ -40,6 +42,7 @@
"streambox-collection",
"stream",
"grpc",
"@grpc/grpc-js",
"es6",
"commonjs",
"node",
Expand All @@ -55,15 +58,13 @@
],
"dependencies": {
"delay": "^4.4.0",
"is-any-type": "0.0.2",
"is-any-type": "0.0.3",
"memorystream": "^0.3.1",
"readable-stream": "^3.6.0"
},
"devDependencies": {
"@types/axios": "^0.14.0",
"@types/delay": "^3.1.0",
"@types/eslint": "^7.2.6",
"@types/express": "^4.17.11",
"@types/jest": "^26.0.20",
"@types/memorystream": "^0.3.0",
"@types/node": "^14.14.22",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/array.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const transformStream = new Transform() as Transform
* @return Promise
*/

export default function array(data: Record<string, any>[] | any[], delay?: number): Promise<Buffer> {
export default function array(data: Record<string, any>[] | any[], delay?: number): ReturnType<() => Promise<Buffer>> {
return new Promise(async (resolve, reject) => {
if (isType(data) === 'array') {
await waitFor(delay)
Expand Down
2 changes: 1 addition & 1 deletion src/lib/number.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const transformStream = new Transform() as Transform
* @return Promise
*/

export default function number(data: number, delay?: number): Promise<Buffer> {
export default function number(data: number, delay?: number): ReturnType<() => Promise<Buffer>> {
return new Promise(async (resolve, reject) => {
if (isType(data) === 'number') {
await waitFor(delay)
Expand Down
2 changes: 1 addition & 1 deletion src/lib/object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const transformStream = new Transform() as Transform
* @return Promise
*/

export default function object(data: Record<string, any>, delay?: number): Promise<Buffer> {
export default function object(data: Record<string, any>, delay?: number): ReturnType<() => Promise<Buffer>> {
return new Promise(async (resolve, reject) => {
if (isType(data) === 'object') {
await waitFor(delay)
Expand Down
2 changes: 1 addition & 1 deletion src/lib/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export function toNumber(chunk: Buffer): any {
* parse promise to callback
*/

export function toCallback(parameter: Promise<any>, callback: any): void {
export function toCallback(parameter: Promise<any>, callback: any): ReturnType<() => void> {
let response
let error

Expand Down
2 changes: 1 addition & 1 deletion src/lib/string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const transformStream = new Transform() as Transform
* @return Promise
*/

export default function string(data: string, delay?: number): Promise<Buffer> {
export default function string(data: string, delay?: number): ReturnType<() => Promise<Buffer>> {
return new Promise(async (resolve, reject) => {
if (isType(data) === 'string') {
await waitFor(delay)
Expand Down
4 changes: 2 additions & 2 deletions src/utils/util.generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ export class Generator {
this.next = this.iterator.next()
}

private *generator(): globalThis.Generator {
private *generator(): ReturnType<() => globalThis.Generator> {
yield this.promise
}

public execute(): Promise<any> | any {
public execute(): ReturnType<() => Promise<any> | any> {
return this.next.value
}
}

0 comments on commit f1d3704

Please sign in to comment.