diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 36211ec2..1e581868 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -31,7 +31,7 @@ on:
- main
env:
- VERSION_NUMBER: 'v1.9.1'
+ VERSION_NUMBER: 'v1.9.2'
DOCKERHUB_REGISTRY_NAME: 'digitalghostdev/poke-cli'
AWS_REGION: 'us-west-2'
diff --git a/.github/workflows/python_testing.yml b/.github/workflows/python_testing.yml
index a188d6ae..854949ce 100644
--- a/.github/workflows/python_testing.yml
+++ b/.github/workflows/python_testing.yml
@@ -1,12 +1,6 @@
name: Python Tests
on:
- push:
- branches:
- - main
- paths:
- - 'card_data/**'
- - 'web/**'
pull_request:
types: [opened, reopened, synchronize]
paths:
diff --git a/.goreleaser.yml b/.goreleaser.yml
index fdaea092..f5e6bac1 100644
--- a/.goreleaser.yml
+++ b/.goreleaser.yml
@@ -14,7 +14,7 @@ builds:
- windows
- darwin
ldflags:
- - -s -w -X main.version=v1.9.1
+ - -s -w -X main.version=v1.9.2
archives:
- formats: [ 'zip' ]
diff --git a/Dockerfile b/Dockerfile
index f3af9367..5480709f 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -8,7 +8,7 @@ RUN go mod download
COPY . .
-RUN go build -ldflags "-X main.version=v1.9.1" -o poke-cli .
+RUN go build -ldflags "-X main.version=v1.9.2" -o poke-cli .
# build 2
FROM --platform=$BUILDPLATFORM alpine:3.23
diff --git a/README.md b/README.md
index 2d0fc9be..50944d4e 100644
--- a/README.md
+++ b/README.md
@@ -2,7 +2,7 @@
-
+
@@ -99,11 +99,11 @@ Cloudsmith is a fully cloud-based service that lets you easily create, store, an
3. Choose how to interact with the container:
* Run a single command and exit:
```bash
- docker run --rm -it digitalghostdev/poke-cli:v1.9.1 [subcommand] [flag]
+ docker run --rm -it digitalghostdev/poke-cli:v1.9.2 [subcommand] [flag]
```
* Enter the container and use its shell:
```bash
- docker run --rm -it --name poke-cli --entrypoint /bin/sh digitalghostdev/poke-cli:v1.9.1 -c "cd /app && exec sh"
+ docker run --rm -it --name poke-cli --entrypoint /bin/sh digitalghostdev/poke-cli:v1.9.2 -c "cd /app && exec sh"
# placed into the /app directory, run the program with './poke-cli'
# example: ./poke-cli ability swift-swim
```
@@ -112,13 +112,13 @@ Cloudsmith is a fully cloud-based service that lets you easily create, store, an
> The `card` command renders TCG card images using your terminal's graphics protocol. When running inside Docker, pass your terminal's environment variables so image rendering works correctly:
> ```bash
> # Kitty
-> docker run --rm -it -e TERM -e KITTY_WINDOW_ID digitalghostdev/poke-cli:v1.9.1 card
+> docker run --rm -it -e TERM -e KITTY_WINDOW_ID digitalghostdev/poke-cli:v1.9.2 card
>
> # WezTerm, iTerm2, Ghostty, Konsole, Rio, Tabby
-> docker run --rm -it -e TERM -e TERM_PROGRAM digitalghostdev/poke-cli:v1.9.1 card
+> docker run --rm -it -e TERM -e TERM_PROGRAM digitalghostdev/poke-cli:v1.9.2 card
>
> # Windows Terminal (Sixel)
-> docker run --rm -it -e WT_SESSION digitalghostdev/poke-cli:v1.9.1 card
+> docker run --rm -it -e WT_SESSION digitalghostdev/poke-cli:v1.9.2 card
> ```
> If your terminal is not listed above, image rendering is not supported inside Docker.
diff --git a/card_data/pipelines/poke_cli_dbt/dbt_project.yml b/card_data/pipelines/poke_cli_dbt/dbt_project.yml
index f5fdbb32..d684c534 100644
--- a/card_data/pipelines/poke_cli_dbt/dbt_project.yml
+++ b/card_data/pipelines/poke_cli_dbt/dbt_project.yml
@@ -1,5 +1,5 @@
name: 'poke_cli_dbt'
-version: '1.9.0'
+version: '1.9.2'
profile: 'poke_cli_dbt'
diff --git a/cmd/pokemon/pokemon.go b/cmd/pokemon/pokemon.go
index f1e5e015..db6a974e 100644
--- a/cmd/pokemon/pokemon.go
+++ b/cmd/pokemon/pokemon.go
@@ -93,28 +93,77 @@ func PokemonCommand() (string, error) {
}
}
- eggGroup := func(w io.Writer) {
- var eggGroupSlice []string
+ eggInformation := func(w io.Writer) {
+ var eggInformationSlice []string
+
+ modernEggInformationNames := map[string]string{
+ "indeterminate": "Amorphous",
+ "ground": "Field",
+ "humanshape": "Human-Like",
+ "plant": "Grass",
+ "no-eggs": "Undiscovered",
+ }
for _, entry := range pokemonSpeciesStruct.EggGroups {
- modernEggGroupNames := map[string]string{
- "indeterminate": "Amorphous",
- "ground": "Field",
- "humanshape": "Human-Like",
- "plant": "Grass",
- "no-eggs": "Undiscovered",
+ if name, exists := modernEggInformationNames[entry.Name]; exists {
+ eggInformationSlice = append(eggInformationSlice, name)
+ } else {
+ eggInformationSlice = append(eggInformationSlice, cases.Title(language.English).String(entry.Name))
}
+ }
- if name, exists := modernEggGroupNames[entry.Name]; exists {
- eggGroupSlice = append(eggGroupSlice, name)
- } else {
- capitalizedEggGroup := cases.Title(language.English).String(entry.Name)
- eggGroupSlice = append(eggGroupSlice, capitalizedEggGroup)
+ sort.Strings(eggInformationSlice)
+
+ genderRate := pokemonSpeciesStruct.GenderRate
+ m := map[int]string{
+ -1: "Genderless",
+ 0: "0% F",
+ 1: "12.5% F",
+ 2: "25% F",
+ 3: "37.5% F",
+ 4: "50% F",
+ 5: "62.5% F",
+ 6: "75% F",
+ 7: "87.5% F",
+ 8: "100% F",
+ }
+
+ hatchCounter := pokemonSpeciesStruct.HatchCounter
+
+ fmt.Fprintf(w,
+ "\n%s %s %s\n%s %s %s\n%s %s %d",
+ styling.ColoredBullet,
+ "Egg Group(s):", strings.Join(eggInformationSlice, ", "),
+ styling.ColoredBullet,
+ "Gender Rate:", m[genderRate],
+ styling.ColoredBullet,
+ "Egg Cycles:", hatchCounter,
+ )
+ }
+
+ effortValues := func(w io.Writer) {
+ nameMapping := map[string]string{
+ "hp": "HP",
+ "attack": "Atk",
+ "defense": "Def",
+ "special-attack": "SpA",
+ "special-defense": "SpD",
+ "speed": "Spd",
+ }
+
+ var evs []string
+
+ for _, effortValue := range pokemonStruct.Stats {
+ if effortValue.Effort > 0 {
+ name, ok := nameMapping[effortValue.Stat.Name]
+ if !ok {
+ name = "Missing from API"
+ }
+ evs = append(evs, fmt.Sprintf("%d %s", effortValue.Effort, name))
}
}
- sort.Strings(eggGroupSlice)
- fmt.Fprintf(w, "\n%s %s %s", styling.ColoredBullet, "Egg Group(s):", strings.Join(eggGroupSlice, ", "))
+ fmt.Fprintf(w, "\n%s Effort Values: %s", styling.ColoredBullet, strings.Join(evs, ", "))
}
typing := func(w io.Writer) {
@@ -176,22 +225,24 @@ func PokemonCommand() (string, error) {
}
var (
- entryOutput bytes.Buffer
- eggGroupOutput bytes.Buffer
- typeOutput bytes.Buffer
- metricsOutput bytes.Buffer
- speciesOutput bytes.Buffer
+ entryOutput bytes.Buffer
+ eggGroupOutput bytes.Buffer
+ typeOutput bytes.Buffer
+ metricsOutput bytes.Buffer
+ speciesOutput bytes.Buffer
+ effortValuesOutput bytes.Buffer
)
entry(&entryOutput)
- eggGroup(&eggGroupOutput)
+ eggInformation(&eggGroupOutput)
typing(&typeOutput)
metrics(&metricsOutput)
species(&speciesOutput)
+ effortValues(&effortValuesOutput)
fmt.Fprintf(&output,
- "Your selected Pokémon: %s\n%s\n%s%s%s%s\n",
- capitalizedString, entryOutput.String(), typeOutput.String(), metricsOutput.String(), speciesOutput.String(), eggGroupOutput.String(),
+ "Your selected Pokémon: %s\n%s\n%s%s%s%s%s\n",
+ capitalizedString, entryOutput.String(), typeOutput.String(), metricsOutput.String(), speciesOutput.String(), eggGroupOutput.String(), effortValuesOutput.String(),
)
if *pf.Image != "" || *pf.ShortImage != "" {
diff --git a/cmd/utils/validateargs.go b/cmd/utils/validateargs.go
index 25bc7630..ee0e4551 100644
--- a/cmd/utils/validateargs.go
+++ b/cmd/utils/validateargs.go
@@ -40,7 +40,13 @@ func ValidateArgs(args []string, v Validator) error {
return err
}
if v.RequireName && len(args) == 2 {
- return fmt.Errorf("✖ Error! Please specify a(n) %s", v.CmdName)
+ errMessage := styling.ErrorBorder.Render(
+ styling.ErrorColor.Render("✖ Error!"),
+ fmt.Sprintf("\nPlease declare a(n) %s's name after the <%s> command", v.CmdName, v.CmdName),
+ fmt.Sprintf("\nRun 'poke-cli %s -h' for more details", v.CmdName),
+ "\nerror: insufficient arguments",
+ )
+ return fmt.Errorf("%s", errMessage)
}
if !v.HasFlags && !v.RequireName {
if err := checkNoOtherOptions(args, v.MaxArgs, v.CmdName); err != nil {
diff --git a/docs/nginx.conf b/docs/nginx.conf
index df13beb0..c75c6f0e 100644
--- a/docs/nginx.conf
+++ b/docs/nginx.conf
@@ -3,7 +3,7 @@ server {
root /usr/share/nginx/html;
index index.html;
- add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: https:; connect-src 'self';" always;
+ add_header Content-Security-Policy "default-src 'self'; script-src 'self' 'unsafe-inline'; style-src 'self' 'unsafe-inline' https://fonts.googleapis.com; font-src 'self' https://fonts.gstatic.com; img-src 'self' data: https:; connect-src 'self' https://api.github.com;" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-XSS-Protection "1; mode=block" always;
diff --git a/nfpm.yaml b/nfpm.yaml
index aa968e2a..16135dbf 100644
--- a/nfpm.yaml
+++ b/nfpm.yaml
@@ -1,7 +1,7 @@
name: "poke-cli"
arch: "arm64"
platform: "linux"
-version: "v1.9.1"
+version: "v1.9.2"
section: "default"
version_schema: semver
maintainer: "Christian S"
diff --git a/structs/structs.go b/structs/structs.go
index 4381edfc..9b6e4956 100644
--- a/structs/structs.go
+++ b/structs/structs.go
@@ -1,28 +1,16 @@
package structs
-func (a AbilityJSONStruct) GetResourceName() string {
- return a.Name
-}
+func (a AbilityJSONStruct) GetResourceName() string { return a.Name }
-func (i ItemJSONStruct) GetResourceName() string {
- return i.Name
-}
+func (i ItemJSONStruct) GetResourceName() string { return i.Name }
-func (m MoveJSONStruct) GetResourceName() string {
- return m.Name
-}
+func (m MoveJSONStruct) GetResourceName() string { return m.Name }
-func (p PokemonJSONStruct) GetResourceName() string {
- return p.Name
-}
+func (p PokemonJSONStruct) GetResourceName() string { return p.Name }
-func (s PokemonSpeciesJSONStruct) GetResourceName() string {
- return s.Name
-}
+func (s PokemonSpeciesJSONStruct) GetResourceName() string { return s.Name }
-func (t TypesJSONStruct) GetResourceName() string {
- return t.Name
-}
+func (t TypesJSONStruct) GetResourceName() string { return t.Name }
// AbilityJSONStruct ability endpoint from API
type AbilityJSONStruct struct {
@@ -183,6 +171,7 @@ type PokemonJSONStruct struct {
} `json:"sprites"`
Stats []struct {
BaseStat int `json:"base_stat"`
+ Effort int `json:"effort"`
Stat struct {
Name string `json:"name"`
} `json:"stat"`
@@ -215,6 +204,8 @@ type PokemonSpeciesJSONStruct struct {
URL string `json:"url"`
} `json:"version"`
} `json:"flavor_text_entries"`
+ GenderRate int `json:"gender_rate"`
+ HatchCounter int `json:"hatch_counter"`
}
// TypesJSONStruct type endpoint from API
diff --git a/testdata/main_latest_flag.golden b/testdata/main_latest_flag.golden
index 4a9faff1..d29afa4a 100644
--- a/testdata/main_latest_flag.golden
+++ b/testdata/main_latest_flag.golden
@@ -2,6 +2,6 @@
┃ ┃
┃ Latest available release ┃
┃ on GitHub: ┃
-┃ • v1.9.0 ┃
+┃ • v1.9.1 ┃
┃ ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
diff --git a/testdata/pokemon_abilities.golden b/testdata/pokemon_abilities.golden
index 5eb43a9e..80b10510 100644
--- a/testdata/pokemon_abilities.golden
+++ b/testdata/pokemon_abilities.golden
@@ -10,6 +10,9 @@ supercomputer, and it uses calculations to analyze foes.
• Height: 1.6m (5′03″)
• Evolves from: Metang
• Egg Group(s): Mineral
+• Gender Rate: Genderless
+• Egg Cycles: 40
+• Effort Values: 3 Def
─────────
Abilities
Ability 1: Clear Body
diff --git a/testdata/pokemon_defense.golden b/testdata/pokemon_defense.golden
index 3bb066f0..c8fd067e 100644
--- a/testdata/pokemon_defense.golden
+++ b/testdata/pokemon_defense.golden
@@ -10,6 +10,9 @@ look forward to being launched out at Mach speeds.
• Height: 3.0m (9′10″)
• Evolves from: Drakloak
• Egg Group(s): Amorphous, Dragon
+• Gender Rate: 50% F
+• Egg Cycles: 40
+• Effort Values: 3 Spd
─────────────
Type Defenses
Immune: Fighting, Normal
diff --git a/testdata/pokemon_defense_ability_immunities.golden b/testdata/pokemon_defense_ability_immunities.golden
index 5d86513d..2b4ff7be 100644
--- a/testdata/pokemon_defense_ability_immunities.golden
+++ b/testdata/pokemon_defense_ability_immunities.golden
@@ -10,6 +10,9 @@ escapes.
• Height: 0.9m (2′11″)
• Evolves from: Shellos
• Egg Group(s): Amorphous, Water1
+• Gender Rate: 50% F
+• Egg Cycles: 20
+• Effort Values: 2 HP
─────────────
Type Defenses
Immune: Electric
diff --git a/testdata/pokemon_image.golden b/testdata/pokemon_image.golden
index 7921d0db..95c12445 100644
--- a/testdata/pokemon_image.golden
+++ b/testdata/pokemon_image.golden
@@ -11,6 +11,9 @@ Skeledirge’s head gained a soul.
• Height: 1.6m (5′03″)
• Evolves from: Crocalor
• Egg Group(s): Field
+• Gender Rate: 12.5% F
+• Egg Cycles: 20
+• Effort Values: 3 SpA
─────
Image
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
diff --git a/testdata/pokemon_image_flag_non-valid_size.golden b/testdata/pokemon_image_flag_non-valid_size.golden
index 7018d2ed..679a62e2 100644
--- a/testdata/pokemon_image_flag_non-valid_size.golden
+++ b/testdata/pokemon_image_flag_non-valid_size.golden
@@ -10,6 +10,9 @@ in the rescues of drowning people.
• Height: 1.1m (3′07″)
• Evolves from: Buizel
• Egg Group(s): Field, Water1
+• Gender Rate: 50% F
+• Egg Cycles: 20
+• Effort Values: 2 Spd
─────
Image
╭───────────────────────────╮
diff --git a/testdata/pokemon_no_flags_dual_type.golden b/testdata/pokemon_no_flags_dual_type.golden
index 0dd5cf1b..5038a359 100644
--- a/testdata/pokemon_no_flags_dual_type.golden
+++ b/testdata/pokemon_no_flags_dual_type.golden
@@ -10,3 +10,6 @@ Victini always win, regardless of the type of encounter.
• Height: 0.4m (1′04″)
• Basic Pokémon
• Egg Group(s): Undiscovered
+• Gender Rate: Genderless
+• Egg Cycles: 120
+• Effort Values: 3 HP
diff --git a/testdata/pokemon_regional_form.golden b/testdata/pokemon_regional_form.golden
index f4d976c0..486be6e3 100644
--- a/testdata/pokemon_regional_form.golden
+++ b/testdata/pokemon_regional_form.golden
@@ -10,6 +10,9 @@ friendly and never appear to squabble.
• Height: 10.9m (35′09″)
• Evolves from: Exeggcute
• Egg Group(s): Grass
+• Gender Rate: 50% F
+• Egg Cycles: 20
+• Effort Values: 2 SpA
──────────
Base Stats
HP ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 95
diff --git a/testdata/pokemon_regional_form_2.golden b/testdata/pokemon_regional_form_2.golden
index a5ef1c41..17d78ea5 100644
--- a/testdata/pokemon_regional_form_2.golden
+++ b/testdata/pokemon_regional_form_2.golden
@@ -10,3 +10,6 @@ situation, it remains calm and collected.
• Height: 1.8m (5′11″)
• Evolves from: Slowpoke
• Egg Group(s): Monster, Water1
+• Gender Rate: 50% F
+• Egg Cycles: 20
+• Effort Values: 2 SpD
diff --git a/testdata/pokemon_stats.golden b/testdata/pokemon_stats.golden
index a7862632..99a1b2cc 100644
--- a/testdata/pokemon_stats.golden
+++ b/testdata/pokemon_stats.golden
@@ -10,6 +10,9 @@ stored poison is churned for greater potency.
• Height: 1.3m (4′03″)
• Evolves from: Croagunk
• Egg Group(s): Human-Like
+• Gender Rate: 50% F
+• Egg Cycles: 20
+• Effort Values: 2 Atk
──────────
Base Stats
HP ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ 83
diff --git a/web/pyproject.toml b/web/pyproject.toml
index c96386d6..77181744 100644
--- a/web/pyproject.toml
+++ b/web/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "web"
-version = "1.9.0"
+version = "1.9.2"
description = "Streamlit dashboard for browsing and visualizing Pokémon TCG tournament standings and results."
readme = "README.md"
requires-python = ">=3.12"