Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/api-client/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ Simple API client using fetch ([Node.js](https://nodejs.org/api/globals.html#fet

## Prerequisites

- [Node.js](https://nodejs.org) >= 14
- npm (preinstalled) or [yarn](https://classic.yarnpkg.com)
- [Node.js](https://nodejs.org)
- npm (preinstalled) or [yarn](https://yarnpkg.com)

## Installation

ℹ️ 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
4 changes: 2 additions & 2 deletions packages/auto-merge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Automatically merge (and optionally approve) all GitHub PRs which match a specif

## Prerequisites

- [Node.js](https://nodejs.org) >= 14
- npm (preinstalled) or [yarn](https://classic.yarnpkg.com)
- [Node.js](https://nodejs.org)
- npm (preinstalled) or [yarn](https://yarnpkg.com)

## Installation

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.6"
},
"engines": {
"node": ">= 18.0"
"node": ">= 21"
},
"exports": "./dist/index.js",
"files": [
"dist"
],
"keywords": [
"auto-merge",
"cli",
"typescript"
],
Expand Down
7 changes: 3 additions & 4 deletions packages/auto-merge/src/AutoMerge.ts
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
import fs from 'node:fs';
import fs from 'node:fs/promises';
import path from 'node:path';
import logdown from 'logdown';

import type {AutoMergeConfig, ActionResult, GitHubPullRequest, Repository, RepositoryResult} from './types/index.js';

interface PackageJson {
bin: Record<string, string>;
name: string;
version: string;
}

const __dirname = import.meta.dirname;
const packageJsonPath = path.join(__dirname, '../package.json');

const {bin, version: toolVersion}: PackageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'));
const toolName = Object.keys(bin)[0];
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
4 changes: 2 additions & 2 deletions packages/crates-updater/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Check your [Rust packages](https://crates.io) for updates.

## Prerequisites

- [Node.js](https://nodejs.org) >= 14
- npm (preinstalled) or [yarn](https://classic.yarnpkg.com)
- [Node.js](https://nodejs.org)
- npm (preinstalled) or [yarn](https://yarnpkg.com)

## Installation

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": ">= 18"
},
"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
4 changes: 2 additions & 2 deletions packages/double-linked-list/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ A linked list in which every element knows about its predecessor and its success

## Prerequisites

- [Node.js](https://nodejs.org) >= 14
- npm (preinstalled) or [yarn](https://classic.yarnpkg.com)
- [Node.js](https://nodejs.org)
- npm (preinstalled) or [yarn](https://yarnpkg.com)

## Installation

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.6"
},
"engines": {
"node": ">= 18.0"
"node": ">= 18"
},
"exports": "./dist/index.js",
"files": [
Expand Down
4 changes: 2 additions & 2 deletions packages/electron-icon-generator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ Based on https://github.com/jaretburkett/electron-icon-maker.

## Prerequisites

- [Node.js](https://nodejs.org) >= 14
- npm (preinstalled) or [yarn](https://classic.yarnpkg.com)
- [Node.js](https://nodejs.org)
- npm (preinstalled) or [yarn](https://yarnpkg.com)

## Installation

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": ">= 18"
},
"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
4 changes: 2 additions & 2 deletions packages/electron-info/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Get useful data about Electron releases. Uses [electron-releases](https://github

## Prerequisites

- [Node.js](https://nodejs.org) >= 14
- npm (preinstalled) or [yarn](https://classic.yarnpkg.com)
- [Node.js](https://nodejs.org)
- npm (preinstalled) or [yarn](https://yarnpkg.com)

## Installation

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.6"
},
"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';
Loading