sunpeak 0.3.5 → 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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sunpeak",
3
- "version": "0.3.5",
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,4 +1,5 @@
1
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,5 @@
1
1
  @import "tailwindcss";
2
2
  @import "@openai/apps-sdk-ui/css";
3
- @import "sunpeak/style.css";
4
3
 
5
4
  /* Required for Tailwind to find class references in Apps SDK UI components. */
6
5
  @source "../node_modules/@openai/apps-sdk-ui";
@@ -22,12 +22,7 @@
22
22
  "declarationMap": true,
23
23
  "sourceMap": true,
24
24
 
25
- "baseUrl": ".",
26
- "paths": {
27
- "sunpeak": ["../src/index.ts"],
28
- "sunpeak/*": ["../src/*"],
29
- "~/*": ["../src/*"]
30
- }
25
+ "baseUrl": "."
31
26
  },
32
27
  "include": ["src", "dev"],
33
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,8 +39,11 @@ export default defineConfig({
35
39
  },
36
40
  resolve: {
37
41
  alias: {
38
- 'sunpeak': path.resolve(__dirname, '../src'),
39
- '~': path.resolve(__dirname, '../src'),
42
+ // In workspace dev mode, use local sunpeak source
43
+ ...(isTemplate && {
44
+ 'sunpeak': parentSrc,
45
+ '~': parentSrc,
46
+ }),
40
47
  },
41
48
  conditions: ['style', 'import', 'module', 'browser', 'default'],
42
49
  },
@@ -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,8 +13,11 @@ export default defineConfig({
9
13
  },
10
14
  resolve: {
11
15
  alias: {
12
- 'sunpeak': path.resolve(__dirname, '../src'),
13
- '~': path.resolve(__dirname, '../src'),
16
+ // In workspace dev mode, use local sunpeak source
17
+ ...(isTemplate && {
18
+ 'sunpeak': parentSrc,
19
+ '~': parentSrc,
20
+ }),
14
21
  },
15
22
  },
16
23
  });