From 7d9b9b2d1d8e48c86f3ee83a8522edb10abd69b3 Mon Sep 17 00:00:00 2001 From: LosslessBot Date: Sat, 30 Apr 2016 12:25:35 +0200 Subject: [PATCH] now makes TypeScript modules fully typed by default --- dist/npmts.compile.js | 7 +++++++ ts/npmts.compile.ts | 9 +++++++++ 2 files changed, 16 insertions(+) diff --git a/dist/npmts.compile.js b/dist/npmts.compile.js index 7035619..e3c59a1 100644 --- a/dist/npmts.compile.js +++ b/dist/npmts.compile.js @@ -38,6 +38,13 @@ exports.run = function (configArg) { moduleStream.on("queueDrain", function () { plugins.beautylog.ok("TypeScript has been compiled!"); moduleStream.on("finish", function () { + try { + if (config.mode = "default") + plugins.fs.copySync(plugins.path.join(paths.cwd, "ts/typings"), plugins.path.join(paths.cwd, "dist/typings")); + } + catch (err) { + plugins.beautylog.warn("failed to copy external typings for full module declaration support"); + } done.resolve(config); }); moduleStream.end(); diff --git a/ts/npmts.compile.ts b/ts/npmts.compile.ts index 5f4cef5..c57be38 100644 --- a/ts/npmts.compile.ts +++ b/ts/npmts.compile.ts @@ -45,6 +45,15 @@ export let run = function (configArg) { moduleStream.on("queueDrain", function () { plugins.beautylog.ok("TypeScript has been compiled!"); moduleStream.on("finish", function () { + try { + if(config.mode = "default") plugins.fs.copySync( + plugins.path.join(paths.cwd,"ts/typings"), + plugins.path.join(paths.cwd,"dist/typings") + ); + } + catch (err){ + plugins.beautylog.warn("failed to copy external typings for full module declaration support"); + } done.resolve(config); }); moduleStream.end();