mirror of
https://github.com/actualbudget/actual.git
synced 2026-10-12 02:10:19 +00:00
chore(api): migrate node version validation to TypeScript (#8461)
* chore(api): migrate node version validation to TypeScript * [autofix.ci] apply automated fixes * docs: add release note for API TypeScript migration * Update upcoming-release-notes/wip-chore-api-migrate-node-version-validation-to-typescript.md Co-authored-by: Matiss Janis Aboltins <[email protected]> * Update upcoming-release-notes/wip-chore-api-migrate-node-version-validation-to-typescript.md Co-authored-by: Matiss Janis Aboltins <[email protected]> --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> Co-authored-by: Matiss Janis Aboltins <[email protected]>
This commit is contained in:
co-authored by
Matiss Janis Aboltins
autofix-ci[bot]
parent
b37bfe2cb7
commit
0146471d0e
@@ -30,7 +30,7 @@
|
||||
"path": "../crdt"
|
||||
}
|
||||
],
|
||||
"include": ["."],
|
||||
"include": [".", "package.json"],
|
||||
"exclude": [
|
||||
"**/node_modules/*",
|
||||
"dist",
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
import { satisfies } from 'compare-versions';
|
||||
|
||||
import * as packageJson from './package.json';
|
||||
|
||||
export function validateNodeVersion() {
|
||||
if (process?.versions?.node) {
|
||||
const nodeVersion = process?.versions?.node;
|
||||
const minimumNodeVersion = packageJson.engines.node;
|
||||
|
||||
if (!satisfies(nodeVersion, minimumNodeVersion)) {
|
||||
throw new Error(
|
||||
`@actual-app/api requires a node version ${minimumNodeVersion}. Found that you are using: ${nodeVersion}. Please upgrade to a higher version`,
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
import { satisfies } from 'compare-versions';
|
||||
|
||||
import * as packageJson from './package.json';
|
||||
|
||||
export function validateNodeVersion(): void {
|
||||
const nodeVersion = process.versions.node;
|
||||
const minimumNodeVersion = packageJson.engines.node;
|
||||
|
||||
if (!satisfies(nodeVersion, minimumNodeVersion)) {
|
||||
throw new Error(
|
||||
`@actual-app/api requires a node version ${minimumNodeVersion}. Found that you are using: ${nodeVersion}. Please upgrade to a higher version`,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
---
|
||||
category: Maintenance
|
||||
authors: [Ehtasham-Yasin]
|
||||
---
|
||||
|
||||
Migrate node version validation to TypeScript
|
||||
Reference in New Issue
Block a user