From bdba0ecc52b4c3e31b6f76076a6c1063eb7eced6 Mon Sep 17 00:00:00 2001 From: Rene Saarsoo Date: Thu, 1 Oct 2020 20:32:23 +0300 Subject: [PATCH] Change main index file to only perform export of functions --- bin/make-workout.js | 5 +---- src/index.ts | 19 ++++--------------- 2 files changed, 5 insertions(+), 19 deletions(-) diff --git a/bin/make-workout.js b/bin/make-workout.js index 8211972..bf3d617 100755 --- a/bin/make-workout.js +++ b/bin/make-workout.js @@ -1,10 +1,7 @@ #!/usr/bin/env node /* eslint-disable @typescript-eslint/no-var-requires */ const fs = require("fs"); -const { generateZwo } = require("../dist/generateZwo"); -const { parse } = require("../dist/parser"); -const { stats } = require("../dist/stats"); -const { parseCliOptions } = require("../dist/parseCliOptions"); +const { generateZwo, parse, stats, parseCliOptions } = require("../dist/index"); const opts = parseCliOptions(); diff --git a/src/index.ts b/src/index.ts index 5211987..5b7f335 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,15 +1,4 @@ -import * as fs from "fs"; -import { generateZwo } from "./generateZwo"; -import { parse } from "./parser"; -import { stats } from "./stats"; -import { parseCliOptions } from "./parseCliOptions"; - -const opts = parseCliOptions(); - -const workout = parse(fs.readFileSync(opts.file, "utf8")); - -if (opts.stats) { - console.log(stats(workout)); -} else { - console.log(generateZwo(workout)); -} +export { generateZwo } from "./generateZwo"; +export { parse } from "./parser"; +export { stats } from "./stats"; +export { parseCliOptions } from "./parseCliOptions";