forked from n8n-io/n8n
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Switch from npm to pnpm (n8n-io#4429)
- Loading branch information
Showing
33 changed files
with
22,666 additions
and
72,016 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,25 +18,27 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: pnpm/[email protected] | ||
|
||
- 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,30 +18,32 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: pnpm/[email protected] | ||
|
||
- 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/[email protected] | ||
with: | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,29 +15,32 @@ jobs: | |
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- uses: pnpm/[email protected] | ||
|
||
- 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 }} | ||
|
||
- name: Run ESLint on changes only | ||
env: | ||
ESLINT_PLUGIN_DIFF_COMMIT: ${{ github.event.pull_request.base.ref }} | ||
run: npm run lint | ||
run: pnpm lint |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,12 +26,14 @@ jobs: | |
repository: n8n-io/test-workflows | ||
path: test-workflows | ||
|
||
- uses: pnpm/[email protected] | ||
|
||
- 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 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 [email protected] | ||
|
||
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 | ||
|
Oops, something went wrong.