sunpeak 0.1.25 → 0.2.2

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 (44) hide show
  1. package/README.md +9 -76
  2. package/bin/sunpeak.js +87 -0
  3. package/dist/index.cjs +827 -1361
  4. package/dist/index.cjs.map +1 -1
  5. package/dist/index.d.cts +98 -589
  6. package/dist/index.d.ts +98 -589
  7. package/dist/index.js +795 -1337
  8. package/dist/index.js.map +1 -1
  9. package/dist/styles/chatgpt/index.css +146 -0
  10. package/dist/styles/globals.css +220 -0
  11. package/package.json +34 -36
  12. package/template/.prettierignore +4 -0
  13. package/template/.prettierrc +9 -0
  14. package/template/README.md +47 -0
  15. package/template/assets/favicon.ico +0 -0
  16. package/template/components.json +21 -0
  17. package/template/dev/main.tsx +65 -0
  18. package/template/dev/styles.css +5 -0
  19. package/template/eslint.config.cjs +49 -0
  20. package/template/index.html +13 -0
  21. package/template/package.json +56 -0
  22. package/template/src/App.tsx +45 -0
  23. package/template/src/components/index.ts +2 -0
  24. package/template/src/components/shadcn/button.tsx +60 -0
  25. package/template/src/components/shadcn/card.tsx +76 -0
  26. package/template/src/components/shadcn/carousel.tsx +260 -0
  27. package/template/src/components/shadcn/index.ts +5 -0
  28. package/template/src/components/shadcn/label.tsx +24 -0
  29. package/template/src/components/shadcn/select.tsx +157 -0
  30. package/template/src/components/sunpeak-card.test.tsx +76 -0
  31. package/template/src/components/sunpeak-card.tsx +140 -0
  32. package/template/src/components/sunpeak-carousel.test.tsx +42 -0
  33. package/template/src/components/sunpeak-carousel.tsx +126 -0
  34. package/template/src/index.ts +3 -0
  35. package/template/src/lib/index.ts +1 -0
  36. package/template/src/lib/utils.ts +6 -0
  37. package/template/src/styles/chatgpt.css +146 -0
  38. package/template/src/styles/globals.css +220 -0
  39. package/template/src/test/setup.ts +37 -0
  40. package/template/tsconfig.json +32 -0
  41. package/template/tsconfig.node.json +11 -0
  42. package/template/tsup.config.ts +23 -0
  43. package/template/vite.config.ts +35 -0
  44. package/template/vitest.config.ts +15 -0
@@ -0,0 +1,37 @@
1
+ import '@testing-library/jest-dom/vitest';
2
+
3
+ Object.defineProperty(window, 'matchMedia', {
4
+ writable: true,
5
+ value: (query: string) => ({
6
+ matches: false,
7
+ media: query,
8
+ onchange: null,
9
+ addListener: () => {},
10
+ removeListener: () => {},
11
+ addEventListener: () => {},
12
+ removeEventListener: () => {},
13
+ dispatchEvent: () => false,
14
+ }),
15
+ });
16
+
17
+ class MockIntersectionObserver {
18
+ observe = () => {};
19
+ unobserve = () => {};
20
+ disconnect = () => {};
21
+ }
22
+
23
+ Object.defineProperty(window, 'IntersectionObserver', {
24
+ writable: true,
25
+ value: MockIntersectionObserver,
26
+ });
27
+
28
+ class MockResizeObserver {
29
+ observe = () => {};
30
+ unobserve = () => {};
31
+ disconnect = () => {};
32
+ }
33
+
34
+ Object.defineProperty(window, 'ResizeObserver', {
35
+ writable: true,
36
+ value: MockResizeObserver,
37
+ });
@@ -0,0 +1,32 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2020",
4
+ "useDefineForClassFields": true,
5
+ "lib": ["ES2020", "DOM", "DOM.Iterable"],
6
+ "module": "ESNext",
7
+ "skipLibCheck": true,
8
+
9
+ "moduleResolution": "bundler",
10
+ "allowImportingTsExtensions": true,
11
+ "resolveJsonModule": true,
12
+ "isolatedModules": true,
13
+ "noEmit": true,
14
+ "jsx": "react-jsx",
15
+
16
+ "strict": true,
17
+ "noUnusedLocals": true,
18
+ "noUnusedParameters": true,
19
+ "noFallthroughCasesInSwitch": true,
20
+
21
+ "declaration": true,
22
+ "declarationMap": true,
23
+ "sourceMap": true,
24
+
25
+ "baseUrl": ".",
26
+ "paths": {
27
+ "@/*": ["./src/*"]
28
+ }
29
+ },
30
+ "include": ["src", "dev"],
31
+ "references": [{ "path": "./tsconfig.node.json" }]
32
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "compilerOptions": {
3
+ "composite": true,
4
+ "skipLibCheck": true,
5
+ "module": "ESNext",
6
+ "moduleResolution": "bundler",
7
+ "allowSyntheticDefaultImports": true,
8
+ "strict": true
9
+ },
10
+ "include": ["vite.config.ts", "tsup.config.ts"]
11
+ }
@@ -0,0 +1,23 @@
1
+ import { defineConfig } from 'tsup';
2
+
3
+ export default defineConfig({
4
+ entry: {
5
+ 'chatgpt/index': 'src/App.tsx',
6
+ },
7
+ format: ['esm'],
8
+ dts: false,
9
+ sourcemap: false,
10
+ clean: true,
11
+ external: [],
12
+ treeshake: true,
13
+ splitting: false,
14
+ minify: true,
15
+ outDir: 'dist',
16
+ injectStyle: true,
17
+ esbuildOptions(options) {
18
+ options.bundle = true;
19
+ options.platform = 'browser';
20
+ options.target = 'es2020';
21
+ options.jsx = 'automatic';
22
+ },
23
+ });
@@ -0,0 +1,35 @@
1
+ import { defineConfig } from 'vite';
2
+ import react from '@vitejs/plugin-react';
3
+ import tailwindcss from '@tailwindcss/vite';
4
+ import path from 'path';
5
+ import fs from 'fs';
6
+
7
+ // Check if we're in the sunpeak workspace
8
+ const parentPkgPath = path.resolve(__dirname, '../package.json');
9
+ 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
+
19
+ export default defineConfig({
20
+ plugins: [react(), tailwindcss()],
21
+ resolve: {
22
+ alias: {
23
+ '@': path.resolve(__dirname, './src'),
24
+ // In workspace dev mode, use local sunpeak source
25
+ ...(isSunpeakWorkspace && {
26
+ 'sunpeak': parentSrc,
27
+ '~': parentSrc,
28
+ }),
29
+ },
30
+ },
31
+ server: {
32
+ port: 6767,
33
+ open: true,
34
+ },
35
+ });
@@ -0,0 +1,15 @@
1
+ import { defineConfig } from 'vitest/config';
2
+ import path from 'path';
3
+
4
+ export default defineConfig({
5
+ test: {
6
+ globals: true,
7
+ environment: 'jsdom',
8
+ setupFiles: './src/test/setup.ts',
9
+ },
10
+ resolve: {
11
+ alias: {
12
+ '@': path.resolve(__dirname, './src'),
13
+ },
14
+ },
15
+ });