Skip to content

Commit 4bfdf9f

Browse files
authored
docs: improve clarity of example code marking in starter template (#101)
- Added prominent header comments to example files marking them for removal - Added subtle markers to template infrastructure files - Updated GETTING_STARTED.md with clear distinction info box - Added note to README.md about example code Closes #97
1 parent 4f7c7ee commit 4bfdf9f

File tree

11 files changed

+90
-2
lines changed

11 files changed

+90
-2
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'agentic-node-ts-starter': patch
3+
---
4+
5+
docs: Improve clarity of example code marking in starter template
6+
7+
- Added prominent header comments to all example files (src/index.ts, tests/\*.spec.ts) marking them as "EXAMPLE CODE - REPLACE WITH YOUR IMPLEMENTATION"
8+
- Added subtle header comments to template infrastructure files marking them as production-ready and customizable
9+
- Updated GETTING_STARTED.md with an info box clearly distinguishing between example code to remove and template infrastructure to keep
10+
- Added note to README.md explaining that the template includes marked example code
11+
- All files now have clear visual indicators helping developers quickly identify what to keep vs. what to replace
12+
13+
This change addresses issue #97 by making it immediately apparent which files are examples versus production-ready template code, reducing confusion for new users adopting the starter template.

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
A **batteries-included** TypeScript starter template with comprehensive testing, code quality automation, and security scanning. Built for modern Node.js development with an agentic coding workflow.
44

5+
> **Note:** This template includes example code to demonstrate its capabilities. These example files are clearly marked with header comments and should be removed when starting your project. See [Getting Started](./docs/GETTING_STARTED.md#clean-up-example-code) for details.
6+
57
## 🛠️ Tech Stack
68

79
**Core:** Node.js 22+ • TypeScript 5.9 (strict) • pnpm 10.15

docs/GETTING_STARTED.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,25 @@ Edit `package.json`:
8585

8686
### 4. Clean Up Example Code
8787

88+
> [!IMPORTANT]
89+
> **Understanding Template Files**
90+
>
91+
> This template includes two types of files:
92+
>
93+
> - **📝 Example Code**: Demonstration files that should be removed or replaced:
94+
> - `src/index.ts` - Example add function with validation demos
95+
> - `tests/index.spec.ts` - Example unit tests
96+
> - `tests/add.property.spec.ts` - Example property-based tests
97+
> - **🏗️ Template Infrastructure**: Production-ready code that you can keep and customize:
98+
> - `src/logger.ts` - Structured logging with Pino
99+
> - `src/dev/debug-utils.ts` - Development debugging utilities
100+
> - `tests/logger.spec.ts` - Logger tests
101+
> - `tests/container-scan.spec.ts` - Container security tests
102+
> - `tests/documentation.spec.ts` - Documentation validation tests
103+
> - All configuration files (TypeScript, ESLint, Prettier, etc.)
104+
>
105+
> Look for header comments in files to identify their purpose.
106+
88107
Remove the example files and create your own:
89108

90109
```bash

src/dev/debug-utils.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/**
2-
* Development and debugging utilities
3-
* Only available in development mode
2+
* Development and debugging utilities - Template infrastructure.
3+
* This file provides helpful debugging tools and can be kept and customized.
4+
* Only available in development mode.
45
*/
56

67
/* eslint-disable no-console, @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-return */

src/index.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/**
2+
* ============================================================================
3+
* EXAMPLE CODE - REPLACE WITH YOUR IMPLEMENTATION
4+
* ============================================================================
5+
* This file contains example code demonstrating the template's capabilities.
6+
* It should be removed or replaced with your actual application code.
7+
*
8+
* See docs/GETTING_STARTED.md#clean-up-example-code for cleanup instructions.
9+
* ============================================================================
10+
*/
11+
112
import { createChildLogger } from './logger.js';
213

314
const logger = createChildLogger('index');

src/logger.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Production-ready logger configuration using Pino.
3+
* This file is part of the template infrastructure and can be kept and customized.
4+
*/
5+
16
import pino, { type Logger as PinoLogger, type LoggerOptions } from 'pino';
27

38
/**

tests/add.property.spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/**
2+
* ============================================================================
3+
* EXAMPLE TEST - REMOVE OR REPLACE THIS FILE
4+
* ============================================================================
5+
* This test file demonstrates property-based testing patterns for example code.
6+
* It should be removed or replaced with tests for your actual application.
7+
*
8+
* See docs/GETTING_STARTED.md#clean-up-example-code for cleanup instructions.
9+
* ============================================================================
10+
*/
11+
112
import { describe, it } from 'vitest';
213
import fc from 'fast-check';
314
import { add } from '../src/index.js';

tests/container-scan.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Tests for container security scanning - Template infrastructure.
3+
* These tests verify container scanning setup and can be kept/customized.
4+
*/
5+
16
import { describe, it, expect, beforeAll, afterAll } from 'vitest';
27
import { execFileSync } from 'child_process';
38
import {

tests/documentation.spec.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
/**
2+
* Tests for documentation - Template infrastructure.
3+
* These tests verify documentation quality and can be kept/customized.
4+
*/
5+
16
import { describe, it, expect } from 'vitest';
27
import { readFileSync, existsSync } from 'fs';
38
import { join } from 'path';

tests/index.spec.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
/**
2+
* ============================================================================
3+
* EXAMPLE TEST - REMOVE OR REPLACE THIS FILE
4+
* ============================================================================
5+
* This test file demonstrates testing patterns for the example code.
6+
* It should be removed or replaced with tests for your actual application.
7+
*
8+
* See docs/GETTING_STARTED.md#clean-up-example-code for cleanup instructions.
9+
* ============================================================================
10+
*/
11+
112
import { describe, it, expect } from 'vitest';
213
import { add } from '../src/index.js';
314

0 commit comments

Comments
 (0)