|
1 | 1 | # Extension Development
|
2 | 2 |
|
3 |
| -## File Structure (recommended) |
4 |
| - |
5 |
| -``` |
6 |
| -extension-name/ |
7 |
| -├── .storybook/ # Storybook configuration |
8 |
| -├── assets/ # Raw assets (images, videos) |
9 |
| -├── public/ # Static files served as-is |
10 |
| -├── src/ |
11 |
| -│ ├── stories/ # Storybook stories for components |
12 |
| -│ │ ├── <widget-name-1>-1x1-1.stories.tsx |
13 |
| -│ │ ├── <widget-name-1>-1x1-2.stories.tsx |
14 |
| -│ │ ├── <widget-name-2>-2x2.stories.tsx |
15 |
| -│ │ └── <widget-name-2>-full.stories.tsx |
16 |
| -│ ├── widgets/ # Widget implementations |
17 |
| -│ │ ├── components/ # Shared components |
18 |
| -│ │ │ └── <shared-component>.tsx |
19 |
| -│ │ └── <widget-name-1>/ # Example widget 1 implementation |
20 |
| -│ │ │ ├── 1x1-1.tsx # First 1x1 layout widget |
21 |
| -│ │ │ ├── 1x1-2.tsx # Second 1x1 layout widget |
22 |
| -│ │ │ └── index.tsx # Widget group |
23 |
| -│ │ └── <widget-name-2>/ |
24 |
| -│ │ ├── 2x2.tsx |
25 |
| -│ │ ├── full.tsx |
26 |
| -│ │ └── index.tsx |
27 |
| -│ ├── globals.css # Global styles |
28 |
| -│ ├── index.tsx # Extension entry point and initialization |
29 |
| -│ ├── types.ts # Type definitions |
30 |
| -│ └── utils.ts # Utility functions |
31 |
| -├── config.json # Extension configuration |
32 |
| -├── package.json # Dependencies and scripts |
33 |
| -├── tailwind.config.ts # Tailwind CSS configuration |
34 |
| -└── tsconfig.json # TypeScript configuration |
35 |
| -``` |
36 |
| - |
37 |
| -### Key Directories and Files |
38 |
| - |
39 |
| -- **src/stories/**: Contains Storybook stories for testing widgets in isolation |
40 |
| -- **src/widgets/**: Main widget implementations |
41 |
| - - **components/**: Reusable components shared across widgets |
42 |
| - - **\<widget-name\>/**: Specific widget implementation (e.g., live, replay) |
43 |
| -- **src/types.ts**: TypeScript type definitions and interfaces |
44 |
| -- **src/utils.ts**: Shared utility functions |
45 |
| -- **config.json**: Extension metadata and configuration |
46 |
| - |
47 | 3 | ## Interface
|
48 | 4 |
|
49 | 5 | All extension must **default-export** [Extension](https://github.com/fastrepl/hyprnote/blob/main/extensions/types.ts) interface.
|
|
0 commit comments