From 34a76f78875931a18d5ff7d7204326a4a9cd1ad5 Mon Sep 17 00:00:00 2001 From: Jeff Dickey <216188+jdxcode@users.noreply.github.com> Date: Thu, 14 Dec 2017 20:53:45 -0800 Subject: [PATCH] ts work --- .gitignore | 5 +++-- package.json | 7 +++++-- lib/commands/foo/bar.js => src/commands/foo/bar.ts | 0 lib/hooks/init.js => src/hooks/init.ts | 0 src/hooks/plugins/parse/legacy.ts | 3 +++ tsconfig.json | 14 ++++++++++++++ yarn.lock | 8 ++++++++ 7 files changed, 33 insertions(+), 4 deletions(-) rename lib/commands/foo/bar.js => src/commands/foo/bar.ts (100%) rename lib/hooks/init.js => src/hooks/init.ts (100%) create mode 100644 src/hooks/plugins/parse/legacy.ts create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore index 3efd630..a626842 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ -tmp -node_modules +/lib +/node_modules +/tmp diff --git a/package.json b/package.json index 4a61328..89875b7 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "commands": "./lib/commands", "userPlugins": true, "hooks": { - "init": "./lib/hooks/init" + "init": "./lib/hooks/init", + "plugins:parse": "./lib/hooks/plugins/parse/legacy" }, "s3": { "host": "cli-assets.heroku.com" @@ -26,7 +27,9 @@ "cli-engine-example-plugin": "^2.1.4" }, "devDependencies": { - "jest": "20.0.4" + "@types/node": "8.5.1", + "jest": "20.0.4", + "typescript": "2.6.2" }, "jest": { "testEnvironment": "node", diff --git a/lib/commands/foo/bar.js b/src/commands/foo/bar.ts similarity index 100% rename from lib/commands/foo/bar.js rename to src/commands/foo/bar.ts diff --git a/lib/hooks/init.js b/src/hooks/init.ts similarity index 100% rename from lib/hooks/init.js rename to src/hooks/init.ts diff --git a/src/hooks/plugins/parse/legacy.ts b/src/hooks/plugins/parse/legacy.ts new file mode 100644 index 0000000..bc2a605 --- /dev/null +++ b/src/hooks/plugins/parse/legacy.ts @@ -0,0 +1,3 @@ +module.exports = (...opts: any[]) => { + console.dir(opts) +} diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..54ecdd1 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,14 @@ +{ + "compilerOptions": { + "strict": true, + "alwaysStrict": true, + "module": "commonjs", + "outDir": "./lib", + "noUnusedLocals": true, + "noUnusedParameters": true, + "target": "esnext" + }, + "include": [ + "./src/**/*" + ] +} diff --git a/yarn.lock b/yarn.lock index f072668..9c1c24d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2,6 +2,10 @@ # yarn lockfile v1 +"@types/node@8.5.1": + version "8.5.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-8.5.1.tgz#4ec3020bcdfe2abffeef9ba3fbf26fca097514b5" + abab@^1.0.3: version "1.0.3" resolved "https://registry.yarnpkg.com/abab/-/abab-1.0.3.tgz#b81de5f7274ec4e756d797cd834f303642724e5d" @@ -2343,6 +2347,10 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" +typescript@2.6.2: + version "2.6.2" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.6.2.tgz#3c5b6fd7f6de0914269027f03c0946758f7673a4" + uglify-js@^2.6: version "2.8.14" resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.14.tgz#25b15d1af39b21752ee33703adbf432e8bc8f77d"