Skip to content

Commit 137e284

Browse files
FEAT: DVR-328 | passport event handling feature (#2617)
1 parent 3c561a9 commit 137e284

25 files changed

+389
-138
lines changed

examples/README.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -329,11 +329,11 @@ pnpm test
329329

330330
# Generating example apps using cursor
331331

332-
1) Open the product folder under /examples/{product}
332+
1) Open the product folder under /examples/{product}/_prompts
333333

334-
2) Under the {product} directory, open the prompt-part2.txt file.
334+
2) Under the {product}/_prompts directory, open the example-app-2-add-feature.txt file.
335335

336-
3) Copy all of the content in the prompt-part2.txt file.
336+
3) Copy all of the content in the example-app-2-add-feature.txt file.
337337

338338
4) Paste it on to Cursor. Make sure that you're using Agent mode and the model to be used is Claude 3.7 (Thinking)
339339

@@ -347,15 +347,15 @@ the <feature name> has the manually-edited field value as true in the feature.js
347347

348348
7) If the flag above exists, it will ask for a confirmation, otherwise, it will use best practices to update the existing feature page.
349349

350-
8) Once the feature page is completed, under the same directory as prompt-part2.txt, open prompt-part3.txt and copy all of its contents.
350+
8) Once the feature page is completed, under the same directory as example-app-2-add-feature.txt, open example-app-3-fix-ui.txt and copy all of its contents.
351351

352352
9) Paste it on to a new Cursor window and in the chat window you can type:
353353

354354
feature name: <name of the feature>
355355

356356
Here, cursor will check and fix pages with styling issues to ensure that it looks consistent with other example apps.
357357

358-
10) Once the styling changes have been made, under the same directory as prompt-part2.txt, open prompt-part4.txt and copy all of its contents.
358+
10) Once the styling changes have been made, under the same directory as example-app-2-add-feature.txt, open example-app-4-testing.txt and copy all of its contents.
359359

360360
11) Paste it on to a new Cursor window and in the chat window you can type:
361361
app name: <app name(if exists)>
@@ -369,7 +369,7 @@ feature name: <name of the feature>
369369

370370
## If an App Doesn't Exist Yet
371371

372-
You must create the app first by going to the prompt-part1.txt file and paste it on to Cursor's chat window and use Agent Mode + Claude 3.7 Sonnet Thinking.
372+
You must create the app first by going to the example-app-1-create-app-template.txt file and paste it on to Cursor's chat window and use Agent Mode + Claude 3.7 Sonnet Thinking.
373373

374374
In the chat window, type in:
375375
feature name: <name>
@@ -383,35 +383,35 @@ IMPORTANT: For any prompts, if cursor is not done with its operations but it has
383383

384384
The example generation process uses three different prompt files, each with a specific purpose:
385385

386-
### prompt-part1.txt
386+
### example-app-1-create-app-template.txt
387387
- **Purpose**: Creates the initial app structure and boilerplate
388388
- **When to use**: Only when you need to create a completely new example app
389389
- **What it does**: Sets up the project structure, configuration files, basic components, and placeholder pages
390390
- **Output**: A functioning but minimal app with no implemented features
391391

392-
### prompt-part2.txt
392+
### example-app-2-add-feature.txt
393393
- **Purpose**: Implements or updates a specific feature within an existing app
394-
- **When to use**: After creating an app with prompt-part1.txt, or when adding/updating features
394+
- **When to use**: After creating an app with example-app-1-create-app-template.txt, or when adding/updating features
395395
- **What it does**: Creates or modifies the feature implementation with proper error handling, UI states, and best practices
396396
- **Output**: A fully implemented feature page within the app structure
397397

