This commit is contained in:
Oscar 2023-08-15 11:25:34 +02:00 committed by GitHub
commit 08c1a141e5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 1413 additions and 10437 deletions

1
.env Normal file
View file

@ -0,0 +1 @@
GENERIC_TIMEZONE=UTC

View file

@ -31,7 +31,7 @@ These are the basic steps for working with the starter. For detailed guidance on
3. Run `npm i` to install dependencies. 3. Run `npm i` to install dependencies.
4. Open the project in your editor. 4. Open the project in your editor.
5. Browse the examples in `/nodes` and `/credentials`. Modify the examples, or replace them with your own nodes. 5. Browse the examples in `/nodes` and `/credentials`. Modify the examples, or replace them with your own nodes.
6. Update the `package.json` to match your details. 6. Update the `package.json` to match your details. Also update the `run.sh` with your package (In `package.json` => "name") name.
7. Run `npm run lint` to check for errors or `npm run lintfix` to automatically fix errors when possible. 7. Run `npm run lint` to check for errors or `npm run lintfix` to automatically fix errors when possible.
8. Test your node locally. Refer to [Run your node locally](https://docs.n8n.io/integrations/creating-nodes/test/run-node-locally/) for guidance. 8. Test your node locally. Refer to [Run your node locally](https://docs.n8n.io/integrations/creating-nodes/test/run-node-locally/) for guidance.
9. Replace this README with documentation for your node. Use the [README_TEMPLATE](README_TEMPLATE.md) to get started. 9. Replace this README with documentation for your node. Use the [README_TEMPLATE](README_TEMPLATE.md) to get started.

20
docker-compose.yml Normal file
View file

@ -0,0 +1,20 @@
version: "3"
services:
n8n:
image: n8n-custom-nodes
restart: unless-stopped
build:
dockerfile: ./docker/Dockerfile
context: .
ports:
- "5678:5678"
environment:
- GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
- N8N_LOG_LEVEL=debug
volumes:
- n8n-data:/home/node/.n8n
volumes:
n8n-data:
name: n8n-data

21
docker/Dockerfile Normal file
View file

@ -0,0 +1,21 @@
FROM docker.n8n.io/n8nio/n8n:latest AS target
FROM node:18-alpine AS build
RUN npm i npm@latest -g
WORKDIR /build
COPY . .
RUN npm run build
FROM target as final
WORKDIR /custom-nodes
COPY --from=build /build .
COPY --from=build /build/docker/run.sh /run.sh
WORKDIR /custom-nodes
USER root
RUN npm link
USER node
ENTRYPOINT [ "tini", "--", "/run.sh" ]

5
docker/run.sh Normal file
View file

@ -0,0 +1,5 @@
#!/bin/sh
mkdir -p ~/.n8n/nodes/
cd ~/.n8n/nodes/
npm link n8n-nodes-<...>
/docker-entrypoint.sh

View file

@ -1,16 +0,0 @@
const path = require('path');
const { task, src, dest } = require('gulp');
task('build:icons', copyIcons);
function copyIcons() {
const nodeSource = path.resolve('nodes', '**', '*.{png,svg}');
const nodeDestination = path.resolve('dist', 'nodes');
src(nodeSource).pipe(dest(nodeDestination));
const credSource = path.resolve('credentials', '**', '*.{png,svg}');
const credDestination = path.resolve('dist', 'credentials');
return src(credSource).pipe(dest(credDestination));
}

11766
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -17,7 +17,9 @@
}, },
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {
"build": "tsc && gulp build:icons", "build": "npm run clean && tsc && npm run build:images",
"clean": "rimraf dist/",
"build:images": "copyfiles nodes/**/*.svg nodes/**/*.png dist/",
"dev": "tsc --watch", "dev": "tsc --watch",
"format": "prettier nodes credentials --write", "format": "prettier nodes credentials --write",
"lint": "eslint nodes credentials package.json", "lint": "eslint nodes credentials package.json",
@ -39,14 +41,15 @@
] ]
}, },
"devDependencies": { "devDependencies": {
"@types/express": "^4.17.6", "@types/express": "^4.17.17",
"@types/request-promise-native": "~1.0.15", "@types/request-promise-native": "~1.0.15",
"@typescript-eslint/parser": "~5.45", "@typescript-eslint/parser": "~6.3.0",
"eslint-plugin-n8n-nodes-base": "^1.11.0", "copyfiles": "^2.4.1",
"gulp": "^4.0.2", "eslint-plugin-n8n-nodes-base": "^1.16.0",
"n8n-core": "*", "n8n-core": "^1.2.0",
"n8n-workflow": "*", "n8n-workflow": "*",
"prettier": "^2.7.1", "prettier": "^3.0.1",
"typescript": "~4.8.4" "rimraf": "^5.0.1",
"typescript": "~5.1.6"
} }
} }