[WCTAS-2] Initialize npm/TypeScript project
Add package.json with build/start/dev/test scripts, tsconfig.json with strict mode and CommonJS target, .gitignore, and CLAUDE.md documenting the new project structure and commands. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
0333c7ae0f
commit
f4acc259b3
11
.gitignore
vendored
Normal file
11
.gitignore
vendored
Normal file
@ -0,0 +1,11 @@
|
||||
node_modules/
|
||||
dist/
|
||||
.env
|
||||
.env.local
|
||||
*.log
|
||||
npm-debug.log*
|
||||
.DS_Store
|
||||
.vscode/
|
||||
.idea/
|
||||
*.js.map
|
||||
coverage/
|
||||
51
CLAUDE.md
Normal file
51
CLAUDE.md
Normal file
@ -0,0 +1,51 @@
|
||||
# word-counter-api
|
||||
|
||||
## Project Status
|
||||
|
||||
Node.js/TypeScript project initialized with npm and tsconfig. Source code implementation is pending.
|
||||
|
||||
## Build Commands
|
||||
|
||||
```bash
|
||||
npm install # install dependencies
|
||||
npm run build # compile TypeScript → dist/ via tsc
|
||||
```
|
||||
|
||||
## Test Commands
|
||||
|
||||
```bash
|
||||
npm test # run full Jest test suite
|
||||
npm test -- path/to/file.test.ts # run a single test file
|
||||
npm test -- -t "test name" # run a single named test
|
||||
```
|
||||
|
||||
## Development Commands
|
||||
|
||||
```bash
|
||||
npm run dev # tsx watch src/server.ts (TypeScript watch mode)
|
||||
npm start # node dist/server.js (production build)
|
||||
```
|
||||
|
||||
## Project Structure
|
||||
|
||||
```
|
||||
word-counter-api/
|
||||
├── src/ # TypeScript source files (to be added)
|
||||
│ └── server.ts # Entry point
|
||||
├── dist/ # Compiled JavaScript output (gitignored)
|
||||
├── package.json # npm manifest with build/start/dev/test scripts
|
||||
├── tsconfig.json # TypeScript config (CommonJS, strict mode)
|
||||
├── .gitignore
|
||||
├── README.md
|
||||
└── CLAUDE.md # This file
|
||||
```
|
||||
|
||||
## Architecture Notes
|
||||
|
||||
- **Purpose**: An API service for counting words in text input.
|
||||
- **Stack**: Node.js + TypeScript (CommonJS modules, `tsc` build, `tsx` for dev watch).
|
||||
- Key design decisions still to make: HTTP framework, authentication strategy, request/response format (REST vs. GraphQL), deployment target.
|
||||
|
||||
## Code Style
|
||||
|
||||
TypeScript strict mode is enabled (`"strict": true` in tsconfig.json). No linter or formatter configured yet. Document here once a stack is chosen (e.g., ESLint/Prettier).
|
||||
20
package.json
Normal file
20
package.json
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
"name": "word-counter-api",
|
||||
"version": "1.0.0",
|
||||
"description": "HTTP API that counts words in text input",
|
||||
"main": "dist/server.js",
|
||||
"scripts": {
|
||||
"build": "tsc",
|
||||
"start": "node dist/server.js",
|
||||
"dev": "tsx watch src/server.ts",
|
||||
"test": "jest"
|
||||
},
|
||||
"keywords": [],
|
||||
"author": "",
|
||||
"license": "ISC",
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.0.0",
|
||||
"tsx": "^4.0.0",
|
||||
"typescript": "^5.0.0"
|
||||
}
|
||||
}
|
||||
18
tsconfig.json
Normal file
18
tsconfig.json
Normal file
@ -0,0 +1,18 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2020",
|
||||
"module": "CommonJS",
|
||||
"moduleResolution": "node",
|
||||
"outDir": "dist",
|
||||
"rootDir": "src",
|
||||
"strict": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"sourceMap": true
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user