Skip to content

Commit

Permalink
[wow] Begin the creation of @blizzard-api/wow with achievement API types
Browse files Browse the repository at this point in the history
  • Loading branch information
Pewtro committed Mar 28, 2024
1 parent 06dc41d commit 3ea04fa
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/ten-taxis-look.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@blizzard-api/wow': patch
---

Begin the creation of @blizzard-api/wow with achievement API types
7 changes: 6 additions & 1 deletion packages/wow/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,12 @@
"overwatch"
],
"dependencies": {},
"devDependencies": {},
"peerDependencies": {
"@blizzard-api/core": "0.0.2"
},
"devDependencies": {
"@blizzard-api/core": "workspace:*"
},
"scripts": {
"build": "tsup",
"debv": "tsup --watch",
Expand Down
25 changes: 25 additions & 0 deletions packages/wow/src/game-data/achievement.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import type { Resource } from '@blizzard-api/core';
import { base, mediaBase } from './base';

const achievementBase = `${base}/achievement`;
const achievementCategoryBase = `${base}/achievement-category`;

export const achievement = {
achievementCategory: (achievementCategoryId?: number): Resource => {
return {
path: achievementCategoryId
? `${achievementCategoryBase}/${achievementCategoryId}`
: `${achievementCategoryBase}/index`,
namespace: 'static',
};
},
achievement: (achievementId?: number): Resource => {
return {
path: achievementId ? `${achievementBase}/${achievementId}` : `${achievementBase}/index`,
namespace: 'static',
};
},
media: (achievementId: number): Resource => {
return { path: `${mediaBase}/achievement/${achievementId}`, namespace: 'static' };
},
};
3 changes: 3 additions & 0 deletions packages/wow/src/game-data/base.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export const base = '/data/wow' as const;

export const mediaBase = `${base}/media` as const;
5 changes: 5 additions & 0 deletions packages/wow/src/game-data/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import { achievement } from './achievement';

export const gameDataApi = {
achievement,
};
6 changes: 5 additions & 1 deletion packages/wow/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
console.log('coool???');
import { gameDataApi } from './game-data';

export const wow = {
...gameDataApi,
};

0 comments on commit 3ea04fa

Please sign in to comment.