Skip to content

Commit

Permalink
feat(moveentry): remove type unions for category and target
Browse files Browse the repository at this point in the history
They were far more effort than they were worth. Maybe when they're properly supported.
  • Loading branch information
favna committed Jan 2, 2020
1 parent ba44902 commit 8f8b652
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 150 deletions.
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,14 @@
"cz": "git-cz",
"up": "yarn upgrade-interactive --latest",
"sversion": "standard-version",
"codegen": "graphql-codegen && yarn scripts:addunionstotypings && tsc -b typings",
"codegen": "graphql-codegen && tsc -b typings",
"cloud:start": "node index.js",
"prepublishOnly": "yarn codegen",
"scripts:runner": "ts-node -P tsconfig.eslint.json",
"scripts:validateNoOnly": "yarn scripts:runner scripts/validateNoOnly",
"scripts:yarnAfterPull": "yarn scripts:runner scripts/yarnAfterPull",
"scripts:smogontiersupdater": "yarn scripts:runner scripts/updateSmogonTiers",
"scripts:updatelearnsets": "yarn scripts:runner scripts/UpdateLearnsets",
"scripts:addunionstotypings": "yarn scripts:runner scripts/addUnionsToTypings"
"scripts:updatelearnsets": "yarn scripts:runner scripts/UpdateLearnsets"
},
"dependencies": {
"graphql": "^14.5.8"
Expand Down
68 changes: 0 additions & 68 deletions scripts/addUnionsToTypings.ts

This file was deleted.

10 changes: 4 additions & 6 deletions src/structures/MoveEntry.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { Field, Int, ObjectType } from 'type-graphql';
import Pokemon from '../utils/pokemon';
import { MoveCategoryUnion, MoveTargetUnion } from './RegularExpression';

@ObjectType({ description: 'A single Pokémon move entry' })
export default class MoveEntry {
Expand All @@ -19,17 +17,17 @@ export default class MoveEntry {
@Field(() => Int, { description: 'The power points for a move' })
pp: number;

@Field(() => MoveCategoryUnion, { description: 'The category for a move' })
category: Pokemon.MoveCategoryUnion;
@Field(() => String, { description: 'The category for a move' })
category: string;

@Field(() => Int, { description: 'The accuracy for a move' })
accuracy: number;

@Field(() => Int, { description: 'The priority for a move' })
priority: number;

@Field(() => MoveTargetUnion, { description: 'The target for a move' })
target: Pokemon.MoveTargetUnion;
@Field(() => String, { description: 'The target for a move' })
target: string;

@Field(() => String, { nullable: true, description: 'The contest type for a move' })
contestType?: string;
Expand Down
73 changes: 0 additions & 73 deletions src/structures/RegularExpression.ts

This file was deleted.

0 comments on commit 8f8b652

Please sign in to comment.