unite-lib 1.0.3 → 1.1.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/LICENSE +21 -21
- package/README.md +239 -203
- package/dist/i18n/index.cjs +28 -3
- package/dist/i18n/index.cjs.map +1 -1
- package/dist/i18n/index.d.cts +1 -2
- package/dist/i18n/index.d.ts +1 -2
- package/dist/i18n/index.global.js +28 -3
- package/dist/i18n/index.global.js.map +1 -1
- package/dist/i18n/index.js +28 -3
- package/dist/i18n/index.js.map +1 -1
- package/dist/index.cjs +28 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.global.js +28 -3
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +28 -3
- package/dist/index.js.map +1 -1
- package/moves/moltres_s11.png +0 -0
- package/moves/moltres_s21.png +0 -0
- package/package.json +66 -47
- package/pokemons/roster-moltres-2x.png +0 -0
- package/pokemons/roster-moltres.png +0 -0
- package/pokemons/stat-moltres.png +0 -0
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 unite-lib contributors
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 unite-lib contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,203 +1,239 @@
|
|
|
1
|
-
# unite-lib
|
|
2
|
-
|
|
3
|
-
Assets and data library for **Pokémon Unite**: roster, names, images, moves, and maps. Use in any project via **npm** or **CDN**.
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
```bash
|
|
8
|
-
npm install unite-lib
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## Usage
|
|
12
|
-
|
|
13
|
-
### Data and helpers
|
|
14
|
-
|
|
15
|
-
```js
|
|
16
|
-
import {
|
|
17
|
-
pokemons,
|
|
18
|
-
moves,
|
|
19
|
-
maps,
|
|
20
|
-
BattleType,
|
|
21
|
-
Tag,
|
|
22
|
-
getPokemonByName,
|
|
23
|
-
getPokemonByDex,
|
|
24
|
-
getPokemonsByBattleType,
|
|
25
|
-
getImageUrl,
|
|
26
|
-
getPokemonName,
|
|
27
|
-
} from "unite-lib";
|
|
28
|
-
|
|
29
|
-
// All roster entries
|
|
30
|
-
console.log(pokemons.length);
|
|
31
|
-
|
|
32
|
-
// Find by name or dex
|
|
33
|
-
const pikachu = getPokemonByName("Pikachu");
|
|
34
|
-
const dex25 = getPokemonByDex(25);
|
|
35
|
-
|
|
36
|
-
// Filter by role
|
|
37
|
-
const attackers = getPokemonsByBattleType(BattleType.ATTACKER);
|
|
38
|
-
const ranged = getPokemonsByTag(Tag.RANGED);
|
|
39
|
-
|
|
40
|
-
// Image URL (relative or with CDN base)
|
|
41
|
-
const mainImg = getImageUrl(pikachu, "main");
|
|
42
|
-
const cdnImg = getImageUrl(pikachu, "main", {
|
|
43
|
-
baseUrl: "https://cdn.jsdelivr.net/npm/unite-lib@1.0.0",
|
|
44
|
-
});
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### i18n (localized names)
|
|
48
|
-
|
|
49
|
-
```js
|
|
50
|
-
import { getPokemonName } from "unite-lib";
|
|
51
|
-
// or
|
|
52
|
-
import { getPokemonName } from "unite-lib/i18n";
|
|
53
|
-
|
|
54
|
-
getPokemonName("venusaur", "en"); // "Venusaur"
|
|
55
|
-
getPokemonName("venusaur", "pt-BR"); // "Venusaur"
|
|
56
|
-
getPokemonName("venusaur", "ja-JP"); // "フシギバナ"
|
|
57
|
-
getPokemonName("venusaur", "fr"); // "Florizarre"
|
|
58
|
-
getPokemonName("venusaur", "es"); // "Venusaur"
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
Supported locales: `en`, `pt-BR`, `ja-JP`, `fr`, `es`.
|
|
62
|
-
|
|
63
|
-
## Content
|
|
64
|
-
|
|
65
|
-
The library includes data and images ready to use in Pokémon Unite apps, bots, and sites.
|
|
66
|
-
|
|
67
|
-
### Roster (Pokémon)
|
|
68
|
-
|
|
69
|
-
Roster icons and stat images for the full active roster.
|
|
70
|
-
|
|
71
|
-
| Roster example | Stats example |
|
|
72
|
-
|----------------|----------------|
|
|
73
|
-
|  |  |
|
|
74
|
-
|  |  |
|
|
75
|
-
|  |  |
|
|
76
|
-
|
|
77
|
-
### Moves
|
|
78
|
-
|
|
79
|
-
Move images (slot 1 and 2, variants 1 and 2) per Pokémon.
|
|
80
|
-
|
|
81
|
-
| Slot 1.1 | Slot 1.2 | Slot 2.1 | Slot 2.2 |
|
|
82
|
-
|----------|----------|----------|----------|
|
|
83
|
-
|  |  |  |  |
|
|
84
|
-
|
|
85
|
-
### Maps
|
|
86
|
-
|
|
87
|
-
Game map images (Remoat Stadium, Theia Sky Ruins, Mer Stadium, etc.).
|
|
88
|
-
|
|
89
|
-

|
|
90
|
-
|
|
91
|
-
---
|
|
92
|
-
|
|
93
|
-
## Local development (testing without publishing to npm)
|
|
94
|
-
|
|
95
|
-
To test the library in another project on your machine without publishing to npm:
|
|
96
|
-
|
|
97
|
-
### 1. Build the library
|
|
98
|
-
|
|
99
|
-
From the **unite-lib** folder:
|
|
100
|
-
|
|
101
|
-
```bash
|
|
102
|
-
cd unite-lib
|
|
103
|
-
npm run build
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
### 2. Use in your project
|
|
107
|
-
|
|
108
|
-
**Option A — `npm link` (symlink, great for development)**
|
|
109
|
-
|
|
110
|
-
From the library folder:
|
|
111
|
-
|
|
112
|
-
```bash
|
|
113
|
-
npm link
|
|
114
|
-
```
|
|
115
|
-
|
|
116
|
-
In your other project (e.g. the app that consumes the library):
|
|
117
|
-
|
|
118
|
-
```bash
|
|
119
|
-
cd /path/to/your/project
|
|
120
|
-
npm link unite-lib
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
From then on, `import { pokemons, getPokemonName } from "unite-lib"` uses the local version. When you change the library, run `npm run build` again; the consuming project already points to the same package.
|
|
124
|
-
|
|
125
|
-
To undo in the consuming project: `npm unlink unite-lib`.
|
|
126
|
-
|
|
127
|
-
**Option B — `file:` dependency (install from path)**
|
|
128
|
-
|
|
129
|
-
In your project's `package.json`, add:
|
|
130
|
-
|
|
131
|
-
```json
|
|
132
|
-
{
|
|
133
|
-
"dependencies": {
|
|
134
|
-
"unite-lib": "file:../unite-lib"
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
Adjust `../unite-lib` to the relative (or absolute) path to the library folder. Then:
|
|
140
|
-
|
|
141
|
-
```bash
|
|
142
|
-
npm install
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
Whenever you change the library, run `npm run build` in it and, to refresh the copy in the consumer, run `npm install` again in the project (or use `npm update unite-lib`).
|
|
146
|
-
|
|
147
|
-
### Images when testing locally
|
|
148
|
-
|
|
149
|
-
Image paths are relative (e.g. `pokemons/roster-venusaur.png`). In the consumer you can:
|
|
150
|
-
|
|
151
|
-
- Use **baseUrl** when calling `getImageUrl(pokemon, "main", { baseUrl: "http://localhost:3000/node_modules/unite-lib" })` if the bundler/server serves `node_modules`, or
|
|
152
|
-
- Point **baseUrl** to where the `pokemons/`, `moves/`, and `maps/` folders are available in your app.
|
|
153
|
-
|
|
154
|
-
---
|
|
155
|
-
|
|
156
|
-
## CDN (browser)
|
|
157
|
-
|
|
158
|
-
```html
|
|
159
|
-
<script src="https://cdn.jsdelivr.net/npm/unite-lib@latest/dist/index.global.js"></script>
|
|
160
|
-
<script>
|
|
161
|
-
const { pokemons, getPokemonName, BattleType } = window.UniteLib;
|
|
162
|
-
</script>
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
Asset URLs via jsDelivr (substitua `@latest` por uma versão se quiser):
|
|
166
|
-
|
|
167
|
-
- `https://cdn.jsdelivr.net/npm/unite-lib@latest/pokemons/roster-venusaur.png`
|
|
168
|
-
- `https://cdn.jsdelivr.net/npm/unite-lib@latest/moves/venusaur_s11.png`
|
|
169
|
-
|
|
170
|
-
## API overview
|
|
171
|
-
|
|
172
|
-
| Export | Description |
|
|
173
|
-
|--------|-------------|
|
|
174
|
-
| `pokemons` | Full roster (name, dex, images, battleType, stats, tags, difficulty) |
|
|
175
|
-
| `moves` | Move list (pokemonId, slotId, name, image) |
|
|
176
|
-
| `maps` | Map list (id, name, image, description) |
|
|
177
|
-
| `BattleType` | `attacker`, `defender`, `allrounder`, `speedster`, `supporter` |
|
|
178
|
-
| `Tag` | Role + style: `attacker`, `defender`, `melee`, `ranged`, … |
|
|
179
|
-
| `getImageUrl(pokemon, key, options?)` | Image path or full URL with `baseUrl` |
|
|
180
|
-
| `getPokemonByName(name)` | Find by display name |
|
|
181
|
-
| `getPokemonByDex(dex)` | Find by Pokédex number |
|
|
182
|
-
| `getPokemonBySlug(slug)` | Find by slug (e.g. `venusaur`) |
|
|
183
|
-
| `getPokemonsByBattleType(type)` | Filter by BattleType |
|
|
184
|
-
| `getPokemonsByTag(tag)` | Filter by Tag |
|
|
185
|
-
| `getActivePokemons()` | Only active roster entries |
|
|
186
|
-
| `getPokemonName(slug, locale)` | Localized name (from main package or `unite-lib/i18n`) |
|
|
187
|
-
|
|
188
|
-
## Project structure
|
|
189
|
-
|
|
190
|
-
- **`dist/`** — Built ESM, CJS, and IIFE; type definitions (`.d.ts`)
|
|
191
|
-
- **`pokemons/`** — Roster and stat images
|
|
192
|
-
- **`moves/`** — Move images
|
|
193
|
-
- **`maps/`** — Map images
|
|
194
|
-
- **`.cursor/skills/`** — [Cursor Agent Skills](https://docs.cursor.com/context/agent-skills) for use with AI agents in this repo (e.g. syncing roster from images in `pokemons/` and `moves/`).
|
|
195
|
-
- **`mcp/`** — [MCP server](mcp/README.md) (Model Context Protocol) para consumir a library em agentes de IA: tools para listar e buscar pokémons, moves, mapas, URLs de imagens e nomes localizados (Cursor, Claude Desktop, etc.).
|
|
196
|
-
|
|
197
|
-
##
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
1
|
+
# unite-lib
|
|
2
|
+
|
|
3
|
+
Assets and data library for **Pokémon Unite**: roster, names, images, moves, and maps. Use in any project via **npm** or **CDN**.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install unite-lib
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Usage
|
|
12
|
+
|
|
13
|
+
### Data and helpers
|
|
14
|
+
|
|
15
|
+
```js
|
|
16
|
+
import {
|
|
17
|
+
pokemons,
|
|
18
|
+
moves,
|
|
19
|
+
maps,
|
|
20
|
+
BattleType,
|
|
21
|
+
Tag,
|
|
22
|
+
getPokemonByName,
|
|
23
|
+
getPokemonByDex,
|
|
24
|
+
getPokemonsByBattleType,
|
|
25
|
+
getImageUrl,
|
|
26
|
+
getPokemonName,
|
|
27
|
+
} from "unite-lib";
|
|
28
|
+
|
|
29
|
+
// All roster entries
|
|
30
|
+
console.log(pokemons.length);
|
|
31
|
+
|
|
32
|
+
// Find by name or dex
|
|
33
|
+
const pikachu = getPokemonByName("Pikachu");
|
|
34
|
+
const dex25 = getPokemonByDex(25);
|
|
35
|
+
|
|
36
|
+
// Filter by role
|
|
37
|
+
const attackers = getPokemonsByBattleType(BattleType.ATTACKER);
|
|
38
|
+
const ranged = getPokemonsByTag(Tag.RANGED);
|
|
39
|
+
|
|
40
|
+
// Image URL (relative or with CDN base)
|
|
41
|
+
const mainImg = getImageUrl(pikachu, "main");
|
|
42
|
+
const cdnImg = getImageUrl(pikachu, "main", {
|
|
43
|
+
baseUrl: "https://cdn.jsdelivr.net/npm/unite-lib@1.0.0",
|
|
44
|
+
});
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### i18n (localized names)
|
|
48
|
+
|
|
49
|
+
```js
|
|
50
|
+
import { getPokemonName } from "unite-lib";
|
|
51
|
+
// or
|
|
52
|
+
import { getPokemonName } from "unite-lib/i18n";
|
|
53
|
+
|
|
54
|
+
getPokemonName("venusaur", "en"); // "Venusaur"
|
|
55
|
+
getPokemonName("venusaur", "pt-BR"); // "Venusaur"
|
|
56
|
+
getPokemonName("venusaur", "ja-JP"); // "フシギバナ"
|
|
57
|
+
getPokemonName("venusaur", "fr"); // "Florizarre"
|
|
58
|
+
getPokemonName("venusaur", "es"); // "Venusaur"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Supported locales: `en`, `pt-BR`, `ja-JP`, `fr`, `es`.
|
|
62
|
+
|
|
63
|
+
## Content
|
|
64
|
+
|
|
65
|
+
The library includes data and images ready to use in Pokémon Unite apps, bots, and sites.
|
|
66
|
+
|
|
67
|
+
### Roster (Pokémon)
|
|
68
|
+
|
|
69
|
+
Roster icons and stat images for the full active roster.
|
|
70
|
+
|
|
71
|
+
| Roster example | Stats example |
|
|
72
|
+
|----------------|----------------|
|
|
73
|
+
|  |  |
|
|
74
|
+
|  |  |
|
|
75
|
+
|  |  |
|
|
76
|
+
|
|
77
|
+
### Moves
|
|
78
|
+
|
|
79
|
+
Move images (slot 1 and 2, variants 1 and 2) per Pokémon.
|
|
80
|
+
|
|
81
|
+
| Slot 1.1 | Slot 1.2 | Slot 2.1 | Slot 2.2 |
|
|
82
|
+
|----------|----------|----------|----------|
|
|
83
|
+
|  |  |  |  |
|
|
84
|
+
|
|
85
|
+
### Maps
|
|
86
|
+
|
|
87
|
+
Game map images (Remoat Stadium, Theia Sky Ruins, Mer Stadium, etc.).
|
|
88
|
+
|
|
89
|
+

|
|
90
|
+
|
|
91
|
+
---
|
|
92
|
+
|
|
93
|
+
## Local development (testing without publishing to npm)
|
|
94
|
+
|
|
95
|
+
To test the library in another project on your machine without publishing to npm:
|
|
96
|
+
|
|
97
|
+
### 1. Build the library
|
|
98
|
+
|
|
99
|
+
From the **unite-lib** folder:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
cd unite-lib
|
|
103
|
+
npm run build
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
### 2. Use in your project
|
|
107
|
+
|
|
108
|
+
**Option A — `npm link` (symlink, great for development)**
|
|
109
|
+
|
|
110
|
+
From the library folder:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
npm link
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
In your other project (e.g. the app that consumes the library):
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
cd /path/to/your/project
|
|
120
|
+
npm link unite-lib
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
From then on, `import { pokemons, getPokemonName } from "unite-lib"` uses the local version. When you change the library, run `npm run build` again; the consuming project already points to the same package.
|
|
124
|
+
|
|
125
|
+
To undo in the consuming project: `npm unlink unite-lib`.
|
|
126
|
+
|
|
127
|
+
**Option B — `file:` dependency (install from path)**
|
|
128
|
+
|
|
129
|
+
In your project's `package.json`, add:
|
|
130
|
+
|
|
131
|
+
```json
|
|
132
|
+
{
|
|
133
|
+
"dependencies": {
|
|
134
|
+
"unite-lib": "file:../unite-lib"
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
Adjust `../unite-lib` to the relative (or absolute) path to the library folder. Then:
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
npm install
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
Whenever you change the library, run `npm run build` in it and, to refresh the copy in the consumer, run `npm install` again in the project (or use `npm update unite-lib`).
|
|
146
|
+
|
|
147
|
+
### Images when testing locally
|
|
148
|
+
|
|
149
|
+
Image paths are relative (e.g. `pokemons/roster-venusaur.png`). In the consumer you can:
|
|
150
|
+
|
|
151
|
+
- Use **baseUrl** when calling `getImageUrl(pokemon, "main", { baseUrl: "http://localhost:3000/node_modules/unite-lib" })` if the bundler/server serves `node_modules`, or
|
|
152
|
+
- Point **baseUrl** to where the `pokemons/`, `moves/`, and `maps/` folders are available in your app.
|
|
153
|
+
|
|
154
|
+
---
|
|
155
|
+
|
|
156
|
+
## CDN (browser)
|
|
157
|
+
|
|
158
|
+
```html
|
|
159
|
+
<script src="https://cdn.jsdelivr.net/npm/unite-lib@latest/dist/index.global.js"></script>
|
|
160
|
+
<script>
|
|
161
|
+
const { pokemons, getPokemonName, BattleType } = window.UniteLib;
|
|
162
|
+
</script>
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
Asset URLs via jsDelivr (substitua `@latest` por uma versão se quiser):
|
|
166
|
+
|
|
167
|
+
- `https://cdn.jsdelivr.net/npm/unite-lib@latest/pokemons/roster-venusaur.png`
|
|
168
|
+
- `https://cdn.jsdelivr.net/npm/unite-lib@latest/moves/venusaur_s11.png`
|
|
169
|
+
|
|
170
|
+
## API overview
|
|
171
|
+
|
|
172
|
+
| Export | Description |
|
|
173
|
+
|--------|-------------|
|
|
174
|
+
| `pokemons` | Full roster (name, dex, images, battleType, stats, tags, difficulty) |
|
|
175
|
+
| `moves` | Move list (pokemonId, slotId, name, image) |
|
|
176
|
+
| `maps` | Map list (id, name, image, description) |
|
|
177
|
+
| `BattleType` | `attacker`, `defender`, `allrounder`, `speedster`, `supporter` |
|
|
178
|
+
| `Tag` | Role + style: `attacker`, `defender`, `melee`, `ranged`, … |
|
|
179
|
+
| `getImageUrl(pokemon, key, options?)` | Image path or full URL with `baseUrl` |
|
|
180
|
+
| `getPokemonByName(name)` | Find by display name |
|
|
181
|
+
| `getPokemonByDex(dex)` | Find by Pokédex number |
|
|
182
|
+
| `getPokemonBySlug(slug)` | Find by slug (e.g. `venusaur`) |
|
|
183
|
+
| `getPokemonsByBattleType(type)` | Filter by BattleType |
|
|
184
|
+
| `getPokemonsByTag(tag)` | Filter by Tag |
|
|
185
|
+
| `getActivePokemons()` | Only active roster entries |
|
|
186
|
+
| `getPokemonName(slug, locale)` | Localized name (from main package or `unite-lib/i18n`) |
|
|
187
|
+
|
|
188
|
+
## Project structure
|
|
189
|
+
|
|
190
|
+
- **`dist/`** — Built ESM, CJS, and IIFE; type definitions (`.d.ts`)
|
|
191
|
+
- **`pokemons/`** — Roster and stat images
|
|
192
|
+
- **`moves/`** — Move images
|
|
193
|
+
- **`maps/`** — Map images
|
|
194
|
+
- **`.cursor/skills/`** — [Cursor Agent Skills](https://docs.cursor.com/context/agent-skills) for use with AI agents in this repo (e.g. syncing roster from images in `pokemons/` and `moves/`).
|
|
195
|
+
- **`mcp/`** — [MCP server](mcp/README.md) (Model Context Protocol) para consumir a library em agentes de IA: tools para listar e buscar pokémons, moves, mapas, URLs de imagens e nomes localizados (Cursor, Claude Desktop, etc.).
|
|
196
|
+
|
|
197
|
+
## Releases (publicação no npm)
|
|
198
|
+
|
|
199
|
+
As versões e a publicação no npm são feitas automaticamente com [semantic-release](https://github.com/semantic-release/semantic-release) quando há **push na branch `main`**.
|
|
200
|
+
|
|
201
|
+
### Como a versão é definida
|
|
202
|
+
|
|
203
|
+
Os commits seguem [Conventional Commits](https://www.conventionalcommits.org/). O semantic-release usa isso para decidir o tipo de release:
|
|
204
|
+
|
|
205
|
+
| Tipo de commit | Efeito na versão |
|
|
206
|
+
|------------------|-------------------|
|
|
207
|
+
| `feat:` | **MINOR** (1.**x**.0) — nova funcionalidade |
|
|
208
|
+
| `fix:`, `perf:`, `docs:` (sem escopo de código) | **PATCH** (1.0.**x**) — correção ou melhoria |
|
|
209
|
+
| `BREAKING CHANGE` ou `!` no escopo (ex.: `feat!:`) | **MAJOR** (**x**.0.0) — mudança incompatível |
|
|
210
|
+
|
|
211
|
+
Exemplos:
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
git commit -m "feat: add Mega Charizard Y to roster"
|
|
215
|
+
git commit -m "fix: correct Venusaur stat image path"
|
|
216
|
+
git commit -m "feat!: change getImageUrl signature" # breaking → MAJOR
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
Commits que não indicam release (ex.: `chore:`, `style:`, `test:`) não geram nova versão; mesmo assim o push na `main` roda o workflow (que pode não publicar nada).
|
|
220
|
+
|
|
221
|
+
### O que você precisa configurar
|
|
222
|
+
|
|
223
|
+
1. **Token do npm (NPM_TOKEN)**
|
|
224
|
+
No repositório no GitHub: **Settings → Secrets and variables → Actions** e crie um secret chamado **`NPM_TOKEN`**.
|
|
225
|
+
- Crie o token em [npmjs.com → Access Tokens](https://www.npmjs.com/settings/~youruser/tokens): “Automation” ou “Publish”.
|
|
226
|
+
- Cole o valor no secret `NPM_TOKEN`.
|
|
227
|
+
|
|
228
|
+
2. **Conventional Commits**
|
|
229
|
+
Para haver release, use pelo menos um commit com `feat:` ou `fix:` (ou breaking) no histórico desde a última tag. Se todos forem `chore:`/`style:`/`test:`, nenhuma versão será publicada.
|
|
230
|
+
|
|
231
|
+
Depois disso, ao dar push na `main`, o workflow **Release** roda, o semantic-release analisa os commits, atualiza a versão no `package.json`, gera/atualiza o `CHANGELOG.md`, cria a release no GitHub e publica o pacote no npm.
|
|
232
|
+
|
|
233
|
+
## License
|
|
234
|
+
|
|
235
|
+
MIT. See [LICENSE](LICENSE).
|
|
236
|
+
|
|
237
|
+
## Contributing
|
|
238
|
+
|
|
239
|
+
Contributions are welcome. See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines and workflow.
|
package/dist/i18n/index.cjs
CHANGED
|
@@ -734,6 +734,31 @@ var pokemons = [
|
|
|
734
734
|
],
|
|
735
735
|
"difficulty": 1
|
|
736
736
|
},
|
|
737
|
+
{
|
|
738
|
+
"name": "Moltres",
|
|
739
|
+
"dex": 146,
|
|
740
|
+
"images": {
|
|
741
|
+
"main": "pokemons/roster-moltres.png",
|
|
742
|
+
"big": "pokemons/roster-moltres-2x.png",
|
|
743
|
+
"complete": "pokemons/stat-moltres.png",
|
|
744
|
+
"move_s11": "moves/moltres_s11.png",
|
|
745
|
+
"move_s21": "moves/moltres_s21.png"
|
|
746
|
+
},
|
|
747
|
+
"active": true,
|
|
748
|
+
"battleType": BattleType.ALLROUNDER,
|
|
749
|
+
"stats": {
|
|
750
|
+
"offense": 4,
|
|
751
|
+
"endurance": 2.5,
|
|
752
|
+
"mobility": 2,
|
|
753
|
+
"scoring": 2,
|
|
754
|
+
"support": 2
|
|
755
|
+
},
|
|
756
|
+
"tags": [
|
|
757
|
+
Tag.ALLROUNDER,
|
|
758
|
+
Tag.MELEE
|
|
759
|
+
],
|
|
760
|
+
"difficulty": 2
|
|
761
|
+
},
|
|
737
762
|
{
|
|
738
763
|
"name": "Dragonite",
|
|
739
764
|
"dex": 149,
|
|
@@ -762,7 +787,7 @@ var pokemons = [
|
|
|
762
787
|
"difficulty": 1
|
|
763
788
|
},
|
|
764
789
|
{
|
|
765
|
-
"name": "Mewtwo X",
|
|
790
|
+
"name": "Mega Mewtwo X",
|
|
766
791
|
"dex": 150,
|
|
767
792
|
"images": {
|
|
768
793
|
"main": "pokemons/roster-mewtwox.png",
|
|
@@ -789,7 +814,7 @@ var pokemons = [
|
|
|
789
814
|
"difficulty": 1
|
|
790
815
|
},
|
|
791
816
|
{
|
|
792
|
-
"name": "Mewtwo Y",
|
|
817
|
+
"name": "Mega Mewtwo Y",
|
|
793
818
|
"dex": 150,
|
|
794
819
|
"images": {
|
|
795
820
|
"main": "pokemons/roster-mewtwoy.png",
|
|
@@ -2383,7 +2408,7 @@ for (const p of pokemons_default) {
|
|
|
2383
2408
|
var en_default = names;
|
|
2384
2409
|
|
|
2385
2410
|
// src/i18n/pt-BR.ts
|
|
2386
|
-
var ptBR = { ...en_default
|
|
2411
|
+
var ptBR = { ...en_default };
|
|
2387
2412
|
var pt_BR_default = ptBR;
|
|
2388
2413
|
|
|
2389
2414
|
// src/i18n/ja-JP.ts
|