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
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
22.12
22.18
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
"license": "MIT",
"type": "module",
"engines": {
"node": ">= 22.12.0"
"node": ">= 22.18.0"
},
"scripts": {
"clean": "node -e \"fs.rmSync('dist', { recursive: true, force: true })\" && lerna exec -- \"node -e \\\"fs.rmSync('dist', { recursive: true, force: true })\\\" && node -e \\\"fs.rmSync('tsconfig.tsbuildinfo', { recursive: true, force: true })\\\"\"",
"build": "tsc -b packages && tsx tools/test-dist",
"build": "tsc -b packages && node tools/test-dist.ts",
"build:watch": "tsc -b packages --watch",
"docs": "yarn build && typedoc",
"lerna:version": "./tools/version.sh",
Expand All @@ -23,10 +23,10 @@
"test": "xvfb-maybe vitest run --project fast --project slow --project slow-verdaccio",
"test:fast": "xvfb-maybe vitest run --project fast",
"test:slow": "xvfb-maybe vitest run --project slow",
"test:verdaccio": "tsx tools/verdaccio/spawn-verdaccio.ts xvfb-maybe vitest run --project slow-verdaccio",
"test:clear": "tsx tools/test-clear",
"postinstall": "husky install && node -e \"try { fs.rmSync('node_modules/.bin/*.ps1', { recursive: true, force: true }) } catch (e) {}\" && tsx ./tools/gen-tsconfigs.ts && tsx ./tools/gen-ts-glue.ts",
"spawn-verdaccio": "tsx tools/verdaccio/spawn-verdaccio.ts"
"test:verdaccio": "node tools/verdaccio/spawn-verdaccio.ts xvfb-maybe vitest run --project slow-verdaccio",
"test:clear": "node tools/test-clear.ts",
"postinstall": "husky install && node -e \"try { fs.rmSync('node_modules/.bin/*.ps1', { recursive: true, force: true }) } catch (e) {}\" && node ./tools/gen-tsconfigs.ts && node ./tools/gen-ts-glue.ts",
"spawn-verdaccio": "node tools/verdaccio/spawn-verdaccio.ts"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.654.0",
Expand Down Expand Up @@ -63,7 +63,6 @@
"parse-author": "^2.0.0",
"semver": "^7.2.1",
"source-map-support": "^0.5.13",
"tsx": "^4.21.0",
"username": "^5.1.0",
"vite": "^7.2.4",
"webpack": "^5.69.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/api/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"semver": "^7.2.1"
},
"engines": {
"node": ">= 22.12.0"
"node": ">= 22.18.0"
},
"funding": [
{
Expand Down
3 changes: 1 addition & 2 deletions packages/api/cli/spec/cli.slow.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@ import { describe, expect, it } from 'vitest';

function runForgeCLI(...extraArgs: string[]): Promise<string> {
const args = [
'tsx',
path.resolve(import.meta.dirname, '../src/electron-forge.ts'),
...extraArgs,
];
return spawn('npx', args);
return spawn('node', args);
}

describe('cli', () => {
Expand Down
3 changes: 1 addition & 2 deletions packages/api/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,14 @@
"find-up": "^5.0.0",
"fs-extra": "^10.0.0",
"got": "^14.0.0",
"jiti": "^2.4.2",
"listr2": "^7.0.2",
"log-symbols": "^4.0.0",
"semver": "^7.2.1",
"source-map-support": "^0.5.13",
"username": "^5.1.0"
},
"engines": {
"node": ">= 22.12.0"
"node": ">= 22.18.0"
},
"funding": [
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
import type { ForgeConfig } from '@electron-forge/shared-types';

const config: ForgeConfig = {
const config = {
buildIdentifier: 'typescript-commonjs',
};

export default config;
module.exports = config;
16 changes: 8 additions & 8 deletions packages/api/core/src/util/forge-config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import path from 'node:path';

import { createRequire } from 'node:module';

import { ForgeConfig, ResolvedForgeConfig } from '@electron-forge/shared-types';
import fs from 'fs-extra';
import { createJiti } from 'jiti';

import { runMutatingHook } from './hook.js';
import PluginInterface from './plugin-interface.js';
Expand Down Expand Up @@ -163,15 +164,14 @@ export default async (dir: string): Promise<ResolvedForgeConfig> => {
) {
const forgeConfigPath = path.resolve(dir, forgeConfig);
try {
let loadFn;
if (['.cts', '.mts', '.ts'].includes(path.extname(forgeConfigPath))) {
const jiti = createJiti(import.meta.filename);
loadFn = jiti.import;
}
// The loaded "config" could potentially be a static forge config, ESM module or async function
let loaded: MaybeESM<ForgeConfig | AsyncForgeConfigGenerator>;
if (loadFn) {
loaded = await loadFn(forgeConfigPath);

// Node.js >= 22.18 supports type stripping natively for .ts and .mts files.
// .cts files must be loaded via require() since they are CommonJS.
if (path.extname(forgeConfigPath) === '.cts') {
const cjsRequire = createRequire(import.meta.url);
loaded = cjsRequire(forgeConfigPath);
} else {
loaded = await import(forgeConfigPath);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/external/create-electron-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"author": "Samuel Attard",
"license": "MIT",
"engines": {
"node": ">= 22.12.0"
"node": ">= 22.18.0"
},
"dependencies": {
"@electron-forge/core-utils": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/maker/appx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"vitest": "^4.0.14"
},
"engines": {
"node": ">= 22.12.0"
"node": ">= 22.18.0"
},
"dependencies": {
"@electron-forge/core-utils": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/maker/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"vitest": "^4.0.14"
},
"engines": {
"node": ">= 22.12.0"
"node": ">= 22.18.0"
},
"dependencies": {
"@electron-forge/shared-types": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/maker/deb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"vitest": "^4.0.14"
},
"engines": {
"node": ">= 22.12.0"
"node": ">= 22.18.0"
},
"dependencies": {
"@electron-forge/maker-base": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/maker/dmg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"vitest": "^4.0.14"
},
"engines": {
"node": ">= 22.12.0"
"node": ">= 22.18.0"
},
"dependencies": {
"@electron-forge/maker-base": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/maker/flatpak/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"vitest": "^4.0.14"
},
"engines": {
"node": ">= 22.12.0"
"node": ">= 22.18.0"
},
"dependencies": {
"@electron-forge/maker-base": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/maker/msix/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"vitest": "^4.0.14"
},
"engines": {
"node": ">= 22.12.0"
"node": ">= 22.18.0"
},
"dependencies": {
"@electron-forge/core-utils": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/maker/pkg/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"vitest": "^4.0.14"
},
"engines": {
"node": ">= 22.12.0"
"node": ">= 22.18.0"
},
"dependencies": {
"@electron-forge/maker-base": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/maker/rpm/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"vitest": "^4.0.14"
},
"engines": {
"node": ">= 22.12.0"
"node": ">= 22.18.0"
},
"dependencies": {
"@electron-forge/maker-base": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/maker/snap/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"vitest": "^4.0.14"
},
"engines": {
"node": ">= 22.12.0"
"node": ">= 22.18.0"
},
"dependencies": {
"@electron-forge/maker-base": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/maker/squirrel/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"exports": "./dist/MakerSquirrel.js",
"typings": "dist/MakerSquirrel.d.ts",
"engines": {
"node": ">= 22.12.0"
"node": ">= 22.18.0"
},
"dependencies": {
"@electron-forge/maker-base": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/maker/wix/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"vitest": "^4.0.14"
},
"engines": {
"node": ">= 22.12.0"
"node": ">= 22.18.0"
},
"dependencies": {
"@electron-forge/core-utils": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/maker/zip/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"vitest": "^4.0.14"
},
"engines": {
"node": ">= 22.12.0"
"node": ">= 22.18.0"
},
"dependencies": {
"@electron-forge/maker-base": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin/auto-unpack-natives/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"exports": "./dist/AutoUnpackNativesPlugin.js",
"typings": "dist/AutoUnpackNativesPlugin.d.ts",
"engines": {
"node": ">= 22.12.0"
"node": ">= 22.18.0"
},
"dependencies": {
"@electron-forge/plugin-base": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"exports": "./dist/Plugin.js",
"typings": "dist/Plugin.d.ts",
"engines": {
"node": ">= 22.12.0"
"node": ">= 22.18.0"
},
"dependencies": {
"@electron-forge/shared-types": "workspace:*"
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin/fuses/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@electron/fuses": "^2.0.0"
},
"engines": {
"node": ">= 22.12.0"
"node": ">= 22.18.0"
},
"dependencies": {
"@electron-forge/plugin-base": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin/local-electron/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"exports": "./dist/LocalElectronPlugin.js",
"typings": "dist/LocalElectronPlugin.d.ts",
"engines": {
"node": ">= 22.12.0"
"node": ">= 22.18.0"
},
"dependencies": {
"@electron-forge/plugin-base": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin/vite/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
"xvfb-maybe": "^0.2.1"
},
"engines": {
"node": ">= 22.12.0"
"node": ">= 22.18.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin/webpack/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"xvfb-maybe": "^0.2.1"
},
"engines": {
"node": ">= 22.12.0"
"node": ">= 22.18.0"
},
"dependencies": {
"@electron-forge/core-utils": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin/webpack/src/Config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Configuration as RawWebpackConfiguration } from 'webpack';
import type { Configuration as RawWebpackConfiguration } from 'webpack';
import WebpackDevServer from 'webpack-dev-server';

import { ConfigurationFactory as WebpackConfigurationFactory } from './WebpackConfig.js';
Expand Down
8 changes: 4 additions & 4 deletions packages/plugin/webpack/src/WebpackConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import path from 'node:path';

import debug from 'debug';
import HtmlWebpackPlugin from 'html-webpack-plugin';
import * as webpack from 'webpack';
import { DefinePlugin, ExternalsPlugin, WebpackPluginInstance } from 'webpack';
import type { WebpackPluginInstance } from 'webpack';
import webpack from 'webpack';
import { merge as webpackMerge } from 'webpack-merge';

import {
Expand Down Expand Up @@ -230,7 +230,7 @@ export default class WebpackConfigGenerator {
filename: 'index.js',
libraryTarget: 'commonjs2',
},
plugins: [new DefinePlugin(this.getDefines())],
plugins: [new webpack.DefinePlugin(this.getDefines())],
node: {
__dirname: false,
__filename: false,
Expand Down Expand Up @@ -419,7 +419,7 @@ export default class WebpackConfigGenerator {
plugins:
target === RendererTarget.ElectronPreload
? []
: [new ExternalsPlugin('commonjs2', externals)],
: [new webpack.ExternalsPlugin('commonjs2', externals)],
};
return webpackMerge(baseConfig, rendererConfig || {}, config);
}
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin/webpack/src/WebpackPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import debug from 'debug';
import glob from 'fast-glob';
import fs from 'fs-extra';
import { PRESET_TIMER } from 'listr2';
import * as webpack from 'webpack';
import webpack from 'webpack';
import WebpackDevServer from 'webpack-dev-server';
import { merge } from 'webpack-merge';

Expand Down
2 changes: 1 addition & 1 deletion packages/plugin/webpack/src/util/AssetRelocatorPatch.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Chunk, Compiler } from 'webpack';
import type { Chunk, Compiler } from 'webpack';

export default class AssetRelocatorPatch {
private readonly isProd: boolean;
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin/webpack/src/util/ElectronForgeLogging.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Tab } from '@electron-forge/web-multi-logger';
import { Compiler } from 'webpack';
import type { Compiler } from 'webpack';

const pluginName = 'ElectronForgeLogging';

Expand Down
2 changes: 1 addition & 1 deletion packages/plugin/webpack/src/util/processConfig.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Configuration } from 'webpack';
import type { Configuration } from 'webpack';

import { ConfigurationFactory } from '../WebpackConfig.js';

Expand Down
2 changes: 1 addition & 1 deletion packages/publisher/base-static/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"vitest": "^4.0.14"
},
"engines": {
"node": ">= 22.12.0"
"node": ">= 22.18.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/publisher/base/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"vitest": "^4.0.14"
},
"engines": {
"node": ">= 22.12.0"
"node": ">= 22.18.0"
},
"publishConfig": {
"access": "public"
Expand Down
2 changes: 1 addition & 1 deletion packages/publisher/bitbucket/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"exports": "./dist/PublisherBitbucket.js",
"typings": "dist/PublisherBitbucket.d.ts",
"engines": {
"node": ">= 22.12.0"
"node": ">= 22.18.0"
},
"dependencies": {
"@electron-forge/publisher-base": "workspace:*",
Expand Down
2 changes: 1 addition & 1 deletion packages/publisher/electron-release-server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"vitest": "^4.0.14"
},
"engines": {
"node": ">= 22.12.0"
"node": ">= 22.18.0"
},
"dependencies": {
"@electron-forge/publisher-base": "workspace:*",
Expand Down
Loading
Loading