create-skybridge 0.0.0-dev.b0a1d24 → 0.0.0-dev.b0d461b

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.
Files changed (96) hide show
  1. package/dist/index.js +332 -194
  2. package/package.json +10 -9
  3. package/templates/blank/.dockerignore +4 -0
  4. package/templates/blank/AGENTS.md +1 -0
  5. package/templates/blank/Dockerfile +53 -0
  6. package/templates/blank/README.md +92 -0
  7. package/templates/blank/_gitignore +7 -0
  8. package/templates/blank/alpic.json +3 -0
  9. package/templates/blank/node_modules/.bin/alpic +21 -0
  10. package/templates/blank/node_modules/.bin/sb +21 -0
  11. package/templates/blank/node_modules/.bin/skybridge +21 -0
  12. package/templates/blank/node_modules/.bin/tsc +21 -0
  13. package/templates/blank/node_modules/.bin/tsserver +21 -0
  14. package/templates/blank/node_modules/.bin/tsx +21 -0
  15. package/templates/blank/node_modules/.bin/vite +21 -0
  16. package/templates/blank/package.json +29 -0
  17. package/templates/blank/src/helpers.ts +4 -0
  18. package/templates/blank/src/server.ts +16 -0
  19. package/templates/blank/tsconfig.json +5 -0
  20. package/templates/blank/vite.config.ts +6 -0
  21. package/templates/demo/.dockerignore +4 -0
  22. package/templates/demo/AGENTS.md +1 -0
  23. package/templates/demo/Dockerfile +53 -0
  24. package/templates/demo/README.md +95 -0
  25. package/templates/demo/_gitignore +7 -0
  26. package/templates/demo/alpic.json +3 -0
  27. package/templates/demo/node_modules/.bin/alpic +21 -0
  28. package/templates/demo/node_modules/.bin/sb +21 -0
  29. package/templates/demo/node_modules/.bin/skybridge +21 -0
  30. package/templates/demo/node_modules/.bin/tsc +21 -0
  31. package/templates/demo/node_modules/.bin/tsserver +21 -0
  32. package/templates/demo/node_modules/.bin/tsx +21 -0
  33. package/templates/demo/node_modules/.bin/vite +21 -0
  34. package/templates/demo/package.json +41 -0
  35. package/templates/demo/src/helpers.ts +4 -0
  36. package/templates/demo/src/index.css +59 -0
  37. package/templates/demo/src/server.ts +94 -0
  38. package/templates/demo/src/views/components/doc-link.tsx +22 -0
  39. package/templates/demo/src/views/components/doc.tsx +21 -0
  40. package/templates/demo/src/views/components/nav.tsx +31 -0
  41. package/templates/demo/src/views/components/progress.tsx +35 -0
  42. package/templates/demo/src/views/components/steps/outro.tsx +68 -0
  43. package/templates/demo/src/views/components/steps/state.tsx +47 -0
  44. package/templates/demo/src/views/components/steps/tool-call.tsx +53 -0
  45. package/templates/demo/src/views/components/steps/tool-output.tsx +40 -0
  46. package/templates/demo/src/views/images/mascot/beret.png +0 -0
  47. package/templates/demo/src/views/images/mascot/chapka.png +0 -0
  48. package/templates/demo/src/views/images/mascot/cowboy-hat.png +0 -0
  49. package/templates/demo/src/views/images/mascot/fez.png +0 -0
  50. package/templates/demo/src/views/images/mascot/jester-hat.png +0 -0
  51. package/templates/demo/src/views/images/mascot/mitre.png +0 -0
  52. package/templates/demo/src/views/images/mascot/non-la.png +0 -0
  53. package/templates/demo/src/views/images/mascot/original.png +0 -0
  54. package/templates/demo/src/views/images/mascot/propeller-beanie.png +0 -0
  55. package/templates/demo/src/views/images/mascot/ski-mask.png +0 -0
  56. package/templates/demo/src/views/images/mascot/sombrero.png +0 -0
  57. package/templates/demo/src/views/images/mascot/top-hat.png +0 -0
  58. package/templates/demo/src/views/images/mascot/viking-helmet.png +0 -0
  59. package/templates/demo/src/views/onboarding.tsx +63 -0
  60. package/templates/demo/src/views/use-mascot.ts +60 -0
  61. package/templates/demo/tsconfig.json +11 -0
  62. package/{template-ecom/web → templates/demo}/vite.config.ts +3 -4
  63. package/dist/index.test.d.ts +0 -1
  64. package/dist/index.test.js +0 -23
  65. package/template/README.md +0 -77
  66. package/template/alpic.json +0 -4
  67. package/template/node_modules/.bin/mcp-inspector +0 -21
  68. package/template/node_modules/.bin/nodemon +0 -21
  69. package/template/node_modules/.bin/shx +0 -21
  70. package/template/node_modules/.bin/tsc +0 -21
  71. package/template/node_modules/.bin/tsserver +0 -21
  72. package/template/node_modules/.bin/tsx +0 -21
  73. package/template/node_modules/.bin/vite +0 -21
  74. package/template/nodemon.json +0 -5
  75. package/template/package.json +0 -42
  76. package/template/server/src/index.ts +0 -39
  77. package/template/server/src/middleware.ts +0 -54
  78. package/template/server/src/server.ts +0 -61
  79. package/template/tsconfig.json +0 -23
  80. package/template/tsconfig.server.json +0 -11
  81. package/template/web/src/helpers.ts +0 -4
  82. package/template/web/src/index.css +0 -31
  83. package/template/web/src/widgets/magic-8-ball.tsx +0 -24
  84. package/template/web/vite.config.ts +0 -15
  85. package/template-ecom/README.md +0 -86
  86. package/template-ecom/alpic.json +0 -4
  87. package/template-ecom/nodemon.json +0 -5
  88. package/template-ecom/package.json +0 -40
  89. package/template-ecom/server/src/index.ts +0 -39
  90. package/template-ecom/server/src/middleware.ts +0 -54
  91. package/template-ecom/server/src/server.ts +0 -73
  92. package/template-ecom/tsconfig.json +0 -23
  93. package/template-ecom/tsconfig.server.json +0 -11
  94. package/template-ecom/web/src/helpers.ts +0 -4
  95. package/template-ecom/web/src/index.css +0 -178
  96. package/template-ecom/web/src/widgets/ecom-carousel.tsx +0 -109
