Skip to content

Commit 1fea7d2

Browse files
authored
feat: expose 'wikiAvailable', match on uniqueName (#718)
1 parent cb9b80b commit 1fea7d2

File tree

11 files changed

+17014
-16888
lines changed

11 files changed

+17014
-16888
lines changed

build/parser.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -912,8 +912,9 @@ class Parser {
912912
if (item.category === 'Archwing') wikiCategory = 'archwings';
913913
if (category === 'Sentinels') wikiCategory = 'companions';
914914

915-
const wikiaItem = wikiaData[wikiCategory].filter((i) => i).find((i) => i.name === item.name);
915+
const wikiaItem = wikiaData[wikiCategory].filter((i) => i).find((i) => i.uniqueName === item.uniqueName);
916916
if (!wikiaItem) return;
917+
item.wikiAvailable = true;
917918

918919
switch (category.toLowerCase()) {
919920
case 'sentinels':

build/wikia/transformers/transformArcanes.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ export default async (oldArcane, imageUrls) => {
55
}
66

77
try {
8-
const { Image, Name, Transmutable, Introduced, Type } = oldArcane;
8+
const { Image, Name, Transmutable, Introduced, Type, InternalName } = oldArcane;
99

1010
newArcane = {
1111
name: Name,
12+
uniqueName: InternalName,
1213
url: `https://wiki.warframe.com/w/${encodeURIComponent(Name.replace(/\s/g, '_'))}`,
1314
transmutable: Transmutable,
1415
introduced: Introduced,

build/wikia/transformers/transformCompanion.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ export default async (oldCompanion, imageUrls) => {
1313
}
1414

1515
try {
16-
const { Image, Mastery, Polarities, Stamina, Introduced, Vaulted, VaultDate, EstimatedVaultDate } = oldCompanion;
16+
const { Image, Mastery, Polarities, Stamina, Introduced, Vaulted, VaultDate, EstimatedVaultDate, InternalName } =
17+
oldCompanion;
1718
const { Name } = oldCompanion;
1819

1920
newCompanion = {
2021
name: Name,
22+
uniqueName: InternalName,
2123
url: `https://wiki.warframe.com/w/${encodeURIComponent(Name.replace(/\s/g, '_').replace('_Prime', '/Prime'))}`,
2224
mr: Mastery || 0,
2325
polarities: Polarities,

build/wikia/transformers/transformMod.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ export default async (oldMod, imageUrls) => {
55
}
66

77
try {
8-
const { Image, Name, Transmutable, Introduced } = oldMod;
8+
const { Image, Name, Transmutable, Introduced, InternalName } = oldMod;
99

1010
newMod = {
1111
name: Name,
12+
uniqueName: InternalName,
1213
url: `https://wiki.warframe.com/w/${encodeURIComponent(Name.replace(/\s/g, '_'))}`,
1314
transmutable: Transmutable,
1415
introduced: Introduced,

build/wikia/transformers/transformWarframe.mjs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@ export default async (oldFrame, imageUrls, blueprints) => {
3434
}
3535

3636
try {
37-
const { AuraPolarity, Conclave, Image, Mastery, Polarities, Sprint, Introduced, Sex, Vaulted } = oldFrame;
37+
const { AuraPolarity, Conclave, Image, Mastery, Polarities, Sprint, Introduced, Sex, Vaulted, InternalName } =
38+
oldFrame;
3839
const { Name } = oldFrame;
3940

4041
newFrame = {
4142
name: Name,
43+
uniqueName: InternalName,
4244
url: `https://wiki.warframe.com/w/${encodeURIComponent(Name.replace(/\s/g, '_').replace('_Prime', '/Prime'))}`,
4345
auraPolarity: AuraPolarity,
4446
conclave: Conclave,

build/wikia/transformers/transformWeapon.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,11 +202,13 @@ export default (oldWeapon, imageUrls, blueprints) => {
202202
Attack9,
203203
Attack10,
204204
Attacks,
205+
InternalName,
205206
} = oldWeapon;
206207

207208
newWeapon = {
208209
regex: `^${Name.toLowerCase().replace(/\s/g, '\\s')}$`,
209210
name: Name,
211+
uniqueName: InternalName,
210212
url: `https://wiki.warframe.com/w/${encodeURIComponent(Name.replace(/\s/g, '_'))}`,
211213
mr: Mastery || 0,
212214
type: Class || Type,

build/wikia/transformers/transformerArchwing.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,12 @@ export default async (oldWings, imageUrls) => {
1313
}
1414

1515
try {
16-
const { Image, Mastery, Polarities, Sprint, Introduced, Vaulted } = oldWings;
16+
const { Image, Mastery, Polarities, Sprint, Introduced, Vaulted, InternalName } = oldWings;
1717
const { Name } = oldWings;
1818

1919
newWings = {
2020
name: Name,
21+
uniqueName: InternalName,
2122
url: `https://wiki.warframe.com/w/${encodeURIComponent(Name.replace(/\s/g, '_').replace('_Prime', '/Prime'))}`,
2223
mr: Mastery || 0,
2324
polarities: Polarities,

index.d.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ declare module 'warframe-items' {
155155
wikiaUrl?: string;
156156
tags?: Tag[];
157157
introduced?: Update;
158+
wikiAvailable?: boolean;
158159
}
159160
interface Droppable {
160161
rarity?: Rarity;
@@ -397,7 +398,7 @@ declare module 'warframe-items' {
397398
interface ModularPetPart extends MinimalItem, Droppable, Attackable, Equippable {
398399
category: 'Pets';
399400
}
400-
interface Component extends MinimalItem {
401+
interface Component extends MinimalItem, WikiaItem {
401402
itemCount: number;
402403
imageName: string;
403404
tradable: boolean;
@@ -436,8 +437,6 @@ declare module 'warframe-items' {
436437
tags?: Tag[];
437438
type?: Type;
438439
vaulted?: boolean;
439-
wikiaThumbnail?: string;
440-
wikiaUrl?: string;
441440
disposition?: Disposition;
442441
ducats?: number;
443442
channeling?: number;

0 commit comments

Comments
 (0)