398-
### prompt-part3.txt
398+
### example-app-3-fix-ui.txt
399399
- **Purpose**: Apply styling changes to the given example app if possible to ensure styling consistency with other example apps
400-
- **When to use**: After running prompt-part2.txt to implement a feature
400+
- **When to use**: After running example-app-2-add-feature.txt to implement a feature
401401
- **What it does**: Modifies the example app's UI/UX to ensure that the app looks consistent with other example apps
402402
- **Output**: A fully implemented feature page within the app structure with consistent UI/UX looks.
403403

404-
### prompt-part4.txt
404+
### example-app-4-testing.txt
405405
- **Purpose**: Tests, validates, and fixes issues in the implementation
406-
- **When to use**: After running prompt-part2.txt to implement a feature
406+
- **When to use**: After running example-app-2-add-feature.txt to implement a feature
407407
- **What it does**: Runs tests, checks coverage, builds the app, and fixes any detected issues
408408
- **Output**: A tested, validated feature ready for use
409409

410410
**Typical Workflow:**
411-
1. Use prompt-part1.txt to create a new app (only once per app)
412-
1. Use prompt-part2.txt to implement each feature in the app
413-
1. Use prompt-part3.txt to fix the app's UI/UX styling and make it look consistent to other example apps.
414-
1. Use prompt-part4.txt after each feature implementation to test and validate
411+
1. Use example-app-1-create-app-template.txt to create a new app (only once per app)
412+
1. Use example-app-2-add-feature.txt to implement each feature in the app
413+
1. Use example-app-3-fix-ui.txt to fix the app's UI/UX styling and make it look consistent to other example apps.
414+
1. Use example-app-4-testing.txt after each feature implementation to test and validate
415415
1. Once you've generated the example app or feature, you should manually review the implementation and the UI. It's likely you will need to make some manual adjustments to get the app to function and look like our other example apps because the cursor can not reliably get it 100% correct.
416416
1. Once you're happy with your example app or feature, you need to [re-run the tutorial generation prompt](#generating-tutorials-and-metadata-with-cursor) for your example app before creating your PR so the new example app or feature is piped into the docs site with it's corresponding tutorial.
417417

@@ -507,7 +507,7 @@ If this happens you will need to log into the Netlify site, check the error and
507507

508508
# Generating tutorials and metadata with cursor
509509

510-
Whenever you add a new example app, or update an existing example app, you can use the prompts in the `prompt.txt` files in each `examples/product` folder to generate the tutorials and metadata for the example apps using Cursor AI.
510+
Whenever you add a new example app, or update an existing example app, you can use the prompts in the `tutorial-generation-prompt.txt` files in each `examples/product/_prompts` folder to generate the tutorials and metadata for the example apps using Cursor AI.
511511

512512
These AI generated tutorials and metadata files are then piped through to the docs site in the CI/CD pipeline, where they are used to display the example apps and their code walkthroughs. If you don't follow these steps, your example app will not be displayed on the docs site.
513513

@@ -520,7 +520,7 @@ Follow these steps to generate the tutorials and metadata for the example apps:
520520
1. Delete the existing tutorial.md and metadata.json files in the example app you are wanting to generate the tutorials and metadata for.
521521
2. Open the Composer window in Cursor IDE (Claude 3.7-sonnet-thinking).
522522
3. Press the `+` button clear the context of the composer window.
523-
4. Open the `prompt.txt` file in the examples/product folder you are wanting to generate the tutorials and metadata for e.g. `examples/passport/prompt.txt`.
523+
4. Open the `tutorial-generation-prompt.txt` file in the examples/product/_prompts folder you are wanting to generate the tutorials and metadata for e.g. `examples/passport/_prompts/tutorial-generation-prompt.txt`.
524524
5. Copy and pate the prompt into the composer window, or attach it as a file.
525525
6. After adding the prompt, in the composer window, type `app name: <name of the example app>` e.g. `app name: login-with-nextjs` where the app name is the folder name of the example app in the examples/product folder you are wanting to generate the tutorials and metadata for.
526526
7. Press enter and let the AI generate the tutorials and metadata.

0 commit comments

Comments
 (0)