@@ -1,109 +0,0 @@
1
- import "@/index.css";
2
-
3
- import { useState } from "react";
4
- import { mountWidget, useLayout, useUser } from "skybridge/web";
5
- import { useToolInfo } from "../helpers.js";
6
-
7
- const translations: Record<string, Record<string, string>> = {
8
- en: {
9
- loading: "Loading products...",
10
- noProducts: "No product found",
11
- },
12
- fr: {
13
- loading: "Chargement des produits...",
14
- noProducts: "Aucun produit trouvé",
15
- },
16
- es: {
17
- loading: "Cargando productos...",
18
- noProducts: "No se encontraron productos",
19
- },
20
- de: {
21
- loading: "Produkte werden geladen...",
22
- noProducts: "Keine Produkte gefunden",
23
- },
24
- };
25
-
26
- function EcomCarousel() {
27
- const { theme } = useLayout();
28
- const { locale } = useUser();
29
-
30
- const lang = locale?.split("-")[0] ?? "en";
31
-
32
- function translate(key: string) {
33
- return translations[lang]?.[key] ?? translations.en[key];
34
- }
35
-
36
- const { output, isPending } = useToolInfo<"ecom-carousel">();
37
- type Product = NonNullable<typeof output>["products"][number];
38
- const [selected, setSelected] = useState<Product | null>(null);
39
-
40
- function cn(...classes: string[]) {
41
- return [theme, ...classes].filter(Boolean).join(" ");
42
- }
43
-
44
- if (isPending) {
45
- return (
46
- <div className={cn("container")}>
47
- <div className={cn("message")}>{translate("loading")}</div>
48
- </div>
49
- );
50
- }
51
-
52
- if (!output || output.products.length === 0) {
53
- return (
54
- <div className={cn("container")}>
55
- <div className={cn("message")}>{translate("noProducts")}</div>
56
- </div>
57
- );
58
- }
59
-
60
- const activeProduct = selected ?? output.products[0];
61
-
62
- return (
63
- <div className={cn("container")}>
64
- <div className={cn("carousel")}>
65
- {output.products.map((product) => (
66
- <button
67
- type="button"
68
- key={product.id}
69
- className={cn(
70
- "product-card",
71
- activeProduct?.id === product.id ? "selected" : "",
72
- )}
73
- onClick={() =>
74
- setSelected(selected?.id === product.id ? null : product)
75
- }
76
- >
77
- <img
78
- src={product.image}
79
- alt={product.title}
80
- className={cn("product-image")}
81
- />
82
- <div className={cn("product-info")}>
83
- <div className={cn("product-title")}>{product.title}</div>
84
- <div className={cn("product-price")}>
85
- ${product.price.toFixed(2)}
86
- </div>
87
- </div>
88
- </button>
89
- ))}
90
- </div>
91
- {activeProduct && (
92
- <div className={cn("product-detail")}>
93
- <div className={cn("detail-title")}>{activeProduct.title}</div>
94
- <div className={cn("detail-rating")}>
95
- ⭐ {activeProduct.rating.rate} ({activeProduct.rating.count}{" "}
96
- reviews)
97
- </div>
98
- <div className={cn("detail-description")}>
99
- {activeProduct.description}
100
- </div>
101
- </div>
102
- )}
103
- </div>
104
- );
105
- }
106
-
107
- export default EcomCarousel;
108
-
109
- mountWidget(<EcomCarousel />);