Initial commit

This commit is contained in:
Rene Saarsoo 2020-09-17 22:47:18 +03:00
commit ae31567cbf
7 changed files with 171 additions and 0 deletions

1
.gitignore vendored Normal file
View File

@ -0,0 +1 @@
node_modules/

View File

@ -0,0 +1,21 @@
Name: Threshold pushing
Author: R.Saarsoo
Description:
Start with a good warm up (10 minutes Zone 1, then 5 minutes Zone 2,
5 minutes Zone 3 followed by 5 minutes easy spinning).
Then straight in at Threshold Pushing powers for 12 mins.
Have 10 mins easy soft pedalling and repeat - warm down 15 minutes.
This session is designed to increase your FTP from below.
Working predominately aerobic metabolism.
In time your body will become more comfortable at these powers
and your FTP will increase.
Warmup: 20:00 45%..75%
Rest: 5:00 52%
Interval: 12:00 100% 90rpm
Rest: 10:00 52%
Interval: 12:00 100% 90rpm
Rest: 10:00 52%
Cooldown: 10:00 65%..45%

View File

@ -0,0 +1,31 @@
<workout_file>
<author>R.Saarsoo</author>
<name>Threshold pushing</name>
<description>
Start with a good warm up (10 minutes Zone 1, then 5 minutes Zone 2,
5 minutes Zone 3 followed by 5 minutes easy spinning).
Then straight in at Threshold Pushing powers for 12 mins.
Have 10 mins easy soft pedalling and repeat - warm down 15 minutes.
This session is designed to increase your FTP from below.
Working predominately aerobic metabolism.
In time your body will become more comfortable at these powers
and your FTP will increase.
</description>
<sportType>bike</sportType>
<tags/>
<workout>
<Warmup Duration="1200" PowerLow="0.45" PowerHigh="0.75" />
<SteadyState Duration="300" Power="0.52" />
<SteadyState Duration="720" Power="1.00" Cadence="90" />
<SteadyState Duration="600" Power="0.52" />
<SteadyState Duration="720" Power="1.00" Cadence="90" />
<SteadyState Duration="600" Power="0.52" />
<Cooldown Duration="600" PowerLow="0.65" PowerHigh="0.45" />
</workout>
</workout_file>

14
package.json Normal file
View File

@ -0,0 +1,14 @@
{
"name": "make-workout",
"version": "0.0.0",
"license": "GPL-3.0-or-later",
"scripts": {
"lint:ts": "tsc --no-emit",
"test": "ts-node src/index.ts examples/threshold-pushing.txt"
},
"devDependencies": {
"@types/node": "^14.10.3",
"ts-node": "^9.0.0",
"typescript": "^4.0.2"
}
}

30
src/index.ts Normal file
View File

@ -0,0 +1,30 @@
import * as fs from "fs";
type Def = {
type: string;
text: string;
};
const parseDefinition = (line: string): Def | undefined => {
const matches = line.match(/^(\w+):(.*)$/);
if (!matches) {
return undefined;
}
return {
type: matches[1],
text: matches[2],
}
};
const isDefined = <T>(x: T | undefined): x is T => Boolean(x);
const filename = process.argv[2];
console.log(`Parsing: ${filename}`);
const file = fs.readFileSync(filename, "utf8");
file.split(/\n/)
.map(parseDefinition)
.filter(isDefined)
.forEach((def) => console.log(def.type));

12
tsconfig.json Normal file
View File

@ -0,0 +1,12 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"sourceMap": true,
"outDir": "dist",
"strict": true,
},
"include": [
"src/**/*"
]
}

62
yarn.lock Normal file
View File

@ -0,0 +1,62 @@
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@types/node@^14.10.3":
version "14.10.3"
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.10.3.tgz#5ae1f119c96643fc9b19b2d1a83bfa2ec3dbb7ea"
integrity sha512-zdN0hor7TLkjAdKTnYW+Y22oIhUUpil5ZD1V1OFq0CR0CLKw+NdR6dkziTfkWRLo6sKzisayoj/GNpNbe4LY9Q==
arg@^4.1.0:
version "4.1.3"
resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089"
integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==
buffer-from@^1.0.0:
version "1.1.1"
resolved "https://registry.yarnpkg.com/buffer-from/-/buffer-from-1.1.1.tgz#32713bc028f75c02fdb710d7c7bcec1f2c6070ef"
integrity sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==
diff@^4.0.1:
version "4.0.2"
resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d"
integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==
make-error@^1.1.1:
version "1.3.6"
resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2"
integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==
source-map-support@^0.5.17:
version "0.5.19"
resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.19.tgz#a98b62f86dcaf4f67399648c085291ab9e8fed61"
integrity sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==
dependencies:
buffer-from "^1.0.0"
source-map "^0.6.0"
source-map@^0.6.0:
version "0.6.1"
resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.6.1.tgz#74722af32e9614e9c287a8d0bbde48b5e2f1a263"
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==
ts-node@^9.0.0:
version "9.0.0"
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-9.0.0.tgz#e7699d2a110cc8c0d3b831715e417688683460b3"
integrity sha512-/TqB4SnererCDR/vb4S/QvSZvzQMJN8daAslg7MeaiHvD8rDZsSfXmNeNumyZZzMned72Xoq/isQljYSt8Ynfg==
dependencies:
arg "^4.1.0"
diff "^4.0.1"
make-error "^1.1.1"
source-map-support "^0.5.17"
yn "3.1.1"
typescript@^4.0.2:
version "4.0.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.2.tgz#7ea7c88777c723c681e33bf7988be5d008d05ac2"
integrity sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==
yn@3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"
integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==