1
1
mirror of https://github.com/n8n-io/n8n.git synced 2024-08-16 08:30:26 +03:00

feat: Switch from npm to pnpm (#4429)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™ 2022-11-09 17:32:05 +01:00 committed by GitHub
parent db163b71b9
commit 736777385c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
33 changed files with 22666 additions and 72016 deletions

View File

@ -1,8 +1,12 @@
**/*.md
**/.env
.cache
assets
node_modules
packages/node-dev
packages/*/node_modules
packages/*/dist
packages/*/.turbo
packages/**/node_modules
packages/**/dist
packages/**/.turbo
.git
.github
*.tsbuildinfo

View File

@ -22,9 +22,9 @@ A clear and concise description of what you expected to happen.
**Environment (please complete the following information):**
- OS: [e.g. Ubuntu Linux 18.04]
- n8n Version [e.g. 0.119.0]
- Node.js Version [e.g. 14.16.0]
- OS: [e.g. Ubuntu Linux 22.04]
- n8n Version [e.g. 0.200.1]
- Node.js Version [e.g. 16.17.0]
- Database system [e.g. SQLite; n8n uses SQLite as default otherwise changed]
- Operation mode [e.g. own; operation modes are `own`, `main` and `queue`. Default is `own`]

View File

@ -18,25 +18,27 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2.2.4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache: 'pnpm'
- name: Install npm and dependencies
run: npm install -g npm@latest && npm install
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: npm run build --if-present
run: pnpm build
- name: Test
run:
npm run test
run: pnpm test
- name: Test E2E
run:
npm run test:e2e:ci:smoke
run: |
pnpm cypress:install
pnpm test:e2e:ci:smoke
- name: Lint
run: npm run lint
run: pnpm lint

View File

@ -18,13 +18,15 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2.2.4
- uses: actions/setup-node@v3
with:
node-version: 16.x
cache: 'npm'
cache: 'pnpm'
- name: Install npm and dependencies
run: npm install -g npm@latest && npm install
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Start MySQL & Postgres
uses: isbang/compose-action@v1.3.2
@ -32,16 +34,16 @@ jobs:
compose-file: ./.github/docker-compose.yml
- name: Build Core & Workflow
run: npm run -w packages/workflow -w packages/core build
run: pnpm --filter n8n-workflow --filter=n8n-core build
- name: Test MySQL
working-directory: packages/cli
run: npm run test:mysql
run: pnpm test:mysql
- name: Test Postgres
working-directory: packages/cli
run: npm run test:postgres
run: pnpm test:postgres
- name: Test Postgres (alternate schema)
working-directory: packages/cli
run: npm run test:postgres:alt-schema
run: pnpm test:postgres:alt-schema

View File

@ -15,24 +15,27 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: pnpm/action-setup@v2.2.4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache: 'pnpm'
- name: Install npm and dependencies
run: npm install -g npm@latest && npm install
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Build
run: npm run build --if-present
run: pnpm build
- name: Test
run: npm run test
run: pnpm test
- name: Test E2E
run:
npm run test:e2e:ci:smoke
run: |
pnpm cypress:install
pnpm test:e2e:ci:smoke
- name: Fetch base branch for `git diff`
run: git fetch origin ${{ github.event.pull_request.base.ref }}:${{ github.event.pull_request.base.ref }}
@ -40,4 +43,4 @@ jobs:
- name: Run ESLint on changes only
env:
ESLINT_PLUGIN_DIFF_COMMIT: ${{ github.event.pull_request.base.ref }}
run: npm run lint
run: pnpm lint

View File

@ -26,12 +26,14 @@ jobs:
repository: n8n-io/test-workflows
path: test-workflows
- uses: pnpm/action-setup@v2.2.4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
cache: 'npm'
cache-dependency-path: 'n8n/package-lock.json'
cache: 'pnpm'
cache-dependency-path: 'n8n/pnpm-lock.yaml'
- name: Install dependencies
run: |
@ -41,12 +43,11 @@ jobs:
DEBIAN_FRONTEND="noninteractive" sudo apt-get install -y graphicsmagick
shell: bash
- name: npm install and build
- name: pnpm install and build
working-directory: n8n
run: |
npm install -g npm@latest
npm install
npm run build --if-present
pnpm install
pnpm build
shell: bash
- name: Import credentials

4
.gitignore vendored
View File

@ -13,8 +13,8 @@ _START_PACKAGE
!.vscode/settings.default.json
.idea
nodelinter.config.json
packages/*/package-lock.json
packages/*/.turbo
**/package-lock.json
packages/**/.turbo
*.tsbuildinfo
cypress/videos/*
cypress/screenshots/*

8
.npmrc
View File

@ -1 +1,7 @@
legacy-peer-deps=true
auto-install-peers = true
strict-peer-dependencies = false
prefer-workspace-packages = true
link-workspace-packages = deep
hoist = true
shamefully-hoist = true
loglevel = warn

View File

@ -4,7 +4,7 @@
"search.exclude": {
"node_modules": true,
"dist": true,
"package-lock.json": true
"pnpm-lock.yaml": true
},
"typescript.tsdk": "node_modules/typescript/lib",
"workspace-default-settings.runOnActivation": true

View File

@ -4,15 +4,24 @@ Great that you are here and you want to contribute to n8n
## Contents
- [Code of Conduct](#code-of-conduct)
- [Directory Structure](#directory-structure)
- [Development Setup](#development-setup)
- [Development Cycle](#development-cycle)
- [Create Custom Nodes](#create-custom-nodes)
- [Create a new node to contribute to n8n](#create-a-new-node-to-contribute-to-n8n)
- [Checklist before submitting a new node](#checklist-before-submitting-a-new-node)
- [Extend Documentation](#extend-documentation)
- [Contributor License Agreement](#contributor-license-agreement)
- [Contributing to n8n](#contributing-to-n8n)
- [Contents](#contents)
- [Code of conduct](#code-of-conduct)
- [Directory structure](#directory-structure)
- [Development setup](#development-setup)
- [Requirements](#requirements)
- [Node.js](#nodejs)
- [Build tools](#build-tools)
- [pnpm workspaces](#pnpm-workspaces)
- [Actual n8n setup](#actual-n8n-setup)
- [Start](#start)
- [Development cycle](#development-cycle)
- [Test suite](#test-suite)
- [Create custom nodes](#create-custom-nodes)
- [Create a new node to contribute to n8n](#create-a-new-node-to-contribute-to-n8n)
- [Checklist before submitting a new node](#checklist-before-submitting-a-new-node)
- [Extend documentation](#extend-documentation)
- [Contributor License Agreement](#contributor-license-agreement)
## Code of conduct
@ -51,7 +60,13 @@ dependencies are installed and the packages get linked correctly. Here a short g
#### Node.js
We suggest using [Node.js](https://nodejs.org/en/) version 16 for development purposes.
We suggest using [Node.js](https://nodejs.org/en/) version 16.9 or newer for development purposes.
After that we recommend enabling [Node.js corepack](https://nodejs.org/docs/latest-v16.x/api/corepack.html) with `corepack enable`, and [pnpm](https://pnpm.io/) with `corepack prepare pnpm --activate`.
**IMPORTANT**: If you have installed Node.js via homebrew, you'll need to run `brew install corepack`, since homebrew explicitly removes `npm` and `corepack` from [the `node` formula](https://github.com/Homebrew/homebrew-core/blob/master/Formula/node.rb#L66).
**IMPORTANT**: If you are on windows, you'd need to run `corepack enable` and `corepack prepare pnpm --activate` in a terminal as an administrator.
#### Build tools
@ -72,15 +87,14 @@ yum install gcc gcc-c++ make
Windows:
```
npm install -g windows-build-tools
npm add -g windows-build-tools
```
#### npm workspaces
#### pnpm workspaces
n8n is split up in different modules which are all in a single mono repository.
To facilitate the module management, [npm workspaces](https://docs.npmjs.com/cli/v7/using-npm/workspaces) are
used. This automatically sets up file-links between modules which depend on each
other.
To facilitate the module management, [pnpm workspaces](https://pnpm.io/workspaces) are used.
This automatically sets up file-links between modules which depend on each other.
### Actual n8n setup
@ -112,12 +126,12 @@ checked out and set up:
5. Install all dependencies of all modules and link them together:
```
npm install
pnpm install
```
6. Build all the code:
```
npm run build
pnpm build
```
### Start
@ -125,7 +139,7 @@ checked out and set up:
To start n8n execute:
```
npm run start
pnpm start
```
To start n8n with tunnel:
@ -136,24 +150,24 @@ To start n8n with tunnel:
## Development cycle
While iterating on n8n modules code, you can run `npm run dev`. It will then
While iterating on n8n modules code, you can run `pnpm dev`. It will then
automatically build your code, restart the backend and refresh the frontend
(editor-ui) on every change you make.
1. Start n8n in development mode:
```
npm run dev
pnpm dev
```
1. Hack, hack, hack
1. Check if everything still runs in production mode
```
npm run build
npm run start
pnpm build
pnpm start
```
1. Create tests
1. Run all [tests](#test-suite)
```
npm run test
pnpm test
```
1. Commit code and [create a pull request](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork)
@ -162,7 +176,7 @@ automatically build your code, restart the backend and refresh the frontend
The tests can be started via:
```
npm run test
pnpm test
```
If that gets executed in one of the package folders it will only run the tests

View File

@ -3,25 +3,20 @@ ARG NODE_VERSION=16
# 1. Create an image to build n8n
FROM n8nio/base:${NODE_VERSION} as builder
RUN npm install -g run-script-os turbo@1.5.5
COPY turbo.json package.json package-lock.json tsconfig.json ./
COPY turbo.json package.json .npmrc pnpm-lock.yaml pnpm-workspace.yaml tsconfig.json ./
COPY packages ./packages
COPY patches ./patches
RUN corepack enable && corepack prepare --activate
RUN chown -R node:node .
RUN npm config set legacy-peer-deps true
USER node
RUN \
npm install && \
npm run build && \
# TODO: removing dev dependecies is deleting `bn.js`, which breaks the Snowflake node
npm prune --omit=dev && \
npm i --omit=dev bn.js && \
find . -type f -name "*.ts" -o -name "*.js.map" -o -name "*.vue" -o -name "tsconfig.json" | xargs rm &&\
rm -rf node_modules/.cache packages/*/node_modules/.cache packages/*/.turbo .config .npm /tmp/*
RUN pnpm install --frozen-lockfile
RUN pnpm build
RUN rm -rf node_modules
RUN NODE_ENV=production pnpm install --prod --no-optional
RUN find . -type f -name "*.ts" -o -name "*.js.map" -o -name "*.vue" -o -name "tsconfig.json" -o -name "*.tsbuildinfo" | xargs rm
RUN rm -rf patches .npmrc *.yaml node_modules/.cache packages/**/node_modules/.cache packages/**/.turbo .config .cache .local .node /tmp/*
# 2. Start with a new clean image with just the code that is needed to run n8n

71803
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -3,15 +3,19 @@
"version": "0.201.0",
"private": true,
"homepage": "https://n8n.io",
"engines": {
"node": ">=16.9",
"pnpm": ">=7.5"
},
"packageManager": "pnpm@7.14.2",
"scripts": {
"build": "turbo run build",
"dev": "turbo run dev --parallel",
"clean:dist": "npm exec -ws -- rimraf ./dist",
"clean": "turbo run clean --parallel",
"format": "turbo run format && node scripts/format.mjs",
"lint": "turbo run lint",
"lintfix": "turbo run lintfix",
"optimize-svg": "find ./packages -name '*.svg' ! -name 'pipedrive.svg' -print0 | xargs -0 -P16 -L20 npx svgo",
"postinstall": "patch-package",
"start": "run-script-os",
"start:default": "cd packages/cli/bin && ./n8n",
"start:tunnel": "./packages/cli/bin/n8n start --tunnel",
@ -20,39 +24,51 @@
"watch": "turbo run watch",
"webhook": "./packages/cli/bin/n8n webhook",
"worker": "./packages/cli/bin/n8n worker",
"cypress:install": "cypress install",
"test:e2e:db:clean": "rimraf ~/.n8n/cypress.sqlite ~/.n8n/cypress.sqlite.bak",
"test:e2e:cypress:run": "cypress run",
"test:e2e": "npm run test:e2e:db:clean && cross-env DB_SQLITE_DATABASE=cypress.sqlite N8N_DIAGNOSTICS_ENABLED=false start-server-and-test start http://localhost:5678/favicon.ico test:e2e:cypress:run",
"test:e2e": "pnpm test:e2e:db:clean && cross-env DB_SQLITE_DATABASE=cypress.sqlite N8N_DIAGNOSTICS_ENABLED=false start-server-and-test start http://localhost:5678/favicon.ico test:e2e:cypress:run",
"test:e2e:cypress:dev": "cypress open",
"test:e2e:dev": "npm run test:e2e:db:clean && cross-env DB_SQLITE_DATABASE=cypress.sqlite N8N_DIAGNOSTICS_ENABLED=false start-server-and-test start http://localhost:5678/favicon.ico test:e2e:cypress:dev",
"test:e2e:dev": "pnpm test:e2e:db:clean && cross-env DB_SQLITE_DATABASE=cypress.sqlite N8N_DIAGNOSTICS_ENABLED=false start-server-and-test start http://localhost:5678/favicon.ico test:e2e:cypress:dev",
"test:e2e:cypress:ci:smoke": "cypress run --headless --spec \"cypress/e2e/0-smoke.cy.ts\"",
"test:e2e:ci:smoke": "npm run test:e2e:db:clean && cross-env DB_SQLITE_DATABASE=cypress.sqlite N8N_DIAGNOSTICS_ENABLED=false start-server-and-test start http://localhost:5678/favicon.ico test:e2e:cypress:ci:smoke"
"test:e2e:ci:smoke": "pnpm test:e2e:db:clean && cross-env DB_SQLITE_DATABASE=cypress.sqlite N8N_DIAGNOSTICS_ENABLED=false start-server-and-test start http://localhost:5678/favicon.ico test:e2e:cypress:ci:smoke"
},
"dependencies": {
"n8n": "*"
},
"devDependencies": {
"@n8n_io/eslint-config": "*",
"@ngneat/falso": "^6.1.0",
"@types/jest": "^28.1.8",
"@types/node": "^16.11.22",
"cross-env": "^7.0.3",
"cypress": "^10.0.3",
"jest": "^28.1.3",
"jest-environment-jsdom": "^28.1.3",
"jest-mock": "^28.1.3",
"patch-package": "^6.4.7",
"prettier": "^2.3.2",
"rimraf": "^3.0.2",
"run-script-os": "^1.0.7",
"start-server-and-test": "^1.14.0",
"supertest": "^6.2.2",
"ts-jest": "^28.0.8",
"turbo": "1.2.15",
"ts-node": "^9.1.1",
"turbo": "1.5.5",
"typescript": "^4.8.4"
},
"postcss": {},
"workspaces": [
"packages/*",
"packages/@n8n_io/*"
],
"overrides": {
"browserslist": "^4.21.3",
"ejs": "^3.1.8",
"fork-ts-checker-webpack-plugin": "^6.0.4",
"globby": "^11.0.2"
"pnpm": {
"patchedDependencies": {
"quill@2.0.0-dev.4": "patches/quill@2.0.0-dev.4.patch"
},
"onlyBuiltDependencies": [
"sqlite3",
"vue-demi"
],
"overrides": {
"browserslist": "^4.21.4",
"ejs": "^3.1.8",
"fork-ts-checker-webpack-plugin": "^6.0.4",
"globby": "^11.1.0"
}
}
}

View File

@ -4,11 +4,7 @@
module.exports = {
plugins: ['vue'],
extends: [
'plugin:vue/essential',
'@vue/typescript',
'@n8n_io/eslint-config/base',
],
extends: ['plugin:vue/essential', '@vue/typescript', './base'],
env: {
browser: true,
@ -21,11 +17,7 @@ module.exports = {
parser: '@typescript-eslint/parser',
},
ignorePatterns: [
'**/*.js',
'**/*.d.ts',
'vite.config.ts',
],
ignorePatterns: ['**/*.js', '**/*.d.ts', 'vite.config.ts'],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',

