fix(nodes-base): fix and harmonize all primaryDocumentation links (#4191)

* fix(nodes-base): fix and harmonize all primaryDocumentation links

* feat(workflow, cli): expose documentation links to UI via node codex

* fix(editor-ui): link to correct node and credential documentation URLs

* config(nodes-base): update 'format' script to also format node descriptor json

* chore: fix outdated links to node reference documentation
This commit is contained in:
Mike Arvela
2022-09-29 13:33:16 +03:00
committed by GitHub
parent 23bd71b82a
commit 6e8e4f5937
390 changed files with 1384 additions and 2496 deletions

View File

@@ -113,7 +113,7 @@ You can find additional information and example workflows on the [n8n.io](https:
## Create Custom Nodes
You can create custom nodes for n8n. Follow the instructions mentioned in the documentation to create your node: [Creating nodes](https://docs.n8n.io/nodes/creating-nodes/create-node.html)
You can create custom nodes for n8n. Follow the instructions mentioned in the documentation to create your node: [Creating nodes](https://docs.n8n.io/integrations/creating-nodes/build/)
## Contributing

View File

@@ -78,6 +78,7 @@
"@types/lodash.intersection": "^4.4.7",
"@types/lodash.merge": "^4.6.6",
"@types/lodash.omit": "^4.5.7",
"@types/lodash.pick": "^4.4.7",
"@types/lodash.set": "^4.3.6",
"@types/lodash.split": "^4.4.7",
"@types/lodash.unset": "^4.5.7",
@@ -142,6 +143,7 @@
"lodash.intersection": "^4.4.0",
"lodash.merge": "^4.6.2",
"lodash.omit": "^4.5.0",
"lodash.pick": "^4.4.0",
"lodash.set": "^4.3.2",
"lodash.split": "^4.4.2",
"lodash.unset": "^4.5.2",

View File

@@ -31,6 +31,7 @@ import {
} from 'fs/promises';
import glob from 'fast-glob';
import path from 'path';
import pick from 'lodash.pick';
import { IN8nNodePackageJson } from './Interfaces';
import { getLogger } from './Logger';
import config from '../config';
@@ -428,19 +429,23 @@ class LoadNodesAndCredentialsClass {
}
/**
* Retrieves `categories`, `subcategories` and alias (if defined)
* from the codex data for the node at the given file path.
* Retrieves `categories`, `subcategories`, partial `resources` and
* alias (if defined) from the codex data for the node at the given file path.
*
* @param {string} filePath The file path to a `*.node.js` file
* @returns {CodexData}
*/
getCodex(filePath: string): CodexData {
// eslint-disable-next-line global-require, import/no-dynamic-require, @typescript-eslint/no-var-requires
const { categories, subcategories, alias } = require(`${filePath}on`); // .js to .json
const { categories, subcategories, resources: allResources, alias } = require(`${filePath}on`); // .js to .json
const resources = pick(allResources, ['primaryDocumentation', 'credentialDocumentation']);
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
return {
...(categories && { categories }),
...(subcategories && { subcategories }),
...(resources && { resources }),
...(alias && { alias }),
};
}