import {satisfies} from 'semver';
import {showWarning} from '../helpers/common/message-helper.js';

const SUPPORTED_VERSION = '^24.7.0';

export const validateNodeVersion = (processVersion: string) => {
	const isVersionSupported = satisfies(processVersion, SUPPORTED_VERSION);

	if (!isVersionSupported) {
		showWarning(`[WARNING]: Using unsupported node version - ${processVersion}. Supported node version is "${SUPPORTED_VERSION}". Some of the features may not be working as expected.`);
	}
};