From 98ad7d1f6201e7294bd0bc81d72af0d34d88c5c5 Mon Sep 17 00:00:00 2001 From: Rene Saarsoo Date: Sun, 4 Oct 2020 15:11:23 +0300 Subject: [PATCH] Switch to properly released zwiftout lib --- package.json | 3 ++- src/App.tsx | 2 +- src/components/Bar.tsx | 2 +- src/components/WorkoutPlot.tsx | 2 +- src/components/WorkoutStats.tsx | 2 +- src/components/ZwoOutput.tsx | 2 +- src/components/formatDuration.ts | 2 +- yarn.lock | 24 ++++++++++++++++++++++++ 8 files changed, 32 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 950de03..3863cb6 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,8 @@ "react-scripts": "3.4.3", "react-simple-code-editor": "^0.11.0", "styled-components": "^5.2.0", - "typescript": "~3.7.2" + "typescript": "~3.7.2", + "zwiftout": "^0.1.0" }, "scripts": { "start": "react-scripts start", diff --git a/src/App.tsx b/src/App.tsx index a62bbb5..4eb7492 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -1,7 +1,7 @@ import React, { useState, useCallback } from 'react'; import { WorkoutPlot } from './components/WorkoutPlot'; import { WorkoutStats } from './components/WorkoutStats'; -import { parse, chunkRangeIntervals, Duration } from 'make-workout'; +import { parse, chunkRangeIntervals, Duration } from 'zwiftout'; import { ErrorMessage } from './components/ErrorMessage'; import styled from 'styled-components'; import { CodeEditor } from './components/CodeEditor'; diff --git a/src/components/Bar.tsx b/src/components/Bar.tsx index ce980d6..595e5e2 100644 --- a/src/components/Bar.tsx +++ b/src/components/Bar.tsx @@ -1,5 +1,5 @@ import styled from "styled-components"; -import { ZoneType } from "make-workout"; +import { ZoneType } from "zwiftout"; export type BarProps = { // Percentage of total workout length diff --git a/src/components/WorkoutPlot.tsx b/src/components/WorkoutPlot.tsx index 4a5e57b..6c15ece 100644 --- a/src/components/WorkoutPlot.tsx +++ b/src/components/WorkoutPlot.tsx @@ -1,6 +1,6 @@ import React from "react"; import styled from "styled-components"; -import { Interval, Intensity, Duration, totalDuration, maximumIntensity } from "make-workout"; +import { Interval, Intensity, Duration, totalDuration, maximumIntensity } from "zwiftout"; import { BarProps, Bar } from "./Bar"; const toBarProps = (interval: Interval, workoutDuration: Duration, maxIntensity: Intensity): BarProps => ({ diff --git a/src/components/WorkoutStats.tsx b/src/components/WorkoutStats.tsx index a9e3698..15e2c9f 100644 --- a/src/components/WorkoutStats.tsx +++ b/src/components/WorkoutStats.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { stats, Workout, Intensity } from 'make-workout'; +import { stats, Workout, Intensity } from 'zwiftout'; import { formatDuration } from './formatDuration'; import styled from 'styled-components'; diff --git a/src/components/ZwoOutput.tsx b/src/components/ZwoOutput.tsx index 2493654..fc91335 100644 --- a/src/components/ZwoOutput.tsx +++ b/src/components/ZwoOutput.tsx @@ -1,5 +1,5 @@ import React from 'react'; -import { Workout, generateZwo } from 'make-workout'; +import { Workout, generateZwo } from 'zwiftout'; import styled from 'styled-components'; const Header = styled.h2` diff --git a/src/components/formatDuration.ts b/src/components/formatDuration.ts index 877b0ab..fe9f780 100644 --- a/src/components/formatDuration.ts +++ b/src/components/formatDuration.ts @@ -1,4 +1,4 @@ -import { Duration } from "make-workout"; +import { Duration } from "zwiftout"; const splitDuration = (duration: Duration) => ({ hours: Math.floor(duration.seconds / 60 / 60), diff --git a/yarn.lock b/yarn.lock index 9b9b88a..ca30340 100644 --- a/yarn.lock +++ b/yarn.lock @@ -2130,6 +2130,11 @@ argparse@^1.0.7: dependencies: sprintf-js "~1.0.2" +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + aria-query@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-3.0.0.tgz#65b3fcc1ca1155a8c9ae64d6eee297f15d5133cc" @@ -8630,6 +8635,11 @@ raf@^3.4.1: dependencies: performance-now "^2.1.0" +ramda@^0.27.1: + version "0.27.1" + resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.27.1.tgz#66fc2df3ef873874ffc2da6aa8984658abacf5c9" + integrity sha512-PgIdVpn5y5Yns8vqb8FzBUEYn98V3xcPgawAkkgj0YJ0qDsnHCiNmZYfOGMgOvoB0eWFLpYbhxUR3mxfDIMvpw== + randombytes@^2.0.0, randombytes@^2.0.1, randombytes@^2.0.5, randombytes@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a" @@ -10930,6 +10940,11 @@ xml-name-validator@^3.0.0: resolved "https://registry.yarnpkg.com/xml-name-validator/-/xml-name-validator-3.0.0.tgz#6ae73e06de4d8c6e47f9fb181f78d648ad457c6a" integrity sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw== +xml@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/xml/-/xml-1.0.1.tgz#78ba72020029c5bc87b8a81a3cfcd74b4a2fc1e5" + integrity sha1-eLpyAgApxbyHuKgaPPzXS0ovweU= + xmlchars@^2.1.1: version "2.2.0" resolved "https://registry.yarnpkg.com/xmlchars/-/xmlchars-2.2.0.tgz#060fe1bcb7f9c76fe2a17db86a9bc3ab894210cb" @@ -10992,3 +11007,12 @@ yargs@^13.3.0, yargs@^13.3.2: which-module "^2.0.0" y18n "^4.0.0" yargs-parser "^13.1.2" + +zwiftout@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/zwiftout/-/zwiftout-0.1.0.tgz#7f59650839fef1e50f78ee61ad3b3113235dd39f" + integrity sha512-WCF1B3dqqTGu8rVmZXiWOkx1k8c2mfQlDTZbgjVVivP54/H6t8OgCudKaPPbL50dQs/ghFr5iXRTQXwWQkhSBQ== + dependencies: + argparse "^2.0.1" + ramda "^0.27.1" + xml "^1.0.1"