fix namespace conflicts

This commit is contained in:
Jeff Colombo 2019-03-19 02:02:10 -04:00
parent 0d7fbab223
commit c5f36e553f
24 changed files with 3598 additions and 3603 deletions

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -11,8 +11,8 @@
"tsnode": "node -r ts-node/register -r tsconfig-paths/register", "tsnode": "node -r ts-node/register -r tsconfig-paths/register",
"generate": "node_modules/.bin/run-s protobuf pbjs pbts pokemondata", "generate": "node_modules/.bin/run-s protobuf pbjs pbts pokemondata",
"protobuf": "yarn tsnode ./src/scripts/generatePogoProtocolBuffer.ts PokemonId.proto Form.proto PokemonMove.proto PokemonFamilyId.proto PokemonType.proto", "protobuf": "yarn tsnode ./src/scripts/generatePogoProtocolBuffer.ts PokemonId.proto Form.proto PokemonMove.proto PokemonFamilyId.proto PokemonType.proto",
"pbjs": "node_modules/.bin/pbjs --keep-case -t static-module --no-verify --no-create --no-delimited -o ./externals/generated/PvPogoProtos.js ./externals/generated/POGOProtos.generated.proto", "pbjs": "node_modules/.bin/pbjs --keep-case -t static-module --no-verify --no-create --no-delimited -w es6 -r PVPokemon -o ./externals/generated/PVPogoProtos.js ./externals/generated/POGOProtos.generated.proto",
"pbts": "node_modules/.bin/pbts --no-comments -o ./externals/generated/PvPogoProtos.d.ts ./externals/generated/PvPogoProtos.js", "pbts": "node_modules/.bin/pbts --no-comments -n PVPokemon -o ./externals/generated/PVPogoProtos.d.ts ./externals/generated/PVPogoProtos.js",
"pokemondata": "yarn tsnode ./src/scripts/generatePokemonData.ts" "pokemondata": "yarn tsnode ./src/scripts/generatePokemonData.ts"
}, },
"devDependencies": { "devDependencies": {

View File

@ -9,7 +9,7 @@ import { ILeaguePokemonJson } from 'api/PokemonService';
import { ILeaguePokemon, League, MaxCpByLeague } from 'app/models/League'; import { ILeaguePokemon, League, MaxCpByLeague } from 'app/models/League';
import { Grade, IMaxStats, IStats } from 'app/models/Pokemon'; import { Grade, IMaxStats, IStats } from 'app/models/Pokemon';
import * as PVPogoProtos from 'common/models/PvPogoProtos'; import * as PVPogoProtos from 'common/models/PVPogoProtos';
type ICpAndTotalFound = Record<number, Array<IStats>>; type ICpAndTotalFound = Record<number, Array<IStats>>;
interface IStatsDistribution { interface IStatsDistribution {

View File

@ -1,12 +1,13 @@
import fs from 'fs'; import fs from 'fs';
import path from 'path'; import path from 'path';
import POGOProtos from 'pogo-protos';
import { ApiService } from 'api/ApiService'; import { ApiService } from 'api/ApiService';
import { CombatMoveStats, IBaseStatsRank, IPokemon, TypeEffectiveness, TypeOrder } from 'app/models/Pokemon'; import { CombatMoveStats, IBaseStatsRank, IPokemon, TypeEffectiveness, TypeOrder } from 'app/models/Pokemon';
import { LegacyMoves } from 'common/models/LegacyMoves'; import { LegacyMoves } from 'common/models/LegacyMoves';
import * as PVPogoProtos from 'common/models/PvPogoProtos'; import * as PVPogoProtos from 'common/models/PVPogoProtos';
interface ICalculateRelativeStats { interface ICalculateRelativeStats {
id : PVPogoProtos.PokemonId; id : PVPogoProtos.PokemonId;
@ -15,8 +16,6 @@ interface ICalculateRelativeStats {
} }
export const parseGameMaster = async () => { export const parseGameMaster = async () => {
const POGOProtos = await import('pogo-protos');
const apiService = new ApiService(); const apiService = new ApiService();
const pokemonDataByPokemonId : Map<PVPogoProtos.PokemonId, Array<IPokemon>> = new Map(); const pokemonDataByPokemonId : Map<PVPogoProtos.PokemonId, Array<IPokemon>> = new Map();
const pokemonFormsByPokemonId : Map<PVPogoProtos.PokemonId, Array<PVPogoProtos.PokemonForm>> = new Map(); const pokemonFormsByPokemonId : Map<PVPogoProtos.PokemonId, Array<PVPogoProtos.PokemonForm>> = new Map();

View File

@ -5,7 +5,7 @@ import { AjaxRequest } from 'api/AjaxRequest';
import { DEFAULT_POKEMON_NAME, IPokemonSpecies } from 'app/models/Pokemon'; import { DEFAULT_POKEMON_NAME, IPokemonSpecies } from 'app/models/Pokemon';
import * as PVPogoProtos from 'common/models/PvPogoProtos'; import * as PVPogoProtos from 'common/models/PVPogoProtos';
interface IPokeApiSpeciesNameJSON { interface IPokeApiSpeciesNameJSON {
pokemon_species_id : string; pokemon_species_id : string;

View File

@ -4,7 +4,7 @@ import { AttackTypeEffectivenessSerializingTuple, IConfig, IConfigJson } from 'a
import { ILeaguePokemon } from 'app/models/League'; import { ILeaguePokemon } from 'app/models/League';
import { IPokemon, TypeEffectiveness } from 'app/models/Pokemon'; import { IPokemon, TypeEffectiveness } from 'app/models/Pokemon';
import * as PVPogoProtos from 'common/models/PvPogoProtos'; import * as PVPogoProtos from 'common/models/PVPogoProtos';
type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>; type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
export interface ILeaguePokemonJson extends Omit<ILeaguePokemon, 'effectiveness'> { export interface ILeaguePokemonJson extends Omit<ILeaguePokemon, 'effectiveness'> {

View File

@ -18,7 +18,7 @@ import { Header } from 'app/components/Header';
import { ConnectedPokemonExplorer } from 'app/components/PokemonExplorer/PokemonExplorer'; import { ConnectedPokemonExplorer } from 'app/components/PokemonExplorer/PokemonExplorer';
import { PokemonSelectList } from 'app/components/PokemonSelectList/PokemonSelectList'; import { PokemonSelectList } from 'app/components/PokemonSelectList/PokemonSelectList';
import * as PVPogoProtos from 'common/models/PvPogoProtos'; import * as PVPogoProtos from 'common/models/PVPogoProtos';
import * as styles from 'app/styles/PokemonApp.scss'; import * as styles from 'app/styles/PokemonApp.scss';

View File

@ -7,7 +7,7 @@ import classNames from 'classnames';
import { IIndividualValues } from 'app/components/PokemonExplorer/types'; import { IIndividualValues } from 'app/components/PokemonExplorer/types';
import { Grade, IStats } from 'app/models/Pokemon'; import { Grade, IStats } from 'app/models/Pokemon';
import * as PVPogoProtos from 'common/models/PvPogoProtos'; import * as PVPogoProtos from 'common/models/PVPogoProtos';
import * as styles from 'app/components/PokemonExplorer/styles/LeagueStatsList.scss'; import * as styles from 'app/components/PokemonExplorer/styles/LeagueStatsList.scss';

View File

@ -11,7 +11,7 @@ import { TypeIndicator, TypeTheme } from './TypeIndicator';
import { formatType } from 'app/utils/formatter'; import { formatType } from 'app/utils/formatter';
import { getMoveType } from 'app/utils/types'; import { getMoveType } from 'app/utils/types';
import * as PVPogoProtos from 'common/models/PvPogoProtos'; import * as PVPogoProtos from 'common/models/PVPogoProtos';
import * as styles from 'app/components/PokemonExplorer/styles/MovesDropdown.scss'; import * as styles from 'app/components/PokemonExplorer/styles/MovesDropdown.scss';

View File

@ -12,7 +12,7 @@ import { EffectivenessMode, TypeEffectiveDisplay } from './TypeEffectiveDisplay'
import { calculateTypeCoverage } from 'app/utils/types'; import { calculateTypeCoverage } from 'app/utils/types';
import * as PVPogoProtos from 'common/models/PvPogoProtos'; import * as PVPogoProtos from 'common/models/PVPogoProtos';
import * as styles from 'app/components/PokemonExplorer/styles/MovesExplorer.scss'; import * as styles from 'app/components/PokemonExplorer/styles/MovesExplorer.scss';

View File

@ -9,7 +9,7 @@ import { formatDexNumber, formatForm, Forms } from 'app/utils/formatter';
import { StatDisplay } from './StatDisplay'; import { StatDisplay } from './StatDisplay';
import { TypeIndicator, TypeTheme } from './TypeIndicator'; import { TypeIndicator, TypeTheme } from './TypeIndicator';
import * as PVPogoProtos from 'common/models/PvPogoProtos'; import * as PVPogoProtos from 'common/models/PVPogoProtos';
import * as styles from 'app/components/PokemonExplorer/styles/PokemonDisplay.scss'; import * as styles from 'app/components/PokemonExplorer/styles/PokemonDisplay.scss';

View File

@ -26,7 +26,7 @@ import { EffectivenessMode, TypeEffectiveDisplay } from 'app/components/PokemonE
import { appendQueryString } from 'app/utils/navigation'; import { appendQueryString } from 'app/utils/navigation';
import { calculateTypeCoverage } from 'app/utils/types'; import { calculateTypeCoverage } from 'app/utils/types';
import * as PVPogoProtos from 'common/models/PvPogoProtos'; import * as PVPogoProtos from 'common/models/PVPogoProtos';
import * as styles from 'app/styles/PokemonApp.scss'; import * as styles from 'app/styles/PokemonApp.scss';

View File

@ -6,7 +6,7 @@ import { IPokemon, TypeEffectiveness } from 'app/models/Pokemon';
import { TypeIndicator, TypeTheme } from './TypeIndicator'; import { TypeIndicator, TypeTheme } from './TypeIndicator';
import * as PVPogoProtos from 'common/models/PvPogoProtos'; import * as PVPogoProtos from 'common/models/PVPogoProtos';
import * as styles from 'app/components/PokemonExplorer/styles/TypeEffectiveDisplay.scss'; import * as styles from 'app/components/PokemonExplorer/styles/TypeEffectiveDisplay.scss';

View File

@ -4,7 +4,7 @@ import classNames from 'classnames';
import { formatType } from 'app/utils/formatter'; import { formatType } from 'app/utils/formatter';
import * as PVPogoProtos from 'common/models/PvPogoProtos'; import * as PVPogoProtos from 'common/models/PVPogoProtos';
import * as styles from 'app/components/PokemonExplorer/styles/TypeIndicator.scss'; import * as styles from 'app/components/PokemonExplorer/styles/TypeIndicator.scss';

View File

@ -10,7 +10,7 @@ import { appendQueryString } from 'app/utils/navigation';
import { DEFAULT_POKEMON_NAME, IPokemon } from 'app/models/Pokemon'; import { DEFAULT_POKEMON_NAME, IPokemon } from 'app/models/Pokemon';
import * as PVPogoProtos from 'common/models/PvPogoProtos'; import * as PVPogoProtos from 'common/models/PVPogoProtos';
import * as styles from './styles/PokemonSelectList.scss'; import * as styles from './styles/PokemonSelectList.scss';

View File

@ -6,7 +6,7 @@ import { IPokemon } from 'app/models/Pokemon';
import { ThunkResult } from 'app/types'; import { ThunkResult } from 'app/types';
import { PokemonSelectListActionTypes } from './types'; import { PokemonSelectListActionTypes } from './types';
import * as PVPogoProtos from 'common/models/PvPogoProtos'; import * as PVPogoProtos from 'common/models/PVPogoProtos';
export const setIsLoading = (isLoading : boolean) => action(PokemonSelectListActionTypes.SET_IS_LOADING, { isLoading }); export const setIsLoading = (isLoading : boolean) => action(PokemonSelectListActionTypes.SET_IS_LOADING, { isLoading });

View File

@ -1,7 +1,7 @@
import { ILeaguePokemon } from 'app/models/League'; import { ILeaguePokemon } from 'app/models/League';
import { IPokemon } from 'app/models/Pokemon'; import { IPokemon } from 'app/models/Pokemon';
import * as PVPogoProtos from 'common/models/PvPogoProtos'; import * as PVPogoProtos from 'common/models/PVPogoProtos';
export interface IPokemonSelectListState { export interface IPokemonSelectListState {
isLoading : boolean; isLoading : boolean;

View File

@ -1,6 +1,6 @@
import { CombatMoveStats, ICombatMoveStats, IMaxStats, TypeEffectiveness } from 'app/models/Pokemon'; import { CombatMoveStats, ICombatMoveStats, IMaxStats, TypeEffectiveness } from 'app/models/Pokemon';
import * as PVPogoProtos from 'common/models/PvPogoProtos'; import * as PVPogoProtos from 'common/models/PVPogoProtos';
type TypeEffectivenessByTypeJson = Array<[PVPogoProtos.PokemonType, TypeEffectiveness]>; type TypeEffectivenessByTypeJson = Array<[PVPogoProtos.PokemonType, TypeEffectiveness]>;
type AttackTypeEffectivenessJson = Array<[PVPogoProtos.PokemonType, TypeEffectivenessByTypeJson]>; type AttackTypeEffectivenessJson = Array<[PVPogoProtos.PokemonType, TypeEffectivenessByTypeJson]>;

View File

@ -1,4 +1,4 @@
import * as PVPogoProtos from 'common/models/PvPogoProtos'; import * as PVPogoProtos from 'common/models/PVPogoProtos';
export const DEFAULT_POKEMON_NAME = 'MissingNo.'; export const DEFAULT_POKEMON_NAME = 'MissingNo.';

View File

@ -1,4 +1,4 @@
import * as PVPogoProtos from 'common/models/PvPogoProtos'; import * as PVPogoProtos from 'common/models/PVPogoProtos';
export const formatDexNumber = (dex : number) => { export const formatDexNumber = (dex : number) => {
let prefix : string = ''; let prefix : string = '';

View File

@ -3,7 +3,7 @@ import { CombatMoveStats, ICombatMoveStats, IPokemonMove, TypeEffectiveness } fr
import { SelectedCombatMoves } from 'app/components/PokemonExplorer/types'; import { SelectedCombatMoves } from 'app/components/PokemonExplorer/types';
import * as PVPogoProtos from 'common/models/PvPogoProtos'; import * as PVPogoProtos from 'common/models/PVPogoProtos';
export const calculateTypeCoverage = ( export const calculateTypeCoverage = (
selectedMoves : SelectedCombatMoves, selectedMoves : SelectedCombatMoves,

View File

@ -1,4 +1,4 @@
import * as PVPogoProtos from 'common/models/PvPogoProtos'; import * as PVPogoProtos from 'common/models/PVPogoProtos';
interface ILegacyMoves { interface ILegacyMoves {
quick_moves : Array<PVPogoProtos.PokemonMove>; quick_moves : Array<PVPogoProtos.PokemonMove>;

View File

@ -1,19 +1,19 @@
import { POGOProtos } from 'externals/generated/PvPogoProtos'; import * as PVPogoProtos from 'externals/generated/PVPogoProtos';
export const PokemonId = POGOProtos.Enums.PokemonId; export const PokemonId = PVPogoProtos.POGOProtos.Enums.PokemonId;
export type PokemonId = POGOProtos.Enums.PokemonId; export type PokemonId = PVPogoProtos.POGOProtos.Enums.PokemonId;
export const PokemonMove = POGOProtos.Enums.PokemonMove; export const PokemonMove = PVPogoProtos.POGOProtos.Enums.PokemonMove;
export type PokemonMove = POGOProtos.Enums.PokemonMove; export type PokemonMove = PVPogoProtos.POGOProtos.Enums.PokemonMove;
export const PokemonFamilyId = POGOProtos.Enums.PokemonFamilyId; export const PokemonFamilyId = PVPogoProtos.POGOProtos.Enums.PokemonFamilyId;
export type PokemonFamilyId = POGOProtos.Enums.PokemonFamilyId; export type PokemonFamilyId = PVPogoProtos.POGOProtos.Enums.PokemonFamilyId;
export const PokemonType = POGOProtos.Enums.PokemonType; export const PokemonType = PVPogoProtos.POGOProtos.Enums.PokemonType;
export type PokemonType = POGOProtos.Enums.PokemonType; export type PokemonType = PVPogoProtos.POGOProtos.Enums.PokemonType;
export const PokemonForm = POGOProtos.Enums.Form; export const PokemonForm = PVPogoProtos.POGOProtos.Enums.Form;
export type PokemonForm = POGOProtos.Enums.Form; export type PokemonForm = PVPogoProtos.POGOProtos.Enums.Form;
// this worked, until i realized that i needed to access the values of the enums and not just the types // this worked, until i realized that i needed to access the values of the enums and not just the types
// export declare const PokemonId : import('pogo-protos').Enums.PokemonId; // export declare const PokemonId : import('pogo-protos').Enums.PokemonId;