From b499d27f08079cafa46d0092cda260472ea539e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E0=A4=95=E0=A4=BE=E0=A4=B0=E0=A4=A4=E0=A5=8B=E0=A4=AB?= =?UTF-8?q?=E0=A5=8D=E0=A4=AB=E0=A5=87=E0=A4=B2=E0=A4=B8=E0=A5=8D=E0=A4=95?= =?UTF-8?q?=E0=A5=8D=E0=A4=B0=E0=A4=BF=E0=A4=AA=E0=A5=8D=E0=A4=9F=E2=84=A2?= Date: Mon, 8 May 2023 11:46:20 +0000 Subject: [PATCH] feat(core): Update config defaults for for v1 (no-changelog) (#6196) feat(core): Change config defaults when the release is V1 --- packages/cli/src/config/schema.ts | 5 +++-- packages/cli/src/constants.ts | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/cli/src/config/schema.ts b/packages/cli/src/config/schema.ts index 1a9413167f..4e06fc2a48 100644 --- a/packages/cli/src/config/schema.ts +++ b/packages/cli/src/config/schema.ts @@ -4,6 +4,7 @@ import path from 'path'; import convict from 'convict'; import { UserSettings } from 'n8n-core'; import { jsonParse } from 'n8n-workflow'; +import { IS_V1_RELEASE } from '@/constants'; convict.addFormat({ name: 'nodes-list', @@ -230,7 +231,7 @@ export const schema = { process: { doc: 'In what process workflows should be executed', format: ['main', 'own'] as const, - default: 'own', + default: IS_V1_RELEASE ? 'main' : 'own', env: 'EXECUTIONS_PROCESS', }, @@ -943,7 +944,7 @@ export const schema = { push: { backend: { format: ['sse', 'websocket'] as const, - default: 'sse', + default: IS_V1_RELEASE ? 'websocket' : 'sse', env: 'N8N_PUSH_BACKEND', doc: 'Backend to use for push notifications', }, diff --git a/packages/cli/src/constants.ts b/packages/cli/src/constants.ts index 6d6ebab385..818364bc5c 100644 --- a/packages/cli/src/constants.ts +++ b/packages/cli/src/constants.ts @@ -3,6 +3,7 @@ /* eslint-disable @typescript-eslint/naming-convention */ import { readFileSync } from 'fs'; import { resolve, join, dirname } from 'path'; +import { major } from 'semver'; import type { n8n } from 'n8n-core'; import { RESPONSE_ERROR_MESSAGES as CORE_RESPONSE_ERROR_MESSAGES, UserSettings } from 'n8n-core'; import { jsonParse } from 'n8n-workflow'; @@ -29,6 +30,7 @@ export function getN8nPackageJson() { export const START_NODES = ['n8n-nodes-base.start', 'n8n-nodes-base.manualTrigger']; export const N8N_VERSION = getN8nPackageJson().version; +export const IS_V1_RELEASE = major(N8N_VERSION) > 0; export const NODE_PACKAGE_PREFIX = 'n8n-nodes-';