Skip to content

Commit

Permalink
Merge pull request #808 from Gabb-c/master
Browse files Browse the repository at this point in the history
  • Loading branch information
Gabb-c authored Mar 24, 2023
2 parents 420864a + f898c5c commit 1e4e8de
Show file tree
Hide file tree
Showing 11 changed files with 662 additions and 858 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
run: pnpm install --frozen-lockfile

- name: Semantic Release
uses: cycjimmy/semantic-release-action@v3.3.0
uses: cycjimmy/semantic-release-action@v3.4.0
with:
extra_plugins: |
@semantic-release/git
Expand Down
20 changes: 17 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,22 @@ A lightweight Node.js wrapper for the PokéAPI with built-in types. An easy way

## Features

- [Built-in typings](https://pokenode-ts.vercel.app/typings/pokemon-typings)
- [Axios with auto-cache requests](https://pokenode-ts.vercel.app/guides/cache)
- [Logging](https://pokenode-ts.vercel.app/guides/logging)
- Built-in typings
- Axios with auto-cache requests
- Logging

## Installation

```bash
# NPM
npm i axios axios-cache-interceptor pokenode-ts

# Yarn
yarn add axios axios-cache-interceptor pokenode-ts

# Pnpm
pnpm i axios axios-cache-interceptor pokenode-ts
```

## Basic Example

Expand Down Expand Up @@ -52,6 +65,7 @@ Every change in this project is analyzed by [SonarCloud](https://sonarcloud.io/)
[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=Gabb-c_pokenode-ts&metric=bugs)](https://sonarcloud.io/summary/new_code?id=Gabb-c_pokenode-ts)
[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=Gabb-c_pokenode-ts&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=Gabb-c_pokenode-ts)
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=Gabb-c_pokenode-ts&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=Gabb-c_pokenode-ts)
[![codecov](https://codecov.io/gh/Gabb-c/pokenode-ts/branch/master/graph/badge.svg?token=whfY8GNSpS)](https://codecov.io/gh/Gabb-c/pokenode-ts)

## Leave your feedback

Expand Down
121 changes: 11 additions & 110 deletions docs/.vitepress/config.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import { defineConfig } from 'vitepress';
import { readFileSync } from 'node:fs';
import {
author,
license,
repository,
description as packageDescription,
name,
} from '../../package.json';
import { author, license, repository, description as packageDescription } from '../../package.json';
import { navbarItems, sidebarRoutes } from './routes';
import { SOCIAL_LINKS } from './social-links';
import { headConfig } from './head-config';

import * as dotenv from 'dotenv';
dotenv.config();

const readSvg = (path: string): string => readFileSync(require.resolve(path), 'utf-8');

Expand All @@ -18,109 +16,7 @@ export default defineConfig({
lang: 'en-US',
srcDir: './src',
lastUpdated: true,
head: [
['link', { rel: 'icon', href: '/siteLogo.svg', type: 'image/svg+xml' }],
[
'link',
{ rel: 'apple-touch-icon', sizes: '57x57', href: '/siteLogo.svg', type: 'image/svg+xml' },
],
[
'link',
{ rel: 'apple-touch-icon', sizes: '60x60', href: '/siteLogo.svg', type: 'image/svg+xml' },
],
[
'link',
{ rel: 'apple-touch-icon', sizes: '72x72', href: '/siteLogo.svg', type: 'image/svg+xml' },
],
[
'link',
{ rel: 'apple-touch-icon', sizes: '76x76', href: '/siteLogo.svg', type: 'image/svg+xml' },
],
[
'link',
{
rel: 'apple-touch-icon',
sizes: '114x114',
href: '/siteLogo.svg',
type: 'image/svg+xml',
},
],
[
'link',
{
rel: 'apple-touch-icon',
sizes: '120x120',
href: '/siteLogo.svg',
type: 'image/svg+xml',
},
],
[
'link',
{
rel: 'apple-touch-icon',
sizes: '144x144',
href: '/siteLogo.svg',
type: 'image/svg+xml',
},
],
[
'link',
{
rel: 'apple-touch-icon',
sizes: '152x152',
href: '/siteLogo.svg',
type: 'image/svg+xml',
},
],
[
'link',
{
rel: 'apple-touch-icon',
sizes: '180x180',
href: '/siteLogo.svg',
type: 'image/svg+xml',
},
],
[
'link',
{
rel: 'icon',
sizes: '192x192',
href: '/siteLogo.svg',
type: 'image/svg+xml',
},
],
[
'link',
{
rel: 'icon',
sizes: '32x32',
href: '/siteLogo.svg',
type: 'image/svg+xml',
},
],
[
'link',
{
rel: 'icon',
sizes: '96x96',
href: '/siteLogo.svg',
type: 'image/svg+xml',
},
],
[
'link',
{
rel: 'icon',
sizes: '16x16',
href: '/siteLogo.svg',
type: 'image/svg+xml',
},
],
['meta', { property: 'og:title', content: name }],
['meta', { property: 'og:description', content: packageDescription }],
['meta', { property: 'og:image', content: '/cover.jpg' }],
],
head: headConfig,
themeConfig: {
nav: navbarItems,
sidebar: sidebarRoutes,
Expand All @@ -147,6 +43,11 @@ export default defineConfig({
pattern: `${repository.url}/vitepress/edit/main/docs/src/:path`,
text: 'Edit this page on GitHub',
},
algolia: {
apiKey: process.env.API_KEY as string,
appId: process.env.APP_ID as string,
indexName: process.env.INDEX_NAME as string,
},
},
cleanUrls: true,
});
106 changes: 106 additions & 0 deletions docs/.vitepress/head-config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
import { HeadConfig } from 'vitepress';
import { description as packageDescription, name } from '../../package.json';

export const headConfig: HeadConfig[] = [
['link', { rel: 'icon', href: '/siteLogo.svg', type: 'image/svg+xml' }],
[
'link',
{ rel: 'apple-touch-icon', sizes: '57x57', href: '/siteLogo.svg', type: 'image/svg+xml' },
],
[
'link',
{ rel: 'apple-touch-icon', sizes: '60x60', href: '/siteLogo.svg', type: 'image/svg+xml' },
],
[
'link',
{ rel: 'apple-touch-icon', sizes: '72x72', href: '/siteLogo.svg', type: 'image/svg+xml' },
],
[
'link',
{ rel: 'apple-touch-icon', sizes: '76x76', href: '/siteLogo.svg', type: 'image/svg+xml' },
],
[
'link',
{
rel: 'apple-touch-icon',
sizes: '114x114',
href: '/siteLogo.svg',
type: 'image/svg+xml',
},
],
[
'link',
{
rel: 'apple-touch-icon',
sizes: '120x120',
href: '/siteLogo.svg',
type: 'image/svg+xml',
},
],
[
'link',
{
rel: 'apple-touch-icon',
sizes: '144x144',
href: '/siteLogo.svg',
type: 'image/svg+xml',
},
],
[
'link',
{
rel: 'apple-touch-icon',
sizes: '152x152',
href: '/siteLogo.svg',
type: 'image/svg+xml',
},
],
[
'link',
{
rel: 'apple-touch-icon',
sizes: '180x180',
href: '/siteLogo.svg',
type: 'image/svg+xml',
},
],
[
'link',
{
rel: 'icon',
sizes: '192x192',
href: '/siteLogo.svg',
type: 'image/svg+xml',
},
],
[
'link',
{
rel: 'icon',
sizes: '32x32',
href: '/siteLogo.svg',
type: 'image/svg+xml',
},
],
[
'link',
{
rel: 'icon',
sizes: '96x96',
href: '/siteLogo.svg',
type: 'image/svg+xml',
},
],
[
'link',
{
rel: 'icon',
sizes: '16x16',
href: '/siteLogo.svg',
type: 'image/svg+xml',
},
],
['meta', { property: 'og:title', content: name }],
['meta', { property: 'og:description', content: packageDescription }],
['meta', { property: 'og:image', content: '/cover.jpg' }],
];
15 changes: 15 additions & 0 deletions docs/src/typings/pokemon-typings.md
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,19 @@ export interface TypeRelations {
}
```

## Type Relations

Details of how effective this type was toward others and vice versa in a previous generation

```ts
export interface TypeRelationsPast {
/** The last generation in which the referenced type had the listed damage relations */
generation: NamedAPIResource;
/** The damage relations the referenced type had up to and including the listed generation */
damage_relations: TypeRelations;
}
```

## Type

Types are properties for Pokémon and their moves.
Expand All @@ -845,6 +858,8 @@ export interface Type {
name: string;
/** A detail of how effective this type is toward others and vice versa */
damage_relations: TypeRelations;
/** A list of details of how effective this type was toward others and vice versa in previous generations */
past_damage_relations: TypeRelationsPast[];
/** A list of game indices relevent to this item by generation */
game_indices: GenerationGameIndex[];
/** The generation this type was introduced in */
Expand Down
39 changes: 20 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,35 +54,36 @@
"sort": "sort-package-json package.json",
"test:ci": "vitest --silent --run",
"test:coverage": "vitest run --coverage",
"test:dev": "vitest -w --logHeapUsage --inspect",
"test:dev": "vitest -w",
"test:ui": "vitest --ui --api 9527"
},
"devDependencies": {
"@algolia/client-search": "^4.15.0",
"@commitlint/cli": "^17.4.4",
"@algolia/client-search": "^4.16.0",
"@commitlint/cli": "^17.5.0",
"@commitlint/config-conventional": "^17.4.4",
"@semantic-release/changelog": "^6.0.2",
"@semantic-release/changelog": "^6.0.3",
"@semantic-release/commit-analyzer": "^9.0.2",
"@semantic-release/git": "^10.0.1",
"@semantic-release/github": "^8.0.7",
"@semantic-release/npm": "^9.0.2",
"@semantic-release/npm": "^10.0.2",
"@semantic-release/release-notes-generator": "^10.0.3",
"@size-limit/preset-small-lib": "^8.2.4",
"@swc/core": "^1.3.40",
"@swc/core": "^1.3.42",
"@types/is-ci": "^3.0.0",
"@types/node": "^18.15.3",
"@typescript-eslint/eslint-plugin": "^5.55.0",
"@typescript-eslint/parser": "^5.55.0",
"@vitest/coverage-c8": "^0.29.2",
"@vitest/ui": "^0.29.2",
"@types/node": "^18.15.7",
"@typescript-eslint/eslint-plugin": "^5.56.0",
"@typescript-eslint/parser": "^5.56.0",
"@vitest/coverage-c8": "^0.29.7",
"@vitest/ui": "^0.29.7",
"axios": "^1.3.4",
"axios-cache-interceptor": "^1.0.1",
"ci-info": "^3.8.0",
"dotenv": "^16.0.3",
"eslint": "^8.36.0",
"eslint-config-airbnb-base": "^15.0.0",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-node": "^4.1.0",
"eslint-config-prettier": "^8.7.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-node": "^11.1.0",
Expand All @@ -93,15 +94,15 @@
"husky": "^8.0.3",
"is-ci": "^3.0.1",
"lint-staged": "^13.2.0",
"prettier": "^2.8.4",
"rimraf": "^4.4.0",
"semantic-release": "^20.1.1",
"prettier": "^2.8.7",
"rimraf": "^4.4.1",
"semantic-release": "^20.1.3",
"size-limit": "^8.2.4",
"sort-package-json": "^2.4.1",
"tsup": "^6.6.3",
"typescript": "^4.9.5",
"vitepress": "1.0.0-alpha.60",
"vitest": "^0.29.2",
"tsup": "^6.7.0",
"typescript": "^5.0.2",
"vitepress": "1.0.0-alpha.61",
"vitest": "^0.29.7",
"vue": "^3.2.47"
},
"peerDependencies": {
Expand Down
Loading

0 comments on commit 1e4e8de

Please sign in to comment.