sunpeak 0.3.4 → 0.3.6
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/README.md +7 -0
- package/package.json +1 -1
- package/template/dev/main.tsx +1 -1
- package/template/src/App.tsx +2 -1
- package/template/src/components/openai-card.tsx +1 -1
- package/template/src/components/openai-carousel.tsx +1 -1
- package/template/tsconfig.json +1 -4
- package/template/vite.config.build.ts +9 -1
- package/template/vite.config.ts +0 -1
- package/template/vitest.config.ts +9 -1
package/README.md
CHANGED
|
@@ -39,6 +39,13 @@ Requirements: React (18+), Tailwind 4
|
|
|
39
39
|
pnpm add sunpeak
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
+
When using `ChatGPTSimulator`, import the styles in your entry file:
|
|
43
|
+
|
|
44
|
+
```tsx
|
|
45
|
+
import 'sunpeak/style.css';
|
|
46
|
+
import { ChatGPTSimulator } from 'sunpeak';
|
|
47
|
+
```
|
|
48
|
+
|
|
42
49
|
## Key Features
|
|
43
50
|
- 📺 ChatGPT simulator for local UI component development.
|
|
44
51
|
- 📚 Pre-built component library built on [openai/apps-sdk-ui](https://github.com/openai/apps-sdk-ui).
|
package/package.json
CHANGED
package/template/dev/main.tsx
CHANGED
package/template/src/App.tsx
CHANGED
|
@@ -4,7 +4,7 @@ import { WheelGesturesPlugin } from "embla-carousel-wheel-gestures"
|
|
|
4
4
|
import { ArrowLeft, ArrowRight } from "@openai/apps-sdk-ui/components/Icon"
|
|
5
5
|
import { useWidgetState, useDisplayMode } from "sunpeak"
|
|
6
6
|
import { Button } from "@openai/apps-sdk-ui/components/Button"
|
|
7
|
-
import { cn } from "
|
|
7
|
+
import { cn } from "../lib/index"
|
|
8
8
|
|
|
9
9
|
export interface OpenAICarouselState extends Record<string, unknown> {
|
|
10
10
|
currentIndex?: number
|
package/template/tsconfig.json
CHANGED
|
@@ -4,6 +4,10 @@ import path from 'path';
|
|
|
4
4
|
import tailwindcss from '@tailwindcss/vite';
|
|
5
5
|
import { readFileSync, writeFileSync, unlinkSync, existsSync } from 'fs';
|
|
6
6
|
|
|
7
|
+
// Check if we're in the sunpeak workspace (directory is named "template")
|
|
8
|
+
const isTemplate = path.basename(__dirname) === 'template';
|
|
9
|
+
const parentSrc = path.resolve(__dirname, '../src');
|
|
10
|
+
|
|
7
11
|
// Plugin to inline CSS into the JS bundle
|
|
8
12
|
function inlineCssPlugin() {
|
|
9
13
|
return {
|
|
@@ -35,7 +39,11 @@ export default defineConfig({
|
|
|
35
39
|
},
|
|
36
40
|
resolve: {
|
|
37
41
|
alias: {
|
|
38
|
-
|
|
42
|
+
// In workspace dev mode, use local sunpeak source
|
|
43
|
+
...(isTemplate && {
|
|
44
|
+
'sunpeak': parentSrc,
|
|
45
|
+
'~': parentSrc,
|
|
46
|
+
}),
|
|
39
47
|
},
|
|
40
48
|
conditions: ['style', 'import', 'module', 'browser', 'default'],
|
|
41
49
|
},
|
package/template/vite.config.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { defineConfig } from 'vitest/config';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
|
|
4
|
+
// Check if we're in the sunpeak workspace (directory is named "template")
|
|
5
|
+
const isTemplate = path.basename(__dirname) === 'template';
|
|
6
|
+
const parentSrc = path.resolve(__dirname, '../src');
|
|
7
|
+
|
|
4
8
|
export default defineConfig({
|
|
5
9
|
test: {
|
|
6
10
|
globals: true,
|
|
@@ -9,7 +13,11 @@ export default defineConfig({
|
|
|
9
13
|
},
|
|
10
14
|
resolve: {
|
|
11
15
|
alias: {
|
|
12
|
-
|
|
16
|
+
// In workspace dev mode, use local sunpeak source
|
|
17
|
+
...(isTemplate && {
|
|
18
|
+
'sunpeak': parentSrc,
|
|
19
|
+
'~': parentSrc,
|
|
20
|
+
}),
|
|
13
21
|
},
|
|
14
22
|
},
|
|
15
23
|
});
|