Skip to content
2 changes: 1 addition & 1 deletion packages/api-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ A simple API client using fetch ([Node.js](https://nodejs.org/api/globals.html#f

ℹ️ This is a pure [ESM](https://nodejs.org/api/esm.html#introduction) module.

Run `yarn global add @ffflorian/api-client` or `npm i -g @ffflorian/api-client`.
Run `yarn add @ffflorian/api-client` or `npm i @ffflorian/api-client`.

## Usage

Expand Down
2 changes: 1 addition & 1 deletion packages/api-client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"typescript": "5.9.3"
},
"engines": {
"node": ">= 18.0"
"node": ">= 21"
},
"exports": "./dist/index.js",
"files": [
Expand Down
3 changes: 2 additions & 1 deletion packages/auto-merge/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,14 @@
"vitest": "4.0.16"
},
"engines": {
"node": ">= 18.0"
"node": ">= 21"
},
"exports": "./dist/index.js",
"files": [
"dist"
],
"keywords": [
"auto-merge",
"cli",
"typescript"
],
Expand Down
4 changes: 2 additions & 2 deletions packages/auto-merge/src/AutoMerge.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import fs from 'node:fs';
import fs from 'node:fs/promises';
import path from 'node:path';
import logdown from 'logdown';

Expand All @@ -12,7 +12,7 @@ interface PackageJson {
const __dirname = import.meta.dirname;
const packageJsonPath = path.join(__dirname, '../package.json');

const {name: toolName, version: toolVersion}: PackageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
const {name: toolName, version: toolVersion}: PackageJson = JSON.parse(await fs.readFile(packageJsonPath, 'utf-8'));

export class AutoMerge {
private readonly baseHeaders: Record<string, string>;
Expand Down
12 changes: 7 additions & 5 deletions packages/auto-merge/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/usr/bin/env node

import fs from 'node:fs';
import fs from 'node:fs/promises';
import path from 'node:path';
import readline from 'node:readline';
import {program as commander} from 'commander';
import {cosmiconfigSync} from 'cosmiconfig';
import {cosmiconfig} from 'cosmiconfig';
import logdown from 'logdown';

import {AutoMerge} from './AutoMerge.js';
Expand All @@ -27,7 +27,7 @@ interface PackageJson {
const __dirname = import.meta.dirname;
const packageJsonPath = path.join(__dirname, '../package.json');

const {description, name, version}: PackageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
const {description, name, version}: PackageJson = JSON.parse(await fs.readFile(packageJsonPath, 'utf-8'));

commander
.name(name.replace(/^@[^/]+\//, ''))
Expand All @@ -41,8 +41,10 @@ commander
.parse(process.argv);

const commanderOptions = commander.opts();
const configExplorer = cosmiconfigSync('automerge');
const configResult = commanderOptions.config ? configExplorer.load(commanderOptions.config) : configExplorer.search();
const configExplorer = cosmiconfig('automerge');
const configResult = commanderOptions.config
? await configExplorer.load(commanderOptions.config)
: await configExplorer.search();

if (!configResult || configResult.isEmpty) {
logger.error('No valid configuration file found.');
Expand Down
2 changes: 1 addition & 1 deletion packages/crates-updater/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"typescript": "5.9.3"
},
"engines": {
"node": ">= 18.0"
"node": ">= 21"
},
"exports": "./dist/index.js",
"files": [
Expand Down
7 changes: 4 additions & 3 deletions packages/crates-updater/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node

import fs from 'node:fs';
import fs from 'node:fs/promises';
import path from 'node:path';
import {program as commander} from 'commander';

Expand All @@ -15,10 +15,11 @@ interface PackageJson {
const __dirname = import.meta.dirname;
const packageJsonPath = path.join(__dirname, '../package.json');

const {bin, description, version}: PackageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
const {bin, description, version}: PackageJson = JSON.parse(await fs.readFile(packageJsonPath, 'utf-8'));
const [toolName] = Object.keys(bin);

commander
.name(Object.keys(bin)[0])
.name(toolName)
.description(description)
.arguments('<package>')
.arguments('[packageVersion]')
Expand Down
2 changes: 1 addition & 1 deletion packages/double-linked-list/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"vitest": "4.0.16"
},
"engines": {
"node": ">= 18.0"
"node": ">= 18"
},
"exports": "./dist/index.js",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion packages/electron-icon-generator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"typescript": "5.9.3"
},
"engines": {
"node": ">= 18.0"
"node": ">= 21"
},
"exports": "./dist/index.js",
"files": [
Expand Down
4 changes: 2 additions & 2 deletions packages/electron-icon-generator/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node

import fs from 'node:fs';
import fs from 'node:fs/promises';
import path from 'node:path';
import {program as commander} from 'commander';

Expand All @@ -15,7 +15,7 @@ interface PackageJson {
const __dirname = import.meta.dirname;
const packageJsonPath = path.join(__dirname, '../package.json');

const {description, name, version}: PackageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
const {description, name, version}: PackageJson = JSON.parse(await fs.readFile(packageJsonPath, 'utf-8'));

commander
.name(name.replace(/^@[^/]+\//, ''))
Expand Down
2 changes: 1 addition & 1 deletion packages/electron-info/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
"vitest": "4.0.16"
},
"engines": {
"node": ">= 18.0"
"node": ">= 21"
},
"exports": "./dist/index.js",
"files": [
Expand Down
3 changes: 2 additions & 1 deletion packages/electron-info/src/ElectronInfo.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import {expect, describe, test, beforeEach, beforeAll, afterAll, afterEach} from
import {StatusCodes as HTTP_STATUS} from 'http-status-codes';
import nock from 'nock';

import {ElectronInfo, RawReleaseInfo} from './ElectronInfo.js';
import {ElectronInfo} from './ElectronInfo.js';
import type {RawReleaseInfo} from './interfaces.js';

const __dirname = import.meta.dirname;
const tempDir = path.resolve(__dirname, '.temp');
Expand Down
55 changes: 1 addition & 54 deletions packages/electron-info/src/ElectronInfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,60 +5,7 @@ import logdown from 'logdown';
import semver from 'semver';

import {FileService} from './FileService.js';

export interface RawDeps {
chrome: string;
modules: string;
node: string;
openssl: string;
uv: string;
v8: string;
zlib: string;
}

export interface RawReleaseInfo {
deps?: RawDeps;
name: string;
node_id: string;
npm_dist_tags: string[];
npm_package_name?: string;
prerelease: boolean;
published_at: string;
tag_name: string;
total_downloads: number;
version: string;
}

export interface Options {
/** Enable debug logging. Default: `false`. */
debug?: boolean;
/** If Electron prereleases should be included. Default: `true`. */
electronPrereleases?: boolean;
/** Force downloading the latest release file. Default: `false`. */
forceUpdate?: boolean;
/**
* Include only the latest release. Alias for `limit=1`. Ignores `limit`.
* Default: `false`.
*/
latest?: boolean;
/**
* Limit output of releases. Everything below 1 will be treated as no limit.
* Default: 0.
*/
limit?: number;
/**
* Can be a URL or a local path. Default:
* https://raw.githubusercontent.com/electron/releases/master/lite.json.
*/
releasesUrl?: string;
/**
* Use a custom temporary directory. If not defined, the system's temporary
* directory will be used.
*/
tempDirectory?: string;
/** Use a custom HTTP timeout in milliseconds. Default is `2000`. */
timeout?: number;
}
import type {Options, RawDeps, RawReleaseInfo} from './interfaces.js';

const defaultOptions: Required<Options> = {
debug: false,
Expand Down
2 changes: 1 addition & 1 deletion packages/electron-info/src/FileService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import URL from 'node:url';
import {isAfter as isAfterDate, sub as subtractDate} from 'date-fns';
import logdown from 'logdown';

import type {Options, RawReleaseInfo} from './ElectronInfo.js';
import {HTTPService} from './HTTPService.js';
import type {Options, RawReleaseInfo} from './interfaces.js';

export class FileService {
private readonly httpService: HTTPService;
Expand Down
4 changes: 1 addition & 3 deletions packages/electron-info/src/HTTPService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import fs from 'node:fs/promises';
import {inspect} from 'node:util';
import logdown from 'logdown';

import type {Options, RawReleaseInfo} from './ElectronInfo.js';

export type HTTPOptions = Pick<Options, 'debug' | 'timeout'>;
import type {HTTPOptions, RawReleaseInfo} from './interfaces.js';

export class HTTPService {
private readonly logger: logdown.Logger;
Expand Down
7 changes: 4 additions & 3 deletions packages/electron-info/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#!/usr/bin/env node

import fs from 'node:fs';
import fs from 'node:fs/promises';
import path from 'node:path';
import {program as commander} from 'commander';

import {ElectronInfo, RawDeps, SupportedDependencies} from './ElectronInfo.js';
import {ElectronInfo, SupportedDependencies} from './ElectronInfo.js';
import type {RawDeps} from './interfaces.js';

interface PackageJson {
description: string;
Expand All @@ -15,7 +16,7 @@ interface PackageJson {
const __dirname = import.meta.dirname;
const packageJsonPath = path.join(__dirname, '../package.json');

const {description, name, version}: PackageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
const {description, name, version}: PackageJson = JSON.parse(await fs.readFile(packageJsonPath, 'utf-8'));

let matchedCommand = false;

Expand Down
1 change: 1 addition & 0 deletions packages/electron-info/src/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './ElectronInfo.js';
export * from './interfaces.js';
55 changes: 55 additions & 0 deletions packages/electron-info/src/interfaces.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
export interface RawDeps {
chrome: string;
modules: string;
node: string;
openssl: string;
uv: string;
v8: string;
zlib: string;
}

export interface RawReleaseInfo {
deps?: RawDeps;
name: string;
node_id: string;
npm_dist_tags: string[];
npm_package_name?: string;
prerelease: boolean;
published_at: string;
tag_name: string;
total_downloads: number;
version: string;
}

export interface Options {
/** Enable debug logging. Default: `false`. */
debug?: boolean;
/** If Electron prereleases should be included. Default: `true`. */
electronPrereleases?: boolean;
/** Force downloading the latest release file. Default: `false`. */
forceUpdate?: boolean;
/**
* Include only the latest release. Alias for `limit=1`. Ignores `limit`.
* Default: `false`.
*/
latest?: boolean;
/**
* Limit output of releases. Everything below 1 will be treated as no limit.
* Default: 0.
*/
limit?: number;
/**
* Can be a URL or a local path. Default:
* https://raw.githubusercontent.com/electron/releases/master/lite.json.
*/
releasesUrl?: string;
/**
* Use a custom temporary directory. If not defined, the system's temporary
* directory will be used.
*/
tempDirectory?: string;
/** Use a custom HTTP timeout in milliseconds. Default is `2000`. */
timeout?: number;
}

export type HTTPOptions = Pick<Options, 'debug' | 'timeout'>;
2 changes: 1 addition & 1 deletion packages/exposure-keys/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"typescript": "5.9.3"
},
"engines": {
"node": ">= 18.0"
"node": ">= 18"
},
"files": [
"dist",
Expand Down
2 changes: 1 addition & 1 deletion packages/gh-open/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"vitest": "4.0.16"
},
"engines": {
"node": ">= 18.0"
"node": ">= 21"
},
"exports": "./dist/index.js",
"files": [
Expand Down
4 changes: 2 additions & 2 deletions packages/gh-open/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env node

import fs from 'node:fs/promises';
import path from 'node:path';
import fs from 'node:fs';
import {program as commander} from 'commander';
import {findUp} from 'find-up';
import open from 'open';
Expand All @@ -16,7 +16,7 @@ interface PackageJson {

const __dirname = import.meta.dirname;
const packageJsonPath = path.join(__dirname, '../package.json');
const {description, name, version}: PackageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
const {description, name, version}: PackageJson = JSON.parse(await fs.readFile(packageJsonPath, 'utf-8'));

commander
.name(name.replace(/^@[^/]+\//, ''))
Expand Down
2 changes: 1 addition & 1 deletion packages/https-proxy/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"typescript": "5.9.3"
},
"engines": {
"node": ">= 18.0"
"node": ">= 21"
},
"exports": "./dist/index.js",
"files": [
Expand Down
4 changes: 2 additions & 2 deletions packages/https-proxy/src/cli.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env node

import fs from 'node:fs';
import fs from 'node:fs/promises';
import path from 'node:path';
import {program as commander} from 'commander';

Expand All @@ -15,7 +15,7 @@ interface PackageJson {
const __dirname = import.meta.dirname;
const packageJsonPath = path.join(__dirname, '../package.json');

const {description, name, version}: PackageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
const {description, name, version}: PackageJson = JSON.parse(await fs.readFile(packageJsonPath, 'utf-8'));

commander
.name(name.replace(/^@[^/]+\//, ''))
Expand Down
Loading