trackswap 0.0.27 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/types.d.ts CHANGED
@@ -70,6 +70,7 @@ export interface ActivityLengthType extends LengthMesgType {
70
70
  export interface ActivityLapType extends LapMesgType {
71
71
  index: number;
72
72
  endTime?: Date;
73
+ routeName?: string;
73
74
  records: ActivityRecordType[];
74
75
  lengths: ActivityLengthType[];
75
76
  }
package/dist/util.d.ts ADDED
@@ -0,0 +1,25 @@
1
+ export declare const convertGPXExtensionsMapping: {
2
+ heartrate: string;
3
+ "gpxtpx:hr": string;
4
+ "ns3:hr": string;
5
+ "gpxdata:hr": string;
6
+ "gpxdata:cadence": string;
7
+ "gpxtpx:cad": string;
8
+ "ns3:cad": string;
9
+ cadence: string;
10
+ "gpxtpx:speed": string;
11
+ "ns3:speed": string;
12
+ speed: string;
13
+ power: string;
14
+ "gpxdata:power": string;
15
+ "gpxpx:PowerInWatts": string;
16
+ PowerInWatts: string;
17
+ "gpxtpx:temp": string;
18
+ "gpxtpx:wtemp": string;
19
+ "gpxtpx:atemp": string;
20
+ "gpxx:Temperature": string;
21
+ "gpxx:Depth": string;
22
+ };
23
+ export declare const semicirclesToDegrees: (semicircles: number) => number;
24
+ export declare const FIT_SEMICIRCLE_INVALID_SINT32 = 2147483647;
25
+ export declare function normalizeFitSemicircleToDegrees(raw: unknown, precision?: number): number | undefined;
package/package.json CHANGED
@@ -1,15 +1,16 @@
1
1
  {
2
2
  "name": "trackswap",
3
- "version": "0.0.27",
4
- "description": "A powerful and flexible GPX parser and encoder library for Node.js and TypeScript. TrackSwap provides comprehensive support for GPX 1.1 format with advanced features like plugin system, middleware support, and optimized performance.",
3
+ "version": "0.2.0",
4
+ "description": "A typed, adapter-based toolkit for decoding, normalizing and transcoding FIT, GPX and TCX data.",
5
+ "type": "module",
5
6
  "main": "dist/index.cjs",
6
7
  "module": "dist/index.js",
7
8
  "types": "dist/index.d.ts",
8
9
  "exports": {
9
10
  ".": {
10
- "types": "./dist/index.d.ts",
11
11
  "import": "./dist/index.js",
12
- "require": "./dist/index.cjs"
12
+ "require": "./dist/index.cjs",
13
+ "types": "./dist/index.d.ts"
13
14
  }
14
15
  },
15
16
  "files": [
@@ -31,15 +32,22 @@
31
32
  "build:cjs": "NODE_ENV=production FORMAT=cjs node build.config.js",
32
33
  "build:dev": "npm run clean && npm run build:types && NODE_ENV=development node build.config.js",
33
34
  "build:optimize": "node scripts/optimize-dist.js",
34
- "verify:types": "node -e \"const fs=require('fs'); const files=['dist/index.d.ts','dist/TrackSwap.d.ts','dist/types.d.ts']; const missing=files.filter((f)=>!fs.existsSync(f)); if(missing.length){console.error('Missing type artifacts:', missing.join(', ')); process.exit(1);} console.log('Type artifacts verified');\"",
35
- "build:js": "esbuild src/index.ts --bundle --platform=node --target=node14 --format=esm --outfile=dist/index.js --minify --sourcemap",
35
+ "build:js": "esbuild src/index.ts --bundle --platform=node --target=node18 --format=esm --outfile=dist/index.js --minify --sourcemap",
36
36
  "build:tsc": "tsc && npm run minify",
37
37
  "minify": "terser dist/**/*.js --compress --mangle --output dist/index.min.js --source-map",
38
38
  "analyze": "NODE_ENV=production ANALYZE=true node build.config.js",
39
39
  "start": "node dist/index.js",
40
40
  "test:gpx": "cd example/gpx && rm -f output* *.json *_encoded.xml && node test.js",
41
41
  "test:fit": "cd example/FIT && rm -rf output && node test.js",
42
- "prepublishOnly": "npm run build && npm run verify:types"
42
+ "test:fit-coords": "npm run build:dev && node scripts/verify-fit-coordinates.mjs",
43
+ "test:tcx-course": "npm run build:dev && node scripts/tcx-course-smoke.mjs",
44
+ "test:routes-fit": "npm run build:dev && node scripts/routes-only-fit-smoke.mjs",
45
+ "test": "npm run test:architecture && npm run test:health && npm run test:garmin-parity",
46
+ "test:architecture": "esbuild test/architecture.test.ts --bundle --platform=node --target=node18 --format=esm --outfile=/tmp/trackswap-architecture.test.mjs && node /tmp/trackswap-architecture.test.mjs",
47
+ "test:health": "esbuild test/health-fit.test.ts --bundle --platform=node --target=node18 --format=esm --outfile=/tmp/trackswap-health-fit.test.mjs && node /tmp/trackswap-health-fit.test.mjs",
48
+ "test:garmin-parity": "esbuild test/garmin-sdk-parity.test.ts --bundle --platform=node --target=node18 --format=esm --outfile=/tmp/trackswap-garmin-sdk-parity.test.mjs && node /tmp/trackswap-garmin-sdk-parity.test.mjs",
49
+ "test:package": "node scripts/verify-package.mjs",
50
+ "prepublishOnly": "npm run build"
43
51
  },
44
52
  "keywords": [
45
53
  "gpx",
@@ -60,14 +68,14 @@
60
68
  "license": "MIT",
61
69
  "repository": {
62
70
  "type": "git",
63
- "url": "https://github.com/berber1016/trackswap.git"
71
+ "url": "git+https://github.com/berber1016/trackswap.git"
64
72
  },
65
73
  "homepage": "https://github.com/berber1016/trackswap#readme",
66
74
  "bugs": {
67
75
  "url": "https://github.com/berber1016/trackswap/issues"
68
76
  },
69
77
  "engines": {
70
- "node": ">=14.0.0"
78
+ "node": ">=18.0.0"
71
79
  },
72
80
  "devDependencies": {
73
81
  "@types/node": "^22.15.24",