mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-17 01:56:46 +00:00
refactor: Delete a lot of unused and duplicate code in Server and WebhookServer (#5080)
* store n8n version string in a const and use that everywhere * reduce code duplication between Server and WebhookServer * unify redis checks * fix linting
This commit is contained in:
committed by
GitHub
parent
b67f803cbe
commit
8b19fdd5f0
@@ -1,8 +1,14 @@
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
|
||||
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
|
||||
/* eslint-disable @typescript-eslint/naming-convention */
|
||||
import { readFileSync } from 'fs';
|
||||
import { resolve, join, dirname } from 'path';
|
||||
import { RESPONSE_ERROR_MESSAGES as CORE_RESPONSE_ERROR_MESSAGES, UserSettings } from 'n8n-core';
|
||||
import {
|
||||
n8n,
|
||||
RESPONSE_ERROR_MESSAGES as CORE_RESPONSE_ERROR_MESSAGES,
|
||||
UserSettings,
|
||||
} from 'n8n-core';
|
||||
import { jsonParse } from 'n8n-workflow';
|
||||
|
||||
const { NODE_ENV, E2E_TESTS } = process.env;
|
||||
export const inProduction = NODE_ENV === 'production';
|
||||
@@ -16,6 +22,10 @@ export const NODES_BASE_DIR = join(CLI_DIR, '..', 'nodes-base');
|
||||
export const GENERATED_STATIC_DIR = join(UserSettings.getUserHome(), '.cache/n8n/public');
|
||||
export const EDITOR_UI_DIST_DIR = join(dirname(require.resolve('n8n-editor-ui')), 'dist');
|
||||
|
||||
export const N8N_VERSION = jsonParse<n8n.PackageJson>(
|
||||
readFileSync(join(CLI_DIR, 'package.json'), 'utf8'),
|
||||
).version;
|
||||
|
||||
export const NODE_PACKAGE_PREFIX = 'n8n-nodes-';
|
||||
|
||||
export const STARTER_TEMPLATE_NAME = `${NODE_PACKAGE_PREFIX}starter`;
|
||||
|
||||
Reference in New Issue
Block a user