sunpeak 0.2.2 → 0.2.3

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/bin/sunpeak.js CHANGED
@@ -25,6 +25,11 @@ async function init(projectName) {
25
25
  }
26
26
  }
27
27
 
28
+ if (projectName === 'template') {
29
+ console.error('Error: "template" is a reserved name. Please choose another name.');
30
+ process.exit(1);
31
+ }
32
+
28
33
  const targetDir = join(process.cwd(), projectName);
29
34
 
30
35
  if (existsSync(targetDir)) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sunpeak",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
4
4
  "description": "The ChatGPT Apps UI SDK. Build and test your ChatGPT App UI locally with approved shadcn React components.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -3,3 +3,4 @@
3
3
 
4
4
  /* Scan sunpeak source for Tailwind classes (only works in workspace, ignored otherwise) */
5
5
  @source "../../src/**/*.{ts,tsx}";
6
+ @source "../node_modules/sunpeak/**/*.{ts,tsx}"
@@ -2,19 +2,10 @@ import { defineConfig } from 'vite';
2
2
  import react from '@vitejs/plugin-react';
3
3
  import tailwindcss from '@tailwindcss/vite';
4
4
  import path from 'path';
5
- import fs from 'fs';
6
5
 
7
- // Check if we're in the sunpeak workspace
8
- const parentPkgPath = path.resolve(__dirname, '../package.json');
6
+ // Check if we're in the sunpeak workspace (directory is named "template")
7
+ const isTemplate = path.basename(__dirname) === 'template';
9
8
  const parentSrc = path.resolve(__dirname, '../src');
10
- let isSunpeakWorkspace = false;
11
-
12
- if (fs.existsSync(parentPkgPath) && fs.existsSync(parentSrc)) {
13
- try {
14
- const parentPkg = JSON.parse(fs.readFileSync(parentPkgPath, 'utf-8'));
15
- isSunpeakWorkspace = parentPkg.name === 'sunpeak';
16
- } catch {}
17
- }
18
9
 
19
10
  export default defineConfig({
20
11
  plugins: [react(), tailwindcss()],
@@ -22,7 +13,7 @@ export default defineConfig({
22
13
  alias: {
23
14
  '@': path.resolve(__dirname, './src'),
24
15
  // In workspace dev mode, use local sunpeak source
25
- ...(isSunpeakWorkspace && {
16
+ ...(isTemplate && {
26
17
  'sunpeak': parentSrc,
27
18
  '~': parentSrc,
28
19
  }),