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 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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sunpeak",
3
- "version": "0.3.4",
3
+ "version": "0.3.6",
4
4
  "description": "The ChatGPT Apps UI SDK. Build and test your ChatGPT App UI locally with OpenAI apps-sdk-ui components.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -1,7 +1,7 @@
1
1
  import { StrictMode } from 'react';
2
2
  import { createRoot } from 'react-dom/client';
3
3
  import { ChatGPTSimulator } from 'sunpeak';
4
- import { App } from '@/App';
4
+ import { App } from '../src/App';
5
5
 
6
6
  const toolOutput = {
7
7
  places: [
@@ -1,4 +1,5 @@
1
- import '@/styles/globals.css';
1
+ import './styles/globals.css';
2
+ import 'sunpeak/style.css';
2
3
 
3
4
  import { useWidgetProps } from 'sunpeak';
4
5
  import { OpenAICarousel, OpenAICard } from './components';
@@ -1,6 +1,6 @@
1
1
  import * as React from "react"
2
2
  import { Button } from "@openai/apps-sdk-ui/components/Button"
3
- import { cn } from "@/lib/index"
3
+ import { cn } from "../lib/index"
4
4
 
5
5
  export interface OpenAIButtonProps {
6
6
  isPrimary?: boolean
@@ -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 "@/lib/index"
7
+ import { cn } from "../lib/index"
8
8
 
9
9
  export interface OpenAICarouselState extends Record<string, unknown> {
10
10
  currentIndex?: number
@@ -22,10 +22,7 @@
22
22
  "declarationMap": true,
23
23
  "sourceMap": true,
24
24
 
25
- "baseUrl": ".",
26
- "paths": {
27
- "@/*": ["./src/*"]
28
- }
25
+ "baseUrl": "."
29
26
  },
30
27
  "include": ["src", "dev"],
31
28
  "references": [{ "path": "./tsconfig.node.json" }]
@@ -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
- '@': path.resolve(__dirname, './src'),
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
  },
@@ -11,7 +11,6 @@ export default defineConfig({
11
11
  plugins: [react(), tailwindcss()],
12
12
  resolve: {
13
13
  alias: {
14
- '@': path.resolve(__dirname, './src'),
15
14
  // In workspace dev mode, use local sunpeak source
16
15
  ...(isTemplate && {
17
16
  'sunpeak': parentSrc,
@@ -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
- '@': path.resolve(__dirname, './src'),
16
+ // In workspace dev mode, use local sunpeak source
17
+ ...(isTemplate && {
18
+ 'sunpeak': parentSrc,
19
+ '~': parentSrc,
20
+ }),
13
21
  },
14
22
  },
15
23
  });