create-skybridge 0.0.0-dev.eea25a3 → 0.0.0-dev.f476513
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.
- package/dist/index.js +78 -12
- package/dist/index.test.js +2 -1
- package/package.json +1 -1
- package/template/README.md +31 -70
- package/template/_gitignore +2 -192
- package/template/node_modules/.bin/mcp-inspector +21 -0
- package/template/node_modules/.bin/nodemon +21 -0
- package/template/node_modules/.bin/shx +21 -0
- package/template/node_modules/.bin/tsc +21 -0
- package/template/node_modules/.bin/tsserver +21 -0
- package/template/node_modules/.bin/tsx +21 -0
- package/template/node_modules/.bin/vite +21 -0
- package/template/nodemon.json +5 -0
- package/template/package.json +29 -11
- package/template/server/src/index.ts +4 -3
- package/template/server/src/server.ts +45 -60
- package/template/tsconfig.json +23 -0
- package/template/tsconfig.server.json +11 -0
- package/template/web/src/helpers.ts +1 -1
- package/template/web/src/index.css +24 -113
- package/template/web/src/widgets/magic-8-ball.tsx +24 -0
- package/template/web/vite.config.ts +2 -3
- package/template/.cursor/mcp.json +0 -7
- package/template/.nvmrc +0 -1
- package/template/.vscode/launch.json +0 -16
- package/template/.vscode/settings.json +0 -3
- package/template/.vscode/tasks.json +0 -14
- package/template/docs/demo.gif +0 -0
- package/template/pnpm-lock.yaml +0 -317
- package/template/pnpm-workspace.yaml +0 -7
- package/template/server/nodemon.json +0 -5
- package/template/server/package.json +0 -36
- package/template/server/pnpm-lock.yaml +0 -3796
- package/template/server/src/env.ts +0 -12
- package/template/server/src/pokedex.ts +0 -148
- package/template/server/tsconfig.json +0 -17
- package/template/web/components.json +0 -22
- package/template/web/package.json +0 -32
- package/template/web/pnpm-lock.yaml +0 -2629
- package/template/web/src/components/ui/shadcn-io/spinner/index.tsx +0 -272
- package/template/web/src/utils.ts +0 -6
- package/template/web/src/widgets/pokemon.tsx +0 -203
- package/template/web/tsconfig.app.json +0 -34
- package/template/web/tsconfig.json +0 -13
- package/template/web/tsconfig.node.json +0 -26
|
@@ -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,17 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "ESNext",
|
|
4
|
-
"module": "ESNext",
|
|
5
|
-
"moduleResolution": "bundler",
|
|
6
|
-
"esModuleInterop": true,
|
|
7
|
-
"strict": true,
|
|
8
|
-
"skipLibCheck": true,
|
|
9
|
-
"forceConsistentCasingInFileNames": true,
|
|
10
|
-
"outDir": "dist",
|
|
11
|
-
"sourceMap": true,
|
|
12
|
-
"jsx": "react",
|
|
13
|
-
"inlineSources": true
|
|
14
|
-
},
|
|
15
|
-
"include": ["**/*.ts", "**/*.tsx"],
|
|
16
|
-
"exclude": ["dist", "node_modules"]
|
|
17
|
-
}
|
|
@@ -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
|
-
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@apps-sdk-template/web",
|
|
3
|
-
"private": true,
|
|
4
|
-
"version": "0.0.0",
|
|
5
|
-
"type": "module",
|
|
6
|
-
"scripts": {
|
|
7
|
-
"dev": "echo 'Not implemented",
|
|
8
|
-
"build": "tsc -b && vite build",
|
|
9
|
-
"preview": "vite preview"
|
|
10
|
-
},
|
|
11
|
-
"dependencies": {
|
|
12
|
-
"skybridge": "catalog:",
|
|
13
|
-
"class-variance-authority": "^0.7.1",
|
|
14
|
-
"clsx": "^2.1.1",
|
|
15
|
-
"glob": "^11.0.3",
|
|
16
|
-
"lucide-react": "^0.546.0",
|
|
17
|
-
"react": "^19.1.1",
|
|
18
|
-
"react-dom": "^19.1.1",
|
|
19
|
-
"tailwind-merge": "^3.3.1",
|
|
20
|
-
"tailwindcss": "^4.1.14"
|
|
21
|
-
},
|
|
22
|
-
"devDependencies": {
|
|
23
|
-
"@tailwindcss/vite": "^4.1.14",
|
|
24
|
-
"@types/node": "^24.6.0",
|
|
25
|
-
"@types/react": "^19.1.16",
|
|
26
|
-
"@types/react-dom": "^19.1.9",
|
|
27
|
-
"@vitejs/plugin-react": "^5.0.4",
|
|
28
|
-
"tw-animate-css": "^1.4.0",
|
|
29
|
-
"typescript": "~5.9.3",
|
|
30
|
-
"vite": "^7.1.11"
|
|
31
|
-
}
|
|
32
|
-
}
|