@n8n/create-node 0.3.0 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +290 -6
  2. package/package.json +2 -2
package/README.md CHANGED
@@ -1,13 +1,297 @@
1
1
  # @n8n/create-node
2
2
 
3
- Scaffold a new community n8n node
3
+ A powerful scaffolding tool to quickly create custom n8n community nodes with best practices built-in.
4
4
 
5
- ## Usage
5
+ ## 🚀 Quick Start
6
+
7
+ Create a new n8n node in seconds:
6
8
 
7
9
  ```bash
8
- npm create @n8n/node
9
- # or
10
10
  pnpm create @n8n/node
11
- # or
12
- yarn create @n8n/node
13
11
  ```
12
+
13
+ Follow the interactive prompts to configure your node, or specify options directly:
14
+
15
+ ```bash
16
+ pnpm create @n8n/node my-awesome-node --template declarative/custom
17
+ ```
18
+
19
+ ## 📋 Command Line Options
20
+
21
+ ```bash
22
+ pnpm create @n8n/node [NAME] [OPTIONS]
23
+ ```
24
+
25
+ ### Options
26
+
27
+ | Flag | Description |
28
+ |------|-------------|
29
+ | `-f, --force` | Overwrite destination folder if it already exists |
30
+ | `--skip-install` | Skip automatic dependency installation |
31
+ | `--template <template>` | Specify which template to use |
32
+
33
+ ### Available Templates
34
+
35
+ - **`declarative/custom`** - Start with a minimal declarative node structure
36
+ - **`declarative/github-issues`** - GitHub Issues integration example
37
+ - **`programmatic/example`** - Full programmatic node with advanced features
38
+
39
+ ## 🎯 Interactive Setup
40
+
41
+ The CLI will guide you through setting up your node:
42
+
43
+ ```
44
+ $ pnpm create @n8n/node
45
+ ┌ @n8n/create-node
46
+
47
+ ◇ What is your node called?
48
+ │ my-awesome-api-node
49
+
50
+ ◇ What kind of node are you building?
51
+ │ HTTP API
52
+
53
+ ◇ What template do you want to use?
54
+ │ Start from scratch
55
+
56
+ ◇ What's the base URL of the API?
57
+ │ https://api.example.com/v1
58
+
59
+ ◇ What type of authentication does your API use?
60
+ │ API Key
61
+
62
+ ◇ Files copied ✓
63
+
64
+ ◇ Dependencies installed ✓
65
+
66
+ ◇ Next Steps ─────────────────────────────────────────────────────────────────────╮
67
+ │ │
68
+ │ cd ./my-awesome-api-node && pnpm run dev │
69
+ │ │
70
+ │ 📚 Documentation: https://docs.n8n.io/integrations/creating-nodes/ │
71
+ │ 💬 Community: https://community.n8n.io │
72
+ │ │
73
+ ├──────────────────────────────────────────────────────────────────────────────────╯
74
+
75
+ └ Created ./my-awesome-api-node ✨
76
+ ```
77
+
78
+ ## 🛠️ Development Workflow
79
+
80
+ ### 1. Navigate to your project
81
+
82
+ ```bash
83
+ cd ./my-awesome-api-node
84
+ ```
85
+
86
+ ### 2. Start development server
87
+
88
+ ```bash
89
+ pnpm dev
90
+ ```
91
+
92
+ This command:
93
+ - Starts n8n in development mode on `http://localhost:5678`
94
+ - Enables hot reload for your node changes
95
+ - Automatically includes your node in the n8n instance
96
+ - Links your node to `~/.n8n-node-cli/.n8n/custom` for development
97
+ - Watches for file changes and rebuilds automatically
98
+
99
+ ### 3. Test your node
100
+
101
+ - Open n8n at `http://localhost:5678`
102
+ - Create a new workflow
103
+ - Find your node in the node panel
104
+ - Test parameters and functionality in real-time
105
+
106
+ ## 📦 Generated Project Commands
107
+
108
+ Your generated project comes with these convenient npm scripts:
109
+
110
+ ### Development
111
+ ```bash
112
+ pnpm dev
113
+ # Runs: n8n-node dev
114
+ ```
115
+
116
+ ### Building
117
+ ```bash
118
+ pnpm build
119
+ # Runs: n8n-node build
120
+ ```
121
+
122
+ ### Linting
123
+ ```bash
124
+ pnpm lint
125
+ # Runs: n8n-node lint
126
+
127
+ pnpm lint:fix
128
+ # Runs: n8n-node lint --fix
129
+ ```
130
+
131
+ ### Publishing
132
+ ```bash
133
+ pnpm run release
134
+ # Runs: n8n-node release
135
+ ```
136
+
137
+ ## 📦 Build & Deploy
138
+
139
+ ### Build for production
140
+
141
+ ```bash
142
+ pnpm build
143
+ ```
144
+
145
+ Generates:
146
+ - Compiled TypeScript code
147
+ - Bundled node package
148
+ - Optimized assets and icons
149
+ - Ready-to-publish package
150
+
151
+ ### Quality checks
152
+
153
+ ```bash
154
+ pnpm lint
155
+ ```
156
+
157
+ Validates:
158
+ - Code style and formatting
159
+ - n8n node conventions
160
+ - Common integration issues
161
+ - Cloud publication readiness
162
+
163
+ Fix issues automatically:
164
+
165
+ ```bash
166
+ pnpm lint:fix
167
+ ```
168
+
169
+ ### Publish your node
170
+
171
+ ```bash
172
+ pnpm run release
173
+ ```
174
+
175
+ Runs [release-it](https://github.com/release-it/release-it) to handle the complete release process:
176
+ - Ensures working directory is clean
177
+ - Verifies you're on the main git branch
178
+ - Increments your package version
179
+ - Runs build and lint checks
180
+ - Updates changelog
181
+ - Creates git tag with version bump
182
+ - Creates GitHub release with changelog
183
+ - Publishes to npm
184
+
185
+ ## 📁 Project Structure
186
+
187
+ Your generated project includes:
188
+
189
+ ```
190
+ my-awesome-api-node/
191
+ ├── src/
192
+ │ ├── nodes/
193
+ │ │ └── MyAwesomeApi/
194
+ │ │ ├── MyAwesomeApi.node.ts # Main node logic
195
+ │ │ └── MyAwesomeApi.node.json # Node metadata
196
+ │ └── credentials/
197
+ │ └── MyAwesomeApiAuth.credentials.ts
198
+ ├── package.json
199
+ ├── tsconfig.json
200
+ └── README.md
201
+ ```
202
+
203
+ The CLI expects your project to follow this structure for proper building and development.
204
+
205
+ ## ⚙️ Configuration
206
+
207
+ The CLI reads configuration from your `package.json`:
208
+
209
+ ```json
210
+ {
211
+ "name": "n8n-nodes-my-awesome-node",
212
+ "n8n": {
213
+ "n8nNodesApiVersion": 1,
214
+ "nodes": [
215
+ "dist/nodes/MyAwesomeApi/MyAwesomeApi.node.js"
216
+ ],
217
+ "credentials": [
218
+ "dist/credentials/MyAwesomeApiAuth.credentials.js"
219
+ ]
220
+ }
221
+ }
222
+ ```
223
+
224
+ ## 🎨 Node Types
225
+
226
+ Choose the right template for your use case:
227
+
228
+ | Template | Best For | Features |
229
+ |----------|----------|----------|
230
+ | **Declarative** | REST APIs, simple integrations | JSON-based configuration, automatic UI generation |
231
+ | **Programmatic** | Complex logic, custom operations | Full TypeScript control, advanced error handling |
232
+
233
+ ## 🐛 Troubleshooting
234
+
235
+ ### Common Issues
236
+
237
+ **Node not appearing in n8n:**
238
+ ```bash
239
+ # Clear n8n node cli cache and restart
240
+ rm -rf ~/.n8n-node-cli/.n8n/custom
241
+ pnpm dev
242
+ ```
243
+
244
+ **TypeScript errors:**
245
+ ```bash
246
+ # Reinstall dependencies
247
+ rm -rf node_modules pnpm-lock.yaml
248
+ pnpm install
249
+ ```
250
+
251
+ **Build failures:**
252
+ ```bash
253
+ # Check for linting issues first
254
+ pnpm lint --fix
255
+ pnpm build
256
+ ```
257
+
258
+ **Development server issues:**
259
+ ```bash
260
+ # Clear cache and restart development server
261
+ rm -rf ~/.n8n-node-cli/.n8n/custom
262
+ pnpm dev
263
+ ```
264
+
265
+ ## 🔧 Advanced Usage
266
+
267
+ ### Using External n8n Instance
268
+
269
+ If you prefer to use your own n8n installation:
270
+
271
+ ```bash
272
+ pnpm dev --external-n8n
273
+ ```
274
+
275
+ ### Custom User Folder
276
+
277
+ Specify a custom location for n8n user data:
278
+
279
+ ```bash
280
+ pnpm dev --custom-user-folder /path/to/custom/folder
281
+ ```
282
+
283
+ ## 📚 Resources
284
+
285
+ - **[Node Development Guide](https://docs.n8n.io/integrations/creating-nodes/)** - Complete documentation
286
+ - **[API Reference](https://docs.n8n.io/integrations/creating-nodes/build/reference/)** - Technical specifications
287
+ - **[Community Forum](https://community.n8n.io)** - Get help and share your nodes
288
+ - **[Node Examples](https://github.com/n8n-io/n8n/tree/master/packages/nodes-base/nodes)** - Official node implementations
289
+ - **[@n8n/node-cli](https://www.npmjs.com/package/@n8n/node-cli)** - The underlying CLI tool
290
+
291
+ ## 🤝 Contributing
292
+
293
+ Found a bug or want to contribute? Check out the [n8n repository](https://github.com/n8n-io/n8n) and join our community!
294
+
295
+ ---
296
+
297
+ **Happy node building! 🎉**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@n8n/create-node",
3
- "version": "0.3.0",
3
+ "version": "0.5.0",
4
4
  "description": "Official CLI to create new community nodes for n8n",
5
5
  "bin": {
6
6
  "create-n8n-node": "bin/create.js"
@@ -16,7 +16,7 @@
16
16
  "url": "git+https://github.com/n8n-io/n8n.git"
17
17
  },
18
18
  "dependencies": {
19
- "@n8n/node-cli": "0.3.0"
19
+ "@n8n/node-cli": "0.5.0"
20
20
  },
21
21
  "license": "SEE LICENSE IN LICENSE.md",
22
22
  "homepage": "https://n8n.io",