create-skybridge 0.0.0-dev.eea25a3 → 0.0.0-dev.f762713

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,12 +0,0 @@
1
- import "dotenv/config";
2
-
3
- import { createEnv } from "@t3-oss/env-core";
4
- import { z } from "zod";
5
-
6
- export const env = createEnv({
7
- server: {
8
- NODE_ENV: z.enum(["development", "production"]).default("development"),
9
- },
10
- runtimeEnv: process.env,
11
- emptyStringAsUndefined: true,
12
- });
@@ -1,148 +0,0 @@
1
- export const getPokemon = async (name: string) => {
2
- const query = `
3
- query getPokemon($name: String!, $language: String!) {
4
- pokemon(where: {name: {_eq: $name} is_default: {_eq: true}}) {
5
- id
6
- order
7
- height
8
- weight
9
- pokemonstats {
10
- base_stat
11
- stat {
12
- name
13
- statnames(where: {language: {name: {_eq: $language}}}, limit: 1) {
14
- name
15
- }
16
- }
17
- }
18
- pokemonabilities {
19
- ability {
20
- name
21
- abilitynames(where: {language: {name: {_eq: $language}}}, limit: 1) {
22
- name
23
- }
24
- abilityflavortexts(where: {language: {name: {_eq: $language}}}, limit: 1) {
25
- flavor_text
26
- }
27
- }
28
- }
29
- pokemonsprites {
30
- sprites
31
- }
32
- pokemontypes {
33
- type {
34
- name
35
- typenames(where: {language: {name: {_eq: $language}}}, limit: 1) {
36
- name
37
- }
38
- }
39
- }
40
- pokemonspecy {
41
- pokemoncolor {
42
- name
43
- }
44
- evolutionchain {
45
- pokemonspecies {
46
- pokemons(where: {is_default: {_eq: true}}) {
47
- name
48
- order
49
- pokemonsprites {
50
- sprites
51
- }
52
- }
53
- }
54
- }
55
- pokemonspeciesflavortexts(where: {language: {name: {_eq: $language}}}, limit: 1) {
56
- flavor_text
57
- }
58
- }
59
- }
60
- }
61
- `;
62
-
63
- const response = await fetch("https://graphql.pokeapi.co/v1beta2", {
64
- method: "POST",
65
- headers: {
66
- "Content-Type": "application/json",
67
- },
68
- body: JSON.stringify({
69
- query,
70
- variables: { name: name.toLowerCase(), language: "en" },
71
- }),
72
- });
73
-
74
- const result = await response.json();
75
- const pokemon = result.data.pokemon[0] as {
76
- id: number;
77
- order: number;
78
- height: number;
79
- weight: number;
80
- pokemonspecy: {
81
- pokemoncolor: { name: string };
82
- pokemonspeciesflavortexts: { flavor_text: string }[];
83
- evolutionchain: {
84
- pokemonspecies: {
85
- pokemons: {
86
- name: string;
87
- order: number;
88
- pokemonsprites: { sprites: { front_default: string } }[];
89
- }[];
90
- }[];
91
- };
92
- };
93
- pokemonsprites: { sprites: { front_default: string } }[];
94
- pokemonstats: {
95
- base_stat: number;
96
- stat: { name: string; statnames: { name: string }[] };
97
- }[];
98
- pokemontypes: {
99
- type: { name: string; typenames: { name: string }[] };
100
- }[];
101
- pokemonabilities: {
102
- ability: {
103
- name: string;
104
- abilitynames: { name: string }[];
105
- abilityflavortexts: { flavor_text: string }[];
106
- };
107
- }[];
108
- } | null;
109
-
110
- if (!pokemon) {
111
- throw new Error(`Pokemon ${name} not found`);
112
- }
113
-
114
- return {
115
- id: pokemon.id,
116
- color: pokemon.pokemonspecy.pokemoncolor.name,
117
- order: pokemon.order,
118
- heightInMeters: pokemon.height / 10,
119
- weightInKilograms: pokemon.weight / 10,
120
- imageUrl: pokemon.pokemonsprites[0].sprites.front_default,
121
- description: pokemon.pokemonspecy.pokemonspeciesflavortexts[0]?.flavor_text
122
- .replace(/\n/g, " ")
123
- .replace(/\.(?![^.]*$)/g, ". "),
124
- stats: pokemon.pokemonstats.map((stat) => ({
125
- id: stat.stat.name,
126
- name: stat.stat.statnames[0].name,
127
- value: stat.base_stat,
128
- })),
129
- types: pokemon.pokemontypes.map((type) => ({
130
- id: type.type.name,
131
- name: type.type.typenames[0].name,
132
- })),
133
- abilities: pokemon.pokemonabilities.map((ability) => ({
134
- id: ability.ability.name,
135
- name: ability.ability.abilitynames[0].name,
136
- description: ability.ability.abilityflavortexts[0]?.flavor_text
137
- .replace(/\n/g, " ")
138
- .replace(/\.(?![^.]*$)/g, ". "),
139
- })),
140
- evolutions: pokemon.pokemonspecy.evolutionchain.pokemonspecies.map(
141
- ({ pokemons: [pokemon] }) => ({
142
- id: pokemon.name,
143
- order: pokemon.order,
144
- imageUrl: pokemon.pokemonsprites[0].sprites.front_default,
145
- }),
146
- ),
147
- };
148
- };
@@ -1,22 +0,0 @@
1
- {
2
- "$schema": "https://ui.shadcn.com/schema.json",
3
- "style": "new-york",
4
- "rsc": false,
5
- "tsx": true,
6
- "tailwind": {
7
- "config": "",
8
- "css": "src/index.css",
9
- "baseColor": "neutral",
10
- "cssVariables": true,
11
- "prefix": ""
12
- },
13
- "iconLibrary": "lucide",
14
- "aliases": {
15
- "components": "@/components",
16
- "utils": "@/lib/utils",
17
- "ui": "@/components/ui",
18
- "lib": "@/lib",
19
- "hooks": "@/hooks"
20
- },
21
- "registries": {}
22
- }