From 9d4183364aae1c81758adb1b48bcfd13aaf600c4 Mon Sep 17 00:00:00 2001 From: lublak <44057030+lublak@users.noreply.github.com> Date: Mon, 17 Jan 2022 18:21:18 +0100 Subject: [PATCH 1/8] :bug: Fix package (#6) * sync with n8n * Update package.json remove format --- gulpfile.js | 9 ++++++--- package.json | 19 +++++++++++-------- tsconfig.json | 7 +++++-- tslint.json | 23 ++++++++++++++++++++++- 4 files changed, 44 insertions(+), 14 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 9771a40..546bb43 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,8 +1,11 @@ const { src, dest } = require('gulp'); function copyIcons() { - return src('nodes/**/*.png') - .pipe(dest('dist/nodes')); + src('nodes/**/*.{png,svg}') + .pipe(dest('dist/nodes')) + + return src('credentials/**/*.{png,svg}') + .pipe(dest('dist/credentials')); } -exports.default = copyIcons; +exports.default = copyIcons; \ No newline at end of file diff --git a/package.json b/package.json index 0f9422b..2b0acb3 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,9 @@ "scripts": { "dev": "npm run watch", "build": "tsc && gulp", - "tslint": "tslint -p tsconfig.json -c tslint.json", + "lint": "tslint -p tsconfig.json -c tslint.json", + "lintfix": "tslint --fix -p tsconfig.json -c tslint.json", + "nodelinter": "nodelinter", "watch": "tsc --watch", "test": "jest" }, @@ -35,16 +37,17 @@ "@types/express": "^4.17.6", "@types/jest": "^24.0.18", "@types/node": "^10.10.1", - "@types/request-promise-native": "^1.0.17", + "@types/request-promise-native": "~1.0.15", "gulp": "^4.0.0", - "jest": "^24.9.0", - "n8n-workflow": "^0.11.0", - "ts-jest": "^24.0.2", - "tslint": "^5.17.0", - "typescript": "~3.5.2" + "jest": "^26.4.2", + "n8n-workflow": "~0.75.0", + "nodelinter": "^0.1.9", + "ts-jest": "^26.3.0", + "tslint": "^6.1.2", + "typescript": "~4.3.5" }, "dependencies": { - "n8n-core": "^0.10.0" + "n8n-core": "~0.92.0" }, "jest": { "transform": { diff --git a/tsconfig.json b/tsconfig.json index 5740965..6456490 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,7 +1,8 @@ { "compilerOptions": { "lib": [ - "es2017" + "es2017", + "es2019.array" ], "types": [ "node", @@ -13,6 +14,7 @@ "strictNullChecks": true, "strict": true, "preserveConstEnums": true, + "resolveJsonModule": true, "declaration": true, "outDir": "./dist/", "target": "es2017", @@ -22,9 +24,10 @@ "credentials/**/*", "src/**/*", "nodes/**/*", + "nodes/**/*.json", "test/**/*" ], "exclude": [ "**/*.spec.ts" ] -} +} \ No newline at end of file diff --git a/tslint.json b/tslint.json index 7eb9d01..859893d 100644 --- a/tslint.json +++ b/tslint.json @@ -46,6 +46,7 @@ "forin": true, "jsdoc-format": true, "label-position": true, + "indent": [true, "tabs", 2], "member-access": [ true, "no-public" @@ -60,6 +61,10 @@ "no-default-export": true, "no-duplicate-variable": true, "no-inferrable-types": true, + "ordered-imports": [true, { + "import-sources-order": "any", + "named-imports-order": "case-insensitive" + }], "no-namespace": [ true, "allow-declarations" @@ -82,11 +87,27 @@ "ignore-bound-class-methods" ], "switch-default": true, + "trailing-comma": [ + true, + { + "multiline": { + "objects": "always", + "arrays": "always", + "functions": "always", + "typeLiterals": "ignore" + }, + "esSpecCompliant": true + } + ], "triple-equals": [ true, "allow-null-check" ], "use-isnan": true, + "quotemark": [ + true, + "single" + ], "quotes": [ "error", "single" @@ -100,4 +121,4 @@ ] }, "rulesDirectory": [] -} +} \ No newline at end of file From 61dca83eb030b39ed59c109d46e50cf710090093 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Mon, 17 Jan 2022 18:29:15 +0100 Subject: [PATCH 2/8] :shirt: Fix lint issue --- nodes/ExampleNode/ExampleNode.node.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nodes/ExampleNode/ExampleNode.node.ts b/nodes/ExampleNode/ExampleNode.node.ts index dfad49e..df7d60c 100644 --- a/nodes/ExampleNode/ExampleNode.node.ts +++ b/nodes/ExampleNode/ExampleNode.node.ts @@ -29,8 +29,8 @@ export class ExampleNode implements INodeType { default: '', placeholder: 'Placeholder value', description: 'The description text', - } - ] + }, + ], }; From 2c50ddee049c36ce91b73f1a04e2dbad78b440a5 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Mon, 17 Jan 2022 18:29:30 +0100 Subject: [PATCH 3/8] :zap: Add .editorconfig file --- .editorconfig | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..fdda219 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,17 @@ +root = true + +[*] +charset = utf-8 +indent_style = tab +indent_size = 2 +end_of_line = lf +insert_final_newline = true +trim_trailing_whitespace = true + +[package.json] +indent_style = space +indent_size = 2 + +[*.yml] +indent_style = space +indent_size = 2 From cfade8a9b3fd0ca920140f1c5df7992c1d029576 Mon Sep 17 00:00:00 2001 From: Jan Oberhauser Date: Mon, 17 Jan 2022 18:35:40 +0100 Subject: [PATCH 4/8] :arrow_up: Update dependencies --- package.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 2b0acb3..5fe4f72 100644 --- a/package.json +++ b/package.json @@ -35,19 +35,19 @@ }, "devDependencies": { "@types/express": "^4.17.6", - "@types/jest": "^24.0.18", - "@types/node": "^10.10.1", + "@types/jest": "^26.0.13", + "@types/node": "^14.17.27", "@types/request-promise-native": "~1.0.15", "gulp": "^4.0.0", "jest": "^26.4.2", - "n8n-workflow": "~0.75.0", + "n8n-workflow": "~0.83.0", "nodelinter": "^0.1.9", "ts-jest": "^26.3.0", "tslint": "^6.1.2", "typescript": "~4.3.5" }, "dependencies": { - "n8n-core": "~0.92.0" + "n8n-core": "~0.101.0" }, "jest": { "transform": { From b9fa372d940643c5079d5c165bb0eee19aa98bf5 Mon Sep 17 00:00:00 2001 From: Deborah Barnard Date: Mon, 13 Jun 2022 16:46:20 +0100 Subject: [PATCH 5/8] quick update --- README.md | 15 +++++++++++++-- package.json | 3 ++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6148a6d..fae77bc 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,20 @@ # n8n-nodes-starter -![n8n.io - Workflow Automation](https://raw.githubusercontent.com/n8n-io/n8n/master/docs/images/n8n-logo.png) +This repo contains example nodes to help you get starting building your own custom integrations for n8n. -Example starter module for custom n8n nodes. +## Using this starter +1. Clone the repo: + ``` + git clone https://github.com/n8n-io/n8n-nodes-starter.git + ``` +2. Open the project in your editor. +3. Browse the examples in `/nodes`. Modify the examples, or replace them with your own nodes. +4. Update the `package.json` to match your details. + +## More information + +Refer to our [documentation on creating nodes](https://docs.n8n.io/integrations/creating-nodes/) for detailed information on building your own nodes. ## License diff --git a/package.json b/package.json index 5fe4f72..baea4d0 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,8 @@ { - "name": "n8n-nodes-starter", + "name": "n8n-node-starter", "version": "0.1.0", "description": "Example starter module for custom n8n nodes.", + "keywords": ["n8n-community-node-package"], "license": "SEE LICENSE IN LICENSE.md", "homepage": "https://n8n.io", "author": { From c20c6995eaa698f52f3743980b811a18104beb61 Mon Sep 17 00:00:00 2001 From: Deborah Barnard Date: Mon, 13 Jun 2022 16:50:13 +0100 Subject: [PATCH 6/8] add a bit more detail to readme --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index fae77bc..83e0f39 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,8 @@ This repo contains example nodes to help you get starting building your own custom integrations for n8n. +All nodes are npm packages. To make your custom node available to the community, you must create it as an npm package, and [submit it to the npm registry](https://docs.npmjs.com/packages-and-modules/contributing-packages-to-the-registry). + ## Using this starter 1. Clone the repo: From 543a14e89fdae04efbbc11a118fa9727ce373560 Mon Sep 17 00:00:00 2001 From: Deborah Date: Mon, 13 Jun 2022 16:58:34 +0100 Subject: [PATCH 7/8] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 83e0f39..c987f9e 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # n8n-nodes-starter -This repo contains example nodes to help you get starting building your own custom integrations for n8n. +This repo contains example nodes to help you get started building your own custom integrations for n8n. All nodes are npm packages. To make your custom node available to the community, you must create it as an npm package, and [submit it to the npm registry](https://docs.npmjs.com/packages-and-modules/contributing-packages-to-the-registry). From 22a68517e23d722134eba71a8789e4fbae7ed21d Mon Sep 17 00:00:00 2001 From: Deborah Date: Tue, 14 Jun 2022 11:37:28 +0100 Subject: [PATCH 8/8] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index baea4d0..4c83043 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "n8n-node-starter", + "name": "n8n-nodes-starter", "version": "0.1.0", "description": "Example starter module for custom n8n nodes.", "keywords": ["n8n-community-node-package"],