View File

@ -2,7 +2,7 @@
* @type {import('@types/eslint').ESLint.ConfigData}
*/
module.exports = {
extends: ['@n8n_io/eslint-config/base'],
extends: ['./base'],
env: {
es6: true,

View File

@ -1,21 +1,23 @@
{
"name": "@n8n_io/eslint-config",
"private": true,
"version": "0.0.1",
"devDependencies": {
"@types/eslint": "8.4.6",
"@typescript-eslint/eslint-plugin": "^5.36.2",
"@typescript-eslint/parser": "^5.36.2",
"@vue/eslint-config-typescript": "^11.0.0",
"eslint": "8.23.0",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-diff": "^2.0.1",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-n8n-local-rules": "^1.0.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-vue": "^9.4.0"
"@types/eslint": "~8.4",
"@typescript-eslint/eslint-plugin": "~5.36",
"@typescript-eslint/parser": "~5.36",
"@vue/eslint-config-typescript": "~8.0",
"eslint": "~8.26",
"eslint-config-airbnb-typescript": "~17.0",
"eslint-config-prettier": "~8.5",
"eslint-plugin-diff": "~2.0",
"eslint-plugin-import": "~2.26",
"eslint-plugin-n8n-local-rules": "~1.0",
"eslint-plugin-prettier": "~4.2",
"eslint-plugin-vue": "~7.17"
},
"scripts": {
"clean": "rimraf .turbo",
"test": "jest"
}
}

View File

@ -2,6 +2,20 @@
This list shows all the versions which include breaking changes and how to upgrade.
## 0.202.0
### What changed?
Switched from NPM to PNPM for development.
### When is action necessary?
If you are contributing to n8n.
### How to upgrade:
Make sure that your local development setup is up to date with the latest [Contribution Guide](../../CONTRIBUTING.md).
## 0.198.0
### What changed?

View File

@ -19,10 +19,11 @@
"bin": "n8n"
},
"scripts": {
"clean": "rimraf dist .turbo",
"typecheck": "tsc",
"build": "tsc -p tsconfig.build.json && tsc-alias -p tsconfig.build.json && node scripts/build.mjs",
"dev": "concurrently -k -n \"TypeScript,Node\" -c \"yellow.bold,cyan.bold\" \"npm run watch\" \"nodemon\"",
"format": "cd ../.. && node_modules/prettier/bin-prettier.js packages/cli/**/**.ts --write",
"format": "prettier **/**.ts --write",
"lint": "eslint .",
"lintfix": "eslint . --fix",
"postpack": "rm -f oclif.manifest.json",
@ -31,10 +32,10 @@
"start:default": "cd bin && ./n8n",
"start:windows": "cd bin && n8n",
"swagger": "swagger-cli",
"test": "npm run test:sqlite",
"test": "pnpm test:sqlite",
"test:sqlite": "N8N_LOG_LEVEL=silent DB_TYPE=sqlite jest",
"test:postgres": "N8N_LOG_LEVEL=silent DB_TYPE=postgresdb jest",
"test:postgres:alt-schema": "DB_POSTGRESDB_SCHEMA=alt_schema npm run test:postgres",
"test:postgres:alt-schema": "DB_POSTGRESDB_SCHEMA=alt_schema pnpm test:postgres",
"test:mysql": "N8N_LOG_LEVEL=silent DB_TYPE=mysqldb jest",
"watch": "concurrently \"tsc -w -p tsconfig.build.json\" \"tsc-alias -w -p tsconfig.build.json\"",
"typeorm": "ts-node -T ../../node_modules/typeorm/cli.js"
@ -61,7 +62,6 @@
],
"devDependencies": {
"@apidevtools/swagger-cli": "4.0.0",
"@n8n_io/eslint-config": "",
"@oclif/dev-cli": "^1.22.2",
"@types/basic-auth": "^1.1.2",
"@types/bcryptjs": "^2.4.2",
@ -82,7 +82,6 @@
"@types/lodash.set": "^4.3.6",
"@types/lodash.split": "^4.4.7",
"@types/lodash.unset": "^4.5.7",
"@types/node": "^16.11.22",
"@types/parseurl": "^1.3.1",
"@types/passport-jwt": "^3.0.6",
"@types/psl": "^1.1.0",
@ -104,9 +103,9 @@
"typescript": "~4.8.0"
},
"dependencies": {
"@oclif/command": "^1.5.18",
"@oclif/core": "^1.9.3",
"@oclif/errors": "^1.2.2",
"@oclif/command": "^1.8.16",
"@oclif/core": "^1.16.4",
"@oclif/errors": "^1.3.6",
"@rudderstack/rudder-sdk-node": "1.0.6",
"@sentry/node": "^7.17.3",
"@sentry/integrations": "^7.17.3",
@ -166,7 +165,7 @@
"prom-client": "^13.1.0",
"psl": "^1.8.0",
"shelljs": "^0.8.5",
"sqlite3": "^5.0.2",
"sqlite3": "^5.1.2",
"sse-channel": "^3.1.1",
"swagger-ui-express": "^4.3.0",
"tslib": "1.14.1",

View File

@ -15,10 +15,11 @@
"main": "dist/index",
"types": "dist/index.d.ts",
"scripts": {
"clean": "rimraf dist .turbo",
"typecheck": "tsc",
"build": "tsc -p tsconfig.build.json",
"dev": "npm run watch",
"format": "cd ../.. && node_modules/prettier/bin-prettier.js packages/core/**/**.ts --write",
"dev": "pnpm watch",
"format": "prettier **/**.ts --write",
"lint": "eslint .",
"lintfix": "eslint . --fix",
"watch": "tsc --watch",
@ -28,17 +29,14 @@
"dist"
],
"devDependencies": {
"@n8n_io/eslint-config": "",
"@types/cron": "~1.7.1",
"@types/crypto-js": "^4.0.1",
"@types/express": "^4.17.6",
"@types/lodash.get": "^4.4.6",
"@types/mime-types": "^2.1.0",
"@types/node": "^16.11.22",
"@types/request-promise-native": "~1.0.15",
"@types/uuid": "^8.3.2",
"source-map-support": "^0.5.9",
"typescript": "~4.8.0"
"source-map-support": "^0.5.9"
},
"dependencies": {
"axios": "^0.21.1",

View File

@ -7,43 +7,43 @@ A component system for [n8n](https://n8n.io) using Storybook to preview.
## Project setup
```
npm install
pnpm install
```
### Compiles and hot-reloads for development
```
npm run storybook
pnpm storybook
```
### Build static pages
```
npm run build:storybook
pnpm build:storybook
```
### Run your unit tests
```
npm run test:unit
pnpm test:unit
```
### Lints and fixes files
```
npm run lint
pnpm lint
```
### Build css files
```
npm run build:theme
pnpm build:theme
```
### Monitor theme files and build any changes
```
npm run watch:theme
pnpm watch:theme
```
## License

View File

@ -13,6 +13,7 @@
"url": "git+https://github.com/n8n-io/n8n.git"
},
"scripts": {
"clean": "rimraf dist .turbo",
"build": "vite build",
"build:vue:typecheck": "vue-tsc --emitDeclarationOnly",
"test": "vitest run",
@ -20,6 +21,7 @@
"test:dev": "vitest",
"build:storybook": "build-storybook",
"storybook": "start-storybook -p 6006",
"format": "prettier **/**.{ts,vue} --write",
"lint": "tslint -p tsconfig.json -c tslint.json && eslint .",
"lintfix": "tslint --fix -p tsconfig.json -c tslint.json && eslint . --fix"
},
@ -33,7 +35,6 @@
"@fortawesome/fontawesome-svg-core": "^1.2.35",
"@fortawesome/free-solid-svg-icons": "^5.15.3",
"@fortawesome/vue-fontawesome": "^2.0.2",
"@n8n_io/eslint-config": "",
"@storybook/addon-actions": "^6.5.10",
"@storybook/addon-essentials": "^6.5.10",
"@storybook/addon-links": "^6.5.10",
@ -45,33 +46,29 @@
"@types/sanitize-html": "^2.6.2",
"c8": "7.11.0",
"core-js": "^3.6.5",
"eslint": "^8.0.0",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-vue": "^7.16.0",
"jsdom": "19.0.0",
"markdown-it": "^12.3.2",
"markdown-it-emoji": "^2.0.0",
"markdown-it-link-attributes": "^4.0.0",
"markdown-it-task-lists": "^2.1.1",
"node-notifier": ">=8.0.1",
"prettier": "^2.3.2",
"sass": "^1.26.5",
"sass-loader": "^8.0.2",
"sass": "^1.55.0",
"sass-loader": "^10.1.1",
"storybook-addon-designs": "^6.3.1",
"storybook-addon-themes": "^6.1.0",
"trim": ">=0.0.3",
"typescript": "~4.8.0",
"vite": "2.9.5",
"vite": "^2.9.5",
"@vitejs/plugin-vue2": "^1.1.2",
"vitest": "0.9.3",
"vue": "~2.7.10",
"vitest": "^0.9.3",
"vue": "^2.7",
"vue-class-component": "^7.2.3",
"vue-loader": "^15.9.7",
"vue-property-decorator": "^9.1.2",
"vue-template-compiler": "~2.7.10",
"vue-tsc": "0.34.8",
"vue-template-compiler": "^2.7",
"vue-tsc": "^0.34.8",
"vue-typed-mixins": "^0.2.0",
"vue2-boring-avatars": "0.3.4",
"webpack": "^4.46.0",
"xss": "^1.0.10"
},
"dependencies": {

View File

@ -10,37 +10,37 @@ npm install n8n -g
## Project setup
```
npm install
pnpm install
```
### Compiles and hot-reloads for development
```
npm run serve
pnpm serve
```
### Compiles and minifies for production
```
npm run build
pnpm build
```
### Run your tests
```
npm run test
pnpm test
```
### Lints and fixes files
```
npm run lint
pnpm lint
```
### Run your end-to-end tests
```
npm run test:e2e
pnpm test:e2e
```
### Run your unit tests
```
npm run test:unit
pnpm test:unit
```
### Customize configuration

View File

@ -14,11 +14,12 @@
"url": "git+https://github.com/n8n-io/n8n.git"
},
"scripts": {
"clean": "rimraf dist .turbo",
"build": "cross-env VUE_APP_PUBLIC_PATH=\"/{{BASE_PATH}}/\" NODE_OPTIONS=\"--max-old-space-size=8192\" vite build",
"dev": "npm run serve",
"dev": "pnpm serve",
"lint": "tslint -p tsconfig.json -c tslint.json && eslint .",
"lintfix": "tslint --fix -p tsconfig.json -c tslint.json && eslint . --fix",
"format": "cd ../.. && node_modules/prettier/bin-prettier.js packages/editor-ui/**/**.ts --write",
"format": "prettier **/**.{ts,vue} --write",
"serve": "cross-env VUE_APP_URL_BASE_API=http://localhost:5678/ vite --host 0.0.0.0 --port 8080 dev",
"test": "vitest run",
"test:ci": "vitest run --coverage",
@ -52,8 +53,8 @@
"lodash.get": "^4.4.2",
"lodash.orderby": "^4.6.0",
"lodash.set": "^4.3.2",
"luxon": "~2.3.0",
"monaco-editor": "^0.30.1",
"luxon": "^2.3.0",
"monaco-editor": "^0.33.0",
"n8n-design-system": "~0.41.0",
"n8n-workflow": "~0.123.0",
"normalize-wheel": "^1.0.1",
@ -64,14 +65,14 @@
"timeago.js": "^4.0.2",
"uuid": "^8.3.2",
"v-click-outside": "^3.1.2",
"vue": "~2.7.10",
"vue": "^2.7",
"vue-agile": "^2.0.0",
"vue-fragment": "1.5.1",
"vue-i18n": "^8.26.7",
"vue-json-pretty": "1.9.3",
"vue-prism-editor": "^0.3.0",
"vue-router": "^3.0.6",
"vue-template-compiler": "~2.7.10",
"vue-template-compiler": "^2.7",
"vue-typed-mixins": "^0.2.0",
"vue2-boring-avatars": "0.3.4",
"vue2-teleport": "^1.0.1",
@ -80,7 +81,6 @@
},
"devDependencies": {
"@intlify/vue-i18n-loader": "^1.1.0",
"@n8n_io/eslint-config": "",
"@pinia/testing": "^0.0.14",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/vue": "^5.8.3",
@ -92,23 +92,17 @@
"@types/lodash.get": "^4.4.6",
"@types/lodash.set": "^4.3.6",
"@types/luxon": "^2.0.9",
"@types/node": "^16.11.22",
"@types/quill": "^2.0.1",
"@types/uuid": "^8.3.2",
"@vitejs/plugin-legacy": "^1.8.2",
"@vitejs/plugin-vue2": "^1.1.2",
"@yfwz100/vite-plugin-vue2-i18n": "^1.0.0-2",
"c8": "^7.12.0",
"cross-env": "^7.0.2",
"eslint": "^8.0.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-vue": "^7.16.0",
"jshint": "^2.9.7",
"sass": "^1.54.9",
"sass-loader": "^8.0.2",
"sass": "^1.55.0",
"sass-loader": "^10.1.1",
"string-template-parser": "^1.2.6",
"tslint": "^6.1.2",
"typescript": "~4.8.0",
"vite": "2.9.5",
"vite-plugin-html": "^3.2.0",
"vite-plugin-monaco-editor": "^1.0.10",

View File

@ -30,7 +30,7 @@ By default, n8n runs in the `en` (English) locale. To have run it in a different
```
export N8N_DEFAULT_LOCALE=de
npm run start
pnpm start
```
Output:
@ -464,7 +464,7 @@ When translating a base text file at `/packages/editor-ui/src/plugins/i18n/local
```sh
export N8N_DEFAULT_LOCALE=de
npm run start
pnpm start
```
2. Open another terminal:
@ -472,7 +472,7 @@ npm run start
```sh
export N8N_DEFAULT_LOCALE=de
cd packages/editor-ui
npm run dev
pnpm dev
```
Changing the base text file will trigger a rebuild of the client at `http://localhost:8080`.
@ -485,7 +485,7 @@ When translating a dynamic text file at `/packages/nodes-base/nodes/{node}/trans
```sh
export N8N_DEFAULT_LOCALE=de
npm run start
pnpm start
```
2. Open another terminal:
@ -493,8 +493,8 @@ npm run start
```sh
export N8N_DEFAULT_LOCALE=de
cd packages/nodes-base
npm run build:translations
npm run watch
pnpm build:translations
pnpm watch
```
After changing the dynamic text file:
@ -502,6 +502,6 @@ After changing the dynamic text file:
1. Stop and restart the first terminal.
2. Refresh the browser at `http://localhost:5678`
If a `headerText` section was changed, re-run `npm run build:translations` in `/nodes-base`.
If a `headerText` section was changed, re-run `pnpm build:translations` in `/nodes-base`.
> **Note**: To translate base and dynamic text simultaneously, run three terminals following the steps from both sections (first terminal running only once) and browse `http://localhost:8080`.

View File

@ -19,10 +19,11 @@
"bin": "n8n-node-dev"
},
"scripts": {
"dev": "npm run watch",
"build": "",
"clean": "rimraf dist .turbo",
"dev": "pnpm watch",
"build": "tsc --noEmit",
"build-node-dev": "tsc",
"format": "cd ../.. && node_modules/prettier/bin-prettier.js packages/node-dev/**/**.ts --write",
"format": "prettier **/**.ts --write",
"lint": "eslint .",
"lintfix": "eslint . --fix",
"postpack": "rm -f oclif.manifest.json",
@ -46,11 +47,9 @@
"src/tsconfig-build.json"
],
"devDependencies": {
"@n8n_io/eslint-config": "",
"@oclif/dev-cli": "^1.22.2",
"@types/express": "^4.17.6",
"@types/inquirer": "^6.5.0",
"@types/node": "^16.11.22",
"@types/tmp": "^0.2.0",
"@types/vorpal": "^1.11.0"
},
@ -65,7 +64,6 @@
"oauth-1.0a": "^2.2.6",
"replace-in-file": "^6.0.0",
"request": "^2.88.2",
"tmp-promise": "^3.0.2",
"typescript": "~4.8.0"
"tmp-promise": "^3.0.2"
}
}

