Skip to content

Commit 3b704c9

Browse files
docs(readme): add badges and social links
1 parent 6aec466 commit 3b704c9

File tree

13 files changed

+634
-164
lines changed

13 files changed

+634
-164
lines changed

README.md

Lines changed: 116 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,150 @@
1-
# Turborepo starter
1+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
2+
[![GitHub stars](https://img.shields.io/github/stars/withseismic/cursor-tools?style=social)](https://github.com/withseismic/cursor-tools/stargazers)
3+
[![TypeScript](https://img.shields.io/badge/TypeScript-5.0-blue.svg)](https://www.typescriptlang.org/)
4+
[![Electron](https://img.shields.io/badge/Electron-28.0-blue.svg)](https://www.electronjs.org/)
5+
[![React](https://img.shields.io/badge/React-18.0-blue.svg)](https://reactjs.org/)
6+
[![Discord](https://img.shields.io/badge/Discord-Join%20Chat-7289da.svg)](https://discord.gg/cursor)
27

3-
This Turborepo starter is maintained by the Turborepo core team.
8+
[🔗 Reddit Discussion](https://www.reddit.com/r/cursor/comments/1i77m4d/notepads_manager_for_cursor/) | [💬 Discord Community](https://discord.gg/BX25FcS53N)
49

5-
## Using this example
10+
# Cursor Tools
611

7-
Run the following command:
12+
A powerful desktop application for managing and enhancing your Cursor IDE notepads, built with Electron, React, and TypeScript. (Ish. It's a proof of concept that shows you how to hook into Cursor's workspace / global settings and do some cool stuff.)
813

9-
```sh
10-
npx create-turbo@latest
11-
```
14+
![Cursor Tools](cursor-tools.png)
1215

13-
## What's inside?
16+
## Overview
1417

15-
This Turborepo includes the following packages/apps:
18+
Cursor Tools provides a robust suite of utilities for managing your Cursor IDE notepads, allowing you to backup, sync, and organize your development notes across workspaces. Built with modern technologies and best practices, it offers a seamless integration with your Cursor IDE workflow.
1619

17-
### Apps and Packages
20+
### Key Features
1821

19-
- `docs`: a [Next.js](https://nextjs.org/) app
20-
- `web`: another [Next.js](https://nextjs.org/) app
21-
- `@repo/ui`: a stub React component library shared by both `web` and `docs` applications
22-
- `@repo/eslint-config`: `eslint` configurations (includes `eslint-config-next` and `eslint-config-prettier`)
23-
- `@repo/typescript-config`: `tsconfig.json`s used throughout the monorepo
22+
#### 1. Notepad Management
2423

25-
Each package/app is 100% [TypeScript](https://www.typescriptlang.org/).
24+
- **Create & Edit**: Create new notepads with rich content and edit existing ones
25+
- **Organization**: Group related notepads and manage them efficiently
26+
- **Search & Filter**: Quickly find notepads across all workspaces
27+
- **Backup & Sync**: Automatically backup your Cursor notepads across workspaces
28+
- **Import/Export**: Share notepads between workspaces or with team members
2629

27-
### Utilities
30+
#### 2. Smart Templates
2831

29-
This Turborepo has some additional tools already setup for you:
32+
Pre-built notepad templates for common development workflows:
3033

31-
- [TypeScript](https://www.typescriptlang.org/) for static type checking
32-
- [ESLint](https://eslint.org/) for code linting
33-
- [Prettier](https://prettier.io) for code formatting
34+
- Git branch and workflow best practices
35+
- Test-Driven Development (TDD) guides
36+
- AI-assisted development patterns
37+
- Documentation templates
38+
- Code review checklists
39+
- Performance optimization guides
40+
- Security best practices
41+
- Accessibility guidelines
42+
- Architecture planning templates
3443

35-
### Build
44+
#### 3. Workspace Integration
3645

37-
To build all apps and packages, run the following command:
46+
- **Multi-Workspace Support**: Manage notepads across multiple Cursor workspaces
47+
- **Workspace Migration**: Easily copy notepads between workspaces
48+
- **Context Awareness**: Notepads maintain references to relevant files and folders
49+
- **Persistent Storage**: Reliable SQLite-based storage for all your notes
3850

39-
```
40-
cd my-turborepo
41-
pnpm build
51+
#### 4. Advanced Features
52+
53+
- **Version History**: Track changes to your notepads over time
54+
- **Rich Context**: Link notepads to files, folders, and git commits
55+
- **Smart References**: Maintain connections to external resources and documentation
56+
- **Customizable Layout**: Adjust the UI layout to match your workflow
57+
58+
### Installation
59+
60+
```bash
61+
# Install dependencies
62+
pnpm install
63+
64+
# Start development
65+
pnpm dev:electron
66+
67+
# Build for your platform
68+
pnpm build:win # Windows
69+
pnpm build:mac # macOS
70+
pnpm build:linux # Linux
4271
```
4372

44-
### Develop
73+
### Project Structure
4574

46-
To develop all apps and packages, run the following command:
75+
This project uses [Turborepo](https://turbo.build/repo) and follows modern development practices:
4776

4877
```
49-
cd my-turborepo
50-
pnpm dev
78+
apps/
79+
├── electron-app/ # Main desktop application
80+
│ ├── src/
81+
│ │ ├── main/ # Electron main process
82+
│ │ ├── renderer/ # React-based UI
83+
│ │ └── preload/ # Preload scripts
84+
│ └── ...
85+
packages/
86+
├── eslint-config/ # Shared ESLint configuration
87+
└── typescript-config/ # Shared TypeScript configuration
5188
```
5289

53-
### Remote Caching
90+
### Technology Stack
5491

55-
> [!TIP]
56-
> Vercel Remote Cache is free for all plans. Get started today at [vercel.com](https://vercel.com/signup?/signup?utm_source=remote-cache-sdk&utm_campaign=free_remote_cache).
92+
- **TypeScript**: For type-safe code
93+
- **Electron**: Desktop application framework
94+
- **React**: UI components and state management
95+
- **SQLite**: Reliable data persistence
96+
- **Tailwind CSS**: Modern styling
97+
- **ESLint & Prettier**: Code quality tools
5798

58-
Turborepo can use a technique known as [Remote Caching](https://turbo.build/repo/docs/core-concepts/remote-caching) to share cache artifacts across machines, enabling you to share build caches with your team and CI/CD pipelines.
99+
### API Documentation
59100

60-
By default, Turborepo will cache locally. To enable Remote Caching you will need an account with Vercel. If you don't have an account you can [create one](https://vercel.com/signup?utm_source=turborepo-examples), then enter the following commands:
101+
#### Notepad Management
61102

62-
```
63-
cd my-turborepo
64-
npx turbo login
65-
```
103+
```typescript
104+
// Create a new notepad
105+
const notepad = await notepadManager.createNotepad({
106+
name: "My Notepad",
107+
text: "Initial content"
108+
});
66109

67-
This will authenticate the Turborepo CLI with your [Vercel account](https://vercel.com/docs/concepts/personal-accounts/overview).
110+
// Get all notepads
111+
const notepads = await notepadManager.getAll();
68112

69-
Next, you can link your Turborepo to your Remote Cache by running the following command from the root of your Turborepo:
113+
// Get a specific notepad
114+
const notepad = await notepadManager.getNotepad(id);
70115

116+
// Update notepad content
117+
await notepad.setText("Updated content");
118+
119+
// Delete a notepad
120+
await notepadManager.deleteNotepad(id);
71121
```
72-
npx turbo link
122+
123+
#### Workspace Operations
124+
125+
```typescript
126+
// Get all workspaces
127+
const workspaces = await workspaceManager.getWorkspaces();
128+
129+
// Get a specific workspace
130+
const workspace = await workspaceManager.getWorkspace(id);
131+
132+
// Access workspace storage
133+
await workspace.set("key", value);
134+
const value = await workspace.get("key");
73135
```
74136

75-
## Useful Links
137+
### Contributing
138+
139+
We welcome contributions! Please follow these steps:
140+
141+
1. Fork the repository
142+
2. Create a feature branch
143+
3. Make your changes
144+
4. Submit a pull request
145+
146+
Please ensure your code follows our style guidelines and includes appropriate tests.
76147

77-
Learn more about the power of Turborepo:
148+
### License
78149

79-
- [Tasks](https://turbo.build/repo/docs/core-concepts/monorepos/running-tasks)
80-
- [Caching](https://turbo.build/repo/docs/core-concepts/caching)
81-
- [Remote Caching](https://turbo.build/repo/docs/core-concepts/remote-caching)
82-
- [Filtering](https://turbo.build/repo/docs/core-concepts/monorepos/filtering)
83-
- [Configuration Options](https://turbo.build/repo/docs/reference/configuration)
84-
- [CLI Usage](https://turbo.build/repo/docs/reference/command-line-reference)
150+
MIT

apps/electron-app/src/main/features/notepad/notepad-manager.ts

Lines changed: 74 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { DataValidationError, NotepadError } from '../workspace/errors'
55

66
/**
77
* Structure for notepad data storage.
8+
* Defines the format for persisting notepad data in the workspace.
89
*/
910
interface NotepadData {
1011
/** Version number of the notepad data format */
@@ -15,6 +16,7 @@ interface NotepadData {
1516

1617
/**
1718
* Input parameters for creating a new notepad.
19+
* Required configuration for notepad creation.
1820
*/
1921
export interface CreateNotepadInput {
2022
/** Display name for the new notepad */
@@ -24,9 +26,11 @@ export interface CreateNotepadInput {
2426
}
2527

2628
/**
27-
* Validates notepad data structure.
29+
* Type guard to validate notepad data structure.
30+
* Ensures data loaded from storage matches expected format.
31+
*
2832
* @param {unknown} data - The data to validate
29-
* @returns {data is NotepadData} Type guard indicating if the data is valid
33+
* @returns {boolean} True if data matches NotepadData structure
3034
*/
3135
function isValidNotepadData(data: unknown): data is NotepadData {
3236
if (!data || typeof data !== 'object') return false
@@ -42,12 +46,31 @@ function isValidNotepadData(data: unknown): data is NotepadData {
4246
* Manages notepad instances within a workspace.
4347
* Handles notepad creation, retrieval, and lifecycle management.
4448
*
49+
* Key responsibilities:
50+
* - Creating new notepads with proper initialization
51+
* - Managing notepad persistence
52+
* - Retrieving existing notepads
53+
* - Handling notepad deletion
54+
* - Maintaining data consistency
55+
*
4556
* @example
4657
* ```typescript
4758
* const manager = new NotepadManager(workspace);
48-
* const notepad = await manager.createNotepad({ name: 'New Notepad' });
59+
*
60+
* // Create a new notepad
61+
* const notepad = await manager.createNotepad({
62+
* name: 'New Notepad',
63+
* text: 'Initial content'
64+
* });
65+
*
66+
* // Get all notepads
67+
* const notepads = await manager.getAll();
68+
*
69+
* // Get a specific notepad
4970
* const existingNotepad = await manager.getNotepad('notepad-id');
50-
* const allNotepads = await manager.getAll();
71+
*
72+
* // Delete a notepad
73+
* await manager.deleteNotepad('notepad-id');
5174
* ```
5275
*/
5376
export class NotepadManager {
@@ -62,6 +85,7 @@ export class NotepadManager {
6285
/**
6386
* Retrieves the current notepad data from storage.
6487
* Creates default data structure if none exists.
88+
*
6589
* @private
6690
* @returns {Promise<NotepadData>} The current notepad data
6791
* @throws {DataValidationError} If stored data is invalid
@@ -86,6 +110,7 @@ export class NotepadManager {
86110
/**
87111
* Creates a default context for new notepads.
88112
* Initializes all context fields with empty values.
113+
*
89114
* @private
90115
* @returns {NotepadContext} A new default context object
91116
*/
@@ -134,10 +159,25 @@ export class NotepadManager {
134159
/**
135160
* Creates a new notepad with the specified configuration.
136161
* Initializes the notepad with default context and a single chat tab.
162+
*
163+
* The creation process:
164+
* 1. Validates input parameters
165+
* 2. Generates unique IDs for notepad components
166+
* 3. Creates initial notepad structure
167+
* 4. Persists the notepad to storage
168+
*
137169
* @param {CreateNotepadInput} input - Configuration for the new notepad
138170
* @returns {Promise<Notepad>} The newly created notepad instance
139171
* @throws {NotepadError} If notepad creation or save fails
140172
* @throws {DataValidationError} If input validation fails
173+
*
174+
* @example
175+
* ```typescript
176+
* const notepad = await manager.createNotepad({
177+
* name: 'Project Notes',
178+
* text: 'Initial project planning'
179+
* });
180+
* ```
141181
*/
142182
async createNotepad(input: CreateNotepadInput): Promise<Notepad> {
143183
if (!input.name || input.name.trim().length === 0) {
@@ -192,10 +232,20 @@ export class NotepadManager {
192232

193233
/**
194234
* Retrieves a notepad by its ID.
235+
* Returns null if no notepad exists with the given ID.
236+
*
195237
* @param {string} id - The unique identifier of the notepad
196238
* @returns {Promise<Notepad | null>} The notepad instance if found, null otherwise
197239
* @throws {NotepadError} If notepad retrieval fails
198240
* @throws {DataValidationError} If stored notepad data is invalid
241+
*
242+
* @example
243+
* ```typescript
244+
* const notepad = await manager.getNotepad('notepad-123');
245+
* if (notepad) {
246+
* await notepad.setText('Updated content');
247+
* }
248+
* ```
199249
*/
200250
async getNotepad(id: string): Promise<Notepad | null> {
201251
if (!id || typeof id !== 'string') {
@@ -218,9 +268,19 @@ export class NotepadManager {
218268

219269
/**
220270
* Retrieves all notepads in the workspace.
271+
* Loads and validates notepad data from storage.
272+
*
221273
* @returns {Promise<Notepad[]>} Array of all notepad instances
222274
* @throws {NotepadError} If notepad retrieval fails
223275
* @throws {DataValidationError} If stored notepad data is invalid
276+
*
277+
* @example
278+
* ```typescript
279+
* const notepads = await manager.getAll();
280+
* for (const notepad of notepads) {
281+
* console.log(notepad.data.name);
282+
* }
283+
* ```
224284
*/
225285
async getAll(): Promise<Notepad[]> {
226286
try {
@@ -236,10 +296,20 @@ export class NotepadManager {
236296

237297
/**
238298
* Deletes a notepad by its ID.
299+
* Removes the notepad from storage if it exists.
300+
*
239301
* @param {string} id - The unique identifier of the notepad to delete
240302
* @returns {Promise<boolean>} True if the notepad was found and deleted, false otherwise
241303
* @throws {NotepadError} If notepad deletion fails
242304
* @throws {DataValidationError} If notepad ID is invalid
305+
*
306+
* @example
307+
* ```typescript
308+
* const wasDeleted = await manager.deleteNotepad('notepad-123');
309+
* if (wasDeleted) {
310+
* console.log('Notepad successfully deleted');
311+
* }
312+
* ```
243313
*/
244314
async deleteNotepad(id: string): Promise<boolean> {
245315
if (!id || typeof id !== 'string') {

0 commit comments

Comments
 (0)