Skip to content
Merged
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
2 changes: 1 addition & 1 deletion example/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"url": "git+https://github.com/SpacingBat3/ReForged.git"
},
"devDependencies": {
"@electron-forge/cli": "^7.1.0",
"@electron-forge/cli": "^7.1.0 || ^8.0.1",
"@reforged/maker-appimage": "file:../makers/appimage",
"@reforged/plugin-launcher": "file:../plugins/launcher",
"electron": "latest"
Expand Down
2 changes: 1 addition & 1 deletion makers/appimage/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"author": "SpacingBat3 <git@spacingbat3.anonaddy.com> (https://github.com/SpacingBat3)",
"license": "ISC",
"dependencies": {
"@electron-forge/maker-base": "^6.0.0 || ^7.0.0",
"@electron-forge/maker-base": "^6.0.0 || ^7.0.0 || ^8.0.1",
"@reforged/maker-types": "^2.2.0",
"@spacingbat3/lss": "^1.0.0",
"semver": "^7.3.8"
Expand Down
5 changes: 1 addition & 4 deletions makers/appimage/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,4 @@ export type {
MakerAppImageConfigOptions
} from "../types/config.d.ts";

export type {
ForgeArch,
MakerMeta
} from "./utils.js";
export type { MakerMeta } from "./utils.js";
4 changes: 1 addition & 3 deletions makers/appimage/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import type { MakerOptions } from "@electron-forge/maker-base"
import type { SemVer } from "semver"

type AppImageArch = "x86_64"|"aarch64"|"armhf"|"i686";
export type ForgeArch = "x64" | "arm64" | "armv7l" | "ia32" | "mips64el" | "universal";

interface PackageJSON extends Record<string,unknown> {
name?: string;
Expand All @@ -29,7 +28,6 @@ type MixedMut<T> = T & ReadonlyAll<T>;

export interface MakerMeta extends MixedMut<MakerOptions> {
packageJSON: PackageJSON;
targetArch: ForgeArch;
}

/**
Expand Down Expand Up @@ -285,7 +283,7 @@ export async function joinFiles(...filesAndBuffers:readonly(string|ArrayBufferLi
/**
* Maps Node.js architecture to the AppImage-friendly format.
*/
export const mapArch:Readonly<Partial<Record<ForgeArch,AppImageArch>>> = Object.freeze({
export const mapArch:Readonly<Partial<Record<MakerMeta["targetArch"],AppImageArch>>> = Object.freeze({
x64: "x86_64",
ia32: "i686",
arm64: "aarch64",
Expand Down
21 changes: 11 additions & 10 deletions makers/appimage/test/make.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@ import { resolve } from "node:path";
import { execFile } from "node:child_process";
import { promisify } from "node:util";
import { tmpdir } from "node:os";


import assert from "node:assert";
import { MakerAppImage } from "@reforged/maker-appimage";

import type { ForgeArch } from "@reforged/maker-appimage";
import { MakerAppImage } from "@reforged/maker-appimage";
import type { IconSet } from "@reforged/maker-types";
import type { MakerOptions } from "@electron-forge/maker-base";

type ForgeArch = MakerOptions["targetArch"];
type ForgePlatform = MakerOptions["targetPlatform"];

const icon: IconSet = {};

Expand All @@ -55,7 +56,7 @@ for(const str of icons)

/** Maker to test. */
const maker = new MakerAppImage({ options: { icon } });
await maker.prepareConfig(process.arch);
await maker.prepareConfig(process.arch as ForgeArch);

// Mock app metadata
const
Expand Down Expand Up @@ -114,7 +115,7 @@ suites.push(describe("MakerAppimage is working correctly", {skip}, async() => {
dir: await mockAppPath,
makeDir: await mockMkPath,
targetArch: process.arch as ForgeArch,
targetPlatform: process.platform
targetPlatform: process.platform as ForgePlatform
}).then(([path]) => path);
await assert.doesNotReject(AppImageDir);
assert.strictEqual(
Expand Down Expand Up @@ -248,15 +249,15 @@ suites.push(describe("MakerAppImage fails for invalid cases", {skip}, () => {

it("rejects when configured binary name does not exist", async() => {
const badmaker = new MakerAppImage({options:{bin:"invalid"}});
await badmaker.prepareConfig(process.arch);
await badmaker.prepareConfig(process.arch as ForgeArch);
const failedAttempt = badmaker.make({
packageJSON,
forgeConfig,
appName: packageJSON.productName,
dir: await mockAppPath,
makeDir: await mockMkPath,
targetArch: process.arch as ForgeArch,
targetPlatform: process.platform
targetPlatform: process.platform as ForgePlatform
});
await assert.rejects(failedAttempt, err.noExecutable);
})
Expand All @@ -269,7 +270,7 @@ suites.push(describe("MakerAppImage fails for invalid cases", {skip}, () => {
dir: resolve("/","invalid"),
makeDir: await mockMkPath,
targetArch: process.arch as ForgeArch,
targetPlatform: process.platform
targetPlatform: process.platform as ForgePlatform
});
await assert.rejects(failedAttempt, err.noExecutable);
})
Expand All @@ -282,7 +283,7 @@ suites.push(describe("MakerAppImage fails for invalid cases", {skip}, () => {
dir: await mockAppPath,
makeDir: await mockMkPath,
targetArch: "wrong-arch" as ForgeArch,
targetPlatform: process.platform
targetPlatform: process.platform as ForgePlatform
});
await assert.rejects(failedAttempt, err.unsupportedArch);
})
Expand Down
Loading
Loading