From 11ec8b0e410c1e83c2b6011a7aa30dddbc154c26 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Thu, 6 Dec 2018 10:41:09 -0800 Subject: [PATCH 1/3] Add shelljs/make The make utility script: 1. Adds an object named target to the global namespace. 2. Dumps the contents of shelljs into the global namespace. --- types/shelljs/make.d.ts | 41 +++++++++++++++++++++++++++++++++++++ types/shelljs/tsconfig.json | 3 ++- 2 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 types/shelljs/make.d.ts diff --git a/types/shelljs/make.d.ts b/types/shelljs/make.d.ts new file mode 100644 index 0000000000..2ebded5a99 --- /dev/null +++ b/types/shelljs/make.d.ts @@ -0,0 +1,41 @@ +import * as shelljs from './' +declare global { + type Target = { + (...args: any[]): void, + result?: any, + done?: boolean + }; + export const target: { + all?: Target; + [s: string]: Target; + }; + export const cd: typeof shelljs.cd; + export const pwd: typeof shelljs.pwd; + export const ls: typeof shelljs.ls; + export const find: typeof shelljs.find; + export const cp: typeof shelljs.cp; + export const rm: typeof shelljs.rm; + export const mv: typeof shelljs.mv; + export const mkdir: typeof shelljs.mkdir; + export const cat: typeof shelljs.cat; + export const sed: typeof shelljs.sed; + export const grep: typeof shelljs.grep; + export const echo: typeof shelljs.echo; + export const pushd: typeof shelljs.pushd; + export const popd: typeof shelljs.popd; + export const dirs: typeof shelljs.dirs; + export const ln: typeof shelljs.ln; + export const exit: typeof shelljs.exit; + export const env: typeof shelljs.env; + export const exec: typeof shelljs.exec; + export const chmod: typeof shelljs.chmod; + export const tempdir: typeof shelljs.tempdir; + export const error: typeof shelljs.error; + export const touch: typeof shelljs.touch; + export const head: typeof shelljs.head; + export const sort: typeof shelljs.sort; + export const tail: typeof shelljs.tail; + export const uniq: typeof shelljs.uniq; + export const set: typeof shelljs.set; + export const config: typeof shelljs.config; +} diff --git a/types/shelljs/tsconfig.json b/types/shelljs/tsconfig.json index 7343a42a7e..51937bc2c0 100644 --- a/types/shelljs/tsconfig.json +++ b/types/shelljs/tsconfig.json @@ -18,6 +18,7 @@ }, "files": [ "index.d.ts", + "make.d.ts", "shelljs-tests.ts" ] -} \ No newline at end of file +} From c9ed1594d67e7a632b308e1a483a7c667fe4c844 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Thu, 6 Dec 2018 10:50:51 -0800 Subject: [PATCH 2/3] Fix some lint --- types/shelljs/make.d.ts | 66 ++++++++++++++++++++--------------------- 1 file changed, 33 insertions(+), 33 deletions(-) diff --git a/types/shelljs/make.d.ts b/types/shelljs/make.d.ts index 2ebded5a99..0db5320b72 100644 --- a/types/shelljs/make.d.ts +++ b/types/shelljs/make.d.ts @@ -1,41 +1,41 @@ -import * as shelljs from './' +import * as shelljs from './'; declare global { - type Target = { + interface Target { (...args: any[]): void, result?: any, done?: boolean - }; - export const target: { + } + const target: { all?: Target; [s: string]: Target; }; - export const cd: typeof shelljs.cd; - export const pwd: typeof shelljs.pwd; - export const ls: typeof shelljs.ls; - export const find: typeof shelljs.find; - export const cp: typeof shelljs.cp; - export const rm: typeof shelljs.rm; - export const mv: typeof shelljs.mv; - export const mkdir: typeof shelljs.mkdir; - export const cat: typeof shelljs.cat; - export const sed: typeof shelljs.sed; - export const grep: typeof shelljs.grep; - export const echo: typeof shelljs.echo; - export const pushd: typeof shelljs.pushd; - export const popd: typeof shelljs.popd; - export const dirs: typeof shelljs.dirs; - export const ln: typeof shelljs.ln; - export const exit: typeof shelljs.exit; - export const env: typeof shelljs.env; - export const exec: typeof shelljs.exec; - export const chmod: typeof shelljs.chmod; - export const tempdir: typeof shelljs.tempdir; - export const error: typeof shelljs.error; - export const touch: typeof shelljs.touch; - export const head: typeof shelljs.head; - export const sort: typeof shelljs.sort; - export const tail: typeof shelljs.tail; - export const uniq: typeof shelljs.uniq; - export const set: typeof shelljs.set; - export const config: typeof shelljs.config; + const cd: typeof shelljs.cd; + const pwd: typeof shelljs.pwd; + const ls: typeof shelljs.ls; + const find: typeof shelljs.find; + const cp: typeof shelljs.cp; + const rm: typeof shelljs.rm; + const mv: typeof shelljs.mv; + const mkdir: typeof shelljs.mkdir; + const cat: typeof shelljs.cat; + const sed: typeof shelljs.sed; + const grep: typeof shelljs.grep; + const echo: typeof shelljs.echo; + const pushd: typeof shelljs.pushd; + const popd: typeof shelljs.popd; + const dirs: typeof shelljs.dirs; + const ln: typeof shelljs.ln; + const exit: typeof shelljs.exit; + const env: typeof shelljs.env; + const exec: typeof shelljs.exec; + const chmod: typeof shelljs.chmod; + const tempdir: typeof shelljs.tempdir; + const error: typeof shelljs.error; + const touch: typeof shelljs.touch; + const head: typeof shelljs.head; + const sort: typeof shelljs.sort; + const tail: typeof shelljs.tail; + const uniq: typeof shelljs.uniq; + const set: typeof shelljs.set; + const config: typeof shelljs.config; } From d00ce6dfdf92472f320222dab32d8a8eb149b402 Mon Sep 17 00:00:00 2001 From: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Date: Thu, 6 Dec 2018 11:39:44 -0800 Subject: [PATCH 3/3] Add semi-colons --- types/shelljs/make.d.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/types/shelljs/make.d.ts b/types/shelljs/make.d.ts index 0db5320b72..ca4c2b6135 100644 --- a/types/shelljs/make.d.ts +++ b/types/shelljs/make.d.ts @@ -1,9 +1,9 @@ import * as shelljs from './'; declare global { interface Target { - (...args: any[]): void, - result?: any, - done?: boolean + (...args: any[]): void; + result?: any; + done?: boolean; } const target: { all?: Target;