From a8ad9e6966ed52f84d03029a07968347a4f2628e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Mon, 27 Jun 2022 11:38:41 +0200 Subject: [PATCH 01/13] :fire: Remove `.eslintignore` --- .eslintignore | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 .eslintignore diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 2bbcd4d..0000000 --- a/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -packages/editor-ui -packages/design-system From 0dbef6471106b5e796bd3ac5d6e47ec5d508a444 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Mon, 27 Jun 2022 11:43:54 +0200 Subject: [PATCH 02/13] :heavy_plus_sign: Add `prettier` --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 08f4905..f266bdd 100644 --- a/package.json +++ b/package.json @@ -45,6 +45,7 @@ "gulp": "^4.0.2", "jest": "^26.4.2", "n8n-workflow": "~0.104.0", + "prettier": "^2.7.1", "ts-jest": "^26.3.0", "tslint": "^6.1.2", "typescript": "~4.3.5" From 0d1c2a3e6892961c55316ffb2248d6c372503aeb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Mon, 27 Jun 2022 11:44:09 +0200 Subject: [PATCH 03/13] :wrench: Create Prettier config --- .prettierrc.js | 51 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 .prettierrc.js diff --git a/.prettierrc.js b/.prettierrc.js new file mode 100644 index 0000000..ebf28d8 --- /dev/null +++ b/.prettierrc.js @@ -0,0 +1,51 @@ +module.exports = { + /** + * https://prettier.io/docs/en/options.html#semicolons + */ + semi: true, + + /** + * https://prettier.io/docs/en/options.html#trailing-commas + */ + trailingComma: 'all', + + /** + * https://prettier.io/docs/en/options.html#bracket-spacing + */ + bracketSpacing: true, + + /** + * https://prettier.io/docs/en/options.html#tabs + */ + useTabs: true, + + /** + * https://prettier.io/docs/en/options.html#tab-width + */ + tabWidth: 2, + + /** + * https://prettier.io/docs/en/options.html#arrow-function-parentheses + */ + arrowParens: 'always', + + /** + * https://prettier.io/docs/en/options.html#quotes + */ + singleQuote: true, + + /** + * https://prettier.io/docs/en/options.html#quote-props + */ + quoteProps: 'as-needed', + + /** + * https://prettier.io/docs/en/options.html#end-of-line + */ + endOfLine: 'lf', + + /** + * https://prettier.io/docs/en/options.html#print-width + */ + printWidth: 100, +}; From 57751f3fe55077f7a1b4a89cef850703fe95f2e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Mon, 27 Jun 2022 11:45:26 +0200 Subject: [PATCH 04/13] :zap: Set up Prettier command --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index f266bdd..51c094b 100644 --- a/package.json +++ b/package.json @@ -19,6 +19,7 @@ "scripts": { "dev": "npm run watch", "build": "tsc && gulp", + "format": "prettier nodes credentials --write", "lint": "tslint -p tsconfig.json -c tslint.json && node_modules/eslint/bin/eslint.js ./nodes", "lintfix": "tslint --fix -p tsconfig.json -c tslint.json && node_modules/eslint/bin/eslint.js --fix ./nodes", "watch": "tsc --watch", From f2731eaa55dafaddcc89ff0d309d006cc0ce3e24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Mon, 27 Jun 2022 11:45:32 +0200 Subject: [PATCH 05/13] :art: Apply Prettier --- credentials/ExampleCredentials.credentials.ts | 6 +----- nodes/ExampleNode/ExampleNode.node.ts | 10 +--------- nodes/HttpBin/HttpBin.node.json | 5 +---- nodes/HttpBin/HttpVerbDescriptions.ts | 9 ++++----- 4 files changed, 7 insertions(+), 23 deletions(-) diff --git a/credentials/ExampleCredentials.credentials.ts b/credentials/ExampleCredentials.credentials.ts index 7e84255..2484f47 100644 --- a/credentials/ExampleCredentials.credentials.ts +++ b/credentials/ExampleCredentials.credentials.ts @@ -1,8 +1,4 @@ -import { - ICredentialType, - NodePropertyTypes, -} from 'n8n-workflow'; - +import { ICredentialType, NodePropertyTypes } from 'n8n-workflow'; export class ExampleCredentials implements ICredentialType { name = 'exampleCredentials'; diff --git a/nodes/ExampleNode/ExampleNode.node.ts b/nodes/ExampleNode/ExampleNode.node.ts index df7d60c..9d471db 100644 --- a/nodes/ExampleNode/ExampleNode.node.ts +++ b/nodes/ExampleNode/ExampleNode.node.ts @@ -1,10 +1,5 @@ import { IExecuteFunctions } from 'n8n-core'; -import { - INodeExecutionData, - INodeType, - INodeTypeDescription, -} from 'n8n-workflow'; - +import { INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow'; export class ExampleNode implements INodeType { description: INodeTypeDescription = { @@ -33,9 +28,7 @@ export class ExampleNode implements INodeType { ], }; - async execute(this: IExecuteFunctions): Promise { - const items = this.getInputData(); let item: INodeExecutionData; @@ -52,6 +45,5 @@ export class ExampleNode implements INodeType { } return this.prepareOutputData(items); - } } diff --git a/nodes/HttpBin/HttpBin.node.json b/nodes/HttpBin/HttpBin.node.json index cc9eb82..1ed6939 100644 --- a/nodes/HttpBin/HttpBin.node.json +++ b/nodes/HttpBin/HttpBin.node.json @@ -2,10 +2,7 @@ "node": "n8n-nodes-base.httpbin", "nodeVersion": "1.0", "codexVersion": "1.0", - "categories": [ - "Development", - "Developer Tools" - ], + "categories": ["Development", "Developer Tools"], "resources": { "credentialDocumentation": [ { diff --git a/nodes/HttpBin/HttpVerbDescriptions.ts b/nodes/HttpBin/HttpVerbDescriptions.ts index 265d131..80efc5b 100644 --- a/nodes/HttpBin/HttpVerbDescriptions.ts +++ b/nodes/HttpBin/HttpVerbDescriptions.ts @@ -64,7 +64,7 @@ const getOperation: INodeProperties[] = [ { name: 'arguments', default: {}, - description: 'The request\'s query parameters', + description: "The request's query parameters", displayName: 'Query Parameters', displayOptions: { show: { @@ -115,8 +115,7 @@ const deleteOperation: INodeProperties[] = [ { name: 'typeofData', default: 'queryParameter', - description: - 'Select type of data to send [Query Parameter Arguments, JSON-Body]', + description: 'Select type of data to send [Query Parameter Arguments, JSON-Body]', displayName: 'Type of Data', displayOptions: { show: { @@ -140,7 +139,7 @@ const deleteOperation: INodeProperties[] = [ { name: 'arguments', default: {}, - description: 'The request\'s query parameters', + description: "The request's query parameters", displayName: 'Query Parameters', displayOptions: { show: { @@ -187,7 +186,7 @@ const deleteOperation: INodeProperties[] = [ { name: 'arguments', default: {}, - description: 'The request\'s JSON properties', + description: "The request's JSON properties", displayName: 'JSON Object', displayOptions: { show: { From 2b2ddca3be2dd94931ceca71cdf8f60f6399e1ea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Mon, 27 Jun 2022 11:52:17 +0200 Subject: [PATCH 06/13] :hammer: Update gulp --- gulpfile.js | 12 +++++------- package.json | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 546bb43..dfed723 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,11 +1,9 @@ -const { src, dest } = require('gulp'); +const { task, src, dest } = require('gulp'); + +task('build:icons', copyIcons); function copyIcons() { - src('nodes/**/*.{png,svg}') - .pipe(dest('dist/nodes')) + src('nodes/**/*.{png,svg}').pipe(dest('dist/nodes')); - return src('credentials/**/*.{png,svg}') - .pipe(dest('dist/credentials')); + return src('credentials/**/*.{png,svg}').pipe(dest('dist/credentials')); } - -exports.default = copyIcons; \ No newline at end of file diff --git a/package.json b/package.json index 51c094b..25b2dcb 100644 --- a/package.json +++ b/package.json @@ -18,7 +18,7 @@ "main": "index.js", "scripts": { "dev": "npm run watch", - "build": "tsc && gulp", + "build": "tsc && gulp build:icons", "format": "prettier nodes credentials --write", "lint": "tslint -p tsconfig.json -c tslint.json && node_modules/eslint/bin/eslint.js ./nodes", "lintfix": "tslint --fix -p tsconfig.json -c tslint.json && node_modules/eslint/bin/eslint.js --fix ./nodes", From acbdb934dfac3e55f6a44a66b54bcc21c897a165 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Mon, 27 Jun 2022 11:54:29 +0200 Subject: [PATCH 07/13] :heavy_minus_sign: Remove `jest` and `ts-jest` --- package.json | 2 -- tsconfig.json | 1 - 2 files changed, 3 deletions(-) diff --git a/package.json b/package.json index 25b2dcb..8458378 100644 --- a/package.json +++ b/package.json @@ -44,10 +44,8 @@ "@typescript-eslint/parser": "^5.29.0", "eslint-plugin-n8n-nodes-base": "^1.0.43", "gulp": "^4.0.2", - "jest": "^26.4.2", "n8n-workflow": "~0.104.0", "prettier": "^2.7.1", - "ts-jest": "^26.3.0", "tslint": "^6.1.2", "typescript": "~4.3.5" }, diff --git a/tsconfig.json b/tsconfig.json index fc72671..9f0cfb1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,7 +6,6 @@ ], "types": [ "node", - "jest" ], "module": "commonjs", "noImplicitAny": true, From ba1d004a74d3645eb37f7bd1d10e010c14b3b202 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Mon, 27 Jun 2022 11:56:49 +0200 Subject: [PATCH 08/13] :heavy_minus_sign: Remove `glob-parent` --- package.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/package.json b/package.json index 8458378..ca4c4c2 100644 --- a/package.json +++ b/package.json @@ -51,8 +51,5 @@ }, "dependencies": { "n8n-core": "~0.122.1" - }, - "overrides": { - "glob-parent": "5.1.2" } } From b31979b96bec927905f62d907ecf5bc00b751d10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Mon, 27 Jun 2022 11:57:05 +0200 Subject: [PATCH 09/13] :fire: Remove `test` script --- package.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/package.json b/package.json index ca4c4c2..394b756 100644 --- a/package.json +++ b/package.json @@ -22,8 +22,7 @@ "format": "prettier nodes credentials --write", "lint": "tslint -p tsconfig.json -c tslint.json && node_modules/eslint/bin/eslint.js ./nodes", "lintfix": "tslint --fix -p tsconfig.json -c tslint.json && node_modules/eslint/bin/eslint.js --fix ./nodes", - "watch": "tsc --watch", - "test": "jest" + "watch": "tsc --watch" }, "files": [ "dist" From 7786edd7d2d4ed476c274c5a4ebb6017d8ffc328 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Mon, 27 Jun 2022 11:57:31 +0200 Subject: [PATCH 10/13] :fire: Remove duplicate script --- package.json | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 394b756..2c3bf4b 100644 --- a/package.json +++ b/package.json @@ -17,12 +17,11 @@ }, "main": "index.js", "scripts": { - "dev": "npm run watch", "build": "tsc && gulp build:icons", + "dev": "tsc --watch", "format": "prettier nodes credentials --write", "lint": "tslint -p tsconfig.json -c tslint.json && node_modules/eslint/bin/eslint.js ./nodes", - "lintfix": "tslint --fix -p tsconfig.json -c tslint.json && node_modules/eslint/bin/eslint.js --fix ./nodes", - "watch": "tsc --watch" + "lintfix": "tslint --fix -p tsconfig.json -c tslint.json && node_modules/eslint/bin/eslint.js --fix ./nodes" }, "files": [ "dist" From 05d78d6c92d6afb6d3de7716fbdb467d548aeeb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Mon, 27 Jun 2022 12:22:08 +0200 Subject: [PATCH 11/13] :pencil2: Add TODO comment --- gulpfile.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gulpfile.js b/gulpfile.js index dfed723..5cab748 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -7,3 +7,5 @@ function copyIcons() { return src('credentials/**/*.{png,svg}').pipe(dest('dist/credentials')); } + +// TODO: Add i18n to pipeline From adb6f6a1d8a517938e408883edfd00c7e211869c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Mon, 27 Jun 2022 12:26:57 +0200 Subject: [PATCH 12/13] :arrow_up: Upgrade TypeScript version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 2c3bf4b..f7fe4ac 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "n8n-workflow": "~0.104.0", "prettier": "^2.7.1", "tslint": "^6.1.2", - "typescript": "~4.3.5" + "typescript": "~4.6.0" }, "dependencies": { "n8n-core": "~0.122.1" From 1d8cefe221e8cf2ec9af09eb6dc3b02d9ff9f6f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Iv=C3=A1n=20Ovejero?= Date: Mon, 27 Jun 2022 12:27:11 +0200 Subject: [PATCH 13/13] :wrench: Update `tsconfig.json` --- tsconfig.json | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 9f0cfb1..f143b59 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,7 +2,7 @@ "compilerOptions": { "lib": [ "es2017", - "es2019.array" + "es2019" ], "types": [ "node", @@ -18,16 +18,12 @@ "outDir": "./dist/", "target": "es2019", "sourceMap": true, - "esModuleInterop": true + "esModuleInterop": true, + "useUnknownInCatchVariables": false, }, "include": [ "credentials/**/*", - "src/**/*", "nodes/**/*", "nodes/**/*.json", - "test/**/*" ], - "exclude": [ - "**/*.spec.ts" - ] }