fit-file-parser 3.0.0 → 3.0.2
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/cjs/fit-parser.js +13 -1
- package/dist/cjs/fit.js +359 -0
- package/dist/cjs/fit_types.d.ts +54 -2
- package/dist/cjs/type_generator.js +4 -0
- package/dist/fit-parser.js +13 -1
- package/dist/fit.js +359 -0
- package/dist/fit_types.d.ts +54 -2
- package/dist/type_generator.js +4 -0
- package/package.json +9 -2
- package/.agent/rules/fit-parser-dev.md +0 -35
- package/.agent/skills/add-fit-message/SKILL.md +0 -29
- package/.agent/workflows/fit-workflows.md +0 -28
- package/.editorconfig +0 -3
- package/.github/workflows/ci.yml +0 -40
- package/.vscode/extensions.json +0 -6
- package/.vscode/launch.json +0 -27
- package/.vscode/tasks.json +0 -34
- package/INVESTIGATING.md +0 -50
- package/check_ids.js +0 -24
- package/check_jump_fields.js +0 -46
- package/codegen/codegen.ts +0 -9
- package/eslint.config.js +0 -20
- package/find_field.js +0 -23
- package/find_field_esm.js +0 -28
- package/inspect_parser.ts +0 -34
- package/output.txt +0 -154
- package/scan_jumps.js +0 -29
- package/scripts/deep_probe.js +0 -74
- package/scripts/inspect_fit.js +0 -69
- package/tsconfig.cjs.json +0 -8
- package/tsconfig.json +0 -16
- package/vitest.config.js +0 -8
package/scripts/inspect_fit.js
DELETED
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import fs from 'fs'
|
|
2
|
-
import { createRequire } from 'module'
|
|
3
|
-
|
|
4
|
-
const require = createRequire(import.meta.url)
|
|
5
|
-
// Try to load from local build or node_modules
|
|
6
|
-
let FitParser
|
|
7
|
-
try {
|
|
8
|
-
FitParser = require('../dist/fit-parser.js').default
|
|
9
|
-
}
|
|
10
|
-
catch (e) {
|
|
11
|
-
FitParser = require('fit-file-parser').default
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const args = process.argv.slice(2)
|
|
15
|
-
if (args.length < 1) {
|
|
16
|
-
console.log('Usage: node inspect_fit.js <path_to_fit_file> [message_key]')
|
|
17
|
-
console.log('Example: node inspect_fit.js ../examples/jumps-mtb.fit jumps')
|
|
18
|
-
process.exit(1)
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
const filePath = args[0]
|
|
22
|
-
const messageKey = args[1]
|
|
23
|
-
|
|
24
|
-
try {
|
|
25
|
-
const content = fs.readFileSync(filePath)
|
|
26
|
-
const fitParser = new FitParser({
|
|
27
|
-
force: true,
|
|
28
|
-
mode: 'both',
|
|
29
|
-
speedUnit: 'm/s',
|
|
30
|
-
lengthUnit: 'm',
|
|
31
|
-
})
|
|
32
|
-
|
|
33
|
-
fitParser.parse(content, (error, data) => {
|
|
34
|
-
if (error) {
|
|
35
|
-
console.error('Error parsing FIT file:', error)
|
|
36
|
-
return
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (messageKey) {
|
|
40
|
-
if (data[messageKey]) {
|
|
41
|
-
console.log(`\n=== ${messageKey.toUpperCase()} (${Array.isArray(data[messageKey]) ? data[messageKey].length : 'object'}) ===`)
|
|
42
|
-
console.log(JSON.stringify(data[messageKey], null, 2))
|
|
43
|
-
}
|
|
44
|
-
else if (data.activity && data.activity[messageKey]) {
|
|
45
|
-
console.log(`\n=== ACTIVITY.${messageKey.toUpperCase()} ===`)
|
|
46
|
-
console.log(JSON.stringify(data.activity[messageKey], null, 2))
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
console.log(`\nMessage key '${messageKey}' not found in root or activity object.`)
|
|
50
|
-
console.log('Available keys:', Object.keys(data).join(', '))
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
else {
|
|
54
|
-
console.log('\n=== ROOT KEYS ===')
|
|
55
|
-
console.log(Object.keys(data).join('\n'))
|
|
56
|
-
|
|
57
|
-
// Print summary of counts
|
|
58
|
-
console.log('\n=== SUMMARY ===')
|
|
59
|
-
Object.keys(data).forEach((key) => {
|
|
60
|
-
if (Array.isArray(data[key])) {
|
|
61
|
-
console.log(`${key}: ${data[key].length} items`)
|
|
62
|
-
}
|
|
63
|
-
})
|
|
64
|
-
}
|
|
65
|
-
})
|
|
66
|
-
}
|
|
67
|
-
catch (e) {
|
|
68
|
-
console.error('Error reading file:', e.message)
|
|
69
|
-
}
|
package/tsconfig.cjs.json
DELETED
package/tsconfig.json
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "es6",
|
|
4
|
-
"rootDir": "./src",
|
|
5
|
-
"module": "Node16",
|
|
6
|
-
"strict": true,
|
|
7
|
-
"declaration": true,
|
|
8
|
-
"outDir": "./dist",
|
|
9
|
-
"esModuleInterop": true,
|
|
10
|
-
"forceConsistentCasingInFileNames": true,
|
|
11
|
-
"skipLibCheck": true
|
|
12
|
-
},
|
|
13
|
-
"include": ["src/**/*"],
|
|
14
|
-
"exclude": ["node_modules"]
|
|
15
|
-
|
|
16
|
-
}
|