fitzroy 1.7.2 → 1.8.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/README.md +3 -0
- package/dist/cli.js +8 -3
- package/package.json +1 -2
package/README.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# fitzroy
|
|
2
2
|
|
|
3
|
+
[](https://github.com/jackemcpherson/fitzRoy-ts/actions/workflows/ci.yml)
|
|
4
|
+
[](https://www.npmjs.com/package/fitzroy)
|
|
5
|
+
|
|
3
6
|
TypeScript library and CLI for AFL data — match results, player stats, fixtures, ladders, lineups, squads, and teams.
|
|
4
7
|
|
|
5
8
|
A port of the [fitzRoy R package](https://github.com/jimmyday12/fitzRoy).
|
package/dist/cli.js
CHANGED
|
@@ -5322,6 +5322,7 @@ var init_lineup3 = __esm({
|
|
|
5322
5322
|
...REQUIRED_ROUND_FLAG,
|
|
5323
5323
|
match: { type: "string", description: "Filter by team name to find a specific match" },
|
|
5324
5324
|
"match-id": { type: "string", description: "Specific match provider ID (advanced)" },
|
|
5325
|
+
...TEAM_FLAG,
|
|
5325
5326
|
...SOURCE_FLAG,
|
|
5326
5327
|
...COMPETITION_FLAG,
|
|
5327
5328
|
...OUTPUT_FLAGS
|
|
@@ -5332,6 +5333,7 @@ var init_lineup3 = __esm({
|
|
|
5332
5333
|
const source = validateSource(args.source);
|
|
5333
5334
|
const competition = validateCompetition(args.competition);
|
|
5334
5335
|
const format = validateFormat(args.format);
|
|
5336
|
+
const team = args.team ? await resolveTeamNameOrPrompt(args.team) : void 0;
|
|
5335
5337
|
let matchId = args["match-id"];
|
|
5336
5338
|
if (!matchId && args.match) {
|
|
5337
5339
|
const client = new AflApiClient();
|
|
@@ -5348,8 +5350,11 @@ var init_lineup3 = __esm({
|
|
|
5348
5350
|
if (!result.success) {
|
|
5349
5351
|
throw result.error;
|
|
5350
5352
|
}
|
|
5351
|
-
const data = result.data;
|
|
5352
|
-
|
|
5353
|
+
const data = team ? result.data.filter((l) => l.homeTeam === team || l.awayTeam === team) : result.data;
|
|
5354
|
+
const teamSuffix = team ? ` for ${team}` : "";
|
|
5355
|
+
showSummary(
|
|
5356
|
+
`Loaded ${data.length} lineup${data.length === 1 ? "" : "s"} for ${season} round ${round}${teamSuffix}`
|
|
5357
|
+
);
|
|
5353
5358
|
const formatOptions = {
|
|
5354
5359
|
json: args.json,
|
|
5355
5360
|
csv: args.csv,
|
|
@@ -5796,7 +5801,7 @@ resolveAliases();
|
|
|
5796
5801
|
var main = defineCommand11({
|
|
5797
5802
|
meta: {
|
|
5798
5803
|
name: "fitzroy",
|
|
5799
|
-
version: "1.
|
|
5804
|
+
version: "1.8.0",
|
|
5800
5805
|
description: "TypeScript port of the fitzRoy R package \u2014 fetch AFL data from the command line"
|
|
5801
5806
|
},
|
|
5802
5807
|
subCommands: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "fitzroy",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.8.0",
|
|
4
4
|
"description": "TypeScript port of the fitzRoy R package — programmatic access to AFL data including match results, player stats, fixtures, ladders, and more",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -46,7 +46,6 @@
|
|
|
46
46
|
"@jackemcpherson/rds-js": "0.2.0",
|
|
47
47
|
"cheerio": "^1.0.0",
|
|
48
48
|
"citty": "^0.2.1",
|
|
49
|
-
"fitzroy": "^1.4.1",
|
|
50
49
|
"picocolors": "^1.1.1",
|
|
51
50
|
"zod": "^4.3.6"
|
|
52
51
|
},
|