Project Structure – Source and Compiled Outputs
This section outlines how the DocuWriter.ai n8n nodes are organized in source form under nodes/ and how they’re consumed by n8n from the compiled dist/ directory. It covers the main action node, the trigger node, and credential definitions.
Source Directory (nodes/)
The nodes/ folder contains the original TypeScript implementation of all n8n nodes:
-
Action Node
- File:
nodes/DocuWriter/DocuWriter.node.ts - Description: Implements the
DocuWriter.aiaction node. It defines a classDocuWriterthat handles resources such as Code Documentation, Code Tests, Code Comments, UML Diagrams, Code Optimization, Generations, and User Info, all extendingINodeType.
- File:
-
Trigger Node
- File:
nodes/DocuWriterTrigger/DocuWriterTrigger.node.ts - Description: Defines a webhook trigger
docuWriterTriggerwhich listens for generation.created events from the DocuWriter.ai API.
- File:
-
Credentials Definition
- File:
credentials/DocuWriterApi.credentials.ts - Description: Implements
DocuWriterApicredential type. It uses generic authentication via an API token header and includes a test request to/user.
- File:
Compiled Output (dist/)
n8n requires compiled JavaScript. All TS files under nodes/ and credentials/ compile to dist/:
| Location | Description |
|---|---|
dist/nodes/DocuWriter/DocuWriter.node.js |
Compiled JavaScript for the action node |
dist/nodes/DocuWriterTrigger/DocuWriterTrigger.node.js |
Compiled JavaScript for the trigger node |
dist/credentials/DocuWriterApi.credentials.js |
Compiled JavaScript for DocuWriter.ai API credentials |
index.js |
Stub for package.json main; exports empty object |
# Typical build command
pnpm run build
How n8n Loads These Files
-
Manifest Registration
n8n reads the node definitions from the compiled files underdist/nodes/.... The manifest (auto-generated during build) registers:docuWriterfromdist/nodes/DocuWriter/DocuWriter.node.jsdocuWriterTriggerfromdist/nodes/DocuWriterTrigger/DocuWriterTrigger.node.js
-
Credentials Registration
The credential typedocuWriterApiis loaded fromdist/credentials/DocuWriterApi.credentials.js. -
Execution Environment
- Requires Node.js ≥ 18.10
- Uses pnpm as the package manager for workspace management and fast builds.
{
"commands": {
"npm": "npm install",
"yarn": "yarn add",
"pnpm": "pnpm add",
"bun": "bun add"
}
}
Summary of Responsibilities
-
Source (
nodes/,credentials/)- Author and maintain business logic in TS.
- Define node properties, parameters, and execution methods.
-
Compiled (
dist/)- Provide n8n with production-ready JS.
- Keep source and runtime cleanly separated.
By following this structure, DocuWriter.ai nodes remain easy to develop, test, and deploy, while n8n seamlessly consumes the compiled artifacts at runtime.
Updated