Development and Maintenance
This section covers local development tasks for the n8n-nodes-docuwriter-ai project. Follow these steps to set up a rapid edit–build–verify cycle, enforce code quality, and prepare for publishing.
Local Development 🛠️
- Live TypeScript builds
Run the TypeScript compiler in watch mode to rebuild on every file change.pnpm run dev - Code formatting
Format all source files undernodes/andcredentials/using Prettier.pnpm run format - Linting
Enforce coding standards and detect errors with ESLint and theeslint-plugin-n8n-nodes-baseplugin.pnpm run lint - Auto-fix lint issues
Attempt to automatically fix fixable lint errors.pnpm run lintfix - Pre-publish checks
Before publishing, build the project and run the linter in one step.
Thepnpm publish # triggers `prepublishOnly`prepublishOnlyscript combines build and lint to ensure no errors slip through .
NPM Scripts Overview
| Script | Command | Purpose |
|---|---|---|
| build | tsc && npm run copy:icons |
Compile TypeScript and copy SVG icons |
| dev | tsc --watch |
Continuous build on file changes |
| format | prettier nodes credentials --write |
Format code with Prettier |
| lint | eslint "nodes/**/*.ts" "credentials/**/*.ts" |
Check code quality with ESLint |
| lintfix | eslint ... --fix |
Lint and auto-fix issues |
| prepublishOnly | npm run build && npm run lint -s |
Build and lint before publishing |
{
"scripts": {
"build": "tsc && npm run copy:icons",
"copy:icons": "copyfiles \"nodes/**/*.svg\" dist",
"dev": "tsc --watch",
"format": "prettier nodes credentials --write",
"lint": "eslint \"nodes/**/*.ts\" \"credentials/**/*.ts\"",
"lintfix": "eslint \"nodes/**/*.ts\" \"credentials/**/*.ts\" --fix",
"prepublishOnly": "npm run build && npm run lint -s"
}
}
Tooling & Configuration
-
TypeScript
Configuration viatsconfig.jsonensures:- Output to
dist/ - Strict checks enabled
- Sources under
nodes/andcredentials/
- Output to
-
ESLint
Uses core ESLint plus:@typescript-eslint/parser@typescript-eslint/eslint-plugineslint-plugin-n8n-nodes-base
defined indevDependencies.
-
Prettier
Formats code consistently; invoked via theformatscript.
Version Enforcement 🔒
To guarantee a consistent environment, the project enforces Node.js and pnpm versions:
| Engine | Required Version |
|---|---|
| node | >=18.10 |
| pnpm | >=7.18 |
{
"engines": {
"node": ">=18.10",
"pnpm": ">=7.18"
},
"packageManager": "[email protected]"
}
By following these scripts and configurations, contributors can quickly iterate on code, maintain high quality with linting and formatting, and ensure smooth, error-free releases.
Updated