View File

@ -13,10 +13,11 @@
"url": "git+https://github.com/n8n-io/n8n.git"
},
"scripts": {
"dev": "npm run watch",
"clean": "rimraf dist .turbo",
"dev": "pnpm watch",
"build": "tsc && gulp build:icons && gulp build:translations",
"build:translations": "gulp build:translations",
"format": "cd ../.. && node_modules/prettier/bin-prettier.js --write \"packages/nodes-base/**/*.{ts,json}\"",
"format": "prettier --write **/*.{ts,json}",
"lint": "tslint -p tsconfig.json -c tslint.json && eslint nodes credentials",
"lintfix": "tslint --fix -p tsconfig.json -c tslint.json && eslint nodes credentials --fix",
"watch": "tsc --watch",
@ -721,7 +722,6 @@
]
},
"devDependencies": {
"@n8n_io/eslint-config": "",
"@types/amqplib": "^0.8.2",
"@types/aws4": "^1.5.1",
"@types/basic-auth": "^1.1.2",
@ -738,7 +738,6 @@
"@types/mailparser": "^2.7.3",
"@types/mime-types": "^2.1.0",
"@types/mssql": "^6.0.2",
"@types/node": "^16.11.22",
"@types/nodemailer": "^6.4.0",
"@types/promise-ftp": "^1.3.4",
"@types/redis": "^2.8.11",

View File

@ -24,10 +24,11 @@
"./*": "./*"
},
"scripts": {
"dev": "npm run watch",
"clean": "rimraf dist .turbo",
"dev": "pnpm watch",
"typecheck": "tsc",
"build": "tsc -p tsconfig.build.json",
"format": "cd ../.. && node_modules/prettier/bin-prettier.js packages/workflow/**/**.ts --write",
"format": "prettier **/**.ts --write",
"lint": "eslint .",
"lintfix": "eslint . --fix",
"watch": "tsc --watch",
@ -38,17 +39,13 @@
"dist/**/*"
],
"devDependencies": {
"@n8n_io/eslint-config": "",
"@types/express": "^4.17.6",
"@types/jmespath": "^0.15.0",
"@types/lodash.get": "^4.4.6",
"@types/lodash.merge": "^4.6.6",
"@types/lodash.set": "^4.3.6",
"@types/luxon": "^2.0.9",
"@types/node": "^16.11.22",
"@types/xml2js": "^0.4.3",
"prettier": "^2.3.2",
"typescript": "~4.8.0"
"@types/xml2js": "^0.4.3"
},
"dependencies": {
"@n8n_io/riot-tmpl": "^1.0.1",

File diff suppressed because one or more lines are too long

22413
pnpm-lock.yaml Normal file

File diff suppressed because it is too large Load Diff

3
pnpm-workspace.yaml Normal file
View File

@ -0,0 +1,3 @@
packages:
- packages/*
- packages/@n8n_io/*

View File

@ -8,7 +8,7 @@ const prettier = path.resolve('node_modules', 'prettier', 'bin-prettier.js');
if (!fs.existsSync(prettier)) {
throw new Error(
[`Prettier not found at path: ${prettier}`, 'Please run `npm i` first'].join('\n'),
[`Prettier not found at path: ${prettier}`, 'Please run `pnpm i` first'].join('\n'),
);
}

View File

@ -18,6 +18,7 @@
"incremental": true,
"declaration": true,
"sourceMap": true,
"preserveSymlinks": true,
"skipLibCheck": true
},
"exclude": ["**/dist/**/*", "**/node_modules/**/*"]

View File

@ -1,6 +1,9 @@
{
"$schema": "https://turborepo.org/schema.json",
"pipeline": {
"clean": {
"cache": false
},
"build": {
"dependsOn": ["^build"]
},